import { a as ProductFields } from './payloads-BYtydfZU.mjs'; /** * Mapper Interfaces * * Abstract interfaces for backend data mappers. * Each backend (Shopify, custom, etc.) implements these interfaces * to translate platform-specific data into ProductFields and event payloads. */ /** * Maps platform-specific cart items to ProductFields. */ interface CartItemMapper { /** Convert a single cart item to ProductFields */ toProductFields(item: TCartItem): ProductFields; /** Convert an array of cart items to ProductFields[] */ toProductFieldsList(items: TCartItem[]): ProductFields[]; /** Calculate total cart value from items */ calculateCartValue(items: TCartItem[]): number; /** Get currency code from items (or default) */ getCurrency(items: TCartItem[], defaultCurrency?: string): string; } /** * Maps platform-specific product data to ProductFields. */ interface ProductMapper { /** Convert a product to ProductFields */ toProductFields(product: TProduct, variantIndex?: number): ProductFields; } /** * Maps platform-specific order data to purchase event payload. * Output uses Meta-canonical field names. */ interface OrderMapper { /** Convert an order to purchase event payload fields */ toPurchasePayload(order: TOrder): { content_ids: string[]; content_type: string; currency: string; value: number; num_items: number; contents: Array<{ id: string; quantity: number; item_price: number; }>; order_id: string; tax?: number; shipping?: number; coupon?: string; }; } export type { CartItemMapper as C, OrderMapper as O, ProductMapper as P };