burnledger 0.8.0 → 0.9.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 +139 -2
- package/dist/cjs/anchor.d.ts +5 -3
- package/dist/cjs/anchor.d.ts.map +1 -1
- package/dist/cjs/anchor.js +10 -4
- package/dist/cjs/anchor.js.map +1 -1
- package/dist/cjs/client.d.ts +95 -0
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +133 -2
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/customer-keys.d.ts +146 -0
- package/dist/cjs/customer-keys.d.ts.map +1 -0
- package/dist/cjs/customer-keys.js +465 -0
- package/dist/cjs/customer-keys.js.map +1 -0
- package/dist/cjs/enclave-registration.d.ts +153 -0
- package/dist/cjs/enclave-registration.d.ts.map +1 -0
- package/dist/cjs/enclave-registration.js +275 -0
- package/dist/cjs/enclave-registration.js.map +1 -0
- package/dist/cjs/enclave-seal.d.ts +43 -0
- package/dist/cjs/enclave-seal.d.ts.map +1 -1
- package/dist/cjs/enclave-seal.js +62 -1
- package/dist/cjs/enclave-seal.js.map +1 -1
- package/dist/cjs/errors.d.ts +10 -0
- package/dist/cjs/errors.d.ts.map +1 -1
- package/dist/cjs/errors.js +11 -1
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/index.browser.d.ts +7 -3
- package/dist/cjs/index.browser.d.ts.map +1 -1
- package/dist/cjs/index.browser.js +6 -3
- package/dist/cjs/index.browser.js.map +1 -1
- package/dist/cjs/index.d.ts +23 -9
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +40 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/key-group.d.ts +80 -0
- package/dist/cjs/key-group.d.ts.map +1 -0
- package/dist/cjs/key-group.js +136 -0
- package/dist/cjs/key-group.js.map +1 -0
- package/dist/cjs/models.d.ts +60 -0
- package/dist/cjs/models.d.ts.map +1 -1
- package/dist/cjs/models.js +63 -0
- package/dist/cjs/models.js.map +1 -1
- package/dist/cjs/status-document.d.ts +25 -0
- package/dist/cjs/status-document.d.ts.map +1 -0
- package/dist/cjs/status-document.js +62 -0
- package/dist/cjs/status-document.js.map +1 -0
- package/dist/cjs/verify.d.ts +112 -3
- package/dist/cjs/verify.d.ts.map +1 -1
- package/dist/cjs/verify.js +393 -146
- package/dist/cjs/verify.js.map +1 -1
- package/dist/cjs/web-verifier.d.ts +23 -3
- package/dist/cjs/web-verifier.d.ts.map +1 -1
- package/dist/cjs/web-verifier.js +31 -5
- package/dist/cjs/web-verifier.js.map +1 -1
- package/dist/esm/anchor.d.ts +5 -3
- package/dist/esm/anchor.d.ts.map +1 -1
- package/dist/esm/anchor.js +10 -4
- package/dist/esm/anchor.js.map +1 -1
- package/dist/esm/cli.d.ts +13 -19
- package/dist/esm/cli.d.ts.map +1 -1
- package/dist/esm/cli.js +109 -81
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/client.d.ts +95 -0
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +133 -2
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/customer-keys.d.ts +146 -0
- package/dist/esm/customer-keys.d.ts.map +1 -0
- package/dist/esm/customer-keys.js +450 -0
- package/dist/esm/customer-keys.js.map +1 -0
- package/dist/esm/enclave-registration.d.ts +153 -0
- package/dist/esm/enclave-registration.d.ts.map +1 -0
- package/dist/esm/enclave-registration.js +265 -0
- package/dist/esm/enclave-registration.js.map +1 -0
- package/dist/esm/enclave-seal.d.ts +43 -0
- package/dist/esm/enclave-seal.d.ts.map +1 -1
- package/dist/esm/enclave-seal.js +61 -1
- package/dist/esm/enclave-seal.js.map +1 -1
- package/dist/esm/errors.d.ts +10 -0
- package/dist/esm/errors.d.ts.map +1 -1
- package/dist/esm/errors.js +10 -0
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/index.browser.d.ts +7 -3
- package/dist/esm/index.browser.d.ts.map +1 -1
- package/dist/esm/index.browser.js +6 -3
- package/dist/esm/index.browser.js.map +1 -1
- package/dist/esm/index.d.ts +23 -9
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +18 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/key-group.d.ts +80 -0
- package/dist/esm/key-group.d.ts.map +1 -0
- package/dist/esm/key-group.js +130 -0
- package/dist/esm/key-group.js.map +1 -0
- package/dist/esm/models.d.ts +60 -0
- package/dist/esm/models.d.ts.map +1 -1
- package/dist/esm/models.js +59 -0
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/status-document.d.ts +25 -0
- package/dist/esm/status-document.d.ts.map +1 -0
- package/dist/esm/status-document.js +59 -0
- package/dist/esm/status-document.js.map +1 -0
- package/dist/esm/verify.d.ts +112 -3
- package/dist/esm/verify.d.ts.map +1 -1
- package/dist/esm/verify.js +390 -147
- package/dist/esm/verify.js.map +1 -1
- package/dist/esm/web-verifier.d.ts +23 -3
- package/dist/esm/web-verifier.d.ts.map +1 -1
- package/dist/esm/web-verifier.js +27 -5
- package/dist/esm/web-verifier.js.map +1 -1
- package/package.json +1 -1
- package/src/anchor.ts +10 -4
- package/src/cli.ts +122 -79
- package/src/client.ts +198 -6
- package/src/customer-keys.ts +550 -0
- package/src/enclave-registration.ts +390 -0
- package/src/enclave-seal.ts +108 -1
- package/src/errors.ts +11 -0
- package/src/index.browser.ts +9 -3
- package/src/index.ts +48 -6
- package/src/key-group.ts +181 -0
- package/src/models.ts +131 -0
- package/src/status-document.ts +59 -0
- package/src/verify.ts +503 -152
- package/src/web-verifier.ts +36 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Reading a status statement as the status endpoint serves it, before anything
|
|
2
|
+
* verifies it. Shared by the CLI and the /verify page's status button, so the two
|
|
3
|
+
* agree on what counts as a statement: an answer that is not one is silence
|
|
4
|
+
* about revocation, while a statement that is one and fails is a refusal. */
|
|
5
|
+
/** The API wraps every response in {"data": ...}; a caller may hand over either
|
|
6
|
+
* the envelope or the document inside it. Mirrors
|
|
7
|
+
* core.ParseCertificateStatusDocument, so this CLI and the Go one cannot
|
|
8
|
+
* disagree about which shape the endpoint returns. Exported for testing.
|
|
9
|
+
*
|
|
10
|
+
* A document that does not parse THROWS, and the caller turns that into a
|
|
11
|
+
* warning and a VALID_REVOCATION_UNKNOWN verdict. That is deliberate: an answer
|
|
12
|
+
* this build cannot read is silence about revocation, not a finding about the
|
|
13
|
+
* certificate. Handing a half-read document to the verifier instead would
|
|
14
|
+
* report "status statement signature is invalid" — a claim about the issuer —
|
|
15
|
+
* when what actually happened is that something returned nonsense.
|
|
16
|
+
*
|
|
17
|
+
* `status` itself is NOT validated against a known set. A statement saying
|
|
18
|
+
* SUSPENDED is a statement this build cannot read, and the verifier already has
|
|
19
|
+
* the right answer for that: it authenticates the signature first, then reports
|
|
20
|
+
* VALID_REVOCATION_UNKNOWN. Refusing it here would discard the statement before
|
|
21
|
+
* anyone authenticated it. */
|
|
22
|
+
export function unwrapStatusStatement(parsed) {
|
|
23
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
24
|
+
throw new Error("status statement: response is not a JSON object");
|
|
25
|
+
}
|
|
26
|
+
let doc = parsed;
|
|
27
|
+
if (doc.certificate_id === undefined && doc.data !== null && typeof doc.data === "object") {
|
|
28
|
+
doc = doc.data;
|
|
29
|
+
}
|
|
30
|
+
for (const f of ["certificate_id", "status", "key_id"]) {
|
|
31
|
+
if (typeof doc[f] !== "string" || doc[f] === "")
|
|
32
|
+
throw new Error(`status statement: ${f} is missing`);
|
|
33
|
+
}
|
|
34
|
+
for (const f of ["statement_issued_at", "statement_expires_at"])
|
|
35
|
+
requireRfc3339(doc, f);
|
|
36
|
+
if (doc.revoked_at != null)
|
|
37
|
+
requireRfc3339(doc, "revoked_at");
|
|
38
|
+
if (typeof doc.sth_tree_size !== "number")
|
|
39
|
+
throw new Error("status statement: sth_tree_size is not a number");
|
|
40
|
+
// Refuse a short or long value rather than letting it through: a truncated
|
|
41
|
+
// signature or root hash that reaches the verifier is checked against bytes
|
|
42
|
+
// nobody sent.
|
|
43
|
+
requireHex(doc, "sth_root_hash", 32);
|
|
44
|
+
requireHex(doc, "signature", 64);
|
|
45
|
+
return doc;
|
|
46
|
+
}
|
|
47
|
+
function requireRfc3339(doc, field) {
|
|
48
|
+
const v = doc[field];
|
|
49
|
+
if (typeof v !== "string" || Number.isNaN(Date.parse(v))) {
|
|
50
|
+
throw new Error(`status statement: ${field} is not RFC 3339`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function requireHex(doc, field, bytes) {
|
|
54
|
+
const v = doc[field];
|
|
55
|
+
if (typeof v !== "string" || !new RegExp(`^[0-9a-fA-F]{${bytes * 2}}$`).test(v)) {
|
|
56
|
+
throw new Error(`status statement: ${field} is not ${bytes} bytes of hex`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=status-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-document.js","sourceRoot":"","sources":["../../src/status-document.ts"],"names":[],"mappings":"AAAA;;;6EAG6E;AAI7E;;;;;;;;;;;;;;;;8BAgB8B;AAC9B,MAAM,UAAU,qBAAqB,CAAC,MAAe;IACnD,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,IAAI,GAAG,GAAG,MAAyB,CAAC;IACpC,IAAI,GAAG,CAAC,cAAc,KAAK,SAAS,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC1F,GAAG,GAAG,GAAG,CAAC,IAAuB,CAAC;IACpC,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;QACvD,IAAI,OAAO,GAAG,CAAC,CAAC,C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AqB,KAAK,WAAW,KAAK,eAAe,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
package/dist/esm/verify.d.ts
CHANGED
|
@@ -28,6 +28,9 @@ import type { TransparencyResult, VerificationResult } from "./models.js";
|
|
|
28
28
|
* script on the page could otherwise push a version onto it.
|
|
29
29
|
*/
|
|
30
30
|
export declare const KNOWN_FORMAT_VERSIONS: readonly string[];
|
|
31
|
+
/** Decode hex: whole bytes, digits in either case, nothing else. Anything else
|
|
32
|
+
* throws TypeError. It is exported, so its input is a boundary: reading a stray
|
|
33
|
+
* character as 0, as it once did, turned a typo into different bytes. */
|
|
31
34
|
export declare function hexToBytes(hex: string): Uint8Array;
|
|
32
35
|
export declare function bytesToHex(bytes: Uint8Array): string;
|
|
33
36
|
/** A signing key's disposition (ADR-017 §1).
|
|
@@ -110,8 +113,90 @@ export declare function evaluateKey(pki: PublicKeyInfo, anchor: number | null):
|
|
|
110
113
|
*/
|
|
111
114
|
export declare function certificateAnchor(certificate: Record<string, unknown>): number | null;
|
|
112
115
|
type Cert = Record<string, unknown>;
|
|
116
|
+
/**
|
|
117
|
+
* Require what ADR-025 lets a record prove: that a key group you name signed the
|
|
118
|
+
* registration the enclave checked each system against before measuring it.
|
|
119
|
+
*
|
|
120
|
+
* A pass means each required system is `certified` under one of
|
|
121
|
+
* `customerKeyIds`, in a record from an enclave image of wire protocol 12 or
|
|
122
|
+
* later — the first that registers a system only with that key group's
|
|
123
|
+
* signatures. A record from an earlier image (PRE_PROTOCOL_12_IMAGES), or one
|
|
124
|
+
* that names no image, fails: those images could say `certified` with no
|
|
125
|
+
* customer signature at all.
|
|
126
|
+
*
|
|
127
|
+
* Off unless asked for, because a record that says `authorization: none` is
|
|
128
|
+
* still a genuine record. Whoever relays requests to the enclave can always
|
|
129
|
+
* leave a registration out (ADR-025 §5, §8), and the enclave cannot refuse that
|
|
130
|
+
* for want of durable state. So "my systems must be certified" can be enforced
|
|
131
|
+
* in one place only: here, by the party relying on the record.
|
|
132
|
+
*/
|
|
133
|
+
export interface AuthorizationPolicy {
|
|
134
|
+
/** The system_ids that must be certified. Omitted: every system the record covers. */
|
|
135
|
+
readonly systems?: readonly string[];
|
|
136
|
+
/**
|
|
137
|
+
* The key groups you accept. Required: `certified` under a key id you did not
|
|
138
|
+
* name proves nothing to you, because the relay can enroll a key group of its
|
|
139
|
+
* own and the record would name that one.
|
|
140
|
+
*/
|
|
141
|
+
readonly customerKeyIds: readonly string[];
|
|
142
|
+
}
|
|
143
|
+
export interface VerifyOptions {
|
|
144
|
+
/**
|
|
145
|
+
* Refuse the record, with a VerificationError whose code is
|
|
146
|
+
* AUTHORIZATION_POLICY_FAILED, unless it meets this policy. Omitted: no
|
|
147
|
+
* requirement, and `authorization: none` verifies as it always has.
|
|
148
|
+
*/
|
|
149
|
+
readonly requireAuthorization?: AuthorizationPolicy;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The enclave images that issued format 9.0 while running wire protocol 11 or
|
|
153
|
+
* earlier, by PCR0, as the published measurement history records them
|
|
154
|
+
* (website/docs/enclave-measurements/, docs/CONNECTOR-STATUS.md).
|
|
155
|
+
*
|
|
156
|
+
* Their `certified` is not evidence of a customer signature. Before protocol 12
|
|
157
|
+
* the enclave enrolled a key group with no proof that anyone held its keys, and
|
|
158
|
+
* registered a system for whoever relayed the authorization — so the host could
|
|
159
|
+
* make a genuine 9.0 record say `certified`, under a key id it chose, with no
|
|
160
|
+
* customer signature anywhere (reproduced by an independent re-review,
|
|
161
|
+
* 2026-09-13).
|
|
162
|
+
*
|
|
163
|
+
* THE SET IS CLOSED BY POLICY, NOT BY ENFORCEMENT: the release runbook forbids
|
|
164
|
+
* admitting or rolling back to an image of protocol 11 or earlier once any
|
|
165
|
+
* customer key is enrolled, and admitting one takes a KMS re-pin, which ADR-027
|
|
166
|
+
* leaves to the owner. The protocol-12 cutover's KMS tighten drops every
|
|
167
|
+
* measurement here from the signing key's policy, after which none of them can
|
|
168
|
+
* sign. v42 ran for seven minutes and is recorded as issuing nothing; it is here
|
|
169
|
+
* because it held the signing key while it ran.
|
|
170
|
+
*
|
|
171
|
+
* The Python SDK carries the same list, in _verify.py.
|
|
172
|
+
*/
|
|
173
|
+
export declare const PRE_PROTOCOL_12_IMAGES: ReadonlyMap<string, string>;
|
|
174
|
+
/**
|
|
175
|
+
* What a record's signed issuer.enclave_pcr0 makes of `certified`: whether the
|
|
176
|
+
* image that signed it could mark a system certified without the customer's
|
|
177
|
+
* signature. "protocol-12-or-later" is the inference the closed list licenses:
|
|
178
|
+
* a genuine 9.0 record under any other measurement was signed by a later image.
|
|
179
|
+
*/
|
|
180
|
+
export type IssuingImage = {
|
|
181
|
+
readonly kind: "unnamed";
|
|
182
|
+
} | {
|
|
183
|
+
readonly kind: "before-protocol-12";
|
|
184
|
+
readonly name: string;
|
|
185
|
+
readonly pcr0: string;
|
|
186
|
+
} | {
|
|
187
|
+
readonly kind: "protocol-12-or-later";
|
|
188
|
+
readonly pcr0: string;
|
|
189
|
+
};
|
|
190
|
+
export declare function issuingImage(certificate: Cert): IssuingImage;
|
|
191
|
+
/**
|
|
192
|
+
* What `certified` is evidence of, given the image that signed the record: the
|
|
193
|
+
* words every verifier prints after "certified under <key id> —". The Go CLI
|
|
194
|
+
* (cmd/cli/registration_image.go), both SDK CLIs and the /verify page state it
|
|
195
|
+
* identically, and testdata/registration_line_cases.json holds them to it.
|
|
196
|
+
*/
|
|
197
|
+
export declare function registrationQualifier(image: IssuingImage): string;
|
|
113
198
|
/** Verify all signatures on a deletion certificate offline. */
|
|
114
|
-
export declare function verifyCertificate(crypto: CryptoOps, certificate: Cert, publicKeys: Map<string, PublicKeyInfo
|
|
199
|
+
export declare function verifyCertificate(crypto: CryptoOps, certificate: Cert, publicKeys: Map<string, PublicKeyInfo>, options?: VerifyOptions): Promise<VerificationResult>;
|
|
115
200
|
/** Verify the transparency proof embedded in a certificate. */
|
|
116
201
|
export declare function verifyTransparency(crypto: CryptoOps, certificate: Cert, publicKeys: Map<string, PublicKeyInfo>): Promise<TransparencyResult>;
|
|
117
202
|
/** Reconstruct the certificate JSON as it existed at issuance time.
|
|
@@ -125,6 +210,10 @@ export declare function verifyTransparency(crypto: CryptoOps, certificate: Cert,
|
|
|
125
210
|
* verification (#C-01).
|
|
126
211
|
*/
|
|
127
212
|
export declare function issuanceBytes(certificate: Cert): Uint8Array;
|
|
213
|
+
/** Exported for tests/verify.test.ts, which keeps a second implementation of
|
|
214
|
+
* this and must be able to prove the two agree. Not re-exported from index.ts,
|
|
215
|
+
* so it stays off the published API. */
|
|
216
|
+
export declare function canonicalJson(obj: unknown): Uint8Array;
|
|
128
217
|
/** Normalize a certificate timestamp to the UTC form Go signs.
|
|
129
218
|
*
|
|
130
219
|
* Go builds every payload timestamp as `t.UTC().Format("2006-01-02T15:04:05Z")`
|
|
@@ -145,8 +234,11 @@ export declare function issuanceBytes(certificate: Cert): Uint8Array;
|
|
|
145
234
|
* Exported from this module so the timestamp_vectors.json suite can diff it
|
|
146
235
|
* against Go directly. It is deliberately not re-exported from index.ts, so it
|
|
147
236
|
* is not part of the published package surface.
|
|
237
|
+
*
|
|
238
|
+
* `field` names the value in a refusal. It defaults to the word these messages
|
|
239
|
+
* always used, for callers normalizing a time that is not a field of a document.
|
|
148
240
|
*/
|
|
149
|
-
export declare function formatTimestamp(ts: unknown): string;
|
|
241
|
+
export declare function formatTimestamp(ts: unknown, field?: string): string;
|
|
150
242
|
/**
|
|
151
243
|
* Port of Go's BuildTreeHeadPayload.
|
|
152
244
|
*
|
|
@@ -207,7 +299,24 @@ export declare const VALID_REVOCATION_UNKNOWN = "VALID_REVOCATION_UNKNOWN";
|
|
|
207
299
|
*
|
|
208
300
|
* The third row is the point: `verifyCertificate` answers VALID there, which
|
|
209
301
|
* reads as "not revoked" and is not something it checked.
|
|
302
|
+
*
|
|
303
|
+
* `options` is passed to {@link verifyCertificate} unchanged.
|
|
304
|
+
*/
|
|
305
|
+
export declare function verifyCertificateWithStatus(crypto: CryptoOps, certificate: Cert, publicKeys: Map<string, PublicKeyInfo>, status?: Record<string, unknown> | null, now?: Date, options?: VerifyOptions): Promise<string>;
|
|
306
|
+
/**
|
|
307
|
+
* The statement half of {@link verifyCertificateWithStatus}: authenticate a
|
|
308
|
+
* status statement about `certificateId` against the published keys, and read
|
|
309
|
+
* it at `now`. The /verify page's QR lookup has a record id and no record, and
|
|
310
|
+
* uses this so it shows what a signed, fresh statement says, never what the
|
|
311
|
+
* status endpoint claims.
|
|
312
|
+
*
|
|
313
|
+
* | input | result |
|
|
314
|
+
* |---|---|
|
|
315
|
+
* | fresh, REVOKED | throws VerificationError, code CERTIFICATE_REVOKED |
|
|
316
|
+
* | fresh, ACTIVE | the statement key's verdict: `"VALID"`, or a soft one |
|
|
317
|
+
* | stale, or a status this SDK does not know | `"VALID_REVOCATION_UNKNOWN"` |
|
|
318
|
+
* | unknown or unusable key, bad signature, another certificate | throws VerificationError |
|
|
210
319
|
*/
|
|
211
|
-
export declare function
|
|
320
|
+
export declare function verifyStatusStatement(crypto: CryptoOps, status: Record<string, unknown>, publicKeys: Map<string, PublicKeyInfo>, certificateId: unknown, now?: Date): Promise<string>;
|
|
212
321
|
export {};
|
|
213
322
|
//# sourceMappingURL=verify.d.ts.map
|
package/dist/esm/verify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQ7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAyE1E;;;;;;;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