import { Module, ModuleOptions, PisellCore } from '../../types';
import { BaseModule } from '../../modules/BaseModule';
import { VenueBookingAddLogParams, VenueBookingSlotConfig, VenueDateSummaryItem, VenueSlotSelection, VenueTimeSlotGrid } from './types';
import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity } from '../ScanOrder/types';
import type { UpdateOrderProductParams } from '../../modules/Order/types';
import type { OpenDataAvailabilityResult } from '../../modules/OpenData';
import type { ProductData } from '../../modules/Product/types';
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
import type { StrategyConfig } from '../../model/strategy/type';
export * from './types';
interface VenueBookingItemRuleRuntimeConfig {
    strategyConfigs?: StrategyConfig[];
    pax?: Partial<PaxInfo>;
    historicalItems?: CartItemSummary[];
    serviceType?: string;
    submissionIndex?: number;
    custom?: Record<string, any>;
}
export declare class VenueBookingImpl extends BaseModule implements Module {
    protected defaultName: string;
    protected defaultVersion: string;
    isSolution: boolean;
    private initializeOptions;
    private store;
    private otherParams;
    private cacheId;
    private window;
    private request;
    private baseSlotConfig;
    private itemRuleEvaluator;
    private itemRuleConfigs;
    private itemRuleConfigsPromise;
    private itemRulePrefillApplied;
    private itemRuleRuntimeConfig;
    private resourceProductMap;
    private loginEffectDisposers;
    private customerLoginRefreshInFlight;
    private customerLoginRefreshIdInFlight;
    private loadAllProductsInFlight;
    private productsLoaded;
    private loadOpenDataConfigInFlight;
    private static readonly OPEN_DATA_CACHE_TTL;
    private getLoggerContext;
    private safeStringify;
    private pickErrorMessage;
    private serializeError;
    private addVenueBookingLog;
    private logMethodStart;
    private logMethodSuccess;
    private logMethodError;
    addLog(params: VenueBookingAddLogParams): Promise<void>;
    constructor(name?: string, version?: string);
    private normalizeCustomerId;
    private resolveCustomerIdFromLoginPayload;
    private clearLoginEffectListeners;
    private registerLoginEffect;
    private registerCustomerLoginListeners;
    private refreshOrderMarketingAfterLogin;
    initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
    destroy(): Promise<void>;
    retryInit(): Promise<void>;
    refresh(): Promise<void>;
    getStatus(): import("./types").VenueBookingStatus;
    getEntryContext(): import("./types").VenueBookingEntryContext | null;
    getItemRuleQuantityLimits(): QuantityLimitResult[];
    getCartValidationPassed(): boolean | null;
    getCartValidation(): {
        passed: boolean | null;
        failures: QuantityCheckResult[];
    };
    loadAllProducts(): Promise<{
        venueProducts: ProductData[];
        addonProducts: ProductData[];
    }>;
    private _doLoadAllProducts;
    loadVenueProducts(): Promise<ProductData[]>;
    loadAddonProducts(): Promise<ProductData[]>;
    getVenueProducts(): ProductData[];
    getAddonProductsList(): ProductData[];
    loadQuotations(params?: {
        channel?: string;
    }): Promise<void>;
    fetchResourceAvailability(params: {
        startDate: string;
        endDate: string;
    }): Promise<void>;
    private getOperatingHoursScheduleIds;
    private resolveSlotConfigForDate;
    private syncOperatingHoursToSlotConfig;
    getDateRangeSummary(params: {
        startDate: string;
        endDate: string;
    }): VenueDateSummaryItem[];
    getTimeSlotGrid(date: string): VenueTimeSlotGrid;
    /**
     * 切换单个时段的选中状态（选中/取消）。
     * 内部自动处理连续时段的合并与拆分，订单是唯一真相源。
     *
     * slot.productId 指定当前操作针对的是该 resourceId 下的哪一个商品。
     * 同一资源下不同 productId 之间互相隔离，不会相互合并。
     */
    toggleSlot(slot: VenueSlotSelection): Promise<ScanOrderOrderProduct[]>;
    /**
     * 获取某资源当前选中的所有独立时段（从订单中解析）。
     * 不传 productId 时返回该资源下所有商品的选中时段；传了则精确匹配。
     */
    getSelectedSlotsForResource(resourceId: number | string, productId?: number): VenueSlotSelection[];
    /** getSelectedSlotsForResource 的 (resourceId, productId) 精确版，内部使用。 */
    private getSelectedSlotsForResourceProduct;
    /**
     * 判断某个时段是否已选中。
     * 不传 productId 时：只要该资源下任一商品在 startTime 被选中即返回 true；传了则精确匹配。
     */
    isSlotSelected(resourceId: number | string, startTime: string, productId?: number): boolean;
    /**
     * 判断指定 (resourceId, productId, startTime) 格子是否应因其它已选项而被禁用。
     * 规则：
     * 1) 同一 resourceId 下若已选了另一个 productId 的同 startTime → 禁用
     * 2) 当前 resource 是组合资源：若其任一 child resource 在 startTime 被选中 → 禁用
     * 3) 当前 resource 是某些组合资源的 child：若该组合资源在 startTime 被选中 → 禁用
     * 4) 两个组合资源的 child 集合有交集，且对方在该 startTime 被选中 → 禁用
     */
    isSlotDisabledBySelection(params: {
        resourceId: number | string;
        productId: number;
        startTime: string;
    }): boolean;
    /**
     * 获取所有已选时段（按资源分组）。每个 slot 上带 productId，便于 UI 做 per-product 判定。
     */
    getAllSelectedSlots(): Map<number | string, VenueSlotSelection[]>;
    /**
     * 对指定 (resourceId, productId) 的订单商品进行 reconcile：
     * 清除旧商品 → 合并连续时段 → 重新写入。
     * 同一场地下不同商品互不干扰，各自单独 reconcile。
     */
    private reconcileOrderForResourceProduct;
    /** 给定一个父 rawResource，返回其 combined_resource.resource_ids 对应的子 rawResource 列表。 */
    private getCombinedChildRawResources;
    setSlotConfig(config: Partial<VenueBookingSlotConfig>): void;
    getSlotConfig(): VenueBookingSlotConfig;
    loadSchedules(): Promise<void>;
    private injectScheduleResolverToQuotation;
    getScheduleListByIds(ids: number[]): import("../../server").ScheduleItem[];
    getTempOrder(): import("../../modules/Order/types").OrderTempOrder | null;
    updateTempOrderNote(note: string): string;
    updateTempOrderContactsInfo(contactsInfo: any[]): Record<string, any> | null;
    private ensureTempOrder;
    onCustomerLogin(params: {
        customerId: number;
    }): Promise<void>;
    private recalculateOrderPricesFromQuotation;
    scanCode(code: string, customerId?: number): Promise<{
        isAvailable: boolean;
        discountList: import("../../modules/Discount").Discount[];
        type: "server" | "clientCalc";
        unavailableReason?: import("../../modules/Rules/types").UnavailableReason | undefined;
        unavailableReasonKey?: string | null | undefined;
        scannedDiscountList?: import("../../modules/Discount").Discount[] | undefined;
    }>;
    /** 获取当前折扣列表（包装 order.getDiscountList） */
    getDiscountList(): import("../../modules/Discount").Discount[];
    /** 勾选/取消勾选某张折扣券，重新计算折扣并持久化 */
    setDiscountSelected(params: {
        discountId: number;
        isSelected: boolean;
    }): Promise<import("../../modules/Discount").Discount[]>;
    addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
    getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
    getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
    submitOrder<T = any>(): Promise<T>;
    addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
    updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
    removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
    getProductList(): Promise<ProductData[]>;
    private loadOpenDataConfig;
    private loadRuntimeConfigs;
    private fetchItemRuleConfigsByModelIds;
    private buildPrefillProductSourceMap;
    private getItemRuleRuntimeConfig;
    private ensureItemRuleConfigsLoaded;
    private refreshItemRuleQuantityLimits;
    private applyPrefillByItemRule;
    applyItemRulePrefill(): Promise<void>;
    private evaluateCartValidationByItemRule;
    private validateBeforeSubmitByItemRule;
    private refreshCartValidationPassed;
    setItemRuleRuntimeConfig(config?: VenueBookingItemRuleRuntimeConfig): Promise<void>;
    getOtherParams(): Record<string, any>;
    private static readonly UI_STATE_KEY_PREFIX;
    private getUIStateBucketKey;
    private readUIStateBucket;
    private writeUIStateBucket;
    setUIState(key: string, value: any): void;
    getUIState<T = any>(key: string): T | undefined;
    deleteUIState(key: string): void;
    checkOpenDataAvailability(): Promise<OpenDataAvailabilityResult>;
    setOtherParams(params: Record<string, any>, { cover }?: {
        cover?: boolean;
    }): Promise<void>;
}
