import type { APIEndpoint } from "./apiEndpointTypes";
import type { BookingPaymentTermsConfig, BookingPricing, EventAttendanceMode, EventPricingMode, PublicEventEligibilityTicketTypeRecord, PublicEventTicketTypeRecord } from "./bookingConfig";
import type { AutoAppliedDiscountPreview } from "./bookingRecords";
import type { PublicCourseDetails } from "./courses";
import type { PublicTeamMemberBlockItem, PublicTeamMemberSummary } from "./teamMembers";
import type { EventPreset } from "./bookingConfig";
/**
 * Public-experience endpoints group the storefront-facing event, booking, newsletter,
 * and commerce loaders that are shared by blocks and public site runtime consumers.
 */
export type PublicEventLoaderParams = {
    limit?: string;
    from?: string;
    to?: string;
    afterStartsAt?: string;
    afterId?: string;
    categoryIds?: string;
    venueId?: string;
    staffMemberId?: string;
    kind?: string;
    eventSurface?: string;
    eventPresets?: string;
    scheduleScope?: string;
    entryId?: string;
    seriesId?: string;
    includeOccurrenceId?: string;
    detailLevel?: string;
};
export type PublicEventScheduleScope = "any" | "recurring" | "oneOff";
export type PublicEventSurfaceScope = "all" | "regularClassSchedule" | "specialDatedEvents" | "custom";
export type PublicEventDetailsLoaderParams = Omit<PublicEventLoaderParams, "detailLevel">;
export type PublicExperienceAPIEndpoints = {
    getPublicBookingCalendarFeedIcs: APIEndpoint<never, {
        siteId: string;
        token: string;
    }, string>;
    listPublicEvents: APIEndpoint<never, {
        siteId: string;
        stage?: string;
    } & PublicEventLoaderParams, Array<{
        kind?: "event" | "course_session";
        eventPreset?: EventPreset;
        scheduleScope?: Exclude<PublicEventScheduleScope, "any">;
        id: string;
        occurrenceId: string;
        seriesId: string;
        title: string;
        description: string | null;
        presentation?: {
            title?: string | null;
            summary?: string | null;
            image?: {
                type: "image" | "video" | "audio";
                purpose?: string;
                placeholder?: boolean;
                assetId?: string;
                src?: string;
                alt?: string;
                width?: number;
                height?: number;
                storageBucket?: string;
                storagePath?: string;
                transform?: {
                    rect?: [number, number, number, number];
                    hotspot?: {
                        x: number;
                        y: number;
                        radius?: number;
                    };
                };
            } | null;
            tags?: string[];
            ctaLabel?: string | null;
            badges?: string[];
        };
        slug: string;
        path: string;
        requiresRegistration: boolean;
        startsAt: string;
        endsAt: string;
        capacity: number | null;
        registeredCount: number;
        availableSpots: number | null;
        waitlistEnabled: boolean;
        venue: {
            id: string;
            name: string;
            address: string | null;
            location?: {
                lat: number;
                lng: number;
            } | null;
        } | null;
        eventCategory: {
            id: string;
            name: string;
            color: string | null;
        } | null;
        teamMembers?: PublicTeamMemberSummary[];
        status?: "active" | "draft" | "archived";
        pricingType: "free" | "paid" | "pass_only" | "membership_only";
        price: number | null;
        currency: string;
        paymentTerms: BookingPaymentTermsConfig;
        pricingMode?: EventPricingMode;
        ticketTypes?: PublicEventTicketTypeRecord[];
        accessRestriction: "none" | "category";
        allowedCategoryIds: string[];
        requireGuestDetails?: boolean;
        timeZone?: string;
        acceptsPasses?: boolean;
        acceptsMemberships?: boolean;
        course?: {
            id: string;
            pricing?: BookingPricing;
            priceCents: number | null;
            currency: string;
            enrollmentOpen: boolean;
        } | null;
    }>>;
    getPublicEventFilters: APIEndpoint<never, {
        siteId: string;
        stage?: string;
        categoryIds?: string;
        venueId?: string;
        staffMemberId?: string;
        kind?: string;
        eventSurface?: string;
        eventPresets?: string;
        scheduleScope?: string;
    }, {
        categories: Array<{
            id: string;
            name: string;
            identifier: string | null;
            color: string | null;
            upcomingCount: number;
        }>;
        venues: Array<{
            id: string;
            name: string;
            upcomingCount: number;
        }>;
        staffMembers: Array<{
            id: string;
            name: string;
            upcomingCount: number;
        }>;
        labels: {
            courseOption: string;
        };
    }>;
    listPublicPasses: APIEndpoint<never, {
        siteId: string;
        categories?: string;
    }, {
        passes: Array<{
            id: string;
            productUseCase: "event_pass" | "appointment_package";
            name: string;
            description: string | null;
            price: number;
            currency: string;
            creditsTotal: number;
            pricePerCredit: number;
            validDays: number | null;
            eligibleCategoryIds: string[];
            eligibleCategoryNames: string[];
        }>;
    }>;
    listPublicCourses: APIEndpoint<never, {
        siteId: string;
        limit?: string;
        stage?: string;
    }, Array<{
        id: string;
        title: string;
        slug: string;
        description: unknown;
        teamMembers?: PublicTeamMemberSummary[];
        enrollmentOpen: boolean;
        pricing?: BookingPricing;
        priceCents: number | null;
        currency: string;
        paymentTerms: BookingPaymentTermsConfig;
        enrollmentCapacity: number | null;
        acceptsMemberships: boolean;
        status: string;
        sessionsCount: number;
        enrolledCount: number;
        availableSpots: number | null;
        sessions: Array<{
            id: string;
            startsAt: string;
            endsAt: string;
            capacityOverride?: number | null;
            overrides?: Record<string, unknown> | null;
        }>;
        venue: {
            id: string;
            name: string;
            address: string | null;
        } | null;
        contentEntryId: string | null;
    }>>;
    listPublicTeamMembers: APIEndpoint<never, {
        siteId: string;
        stage?: string;
    }, {
        teamMembers: PublicTeamMemberBlockItem[];
    }>;
    getPublicCourse: APIEndpoint<never, {
        siteId: string;
        courseId: string;
        stage?: string;
    }, {
        course: PublicCourseDetails;
    }>;
    enrollInCourse: APIEndpoint<{
        courseId: string;
        pricingOptionId?: string;
        email: string;
        name: string;
        phone?: string;
        formData?: Record<string, unknown>;
        altchaSolution?: string | null;
        stage?: "preview" | "published";
        paymentMethod?: "free" | "membership";
        customerMembershipId?: string;
        claimToken?: string;
    }, {
        siteId: string;
    }, {
        enrollmentId: string;
        status: "enrolled";
        waitlistPosition?: number | null;
        courseTitle: string;
        sessionsCount: number;
        paymentMethod: "free" | "membership" | "stripe";
        pendingPayment: boolean;
        message: string;
    } | {
        status: "waitlist";
        waitlistPosition?: number | null;
        courseTitle: string;
        sessionsCount: number;
        paymentMethod: "free";
        pendingPayment: false;
        message: string;
    }>;
    resolveWaitlistClaim: APIEndpoint<{
        claimToken: string;
    }, {
        siteId: string;
    }, {
        subject: {
            kind: "event_occurrence";
            occurrenceId: string;
        } | {
            kind: "course";
            courseId: string;
        };
        expiresAt: string;
        customer: {
            email: string;
            name: string;
            phone: string | null;
        };
        prefill: {
            email: string;
            name: string;
            phone: string | null;
            notes: string | null;
            guests: Array<{
                name: string;
                email?: string | null;
                phone: string | null;
            }>;
        };
    }>;
    checkCourseEligibility: APIEndpoint<{
        courseId: string;
    }, {
        siteId: string;
    }, {
        courseId: string;
        canEnroll: boolean;
        canJoinWaitlist: boolean;
        reason?: string;
        availableSpots: number | null;
        isFull: boolean;
        isOnWaitlist: boolean;
        waitlistEnabled: boolean;
        price: {
            cents: number | null;
            currency: string;
        };
        paymentOptions: {
            free: boolean;
            membership: boolean;
            stripe: boolean;
        };
        eligibleMemberships?: Array<{
            customerMembershipId: string;
            membershipName: string;
        }>;
    }>;
    createCourseCheckout: APIEndpoint<{
        courseId: string;
        pricingOptionId?: string;
        email: string;
        name: string;
        phone?: string;
        formData?: Record<string, unknown>;
        altchaSolution?: string | null;
        discountCode?: string;
        successUrl: string;
        cancelUrl: string;
        claimToken?: string;
    }, {
        siteId: string;
    }, {
        checkoutUrl: string | null;
        sessionId: string | null;
        enrollmentId: string;
        bypassed: boolean;
    }>;
    getCourseRegistrationStatus: APIEndpoint<never, {
        siteId: string;
        sessionId: string;
    }, {
        enrollmentId: string;
        courseId: string;
        courseTitle: string;
        status: "pending_payment" | "enrolled" | "waitlist" | "cancelled" | "completed";
        paymentMethod: "free" | "membership" | "stripe" | null;
        paymentStatus: "pending" | "completed" | "failed" | "not_required" | "refunded" | null;
    }>;
    listPublicMemberships: APIEndpoint<never, {
        siteId: string;
        categories?: string;
    }, {
        memberships: Array<{
            id: string;
            name: string;
            description: string | null;
            price: number;
            currency: string;
            billingInterval: "month" | "year";
            eligibleCategoryIds: string[];
            eligibleCategoryNames: string[];
        }>;
    }>;
    listPublicProducts: APIEndpoint<never, {
        siteId: string;
        stage?: string;
    } & ({
        productCategoryScope?: undefined;
        productCategoryId?: undefined;
        productCategoryEntryId?: undefined;
    } | {
        productCategoryScope: "category";
        productCategoryId: string;
        productCategoryEntryId?: undefined;
    } | {
        productCategoryScope: "current-category-page";
        productCategoryEntryId: string;
        productCategoryId?: undefined;
    }), {
        products: Array<{
            id: string;
            contentEntryId: string | null;
            title: string;
            slug: string;
            path: string | null;
            status: "draft" | "active";
            priceCents: number;
            currency: string;
            productType: "physical" | "digital";
            requiresShipping: boolean;
            hasVariants: boolean;
            trackInventory: boolean;
            soldOut: boolean;
            category: {
                id: string;
                name: string;
                slug: string;
            } | null;
            summary: string | null;
            badges: string[];
            ctaLabel: string | null;
            body: unknown | null;
            gallery: Array<{
                url: string;
                alt: string | null;
            }>;
            variants: Array<{
                id: string;
                title: string;
                sku: string | null;
                priceCents: number;
                stockQuantity: number | null;
                soldOut: boolean;
            }>;
        }>;
    }>;
    listPublicGiftingOffers: APIEndpoint<never, {
        siteId: string;
    }, {
        currency: string;
        giftCards: Array<{
            id: string;
            kind: "gift_card";
            title: string;
            description: string | null;
            sortOrder: number;
            giftCard: {
                fixedDenominations: number[];
                customAmountEnabled: boolean;
                customAmountMinCents: number;
                customAmountMaxCents: number;
            };
            voucher: null;
        }>;
        vouchers: Array<{
            id: string;
            kind: "voucher";
            title: string;
            description: string | null;
            sortOrder: number;
            giftCard: null;
            voucher: {
                purchaseAmountCents: number;
            };
        }>;
    }>;
    createPublicGiftingCheckout: APIEndpoint<{
        offerId: string;
        purchaserName?: string | null;
        purchaserEmail: string;
        recipientName?: string | null;
        recipientEmail: string;
        message?: string | null;
        amountCents?: number | null;
        sendOnDate?: string | null;
        successUrl: string;
        cancelUrl: string;
    }, {
        siteId: string;
    }, {
        checkoutUrl: string;
        sessionId: string;
    }>;
    claimGiftCardPublic: APIEndpoint<{
        email: string;
        token?: string | null;
        code?: string | null;
    }, {
        siteId: string;
    }, {
        customerId: string;
        amountCents: number;
        currency: string;
    }>;
    createShopCheckout: APIEndpoint<{
        productType: "pass" | "membership";
        productId: string;
        customerEmail: string;
        customerName: string;
        discountCode?: string;
        successUrl: string;
        cancelUrl: string;
        confirmDuplicate?: boolean;
    }, {
        siteId: string;
    }, {
        checkoutUrl: string | null;
        sessionId: string | null;
        bypassed: boolean;
    } | {
        warning: "duplicate_membership";
        message: string;
        existingMembership: {
            id: string;
            name: string;
            expiresAt: string | null;
        };
    }>;
    createUnifiedCheckout: APIEndpoint<{
        mode: "one_time";
        items: Array<{
            type: "event_ticket";
            occurrenceId: string;
            ticketTypeId?: string;
            ticketCount: number;
            attendeeInfo: {
                email: string;
                name: string;
                formData?: Record<string, unknown>;
            };
        } | {
            type: "product";
            productId: string;
            variantId?: string;
            quantity: number;
        } | {
            type: "pass";
            passId: string;
        } | {
            type: "course_enrollment";
            courseId: string;
            pricingOptionId?: string;
            attendeeInfo: {
                email: string;
                name: string;
                formData?: Record<string, unknown>;
            };
        }>;
        customer: {
            email: string;
            name: string;
        };
        discountCode?: string;
        successUrl: string;
        cancelUrl: string;
    } | {
        mode: "subscription";
        membership: {
            membershipId: string;
        };
        customer: {
            email: string;
            name: string;
        };
        discountCode?: string;
        successUrl: string;
        cancelUrl: string;
    }, {
        siteId: string;
    }, {
        type: "redirect";
        checkoutUrl: string;
        sessionId: string;
        orderId: string | null;
        orderNumber: string | null;
    } | {
        type: "bypassed";
        orderId: string | null;
        orderNumber: string | null;
    }>;
    getDiscountsAvailable: APIEndpoint<{
        subtotalCents?: number;
        context: {
            type: "event";
            eventSeriesId: string;
            eventCategoryId: string | null;
            ticketsCount?: number;
        } | {
            type: "appointment";
            serviceId: string;
        } | {
            type: "course";
            courseId: string;
        } | {
            type: "pass";
            passId: string;
        } | {
            type: "membership";
            membershipId: string;
        } | {
            type: "product";
            productId: string;
            productCategoryId: string | null;
        };
    }, {
        siteId: string;
    }, {
        hasDiscounts: boolean;
        manualCodeEntryAllowed: boolean;
        autoAppliedDiscount: AutoAppliedDiscountPreview | null;
    }>;
    batchBlockLoaders: APIEndpoint<{
        requests: Array<{
            id: string;
            endpoint: "listPublicEvents";
            params?: PublicEventLoaderParams;
        } | {
            id: string;
            endpoint: "getPublicEventDetails";
            params?: PublicEventDetailsLoaderParams;
        } | {
            id: string;
            endpoint: "listPublicCourses";
            params?: {
                limit?: string;
            };
        } | {
            id: string;
            endpoint: "listPublicTeamMembers";
            params?: {
                siteId?: string;
                stage?: string;
            };
        } | {
            id: string;
            endpoint: "listPublicProducts";
            params?: {
                categorySelector?: {
                    kind: "category";
                    productCategoryId: string;
                } | {
                    kind: "current-category-page";
                    productCategoryEntryId: string;
                };
            };
        } | {
            id: string;
            endpoint: "getPublicBookingServices";
            params?: {
                ids?: string;
            };
        } | {
            id: string;
            endpoint: "getPublicFormById";
            params: {
                formId: string;
            };
        }>;
    }, {
        siteId: string;
        stage?: string;
    }, {
        results: Record<string, {
            ok: true;
            data: unknown;
        } | {
            ok: false;
            error: {
                code: string;
                message: string;
            };
        }>;
    }>;
    resolveEntrySubroute: APIEndpoint<never, {
        siteId: string;
        entryId: string;
        kind: "event-occurrence" | "course-run";
        segment: string;
        stage?: "preview" | "published";
    }, {
        subroute: {
            kind: "event-occurrence";
            occurrence: {
                id: string;
                seriesId: string;
                startsAt: string;
                endsAt: string;
                timeZone: string;
                status: string;
                capacityOverride: number | null;
                overridesJson: Record<string, unknown>;
            };
        } | {
            kind: "course-run";
            run: {
                courseId: string;
                seriesId: string;
                runSlug: string;
                runName: string | null;
            };
        } | null;
    }>;
    resolveEventOccurrence: APIEndpoint<never, {
        siteId: string;
        entryId: string;
        segment: string;
    }, {
        occurrence: {
            id: string;
            seriesId: string;
            startsAt: string;
            endsAt: string;
            timeZone: string;
            status: string;
            capacityOverride: number | null;
            overridesJson: Record<string, unknown>;
        } | null;
    }>;
    registerForEvent: APIEndpoint<{
        occurrenceId: string;
        attendanceMode?: EventAttendanceMode;
        email: string;
        name: string;
        ticketsCount?: number;
        phone?: string;
        notes?: string;
        formData?: Record<string, unknown>;
        altchaSolution?: string | null;
        stage?: "preview" | "published";
        paymentMethod?: "free" | "pass" | "membership" | "stripe" | "pass_bundle" | "membership_bundle";
        ticketTypeId?: string;
        customerPassId?: string;
        customerMembershipId?: string;
        bundleProductId?: string;
        claimToken?: string;
        guests?: Array<{
            name: string;
            email?: string | null;
            phone?: string | null;
        }>;
    }, {
        siteId: string;
    }, {
        success: boolean;
        attendeeId: string;
        status: "confirmed";
        paymentMethod: "free" | "pass" | "membership" | "stripe" | "pass_bundle" | "membership_bundle";
        pendingPayment: boolean;
        passCreditsUsed?: number;
        alreadyRegistered?: boolean;
        message: string;
    } | {
        success: boolean;
        attendeeId: string;
        status: "waitlist";
        waitlistPosition: number | null;
        alreadyRegistered?: boolean;
        message: string;
    }>;
    createPublicEventCheckout: APIEndpoint<{
        attendeeId: string;
        checkoutType?: "event" | "pass_bundle" | "membership_bundle";
        productId?: string;
        discountCode?: string;
        successUrl: string;
        cancelUrl: string;
    }, {
        siteId: string;
    }, {
        checkoutUrl: string | null;
        sessionId: string | null;
        bypassed: boolean;
    }>;
    checkPublicEventEligibility: APIEndpoint<{
        occurrenceId: string;
        attendanceMode?: EventAttendanceMode;
        email: string;
        ticketsCount?: number;
        ticketTypeId?: string;
    }, {
        siteId: string;
    }, {
        customerExists: boolean;
        eligibility: {
            isFull: boolean;
            waitlistEnabled: boolean;
            canJoinWaitlist: boolean;
            membership: {
                customerMembershipId: string;
                membershipName: string;
            } | null;
            passes: Array<{
                customerPassId: string;
                passName: string;
                creditsRemaining: number;
            }>;
            requiresPayment: boolean;
            pricingMode?: EventPricingMode;
            selectedTicketTypeId?: string | null;
            ticketTypes?: PublicEventEligibilityTicketTypeRecord[];
            eventPrice: number | null;
            eventPriceCurrency: string | null;
            eventAcceptsPasses: boolean;
            eventAcceptsMemberships: boolean;
            requiresAuthForPasses: boolean;
            requiresAuthForMemberships: boolean;
            availableForPurchase: {
                passes: Array<{
                    id: string;
                    name: string;
                    description: string | null;
                    price: number;
                    currency: string;
                    creditsTotal: number;
                    pricePerCredit: number;
                    validDays: number | null;
                }>;
                memberships: Array<{
                    id: string;
                    name: string;
                    description: string | null;
                    price: number;
                    currency: string;
                    interval: "month" | "year";
                }>;
            };
        };
    }>;
    getPublicEventRegistrationStatus: APIEndpoint<never, {
        siteId: string;
        attendeeId: string;
    }, {
        paymentStatus: "not_required" | "pending" | "completed" | "failed" | "refunded";
        attendeeStatus: "confirmed" | "waitlist" | "cancelled";
        waitlistPosition: number | null;
    }>;
    getPublicEventTicketQrSvg: APIEndpoint<never, {
        siteId: string;
        token: string;
    }, string>;
    subscribeNewsletter: APIEndpoint<{
        email: string;
        firstName?: string | null;
        lastName?: string | null;
        name?: string | null;
        company?: string | null;
        phone?: string | null;
        tags?: string[];
        listId: string;
        blockId?: string | null;
        meta?: {
            honeypot?: string;
            altchaSolution?: string | null;
        };
    }, {
        siteId: string;
    }, {
        subscribed: true;
        requiresConfirmation?: boolean;
    }>;
    confirmNewsletter: APIEndpoint<never, {
        siteId: string;
        token: string;
    }, string>;
    unsubscribeNewsletter: APIEndpoint<never, {
        siteId: string;
        token: string;
    }, string>;
    unsubscribeNewsletterPost: APIEndpoint<never, {
        siteId: string;
        token: string;
    }, string>;
    getNewsletterArchive: APIEndpoint<never, {
        siteId: string;
        token: string;
    }, string>;
};
