import type { Branding } from "../types.js";
import type { CompletionRefusalReason } from "./types.js";
/**
with the shared design-system CSS. `extraCss` lets a page add the few
* component styles unique to it without forking the design language. `branding` (from
* `new CredentAgent({ branding })`) appends the host's accent/logo overrides after the
* design system — omitted ⇒ the built-in look, byte-for-byte. */
export declare function pageHead(title: string, extraCss?: string, branding?: Branding): string;
/** The wordmark + a discreet DEMO pill, with an optional confident h1 + identity-first
* tagline underneath. Pass `h1`/`tagline` to render the heading block; omit them to render
* just the brand row (a page can lay out its own heading). `branding` swaps the wordmark for
* the host's (or its logo) and can hide the DEMO pill; omitted ⇒ the CREDENTAGENT wordmark +
* DEMO pill, byte-for-byte. The honesty trust footer is NOT branded (see `trustFooter`). */
export declare function brandHeader(opts?: {
h1?: string;
tagline?: string;
}, branding?: Branding): string;
/** An indeterminate "settling…" progress bar (hidden until JS adds `.on`). Shown on
* the payment rails while x402 settlement runs on-chain (~10s) so the wait reads as
* live work. `id` defaults to "settling" for the page script to toggle. */
export declare function settlingBar(id?: string): string;
/**
* The prominent end-of-ceremony handoff banner: every attestation + payment is done,
* so the order is COMPLETE. It tells the buyer they can close the window and continue
* in their agent — the MCP host polls order-status and resumes the conversation
* automatically (Mode A: the agent never runs the ceremony, it only orchestrates +
* polls). An optional secondary link returns to the checkout hub for a pure-browser
* flow. Built server-side and embedded into the gate page's receipt script.
*/
export declare function completionHandoffBanner(returnUrl?: string, labels?: CompletionLabels): string;
/** Wording overrides for a ceremony that is NOT a purchase (an identity-only gate has no
* order to complete and no checkout to return to). Defaults keep the checkout wording. */
export interface CompletionLabels {
headline?: string;
sub?: string;
returnLabel?: string;
}
/**
* The "Close this window" button on the completion banners. It tries `window.close()`;
* browsers only honour that for windows a script opened, so if the page is still here a
* moment later the button turns into a plain instruction instead of silently doing nothing.
*/
export declare function closeWindowButton(): string;
/**
* Client-side statement (embed inside a pay rail's completion handler, after the receipt
* is rendered into `#receipt`): turn the page into a finished screen. It lifts the
* `.complete-banner` to the top of the page (right under the brand header), hides the pay
* controls via `body.completed`, folds the rest of the receipt (mandate id, gates,
* settlement proof) into a collapsed "Payment details", and scrolls to the top — so on a
* phone the buyer sees "close this window" first, not a disabled button above the fold.
*/
export declare function completedViewScript(): string;
/**
* Buyer-facing copy for every refusal `completeOrder` can make, keyed by its `reason`
* (plus `unknown` for a reason this build doesn't recognise — a newer gate talking to an
* older page). The payment rails embed the whole map server-side and pick one at runtime,
* so escaping happens HERE and the page script stays logic-free.
*
* This exists because a refusal used to render as nothing at all: the pages showed the
* success banner on `completed` and dropped `reason` on the floor, so a buyer whose order
* was correctly refused saw "✓ Payment Mandate authorized", four green gates, and silence
* — indistinguishable from a hang. Every notice therefore states the OUTCOME ("the order
* was not placed") before the cause, and names the buyer's next step in their language.
*
* `returnUrl` (the checkout hub) adds the way back; omit it for an MCP-only flow where
* there is no hub to return to. The `Record` is exhaustive over `CompletionRefusalReason`,
* so adding a reason to that union fails the build until its copy lands.
*/
export declare function refusalNotices(opts?: {
returnUrl?: string;
}): Record;
export interface OrderSummaryLine {
/** Display label (e.g. "Oak Whiskey"). */
name: string;
quantity: number;
lineTotal: number;
/** ISO 4217; falls back to the card currency. */
currency?: string;
}
export interface OrderSummaryArgs {
lines: OrderSummaryLine[];
total: number;
/** Major-units discount; the accent row renders only when > 0. */
discount?: number;
currency: string;
/** Optional label on the discount row, e.g. "Loyalty discount (10%)". */
discountLabel?: string;
/** Optional caption above the table (e.g. "Order ORD-1 · 2 items"). */
caption?: string;
/** Render the money column + Total row. Default true. Pass `false` for a ceremony that
* prices nothing (an identity-only gate): the card still names WHAT is being gated —
* the one thing the user is consenting to — but "$0.00 / Total $0.00" would frame an
* access decision as a free purchase. */
showAmounts?: boolean;
}
/** The order summary card: line items, an accent discount row, a bold Total with a
* top hairline. Money is tabular. Shared by all three pages so the cart reads the
* same everywhere. */
export declare function orderSummaryCard(args: OrderSummaryArgs): string;
export interface RailStep {
label: string;
/** true once this step's verification is recorded. */
done?: boolean;
}
/**
* The Age · Membership · Pay stepper. DONE = filled accent with ✓; CURRENT (the step
* at `currentIndex`, when not already done) = accent ring; everything else = muted.
* The hub passes real status; each gate page marks its OWN step current.
*/
export declare function progressRail(steps: RailStep[], currentIndex: number): string;
/**
* Order-derived progress rail for the ceremony gate pages (payment / credential). Includes
* ONLY the gates the ORDER actually has — Age when the cart is age-restricted, Membership
* when a discount is in play, Pay when there's an amount — plus the CURRENT gate, which is
* always shown even if the order can't imply it (a custom credential id). A step shows ✓
* only when ACTUALLY satisfied (age from the verification record, membership from an applied
* discount), never merely because it precedes the current step — so a payment page can't
* claim "Age ✓" the buyer never presented. Mirrors the hub's stepper inputs without needing
* the policy manifest, which the rails don't carry.
*/
export declare function checkoutRail(order: {
lines: {
minimumAge?: number;
}[];
discount: number;
total: number;
}, current: string, // "age" | "membership" | "pay" | a custom credential id
opts?: {
ageVerified?: boolean;
currentLabel?: string;
includePay?: boolean;
}): string;
/**
* Client-side statement (embed inside a rail page's completion handler): flip the progress
* rail's CURRENT step to done ✓. `checkoutRail` renders the current step un-ticked (a
* highlighted number), but once the order COMPLETES that step IS done — the pay rails call
* this on `out.completed` so the stepper agrees with the "Order complete" banner instead of
* leaving Pay a highlighted number (#46).
*/
export declare function railCompleteScript(): string;
/**
* Client-side declaration: `showInspectLink(presentation, containerId = "log")` — when a
* verify response carries `presentation` (the host set `inspectPresentations`), append an
* "Inspect this presentation" link that opens the wallet's DeviceResponse in Multipaz
* Tools, with the honest note that this gate does not check the issuer signature. A no-op
* when `presentation` is absent (the default), so pages call it unconditionally. Only a
* tools.multipaz.org link is ever rendered, and it is built with DOM APIs (no innerHTML).
*/
export declare function inspectLinkScript(): string;
/**
* Client-side declaration: `showRecordLink()` — once the order completes, append an "Order record ›"
* link to `#receipt` that opens the store's own order-status JSON (the completed order, with what was
* proven for it). `statusUrl` comes from the host's `statusUrl` seam; only a root-relative path or an
* https URL is linked, anything else (or absent) makes this a no-op. Built with DOM APIs (no innerHTML).
*/
export declare function recordLinkScript(statusUrl: string | undefined): string;
/**
* Server-rendered "What was proven" block for a finished order: one line per proof (gate · trust
* level, or "instant demo"), with the Multipaz Tools links a wallet proof carries (Inspect this
* presentation, Issuer certificate), one "Check the signatures" link to the Multipaz verifier when
* any wallet proof is shown, and "Order record ›" to the store's order-status record. Only the
* payment step's own proof can carry those links, for the browser that just presented it; stored
* proofs never do (#320). Only
* tools.multipaz.org URLs and a root-relative / https record URL are ever linked; labels are
* escaped. Empty when there is nothing to show.
*/
export declare function proofLinksHtml(proofs: readonly {
gate: string;
rail: string;
trust_level: string;
presentation?: {
inspectUrl?: string;
issuerCertUrl?: string;
};
}[] | undefined, statusUrl: string | undefined): string;
/**
* The single, DISCREET presence-only honesty line (replaces the old yellow warning
* box). It MUST keep the literal "presence-only-demo" token (FR-011 + the honesty
* tests) — the wire crypto is real; the issuer trust anchor is not.
*
* DELIBERATELY takes no `branding` argument (issue #61): host branding customises the
* chrome, never the trust disclosure. This line is identical on every page, branded or
* not — do not thread branding in here (a bypass test asserts it stays fixed).
*/
export declare function trustFooter(): string;
/**
* The honesty line for the intent-sign rail (spec 012, FR-4). Distinct from
* `trustFooter()` because the trust level is different: here the wallet's device
* signature IS verified, so the disclosure says so — while stating plainly that the
* trust ANCHOR is still a demo credential (no issuer/VICAL check — #14). It MUST keep
* the literal token "device-signed".
*
* Like `trustFooter()`, it takes NO branding argument: host branding customises the
* chrome, never the trust disclosure (a bypass test asserts it stays fixed).
*/
export declare function deviceSignedTrustFooter(): string;