@certrev/cert-block 1.1.0 → 1.2.0-canary.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/CHANGELOG.md +84 -0
- package/README.md +69 -9
- package/dist/builder/cert-chrome-data.d.ts +10 -0
- package/dist/builder/cert-chrome-data.d.ts.map +1 -1
- package/dist/builder/cert-chrome-data.js.map +1 -1
- package/dist/builder/cert-review-card.d.ts.map +1 -1
- package/dist/builder/cert-review-card.js +22 -2
- package/dist/builder/cert-review-card.js.map +1 -1
- package/dist/builder/envelope-face.d.ts +25 -1
- package/dist/builder/envelope-face.d.ts.map +1 -1
- package/dist/builder/envelope-face.js +40 -0
- package/dist/builder/envelope-face.js.map +1 -1
- package/dist/builder/index.d.ts +1 -1
- package/dist/builder/index.d.ts.map +1 -1
- package/dist/builder/index.js +1 -1
- package/dist/builder/index.js.map +1 -1
- package/dist/components/render-cert-block.d.ts.map +1 -1
- package/dist/components/render-cert-block.js +3 -6
- package/dist/components/render-cert-block.js.map +1 -1
- package/dist/modal/certrev-cert-modal.d.ts +34 -1
- package/dist/modal/certrev-cert-modal.d.ts.map +1 -1
- package/dist/modal/certrev-cert-modal.js +40 -2
- package/dist/modal/certrev-cert-modal.js.map +1 -1
- package/dist/modal/certrev-cert.entry.d.ts.map +1 -1
- package/dist/modal/certrev-cert.entry.js +2 -4
- package/dist/modal/certrev-cert.entry.js.map +1 -1
- package/dist/modal/certrev-cert.js +4 -4
- package/dist/modal/deprecated.d.ts +15 -0
- package/dist/modal/deprecated.d.ts.map +1 -0
- package/dist/modal/deprecated.js +22 -0
- package/dist/modal/deprecated.js.map +1 -0
- package/dist/modal/ftc-disclosure.d.ts +7 -3
- package/dist/modal/ftc-disclosure.d.ts.map +1 -1
- package/dist/modal/ftc-disclosure.js +7 -3
- package/dist/modal/ftc-disclosure.js.map +1 -1
- package/dist/modal/index.d.ts +4 -3
- package/dist/modal/index.d.ts.map +1 -1
- package/dist/modal/index.js +4 -3
- package/dist/modal/index.js.map +1 -1
- package/dist/modal/interactions.d.ts +20 -4
- package/dist/modal/interactions.d.ts.map +1 -1
- package/dist/modal/interactions.js +34 -7
- package/dist/modal/interactions.js.map +1 -1
- package/dist/reader/face.d.ts +12 -0
- package/dist/reader/face.d.ts.map +1 -0
- package/dist/reader/face.js +19 -0
- package/dist/reader/face.js.map +1 -0
- package/dist/reader/helpers.d.ts +48 -0
- package/dist/reader/helpers.d.ts.map +1 -0
- package/dist/reader/helpers.js +166 -0
- package/dist/reader/helpers.js.map +1 -0
- package/dist/reader/index.d.ts +10 -0
- package/dist/reader/index.d.ts.map +1 -0
- package/dist/reader/index.js +10 -0
- package/dist/reader/index.js.map +1 -0
- package/dist/reader/logo.d.ts +4 -0
- package/dist/reader/logo.d.ts.map +1 -0
- package/dist/reader/logo.js +23 -0
- package/dist/reader/logo.js.map +1 -0
- package/dist/reader/reader-css.generated.d.ts +2 -0
- package/dist/reader/reader-css.generated.d.ts.map +1 -0
- package/dist/reader/reader-css.generated.js +6 -0
- package/dist/reader/reader-css.generated.js.map +1 -0
- package/dist/reader/render.d.ts +26 -0
- package/dist/reader/render.d.ts.map +1 -0
- package/dist/reader/render.js +230 -0
- package/dist/reader/render.js.map +1 -0
- package/dist/reader/tokens.d.ts +8 -0
- package/dist/reader/tokens.d.ts.map +1 -0
- package/dist/reader/tokens.js +65 -0
- package/dist/reader/tokens.js.map +1 -0
- package/dist/verify/get-verified-delivery.d.ts.map +1 -1
- package/dist/verify/get-verified-delivery.js +5 -1
- package/dist/verify/get-verified-delivery.js.map +1 -1
- package/package.json +7 -1
- package/src/builder/cert-chrome-data.ts +10 -0
- package/src/builder/cert-review-card.tsx +31 -2
- package/src/builder/envelope-face.ts +54 -5
- package/src/builder/index.tsx +3 -0
- package/src/components/render-cert-block.ts +3 -6
- package/src/modal/certrev-cert-modal.ts +45 -2
- package/src/modal/certrev-cert.entry.ts +2 -4
- package/src/modal/deprecated.ts +25 -0
- package/src/modal/ftc-disclosure.ts +7 -3
- package/src/modal/index.ts +4 -3
- package/src/modal/interactions.ts +37 -7
- package/src/reader/face.ts +35 -0
- package/src/reader/helpers.ts +178 -0
- package/src/reader/index.ts +14 -0
- package/src/reader/logo.ts +28 -0
- package/src/reader/reader-css.generated.ts +5 -0
- package/src/reader/reader.css +550 -0
- package/src/reader/render.ts +319 -0
- package/src/reader/tokens.ts +76 -0
- package/src/verify/get-verified-delivery.ts +5 -1
- package/dist/modal/ftc-guard.d.ts +0 -85
- package/dist/modal/ftc-guard.d.ts.map +0 -1
- package/dist/modal/ftc-guard.js +0 -150
- package/dist/modal/ftc-guard.js.map +0 -1
- package/src/modal/ftc-guard.ts +0 -174
package/src/builder/index.tsx
CHANGED
|
@@ -174,8 +174,11 @@ export {
|
|
|
174
174
|
CERT_FACE_FIELDS,
|
|
175
175
|
credentialLabel,
|
|
176
176
|
type EnvelopeCardOptions,
|
|
177
|
+
envelopeCardHtml,
|
|
177
178
|
envelopeCardInput,
|
|
178
179
|
faceFromDef,
|
|
180
|
+
isReaderFaceDef,
|
|
179
181
|
layoutFor,
|
|
182
|
+
READER_FACE,
|
|
180
183
|
themeFromDef,
|
|
181
184
|
} from './envelope-face.js'
|
|
@@ -753,12 +753,9 @@ function floatingPill(facts: CertBlockFacts, placed: PlacedTest): string {
|
|
|
753
753
|
// `data-certrev-*`-hooked building blocks the locked layouts use, so the custom face
|
|
754
754
|
// carries the same markers as banner/sidebar and the crawl monitor reads them alike.
|
|
755
755
|
//
|
|
756
|
-
//
|
|
757
|
-
//
|
|
758
|
-
//
|
|
759
|
-
// NONE of its three scope-line sites. The kill switch therefore cannot see anything
|
|
760
|
-
// renderCertBlock produces, on ANY face. Whether it should is a live design question
|
|
761
|
-
// (which surfaces the switch covers) — not something to settle by quietly adding hooks.
|
|
756
|
+
// No runtime guard watches any of it: the `modal/ftc-guard.ts` kill switch (which never saw
|
|
757
|
+
// this renderer's output anyway: it keyed on `.certrev-memo`) was removed in 1.1.1. Whether a
|
|
758
|
+
// face shows its scope line is decided by its configuration, not policed in the page.
|
|
762
759
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
763
760
|
|
|
764
761
|
function renderCustomFace(facts: CertBlockFacts, placed: PlacedTest, responsive = false): string {
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
* so the document-level delegate can't see the close controls.
|
|
24
24
|
* - Fonts inject at document level on first open (font faces don't scope into a
|
|
25
25
|
* shadow root); deferring to first open avoids loading them on every article view.
|
|
26
|
+
* - A page can carry several faces, each with its own element (a WordPress Query Loop, a
|
|
27
|
+
* related-posts block). A trigger opens its OWN face's element (`ownCertModal`), never the
|
|
28
|
+
* document's first one, and a suppressed element hides only its own face's triggers.
|
|
26
29
|
*/
|
|
27
30
|
|
|
28
31
|
import { type CertDeliveryArtifact, isTombstone } from '@certrev/cert-contract'
|
|
@@ -33,6 +36,44 @@ import { CERT_MODAL_CSS } from './certrev-cert-modal.styles.js'
|
|
|
33
36
|
export const CERT_MODAL_TAG = 'certrev-cert-modal'
|
|
34
37
|
type ModalKind = 'cert' | 'expert'
|
|
35
38
|
|
|
39
|
+
/**
|
|
40
|
+
* One rendered face on a surface that can print several per page: the WordPress plugin wraps each
|
|
41
|
+
* face's card, memo and rail wraps in `<div data-certrev-cert="1">`. A trigger never reaches a
|
|
42
|
+
* `<certrev-cert-modal>` in another face root, and one outside every face root never reaches a
|
|
43
|
+
* modal inside one.
|
|
44
|
+
*/
|
|
45
|
+
export const FACE_ROOT_SELECTOR = '[data-certrev-cert]'
|
|
46
|
+
|
|
47
|
+
/** The element a trigger opens, or why it has none. */
|
|
48
|
+
export type OwnCertModal =
|
|
49
|
+
| { readonly modal: Element; readonly reason: null }
|
|
50
|
+
| { readonly modal: null; readonly reason: 'none' | 'ambiguous'; readonly count: number }
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The `<certrev-cert-modal>` that belongs to `trigger`'s face: the one in the SMALLEST subtree that
|
|
54
|
+
* holds both. Walk up from the trigger; the first ancestor holding a modal decides:
|
|
55
|
+
* - exactly one → that is the face's modal. On Shopify the card wrap (badge + modal) and the memo
|
|
56
|
+
* wrap (triggers only) are placed apart in the article, and their nearest common container holds
|
|
57
|
+
* the page's one modal; a Builder page puts one modal beside the CMS content; a WordPress face root
|
|
58
|
+
* holds its own.
|
|
59
|
+
* - more than one → `ambiguous`: the trigger's face has no modal of its own and sits between other
|
|
60
|
+
* faces'. Picking one would open another cert's certificate, so there is no answer.
|
|
61
|
+
* The walk never leaves the trigger's face root, and only counts modals in that same face root (or,
|
|
62
|
+
* for a trigger in none, modals in none), so a WordPress face without a modal resolves to `none`.
|
|
63
|
+
*/
|
|
64
|
+
export function ownCertModal(trigger: Element): OwnCertModal {
|
|
65
|
+
const face = trigger.closest(FACE_ROOT_SELECTOR)
|
|
66
|
+
for (let node: Element | null = trigger; node; node = node.parentElement) {
|
|
67
|
+
const found = Array.from(node.querySelectorAll(CERT_MODAL_TAG)).filter(
|
|
68
|
+
(m) => m.closest(FACE_ROOT_SELECTOR) === face,
|
|
69
|
+
)
|
|
70
|
+
if (found.length === 1) return { modal: found[0] as Element, reason: null }
|
|
71
|
+
if (found.length > 1) return { modal: null, reason: 'ambiguous', count: found.length }
|
|
72
|
+
if (node === face) break
|
|
73
|
+
}
|
|
74
|
+
return { modal: null, reason: 'none', count: 0 }
|
|
75
|
+
}
|
|
76
|
+
|
|
36
77
|
/** Shared constructable stylesheet (one per document lifetime). */
|
|
37
78
|
let sharedSheet: CSSStyleSheet | null = null
|
|
38
79
|
function supportsConstructableSheets(): boolean {
|
|
@@ -208,11 +249,13 @@ export class CertRevCertModal extends HTMLElement {
|
|
|
208
249
|
/**
|
|
209
250
|
* The modal kill-switch: a fetched envelope is REVOKED/EXPIRED. Don't open;
|
|
210
251
|
* mark the host suppressed (mirrors the badge revalidation's `data-certrev-suppressed`) and
|
|
211
|
-
* hide
|
|
252
|
+
* hide THIS face's light-DOM triggers (those whose `ownCertModal` is this element) so a stale
|
|
253
|
+
* click can't re-open a pulled cert. Another face's triggers on the page are not touched.
|
|
212
254
|
*/
|
|
213
255
|
private markSuppressed(): void {
|
|
214
256
|
this.setAttribute('data-certrev-suppressed', '')
|
|
215
|
-
for (const t of Array.from(
|
|
257
|
+
for (const t of Array.from(this.ownerDocument.querySelectorAll('[data-certrev-modal-open]'))) {
|
|
258
|
+
if (ownCertModal(t).modal !== this) continue
|
|
216
259
|
t.setAttribute('hidden', '')
|
|
217
260
|
t.setAttribute('aria-hidden', 'true')
|
|
218
261
|
}
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
import type { ResolvePublicKeyByKid } from '@certrev/cert-contract'
|
|
12
12
|
import './certrev-cert-modal.js' // registers the unified <certrev-cert-modal> element
|
|
13
|
-
import { installFtcGuard } from './ftc-guard.js'
|
|
14
13
|
import { initCertInteractionsOnReady } from './interactions.js'
|
|
15
14
|
import { initCertPlacement } from './placement.js'
|
|
16
15
|
import { initBadgeRevalidation } from './revalidate.js'
|
|
@@ -37,10 +36,9 @@ if (typeof document !== 'undefined') {
|
|
|
37
36
|
// in-article position — so the badge re-verify pass below finds `<certrev-badge>` already in
|
|
38
37
|
// place and never re-runs against a detached/re-attached node.
|
|
39
38
|
initCertPlacement(document)
|
|
39
|
+
// No disclosure guard since 1.1.1: nothing here hides, replaces or re-checks a face at load or on
|
|
40
|
+
// mutation, so a face that loads inside a closed <details>, tab or accordion renders when opened.
|
|
40
41
|
// Tap-to-expand contributor bios + the in-page certificate modal (progressive enhancement).
|
|
41
42
|
initCertInteractionsOnReady(document)
|
|
42
|
-
// FTC §3 anti-stripping: neutralize a memo whose verbatim disclosure was stripped/hidden/altered
|
|
43
|
-
// (restores the iframe kill switch in the native, in-DOM render). No-op when there's no memo.
|
|
44
|
-
installFtcGuard(document)
|
|
45
43
|
initBadgeRevalidation(document, { verify: createDeliveryVerifier(resolveKid) })
|
|
46
44
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public names kept only so a patch release never breaks a compiling integration (the semver
|
|
3
|
+
* contract at the head of CHANGELOG.md). Each one does nothing it used to do; removal is for 2.0.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Dispatched on the document, once per document, on the first call of a removed API, so a caller
|
|
7
|
+
* that still relies on it can see that it does nothing. `detail: { api, removedIn }`. */
|
|
8
|
+
export const DEPRECATED_API_EVENT = 'certrev:deprecated-api'
|
|
9
|
+
|
|
10
|
+
/** Documents that have already been told, so repeated calls dispatch once. */
|
|
11
|
+
const announcedDocs = new WeakSet<Document>()
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Removed in 1.1.1: the runtime FTC disclosure guard is gone. This installs nothing,
|
|
15
|
+
* checks nothing and never hides or replaces a face; whether a face shows its disclosure is settled
|
|
16
|
+
* where the face is configured. The first call per document dispatches {@link DEPRECATED_API_EVENT}.
|
|
17
|
+
* Will be deleted in 2.0.
|
|
18
|
+
*/
|
|
19
|
+
export function installFtcGuard(doc: Document): void {
|
|
20
|
+
if (announcedDocs.has(doc)) return
|
|
21
|
+
announcedDocs.add(doc)
|
|
22
|
+
doc.dispatchEvent(
|
|
23
|
+
new CustomEvent(DEPRECATED_API_EVENT, { detail: { api: 'installFtcGuard', removedIn: '1.1.1' } }),
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
* module. Legally load-bearing: the curly apostrophe (U+2019) in "article’s"
|
|
5
5
|
* is byte-exact; a reword is a contract divergence.
|
|
6
6
|
*
|
|
7
|
-
* Kept as its OWN module (imported by
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Kept as its OWN module (imported by display-strings, exactly as in portal) so the browser bundle
|
|
8
|
+
* emits the same `var` structure as the deployed certrev-cert.js — do not merge it into
|
|
9
|
+
* display-strings.ts (that consolidation drops one `var` and breaks byte-parity).
|
|
10
|
+
*
|
|
11
|
+
* It is the text the faces RENDER, nothing more. Since 1.1.1 nothing in this package checks at
|
|
12
|
+
* runtime that it is present or visible (the `ftc-guard` kill switch is gone): whether a face shows
|
|
13
|
+
* its disclosure is settled where the face is configured, not by hiding or replacing it in the page.
|
|
10
14
|
*/
|
|
11
15
|
|
|
12
16
|
export const FTC_DISCLOSURE_LINE =
|
package/src/modal/index.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* storefront (`<script src=".../dist/modal/certrev-cert.js">`) instead of vendoring a copy.
|
|
7
7
|
*
|
|
8
8
|
* Importing this module as ESM has the SAME side effect as loading the IIFE: it registers the
|
|
9
|
-
* `<certrev-cert-modal>` element and (in a browser) runs placement + interactions +
|
|
10
|
-
*
|
|
9
|
+
* `<certrev-cert-modal>` element and (in a browser) runs placement + interactions + badge
|
|
10
|
+
* revalidation (no FTC guard since 1.1.1). Bundler users: `import '@certrev/cert-block/modal'`.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
// Side-effect: register the element + (in a browser) kick off the DOM passes.
|
|
@@ -23,7 +23,8 @@ export {
|
|
|
23
23
|
|
|
24
24
|
// Composable entry points for advanced consumers (the IIFE wires these itself).
|
|
25
25
|
export { CERT_MODAL_TAG } from "./certrev-cert-modal.js";
|
|
26
|
-
|
|
26
|
+
/** @deprecated Since 1.1.1 a no-op (the runtime FTC guard was removed); deleted in 2.0. */
|
|
27
|
+
export { installFtcGuard } from "./deprecated.js";
|
|
27
28
|
export { initCertInteractionsOnReady } from "./interactions.js";
|
|
28
29
|
export { initCertPlacement } from "./placement.js";
|
|
29
30
|
export {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* (revealing the row's `.acc-bio` in place; the name caret rotates via CSS) and mirrors the
|
|
9
9
|
* state on `aria-expanded`. A click on a link inside the row (e.g. the "Compensated expert"
|
|
10
10
|
* cue) is NOT a toggle. Keyboard: Enter/Space on the role=button row.
|
|
11
|
-
* • In-page modals: a `[data-certrev-modal-open]` control opens
|
|
12
|
-
* `<certrev-cert-modal>` element via its `.open('cert'|'expert')` method. Bare /
|
|
11
|
+
* • In-page modals: a `[data-certrev-modal-open]` control opens its OWN face's
|
|
12
|
+
* `<certrev-cert-modal>` element (`ownCertModal`) via its `.open('cert'|'expert')` method. Bare /
|
|
13
13
|
* `"cert"` opens the certificate dialog; `"expert"` opens the reviewer dialog. With no JS / no
|
|
14
14
|
* element / no envelope a link control falls back to its href (the certificate or the CertREV
|
|
15
15
|
* profile page). The element owns its OWN close plumbing (× / Close / backdrop / Esc) inside its
|
|
@@ -18,12 +18,18 @@
|
|
|
18
18
|
* No crypto, no network — pure DOM. Idempotent install (guarded so a double-load can't double-bind).
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import { CERT_MODAL_TAG } from './certrev-cert-modal.js'
|
|
21
|
+
import { CERT_MODAL_TAG, ownCertModal } from './certrev-cert-modal.js'
|
|
22
22
|
|
|
23
23
|
export const ACC_ATTR = 'data-certrev-acc'
|
|
24
24
|
export const MODAL_OPEN_ATTR = 'data-certrev-modal-open'
|
|
25
25
|
export const INITIALS_ATTR = 'data-certrev-initials'
|
|
26
26
|
export const CARD_SELECTOR = '.certrev-card'
|
|
27
|
+
/** Stamped on a control that could not tell which modal is its own (value: the reason), beside the
|
|
28
|
+
* bubbling {@link MODAL_UNRESOLVED_EVENT}, so the miss is inspectable rather than a silent link. */
|
|
29
|
+
export const MODAL_UNRESOLVED_ATTR = 'data-certrev-modal-unresolved'
|
|
30
|
+
/** Dispatched on a control whose face has no modal of its own but sits between other faces'
|
|
31
|
+
* (`ownCertModal` → `ambiguous`). `detail: { reason: 'ambiguous', modals }`. */
|
|
32
|
+
export const MODAL_UNRESOLVED_EVENT = 'certrev:modal-unresolved'
|
|
27
33
|
|
|
28
34
|
/** The dialog a `data-certrev-modal-open` control targets. */
|
|
29
35
|
export type ModalKind = 'cert' | 'expert'
|
|
@@ -53,8 +59,10 @@ export function modalTargetKind(value: string | null): ModalKind {
|
|
|
53
59
|
return value === 'expert' ? 'expert' : 'cert'
|
|
54
60
|
}
|
|
55
61
|
|
|
56
|
-
/** Open a cert dialog via the `<certrev-cert-modal>` element
|
|
57
|
-
*
|
|
62
|
+
/** Open a cert dialog via the document's FIRST `<certrev-cert-modal>` element: a page-level helper
|
|
63
|
+
* for a page with one face. Controls go through `openOwnModal`, which finds their own face's element.
|
|
64
|
+
* Returns false (so the caller lets an href fall back) when the element is absent or declines (no
|
|
65
|
+
* envelope + no fetch source). */
|
|
58
66
|
export function openModal(doc: Document, kind: ModalKind): boolean {
|
|
59
67
|
const el = doc.querySelector(CERT_MODAL_TAG) as CertModalElement | null
|
|
60
68
|
if (el && typeof el.open === 'function') return el.open(kind)
|
|
@@ -66,6 +74,28 @@ export function openCertModal(doc: Document): boolean {
|
|
|
66
74
|
return openModal(doc, 'cert')
|
|
67
75
|
}
|
|
68
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Open a dialog of `control`'s OWN face's `<certrev-cert-modal>` (see `ownCertModal`), which is what
|
|
79
|
+
* the delegated click / key handlers do. Returns false (so a link control follows its own href) when
|
|
80
|
+
* the face has no modal, the element declines, or the control cannot tell which modal is its own; in
|
|
81
|
+
* that last case it is stamped `data-certrev-modal-unresolved="ambiguous"` and receives
|
|
82
|
+
* `certrev:modal-unresolved`, and another face's certificate is never opened in its place.
|
|
83
|
+
*/
|
|
84
|
+
export function openOwnModal(control: Element, kind: ModalKind): boolean {
|
|
85
|
+
const own = ownCertModal(control)
|
|
86
|
+
if (own.modal) {
|
|
87
|
+
const el = own.modal as CertModalElement
|
|
88
|
+
return typeof el.open === 'function' ? el.open(kind) : false
|
|
89
|
+
}
|
|
90
|
+
if (own.reason === 'ambiguous') {
|
|
91
|
+
control.setAttribute(MODAL_UNRESOLVED_ATTR, own.reason)
|
|
92
|
+
control.dispatchEvent(
|
|
93
|
+
new CustomEvent(MODAL_UNRESOLVED_EVENT, { bubbles: true, detail: { reason: own.reason, modals: own.count } }),
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
return false
|
|
97
|
+
}
|
|
98
|
+
|
|
69
99
|
function asElement(target: EventTarget | null): Element | null {
|
|
70
100
|
return target && (target as Element).closest ? (target as Element) : null
|
|
71
101
|
}
|
|
@@ -111,7 +141,7 @@ export function initCertInteractions(doc: Document): void {
|
|
|
111
141
|
// (Close is owned by the <certrev-cert-modal> element inside its shadow root.)
|
|
112
142
|
const opener = el.closest(`[${MODAL_OPEN_ATTR}]`)
|
|
113
143
|
if (opener) {
|
|
114
|
-
if (
|
|
144
|
+
if (openOwnModal(opener, modalTargetKind(opener.getAttribute(MODAL_OPEN_ATTR)))) e.preventDefault()
|
|
115
145
|
return
|
|
116
146
|
}
|
|
117
147
|
|
|
@@ -144,7 +174,7 @@ export function initCertInteractions(doc: Document): void {
|
|
|
144
174
|
|
|
145
175
|
const opener = el.closest(`[${MODAL_OPEN_ATTR}]`)
|
|
146
176
|
if (opener) {
|
|
147
|
-
if (
|
|
177
|
+
if (openOwnModal(opener, modalTargetKind(opener.getAttribute(MODAL_OPEN_ATTR)))) {
|
|
148
178
|
e.preventDefault()
|
|
149
179
|
return
|
|
150
180
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `certrev-reader-face`: the round avatar on a reader byline: the person's photo when there is one to show, the
|
|
3
|
+
* silhouette when there is not. The span carries a size class (`sm` for the author, none for the banner reviewer,
|
|
4
|
+
* `lg` for the memo and sidebar reviewer); the image is requested at `width` square through the asset resizer.
|
|
5
|
+
*/
|
|
6
|
+
import { avatarUrl, cleaned, esc, safeUrl } from './helpers.js'
|
|
7
|
+
|
|
8
|
+
export type ReaderFaceSize = '' | 'sm' | 'lg'
|
|
9
|
+
|
|
10
|
+
export interface ReaderFaceInput {
|
|
11
|
+
/** The photo URL on the envelope. */
|
|
12
|
+
readonly photo: unknown
|
|
13
|
+
/** Whether to ATTEMPT the photo: false never reads the URL (the silhouette shows). */
|
|
14
|
+
readonly show: boolean
|
|
15
|
+
readonly size: ReaderFaceSize
|
|
16
|
+
/** The pixel width the resizer is asked for. */
|
|
17
|
+
readonly width: number
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const SILHOUETTE =
|
|
21
|
+
'<svg viewBox="0 0 40 40" aria-hidden="true" focusable="false"><circle cx="20" cy="14.8" r="7"/><path d="M20 23.4c-6.9 0-12.6 4.8-13.8 11.2a20 20 0 0 0 27.6 0C32.6 28.2 26.9 23.4 20 23.4Z"/></svg>'
|
|
22
|
+
|
|
23
|
+
const DIMENSION: Readonly<Record<ReaderFaceSize, number>> = { '': 42, sm: 36, lg: 46 }
|
|
24
|
+
|
|
25
|
+
export function readerFace({ photo, show, size, width }: ReaderFaceInput): string {
|
|
26
|
+
const safe = show ? cleaned(safeUrl(photo)) : ''
|
|
27
|
+
const src = cleaned(avatarUrl(safe, width))
|
|
28
|
+
const dim = DIMENSION[size]
|
|
29
|
+
const cls = size === '' ? 'certrev-r-face' : `certrev-r-face ${esc(size)}`
|
|
30
|
+
const inner =
|
|
31
|
+
src !== ''
|
|
32
|
+
? `<img src="${esc(src)}" alt="" width="${dim}" height="${dim}" loading="lazy" decoding="async">`
|
|
33
|
+
: SILHOUETTE
|
|
34
|
+
return `<span class="${cls}">${inner}</span>`
|
|
35
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Liquid semantics the reader snippets lean on, as small pure functions.
|
|
3
|
+
*
|
|
4
|
+
* The reader face is a byte-for-byte twin of the Shopify `certrev-reader-*` snippets, so the helpers below are not
|
|
5
|
+
* "what a TypeScript author would write": each one reproduces what the Liquid filter or tag does with the same input
|
|
6
|
+
* (which value counts as `blank`, which `default` replaces, how `contains` reads a string, what `strip_html` removes).
|
|
7
|
+
* Where the snippets call another snippet (`certrev-safe-url`, `certrev-avatar-url`, `certrev-reader-first-name`,
|
|
8
|
+
* `certrev-reader-date`) the port is named for it.
|
|
9
|
+
*
|
|
10
|
+
* Like every helper in this package they NEVER throw on a hostile type: the envelope is verified for its signature,
|
|
11
|
+
* not its shape, so a number or an object can arrive where the contract promised a string. Values are read through
|
|
12
|
+
* `rec` and `asText`, never dereferenced bare.
|
|
13
|
+
*/
|
|
14
|
+
import { asText, escapeHtml } from '../components/escape.js'
|
|
15
|
+
|
|
16
|
+
export type Rec = Readonly<Record<string, unknown>>
|
|
17
|
+
|
|
18
|
+
const NO_FIELDS: Rec = Object.freeze({})
|
|
19
|
+
|
|
20
|
+
/** An object's fields, or none: Liquid reads a missing field as nil, never an error. */
|
|
21
|
+
export function rec(value: unknown): Rec {
|
|
22
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value) ? (value as Rec) : NO_FIELDS
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Liquid `escape` as Shopify (and this package) spell it: `& < > " '`. */
|
|
26
|
+
export const esc = (value: unknown): string => escapeHtml(asText(value))
|
|
27
|
+
|
|
28
|
+
/** Liquid `default: fallback`: replaces nil, false and the empty string only (whitespace stays). */
|
|
29
|
+
export function orDefault(value: unknown, fallback: string): unknown {
|
|
30
|
+
return value === undefined || value === null || value === false || value === '' ? fallback : value
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** `value | default: ''` read as text. */
|
|
34
|
+
export const textOr = (value: unknown, fallback = ''): string => asText(orDefault(value, fallback))
|
|
35
|
+
|
|
36
|
+
/** Liquid's `== blank` for the string-ish values the envelope carries: nil, false, empty or whitespace only. */
|
|
37
|
+
export const isBlank = (value: unknown): boolean => asText(value).trim() === ''
|
|
38
|
+
|
|
39
|
+
/** `{% if x %}` for a value read as a flag: Liquid treats only nil and false as false (the empty string is true). */
|
|
40
|
+
export const isTruthy = (value: unknown): boolean => value !== undefined && value !== null && value !== false
|
|
41
|
+
|
|
42
|
+
/** Whether a field carries a value after `| default: ''` (so `!= ''` in the snippet). */
|
|
43
|
+
export const isPresent = (value: unknown): boolean =>
|
|
44
|
+
!(value === undefined || value === null || value === false || value === '')
|
|
45
|
+
|
|
46
|
+
/** Liquid `contains`: an array holds the needle, a string includes it, anything else does not. */
|
|
47
|
+
export function contains(container: unknown, needle: string): boolean {
|
|
48
|
+
if (Array.isArray(container)) return container.some((item) => item === needle)
|
|
49
|
+
if (typeof container === 'string') return container.includes(needle)
|
|
50
|
+
return false
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Liquid `strip_html` as the portal's liquidjs harness runs it: raw-text blocks (`<script…</script>`, `<style…</style>`,
|
|
55
|
+
* `<!-- … -->`) and then any `<…>` tag are dropped; an opener with no closer is not a block, and once no opener fits
|
|
56
|
+
* the rest of the string is kept as it is. The snippets use it on every captured value because Shopify wraps each
|
|
57
|
+
* `{% render %}` of an app snippet in `<!-- BEGIN/END app snippet -->` comments that would corrupt an attribute.
|
|
58
|
+
*/
|
|
59
|
+
export function stripHtml(input: string): string {
|
|
60
|
+
const blocks = new Map<string, string>([
|
|
61
|
+
['<script', '</script>'],
|
|
62
|
+
['<style', '</style>'],
|
|
63
|
+
['<!--', '-->'],
|
|
64
|
+
['<', '>'],
|
|
65
|
+
])
|
|
66
|
+
let out = ''
|
|
67
|
+
let i = 0
|
|
68
|
+
while (i < input.length) {
|
|
69
|
+
const lt = input.indexOf('<', i)
|
|
70
|
+
if (lt < 0) return out + input.slice(i)
|
|
71
|
+
out += input.slice(i, lt)
|
|
72
|
+
for (const [opener, closer] of blocks) {
|
|
73
|
+
if (!input.startsWith(opener, lt)) continue
|
|
74
|
+
const end = input.indexOf(closer, lt + opener.length)
|
|
75
|
+
if (end >= 0) {
|
|
76
|
+
i = end + closer.length
|
|
77
|
+
break
|
|
78
|
+
}
|
|
79
|
+
blocks.delete(opener)
|
|
80
|
+
}
|
|
81
|
+
if (i <= lt) return out + input.slice(lt)
|
|
82
|
+
}
|
|
83
|
+
return out
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** `{% capture x %}…{% endcapture %}` then `x | strip_html | strip`, which every snippet applies to a captured value. */
|
|
87
|
+
export const cleaned = (value: string): string => stripHtml(value).trim()
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* `certrev-safe-url`: the trimmed URL when it is http(s), protocol-relative or site-relative (`/…`, `#…`), else ''.
|
|
91
|
+
* A `javascript:`, `data:` or other scheme collapses to '' so the caller's `!= ''` guard drops the link or the photo.
|
|
92
|
+
*/
|
|
93
|
+
export function safeUrl(url: unknown): string {
|
|
94
|
+
const u = textOr(url).trim()
|
|
95
|
+
if (u === '') return ''
|
|
96
|
+
const lower = u.toLowerCase()
|
|
97
|
+
if (
|
|
98
|
+
lower.startsWith('https://') ||
|
|
99
|
+
lower.startsWith('http://') ||
|
|
100
|
+
u.startsWith('//') ||
|
|
101
|
+
u.startsWith('/') ||
|
|
102
|
+
u.startsWith('#')
|
|
103
|
+
)
|
|
104
|
+
return u
|
|
105
|
+
return ''
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const ASSET_HOSTS: readonly string[] = ['assets.certrev.com', 'staging-assets.certrev.com']
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* `certrev-avatar-url`: a CertREV asset-host photo is requested through the host's `cdn-cgi/image` resizer at
|
|
112
|
+
* `width` square (the query string dropped, which the WAF allowlist pins to empty); any other URL, a lookalike host,
|
|
113
|
+
* an `http://` or `//` form, or a URL already carrying `cdn-cgi/image/`, is returned as it is.
|
|
114
|
+
*/
|
|
115
|
+
export function avatarUrl(url: string, width: number): string {
|
|
116
|
+
const u = url.trim()
|
|
117
|
+
if (!u.includes('assets.certrev.com/')) return u
|
|
118
|
+
const after = u.replace('https://', '')
|
|
119
|
+
const host = after.split('/')[0] ?? ''
|
|
120
|
+
if (!ASSET_HOSTS.includes(host)) return u
|
|
121
|
+
const path = after.replace(host, '').replace('/', '').split('?')[0] ?? ''
|
|
122
|
+
if (path.includes('cdn-cgi/image/')) return u
|
|
123
|
+
return `https://${host}/cdn-cgi/image/width=${width},height=${width},fit=cover,format=auto,onerror=redirect/${path}`
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const HONORIFICS: readonly string[] = [
|
|
127
|
+
'dr.',
|
|
128
|
+
'dr',
|
|
129
|
+
'mr.',
|
|
130
|
+
'mr',
|
|
131
|
+
'mrs.',
|
|
132
|
+
'mrs',
|
|
133
|
+
'ms.',
|
|
134
|
+
'ms',
|
|
135
|
+
'prof.',
|
|
136
|
+
'prof',
|
|
137
|
+
'mx.',
|
|
138
|
+
'mx',
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* `certrev-reader-first-name`: the name's first word with a leading honorific (Dr., Mr., Mrs., Ms., Prof., Mx.,
|
|
143
|
+
* any case) dropped; '' when nothing is left, which the caller words as "View profile".
|
|
144
|
+
*/
|
|
145
|
+
export function firstName(name: string): string {
|
|
146
|
+
let clean = name.trim()
|
|
147
|
+
const firstWord = (clean.split(' ')[0] ?? '').toLowerCase()
|
|
148
|
+
if (HONORIFICS.includes(firstWord)) {
|
|
149
|
+
const honorific = clean.split(' ')[0] ?? ''
|
|
150
|
+
clean = clean.replace(honorific, '').trim()
|
|
151
|
+
}
|
|
152
|
+
return clean.split(' ')[0] ?? ''
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const MONTHS: readonly string[] = [
|
|
156
|
+
'January',
|
|
157
|
+
'February',
|
|
158
|
+
'March',
|
|
159
|
+
'April',
|
|
160
|
+
'May',
|
|
161
|
+
'June',
|
|
162
|
+
'July',
|
|
163
|
+
'August',
|
|
164
|
+
'September',
|
|
165
|
+
'October',
|
|
166
|
+
'November',
|
|
167
|
+
'December',
|
|
168
|
+
]
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* `certrev-reader-date`: "June 20, 2026" for an ISO timestamp, read in UTC (the portal harness's `date` filter does
|
|
172
|
+
* the same). A value that is not a date prints nothing, so the caller's `!= ''` guard falls to the undated wording.
|
|
173
|
+
*/
|
|
174
|
+
export function longDate(iso: unknown): string {
|
|
175
|
+
const parsed = new Date(asText(iso))
|
|
176
|
+
if (Number.isNaN(parsed.getTime())) return ''
|
|
177
|
+
return `${MONTHS[parsed.getUTCMonth()]} ${parsed.getUTCDate()}, ${parsed.getUTCFullYear()}`
|
|
178
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reader face, react-free: `@certrev/cert-block/reader`.
|
|
3
|
+
*
|
|
4
|
+
* Importing this loads no React, so a server bundle that cannot load `./builder` (it creates a React context at import)
|
|
5
|
+
* can still render, and a stylesheet pipeline can still read the CSS. The Builder card reaches the same function
|
|
6
|
+
* through `envelopeCardHtml` (`./builder/face`); the stylesheet is also the package asset `./reader.css`.
|
|
7
|
+
*/
|
|
8
|
+
export { READER_CSS } from './reader-css.generated.js'
|
|
9
|
+
export {
|
|
10
|
+
type ReaderFaceInput,
|
|
11
|
+
type ReaderLayout,
|
|
12
|
+
type ReaderPart,
|
|
13
|
+
renderReaderFace,
|
|
14
|
+
} from './render.js'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CertREV mark the reader face paints in the card cap (18px) and the memo footer (17px): the Liquid
|
|
3
|
+
* `certrev-reader-logo` snippet's inline SVG data URI, byte for byte, so a Builder page and a Shopify page carry the
|
|
4
|
+
* same image. White on a dark accent, black (the demo's logo-mono) on a light one.
|
|
5
|
+
*
|
|
6
|
+
* The four `d` strings below are the snippet's, copied rather than retyped; the golden tests compare the whole
|
|
7
|
+
* element, so a slipped digit fails there.
|
|
8
|
+
*/
|
|
9
|
+
import { escapeHtml } from '../components/escape.js'
|
|
10
|
+
|
|
11
|
+
export type ReaderLogoInk = 'white' | 'mono'
|
|
12
|
+
|
|
13
|
+
const MARK_PATHS: readonly string[] = [
|
|
14
|
+
'M67.59 221.77L138.77 292.95C145.8 299.98 145.8 311.44 138.77 318.47L123.02 334.22C116 341.25 104.54 341.25 97.5 334.22L26.32 263.04C19.29 256.01 19.29 244.55 26.32 237.52L42.07 221.77C49.1 214.74 60.56 214.74 67.59 221.77Z',
|
|
15
|
+
'M96.79 335.08L81.12 319.42C73.8 312.1 73.8 300.23 81.12 292.92L315.88 58.16C323.2 50.85 335.06 50.85 342.38 58.16L358.04 73.83C365.36 81.14 365.36 93.01 358.04 100.33L123.29 335.08C115.97 342.4 104.1 342.4 96.79 335.08Z',
|
|
16
|
+
'M203.5 335.14L187.83 319.48C180.52 312.16 180.52 300.29 187.83 292.98L315.88 164.93C323.2 157.62 335.06 157.62 342.38 164.93L358.04 180.6C365.36 187.92 365.36 199.78 358.04 207.1L230 335.14C222.68 342.46 210.82 342.46 203.5 335.14Z',
|
|
17
|
+
'M310.21 335.2L294.54 319.54C287.23 312.22 287.23 300.36 294.54 293.04L315.88 271.71C323.2 264.39 335.06 264.39 342.38 271.71L358.04 287.37C365.36 294.69 365.36 306.55 358.04 313.87L336.71 335.2C329.39 342.52 317.53 342.52 310.21 335.2Z',
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
/** The `<img>` for the mark: `size` is the pixel width and height, `alt` is '' where the words carry the meaning. */
|
|
21
|
+
export function readerLogo(ink: ReaderLogoInk, size: number, alt: string): string {
|
|
22
|
+
const fill = ink === 'white' ? 'ffffff' : '000000'
|
|
23
|
+
const paths = MARK_PATHS.map((d) => `%3Cpath fill='%23${fill}' d='${d}'/%3E`).join('')
|
|
24
|
+
return (
|
|
25
|
+
`<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 375 375'%3E${paths}%3C/svg%3E" ` +
|
|
26
|
+
`alt="${escapeHtml(alt)}" width="${escapeHtml(String(size))}" height="${escapeHtml(String(size))}" decoding="async">`
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// biome-ignore-all format: generated file
|
|
2
|
+
// biome-ignore-all lint: generated file
|
|
3
|
+
// GENERATED by scripts/refresh-reader.mjs from src/reader/reader.css (the portal reader stylesheet, byte for
|
|
4
|
+
// byte). Do not edit: run the script. reader-css.test.ts asserts this string equals the .css file.
|
|
5
|
+
export const READER_CSS = "/* CERTREV-READER-GEN:BEGIN */\n/* GENERATED by scripts/build-cert-reader-css.mjs from src/lib/cert-render/reader/site-snapshot/ (certrev.com,\n * component Reader, \"What your reader sees\"). DO NOT EDIT: run `pnpm build:cert-reader-css`. The face is driven by\n * four variables the Liquid root sets inline: --cr-ba accent, --cr-ba-fg accent foreground, --cr-br corner, --cr-bf\n * font. */\n.certrev-reader {\n\tcolor: #141414;\n\tfont-family: var(--cr-bf);\n\tfont-size: 16px;\n\tline-height: 1.65;\n\t-webkit-font-smoothing: antialiased;\n\ttext-rendering: optimizelegibility;\n}\n.certrev-reader,\n.certrev-reader *,\n.certrev-reader *:before,\n.certrev-reader *:after {\n\tbox-sizing: border-box;\n}\n.certrev-reader .certrev-r-card {\n\tz-index: 1;\n\tborder: 1px solid #14141421;\n\tborder-radius: calc(var(--cr-br) * 0.7);\n\tbackground: #fff;\n\tflex-shrink: 0;\n\tmargin: 12px 0 0;\n\tposition: relative;\n\toverflow: hidden;\n}\n.certrev-reader .certrev-r-card.pad {\n\tpadding: 15px 18px;\n\toverflow: visible;\n}\n.certrev-reader .certrev-r-card.pad .certrev-r-bys {\n\tgap: 14px;\n}\n.certrev-reader .certrev-r-cap {\n\twhite-space: nowrap;\n\tbackground: var(--cr-ba);\n\tcolor: var(--cr-ba-fg);\n\tfont-family: \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;\n\tletter-spacing: 0.14em;\n\ttext-transform: uppercase;\n\talign-items: center;\n\tgap: 11px;\n\tpadding: 14px 20px;\n\tfont-size: 10.5px;\n\tfont-weight: 700;\n\tdisplay: flex;\n}\n.certrev-reader .certrev-r-cap.center {\n\tletter-spacing: 0.16em;\n\tjustify-content: center;\n\tpadding: 12px;\n}\n.certrev-reader .certrev-r-cap img {\n\tflex-shrink: 0;\n\twidth: 18px;\n\theight: 18px;\n\tdisplay: block;\n}\n.certrev-reader .certrev-r-cap-body {\n\tpadding: 15px 18px 13px;\n}\n.certrev-reader .certrev-r-bys {\n\tgrid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);\n\tgap: 20px;\n\tdisplay: grid;\n}\n.certrev-reader .certrev-r-by {\n\talign-items: flex-start;\n\tgap: 12px;\n\tdisplay: flex;\n}\n.certrev-reader .certrev-r-by > div {\n\tmin-width: 0;\n}\n.certrev-reader .certrev-r-by b {\n\tfont-size: 14.5px;\n\tfont-weight: 700;\n\tline-height: 1.3;\n\tdisplay: block;\n}\n.certrev-reader .certrev-r-by em {\n\tcolor: #1414148c;\n\tmargin-top: 4px;\n\tfont-size: 12.5px;\n\tfont-style: normal;\n\tline-height: 1.45;\n\tdisplay: block;\n}\n.certrev-reader .certrev-r-role {\n\tfont-family: \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;\n\tletter-spacing: 0.14em;\n\ttext-transform: uppercase;\n\tcolor: #14141459;\n\tmargin-top: 9px;\n\tfont-size: 9px;\n\tdisplay: block;\n}\n.certrev-reader .certrev-r-role.on {\n\tcolor: #141414;\n\tfont-weight: 700;\n}\n.certrev-reader .certrev-r-face {\n\tbackground: #14141412;\n\twidth: 42px;\n\theight: 42px;\n\tcolor: #141414;\n\tborder-radius: 50%;\n\tflex-shrink: 0;\n\tdisplay: block;\n\toverflow: hidden;\n}\n.certrev-reader .certrev-r-face.sm {\n\twidth: 36px;\n\theight: 36px;\n}\n.certrev-reader .certrev-r-face.lg {\n\twidth: 46px;\n\theight: 46px;\n}\n.certrev-reader .certrev-r-face svg {\n\tfill: currentColor;\n\topacity: 0.38;\n\twidth: 100%;\n\theight: 100%;\n\tdisplay: block;\n}\n.certrev-reader .certrev-r-rule {\n\tbackground: #14141421;\n\theight: 1px;\n\tmargin: 15px 0 12px;\n}\n.certrev-reader .certrev-r-foot {\n\tjustify-content: space-between;\n\talign-items: center;\n\tgap: 16px;\n\tfont-size: 12.5px;\n\tdisplay: flex;\n}\n.certrev-reader .certrev-r-foot span {\n\twhite-space: nowrap;\n}\n.certrev-reader .certrev-r-foot em {\n\tfont-style: normal;\n\tfont-family: \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;\n\tletter-spacing: 0.14em;\n\ttext-transform: uppercase;\n\tcolor: #1414148c;\n\tmargin-right: 9px;\n\tfont-size: 9.5px;\n}\n.certrev-reader .certrev-r-foot span + span {\n\tcolor: #1414148c;\n}\n.certrev-reader .certrev-r-kick {\n\tfont-family: \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;\n\tletter-spacing: 0.16em;\n\ttext-transform: uppercase;\n\tcolor: #1414148c;\n\tmargin-bottom: 14px;\n\tfont-size: 9.5px;\n}\n.certrev-reader .certrev-r-memo {\n\tgap: 15px;\n\tdisplay: flex;\n}\n.certrev-reader .certrev-r-memo > div {\n\tflex: 1;\n\tmin-width: 0;\n}\n.certrev-reader .certrev-r-memo-name {\n\tcolor: #1414148c;\n\tmargin-bottom: 11px;\n\tfont-size: 15px;\n}\n.certrev-reader .certrev-r-memo-name b {\n\tcolor: #141414;\n\tfont-weight: 700;\n}\n.certrev-reader blockquote {\n\tborder-left: 3px solid var(--cr-ba);\n\tcolor: #141414b8;\n\ttext-wrap: pretty;\n\tmargin: 0;\n\tpadding-left: 16px;\n\tfont-size: 13.5px;\n\tfont-style: italic;\n\tline-height: 1.55;\n}\n.certrev-reader .certrev-r-links {\n\tgap: 22px;\n\tmargin-top: 14px;\n\tdisplay: flex;\n}\n.certrev-reader .certrev-r-links a {\n\tcolor: #141414;\n\twhite-space: nowrap;\n\tfont-size: 13.5px;\n\tfont-weight: 700;\n\ttext-decoration: none;\n}\n.certrev-reader .certrev-r-links a:hover {\n\tcolor: var(--cr-ba);\n}\n.certrev-reader .certrev-r-vfoot {\n\talign-items: baseline;\n\tgap: 16px;\n\tdisplay: flex;\n}\n.certrev-reader .certrev-r-vfoot .certrev-r-scope {\n\tflex: 1;\n\tmin-width: 0;\n\tmargin-top: 0;\n}\n.certrev-reader .certrev-r-verified {\n\tcolor: #141414b8;\n\tflex-shrink: 0;\n\talign-items: center;\n\tgap: 9px;\n\tfont-size: 12.5px;\n\tdisplay: inline-flex;\n}\n.certrev-reader .certrev-r-verified img {\n\tflex-shrink: 0;\n\twidth: 17px;\n\theight: 17px;\n\tdisplay: block;\n}\n.certrev-reader .certrev-r-verified b {\n\tfont-family: \"Plus Jakarta Sans\", -apple-system, system-ui, Helvetica, Arial, sans-serif;\n\tfont-weight: 800;\n}\n.certrev-reader .certrev-r-scope {\n\tcolor: #1414148c;\n\ttext-wrap: pretty;\n\tmargin-top: 9px;\n\tfont-size: 12.5px;\n\tline-height: 1.5;\n}\n.certrev-reader .certrev-r-scope em {\n\tfont-style: normal;\n\tfont-family: \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;\n\tletter-spacing: 0.1em;\n\ttext-transform: uppercase;\n\tfont-size: 9.5px;\n}\n.certrev-reader .certrev-r-side {\n\tz-index: 1;\n\tfloat: right;\n\tborder: 1px solid #14141421;\n\tborder-radius: var(--cr-br);\n\twidth: 268px;\n\tbox-shadow: 0 4px 18px #14141412;\n\tbackground: #fff;\n\tmargin: 2px 0 18px 28px;\n\tposition: relative;\n\toverflow: hidden;\n}\n.certrev-reader .certrev-r-side-body {\n\tpadding: 18px;\n}\n.certrev-reader .certrev-r-side-body .certrev-r-by b {\n\tfont-size: 14px;\n}\n.certrev-reader .certrev-r-side-body p {\n\tcolor: #141414b8;\n\ttext-wrap: pretty;\n\tmargin: 15px 0 0;\n\tfont-size: 13px;\n\tline-height: 1.55;\n}\n.certrev-reader .certrev-r-side-body blockquote {\n\tmargin-top: 15px;\n\tpadding-left: 15px;\n\tfont-size: 13.5px;\n\tline-height: 1.55;\n}\n.certrev-reader .certrev-r-side-body .certrev-r-scope {\n\tmargin-top: 15px;\n\tfont-size: 11.5px;\n}\n.certrev-reader .certrev-r-side-links {\n\tborder-top: 1px solid #14141421;\n\tgrid-template-columns: 1fr 1fr;\n\tdisplay: grid;\n}\n.certrev-reader .certrev-r-side-links a {\n\ttext-align: center;\n\tcolor: #141414;\n\tpadding: 13px;\n\tfont-size: 13px;\n\tfont-weight: 700;\n\ttext-decoration: none;\n}\n.certrev-reader .certrev-r-side-links a:first-child {\n\tborder-right: 1px solid #14141421;\n}\n.certrev-reader .certrev-r-side-links a:hover {\n\tcolor: var(--cr-ba);\n}\n.certrev-reader .certrev-r-pill {\n\tz-index: 3;\n\tbackground: var(--cr-ba);\n\tcolor: var(--cr-ba-fg);\n\tborder-radius: 999px;\n\talign-items: center;\n\tgap: 13px;\n\tpadding: 12px 21px;\n\tdisplay: inline-flex;\n\tposition: absolute;\n\tbottom: 26px;\n\tright: 26px;\n\tbox-shadow: 0 10px 26px #14141429;\n}\n.certrev-reader .certrev-r-pill span {\n\twhite-space: nowrap;\n\tfont-family: \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;\n\tletter-spacing: 0.14em;\n\ttext-transform: uppercase;\n\tfont-size: 10.5px;\n\tfont-weight: 700;\n}\n.certrev-reader .certrev-r-pill a {\n\tcolor: inherit;\n\ttext-underline-offset: 3px;\n\tfont-size: 13.5px;\n\tfont-weight: 700;\n\ttext-decoration: underline;\n}\n.certrev-reader .certrev-r-pill i {\n\topacity: 0.42;\n\tfont-style: normal;\n}\n@media (max-width: 820px) {\n\t.certrev-reader .certrev-r-side {\n\t\tfloat: none;\n\t\twidth: auto;\n\t\tmargin: 20px 0;\n\t}\n\t.certrev-reader .certrev-r-bys {\n\t\tgrid-template-columns: 1fr;\n\t\tgap: 18px;\n\t}\n\t.certrev-reader .certrev-r-cap {\n\t\tletter-spacing: 0.1em;\n\t\tpadding: 12px 16px;\n\t\tfont-size: 9.5px;\n\t}\n\t.certrev-reader .certrev-r-cap-body,\n\t.certrev-reader .certrev-r-card.pad {\n\t\tpadding: 16px 18px;\n\t}\n\t.certrev-reader .certrev-r-pill {\n\t\tgap: 10px;\n\t\tpadding: 10px 16px;\n\t\tbottom: 20px;\n\t\tright: 20px;\n\t}\n}\n@media (max-width: 560px) {\n\t.certrev-reader .certrev-r-links {\n\t\tflex-direction: column;\n\t\tgap: 9px;\n\t}\n\t.certrev-reader .certrev-r-foot {\n\t\tflex-direction: column;\n\t\talign-items: flex-start;\n\t\tgap: 6px;\n\t}\n\t.certrev-reader .certrev-r-foot span {\n\t\twhite-space: normal;\n\t}\n\t.certrev-reader .certrev-r-vfoot {\n\t\tflex-direction: column;\n\t\talign-items: flex-start;\n\t\tgap: 10px;\n\t}\n\t.certrev-reader .certrev-r-vfoot .certrev-r-scope {\n\t\twidth: 100%;\n\t}\n\t.certrev-reader .certrev-r-cap {\n\t\twhite-space: normal;\n\t\tletter-spacing: 0.08em;\n\t\tpadding: 11px 14px;\n\t\tfont-size: 9px;\n\t}\n\t.certrev-reader .certrev-r-cap-body,\n\t.certrev-reader .certrev-r-card.pad {\n\t\tpadding: 14px 15px;\n\t}\n\t.certrev-reader .certrev-r-foot {\n\t\tflex-wrap: wrap;\n\t\tgap: 8px 14px;\n\t}\n\t.certrev-reader .certrev-r-links {\n\t\tflex-wrap: wrap;\n\t\tgap: 16px;\n\t}\n\t.certrev-reader .certrev-r-vfoot {\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t}\n\t.certrev-reader .certrev-r-face.lg {\n\t\twidth: 38px;\n\t\theight: 38px;\n\t}\n\t.certrev-reader .certrev-r-side {\n\t\tmargin: 16px 0;\n\t}\n\t.certrev-reader .certrev-r-side-links a {\n\t\tpadding: 12px 8px;\n\t}\n\t.certrev-reader .certrev-r-pill {\n\t\ttext-align: center;\n\t\tflex-wrap: wrap;\n\t\tjustify-content: center;\n\t\tgap: 6px 12px;\n\t\tpadding: 11px 14px;\n\t\tbottom: 14px;\n\t\tleft: 14px;\n\t\tright: 14px;\n\t}\n\t.certrev-reader .certrev-r-pill span {\n\t\twhite-space: normal;\n\t}\n}\n/* Theme-bleed armor (hand-written, not from the snapshot; see build-cert-reader-css.mjs). */\n.certrev-reader img {\n\tmargin: 0 !important;\n\tmax-width: 100% !important;\n\tfloat: none !important;\n}\n.certrev-reader a {\n\tbackground-image: none !important;\n}\n.certrev-reader .certrev-r-links a,\n.certrev-reader .certrev-r-side-links a {\n\ttext-decoration: none !important;\n}\n.certrev-reader .certrev-r-links a:not(:hover),\n.certrev-reader .certrev-r-side-links a:not(:hover) {\n\tcolor: #141414 !important;\n}\n.certrev-reader .certrev-r-links a:hover,\n.certrev-reader .certrev-r-side-links a:hover {\n\tcolor: var(--cr-ba) !important;\n}\n.certrev-reader .certrev-r-pill a {\n\tcolor: inherit !important;\n\ttext-decoration: underline !important;\n}\n.certrev-reader .certrev-r-face img {\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n}\n.certrev-reader .certrev-r-bys.solo {\n\tgrid-template-columns: minmax(0, 1fr);\n}\n.certrev-reader .certrev-r-foot a {\n\tcolor: inherit !important;\n\ttext-decoration: underline !important;\n}\n.certrev-reader .certrev-r-pill {\n\tposition: fixed;\n\tmargin-bottom: env(safe-area-inset-bottom, 0px);\n}\n.certrev-memo-wrap[data-certrev-placement=\"rail\"] .certrev-reader .certrev-r-side {\n\tfloat: none;\n\twidth: auto;\n\tmargin: 0;\n}\n.certrev-memo-wrap[data-certrev-placement=\"body-fallback\"] .certrev-reader .certrev-r-side,\n.certrev-sidebar-wrap:not([data-certrev-placement]) .certrev-reader .certrev-r-side {\n\tfloat: none;\n\twidth: auto;\n\tmax-width: 360px;\n\tmargin: 0 auto;\n}\n.certrev-reader .certrev-r-side-links.single {\n\tgrid-template-columns: minmax(0, 1fr);\n}\n.certrev-reader .certrev-r-side-links.single a:first-child {\n\tborder-right: 0;\n}\n/* Reader-only font aliases (generated from the CERTREV-FONTS rules above: the same files and unicode ranges, only the family and\n * the weight range differ, so the reader paints weights the legacy card does not declare). */\n@font-face {\n\tfont-family: \"CertREV Reader Serif\";\n\tfont-style: normal;\n\tfont-weight: 400 700;\n\tfont-display: swap;\n\tsrc: url(\"https://assets.certrev.com/fonts/cert-playfair-latin-ext.woff2\") format(\"woff2\");\n\tunicode-range:\n\t\tU+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n\n@font-face {\n\tfont-family: \"CertREV Reader Serif\";\n\tfont-style: normal;\n\tfont-weight: 400 700;\n\tfont-display: swap;\n\tsrc: url(\"https://assets.certrev.com/fonts/cert-playfair-latin.woff2\") format(\"woff2\");\n\tunicode-range:\n\t\tU+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n@font-face {\n\tfont-family: \"CertREV Reader Serif\";\n\tfont-style: italic;\n\tfont-weight: 400 700;\n\tfont-display: swap;\n\tsrc: url(\"https://assets.certrev.com/fonts/cert-playfair-italic-latin-ext.woff2\") format(\"woff2\");\n\tunicode-range:\n\t\tU+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n\n@font-face {\n\tfont-family: \"CertREV Reader Serif\";\n\tfont-style: italic;\n\tfont-weight: 400 700;\n\tfont-display: swap;\n\tsrc: url(\"https://assets.certrev.com/fonts/cert-playfair-italic-latin.woff2\") format(\"woff2\");\n\tunicode-range:\n\t\tU+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n@font-face {\n\tfont-family: \"CertREV Reader Grotesk\";\n\tfont-style: normal;\n\tfont-weight: 400 800;\n\tfont-display: swap;\n\tsrc: url(\"https://assets.certrev.com/fonts/cert-jakarta-latin-ext.woff2\") format(\"woff2\");\n\tunicode-range:\n\t\tU+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n\n@font-face {\n\tfont-family: \"CertREV Reader Grotesk\";\n\tfont-style: normal;\n\tfont-weight: 400 800;\n\tfont-display: swap;\n\tsrc: url(\"https://assets.certrev.com/fonts/cert-jakarta-latin.woff2\") format(\"woff2\");\n\tunicode-range:\n\t\tU+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* CERTREV-READER-GEN:END */\n"
|