import { Venue } from '../types.js'; /** * Parse a raw venue payload into the normalized Venue domain shape. * * Wire shape (ApiVenue) is contained inside this module and never escapes it. * Uses `||` / `??` chains matching the old transformer exactly -- byte-identical * to previous behavior. Throw behavior preserved from old mapper: null/undefined * input throws exactly as the old code did. Callers always pass real wire objects. */ declare function vcParseVenue(raw: unknown): Venue; /** * Public re-export under the canonical name + back-compat alias. Existing call * sites using either parseVenue(apiVenue) or transformVenue(apiVenue) continue * to work unchanged; re-exports don't redeclare the identifier so the * no-shadowed-helper rule is satisfied without a suppression. * @internal canonical name; ./api publishes the `transformVenue` alias, and characterization.test.ts pins this one. */ export { vcParseVenue as parseVenue }; export declare const transformVenue: typeof vcParseVenue; /** * Extract fee configuration from a raw venue payload. * * Uses `??` (not `||`) so 0-valued fees are preserved correctly. */ declare function vcExtractVenueFees(raw: unknown): { serviceFeePercentage: number; serviceFeeCents: number; taxPercentage: number; }; /** * Get formatted venue address. * * Compare-first vs SC canonical formatVenueAddress(venue: Pick): GENUINELY DIVERGED — VC takes its own `Venue` * domain type (the resolved shape `vcParseVenue` emits), not SC's `ParsedVenue` * pick. Kept local under a non-shadowing name and re-exported below; no * eslint-disable. */ declare function vcFormatVenueAddress(venue: Venue): string; /** * The venue's checkout settings, as the checkout form needs them. * * These five keys describe what the checkout asks a buyer for, so the ONLY * consumer is CheckoutForm — every EventData shaper pulls them off whatever * venue block its payload carries and hands them down. Kept here, beside * extractVenueFees, because they are venue config read out of a raw venue * object, and because three shapers (event, series, collection) would otherwise * each grow their own copy of the fallbacks. * * Normalization is the server's (models.PublicCheckoutSettings): `required` * never arrives without `ask`, and the prompt is emitted only when the operator * has both ticked the box and written a question. This re-applies both rules * anyway — the widget is pinned by version and runs against whatever API the * host site's embed reaches, so it must not depend on the payload being current. * * BOTH require-flags are DEPENDENT fields and both are re-derived here, never * passed through raw. The raw columns can contradict each other (a row written * before the operator form grew its own guard, a CSV import, an operator who * ticked "require" and then blanked the question), and the rule the server * enforces in orders-service `CheckoutSettings()` is the one that matters: * NEVER DEMAND AN ANSWER TO A FIELD THE STOREFRONT DOES NOT RENDER. So * `requiredPhoneAtCheckout` dies with `ask`, and `requiredCustomCheckout` dies * with the normalized `hasCustomCheckout` — which is itself already false * unless there is a non-blank prompt to show. Read the raw flag instead and a * stale require=true/prompt='' row gives the buyer an unsatisfiable form: an * error about a question that is not on the page. * * A MISSING key defaults to "ask for a phone, don't require it, ask nothing * else": the least surprising checkout, and the one a payload that predates * these keys should still produce. */ declare function vcExtractVenueCheckoutSettings(raw: unknown): { askForPhoneAtCheckout: boolean; requiredPhoneAtCheckout: boolean; hasCustomCheckout: boolean; requiredCustomCheckout: boolean; questionPrompt: string | undefined; }; export { vcExtractVenueFees as extractVenueFees, vcExtractVenueCheckoutSettings as extractVenueCheckoutSettings, vcFormatVenueAddress as formatVenueAddress, };