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