@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,42 +1,56 @@
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
  // ../../node_modules/@lit/reactive-element/css-tag.js
14
28
  class n {
15
- constructor(t2, e2, o2) {
16
- if (this._$cssResult$ = true, o2 !== s)
29
+ constructor(t, e, o) {
30
+ if (this._$cssResult$ = true, o !== s)
17
31
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
18
- this.cssText = t2, this.t = e2;
32
+ this.cssText = t, this.t = e;
19
33
  }
20
34
  get styleSheet() {
21
- let t2 = this.o;
22
- const s2 = this.t;
23
- if (e && t2 === undefined) {
24
- const e2 = s2 !== undefined && s2.length === 1;
25
- e2 && (t2 = o.get(s2)), t2 === undefined && ((this.o = t2 = new CSSStyleSheet).replaceSync(this.cssText), e2 && o.set(s2, t2));
35
+ let t = this.o;
36
+ const s = this.t;
37
+ if (e && t === undefined) {
38
+ const e = s !== undefined && s.length === 1;
39
+ e && (t = o.get(s)), t === undefined && ((this.o = t = new CSSStyleSheet).replaceSync(this.cssText), e && o.set(s, t));
26
40
  }
27
- return t2;
41
+ return t;
28
42
  }
29
43
  toString() {
30
44
  return this.cssText;
31
45
  }
32
46
  }
33
- var t, e, s, o, r = (t2) => new n(typeof t2 == "string" ? t2 : t2 + "", undefined, s), S = (s2, o2) => {
47
+ var t, e, s, o, r = (t) => new n(typeof t == "string" ? t : t + "", undefined, s), S = (s, o) => {
34
48
  if (e)
35
- s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet);
49
+ s.adoptedStyleSheets = o.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
36
50
  else
37
- for (const e2 of o2) {
38
- const o3 = document.createElement("style"), n2 = t.litNonce;
39
- n2 !== undefined && o3.setAttribute("nonce", n2), o3.textContent = e2.cssText, s2.appendChild(o3);
51
+ for (const e of o) {
52
+ const o = document.createElement("style"), n = t.litNonce;
53
+ n !== undefined && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
40
54
  }
41
55
  }, c;
42
56
  var init_css_tag = __esm(() => {
@@ -44,16 +58,16 @@ var init_css_tag = __esm(() => {
44
58
  e = t.ShadowRoot && (t.ShadyCSS === undefined || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
45
59
  s = Symbol();
46
60
  o = new WeakMap;
47
- c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
48
- let e2 = "";
49
- for (const s2 of t3.cssRules)
50
- e2 += s2.cssText;
51
- return r(e2);
52
- })(t2) : t2;
61
+ c = e ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((t) => {
62
+ let e = "";
63
+ for (const s of t.cssRules)
64
+ e += s.cssText;
65
+ return r(e);
66
+ })(t) : t;
53
67
  });
54
68
 
55
69
  // ../../node_modules/@lit/reactive-element/reactive-element.js
56
- var i2, e2, h, r2, o2, n2, a, c2, l, p, d = (t2, s2) => t2, u, f = (t2, s2) => !i2(t2, s2), b, y;
70
+ var i2, e2, h, r2, o2, n2, a, c2, l, p, d = (t, s) => t, u, f = (t, s) => !i2(t, s), b, y;
57
71
  var init_reactive_element = __esm(() => {
58
72
  init_css_tag();
59
73
  init_css_tag();
@@ -62,175 +76,175 @@ var init_reactive_element = __esm(() => {
62
76
  c2 = a.trustedTypes;
63
77
  l = c2 ? c2.emptyScript : "";
64
78
  p = a.reactiveElementPolyfillSupport;
65
- u = { toAttribute(t2, s2) {
66
- switch (s2) {
79
+ u = { toAttribute(t, s) {
80
+ switch (s) {
67
81
  case Boolean:
68
- t2 = t2 ? l : null;
82
+ t = t ? l : null;
69
83
  break;
70
84
  case Object:
71
85
  case Array:
72
- t2 = t2 == null ? t2 : JSON.stringify(t2);
86
+ t = t == null ? t : JSON.stringify(t);
73
87
  }
74
- return t2;
75
- }, fromAttribute(t2, s2) {
76
- let i3 = t2;
77
- switch (s2) {
88
+ return t;
89
+ }, fromAttribute(t, s) {
90
+ let i = t;
91
+ switch (s) {
78
92
  case Boolean:
79
- i3 = t2 !== null;
93
+ i = t !== null;
80
94
  break;
81
95
  case Number:
82
- i3 = t2 === null ? null : Number(t2);
96
+ i = t === null ? null : Number(t);
83
97
  break;
84
98
  case Object:
85
99
  case Array:
86
100
  try {
87
- i3 = JSON.parse(t2);
88
- } catch (t3) {
89
- i3 = null;
101
+ i = JSON.parse(t);
102
+ } catch (t) {
103
+ i = null;
90
104
  }
91
105
  }
92
- return i3;
106
+ return i;
93
107
  } };
94
108
  b = { attribute: true, type: String, converter: u, reflect: false, useDefault: false, hasChanged: f };
95
109
  Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap;
96
110
  y = class y extends HTMLElement {
97
- static addInitializer(t2) {
98
- this._$Ei(), (this.l ??= []).push(t2);
111
+ static addInitializer(t) {
112
+ this._$Ei(), (this.l ??= []).push(t);
99
113
  }
100
114
  static get observedAttributes() {
101
115
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
102
116
  }
103
- static createProperty(t2, s2 = b) {
104
- 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) {
105
- const i3 = Symbol(), h2 = this.getPropertyDescriptor(t2, i3, s2);
106
- h2 !== undefined && e2(this.prototype, t2, h2);
117
+ static createProperty(t, s = b) {
118
+ 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) {
119
+ const i = Symbol(), h = this.getPropertyDescriptor(t, i, s);
120
+ h !== undefined && e2(this.prototype, t, h);
107
121
  }
108
122
  }
109
- static getPropertyDescriptor(t2, s2, i3) {
110
- const { get: e3, set: r3 } = h(this.prototype, t2) ?? { get() {
111
- return this[s2];
112
- }, set(t3) {
113
- this[s2] = t3;
123
+ static getPropertyDescriptor(t, s, i) {
124
+ const { get: e, set: r } = h(this.prototype, t) ?? { get() {
125
+ return this[s];
126
+ }, set(t) {
127
+ this[s] = t;
114
128
  } };
115
- return { get: e3, set(s3) {
116
- const h2 = e3?.call(this);
117
- r3?.call(this, s3), this.requestUpdate(t2, h2, i3);
129
+ return { get: e, set(s) {
130
+ const h = e?.call(this);
131
+ r?.call(this, s), this.requestUpdate(t, h, i);
118
132
  }, configurable: true, enumerable: true };
119
133
  }
120
- static getPropertyOptions(t2) {
121
- return this.elementProperties.get(t2) ?? b;
134
+ static getPropertyOptions(t) {
135
+ return this.elementProperties.get(t) ?? b;
122
136
  }
123
137
  static _$Ei() {
124
138
  if (this.hasOwnProperty(d("elementProperties")))
125
139
  return;
126
- const t2 = n2(this);
127
- t2.finalize(), t2.l !== undefined && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties);
140
+ const t = n2(this);
141
+ t.finalize(), t.l !== undefined && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
128
142
  }
129
143
  static finalize() {
130
144
  if (this.hasOwnProperty(d("finalized")))
131
145
  return;
132
146
  if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
133
- const t3 = this.properties, s2 = [...r2(t3), ...o2(t3)];
134
- for (const i3 of s2)
135
- this.createProperty(i3, t3[i3]);
147
+ const t = this.properties, s = [...r2(t), ...o2(t)];
148
+ for (const i of s)
149
+ this.createProperty(i, t[i]);
136
150
  }
137
- const t2 = this[Symbol.metadata];
138
- if (t2 !== null) {
139
- const s2 = litPropertyMetadata.get(t2);
140
- if (s2 !== undefined)
141
- for (const [t3, i3] of s2)
142
- this.elementProperties.set(t3, i3);
151
+ const t = this[Symbol.metadata];
152
+ if (t !== null) {
153
+ const s = litPropertyMetadata.get(t);
154
+ if (s !== undefined)
155
+ for (const [t, i] of s)
156
+ this.elementProperties.set(t, i);
143
157
  }
144
158
  this._$Eh = new Map;
145
- for (const [t3, s2] of this.elementProperties) {
146
- const i3 = this._$Eu(t3, s2);
147
- i3 !== undefined && this._$Eh.set(i3, t3);
159
+ for (const [t, s] of this.elementProperties) {
160
+ const i = this._$Eu(t, s);
161
+ i !== undefined && this._$Eh.set(i, t);
148
162
  }
149
163
  this.elementStyles = this.finalizeStyles(this.styles);
150
164
  }
151
- static finalizeStyles(s2) {
152
- const i3 = [];
153
- if (Array.isArray(s2)) {
154
- const e3 = new Set(s2.flat(1 / 0).reverse());
155
- for (const s3 of e3)
156
- i3.unshift(c(s3));
165
+ static finalizeStyles(s) {
166
+ const i = [];
167
+ if (Array.isArray(s)) {
168
+ const e = new Set(s.flat(1 / 0).reverse());
169
+ for (const s of e)
170
+ i.unshift(c(s));
157
171
  } else
158
- s2 !== undefined && i3.push(c(s2));
159
- return i3;
172
+ s !== undefined && i.push(c(s));
173
+ return i;
160
174
  }
161
- static _$Eu(t2, s2) {
162
- const i3 = s2.attribute;
163
- return i3 === false ? undefined : typeof i3 == "string" ? i3 : typeof t2 == "string" ? t2.toLowerCase() : undefined;
175
+ static _$Eu(t, s) {
176
+ const i = s.attribute;
177
+ return i === false ? undefined : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : undefined;
164
178
  }
165
179
  constructor() {
166
180
  super(), this._$Ep = undefined, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
167
181
  }
168
182
  _$Ev() {
169
- this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = new Map, this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this));
183
+ this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = new Map, this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
170
184
  }
171
- addController(t2) {
172
- (this._$EO ??= new Set).add(t2), this.renderRoot !== undefined && this.isConnected && t2.hostConnected?.();
185
+ addController(t) {
186
+ (this._$EO ??= new Set).add(t), this.renderRoot !== undefined && this.isConnected && t.hostConnected?.();
173
187
  }
174
- removeController(t2) {
175
- this._$EO?.delete(t2);
188
+ removeController(t) {
189
+ this._$EO?.delete(t);
176
190
  }
177
191
  _$E_() {
178
- const t2 = new Map, s2 = this.constructor.elementProperties;
179
- for (const i3 of s2.keys())
180
- this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]);
181
- t2.size > 0 && (this._$Ep = t2);
192
+ const t = new Map, s = this.constructor.elementProperties;
193
+ for (const i of s.keys())
194
+ this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
195
+ t.size > 0 && (this._$Ep = t);
182
196
  }
183
197
  createRenderRoot() {
184
- const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
185
- return S(t2, this.constructor.elementStyles), t2;
198
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
199
+ return S(t, this.constructor.elementStyles), t;
186
200
  }
187
201
  connectedCallback() {
188
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.());
202
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t) => t.hostConnected?.());
189
203
  }
190
- enableUpdating(t2) {}
204
+ enableUpdating(t) {}
191
205
  disconnectedCallback() {
192
- this._$EO?.forEach((t2) => t2.hostDisconnected?.());
206
+ this._$EO?.forEach((t) => t.hostDisconnected?.());
193
207
  }
194
- attributeChangedCallback(t2, s2, i3) {
195
- this._$AK(t2, i3);
208
+ attributeChangedCallback(t, s, i) {
209
+ this._$AK(t, i);
196
210
  }
197
- _$ET(t2, s2) {
198
- const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3);
199
- if (e3 !== undefined && i3.reflect === true) {
200
- const h2 = (i3.converter?.toAttribute !== undefined ? i3.converter : u).toAttribute(s2, i3.type);
201
- this._$Em = t2, h2 == null ? this.removeAttribute(e3) : this.setAttribute(e3, h2), this._$Em = null;
211
+ _$ET(t, s) {
212
+ const i = this.constructor.elementProperties.get(t), e = this.constructor._$Eu(t, i);
213
+ if (e !== undefined && i.reflect === true) {
214
+ const h = (i.converter?.toAttribute !== undefined ? i.converter : u).toAttribute(s, i.type);
215
+ this._$Em = t, h == null ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
202
216
  }
203
217
  }
204
- _$AK(t2, s2) {
205
- const i3 = this.constructor, e3 = i3._$Eh.get(t2);
206
- if (e3 !== undefined && this._$Em !== e3) {
207
- const t3 = i3.getPropertyOptions(e3), h2 = typeof t3.converter == "function" ? { fromAttribute: t3.converter } : t3.converter?.fromAttribute !== undefined ? t3.converter : u;
208
- this._$Em = e3;
209
- const r3 = h2.fromAttribute(s2, t3.type);
210
- this[e3] = r3 ?? this._$Ej?.get(e3) ?? r3, this._$Em = null;
218
+ _$AK(t, s) {
219
+ const i = this.constructor, e = i._$Eh.get(t);
220
+ if (e !== undefined && this._$Em !== e) {
221
+ const t = i.getPropertyOptions(e), h = typeof t.converter == "function" ? { fromAttribute: t.converter } : t.converter?.fromAttribute !== undefined ? t.converter : u;
222
+ this._$Em = e;
223
+ const r = h.fromAttribute(s, t.type);
224
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
211
225
  }
212
226
  }
213
- requestUpdate(t2, s2, i3) {
214
- if (t2 !== undefined) {
215
- const e3 = this.constructor, h2 = this[t2];
216
- 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))))
227
+ requestUpdate(t, s, i) {
228
+ if (t !== undefined) {
229
+ const e = this.constructor, h = this[t];
230
+ 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))))
217
231
  return;
218
- this.C(t2, s2, i3);
232
+ this.C(t, s, i);
219
233
  }
220
234
  this.isUpdatePending === false && (this._$ES = this._$EP());
221
235
  }
222
- C(t2, s2, { useDefault: i3, reflect: e3, wrapped: h2 }, r3) {
223
- 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));
236
+ C(t, s, { useDefault: i, reflect: e, wrapped: h }, r) {
237
+ 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));
224
238
  }
225
239
  async _$EP() {
226
240
  this.isUpdatePending = true;
227
241
  try {
228
242
  await this._$ES;
229
- } catch (t3) {
230
- Promise.reject(t3);
243
+ } catch (t) {
244
+ Promise.reject(t);
231
245
  }
232
- const t2 = this.scheduleUpdate();
233
- return t2 != null && await t2, !this.isUpdatePending;
246
+ const t = this.scheduleUpdate();
247
+ return t != null && await t, !this.isUpdatePending;
234
248
  }
235
249
  scheduleUpdate() {
236
250
  return this.performUpdate();
@@ -240,29 +254,29 @@ var init_reactive_element = __esm(() => {
240
254
  return;
241
255
  if (!this.hasUpdated) {
242
256
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
243
- for (const [t4, s3] of this._$Ep)
244
- this[t4] = s3;
257
+ for (const [t, s] of this._$Ep)
258
+ this[t] = s;
245
259
  this._$Ep = undefined;
246
260
  }
247
- const t3 = this.constructor.elementProperties;
248
- if (t3.size > 0)
249
- for (const [s3, i3] of t3) {
250
- const { wrapped: t4 } = i3, e3 = this[s3];
251
- t4 !== true || this._$AL.has(s3) || e3 === undefined || this.C(s3, undefined, i3, e3);
261
+ const t = this.constructor.elementProperties;
262
+ if (t.size > 0)
263
+ for (const [s, i] of t) {
264
+ const { wrapped: t } = i, e = this[s];
265
+ t !== true || this._$AL.has(s) || e === undefined || this.C(s, undefined, i, e);
252
266
  }
253
267
  }
254
- let t2 = false;
255
- const s2 = this._$AL;
268
+ let t = false;
269
+ const s = this._$AL;
256
270
  try {
257
- t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EM();
258
- } catch (s3) {
259
- throw t2 = false, this._$EM(), s3;
271
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach((t) => t.hostUpdate?.()), this.update(s)) : this._$EM();
272
+ } catch (s) {
273
+ throw t = false, this._$EM(), s;
260
274
  }
261
- t2 && this._$AE(s2);
275
+ t && this._$AE(s);
262
276
  }
263
- willUpdate(t2) {}
264
- _$AE(t2) {
265
- this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2);
277
+ willUpdate(t) {}
278
+ _$AE(t) {
279
+ this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
266
280
  }
267
281
  _$EM() {
268
282
  this._$AL = new Map, this.isUpdatePending = false;
@@ -273,80 +287,80 @@ var init_reactive_element = __esm(() => {
273
287
  getUpdateComplete() {
274
288
  return this._$ES;
275
289
  }
276
- shouldUpdate(t2) {
290
+ shouldUpdate(t) {
277
291
  return true;
278
292
  }
279
- update(t2) {
280
- this._$Eq &&= this._$Eq.forEach((t3) => this._$ET(t3, this[t3])), this._$EM();
293
+ update(t) {
294
+ this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM();
281
295
  }
282
- updated(t2) {}
283
- firstUpdated(t2) {}
296
+ updated(t) {}
297
+ firstUpdated(t) {}
284
298
  };
285
299
  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");
286
300
  });
287
301
 
288
302
  // ../../node_modules/lit-html/lit-html.js
289
- function P(t3, i4) {
290
- if (!a2(t3) || !t3.hasOwnProperty("raw"))
303
+ function P(t, i) {
304
+ if (!a2(t) || !t.hasOwnProperty("raw"))
291
305
  throw Error("invalid template strings array");
292
- return s2 !== undefined ? s2.createHTML(i4) : i4;
306
+ return s2 !== undefined ? s2.createHTML(i) : i;
293
307
  }
294
308
 
295
309
  class N {
296
- constructor({ strings: t3, _$litType$: s3 }, n4) {
297
- let r4;
310
+ constructor({ strings: t, _$litType$: s }, n) {
311
+ let r;
298
312
  this.parts = [];
299
- let c4 = 0, a3 = 0;
300
- const u3 = t3.length - 1, d3 = this.parts, [f3, v2] = V(t3, s3);
301
- if (this.el = N.createElement(f3, n4), C.currentNode = this.el.content, s3 === 2 || s3 === 3) {
302
- const t4 = this.el.content.firstChild;
303
- t4.replaceWith(...t4.childNodes);
304
- }
305
- for (;(r4 = C.nextNode()) !== null && d3.length < u3; ) {
306
- if (r4.nodeType === 1) {
307
- if (r4.hasAttributes())
308
- for (const t4 of r4.getAttributeNames())
309
- if (t4.endsWith(e3)) {
310
- const i4 = v2[a3++], s4 = r4.getAttribute(t4).split(h2), e4 = /([.?@])?(.*)/.exec(i4);
311
- 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);
313
+ let c = 0, a = 0;
314
+ const u = t.length - 1, d = this.parts, [f, v] = V(t, s);
315
+ if (this.el = N.createElement(f, n), C.currentNode = this.el.content, s === 2 || s === 3) {
316
+ const t = this.el.content.firstChild;
317
+ t.replaceWith(...t.childNodes);
318
+ }
319
+ for (;(r = C.nextNode()) !== null && d.length < u; ) {
320
+ if (r.nodeType === 1) {
321
+ if (r.hasAttributes())
322
+ for (const t of r.getAttributeNames())
323
+ if (t.endsWith(e3)) {
324
+ const i = v[a++], s = r.getAttribute(t).split(h2), e = /([.?@])?(.*)/.exec(i);
325
+ 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);
312
326
  } else
313
- t4.startsWith(h2) && (d3.push({ type: 6, index: c4 }), r4.removeAttribute(t4));
314
- if ($.test(r4.tagName)) {
315
- const t4 = r4.textContent.split(h2), s4 = t4.length - 1;
316
- if (s4 > 0) {
317
- r4.textContent = i3 ? i3.emptyScript : "";
318
- for (let i4 = 0;i4 < s4; i4++)
319
- r4.append(t4[i4], l2()), C.nextNode(), d3.push({ type: 2, index: ++c4 });
320
- r4.append(t4[s4], l2());
327
+ t.startsWith(h2) && (d.push({ type: 6, index: c }), r.removeAttribute(t));
328
+ if ($.test(r.tagName)) {
329
+ const t = r.textContent.split(h2), s = t.length - 1;
330
+ if (s > 0) {
331
+ r.textContent = i3 ? i3.emptyScript : "";
332
+ for (let i = 0;i < s; i++)
333
+ r.append(t[i], l2()), C.nextNode(), d.push({ type: 2, index: ++c });
334
+ r.append(t[s], l2());
321
335
  }
322
336
  }
323
- } else if (r4.nodeType === 8)
324
- if (r4.data === o3)
325
- d3.push({ type: 2, index: c4 });
337
+ } else if (r.nodeType === 8)
338
+ if (r.data === o3)
339
+ d.push({ type: 2, index: c });
326
340
  else {
327
- let t4 = -1;
328
- for (;(t4 = r4.data.indexOf(h2, t4 + 1)) !== -1; )
329
- d3.push({ type: 7, index: c4 }), t4 += h2.length - 1;
341
+ let t = -1;
342
+ for (;(t = r.data.indexOf(h2, t + 1)) !== -1; )
343
+ d.push({ type: 7, index: c }), t += h2.length - 1;
330
344
  }
331
- c4++;
345
+ c++;
332
346
  }
333
347
  }
334
- static createElement(t3, i4) {
335
- const s3 = r3.createElement("template");
336
- return s3.innerHTML = t3, s3;
348
+ static createElement(t, i) {
349
+ const s = r3.createElement("template");
350
+ return s.innerHTML = t, s;
337
351
  }
338
352
  }
339
- function S2(t3, i4, s3 = t3, e4) {
340
- if (i4 === T)
341
- return i4;
342
- let h3 = e4 !== undefined ? s3._$Co?.[e4] : s3._$Cl;
343
- const o4 = c3(i4) ? undefined : i4._$litDirective$;
344
- 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;
353
+ function S2(t, i, s = t, e) {
354
+ if (i === T)
355
+ return i;
356
+ let h = e !== undefined ? s._$Co?.[e] : s._$Cl;
357
+ const o = c3(i) ? undefined : i._$litDirective$;
358
+ 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;
345
359
  }
346
360
 
347
361
  class M {
348
- constructor(t3, i4) {
349
- this._$AV = [], this._$AN = undefined, this._$AD = t3, this._$AM = i4;
362
+ constructor(t, i) {
363
+ this._$AV = [], this._$AN = undefined, this._$AD = t, this._$AM = i;
350
364
  }
351
365
  get parentNode() {
352
366
  return this._$AM.parentNode;
@@ -354,23 +368,23 @@ class M {
354
368
  get _$AU() {
355
369
  return this._$AM._$AU;
356
370
  }
357
- u(t3) {
358
- const { el: { content: i4 }, parts: s3 } = this._$AD, e4 = (t3?.creationScope ?? r3).importNode(i4, true);
359
- C.currentNode = e4;
360
- let h3 = C.nextNode(), o4 = 0, n4 = 0, l3 = s3[0];
361
- for (;l3 !== undefined; ) {
362
- if (o4 === l3.index) {
363
- let i5;
364
- 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];
371
+ u(t) {
372
+ const { el: { content: i }, parts: s } = this._$AD, e = (t?.creationScope ?? r3).importNode(i, true);
373
+ C.currentNode = e;
374
+ let h = C.nextNode(), o = 0, n = 0, l = s[0];
375
+ for (;l !== undefined; ) {
376
+ if (o === l.index) {
377
+ let i;
378
+ 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];
365
379
  }
366
- o4 !== l3?.index && (h3 = C.nextNode(), o4++);
380
+ o !== l?.index && (h = C.nextNode(), o++);
367
381
  }
368
- return C.currentNode = r3, e4;
382
+ return C.currentNode = r3, e;
369
383
  }
370
- p(t3) {
371
- let i4 = 0;
372
- for (const s3 of this._$AV)
373
- s3 !== undefined && (s3.strings !== undefined ? (s3._$AI(t3, s3, i4), i4 += s3.strings.length - 2) : s3._$AI(t3[i4])), i4++;
384
+ p(t) {
385
+ let i = 0;
386
+ for (const s of this._$AV)
387
+ s !== undefined && (s.strings !== undefined ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
374
388
  }
375
389
  }
376
390
 
@@ -378,13 +392,13 @@ class R {
378
392
  get _$AU() {
379
393
  return this._$AM?._$AU ?? this._$Cv;
380
394
  }
381
- constructor(t3, i4, s3, e4) {
382
- 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;
395
+ constructor(t, i, s, e) {
396
+ 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;
383
397
  }
384
398
  get parentNode() {
385
- let t3 = this._$AA.parentNode;
386
- const i4 = this._$AM;
387
- return i4 !== undefined && t3?.nodeType === 11 && (t3 = i4.parentNode), t3;
399
+ let t = this._$AA.parentNode;
400
+ const i = this._$AM;
401
+ return i !== undefined && t?.nodeType === 11 && (t = i.parentNode), t;
388
402
  }
389
403
  get startNode() {
390
404
  return this._$AA;
@@ -392,47 +406,47 @@ class R {
392
406
  get endNode() {
393
407
  return this._$AB;
394
408
  }
395
- _$AI(t3, i4 = this) {
396
- 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);
409
+ _$AI(t, i = this) {
410
+ 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);
397
411
  }
398
- O(t3) {
399
- return this._$AA.parentNode.insertBefore(t3, this._$AB);
412
+ O(t) {
413
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
400
414
  }
401
- T(t3) {
402
- this._$AH !== t3 && (this._$AR(), this._$AH = this.O(t3));
415
+ T(t) {
416
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
403
417
  }
404
- _(t3) {
405
- this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data = t3 : this.T(r3.createTextNode(t3)), this._$AH = t3;
418
+ _(t) {
419
+ this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r3.createTextNode(t)), this._$AH = t;
406
420
  }
407
- $(t3) {
408
- 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);
409
- if (this._$AH?._$AD === e4)
410
- this._$AH.p(i4);
421
+ $(t) {
422
+ 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);
423
+ if (this._$AH?._$AD === e)
424
+ this._$AH.p(i);
411
425
  else {
412
- const t4 = new M(e4, this), s4 = t4.u(this.options);
413
- t4.p(i4), this.T(s4), this._$AH = t4;
426
+ const t = new M(e, this), s = t.u(this.options);
427
+ t.p(i), this.T(s), this._$AH = t;
414
428
  }
415
429
  }
416
- _$AC(t3) {
417
- let i4 = A.get(t3.strings);
418
- return i4 === undefined && A.set(t3.strings, i4 = new N(t3)), i4;
430
+ _$AC(t) {
431
+ let i = A.get(t.strings);
432
+ return i === undefined && A.set(t.strings, i = new N(t)), i;
419
433
  }
420
- k(t3) {
434
+ k(t) {
421
435
  a2(this._$AH) || (this._$AH = [], this._$AR());
422
- const i4 = this._$AH;
423
- let s3, e4 = 0;
424
- for (const h3 of t3)
425
- e4 === i4.length ? i4.push(s3 = new R(this.O(l2()), this.O(l2()), this, this.options)) : s3 = i4[e4], s3._$AI(h3), e4++;
426
- e4 < i4.length && (this._$AR(s3 && s3._$AB.nextSibling, e4), i4.length = e4);
436
+ const i = this._$AH;
437
+ let s, e = 0;
438
+ for (const h of t)
439
+ e === i.length ? i.push(s = new R(this.O(l2()), this.O(l2()), this, this.options)) : s = i[e], s._$AI(h), e++;
440
+ e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
427
441
  }
428
- _$AR(t3 = this._$AA.nextSibling, i4) {
429
- for (this._$AP?.(false, true, i4);t3 !== this._$AB; ) {
430
- const i5 = t3.nextSibling;
431
- t3.remove(), t3 = i5;
442
+ _$AR(t = this._$AA.nextSibling, i) {
443
+ for (this._$AP?.(false, true, i);t !== this._$AB; ) {
444
+ const i = t.nextSibling;
445
+ t.remove(), t = i;
432
446
  }
433
447
  }
434
- setConnected(t3) {
435
- this._$AM === undefined && (this._$Cv = t3, this._$AP?.(t3));
448
+ setConnected(t) {
449
+ this._$AM === undefined && (this._$Cv = t, this._$AP?.(t));
436
450
  }
437
451
  }
438
452
 
@@ -443,64 +457,64 @@ class k {
443
457
  get _$AU() {
444
458
  return this._$AM._$AU;
445
459
  }
446
- constructor(t3, i4, s3, e4, h3) {
447
- 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;
460
+ constructor(t, i, s, e, h) {
461
+ 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;
448
462
  }
449
- _$AI(t3, i4 = this, s3, e4) {
450
- const h3 = this.strings;
451
- let o4 = false;
452
- if (h3 === undefined)
453
- t3 = S2(this, t3, i4, 0), o4 = !c3(t3) || t3 !== this._$AH && t3 !== T, o4 && (this._$AH = t3);
463
+ _$AI(t, i = this, s, e) {
464
+ const h = this.strings;
465
+ let o = false;
466
+ if (h === undefined)
467
+ t = S2(this, t, i, 0), o = !c3(t) || t !== this._$AH && t !== T, o && (this._$AH = t);
454
468
  else {
455
- const e5 = t3;
456
- let n4, r4;
457
- for (t3 = h3[0], n4 = 0;n4 < h3.length - 1; n4++)
458
- 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;
469
+ const e = t;
470
+ let n, r;
471
+ for (t = h[0], n = 0;n < h.length - 1; n++)
472
+ 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;
459
473
  }
460
- o4 && !e4 && this.j(t3);
474
+ o && !e && this.j(t);
461
475
  }
462
- j(t3) {
463
- t3 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t3 ?? "");
476
+ j(t) {
477
+ t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
464
478
  }
465
479
  }
466
480
 
467
481
  class z {
468
- constructor(t3, i4, s3) {
469
- this.element = t3, this.type = 6, this._$AN = undefined, this._$AM = i4, this.options = s3;
482
+ constructor(t, i, s) {
483
+ this.element = t, this.type = 6, this._$AN = undefined, this._$AM = i, this.options = s;
470
484
  }
471
485
  get _$AU() {
472
486
  return this._$AM._$AU;
473
487
  }
474
- _$AI(t3) {
475
- S2(this, t3);
476
- }
477
- }
478
- 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 = `[
479
- \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) => {
480
- const s3 = t3.length - 1, o4 = [];
481
- let r4, l3 = i4 === 2 ? "<svg>" : i4 === 3 ? "<math>" : "", c4 = f2;
482
- for (let i5 = 0;i5 < s3; i5++) {
483
- const s4 = t3[i5];
484
- let a3, u3, d3 = -1, y3 = 0;
485
- for (;y3 < s4.length && (c4.lastIndex = y3, u3 = c4.exec(s4), u3 !== null); )
486
- 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);
487
- const x2 = c4 === m && t3[i5 + 1].startsWith("/>") ? " " : "";
488
- 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);
489
- }
490
- return [P(t3, l3 + (t3[s3] || "<?>") + (i4 === 2 ? "</svg>" : i4 === 3 ? "</math>" : "")), o4];
491
- }, H, I, L, Z, j, B = (t3, i4, s3) => {
492
- const e4 = s3?.renderBefore ?? i4;
493
- let h3 = e4._$litPart$;
494
- if (h3 === undefined) {
495
- const t4 = s3?.renderBefore ?? null;
496
- e4._$litPart$ = h3 = new R(i4.insertBefore(l2(), t4), t4, undefined, s3 ?? {});
497
- }
498
- return h3._$AI(t3), h3;
488
+ _$AI(t) {
489
+ S2(this, t);
490
+ }
491
+ }
492
+ 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 = `[
493
+ \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) => {
494
+ const s = t.length - 1, o = [];
495
+ let r, l = i === 2 ? "<svg>" : i === 3 ? "<math>" : "", c = f2;
496
+ for (let i = 0;i < s; i++) {
497
+ const s = t[i];
498
+ let a, u, d = -1, y = 0;
499
+ for (;y < s.length && (c.lastIndex = y, u = c.exec(s), u !== null); )
500
+ 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);
501
+ const x = c === m && t[i + 1].startsWith("/>") ? " " : "";
502
+ 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);
503
+ }
504
+ return [P(t, l + (t[s] || "<?>") + (i === 2 ? "</svg>" : i === 3 ? "</math>" : "")), o];
505
+ }, H, I, L, Z, j, B = (t, i, s) => {
506
+ const e = s?.renderBefore ?? i;
507
+ let h = e._$litPart$;
508
+ if (h === undefined) {
509
+ const t = s?.renderBefore ?? null;
510
+ e._$litPart$ = h = new R(i.insertBefore(l2(), t), t, undefined, s ?? {});
511
+ }
512
+ return h._$AI(t), h;
499
513
  };
500
514
  var init_lit_html = __esm(() => {
501
515
  t2 = globalThis;
502
516
  i3 = t2.trustedTypes;
503
- s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t3) => t3 }) : undefined;
517
+ s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t) => t }) : undefined;
504
518
  h2 = `lit$${Math.random().toFixed(9).slice(2)}$`;
505
519
  o3 = "?" + h2;
506
520
  n3 = `<${o3}>`;
@@ -525,30 +539,30 @@ var init_lit_html = __esm(() => {
525
539
  constructor() {
526
540
  super(...arguments), this.type = 3;
527
541
  }
528
- j(t3) {
529
- this.element[this.name] = t3 === E ? undefined : t3;
542
+ j(t) {
543
+ this.element[this.name] = t === E ? undefined : t;
530
544
  }
531
545
  };
532
546
  I = class I extends k {
533
547
  constructor() {
534
548
  super(...arguments), this.type = 4;
535
549
  }
536
- j(t3) {
537
- this.element.toggleAttribute(this.name, !!t3 && t3 !== E);
550
+ j(t) {
551
+ this.element.toggleAttribute(this.name, !!t && t !== E);
538
552
  }
539
553
  };
540
554
  L = class L extends k {
541
- constructor(t3, i4, s3, e4, h3) {
542
- super(t3, i4, s3, e4, h3), this.type = 5;
555
+ constructor(t, i, s, e, h) {
556
+ super(t, i, s, e, h), this.type = 5;
543
557
  }
544
- _$AI(t3, i4 = this) {
545
- if ((t3 = S2(this, t3, i4, 0) ?? E) === T)
558
+ _$AI(t, i = this) {
559
+ if ((t = S2(this, t, i, 0) ?? E) === T)
546
560
  return;
547
- 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);
548
- e4 && this.element.removeEventListener(this.name, this, s3), h3 && this.element.addEventListener(this.name, this, t3), this._$AH = t3;
561
+ 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);
562
+ e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
549
563
  }
550
- handleEvent(t3) {
551
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t3) : this._$AH.handleEvent(t3);
564
+ handleEvent(t) {
565
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
552
566
  }
553
567
  };
554
568
  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 };
@@ -559,9 +573,9 @@ var init_lit_html = __esm(() => {
559
573
  // ../../node_modules/lit-element/lit-element.js
560
574
  var s3, i4, o4;
561
575
  var init_lit_element = __esm(() => {
562
- init_reactive_element();
563
576
  init_reactive_element();
564
577
  init_lit_html();
578
+ init_reactive_element();
565
579
  init_lit_html();
566
580
  s3 = globalThis;
567
581
  i4 = class i4 extends y {
@@ -569,12 +583,12 @@ var init_lit_element = __esm(() => {
569
583
  super(...arguments), this.renderOptions = { host: this }, this._$Do = undefined;
570
584
  }
571
585
  createRenderRoot() {
572
- const t3 = super.createRenderRoot();
573
- return this.renderOptions.renderBefore ??= t3.firstChild, t3;
586
+ const t = super.createRenderRoot();
587
+ return this.renderOptions.renderBefore ??= t.firstChild, t;
574
588
  }
575
- update(t3) {
576
- const r4 = this.render();
577
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t3), this._$Do = B(r4, this.renderRoot, this.renderOptions);
589
+ update(t) {
590
+ const r = this.render();
591
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = B(r, this.renderRoot, this.renderOptions);
578
592
  }
579
593
  connectedCallback() {
580
594
  super.connectedCallback(), this._$Do?.setConnected(true);
@@ -608,16 +622,16 @@ function base(ALPHABET) {
608
622
  throw new TypeError("Alphabet too long");
609
623
  }
610
624
  const BASE_MAP = new Uint8Array(256);
611
- for (let j2 = 0;j2 < BASE_MAP.length; j2++) {
612
- BASE_MAP[j2] = 255;
625
+ for (let j = 0;j < BASE_MAP.length; j++) {
626
+ BASE_MAP[j] = 255;
613
627
  }
614
- for (let i5 = 0;i5 < ALPHABET.length; i5++) {
615
- const x2 = ALPHABET.charAt(i5);
616
- const xc = x2.charCodeAt(0);
628
+ for (let i = 0;i < ALPHABET.length; i++) {
629
+ const x = ALPHABET.charAt(i);
630
+ const xc = x.charCodeAt(0);
617
631
  if (BASE_MAP[xc] !== 255) {
618
- throw new TypeError(x2 + " is ambiguous");
632
+ throw new TypeError(x + " is ambiguous");
619
633
  }
620
- BASE_MAP[xc] = i5;
634
+ BASE_MAP[xc] = i;
621
635
  }
622
636
  const BASE = ALPHABET.length;
623
637
  const LEADER = ALPHABET.charAt(0);
@@ -647,8 +661,8 @@ function base(ALPHABET) {
647
661
  const b58 = new Uint8Array(size);
648
662
  while (pbegin !== pend) {
649
663
  let carry = source[pbegin];
650
- let i5 = 0;
651
- for (let it1 = size - 1;(carry !== 0 || i5 < length) && it1 !== -1; it1--, i5++) {
664
+ let i = 0;
665
+ for (let it1 = size - 1;(carry !== 0 || i < length) && it1 !== -1; it1--, i++) {
652
666
  carry += 256 * b58[it1] >>> 0;
653
667
  b58[it1] = carry % BASE >>> 0;
654
668
  carry = carry / BASE >>> 0;
@@ -656,7 +670,7 @@ function base(ALPHABET) {
656
670
  if (carry !== 0) {
657
671
  throw new Error("Non-zero carry");
658
672
  }
659
- length = i5;
673
+ length = i;
660
674
  pbegin++;
661
675
  }
662
676
  let it2 = size - length;
@@ -694,8 +708,8 @@ function base(ALPHABET) {
694
708
  if (carry === 255) {
695
709
  return;
696
710
  }
697
- let i5 = 0;
698
- for (let it3 = size - 1;(carry !== 0 || i5 < length) && it3 !== -1; it3--, i5++) {
711
+ let i = 0;
712
+ for (let it3 = size - 1;(carry !== 0 || i < length) && it3 !== -1; it3--, i++) {
699
713
  carry += BASE * b256[it3] >>> 0;
700
714
  b256[it3] = carry % 256 >>> 0;
701
715
  carry = carry / 256 >>> 0;
@@ -703,7 +717,7 @@ function base(ALPHABET) {
703
717
  if (carry !== 0) {
704
718
  throw new Error("Non-zero carry");
705
719
  }
706
- length = i5;
720
+ length = i;
707
721
  psz++;
708
722
  }
709
723
  let it4 = size - length;
@@ -711,9 +725,9 @@ function base(ALPHABET) {
711
725
  it4++;
712
726
  }
713
727
  const vch = new Uint8Array(zeroes + (size - it4));
714
- let j2 = zeroes;
728
+ let j = zeroes;
715
729
  while (it4 !== size) {
716
- vch[j2++] = b256[it4++];
730
+ vch[j++] = b256[it4++];
717
731
  }
718
732
  return vch;
719
733
  }
@@ -753,14 +767,14 @@ var init_near = __esm(() => {
753
767
  });
754
768
 
755
769
  // ../shared-ts/src/utils/validation.ts
756
- function isObject(x2) {
757
- return x2 !== null && typeof x2 === "object";
770
+ function isObject(x) {
771
+ return x !== null && typeof x === "object";
758
772
  }
759
- function isString(x2) {
760
- return typeof x2 === "string";
773
+ function isString(x) {
774
+ return typeof x === "string";
761
775
  }
762
- function isNumber(x2) {
763
- return typeof x2 === "number";
776
+ function isNumber(x) {
777
+ return typeof x === "number";
764
778
  }
765
779
  var init_validation = __esm(() => {
766
780
  init_near();
@@ -806,11 +820,14 @@ var init_LitElementWithProps = __esm(() => {
806
820
  init_lit();
807
821
  init_validation();
808
822
  LitElementWithProps = class LitElementWithProps extends i4 {
809
- _varsSheet = null;
810
- _varsMap = {};
811
- _appearanceVarNames = new Set;
812
- _varsDocSheet = null;
813
- _varsClassName = null;
823
+ constructor() {
824
+ super(...arguments);
825
+ this._varsSheet = null;
826
+ this._varsMap = {};
827
+ this._appearanceVarNames = new Set;
828
+ this._varsDocSheet = null;
829
+ this._varsClassName = null;
830
+ }
814
831
  static keepDefinitions;
815
832
  static requiredChildTags;
816
833
  static strictChildDefinitions;
@@ -830,7 +847,6 @@ var init_LitElementWithProps = __esm(() => {
830
847
  propertyNames.forEach((prop) => this.upgradeProperty(prop));
831
848
  }
832
849
  }
833
- styles;
834
850
  connectedCallback() {
835
851
  super.connectedCallback();
836
852
  this.upgradeAllProperties();
@@ -842,7 +858,7 @@ var init_LitElementWithProps = __esm(() => {
842
858
  const { keepDefinitions, requiredChildTags, strictChildDefinitions } = ctor;
843
859
  const defs = keepDefinitions;
844
860
  if (defs && defs.length) {
845
- for (const d3 of defs)
861
+ for (const d of defs)
846
862
  ;
847
863
  }
848
864
  const req = requiredChildTags;
@@ -877,7 +893,7 @@ var init_LitElementWithProps = __esm(() => {
877
893
  const setVar = (name, val) => {
878
894
  vars[name] = val;
879
895
  };
880
- const toKebab = (s4) => this.camelToKebab(s4);
896
+ const toKebab = (s) => this.camelToKebab(s);
881
897
  const transformViewportUnits = (val) => {
882
898
  if (!val || typeof val !== "string")
883
899
  return val;
@@ -924,14 +940,14 @@ var init_LitElementWithProps = __esm(() => {
924
940
  setVar(colorMappings[key], maybeTransformed);
925
941
  return;
926
942
  }
927
- const r4 = key.match(radiusMatcher);
928
- if (r4) {
929
- setVar(`--w3a-border-radius-${r4[1].toLowerCase()}`, maybeTransformed);
943
+ const r = key.match(radiusMatcher);
944
+ if (r) {
945
+ setVar(`--w3a-border-radius-${r[1].toLowerCase()}`, maybeTransformed);
930
946
  return;
931
947
  }
932
- const s4 = key.match(shadowMatcher);
933
- if (s4) {
934
- setVar(`--w3a-shadows-${s4[1].toLowerCase()}`, maybeTransformed);
948
+ const s = key.match(shadowMatcher);
949
+ if (s) {
950
+ setVar(`--w3a-shadows-${s[1].toLowerCase()}`, maybeTransformed);
935
951
  return;
936
952
  }
937
953
  setVar(`--w3a-${toKebab(key)}`, maybeTransformed);
@@ -942,8 +958,8 @@ var init_LitElementWithProps = __esm(() => {
942
958
  const kebabSection = toKebab(section);
943
959
  const kebabProp = toKebab(prop);
944
960
  const cssVarNew = `--w3a-${prefix}__${kebabSection}__${kebabProp}`;
945
- const v2 = typeof value === "string" ? transformViewportUnits(value) : String(value);
946
- vars[cssVarNew] = v2;
961
+ const v = typeof value === "string" ? transformViewportUnits(value) : String(value);
962
+ vars[cssVarNew] = v;
947
963
  });
948
964
  }
949
965
  });
@@ -954,12 +970,12 @@ var init_LitElementWithProps = __esm(() => {
954
970
  }
955
971
  setCssVars(vars) {
956
972
  try {
957
- for (const [k2, v2] of Object.entries(vars)) {
958
- if (v2 == null)
973
+ for (const [k, v] of Object.entries(vars)) {
974
+ if (v == null)
959
975
  continue;
960
- this._varsMap[k2] = String(v2);
976
+ this._varsMap[k] = String(v);
961
977
  }
962
- const decls = Object.entries(this._varsMap).map(([k2, v2]) => `${k2}: ${v2};`).join(" ");
978
+ const decls = Object.entries(this._varsMap).map(([k, v]) => `${k}: ${v};`).join(" ");
963
979
  const cssTextShadow = `:host{ ${decls} }`;
964
980
  const canUseConstructable = supportsConstructableStylesheets();
965
981
  if (this.renderRoot instanceof ShadowRoot && canUseConstructable && hasAdoptedStyleSheets(this.renderRoot)) {
@@ -1026,16 +1042,16 @@ var init_LitElementWithProps = __esm(() => {
1026
1042
  });
1027
1043
 
1028
1044
  // src/core/signingEngine/uiConfirm/ui/lit-components/asset-base.ts
1029
- function withTrailingSlash(s4) {
1030
- return s4.endsWith("/") ? s4 : s4 + "/";
1045
+ function withTrailingSlash(s) {
1046
+ return s.endsWith("/") ? s : s + "/";
1031
1047
  }
1032
1048
  function readGlobalEmbeddedBase() {
1033
1049
  try {
1034
1050
  if (typeof window === "undefined")
1035
1051
  return;
1036
- const v2 = window.__W3A_WALLET_SDK_BASE__;
1037
- if (typeof v2 === "string" && v2.length > 0)
1038
- return withTrailingSlash(v2);
1052
+ const v = window.__W3A_WALLET_SDK_BASE__;
1053
+ if (typeof v === "string" && v.length > 0)
1054
+ return withTrailingSlash(v);
1039
1055
  } catch {}
1040
1056
  return;
1041
1057
  }
@@ -1044,14 +1060,14 @@ function deriveFromModuleUrl() {
1044
1060
  const moduleUrl = String(import.meta.url || "").trim();
1045
1061
  if (!moduleUrl)
1046
1062
  return;
1047
- const base2 = typeof window !== "undefined" ? window.location.href : undefined;
1048
- const u3 = base2 ? new URL(moduleUrl, base2) : new URL(moduleUrl);
1049
- const href = u3.toString();
1063
+ const base = typeof window !== "undefined" ? window.location.href : undefined;
1064
+ const u = base ? new URL(moduleUrl, base) : new URL(moduleUrl);
1065
+ const href = u.toString();
1050
1066
  const idx = href.indexOf(SDK_SEGMENT);
1051
1067
  if (idx > 0) {
1052
1068
  return withTrailingSlash(href.slice(0, idx + SDK_SEGMENT.length));
1053
1069
  }
1054
- const origin = u3.origin;
1070
+ const origin = u.origin;
1055
1071
  if (origin && /^https?:/i.test(origin)) {
1056
1072
  return withTrailingSlash(origin + "/sdk");
1057
1073
  }
@@ -1065,22 +1081,22 @@ var SDK_SEGMENT = "/sdk/";
1065
1081
 
1066
1082
  // src/core/signingEngine/uiConfirm/ui/lit-components/css/css-loader.ts
1067
1083
  function resolveStylesheetUrl(assetName) {
1068
- const base2 = resolveEmbeddedBase();
1069
- const join = (s4) => s4.endsWith("/") ? s4 : s4 + "/";
1070
- if (/^https?:/i.test(base2))
1071
- return `${join(base2)}${assetName}`;
1084
+ const base = resolveEmbeddedBase();
1085
+ const join = (s) => s.endsWith("/") ? s : s + "/";
1086
+ if (/^https?:/i.test(base))
1087
+ return `${join(base)}${assetName}`;
1072
1088
  try {
1073
1089
  if (!warnedRelativeBaseOnce && typeof document !== "undefined" && document.URL === "about:srcdoc") {
1074
1090
  warnedRelativeBaseOnce = true;
1075
- 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" } }, `);
1091
+ 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" } }, `);
1076
1092
  }
1077
1093
  } catch {}
1078
1094
  const origin = typeof window !== "undefined" && window.location ? window.location.origin : "";
1079
1095
  if (origin && origin !== "null" && /^https?:/i.test(origin)) {
1080
- const prefix = base2.startsWith("/") ? base2 : `/${base2}`;
1096
+ const prefix = base.startsWith("/") ? base : `/${base}`;
1081
1097
  return `${join(origin + prefix)}${assetName}`;
1082
1098
  }
1083
- const normalized = base2.startsWith("/") ? base2 : `/${base2}`;
1099
+ const normalized = base.startsWith("/") ? base : `/${base}`;
1084
1100
  return `${join(normalized)}${assetName}`;
1085
1101
  }
1086
1102
  function getDoc(root) {
@@ -1126,9 +1142,9 @@ async function adoptConstructable(root, assetName) {
1126
1142
  if (!res.ok)
1127
1143
  return null;
1128
1144
  const cssText = await res.text();
1129
- const sheet2 = new CSSStyleSheet;
1130
- sheet2.replaceSync(cssText);
1131
- return sheet2;
1145
+ const sheet = new CSSStyleSheet;
1146
+ sheet.replaceSync(cssText);
1147
+ return sheet;
1132
1148
  } catch {
1133
1149
  return null;
1134
1150
  }
@@ -1178,28 +1194,28 @@ var init_css_loader = __esm(() => {
1178
1194
  });
1179
1195
 
1180
1196
  // ../../node_modules/lit-html/directive-helpers.js
1181
- var t3, f3 = (o5) => o5.strings === undefined, r4 = () => document.createComment(""), s4 = (o5, i5, n4) => {
1182
- const e4 = o5._$AA.parentNode, l3 = i5 === undefined ? o5._$AB : i5._$AA;
1183
- if (n4 === undefined) {
1184
- const i6 = e4.insertBefore(r4(), l3), d3 = e4.insertBefore(r4(), l3);
1185
- n4 = new t3(i6, d3, o5, o5.options);
1197
+ var t3, f3 = (o) => o.strings === undefined, r4 = () => document.createComment(""), s4 = (o, i, n) => {
1198
+ const e = o._$AA.parentNode, l = i === undefined ? o._$AB : i._$AA;
1199
+ if (n === undefined) {
1200
+ const i = e.insertBefore(r4(), l), d = e.insertBefore(r4(), l);
1201
+ n = new t3(i, d, o, o.options);
1186
1202
  } else {
1187
- const t4 = n4._$AB.nextSibling, i6 = n4._$AM, d3 = i6 !== o5;
1188
- if (d3) {
1189
- let t5;
1190
- n4._$AQ?.(o5), n4._$AM = o5, n4._$AP !== undefined && (t5 = o5._$AU) !== i6._$AU && n4._$AP(t5);
1203
+ const t = n._$AB.nextSibling, i = n._$AM, d = i !== o;
1204
+ if (d) {
1205
+ let t;
1206
+ n._$AQ?.(o), n._$AM = o, n._$AP !== undefined && (t = o._$AU) !== i._$AU && n._$AP(t);
1191
1207
  }
1192
- if (t4 !== l3 || d3) {
1193
- let o6 = n4._$AA;
1194
- for (;o6 !== t4; ) {
1195
- const t5 = o6.nextSibling;
1196
- e4.insertBefore(o6, l3), o6 = t5;
1208
+ if (t !== l || d) {
1209
+ let o = n._$AA;
1210
+ for (;o !== t; ) {
1211
+ const t = o.nextSibling;
1212
+ e.insertBefore(o, l), o = t;
1197
1213
  }
1198
1214
  }
1199
1215
  }
1200
- return n4;
1201
- }, v2 = (o5, t4, i5 = o5) => (o5._$AI(t4, i5), o5), u3, m2 = (o5, t4 = u3) => o5._$AH = t4, p3 = (o5) => o5._$AH, M2 = (o5) => {
1202
- o5._$AR(), o5._$AA.remove();
1216
+ return n;
1217
+ }, v2 = (o, t, i = o) => (o._$AI(t, i), o), u3, m2 = (o, t = u3) => o._$AH = t, p3 = (o) => o._$AH, M2 = (o) => {
1218
+ o._$AR(), o._$AA.remove();
1203
1219
  };
1204
1220
  var init_directive_helpers = __esm(() => {
1205
1221
  init_lit_html();
@@ -1209,66 +1225,66 @@ var init_directive_helpers = __esm(() => {
1209
1225
 
1210
1226
  // ../../node_modules/lit-html/directive.js
1211
1227
  class i5 {
1212
- constructor(t5) {}
1228
+ constructor(t) {}
1213
1229
  get _$AU() {
1214
1230
  return this._$AM._$AU;
1215
1231
  }
1216
- _$AT(t5, e5, i6) {
1217
- this._$Ct = t5, this._$AM = e5, this._$Ci = i6;
1232
+ _$AT(t, e, i) {
1233
+ this._$Ct = t, this._$AM = e, this._$Ci = i;
1218
1234
  }
1219
- _$AS(t5, e5) {
1220
- return this.update(t5, e5);
1235
+ _$AS(t, e) {
1236
+ return this.update(t, e);
1221
1237
  }
1222
- update(t5, e5) {
1223
- return this.render(...e5);
1238
+ update(t, e) {
1239
+ return this.render(...e);
1224
1240
  }
1225
1241
  }
1226
- var t4, e4 = (t5) => (...e5) => ({ _$litDirective$: t5, values: e5 });
1242
+ var t4, e4 = (t) => (...e) => ({ _$litDirective$: t, values: e });
1227
1243
  var init_directive = __esm(() => {
1228
1244
  t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
1229
1245
  });
1230
1246
 
1231
1247
  // ../../node_modules/lit-html/async-directive.js
1232
- function h3(i6) {
1233
- this._$AN !== undefined ? (o5(this), this._$AM = i6, r5(this)) : this._$AM = i6;
1234
- }
1235
- function n4(i6, t5 = false, e5 = 0) {
1236
- const r6 = this._$AH, h4 = this._$AN;
1237
- if (h4 !== undefined && h4.size !== 0)
1238
- if (t5)
1239
- if (Array.isArray(r6))
1240
- for (let i7 = e5;i7 < r6.length; i7++)
1241
- s5(r6[i7], false), o5(r6[i7]);
1248
+ function h3(i) {
1249
+ this._$AN !== undefined ? (o5(this), this._$AM = i, r5(this)) : this._$AM = i;
1250
+ }
1251
+ function n4(i, t = false, e = 0) {
1252
+ const r = this._$AH, h = this._$AN;
1253
+ if (h !== undefined && h.size !== 0)
1254
+ if (t)
1255
+ if (Array.isArray(r))
1256
+ for (let i = e;i < r.length; i++)
1257
+ s5(r[i], false), o5(r[i]);
1242
1258
  else
1243
- r6 != null && (s5(r6, false), o5(r6));
1259
+ r != null && (s5(r, false), o5(r));
1244
1260
  else
1245
- s5(this, i6);
1261
+ s5(this, i);
1246
1262
  }
1247
- var s5 = (i6, t5) => {
1248
- const e5 = i6._$AN;
1249
- if (e5 === undefined)
1263
+ var s5 = (i, t) => {
1264
+ const e = i._$AN;
1265
+ if (e === undefined)
1250
1266
  return false;
1251
- for (const i7 of e5)
1252
- i7._$AO?.(t5, false), s5(i7, t5);
1267
+ for (const i of e)
1268
+ i._$AO?.(t, false), s5(i, t);
1253
1269
  return true;
1254
- }, o5 = (i6) => {
1255
- let t5, e5;
1270
+ }, o5 = (i) => {
1271
+ let t, e;
1256
1272
  do {
1257
- if ((t5 = i6._$AM) === undefined)
1273
+ if ((t = i._$AM) === undefined)
1258
1274
  break;
1259
- e5 = t5._$AN, e5.delete(i6), i6 = t5;
1260
- } while (e5?.size === 0);
1261
- }, r5 = (i6) => {
1262
- for (let t5;t5 = i6._$AM; i6 = t5) {
1263
- let e5 = t5._$AN;
1264
- if (e5 === undefined)
1265
- t5._$AN = e5 = new Set;
1266
- else if (e5.has(i6))
1275
+ e = t._$AN, e.delete(i), i = t;
1276
+ } while (e?.size === 0);
1277
+ }, r5 = (i) => {
1278
+ for (let t;t = i._$AM; i = t) {
1279
+ let e = t._$AN;
1280
+ if (e === undefined)
1281
+ t._$AN = e = new Set;
1282
+ else if (e.has(i))
1267
1283
  break;
1268
- e5.add(i6), c4(t5);
1284
+ e.add(i), c4(t);
1269
1285
  }
1270
- }, c4 = (i6) => {
1271
- i6.type == t4.CHILD && (i6._$AP ??= n4, i6._$AQ ??= h3);
1286
+ }, c4 = (i) => {
1287
+ i.type == t4.CHILD && (i._$AP ??= n4, i._$AQ ??= h3);
1272
1288
  }, f4;
1273
1289
  var init_async_directive = __esm(() => {
1274
1290
  init_directive_helpers();
@@ -1278,18 +1294,18 @@ var init_async_directive = __esm(() => {
1278
1294
  constructor() {
1279
1295
  super(...arguments), this._$AN = undefined;
1280
1296
  }
1281
- _$AT(i6, t5, e5) {
1282
- super._$AT(i6, t5, e5), r5(this), this.isConnected = i6._$AU;
1297
+ _$AT(i, t, e) {
1298
+ super._$AT(i, t, e), r5(this), this.isConnected = i._$AU;
1283
1299
  }
1284
- _$AO(i6, t5 = true) {
1285
- i6 !== this.isConnected && (this.isConnected = i6, i6 ? this.reconnected?.() : this.disconnected?.()), t5 && (s5(this, i6), o5(this));
1300
+ _$AO(i, t = true) {
1301
+ i !== this.isConnected && (this.isConnected = i, i ? this.reconnected?.() : this.disconnected?.()), t && (s5(this, i), o5(this));
1286
1302
  }
1287
- setValue(t5) {
1303
+ setValue(t) {
1288
1304
  if (f3(this._$Ct))
1289
- this._$Ct._$AI(t5, this);
1305
+ this._$Ct._$AI(t, this);
1290
1306
  else {
1291
- const i6 = [...this._$Ct._$AH];
1292
- i6[this._$Ci] = t5, this._$Ct._$AI(i6, this, 0);
1307
+ const i = [...this._$Ct._$AH];
1308
+ i[this._$Ci] = t, this._$Ct._$AI(i, this, 0);
1293
1309
  }
1294
1310
  }
1295
1311
  disconnected() {}
@@ -1307,20 +1323,20 @@ var init_ref = __esm(() => {
1307
1323
  init_directive();
1308
1324
  o6 = new WeakMap;
1309
1325
  n5 = e4(class extends f4 {
1310
- render(i6) {
1326
+ render(i) {
1311
1327
  return E;
1312
1328
  }
1313
- update(i6, [s6]) {
1314
- const e6 = s6 !== this.G;
1315
- 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;
1329
+ update(i, [s]) {
1330
+ const e = s !== this.G;
1331
+ 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;
1316
1332
  }
1317
- rt(t5) {
1318
- if (this.isConnected || (t5 = undefined), typeof this.G == "function") {
1319
- const i6 = this.ht ?? globalThis;
1320
- let s6 = o6.get(i6);
1321
- 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);
1333
+ rt(t) {
1334
+ if (this.isConnected || (t = undefined), typeof this.G == "function") {
1335
+ const i = this.ht ?? globalThis;
1336
+ let s = o6.get(i);
1337
+ 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);
1322
1338
  } else
1323
- this.G.value = t5;
1339
+ this.G.value = t;
1324
1340
  }
1325
1341
  get lt() {
1326
1342
  return typeof this.G == "function" ? o6.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
@@ -1373,8 +1389,8 @@ var init_lit_events = __esm(() => {
1373
1389
  });
1374
1390
 
1375
1391
  // src/core/signingEngine/uiConfirm/ui/lit-components/Drawer/index.ts
1376
- function clamp(n6, min, max) {
1377
- return Math.max(min, Math.min(max, n6));
1392
+ function clamp(n, min, max) {
1393
+ return Math.max(min, Math.min(max, n));
1378
1394
  }
1379
1395
  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;
1380
1396
  var init_Drawer = __esm(() => {
@@ -1396,44 +1412,185 @@ var init_Drawer = __esm(() => {
1396
1412
  height: { type: String },
1397
1413
  overpullPx: { type: Number, attribute: "overpull-px" }
1398
1414
  };
1399
- isDragging = false;
1400
- pendingDrag = false;
1401
- startY = 0;
1402
- currentY = 0;
1403
- dragDistance = 0;
1404
- lastDragTime = 0;
1405
- velocity = 0;
1406
- drawerElement = null;
1407
- overlayElement = null;
1408
- bodyElement = null;
1409
- drawerHeight = 0;
1410
- startTranslateYPx = 0;
1411
- openRestTranslateYPx = 0;
1412
- dragStartTime = 0;
1413
- isClosing = false;
1414
- aboveFoldResizeObserver;
1415
- drawerResizeObserver;
1416
- detachViewportSync;
1417
- _syncRAF = null;
1418
- _lastOpenTranslatePct;
1419
- _contentAnimRAF = null;
1420
- _activeHeightTransitions = 0;
1421
- detachContentAnimSync;
1422
- _initialMount = true;
1423
- _firstOpen = true;
1424
- _stylesReady = false;
1425
- _stylePromises = [];
1426
- _stylesAwaiting = null;
1427
- _childObserver = null;
1428
1415
  createRenderRoot() {
1429
1416
  const root = this;
1430
- const p4 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
1431
- this._stylePromises.push(p4);
1432
- p4.catch(() => {});
1417
+ const p = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
1418
+ this._stylePromises.push(p);
1419
+ p.catch(() => {});
1433
1420
  return root;
1434
1421
  }
1435
1422
  constructor() {
1436
1423
  super();
1424
+ this.isDragging = false;
1425
+ this.pendingDrag = false;
1426
+ this.startY = 0;
1427
+ this.currentY = 0;
1428
+ this.dragDistance = 0;
1429
+ this.lastDragTime = 0;
1430
+ this.velocity = 0;
1431
+ this.drawerElement = null;
1432
+ this.overlayElement = null;
1433
+ this.bodyElement = null;
1434
+ this.drawerHeight = 0;
1435
+ this.startTranslateYPx = 0;
1436
+ this.openRestTranslateYPx = 0;
1437
+ this.dragStartTime = 0;
1438
+ this.isClosing = false;
1439
+ this._syncRAF = null;
1440
+ this._contentAnimRAF = null;
1441
+ this._activeHeightTransitions = 0;
1442
+ this._initialMount = true;
1443
+ this._firstOpen = true;
1444
+ this._stylesReady = false;
1445
+ this._stylePromises = [];
1446
+ this._stylesAwaiting = null;
1447
+ this._childObserver = null;
1448
+ this._initialChildren = null;
1449
+ this.handleTransitionEnd = (e) => {
1450
+ if (!this.drawerElement)
1451
+ return;
1452
+ if (e.target !== this.drawerElement)
1453
+ return;
1454
+ if (e.propertyName !== "transform")
1455
+ return;
1456
+ const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
1457
+ this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
1458
+ };
1459
+ this.handlePointerDown = (e) => {
1460
+ if (this.loading || !this.open)
1461
+ return;
1462
+ if (e.pointerType === "mouse" && e.button !== 0)
1463
+ return;
1464
+ this.pendingDrag = true;
1465
+ this.startY = e.clientY;
1466
+ this.currentY = e.clientY;
1467
+ this.dragStartTime = Date.now();
1468
+ };
1469
+ this.handlePointerMove = (e) => {
1470
+ if (!this.pendingDrag && !this.isDragging)
1471
+ return;
1472
+ const y = e.clientY;
1473
+ if (this.pendingDrag) {
1474
+ const dy = y - this.startY;
1475
+ const absDy = Math.abs(dy);
1476
+ const ACTIVATE_PX = 8;
1477
+ const body = this.bodyElement;
1478
+ const atTop = !body || body.scrollTop <= 0;
1479
+ if (absDy >= ACTIVATE_PX && atTop) {
1480
+ this.pendingDrag = false;
1481
+ this.startDrag(this.startY);
1482
+ e.target?.setPointerCapture?.(e.pointerId);
1483
+ } else {
1484
+ return;
1485
+ }
1486
+ }
1487
+ if (this.isDragging) {
1488
+ this.updateDrag(y);
1489
+ e.preventDefault();
1490
+ }
1491
+ };
1492
+ this.handlePointerUp = (e) => {
1493
+ if (this.pendingDrag) {
1494
+ this.pendingDrag = false;
1495
+ }
1496
+ if (this.isDragging) {
1497
+ this.endDrag();
1498
+ e.preventDefault();
1499
+ }
1500
+ e.target?.releasePointerCapture?.(e.pointerId);
1501
+ };
1502
+ this.handlePointerCancel = (e) => {
1503
+ if (this.pendingDrag)
1504
+ this.pendingDrag = false;
1505
+ if (this.isDragging)
1506
+ this.endDrag();
1507
+ e.target?.releasePointerCapture?.(e.pointerId);
1508
+ };
1509
+ this.handleTouchStart = (e) => {
1510
+ if (this.loading || !this.open)
1511
+ return;
1512
+ const target = e.target;
1513
+ if (target && target.closest && target.closest(".close-btn")) {
1514
+ return;
1515
+ }
1516
+ const touch = e.touches[0];
1517
+ this.pendingDrag = true;
1518
+ this.startY = touch.clientY;
1519
+ this.currentY = touch.clientY;
1520
+ };
1521
+ this.handleTouchMove = (e) => {
1522
+ const touch = e.touches[0];
1523
+ if (this.pendingDrag && !this.isDragging) {
1524
+ const dy = touch.clientY - this.startY;
1525
+ const absDy = Math.abs(dy);
1526
+ const ACTIVATE_PX = 8;
1527
+ const body = this.bodyElement;
1528
+ const atTop = !body || body.scrollTop <= 0;
1529
+ if (absDy >= ACTIVATE_PX) {
1530
+ if (atTop) {
1531
+ this.startDrag(this.startY);
1532
+ this.isDragging = true;
1533
+ this.pendingDrag = false;
1534
+ }
1535
+ }
1536
+ }
1537
+ if (!this.isDragging)
1538
+ return;
1539
+ this.updateDrag(touch.clientY);
1540
+ e.preventDefault();
1541
+ };
1542
+ this.handleTouchEnd = (e) => {
1543
+ this.pendingDrag = false;
1544
+ if (!this.isDragging)
1545
+ return;
1546
+ this.endDrag();
1547
+ e.preventDefault();
1548
+ };
1549
+ this.handleMouseDown = (e) => {
1550
+ if (this.loading || !this.open)
1551
+ return;
1552
+ this.startDrag(e.clientY);
1553
+ e.preventDefault();
1554
+ };
1555
+ this.handleMouseMove = (e) => {
1556
+ if (!this.isDragging)
1557
+ return;
1558
+ this.updateDrag(e.clientY);
1559
+ e.preventDefault();
1560
+ };
1561
+ this.handleMouseUp = (e) => {
1562
+ if (!this.isDragging)
1563
+ return;
1564
+ this.endDrag();
1565
+ e.preventDefault();
1566
+ };
1567
+ this.onClose = () => {
1568
+ if (this.loading)
1569
+ return;
1570
+ if (this.isClosing)
1571
+ return;
1572
+ if (this.drawerElement) {
1573
+ this.drawerElement.classList.remove("dragging");
1574
+ }
1575
+ this.open = false;
1576
+ dispatchLitCancel(this);
1577
+ this.isClosing = true;
1578
+ setTimeout(() => {
1579
+ this.isClosing = false;
1580
+ }, 300);
1581
+ };
1582
+ this.onHandleClick = () => {
1583
+ if (!this.open) {
1584
+ this.show();
1585
+ } else {
1586
+ this.hide("handle");
1587
+ }
1588
+ };
1589
+ this.onOverlayClick = () => {
1590
+ if (!this.closeOnOverlayClick)
1591
+ return;
1592
+ this.onClose();
1593
+ };
1437
1594
  this.open = false;
1438
1595
  this.theme = "dark";
1439
1596
  this.appearance = undefined;
@@ -1447,13 +1604,12 @@ var init_Drawer = __esm(() => {
1447
1604
  getComponentPrefix() {
1448
1605
  return "modal";
1449
1606
  }
1450
- _initialChildren = null;
1451
1607
  connectedCallback() {
1452
1608
  if (!this._initialChildren) {
1453
1609
  this._initialChildren = Array.from(this.childNodes);
1454
1610
  try {
1455
- for (const n6 of this._initialChildren)
1456
- this.removeChild(n6);
1611
+ for (const n of this._initialChildren)
1612
+ this.removeChild(n);
1457
1613
  } catch {}
1458
1614
  }
1459
1615
  super.connectedCallback();
@@ -1464,7 +1620,7 @@ var init_Drawer = __esm(() => {
1464
1620
  if (this._stylesReady)
1465
1621
  return true;
1466
1622
  if (!this._stylesAwaiting) {
1467
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
1623
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
1468
1624
  this._stylesAwaiting = settle.then(() => {
1469
1625
  this._stylesReady = true;
1470
1626
  this.requestUpdate();
@@ -1561,17 +1717,17 @@ var init_Drawer = __esm(() => {
1561
1717
  return;
1562
1718
  const host = this;
1563
1719
  const toMove = [];
1564
- host.childNodes.forEach((n6) => {
1565
- if (n6.nodeType !== Node.ELEMENT_NODE)
1720
+ host.childNodes.forEach((n) => {
1721
+ if (n.nodeType !== Node.ELEMENT_NODE)
1566
1722
  return;
1567
- const el = n6;
1723
+ const el = n;
1568
1724
  if (el.classList?.contains("overlay"))
1569
1725
  return;
1570
1726
  if (el.classList?.contains("drawer"))
1571
1727
  return;
1572
- toMove.push(n6);
1728
+ toMove.push(n);
1573
1729
  });
1574
- toMove.forEach((n6) => above.appendChild(n6));
1730
+ toMove.forEach((n) => above.appendChild(n));
1575
1731
  this.syncCssVarsForOpenTranslate();
1576
1732
  }
1577
1733
  get contentRoot() {
@@ -1579,10 +1735,10 @@ var init_Drawer = __esm(() => {
1579
1735
  return root && root.querySelector(".above-fold") || null;
1580
1736
  }
1581
1737
  getVisibleVh() {
1582
- const h5 = (this.height || "").trim();
1583
- const m3 = h5.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1584
- if (m3)
1585
- return clamp(parseFloat(m3[1]), 0, 100);
1738
+ const h = (this.height || "").trim();
1739
+ const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1740
+ if (m)
1741
+ return clamp(parseFloat(m[1]), 0, 100);
1586
1742
  return DEFAULT_VISIBLE_VH;
1587
1743
  }
1588
1744
  getOpenTranslateRatio() {
@@ -1595,15 +1751,15 @@ var init_Drawer = __esm(() => {
1595
1751
  return;
1596
1752
  if (this.isDragging || this.pendingDrag)
1597
1753
  return;
1598
- const h5 = (this.height || "").trim();
1599
- const m3 = h5.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1600
- if (m3) {
1601
- const unit2 = (m3[2] || "vh").toLowerCase();
1602
- const visibleVh = clamp(parseFloat(m3[1]), 0, 100);
1603
- const pct2 = clamp(100 - visibleVh, 0, 100);
1604
- this.setCssVars({ "--w3a-drawer__sheet-height": `100${unit2}` });
1754
+ const h = (this.height || "").trim();
1755
+ const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1756
+ if (m) {
1757
+ const unit = (m[2] || "vh").toLowerCase();
1758
+ const visibleVh = clamp(parseFloat(m[1]), 0, 100);
1759
+ const pct = clamp(100 - visibleVh, 0, 100);
1760
+ this.setCssVars({ "--w3a-drawer__sheet-height": `100${unit}` });
1605
1761
  if (!this.open) {
1606
- this.setCssVars({ "--w3a-drawer__open-translate": pct2 + "%" });
1762
+ this.setCssVars({ "--w3a-drawer__open-translate": pct + "%" });
1607
1763
  }
1608
1764
  return;
1609
1765
  }
@@ -1636,16 +1792,6 @@ var init_Drawer = __esm(() => {
1636
1792
  this._performSyncCssVarsForOpenTranslate();
1637
1793
  });
1638
1794
  }
1639
- handleTransitionEnd = (e6) => {
1640
- if (!this.drawerElement)
1641
- return;
1642
- if (e6.target !== this.drawerElement)
1643
- return;
1644
- if (e6.propertyName !== "transform")
1645
- return;
1646
- const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
1647
- this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
1648
- };
1649
1795
  setupAnimateWithContentSync() {
1650
1796
  const root = this.renderRoot;
1651
1797
  const host = root.querySelector(".drawer");
@@ -1670,12 +1816,12 @@ var init_Drawer = __esm(() => {
1670
1816
  };
1671
1817
  const syncTimingFromElement = (el) => {
1672
1818
  const cs = getComputedStyle(el);
1673
- const props = (cs.transitionProperty || "").split(",").map((s6) => s6.trim());
1674
- const durations = (cs.transitionDuration || "").split(",").map((s6) => s6.trim());
1675
- const easings = (cs.transitionTimingFunction || "").split(",").map((s6) => s6.trim());
1676
- let idx = props.findIndex((p4) => p4 === "height");
1819
+ const props = (cs.transitionProperty || "").split(",").map((s) => s.trim());
1820
+ const durations = (cs.transitionDuration || "").split(",").map((s) => s.trim());
1821
+ const easings = (cs.transitionTimingFunction || "").split(",").map((s) => s.trim());
1822
+ let idx = props.findIndex((p) => p === "height");
1677
1823
  if (idx < 0)
1678
- idx = props.findIndex((p4) => p4 === "all");
1824
+ idx = props.findIndex((p) => p === "all");
1679
1825
  if (idx < 0)
1680
1826
  idx = 0;
1681
1827
  const dur = durations[Math.min(idx, durations.length - 1)] || "100ms";
@@ -1686,28 +1832,28 @@ var init_Drawer = __esm(() => {
1686
1832
  });
1687
1833
  };
1688
1834
  const onRun = (ev) => {
1689
- const e6 = ev;
1835
+ const e = ev;
1690
1836
  if (!this.open)
1691
1837
  return;
1692
- if (e6.propertyName !== "height")
1838
+ if (e.propertyName !== "height")
1693
1839
  return;
1694
1840
  this._activeHeightTransitions++;
1695
1841
  ensureLoop();
1696
1842
  };
1697
1843
  const onStart = (ev) => {
1698
- const e6 = ev;
1844
+ const e = ev;
1699
1845
  if (!this.open)
1700
1846
  return;
1701
- if (e6.propertyName !== "height")
1847
+ if (e.propertyName !== "height")
1702
1848
  return;
1703
- if (e6.target && e6.target instanceof Element)
1704
- syncTimingFromElement(e6.target);
1849
+ if (e.target && e.target instanceof Element)
1850
+ syncTimingFromElement(e.target);
1705
1851
  this._activeHeightTransitions++;
1706
1852
  ensureLoop();
1707
1853
  };
1708
1854
  const onEnd = (ev) => {
1709
- const e6 = ev;
1710
- if (e6.propertyName !== "height")
1855
+ const e = ev;
1856
+ if (e.propertyName !== "height")
1711
1857
  return;
1712
1858
  this._activeHeightTransitions = Math.max(0, this._activeHeightTransitions - 1);
1713
1859
  if (this._activeHeightTransitions === 0)
@@ -1803,118 +1949,10 @@ var init_Drawer = __esm(() => {
1803
1949
  document.removeEventListener("pointerup", this.handlePointerUp);
1804
1950
  document.removeEventListener("pointercancel", this.handlePointerCancel);
1805
1951
  }
1806
- handlePointerDown = (e6) => {
1807
- if (this.loading || !this.open)
1808
- return;
1809
- if (e6.pointerType === "mouse" && e6.button !== 0)
1810
- return;
1811
- this.pendingDrag = true;
1812
- this.startY = e6.clientY;
1813
- this.currentY = e6.clientY;
1814
- this.dragStartTime = Date.now();
1815
- };
1816
- handlePointerMove = (e6) => {
1817
- if (!this.pendingDrag && !this.isDragging)
1818
- return;
1819
- const y3 = e6.clientY;
1820
- if (this.pendingDrag) {
1821
- const dy = y3 - this.startY;
1822
- const absDy = Math.abs(dy);
1823
- const ACTIVATE_PX = 8;
1824
- const body = this.bodyElement;
1825
- const atTop = !body || body.scrollTop <= 0;
1826
- if (absDy >= ACTIVATE_PX && atTop) {
1827
- this.pendingDrag = false;
1828
- this.startDrag(this.startY);
1829
- e6.target?.setPointerCapture?.(e6.pointerId);
1830
- } else {
1831
- return;
1832
- }
1833
- }
1834
- if (this.isDragging) {
1835
- this.updateDrag(y3);
1836
- e6.preventDefault();
1837
- }
1838
- };
1839
- handlePointerUp = (e6) => {
1840
- if (this.pendingDrag) {
1841
- this.pendingDrag = false;
1842
- }
1843
- if (this.isDragging) {
1844
- this.endDrag();
1845
- e6.preventDefault();
1846
- }
1847
- e6.target?.releasePointerCapture?.(e6.pointerId);
1848
- };
1849
- handlePointerCancel = (e6) => {
1850
- if (this.pendingDrag)
1851
- this.pendingDrag = false;
1852
- if (this.isDragging)
1853
- this.endDrag();
1854
- e6.target?.releasePointerCapture?.(e6.pointerId);
1855
- };
1856
- handleTouchStart = (e6) => {
1857
- if (this.loading || !this.open)
1858
- return;
1859
- const target = e6.target;
1860
- if (target && target.closest && target.closest(".close-btn")) {
1861
- return;
1862
- }
1863
- const touch = e6.touches[0];
1864
- this.pendingDrag = true;
1865
- this.startY = touch.clientY;
1866
- this.currentY = touch.clientY;
1867
- };
1868
- handleTouchMove = (e6) => {
1869
- const touch = e6.touches[0];
1870
- if (this.pendingDrag && !this.isDragging) {
1871
- const dy = touch.clientY - this.startY;
1872
- const absDy = Math.abs(dy);
1873
- const ACTIVATE_PX = 8;
1874
- const body = this.bodyElement;
1875
- const atTop = !body || body.scrollTop <= 0;
1876
- if (absDy >= ACTIVATE_PX) {
1877
- if (atTop) {
1878
- this.startDrag(this.startY);
1879
- this.isDragging = true;
1880
- this.pendingDrag = false;
1881
- } else {}
1882
- }
1883
- }
1884
- if (!this.isDragging)
1885
- return;
1886
- this.updateDrag(touch.clientY);
1887
- e6.preventDefault();
1888
- };
1889
- handleTouchEnd = (e6) => {
1890
- this.pendingDrag = false;
1891
- if (!this.isDragging)
1892
- return;
1893
- this.endDrag();
1894
- e6.preventDefault();
1895
- };
1896
- handleMouseDown = (e6) => {
1897
- if (this.loading || !this.open)
1898
- return;
1899
- this.startDrag(e6.clientY);
1900
- e6.preventDefault();
1901
- };
1902
- handleMouseMove = (e6) => {
1903
- if (!this.isDragging)
1904
- return;
1905
- this.updateDrag(e6.clientY);
1906
- e6.preventDefault();
1907
- };
1908
- handleMouseUp = (e6) => {
1909
- if (!this.isDragging)
1910
- return;
1911
- this.endDrag();
1912
- e6.preventDefault();
1913
- };
1914
- startDrag(y3) {
1952
+ startDrag(y) {
1915
1953
  this.isDragging = true;
1916
- this.startY = y3;
1917
- this.currentY = y3;
1954
+ this.startY = y;
1955
+ this.currentY = y;
1918
1956
  this.dragDistance = 0;
1919
1957
  this.dragStartTime = Date.now();
1920
1958
  this.lastDragTime = this.dragStartTime;
@@ -1935,17 +1973,17 @@ var init_Drawer = __esm(() => {
1935
1973
  this.drawerElement.classList.add("dragging");
1936
1974
  }
1937
1975
  }
1938
- updateDrag(y3) {
1976
+ updateDrag(y) {
1939
1977
  if (!this.isDragging || !this.drawerElement)
1940
1978
  return;
1941
1979
  const now = Date.now();
1942
1980
  const deltaTime = now - this.lastDragTime;
1943
- const deltaY = y3 - this.currentY;
1981
+ const deltaY = y - this.currentY;
1944
1982
  if (deltaTime > 0) {
1945
1983
  this.velocity = deltaY / deltaTime;
1946
1984
  }
1947
- this.currentY = y3;
1948
- this.dragDistance = y3 - this.startY;
1985
+ this.currentY = y;
1986
+ this.dragDistance = y - this.startY;
1949
1987
  const viewportHalf = typeof window !== "undefined" && window.innerHeight ? window.innerHeight * OVERPULL_VIEWPORT_FACTOR : 0;
1950
1988
  const maxOverdragUpPx = Math.max(this.drawerHeight * OVERPULL_SHEET_FACTOR, viewportHalf, this.overpullPx);
1951
1989
  const rawTargetTranslateY = this.startTranslateYPx + this.dragDistance;
@@ -1999,11 +2037,11 @@ var init_Drawer = __esm(() => {
1999
2037
  if (!transform || transform === "none")
2000
2038
  return NaN;
2001
2039
  if (transform.startsWith("matrix(")) {
2002
- const values = transform.slice(7, -1).split(",").map((v3) => parseFloat(v3.trim()));
2040
+ const values = transform.slice(7, -1).split(",").map((v) => parseFloat(v.trim()));
2003
2041
  return values.length === 6 ? values[5] : NaN;
2004
2042
  }
2005
2043
  if (transform.startsWith("matrix3d(")) {
2006
- const values = transform.slice(9, -1).split(",").map((v3) => parseFloat(v3.trim()));
2044
+ const values = transform.slice(9, -1).split(",").map((v) => parseFloat(v.trim()));
2007
2045
  return values.length === 16 ? values[13] : NaN;
2008
2046
  }
2009
2047
  const match = transform.match(/translateY\(([-\d.]+)px\)/);
@@ -2024,28 +2062,6 @@ var init_Drawer = __esm(() => {
2024
2062
  this.isClosing = false;
2025
2063
  }, 300);
2026
2064
  }
2027
- onClose = () => {
2028
- if (this.loading)
2029
- return;
2030
- if (this.isClosing)
2031
- return;
2032
- if (this.drawerElement) {
2033
- this.drawerElement.classList.remove("dragging");
2034
- }
2035
- this.open = false;
2036
- dispatchLitCancel(this);
2037
- this.isClosing = true;
2038
- setTimeout(() => {
2039
- this.isClosing = false;
2040
- }, 300);
2041
- };
2042
- onHandleClick = () => {
2043
- if (!this.open) {
2044
- this.show();
2045
- } else {
2046
- this.hide("handle");
2047
- }
2048
- };
2049
2065
  show() {
2050
2066
  if (this.drawerElement) {
2051
2067
  this.drawerElement.classList.remove("dragging");
@@ -2095,11 +2111,6 @@ var init_Drawer = __esm(() => {
2095
2111
  </section>
2096
2112
  `;
2097
2113
  }
2098
- onOverlayClick = () => {
2099
- if (!this.closeOnOverlayClick)
2100
- return;
2101
- this.onClose();
2102
- };
2103
2114
  };
2104
2115
  Drawer_default = function ensureDefined() {
2105
2116
  const TAG = W3A_DRAWER_ID;
@@ -2111,44 +2122,44 @@ var init_Drawer = __esm(() => {
2111
2122
  });
2112
2123
 
2113
2124
  // ../shared-ts/src/near/actions.ts
2114
- function fromActionArgsWasm(a3) {
2115
- switch (a3.action_type) {
2125
+ function fromActionArgsWasm(a) {
2126
+ switch (a.action_type) {
2116
2127
  case "FunctionCall" /* FunctionCall */: {
2117
2128
  let parsedArgs = {};
2118
2129
  try {
2119
- parsedArgs = typeof a3.args === "string" ? a3.args ? JSON.parse(a3.args) : {} : a3.args || {};
2130
+ parsedArgs = typeof a.args === "string" ? a.args ? JSON.parse(a.args) : {} : a.args || {};
2120
2131
  } catch {
2121
2132
  parsedArgs = {};
2122
2133
  }
2123
2134
  return {
2124
2135
  type: "FunctionCall" /* FunctionCall */,
2125
- methodName: a3.method_name,
2136
+ methodName: a.method_name,
2126
2137
  args: parsedArgs,
2127
- gas: a3.gas,
2128
- deposit: a3.deposit
2138
+ gas: a.gas,
2139
+ deposit: a.deposit
2129
2140
  };
2130
2141
  }
2131
2142
  case "Transfer" /* Transfer */:
2132
- return { type: "Transfer" /* Transfer */, amount: a3.deposit };
2143
+ return { type: "Transfer" /* Transfer */, amount: a.deposit };
2133
2144
  case "CreateAccount" /* CreateAccount */:
2134
2145
  return { type: "CreateAccount" /* CreateAccount */ };
2135
2146
  case "DeployContract" /* DeployContract */:
2136
2147
  return {
2137
2148
  type: "DeployContract" /* DeployContract */,
2138
- code: Array.isArray(a3.code) ? new Uint8Array(a3.code) : new Uint8Array
2149
+ code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array
2139
2150
  };
2140
2151
  case "DeployGlobalContract" /* DeployGlobalContract */:
2141
2152
  return {
2142
2153
  type: "DeployGlobalContract" /* DeployGlobalContract */,
2143
- code: Array.isArray(a3.code) ? new Uint8Array(a3.code) : new Uint8Array,
2144
- deployMode: a3.deploy_mode
2154
+ code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array,
2155
+ deployMode: a.deploy_mode
2145
2156
  };
2146
2157
  case "Stake" /* Stake */:
2147
- return { type: "Stake" /* Stake */, stake: a3.stake, publicKey: a3.public_key };
2158
+ return { type: "Stake" /* Stake */, stake: a.stake, publicKey: a.public_key };
2148
2159
  case "AddKey" /* AddKey */: {
2149
2160
  let accessKey;
2150
2161
  try {
2151
- accessKey = JSON.parse(a3.access_key);
2162
+ accessKey = JSON.parse(a.access_key);
2152
2163
  } catch {
2153
2164
  accessKey = { nonce: BigInt(0), permission: "FullAccess" };
2154
2165
  }
@@ -2170,7 +2181,7 @@ function fromActionArgsWasm(a3) {
2170
2181
  }
2171
2182
  return {
2172
2183
  type: "AddKey" /* AddKey */,
2173
- publicKey: a3.public_key,
2184
+ publicKey: a.public_key,
2174
2185
  accessKey: {
2175
2186
  nonce: typeof accessKey?.nonce === "number" ? accessKey.nonce : 0,
2176
2187
  permission: normalizedPermission
@@ -2178,13 +2189,13 @@ function fromActionArgsWasm(a3) {
2178
2189
  };
2179
2190
  }
2180
2191
  case "DeleteKey" /* DeleteKey */:
2181
- return { type: "DeleteKey" /* DeleteKey */, publicKey: a3.public_key };
2192
+ return { type: "DeleteKey" /* DeleteKey */, publicKey: a.public_key };
2182
2193
  case "DeleteAccount" /* DeleteAccount */:
2183
- return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId: a3.beneficiary_id };
2194
+ return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId: a.beneficiary_id };
2184
2195
  case "UseGlobalContract" /* UseGlobalContract */:
2185
- return { type: "UseGlobalContract" /* UseGlobalContract */, accountId: a3.account_id, codeHash: a3.code_hash };
2196
+ return { type: "UseGlobalContract" /* UseGlobalContract */, accountId: a.account_id, codeHash: a.code_hash };
2186
2197
  default:
2187
- throw new Error(`Unsupported wasm action_type: ${a3?.action_type}`);
2198
+ throw new Error(`Unsupported wasm action_type: ${a?.action_type}`);
2188
2199
  }
2189
2200
  }
2190
2201
  function fromTransactionInputWasm(tx) {
@@ -2206,74 +2217,74 @@ var init_actions2 = __esm(() => {
2206
2217
  });
2207
2218
 
2208
2219
  // ../../node_modules/lit-html/directives/repeat.js
2209
- var u4 = (e6, s6, t5) => {
2210
- const r6 = new Map;
2211
- for (let l3 = s6;l3 <= t5; l3++)
2212
- r6.set(e6[l3], l3);
2213
- return r6;
2220
+ var u4 = (e, s, t) => {
2221
+ const r = new Map;
2222
+ for (let l = s;l <= t; l++)
2223
+ r.set(e[l], l);
2224
+ return r;
2214
2225
  }, c5;
2215
2226
  var init_repeat = __esm(() => {
2216
2227
  init_lit_html();
2217
2228
  init_directive();
2218
2229
  init_directive_helpers();
2219
2230
  c5 = e4(class extends i5 {
2220
- constructor(e6) {
2221
- if (super(e6), e6.type !== t4.CHILD)
2231
+ constructor(e) {
2232
+ if (super(e), e.type !== t4.CHILD)
2222
2233
  throw Error("repeat() can only be used in text expressions");
2223
2234
  }
2224
- dt(e6, s6, t5) {
2225
- let r6;
2226
- t5 === undefined ? t5 = s6 : s6 !== undefined && (r6 = s6);
2227
- const l3 = [], o7 = [];
2228
- let i6 = 0;
2229
- for (const s7 of e6)
2230
- l3[i6] = r6 ? r6(s7, i6) : i6, o7[i6] = t5(s7, i6), i6++;
2231
- return { values: o7, keys: l3 };
2232
- }
2233
- render(e6, s6, t5) {
2234
- return this.dt(e6, s6, t5).values;
2235
- }
2236
- update(s6, [t5, r6, c6]) {
2237
- const d3 = p3(s6), { values: p4, keys: a3 } = this.dt(t5, r6, c6);
2238
- if (!Array.isArray(d3))
2239
- return this.ut = a3, p4;
2240
- const h5 = this.ut ??= [], v3 = [];
2241
- let m3, y3, x2 = 0, j2 = d3.length - 1, k2 = 0, w2 = p4.length - 1;
2242
- for (;x2 <= j2 && k2 <= w2; )
2243
- if (d3[x2] === null)
2244
- x2++;
2245
- else if (d3[j2] === null)
2246
- j2--;
2247
- else if (h5[x2] === a3[k2])
2248
- v3[k2] = v2(d3[x2], p4[k2]), x2++, k2++;
2249
- else if (h5[j2] === a3[w2])
2250
- v3[w2] = v2(d3[j2], p4[w2]), j2--, w2--;
2251
- else if (h5[x2] === a3[w2])
2252
- v3[w2] = v2(d3[x2], p4[w2]), s4(s6, v3[w2 + 1], d3[x2]), x2++, w2--;
2253
- else if (h5[j2] === a3[k2])
2254
- v3[k2] = v2(d3[j2], p4[k2]), s4(s6, d3[x2], d3[j2]), j2--, k2++;
2255
- else if (m3 === undefined && (m3 = u4(a3, k2, w2), y3 = u4(h5, x2, j2)), m3.has(h5[x2]))
2256
- if (m3.has(h5[j2])) {
2257
- const e6 = y3.get(a3[k2]), t6 = e6 !== undefined ? d3[e6] : null;
2258
- if (t6 === null) {
2259
- const e7 = s4(s6, d3[x2]);
2260
- v2(e7, p4[k2]), v3[k2] = e7;
2235
+ dt(e, s, t) {
2236
+ let r;
2237
+ t === undefined ? t = s : s !== undefined && (r = s);
2238
+ const l = [], o = [];
2239
+ let i = 0;
2240
+ for (const s of e)
2241
+ l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
2242
+ return { values: o, keys: l };
2243
+ }
2244
+ render(e, s, t) {
2245
+ return this.dt(e, s, t).values;
2246
+ }
2247
+ update(s, [t, r, c]) {
2248
+ const d = p3(s), { values: p, keys: a } = this.dt(t, r, c);
2249
+ if (!Array.isArray(d))
2250
+ return this.ut = a, p;
2251
+ const h = this.ut ??= [], v = [];
2252
+ let m, y, x = 0, j = d.length - 1, k = 0, w = p.length - 1;
2253
+ for (;x <= j && k <= w; )
2254
+ if (d[x] === null)
2255
+ x++;
2256
+ else if (d[j] === null)
2257
+ j--;
2258
+ else if (h[x] === a[k])
2259
+ v[k] = v2(d[x], p[k]), x++, k++;
2260
+ else if (h[j] === a[w])
2261
+ v[w] = v2(d[j], p[w]), j--, w--;
2262
+ else if (h[x] === a[w])
2263
+ v[w] = v2(d[x], p[w]), s4(s, v[w + 1], d[x]), x++, w--;
2264
+ else if (h[j] === a[k])
2265
+ v[k] = v2(d[j], p[k]), s4(s, d[x], d[j]), j--, k++;
2266
+ else if (m === undefined && (m = u4(a, k, w), y = u4(h, x, j)), m.has(h[x]))
2267
+ if (m.has(h[j])) {
2268
+ const e = y.get(a[k]), t = e !== undefined ? d[e] : null;
2269
+ if (t === null) {
2270
+ const e = s4(s, d[x]);
2271
+ v2(e, p[k]), v[k] = e;
2261
2272
  } else
2262
- v3[k2] = v2(t6, p4[k2]), s4(s6, d3[x2], t6), d3[e6] = null;
2263
- k2++;
2273
+ v[k] = v2(t, p[k]), s4(s, d[x], t), d[e] = null;
2274
+ k++;
2264
2275
  } else
2265
- M2(d3[j2]), j2--;
2276
+ M2(d[j]), j--;
2266
2277
  else
2267
- M2(d3[x2]), x2++;
2268
- for (;k2 <= w2; ) {
2269
- const e6 = s4(s6, v3[w2 + 1]);
2270
- v2(e6, p4[k2]), v3[k2++] = e6;
2278
+ M2(d[x]), x++;
2279
+ for (;k <= w; ) {
2280
+ const e = s4(s, v[w + 1]);
2281
+ v2(e, p[k]), v[k++] = e;
2271
2282
  }
2272
- for (;x2 <= j2; ) {
2273
- const e6 = d3[x2++];
2274
- e6 !== null && M2(e6);
2283
+ for (;x <= j; ) {
2284
+ const e = d[x++];
2285
+ e !== null && M2(e);
2275
2286
  }
2276
- return this.ut = a3, m2(s6, v3), T;
2287
+ return this.ut = a, m2(s, v), T;
2277
2288
  }
2278
2289
  });
2279
2290
  });
@@ -2697,8 +2708,8 @@ var fromScale = (prefix, scale) => {
2697
2708
  if (!scale)
2698
2709
  return {};
2699
2710
  const out = {};
2700
- for (const k2 of Object.keys(scale))
2701
- out[`${prefix}${k2}`] = scale[k2];
2711
+ for (const k of Object.keys(scale))
2712
+ out[`${prefix}${k}`] = scale[k];
2702
2713
  return out;
2703
2714
  };
2704
2715
  var init_base_styles = () => {};
@@ -2953,7 +2964,7 @@ function formatArgs(args) {
2953
2964
  if (typeof args === "string")
2954
2965
  return args;
2955
2966
  try {
2956
- return JSON.stringify(args, (_k, v3) => typeof v3 === "bigint" ? v3.toString() : v3, 2);
2967
+ return JSON.stringify(args, (_k, v) => typeof v === "bigint" ? v.toString() : v, 2);
2957
2968
  } catch {
2958
2969
  return String(args);
2959
2970
  }
@@ -3028,6 +3039,98 @@ var init_TxTree = __esm(() => {
3028
3039
  init_registry();
3029
3040
  HEIGHT_DRIVEN_CLASSES = ["anim-h", "anim-h-active", "anim-h-driven"];
3030
3041
  TxTree = class TxTree extends LitElementWithProps {
3042
+ constructor() {
3043
+ super(...arguments);
3044
+ this.showShadow = true;
3045
+ this._copied = new Set;
3046
+ this._copyTimers = new Map;
3047
+ this._fileContentModes = new Map;
3048
+ this._animating = new WeakSet;
3049
+ this.onFileContentToggleClick = (e, node) => {
3050
+ e.preventDefault();
3051
+ e.stopPropagation();
3052
+ if (!this.hasFileContentToggle(node))
3053
+ return;
3054
+ const shell = e.currentTarget?.closest(".file-content-shell") ?? null;
3055
+ const currentMode = this.resolveFileContentMode(node);
3056
+ const nextMode = currentMode === "decoded" ? "raw" : "decoded";
3057
+ const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
3058
+ if (shell) {
3059
+ shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
3060
+ this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
3061
+ }
3062
+ this._fileContentModes.set(node.id, nextMode);
3063
+ this.requestUpdate();
3064
+ if (!shell)
3065
+ return;
3066
+ this.updateComplete.then(() => {
3067
+ shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
3068
+ const toCssPx = shell.getBoundingClientRect().height;
3069
+ shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
3070
+ const claimed = announceClampedSurfaceResize({
3071
+ reason: `${node.id}:file-content-mode`,
3072
+ element: shell,
3073
+ drivenClasses: HEIGHT_DRIVEN_CLASSES,
3074
+ fromCssPx,
3075
+ toCssPx,
3076
+ setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
3077
+ });
3078
+ if (!claimed)
3079
+ shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
3080
+ });
3081
+ };
3082
+ this.onSummaryClick = (e) => {
3083
+ const summary = e.currentTarget;
3084
+ if (!summary)
3085
+ return;
3086
+ const path = typeof e.composedPath === "function" ? e.composedPath() : undefined;
3087
+ let clickedReceiverLink = null;
3088
+ if (Array.isArray(path)) {
3089
+ for (const t of path) {
3090
+ if (t instanceof Element && t.matches("a.highlight-receiver-id")) {
3091
+ clickedReceiverLink = t;
3092
+ break;
3093
+ }
3094
+ }
3095
+ } else {
3096
+ const target = e.target;
3097
+ clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
3098
+ }
3099
+ if (clickedReceiverLink) {
3100
+ e.preventDefault();
3101
+ e.stopPropagation();
3102
+ dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
3103
+ try {
3104
+ window.open(clickedReceiverLink.href, "_blank", "noopener");
3105
+ } catch {}
3106
+ return;
3107
+ }
3108
+ e.preventDefault();
3109
+ e.stopPropagation();
3110
+ const details = summary.closest("details");
3111
+ if (!details || this._animating.has(details))
3112
+ return;
3113
+ const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
3114
+ if (!body) {
3115
+ details.open = !details.open;
3116
+ this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
3117
+ return;
3118
+ }
3119
+ const reduceMotion = (() => {
3120
+ return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
3121
+ })();
3122
+ if (reduceMotion) {
3123
+ details.open = !details.open;
3124
+ this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
3125
+ return;
3126
+ }
3127
+ if (!details.open) {
3128
+ this.animateOpen(details, body);
3129
+ } else {
3130
+ this.animateClose(details, body);
3131
+ }
3132
+ };
3133
+ }
3031
3134
  static properties = {
3032
3135
  node: { attribute: false },
3033
3136
  depth: { type: Number, attribute: false },
@@ -3041,26 +3144,11 @@ var init_TxTree = __esm(() => {
3041
3144
  evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
3042
3145
  showShadow: { type: Boolean, attribute: "show-shadow" }
3043
3146
  };
3044
- node;
3045
- depth;
3046
- theme;
3047
- appearance;
3048
- class;
3049
- width;
3050
- shadowDom;
3051
- nearExplorerUrl;
3052
- tempoExplorerUrl;
3053
- evmExplorerUrl;
3054
- showShadow = true;
3055
- _copied = new Set;
3056
- _copyTimers = new Map;
3057
- _fileContentModes = new Map;
3058
- _animating = new WeakSet;
3059
3147
  isCopied(id) {
3060
3148
  return this._copied.has(id);
3061
3149
  }
3062
- async handleCopyClick(e6, node) {
3063
- e6.stopPropagation();
3150
+ async handleCopyClick(e, node) {
3151
+ e.stopPropagation();
3064
3152
  const value = node.copyValue;
3065
3153
  if (!value)
3066
3154
  return;
@@ -3122,94 +3210,10 @@ var init_TxTree = __esm(() => {
3122
3210
  const mode = this.resolveFileContentMode(node);
3123
3211
  return mode === "raw" ? variants.raw : variants.decoded;
3124
3212
  }
3125
- onFileContentToggleClick = (e6, node) => {
3126
- e6.preventDefault();
3127
- e6.stopPropagation();
3128
- if (!this.hasFileContentToggle(node))
3129
- return;
3130
- const shell = e6.currentTarget?.closest(".file-content-shell") ?? null;
3131
- const currentMode = this.resolveFileContentMode(node);
3132
- const nextMode = currentMode === "decoded" ? "raw" : "decoded";
3133
- const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
3134
- if (shell) {
3135
- shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
3136
- this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
3137
- }
3138
- this._fileContentModes.set(node.id, nextMode);
3139
- this.requestUpdate();
3140
- if (!shell)
3141
- return;
3142
- this.updateComplete.then(() => {
3143
- shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
3144
- const toCssPx = shell.getBoundingClientRect().height;
3145
- shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
3146
- const claimed = announceClampedSurfaceResize({
3147
- reason: `${node.id}:file-content-mode`,
3148
- element: shell,
3149
- drivenClasses: HEIGHT_DRIVEN_CLASSES,
3150
- fromCssPx,
3151
- toCssPx,
3152
- setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
3153
- });
3154
- if (!claimed)
3155
- shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
3156
- });
3157
- };
3158
3213
  handleToggle(detail) {
3159
3214
  dispatchLitTreeToggled(this);
3160
3215
  dispatchTxReviewToggleNode(this, detail);
3161
3216
  }
3162
- onSummaryClick = (e6) => {
3163
- const summary = e6.currentTarget;
3164
- if (!summary)
3165
- return;
3166
- const path = typeof e6.composedPath === "function" ? e6.composedPath() : undefined;
3167
- let clickedReceiverLink = null;
3168
- if (Array.isArray(path)) {
3169
- for (const t5 of path) {
3170
- if (t5 instanceof Element && t5.matches("a.highlight-receiver-id")) {
3171
- clickedReceiverLink = t5;
3172
- break;
3173
- }
3174
- }
3175
- } else {
3176
- const target = e6.target;
3177
- clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
3178
- }
3179
- if (clickedReceiverLink) {
3180
- e6.preventDefault();
3181
- e6.stopPropagation();
3182
- dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
3183
- try {
3184
- window.open(clickedReceiverLink.href, "_blank", "noopener");
3185
- } catch {}
3186
- return;
3187
- }
3188
- e6.preventDefault();
3189
- e6.stopPropagation();
3190
- const details = summary.closest("details");
3191
- if (!details || this._animating.has(details))
3192
- return;
3193
- const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
3194
- if (!body) {
3195
- details.open = !details.open;
3196
- this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
3197
- return;
3198
- }
3199
- const reduceMotion = (() => {
3200
- return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
3201
- })();
3202
- if (reduceMotion) {
3203
- details.open = !details.open;
3204
- this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
3205
- return;
3206
- }
3207
- if (!details.open) {
3208
- this.animateOpen(details, body);
3209
- } else {
3210
- this.animateClose(details, body);
3211
- }
3212
- };
3213
3217
  animateOpen(details, body) {
3214
3218
  this._animating.add(details);
3215
3219
  body.classList.add("anim-h", "anim-h-hold");
@@ -3305,9 +3309,9 @@ var init_TxTree = __esm(() => {
3305
3309
  }
3306
3310
  createRenderRoot() {
3307
3311
  if (this.shadowDom) {
3308
- const root2 = super.createRenderRoot();
3309
- ensureExternalStyles(root2, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
3310
- return root2;
3312
+ const root = super.createRenderRoot();
3313
+ ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
3314
+ return root;
3311
3315
  }
3312
3316
  ensureExternalStyles(this, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
3313
3317
  const root = this.getRootNode ? this.getRootNode() : null;
@@ -3363,7 +3367,7 @@ var init_TxTree = __esm(() => {
3363
3367
  }
3364
3368
  resolveContractExplorerHref(treeNode, contractAddress) {
3365
3369
  const chain = treeNode.chain;
3366
- const base2 = (() => {
3370
+ const base = (() => {
3367
3371
  if (chain === "tempo")
3368
3372
  return this.normalizeExplorerBase(this.tempoExplorerUrl);
3369
3373
  if (chain === "evm")
@@ -3372,9 +3376,9 @@ var init_TxTree = __esm(() => {
3372
3376
  return this.normalizeExplorerBase(this.nearExplorerUrl || "https://testnet.nearblocks.io");
3373
3377
  return;
3374
3378
  })();
3375
- if (!base2)
3379
+ if (!base)
3376
3380
  return;
3377
- return `${base2}/address/${encodeURIComponent(contractAddress)}`;
3381
+ return `${base}/address/${encodeURIComponent(contractAddress)}`;
3378
3382
  }
3379
3383
  renderContractTransactionLabel(treeNode) {
3380
3384
  const contractAddress = String(treeNode.contractAddress || "").trim();
@@ -3416,17 +3420,17 @@ var init_TxTree = __esm(() => {
3416
3420
  }
3417
3421
  renderLabelWithSelectiveHighlight(treeNode) {
3418
3422
  if (treeNode.action) {
3419
- const a3 = treeNode.action;
3420
- switch (a3.type) {
3423
+ const a = treeNode.action;
3424
+ switch (a.type) {
3421
3425
  case "FunctionCall": {
3422
- const method = a3.methodName;
3423
- const gasStr = formatGas(a3.gas);
3424
- const depositStr = formatDeposit(a3.deposit);
3426
+ const method = a.methodName;
3427
+ const gasStr = formatGas(a.gas);
3428
+ const depositStr = formatDeposit(a.deposit);
3425
3429
  return x`Calling <span class="highlight-method-name">${method}</span> ${depositStr !== "0 NEAR" ? x` with <span class="highlight-method-name">${depositStr}</span>` : ""}
3426
3430
  ${gasStr ? x` using <span class="highlight-method-name">${gasStr}</span>` : ""}`;
3427
3431
  }
3428
3432
  case "Transfer": {
3429
- const amount = formatDeposit(a3.amount);
3433
+ const amount = formatDeposit(a.amount);
3430
3434
  return x`Transfer <span class="highlight-amount">${amount}</span>`;
3431
3435
  }
3432
3436
  case "CreateAccount":
@@ -3434,26 +3438,26 @@ var init_TxTree = __esm(() => {
3434
3438
  case "DeleteAccount":
3435
3439
  return "Deleting Account";
3436
3440
  case "Stake":
3437
- return `Staking ${formatDeposit(a3.stake)}`;
3441
+ return `Staking ${formatDeposit(a.stake)}`;
3438
3442
  case "AddKey":
3439
3443
  return "Adding Key";
3440
3444
  case "DeleteKey":
3441
3445
  return "Deleting Key";
3442
3446
  case "DeployContract": {
3443
- const codeSize = formatCodeSize(a3.code);
3447
+ const codeSize = formatCodeSize(a.code);
3444
3448
  return `Deploying WASM contract (${codeSize})`;
3445
3449
  }
3446
3450
  case "DeployGlobalContract": {
3447
- const codeSize = formatCodeSize(a3.code);
3448
- const mode = a3.deployMode || "Unknown";
3451
+ const codeSize = formatCodeSize(a.code);
3452
+ const mode = a.deployMode || "Unknown";
3449
3453
  return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
3450
3454
  }
3451
3455
  case "UseGlobalContract": {
3452
- const accountId = a3.accountId;
3453
- const codeHash = a3.codeHash;
3456
+ const accountId = a.accountId;
3457
+ const codeHash = a.codeHash;
3454
3458
  if (accountId) {
3455
- const base2 = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
3456
- const href = `${base2}/address/${encodeURIComponent(String(accountId))}`;
3459
+ const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
3460
+ const href = `${base}/address/${encodeURIComponent(String(accountId))}`;
3457
3461
  return x`Use global contract
3458
3462
  <a
3459
3463
  class="highlight-receiver-id"
@@ -3472,7 +3476,7 @@ var init_TxTree = __esm(() => {
3472
3476
  }
3473
3477
  default: {
3474
3478
  const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
3475
- const typeText = a3.type || "Unknown";
3479
+ const typeText = a.type || "Unknown";
3476
3480
  return `Action${idxText}: ${typeText}`;
3477
3481
  }
3478
3482
  }
@@ -3482,8 +3486,8 @@ var init_TxTree = __esm(() => {
3482
3486
  const idx = treeNode.transactionIndex ?? 0;
3483
3487
  const prefix = total > 1 ? `Transaction ${idx + 1}: to ` : "Transaction to ";
3484
3488
  const receiverId = treeNode.transaction.receiverId;
3485
- const base2 = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
3486
- const href = `${base2}/address/${encodeURIComponent(receiverId)}`;
3489
+ const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
3490
+ const href = `${base}/address/${encodeURIComponent(receiverId)}`;
3487
3491
  return x`${prefix}<a
3488
3492
  class="highlight-receiver-id"
3489
3493
  href=${href}
@@ -3502,22 +3506,22 @@ var init_TxTree = __esm(() => {
3502
3506
  }
3503
3507
  computePlainLabel(treeNode) {
3504
3508
  if (treeNode.action) {
3505
- const a3 = treeNode.action;
3506
- switch (a3.type) {
3509
+ const a = treeNode.action;
3510
+ switch (a.type) {
3507
3511
  case "FunctionCall": {
3508
- const method = a3.methodName;
3509
- const gasStr = formatGas(a3.gas);
3510
- const depositStr = formatDeposit(a3.deposit);
3512
+ const method = a.methodName;
3513
+ const gasStr = formatGas(a.gas);
3514
+ const depositStr = formatDeposit(a.deposit);
3511
3515
  return `Calling ${method} with ${depositStr} using ${gasStr}`;
3512
3516
  }
3513
3517
  case "Transfer":
3514
- return `Transfer ${formatDeposit(a3.amount)}`;
3518
+ return `Transfer ${formatDeposit(a.amount)}`;
3515
3519
  case "CreateAccount":
3516
3520
  return "Creating Account";
3517
3521
  case "DeleteAccount":
3518
3522
  return "Deleting Account";
3519
3523
  case "Stake":
3520
- return `Staking ${formatDeposit(a3.stake)}`;
3524
+ return `Staking ${formatDeposit(a.stake)}`;
3521
3525
  case "AddKey":
3522
3526
  return "Adding Key";
3523
3527
  case "DeleteKey":
@@ -3525,13 +3529,13 @@ var init_TxTree = __esm(() => {
3525
3529
  case "DeployContract":
3526
3530
  return "Deploying WASM contract";
3527
3531
  case "DeployGlobalContract": {
3528
- const codeSize = formatCodeSize(a3.code);
3529
- const mode = a3.deployMode || "Unknown";
3532
+ const codeSize = formatCodeSize(a.code);
3533
+ const mode = a.deployMode || "Unknown";
3530
3534
  return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
3531
3535
  }
3532
3536
  case "UseGlobalContract": {
3533
- const accountId = a3.accountId;
3534
- const codeHash = a3.codeHash;
3537
+ const accountId = a.accountId;
3538
+ const codeHash = a.codeHash;
3535
3539
  if (accountId) {
3536
3540
  return `Use global contract by account ${String(accountId)}`;
3537
3541
  }
@@ -3542,7 +3546,7 @@ var init_TxTree = __esm(() => {
3542
3546
  }
3543
3547
  default: {
3544
3548
  const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
3545
- const typeText = a3.type || "Unknown";
3549
+ const typeText = a.type || "Unknown";
3546
3550
  return `Action${idxText}: ${typeText}`;
3547
3551
  }
3548
3552
  }
@@ -3585,7 +3589,7 @@ var init_TxTree = __esm(() => {
3585
3589
  ${node.copyValue ? x` <span
3586
3590
  class="copy-badge"
3587
3591
  data-copied=${this.isCopied(node.id)}
3588
- @click=${(e6) => this.handleCopyClick(e6, node)}
3592
+ @click=${(e) => this.handleCopyClick(e, node)}
3589
3593
  title=${this.isCopied(node.id) ? "Copied" : "Copy"}
3590
3594
  >
3591
3595
  ${this.isCopied(node.id) ? "copied" : "copy"}
@@ -3598,7 +3602,7 @@ var init_TxTree = __esm(() => {
3598
3602
  class="file-content-mode-toggle"
3599
3603
  title=${`Show ${toggleLabel}`}
3600
3604
  aria-label=${`Show ${toggleLabel}`}
3601
- @click=${(e6) => this.onFileContentToggleClick(e6, node)}
3605
+ @click=${(e) => this.onFileContentToggleClick(e, node)}
3602
3606
  >
3603
3607
  ${toggleLabel}
3604
3608
  </button>` : ""}
@@ -3624,7 +3628,7 @@ var init_TxTree = __esm(() => {
3624
3628
  <span
3625
3629
  class="copy-badge"
3626
3630
  data-copied=${this.isCopied(node.id)}
3627
- @click=${(e6) => this.handleCopyClick(e6, node)}
3631
+ @click=${(e) => this.handleCopyClick(e, node)}
3628
3632
  title=${this.isCopied(node.id) ? "Copied" : "Copy"}
3629
3633
  >${this.isCopied(node.id) ? "copied" : "copy"}</span
3630
3634
  >
@@ -3657,7 +3661,7 @@ var init_TxTree = __esm(() => {
3657
3661
  </summary>
3658
3662
  ${nodeChildren && nodeChildren.length > 0 ? x`
3659
3663
  <div class="folder-children">
3660
- ${c5(nodeChildren, (c6) => c6.id, (c6) => this.renderAnyNode(c6, depth + 1))}
3664
+ ${c5(nodeChildren, (c) => c.id, (c) => this.renderAnyNode(c, depth + 1))}
3661
3665
  </div>
3662
3666
  ` : x``}
3663
3667
  </details>
@@ -4156,49 +4160,49 @@ function hexToBytes(hex) {
4156
4160
  throw new Error(`Invalid hex (odd length): ${hex}`);
4157
4161
  }
4158
4162
  const bytes = new Uint8Array(normalized.length / 2);
4159
- for (let i6 = 0;i6 < bytes.length; i6++) {
4160
- const byte = normalized.slice(i6 * 2, i6 * 2 + 2);
4163
+ for (let i = 0;i < bytes.length; i++) {
4164
+ const byte = normalized.slice(i * 2, i * 2 + 2);
4161
4165
  const value = Number.parseInt(byte, 16);
4162
4166
  if (!Number.isFinite(value))
4163
4167
  throw new Error(`Invalid hex: ${hex}`);
4164
- bytes[i6] = value;
4168
+ bytes[i] = value;
4165
4169
  }
4166
4170
  return bytes;
4167
4171
  }
4168
4172
  function bytesToHex(bytes) {
4169
- return `0x${Array.from(bytes).map((b3) => b3.toString(16).padStart(2, "0")).join("")}`;
4173
+ return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
4170
4174
  }
4171
4175
 
4172
4176
  // ../shared-ts/src/utils/keccak.ts
4173
4177
  function rotateLeft64(value, shift) {
4174
- const n6 = BigInt(shift);
4175
- return (value << n6 | value >> 64n - n6) & UINT64_MASK;
4178
+ const n = BigInt(shift);
4179
+ return (value << n | value >> 64n - n) & UINT64_MASK;
4176
4180
  }
4177
4181
  function keccakF1600(state) {
4178
- const c6 = new Array(5);
4179
- const d3 = new Array(5);
4182
+ const c = new Array(5);
4183
+ const d = new Array(5);
4180
4184
  for (let round = 0;round < 24; round += 1) {
4181
- for (let x2 = 0;x2 < 5; x2 += 1) {
4182
- c6[x2] = state[x2] ^ state[x2 + 5] ^ state[x2 + 10] ^ state[x2 + 15] ^ state[x2 + 20];
4185
+ for (let x = 0;x < 5; x += 1) {
4186
+ c[x] = state[x] ^ state[x + 5] ^ state[x + 10] ^ state[x + 15] ^ state[x + 20];
4183
4187
  }
4184
- for (let x2 = 0;x2 < 5; x2 += 1) {
4185
- d3[x2] = c6[(x2 + 4) % 5] ^ rotateLeft64(c6[(x2 + 1) % 5], 1);
4188
+ for (let x = 0;x < 5; x += 1) {
4189
+ d[x] = c[(x + 4) % 5] ^ rotateLeft64(c[(x + 1) % 5], 1);
4186
4190
  }
4187
- for (let y3 = 0;y3 < 5; y3 += 1) {
4188
- const rowOffset = y3 * 5;
4189
- for (let x2 = 0;x2 < 5; x2 += 1) {
4190
- state[rowOffset + x2] ^= d3[x2];
4191
+ for (let y = 0;y < 5; y += 1) {
4192
+ const rowOffset = y * 5;
4193
+ for (let x = 0;x < 5; x += 1) {
4194
+ state[rowOffset + x] ^= d[x];
4191
4195
  }
4192
4196
  }
4193
4197
  let lane = state[1];
4194
- for (let i6 = 0;i6 < 24; i6 += 1) {
4195
- const targetIndex = PI_LANE_INDEXES[i6];
4198
+ for (let i = 0;i < 24; i += 1) {
4199
+ const targetIndex = PI_LANE_INDEXES[i];
4196
4200
  const nextLane = state[targetIndex];
4197
- state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[i6]);
4201
+ state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[i]);
4198
4202
  lane = nextLane;
4199
4203
  }
4200
- for (let y3 = 0;y3 < 5; y3 += 1) {
4201
- const rowOffset = y3 * 5;
4204
+ for (let y = 0;y < 5; y += 1) {
4205
+ const rowOffset = y * 5;
4202
4206
  const lane0 = state[rowOffset];
4203
4207
  const lane1 = state[rowOffset + 1];
4204
4208
  const lane2 = state[rowOffset + 2];
@@ -4221,8 +4225,8 @@ function absorbByte(state, offset, byte) {
4221
4225
  function keccak256Bytes(input) {
4222
4226
  const state = new Array(25).fill(0n);
4223
4227
  let offset = 0;
4224
- for (let i6 = 0;i6 < input.length; i6 += 1) {
4225
- absorbByte(state, offset, input[i6]);
4228
+ for (let i = 0;i < input.length; i += 1) {
4229
+ absorbByte(state, offset, input[i]);
4226
4230
  offset += 1;
4227
4231
  if (offset === KECCAK_RATE_BYTES) {
4228
4232
  keccakF1600(state);
@@ -4233,10 +4237,10 @@ function keccak256Bytes(input) {
4233
4237
  absorbByte(state, KECCAK_RATE_BYTES - 1, 128);
4234
4238
  keccakF1600(state);
4235
4239
  const out = new Uint8Array(KECCAK256_OUTPUT_BYTES);
4236
- for (let i6 = 0;i6 < KECCAK256_OUTPUT_BYTES; i6 += 1) {
4237
- const lane = state[Math.floor(i6 / 8)];
4238
- const laneShift = BigInt(i6 % 8 * 8);
4239
- out[i6] = Number(lane >> laneShift & 0xffn);
4240
+ for (let i = 0;i < KECCAK256_OUTPUT_BYTES; i += 1) {
4241
+ const lane = state[Math.floor(i / 8)];
4242
+ const laneShift = BigInt(i % 8 * 8);
4243
+ out[i] = Number(lane >> laneShift & 0xffn);
4240
4244
  }
4241
4245
  return out;
4242
4246
  }
@@ -4477,8 +4481,8 @@ function parseAbiTypeNode(args) {
4477
4481
  dynamic: baseType === "bytes" || baseType === "string"
4478
4482
  };
4479
4483
  }
4480
- for (let i6 = arrayDimensions.length - 1;i6 >= 0; i6 -= 1) {
4481
- const length = arrayDimensions[i6];
4484
+ for (let i = arrayDimensions.length - 1;i >= 0; i -= 1) {
4485
+ const length = arrayDimensions[i];
4482
4486
  node = {
4483
4487
  kind: "array",
4484
4488
  canonicalType: `${node.canonicalType}[${length == null ? "" : String(length)}]`,
@@ -4605,16 +4609,16 @@ function decodeTypeAt(typeNode, bytes, offset) {
4605
4609
  if (!decodedItems)
4606
4610
  return null;
4607
4611
  const out = {};
4608
- for (let i6 = 0;i6 < typeNode.components.length; i6 += 1) {
4609
- const component = typeNode.components[i6];
4610
- const baseName = String(component.name || "").trim() || `item${i6}`;
4612
+ for (let i = 0;i < typeNode.components.length; i += 1) {
4613
+ const component = typeNode.components[i];
4614
+ const baseName = String(component.name || "").trim() || `item${i}`;
4611
4615
  let name = baseName;
4612
4616
  let counter = 1;
4613
4617
  while (Object.prototype.hasOwnProperty.call(out, name)) {
4614
4618
  counter += 1;
4615
4619
  name = `${baseName}_${counter}`;
4616
4620
  }
4617
- out[name] = decodedItems[i6];
4621
+ out[name] = decodedItems[i];
4618
4622
  }
4619
4623
  return out;
4620
4624
  }
@@ -4628,8 +4632,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
4628
4632
  const baseOffset = isDynamicArray ? offset + WORD_SIZE : offset;
4629
4633
  const items = [];
4630
4634
  if (typeNode.item.dynamic) {
4631
- for (let i6 = 0;i6 < arrayLength; i6 += 1) {
4632
- const itemRelativeOffset = readWordNumber(bytes, baseOffset + i6 * WORD_SIZE);
4635
+ for (let i = 0;i < arrayLength; i += 1) {
4636
+ const itemRelativeOffset = readWordNumber(bytes, baseOffset + i * WORD_SIZE);
4633
4637
  if (itemRelativeOffset == null)
4634
4638
  return null;
4635
4639
  const decoded = decodeTypeAt(typeNode.item, bytes, baseOffset + itemRelativeOffset);
@@ -4640,8 +4644,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
4640
4644
  return items;
4641
4645
  }
4642
4646
  const itemWords = staticWordLength(typeNode.item);
4643
- for (let i6 = 0;i6 < arrayLength; i6 += 1) {
4644
- const itemOffset = baseOffset + i6 * itemWords * WORD_SIZE;
4647
+ for (let i = 0;i < arrayLength; i += 1) {
4648
+ const itemOffset = baseOffset + i * itemWords * WORD_SIZE;
4645
4649
  const decoded = decodeTypeAt(typeNode.item, bytes, itemOffset);
4646
4650
  if (decoded == null)
4647
4651
  return null;
@@ -4657,17 +4661,17 @@ function decodeTupleComponents(components, bytes, tupleOffset) {
4657
4661
  cursorWords += component.typeNode.dynamic ? 1 : staticWordLength(component.typeNode);
4658
4662
  }
4659
4663
  const out = [];
4660
- for (let i6 = 0;i6 < components.length; i6 += 1) {
4661
- const component = components[i6];
4662
- const headOffset = tupleOffset + headOffsets[i6];
4664
+ for (let i = 0;i < components.length; i += 1) {
4665
+ const component = components[i];
4666
+ const headOffset = tupleOffset + headOffsets[i];
4663
4667
  if (component.typeNode.dynamic) {
4664
4668
  const relativeOffset = readWordNumber(bytes, headOffset);
4665
4669
  if (relativeOffset == null)
4666
4670
  return null;
4667
- const decoded2 = decodeTypeAt(component.typeNode, bytes, tupleOffset + relativeOffset);
4668
- if (decoded2 == null)
4671
+ const decoded = decodeTypeAt(component.typeNode, bytes, tupleOffset + relativeOffset);
4672
+ if (decoded == null)
4669
4673
  return null;
4670
- out.push(decoded2);
4674
+ out.push(decoded);
4671
4675
  continue;
4672
4676
  }
4673
4677
  const decoded = decodeTypeAt(component.typeNode, bytes, headOffset);
@@ -4750,10 +4754,6 @@ var init_abiDecode = __esm(() => {
4750
4754
  });
4751
4755
 
4752
4756
  // src/core/signingEngine/uiConfirm/ui/lit-components/TxTree/abi/enrichDisplayModelWithAbi.ts
4753
- var exports_enrichDisplayModelWithAbi = {};
4754
- __export(exports_enrichDisplayModelWithAbi, {
4755
- enrichDisplayModelWithAbi: () => enrichDisplayModelWithAbi
4756
- });
4757
4757
  function isGenericContractCallOperation(operation) {
4758
4758
  return operation.kind === "generic.contractCall";
4759
4759
  }
@@ -4851,12 +4851,6 @@ var init_tx_confirm_content = __esm(() => {
4851
4851
  init_registry();
4852
4852
  init_registry();
4853
4853
  TxConfirmContentElement = class TxConfirmContentElement extends LitElementWithProps {
4854
- _heightReflow = createSurfaceHeightReflow({
4855
- reason: "tx-body",
4856
- element: () => this.querySelector(".txc-root"),
4857
- setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
4858
- settled: () => this.updateComplete
4859
- });
4860
4854
  static requiredChildTags = [W3A_TX_TREE_ID];
4861
4855
  static keepDefinitions = [TxTree_default];
4862
4856
  static properties = {
@@ -4879,22 +4873,39 @@ var init_tx_confirm_content = __esm(() => {
4879
4873
  evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
4880
4874
  showShadow: { type: Boolean, attribute: "show-shadow" }
4881
4875
  };
4882
- _treeNode = null;
4883
- _ensureTreeDefinition = TxTree_default;
4884
- _stylesReady = false;
4885
- _stylePromises = [];
4886
- _stylesAwaiting = null;
4887
4876
  static _STYLE_MARKERS = [
4888
4877
  "data-w3a-tx-tree-css",
4889
4878
  "data-w3a-tx-confirmer-css",
4890
4879
  "data-w3a-components-css"
4891
4880
  ];
4892
- _treeBuildVersion = 0;
4893
- _confirmArmed = false;
4894
- _confirmArmRaf1 = null;
4895
- _confirmArmRaf2 = null;
4896
4881
  constructor() {
4897
4882
  super();
4883
+ this._heightReflow = createSurfaceHeightReflow({
4884
+ reason: "tx-body",
4885
+ element: () => this.querySelector(".txc-root"),
4886
+ setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
4887
+ settled: () => this.updateComplete
4888
+ });
4889
+ this._treeNode = null;
4890
+ this._ensureTreeDefinition = TxTree_default;
4891
+ this._stylesReady = false;
4892
+ this._stylePromises = [];
4893
+ this._stylesAwaiting = null;
4894
+ this._treeBuildVersion = 0;
4895
+ this._confirmArmed = false;
4896
+ this._confirmArmRaf1 = null;
4897
+ this._confirmArmRaf2 = null;
4898
+ this._stopDragStart = (e) => {
4899
+ e.stopPropagation();
4900
+ };
4901
+ this.onConfirm = () => {
4902
+ if (this.loading || !this._confirmArmed)
4903
+ return;
4904
+ dispatchLitConfirm(this);
4905
+ };
4906
+ this.onCancel = () => {
4907
+ dispatchLitCancel(this);
4908
+ };
4898
4909
  const root = document?.documentElement || null;
4899
4910
  if (root) {
4900
4911
  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"));
@@ -4944,8 +4955,8 @@ var init_tx_confirm_content = __esm(() => {
4944
4955
  return true;
4945
4956
  }
4946
4957
  if (!this._stylesAwaiting) {
4947
- const p4 = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
4948
- this._stylesAwaiting = p4.then(() => {
4958
+ const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
4959
+ this._stylesAwaiting = p.then(() => {
4949
4960
  this._stylesReady = true;
4950
4961
  this._rebuildTree();
4951
4962
  });
@@ -4985,17 +4996,17 @@ var init_tx_confirm_content = __esm(() => {
4985
4996
  }
4986
4997
  }
4987
4998
  _applyTooltipWidthVar() {
4988
- const w2 = this._normalizeWidth(this.tooltipWidth);
4989
- if (w2)
4990
- this.setCssVars({ "--tooltip-width": w2 });
4999
+ const w = this._normalizeWidth(this.tooltipWidth);
5000
+ if (w)
5001
+ this.setCssVars({ "--tooltip-width": w });
4991
5002
  }
4992
5003
  _normalizeWidth(val) {
4993
5004
  if (val === undefined || val === null)
4994
5005
  return;
4995
5006
  if (typeof val === "number" && Number.isFinite(val))
4996
5007
  return `${val}px`;
4997
- const s6 = String(val).trim();
4998
- return s6.length ? s6 : undefined;
5008
+ const s = String(val).trim();
5009
+ return s.length ? s : undefined;
4999
5010
  }
5000
5011
  _operationHasAbiDecodeHint(operation) {
5001
5012
  const hint = operation.abiDecodeHint;
@@ -5021,10 +5032,10 @@ var init_tx_confirm_content = __esm(() => {
5021
5032
  }
5022
5033
  async _enrichTreeWithAbi(args) {
5023
5034
  try {
5024
- const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(), exports_enrichDisplayModelWithAbi));
5035
+ const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(), {}));
5025
5036
  if (args.buildVersion !== this._treeBuildVersion)
5026
5037
  return;
5027
- const enrichedModel = module.enrichDisplayModelWithAbi(args.model);
5038
+ const enrichedModel = enrichDisplayModelWithAbi(args.model);
5028
5039
  if (args.buildVersion !== this._treeBuildVersion)
5029
5040
  return;
5030
5041
  this._treeNode = buildDisplayTreeFromModel(enrichedModel);
@@ -5067,23 +5078,12 @@ var init_tx_confirm_content = __esm(() => {
5067
5078
  return;
5068
5079
  }
5069
5080
  this._treeNode = null;
5070
- } catch (e6) {
5071
- console.warn("[TxConfirmContent] failed to build TxTree", e6);
5081
+ } catch (e) {
5082
+ console.warn("[TxConfirmContent] failed to build TxTree", e);
5072
5083
  this._treeNode = null;
5073
5084
  }
5074
5085
  maybeRequestUpdate();
5075
5086
  }
5076
- _stopDragStart = (e6) => {
5077
- e6.stopPropagation();
5078
- };
5079
- onConfirm = () => {
5080
- if (this.loading || !this._confirmArmed)
5081
- return;
5082
- dispatchLitConfirm(this);
5083
- };
5084
- onCancel = () => {
5085
- dispatchLitCancel(this);
5086
- };
5087
5087
  render() {
5088
5088
  const treeTheme = this.theme === "dark" ? "dark" : "light";
5089
5089
  const nearExplorerBase = this.nearExplorerUrl || "https://testnet.nearblocks.io";
@@ -5321,50 +5321,6 @@ var init_viewer_drawer = __esm(() => {
5321
5321
  otpResendStatus: { type: String, attribute: false },
5322
5322
  otpSubmitAnimating: { type: Boolean, attribute: false }
5323
5323
  };
5324
- otpCode = "";
5325
- otpError = "";
5326
- otpResendBusy = false;
5327
- otpResendUntilMs = 0;
5328
- otpResendStatus = "";
5329
- otpSubmitAnimating = false;
5330
- _otpResendTimer = null;
5331
- _otpSubmitTimer = null;
5332
- _lastAutoOtpSubmitCode = "";
5333
- _ensureDrawerDefinition = Drawer_default;
5334
- _drawerEl = null;
5335
- _open = false;
5336
- _ownsThemeAttr = false;
5337
- _onWindowMessage = (ev) => {
5338
- const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
5339
- if (!data || typeof data.type !== "string")
5340
- return;
5341
- if (data.type === "MODAL_TIMEOUT") {
5342
- const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
5343
- this.loading = false;
5344
- this.errorMessage = msg;
5345
- this._drawerEl?.handleClose?.();
5346
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5347
- bubbles: true,
5348
- composed: true,
5349
- detail: { confirmed: false }
5350
- }));
5351
- }
5352
- };
5353
- _onKeyDown = (e6) => {
5354
- if (e6.key === "Escape" || e6.key === "Esc") {
5355
- if (this.loading)
5356
- return;
5357
- e6.preventDefault();
5358
- this._drawerEl?.handleClose();
5359
- if (!this._drawerEl) {
5360
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5361
- bubbles: true,
5362
- composed: true,
5363
- detail: { confirmed: false }
5364
- }));
5365
- }
5366
- }
5367
- };
5368
5324
  _chainLabelForModel() {
5369
5325
  switch (this.model?.chain) {
5370
5326
  case "tempo":
@@ -5457,24 +5413,6 @@ var init_viewer_drawer = __esm(() => {
5457
5413
  </div>
5458
5414
  `;
5459
5415
  }
5460
- onPasskeyRegistrationConfirm = () => {
5461
- this.finishContentConfirm();
5462
- };
5463
- _onOtpInput = (event) => {
5464
- const input = event.currentTarget;
5465
- const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
5466
- this.otpCode = code;
5467
- this.otpError = "";
5468
- if (code.length < 6) {
5469
- this._lastAutoOtpSubmitCode = "";
5470
- this._resetOtpSubmitAnimation();
5471
- return;
5472
- }
5473
- if (this.loading || this._lastAutoOtpSubmitCode === code)
5474
- return;
5475
- this._lastAutoOtpSubmitCode = code;
5476
- this._submitEmailOtpAfterFade(code);
5477
- };
5478
5416
  _clearOtpSubmitTimer() {
5479
5417
  if (this._otpSubmitTimer != null)
5480
5418
  window.clearTimeout(this._otpSubmitTimer);
@@ -5518,40 +5456,6 @@ var init_viewer_drawer = __esm(() => {
5518
5456
  return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
5519
5457
  return this.otpResendStatus || "Resend code";
5520
5458
  }
5521
- _onOtpResend = () => {
5522
- const resend = this.emailOtpPrompt?.onResend;
5523
- if (typeof resend !== "function" || this.otpResendBusy || this.loading)
5524
- return;
5525
- if (this.otpResendUntilMs > Date.now())
5526
- return;
5527
- this.otpError = "";
5528
- this.otpResendStatus = "";
5529
- this._lastAutoOtpSubmitCode = "";
5530
- this._resetOtpSubmitAnimation();
5531
- this.otpResendBusy = true;
5532
- this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
5533
- this.requestUpdate();
5534
- (async () => {
5535
- try {
5536
- const result = await resend();
5537
- const challengeId = String(result?.challengeId || "").trim();
5538
- const emailHint = String(result?.emailHint || "").trim();
5539
- if (challengeId) {
5540
- this.emailOtpPrompt = {
5541
- ...this.emailOtpPrompt,
5542
- challengeId,
5543
- ...emailHint ? { emailHint } : {}
5544
- };
5545
- }
5546
- this.otpResendStatus = "Code sent";
5547
- } catch (error) {
5548
- this.otpError = formatEmailOtpResendError(error);
5549
- } finally {
5550
- this.otpResendBusy = false;
5551
- this.requestUpdate();
5552
- }
5553
- })();
5554
- };
5555
5459
  _renderEmailOtpPrompt() {
5556
5460
  if (!this._isEmailOtpMode())
5557
5461
  return "";
@@ -5598,11 +5502,6 @@ var init_viewer_drawer = __esm(() => {
5598
5502
  </div>
5599
5503
  `;
5600
5504
  }
5601
- _onFundingNoticeCopy = (event) => {
5602
- const target = event.currentTarget;
5603
- const accountId = String(target?.dataset.copyValue || "").trim();
5604
- copyTextToClipboard(accountId);
5605
- };
5606
5505
  _renderConfirmationBody() {
5607
5506
  const body = String(this.body || "").trim();
5608
5507
  if (!body)
@@ -5633,14 +5532,155 @@ var init_viewer_drawer = __esm(() => {
5633
5532
  }
5634
5533
  constructor() {
5635
5534
  super();
5636
- this.nearAccountId = "";
5637
- this.txSigningRequests = undefined;
5638
- this.model = undefined;
5639
- this.theme = "dark";
5640
- this.appearance = undefined;
5641
- this.loading = false;
5642
- this.body = "";
5643
- this.title = "";
5535
+ this.otpCode = "";
5536
+ this.otpError = "";
5537
+ this.otpResendBusy = false;
5538
+ this.otpResendUntilMs = 0;
5539
+ this.otpResendStatus = "";
5540
+ this.otpSubmitAnimating = false;
5541
+ this._otpResendTimer = null;
5542
+ this._otpSubmitTimer = null;
5543
+ this._lastAutoOtpSubmitCode = "";
5544
+ this._ensureDrawerDefinition = Drawer_default;
5545
+ this._drawerEl = null;
5546
+ this._open = false;
5547
+ this._ownsThemeAttr = false;
5548
+ this._onWindowMessage = (ev) => {
5549
+ const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
5550
+ if (!data || typeof data.type !== "string")
5551
+ return;
5552
+ if (data.type === "MODAL_TIMEOUT") {
5553
+ const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
5554
+ this.loading = false;
5555
+ this.errorMessage = msg;
5556
+ this._drawerEl?.handleClose?.();
5557
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5558
+ bubbles: true,
5559
+ composed: true,
5560
+ detail: { confirmed: false }
5561
+ }));
5562
+ }
5563
+ };
5564
+ this._onKeyDown = (e) => {
5565
+ if (e.key === "Escape" || e.key === "Esc") {
5566
+ if (this.loading)
5567
+ return;
5568
+ e.preventDefault();
5569
+ this._drawerEl?.handleClose();
5570
+ if (!this._drawerEl) {
5571
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5572
+ bubbles: true,
5573
+ composed: true,
5574
+ detail: { confirmed: false }
5575
+ }));
5576
+ }
5577
+ }
5578
+ };
5579
+ this.onPasskeyRegistrationConfirm = () => {
5580
+ this.finishContentConfirm();
5581
+ };
5582
+ this._onOtpInput = (event) => {
5583
+ const input = event.currentTarget;
5584
+ const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
5585
+ this.otpCode = code;
5586
+ this.otpError = "";
5587
+ if (code.length < 6) {
5588
+ this._lastAutoOtpSubmitCode = "";
5589
+ this._resetOtpSubmitAnimation();
5590
+ return;
5591
+ }
5592
+ if (this.loading || this._lastAutoOtpSubmitCode === code)
5593
+ return;
5594
+ this._lastAutoOtpSubmitCode = code;
5595
+ this._submitEmailOtpAfterFade(code);
5596
+ };
5597
+ this._onOtpResend = () => {
5598
+ const resend = this.emailOtpPrompt?.onResend;
5599
+ if (typeof resend !== "function" || this.otpResendBusy || this.loading)
5600
+ return;
5601
+ if (this.otpResendUntilMs > Date.now())
5602
+ return;
5603
+ this.otpError = "";
5604
+ this.otpResendStatus = "";
5605
+ this._lastAutoOtpSubmitCode = "";
5606
+ this._resetOtpSubmitAnimation();
5607
+ this.otpResendBusy = true;
5608
+ this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
5609
+ this.requestUpdate();
5610
+ (async () => {
5611
+ try {
5612
+ const result = await resend();
5613
+ const challengeId = String(result?.challengeId || "").trim();
5614
+ const emailHint = String(result?.emailHint || "").trim();
5615
+ if (challengeId) {
5616
+ this.emailOtpPrompt = {
5617
+ ...this.emailOtpPrompt,
5618
+ challengeId,
5619
+ ...emailHint ? { emailHint } : {}
5620
+ };
5621
+ }
5622
+ this.otpResendStatus = "Code sent";
5623
+ } catch (error) {
5624
+ this.otpError = formatEmailOtpResendError(error);
5625
+ } finally {
5626
+ this.otpResendBusy = false;
5627
+ this.requestUpdate();
5628
+ }
5629
+ })();
5630
+ };
5631
+ this._onFundingNoticeCopy = (event) => {
5632
+ const target = event.currentTarget;
5633
+ const accountId = String(target?.dataset.copyValue || "").trim();
5634
+ copyTextToClipboard(accountId);
5635
+ };
5636
+ this.onDrawerCancel = () => {
5637
+ if (this.loading)
5638
+ return;
5639
+ this._open = false;
5640
+ this.requestUpdate();
5641
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5642
+ bubbles: true,
5643
+ composed: true,
5644
+ detail: { confirmed: false }
5645
+ }));
5646
+ };
5647
+ this.onContentConfirm = () => {
5648
+ if (this.loading || this.otpSubmitAnimating)
5649
+ return;
5650
+ if (this._isEmailOtpMode()) {
5651
+ const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
5652
+ if (!/^\d{6}$/.test(code)) {
5653
+ this.otpCode = code;
5654
+ this.otpError = "Enter the 6-digit Email OTP code.";
5655
+ this.requestUpdate();
5656
+ return;
5657
+ }
5658
+ this.otpCode = code;
5659
+ this.otpError = "";
5660
+ this._lastAutoOtpSubmitCode = code;
5661
+ this._submitEmailOtpAfterFade(code);
5662
+ return;
5663
+ }
5664
+ this.finishContentConfirm();
5665
+ };
5666
+ this.onContentCancel = () => {
5667
+ this._drawerEl?.handleClose();
5668
+ this._open = false;
5669
+ this.requestUpdate();
5670
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5671
+ bubbles: true,
5672
+ composed: true,
5673
+ detail: { confirmed: false }
5674
+ }));
5675
+ };
5676
+ this.nearAccountId = "";
5677
+ this.txSigningRequests = undefined;
5678
+ this.model = undefined;
5679
+ this.theme = "dark";
5680
+ this.appearance = undefined;
5681
+ this.loading = false;
5682
+ this.body = "";
5683
+ this.title = "";
5644
5684
  this.confirmText = "Next";
5645
5685
  this.cancelText = "Cancel";
5646
5686
  this.deferClose = false;
@@ -5693,7 +5733,7 @@ var init_viewer_drawer = __esm(() => {
5693
5733
  ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"),
5694
5734
  ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css")
5695
5735
  ]);
5696
- await new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6())));
5736
+ await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r())));
5697
5737
  this._open = true;
5698
5738
  this.requestUpdate();
5699
5739
  }
@@ -5722,36 +5762,6 @@ var init_viewer_drawer = __esm(() => {
5722
5762
  }
5723
5763
  }
5724
5764
  }
5725
- onDrawerCancel = () => {
5726
- if (this.loading)
5727
- return;
5728
- this._open = false;
5729
- this.requestUpdate();
5730
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5731
- bubbles: true,
5732
- composed: true,
5733
- detail: { confirmed: false }
5734
- }));
5735
- };
5736
- onContentConfirm = () => {
5737
- if (this.loading || this.otpSubmitAnimating)
5738
- return;
5739
- if (this._isEmailOtpMode()) {
5740
- const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
5741
- if (!/^\d{6}$/.test(code)) {
5742
- this.otpCode = code;
5743
- this.otpError = "Enter the 6-digit Email OTP code.";
5744
- this.requestUpdate();
5745
- return;
5746
- }
5747
- this.otpCode = code;
5748
- this.otpError = "";
5749
- this._lastAutoOtpSubmitCode = code;
5750
- this._submitEmailOtpAfterFade(code);
5751
- return;
5752
- }
5753
- this.finishContentConfirm();
5754
- };
5755
5765
  finishContentConfirm(opts) {
5756
5766
  if (this.loading)
5757
5767
  return;
@@ -5771,16 +5781,6 @@ var init_viewer_drawer = __esm(() => {
5771
5781
  }
5772
5782
  }));
5773
5783
  }
5774
- onContentCancel = () => {
5775
- this._drawerEl?.handleClose();
5776
- this._open = false;
5777
- this.requestUpdate();
5778
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5779
- bubbles: true,
5780
- composed: true,
5781
- detail: { confirmed: false }
5782
- }));
5783
- };
5784
5784
  close(_confirmed) {
5785
5785
  if (!this._open)
5786
5786
  return;
@@ -5981,12 +5981,6 @@ var init_viewer_modal = __esm(() => {
5981
5981
  init_nearFundingNotice();
5982
5982
  init_registry();
5983
5983
  ModalTxConfirmElement = class ModalTxConfirmElement extends LitElementWithProps {
5984
- _heightReflow = createSurfaceHeightReflow({
5985
- reason: "confirm-body",
5986
- element: () => this.querySelector(".modal-container-root"),
5987
- setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
5988
- settled: () => this.updateComplete
5989
- });
5990
5984
  static requiredChildTags = ["w3a-tx-confirm-content"];
5991
5985
  static strictChildDefinitions = true;
5992
5986
  static keepDefinitions = [tx_confirm_content_default];
@@ -6019,57 +6013,6 @@ var init_viewer_modal = __esm(() => {
6019
6013
  otpResendStatus: { type: String, attribute: false },
6020
6014
  otpSubmitAnimating: { type: Boolean, attribute: false }
6021
6015
  };
6022
- totalAmount = "";
6023
- method = "";
6024
- fingerprint = "";
6025
- body = "";
6026
- title = "";
6027
- cancelText = "Cancel";
6028
- confirmText = "Next";
6029
- model;
6030
- securityContext;
6031
- loading = false;
6032
- errorMessage = undefined;
6033
- theme = "dark";
6034
- appearance;
6035
- nearExplorerUrl;
6036
- tempoExplorerUrl;
6037
- evmExplorerUrl;
6038
- signingAuthMode;
6039
- emailOtpPrompt;
6040
- otpCode = "";
6041
- otpError = "";
6042
- otpResendBusy = false;
6043
- otpResendUntilMs = 0;
6044
- otpResendStatus = "";
6045
- otpSubmitAnimating = false;
6046
- _otpResendTimer = null;
6047
- _otpSubmitTimer = null;
6048
- _lastAutoOtpSubmitCode = "";
6049
- intentDigest;
6050
- deferClose = false;
6051
- _stylesReady = false;
6052
- _stylePromises = [];
6053
- _stylesAwaiting = null;
6054
- _ensureTreeDefinition = TxTree_default;
6055
- _ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
6056
- _onKeyDown = (e6) => {
6057
- if (e6.key === "Escape" || e6.key === "Esc") {
6058
- e6.preventDefault();
6059
- this._handleCancel();
6060
- }
6061
- };
6062
- _onWindowMessage = (ev) => {
6063
- const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
6064
- if (!data || typeof data.type !== "string")
6065
- return;
6066
- if (data.type === "MODAL_TIMEOUT") {
6067
- const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
6068
- this.loading = false;
6069
- this.errorMessage = msg;
6070
- this._handleCancel();
6071
- }
6072
- };
6073
6016
  _chainLabelForModel() {
6074
6017
  switch (this.model?.chain) {
6075
6018
  case "tempo":
@@ -6107,12 +6050,6 @@ var init_viewer_modal = __esm(() => {
6107
6050
  _isStandaloneSurface() {
6108
6051
  return this.closest("w3a-tx-confirmer")?.getAttribute("data-w3a-confirm-surface") === "standalone";
6109
6052
  }
6110
- _handleBackdropClick = (event) => {
6111
- if (!this._isStandaloneSurface())
6112
- return;
6113
- event.stopPropagation();
6114
- this._handleCancel();
6115
- };
6116
6053
  _authHeadingFallback() {
6117
6054
  if (this._passkeyRegistrationDisplay())
6118
6055
  return "Create your passkey";
@@ -6178,9 +6115,6 @@ var init_viewer_modal = __esm(() => {
6178
6115
  </div>
6179
6116
  `;
6180
6117
  }
6181
- _onPasskeyRegistrationConfirm = () => {
6182
- this._finishConfirm();
6183
- };
6184
6118
  _renderPasskeyRegistrationModal(display) {
6185
6119
  return x`
6186
6120
  ${this._isStandaloneSurface() ? x`<div class="standalone-surface-backdrop" @click=${this._handleBackdropClick}></div>` : ""}
@@ -6215,21 +6149,6 @@ var init_viewer_modal = __esm(() => {
6215
6149
  </div>
6216
6150
  `;
6217
6151
  }
6218
- _onOtpInput = (event) => {
6219
- const input = event.currentTarget;
6220
- const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
6221
- this.otpCode = code;
6222
- this.otpError = "";
6223
- if (code.length < 6) {
6224
- this._lastAutoOtpSubmitCode = "";
6225
- this._resetOtpSubmitAnimation();
6226
- return;
6227
- }
6228
- if (this.loading || this._lastAutoOtpSubmitCode === code)
6229
- return;
6230
- this._lastAutoOtpSubmitCode = code;
6231
- this._submitEmailOtpAfterFade(code);
6232
- };
6233
6152
  _clearOtpSubmitTimer() {
6234
6153
  if (this._otpSubmitTimer != null)
6235
6154
  window.clearTimeout(this._otpSubmitTimer);
@@ -6273,40 +6192,6 @@ var init_viewer_modal = __esm(() => {
6273
6192
  return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
6274
6193
  return this.otpResendStatus || "Resend code";
6275
6194
  }
6276
- _onOtpResend = () => {
6277
- const resend = this.emailOtpPrompt?.onResend;
6278
- if (typeof resend !== "function" || this.otpResendBusy || this.loading)
6279
- return;
6280
- if (this.otpResendUntilMs > Date.now())
6281
- return;
6282
- this.otpError = "";
6283
- this.otpResendStatus = "";
6284
- this._lastAutoOtpSubmitCode = "";
6285
- this._resetOtpSubmitAnimation();
6286
- this.otpResendBusy = true;
6287
- this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
6288
- this.requestUpdate();
6289
- (async () => {
6290
- try {
6291
- const result = await resend();
6292
- const challengeId = String(result?.challengeId || "").trim();
6293
- const emailHint = String(result?.emailHint || "").trim();
6294
- if (challengeId) {
6295
- this.emailOtpPrompt = {
6296
- ...this.emailOtpPrompt,
6297
- challengeId,
6298
- ...emailHint ? { emailHint } : {}
6299
- };
6300
- }
6301
- this.otpResendStatus = "Code sent";
6302
- } catch (error) {
6303
- this.otpError = formatEmailOtpResendError2(error);
6304
- } finally {
6305
- this.otpResendBusy = false;
6306
- this.requestUpdate();
6307
- }
6308
- })();
6309
- };
6310
6195
  _renderEmailOtpPrompt() {
6311
6196
  if (!this._isEmailOtpMode())
6312
6197
  return "";
@@ -6351,11 +6236,6 @@ var init_viewer_modal = __esm(() => {
6351
6236
  </div>
6352
6237
  `;
6353
6238
  }
6354
- _onFundingNoticeCopy = (event) => {
6355
- const target = event.currentTarget;
6356
- const accountId = String(target?.dataset.copyValue || "").trim();
6357
- copyTextToClipboard(accountId);
6358
- };
6359
6239
  _renderConfirmationBody() {
6360
6240
  const body = String(this.body || "").trim();
6361
6241
  if (!body)
@@ -6386,12 +6266,123 @@ var init_viewer_modal = __esm(() => {
6386
6266
  }
6387
6267
  constructor() {
6388
6268
  super();
6269
+ this._heightReflow = createSurfaceHeightReflow({
6270
+ reason: "confirm-body",
6271
+ element: () => this.querySelector(".modal-container-root"),
6272
+ setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
6273
+ settled: () => this.updateComplete
6274
+ });
6275
+ this.totalAmount = "";
6276
+ this.method = "";
6277
+ this.fingerprint = "";
6278
+ this.body = "";
6279
+ this.title = "";
6280
+ this.cancelText = "Cancel";
6281
+ this.confirmText = "Next";
6282
+ this.loading = false;
6283
+ this.errorMessage = undefined;
6284
+ this.theme = "dark";
6285
+ this.otpCode = "";
6286
+ this.otpError = "";
6287
+ this.otpResendBusy = false;
6288
+ this.otpResendUntilMs = 0;
6289
+ this.otpResendStatus = "";
6290
+ this.otpSubmitAnimating = false;
6291
+ this._otpResendTimer = null;
6292
+ this._otpSubmitTimer = null;
6293
+ this._lastAutoOtpSubmitCode = "";
6294
+ this.deferClose = false;
6295
+ this._stylesReady = false;
6296
+ this._stylePromises = [];
6297
+ this._stylesAwaiting = null;
6298
+ this._ensureTreeDefinition = TxTree_default;
6299
+ this._ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
6300
+ this._onKeyDown = (e) => {
6301
+ if (e.key === "Escape" || e.key === "Esc") {
6302
+ e.preventDefault();
6303
+ this._handleCancel();
6304
+ }
6305
+ };
6306
+ this._onWindowMessage = (ev) => {
6307
+ const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
6308
+ if (!data || typeof data.type !== "string")
6309
+ return;
6310
+ if (data.type === "MODAL_TIMEOUT") {
6311
+ const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
6312
+ this.loading = false;
6313
+ this.errorMessage = msg;
6314
+ this._handleCancel();
6315
+ }
6316
+ };
6317
+ this._handleBackdropClick = (event) => {
6318
+ if (!this._isStandaloneSurface())
6319
+ return;
6320
+ event.stopPropagation();
6321
+ this._handleCancel();
6322
+ };
6323
+ this._onPasskeyRegistrationConfirm = () => {
6324
+ this._finishConfirm();
6325
+ };
6326
+ this._onOtpInput = (event) => {
6327
+ const input = event.currentTarget;
6328
+ const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
6329
+ this.otpCode = code;
6330
+ this.otpError = "";
6331
+ if (code.length < 6) {
6332
+ this._lastAutoOtpSubmitCode = "";
6333
+ this._resetOtpSubmitAnimation();
6334
+ return;
6335
+ }
6336
+ if (this.loading || this._lastAutoOtpSubmitCode === code)
6337
+ return;
6338
+ this._lastAutoOtpSubmitCode = code;
6339
+ this._submitEmailOtpAfterFade(code);
6340
+ };
6341
+ this._onOtpResend = () => {
6342
+ const resend = this.emailOtpPrompt?.onResend;
6343
+ if (typeof resend !== "function" || this.otpResendBusy || this.loading)
6344
+ return;
6345
+ if (this.otpResendUntilMs > Date.now())
6346
+ return;
6347
+ this.otpError = "";
6348
+ this.otpResendStatus = "";
6349
+ this._lastAutoOtpSubmitCode = "";
6350
+ this._resetOtpSubmitAnimation();
6351
+ this.otpResendBusy = true;
6352
+ this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
6353
+ this.requestUpdate();
6354
+ (async () => {
6355
+ try {
6356
+ const result = await resend();
6357
+ const challengeId = String(result?.challengeId || "").trim();
6358
+ const emailHint = String(result?.emailHint || "").trim();
6359
+ if (challengeId) {
6360
+ this.emailOtpPrompt = {
6361
+ ...this.emailOtpPrompt,
6362
+ challengeId,
6363
+ ...emailHint ? { emailHint } : {}
6364
+ };
6365
+ }
6366
+ this.otpResendStatus = "Code sent";
6367
+ } catch (error) {
6368
+ this.otpError = formatEmailOtpResendError2(error);
6369
+ } finally {
6370
+ this.otpResendBusy = false;
6371
+ this.requestUpdate();
6372
+ }
6373
+ })();
6374
+ };
6375
+ this._onFundingNoticeCopy = (event) => {
6376
+ const target = event.currentTarget;
6377
+ const accountId = String(target?.dataset.copyValue || "").trim();
6378
+ copyTextToClipboard(accountId);
6379
+ };
6380
+ this._ownsThemeAttr = false;
6389
6381
  const root = document?.documentElement || null;
6390
6382
  if (root) {
6391
6383
  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"));
6392
6384
  }
6393
6385
  }
6394
- _ownsThemeAttr = false;
6395
6386
  willUpdate(changedProperties) {
6396
6387
  super.willUpdate(changedProperties);
6397
6388
  if (this.hasUpdated)
@@ -6463,8 +6454,8 @@ var init_viewer_modal = __esm(() => {
6463
6454
  if (this._stylesReady)
6464
6455
  return true;
6465
6456
  if (!this._stylesAwaiting) {
6466
- const p4 = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
6467
- this._stylesAwaiting = p4.then(() => {
6457
+ const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
6458
+ this._stylesAwaiting = p.then(() => {
6468
6459
  this._stylesReady = true;
6469
6460
  this.requestUpdate();
6470
6461
  });
@@ -6703,18 +6694,18 @@ var init_tx_confirmer_wrapper = __esm(() => {
6703
6694
  evmExplorerUrl: { type: String, attribute: "evm-explorer-url" }
6704
6695
  };
6705
6696
  static keepDefinitions = [ModalTxConfirmElement, DrawerTxConfirmerElement];
6706
- childRef = e5();
6707
- redispatchingEvent = false;
6708
- interactiveAnnounced = false;
6709
- currentChild = null;
6710
- boundConfirmListener = (event) => {
6711
- this.handleChildConfirm(event);
6712
- };
6713
- boundCancelListener = (_event) => {
6714
- this.handleChildCancel();
6715
- };
6716
6697
  constructor() {
6717
6698
  super();
6699
+ this.childRef = e5();
6700
+ this.redispatchingEvent = false;
6701
+ this.interactiveAnnounced = false;
6702
+ this.currentChild = null;
6703
+ this.boundConfirmListener = (event) => {
6704
+ this.handleChildConfirm(event);
6705
+ };
6706
+ this.boundCancelListener = (_event) => {
6707
+ this.handleChildCancel();
6708
+ };
6718
6709
  this.variant = DEFAULT_VARIANT;
6719
6710
  this.nearAccountId = "";
6720
6711
  this.txSigningRequests = undefined;
@@ -6989,7 +6980,7 @@ function renderCopyStatusIcon() {
6989
6980
  function settlingState(state, maskedTarget, startedAtMs) {
6990
6981
  const prefix = maskedTarget.startsWith(state.prefix) ? state.prefix : "";
6991
6982
  const targetSlots = Array.from(maskedTarget.slice(prefix.length));
6992
- const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((_2, index) => ({
6983
+ const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((_, index) => ({
6993
6984
  glyph: randomReelGlyph(state.alphabet),
6994
6985
  nextChangeAtMs: startedAtMs + index * 37 % 90
6995
6986
  }));
@@ -7115,15 +7106,38 @@ var init_viewer = __esm(() => {
7115
7106
  errorMessage: { type: String },
7116
7107
  showCloseButton: { type: Boolean, attribute: "show-close-button" }
7117
7108
  };
7118
- copiedFields = new Set;
7119
- copyTimers = new Map;
7120
- revealStates = new Map;
7121
- revealAnimationFrame = null;
7122
- _stylesReady = false;
7123
- _stylePromises = [];
7124
- _stylesAwaiting = null;
7125
7109
  constructor() {
7126
7110
  super();
7111
+ this.copiedFields = new Set;
7112
+ this.copyTimers = new Map;
7113
+ this.revealStates = new Map;
7114
+ this.revealAnimationFrame = null;
7115
+ this._stylesReady = false;
7116
+ this._stylePromises = [];
7117
+ this._stylesAwaiting = null;
7118
+ this.onRevealAnimationFrame = (now) => {
7119
+ this.revealAnimationFrame = null;
7120
+ if (this.ownerDocument?.hidden) {
7121
+ this.scheduleRevealAnimation();
7122
+ return;
7123
+ }
7124
+ let changed = false;
7125
+ for (const [entryKey, state] of this.revealStates) {
7126
+ if (state.kind === "settled")
7127
+ continue;
7128
+ const nextState = advanceRevealState(state, now);
7129
+ if (nextState !== state) {
7130
+ this.revealStates.set(entryKey, nextState);
7131
+ changed = true;
7132
+ }
7133
+ }
7134
+ if (changed)
7135
+ this.requestUpdate();
7136
+ this.scheduleRevealAnimation();
7137
+ };
7138
+ this._stopDragStart = (e) => {
7139
+ e.stopPropagation();
7140
+ };
7127
7141
  this.theme = "dark";
7128
7142
  this.variant = "drawer";
7129
7143
  this.keys = undefined;
@@ -7135,27 +7149,27 @@ var init_viewer = __esm(() => {
7135
7149
  return "export";
7136
7150
  }
7137
7151
  createRenderRoot() {
7138
- const supportsConstructable2 = typeof ShadowRoot !== "undefined" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype;
7139
- const root = supportsConstructable2 ? super.createRenderRoot() : this;
7152
+ const supportsConstructable = typeof ShadowRoot !== "undefined" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype;
7153
+ const root = supportsConstructable ? super.createRenderRoot() : this;
7140
7154
  const p1 = ensureExternalStyles(root, "export-viewer.css", "data-w3a-export-viewer-css");
7141
7155
  this._stylePromises.push(p1);
7142
7156
  p1.catch(() => {});
7143
7157
  const pCopyIcon = ensureExternalStyles(root, "copy-icon.css", "data-w3a-copy-icon-css");
7144
7158
  this._stylePromises.push(pCopyIcon);
7145
7159
  pCopyIcon.catch(() => {});
7146
- const p22 = ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css");
7147
- this._stylePromises.push(p22);
7148
- p22.catch(() => {});
7149
- const p32 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
7150
- this._stylePromises.push(p32);
7151
- p32.catch(() => {});
7160
+ const p2 = ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css");
7161
+ this._stylePromises.push(p2);
7162
+ p2.catch(() => {});
7163
+ const p3 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
7164
+ this._stylePromises.push(p3);
7165
+ p3.catch(() => {});
7152
7166
  return root;
7153
7167
  }
7154
7168
  shouldUpdate(_changed) {
7155
7169
  if (this._stylesReady)
7156
7170
  return true;
7157
7171
  if (!this._stylesAwaiting) {
7158
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
7172
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
7159
7173
  this._stylesAwaiting = settle.then(() => {
7160
7174
  this._stylesReady = true;
7161
7175
  this.requestUpdate();
@@ -7190,26 +7204,6 @@ var init_viewer = __esm(() => {
7190
7204
  this.resetRevealStates();
7191
7205
  super.disconnectedCallback();
7192
7206
  }
7193
- onRevealAnimationFrame = (now) => {
7194
- this.revealAnimationFrame = null;
7195
- if (this.ownerDocument?.hidden) {
7196
- this.scheduleRevealAnimation();
7197
- return;
7198
- }
7199
- let changed = false;
7200
- for (const [entryKey, state] of this.revealStates) {
7201
- if (state.kind === "settled")
7202
- continue;
7203
- const nextState = advanceRevealState(state, now);
7204
- if (nextState !== state) {
7205
- this.revealStates.set(entryKey, nextState);
7206
- changed = true;
7207
- }
7208
- }
7209
- if (changed)
7210
- this.requestUpdate();
7211
- this.scheduleRevealAnimation();
7212
- };
7213
7207
  scheduleRevealAnimation() {
7214
7208
  if (this.revealAnimationFrame !== null || prefersReducedMotion(this.ownerDocument))
7215
7209
  return;
@@ -7266,9 +7260,6 @@ var init_viewer = __esm(() => {
7266
7260
  }
7267
7261
  this.scheduleRevealAnimation();
7268
7262
  }
7269
- _stopDragStart = (e6) => {
7270
- e6.stopPropagation();
7271
- };
7272
7263
  updateTheme() {
7273
7264
  try {
7274
7265
  const docEl = this.ownerDocument?.documentElement;
@@ -7316,8 +7307,8 @@ var init_viewer = __esm(() => {
7316
7307
  }
7317
7308
  this.markCopied(index, type);
7318
7309
  this.requestUpdate();
7319
- } catch (e6) {
7320
- console.warn("Copy failed", e6);
7310
+ } catch (e) {
7311
+ console.warn("Copy failed", e);
7321
7312
  }
7322
7313
  }
7323
7314
  copyViaTextareaFallback(text) {
@@ -7370,9 +7361,9 @@ var init_viewer = __esm(() => {
7370
7361
  const provided = Array.isArray(this.keys) ? this.keys.filter((item) => {
7371
7362
  if (!item || typeof item !== "object")
7372
7363
  return false;
7373
- const publicKey2 = String(item.publicKey || "").trim();
7374
- const privateKey2 = String(item.privateKey || "").trim();
7375
- return !!publicKey2 || !!privateKey2;
7364
+ const publicKey = String(item.publicKey || "").trim();
7365
+ const privateKey = String(item.privateKey || "").trim();
7366
+ return !!publicKey || !!privateKey;
7376
7367
  }) : [];
7377
7368
  if (provided.length > 0)
7378
7369
  return provided;
@@ -7515,8 +7506,8 @@ function declarationsToCssText(selector, declarations) {
7515
7506
  function getDefaultCspNonce() {
7516
7507
  if (typeof window === "undefined")
7517
7508
  return;
7518
- const w2 = window;
7519
- return w2.w3aNonce || w2.litNonce || undefined;
7509
+ const w = window;
7510
+ return w.w3aNonce || w.litNonce || undefined;
7520
7511
  }
7521
7512
  function createCspStylesheetManager(opts) {
7522
7513
  const { doc, baseCss, baseStyleDataAttr, dynamicStyleDataAttr, nonce } = opts;
@@ -7535,7 +7526,7 @@ function createCspStylesheetManager(opts) {
7535
7526
  return;
7536
7527
  return typeof nonce === "function" ? nonce() : nonce;
7537
7528
  };
7538
- const supportsConstructable2 = () => {
7529
+ const supportsConstructable = () => {
7539
7530
  if (state.supportConstructable != null)
7540
7531
  return state.supportConstructable;
7541
7532
  state.supportConstructable = typeof CSSStyleSheet !== "undefined" && "adoptedStyleSheets" in doc;
@@ -7575,7 +7566,7 @@ function createCspStylesheetManager(opts) {
7575
7566
  const ensureBase = () => {
7576
7567
  if (state.baseSheet || state.baseStyleEl)
7577
7568
  return;
7578
- if (supportsConstructable2()) {
7569
+ if (supportsConstructable()) {
7579
7570
  try {
7580
7571
  state.baseSheet = new CSSStyleSheet;
7581
7572
  state.baseSheet.replaceSync(baseCss);
@@ -7593,7 +7584,7 @@ function createCspStylesheetManager(opts) {
7593
7584
  const buildDynamicCss = () => Array.from(state.rules.values()).join(`
7594
7585
  `);
7595
7586
  const ensureDynamic = () => {
7596
- if (supportsConstructable2()) {
7587
+ if (supportsConstructable()) {
7597
7588
  if (!state.dynamicSheet) {
7598
7589
  state.dynamicSheet = new CSSStyleSheet;
7599
7590
  adoptSheets([state.dynamicSheet]);
@@ -7608,7 +7599,7 @@ function createCspStylesheetManager(opts) {
7608
7599
  };
7609
7600
  const syncDynamic = () => {
7610
7601
  const css = buildDynamicCss();
7611
- if (supportsConstructable2()) {
7602
+ if (supportsConstructable()) {
7612
7603
  try {
7613
7604
  ensureDynamic();
7614
7605
  state.dynamicSheet?.replaceSync(css);
@@ -7627,7 +7618,7 @@ function createCspStylesheetManager(opts) {
7627
7618
  const existing = state.declarationRules.get(id);
7628
7619
  if (existing && existing.selector === selector)
7629
7620
  return existing.rule;
7630
- if (!supportsConstructable2())
7621
+ if (!supportsConstructable())
7631
7622
  return null;
7632
7623
  try {
7633
7624
  if (!state.declarationSheet) {
@@ -7636,9 +7627,9 @@ function createCspStylesheetManager(opts) {
7636
7627
  }
7637
7628
  const sheet = state.declarationSheet;
7638
7629
  if (existing) {
7639
- const index2 = Array.prototype.indexOf.call(sheet.cssRules, existing.rule);
7640
- if (index2 >= 0)
7641
- sheet.deleteRule(index2);
7630
+ const index = Array.prototype.indexOf.call(sheet.cssRules, existing.rule);
7631
+ if (index >= 0)
7632
+ sheet.deleteRule(index);
7642
7633
  state.declarationRules.delete(id);
7643
7634
  }
7644
7635
  const index = sheet.insertRule(`${selector}{}`, sheet.cssRules.length);
@@ -7728,8 +7719,8 @@ function createCspStylesheetManager(opts) {
7728
7719
  // src/core/signingEngine/uiConfirm/ui/lit-components/ExportPrivateKey/iframe-host.ts
7729
7720
  var exports_iframe_host = {};
7730
7721
  __export(exports_iframe_host, {
7731
- default: () => iframe_host_default,
7732
- IframeExportHost: () => IframeExportHost
7722
+ IframeExportHost: () => IframeExportHost,
7723
+ default: () => iframe_host_default
7733
7724
  });
7734
7725
  function getExportTokenStyleManager() {
7735
7726
  if (!exportTokenStyleManager) {
@@ -7746,9 +7737,9 @@ function toStringRecord(value) {
7746
7737
  if (!value || typeof value !== "object")
7747
7738
  return {};
7748
7739
  const out = {};
7749
- for (const [k2, v3] of Object.entries(value)) {
7750
- if (typeof v3 === "string")
7751
- out[k2] = v3;
7740
+ for (const [k, v] of Object.entries(value)) {
7741
+ if (typeof v === "string")
7742
+ out[k] = v;
7752
7743
  }
7753
7744
  return out;
7754
7745
  }
@@ -7830,13 +7821,13 @@ var init_iframe_host = __esm(() => {
7830
7821
  errorMessage: { type: String },
7831
7822
  surface: { type: String, attribute: "data-w3a-export-surface", reflect: false }
7832
7823
  };
7833
- drawerEl = null;
7834
- viewerEl = null;
7835
- openFrame = null;
7836
- stylesReady = false;
7837
- stylePromise = null;
7838
7824
  constructor() {
7839
7825
  super();
7826
+ this.drawerEl = null;
7827
+ this.viewerEl = null;
7828
+ this.openFrame = null;
7829
+ this.stylesReady = false;
7830
+ this.stylePromise = null;
7840
7831
  this.theme = "dark";
7841
7832
  this.variant = "drawer";
7842
7833
  this.accountId = "";
@@ -8057,13 +8048,98 @@ var init_viewer2 = __esm(() => {
8057
8048
  statusMessage: { state: true },
8058
8049
  copied: { state: true }
8059
8050
  };
8060
- experience = { kind: "unconfigured" };
8061
- loadGeneration = 0;
8062
- copiedResetTimer = null;
8063
- stylesReady = false;
8064
- stylePromise = null;
8065
8051
  constructor() {
8066
8052
  super();
8053
+ this.experience = { kind: "unconfigured" };
8054
+ this.loadGeneration = 0;
8055
+ this.copiedResetTimer = null;
8056
+ this.stylesReady = false;
8057
+ this.stylePromise = null;
8058
+ this.retryStatus = () => {
8059
+ if (this.experience.kind !== "account_menu")
8060
+ return;
8061
+ const generation = this.loadGeneration + 1;
8062
+ this.loadGeneration = generation;
8063
+ const current = this.viewState;
8064
+ if (current.kind !== "summary")
8065
+ return;
8066
+ this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
8067
+ this.loadSummaryStatus(this.experience, generation);
8068
+ };
8069
+ this.openRecoveryCodes = async () => {
8070
+ if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
8071
+ return;
8072
+ const generation = this.loadGeneration;
8073
+ const summary = this.viewState;
8074
+ this.viewState = { ...summary, kind: "opening", actionError: null };
8075
+ try {
8076
+ const request = await this.experience.loadPendingBackup();
8077
+ if (generation !== this.loadGeneration)
8078
+ return;
8079
+ if (!request) {
8080
+ this.viewState = {
8081
+ ...summary,
8082
+ actionError: "Recovery codes are no longer available on this device."
8083
+ };
8084
+ return;
8085
+ }
8086
+ this.viewState = { kind: "recovery_codes", request };
8087
+ await this.updateComplete;
8088
+ await new Promise(requestAnimationFrame);
8089
+ this.querySelector("#w3a-wallet-recovery-title")?.focus();
8090
+ } catch (error) {
8091
+ if (generation !== this.loadGeneration)
8092
+ return;
8093
+ this.viewState = {
8094
+ ...summary,
8095
+ actionError: errorMessage(error, "Could not open recovery codes")
8096
+ };
8097
+ }
8098
+ };
8099
+ this.closeSummary = () => {
8100
+ this.dispatchClose({ kind: "dismissed" });
8101
+ };
8102
+ this.download = () => {
8103
+ if (this.viewState.kind !== "recovery_codes")
8104
+ return;
8105
+ const { walletId, recoveryCodes } = this.viewState.request;
8106
+ try {
8107
+ const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
8108
+ type: "text/plain;charset=utf-8"
8109
+ }));
8110
+ const anchor = document.createElement("a");
8111
+ anchor.href = url;
8112
+ anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
8113
+ try {
8114
+ anchor.click();
8115
+ } finally {
8116
+ window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
8117
+ }
8118
+ this.statusMessage = "Recovery codes downloaded.";
8119
+ } catch {
8120
+ this.statusMessage = "Unable to download the codes. Copy them or try again.";
8121
+ }
8122
+ };
8123
+ this.copy = async () => {
8124
+ if (this.viewState.kind !== "recovery_codes")
8125
+ return;
8126
+ const { walletId, recoveryCodes } = this.viewState.request;
8127
+ try {
8128
+ await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
8129
+ this.statusMessage = "Recovery codes copied.";
8130
+ this.flashCopied();
8131
+ } catch {
8132
+ this.statusMessage = "Unable to copy the codes. Download them or try again.";
8133
+ }
8134
+ };
8135
+ this.onAcknowledgementChange = (event) => {
8136
+ const input = event.target;
8137
+ if (input instanceof HTMLInputElement)
8138
+ this.acknowledged = input.checked;
8139
+ };
8140
+ this.closeRecoveryCodes = () => {
8141
+ this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
8142
+ };
8067
8143
  this.viewState = { kind: "unconfigured" };
8068
8144
  this.acknowledged = false;
8069
8145
  this.statusMessage = "";
@@ -8189,50 +8265,6 @@ var init_viewer2 = __esm(() => {
8189
8265
  assertNever2(this.viewState);
8190
8266
  }
8191
8267
  }
8192
- retryStatus = () => {
8193
- if (this.experience.kind !== "account_menu")
8194
- return;
8195
- const generation = this.loadGeneration + 1;
8196
- this.loadGeneration = generation;
8197
- const current = this.viewState;
8198
- if (current.kind !== "summary")
8199
- return;
8200
- this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
8201
- this.loadSummaryStatus(this.experience, generation);
8202
- };
8203
- openRecoveryCodes = async () => {
8204
- if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
8205
- return;
8206
- const generation = this.loadGeneration;
8207
- const summary = this.viewState;
8208
- this.viewState = { ...summary, kind: "opening", actionError: null };
8209
- try {
8210
- const request = await this.experience.loadPendingBackup();
8211
- if (generation !== this.loadGeneration)
8212
- return;
8213
- if (!request) {
8214
- this.viewState = {
8215
- ...summary,
8216
- actionError: "Recovery codes are no longer available on this device."
8217
- };
8218
- return;
8219
- }
8220
- this.viewState = { kind: "recovery_codes", request };
8221
- await this.updateComplete;
8222
- await new Promise(requestAnimationFrame);
8223
- this.querySelector("#w3a-wallet-recovery-title")?.focus();
8224
- } catch (error) {
8225
- if (generation !== this.loadGeneration)
8226
- return;
8227
- this.viewState = {
8228
- ...summary,
8229
- actionError: errorMessage(error, "Could not open recovery codes")
8230
- };
8231
- }
8232
- };
8233
- closeSummary = () => {
8234
- this.dispatchClose({ kind: "dismissed" });
8235
- };
8236
8268
  dispatchClose(detail) {
8237
8269
  this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CLOSE_EVENT, {
8238
8270
  detail,
@@ -8240,39 +8272,6 @@ var init_viewer2 = __esm(() => {
8240
8272
  composed: true
8241
8273
  }));
8242
8274
  }
8243
- download = () => {
8244
- if (this.viewState.kind !== "recovery_codes")
8245
- return;
8246
- const { walletId, recoveryCodes } = this.viewState.request;
8247
- try {
8248
- const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
8249
- type: "text/plain;charset=utf-8"
8250
- }));
8251
- const anchor = document.createElement("a");
8252
- anchor.href = url;
8253
- anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
8254
- try {
8255
- anchor.click();
8256
- } finally {
8257
- window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
8258
- }
8259
- this.statusMessage = "Recovery codes downloaded.";
8260
- } catch {
8261
- this.statusMessage = "Unable to download the codes. Copy them or try again.";
8262
- }
8263
- };
8264
- copy = async () => {
8265
- if (this.viewState.kind !== "recovery_codes")
8266
- return;
8267
- const { walletId, recoveryCodes } = this.viewState.request;
8268
- try {
8269
- await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
8270
- this.statusMessage = "Recovery codes copied.";
8271
- this.flashCopied();
8272
- } catch {
8273
- this.statusMessage = "Unable to copy the codes. Download them or try again.";
8274
- }
8275
- };
8276
8275
  flashCopied() {
8277
8276
  if (this.copiedResetTimer !== null)
8278
8277
  window.clearTimeout(this.copiedResetTimer);
@@ -8282,14 +8281,6 @@ var init_viewer2 = __esm(() => {
8282
8281
  this.copied = false;
8283
8282
  }, COPIED_FLASH_MS);
8284
8283
  }
8285
- onAcknowledgementChange = (event) => {
8286
- const input = event.target;
8287
- if (input instanceof HTMLInputElement)
8288
- this.acknowledged = input.checked;
8289
- };
8290
- closeRecoveryCodes = () => {
8291
- this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
8292
- };
8293
8284
  closeLabel(request) {
8294
8285
  if (this.acknowledged)
8295
8286
  return "Finish backup";
@@ -8437,8 +8428,8 @@ var init_viewer2 = __esm(() => {
8437
8428
  // src/core/signingEngine/uiConfirm/ui/lit-components/RecoveryCodeBackup/host.ts
8438
8429
  var exports_host = {};
8439
8430
  __export(exports_host, {
8440
- default: () => host_default,
8441
- RecoveryCodeBackupHost: () => RecoveryCodeBackupHost
8431
+ RecoveryCodeBackupHost: () => RecoveryCodeBackupHost,
8432
+ default: () => host_default
8442
8433
  });
8443
8434
  var RecoveryCodeBackupHost, host_default;
8444
8435
  var init_host = __esm(() => {
@@ -8454,24 +8445,22 @@ var init_host = __esm(() => {
8454
8445
  experience: { attribute: false },
8455
8446
  surface: { type: String }
8456
8447
  };
8457
- dialogEl = null;
8458
- viewerEl = null;
8459
- shown = false;
8460
- dialogShown;
8461
- resolveDialogShown;
8462
- handleCancel = (event) => {
8463
- event.preventDefault();
8464
- this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
8465
- };
8466
- handleStageChange = (event) => {
8467
- const dialog = event.currentTarget;
8468
- if (!(dialog instanceof HTMLDialogElement))
8469
- return;
8470
- const detail = event.detail;
8471
- dialog.dataset.w3aRecoveryStage = detail.stage;
8472
- };
8473
8448
  constructor() {
8474
8449
  super();
8450
+ this.dialogEl = null;
8451
+ this.viewerEl = null;
8452
+ this.shown = false;
8453
+ this.handleCancel = (event) => {
8454
+ event.preventDefault();
8455
+ this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
8456
+ };
8457
+ this.handleStageChange = (event) => {
8458
+ const dialog = event.currentTarget;
8459
+ if (!(dialog instanceof HTMLDialogElement))
8460
+ return;
8461
+ const detail = event.detail;
8462
+ dialog.dataset.w3aRecoveryStage = detail.stage;
8463
+ };
8475
8464
  this.experience = { kind: "unconfigured" };
8476
8465
  this.surface = "standalone";
8477
8466
  this.dialogShown = new Promise((resolve) => {
@@ -8568,6 +8557,26 @@ var init_HaloBorder = __esm(() => {
8568
8557
  init_css_loader();
8569
8558
  init_registry();
8570
8559
  HaloBorderElement = class HaloBorderElement extends LitElementWithProps {
8560
+ constructor() {
8561
+ super(...arguments);
8562
+ this._stylesReady = false;
8563
+ this._stylePromises = [];
8564
+ this._stylesAwaiting = null;
8565
+ this._rafId = null;
8566
+ this._startTs = 0;
8567
+ this._running = false;
8568
+ this.tick = (ts) => {
8569
+ if (!this._running)
8570
+ return;
8571
+ if (!this._startTs)
8572
+ this._startTs = ts;
8573
+ const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
8574
+ const delta = (ts - this._startTs) % dur;
8575
+ const angle = delta / dur * 360;
8576
+ this.setCssVars({ "--halo-angle": `${angle}deg` });
8577
+ this._rafId = requestAnimationFrame(this.tick);
8578
+ };
8579
+ }
8571
8580
  static properties = {
8572
8581
  animated: { type: Boolean },
8573
8582
  theme: { type: String },
@@ -8582,15 +8591,12 @@ var init_HaloBorder = __esm(() => {
8582
8591
  innerPadding: { type: String, attribute: "inner-padding" },
8583
8592
  innerBackground: { type: String, attribute: "inner-background" }
8584
8593
  };
8585
- _stylesReady = false;
8586
- _stylePromises = [];
8587
- _stylesAwaiting = null;
8588
8594
  static _STYLE_MARKER = "data-w3a-halo-border-css";
8589
8595
  createRenderRoot() {
8590
8596
  const root = super.createRenderRoot();
8591
- const p4 = ensureExternalStyles(root, "halo-border.css", HaloBorderElement._STYLE_MARKER);
8592
- this._stylePromises.push(p4);
8593
- p4.catch(() => {});
8597
+ const p = ensureExternalStyles(root, "halo-border.css", HaloBorderElement._STYLE_MARKER);
8598
+ this._stylePromises.push(p);
8599
+ p.catch(() => {});
8594
8600
  return root;
8595
8601
  }
8596
8602
  shouldUpdate(_changed) {
@@ -8601,7 +8607,7 @@ var init_HaloBorder = __esm(() => {
8601
8607
  return true;
8602
8608
  }
8603
8609
  if (!this._stylesAwaiting) {
8604
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
8610
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
8605
8611
  this._stylesAwaiting = settle.then(() => {
8606
8612
  this._stylesReady = true;
8607
8613
  this.requestUpdate();
@@ -8619,9 +8625,6 @@ var init_HaloBorder = __esm(() => {
8619
8625
  const statefulLink = link;
8620
8626
  return !!(statefulLink._w3aLoaded || link.sheet);
8621
8627
  }
8622
- _rafId = null;
8623
- _startTs = 0;
8624
- _running = false;
8625
8628
  connectedCallback() {
8626
8629
  super.connectedCallback();
8627
8630
  this.applyCssVars();
@@ -8661,17 +8664,6 @@ var init_HaloBorder = __esm(() => {
8661
8664
  this.stop();
8662
8665
  super.disconnectedCallback();
8663
8666
  }
8664
- tick = (ts) => {
8665
- if (!this._running)
8666
- return;
8667
- if (!this._startTs)
8668
- this._startTs = ts;
8669
- const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
8670
- const delta = (ts - this._startTs) % dur;
8671
- const angle = delta / dur * 360;
8672
- this.setCssVars({ "--halo-angle": `${angle}deg` });
8673
- this._rafId = requestAnimationFrame(this.tick);
8674
- };
8675
8667
  start() {
8676
8668
  if (this._running)
8677
8669
  return;
@@ -8714,6 +8706,12 @@ var init_PasskeyHaloLoading = __esm(() => {
8714
8706
  init_css_loader();
8715
8707
  init_registry();
8716
8708
  PasskeyHaloLoadingElement = class PasskeyHaloLoadingElement extends LitElementWithProps {
8709
+ constructor() {
8710
+ super(...arguments);
8711
+ this._stylesReady = false;
8712
+ this._stylePromises = [];
8713
+ this._stylesAwaiting = null;
8714
+ }
8717
8715
  static properties = {
8718
8716
  animated: { type: Boolean },
8719
8717
  theme: { type: String },
@@ -8732,15 +8730,12 @@ var init_PasskeyHaloLoading = __esm(() => {
8732
8730
  iconContainerBorderRadius: { type: String, attribute: "icon-container-border-radius" },
8733
8731
  iconContainerBackgroundColor: { type: String, attribute: "icon-container-background-color" }
8734
8732
  };
8735
- _stylesReady = false;
8736
- _stylePromises = [];
8737
- _stylesAwaiting = null;
8738
8733
  static _STYLE_MARKER = "data-w3a-passkey-halo-loading-css";
8739
8734
  createRenderRoot() {
8740
8735
  const root = super.createRenderRoot();
8741
- const p4 = ensureExternalStyles(root, "passkey-halo-loading.css", PasskeyHaloLoadingElement._STYLE_MARKER);
8742
- this._stylePromises.push(p4);
8743
- p4.catch(() => {});
8736
+ const p = ensureExternalStyles(root, "passkey-halo-loading.css", PasskeyHaloLoadingElement._STYLE_MARKER);
8737
+ this._stylePromises.push(p);
8738
+ p.catch(() => {});
8744
8739
  return root;
8745
8740
  }
8746
8741
  shouldUpdate(_changed) {
@@ -8751,7 +8746,7 @@ var init_PasskeyHaloLoading = __esm(() => {
8751
8746
  return true;
8752
8747
  }
8753
8748
  if (!this._stylesAwaiting) {
8754
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
8749
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
8755
8750
  this._stylesAwaiting = settle.then(() => {
8756
8751
  this._stylesReady = true;
8757
8752
  this.requestUpdate();
@@ -8893,6 +8888,6 @@ var init_PasskeyHaloLoading = __esm(() => {
8893
8888
  init_PasskeyHaloLoading();
8894
8889
 
8895
8890
  export {
8896
- PasskeyHaloLoading_default as default,
8897
- PasskeyHaloLoadingElement
8891
+ PasskeyHaloLoadingElement,
8892
+ PasskeyHaloLoading_default as default
8898
8893
  };