@kya-os/consent 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -3
- package/dist/bundle/index.d.ts +10 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +10 -0
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +4 -4
- package/dist/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/index.js +10 -0
- package/dist/cjs/bundle/index.js.map +1 -1
- package/dist/cjs/bundle/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/components/consent-action-bar.js +66 -15
- package/dist/cjs/components/consent-action-bar.js.map +1 -1
- package/dist/cjs/components/consent-agent-header.js +5 -1
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +17 -1
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-checkbox.js +2 -2
- package/dist/cjs/components/consent-checkbox.js.map +1 -1
- package/dist/cjs/components/consent-duration.js +187 -0
- package/dist/cjs/components/consent-duration.js.map +1 -0
- package/dist/cjs/components/consent-folder-scope.js +169 -0
- package/dist/cjs/components/consent-folder-scope.js.map +1 -0
- package/dist/cjs/components/consent-footer.js +13 -2
- package/dist/cjs/components/consent-footer.js.map +1 -1
- package/dist/cjs/components/consent-grant-terms.js +321 -0
- package/dist/cjs/components/consent-grant-terms.js.map +1 -0
- package/dist/cjs/components/consent-input.js +47 -27
- package/dist/cjs/components/consent-input.js.map +1 -1
- package/dist/cjs/components/consent-otp-input.js +49 -42
- package/dist/cjs/components/consent-otp-input.js.map +1 -1
- package/dist/cjs/components/consent-phone-handoff.js +219 -0
- package/dist/cjs/components/consent-phone-handoff.js.map +1 -0
- package/dist/cjs/components/consent-request-expiry.js +159 -0
- package/dist/cjs/components/consent-request-expiry.js.map +1 -0
- package/dist/cjs/components/consent-revoke.js +308 -0
- package/dist/cjs/components/consent-revoke.js.map +1 -0
- package/dist/cjs/components/consent-shell.js +3 -0
- package/dist/cjs/components/consent-shell.js.map +1 -1
- package/dist/cjs/components/consent-terms.js +2 -2
- package/dist/cjs/components/consent-terms.js.map +1 -1
- package/dist/cjs/components/consent-wallet-check.js +107 -0
- package/dist/cjs/components/consent-wallet-check.js.map +1 -0
- package/dist/cjs/components/consent-wallet-notice.js +189 -0
- package/dist/cjs/components/consent-wallet-notice.js.map +1 -0
- package/dist/cjs/components/consent-wallet-orb.js +273 -0
- package/dist/cjs/components/consent-wallet-orb.js.map +1 -0
- package/dist/cjs/components/consent-wallet-signature.js +104 -0
- package/dist/cjs/components/consent-wallet-signature.js.map +1 -0
- package/dist/cjs/components/grant-field-styles.js +85 -0
- package/dist/cjs/components/grant-field-styles.js.map +1 -0
- package/dist/cjs/components/index.js +32 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +18 -1
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/components/template-link.js +32 -0
- package/dist/cjs/components/template-link.js.map +1 -0
- package/dist/cjs/components/wallet-globe.js +184 -0
- package/dist/cjs/components/wallet-globe.js.map +1 -0
- package/dist/cjs/components/wallet-icons.js +19 -0
- package/dist/cjs/components/wallet-icons.js.map +1 -0
- package/dist/cjs/components/wallet-status.js +34 -0
- package/dist/cjs/components/wallet-status.js.map +1 -0
- package/dist/cjs/copy/tokens.js +91 -0
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/grant/index.js +24 -0
- package/dist/cjs/grant/index.js.map +1 -0
- package/dist/cjs/grant/terms.js +148 -0
- package/dist/cjs/grant/terms.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mcp-app/inline.js +2 -2
- package/dist/cjs/mcp-app/inline.js.map +1 -1
- package/dist/cjs/react/index.js +120 -1
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts +17 -0
- package/dist/components/consent-action-bar.d.ts.map +1 -1
- package/dist/components/consent-action-bar.js +67 -16
- package/dist/components/consent-action-bar.js.map +1 -1
- package/dist/components/consent-agent-header.d.ts.map +1 -1
- package/dist/components/consent-agent-header.js +5 -1
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +10 -0
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +17 -1
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-checkbox.d.ts +1 -1
- package/dist/components/consent-checkbox.js +2 -2
- package/dist/components/consent-checkbox.js.map +1 -1
- package/dist/components/consent-duration.d.ts +64 -0
- package/dist/components/consent-duration.d.ts.map +1 -0
- package/dist/components/consent-duration.js +184 -0
- package/dist/components/consent-duration.js.map +1 -0
- package/dist/components/consent-folder-scope.d.ts +70 -0
- package/dist/components/consent-folder-scope.d.ts.map +1 -0
- package/dist/components/consent-folder-scope.js +166 -0
- package/dist/components/consent-folder-scope.js.map +1 -0
- package/dist/components/consent-footer.d.ts.map +1 -1
- package/dist/components/consent-footer.js +13 -2
- package/dist/components/consent-footer.js.map +1 -1
- package/dist/components/consent-grant-terms.d.ts +88 -0
- package/dist/components/consent-grant-terms.d.ts.map +1 -0
- package/dist/components/consent-grant-terms.js +318 -0
- package/dist/components/consent-grant-terms.js.map +1 -0
- package/dist/components/consent-input.d.ts +4 -4
- package/dist/components/consent-input.d.ts.map +1 -1
- package/dist/components/consent-input.js +49 -29
- package/dist/components/consent-input.js.map +1 -1
- package/dist/components/consent-otp-input.d.ts +4 -4
- package/dist/components/consent-otp-input.d.ts.map +1 -1
- package/dist/components/consent-otp-input.js +51 -44
- package/dist/components/consent-otp-input.js.map +1 -1
- package/dist/components/consent-phone-handoff.d.ts +50 -0
- package/dist/components/consent-phone-handoff.d.ts.map +1 -0
- package/dist/components/consent-phone-handoff.js +215 -0
- package/dist/components/consent-phone-handoff.js.map +1 -0
- package/dist/components/consent-request-expiry.d.ts +52 -0
- package/dist/components/consent-request-expiry.d.ts.map +1 -0
- package/dist/components/consent-request-expiry.js +154 -0
- package/dist/components/consent-request-expiry.js.map +1 -0
- package/dist/components/consent-revoke.d.ts +53 -0
- package/dist/components/consent-revoke.d.ts.map +1 -0
- package/dist/components/consent-revoke.js +305 -0
- package/dist/components/consent-revoke.js.map +1 -0
- package/dist/components/consent-shell.d.ts.map +1 -1
- package/dist/components/consent-shell.js +3 -0
- package/dist/components/consent-shell.js.map +1 -1
- package/dist/components/consent-terms.d.ts +1 -1
- package/dist/components/consent-terms.js +2 -2
- package/dist/components/consent-terms.js.map +1 -1
- package/dist/components/consent-wallet-check.d.ts +45 -0
- package/dist/components/consent-wallet-check.d.ts.map +1 -0
- package/dist/components/consent-wallet-check.js +102 -0
- package/dist/components/consent-wallet-check.js.map +1 -0
- package/dist/components/consent-wallet-notice.d.ts +54 -0
- package/dist/components/consent-wallet-notice.d.ts.map +1 -0
- package/dist/components/consent-wallet-notice.js +186 -0
- package/dist/components/consent-wallet-notice.js.map +1 -0
- package/dist/components/consent-wallet-orb.d.ts +48 -0
- package/dist/components/consent-wallet-orb.d.ts.map +1 -0
- package/dist/components/consent-wallet-orb.js +269 -0
- package/dist/components/consent-wallet-orb.js.map +1 -0
- package/dist/components/consent-wallet-signature.d.ts +26 -0
- package/dist/components/consent-wallet-signature.d.ts.map +1 -0
- package/dist/components/consent-wallet-signature.js +101 -0
- package/dist/components/consent-wallet-signature.js.map +1 -0
- package/dist/components/grant-field-styles.d.ts +9 -0
- package/dist/components/grant-field-styles.d.ts.map +1 -0
- package/dist/components/grant-field-styles.js +82 -0
- package/dist/components/grant-field-styles.js.map +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +13 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +18 -1
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/components/template-link.d.ts +24 -0
- package/dist/components/template-link.d.ts.map +1 -0
- package/dist/components/template-link.js +29 -0
- package/dist/components/template-link.js.map +1 -0
- package/dist/components/wallet-globe.d.ts +29 -0
- package/dist/components/wallet-globe.d.ts.map +1 -0
- package/dist/components/wallet-globe.js +181 -0
- package/dist/components/wallet-globe.js.map +1 -0
- package/dist/components/wallet-icons.d.ts +16 -0
- package/dist/components/wallet-icons.d.ts.map +1 -0
- package/dist/components/wallet-icons.js +16 -0
- package/dist/components/wallet-icons.js.map +1 -0
- package/dist/components/wallet-status.d.ts +19 -0
- package/dist/components/wallet-status.d.ts.map +1 -0
- package/dist/components/wallet-status.js +29 -0
- package/dist/components/wallet-status.js.map +1 -0
- package/dist/consent.js +3126 -783
- package/dist/consent.min.js +1331 -272
- package/dist/copy/tokens.d.ts +91 -0
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +91 -0
- package/dist/copy/tokens.js.map +1 -1
- package/dist/grant/index.d.ts +8 -0
- package/dist/grant/index.d.ts.map +1 -0
- package/dist/grant/index.js +8 -0
- package/dist/grant/index.js.map +1 -0
- package/dist/grant/terms.d.ts +97 -0
- package/dist/grant/terms.d.ts.map +1 -0
- package/dist/grant/terms.js +139 -0
- package/dist/grant/terms.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-app/inline.d.ts.map +1 -1
- package/dist/mcp-app/inline.js +2 -2
- package/dist/mcp-app/inline.js.map +1 -1
- package/dist/react/index.d.ts +74 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +119 -0
- package/dist/react/index.js.map +1 -1
- package/package.json +10 -4
package/dist/consent.js
CHANGED
|
@@ -3,8 +3,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
5
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
-
for (var
|
|
7
|
-
if (decorator = decorators[
|
|
6
|
+
for (var i7 = decorators.length - 1, decorator; i7 >= 0; i7--)
|
|
7
|
+
if (decorator = decorators[i7])
|
|
8
8
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
9
|
if (kind && result) __defProp(target, key, result);
|
|
10
10
|
return result;
|
|
@@ -17,44 +17,44 @@ var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "a
|
|
|
17
17
|
var s = /* @__PURE__ */ Symbol();
|
|
18
18
|
var o = /* @__PURE__ */ new WeakMap();
|
|
19
19
|
var n = class {
|
|
20
|
-
constructor(
|
|
21
|
-
if (this._$cssResult$ = true,
|
|
22
|
-
this.cssText =
|
|
20
|
+
constructor(t7, e10, o9) {
|
|
21
|
+
if (this._$cssResult$ = true, o9 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
22
|
+
this.cssText = t7, this.t = e10;
|
|
23
23
|
}
|
|
24
24
|
get styleSheet() {
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
if (e && void 0 ===
|
|
28
|
-
const
|
|
29
|
-
|
|
25
|
+
let t7 = this.o;
|
|
26
|
+
const s5 = this.t;
|
|
27
|
+
if (e && void 0 === t7) {
|
|
28
|
+
const e10 = void 0 !== s5 && 1 === s5.length;
|
|
29
|
+
e10 && (t7 = o.get(s5)), void 0 === t7 && ((this.o = t7 = new CSSStyleSheet()).replaceSync(this.cssText), e10 && o.set(s5, t7));
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return t7;
|
|
32
32
|
}
|
|
33
33
|
toString() {
|
|
34
34
|
return this.cssText;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
var r = (
|
|
38
|
-
var i = (
|
|
39
|
-
const
|
|
40
|
-
if (true ===
|
|
41
|
-
if ("number" == typeof
|
|
42
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " +
|
|
43
|
-
})(
|
|
44
|
-
return new n(
|
|
37
|
+
var r = (t7) => new n("string" == typeof t7 ? t7 : t7 + "", void 0, s);
|
|
38
|
+
var i = (t7, ...e10) => {
|
|
39
|
+
const o9 = 1 === t7.length ? t7[0] : e10.reduce((e11, s5, o10) => e11 + ((t8) => {
|
|
40
|
+
if (true === t8._$cssResult$) return t8.cssText;
|
|
41
|
+
if ("number" == typeof t8) return t8;
|
|
42
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + t8 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
43
|
+
})(s5) + t7[o10 + 1], t7[0]);
|
|
44
|
+
return new n(o9, t7, s);
|
|
45
45
|
};
|
|
46
|
-
var S = (
|
|
47
|
-
if (e)
|
|
48
|
-
else for (const
|
|
49
|
-
const
|
|
50
|
-
void 0 !==
|
|
46
|
+
var S = (s5, o9) => {
|
|
47
|
+
if (e) s5.adoptedStyleSheets = o9.map((t7) => t7 instanceof CSSStyleSheet ? t7 : t7.styleSheet);
|
|
48
|
+
else for (const e10 of o9) {
|
|
49
|
+
const o10 = document.createElement("style"), n6 = t.litNonce;
|
|
50
|
+
void 0 !== n6 && o10.setAttribute("nonce", n6), o10.textContent = e10.cssText, s5.appendChild(o10);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
var c = e ? (
|
|
54
|
-
let
|
|
55
|
-
for (const
|
|
56
|
-
return r(
|
|
57
|
-
})(
|
|
53
|
+
var c = e ? (t7) => t7 : (t7) => t7 instanceof CSSStyleSheet ? ((t8) => {
|
|
54
|
+
let e10 = "";
|
|
55
|
+
for (const s5 of t8.cssRules) e10 += s5.cssText;
|
|
56
|
+
return r(e10);
|
|
57
|
+
})(t7) : t7;
|
|
58
58
|
|
|
59
59
|
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.js
|
|
60
60
|
var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: h, getOwnPropertyNames: r2, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object;
|
|
@@ -62,169 +62,169 @@ var a = globalThis;
|
|
|
62
62
|
var c2 = a.trustedTypes;
|
|
63
63
|
var l = c2 ? c2.emptyScript : "";
|
|
64
64
|
var p = a.reactiveElementPolyfillSupport;
|
|
65
|
-
var d = (
|
|
66
|
-
var u = { toAttribute(
|
|
67
|
-
switch (
|
|
65
|
+
var d = (t7, s5) => t7;
|
|
66
|
+
var u = { toAttribute(t7, s5) {
|
|
67
|
+
switch (s5) {
|
|
68
68
|
case Boolean:
|
|
69
|
-
|
|
69
|
+
t7 = t7 ? l : null;
|
|
70
70
|
break;
|
|
71
71
|
case Object:
|
|
72
72
|
case Array:
|
|
73
|
-
|
|
73
|
+
t7 = null == t7 ? t7 : JSON.stringify(t7);
|
|
74
74
|
}
|
|
75
|
-
return
|
|
76
|
-
}, fromAttribute(
|
|
77
|
-
let
|
|
78
|
-
switch (
|
|
75
|
+
return t7;
|
|
76
|
+
}, fromAttribute(t7, s5) {
|
|
77
|
+
let i7 = t7;
|
|
78
|
+
switch (s5) {
|
|
79
79
|
case Boolean:
|
|
80
|
-
|
|
80
|
+
i7 = null !== t7;
|
|
81
81
|
break;
|
|
82
82
|
case Number:
|
|
83
|
-
|
|
83
|
+
i7 = null === t7 ? null : Number(t7);
|
|
84
84
|
break;
|
|
85
85
|
case Object:
|
|
86
86
|
case Array:
|
|
87
87
|
try {
|
|
88
|
-
|
|
89
|
-
} catch (
|
|
90
|
-
|
|
88
|
+
i7 = JSON.parse(t7);
|
|
89
|
+
} catch (t8) {
|
|
90
|
+
i7 = null;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
return
|
|
93
|
+
return i7;
|
|
94
94
|
} };
|
|
95
|
-
var f = (
|
|
95
|
+
var f = (t7, s5) => !i2(t7, s5);
|
|
96
96
|
var b = { attribute: true, type: String, converter: u, reflect: false, useDefault: false, hasChanged: f };
|
|
97
97
|
Symbol.metadata ?? (Symbol.metadata = /* @__PURE__ */ Symbol("metadata")), a.litPropertyMetadata ?? (a.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
98
98
|
var y = class extends HTMLElement {
|
|
99
|
-
static addInitializer(
|
|
100
|
-
this._$Ei(), (this.l ?? (this.l = [])).push(
|
|
99
|
+
static addInitializer(t7) {
|
|
100
|
+
this._$Ei(), (this.l ?? (this.l = [])).push(t7);
|
|
101
101
|
}
|
|
102
102
|
static get observedAttributes() {
|
|
103
103
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
104
104
|
}
|
|
105
|
-
static createProperty(
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
void 0 !==
|
|
105
|
+
static createProperty(t7, s5 = b) {
|
|
106
|
+
if (s5.state && (s5.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t7) && ((s5 = Object.create(s5)).wrapped = true), this.elementProperties.set(t7, s5), !s5.noAccessor) {
|
|
107
|
+
const i7 = /* @__PURE__ */ Symbol(), h4 = this.getPropertyDescriptor(t7, i7, s5);
|
|
108
|
+
void 0 !== h4 && e2(this.prototype, t7, h4);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
static getPropertyDescriptor(
|
|
112
|
-
const { get:
|
|
113
|
-
return this[
|
|
114
|
-
}, set(
|
|
115
|
-
this[
|
|
111
|
+
static getPropertyDescriptor(t7, s5, i7) {
|
|
112
|
+
const { get: e10, set: r8 } = h(this.prototype, t7) ?? { get() {
|
|
113
|
+
return this[s5];
|
|
114
|
+
}, set(t8) {
|
|
115
|
+
this[s5] = t8;
|
|
116
116
|
} };
|
|
117
|
-
return { get:
|
|
118
|
-
const
|
|
119
|
-
|
|
117
|
+
return { get: e10, set(s6) {
|
|
118
|
+
const h4 = e10?.call(this);
|
|
119
|
+
r8?.call(this, s6), this.requestUpdate(t7, h4, i7);
|
|
120
120
|
}, configurable: true, enumerable: true };
|
|
121
121
|
}
|
|
122
|
-
static getPropertyOptions(
|
|
123
|
-
return this.elementProperties.get(
|
|
122
|
+
static getPropertyOptions(t7) {
|
|
123
|
+
return this.elementProperties.get(t7) ?? b;
|
|
124
124
|
}
|
|
125
125
|
static _$Ei() {
|
|
126
126
|
if (this.hasOwnProperty(d("elementProperties"))) return;
|
|
127
|
-
const
|
|
128
|
-
|
|
127
|
+
const t7 = n2(this);
|
|
128
|
+
t7.finalize(), void 0 !== t7.l && (this.l = [...t7.l]), this.elementProperties = new Map(t7.elementProperties);
|
|
129
129
|
}
|
|
130
130
|
static finalize() {
|
|
131
131
|
if (this.hasOwnProperty(d("finalized"))) return;
|
|
132
132
|
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
|
|
133
|
-
const
|
|
134
|
-
for (const
|
|
133
|
+
const t8 = this.properties, s5 = [...r2(t8), ...o2(t8)];
|
|
134
|
+
for (const i7 of s5) this.createProperty(i7, t8[i7]);
|
|
135
135
|
}
|
|
136
|
-
const
|
|
137
|
-
if (null !==
|
|
138
|
-
const
|
|
139
|
-
if (void 0 !==
|
|
136
|
+
const t7 = this[Symbol.metadata];
|
|
137
|
+
if (null !== t7) {
|
|
138
|
+
const s5 = litPropertyMetadata.get(t7);
|
|
139
|
+
if (void 0 !== s5) for (const [t8, i7] of s5) this.elementProperties.set(t8, i7);
|
|
140
140
|
}
|
|
141
141
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
142
|
-
for (const [
|
|
143
|
-
const
|
|
144
|
-
void 0 !==
|
|
142
|
+
for (const [t8, s5] of this.elementProperties) {
|
|
143
|
+
const i7 = this._$Eu(t8, s5);
|
|
144
|
+
void 0 !== i7 && this._$Eh.set(i7, t8);
|
|
145
145
|
}
|
|
146
146
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
147
147
|
}
|
|
148
|
-
static finalizeStyles(
|
|
149
|
-
const
|
|
150
|
-
if (Array.isArray(
|
|
151
|
-
const
|
|
152
|
-
for (const
|
|
153
|
-
} else void 0 !==
|
|
154
|
-
return
|
|
148
|
+
static finalizeStyles(s5) {
|
|
149
|
+
const i7 = [];
|
|
150
|
+
if (Array.isArray(s5)) {
|
|
151
|
+
const e10 = new Set(s5.flat(1 / 0).reverse());
|
|
152
|
+
for (const s6 of e10) i7.unshift(c(s6));
|
|
153
|
+
} else void 0 !== s5 && i7.push(c(s5));
|
|
154
|
+
return i7;
|
|
155
155
|
}
|
|
156
|
-
static _$Eu(
|
|
157
|
-
const
|
|
158
|
-
return false ===
|
|
156
|
+
static _$Eu(t7, s5) {
|
|
157
|
+
const i7 = s5.attribute;
|
|
158
|
+
return false === i7 ? void 0 : "string" == typeof i7 ? i7 : "string" == typeof t7 ? t7.toLowerCase() : void 0;
|
|
159
159
|
}
|
|
160
160
|
constructor() {
|
|
161
161
|
super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
|
|
162
162
|
}
|
|
163
163
|
_$Ev() {
|
|
164
|
-
this._$ES = new Promise((
|
|
164
|
+
this._$ES = new Promise((t7) => this.enableUpdating = t7), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t7) => t7(this));
|
|
165
165
|
}
|
|
166
|
-
addController(
|
|
167
|
-
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(
|
|
166
|
+
addController(t7) {
|
|
167
|
+
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t7), void 0 !== this.renderRoot && this.isConnected && t7.hostConnected?.();
|
|
168
168
|
}
|
|
169
|
-
removeController(
|
|
170
|
-
this._$EO?.delete(
|
|
169
|
+
removeController(t7) {
|
|
170
|
+
this._$EO?.delete(t7);
|
|
171
171
|
}
|
|
172
172
|
_$E_() {
|
|
173
|
-
const
|
|
174
|
-
for (const
|
|
175
|
-
|
|
173
|
+
const t7 = /* @__PURE__ */ new Map(), s5 = this.constructor.elementProperties;
|
|
174
|
+
for (const i7 of s5.keys()) this.hasOwnProperty(i7) && (t7.set(i7, this[i7]), delete this[i7]);
|
|
175
|
+
t7.size > 0 && (this._$Ep = t7);
|
|
176
176
|
}
|
|
177
177
|
createRenderRoot() {
|
|
178
|
-
const
|
|
179
|
-
return S(
|
|
178
|
+
const t7 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
179
|
+
return S(t7, this.constructor.elementStyles), t7;
|
|
180
180
|
}
|
|
181
181
|
connectedCallback() {
|
|
182
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), this._$EO?.forEach((
|
|
182
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), this._$EO?.forEach((t7) => t7.hostConnected?.());
|
|
183
183
|
}
|
|
184
|
-
enableUpdating(
|
|
184
|
+
enableUpdating(t7) {
|
|
185
185
|
}
|
|
186
186
|
disconnectedCallback() {
|
|
187
|
-
this._$EO?.forEach((
|
|
187
|
+
this._$EO?.forEach((t7) => t7.hostDisconnected?.());
|
|
188
188
|
}
|
|
189
|
-
attributeChangedCallback(
|
|
190
|
-
this._$AK(
|
|
189
|
+
attributeChangedCallback(t7, s5, i7) {
|
|
190
|
+
this._$AK(t7, i7);
|
|
191
191
|
}
|
|
192
|
-
_$ET(
|
|
193
|
-
const
|
|
194
|
-
if (void 0 !==
|
|
195
|
-
const
|
|
196
|
-
this._$Em =
|
|
192
|
+
_$ET(t7, s5) {
|
|
193
|
+
const i7 = this.constructor.elementProperties.get(t7), e10 = this.constructor._$Eu(t7, i7);
|
|
194
|
+
if (void 0 !== e10 && true === i7.reflect) {
|
|
195
|
+
const h4 = (void 0 !== i7.converter?.toAttribute ? i7.converter : u).toAttribute(s5, i7.type);
|
|
196
|
+
this._$Em = t7, null == h4 ? this.removeAttribute(e10) : this.setAttribute(e10, h4), this._$Em = null;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
_$AK(
|
|
200
|
-
const
|
|
201
|
-
if (void 0 !==
|
|
202
|
-
const
|
|
203
|
-
this._$Em =
|
|
204
|
-
const
|
|
205
|
-
this[
|
|
199
|
+
_$AK(t7, s5) {
|
|
200
|
+
const i7 = this.constructor, e10 = i7._$Eh.get(t7);
|
|
201
|
+
if (void 0 !== e10 && this._$Em !== e10) {
|
|
202
|
+
const t8 = i7.getPropertyOptions(e10), h4 = "function" == typeof t8.converter ? { fromAttribute: t8.converter } : void 0 !== t8.converter?.fromAttribute ? t8.converter : u;
|
|
203
|
+
this._$Em = e10;
|
|
204
|
+
const r8 = h4.fromAttribute(s5, t8.type);
|
|
205
|
+
this[e10] = r8 ?? this._$Ej?.get(e10) ?? r8, this._$Em = null;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
requestUpdate(
|
|
209
|
-
if (void 0 !==
|
|
210
|
-
const
|
|
211
|
-
if (false ===
|
|
212
|
-
this.C(
|
|
208
|
+
requestUpdate(t7, s5, i7, e10 = false, h4) {
|
|
209
|
+
if (void 0 !== t7) {
|
|
210
|
+
const r8 = this.constructor;
|
|
211
|
+
if (false === e10 && (h4 = this[t7]), i7 ?? (i7 = r8.getPropertyOptions(t7)), !((i7.hasChanged ?? f)(h4, s5) || i7.useDefault && i7.reflect && h4 === this._$Ej?.get(t7) && !this.hasAttribute(r8._$Eu(t7, i7)))) return;
|
|
212
|
+
this.C(t7, s5, i7);
|
|
213
213
|
}
|
|
214
214
|
false === this.isUpdatePending && (this._$ES = this._$EP());
|
|
215
215
|
}
|
|
216
|
-
C(
|
|
217
|
-
|
|
216
|
+
C(t7, s5, { useDefault: i7, reflect: e10, wrapped: h4 }, r8) {
|
|
217
|
+
i7 && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t7) && (this._$Ej.set(t7, r8 ?? s5 ?? this[t7]), true !== h4 || void 0 !== r8) || (this._$AL.has(t7) || (this.hasUpdated || i7 || (s5 = void 0), this._$AL.set(t7, s5)), true === e10 && this._$Em !== t7 && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t7));
|
|
218
218
|
}
|
|
219
219
|
async _$EP() {
|
|
220
220
|
this.isUpdatePending = true;
|
|
221
221
|
try {
|
|
222
222
|
await this._$ES;
|
|
223
|
-
} catch (
|
|
224
|
-
Promise.reject(
|
|
223
|
+
} catch (t8) {
|
|
224
|
+
Promise.reject(t8);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
227
|
-
return null !=
|
|
226
|
+
const t7 = this.scheduleUpdate();
|
|
227
|
+
return null != t7 && await t7, !this.isUpdatePending;
|
|
228
228
|
}
|
|
229
229
|
scheduleUpdate() {
|
|
230
230
|
return this.performUpdate();
|
|
@@ -233,28 +233,28 @@ var y = class extends HTMLElement {
|
|
|
233
233
|
if (!this.isUpdatePending) return;
|
|
234
234
|
if (!this.hasUpdated) {
|
|
235
235
|
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
236
|
-
for (const [
|
|
236
|
+
for (const [t9, s6] of this._$Ep) this[t9] = s6;
|
|
237
237
|
this._$Ep = void 0;
|
|
238
238
|
}
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
const { wrapped:
|
|
242
|
-
true !==
|
|
239
|
+
const t8 = this.constructor.elementProperties;
|
|
240
|
+
if (t8.size > 0) for (const [s6, i7] of t8) {
|
|
241
|
+
const { wrapped: t9 } = i7, e10 = this[s6];
|
|
242
|
+
true !== t9 || this._$AL.has(s6) || void 0 === e10 || this.C(s6, void 0, i7, e10);
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
let
|
|
246
|
-
const
|
|
245
|
+
let t7 = false;
|
|
246
|
+
const s5 = this._$AL;
|
|
247
247
|
try {
|
|
248
|
-
|
|
249
|
-
} catch (
|
|
250
|
-
throw
|
|
248
|
+
t7 = this.shouldUpdate(s5), t7 ? (this.willUpdate(s5), this._$EO?.forEach((t8) => t8.hostUpdate?.()), this.update(s5)) : this._$EM();
|
|
249
|
+
} catch (s6) {
|
|
250
|
+
throw t7 = false, this._$EM(), s6;
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
t7 && this._$AE(s5);
|
|
253
253
|
}
|
|
254
|
-
willUpdate(
|
|
254
|
+
willUpdate(t7) {
|
|
255
255
|
}
|
|
256
|
-
_$AE(
|
|
257
|
-
this._$EO?.forEach((
|
|
256
|
+
_$AE(t7) {
|
|
257
|
+
this._$EO?.forEach((t8) => t8.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t7)), this.updated(t7);
|
|
258
258
|
}
|
|
259
259
|
_$EM() {
|
|
260
260
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
|
|
@@ -265,33 +265,33 @@ var y = class extends HTMLElement {
|
|
|
265
265
|
getUpdateComplete() {
|
|
266
266
|
return this._$ES;
|
|
267
267
|
}
|
|
268
|
-
shouldUpdate(
|
|
268
|
+
shouldUpdate(t7) {
|
|
269
269
|
return true;
|
|
270
270
|
}
|
|
271
|
-
update(
|
|
272
|
-
this._$Eq && (this._$Eq = this._$Eq.forEach((
|
|
271
|
+
update(t7) {
|
|
272
|
+
this._$Eq && (this._$Eq = this._$Eq.forEach((t8) => this._$ET(t8, this[t8]))), this._$EM();
|
|
273
273
|
}
|
|
274
|
-
updated(
|
|
274
|
+
updated(t7) {
|
|
275
275
|
}
|
|
276
|
-
firstUpdated(
|
|
276
|
+
firstUpdated(t7) {
|
|
277
277
|
}
|
|
278
278
|
};
|
|
279
279
|
y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[d("elementProperties")] = /* @__PURE__ */ new Map(), y[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: y }), (a.reactiveElementVersions ?? (a.reactiveElementVersions = [])).push("2.1.2");
|
|
280
280
|
|
|
281
281
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js
|
|
282
282
|
var t2 = globalThis;
|
|
283
|
-
var i3 = (
|
|
283
|
+
var i3 = (t7) => t7;
|
|
284
284
|
var s2 = t2.trustedTypes;
|
|
285
|
-
var e3 = s2 ? s2.createPolicy("lit-html", { createHTML: (
|
|
285
|
+
var e3 = s2 ? s2.createPolicy("lit-html", { createHTML: (t7) => t7 }) : void 0;
|
|
286
286
|
var h2 = "$lit$";
|
|
287
287
|
var o3 = `lit$${Math.random().toFixed(9).slice(2)}$`;
|
|
288
288
|
var n3 = "?" + o3;
|
|
289
289
|
var r3 = `<${n3}>`;
|
|
290
290
|
var l2 = document;
|
|
291
291
|
var c3 = () => l2.createComment("");
|
|
292
|
-
var a2 = (
|
|
292
|
+
var a2 = (t7) => null === t7 || "object" != typeof t7 && "function" != typeof t7;
|
|
293
293
|
var u2 = Array.isArray;
|
|
294
|
-
var d2 = (
|
|
294
|
+
var d2 = (t7) => u2(t7) || "function" == typeof t7?.[Symbol.iterator];
|
|
295
295
|
var f2 = "[ \n\f\r]";
|
|
296
296
|
var v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
|
|
297
297
|
var _ = /-->/g;
|
|
@@ -301,7 +301,7 @@ var p2 = RegExp(`>|${f2}(?:([^\\s"'>=/]+)(${f2}*=${f2}*(?:[^
|
|
|
301
301
|
var g = /'/g;
|
|
302
302
|
var $ = /"/g;
|
|
303
303
|
var y2 = /^(?:script|style|textarea|title)$/i;
|
|
304
|
-
var x = (
|
|
304
|
+
var x = (t7) => (i7, ...s5) => ({ _$litType$: t7, strings: i7, values: s5 });
|
|
305
305
|
var b2 = x(1);
|
|
306
306
|
var w = x(2);
|
|
307
307
|
var T = x(3);
|
|
@@ -309,68 +309,68 @@ var E = /* @__PURE__ */ Symbol.for("lit-noChange");
|
|
|
309
309
|
var A = /* @__PURE__ */ Symbol.for("lit-nothing");
|
|
310
310
|
var C = /* @__PURE__ */ new WeakMap();
|
|
311
311
|
var P = l2.createTreeWalker(l2, 129);
|
|
312
|
-
function V(
|
|
313
|
-
if (!u2(
|
|
314
|
-
return void 0 !== e3 ? e3.createHTML(
|
|
312
|
+
function V(t7, i7) {
|
|
313
|
+
if (!u2(t7) || !t7.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
314
|
+
return void 0 !== e3 ? e3.createHTML(i7) : i7;
|
|
315
315
|
}
|
|
316
|
-
var N = (
|
|
317
|
-
const
|
|
318
|
-
let
|
|
319
|
-
for (let
|
|
320
|
-
const
|
|
321
|
-
let
|
|
322
|
-
for (;
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
return [V(
|
|
316
|
+
var N = (t7, i7) => {
|
|
317
|
+
const s5 = t7.length - 1, e10 = [];
|
|
318
|
+
let n6, l4 = 2 === i7 ? "<svg>" : 3 === i7 ? "<math>" : "", c5 = v;
|
|
319
|
+
for (let i8 = 0; i8 < s5; i8++) {
|
|
320
|
+
const s6 = t7[i8];
|
|
321
|
+
let a4, u4, d4 = -1, f4 = 0;
|
|
322
|
+
for (; f4 < s6.length && (c5.lastIndex = f4, u4 = c5.exec(s6), null !== u4); ) f4 = c5.lastIndex, c5 === v ? "!--" === u4[1] ? c5 = _ : void 0 !== u4[1] ? c5 = m : void 0 !== u4[2] ? (y2.test(u4[2]) && (n6 = RegExp("</" + u4[2], "g")), c5 = p2) : void 0 !== u4[3] && (c5 = p2) : c5 === p2 ? ">" === u4[0] ? (c5 = n6 ?? v, d4 = -1) : void 0 === u4[1] ? d4 = -2 : (d4 = c5.lastIndex - u4[2].length, a4 = u4[1], c5 = void 0 === u4[3] ? p2 : '"' === u4[3] ? $ : g) : c5 === $ || c5 === g ? c5 = p2 : c5 === _ || c5 === m ? c5 = v : (c5 = p2, n6 = void 0);
|
|
323
|
+
const x3 = c5 === p2 && t7[i8 + 1].startsWith("/>") ? " " : "";
|
|
324
|
+
l4 += c5 === v ? s6 + r3 : d4 >= 0 ? (e10.push(a4), s6.slice(0, d4) + h2 + s6.slice(d4) + o3 + x3) : s6 + o3 + (-2 === d4 ? i8 : x3);
|
|
325
|
+
}
|
|
326
|
+
return [V(t7, l4 + (t7[s5] || "<?>") + (2 === i7 ? "</svg>" : 3 === i7 ? "</math>" : "")), e10];
|
|
327
327
|
};
|
|
328
328
|
var S2 = class _S {
|
|
329
|
-
constructor({ strings:
|
|
330
|
-
let
|
|
329
|
+
constructor({ strings: t7, _$litType$: i7 }, e10) {
|
|
330
|
+
let r8;
|
|
331
331
|
this.parts = [];
|
|
332
|
-
let
|
|
333
|
-
const
|
|
334
|
-
if (this.el = _S.createElement(
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
for (; null !== (
|
|
339
|
-
if (1 ===
|
|
340
|
-
if (
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
} else
|
|
344
|
-
if (y2.test(
|
|
345
|
-
const
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
-
for (let
|
|
349
|
-
|
|
332
|
+
let l4 = 0, a4 = 0;
|
|
333
|
+
const u4 = t7.length - 1, d4 = this.parts, [f4, v3] = N(t7, i7);
|
|
334
|
+
if (this.el = _S.createElement(f4, e10), P.currentNode = this.el.content, 2 === i7 || 3 === i7) {
|
|
335
|
+
const t8 = this.el.content.firstChild;
|
|
336
|
+
t8.replaceWith(...t8.childNodes);
|
|
337
|
+
}
|
|
338
|
+
for (; null !== (r8 = P.nextNode()) && d4.length < u4; ) {
|
|
339
|
+
if (1 === r8.nodeType) {
|
|
340
|
+
if (r8.hasAttributes()) for (const t8 of r8.getAttributeNames()) if (t8.endsWith(h2)) {
|
|
341
|
+
const i8 = v3[a4++], s5 = r8.getAttribute(t8).split(o3), e11 = /([.?@])?(.*)/.exec(i8);
|
|
342
|
+
d4.push({ type: 1, index: l4, name: e11[2], strings: s5, ctor: "." === e11[1] ? I : "?" === e11[1] ? L : "@" === e11[1] ? z : H }), r8.removeAttribute(t8);
|
|
343
|
+
} else t8.startsWith(o3) && (d4.push({ type: 6, index: l4 }), r8.removeAttribute(t8));
|
|
344
|
+
if (y2.test(r8.tagName)) {
|
|
345
|
+
const t8 = r8.textContent.split(o3), i8 = t8.length - 1;
|
|
346
|
+
if (i8 > 0) {
|
|
347
|
+
r8.textContent = s2 ? s2.emptyScript : "";
|
|
348
|
+
for (let s5 = 0; s5 < i8; s5++) r8.append(t8[s5], c3()), P.nextNode(), d4.push({ type: 2, index: ++l4 });
|
|
349
|
+
r8.append(t8[i8], c3());
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
} else if (8 ===
|
|
352
|
+
} else if (8 === r8.nodeType) if (r8.data === n3) d4.push({ type: 2, index: l4 });
|
|
353
353
|
else {
|
|
354
|
-
let
|
|
355
|
-
for (; -1 !== (
|
|
354
|
+
let t8 = -1;
|
|
355
|
+
for (; -1 !== (t8 = r8.data.indexOf(o3, t8 + 1)); ) d4.push({ type: 7, index: l4 }), t8 += o3.length - 1;
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
l4++;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
static createElement(
|
|
361
|
-
const
|
|
362
|
-
return
|
|
360
|
+
static createElement(t7, i7) {
|
|
361
|
+
const s5 = l2.createElement("template");
|
|
362
|
+
return s5.innerHTML = t7, s5;
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
|
-
function M(
|
|
366
|
-
if (
|
|
367
|
-
let
|
|
368
|
-
const
|
|
369
|
-
return
|
|
365
|
+
function M(t7, i7, s5 = t7, e10) {
|
|
366
|
+
if (i7 === E) return i7;
|
|
367
|
+
let h4 = void 0 !== e10 ? s5._$Co?.[e10] : s5._$Cl;
|
|
368
|
+
const o9 = a2(i7) ? void 0 : i7._$litDirective$;
|
|
369
|
+
return h4?.constructor !== o9 && (h4?._$AO?.(false), void 0 === o9 ? h4 = void 0 : (h4 = new o9(t7), h4._$AT(t7, s5, e10)), void 0 !== e10 ? (s5._$Co ?? (s5._$Co = []))[e10] = h4 : s5._$Cl = h4), void 0 !== h4 && (i7 = M(t7, h4._$AS(t7, i7.values), h4, e10)), i7;
|
|
370
370
|
}
|
|
371
371
|
var R = class {
|
|
372
|
-
constructor(
|
|
373
|
-
this._$AV = [], this._$AN = void 0, this._$AD =
|
|
372
|
+
constructor(t7, i7) {
|
|
373
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t7, this._$AM = i7;
|
|
374
374
|
}
|
|
375
375
|
get parentNode() {
|
|
376
376
|
return this._$AM.parentNode;
|
|
@@ -378,35 +378,35 @@ var R = class {
|
|
|
378
378
|
get _$AU() {
|
|
379
379
|
return this._$AM._$AU;
|
|
380
380
|
}
|
|
381
|
-
u(
|
|
382
|
-
const { el: { content:
|
|
383
|
-
P.currentNode =
|
|
384
|
-
let
|
|
385
|
-
for (; void 0 !==
|
|
386
|
-
if (
|
|
387
|
-
let
|
|
388
|
-
2 ===
|
|
381
|
+
u(t7) {
|
|
382
|
+
const { el: { content: i7 }, parts: s5 } = this._$AD, e10 = (t7?.creationScope ?? l2).importNode(i7, true);
|
|
383
|
+
P.currentNode = e10;
|
|
384
|
+
let h4 = P.nextNode(), o9 = 0, n6 = 0, r8 = s5[0];
|
|
385
|
+
for (; void 0 !== r8; ) {
|
|
386
|
+
if (o9 === r8.index) {
|
|
387
|
+
let i8;
|
|
388
|
+
2 === r8.type ? i8 = new k(h4, h4.nextSibling, this, t7) : 1 === r8.type ? i8 = new r8.ctor(h4, r8.name, r8.strings, this, t7) : 6 === r8.type && (i8 = new Z(h4, this, t7)), this._$AV.push(i8), r8 = s5[++n6];
|
|
389
389
|
}
|
|
390
|
-
|
|
390
|
+
o9 !== r8?.index && (h4 = P.nextNode(), o9++);
|
|
391
391
|
}
|
|
392
|
-
return P.currentNode = l2,
|
|
392
|
+
return P.currentNode = l2, e10;
|
|
393
393
|
}
|
|
394
|
-
p(
|
|
395
|
-
let
|
|
396
|
-
for (const
|
|
394
|
+
p(t7) {
|
|
395
|
+
let i7 = 0;
|
|
396
|
+
for (const s5 of this._$AV) void 0 !== s5 && (void 0 !== s5.strings ? (s5._$AI(t7, s5, i7), i7 += s5.strings.length - 2) : s5._$AI(t7[i7])), i7++;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
399
|
var k = class _k {
|
|
400
400
|
get _$AU() {
|
|
401
401
|
return this._$AM?._$AU ?? this._$Cv;
|
|
402
402
|
}
|
|
403
|
-
constructor(
|
|
404
|
-
this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA =
|
|
403
|
+
constructor(t7, i7, s5, e10) {
|
|
404
|
+
this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = t7, this._$AB = i7, this._$AM = s5, this.options = e10, this._$Cv = e10?.isConnected ?? true;
|
|
405
405
|
}
|
|
406
406
|
get parentNode() {
|
|
407
|
-
let
|
|
408
|
-
const
|
|
409
|
-
return void 0 !==
|
|
407
|
+
let t7 = this._$AA.parentNode;
|
|
408
|
+
const i7 = this._$AM;
|
|
409
|
+
return void 0 !== i7 && 11 === t7?.nodeType && (t7 = i7.parentNode), t7;
|
|
410
410
|
}
|
|
411
411
|
get startNode() {
|
|
412
412
|
return this._$AA;
|
|
@@ -414,45 +414,45 @@ var k = class _k {
|
|
|
414
414
|
get endNode() {
|
|
415
415
|
return this._$AB;
|
|
416
416
|
}
|
|
417
|
-
_$AI(
|
|
418
|
-
|
|
417
|
+
_$AI(t7, i7 = this) {
|
|
418
|
+
t7 = M(this, t7, i7), a2(t7) ? t7 === A || null == t7 || "" === t7 ? (this._$AH !== A && this._$AR(), this._$AH = A) : t7 !== this._$AH && t7 !== E && this._(t7) : void 0 !== t7._$litType$ ? this.$(t7) : void 0 !== t7.nodeType ? this.T(t7) : d2(t7) ? this.k(t7) : this._(t7);
|
|
419
419
|
}
|
|
420
|
-
O(
|
|
421
|
-
return this._$AA.parentNode.insertBefore(
|
|
420
|
+
O(t7) {
|
|
421
|
+
return this._$AA.parentNode.insertBefore(t7, this._$AB);
|
|
422
422
|
}
|
|
423
|
-
T(
|
|
424
|
-
this._$AH !==
|
|
423
|
+
T(t7) {
|
|
424
|
+
this._$AH !== t7 && (this._$AR(), this._$AH = this.O(t7));
|
|
425
425
|
}
|
|
426
|
-
_(
|
|
427
|
-
this._$AH !== A && a2(this._$AH) ? this._$AA.nextSibling.data =
|
|
426
|
+
_(t7) {
|
|
427
|
+
this._$AH !== A && a2(this._$AH) ? this._$AA.nextSibling.data = t7 : this.T(l2.createTextNode(t7)), this._$AH = t7;
|
|
428
428
|
}
|
|
429
|
-
$(
|
|
430
|
-
const { values:
|
|
431
|
-
if (this._$AH?._$AD ===
|
|
429
|
+
$(t7) {
|
|
430
|
+
const { values: i7, _$litType$: s5 } = t7, e10 = "number" == typeof s5 ? this._$AC(t7) : (void 0 === s5.el && (s5.el = S2.createElement(V(s5.h, s5.h[0]), this.options)), s5);
|
|
431
|
+
if (this._$AH?._$AD === e10) this._$AH.p(i7);
|
|
432
432
|
else {
|
|
433
|
-
const
|
|
434
|
-
|
|
433
|
+
const t8 = new R(e10, this), s6 = t8.u(this.options);
|
|
434
|
+
t8.p(i7), this.T(s6), this._$AH = t8;
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
_$AC(
|
|
438
|
-
let
|
|
439
|
-
return void 0 ===
|
|
437
|
+
_$AC(t7) {
|
|
438
|
+
let i7 = C.get(t7.strings);
|
|
439
|
+
return void 0 === i7 && C.set(t7.strings, i7 = new S2(t7)), i7;
|
|
440
440
|
}
|
|
441
|
-
k(
|
|
441
|
+
k(t7) {
|
|
442
442
|
u2(this._$AH) || (this._$AH = [], this._$AR());
|
|
443
|
-
const
|
|
444
|
-
let
|
|
445
|
-
for (const
|
|
446
|
-
|
|
443
|
+
const i7 = this._$AH;
|
|
444
|
+
let s5, e10 = 0;
|
|
445
|
+
for (const h4 of t7) e10 === i7.length ? i7.push(s5 = new _k(this.O(c3()), this.O(c3()), this, this.options)) : s5 = i7[e10], s5._$AI(h4), e10++;
|
|
446
|
+
e10 < i7.length && (this._$AR(s5 && s5._$AB.nextSibling, e10), i7.length = e10);
|
|
447
447
|
}
|
|
448
|
-
_$AR(
|
|
449
|
-
for (this._$AP?.(false, true,
|
|
450
|
-
const
|
|
451
|
-
i3(
|
|
448
|
+
_$AR(t7 = this._$AA.nextSibling, s5) {
|
|
449
|
+
for (this._$AP?.(false, true, s5); t7 !== this._$AB; ) {
|
|
450
|
+
const s6 = i3(t7).nextSibling;
|
|
451
|
+
i3(t7).remove(), t7 = s6;
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
setConnected(
|
|
455
|
-
void 0 === this._$AM && (this._$Cv =
|
|
454
|
+
setConnected(t7) {
|
|
455
|
+
void 0 === this._$AM && (this._$Cv = t7, this._$AP?.(t7));
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
458
|
var H = class {
|
|
@@ -462,74 +462,74 @@ var H = class {
|
|
|
462
462
|
get _$AU() {
|
|
463
463
|
return this._$AM._$AU;
|
|
464
464
|
}
|
|
465
|
-
constructor(
|
|
466
|
-
this.type = 1, this._$AH = A, this._$AN = void 0, this.element =
|
|
465
|
+
constructor(t7, i7, s5, e10, h4) {
|
|
466
|
+
this.type = 1, this._$AH = A, this._$AN = void 0, this.element = t7, this.name = i7, this._$AM = e10, this.options = h4, s5.length > 2 || "" !== s5[0] || "" !== s5[1] ? (this._$AH = Array(s5.length - 1).fill(new String()), this.strings = s5) : this._$AH = A;
|
|
467
467
|
}
|
|
468
|
-
_$AI(
|
|
469
|
-
const
|
|
470
|
-
let
|
|
471
|
-
if (void 0 ===
|
|
468
|
+
_$AI(t7, i7 = this, s5, e10) {
|
|
469
|
+
const h4 = this.strings;
|
|
470
|
+
let o9 = false;
|
|
471
|
+
if (void 0 === h4) t7 = M(this, t7, i7, 0), o9 = !a2(t7) || t7 !== this._$AH && t7 !== E, o9 && (this._$AH = t7);
|
|
472
472
|
else {
|
|
473
|
-
const
|
|
474
|
-
let
|
|
475
|
-
for (
|
|
473
|
+
const e11 = t7;
|
|
474
|
+
let n6, r8;
|
|
475
|
+
for (t7 = h4[0], n6 = 0; n6 < h4.length - 1; n6++) r8 = M(this, e11[s5 + n6], i7, n6), r8 === E && (r8 = this._$AH[n6]), o9 || (o9 = !a2(r8) || r8 !== this._$AH[n6]), r8 === A ? t7 = A : t7 !== A && (t7 += (r8 ?? "") + h4[n6 + 1]), this._$AH[n6] = r8;
|
|
476
476
|
}
|
|
477
|
-
|
|
477
|
+
o9 && !e10 && this.j(t7);
|
|
478
478
|
}
|
|
479
|
-
j(
|
|
480
|
-
|
|
479
|
+
j(t7) {
|
|
480
|
+
t7 === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t7 ?? "");
|
|
481
481
|
}
|
|
482
482
|
};
|
|
483
483
|
var I = class extends H {
|
|
484
484
|
constructor() {
|
|
485
485
|
super(...arguments), this.type = 3;
|
|
486
486
|
}
|
|
487
|
-
j(
|
|
488
|
-
this.element[this.name] =
|
|
487
|
+
j(t7) {
|
|
488
|
+
this.element[this.name] = t7 === A ? void 0 : t7;
|
|
489
489
|
}
|
|
490
490
|
};
|
|
491
491
|
var L = class extends H {
|
|
492
492
|
constructor() {
|
|
493
493
|
super(...arguments), this.type = 4;
|
|
494
494
|
}
|
|
495
|
-
j(
|
|
496
|
-
this.element.toggleAttribute(this.name, !!
|
|
495
|
+
j(t7) {
|
|
496
|
+
this.element.toggleAttribute(this.name, !!t7 && t7 !== A);
|
|
497
497
|
}
|
|
498
498
|
};
|
|
499
499
|
var z = class extends H {
|
|
500
|
-
constructor(
|
|
501
|
-
super(
|
|
500
|
+
constructor(t7, i7, s5, e10, h4) {
|
|
501
|
+
super(t7, i7, s5, e10, h4), this.type = 5;
|
|
502
502
|
}
|
|
503
|
-
_$AI(
|
|
504
|
-
if ((
|
|
505
|
-
const
|
|
506
|
-
|
|
503
|
+
_$AI(t7, i7 = this) {
|
|
504
|
+
if ((t7 = M(this, t7, i7, 0) ?? A) === E) return;
|
|
505
|
+
const s5 = this._$AH, e10 = t7 === A && s5 !== A || t7.capture !== s5.capture || t7.once !== s5.once || t7.passive !== s5.passive, h4 = t7 !== A && (s5 === A || e10);
|
|
506
|
+
e10 && this.element.removeEventListener(this.name, this, s5), h4 && this.element.addEventListener(this.name, this, t7), this._$AH = t7;
|
|
507
507
|
}
|
|
508
|
-
handleEvent(
|
|
509
|
-
"function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element,
|
|
508
|
+
handleEvent(t7) {
|
|
509
|
+
"function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t7) : this._$AH.handleEvent(t7);
|
|
510
510
|
}
|
|
511
511
|
};
|
|
512
512
|
var Z = class {
|
|
513
|
-
constructor(
|
|
514
|
-
this.element =
|
|
513
|
+
constructor(t7, i7, s5) {
|
|
514
|
+
this.element = t7, this.type = 6, this._$AN = void 0, this._$AM = i7, this.options = s5;
|
|
515
515
|
}
|
|
516
516
|
get _$AU() {
|
|
517
517
|
return this._$AM._$AU;
|
|
518
518
|
}
|
|
519
|
-
_$AI(
|
|
520
|
-
M(this,
|
|
519
|
+
_$AI(t7) {
|
|
520
|
+
M(this, t7);
|
|
521
521
|
}
|
|
522
522
|
};
|
|
523
523
|
var B = t2.litHtmlPolyfillSupport;
|
|
524
524
|
B?.(S2, k), (t2.litHtmlVersions ?? (t2.litHtmlVersions = [])).push("3.3.2");
|
|
525
|
-
var D = (
|
|
526
|
-
const
|
|
527
|
-
let
|
|
528
|
-
if (void 0 ===
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
}
|
|
532
|
-
return
|
|
525
|
+
var D = (t7, i7, s5) => {
|
|
526
|
+
const e10 = s5?.renderBefore ?? i7;
|
|
527
|
+
let h4 = e10._$litPart$;
|
|
528
|
+
if (void 0 === h4) {
|
|
529
|
+
const t8 = s5?.renderBefore ?? null;
|
|
530
|
+
e10._$litPart$ = h4 = new k(i7.insertBefore(c3(), t8), t8, void 0, s5 ?? {});
|
|
531
|
+
}
|
|
532
|
+
return h4._$AI(t7), h4;
|
|
533
533
|
};
|
|
534
534
|
|
|
535
535
|
// ../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js
|
|
@@ -540,12 +540,12 @@ var i4 = class extends y {
|
|
|
540
540
|
}
|
|
541
541
|
createRenderRoot() {
|
|
542
542
|
var _a;
|
|
543
|
-
const
|
|
544
|
-
return (_a = this.renderOptions).renderBefore ?? (_a.renderBefore =
|
|
543
|
+
const t7 = super.createRenderRoot();
|
|
544
|
+
return (_a = this.renderOptions).renderBefore ?? (_a.renderBefore = t7.firstChild), t7;
|
|
545
545
|
}
|
|
546
|
-
update(
|
|
547
|
-
const
|
|
548
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(
|
|
546
|
+
update(t7) {
|
|
547
|
+
const r8 = this.render();
|
|
548
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t7), this._$Do = D(r8, this.renderRoot, this.renderOptions);
|
|
549
549
|
}
|
|
550
550
|
connectedCallback() {
|
|
551
551
|
super.connectedCallback(), this._$Do?.setConnected(true);
|
|
@@ -563,55 +563,79 @@ o4?.({ LitElement: i4 });
|
|
|
563
563
|
(s3.litElementVersions ?? (s3.litElementVersions = [])).push("4.2.2");
|
|
564
564
|
|
|
565
565
|
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js
|
|
566
|
-
var t3 = (
|
|
567
|
-
void 0 !==
|
|
568
|
-
customElements.define(
|
|
569
|
-
}) : customElements.define(
|
|
566
|
+
var t3 = (t7) => (e10, o9) => {
|
|
567
|
+
void 0 !== o9 ? o9.addInitializer(() => {
|
|
568
|
+
customElements.define(t7, e10);
|
|
569
|
+
}) : customElements.define(t7, e10);
|
|
570
570
|
};
|
|
571
571
|
|
|
572
572
|
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js
|
|
573
573
|
var o5 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
|
|
574
|
-
var r4 = (
|
|
575
|
-
const { kind:
|
|
576
|
-
let
|
|
577
|
-
if (void 0 ===
|
|
578
|
-
const { name:
|
|
579
|
-
return { set(
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
}, init(
|
|
583
|
-
return void 0 !==
|
|
574
|
+
var r4 = (t7 = o5, e10, r8) => {
|
|
575
|
+
const { kind: n6, metadata: i7 } = r8;
|
|
576
|
+
let s5 = globalThis.litPropertyMetadata.get(i7);
|
|
577
|
+
if (void 0 === s5 && globalThis.litPropertyMetadata.set(i7, s5 = /* @__PURE__ */ new Map()), "setter" === n6 && ((t7 = Object.create(t7)).wrapped = true), s5.set(r8.name, t7), "accessor" === n6) {
|
|
578
|
+
const { name: o9 } = r8;
|
|
579
|
+
return { set(r9) {
|
|
580
|
+
const n7 = e10.get.call(this);
|
|
581
|
+
e10.set.call(this, r9), this.requestUpdate(o9, n7, t7, true, r9);
|
|
582
|
+
}, init(e11) {
|
|
583
|
+
return void 0 !== e11 && this.C(o9, void 0, t7, e11), e11;
|
|
584
584
|
} };
|
|
585
585
|
}
|
|
586
|
-
if ("setter" ===
|
|
587
|
-
const { name:
|
|
588
|
-
return function(
|
|
589
|
-
const
|
|
590
|
-
|
|
586
|
+
if ("setter" === n6) {
|
|
587
|
+
const { name: o9 } = r8;
|
|
588
|
+
return function(r9) {
|
|
589
|
+
const n7 = this[o9];
|
|
590
|
+
e10.call(this, r9), this.requestUpdate(o9, n7, t7, true, r9);
|
|
591
591
|
};
|
|
592
592
|
}
|
|
593
|
-
throw Error("Unsupported decorator location: " +
|
|
593
|
+
throw Error("Unsupported decorator location: " + n6);
|
|
594
594
|
};
|
|
595
|
-
function n4(
|
|
596
|
-
return (
|
|
597
|
-
const
|
|
598
|
-
return
|
|
599
|
-
})(
|
|
595
|
+
function n4(t7) {
|
|
596
|
+
return (e10, o9) => "object" == typeof o9 ? r4(t7, e10, o9) : ((t8, e11, o10) => {
|
|
597
|
+
const r8 = e11.hasOwnProperty(o10);
|
|
598
|
+
return e11.constructor.createProperty(o10, t8), r8 ? Object.getOwnPropertyDescriptor(e11, o10) : void 0;
|
|
599
|
+
})(t7, e10, o9);
|
|
600
600
|
}
|
|
601
601
|
|
|
602
602
|
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js
|
|
603
|
-
function r5(
|
|
604
|
-
return n4({ ...
|
|
603
|
+
function r5(r8) {
|
|
604
|
+
return n4({ ...r8, state: true, attribute: false });
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/base.js
|
|
608
|
-
var e4 = (
|
|
608
|
+
var e4 = (e10, t7, c5) => (c5.configurable = true, c5.enumerable = true, Reflect.decorate && "object" != typeof t7 && Object.defineProperty(e10, t7, c5), c5);
|
|
609
|
+
|
|
610
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/query.js
|
|
611
|
+
function e5(e10, r8) {
|
|
612
|
+
return (n6, s5, i7) => {
|
|
613
|
+
const o9 = (t7) => t7.renderRoot?.querySelector(e10) ?? null;
|
|
614
|
+
if (r8) {
|
|
615
|
+
const { get: e11, set: r9 } = "object" == typeof s5 ? n6 : i7 ?? /* @__PURE__ */ (() => {
|
|
616
|
+
const t7 = /* @__PURE__ */ Symbol();
|
|
617
|
+
return { get() {
|
|
618
|
+
return this[t7];
|
|
619
|
+
}, set(e12) {
|
|
620
|
+
this[t7] = e12;
|
|
621
|
+
} };
|
|
622
|
+
})();
|
|
623
|
+
return e4(n6, s5, { get() {
|
|
624
|
+
let t7 = e11.call(this);
|
|
625
|
+
return void 0 === t7 && (t7 = o9(this), (null !== t7 || this.hasUpdated) && r9.call(this, t7)), t7;
|
|
626
|
+
} });
|
|
627
|
+
}
|
|
628
|
+
return e4(n6, s5, { get() {
|
|
629
|
+
return o9(this);
|
|
630
|
+
} });
|
|
631
|
+
};
|
|
632
|
+
}
|
|
609
633
|
|
|
610
634
|
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/query-all.js
|
|
611
|
-
var
|
|
612
|
-
function r6(
|
|
613
|
-
return (
|
|
614
|
-
return (this.renderRoot ?? (
|
|
635
|
+
var e6;
|
|
636
|
+
function r6(r8) {
|
|
637
|
+
return (n6, o9) => e4(n6, o9, { get() {
|
|
638
|
+
return (this.renderRoot ?? (e6 ?? (e6 = document.createDocumentFragment()))).querySelectorAll(r8);
|
|
615
639
|
} });
|
|
616
640
|
}
|
|
617
641
|
|
|
@@ -769,8 +793,8 @@ var ConsentCheckbox = class extends i4 {
|
|
|
769
793
|
this.internals.setFormValue(null);
|
|
770
794
|
}
|
|
771
795
|
}
|
|
772
|
-
handleChange(
|
|
773
|
-
const input =
|
|
796
|
+
handleChange(e10) {
|
|
797
|
+
const input = e10.target;
|
|
774
798
|
this.checked = input.checked;
|
|
775
799
|
this.updateFormValue();
|
|
776
800
|
this.dispatchEvent(
|
|
@@ -901,7 +925,7 @@ ConsentCheckbox.styles = i`
|
|
|
901
925
|
}
|
|
902
926
|
`;
|
|
903
927
|
__decorateClass([
|
|
904
|
-
n4({ type: String })
|
|
928
|
+
n4({ type: String, reflect: true })
|
|
905
929
|
], ConsentCheckbox.prototype, "name", 2);
|
|
906
930
|
__decorateClass([
|
|
907
931
|
n4({ type: Boolean, reflect: true })
|
|
@@ -940,8 +964,8 @@ var ConsentInput = class extends i4 {
|
|
|
940
964
|
this.internals.setFormValue(this.value || null);
|
|
941
965
|
}
|
|
942
966
|
}
|
|
943
|
-
handleInput(
|
|
944
|
-
const input =
|
|
967
|
+
handleInput(e10) {
|
|
968
|
+
const input = e10.target;
|
|
945
969
|
this.value = input.value;
|
|
946
970
|
this.internals.setFormValue(this.value || null);
|
|
947
971
|
this.dispatchEvent(
|
|
@@ -952,8 +976,8 @@ var ConsentInput = class extends i4 {
|
|
|
952
976
|
})
|
|
953
977
|
);
|
|
954
978
|
}
|
|
955
|
-
handleChange(
|
|
956
|
-
const input =
|
|
979
|
+
handleChange(e10) {
|
|
980
|
+
const input = e10.target;
|
|
957
981
|
this.value = input.value;
|
|
958
982
|
this.dispatchEvent(
|
|
959
983
|
new CustomEvent("change", {
|
|
@@ -969,14 +993,28 @@ var ConsentInput = class extends i4 {
|
|
|
969
993
|
renderPasswordToggle() {
|
|
970
994
|
if (this.type !== "password") return null;
|
|
971
995
|
const icon = this.showPassword ? b2`
|
|
972
|
-
<svg
|
|
973
|
-
|
|
974
|
-
|
|
996
|
+
<svg
|
|
997
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
998
|
+
viewBox="0 0 24 24"
|
|
999
|
+
fill="none"
|
|
1000
|
+
stroke="currentColor"
|
|
1001
|
+
stroke-width="2"
|
|
1002
|
+
>
|
|
1003
|
+
<path
|
|
1004
|
+
d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"
|
|
1005
|
+
/>
|
|
1006
|
+
<line x1="1" y1="1" x2="23" y2="23" />
|
|
975
1007
|
</svg>
|
|
976
1008
|
` : b2`
|
|
977
|
-
<svg
|
|
978
|
-
|
|
979
|
-
|
|
1009
|
+
<svg
|
|
1010
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1011
|
+
viewBox="0 0 24 24"
|
|
1012
|
+
fill="none"
|
|
1013
|
+
stroke="currentColor"
|
|
1014
|
+
stroke-width="2"
|
|
1015
|
+
>
|
|
1016
|
+
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" />
|
|
1017
|
+
<circle cx="12" cy="12" r="3" />
|
|
980
1018
|
</svg>
|
|
981
1019
|
`;
|
|
982
1020
|
return b2`
|
|
@@ -1058,7 +1096,9 @@ ConsentInput.styles = i`
|
|
|
1058
1096
|
border-radius: 0.5rem;
|
|
1059
1097
|
outline: none;
|
|
1060
1098
|
box-shadow: none;
|
|
1061
|
-
transition:
|
|
1099
|
+
transition:
|
|
1100
|
+
border-color 0.15s ease,
|
|
1101
|
+
box-shadow 0.15s ease;
|
|
1062
1102
|
}
|
|
1063
1103
|
|
|
1064
1104
|
.input-wrapper input:focus {
|
|
@@ -1105,7 +1145,7 @@ ConsentInput.styles = i`
|
|
|
1105
1145
|
}
|
|
1106
1146
|
|
|
1107
1147
|
/* Password toggle */
|
|
1108
|
-
.input-wrapper input[type=
|
|
1148
|
+
.input-wrapper input[type="password"] {
|
|
1109
1149
|
padding-right: 2.5rem;
|
|
1110
1150
|
}
|
|
1111
1151
|
|
|
@@ -1157,7 +1197,7 @@ __decorateClass([
|
|
|
1157
1197
|
n4({ type: String })
|
|
1158
1198
|
], ConsentInput.prototype, "type", 2);
|
|
1159
1199
|
__decorateClass([
|
|
1160
|
-
n4({ type: String })
|
|
1200
|
+
n4({ type: String, reflect: true })
|
|
1161
1201
|
], ConsentInput.prototype, "name", 2);
|
|
1162
1202
|
__decorateClass([
|
|
1163
1203
|
n4({ type: String })
|
|
@@ -1232,19 +1272,19 @@ function channels(hex) {
|
|
|
1232
1272
|
return [1, 3, 5].map((at) => parseInt(hex.slice(at, at + 2), 16));
|
|
1233
1273
|
}
|
|
1234
1274
|
function toHex(rgb) {
|
|
1235
|
-
return `#${rgb.map((
|
|
1275
|
+
return `#${rgb.map((c5) => c5.toString(16).padStart(2, "0")).join("")}`.toUpperCase();
|
|
1236
1276
|
}
|
|
1237
1277
|
function linear(value) {
|
|
1238
|
-
const
|
|
1239
|
-
return
|
|
1278
|
+
const c5 = value / 255;
|
|
1279
|
+
return c5 <= 0.03928 ? c5 / 12.92 : ((c5 + 0.055) / 1.055) ** 2.4;
|
|
1240
1280
|
}
|
|
1241
1281
|
function relativeLuminance(hex) {
|
|
1242
|
-
const [
|
|
1243
|
-
return 0.2126 * linear(
|
|
1282
|
+
const [r8, g3, b4] = channels(hex);
|
|
1283
|
+
return 0.2126 * linear(r8) + 0.7152 * linear(g3) + 0.0722 * linear(b4);
|
|
1244
1284
|
}
|
|
1245
|
-
function contrastRatio(
|
|
1246
|
-
const la = relativeLuminance(
|
|
1247
|
-
const lb = relativeLuminance(
|
|
1285
|
+
function contrastRatio(a4, b4) {
|
|
1286
|
+
const la = relativeLuminance(a4);
|
|
1287
|
+
const lb = relativeLuminance(b4);
|
|
1248
1288
|
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
1249
1289
|
}
|
|
1250
1290
|
function readableTextOn(background, preferred) {
|
|
@@ -1255,16 +1295,16 @@ function readableTextOn(background, preferred) {
|
|
|
1255
1295
|
}
|
|
1256
1296
|
function readableTextColor(color, surface = WHITE) {
|
|
1257
1297
|
if (contrastRatio(color, surface) >= AA_TEXT_CONTRAST) return color;
|
|
1258
|
-
const [
|
|
1298
|
+
const [r8, g3, b4] = channels(color);
|
|
1259
1299
|
const [tr, tg, tb] = channels(readableTextOn(surface));
|
|
1260
|
-
const toward = (
|
|
1261
|
-
const exact =
|
|
1262
|
-
return target >
|
|
1300
|
+
const toward = (c5, target, amount) => {
|
|
1301
|
+
const exact = c5 + (target - c5) * amount;
|
|
1302
|
+
return target > c5 ? Math.ceil(exact) : Math.floor(exact);
|
|
1263
1303
|
};
|
|
1264
1304
|
const mix = (amount) => toHex([
|
|
1265
|
-
toward(
|
|
1266
|
-
toward(
|
|
1267
|
-
toward(
|
|
1305
|
+
toward(r8, tr, amount),
|
|
1306
|
+
toward(g3, tg, amount),
|
|
1307
|
+
toward(b4, tb, amount)
|
|
1268
1308
|
]);
|
|
1269
1309
|
let low = 0;
|
|
1270
1310
|
let high = 1;
|
|
@@ -1399,7 +1439,10 @@ ConsentShell.styles = i`
|
|
|
1399
1439
|
}
|
|
1400
1440
|
|
|
1401
1441
|
/* Container - matches Checkpoint PreviewShell exactly */
|
|
1442
|
+
/* border-box, so the border fits inside width: 100% instead of pushing
|
|
1443
|
+
the card 2px past a phone's edge. */
|
|
1402
1444
|
.container {
|
|
1445
|
+
box-sizing: border-box;
|
|
1403
1446
|
background: white;
|
|
1404
1447
|
border-radius: 20px;
|
|
1405
1448
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
@@ -1521,7 +1564,7 @@ var ConsentPermissions = class extends i4 {
|
|
|
1521
1564
|
* Preserves existing valid selections while adding new scopes based on selectAll/required settings.
|
|
1522
1565
|
*/
|
|
1523
1566
|
reinitializeSelectedScopes() {
|
|
1524
|
-
const currentScopeIds = new Set(this.normalizedScopes.map((
|
|
1567
|
+
const currentScopeIds = new Set(this.normalizedScopes.map((s5) => s5.id));
|
|
1525
1568
|
const validSelections = new Set(
|
|
1526
1569
|
Array.from(this.selectedScopes).filter((id) => currentScopeIds.has(id))
|
|
1527
1570
|
);
|
|
@@ -1531,7 +1574,7 @@ var ConsentPermissions = class extends i4 {
|
|
|
1531
1574
|
if (this.selectAll) {
|
|
1532
1575
|
this.selectedScopes = /* @__PURE__ */ new Set([...validSelections, ...newScopeIds]);
|
|
1533
1576
|
} else {
|
|
1534
|
-
const requiredIds = this.normalizedScopes.filter((
|
|
1577
|
+
const requiredIds = this.normalizedScopes.filter((s5) => s5.required).map((s5) => s5.id);
|
|
1535
1578
|
this.selectedScopes = /* @__PURE__ */ new Set([...validSelections, ...requiredIds]);
|
|
1536
1579
|
}
|
|
1537
1580
|
this.previousScopeIds = currentScopeIds;
|
|
@@ -1642,9 +1685,9 @@ var ConsentPermissions = class extends i4 {
|
|
|
1642
1685
|
class="checkbox"
|
|
1643
1686
|
.checked=${isSelected}
|
|
1644
1687
|
?disabled=${scope.required}
|
|
1645
|
-
@change=${(
|
|
1688
|
+
@change=${(e10) => this.handleCheckboxChange(
|
|
1646
1689
|
scope.id,
|
|
1647
|
-
|
|
1690
|
+
e10.target.checked
|
|
1648
1691
|
)}
|
|
1649
1692
|
aria-label=${scope.label}
|
|
1650
1693
|
/>
|
|
@@ -1927,10 +1970,10 @@ function sanitizeLinkUrl(url) {
|
|
|
1927
1970
|
}
|
|
1928
1971
|
function hexToRgb(hex) {
|
|
1929
1972
|
const cleanHex = hex.replace(/^#/, "");
|
|
1930
|
-
const
|
|
1931
|
-
const
|
|
1932
|
-
const
|
|
1933
|
-
return `${
|
|
1973
|
+
const r8 = parseInt(cleanHex.slice(0, 2), 16);
|
|
1974
|
+
const g3 = parseInt(cleanHex.slice(2, 4), 16);
|
|
1975
|
+
const b4 = parseInt(cleanHex.slice(4, 6), 16);
|
|
1976
|
+
return `${r8}, ${g3}, ${b4}`;
|
|
1934
1977
|
}
|
|
1935
1978
|
function generateBrandingCSSVars(branding) {
|
|
1936
1979
|
return {
|
|
@@ -1991,8 +2034,8 @@ var ConsentTerms = class extends i4 {
|
|
|
1991
2034
|
this.internals.setFormValue(null);
|
|
1992
2035
|
}
|
|
1993
2036
|
}
|
|
1994
|
-
handleChange(
|
|
1995
|
-
const input =
|
|
2037
|
+
handleChange(e10) {
|
|
2038
|
+
const input = e10.target;
|
|
1996
2039
|
this.checked = input.checked;
|
|
1997
2040
|
this.updateFormValue();
|
|
1998
2041
|
this.dispatchEvent(
|
|
@@ -2011,7 +2054,7 @@ var ConsentTerms = class extends i4 {
|
|
|
2011
2054
|
target="_blank"
|
|
2012
2055
|
rel="noopener noreferrer"
|
|
2013
2056
|
part="link"
|
|
2014
|
-
@click=${(
|
|
2057
|
+
@click=${(e10) => e10.stopPropagation()}
|
|
2015
2058
|
>${text}</a
|
|
2016
2059
|
>`;
|
|
2017
2060
|
}
|
|
@@ -2156,7 +2199,7 @@ ConsentTerms.styles = i`
|
|
|
2156
2199
|
}
|
|
2157
2200
|
`;
|
|
2158
2201
|
__decorateClass([
|
|
2159
|
-
n4({ type: String })
|
|
2202
|
+
n4({ type: String, reflect: true })
|
|
2160
2203
|
], ConsentTerms.prototype, "name", 2);
|
|
2161
2204
|
__decorateClass([
|
|
2162
2205
|
n4({ type: String })
|
|
@@ -2194,47 +2237,47 @@ ConsentTerms = __decorateClass([
|
|
|
2194
2237
|
|
|
2195
2238
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.js
|
|
2196
2239
|
var t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
2197
|
-
var
|
|
2240
|
+
var e7 = (t7) => (...e10) => ({ _$litDirective$: t7, values: e10 });
|
|
2198
2241
|
var i5 = class {
|
|
2199
|
-
constructor(
|
|
2242
|
+
constructor(t7) {
|
|
2200
2243
|
}
|
|
2201
2244
|
get _$AU() {
|
|
2202
2245
|
return this._$AM._$AU;
|
|
2203
2246
|
}
|
|
2204
|
-
_$AT(
|
|
2205
|
-
this._$Ct =
|
|
2247
|
+
_$AT(t7, e10, i7) {
|
|
2248
|
+
this._$Ct = t7, this._$AM = e10, this._$Ci = i7;
|
|
2206
2249
|
}
|
|
2207
|
-
_$AS(
|
|
2208
|
-
return this.update(
|
|
2250
|
+
_$AS(t7, e10) {
|
|
2251
|
+
return this.update(t7, e10);
|
|
2209
2252
|
}
|
|
2210
|
-
update(
|
|
2211
|
-
return this.render(...
|
|
2253
|
+
update(t7, e10) {
|
|
2254
|
+
return this.render(...e10);
|
|
2212
2255
|
}
|
|
2213
2256
|
};
|
|
2214
2257
|
|
|
2215
2258
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/unsafe-html.js
|
|
2216
|
-
var
|
|
2217
|
-
constructor(
|
|
2218
|
-
if (super(
|
|
2219
|
-
}
|
|
2220
|
-
render(
|
|
2221
|
-
if (
|
|
2222
|
-
if (
|
|
2223
|
-
if ("string" != typeof
|
|
2224
|
-
if (
|
|
2225
|
-
this.it =
|
|
2226
|
-
const
|
|
2227
|
-
return
|
|
2259
|
+
var e8 = class extends i5 {
|
|
2260
|
+
constructor(i7) {
|
|
2261
|
+
if (super(i7), this.it = A, i7.type !== t4.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
2262
|
+
}
|
|
2263
|
+
render(r8) {
|
|
2264
|
+
if (r8 === A || null == r8) return this._t = void 0, this.it = r8;
|
|
2265
|
+
if (r8 === E) return r8;
|
|
2266
|
+
if ("string" != typeof r8) throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
2267
|
+
if (r8 === this.it) return this._t;
|
|
2268
|
+
this.it = r8;
|
|
2269
|
+
const s5 = [r8];
|
|
2270
|
+
return s5.raw = s5, this._t = { _$litType$: this.constructor.resultType, strings: s5, values: [] };
|
|
2228
2271
|
}
|
|
2229
2272
|
};
|
|
2230
|
-
|
|
2231
|
-
var o6 =
|
|
2273
|
+
e8.directiveName = "unsafeHTML", e8.resultType = 1;
|
|
2274
|
+
var o6 = e7(e8);
|
|
2232
2275
|
|
|
2233
2276
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/unsafe-svg.js
|
|
2234
|
-
var t5 = class extends
|
|
2277
|
+
var t5 = class extends e8 {
|
|
2235
2278
|
};
|
|
2236
2279
|
t5.directiveName = "unsafeSVG", t5.resultType = 2;
|
|
2237
|
-
var o7 =
|
|
2280
|
+
var o7 = e7(t5);
|
|
2238
2281
|
|
|
2239
2282
|
// src/components/consent-oauth-button.ts
|
|
2240
2283
|
function sanitizeSvg(svg) {
|
|
@@ -2573,8 +2616,8 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2573
2616
|
if (this.value) {
|
|
2574
2617
|
const digitsOnly = this.value.replace(/\D/g, "").slice(0, this.length);
|
|
2575
2618
|
const chars = digitsOnly.split("");
|
|
2576
|
-
chars.forEach((char,
|
|
2577
|
-
this.digits[
|
|
2619
|
+
chars.forEach((char, i7) => {
|
|
2620
|
+
this.digits[i7] = char;
|
|
2578
2621
|
});
|
|
2579
2622
|
}
|
|
2580
2623
|
}
|
|
@@ -2596,8 +2639,8 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2596
2639
|
getFullValue() {
|
|
2597
2640
|
return this.digits.join("");
|
|
2598
2641
|
}
|
|
2599
|
-
handleInput(index,
|
|
2600
|
-
const input =
|
|
2642
|
+
handleInput(index, e10) {
|
|
2643
|
+
const input = e10.target;
|
|
2601
2644
|
let newValue = input.value;
|
|
2602
2645
|
if (newValue.length > 1) {
|
|
2603
2646
|
newValue = newValue.slice(-1);
|
|
@@ -2638,10 +2681,10 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2638
2681
|
})
|
|
2639
2682
|
);
|
|
2640
2683
|
}
|
|
2641
|
-
handleKeyDown(index,
|
|
2642
|
-
switch (
|
|
2684
|
+
handleKeyDown(index, e10) {
|
|
2685
|
+
switch (e10.key) {
|
|
2643
2686
|
case "Backspace": {
|
|
2644
|
-
|
|
2687
|
+
e10.preventDefault();
|
|
2645
2688
|
const target = !this.digits[index] && index > 0 ? index - 1 : index;
|
|
2646
2689
|
if (target !== index) {
|
|
2647
2690
|
this.inputs[target]?.focus();
|
|
@@ -2650,19 +2693,19 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2650
2693
|
break;
|
|
2651
2694
|
}
|
|
2652
2695
|
case "ArrowLeft":
|
|
2653
|
-
|
|
2696
|
+
e10.preventDefault();
|
|
2654
2697
|
if (index > 0) {
|
|
2655
2698
|
this.inputs[index - 1]?.focus();
|
|
2656
2699
|
}
|
|
2657
2700
|
break;
|
|
2658
2701
|
case "ArrowRight":
|
|
2659
|
-
|
|
2702
|
+
e10.preventDefault();
|
|
2660
2703
|
if (index < this.length - 1) {
|
|
2661
2704
|
this.inputs[index + 1]?.focus();
|
|
2662
2705
|
}
|
|
2663
2706
|
break;
|
|
2664
2707
|
case "Delete":
|
|
2665
|
-
|
|
2708
|
+
e10.preventDefault();
|
|
2666
2709
|
this.clearDigit(index);
|
|
2667
2710
|
break;
|
|
2668
2711
|
}
|
|
@@ -2692,12 +2735,15 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2692
2735
|
})
|
|
2693
2736
|
);
|
|
2694
2737
|
}
|
|
2695
|
-
handlePaste(
|
|
2696
|
-
|
|
2697
|
-
const pastedData =
|
|
2738
|
+
handlePaste(e10) {
|
|
2739
|
+
e10.preventDefault();
|
|
2740
|
+
const pastedData = e10.clipboardData?.getData("text") || "";
|
|
2698
2741
|
const digits = pastedData.replace(/\D/g, "").slice(0, this.length);
|
|
2699
2742
|
if (digits) {
|
|
2700
|
-
this.digits = Array.from(
|
|
2743
|
+
this.digits = Array.from(
|
|
2744
|
+
{ length: this.length },
|
|
2745
|
+
(_3, i7) => digits[i7] || ""
|
|
2746
|
+
);
|
|
2701
2747
|
this.value = this.getFullValue();
|
|
2702
2748
|
this.requestUpdate();
|
|
2703
2749
|
const focusIndex = Math.min(digits.length, this.length - 1);
|
|
@@ -2729,15 +2775,15 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2729
2775
|
}
|
|
2730
2776
|
}
|
|
2731
2777
|
}
|
|
2732
|
-
handleFocus(
|
|
2733
|
-
const input =
|
|
2778
|
+
handleFocus(e10) {
|
|
2779
|
+
const input = e10.target;
|
|
2734
2780
|
input.select();
|
|
2735
2781
|
}
|
|
2736
2782
|
/**
|
|
2737
2783
|
* Focus the first empty input or the last input
|
|
2738
2784
|
*/
|
|
2739
2785
|
focus() {
|
|
2740
|
-
const emptyIndex = this.digits.findIndex((
|
|
2786
|
+
const emptyIndex = this.digits.findIndex((d4) => !d4);
|
|
2741
2787
|
const focusIndex = emptyIndex >= 0 ? emptyIndex : this.length - 1;
|
|
2742
2788
|
this.inputs[focusIndex]?.focus();
|
|
2743
2789
|
}
|
|
@@ -2763,8 +2809,8 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2763
2809
|
?disabled=${this.disabled}
|
|
2764
2810
|
placeholder="○"
|
|
2765
2811
|
class=${isFilled2 ? "filled" : ""}
|
|
2766
|
-
@input=${(
|
|
2767
|
-
@keydown=${(
|
|
2812
|
+
@input=${(e10) => this.handleInput(index, e10)}
|
|
2813
|
+
@keydown=${(e10) => this.handleKeyDown(index, e10)}
|
|
2768
2814
|
@paste=${this.handlePaste}
|
|
2769
2815
|
@focus=${this.handleFocus}
|
|
2770
2816
|
aria-label=${`Digit ${index + 1} of ${this.length}`}
|
|
@@ -2773,8 +2819,16 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2773
2819
|
}
|
|
2774
2820
|
render() {
|
|
2775
2821
|
return b2`
|
|
2776
|
-
<div
|
|
2777
|
-
|
|
2822
|
+
<div
|
|
2823
|
+
class="container"
|
|
2824
|
+
part="container"
|
|
2825
|
+
role="group"
|
|
2826
|
+
aria-label="One-time password input"
|
|
2827
|
+
>
|
|
2828
|
+
${Array.from(
|
|
2829
|
+
{ length: this.length },
|
|
2830
|
+
(_3, i7) => this.renderDigitInput(i7)
|
|
2831
|
+
)}
|
|
2778
2832
|
</div>
|
|
2779
2833
|
`;
|
|
2780
2834
|
}
|
|
@@ -2805,7 +2859,9 @@ ConsentOTPInput.styles = i`
|
|
|
2805
2859
|
border: 1px solid #d1d5db;
|
|
2806
2860
|
border-radius: 0.5rem;
|
|
2807
2861
|
outline: none;
|
|
2808
|
-
transition:
|
|
2862
|
+
transition:
|
|
2863
|
+
border-color 0.15s ease,
|
|
2864
|
+
box-shadow 0.15s ease;
|
|
2809
2865
|
|
|
2810
2866
|
/* Hide spinner for number inputs */
|
|
2811
2867
|
-moz-appearance: textfield;
|
|
@@ -2865,7 +2921,7 @@ __decorateClass([
|
|
|
2865
2921
|
n4({ type: Number })
|
|
2866
2922
|
], ConsentOTPInput.prototype, "length", 2);
|
|
2867
2923
|
__decorateClass([
|
|
2868
|
-
n4({ type: String })
|
|
2924
|
+
n4({ type: String, reflect: true })
|
|
2869
2925
|
], ConsentOTPInput.prototype, "name", 2);
|
|
2870
2926
|
__decorateClass([
|
|
2871
2927
|
n4({ type: String })
|
|
@@ -2986,6 +3042,97 @@ var CONSENT_COPY_TOKENS = {
|
|
|
2986
3042
|
/** Dark theme secondary. */
|
|
2987
3043
|
deny: "Deny"
|
|
2988
3044
|
},
|
|
3045
|
+
/**
|
|
3046
|
+
* `consent-grant-terms`, `consent-duration` and `consent-folder-scope`
|
|
3047
|
+
* defaults. Each element takes its own label, hint and placeholder too.
|
|
3048
|
+
*/
|
|
3049
|
+
grant: {
|
|
3050
|
+
/** The button that opens the terms. */
|
|
3051
|
+
customize: "Customize",
|
|
3052
|
+
/** Between the parts of the closed summary: "8 hours · Every folder". */
|
|
3053
|
+
summarySeparator: " \xB7 ",
|
|
3054
|
+
durationLabel: "Valid for",
|
|
3055
|
+
durationHint: "The grant ends on its own after this. The agent has to ask again.",
|
|
3056
|
+
folderLabel: "Limit to a folder (optional)",
|
|
3057
|
+
folderPlaceholder: "e.g. notes/",
|
|
3058
|
+
folderHint: "Only files under this folder. Leave it blank to allow every folder.",
|
|
3059
|
+
/** The summary when no folder is set. */
|
|
3060
|
+
everyFolder: "Every folder",
|
|
3061
|
+
/** `{Folder}` → the folder, e.g. "notes/". */
|
|
3062
|
+
onlyFolderTemplate: "Only {Folder}",
|
|
3063
|
+
/** A folder with a `.` or `..` segment, which no request can match. */
|
|
3064
|
+
folderDotSegment: "Use a folder path without . or .. in it.",
|
|
3065
|
+
/** The summary while the folder can't be used. */
|
|
3066
|
+
folderNeedsFixing: "Folder needs fixing",
|
|
3067
|
+
/** `chained`: what a delegation chain lets the agent do with the grant. */
|
|
3068
|
+
passOn: "The agent can pass on only a narrower grant, never a wider one."
|
|
3069
|
+
},
|
|
3070
|
+
/** `consent-revoke` defaults. `{Agent}` → agent display name. */
|
|
3071
|
+
revoke: {
|
|
3072
|
+
titleTemplate: "Take back {Agent}'s access?",
|
|
3073
|
+
bodyTemplate: "It ends right away, and {Agent} has to ask again to get it back.",
|
|
3074
|
+
/** Heading over what ends. */
|
|
3075
|
+
endsTitle: "This ends",
|
|
3076
|
+
/** `chained`: the grants the agent made under this one end too. */
|
|
3077
|
+
chainedItemTemplate: "Every narrower grant {Agent} passed on",
|
|
3078
|
+
confirm: "Take back access",
|
|
3079
|
+
keep: "Keep access",
|
|
3080
|
+
working: "Taking back\u2026",
|
|
3081
|
+
doneTitle: "Access taken back",
|
|
3082
|
+
/** `{Agent}` never starts a sentence: it falls back to "this agent". */
|
|
3083
|
+
doneBodyTemplate: "It has ended, and {Agent} can no longer use it."
|
|
3084
|
+
},
|
|
3085
|
+
/**
|
|
3086
|
+
* The wallet elements: `consent-wallet-check`, `consent-wallet-notice`,
|
|
3087
|
+
* `consent-wallet-signature` and `consent-phone-handoff`. `{App}` → the
|
|
3088
|
+
* app's name. `{CredentialsLink}` and `{RevokeLink}` → a link to the page
|
|
3089
|
+
* where the person manages their wallet and their grants.
|
|
3090
|
+
*/
|
|
3091
|
+
wallet: {
|
|
3092
|
+
/** The caption under the wallet check, one per status. */
|
|
3093
|
+
check: {
|
|
3094
|
+
checking: "Checking wallet identity\u2026",
|
|
3095
|
+
syncing: "Syncing this device's wallet to your account\u2026",
|
|
3096
|
+
ready: "Wallet verified",
|
|
3097
|
+
conflict: "This browser can't sign for your wallet",
|
|
3098
|
+
error: "Couldn't verify your wallet"
|
|
3099
|
+
},
|
|
3100
|
+
notice: {
|
|
3101
|
+
/** `{App}` when the host doesn't name its app. */
|
|
3102
|
+
appFallback: "this app",
|
|
3103
|
+
credentialsLink: "your credentials page",
|
|
3104
|
+
/** `updates-on-its-own`: the page reflects an approval made elsewhere. */
|
|
3105
|
+
updatesOnItsOwn: "This page updates on its own once you do.",
|
|
3106
|
+
errorTitle: "Couldn't check your wallet",
|
|
3107
|
+
errorBody: "Refresh the page to try again. If it keeps happening, open {CredentialsLink} to check the wallet there.",
|
|
3108
|
+
passkeyUnreachableTitle: "Approve from the browser that holds your passkey",
|
|
3109
|
+
passkeyUnreachableBody: "Your wallet is derived from a passkey this browser can't reach, so nothing can be signed here. Open this same link in the browser where {App} is already set up and approve it there.",
|
|
3110
|
+
passkeyUnreachableMore: "To approve from this browser in future, sync that passkey to it (iCloud Keychain, Google Password Manager, or 1Password).",
|
|
3111
|
+
keyDriftTitle: "This browser's wallet key doesn't match your account",
|
|
3112
|
+
keyDriftBody: "It holds your account identity but signs with a different key than the one your account publishes, so anything it signs would be rejected. Approve from the browser where {App} was first set up, or re-link this browser from {CredentialsLink}.",
|
|
3113
|
+
supersededTitle: "Your identity was re-registered",
|
|
3114
|
+
supersededBody: "The registry's current record for your account doesn't include this device's signing key. Re-link your account with the registry from {CredentialsLink}, then reopen this request.",
|
|
3115
|
+
/** A conflict with a reason the element doesn't know: `message` follows. */
|
|
3116
|
+
otherTitle: "This browser can't sign this request"
|
|
3117
|
+
},
|
|
3118
|
+
signature: {
|
|
3119
|
+
signedBy: "Signed by your KYA-OS wallet.",
|
|
3120
|
+
revokeTemplate: "Revoke any time from {RevokeLink}.",
|
|
3121
|
+
revokeLink: "your credentials list"
|
|
3122
|
+
},
|
|
3123
|
+
handoff: {
|
|
3124
|
+
title: "Approve on your phone instead",
|
|
3125
|
+
body: "If your wallet's passkey is on your phone, approving there with Face ID or Touch ID is faster and more reliable than signing from this computer.",
|
|
3126
|
+
scan: "Scan this with your phone's camera and approve there.",
|
|
3127
|
+
updatesOnItsOwn: "This page updates on its own once you do.",
|
|
3128
|
+
qrLabel: "QR code that opens this request on your phone"
|
|
3129
|
+
}
|
|
3130
|
+
},
|
|
3131
|
+
/** `consent-request-expiry`. `{Time}` → the time left, e.g. "4:59". */
|
|
3132
|
+
request: {
|
|
3133
|
+
expiresTemplate: "This request expires in {Time}. Approve before then, or the agent will need to ask again.",
|
|
3134
|
+
expired: "This request expired. Ask the agent to try again."
|
|
3135
|
+
},
|
|
2989
3136
|
attribution: {
|
|
2990
3137
|
/** Light theme. */
|
|
2991
3138
|
protectedBy: "Protected by Checkpoint",
|
|
@@ -3128,10 +3275,13 @@ ConsentAgentHeader.styles = i`
|
|
|
3128
3275
|
width: 100%;
|
|
3129
3276
|
}
|
|
3130
3277
|
|
|
3278
|
+
/* In a narrow card the name moves under the logo rather than squeezing
|
|
3279
|
+
into a column too thin for its pill (see .body's basis). */
|
|
3131
3280
|
.tile {
|
|
3132
3281
|
display: flex;
|
|
3282
|
+
flex-wrap: wrap;
|
|
3133
3283
|
align-items: center;
|
|
3134
|
-
gap: 16px;
|
|
3284
|
+
gap: 12px 16px;
|
|
3135
3285
|
padding: 16px 18px;
|
|
3136
3286
|
border-radius: 14px;
|
|
3137
3287
|
background: var(--cs-surface-inset, transparent);
|
|
@@ -3174,6 +3324,7 @@ ConsentAgentHeader.styles = i`
|
|
|
3174
3324
|
|
|
3175
3325
|
.body {
|
|
3176
3326
|
display: flex;
|
|
3327
|
+
flex: 1 1 140px;
|
|
3177
3328
|
flex-direction: column;
|
|
3178
3329
|
gap: 4px;
|
|
3179
3330
|
min-width: 0;
|
|
@@ -3516,9 +3667,9 @@ var ConsentCapabilityCard = class extends i4 {
|
|
|
3516
3667
|
tabindex=${this.disabled ? "-1" : "0"}
|
|
3517
3668
|
aria-disabled=${String(this.disabled)}
|
|
3518
3669
|
@click=${this.onRowClick}
|
|
3519
|
-
@keydown=${(
|
|
3520
|
-
if (
|
|
3521
|
-
|
|
3670
|
+
@keydown=${(e10) => {
|
|
3671
|
+
if (e10.target === e10.currentTarget && (e10.key === " " || e10.key === "Enter")) {
|
|
3672
|
+
e10.preventDefault();
|
|
3522
3673
|
this.toggleChecked();
|
|
3523
3674
|
}
|
|
3524
3675
|
}}
|
|
@@ -3530,8 +3681,8 @@ var ConsentCapabilityCard = class extends i4 {
|
|
|
3530
3681
|
aria-checked="${String(this.checked)}"
|
|
3531
3682
|
aria-label="${this.label}"
|
|
3532
3683
|
?disabled=${this.disabled}
|
|
3533
|
-
@click=${(
|
|
3534
|
-
|
|
3684
|
+
@click=${(e10) => {
|
|
3685
|
+
e10.stopPropagation();
|
|
3535
3686
|
this.toggleChecked();
|
|
3536
3687
|
}}
|
|
3537
3688
|
type="button"
|
|
@@ -3970,6 +4121,11 @@ function iconSvgFor(icon) {
|
|
|
3970
4121
|
}
|
|
3971
4122
|
}
|
|
3972
4123
|
|
|
4124
|
+
// src/components/wallet-icons.ts
|
|
4125
|
+
var fingerprintIcon = w`<path d="M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4" /><path d="M14 13.12c0 2.38 0 6.38-1 8.88" /><path d="M17.29 21.02c.12-.6.43-2.3.5-3.02" /><path d="M2 12a10 10 0 0 1 18-6" /><path d="M2 16h.01" /><path d="M21.8 16c.2-2 .131-5.354 0-6" /><path d="M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2" /><path d="M8.65 22c.21-.66.45-1.32.57-2" /><path d="M9 6.8a6 6 0 0 1 9 5.2v2" />`;
|
|
4126
|
+
var smartphoneIcon = w`<rect width="14" height="20" x="5" y="2" rx="2" ry="2" /><path d="M12 18h.01" />`;
|
|
4127
|
+
var kyaOsMark = w`<path fill="currentColor" d="M85.807 0.190363C96.416 -0.0168199 107.047 -0.143695 117.645 0.291926C134.724 0.998586 147.873 9.07309 157.611 22.9492C157.866 23.3103 158.094 23.6932 158.301 24.081C158.37 24.2138 158.333 24.4052 158.349 24.6708C154.784 25.5474 151.167 26.2912 147.634 27.3271C113.453 37.3199 90.5985 70.3001 93.9134 105.671C96.5803 134.157 111.264 154.573 137.136 166.877C140.249 168.359 143.437 169.107 146.89 168.141C151.873 166.749 155.252 162.844 155.773 157.744C156.256 152.995 153.626 148.203 148.967 146.195C142.991 143.619 137.386 140.516 132.653 136.006C105.097 109.773 115.35 63.6591 151.714 50.7656C156.965 48.902 162.598 48.1099 169.033 46.5868C169.819 54.4646 171.275 61.3225 171.02 68.122C170.568 80.3992 173.527 91.5764 179.483 102.101C184.227 110.478 189.018 118.83 194.023 127.054C198.023 133.625 196.466 138.699 189.209 141.435C187.313 142.152 185.364 142.748 183.504 143.55C178.638 145.653 177.172 149.722 179.753 154.365C181.05 156.692 183.089 158.934 181.352 161.617C179.981 163.731 177.9 165.39 175.897 167.504C175.983 167.632 176.497 168.312 176.932 169.033C179.179 172.768 178.51 177.055 175.052 179.653C171.078 182.634 170.143 186.501 170.313 191.293C170.488 196.356 170.499 201.652 169.235 206.492C166.308 217.707 157.627 222.769 146.996 225.234C135.984 227.79 125.502 226.303 115.786 220.65C102.122 212.703 91.3686 202.141 87.8304 186.06C86.837 181.55 86.97 176.758 86.8744 172.094C86.5609 156.39 82.7148 141.7 74.5335 128.249C65.906 114.07 54.3559 102.68 39.2152 95.9911C24.2926 89.4034 14.4545 72.7434 19.6341 52.7314C27.619 21.8764 53.9585 0.811927 85.807 0.190363ZM14.4857 111.658C15.681 111.977 17.381 112.365 19.0384 112.875C44.8254 120.828 62.208 144.065 63.058 171.053C63.637 189.577 60.3325 207.247 53.0384 224.247C52.2044 226.186 51.2644 226.685 49.3255 226.335C42.3238 225.06 35.4866 223.423 29.7279 218.897C23.5122 214.015 21.2808 207.645 22.3646 199.899C22.7046 197.482 22.8426 194.969 22.5345 192.562C22.3485 191.123 21.4025 189.534 20.3294 188.493C14.6028 182.915 14.3688 181.927 17.8431 175.6C16.2017 173.847 14.3531 172.402 13.2269 170.521C12.021 168.503 12.4833 166.467 14.3001 164.528C15.7344 163.004 16.8446 160.926 17.4183 158.902C18.4594 155.263 16.8659 152.453 13.3597 151.066C10.7353 150.03 7.97805 149.329 5.38023 148.24C0.264303 146.094 -1.36161 141.69 1.1937 136.76C5.49146 128.472 9.92764 120.254 14.4857 111.664V111.658ZM63.9505 39.4452C53.825 39.4773 45.8567 47.5041 45.8832 57.6562C45.9044 67.5746 54.0216 75.6022 64.0091 75.581C74.1028 75.5597 82.2472 67.4581 82.2474 57.4335H82.2416C82.2416 47.3769 74.14 39.4134 63.9505 39.4452ZM169.043 46.5849C169.04 46.5857 169.036 46.586 169.033 46.5868V46.5849H169.043Z" />`;
|
|
4128
|
+
|
|
3973
4129
|
// src/components/consent-action-bar.ts
|
|
3974
4130
|
var ConsentActionBar = class extends i4 {
|
|
3975
4131
|
constructor() {
|
|
@@ -3980,6 +4136,8 @@ var ConsentActionBar = class extends i4 {
|
|
|
3980
4136
|
this.loading = false;
|
|
3981
4137
|
this.submitLabel = "";
|
|
3982
4138
|
this.cancelLabel = "";
|
|
4139
|
+
this.submitIcon = "";
|
|
4140
|
+
this.loadingLabel = "";
|
|
3983
4141
|
}
|
|
3984
4142
|
emitAllow() {
|
|
3985
4143
|
if (this.disabled || this.loading) return;
|
|
@@ -3997,6 +4155,7 @@ var ConsentActionBar = class extends i4 {
|
|
|
3997
4155
|
const allowLabel = this.submitLabel || (this.theme === "dark" ? CONSENT_COPY_TOKENS.actions.allowAccess : `${formatToken(CONSENT_COPY_TOKENS.actions.allowAgentTemplate, {
|
|
3998
4156
|
Agent: this.agentName || "this agent"
|
|
3999
4157
|
})} \u2192`);
|
|
4158
|
+
const submitLabel = this.loading && this.loadingLabel ? this.loadingLabel : allowLabel;
|
|
4000
4159
|
const denyLabel = this.cancelLabel || (this.theme === "dark" ? CONSENT_COPY_TOKENS.actions.deny : CONSENT_COPY_TOKENS.actions.notNow);
|
|
4001
4160
|
return b2`
|
|
4002
4161
|
<button
|
|
@@ -4006,7 +4165,19 @@ var ConsentActionBar = class extends i4 {
|
|
|
4006
4165
|
?disabled=${this.disabled || this.loading}
|
|
4007
4166
|
@click=${this.emitAllow}
|
|
4008
4167
|
>
|
|
4009
|
-
${
|
|
4168
|
+
${this.submitIcon === "passkey" ? b2`<svg
|
|
4169
|
+
part="submit-icon"
|
|
4170
|
+
class="submit-icon"
|
|
4171
|
+
viewBox="0 0 24 24"
|
|
4172
|
+
fill="none"
|
|
4173
|
+
stroke="currentColor"
|
|
4174
|
+
stroke-width="2"
|
|
4175
|
+
stroke-linecap="round"
|
|
4176
|
+
stroke-linejoin="round"
|
|
4177
|
+
aria-hidden="true"
|
|
4178
|
+
>
|
|
4179
|
+
${fingerprintIcon}
|
|
4180
|
+
</svg>` : A}${submitLabel}
|
|
4010
4181
|
</button>
|
|
4011
4182
|
<button
|
|
4012
4183
|
class="secondary"
|
|
@@ -4031,12 +4202,14 @@ ConsentActionBar.styles = i`
|
|
|
4031
4202
|
button {
|
|
4032
4203
|
width: 100%;
|
|
4033
4204
|
padding: 14px 18px;
|
|
4034
|
-
border-radius: 999px;
|
|
4205
|
+
border-radius: var(--cs-action-radius, 999px);
|
|
4035
4206
|
font-size: var(--cs-action-font-size, 15px);
|
|
4036
4207
|
font-weight: 500;
|
|
4037
4208
|
font-family: inherit;
|
|
4038
4209
|
cursor: pointer;
|
|
4039
|
-
transition:
|
|
4210
|
+
transition:
|
|
4211
|
+
opacity 0.15s ease,
|
|
4212
|
+
transform 0.05s ease;
|
|
4040
4213
|
border: none;
|
|
4041
4214
|
}
|
|
4042
4215
|
|
|
@@ -4046,20 +4219,30 @@ ConsentActionBar.styles = i`
|
|
|
4046
4219
|
}
|
|
4047
4220
|
|
|
4048
4221
|
button:focus-visible {
|
|
4049
|
-
outline: 2px solid var(--cs-focus-ring, #
|
|
4222
|
+
outline: 2px solid var(--cs-focus-ring, #0f172a);
|
|
4050
4223
|
outline-offset: 3px;
|
|
4051
4224
|
}
|
|
4052
4225
|
|
|
4053
4226
|
.primary {
|
|
4227
|
+
display: inline-flex;
|
|
4228
|
+
align-items: center;
|
|
4229
|
+
justify-content: center;
|
|
4230
|
+
gap: 8px;
|
|
4054
4231
|
min-height: var(--cs-action-min-height, 0px);
|
|
4055
|
-
background: var(--cs-surface-accent, #
|
|
4056
|
-
color: var(--cs-surface-accent-text, #
|
|
4232
|
+
background: var(--cs-surface-accent, #0f172a);
|
|
4233
|
+
color: var(--cs-surface-accent-text, #ffffff);
|
|
4057
4234
|
}
|
|
4058
4235
|
|
|
4059
4236
|
.primary:hover:not(:disabled) {
|
|
4060
4237
|
opacity: 0.92;
|
|
4061
4238
|
}
|
|
4062
4239
|
|
|
4240
|
+
.submit-icon {
|
|
4241
|
+
flex: none;
|
|
4242
|
+
width: 16px;
|
|
4243
|
+
height: 16px;
|
|
4244
|
+
}
|
|
4245
|
+
|
|
4063
4246
|
.secondary {
|
|
4064
4247
|
background: transparent;
|
|
4065
4248
|
color: var(--cs-text-secondary, #334155);
|
|
@@ -4068,7 +4251,7 @@ ConsentActionBar.styles = i`
|
|
|
4068
4251
|
}
|
|
4069
4252
|
|
|
4070
4253
|
.secondary:hover:not(:disabled) {
|
|
4071
|
-
color: var(--cs-text-primary, #
|
|
4254
|
+
color: var(--cs-text-primary, #0f172a);
|
|
4072
4255
|
}
|
|
4073
4256
|
`;
|
|
4074
4257
|
__decorateClass([
|
|
@@ -4089,6 +4272,12 @@ __decorateClass([
|
|
|
4089
4272
|
__decorateClass([
|
|
4090
4273
|
n4({ type: String, attribute: "cancel-label" })
|
|
4091
4274
|
], ConsentActionBar.prototype, "cancelLabel", 2);
|
|
4275
|
+
__decorateClass([
|
|
4276
|
+
n4({ type: String, attribute: "submit-icon" })
|
|
4277
|
+
], ConsentActionBar.prototype, "submitIcon", 2);
|
|
4278
|
+
__decorateClass([
|
|
4279
|
+
n4({ type: String, attribute: "loading-label" })
|
|
4280
|
+
], ConsentActionBar.prototype, "loadingLabel", 2);
|
|
4092
4281
|
ConsentActionBar = __decorateClass([
|
|
4093
4282
|
t3("consent-action-bar")
|
|
4094
4283
|
], ConsentActionBar);
|
|
@@ -4119,21 +4308,27 @@ var ConsentFooter = class extends i4 {
|
|
|
4119
4308
|
${attribution}
|
|
4120
4309
|
</span>
|
|
4121
4310
|
${sanitizeLinkUrl(this.howItWorksUrl) ? b2`<a
|
|
4311
|
+
class="how"
|
|
4122
4312
|
href="${sanitizeLinkUrl(this.howItWorksUrl)}"
|
|
4123
4313
|
target="_blank"
|
|
4124
4314
|
rel="noopener"
|
|
4125
4315
|
>
|
|
4126
4316
|
${CONSENT_COPY_TOKENS.attribution.howThisWorks}
|
|
4127
|
-
</a>` : b2`<span
|
|
4317
|
+
</a>` : b2`<span class="how"
|
|
4318
|
+
>${CONSENT_COPY_TOKENS.attribution.howThisWorks}</span
|
|
4319
|
+
>`}
|
|
4128
4320
|
`;
|
|
4129
4321
|
}
|
|
4130
4322
|
};
|
|
4131
4323
|
ConsentFooter.styles = i`
|
|
4324
|
+
/* Each half stays on one line; in a narrow card the second moves under
|
|
4325
|
+
the first. */
|
|
4132
4326
|
:host {
|
|
4133
4327
|
display: flex;
|
|
4328
|
+
flex-wrap: wrap;
|
|
4134
4329
|
align-items: center;
|
|
4135
4330
|
justify-content: space-between;
|
|
4136
|
-
gap: 16px;
|
|
4331
|
+
gap: 6px 16px;
|
|
4137
4332
|
padding-top: 12px;
|
|
4138
4333
|
font-size: 12px;
|
|
4139
4334
|
color: var(--cs-text-tertiary, #64748b);
|
|
@@ -4146,6 +4341,11 @@ ConsentFooter.styles = i`
|
|
|
4146
4341
|
gap: 6px;
|
|
4147
4342
|
}
|
|
4148
4343
|
|
|
4344
|
+
.left,
|
|
4345
|
+
.how {
|
|
4346
|
+
white-space: nowrap;
|
|
4347
|
+
}
|
|
4348
|
+
|
|
4149
4349
|
.check {
|
|
4150
4350
|
width: 14px;
|
|
4151
4351
|
height: 14px;
|
|
@@ -4547,7 +4747,7 @@ function themeToCssVariables(tokens) {
|
|
|
4547
4747
|
return declarations.join("\n");
|
|
4548
4748
|
}
|
|
4549
4749
|
function camelToKebab(value) {
|
|
4550
|
-
return value.replace(/[A-Z]/g, (
|
|
4750
|
+
return value.replace(/[A-Z]/g, (c5) => `-${c5.toLowerCase()}`);
|
|
4551
4751
|
}
|
|
4552
4752
|
|
|
4553
4753
|
// src/identity/entity-card.ts
|
|
@@ -4586,8 +4786,8 @@ function hostOf(url) {
|
|
|
4586
4786
|
if (parsed.username || parsed.password) return null;
|
|
4587
4787
|
return parsed.host.toLowerCase();
|
|
4588
4788
|
}
|
|
4589
|
-
function sameDid(
|
|
4590
|
-
return
|
|
4789
|
+
function sameDid(a4, b4) {
|
|
4790
|
+
return a4 === b4 || canonicalDid(a4) === canonicalDid(b4);
|
|
4591
4791
|
}
|
|
4592
4792
|
function canonicalDid(did) {
|
|
4593
4793
|
if (!did.startsWith(DID_WEB_PREFIX)) return did;
|
|
@@ -4814,7 +5014,7 @@ function verificationMeta(verification) {
|
|
|
4814
5014
|
// src/cedar/compile.ts
|
|
4815
5015
|
var PLACEHOLDER_PATTERN = /\{\{\s*(agent_did|user_did|org|deployment)\s*\}\}/g;
|
|
4816
5016
|
function compileSingleCapability(capability, context) {
|
|
4817
|
-
const compiled = capability.cedar.replace(PLACEHOLDER_PATTERN, (
|
|
5017
|
+
const compiled = capability.cedar.replace(PLACEHOLDER_PATTERN, (_3, key) => {
|
|
4818
5018
|
const value = context[key];
|
|
4819
5019
|
if (typeof value !== "string" || value.length === 0) {
|
|
4820
5020
|
throw new Error(
|
|
@@ -4900,7 +5100,7 @@ function capabilityIdsFor(capabilities, disclosureMode) {
|
|
|
4900
5100
|
return capabilities.filter((capability) => disclosureMode || capability.defaultOn).map((capability) => capability.id);
|
|
4901
5101
|
}
|
|
4902
5102
|
function capabilitySeedKey(capabilities, allSelected) {
|
|
4903
|
-
return `${allSelected ? 1 : 0}:${capabilities.map((
|
|
5103
|
+
return `${allSelected ? 1 : 0}:${capabilities.map((c5) => c5.id).join(" ")}`;
|
|
4904
5104
|
}
|
|
4905
5105
|
|
|
4906
5106
|
// src/constants/capabilities.ts
|
|
@@ -4910,362 +5110,2488 @@ var CONSENT_CAPABILITIES_FEATURES = Object.freeze({
|
|
|
4910
5110
|
slots: Object.freeze(["identity", "details", "notice", "footer"])
|
|
4911
5111
|
});
|
|
4912
5112
|
|
|
4913
|
-
// src/
|
|
4914
|
-
var
|
|
5113
|
+
// src/grant/terms.ts
|
|
5114
|
+
var MINUTE = 60;
|
|
5115
|
+
var HOUR = 60 * MINUTE;
|
|
5116
|
+
var DAY = 24 * HOUR;
|
|
5117
|
+
var DURATION_OPTIONS = Object.freeze([
|
|
5118
|
+
{ label: "15 minutes", seconds: 15 * MINUTE },
|
|
5119
|
+
{ label: "30 minutes", seconds: 30 * MINUTE },
|
|
5120
|
+
{ label: "1 hour", seconds: HOUR },
|
|
5121
|
+
{ label: "8 hours", seconds: 8 * HOUR },
|
|
5122
|
+
{ label: "24 hours", seconds: DAY },
|
|
5123
|
+
{ label: "7 days", seconds: 7 * DAY },
|
|
5124
|
+
{ label: "30 days", seconds: 30 * DAY }
|
|
5125
|
+
]);
|
|
5126
|
+
var DEFAULT_DURATION_SECONDS = 8 * HOUR;
|
|
5127
|
+
function durationOptionsWithin(options, maxSeconds) {
|
|
5128
|
+
const valid = options.filter(
|
|
5129
|
+
(o9) => Number.isFinite(o9.seconds) && o9.seconds > 0
|
|
5130
|
+
);
|
|
5131
|
+
if (valid.length === 0) return [...DURATION_OPTIONS.slice(0, 1)];
|
|
5132
|
+
if (maxSeconds === void 0 || !Number.isFinite(maxSeconds)) {
|
|
5133
|
+
return valid;
|
|
5134
|
+
}
|
|
5135
|
+
const within = valid.filter((o9) => o9.seconds <= maxSeconds);
|
|
5136
|
+
if (within.length > 0) return within;
|
|
5137
|
+
const shortest = valid.reduce((a4, b4) => b4.seconds < a4.seconds ? b4 : a4);
|
|
5138
|
+
return [shortest];
|
|
5139
|
+
}
|
|
5140
|
+
function pickDuration(seconds, options, maxSeconds) {
|
|
5141
|
+
const offered = durationOptionsWithin(options, maxSeconds);
|
|
5142
|
+
const exact = offered.find((o9) => o9.seconds === seconds);
|
|
5143
|
+
if (exact) return exact;
|
|
5144
|
+
const shorter = offered.filter((o9) => o9.seconds < seconds);
|
|
5145
|
+
if (shorter.length > 0) {
|
|
5146
|
+
return shorter.reduce((a4, b4) => b4.seconds > a4.seconds ? b4 : a4);
|
|
5147
|
+
}
|
|
5148
|
+
return offered.reduce((a4, b4) => b4.seconds < a4.seconds ? b4 : a4);
|
|
5149
|
+
}
|
|
5150
|
+
function readFolder(input) {
|
|
5151
|
+
let folder = input.trim().replace(/\\/g, "/").replace(/\/{2,}/g, "/").replace(/^\//, "");
|
|
5152
|
+
if (folder.endsWith("*")) folder = folder.slice(0, -1);
|
|
5153
|
+
if (folder.replace(/\/+$/, "") === "") return { ok: true, folder: "" };
|
|
5154
|
+
const segments = folder.split("/");
|
|
5155
|
+
if (segments.some((s5) => s5 === "." || s5 === "..")) {
|
|
5156
|
+
return { ok: false, problem: "dot-segment" };
|
|
5157
|
+
}
|
|
5158
|
+
return { ok: true, folder };
|
|
5159
|
+
}
|
|
5160
|
+
function folderTerms(folder) {
|
|
5161
|
+
return folder ? { crispScopes: [{ resource: folder, matcher: "path-prefix" }] } : {};
|
|
5162
|
+
}
|
|
5163
|
+
function mergeGrantTerms(...parts) {
|
|
5164
|
+
const merged = {};
|
|
5165
|
+
for (const part of parts) {
|
|
5166
|
+
if (part.notAfter !== void 0) {
|
|
5167
|
+
merged.notAfter = merged.notAfter === void 0 ? part.notAfter : Math.min(merged.notAfter, part.notAfter);
|
|
5168
|
+
}
|
|
5169
|
+
if (part.crispScopes?.length) {
|
|
5170
|
+
merged.crispScopes = [...merged.crispScopes ?? [], ...part.crispScopes];
|
|
5171
|
+
}
|
|
5172
|
+
}
|
|
5173
|
+
return merged;
|
|
5174
|
+
}
|
|
5175
|
+
|
|
5176
|
+
// src/components/grant-field-styles.ts
|
|
5177
|
+
var fieldStyles = i`
|
|
5178
|
+
:host {
|
|
5179
|
+
display: grid;
|
|
5180
|
+
gap: 6px;
|
|
5181
|
+
font-family: inherit;
|
|
5182
|
+
}
|
|
5183
|
+
|
|
5184
|
+
:host([hidden]) {
|
|
5185
|
+
display: none;
|
|
5186
|
+
}
|
|
5187
|
+
|
|
5188
|
+
label {
|
|
5189
|
+
color: var(--cs-text-secondary, #334155);
|
|
5190
|
+
font-size: 12.5px;
|
|
5191
|
+
font-weight: 500;
|
|
5192
|
+
line-height: 1.4;
|
|
5193
|
+
}
|
|
5194
|
+
|
|
5195
|
+
select,
|
|
5196
|
+
input {
|
|
5197
|
+
box-sizing: border-box;
|
|
5198
|
+
width: 100%;
|
|
5199
|
+
min-height: 40px;
|
|
5200
|
+
margin: 0;
|
|
5201
|
+
padding: 9px 12px;
|
|
5202
|
+
border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.12));
|
|
5203
|
+
border-radius: var(--cs-field-radius, 10px);
|
|
5204
|
+
background: var(--cs-surface-card, #ffffff);
|
|
5205
|
+
color: var(--cs-text-primary, #0f172a);
|
|
5206
|
+
font: inherit;
|
|
5207
|
+
font-size: 14px;
|
|
5208
|
+
line-height: 1.4;
|
|
5209
|
+
transition: border-color 0.15s ease;
|
|
5210
|
+
}
|
|
5211
|
+
|
|
5212
|
+
input::placeholder {
|
|
5213
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
5214
|
+
opacity: 1;
|
|
5215
|
+
}
|
|
5216
|
+
|
|
5217
|
+
select:focus-visible,
|
|
5218
|
+
input:focus-visible {
|
|
5219
|
+
border-color: var(--cs-focus-ring, #0f172a);
|
|
5220
|
+
outline: 2px solid var(--cs-focus-ring, #0f172a);
|
|
5221
|
+
outline-offset: 1px;
|
|
5222
|
+
}
|
|
5223
|
+
|
|
5224
|
+
select:disabled,
|
|
5225
|
+
input:disabled {
|
|
5226
|
+
cursor: not-allowed;
|
|
5227
|
+
opacity: 0.6;
|
|
5228
|
+
}
|
|
5229
|
+
|
|
5230
|
+
input[aria-invalid="true"] {
|
|
5231
|
+
border-color: var(--cs-danger, #b42318);
|
|
5232
|
+
}
|
|
5233
|
+
|
|
5234
|
+
.hint,
|
|
5235
|
+
.error {
|
|
5236
|
+
margin: 0;
|
|
5237
|
+
font-size: 12px;
|
|
5238
|
+
line-height: 1.45;
|
|
5239
|
+
}
|
|
5240
|
+
|
|
5241
|
+
.hint {
|
|
5242
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
5243
|
+
}
|
|
5244
|
+
|
|
5245
|
+
.error {
|
|
5246
|
+
color: var(--cs-danger, #b42318);
|
|
5247
|
+
font-weight: 500;
|
|
5248
|
+
}
|
|
5249
|
+
`;
|
|
5250
|
+
|
|
5251
|
+
// src/components/consent-duration.ts
|
|
5252
|
+
var nextId = 0;
|
|
5253
|
+
var ConsentDuration = class extends i4 {
|
|
4915
5254
|
constructor() {
|
|
4916
5255
|
super(...arguments);
|
|
4917
|
-
this.
|
|
4918
|
-
this.
|
|
4919
|
-
this.
|
|
4920
|
-
this.revocationPath = "Account \u2192 Connected Agents";
|
|
4921
|
-
this.inactivityDays = 90;
|
|
4922
|
-
this.fixedExpiry = false;
|
|
4923
|
-
this.theme = "light";
|
|
4924
|
-
this.howItWorksUrl = "";
|
|
4925
|
-
this.loading = false;
|
|
5256
|
+
this.value = DEFAULT_DURATION_SECONDS;
|
|
5257
|
+
this.options = [...DURATION_OPTIONS];
|
|
5258
|
+
this.name = "";
|
|
4926
5259
|
this.disabled = false;
|
|
4927
|
-
this.
|
|
4928
|
-
this.
|
|
4929
|
-
this.
|
|
4930
|
-
this.
|
|
4931
|
-
this.allowDisabled = false;
|
|
4932
|
-
this.serverDomain = "";
|
|
4933
|
-
this.logoDevToken = "";
|
|
4934
|
-
this.serverLogoUrl = "";
|
|
4935
|
-
this.requireAll = false;
|
|
4936
|
-
this.selected = /* @__PURE__ */ new Set();
|
|
4937
|
-
/**
|
|
4938
|
-
* Last capability set this component seeded `selected` from, per
|
|
4939
|
-
* `capabilitySeedKey`. Re-seeding is keyed on this value rather than on
|
|
4940
|
-
* `capabilities` array identity — see `seedDefaults`.
|
|
4941
|
-
*/
|
|
4942
|
-
this.seedKey = "";
|
|
4943
|
-
this.onCapabilityToggle = (event) => {
|
|
4944
|
-
if (this.loading || this.disabled || !(event instanceof CustomEvent))
|
|
4945
|
-
return;
|
|
4946
|
-
const detail = event.detail;
|
|
4947
|
-
if (!detail || typeof detail !== "object" || !("id" in detail) || typeof detail.id !== "string" || !("checked" in detail) || typeof detail.checked !== "boolean" || !this.capabilities.some((capability) => capability.id === detail.id))
|
|
4948
|
-
return;
|
|
4949
|
-
const next = new Set(this.selected);
|
|
4950
|
-
if (detail.checked) next.add(detail.id);
|
|
4951
|
-
else next.delete(detail.id);
|
|
4952
|
-
this.selected = next;
|
|
4953
|
-
};
|
|
4954
|
-
this.onAllow = () => {
|
|
4955
|
-
if (this.loading || this.approvalDisabled) return;
|
|
4956
|
-
const selectedCapabilities = this.capabilities.filter(
|
|
4957
|
-
(c4) => this.selected.has(c4.id)
|
|
4958
|
-
);
|
|
4959
|
-
if (selectedCapabilities.length === 0) return;
|
|
4960
|
-
const selectedIds = selectedCapabilities.map((c4) => c4.id);
|
|
4961
|
-
const selectedScopes = Array.from(
|
|
4962
|
-
new Set(selectedCapabilities.flatMap((c4) => c4.scopes))
|
|
4963
|
-
);
|
|
4964
|
-
const detail = {
|
|
4965
|
-
selectedCapabilityIds: selectedIds,
|
|
4966
|
-
selectedScopes
|
|
4967
|
-
};
|
|
4968
|
-
this.dispatchEvent(
|
|
4969
|
-
new CustomEvent("capabilities-allow", {
|
|
4970
|
-
detail,
|
|
4971
|
-
bubbles: true,
|
|
4972
|
-
composed: true
|
|
4973
|
-
})
|
|
4974
|
-
);
|
|
4975
|
-
};
|
|
4976
|
-
this.onDeny = () => {
|
|
4977
|
-
if (this.loading) return;
|
|
4978
|
-
this.dispatchEvent(
|
|
4979
|
-
new CustomEvent("capabilities-deny", { bubbles: true, composed: true })
|
|
4980
|
-
);
|
|
4981
|
-
};
|
|
5260
|
+
this.label = CONSENT_COPY_TOKENS.grant.durationLabel;
|
|
5261
|
+
this.hint = CONSENT_COPY_TOKENS.grant.durationHint;
|
|
5262
|
+
this.internals = this.attachInternals?.();
|
|
5263
|
+
this.fieldId = `consent-duration-${++nextId}`;
|
|
4982
5264
|
}
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
this.
|
|
5265
|
+
/** The choices the host allows. */
|
|
5266
|
+
get offered() {
|
|
5267
|
+
return durationOptionsWithin(this.options, this.max);
|
|
4986
5268
|
}
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
}
|
|
5269
|
+
/** The choice in effect. */
|
|
5270
|
+
get selected() {
|
|
5271
|
+
return pickDuration(this.value, this.options, this.max);
|
|
4991
5272
|
}
|
|
4992
|
-
/**
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
* array on every render (e.g. because a sibling `@state()` field changed)
|
|
4996
|
-
* produces a new array with the same contents on every keystroke; without
|
|
4997
|
-
* this guard `willUpdate` would re-seed on every one of those renders and
|
|
4998
|
-
* silently wipe whatever the user had already toggled.
|
|
4999
|
-
*/
|
|
5000
|
-
seedDefaults() {
|
|
5001
|
-
const key = capabilitySeedKey(this.capabilities, this.allSelected);
|
|
5002
|
-
if (key === this.seedKey) return;
|
|
5003
|
-
this.seedKey = key;
|
|
5004
|
-
this.selected = new Set(
|
|
5005
|
-
capabilityIdsFor(this.capabilities, this.allSelected)
|
|
5006
|
-
);
|
|
5273
|
+
/** The duration in words, for the group's closed summary. */
|
|
5274
|
+
get summary() {
|
|
5275
|
+
return this.selected.label;
|
|
5007
5276
|
}
|
|
5008
|
-
|
|
5009
|
-
|
|
5277
|
+
/** Always true: every offered choice is a valid grant. */
|
|
5278
|
+
get valid() {
|
|
5279
|
+
return true;
|
|
5010
5280
|
}
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
);
|
|
5281
|
+
/** `{ notAfter }` for `issueDelegation()`. */
|
|
5282
|
+
get grantTerms() {
|
|
5283
|
+
return { notAfter: this.selected.seconds };
|
|
5015
5284
|
}
|
|
5016
|
-
|
|
5017
|
-
const
|
|
5018
|
-
if (
|
|
5019
|
-
if (!this.cedarContext) {
|
|
5020
|
-
return cedar;
|
|
5021
|
-
}
|
|
5022
|
-
try {
|
|
5023
|
-
return compileSingleCapability(
|
|
5024
|
-
{ ...capability, cedar },
|
|
5025
|
-
this.cedarContext
|
|
5026
|
-
);
|
|
5027
|
-
} catch {
|
|
5028
|
-
return cedar;
|
|
5029
|
-
}
|
|
5285
|
+
willUpdate() {
|
|
5286
|
+
const seconds = this.selected.seconds;
|
|
5287
|
+
if (seconds !== this.value) this.value = seconds;
|
|
5030
5288
|
}
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
if (
|
|
5034
|
-
|
|
5035
|
-
}
|
|
5036
|
-
try {
|
|
5037
|
-
return agentMetadataFromIdentity(this.agentIdentity);
|
|
5038
|
-
} catch {
|
|
5039
|
-
return void 0;
|
|
5289
|
+
updated() {
|
|
5290
|
+
const select = this.renderRoot.querySelector("select");
|
|
5291
|
+
if (select && select.value !== String(this.value)) {
|
|
5292
|
+
select.value = String(this.value);
|
|
5040
5293
|
}
|
|
5294
|
+
this.internals?.setFormValue(String(this.value));
|
|
5295
|
+
}
|
|
5296
|
+
onChange(event) {
|
|
5297
|
+
const seconds = Number(event.target.value);
|
|
5298
|
+
this.value = seconds;
|
|
5299
|
+
this.dispatchEvent(
|
|
5300
|
+
new CustomEvent("consent-duration-change", {
|
|
5301
|
+
detail: { seconds },
|
|
5302
|
+
bubbles: true,
|
|
5303
|
+
composed: true
|
|
5304
|
+
})
|
|
5305
|
+
);
|
|
5041
5306
|
}
|
|
5042
5307
|
render() {
|
|
5043
|
-
const tokens = CONSENT_COPY_TOKENS;
|
|
5044
|
-
const agent = this.resolveAgent();
|
|
5045
|
-
const agentName = agent?.name || "this agent";
|
|
5046
|
-
const sectionHeader = formatToken(tokens.section.capabilitiesHeader, {
|
|
5047
|
-
Agent: agentName.toUpperCase()
|
|
5048
|
-
});
|
|
5049
5308
|
return b2`
|
|
5050
|
-
<
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
agent-name="${agent?.name ?? ""}"
|
|
5067
|
-
org-name="${this.orgName}"
|
|
5068
|
-
verb="${this.headlineVerb}"
|
|
5069
|
-
description="${this.description}"
|
|
5070
|
-
></consent-headline>
|
|
5071
|
-
<slot name="recovery"></slot>
|
|
5072
|
-
<slot name="identity"></slot>
|
|
5073
|
-
${agent ? b2`<consent-agent-header
|
|
5074
|
-
part="agent"
|
|
5075
|
-
agentName="${agent.name}"
|
|
5076
|
-
vendor="${agent.vendor || ""}"
|
|
5077
|
-
surfaceLabel="${agent.surfaceLabel || ""}"
|
|
5078
|
-
verification="${agentVerification(agent)}"
|
|
5079
|
-
domain="${agent.domain || ""}"
|
|
5080
|
-
logoUrl="${agent.logoUrl || ""}"
|
|
5081
|
-
connectedAt="${agent.connectedAt || ""}"
|
|
5082
|
-
></consent-agent-header>` : A}
|
|
5083
|
-
<slot name="agent-key"></slot>
|
|
5084
|
-
<div part="permissions">
|
|
5085
|
-
<div class="section-header">
|
|
5086
|
-
<span>${sectionHeader}</span>
|
|
5087
|
-
<span class="hint">${tokens.section.tapToToggle}</span>
|
|
5088
|
-
</div>
|
|
5089
|
-
<div class="rows" @capability-toggle=${this.onCapabilityToggle}>
|
|
5090
|
-
${this.capabilities.map(
|
|
5091
|
-
(capability) => b2`
|
|
5092
|
-
<consent-capability-card
|
|
5093
|
-
capabilityId="${capability.id}"
|
|
5094
|
-
label="${capability.label}"
|
|
5095
|
-
description="${capability.description}"
|
|
5096
|
-
icon="${capability.icon}"
|
|
5097
|
-
riskLevel="${capability.riskLevel}"
|
|
5098
|
-
?checked=${this.selected.has(capability.id)}
|
|
5099
|
-
?disabled=${this.loading || this.disabled}
|
|
5100
|
-
.scopes=${capability.scopes}
|
|
5101
|
-
compiled-cedar="${this.compileCapabilityCedar(capability)}"
|
|
5102
|
-
></consent-capability-card>
|
|
5103
|
-
`
|
|
5309
|
+
<label part="label" for=${this.fieldId}>${this.label}</label>
|
|
5310
|
+
<div class="control">
|
|
5311
|
+
<select
|
|
5312
|
+
part="select"
|
|
5313
|
+
id=${this.fieldId}
|
|
5314
|
+
aria-describedby=${this.hint ? `${this.fieldId}-hint` : A}
|
|
5315
|
+
?disabled=${this.disabled}
|
|
5316
|
+
@change=${this.onChange}
|
|
5317
|
+
>
|
|
5318
|
+
${this.offered.map(
|
|
5319
|
+
(o9) => b2`<option
|
|
5320
|
+
value=${o9.seconds}
|
|
5321
|
+
?selected=${o9.seconds === this.value}
|
|
5322
|
+
>
|
|
5323
|
+
${o9.label}
|
|
5324
|
+
</option>`
|
|
5104
5325
|
)}
|
|
5326
|
+
</select>
|
|
5327
|
+
<svg
|
|
5328
|
+
class="chevron"
|
|
5329
|
+
viewBox="0 0 16 16"
|
|
5330
|
+
fill="none"
|
|
5331
|
+
stroke="currentColor"
|
|
5332
|
+
stroke-width="1.6"
|
|
5333
|
+
stroke-linecap="round"
|
|
5334
|
+
stroke-linejoin="round"
|
|
5335
|
+
aria-hidden="true"
|
|
5336
|
+
>
|
|
5337
|
+
<path d="M4 6l4 4 4-4" />
|
|
5338
|
+
</svg>
|
|
5339
|
+
</div>
|
|
5340
|
+
${this.hint ? b2`<p part="hint" class="hint" id="${this.fieldId}-hint">
|
|
5341
|
+
${this.hint}
|
|
5342
|
+
</p>` : null}
|
|
5343
|
+
`;
|
|
5344
|
+
}
|
|
5345
|
+
};
|
|
5346
|
+
ConsentDuration.formAssociated = true;
|
|
5347
|
+
ConsentDuration.styles = [
|
|
5348
|
+
fieldStyles,
|
|
5349
|
+
i`
|
|
5350
|
+
.control {
|
|
5351
|
+
position: relative;
|
|
5352
|
+
}
|
|
5353
|
+
|
|
5354
|
+
select {
|
|
5355
|
+
appearance: none;
|
|
5356
|
+
-webkit-appearance: none;
|
|
5357
|
+
padding-right: 36px;
|
|
5358
|
+
cursor: pointer;
|
|
5359
|
+
}
|
|
5360
|
+
|
|
5361
|
+
.chevron {
|
|
5362
|
+
position: absolute;
|
|
5363
|
+
top: 50%;
|
|
5364
|
+
right: 12px;
|
|
5365
|
+
width: 14px;
|
|
5366
|
+
height: 14px;
|
|
5367
|
+
margin-top: -7px;
|
|
5368
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
5369
|
+
pointer-events: none;
|
|
5370
|
+
}
|
|
5371
|
+
`
|
|
5372
|
+
];
|
|
5373
|
+
__decorateClass([
|
|
5374
|
+
n4({ type: Number })
|
|
5375
|
+
], ConsentDuration.prototype, "value", 2);
|
|
5376
|
+
__decorateClass([
|
|
5377
|
+
n4({ type: Array })
|
|
5378
|
+
], ConsentDuration.prototype, "options", 2);
|
|
5379
|
+
__decorateClass([
|
|
5380
|
+
n4({ type: Number })
|
|
5381
|
+
], ConsentDuration.prototype, "max", 2);
|
|
5382
|
+
__decorateClass([
|
|
5383
|
+
n4({ type: String, reflect: true })
|
|
5384
|
+
], ConsentDuration.prototype, "name", 2);
|
|
5385
|
+
__decorateClass([
|
|
5386
|
+
n4({ type: Boolean, reflect: true })
|
|
5387
|
+
], ConsentDuration.prototype, "disabled", 2);
|
|
5388
|
+
__decorateClass([
|
|
5389
|
+
n4({ type: String })
|
|
5390
|
+
], ConsentDuration.prototype, "label", 2);
|
|
5391
|
+
__decorateClass([
|
|
5392
|
+
n4({ type: String })
|
|
5393
|
+
], ConsentDuration.prototype, "hint", 2);
|
|
5394
|
+
ConsentDuration = __decorateClass([
|
|
5395
|
+
t3("consent-duration")
|
|
5396
|
+
], ConsentDuration);
|
|
5397
|
+
|
|
5398
|
+
// src/components/consent-folder-scope.ts
|
|
5399
|
+
var nextId2 = 0;
|
|
5400
|
+
var ConsentFolderScope = class extends i4 {
|
|
5401
|
+
constructor() {
|
|
5402
|
+
super(...arguments);
|
|
5403
|
+
this.value = "";
|
|
5404
|
+
this.name = "";
|
|
5405
|
+
this.disabled = false;
|
|
5406
|
+
this.label = CONSENT_COPY_TOKENS.grant.folderLabel;
|
|
5407
|
+
this.placeholder = CONSENT_COPY_TOKENS.grant.folderPlaceholder;
|
|
5408
|
+
this.hint = CONSENT_COPY_TOKENS.grant.folderHint;
|
|
5409
|
+
this.everythingLabel = CONSENT_COPY_TOKENS.grant.everyFolder;
|
|
5410
|
+
this.onlyTemplate = CONSENT_COPY_TOKENS.grant.onlyFolderTemplate;
|
|
5411
|
+
this.internals = this.attachInternals?.();
|
|
5412
|
+
this.fieldId = `consent-folder-scope-${++nextId2}`;
|
|
5413
|
+
}
|
|
5414
|
+
/** The folder, as the grant will read it. */
|
|
5415
|
+
get scope() {
|
|
5416
|
+
return readFolder(this.value);
|
|
5417
|
+
}
|
|
5418
|
+
get valid() {
|
|
5419
|
+
return this.scope.ok;
|
|
5420
|
+
}
|
|
5421
|
+
/** The folder in words, for the group's closed summary. */
|
|
5422
|
+
get summary() {
|
|
5423
|
+
const scope = this.scope;
|
|
5424
|
+
if (!scope.ok) return CONSENT_COPY_TOKENS.grant.folderNeedsFixing;
|
|
5425
|
+
return scope.folder ? formatToken(this.onlyTemplate, { Folder: scope.folder }) : this.everythingLabel;
|
|
5426
|
+
}
|
|
5427
|
+
/** `{ crispScopes }` for `issueDelegation()`, or `{}` for every folder. */
|
|
5428
|
+
get grantTerms() {
|
|
5429
|
+
const scope = this.scope;
|
|
5430
|
+
return scope.ok ? folderTerms(scope.folder) : {};
|
|
5431
|
+
}
|
|
5432
|
+
updated() {
|
|
5433
|
+
const scope = this.scope;
|
|
5434
|
+
if (!this.internals) return;
|
|
5435
|
+
this.internals.setFormValue(scope.ok ? scope.folder : null);
|
|
5436
|
+
const input = this.renderRoot.querySelector("input") ?? void 0;
|
|
5437
|
+
if (scope.ok) this.internals.setValidity({});
|
|
5438
|
+
else
|
|
5439
|
+
this.internals.setValidity(
|
|
5440
|
+
{ customError: true },
|
|
5441
|
+
CONSENT_COPY_TOKENS.grant.folderDotSegment,
|
|
5442
|
+
input
|
|
5443
|
+
);
|
|
5444
|
+
}
|
|
5445
|
+
onInput(event) {
|
|
5446
|
+
this.value = event.target.value;
|
|
5447
|
+
const scope = this.scope;
|
|
5448
|
+
this.dispatchEvent(
|
|
5449
|
+
new CustomEvent("consent-folder-scope-change", {
|
|
5450
|
+
detail: {
|
|
5451
|
+
value: this.value,
|
|
5452
|
+
folder: scope.ok ? scope.folder : "",
|
|
5453
|
+
valid: scope.ok
|
|
5454
|
+
},
|
|
5455
|
+
bubbles: true,
|
|
5456
|
+
composed: true
|
|
5457
|
+
})
|
|
5458
|
+
);
|
|
5459
|
+
}
|
|
5460
|
+
render() {
|
|
5461
|
+
const invalid = !this.scope.ok;
|
|
5462
|
+
const describedBy = invalid ? `${this.fieldId}-error` : this.hint ? `${this.fieldId}-hint` : void 0;
|
|
5463
|
+
return b2`
|
|
5464
|
+
<label part="label" for=${this.fieldId}>${this.label}</label>
|
|
5465
|
+
<input
|
|
5466
|
+
part="input"
|
|
5467
|
+
id=${this.fieldId}
|
|
5468
|
+
type="text"
|
|
5469
|
+
autocomplete="off"
|
|
5470
|
+
autocapitalize="off"
|
|
5471
|
+
spellcheck="false"
|
|
5472
|
+
placeholder=${this.placeholder}
|
|
5473
|
+
.value=${this.value}
|
|
5474
|
+
?disabled=${this.disabled}
|
|
5475
|
+
aria-invalid=${invalid ? "true" : "false"}
|
|
5476
|
+
aria-describedby=${describedBy ?? A}
|
|
5477
|
+
@input=${this.onInput}
|
|
5478
|
+
/>
|
|
5479
|
+
${invalid ? b2`<p part="error" class="error" id="${this.fieldId}-error">
|
|
5480
|
+
${CONSENT_COPY_TOKENS.grant.folderDotSegment}
|
|
5481
|
+
</p>` : this.hint ? b2`<p part="hint" class="hint" id="${this.fieldId}-hint">
|
|
5482
|
+
${this.hint}
|
|
5483
|
+
</p>` : A}
|
|
5484
|
+
`;
|
|
5485
|
+
}
|
|
5486
|
+
};
|
|
5487
|
+
ConsentFolderScope.formAssociated = true;
|
|
5488
|
+
ConsentFolderScope.styles = fieldStyles;
|
|
5489
|
+
__decorateClass([
|
|
5490
|
+
n4({ type: String })
|
|
5491
|
+
], ConsentFolderScope.prototype, "value", 2);
|
|
5492
|
+
__decorateClass([
|
|
5493
|
+
n4({ type: String, reflect: true })
|
|
5494
|
+
], ConsentFolderScope.prototype, "name", 2);
|
|
5495
|
+
__decorateClass([
|
|
5496
|
+
n4({ type: Boolean, reflect: true })
|
|
5497
|
+
], ConsentFolderScope.prototype, "disabled", 2);
|
|
5498
|
+
__decorateClass([
|
|
5499
|
+
n4({ type: String })
|
|
5500
|
+
], ConsentFolderScope.prototype, "label", 2);
|
|
5501
|
+
__decorateClass([
|
|
5502
|
+
n4({ type: String })
|
|
5503
|
+
], ConsentFolderScope.prototype, "placeholder", 2);
|
|
5504
|
+
__decorateClass([
|
|
5505
|
+
n4({ type: String })
|
|
5506
|
+
], ConsentFolderScope.prototype, "hint", 2);
|
|
5507
|
+
__decorateClass([
|
|
5508
|
+
n4({ type: String, attribute: "everything-label" })
|
|
5509
|
+
], ConsentFolderScope.prototype, "everythingLabel", 2);
|
|
5510
|
+
__decorateClass([
|
|
5511
|
+
n4({ type: String, attribute: "only-template" })
|
|
5512
|
+
], ConsentFolderScope.prototype, "onlyTemplate", 2);
|
|
5513
|
+
ConsentFolderScope = __decorateClass([
|
|
5514
|
+
t3("consent-folder-scope")
|
|
5515
|
+
], ConsentFolderScope);
|
|
5516
|
+
|
|
5517
|
+
// src/components/consent-grant-terms.ts
|
|
5518
|
+
var GRANT_FIELD_EVENTS = [
|
|
5519
|
+
"consent-duration-change",
|
|
5520
|
+
"consent-folder-scope-change",
|
|
5521
|
+
"consent-grant-field-change"
|
|
5522
|
+
];
|
|
5523
|
+
function isGrantField(el) {
|
|
5524
|
+
return "grantTerms" in el;
|
|
5525
|
+
}
|
|
5526
|
+
var nextId3 = 0;
|
|
5527
|
+
var ConsentGrantTerms = class extends i4 {
|
|
5528
|
+
constructor() {
|
|
5529
|
+
super();
|
|
5530
|
+
this.open = false;
|
|
5531
|
+
this.chained = false;
|
|
5532
|
+
this.customizeLabel = CONSENT_COPY_TOKENS.grant.customize;
|
|
5533
|
+
this.bodyId = `consent-grant-terms-${++nextId3}`;
|
|
5534
|
+
for (const type of GRANT_FIELD_EVENTS) {
|
|
5535
|
+
this.addEventListener(type, () => this.fieldChanged());
|
|
5536
|
+
}
|
|
5537
|
+
}
|
|
5538
|
+
/**
|
|
5539
|
+
* The default fields show while the element has no child elements. Not
|
|
5540
|
+
* slot fallback content: whitespace between the tags is slotted too, and
|
|
5541
|
+
* would hide the fallback.
|
|
5542
|
+
*/
|
|
5543
|
+
get usesDefaults() {
|
|
5544
|
+
return (this.children?.length ?? 0) === 0;
|
|
5545
|
+
}
|
|
5546
|
+
/** The fields: the children with `grantTerms`, or the defaults. */
|
|
5547
|
+
get fields() {
|
|
5548
|
+
if (!this.usesDefaults) {
|
|
5549
|
+
return Array.from(this.children).filter(isGrantField);
|
|
5550
|
+
}
|
|
5551
|
+
const defaults = this.renderRoot?.querySelector?.(".defaults");
|
|
5552
|
+
return defaults ? [...defaults.children].filter(isGrantField) : [];
|
|
5553
|
+
}
|
|
5554
|
+
/** False while a field's terms can't be used. */
|
|
5555
|
+
get valid() {
|
|
5556
|
+
return this.fields.every((f4) => f4.valid !== false);
|
|
5557
|
+
}
|
|
5558
|
+
/** Every field's terms, merged. */
|
|
5559
|
+
get grantTerms() {
|
|
5560
|
+
return mergeGrantTerms(
|
|
5561
|
+
...this.fields.filter((f4) => f4.valid !== false).map((f4) => f4.grantTerms)
|
|
5562
|
+
);
|
|
5563
|
+
}
|
|
5564
|
+
/** The closed line: each field's summary. */
|
|
5565
|
+
get summary() {
|
|
5566
|
+
return this.fields.map((f4) => f4.summary).filter((s5) => Boolean(s5)).join(CONSENT_COPY_TOKENS.grant.summarySeparator);
|
|
5567
|
+
}
|
|
5568
|
+
fieldChanged() {
|
|
5569
|
+
void this.updateComplete.then(async () => {
|
|
5570
|
+
await Promise.all(
|
|
5571
|
+
this.fields.map(
|
|
5572
|
+
(f4) => f4 instanceof i4 ? f4.updateComplete : void 0
|
|
5573
|
+
)
|
|
5574
|
+
);
|
|
5575
|
+
this.requestUpdate();
|
|
5576
|
+
this.dispatchEvent(
|
|
5577
|
+
new CustomEvent("consent-grant-terms-change", {
|
|
5578
|
+
detail: {
|
|
5579
|
+
terms: this.grantTerms,
|
|
5580
|
+
valid: this.valid,
|
|
5581
|
+
summary: this.summary
|
|
5582
|
+
},
|
|
5583
|
+
bubbles: true,
|
|
5584
|
+
composed: true
|
|
5585
|
+
})
|
|
5586
|
+
);
|
|
5587
|
+
});
|
|
5588
|
+
}
|
|
5589
|
+
onSlotChange() {
|
|
5590
|
+
this.requestUpdate();
|
|
5591
|
+
}
|
|
5592
|
+
toggle() {
|
|
5593
|
+
this.open = !this.open;
|
|
5594
|
+
}
|
|
5595
|
+
firstUpdated() {
|
|
5596
|
+
void Promise.all(
|
|
5597
|
+
this.fields.map(
|
|
5598
|
+
(f4) => f4 instanceof i4 ? f4.updateComplete : void 0
|
|
5599
|
+
)
|
|
5600
|
+
).then(() => this.requestUpdate());
|
|
5601
|
+
}
|
|
5602
|
+
render() {
|
|
5603
|
+
const summary = this.hasUpdated ? this.summary : "";
|
|
5604
|
+
return b2`
|
|
5605
|
+
<div part="frame" class="frame">
|
|
5606
|
+
<button
|
|
5607
|
+
part="toggle"
|
|
5608
|
+
class="toggle"
|
|
5609
|
+
type="button"
|
|
5610
|
+
aria-expanded=${this.open ? "true" : "false"}
|
|
5611
|
+
aria-controls=${this.bodyId}
|
|
5612
|
+
@click=${this.toggle}
|
|
5613
|
+
>
|
|
5614
|
+
<span part="summary" class="summary ${this.valid ? "" : "invalid"}"
|
|
5615
|
+
>${summary}</span
|
|
5616
|
+
>
|
|
5617
|
+
<span class="customize">
|
|
5618
|
+
${this.customizeLabel}
|
|
5619
|
+
<svg
|
|
5620
|
+
class="chevron"
|
|
5621
|
+
viewBox="0 0 16 16"
|
|
5622
|
+
fill="none"
|
|
5623
|
+
stroke="currentColor"
|
|
5624
|
+
stroke-width="1.6"
|
|
5625
|
+
stroke-linecap="round"
|
|
5626
|
+
stroke-linejoin="round"
|
|
5627
|
+
aria-hidden="true"
|
|
5628
|
+
>
|
|
5629
|
+
<path d="M4 6l4 4 4-4" />
|
|
5630
|
+
</svg>
|
|
5631
|
+
</span>
|
|
5632
|
+
</button>
|
|
5633
|
+
<div part="body" class="body" id=${this.bodyId} ?hidden=${!this.open}>
|
|
5634
|
+
<slot @slotchange=${this.onSlotChange}></slot>
|
|
5635
|
+
${this.usesDefaults ? b2`<div class="defaults">
|
|
5636
|
+
<consent-duration></consent-duration>
|
|
5637
|
+
<consent-folder-scope></consent-folder-scope>
|
|
5638
|
+
</div>` : A}
|
|
5639
|
+
${this.chained ? b2`<p part="pass-on" class="pass-on">
|
|
5640
|
+
${CONSENT_COPY_TOKENS.grant.passOn}
|
|
5641
|
+
</p>` : A}
|
|
5642
|
+
</div>
|
|
5643
|
+
</div>
|
|
5644
|
+
`;
|
|
5645
|
+
}
|
|
5646
|
+
};
|
|
5647
|
+
ConsentGrantTerms.styles = i`
|
|
5648
|
+
:host {
|
|
5649
|
+
display: block;
|
|
5650
|
+
font-family: inherit;
|
|
5651
|
+
}
|
|
5652
|
+
|
|
5653
|
+
/* The outline lives inside the shadow root, not on the host: a page's
|
|
5654
|
+
rules beat :host rules, so a CSS reset (Tailwind's preflight zeroes
|
|
5655
|
+
every border) would otherwise erase it. */
|
|
5656
|
+
.frame {
|
|
5657
|
+
border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.12));
|
|
5658
|
+
border-radius: var(--cs-field-radius, 12px);
|
|
5659
|
+
background: var(--cs-grant-bg, transparent);
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
:host([hidden]) {
|
|
5663
|
+
display: none;
|
|
5664
|
+
}
|
|
5665
|
+
|
|
5666
|
+
/* When the line and Customize don't fit side by side, Customize moves
|
|
5667
|
+
under the line rather than squeezing it a word wide. */
|
|
5668
|
+
.toggle {
|
|
5669
|
+
display: flex;
|
|
5670
|
+
flex-wrap: wrap;
|
|
5671
|
+
width: 100%;
|
|
5672
|
+
align-items: center;
|
|
5673
|
+
justify-content: space-between;
|
|
5674
|
+
gap: 4px 8px;
|
|
5675
|
+
margin: 0;
|
|
5676
|
+
padding: 11px 14px;
|
|
5677
|
+
border: 0;
|
|
5678
|
+
border-radius: inherit;
|
|
5679
|
+
background: none;
|
|
5680
|
+
color: inherit;
|
|
5681
|
+
font: inherit;
|
|
5682
|
+
text-align: left;
|
|
5683
|
+
cursor: pointer;
|
|
5684
|
+
}
|
|
5685
|
+
|
|
5686
|
+
:host([open]) .toggle {
|
|
5687
|
+
border-bottom-left-radius: 0;
|
|
5688
|
+
border-bottom-right-radius: 0;
|
|
5689
|
+
}
|
|
5690
|
+
|
|
5691
|
+
.toggle:hover {
|
|
5692
|
+
background: var(--cs-row-hover-bg, rgba(15, 23, 42, 0.03));
|
|
5693
|
+
}
|
|
5694
|
+
|
|
5695
|
+
.toggle:focus-visible {
|
|
5696
|
+
outline: 2px solid var(--cs-focus-ring, #0f172a);
|
|
5697
|
+
outline-offset: 2px;
|
|
5698
|
+
}
|
|
5699
|
+
|
|
5700
|
+
/* It wraps rather than ellipsizes: the line says what the person is
|
|
5701
|
+
granting, so a narrow screen must not hide the folder. Words stay
|
|
5702
|
+
whole; only a folder longer than the whole line is broken. */
|
|
5703
|
+
.summary {
|
|
5704
|
+
min-width: 0;
|
|
5705
|
+
color: var(--cs-text-secondary, #334155);
|
|
5706
|
+
font-size: 12.5px;
|
|
5707
|
+
line-height: 1.4;
|
|
5708
|
+
overflow-wrap: break-word;
|
|
5709
|
+
}
|
|
5710
|
+
|
|
5711
|
+
.summary.invalid {
|
|
5712
|
+
color: var(--cs-danger, #b42318);
|
|
5713
|
+
}
|
|
5714
|
+
|
|
5715
|
+
.customize {
|
|
5716
|
+
display: inline-flex;
|
|
5717
|
+
flex-shrink: 0;
|
|
5718
|
+
align-items: center;
|
|
5719
|
+
gap: 4px;
|
|
5720
|
+
color: var(--cs-text-primary, #0f172a);
|
|
5721
|
+
font-size: 12.5px;
|
|
5722
|
+
font-weight: 500;
|
|
5723
|
+
/* The summary's line height, so the two share a baseline whatever
|
|
5724
|
+
line height the page sets. */
|
|
5725
|
+
line-height: 1.4;
|
|
5726
|
+
}
|
|
5727
|
+
|
|
5728
|
+
.chevron {
|
|
5729
|
+
width: 14px;
|
|
5730
|
+
height: 14px;
|
|
5731
|
+
transition: transform 0.2s ease;
|
|
5732
|
+
}
|
|
5733
|
+
|
|
5734
|
+
:host([open]) .chevron {
|
|
5735
|
+
transform: rotate(180deg);
|
|
5736
|
+
}
|
|
5737
|
+
|
|
5738
|
+
@media (prefers-reduced-motion: reduce) {
|
|
5739
|
+
.chevron {
|
|
5740
|
+
transition: none;
|
|
5741
|
+
}
|
|
5742
|
+
}
|
|
5743
|
+
|
|
5744
|
+
.body {
|
|
5745
|
+
display: grid;
|
|
5746
|
+
gap: 16px;
|
|
5747
|
+
padding: 14px 14px 16px;
|
|
5748
|
+
border-top: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.12));
|
|
5749
|
+
}
|
|
5750
|
+
|
|
5751
|
+
.body[hidden] {
|
|
5752
|
+
display: none;
|
|
5753
|
+
}
|
|
5754
|
+
|
|
5755
|
+
::slotted(*) {
|
|
5756
|
+
margin: 0;
|
|
5757
|
+
}
|
|
5758
|
+
|
|
5759
|
+
.defaults {
|
|
5760
|
+
display: grid;
|
|
5761
|
+
gap: 16px;
|
|
5762
|
+
}
|
|
5763
|
+
|
|
5764
|
+
slot {
|
|
5765
|
+
display: contents;
|
|
5766
|
+
}
|
|
5767
|
+
|
|
5768
|
+
.pass-on {
|
|
5769
|
+
margin: 0;
|
|
5770
|
+
color: var(--cs-text-secondary, #334155);
|
|
5771
|
+
font-size: 12px;
|
|
5772
|
+
line-height: 1.45;
|
|
5773
|
+
}
|
|
5774
|
+
`;
|
|
5775
|
+
__decorateClass([
|
|
5776
|
+
n4({ type: Boolean, reflect: true })
|
|
5777
|
+
], ConsentGrantTerms.prototype, "open", 2);
|
|
5778
|
+
__decorateClass([
|
|
5779
|
+
n4({ type: Boolean, reflect: true })
|
|
5780
|
+
], ConsentGrantTerms.prototype, "chained", 2);
|
|
5781
|
+
__decorateClass([
|
|
5782
|
+
n4({ type: String, attribute: "customize-label" })
|
|
5783
|
+
], ConsentGrantTerms.prototype, "customizeLabel", 2);
|
|
5784
|
+
ConsentGrantTerms = __decorateClass([
|
|
5785
|
+
t3("consent-grant-terms")
|
|
5786
|
+
], ConsentGrantTerms);
|
|
5787
|
+
|
|
5788
|
+
// src/components/consent-capabilities-screen.ts
|
|
5789
|
+
var ConsentCapabilitiesScreen = class extends i4 {
|
|
5790
|
+
constructor() {
|
|
5791
|
+
super();
|
|
5792
|
+
this.capabilities = [];
|
|
5793
|
+
this.orgName = "";
|
|
5794
|
+
this.headlineVerb = "";
|
|
5795
|
+
this.revocationPath = "Account \u2192 Connected Agents";
|
|
5796
|
+
this.inactivityDays = 90;
|
|
5797
|
+
this.fixedExpiry = false;
|
|
5798
|
+
this.theme = "light";
|
|
5799
|
+
this.howItWorksUrl = "";
|
|
5800
|
+
this.loading = false;
|
|
5801
|
+
this.disabled = false;
|
|
5802
|
+
this.description = "";
|
|
5803
|
+
this.submitLabel = "";
|
|
5804
|
+
this.cancelLabel = "";
|
|
5805
|
+
this.allSelected = false;
|
|
5806
|
+
this.allowDisabled = false;
|
|
5807
|
+
this.serverDomain = "";
|
|
5808
|
+
this.logoDevToken = "";
|
|
5809
|
+
this.serverLogoUrl = "";
|
|
5810
|
+
this.requireAll = false;
|
|
5811
|
+
this.selected = /* @__PURE__ */ new Set();
|
|
5812
|
+
/**
|
|
5813
|
+
* Last capability set this component seeded `selected` from, per
|
|
5814
|
+
* `capabilitySeedKey`. Re-seeding is keyed on this value rather than on
|
|
5815
|
+
* `capabilities` array identity — see `seedDefaults`.
|
|
5816
|
+
*/
|
|
5817
|
+
this.seedKey = "";
|
|
5818
|
+
this.onCapabilityToggle = (event) => {
|
|
5819
|
+
if (this.loading || this.disabled || !(event instanceof CustomEvent))
|
|
5820
|
+
return;
|
|
5821
|
+
const detail = event.detail;
|
|
5822
|
+
if (!detail || typeof detail !== "object" || !("id" in detail) || typeof detail.id !== "string" || !("checked" in detail) || typeof detail.checked !== "boolean" || !this.capabilities.some((capability) => capability.id === detail.id))
|
|
5823
|
+
return;
|
|
5824
|
+
const next = new Set(this.selected);
|
|
5825
|
+
if (detail.checked) next.add(detail.id);
|
|
5826
|
+
else next.delete(detail.id);
|
|
5827
|
+
this.selected = next;
|
|
5828
|
+
};
|
|
5829
|
+
this.onAllow = () => {
|
|
5830
|
+
if (this.loading || this.approvalDisabled) return;
|
|
5831
|
+
const selectedCapabilities = this.capabilities.filter(
|
|
5832
|
+
(c5) => this.selected.has(c5.id)
|
|
5833
|
+
);
|
|
5834
|
+
if (selectedCapabilities.length === 0) return;
|
|
5835
|
+
const selectedIds = selectedCapabilities.map((c5) => c5.id);
|
|
5836
|
+
const selectedScopes = Array.from(
|
|
5837
|
+
new Set(selectedCapabilities.flatMap((c5) => c5.scopes))
|
|
5838
|
+
);
|
|
5839
|
+
const terms = this.slottedTerms;
|
|
5840
|
+
const detail = {
|
|
5841
|
+
selectedCapabilityIds: selectedIds,
|
|
5842
|
+
selectedScopes,
|
|
5843
|
+
...terms.length > 0 ? { grantTerms: mergeGrantTerms(...terms.map((t7) => t7.grantTerms)) } : {}
|
|
5844
|
+
};
|
|
5845
|
+
this.dispatchEvent(
|
|
5846
|
+
new CustomEvent("capabilities-allow", {
|
|
5847
|
+
detail,
|
|
5848
|
+
bubbles: true,
|
|
5849
|
+
composed: true
|
|
5850
|
+
})
|
|
5851
|
+
);
|
|
5852
|
+
};
|
|
5853
|
+
this.onDeny = () => {
|
|
5854
|
+
if (this.loading) return;
|
|
5855
|
+
this.dispatchEvent(
|
|
5856
|
+
new CustomEvent("capabilities-deny", { bubbles: true, composed: true })
|
|
5857
|
+
);
|
|
5858
|
+
};
|
|
5859
|
+
const refresh = () => this.requestUpdate();
|
|
5860
|
+
this.addEventListener("consent-grant-terms-change", refresh);
|
|
5861
|
+
for (const type of GRANT_FIELD_EVENTS) this.addEventListener(type, refresh);
|
|
5862
|
+
}
|
|
5863
|
+
connectedCallback() {
|
|
5864
|
+
super.connectedCallback();
|
|
5865
|
+
this.seedDefaults();
|
|
5866
|
+
}
|
|
5867
|
+
willUpdate(changed) {
|
|
5868
|
+
if (changed.has("capabilities") || changed.has("allSelected")) {
|
|
5869
|
+
this.seedDefaults();
|
|
5870
|
+
}
|
|
5871
|
+
}
|
|
5872
|
+
/**
|
|
5873
|
+
* Seed `selected` from the capability defaults, but only when the
|
|
5874
|
+
* capability set actually changed. A parent that rebuilds its capability
|
|
5875
|
+
* array on every render (e.g. because a sibling `@state()` field changed)
|
|
5876
|
+
* produces a new array with the same contents on every keystroke; without
|
|
5877
|
+
* this guard `willUpdate` would re-seed on every one of those renders and
|
|
5878
|
+
* silently wipe whatever the user had already toggled.
|
|
5879
|
+
*/
|
|
5880
|
+
seedDefaults() {
|
|
5881
|
+
const key = capabilitySeedKey(this.capabilities, this.allSelected);
|
|
5882
|
+
if (key === this.seedKey) return;
|
|
5883
|
+
this.seedKey = key;
|
|
5884
|
+
this.selected = new Set(
|
|
5885
|
+
capabilityIdsFor(this.capabilities, this.allSelected)
|
|
5886
|
+
);
|
|
5887
|
+
}
|
|
5888
|
+
hostStyle() {
|
|
5889
|
+
return `:host { ${themeToCssVariables(getConsentTheme(this.theme))} }`;
|
|
5890
|
+
}
|
|
5891
|
+
/** Grant terms in the `details` slot. None when rendered without a DOM. */
|
|
5892
|
+
get slottedTerms() {
|
|
5893
|
+
return Array.from(this.children ?? []).filter(
|
|
5894
|
+
(el) => el.slot === "details" && "grantTerms" in el
|
|
5895
|
+
);
|
|
5896
|
+
}
|
|
5897
|
+
get approvalDisabled() {
|
|
5898
|
+
return this.disabled || this.allowDisabled || this.slottedTerms.some((terms) => terms.valid === false) || this.selected.size === 0 || this.requireAll && this.capabilities.some(
|
|
5899
|
+
(capability) => !this.selected.has(capability.id)
|
|
5900
|
+
);
|
|
5901
|
+
}
|
|
5902
|
+
compileCapabilityCedar(capability) {
|
|
5903
|
+
const cedar = capability.cedar?.trim() || "";
|
|
5904
|
+
if (!cedar) return "";
|
|
5905
|
+
if (!this.cedarContext) {
|
|
5906
|
+
return cedar;
|
|
5907
|
+
}
|
|
5908
|
+
try {
|
|
5909
|
+
return compileSingleCapability(
|
|
5910
|
+
{ ...capability, cedar },
|
|
5911
|
+
this.cedarContext
|
|
5912
|
+
);
|
|
5913
|
+
} catch {
|
|
5914
|
+
return cedar;
|
|
5915
|
+
}
|
|
5916
|
+
}
|
|
5917
|
+
/** The agent tile: from `agentIdentity` when it is set, else `agentMetadata`. */
|
|
5918
|
+
resolveAgent() {
|
|
5919
|
+
if (this.agentIdentity === void 0 || this.agentIdentity === null) {
|
|
5920
|
+
return this.agentMetadata;
|
|
5921
|
+
}
|
|
5922
|
+
try {
|
|
5923
|
+
return agentMetadataFromIdentity(this.agentIdentity);
|
|
5924
|
+
} catch {
|
|
5925
|
+
return void 0;
|
|
5926
|
+
}
|
|
5927
|
+
}
|
|
5928
|
+
render() {
|
|
5929
|
+
const tokens = CONSENT_COPY_TOKENS;
|
|
5930
|
+
const agent = this.resolveAgent();
|
|
5931
|
+
const agentName = agent?.name || "this agent";
|
|
5932
|
+
const sectionHeader = formatToken(tokens.section.capabilitiesHeader, {
|
|
5933
|
+
Agent: agentName.toUpperCase()
|
|
5934
|
+
});
|
|
5935
|
+
return b2`
|
|
5936
|
+
<style>
|
|
5937
|
+
${this.hostStyle()}
|
|
5938
|
+
</style>
|
|
5939
|
+
<consent-connector-header
|
|
5940
|
+
part="connector"
|
|
5941
|
+
clientName="${agent?.name || ""}"
|
|
5942
|
+
clientDid="${agent?.did || ""}"
|
|
5943
|
+
client-logo-url="${agent?.logoUrl || ""}"
|
|
5944
|
+
serverName="${this.orgName || ""}"
|
|
5945
|
+
server-logo-url="${this.serverLogoUrl}"
|
|
5946
|
+
server-domain="${this.serverDomain}"
|
|
5947
|
+
logo-dev-token="${this.logoDevToken}"
|
|
5948
|
+
></consent-connector-header>
|
|
5949
|
+
<div class="card" part="card">
|
|
5950
|
+
<consent-headline
|
|
5951
|
+
exportparts="eyebrow, headline, subhead"
|
|
5952
|
+
agent-name="${agent?.name ?? ""}"
|
|
5953
|
+
org-name="${this.orgName}"
|
|
5954
|
+
verb="${this.headlineVerb}"
|
|
5955
|
+
description="${this.description}"
|
|
5956
|
+
></consent-headline>
|
|
5957
|
+
<slot name="recovery"></slot>
|
|
5958
|
+
<slot name="identity"></slot>
|
|
5959
|
+
${agent ? b2`<consent-agent-header
|
|
5960
|
+
part="agent"
|
|
5961
|
+
agentName="${agent.name}"
|
|
5962
|
+
vendor="${agent.vendor || ""}"
|
|
5963
|
+
surfaceLabel="${agent.surfaceLabel || ""}"
|
|
5964
|
+
verification="${agentVerification(agent)}"
|
|
5965
|
+
domain="${agent.domain || ""}"
|
|
5966
|
+
logoUrl="${agent.logoUrl || ""}"
|
|
5967
|
+
connectedAt="${agent.connectedAt || ""}"
|
|
5968
|
+
></consent-agent-header>` : A}
|
|
5969
|
+
<slot name="agent-key"></slot>
|
|
5970
|
+
<div part="permissions">
|
|
5971
|
+
<div class="section-header">
|
|
5972
|
+
<span>${sectionHeader}</span>
|
|
5973
|
+
<span class="hint">${tokens.section.tapToToggle}</span>
|
|
5974
|
+
</div>
|
|
5975
|
+
<div class="rows" @capability-toggle=${this.onCapabilityToggle}>
|
|
5976
|
+
${this.capabilities.map(
|
|
5977
|
+
(capability) => b2`
|
|
5978
|
+
<consent-capability-card
|
|
5979
|
+
capabilityId="${capability.id}"
|
|
5980
|
+
label="${capability.label}"
|
|
5981
|
+
description="${capability.description}"
|
|
5982
|
+
icon="${capability.icon}"
|
|
5983
|
+
riskLevel="${capability.riskLevel}"
|
|
5984
|
+
?checked=${this.selected.has(capability.id)}
|
|
5985
|
+
?disabled=${this.loading || this.disabled}
|
|
5986
|
+
.scopes=${capability.scopes}
|
|
5987
|
+
compiled-cedar="${this.compileCapabilityCedar(capability)}"
|
|
5988
|
+
></consent-capability-card>
|
|
5989
|
+
`
|
|
5990
|
+
)}
|
|
5991
|
+
</div>
|
|
5992
|
+
</div>
|
|
5993
|
+
<slot name="auth"></slot>
|
|
5994
|
+
<slot name="details"></slot>
|
|
5995
|
+
<slot name="notice"
|
|
5996
|
+
><consent-revocation-notice
|
|
5997
|
+
revocationPath="${this.revocationPath}"
|
|
5998
|
+
orgName="${this.orgName || "this site"}"
|
|
5999
|
+
inactivityDays=${this.inactivityDays}
|
|
6000
|
+
?fixed-expiry=${this.fixedExpiry}
|
|
6001
|
+
fixed-expiry-days=${this.fixedExpiryDays ?? A}
|
|
6002
|
+
></consent-revocation-notice
|
|
6003
|
+
></slot>
|
|
6004
|
+
<consent-action-bar
|
|
6005
|
+
part="actions"
|
|
6006
|
+
agentName="${agentName}"
|
|
6007
|
+
theme="${this.theme}"
|
|
6008
|
+
?loading=${this.loading}
|
|
6009
|
+
?disabled=${this.approvalDisabled}
|
|
6010
|
+
submit-label=${this.submitLabel}
|
|
6011
|
+
cancel-label=${this.cancelLabel}
|
|
6012
|
+
exportparts="submit, cancel"
|
|
6013
|
+
@consent-allow=${this.onAllow}
|
|
6014
|
+
@consent-deny=${this.onDeny}
|
|
6015
|
+
></consent-action-bar>
|
|
6016
|
+
<slot name="footer"
|
|
6017
|
+
><consent-footer
|
|
6018
|
+
theme="${this.theme}"
|
|
6019
|
+
howItWorksUrl="${this.howItWorksUrl}"
|
|
6020
|
+
></consent-footer
|
|
6021
|
+
></slot>
|
|
6022
|
+
</div>
|
|
6023
|
+
`;
|
|
6024
|
+
}
|
|
6025
|
+
};
|
|
6026
|
+
ConsentCapabilitiesScreen.features = CONSENT_CAPABILITIES_FEATURES;
|
|
6027
|
+
ConsentCapabilitiesScreen.styles = i`
|
|
6028
|
+
:host {
|
|
6029
|
+
display: block;
|
|
6030
|
+
box-sizing: border-box;
|
|
6031
|
+
width: 100%;
|
|
6032
|
+
max-width: var(--cs-screen-max-width, 560px);
|
|
6033
|
+
margin: 0 auto;
|
|
6034
|
+
}
|
|
6035
|
+
|
|
6036
|
+
.card {
|
|
6037
|
+
min-width: 0;
|
|
6038
|
+
background: var(--cs-surface-card);
|
|
6039
|
+
border: 1px solid var(--cs-surface-border);
|
|
6040
|
+
border-radius: 22px;
|
|
6041
|
+
box-shadow: var(--cs-card-shadow);
|
|
6042
|
+
padding: var(--cs-card-padding, 28px 28px 22px);
|
|
6043
|
+
display: flex;
|
|
6044
|
+
flex-direction: column;
|
|
6045
|
+
gap: var(--cs-card-gap, 22px);
|
|
6046
|
+
color: var(--cs-text-primary);
|
|
6047
|
+
}
|
|
6048
|
+
|
|
6049
|
+
.section-header {
|
|
6050
|
+
display: flex;
|
|
6051
|
+
align-items: center;
|
|
6052
|
+
justify-content: space-between;
|
|
6053
|
+
font-size: 11px;
|
|
6054
|
+
letter-spacing: 0.14em;
|
|
6055
|
+
font-weight: 600;
|
|
6056
|
+
color: var(--cs-text-tertiary);
|
|
6057
|
+
text-transform: uppercase;
|
|
6058
|
+
gap: 12px;
|
|
6059
|
+
flex-wrap: wrap;
|
|
6060
|
+
}
|
|
6061
|
+
|
|
6062
|
+
.section-header .hint {
|
|
6063
|
+
letter-spacing: 0;
|
|
6064
|
+
font-weight: 400;
|
|
6065
|
+
text-transform: none;
|
|
6066
|
+
font-size: 12px;
|
|
6067
|
+
}
|
|
6068
|
+
|
|
6069
|
+
.rows {
|
|
6070
|
+
display: flex;
|
|
6071
|
+
flex-direction: column;
|
|
6072
|
+
}
|
|
6073
|
+
|
|
6074
|
+
@media (max-width: 480px) {
|
|
6075
|
+
.card {
|
|
6076
|
+
padding: var(--cs-card-padding-mobile, 20px 18px);
|
|
6077
|
+
}
|
|
6078
|
+
}
|
|
6079
|
+
`;
|
|
6080
|
+
__decorateClass([
|
|
6081
|
+
n4({ type: Array })
|
|
6082
|
+
], ConsentCapabilitiesScreen.prototype, "capabilities", 2);
|
|
6083
|
+
__decorateClass([
|
|
6084
|
+
n4({ type: Object })
|
|
6085
|
+
], ConsentCapabilitiesScreen.prototype, "agentMetadata", 2);
|
|
6086
|
+
__decorateClass([
|
|
6087
|
+
n4({ type: Object })
|
|
6088
|
+
], ConsentCapabilitiesScreen.prototype, "agentIdentity", 2);
|
|
6089
|
+
__decorateClass([
|
|
6090
|
+
n4({ type: Object })
|
|
6091
|
+
], ConsentCapabilitiesScreen.prototype, "cedarContext", 2);
|
|
6092
|
+
__decorateClass([
|
|
6093
|
+
n4({ type: String })
|
|
6094
|
+
], ConsentCapabilitiesScreen.prototype, "orgName", 2);
|
|
6095
|
+
__decorateClass([
|
|
6096
|
+
n4({ type: String })
|
|
6097
|
+
], ConsentCapabilitiesScreen.prototype, "headlineVerb", 2);
|
|
6098
|
+
__decorateClass([
|
|
6099
|
+
n4({ type: String })
|
|
6100
|
+
], ConsentCapabilitiesScreen.prototype, "revocationPath", 2);
|
|
6101
|
+
__decorateClass([
|
|
6102
|
+
n4({ type: Number })
|
|
6103
|
+
], ConsentCapabilitiesScreen.prototype, "inactivityDays", 2);
|
|
6104
|
+
__decorateClass([
|
|
6105
|
+
n4({ type: Boolean, attribute: "fixed-expiry" })
|
|
6106
|
+
], ConsentCapabilitiesScreen.prototype, "fixedExpiry", 2);
|
|
6107
|
+
__decorateClass([
|
|
6108
|
+
n4({ type: Number, attribute: "fixed-expiry-days" })
|
|
6109
|
+
], ConsentCapabilitiesScreen.prototype, "fixedExpiryDays", 2);
|
|
6110
|
+
__decorateClass([
|
|
6111
|
+
n4({ type: String })
|
|
6112
|
+
], ConsentCapabilitiesScreen.prototype, "theme", 2);
|
|
6113
|
+
__decorateClass([
|
|
6114
|
+
n4({ type: String, attribute: "how-it-works-url" })
|
|
6115
|
+
], ConsentCapabilitiesScreen.prototype, "howItWorksUrl", 2);
|
|
6116
|
+
__decorateClass([
|
|
6117
|
+
n4({ type: Boolean })
|
|
6118
|
+
], ConsentCapabilitiesScreen.prototype, "loading", 2);
|
|
6119
|
+
__decorateClass([
|
|
6120
|
+
n4({ type: Boolean })
|
|
6121
|
+
], ConsentCapabilitiesScreen.prototype, "disabled", 2);
|
|
6122
|
+
__decorateClass([
|
|
6123
|
+
n4({ type: String })
|
|
6124
|
+
], ConsentCapabilitiesScreen.prototype, "description", 2);
|
|
6125
|
+
__decorateClass([
|
|
6126
|
+
n4({ type: String, attribute: "submit-label" })
|
|
6127
|
+
], ConsentCapabilitiesScreen.prototype, "submitLabel", 2);
|
|
6128
|
+
__decorateClass([
|
|
6129
|
+
n4({ type: String, attribute: "cancel-label" })
|
|
6130
|
+
], ConsentCapabilitiesScreen.prototype, "cancelLabel", 2);
|
|
6131
|
+
__decorateClass([
|
|
6132
|
+
n4({ type: Boolean, reflect: true, attribute: "all-selected" })
|
|
6133
|
+
], ConsentCapabilitiesScreen.prototype, "allSelected", 2);
|
|
6134
|
+
__decorateClass([
|
|
6135
|
+
n4({ type: Boolean, attribute: "allow-disabled" })
|
|
6136
|
+
], ConsentCapabilitiesScreen.prototype, "allowDisabled", 2);
|
|
6137
|
+
__decorateClass([
|
|
6138
|
+
n4({ type: String, attribute: "server-domain" })
|
|
6139
|
+
], ConsentCapabilitiesScreen.prototype, "serverDomain", 2);
|
|
6140
|
+
__decorateClass([
|
|
6141
|
+
n4({ type: String, attribute: "logo-dev-token" })
|
|
6142
|
+
], ConsentCapabilitiesScreen.prototype, "logoDevToken", 2);
|
|
6143
|
+
__decorateClass([
|
|
6144
|
+
n4({ type: String, attribute: "server-logo-url" })
|
|
6145
|
+
], ConsentCapabilitiesScreen.prototype, "serverLogoUrl", 2);
|
|
6146
|
+
__decorateClass([
|
|
6147
|
+
n4({ type: Boolean, attribute: "require-all" })
|
|
6148
|
+
], ConsentCapabilitiesScreen.prototype, "requireAll", 2);
|
|
6149
|
+
__decorateClass([
|
|
6150
|
+
r5()
|
|
6151
|
+
], ConsentCapabilitiesScreen.prototype, "selected", 2);
|
|
6152
|
+
ConsentCapabilitiesScreen = __decorateClass([
|
|
6153
|
+
t3("consent-capabilities-screen")
|
|
6154
|
+
], ConsentCapabilitiesScreen);
|
|
6155
|
+
|
|
6156
|
+
// src/components/consent-revoke.ts
|
|
6157
|
+
var ConsentRevoke = class extends i4 {
|
|
6158
|
+
constructor() {
|
|
6159
|
+
super(...arguments);
|
|
6160
|
+
this.agentName = "";
|
|
6161
|
+
this.items = [];
|
|
6162
|
+
this.chained = false;
|
|
6163
|
+
this.loading = false;
|
|
6164
|
+
this.revoked = false;
|
|
6165
|
+
this.error = "";
|
|
6166
|
+
this.confirmLabel = "";
|
|
6167
|
+
this.keepLabel = "";
|
|
6168
|
+
}
|
|
6169
|
+
onConfirm() {
|
|
6170
|
+
if (this.loading) return;
|
|
6171
|
+
this.dispatchEvent(
|
|
6172
|
+
new CustomEvent("consent-revoke", { bubbles: true, composed: true })
|
|
6173
|
+
);
|
|
6174
|
+
}
|
|
6175
|
+
onKeep() {
|
|
6176
|
+
if (this.loading) return;
|
|
6177
|
+
this.dispatchEvent(
|
|
6178
|
+
new CustomEvent("consent-keep", { bubbles: true, composed: true })
|
|
6179
|
+
);
|
|
6180
|
+
}
|
|
6181
|
+
renderDone(agent) {
|
|
6182
|
+
const tokens = CONSENT_COPY_TOKENS.revoke;
|
|
6183
|
+
return b2`
|
|
6184
|
+
<div part="done" class="done" role="status">
|
|
6185
|
+
<svg
|
|
6186
|
+
class="check"
|
|
6187
|
+
viewBox="0 0 24 24"
|
|
6188
|
+
fill="none"
|
|
6189
|
+
stroke="currentColor"
|
|
6190
|
+
stroke-width="1.8"
|
|
6191
|
+
stroke-linecap="round"
|
|
6192
|
+
stroke-linejoin="round"
|
|
6193
|
+
aria-hidden="true"
|
|
6194
|
+
>
|
|
6195
|
+
<circle cx="12" cy="12" r="9.5" />
|
|
6196
|
+
<path d="M8 12.5l2.6 2.6L16 9.5" />
|
|
6197
|
+
</svg>
|
|
6198
|
+
<h2 part="title">${tokens.doneTitle}</h2>
|
|
6199
|
+
<p part="body" class="body">
|
|
6200
|
+
${formatToken(tokens.doneBodyTemplate, { Agent: agent })}
|
|
6201
|
+
</p>
|
|
6202
|
+
</div>
|
|
6203
|
+
`;
|
|
6204
|
+
}
|
|
6205
|
+
render() {
|
|
6206
|
+
const tokens = CONSENT_COPY_TOKENS.revoke;
|
|
6207
|
+
const agent = this.agentName.trim() || "this agent";
|
|
6208
|
+
if (this.revoked) return this.renderDone(agent);
|
|
6209
|
+
const items = this.items.filter((item) => item.trim() !== "");
|
|
6210
|
+
const chainedItem = this.chained ? formatToken(tokens.chainedItemTemplate, { Agent: agent }) : "";
|
|
6211
|
+
const ends = chainedItem ? [...items, chainedItem] : items;
|
|
6212
|
+
return b2`
|
|
6213
|
+
<div>
|
|
6214
|
+
<h2 part="title">
|
|
6215
|
+
${formatToken(tokens.titleTemplate, { Agent: agent })}
|
|
6216
|
+
</h2>
|
|
6217
|
+
<p part="body" class="body">
|
|
6218
|
+
${formatToken(tokens.bodyTemplate, { Agent: agent })}
|
|
6219
|
+
</p>
|
|
6220
|
+
</div>
|
|
6221
|
+
${ends.length > 0 ? b2`<div part="ends" class="ends">
|
|
6222
|
+
<p class="ends-title">${tokens.endsTitle}</p>
|
|
6223
|
+
<ul>
|
|
6224
|
+
${ends.map((item) => b2`<li part="item">${item}</li>`)}
|
|
6225
|
+
</ul>
|
|
6226
|
+
</div>` : A}
|
|
6227
|
+
${this.error ? b2`<p part="error" class="error" role="alert">${this.error}</p>` : A}
|
|
6228
|
+
<div class="actions">
|
|
6229
|
+
<button
|
|
6230
|
+
part="confirm"
|
|
6231
|
+
class="confirm"
|
|
6232
|
+
type="button"
|
|
6233
|
+
?disabled=${this.loading}
|
|
6234
|
+
aria-busy=${this.loading ? "true" : "false"}
|
|
6235
|
+
@click=${this.onConfirm}
|
|
6236
|
+
>
|
|
6237
|
+
${this.loading ? tokens.working : this.confirmLabel || tokens.confirm}
|
|
6238
|
+
</button>
|
|
6239
|
+
<button
|
|
6240
|
+
part="keep"
|
|
6241
|
+
class="keep"
|
|
6242
|
+
type="button"
|
|
6243
|
+
?disabled=${this.loading}
|
|
6244
|
+
@click=${this.onKeep}
|
|
6245
|
+
>
|
|
6246
|
+
${this.keepLabel || tokens.keep}
|
|
6247
|
+
</button>
|
|
6248
|
+
</div>
|
|
6249
|
+
`;
|
|
6250
|
+
}
|
|
6251
|
+
};
|
|
6252
|
+
ConsentRevoke.styles = i`
|
|
6253
|
+
:host {
|
|
6254
|
+
display: grid;
|
|
6255
|
+
gap: 16px;
|
|
6256
|
+
color: var(--cs-text-primary, #0f172a);
|
|
6257
|
+
font-family: inherit;
|
|
6258
|
+
}
|
|
6259
|
+
|
|
6260
|
+
:host([hidden]) {
|
|
6261
|
+
display: none;
|
|
6262
|
+
}
|
|
6263
|
+
|
|
6264
|
+
h2 {
|
|
6265
|
+
margin: 0;
|
|
6266
|
+
font-size: var(--cs-revoke-title-font-size, 19px);
|
|
6267
|
+
font-weight: 600;
|
|
6268
|
+
letter-spacing: -0.01em;
|
|
6269
|
+
line-height: 1.3;
|
|
6270
|
+
}
|
|
6271
|
+
|
|
6272
|
+
.body {
|
|
6273
|
+
margin: 6px 0 0;
|
|
6274
|
+
color: var(--cs-text-secondary, #334155);
|
|
6275
|
+
font-size: 14px;
|
|
6276
|
+
line-height: 1.5;
|
|
6277
|
+
}
|
|
6278
|
+
|
|
6279
|
+
.ends {
|
|
6280
|
+
display: grid;
|
|
6281
|
+
gap: 8px;
|
|
6282
|
+
padding: 12px 14px;
|
|
6283
|
+
border-radius: 12px;
|
|
6284
|
+
background: var(--cs-surface-inset, #f1ece2);
|
|
6285
|
+
}
|
|
6286
|
+
|
|
6287
|
+
.ends-title {
|
|
6288
|
+
margin: 0;
|
|
6289
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
6290
|
+
font-size: 12px;
|
|
6291
|
+
font-weight: 500;
|
|
6292
|
+
}
|
|
6293
|
+
|
|
6294
|
+
ul {
|
|
6295
|
+
display: grid;
|
|
6296
|
+
gap: 6px;
|
|
6297
|
+
margin: 0;
|
|
6298
|
+
padding: 0;
|
|
6299
|
+
list-style: none;
|
|
6300
|
+
}
|
|
6301
|
+
|
|
6302
|
+
li {
|
|
6303
|
+
display: flex;
|
|
6304
|
+
align-items: baseline;
|
|
6305
|
+
gap: 8px;
|
|
6306
|
+
color: var(--cs-text-primary, #0f172a);
|
|
6307
|
+
font-size: 13.5px;
|
|
6308
|
+
line-height: 1.45;
|
|
6309
|
+
}
|
|
6310
|
+
|
|
6311
|
+
li::before {
|
|
6312
|
+
content: "";
|
|
6313
|
+
width: 6px;
|
|
6314
|
+
height: 6px;
|
|
6315
|
+
flex-shrink: 0;
|
|
6316
|
+
border-radius: 999px;
|
|
6317
|
+
background: var(--cs-danger, #b42318);
|
|
6318
|
+
transform: translateY(-1px);
|
|
6319
|
+
}
|
|
6320
|
+
|
|
6321
|
+
.actions {
|
|
6322
|
+
display: grid;
|
|
6323
|
+
gap: 4px;
|
|
6324
|
+
}
|
|
6325
|
+
|
|
6326
|
+
button {
|
|
6327
|
+
width: 100%;
|
|
6328
|
+
padding: 13px 18px;
|
|
6329
|
+
border: none;
|
|
6330
|
+
border-radius: 999px;
|
|
6331
|
+
font: inherit;
|
|
6332
|
+
font-size: var(--cs-action-font-size, 15px);
|
|
6333
|
+
font-weight: 500;
|
|
6334
|
+
cursor: pointer;
|
|
6335
|
+
transition: opacity 0.15s ease;
|
|
6336
|
+
}
|
|
6337
|
+
|
|
6338
|
+
button:disabled {
|
|
6339
|
+
cursor: not-allowed;
|
|
6340
|
+
opacity: 0.55;
|
|
6341
|
+
}
|
|
6342
|
+
|
|
6343
|
+
button:focus-visible {
|
|
6344
|
+
outline: 2px solid var(--cs-focus-ring, #0f172a);
|
|
6345
|
+
outline-offset: 3px;
|
|
6346
|
+
}
|
|
6347
|
+
|
|
6348
|
+
.confirm {
|
|
6349
|
+
background: var(--cs-danger, #b42318);
|
|
6350
|
+
color: var(--cs-danger-text, #ffffff);
|
|
6351
|
+
}
|
|
6352
|
+
|
|
6353
|
+
.confirm:hover:not(:disabled) {
|
|
6354
|
+
opacity: 0.92;
|
|
6355
|
+
}
|
|
6356
|
+
|
|
6357
|
+
.keep {
|
|
6358
|
+
padding: 10px 18px;
|
|
6359
|
+
background: transparent;
|
|
6360
|
+
color: var(--cs-text-secondary, #334155);
|
|
6361
|
+
}
|
|
6362
|
+
|
|
6363
|
+
.keep:hover:not(:disabled) {
|
|
6364
|
+
color: var(--cs-text-primary, #0f172a);
|
|
6365
|
+
}
|
|
6366
|
+
|
|
6367
|
+
.error {
|
|
6368
|
+
margin: 0;
|
|
6369
|
+
color: var(--cs-danger, #b42318);
|
|
6370
|
+
font-size: 13px;
|
|
6371
|
+
font-weight: 500;
|
|
6372
|
+
line-height: 1.45;
|
|
6373
|
+
}
|
|
6374
|
+
|
|
6375
|
+
.done {
|
|
6376
|
+
display: grid;
|
|
6377
|
+
justify-items: start;
|
|
6378
|
+
gap: 6px;
|
|
6379
|
+
}
|
|
6380
|
+
|
|
6381
|
+
.check {
|
|
6382
|
+
width: 28px;
|
|
6383
|
+
height: 28px;
|
|
6384
|
+
margin-bottom: 4px;
|
|
6385
|
+
color: var(--cs-allow, #15803d);
|
|
6386
|
+
}
|
|
6387
|
+
`;
|
|
6388
|
+
__decorateClass([
|
|
6389
|
+
n4({ type: String, attribute: "agent-name" })
|
|
6390
|
+
], ConsentRevoke.prototype, "agentName", 2);
|
|
6391
|
+
__decorateClass([
|
|
6392
|
+
n4({ type: Array })
|
|
6393
|
+
], ConsentRevoke.prototype, "items", 2);
|
|
6394
|
+
__decorateClass([
|
|
6395
|
+
n4({ type: Boolean, reflect: true })
|
|
6396
|
+
], ConsentRevoke.prototype, "chained", 2);
|
|
6397
|
+
__decorateClass([
|
|
6398
|
+
n4({ type: Boolean, reflect: true })
|
|
6399
|
+
], ConsentRevoke.prototype, "loading", 2);
|
|
6400
|
+
__decorateClass([
|
|
6401
|
+
n4({ type: Boolean, reflect: true })
|
|
6402
|
+
], ConsentRevoke.prototype, "revoked", 2);
|
|
6403
|
+
__decorateClass([
|
|
6404
|
+
n4({ type: String })
|
|
6405
|
+
], ConsentRevoke.prototype, "error", 2);
|
|
6406
|
+
__decorateClass([
|
|
6407
|
+
n4({ type: String, attribute: "confirm-label" })
|
|
6408
|
+
], ConsentRevoke.prototype, "confirmLabel", 2);
|
|
6409
|
+
__decorateClass([
|
|
6410
|
+
n4({ type: String, attribute: "keep-label" })
|
|
6411
|
+
], ConsentRevoke.prototype, "keepLabel", 2);
|
|
6412
|
+
ConsentRevoke = __decorateClass([
|
|
6413
|
+
t3("consent-revoke")
|
|
6414
|
+
], ConsentRevoke);
|
|
6415
|
+
|
|
6416
|
+
// src/components/wallet-globe.ts
|
|
6417
|
+
var POINTS = 460;
|
|
6418
|
+
var RADIUS = 0.94;
|
|
6419
|
+
var TILT = 0.42;
|
|
6420
|
+
var TURNING = 2 * Math.PI / 26e3;
|
|
6421
|
+
var EASE_MS = 420;
|
|
6422
|
+
var AT_REST = TURNING / 60;
|
|
6423
|
+
var DOT_BACK = 0.014;
|
|
6424
|
+
var DOT_FRONT = 0.034;
|
|
6425
|
+
var NO_GLOBE = { turn() {
|
|
6426
|
+
}, stop() {
|
|
6427
|
+
} };
|
|
6428
|
+
function lattice(count) {
|
|
6429
|
+
const points = new Float32Array(count * 3);
|
|
6430
|
+
const golden = Math.PI * (3 - Math.sqrt(5));
|
|
6431
|
+
for (let i7 = 0; i7 < count; i7++) {
|
|
6432
|
+
const y4 = 1 - 2 * (i7 + 0.5) / count;
|
|
6433
|
+
const ring = Math.sqrt(1 - y4 * y4);
|
|
6434
|
+
const around = i7 * golden;
|
|
6435
|
+
points[i7 * 3] = Math.cos(around) * ring;
|
|
6436
|
+
points[i7 * 3 + 1] = y4;
|
|
6437
|
+
points[i7 * 3 + 2] = Math.sin(around) * ring;
|
|
6438
|
+
}
|
|
6439
|
+
return points;
|
|
6440
|
+
}
|
|
6441
|
+
function drawGlobe(canvas) {
|
|
6442
|
+
const ctx = canvas.getContext?.("2d");
|
|
6443
|
+
if (!ctx) return NO_GLOBE;
|
|
6444
|
+
const points = lattice(POINTS);
|
|
6445
|
+
const reducedMotion = globalThis.matchMedia?.(
|
|
6446
|
+
"(prefers-reduced-motion: reduce)"
|
|
6447
|
+
);
|
|
6448
|
+
const tiltCos = Math.cos(TILT);
|
|
6449
|
+
const tiltSin = Math.sin(TILT);
|
|
6450
|
+
let angle = 0.6;
|
|
6451
|
+
let speed = 0;
|
|
6452
|
+
let wanted = 0;
|
|
6453
|
+
let frame = 0;
|
|
6454
|
+
let last = 0;
|
|
6455
|
+
let inView = true;
|
|
6456
|
+
let pageShown = !document.hidden;
|
|
6457
|
+
let layoutWidth = 0;
|
|
6458
|
+
function devicePixels() {
|
|
6459
|
+
const css = layoutWidth || parseFloat(getComputedStyle(canvas).width) || canvas.clientWidth;
|
|
6460
|
+
return Math.max(1, Math.round(css * (globalThis.devicePixelRatio || 1)));
|
|
6461
|
+
}
|
|
6462
|
+
function draw() {
|
|
6463
|
+
const px = devicePixels();
|
|
6464
|
+
if (canvas.width !== px || canvas.height !== px) {
|
|
6465
|
+
canvas.width = px;
|
|
6466
|
+
canvas.height = px;
|
|
6467
|
+
}
|
|
6468
|
+
const half = px / 2;
|
|
6469
|
+
const radius = half * RADIUS;
|
|
6470
|
+
ctx.clearRect(0, 0, px, px);
|
|
6471
|
+
ctx.fillStyle = getComputedStyle(canvas).color;
|
|
6472
|
+
const cos = Math.cos(angle);
|
|
6473
|
+
const sin = Math.sin(angle);
|
|
6474
|
+
for (const front of [false, true]) {
|
|
6475
|
+
for (let i7 = 0; i7 < POINTS; i7++) {
|
|
6476
|
+
const x3 = points[i7 * 3];
|
|
6477
|
+
const y4 = points[i7 * 3 + 1];
|
|
6478
|
+
const z3 = points[i7 * 3 + 2];
|
|
6479
|
+
const tx = x3 * cos + z3 * sin;
|
|
6480
|
+
const tz = z3 * cos - x3 * sin;
|
|
6481
|
+
const ty = y4 * tiltCos - tz * tiltSin;
|
|
6482
|
+
const depth = y4 * tiltSin + tz * tiltCos;
|
|
6483
|
+
if (depth >= 0 !== front) continue;
|
|
6484
|
+
const near = (depth + 1) / 2;
|
|
6485
|
+
ctx.globalAlpha = front ? 0.3 + 0.7 * near ** 1.6 : 0.06 + 0.16 * near;
|
|
6486
|
+
ctx.beginPath();
|
|
6487
|
+
ctx.arc(
|
|
6488
|
+
half + tx * radius,
|
|
6489
|
+
half - ty * radius,
|
|
6490
|
+
radius * (DOT_BACK + (DOT_FRONT - DOT_BACK) * near),
|
|
6491
|
+
0,
|
|
6492
|
+
2 * Math.PI
|
|
6493
|
+
);
|
|
6494
|
+
ctx.fill();
|
|
6495
|
+
}
|
|
6496
|
+
}
|
|
6497
|
+
ctx.globalAlpha = 1;
|
|
6498
|
+
}
|
|
6499
|
+
function loop(now) {
|
|
6500
|
+
const elapsed = last ? Math.min(now - last, 100) : 0;
|
|
6501
|
+
last = now;
|
|
6502
|
+
speed += (wanted - speed) * (1 - Math.exp(-elapsed / EASE_MS));
|
|
6503
|
+
if (!wanted && speed < AT_REST) speed = 0;
|
|
6504
|
+
angle += speed * elapsed;
|
|
6505
|
+
draw();
|
|
6506
|
+
frame = speed || wanted ? requestAnimationFrame(loop) : 0;
|
|
6507
|
+
}
|
|
6508
|
+
function sync() {
|
|
6509
|
+
const still = Boolean(reducedMotion?.matches);
|
|
6510
|
+
if (still) speed = 0;
|
|
6511
|
+
const run = inView && pageShown && !still && Boolean(speed || wanted);
|
|
6512
|
+
if (run && !frame) {
|
|
6513
|
+
last = 0;
|
|
6514
|
+
frame = requestAnimationFrame(loop);
|
|
6515
|
+
} else if (!run) {
|
|
6516
|
+
if (frame) cancelAnimationFrame(frame);
|
|
6517
|
+
frame = 0;
|
|
6518
|
+
draw();
|
|
6519
|
+
}
|
|
6520
|
+
}
|
|
6521
|
+
const onVisibility = () => {
|
|
6522
|
+
pageShown = !document.hidden;
|
|
6523
|
+
sync();
|
|
6524
|
+
};
|
|
6525
|
+
document.addEventListener("visibilitychange", onVisibility);
|
|
6526
|
+
reducedMotion?.addEventListener?.("change", sync);
|
|
6527
|
+
const onInk = (event) => {
|
|
6528
|
+
if (event.propertyName === "color" && !frame) draw();
|
|
6529
|
+
};
|
|
6530
|
+
canvas.addEventListener("transitionend", onInk);
|
|
6531
|
+
const seen = typeof IntersectionObserver === "function" ? new IntersectionObserver((entries) => {
|
|
6532
|
+
inView = entries.some((entry) => entry.isIntersecting);
|
|
6533
|
+
sync();
|
|
6534
|
+
}) : void 0;
|
|
6535
|
+
seen?.observe(canvas);
|
|
6536
|
+
const resized = typeof ResizeObserver === "function" ? new ResizeObserver(([entry]) => {
|
|
6537
|
+
layoutWidth = entry?.contentRect.width || layoutWidth;
|
|
6538
|
+
if (!frame) draw();
|
|
6539
|
+
}) : void 0;
|
|
6540
|
+
resized?.observe(canvas);
|
|
6541
|
+
sync();
|
|
6542
|
+
return {
|
|
6543
|
+
turn(on) {
|
|
6544
|
+
wanted = on ? TURNING : 0;
|
|
6545
|
+
sync();
|
|
6546
|
+
},
|
|
6547
|
+
stop() {
|
|
6548
|
+
if (frame) cancelAnimationFrame(frame);
|
|
6549
|
+
frame = 0;
|
|
6550
|
+
document.removeEventListener("visibilitychange", onVisibility);
|
|
6551
|
+
reducedMotion?.removeEventListener?.("change", sync);
|
|
6552
|
+
canvas.removeEventListener("transitionend", onInk);
|
|
6553
|
+
seen?.disconnect();
|
|
6554
|
+
resized?.disconnect();
|
|
6555
|
+
}
|
|
6556
|
+
};
|
|
6557
|
+
}
|
|
6558
|
+
|
|
6559
|
+
// src/components/wallet-status.ts
|
|
6560
|
+
var WALLET_CHECK_STATUSES = [
|
|
6561
|
+
"checking",
|
|
6562
|
+
"syncing",
|
|
6563
|
+
"ready",
|
|
6564
|
+
"conflict",
|
|
6565
|
+
"error"
|
|
6566
|
+
];
|
|
6567
|
+
function readWalletStatus(status) {
|
|
6568
|
+
return WALLET_CHECK_STATUSES.includes(status) ? status : "checking";
|
|
6569
|
+
}
|
|
6570
|
+
var WALLET_ORB_STATUSES = ["idle", ...WALLET_CHECK_STATUSES];
|
|
6571
|
+
function readWalletOrbStatus(status) {
|
|
6572
|
+
return status === "idle" ? "idle" : readWalletStatus(status);
|
|
6573
|
+
}
|
|
6574
|
+
|
|
6575
|
+
// src/components/consent-wallet-orb.ts
|
|
6576
|
+
var TICK_COUNT = 48;
|
|
6577
|
+
var TICKS = Array.from({ length: TICK_COUNT }, (_3, i7) => {
|
|
6578
|
+
const turn = i7 / TICK_COUNT * 2 * Math.PI;
|
|
6579
|
+
const at = (radius) => [
|
|
6580
|
+
(50 + radius * Math.sin(turn)).toFixed(2),
|
|
6581
|
+
(50 - radius * Math.cos(turn)).toFixed(2)
|
|
6582
|
+
];
|
|
6583
|
+
const [x1, y1] = at(48);
|
|
6584
|
+
const [x22, y22] = at(43);
|
|
6585
|
+
return w`<line class="tick" x1=${x1} y1=${y1} x2=${x22} y2=${y22}></line>`;
|
|
6586
|
+
});
|
|
6587
|
+
var TICK_ORDER = r(
|
|
6588
|
+
Array.from(
|
|
6589
|
+
{ length: TICK_COUNT },
|
|
6590
|
+
(_3, i7) => `.tick:nth-child(${i7 + 1}){--n:${i7}}`
|
|
6591
|
+
).join("")
|
|
6592
|
+
);
|
|
6593
|
+
function turning(status) {
|
|
6594
|
+
return status === "idle" || status === "checking" || status === "syncing";
|
|
6595
|
+
}
|
|
6596
|
+
var ConsentWalletOrb = class extends i4 {
|
|
6597
|
+
constructor() {
|
|
6598
|
+
super(...arguments);
|
|
6599
|
+
this.status = "checking";
|
|
6600
|
+
}
|
|
6601
|
+
connectedCallback() {
|
|
6602
|
+
super.connectedCallback();
|
|
6603
|
+
if (this.hasUpdated) this.startGlobe();
|
|
6604
|
+
}
|
|
6605
|
+
disconnectedCallback() {
|
|
6606
|
+
super.disconnectedCallback();
|
|
6607
|
+
this.globe?.stop();
|
|
6608
|
+
this.globe = void 0;
|
|
6609
|
+
}
|
|
6610
|
+
firstUpdated(changed) {
|
|
6611
|
+
super.firstUpdated(changed);
|
|
6612
|
+
this.startGlobe();
|
|
6613
|
+
}
|
|
6614
|
+
updated(changed) {
|
|
6615
|
+
super.updated(changed);
|
|
6616
|
+
if (changed.has("status")) {
|
|
6617
|
+
this.globe?.turn(turning(readWalletOrbStatus(this.status)));
|
|
6618
|
+
}
|
|
6619
|
+
}
|
|
6620
|
+
startGlobe() {
|
|
6621
|
+
if (!this.canvas || this.globe) return;
|
|
6622
|
+
this.globe = drawGlobe(this.canvas);
|
|
6623
|
+
this.globe.turn(turning(readWalletOrbStatus(this.status)));
|
|
6624
|
+
}
|
|
6625
|
+
render() {
|
|
6626
|
+
const status = readWalletOrbStatus(this.status);
|
|
6627
|
+
return b2`
|
|
6628
|
+
<div part="frame" class="frame" data-status=${status} aria-hidden="true">
|
|
6629
|
+
<canvas part="globe" class="globe"></canvas>
|
|
6630
|
+
<svg part="dial" class="dial" viewBox="0 0 100 100">${TICKS}</svg>
|
|
6631
|
+
<svg class="mark" viewBox="0 0 100 100">
|
|
6632
|
+
<path
|
|
6633
|
+
part="check"
|
|
6634
|
+
class="check"
|
|
6635
|
+
d="M35.5 50 45.5 60 65 40.5"
|
|
6636
|
+
pathLength="1"
|
|
6637
|
+
></path>
|
|
6638
|
+
</svg>
|
|
6639
|
+
</div>
|
|
6640
|
+
`;
|
|
6641
|
+
}
|
|
6642
|
+
};
|
|
6643
|
+
ConsentWalletOrb.styles = i`
|
|
6644
|
+
:host {
|
|
6645
|
+
display: inline-block;
|
|
6646
|
+
width: var(--cs-wallet-orb-size, 80px);
|
|
6647
|
+
height: var(--cs-wallet-orb-size, 80px);
|
|
6648
|
+
flex: none;
|
|
6649
|
+
vertical-align: middle;
|
|
6650
|
+
}
|
|
6651
|
+
|
|
6652
|
+
:host([hidden]) {
|
|
6653
|
+
display: none;
|
|
6654
|
+
}
|
|
6655
|
+
|
|
6656
|
+
.frame {
|
|
6657
|
+
--_ink: var(--cs-wallet-accent, var(--cs-surface-accent, #0f172a));
|
|
6658
|
+
--_success: var(--cs-wallet-success, #10b981);
|
|
6659
|
+
--_muted: var(--cs-wallet-muted, var(--cs-text-tertiary, #64748b));
|
|
6660
|
+
position: relative;
|
|
6661
|
+
width: 100%;
|
|
6662
|
+
height: 100%;
|
|
6663
|
+
}
|
|
6664
|
+
|
|
6665
|
+
.globe,
|
|
6666
|
+
.dial,
|
|
6667
|
+
.mark {
|
|
6668
|
+
position: absolute;
|
|
6669
|
+
display: block;
|
|
6670
|
+
pointer-events: none;
|
|
6671
|
+
}
|
|
6672
|
+
|
|
6673
|
+
.globe {
|
|
6674
|
+
inset: 14%;
|
|
6675
|
+
width: 72%;
|
|
6676
|
+
height: 72%;
|
|
6677
|
+
color: var(--_ink);
|
|
6678
|
+
/* The 1ms colour transition tells the globe its ink changed. */
|
|
6679
|
+
transition:
|
|
6680
|
+
color 1ms linear,
|
|
6681
|
+
opacity 0.45s ease;
|
|
6682
|
+
}
|
|
6683
|
+
|
|
6684
|
+
.dial,
|
|
6685
|
+
.mark {
|
|
6686
|
+
inset: 0;
|
|
6687
|
+
width: 100%;
|
|
6688
|
+
height: 100%;
|
|
6689
|
+
overflow: visible;
|
|
6690
|
+
}
|
|
6691
|
+
|
|
6692
|
+
.tick {
|
|
6693
|
+
stroke: var(--_ink);
|
|
6694
|
+
stroke-width: 1.6;
|
|
6695
|
+
stroke-linecap: round;
|
|
6696
|
+
opacity: 0.16;
|
|
6697
|
+
transition:
|
|
6698
|
+
stroke 0.2s ease,
|
|
6699
|
+
opacity 0.2s ease;
|
|
6700
|
+
}
|
|
6701
|
+
|
|
6702
|
+
${TICK_ORDER}
|
|
6703
|
+
|
|
6704
|
+
[data-status="checking"] .tick {
|
|
6705
|
+
animation: light 1.6s linear infinite;
|
|
6706
|
+
animation-delay: calc((var(--n) / 48 - 1) * 1.6s);
|
|
6707
|
+
}
|
|
6708
|
+
|
|
6709
|
+
[data-status="syncing"] .tick {
|
|
6710
|
+
animation: light 1.6s linear infinite;
|
|
6711
|
+
animation-delay: calc(var(--n) / 48 * -1.6s);
|
|
6712
|
+
}
|
|
6713
|
+
|
|
6714
|
+
[data-status="ready"] .tick {
|
|
6715
|
+
stroke: var(--_success);
|
|
6716
|
+
opacity: 1;
|
|
6717
|
+
transition-delay: calc(var(--n) * 9ms);
|
|
6718
|
+
}
|
|
6719
|
+
|
|
6720
|
+
[data-status="conflict"] .tick,
|
|
6721
|
+
[data-status="error"] .tick {
|
|
6722
|
+
stroke: var(--_muted);
|
|
6723
|
+
opacity: 0.5;
|
|
6724
|
+
}
|
|
6725
|
+
|
|
6726
|
+
/* The gap at 12 o'clock: the middle tick and two either side. */
|
|
6727
|
+
[data-status="conflict"] .tick:is(:nth-child(-n + 3), :nth-child(n + 47)),
|
|
6728
|
+
[data-status="error"] .tick:is(:nth-child(-n + 3), :nth-child(n + 47)) {
|
|
6729
|
+
opacity: 0;
|
|
6730
|
+
}
|
|
6731
|
+
|
|
6732
|
+
[data-status="ready"] .globe {
|
|
6733
|
+
opacity: 0.16;
|
|
6734
|
+
}
|
|
6735
|
+
|
|
6736
|
+
[data-status="conflict"] .globe,
|
|
6737
|
+
[data-status="error"] .globe {
|
|
6738
|
+
color: var(--_muted);
|
|
6739
|
+
opacity: 0.75;
|
|
6740
|
+
}
|
|
6741
|
+
|
|
6742
|
+
.check {
|
|
6743
|
+
fill: none;
|
|
6744
|
+
stroke: var(--_success);
|
|
6745
|
+
stroke-width: 4;
|
|
6746
|
+
stroke-linecap: round;
|
|
6747
|
+
stroke-linejoin: round;
|
|
6748
|
+
/* A dash as long as the path, then a longer gap: drawn from nothing. */
|
|
6749
|
+
stroke-dasharray: 1 2;
|
|
6750
|
+
stroke-dashoffset: 1;
|
|
6751
|
+
opacity: 0;
|
|
6752
|
+
transition:
|
|
6753
|
+
stroke-dashoffset 0.38s cubic-bezier(0.65, 0, 0.35, 1),
|
|
6754
|
+
opacity 0.1s linear;
|
|
6755
|
+
}
|
|
6756
|
+
|
|
6757
|
+
[data-status="ready"] .check {
|
|
6758
|
+
stroke-dashoffset: 0;
|
|
6759
|
+
opacity: 1;
|
|
6760
|
+
transition-delay: 0.22s;
|
|
6761
|
+
}
|
|
6762
|
+
|
|
6763
|
+
@keyframes light {
|
|
6764
|
+
0% {
|
|
6765
|
+
opacity: 1;
|
|
6766
|
+
}
|
|
6767
|
+
40%,
|
|
6768
|
+
100% {
|
|
6769
|
+
opacity: 0.16;
|
|
6770
|
+
}
|
|
6771
|
+
}
|
|
6772
|
+
|
|
6773
|
+
/* As specific as the rules they undo ([data-status] .tick). */
|
|
6774
|
+
@media (prefers-reduced-motion: reduce) {
|
|
6775
|
+
.frame[data-status] .tick {
|
|
6776
|
+
animation: none;
|
|
6777
|
+
transition: none;
|
|
6778
|
+
}
|
|
6779
|
+
|
|
6780
|
+
.frame[data-status="checking"] .tick,
|
|
6781
|
+
.frame[data-status="syncing"] .tick {
|
|
6782
|
+
opacity: 0.4;
|
|
6783
|
+
}
|
|
6784
|
+
|
|
6785
|
+
.frame[data-status] .globe {
|
|
6786
|
+
transition: color 1ms linear;
|
|
6787
|
+
}
|
|
6788
|
+
|
|
6789
|
+
.frame[data-status] .check {
|
|
6790
|
+
transition: none;
|
|
6791
|
+
}
|
|
6792
|
+
}
|
|
6793
|
+
`;
|
|
6794
|
+
__decorateClass([
|
|
6795
|
+
n4({ type: String, reflect: true })
|
|
6796
|
+
], ConsentWalletOrb.prototype, "status", 2);
|
|
6797
|
+
__decorateClass([
|
|
6798
|
+
e5("canvas")
|
|
6799
|
+
], ConsentWalletOrb.prototype, "canvas", 2);
|
|
6800
|
+
ConsentWalletOrb = __decorateClass([
|
|
6801
|
+
t3("consent-wallet-orb")
|
|
6802
|
+
], ConsentWalletOrb);
|
|
6803
|
+
|
|
6804
|
+
// src/components/consent-wallet-check.ts
|
|
6805
|
+
var ConsentWalletCheck = class extends i4 {
|
|
6806
|
+
constructor() {
|
|
6807
|
+
super(...arguments);
|
|
6808
|
+
this.status = "checking";
|
|
6809
|
+
this.caption = "";
|
|
6810
|
+
}
|
|
6811
|
+
render() {
|
|
6812
|
+
const status = readWalletStatus(this.status);
|
|
6813
|
+
return b2`
|
|
6814
|
+
<div part="frame" class="frame">
|
|
6815
|
+
<consent-wallet-orb
|
|
6816
|
+
part="orb"
|
|
6817
|
+
exportparts="globe, dial, check"
|
|
6818
|
+
aria-hidden="true"
|
|
6819
|
+
.status=${status}
|
|
6820
|
+
></consent-wallet-orb>
|
|
6821
|
+
<p part="caption" class="caption" aria-live="polite">
|
|
6822
|
+
${this.caption || CONSENT_COPY_TOKENS.wallet.check[status]}
|
|
6823
|
+
</p>
|
|
6824
|
+
</div>
|
|
6825
|
+
`;
|
|
6826
|
+
}
|
|
6827
|
+
};
|
|
6828
|
+
ConsentWalletCheck.styles = i`
|
|
6829
|
+
:host {
|
|
6830
|
+
display: block;
|
|
6831
|
+
font-family: inherit;
|
|
6832
|
+
}
|
|
6833
|
+
|
|
6834
|
+
:host([hidden]) {
|
|
6835
|
+
display: none;
|
|
6836
|
+
}
|
|
6837
|
+
|
|
6838
|
+
.frame {
|
|
6839
|
+
display: flex;
|
|
6840
|
+
flex-direction: column;
|
|
6841
|
+
align-items: center;
|
|
6842
|
+
gap: 8px;
|
|
6843
|
+
padding: 8px 0;
|
|
6844
|
+
text-align: center;
|
|
6845
|
+
}
|
|
6846
|
+
|
|
6847
|
+
.caption {
|
|
6848
|
+
margin: 0;
|
|
6849
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
6850
|
+
font-size: 12px;
|
|
6851
|
+
line-height: 1.35;
|
|
6852
|
+
}
|
|
6853
|
+
`;
|
|
6854
|
+
__decorateClass([
|
|
6855
|
+
n4({ type: String, reflect: true })
|
|
6856
|
+
], ConsentWalletCheck.prototype, "status", 2);
|
|
6857
|
+
__decorateClass([
|
|
6858
|
+
n4({ type: String })
|
|
6859
|
+
], ConsentWalletCheck.prototype, "caption", 2);
|
|
6860
|
+
ConsentWalletCheck = __decorateClass([
|
|
6861
|
+
t3("consent-wallet-check")
|
|
6862
|
+
], ConsentWalletCheck);
|
|
6863
|
+
|
|
6864
|
+
// src/components/template-link.ts
|
|
6865
|
+
function templateWithLink(template, values, link) {
|
|
6866
|
+
const placeholder = `{${link.key}}`;
|
|
6867
|
+
const at = template.indexOf(placeholder);
|
|
6868
|
+
if (at === -1) return b2`${formatToken(template, values)}`;
|
|
6869
|
+
const before = formatToken(template.slice(0, at), values);
|
|
6870
|
+
const after = formatToken(template.slice(at + placeholder.length), values);
|
|
6871
|
+
const href = sanitizeLinkUrl(link.url);
|
|
6872
|
+
const anchor = href ? b2`<a part="link" href=${href}>${link.text}</a>` : link.text;
|
|
6873
|
+
return b2`${before}${anchor}${after}`;
|
|
6874
|
+
}
|
|
6875
|
+
|
|
6876
|
+
// src/components/consent-wallet-notice.ts
|
|
6877
|
+
var ConsentWalletNotice = class extends i4 {
|
|
6878
|
+
constructor() {
|
|
6879
|
+
super(...arguments);
|
|
6880
|
+
this.status = "";
|
|
6881
|
+
this.reason = "";
|
|
6882
|
+
this.message = "";
|
|
6883
|
+
this.appName = "";
|
|
6884
|
+
this.credentialsUrl = "";
|
|
6885
|
+
this.updatesOnItsOwn = false;
|
|
6886
|
+
}
|
|
6887
|
+
render() {
|
|
6888
|
+
if (this.status !== "conflict" && this.status !== "error") return A;
|
|
6889
|
+
const copy = CONSENT_COPY_TOKENS.wallet.notice;
|
|
6890
|
+
const values = { App: this.appName.trim() || copy.appFallback };
|
|
6891
|
+
const link = {
|
|
6892
|
+
key: "CredentialsLink",
|
|
6893
|
+
text: copy.credentialsLink,
|
|
6894
|
+
url: this.credentialsUrl
|
|
6895
|
+
};
|
|
6896
|
+
const say = (template) => templateWithLink(template, values, link);
|
|
6897
|
+
const live = this.updatesOnItsOwn ? ` ${copy.updatesOnItsOwn}` : "";
|
|
6898
|
+
let title;
|
|
6899
|
+
let body;
|
|
6900
|
+
let more = A;
|
|
6901
|
+
if (this.status === "error") {
|
|
6902
|
+
title = copy.errorTitle;
|
|
6903
|
+
body = say(copy.errorBody);
|
|
6904
|
+
} else if (this.reason === "passkey-unreachable") {
|
|
6905
|
+
title = copy.passkeyUnreachableTitle;
|
|
6906
|
+
body = b2`${say(copy.passkeyUnreachableBody)}${live}`;
|
|
6907
|
+
more = b2`<p part="more" class="more">
|
|
6908
|
+
<slot name="more">${copy.passkeyUnreachableMore}</slot>
|
|
6909
|
+
</p>`;
|
|
6910
|
+
} else if (this.reason === "key-drift") {
|
|
6911
|
+
title = copy.keyDriftTitle;
|
|
6912
|
+
body = say(copy.keyDriftBody);
|
|
6913
|
+
} else if (this.reason === "superseded") {
|
|
6914
|
+
title = copy.supersededTitle;
|
|
6915
|
+
body = say(copy.supersededBody);
|
|
6916
|
+
} else {
|
|
6917
|
+
title = copy.otherTitle;
|
|
6918
|
+
body = this.message;
|
|
6919
|
+
}
|
|
6920
|
+
return b2`
|
|
6921
|
+
<div part="frame" class="frame">
|
|
6922
|
+
<p part="title" class="title">${title}</p>
|
|
6923
|
+
<p part="body" class="body">${body}</p>
|
|
6924
|
+
${more}
|
|
6925
|
+
</div>
|
|
6926
|
+
`;
|
|
6927
|
+
}
|
|
6928
|
+
};
|
|
6929
|
+
ConsentWalletNotice.styles = i`
|
|
6930
|
+
:host {
|
|
6931
|
+
display: block;
|
|
6932
|
+
font-family: inherit;
|
|
6933
|
+
}
|
|
6934
|
+
|
|
6935
|
+
:host(:not([status="conflict"]):not([status="error"])),
|
|
6936
|
+
:host([hidden]) {
|
|
6937
|
+
display: none;
|
|
6938
|
+
}
|
|
6939
|
+
|
|
6940
|
+
.frame {
|
|
6941
|
+
display: grid;
|
|
6942
|
+
gap: 6px;
|
|
6943
|
+
padding: 10px 12px;
|
|
6944
|
+
border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.12));
|
|
6945
|
+
border-radius: var(--cs-field-radius, 12px);
|
|
6946
|
+
background: var(--cs-notice-bg, var(--cs-surface-card, #ffffff));
|
|
6947
|
+
}
|
|
6948
|
+
|
|
6949
|
+
.title {
|
|
6950
|
+
margin: 0;
|
|
6951
|
+
color: var(--cs-text-primary, #0f172a);
|
|
6952
|
+
font-size: 14px;
|
|
6953
|
+
font-weight: 500;
|
|
6954
|
+
line-height: 1.4;
|
|
6955
|
+
}
|
|
6956
|
+
|
|
6957
|
+
.body,
|
|
6958
|
+
.more {
|
|
6959
|
+
margin: 0;
|
|
6960
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
6961
|
+
font-size: 12px;
|
|
6962
|
+
line-height: 1.375;
|
|
6963
|
+
}
|
|
6964
|
+
|
|
6965
|
+
::slotted(*) {
|
|
6966
|
+
margin: 0;
|
|
6967
|
+
}
|
|
6968
|
+
|
|
6969
|
+
a {
|
|
6970
|
+
color: var(--cs-link, var(--cs-text-primary, #0f172a));
|
|
6971
|
+
text-decoration: none;
|
|
6972
|
+
white-space: nowrap;
|
|
6973
|
+
}
|
|
6974
|
+
|
|
6975
|
+
a:hover {
|
|
6976
|
+
text-decoration: underline;
|
|
6977
|
+
}
|
|
6978
|
+
|
|
6979
|
+
a:focus-visible {
|
|
6980
|
+
border-radius: 2px;
|
|
6981
|
+
outline: 2px solid var(--cs-focus-ring, #0f172a);
|
|
6982
|
+
outline-offset: 2px;
|
|
6983
|
+
}
|
|
6984
|
+
`;
|
|
6985
|
+
__decorateClass([
|
|
6986
|
+
n4({ type: String, reflect: true })
|
|
6987
|
+
], ConsentWalletNotice.prototype, "status", 2);
|
|
6988
|
+
__decorateClass([
|
|
6989
|
+
n4({ type: String, reflect: true })
|
|
6990
|
+
], ConsentWalletNotice.prototype, "reason", 2);
|
|
6991
|
+
__decorateClass([
|
|
6992
|
+
n4({ type: String })
|
|
6993
|
+
], ConsentWalletNotice.prototype, "message", 2);
|
|
6994
|
+
__decorateClass([
|
|
6995
|
+
n4({ type: String, attribute: "app-name" })
|
|
6996
|
+
], ConsentWalletNotice.prototype, "appName", 2);
|
|
6997
|
+
__decorateClass([
|
|
6998
|
+
n4({ type: String, attribute: "credentials-url" })
|
|
6999
|
+
], ConsentWalletNotice.prototype, "credentialsUrl", 2);
|
|
7000
|
+
__decorateClass([
|
|
7001
|
+
n4({ type: Boolean, attribute: "updates-on-its-own" })
|
|
7002
|
+
], ConsentWalletNotice.prototype, "updatesOnItsOwn", 2);
|
|
7003
|
+
ConsentWalletNotice = __decorateClass([
|
|
7004
|
+
t3("consent-wallet-notice")
|
|
7005
|
+
], ConsentWalletNotice);
|
|
7006
|
+
|
|
7007
|
+
// src/components/consent-wallet-signature.ts
|
|
7008
|
+
var ConsentWalletSignature = class extends i4 {
|
|
7009
|
+
constructor() {
|
|
7010
|
+
super(...arguments);
|
|
7011
|
+
this.revokeUrl = "";
|
|
7012
|
+
}
|
|
7013
|
+
render() {
|
|
7014
|
+
const copy = CONSENT_COPY_TOKENS.wallet.signature;
|
|
7015
|
+
return b2`
|
|
7016
|
+
<p part="frame" class="frame">
|
|
7017
|
+
<span part="signed-by"
|
|
7018
|
+
><svg
|
|
7019
|
+
part="mark"
|
|
7020
|
+
class="mark"
|
|
7021
|
+
viewBox="0 0 197 227"
|
|
7022
|
+
aria-hidden="true"
|
|
7023
|
+
>
|
|
7024
|
+
${kyaOsMark}</svg
|
|
7025
|
+
>${copy.signedBy}</span
|
|
7026
|
+
>
|
|
7027
|
+
<span part="revoke"
|
|
7028
|
+
>${templateWithLink(
|
|
7029
|
+
copy.revokeTemplate,
|
|
7030
|
+
{},
|
|
7031
|
+
{ key: "RevokeLink", text: copy.revokeLink, url: this.revokeUrl }
|
|
7032
|
+
)}</span
|
|
7033
|
+
>
|
|
7034
|
+
</p>
|
|
7035
|
+
`;
|
|
7036
|
+
}
|
|
7037
|
+
};
|
|
7038
|
+
ConsentWalletSignature.styles = i`
|
|
7039
|
+
:host {
|
|
7040
|
+
display: block;
|
|
7041
|
+
font-family: inherit;
|
|
7042
|
+
}
|
|
7043
|
+
|
|
7044
|
+
:host([hidden]) {
|
|
7045
|
+
display: none;
|
|
7046
|
+
}
|
|
7047
|
+
|
|
7048
|
+
.frame {
|
|
7049
|
+
margin: 0;
|
|
7050
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
7051
|
+
font-size: 12px;
|
|
7052
|
+
line-height: 1.5;
|
|
7053
|
+
}
|
|
7054
|
+
|
|
7055
|
+
.mark {
|
|
7056
|
+
display: inline-block;
|
|
7057
|
+
width: 12px;
|
|
7058
|
+
height: 12px;
|
|
7059
|
+
margin-right: 6px;
|
|
7060
|
+
vertical-align: -1px;
|
|
7061
|
+
}
|
|
7062
|
+
|
|
7063
|
+
span {
|
|
7064
|
+
display: block;
|
|
7065
|
+
}
|
|
7066
|
+
|
|
7067
|
+
a {
|
|
7068
|
+
color: var(--cs-link, var(--cs-text-primary, #0f172a));
|
|
7069
|
+
text-decoration: underline;
|
|
7070
|
+
text-underline-offset: 2px;
|
|
7071
|
+
white-space: nowrap;
|
|
7072
|
+
}
|
|
7073
|
+
|
|
7074
|
+
a:focus-visible {
|
|
7075
|
+
border-radius: 2px;
|
|
7076
|
+
outline: 2px solid var(--cs-focus-ring, #0f172a);
|
|
7077
|
+
outline-offset: 2px;
|
|
7078
|
+
}
|
|
7079
|
+
`;
|
|
7080
|
+
__decorateClass([
|
|
7081
|
+
n4({ type: String, attribute: "revoke-url" })
|
|
7082
|
+
], ConsentWalletSignature.prototype, "revokeUrl", 2);
|
|
7083
|
+
ConsentWalletSignature = __decorateClass([
|
|
7084
|
+
t3("consent-wallet-signature")
|
|
7085
|
+
], ConsentWalletSignature);
|
|
7086
|
+
|
|
7087
|
+
// src/components/consent-request-expiry.ts
|
|
7088
|
+
function readExpiry(value) {
|
|
7089
|
+
if (value instanceof Date) return value.getTime();
|
|
7090
|
+
if (typeof value === "number") return value > 0 ? value : Number.NaN;
|
|
7091
|
+
if (typeof value === "string") {
|
|
7092
|
+
const trimmed = value.trim();
|
|
7093
|
+
if (/^\d+$/.test(trimmed)) return Number(trimmed) || Number.NaN;
|
|
7094
|
+
return Date.parse(trimmed);
|
|
7095
|
+
}
|
|
7096
|
+
return Number.NaN;
|
|
7097
|
+
}
|
|
7098
|
+
function formatTimeLeft(seconds) {
|
|
7099
|
+
const hours = Math.floor(seconds / 3600);
|
|
7100
|
+
const minutes = Math.floor(seconds % 3600 / 60);
|
|
7101
|
+
const secs = String(seconds % 60).padStart(2, "0");
|
|
7102
|
+
return hours > 0 ? `${hours}:${String(minutes).padStart(2, "0")}:${secs}` : `${minutes}:${secs}`;
|
|
7103
|
+
}
|
|
7104
|
+
var ConsentRequestExpiry = class extends i4 {
|
|
7105
|
+
constructor() {
|
|
7106
|
+
super(...arguments);
|
|
7107
|
+
this.expiresAt = 0;
|
|
7108
|
+
/** The expiry `consent-request-expired` already fired for. */
|
|
7109
|
+
this.announced = Number.NaN;
|
|
7110
|
+
}
|
|
7111
|
+
connectedCallback() {
|
|
7112
|
+
super.connectedCallback();
|
|
7113
|
+
if (this.hasUpdated) this.schedule();
|
|
7114
|
+
}
|
|
7115
|
+
disconnectedCallback() {
|
|
7116
|
+
super.disconnectedCallback();
|
|
7117
|
+
clearTimeout(this.timer);
|
|
7118
|
+
this.timer = void 0;
|
|
7119
|
+
}
|
|
7120
|
+
updated() {
|
|
7121
|
+
this.schedule();
|
|
7122
|
+
}
|
|
7123
|
+
/** The next repaint, on the second the count changes, or the event at zero. */
|
|
7124
|
+
schedule() {
|
|
7125
|
+
clearTimeout(this.timer);
|
|
7126
|
+
this.timer = void 0;
|
|
7127
|
+
const expiry = readExpiry(this.expiresAt);
|
|
7128
|
+
if (!Number.isFinite(expiry)) return;
|
|
7129
|
+
const left = expiry - Date.now();
|
|
7130
|
+
if (left > 0) {
|
|
7131
|
+
this.timer = setTimeout(() => this.requestUpdate(), left % 1e3 || 1e3);
|
|
7132
|
+
} else if (this.announced !== expiry) {
|
|
7133
|
+
this.timer = setTimeout(() => {
|
|
7134
|
+
this.timer = void 0;
|
|
7135
|
+
this.announced = expiry;
|
|
7136
|
+
this.dispatchEvent(
|
|
7137
|
+
new CustomEvent("consent-request-expired", {
|
|
7138
|
+
detail: { expiresAt: expiry },
|
|
7139
|
+
bubbles: true,
|
|
7140
|
+
composed: true
|
|
7141
|
+
})
|
|
7142
|
+
);
|
|
7143
|
+
}, 0);
|
|
7144
|
+
}
|
|
7145
|
+
}
|
|
7146
|
+
render() {
|
|
7147
|
+
const expiry = readExpiry(this.expiresAt);
|
|
7148
|
+
if (!Number.isFinite(expiry)) return A;
|
|
7149
|
+
const copy = CONSENT_COPY_TOKENS.request;
|
|
7150
|
+
const seconds = Math.ceil((expiry - Date.now()) / 1e3);
|
|
7151
|
+
if (seconds <= 0) {
|
|
7152
|
+
return b2`<p part="expired" role="status">${copy.expired}</p>`;
|
|
7153
|
+
}
|
|
7154
|
+
const [before, after = ""] = copy.expiresTemplate.split("{Time}");
|
|
7155
|
+
return b2`<p part="text">
|
|
7156
|
+
${before}<span part="time" class="time" role="timer"
|
|
7157
|
+
>${formatTimeLeft(seconds)}</span
|
|
7158
|
+
>${after}
|
|
7159
|
+
</p>`;
|
|
7160
|
+
}
|
|
7161
|
+
};
|
|
7162
|
+
ConsentRequestExpiry.styles = i`
|
|
7163
|
+
:host {
|
|
7164
|
+
display: block;
|
|
7165
|
+
font-family: inherit;
|
|
7166
|
+
}
|
|
7167
|
+
|
|
7168
|
+
:host([hidden]) {
|
|
7169
|
+
display: none;
|
|
7170
|
+
}
|
|
7171
|
+
|
|
7172
|
+
p {
|
|
7173
|
+
margin: 0;
|
|
7174
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
7175
|
+
font-size: 12px;
|
|
7176
|
+
line-height: 1.4;
|
|
7177
|
+
}
|
|
7178
|
+
|
|
7179
|
+
.time {
|
|
7180
|
+
color: var(--cs-text-primary, #0f172a);
|
|
7181
|
+
font-family: var(
|
|
7182
|
+
--cs-mono-font,
|
|
7183
|
+
ui-monospace,
|
|
7184
|
+
SFMono-Regular,
|
|
7185
|
+
Menlo,
|
|
7186
|
+
monospace
|
|
7187
|
+
);
|
|
7188
|
+
font-variant-numeric: tabular-nums;
|
|
7189
|
+
}
|
|
7190
|
+
`;
|
|
7191
|
+
__decorateClass([
|
|
7192
|
+
n4({ attribute: "expires-at" })
|
|
7193
|
+
], ConsentRequestExpiry.prototype, "expiresAt", 2);
|
|
7194
|
+
ConsentRequestExpiry = __decorateClass([
|
|
7195
|
+
t3("consent-request-expiry")
|
|
7196
|
+
], ConsentRequestExpiry);
|
|
7197
|
+
|
|
7198
|
+
// ../../node_modules/.pnpm/lean-qr@2.7.4/node_modules/lean-qr/index.mjs
|
|
7199
|
+
var t6 = [0.2, 3 / 8, 5 / 9, 2 / 3];
|
|
7200
|
+
var o8 = (o9, e10) => (r8) => {
|
|
7201
|
+
const n6 = 4 * o9 + r8 - 4, s5 = "*-04-39?2$%%$%%'$%''%'''%')(%'))%(++'(++'(+.'+-.',/3',33)-/5)-43).36)058*18<+37<+4:<,4:E,5<A-7>C/8@F/:EH/<EK0=FM1?IP2@KS3BNV4DPY5FS\\6HV_6IXb7K[e8N^i9Pam;Rdp<Tgt".charCodeAt(n6) - 35, f4 = n6 > 8 ? s5 : 1, c5 = e10 / f4 | 0, i7 = e10 % f4, l4 = f4 - i7, a4 = n6 > 8 ? c5 * t6[r8] + (o9 > 5) & -2 : s5, _3 = c5 - a4;
|
|
7202
|
+
return { t: l4 * _3 + i7 * _3 + i7, o: [[l4, _3], [i7, _3 + 1]], i: a4 };
|
|
7203
|
+
};
|
|
7204
|
+
var e9 = { min: 0, L: 0, M: 1, Q: 2, H: 3, max: 3 };
|
|
7205
|
+
var r7 = (t7) => new Uint8Array(t7);
|
|
7206
|
+
var n5 = (t7) => {
|
|
7207
|
+
const o9 = new Error(`lean-qr error ${t7}`);
|
|
7208
|
+
throw o9.code = t7, o9;
|
|
7209
|
+
};
|
|
7210
|
+
var s4 = (t7) => "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".indexOf(t7);
|
|
7211
|
+
var f3 = (t7) => t7.charCodeAt(0);
|
|
7212
|
+
var c4 = (...t7) => (o9, e10) => t7.forEach((t8) => t8(o9, e10));
|
|
7213
|
+
var i6 = (t7) => (o9) => {
|
|
7214
|
+
o9.eci !== t7 && (o9.push(7, 4), t7 < 128 ? o9.push(t7, 8) : t7 < 16384 ? o9.push(32768 | t7, 16) : o9.push(12582912 | t7, 24), o9.eci = t7);
|
|
7215
|
+
};
|
|
7216
|
+
var l3 = (t7) => (o9, e10) => {
|
|
7217
|
+
o9.push(4, 4), o9.push(t7.length, 8 + 8 * (e10 > 9)), t7.forEach((t8) => o9.push(t8, 8));
|
|
7218
|
+
};
|
|
7219
|
+
var a3 = (t7, o9, e10, r8, n6 = (t8, o10) => e10(t8.length, o10), s5 = r8 ? (o10) => c4(i6(r8), t7(o10)) : t7) => (s5.test = o9, s5.l = e10, s5.est = n6, s5.eci = r8 && [r8], s5);
|
|
7220
|
+
var _2 = a3((t7) => (o9, e10) => {
|
|
7221
|
+
o9.push(1, 4), o9.push(t7.length, 10 + 2 * (e10 > 26) + 2 * (e10 > 9));
|
|
7222
|
+
let r8 = 0;
|
|
7223
|
+
for (; r8 < t7.length - 2; r8 += 3) o9.push(+t7.slice(r8, r8 + 3), 10);
|
|
7224
|
+
r8 < t7.length - 1 ? o9.push(+t7.slice(r8), 7) : r8 < t7.length && o9.push(+t7[r8], 4);
|
|
7225
|
+
}, (t7) => /[0-9]/.test(t7), (t7, o9) => 14 + 2 * (o9 > 26) + 2 * (o9 > 9) + 10 * t7 / 3);
|
|
7226
|
+
var u3 = a3((t7) => (o9, e10) => {
|
|
7227
|
+
o9.push(2, 4), o9.push(t7.length, 9 + 2 * (e10 > 26) + 2 * (e10 > 9));
|
|
7228
|
+
let r8 = 0;
|
|
7229
|
+
for (; r8 < t7.length - 1; r8 += 2) o9.push(45 * s4(t7[r8]) + s4(t7[r8 + 1]), 11);
|
|
7230
|
+
r8 < t7.length && o9.push(s4(t7[r8]), 6);
|
|
7231
|
+
}, (t7) => s4(t7) >= 0, (t7, o9) => 13 + 2 * (o9 > 26) + 2 * (o9 > 9) + 5.5 * t7);
|
|
7232
|
+
var d3 = a3((t7) => l3([...t7].map(f3)), (t7) => f3(t7) < 128, (t7, o9) => 12 + 8 * (o9 > 9) + 8 * t7);
|
|
7233
|
+
d3._ = true, d3.u = true;
|
|
7234
|
+
var p3 = a3(d3, (t7) => f3(t7) < 256, d3.l, 3);
|
|
7235
|
+
p3._ = true;
|
|
7236
|
+
var m2 = new TextEncoder();
|
|
7237
|
+
var h3 = a3((t7) => l3(m2.encode(t7)), () => 1, 0, 26, (t7, o9) => 12 + 8 * (o9 > 9) + 8 * m2.encode(t7).length);
|
|
7238
|
+
h3._ = true;
|
|
7239
|
+
var w2 = () => {
|
|
7240
|
+
const t7 = /* @__PURE__ */ new Map(), o9 = new TextDecoder("sjis"), e10 = r7(2);
|
|
7241
|
+
for (let r8 = 0; r8 < 7973; ++r8) e10[0] = r8 / 192 + 129 + 64 * (r8 > 5951), e10[1] = r8 % 192 + 64, t7.set(o9.decode(e10), r8);
|
|
7242
|
+
return t7.delete("\uFFFD"), w2 = () => t7, t7;
|
|
7243
|
+
};
|
|
7244
|
+
var y3 = a3((t7) => (o9, e10) => {
|
|
7245
|
+
o9.push(8, 4), o9.push(t7.length, 8 + 2 * (e10 > 26) + 2 * (e10 > 9));
|
|
7246
|
+
for (const e11 of t7) o9.push(w2().get(e11), 13);
|
|
7247
|
+
}, (t7) => w2().has(t7), (t7, o9) => 12 + 2 * (o9 > 26) + 2 * (o9 > 9) + 13 * t7);
|
|
7248
|
+
y3._ = true;
|
|
7249
|
+
var g2 = [_2, u3, d3, p3, y3, h3];
|
|
7250
|
+
var b3 = { auto: (t7, { modes: o9 = g2 } = {}) => (e10, r8) => {
|
|
7251
|
+
const s5 = o9.map((o10, e11) => {
|
|
7252
|
+
const n6 = /* @__PURE__ */ new Map(), s6 = (t8, o11) => (n6.has(t8) || n6.set(t8, o11(t8, r8)), n6.get(t8));
|
|
7253
|
+
return { m: o10, h: 1 << e11, C: o10.est("", r8), S: o10.l ? (t8, e12) => s6(e12 - t8, o10.l) : (e12, r9) => s6(t7.slice(e12, r9), o10.est) };
|
|
7254
|
+
});
|
|
7255
|
+
let f4 = [{ v: 0 }], c5 = 0, i7 = 0, l4 = -1;
|
|
7256
|
+
for (const o10 of [...t7, ""]) {
|
|
7257
|
+
let t8 = 0;
|
|
7258
|
+
if (o10) for (const e11 of s5) e11.m.test(o10) && (t8 |= e11.h);
|
|
7259
|
+
if (!o10 || t8 !== l4) {
|
|
7260
|
+
if (-1 !== l4) {
|
|
7261
|
+
const t9 = new Set(f4.map((t10) => t10.D)), o11 = [];
|
|
7262
|
+
for (const { m: e11, C: r9, S: n6, h: a5 } of s5) if (l4 & a5) {
|
|
7263
|
+
const s6 = n6(c5, i7);
|
|
7264
|
+
for (const l5 of e11.eci ?? t9) if (!e11.u || !l5) {
|
|
7265
|
+
let t10;
|
|
7266
|
+
for (const o12 of f4) if (o12.D === l5 || e11.eci) {
|
|
7267
|
+
const f5 = o12.m === e11 && o12.D === l5, a6 = f5 ? o12.V : o12, _3 = e11._ && f5 ? o12.v + s6 - r9 : a6.v + 12 * (a6.D !== l5) + (f5 ? n6(f5 ? o12.$ : c5, i7) : s6);
|
|
7268
|
+
(!t10 || _3 < t10.v) && (t10 = { $: f5 ? o12.$ : c5, V: a6, m: e11, D: l5, A: i7, v: _3 });
|
|
7269
|
+
}
|
|
7270
|
+
t10 && o11.push(t10);
|
|
7271
|
+
}
|
|
7272
|
+
}
|
|
7273
|
+
f4 = o11;
|
|
7274
|
+
}
|
|
7275
|
+
l4 = t8, c5 = i7;
|
|
7276
|
+
}
|
|
7277
|
+
i7 += o10.length;
|
|
7278
|
+
}
|
|
7279
|
+
f4.length || n5(5);
|
|
7280
|
+
const a4 = [];
|
|
7281
|
+
for (let o10 = f4.reduce((t8, o11) => o11.v < t8.v ? o11 : t8); o10.m; o10 = o10.V) a4.push(o10.m(t7.slice(o10.$, o10.A)));
|
|
7282
|
+
a4.reverse().forEach((t8) => t8(e10, r8));
|
|
7283
|
+
}, multi: c4, eci: i6, bytes: l3, numeric: _2, alphaNumeric: u3, ascii: d3, iso8859_1: p3, shift_jis: y3, utf8: h3 };
|
|
7284
|
+
var C2 = () => ({ F: r7(2956), I: 0, push(t7, o9) {
|
|
7285
|
+
for (let e10 = o9, r8 = 8 - (7 & this.I); e10 > 0; e10 -= r8, r8 = 8) this.F[this.I >> 3] |= t7 << r8 >> e10, this.I += e10 < r8 ? e10 : r8;
|
|
7286
|
+
} });
|
|
7287
|
+
var x2 = (t7, o9 = t7 * t7, e10 = r7(o9)) => ({ size: t7, K: e10, get: (o10, r8) => o10 >= 0 && o10 < t7 && !!(1 & e10[r8 * t7 + o10]), toString({ on: o10 = "##", off: e11 = " ", lf: r8 = "\n", pad: n6 = 4, padX: s5 = n6, padY: f4 = n6 } = {}) {
|
|
7288
|
+
let c5 = "";
|
|
7289
|
+
for (let n7 = -f4; n7 < t7 + f4; ++n7) {
|
|
7290
|
+
for (let r9 = -s5; r9 < t7 + s5; ++r9) c5 += this.get(r9, n7) ? o10 : e11;
|
|
7291
|
+
c5 += r8;
|
|
7292
|
+
}
|
|
7293
|
+
return c5;
|
|
7294
|
+
}, toImageData(o10, { on: e11 = [0, 0, 0], off: r8 = [0, 0, 0, 0], pad: n6 = 4, padX: s5 = n6, padY: f4 = n6 } = {}) {
|
|
7295
|
+
const c5 = t7 + 2 * s5, i7 = t7 + 2 * f4, l4 = o10.createImageData(c5, i7), a4 = new Uint32Array(l4.data.buffer);
|
|
7296
|
+
l4.data.set([...e11, 255]);
|
|
7297
|
+
const _3 = a4[0];
|
|
7298
|
+
l4.data.set([...r8, 255]);
|
|
7299
|
+
const u4 = a4[0];
|
|
7300
|
+
for (let t8 = 0; t8 < i7; ++t8) for (let o11 = 0; o11 < c5; ++o11) a4[t8 * c5 + o11] = this.get(o11 - s5, t8 - f4) ? _3 : u4;
|
|
7301
|
+
return l4;
|
|
7302
|
+
}, toCanvas(t8, o10) {
|
|
7303
|
+
const e11 = t8.getContext("2d"), r8 = this.toImageData(e11, o10);
|
|
7304
|
+
t8.width = r8.width, t8.height = r8.height, e11.putImageData(r8, 0, 0);
|
|
7305
|
+
}, toDataURL({ type: t8 = "image/png", scale: o10 = 1, ...e11 } = {}) {
|
|
7306
|
+
const r8 = document.createElement("canvas"), n6 = r8.getContext("2d"), s5 = this.toImageData(n6, e11);
|
|
7307
|
+
return r8.width = s5.width * o10, r8.height = s5.height * o10, n6.putImageData(s5, 0, 0), n6.imageSmoothingEnabled = false, n6.globalCompositeOperation = "copy", n6.drawImage(r8, 0, 0, s5.width, s5.height, 0, 0, r8.width, r8.height), r8.toDataURL(t8, 1);
|
|
7308
|
+
} });
|
|
7309
|
+
var z2 = [(t7, o9) => 1 & (t7 ^ o9), (t7, o9) => 1 & o9, (t7) => t7 % 3, (t7, o9) => (t7 + o9) % 3, (t7, o9) => 1 & (t7 / 3 ^ o9 >> 1), (t7, o9) => (t7 & o9 & 1) + t7 * o9 % 3, (t7, o9) => (t7 & o9) + t7 * o9 % 3 & 1, (t7, o9) => (t7 ^ o9) + t7 * o9 % 3 & 1];
|
|
7310
|
+
var E2 = r7(511);
|
|
7311
|
+
for (let t7 = 0, o9 = 1; t7 < 255; o9 = 2 * o9 ^ 285 * (o9 > 127)) E2[E2[o9 + 255] = t7++] = o9;
|
|
7312
|
+
var M2 = (t7) => E2[t7 % 255];
|
|
7313
|
+
var S3 = (t7) => E2[t7 + 255];
|
|
7314
|
+
var v2 = (t7, o9) => {
|
|
7315
|
+
const e10 = r7(t7.length + o9.length - 1);
|
|
7316
|
+
for (let r8 = 0; r8 < t7.length; ++r8) for (let n6 = 0; n6 < o9.length; ++n6) e10[r8 + n6] ^= M2(t7[r8] + o9[n6]);
|
|
7317
|
+
return e10.map(S3);
|
|
7318
|
+
};
|
|
7319
|
+
var D2 = (t7, o9) => {
|
|
7320
|
+
const e10 = r7(t7.length + o9.length - 1);
|
|
7321
|
+
e10.set(t7, 0);
|
|
7322
|
+
for (let r8 = 0; r8 < t7.length; ++r8) if (e10[r8]) {
|
|
7323
|
+
const t8 = S3(e10[r8]);
|
|
7324
|
+
for (let n6 = 0; n6 < o9.length; ++n6) e10[r8 + n6] ^= M2(o9[n6] + t8);
|
|
7325
|
+
}
|
|
7326
|
+
return e10.slice(t7.length);
|
|
7327
|
+
};
|
|
7328
|
+
var L2 = [[0], [0, 0]];
|
|
7329
|
+
for (let t7 = 1; t7 < 30; ++t7) L2.push(v2(L2[t7], [0, t7]));
|
|
7330
|
+
var V2 = (t7, o9) => {
|
|
7331
|
+
const e10 = [[], []];
|
|
7332
|
+
let n6 = 0, s5 = 0;
|
|
7333
|
+
for (const [r8, f5] of o9.o) for (let c5 = 0; c5 < r8; ++c5, n6 += f5) {
|
|
7334
|
+
const r9 = t7.slice(n6, n6 + f5);
|
|
7335
|
+
e10[0].push(r9), e10[1].push(D2(r9, L2[o9.i])), s5 += f5 + o9.i;
|
|
7336
|
+
}
|
|
7337
|
+
const f4 = r7(s5);
|
|
7338
|
+
s5 = 0;
|
|
7339
|
+
for (const t8 of e10) for (let o10 = 0, e11 = -1; e11 < s5; ++o10) {
|
|
7340
|
+
e11 = s5;
|
|
7341
|
+
for (const e12 of t8) o10 < e12.length && (f4[s5++] = e12[o10]);
|
|
7342
|
+
}
|
|
7343
|
+
return f4;
|
|
7344
|
+
};
|
|
7345
|
+
var $2 = (t7, o9, e10) => {
|
|
7346
|
+
let r8 = t7 <<= e10;
|
|
7347
|
+
for (let t8 = 134217728; t8 >>= 1; ) r8 & t8 && (r8 ^= o9 * (t8 >> e10));
|
|
7348
|
+
return r8 | t7;
|
|
7349
|
+
};
|
|
7350
|
+
var A2 = ({ size: t7, K: o9 }, e10) => {
|
|
7351
|
+
const r8 = (e11, r9, n7, s6) => {
|
|
7352
|
+
for (; n7-- > 0; e11 += t7) o9.fill(s6, e11, e11 + r9);
|
|
7353
|
+
}, n6 = (o10, e11, n7) => {
|
|
7354
|
+
for (let s6 = 0; s6++ < 3; n7 -= 2) r8(e11 * t7 + o10 - (n7 >> 1) * (t7 + 1), n7, n7, 2 | s6);
|
|
7355
|
+
}, s5 = 2 * ((t7 - 13) / (1 + (e10 / 7 | 0)) / 2 + 0.75 | 0);
|
|
7356
|
+
if (e10 > 1) for (let o10 = t7 - 7; o10 > 8; o10 -= s5) {
|
|
7357
|
+
for (let t8 = o10; t8 > 8; t8 -= s5) n6(o10, t8, 5);
|
|
7358
|
+
o10 < t7 - 7 && n6(o10, 6, 5);
|
|
7359
|
+
}
|
|
7360
|
+
if (e10 > 6) for (let r9 = $2(e10, 7973, 12), n7 = 1; n7 < 7; ++n7) for (let e11 = 12; e11-- > 9; r9 >>= 1) o9[n7 * t7 - e11] = 2 | 1 & r9;
|
|
7361
|
+
r8(7, 2, 9, 2), r8(t7 - 8, 8, 9, 2);
|
|
7362
|
+
for (let e11 = 0; e11 < t7; ++e11) o9[6 * t7 + e11] = 3 ^ 1 & e11;
|
|
7363
|
+
n6(3, 3, 7), n6(t7 - 4, 3, 7);
|
|
7364
|
+
for (let e11 = 0; e11 < t7; ++e11) for (let r9 = e11; r9 < t7; ++r9) o9[r9 * t7 + e11] = o9[e11 * t7 + r9];
|
|
7365
|
+
o9[(t7 - 8) * t7 + 8] = 3;
|
|
7366
|
+
};
|
|
7367
|
+
var F = ({ size: t7, K: o9 }) => {
|
|
7368
|
+
const e10 = [];
|
|
7369
|
+
for (let r8 = t7 - 2, n6 = t7, s5 = -1; r8 >= 0; r8 -= 2) {
|
|
7370
|
+
for (5 === r8 && (r8 = 4); n6 += s5, -1 !== n6 && n6 !== t7; ) {
|
|
7371
|
+
const s6 = n6 * t7 + r8;
|
|
7372
|
+
o9[s6 + 1] || e10.push(s6 + 1), o9[s6] || e10.push(s6);
|
|
7373
|
+
}
|
|
7374
|
+
s5 *= -1;
|
|
7375
|
+
}
|
|
7376
|
+
return e10;
|
|
7377
|
+
};
|
|
7378
|
+
var H2 = ({ K: t7 }, o9, e10) => o9.forEach((o10, r8) => t7[o10] = e10[r8 >> 3] >> (7 & ~r8) & 1);
|
|
7379
|
+
var I2 = ({ size: t7, K: o9 }, e10, r8, n6) => {
|
|
7380
|
+
for (let r9 = 0; r9 < t7; ++r9) for (let n7 = 0; n7 < t7; ++n7) {
|
|
7381
|
+
const s6 = r9 * t7 + n7;
|
|
7382
|
+
o9[s6] ^= !(e10(n7, r9) || 2 & o9[s6]);
|
|
7383
|
+
}
|
|
7384
|
+
let s5 = 21522 ^ $2((1 ^ n6) << 3 | r8, 1335, 10);
|
|
7385
|
+
for (let e11 = 0; e11++ < 8; s5 >>= 1) o9[(e11 - (e11 < 7)) * t7 + 8] = 1 & s5, o9[9 * t7 - e11] = 1 & s5;
|
|
7386
|
+
for (let e11 = 8; --e11, s5; s5 >>= 1) o9[8 * t7 + e11 - (e11 < 7)] = 1 & s5, o9[(t7 - e11) * t7 + 8] = 1 & s5;
|
|
7387
|
+
};
|
|
7388
|
+
var K = ({ size: t7, K: o9 }, e10 = 0, r8 = 0) => {
|
|
7389
|
+
for (let n6 = 0; n6 < t7; ++n6) {
|
|
7390
|
+
for (let s5 = 0; s5 < 2; ++s5) for (let f4, c5 = 0, i7 = 0, l4 = 2; c5 < t7; ++c5) {
|
|
7391
|
+
const a4 = 1 & o9[s5 ? n6 * t7 + c5 : c5 * t7 + n6];
|
|
7392
|
+
r8 += a4, i7 = (i7 >> 1 | 2098176) & (3047517 ^ a4 - 1), 2049 & i7 && (e10 += 40), a4 ^ l4 && (f4 = 0), l4 = a4, e10 += 5 === ++f4 ? 3 : f4 > 5;
|
|
7393
|
+
}
|
|
7394
|
+
if (n6) for (let r9 = t7 + n6, s5 = 5 * o9[n6 - 1] ^ o9[n6]; r9 < t7 * t7; r9 += t7) {
|
|
7395
|
+
const t8 = 5 * o9[r9 - 1] ^ o9[r9];
|
|
7396
|
+
e10 += 3 * !(1 & (s5 | t8) | 4 & (s5 ^ t8)), s5 = t8;
|
|
7397
|
+
}
|
|
7398
|
+
}
|
|
7399
|
+
return e10 + 10 * (10 * Math.abs(r8 / (t7 * t7) - 1) | 0);
|
|
7400
|
+
};
|
|
7401
|
+
var N2 = [];
|
|
7402
|
+
var P2 = (t7 = n5(1), { minCorrectionLevel: e10 = 0, maxCorrectionLevel: r8 = 3, minVersion: s5 = 1, maxVersion: f4 = 40, mask: c5, trailer: i7 = 60433, ...l4 } = {}) => {
|
|
7403
|
+
r8 < e10 && n5(3), f4 < s5 && n5(2), "string" == typeof t7 && (t7 = b3.auto(t7, l4));
|
|
7404
|
+
for (let n6 = s5, l5 = 0; n6 <= f4; ++n6) {
|
|
7405
|
+
let s6 = N2[n6];
|
|
7406
|
+
s6 || (N2[n6] = s6 = x2(4 * n6 + 17), A2(s6, n6), s6.p = F(s6));
|
|
7407
|
+
const f5 = o8(n6, s6.p.length >> 3);
|
|
7408
|
+
if (8 * f5(e10).t < l5) continue;
|
|
7409
|
+
const a4 = C2();
|
|
7410
|
+
t7(a4, n6), l5 = a4.I;
|
|
7411
|
+
for (let t8 = r8; t8 >= e10; --t8) {
|
|
7412
|
+
const o9 = f5(t8);
|
|
7413
|
+
if (8 * o9.t < l5) continue;
|
|
7414
|
+
for (a4.I = l5 + 11 & -8; a4.I < 8 * o9.t; ) a4.push(i7, 16);
|
|
7415
|
+
const e11 = x2(s6.size, s6.K);
|
|
7416
|
+
return H2(e11, s6.p, V2(a4.F, o9)), (z2[c5] ? [z2[c5]] : z2).map((o10, r9) => {
|
|
7417
|
+
const n7 = x2(e11.size, e11.K);
|
|
7418
|
+
return I2(n7, o10, c5 ?? r9, t8), n7.s = z2[c5] ? 0 : K(n7), n7;
|
|
7419
|
+
}).reduce((t9, o10) => o10.s < t9.s ? o10 : t9);
|
|
7420
|
+
}
|
|
7421
|
+
}
|
|
7422
|
+
n5(4);
|
|
7423
|
+
};
|
|
7424
|
+
P2.with = (...t7) => (o9, e10) => P2(o9, { modes: [...g2, ...t7], ...e10 });
|
|
7425
|
+
|
|
7426
|
+
// src/components/consent-phone-handoff.ts
|
|
7427
|
+
function qrCodeFor(url) {
|
|
7428
|
+
if (!url) return null;
|
|
7429
|
+
try {
|
|
7430
|
+
const code = P2(url, { minCorrectionLevel: e9.M });
|
|
7431
|
+
let path = "";
|
|
7432
|
+
for (let y4 = 0; y4 < code.size; y4++) {
|
|
7433
|
+
for (let x3 = 0; x3 < code.size; x3++) {
|
|
7434
|
+
if (code.get(x3, y4)) path += `M${x3} ${y4}h1v1h-1z`;
|
|
7435
|
+
}
|
|
7436
|
+
}
|
|
7437
|
+
return { size: code.size, path };
|
|
7438
|
+
} catch {
|
|
7439
|
+
return null;
|
|
7440
|
+
}
|
|
7441
|
+
}
|
|
7442
|
+
var ConsentPhoneHandoff = class extends i4 {
|
|
7443
|
+
constructor() {
|
|
7444
|
+
super(...arguments);
|
|
7445
|
+
this.url = "";
|
|
7446
|
+
this.heading = "";
|
|
7447
|
+
this.description = "";
|
|
7448
|
+
this.updatesOnItsOwn = false;
|
|
7449
|
+
this.code = null;
|
|
7450
|
+
}
|
|
7451
|
+
willUpdate(changed) {
|
|
7452
|
+
if (changed.has("url")) this.code = qrCodeFor(this.url);
|
|
7453
|
+
}
|
|
7454
|
+
render() {
|
|
7455
|
+
const code = this.code;
|
|
7456
|
+
if (!code) return A;
|
|
7457
|
+
const copy = CONSENT_COPY_TOKENS.wallet.handoff;
|
|
7458
|
+
const box = code.size + 2;
|
|
7459
|
+
return b2`
|
|
7460
|
+
<section part="frame" class="frame">
|
|
7461
|
+
<div class="head">
|
|
7462
|
+
<h2 part="title" class="title">
|
|
7463
|
+
<svg
|
|
7464
|
+
viewBox="0 0 24 24"
|
|
7465
|
+
fill="none"
|
|
7466
|
+
stroke="currentColor"
|
|
7467
|
+
stroke-width="2"
|
|
7468
|
+
stroke-linecap="round"
|
|
7469
|
+
stroke-linejoin="round"
|
|
7470
|
+
aria-hidden="true"
|
|
7471
|
+
>
|
|
7472
|
+
${smartphoneIcon}
|
|
7473
|
+
</svg>
|
|
7474
|
+
${this.heading || copy.title}
|
|
7475
|
+
</h2>
|
|
7476
|
+
<p part="body" class="body">${this.description || copy.body}</p>
|
|
7477
|
+
</div>
|
|
7478
|
+
<div class="content">
|
|
7479
|
+
<div part="box" class="box">
|
|
7480
|
+
<svg
|
|
7481
|
+
part="code"
|
|
7482
|
+
class="code"
|
|
7483
|
+
viewBox="-1 -1 ${box} ${box}"
|
|
7484
|
+
role="img"
|
|
7485
|
+
aria-label=${copy.qrLabel}
|
|
7486
|
+
shape-rendering="crispEdges"
|
|
7487
|
+
>
|
|
7488
|
+
<path d=${code.path} fill="currentColor" />
|
|
7489
|
+
</svg>
|
|
5105
7490
|
</div>
|
|
7491
|
+
<p part="scan" class="scan">
|
|
7492
|
+
${copy.scan}${this.updatesOnItsOwn ? ` ${copy.updatesOnItsOwn}` : ""}
|
|
7493
|
+
</p>
|
|
5106
7494
|
</div>
|
|
5107
|
-
|
|
5108
|
-
<slot name="details"></slot>
|
|
5109
|
-
<slot name="notice"
|
|
5110
|
-
><consent-revocation-notice
|
|
5111
|
-
revocationPath="${this.revocationPath}"
|
|
5112
|
-
orgName="${this.orgName || "this site"}"
|
|
5113
|
-
inactivityDays=${this.inactivityDays}
|
|
5114
|
-
?fixed-expiry=${this.fixedExpiry}
|
|
5115
|
-
fixed-expiry-days=${this.fixedExpiryDays ?? A}
|
|
5116
|
-
></consent-revocation-notice
|
|
5117
|
-
></slot>
|
|
5118
|
-
<consent-action-bar
|
|
5119
|
-
part="actions"
|
|
5120
|
-
agentName="${agentName}"
|
|
5121
|
-
theme="${this.theme}"
|
|
5122
|
-
?loading=${this.loading}
|
|
5123
|
-
?disabled=${this.approvalDisabled}
|
|
5124
|
-
submit-label=${this.submitLabel}
|
|
5125
|
-
cancel-label=${this.cancelLabel}
|
|
5126
|
-
exportparts="submit, cancel"
|
|
5127
|
-
@consent-allow=${this.onAllow}
|
|
5128
|
-
@consent-deny=${this.onDeny}
|
|
5129
|
-
></consent-action-bar>
|
|
5130
|
-
<slot name="footer"
|
|
5131
|
-
><consent-footer
|
|
5132
|
-
theme="${this.theme}"
|
|
5133
|
-
howItWorksUrl="${this.howItWorksUrl}"
|
|
5134
|
-
></consent-footer
|
|
5135
|
-
></slot>
|
|
5136
|
-
</div>
|
|
7495
|
+
</section>
|
|
5137
7496
|
`;
|
|
5138
7497
|
}
|
|
5139
7498
|
};
|
|
5140
|
-
|
|
5141
|
-
ConsentCapabilitiesScreen.styles = i`
|
|
7499
|
+
ConsentPhoneHandoff.styles = i`
|
|
5142
7500
|
:host {
|
|
5143
7501
|
display: block;
|
|
5144
|
-
|
|
5145
|
-
width: 100%;
|
|
5146
|
-
max-width: var(--cs-screen-max-width, 560px);
|
|
5147
|
-
margin: 0 auto;
|
|
7502
|
+
font-family: inherit;
|
|
5148
7503
|
}
|
|
5149
7504
|
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
background: var(--cs-surface-card);
|
|
5153
|
-
border: 1px solid var(--cs-surface-border);
|
|
5154
|
-
border-radius: 22px;
|
|
5155
|
-
box-shadow: var(--cs-card-shadow);
|
|
5156
|
-
padding: var(--cs-card-padding, 28px 28px 22px);
|
|
5157
|
-
display: flex;
|
|
5158
|
-
flex-direction: column;
|
|
5159
|
-
gap: var(--cs-card-gap, 22px);
|
|
5160
|
-
color: var(--cs-text-primary);
|
|
7505
|
+
:host([hidden]) {
|
|
7506
|
+
display: none;
|
|
5161
7507
|
}
|
|
5162
7508
|
|
|
5163
|
-
.
|
|
7509
|
+
.frame {
|
|
7510
|
+
display: grid;
|
|
7511
|
+
gap: 24px;
|
|
7512
|
+
padding: var(--cs-card-padding, 24px);
|
|
7513
|
+
border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.12));
|
|
7514
|
+
border-radius: var(--cs-card-radius, 16px);
|
|
7515
|
+
background: var(--cs-surface-card, #ffffff);
|
|
7516
|
+
box-shadow: var(--cs-card-shadow, 0 1px 2px rgba(15, 23, 42, 0.05));
|
|
7517
|
+
color: var(--cs-text-primary, #0f172a);
|
|
7518
|
+
}
|
|
7519
|
+
|
|
7520
|
+
.head {
|
|
7521
|
+
display: grid;
|
|
7522
|
+
gap: 8px;
|
|
7523
|
+
}
|
|
7524
|
+
|
|
7525
|
+
/* A title that wraps keeps its lines apart, and the icon stays centred
|
|
7526
|
+
on the first line. */
|
|
7527
|
+
.title {
|
|
5164
7528
|
display: flex;
|
|
5165
|
-
align-items:
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
7529
|
+
align-items: flex-start;
|
|
7530
|
+
gap: 8px;
|
|
7531
|
+
margin: 0;
|
|
7532
|
+
font-size: 16px;
|
|
5169
7533
|
font-weight: 600;
|
|
5170
|
-
|
|
5171
|
-
|
|
7534
|
+
line-height: 1.3;
|
|
7535
|
+
}
|
|
7536
|
+
|
|
7537
|
+
.title svg {
|
|
7538
|
+
flex: none;
|
|
7539
|
+
width: 16px;
|
|
7540
|
+
height: 16px;
|
|
7541
|
+
margin-top: calc((1.3em - 16px) / 2);
|
|
7542
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
7543
|
+
}
|
|
7544
|
+
|
|
7545
|
+
.body {
|
|
7546
|
+
margin: 0;
|
|
7547
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
7548
|
+
font-size: 14px;
|
|
7549
|
+
line-height: 1.45;
|
|
7550
|
+
}
|
|
7551
|
+
|
|
7552
|
+
.content {
|
|
7553
|
+
display: grid;
|
|
7554
|
+
justify-items: center;
|
|
5172
7555
|
gap: 12px;
|
|
5173
|
-
flex-wrap: wrap;
|
|
5174
7556
|
}
|
|
5175
7557
|
|
|
5176
|
-
.
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
7558
|
+
.box {
|
|
7559
|
+
padding: 12px;
|
|
7560
|
+
border-radius: 8px;
|
|
7561
|
+
background: var(--cs-qr-bg, #ffffff);
|
|
7562
|
+
line-height: 0;
|
|
5181
7563
|
}
|
|
5182
7564
|
|
|
5183
|
-
.
|
|
5184
|
-
display:
|
|
5185
|
-
|
|
7565
|
+
.code {
|
|
7566
|
+
display: block;
|
|
7567
|
+
width: var(--cs-qr-size, 148px);
|
|
7568
|
+
height: var(--cs-qr-size, 148px);
|
|
7569
|
+
color: var(--cs-qr-fg, #000000);
|
|
5186
7570
|
}
|
|
5187
7571
|
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
7572
|
+
.scan {
|
|
7573
|
+
justify-self: stretch;
|
|
7574
|
+
margin: 0;
|
|
7575
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
7576
|
+
font-size: 12px;
|
|
7577
|
+
line-height: 1.4;
|
|
5192
7578
|
}
|
|
5193
7579
|
`;
|
|
5194
|
-
__decorateClass([
|
|
5195
|
-
n4({ type: Array })
|
|
5196
|
-
], ConsentCapabilitiesScreen.prototype, "capabilities", 2);
|
|
5197
|
-
__decorateClass([
|
|
5198
|
-
n4({ type: Object })
|
|
5199
|
-
], ConsentCapabilitiesScreen.prototype, "agentMetadata", 2);
|
|
5200
|
-
__decorateClass([
|
|
5201
|
-
n4({ type: Object })
|
|
5202
|
-
], ConsentCapabilitiesScreen.prototype, "agentIdentity", 2);
|
|
5203
|
-
__decorateClass([
|
|
5204
|
-
n4({ type: Object })
|
|
5205
|
-
], ConsentCapabilitiesScreen.prototype, "cedarContext", 2);
|
|
5206
|
-
__decorateClass([
|
|
5207
|
-
n4({ type: String })
|
|
5208
|
-
], ConsentCapabilitiesScreen.prototype, "orgName", 2);
|
|
5209
|
-
__decorateClass([
|
|
5210
|
-
n4({ type: String })
|
|
5211
|
-
], ConsentCapabilitiesScreen.prototype, "headlineVerb", 2);
|
|
5212
7580
|
__decorateClass([
|
|
5213
7581
|
n4({ type: String })
|
|
5214
|
-
],
|
|
5215
|
-
__decorateClass([
|
|
5216
|
-
n4({ type: Number })
|
|
5217
|
-
], ConsentCapabilitiesScreen.prototype, "inactivityDays", 2);
|
|
5218
|
-
__decorateClass([
|
|
5219
|
-
n4({ type: Boolean, attribute: "fixed-expiry" })
|
|
5220
|
-
], ConsentCapabilitiesScreen.prototype, "fixedExpiry", 2);
|
|
5221
|
-
__decorateClass([
|
|
5222
|
-
n4({ type: Number, attribute: "fixed-expiry-days" })
|
|
5223
|
-
], ConsentCapabilitiesScreen.prototype, "fixedExpiryDays", 2);
|
|
7582
|
+
], ConsentPhoneHandoff.prototype, "url", 2);
|
|
5224
7583
|
__decorateClass([
|
|
5225
7584
|
n4({ type: String })
|
|
5226
|
-
],
|
|
5227
|
-
__decorateClass([
|
|
5228
|
-
n4({ type: String, attribute: "how-it-works-url" })
|
|
5229
|
-
], ConsentCapabilitiesScreen.prototype, "howItWorksUrl", 2);
|
|
5230
|
-
__decorateClass([
|
|
5231
|
-
n4({ type: Boolean })
|
|
5232
|
-
], ConsentCapabilitiesScreen.prototype, "loading", 2);
|
|
5233
|
-
__decorateClass([
|
|
5234
|
-
n4({ type: Boolean })
|
|
5235
|
-
], ConsentCapabilitiesScreen.prototype, "disabled", 2);
|
|
7585
|
+
], ConsentPhoneHandoff.prototype, "heading", 2);
|
|
5236
7586
|
__decorateClass([
|
|
5237
7587
|
n4({ type: String })
|
|
5238
|
-
],
|
|
5239
|
-
__decorateClass([
|
|
5240
|
-
n4({ type: String, attribute: "submit-label" })
|
|
5241
|
-
], ConsentCapabilitiesScreen.prototype, "submitLabel", 2);
|
|
5242
|
-
__decorateClass([
|
|
5243
|
-
n4({ type: String, attribute: "cancel-label" })
|
|
5244
|
-
], ConsentCapabilitiesScreen.prototype, "cancelLabel", 2);
|
|
7588
|
+
], ConsentPhoneHandoff.prototype, "description", 2);
|
|
5245
7589
|
__decorateClass([
|
|
5246
|
-
n4({ type: Boolean,
|
|
5247
|
-
],
|
|
5248
|
-
__decorateClass([
|
|
5249
|
-
|
|
5250
|
-
],
|
|
5251
|
-
__decorateClass([
|
|
5252
|
-
n4({ type: String, attribute: "server-domain" })
|
|
5253
|
-
], ConsentCapabilitiesScreen.prototype, "serverDomain", 2);
|
|
5254
|
-
__decorateClass([
|
|
5255
|
-
n4({ type: String, attribute: "logo-dev-token" })
|
|
5256
|
-
], ConsentCapabilitiesScreen.prototype, "logoDevToken", 2);
|
|
5257
|
-
__decorateClass([
|
|
5258
|
-
n4({ type: String, attribute: "server-logo-url" })
|
|
5259
|
-
], ConsentCapabilitiesScreen.prototype, "serverLogoUrl", 2);
|
|
5260
|
-
__decorateClass([
|
|
5261
|
-
n4({ type: Boolean, attribute: "require-all" })
|
|
5262
|
-
], ConsentCapabilitiesScreen.prototype, "requireAll", 2);
|
|
5263
|
-
__decorateClass([
|
|
5264
|
-
r5()
|
|
5265
|
-
], ConsentCapabilitiesScreen.prototype, "selected", 2);
|
|
5266
|
-
ConsentCapabilitiesScreen = __decorateClass([
|
|
5267
|
-
t3("consent-capabilities-screen")
|
|
5268
|
-
], ConsentCapabilitiesScreen);
|
|
7590
|
+
n4({ type: Boolean, attribute: "updates-on-its-own" })
|
|
7591
|
+
], ConsentPhoneHandoff.prototype, "updatesOnItsOwn", 2);
|
|
7592
|
+
ConsentPhoneHandoff = __decorateClass([
|
|
7593
|
+
t3("consent-phone-handoff")
|
|
7594
|
+
], ConsentPhoneHandoff);
|
|
5269
7595
|
|
|
5270
7596
|
// src/resolution/resolve-copy.ts
|
|
5271
7597
|
var AGENT_NAME_PLACEHOLDER = "[AI Agent]";
|
|
@@ -5694,8 +8020,8 @@ var McpConsent = class extends i4 {
|
|
|
5694
8020
|
* @fires mcp-consent:approve - Emitted when consent is successfully submitted
|
|
5695
8021
|
* @fires mcp-consent:error - Emitted if consent submission fails
|
|
5696
8022
|
*/
|
|
5697
|
-
async handleApprove(
|
|
5698
|
-
|
|
8023
|
+
async handleApprove(e10) {
|
|
8024
|
+
e10?.preventDefault();
|
|
5699
8025
|
if (this.nativeScopeSelection && this.requestExpiresAt > 0 && Date.now() >= this.requestExpiresAt)
|
|
5700
8026
|
this.setApprovalRecovery("kyaos/pickup-expired");
|
|
5701
8027
|
if (this.approvalRecovery) return;
|
|
@@ -5825,10 +8151,10 @@ var McpConsent = class extends i4 {
|
|
|
5825
8151
|
composed: true
|
|
5826
8152
|
})
|
|
5827
8153
|
);
|
|
5828
|
-
} catch (
|
|
8154
|
+
} catch (e11) {
|
|
5829
8155
|
if (this.nativeScopeSelection && !credentialsRejected && !this.approvalRecovery)
|
|
5830
8156
|
this.setApprovalRecovery("kyaos/consent-request-unavailable");
|
|
5831
|
-
const message = this.approvalRecoveryMessage() ?? (
|
|
8157
|
+
const message = this.approvalRecoveryMessage() ?? (e11 instanceof Error ? e11.message : "Unknown error");
|
|
5832
8158
|
this.error = message;
|
|
5833
8159
|
this.dispatchEvent(
|
|
5834
8160
|
new CustomEvent("mcp-consent:error", {
|
|
@@ -5856,8 +8182,8 @@ var McpConsent = class extends i4 {
|
|
|
5856
8182
|
this.closeFailed = true;
|
|
5857
8183
|
}, 300);
|
|
5858
8184
|
}
|
|
5859
|
-
handleTermsChange(
|
|
5860
|
-
this.termsAccepted =
|
|
8185
|
+
handleTermsChange(e10) {
|
|
8186
|
+
this.termsAccepted = e10.detail.checked;
|
|
5861
8187
|
}
|
|
5862
8188
|
handleInputChange(name, value) {
|
|
5863
8189
|
this.formData = { ...this.formData, [name]: value };
|
|
@@ -5924,8 +8250,8 @@ var McpConsent = class extends i4 {
|
|
|
5924
8250
|
${this.renderNativeAgentKey()}
|
|
5925
8251
|
`;
|
|
5926
8252
|
}
|
|
5927
|
-
handlePermissionsChange(
|
|
5928
|
-
this.selectedScopes =
|
|
8253
|
+
handlePermissionsChange(e10) {
|
|
8254
|
+
this.selectedScopes = e10.detail.selected;
|
|
5929
8255
|
}
|
|
5930
8256
|
renderPermissions() {
|
|
5931
8257
|
if (this.scopes.length === 0) return A;
|
|
@@ -6093,9 +8419,9 @@ var McpConsent = class extends i4 {
|
|
|
6093
8419
|
placeholder=${creds?.usernamePlaceholder ?? "Enter your username"}
|
|
6094
8420
|
autocomplete="username"
|
|
6095
8421
|
required
|
|
6096
|
-
@input=${(
|
|
6097
|
-
const customEvent =
|
|
6098
|
-
const value = customEvent.detail?.value ??
|
|
8422
|
+
@input=${(e10) => {
|
|
8423
|
+
const customEvent = e10;
|
|
8424
|
+
const value = customEvent.detail?.value ?? e10.target?.value ?? "";
|
|
6099
8425
|
this.handleInputChange("username", value);
|
|
6100
8426
|
}}
|
|
6101
8427
|
></consent-input>
|
|
@@ -6107,9 +8433,9 @@ var McpConsent = class extends i4 {
|
|
|
6107
8433
|
placeholder=${creds?.passwordPlaceholder ?? "Enter your password"}
|
|
6108
8434
|
autocomplete="current-password"
|
|
6109
8435
|
required
|
|
6110
|
-
@input=${(
|
|
6111
|
-
const customEvent =
|
|
6112
|
-
const value = customEvent.detail?.value ??
|
|
8436
|
+
@input=${(e10) => {
|
|
8437
|
+
const customEvent = e10;
|
|
8438
|
+
const value = customEvent.detail?.value ?? e10.target?.value ?? "";
|
|
6113
8439
|
this.handleInputChange("password", value);
|
|
6114
8440
|
}}
|
|
6115
8441
|
></consent-input>
|
|
@@ -6192,9 +8518,9 @@ var McpConsent = class extends i4 {
|
|
|
6192
8518
|
placeholder=${ml?.emailPlaceholder ?? "Enter your email address"}
|
|
6193
8519
|
autocomplete="email"
|
|
6194
8520
|
required
|
|
6195
|
-
@input=${(
|
|
6196
|
-
const customEvent =
|
|
6197
|
-
const value = customEvent.detail?.value ??
|
|
8521
|
+
@input=${(e10) => {
|
|
8522
|
+
const customEvent = e10;
|
|
8523
|
+
const value = customEvent.detail?.value ?? e10.target?.value ?? "";
|
|
6198
8524
|
this.handleInputChange("email", value);
|
|
6199
8525
|
}}
|
|
6200
8526
|
></consent-input>
|
|
@@ -6228,14 +8554,14 @@ var McpConsent = class extends i4 {
|
|
|
6228
8554
|
length=${otp?.digits ?? 6}
|
|
6229
8555
|
name="otp"
|
|
6230
8556
|
auto-focus
|
|
6231
|
-
@complete=${(
|
|
6232
|
-
const customEvent =
|
|
8557
|
+
@complete=${(e10) => {
|
|
8558
|
+
const customEvent = e10;
|
|
6233
8559
|
const value = customEvent.detail?.value ?? "";
|
|
6234
8560
|
this.handleInputChange("otp", value);
|
|
6235
8561
|
this.handleApprove();
|
|
6236
8562
|
}}
|
|
6237
|
-
@input=${(
|
|
6238
|
-
const customEvent =
|
|
8563
|
+
@input=${(e10) => {
|
|
8564
|
+
const customEvent = e10;
|
|
6239
8565
|
const value = customEvent.detail?.value ?? "";
|
|
6240
8566
|
this.handleInputChange("otp", value);
|
|
6241
8567
|
}}
|
|
@@ -6505,8 +8831,11 @@ McpConsent.styles = i`
|
|
|
6505
8831
|
}
|
|
6506
8832
|
|
|
6507
8833
|
/* Agent info box */
|
|
8834
|
+
/* In a narrow card the request moves under its icon rather than
|
|
8835
|
+
squeezing into a column a word wide. */
|
|
6508
8836
|
.agent-info {
|
|
6509
8837
|
display: flex;
|
|
8838
|
+
flex-wrap: wrap;
|
|
6510
8839
|
gap: 1rem;
|
|
6511
8840
|
padding: 1rem;
|
|
6512
8841
|
background: #f9fafb;
|
|
@@ -6532,7 +8861,8 @@ McpConsent.styles = i`
|
|
|
6532
8861
|
}
|
|
6533
8862
|
|
|
6534
8863
|
.agent-text {
|
|
6535
|
-
flex: 1;
|
|
8864
|
+
flex: 1 1 140px;
|
|
8865
|
+
min-width: 0;
|
|
6536
8866
|
}
|
|
6537
8867
|
|
|
6538
8868
|
.agent-text p {
|
|
@@ -6572,6 +8902,19 @@ McpConsent.styles = i`
|
|
|
6572
8902
|
min-width: 0;
|
|
6573
8903
|
}
|
|
6574
8904
|
|
|
8905
|
+
/* Cancel and Allow share the footer equally. When they don't both fit,
|
|
8906
|
+
they stack full width with Allow on top (wrap-reverse), nearest the
|
|
8907
|
+
request it answers. */
|
|
8908
|
+
[slot="footer"] {
|
|
8909
|
+
display: flex;
|
|
8910
|
+
flex-wrap: wrap-reverse;
|
|
8911
|
+
gap: 0.75rem;
|
|
8912
|
+
}
|
|
8913
|
+
|
|
8914
|
+
[slot="footer"] > consent-button {
|
|
8915
|
+
flex: 1 1 140px;
|
|
8916
|
+
}
|
|
8917
|
+
|
|
6575
8918
|
[slot="agent-key"] .agent-key {
|
|
6576
8919
|
margin-bottom: 0;
|
|
6577
8920
|
}
|
|
@@ -7136,15 +9479,15 @@ McpConsent = __decorateClass([
|
|
|
7136
9479
|
t3("mcp-consent")
|
|
7137
9480
|
], McpConsent);
|
|
7138
9481
|
|
|
7139
|
-
// ../../node_modules/.pnpm/@kya-os+id@0.
|
|
9482
|
+
// ../../node_modules/.pnpm/@kya-os+id@0.8.0_@cfworker+json-schema@4.1.1_better-auth@1.7.7_@opentelemetry+api@1.9.0_e82dbb56096291ceb7712125c72d027a/node_modules/@kya-os/id/dist/base64url.js
|
|
7140
9483
|
function bytesToBase64Url(bytes) {
|
|
7141
9484
|
let b642;
|
|
7142
9485
|
if (typeof Buffer !== "undefined") {
|
|
7143
9486
|
b642 = Buffer.from(bytes).toString("base64");
|
|
7144
9487
|
} else {
|
|
7145
9488
|
let bin = "";
|
|
7146
|
-
for (let
|
|
7147
|
-
bin += String.fromCharCode(bytes[
|
|
9489
|
+
for (let i7 = 0; i7 < bytes.length; i7++)
|
|
9490
|
+
bin += String.fromCharCode(bytes[i7]);
|
|
7148
9491
|
b642 = btoa(bin);
|
|
7149
9492
|
}
|
|
7150
9493
|
return b642.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
@@ -7158,27 +9501,27 @@ function base64UrlToBytes(b64url) {
|
|
|
7158
9501
|
}
|
|
7159
9502
|
const bin = atob(b642);
|
|
7160
9503
|
const out = new Uint8Array(bin.length);
|
|
7161
|
-
for (let
|
|
7162
|
-
out[
|
|
9504
|
+
for (let i7 = 0; i7 < bin.length; i7++)
|
|
9505
|
+
out[i7] = bin.charCodeAt(i7);
|
|
7163
9506
|
return out;
|
|
7164
9507
|
}
|
|
7165
|
-
function base64UrlToBytesStrict(
|
|
7166
|
-
if (typeof
|
|
9508
|
+
function base64UrlToBytesStrict(s5) {
|
|
9509
|
+
if (typeof s5 !== "string")
|
|
7167
9510
|
return null;
|
|
7168
|
-
if (!/^[A-Za-z0-9_-]*$/.test(
|
|
9511
|
+
if (!/^[A-Za-z0-9_-]*$/.test(s5) || s5.length % 4 === 1)
|
|
7169
9512
|
return null;
|
|
7170
|
-
const bytes = base64UrlToBytes(
|
|
7171
|
-
return bytesToBase64Url(bytes) ===
|
|
9513
|
+
const bytes = base64UrlToBytes(s5);
|
|
9514
|
+
return bytesToBase64Url(bytes) === s5 ? bytes : null;
|
|
7172
9515
|
}
|
|
7173
9516
|
|
|
7174
|
-
// ../../node_modules/.pnpm/@kya-os+id@0.
|
|
9517
|
+
// ../../node_modules/.pnpm/@kya-os+id@0.8.0_@cfworker+json-schema@4.1.1_better-auth@1.7.7_@opentelemetry+api@1.9.0_e82dbb56096291ceb7712125c72d027a/node_modules/@kya-os/id/dist/passkey/types.js
|
|
7175
9518
|
var PASSKEY_COSE_ALGORITHMS = Object.freeze([
|
|
7176
9519
|
-8,
|
|
7177
9520
|
-7,
|
|
7178
9521
|
-257
|
|
7179
9522
|
]);
|
|
7180
9523
|
|
|
7181
|
-
// ../../node_modules/.pnpm/@kya-os+id@0.
|
|
9524
|
+
// ../../node_modules/.pnpm/@kya-os+id@0.8.0_@cfworker+json-schema@4.1.1_better-auth@1.7.7_@opentelemetry+api@1.9.0_e82dbb56096291ceb7712125c72d027a/node_modules/@kya-os/id/dist/wallet/passkey.js
|
|
7182
9525
|
var PasskeyCeremonyError = class extends Error {
|
|
7183
9526
|
constructor(code, message, options) {
|
|
7184
9527
|
super(message, options);
|
|
@@ -7196,16 +9539,16 @@ async function isPasskeySupported() {
|
|
|
7196
9539
|
return false;
|
|
7197
9540
|
return credentialsContainer() !== null;
|
|
7198
9541
|
}
|
|
7199
|
-
async function createPasskey(
|
|
9542
|
+
async function createPasskey(o9) {
|
|
7200
9543
|
const json = {
|
|
7201
|
-
rp: { id:
|
|
7202
|
-
user: { id:
|
|
7203
|
-
challenge:
|
|
9544
|
+
rp: { id: o9.rpId, name: o9.rpName },
|
|
9545
|
+
user: { id: o9.user.id, name: o9.user.name, displayName: o9.user.displayName },
|
|
9546
|
+
challenge: o9.challenge,
|
|
7204
9547
|
pubKeyCredParams: PASSKEY_COSE_ALGORITHMS.map((alg) => ({
|
|
7205
9548
|
type: "public-key",
|
|
7206
9549
|
alg
|
|
7207
9550
|
})),
|
|
7208
|
-
excludeCredentials: (
|
|
9551
|
+
excludeCredentials: (o9.excludeCredentialIds ?? []).map((id) => ({
|
|
7209
9552
|
id,
|
|
7210
9553
|
type: "public-key"
|
|
7211
9554
|
})),
|
|
@@ -7215,15 +9558,15 @@ async function createPasskey(o8) {
|
|
|
7215
9558
|
userVerification: "required"
|
|
7216
9559
|
},
|
|
7217
9560
|
attestation: "none",
|
|
7218
|
-
...
|
|
9561
|
+
...o9.timeoutMs === void 0 ? {} : { timeout: o9.timeoutMs }
|
|
7219
9562
|
};
|
|
7220
9563
|
const manual = {
|
|
7221
9564
|
...json,
|
|
7222
9565
|
user: { ...json.user, id: toBuffer(json.user.id, "user.id") },
|
|
7223
9566
|
challenge: toBuffer(json.challenge, "challenge"),
|
|
7224
|
-
excludeCredentials: json.excludeCredentials.map((
|
|
7225
|
-
...
|
|
7226
|
-
id: toBuffer(
|
|
9567
|
+
excludeCredentials: json.excludeCredentials.map((c5) => ({
|
|
9568
|
+
...c5,
|
|
9569
|
+
id: toBuffer(c5.id, "excludeCredentialIds[]")
|
|
7227
9570
|
}))
|
|
7228
9571
|
};
|
|
7229
9572
|
const container = requireCredentialsContainer();
|
|
@@ -7240,23 +9583,23 @@ async function createPasskey(o8) {
|
|
|
7240
9583
|
}
|
|
7241
9584
|
return registrationToJSON(credential);
|
|
7242
9585
|
}
|
|
7243
|
-
async function getPasskeyAssertion(
|
|
9586
|
+
async function getPasskeyAssertion(o9) {
|
|
7244
9587
|
const json = {
|
|
7245
|
-
challenge:
|
|
7246
|
-
rpId:
|
|
7247
|
-
allowCredentials: (
|
|
9588
|
+
challenge: o9.challenge,
|
|
9589
|
+
rpId: o9.rpId,
|
|
9590
|
+
allowCredentials: (o9.allowCredentialIds ?? []).map((id) => ({
|
|
7248
9591
|
id,
|
|
7249
9592
|
type: "public-key"
|
|
7250
9593
|
})),
|
|
7251
9594
|
userVerification: "required",
|
|
7252
|
-
...
|
|
9595
|
+
...o9.timeoutMs === void 0 ? {} : { timeout: o9.timeoutMs }
|
|
7253
9596
|
};
|
|
7254
9597
|
const manual = {
|
|
7255
9598
|
...json,
|
|
7256
9599
|
challenge: toBuffer(json.challenge, "challenge"),
|
|
7257
|
-
allowCredentials: json.allowCredentials.map((
|
|
7258
|
-
...
|
|
7259
|
-
id: toBuffer(
|
|
9600
|
+
allowCredentials: json.allowCredentials.map((c5) => ({
|
|
9601
|
+
...c5,
|
|
9602
|
+
id: toBuffer(c5.id, "allowCredentialIds[]")
|
|
7260
9603
|
}))
|
|
7261
9604
|
};
|
|
7262
9605
|
const container = requireCredentialsContainer();
|