import * as _iblai_iblai_api from '@iblai/iblai-api';
import { FreeUsageCount, StripeCustomerPortalRequest } from '@iblai/iblai-api';
import { StripeContextResponse, AccessCheckResponse, UploadProfileImageResponse, RemoveProfileImageResponse, StorageService, TokenResponse, FileUploadURLResponse } from '@iblai/data-layer';
import * as React from 'react';
import React__default from 'react';
import { PricingModalData as PricingModalData$1 } from '@web-utils/types/subscription';
import { OpUnitType } from 'dayjs';
import duration from 'dayjs/plugin/duration';
import { ChatStatus as ChatStatus$1 } from '@web-utils/features';
import { Error402MessageData as Error402MessageData$1, Tenant as Tenant$3 } from '@web-utils/types';
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
import { Reducer, Slice } from '@reduxjs/toolkit';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { z } from 'zod';

interface Tenant$2 {
    key: string;
    is_admin: boolean;
    org: string;
}
interface SubscriptionFlowConfig {
    platformName: string;
    currentTenantKey: string;
    username: string;
    currentTenantOrg: string;
    userTenants: Tenant$2[];
    isAdmin: boolean;
    mainTenantKey: string;
}
/**
 * SubscriptionFlow class manages all subscription-related flows and user interactions
 * Handles free trial, usage limits, and subscription management
 */
declare abstract class SubscriptionFlow {
    protected platformName: string;
    protected currentTenantKey: string;
    protected username: string;
    protected currentTenantOrg: string;
    protected userTenants: Tenant$2[];
    protected isAdmin: boolean;
    protected mainTenantKey: string;
    constructor(config: SubscriptionFlowConfig);
    getPlatformName(): string;
    getCurrentTenantKey(): string;
    getUsername(): string;
    getCurrentTenantOrg(): string;
    getUserTenants(): Tenant$2[];
    isUserAdmin(): boolean;
    /**
     * Handles the flow when user reaches their free usage limit
     * Updates banner with appropriate message based on remaining usage count
     */
    abstract handleFreeUsageCountFlow(freeUsageCount: FreeUsageCount): void;
    /**
     * Handles the flow when user's free trial period has ended
     * Updates banner and clears any existing trial interval
     */
    abstract handleTrialEndedFlow(freeTrialIntervalID?: number): void;
    /**
     * Handles the flow for ongoing subscription period
     * Updates banner with remaining trial time and subscription options
     */
    abstract handleSubscriptionOnGoingFlow(timeRemainingInString: string): void;
    /**
     * Handles redirection to external URLs with optional toast notification
     */
    abstract handleRedirectToURLFlow(redirectUrl: string, toastMessage?: string): void;
    /**
     * Displays the pricing modal for subscription options
     */
    handlePricingPageDisplayFlow(): void;
    /**
     * Handles the pre-subscription state
     * Updates banner to show loading state
     */
    handleBeforeSubscribeUserTriggerFlow(): void;
    /**
     * Handles successful subscription completion
     * Shows success message and disables subscription banner
     */
    abstract handleSuccessfullySubscribedFlow(message?: string): void;
    getMainTenantKey(): string;
}

/**
 * Hook to handle subscription logic
 * @param subscriptionFlow Instance of SubscriptionFlow that manages different subscription states and actions
 */
declare const useSubscriptionHandler: (subscriptionFlow: SubscriptionFlow) => {
    handleSubscriptionCheck: () => Promise<void>;
    handleIntervalSubscriptionCheck: () => (() => void) | undefined;
    trialCounterStarted: boolean;
    bannerButtonTriggerCallback: (trigger: string) => () => void;
};

declare const SUBSCRIPTION_TRIGGERS: {
    PRICING_MODAL: string;
    SUBSCRIBE_USER: string;
};

interface Tenant$1 {
    key: string;
    is_admin: boolean;
    org: string;
    is_advertising?: boolean;
}
interface SubscriptionFlowConfigV2 {
    platformName: string;
    currentTenantKey: string;
    username: string;
    currentTenantOrg: string;
    userTenants: Tenant$1[];
    isAdmin: boolean;
    mainTenantKey: string;
    userEmail: string;
    mentorUrl: string;
}
/**
 * SubscriptionFlow class manages all subscription-related flows and user interactions
 * Handles free trial, usage limits, and subscription management
 */
declare abstract class SubscriptionFlowV2 {
    protected platformName: string;
    protected currentTenantKey: string;
    protected username: string;
    protected currentTenantOrg: string;
    protected userTenants: Tenant$1[];
    protected isAdmin: boolean;
    protected mainTenantKey: string;
    protected userEmail: string;
    protected mentorUrl: string;
    constructor(config: SubscriptionFlowConfigV2);
    getPlatformName(): string;
    getCurrentTenantKey(): string;
    getUsername(): string;
    getCurrentTenantOrg(): string;
    getUserTenants(): Tenant$1[];
    isUserAdmin(): boolean;
    getUserEmail(): string;
    getMainTenantKey(): string;
    getMentorUrl(): string;
    abstract handleRedirectToBillingPageFlow(billingUrl: string): void;
    handleBeforeTopUpCreditTriggerFlow(): void;
    handleBeforeBillingPageTriggerFlow(): void;
    /**
     * Handles the flow when user reaches their free usage limit
     * Updates banner with appropriate message based on remaining usage count
     */
    abstract handleFreeUsageCountFlow(hasCredits: boolean, appExists: boolean): void;
    /**
     * Displays the pricing modal for subscription options
     */
    abstract handlePricingPageDisplayFlow(stripeContext: StripeContextResponse, creditExhausted: boolean): void;
    /**
     * Displays error notification when payment flow fails
     */
    handleFailureOnPaymentFlow(): void;
    handleBeforePricingPageDisplayFlow(): void;
    handleFailureOnTopUpCreditTriggerFlow(): void;
    handlePaidPlanCreditExhaustedFlow(): void;
    handleProPlanCreditExhaustedFlow(): void;
    handleStudentOnPaidPlanCreditExhaustedFlow(): void;
    abstract handleOpenContactAdminFlow(adminEmail: string): void;
    abstract handleCreditExhaustedWithUserOnFreePackageFlow({ subscriptionId, expiryDate, }: {
        subscriptionId: string;
        expiryDate: string;
    }): void;
    abstract handleCreditExhaustedWithUserOnStarterPackageFlow({ subscriptionId, expiryDate, }: {
        subscriptionId: string;
        expiryDate: string;
    }): void;
    abstract handleCreditExhaustedWithUserOnProPackageFlow({ expiryDate, }: {
        expiryDate: string;
    }): void;
    handleFailureOnBillingPageTriggerFlow(): void;
}

/**
 * Hook to handle subscription logic
 * @param subscriptionFlow Instance of SubscriptionFlow that manages different subscription states and actions
 */
declare const useSubscriptionHandlerV2: (subscriptionFlow: SubscriptionFlowV2) => {
    handleSubscriptionCheck: () => Promise<void>;
    bannerButtonTriggerCallback: (trigger: string) => ((returnURL?: string) => Promise<void>) | (() => void);
    CREDIT_INTERVAL_CHECK_COUNTER: number;
    getBillingURL: ({ returnURL, includeSubscriptionIdIfNeeded, additionalPayload, }: {
        returnURL: string;
        includeSubscriptionIdIfNeeded?: boolean;
        additionalPayload?: Record<string, any>;
    }) => Promise<string | null | undefined>;
    getTopUpURL: (obtainBillingPageURLIfNeeded?: boolean) => Promise<string | null | undefined>;
    getUserSubscriptionPackage: () => Promise<string | null>;
    getUserActiveApp: (platformKey?: string, useCache?: boolean) => Promise<{
        id: null;
        app: {
            name: string;
            url: string;
            type: string;
            metadata: null;
            onboarding_required: boolean;
        };
        platform: {
            key: any;
            name: any;
            org: any;
            lms_url: null;
            cms_url: null;
            portal_url: null;
            is_advertising: boolean;
            is_enterprise: boolean;
        };
        subscription: {
            identifier: any;
            product: null;
            active: boolean;
            subscription_ends: null;
            subscription_starts: null;
            created_on: null;
            last_updated: null;
            owner: {
                email: null;
                username: null;
            };
            trial_ends: null;
            entitlements: {
                has_credits: any;
                account_id: any;
                available_credits: any;
            };
            uuid: any;
            stripe_mode: null;
            status: string;
            subscription_id: null;
            product_sku: any;
        };
        provider: string;
        is_admin: boolean;
        is_active: boolean;
        metadata: null;
        onboarding_completed: boolean;
        free_trial_started: any;
        free_trial_expired: boolean;
        has_active_subscription: boolean;
        pricing_table: any;
    } | null>;
    getUserActiveAppLegacy: (platformKey?: string, useCache?: boolean) => Promise<_iblai_iblai_api.UserApp | undefined>;
};

declare const useExternalPricingPlan: ({ pricingModalData, userEmail, }: {
    pricingModalData: PricingModalData$1;
    userEmail: string;
}) => {
    pricingBoxIframeRef: React.RefObject<null>;
};

declare const SUBSCRIPTION_V2_TRIGGERS: {
    PRICING_MODAL: string;
    TOP_UP_CREDIT: string;
    CONTACT_ADMIN: string;
    BILLING_PAGE: string;
};
declare const SUBSCRIPTION_MESSAGES: {
    CREDIT_EXHAUSTED: {
        FREE_PACKAGE: ({ expiryDate }: {
            expiryDate: string;
        }) => string;
        STARTER_PACKAGE: ({ expiryDate }: {
            expiryDate: string;
        }) => string;
        PRO_PACKAGE: ({ expiryDate }: {
            expiryDate: string;
        }) => string;
        STUDENT_UNDER_PAID_PACKAGE_EMAIL_BODY: ({ currentTenantOrg, userEmail, }: {
            currentTenantOrg: string;
            userEmail: string;
        }) => string;
        STUDENT_UNDER_PAID_PACKAGE_EMAIL_SUBJECT: ({ currentTenantOrg, }: {
            currentTenantOrg: string;
        }) => string;
        ADMIN: string;
        STUDENT: string;
        FREE_TRIAL_LIMIT: string;
        NO_APP: string;
    };
    ACTION_BUTTONS: {
        FREE_PACKAGE: string;
        STARTER_PACKAGE: string;
        PRO_PACKAGE: string;
        UPGRADE: string;
        TOP_UP: string;
        CONTACT_ADMIN: string;
        ADD_CREDITS: string;
    };
    TOAST_MESSAGES: {
        PRICING_PAGE_LOAD_ERROR: string;
        TOP_UP_CREDIT_TRIGGER_LOAD_ERROR: string;
        REDIRECTING_BILLING_PAGE: string;
        BILLING_PAGE_TRIGGER_LOAD_ERROR: string;
    };
};
declare const SUBSCRIPTION_PACKAGES: {
    PRE_FREE_PACKAGE: string;
    FREE_PACKAGE: (productName: string) => string;
    STARTER_PACKAGE: (productName: string) => string;
    PRO_PACKAGE: (productName: string) => string;
};
declare const SUBSCRIPTION_PACKAGES_V2: {
    FREE_PACKAGE: string;
    STARTER_PACKAGE: string;
    PRO_PACKAGE: string;
};

declare const useDayJs: () => {
    getTimeDifferenceBetweenTwoDates: (futureDate: string, pastDate: string, format?: OpUnitType) => number;
    getDayJSDurationObjFromSeconds: (seconds: number) => duration.Duration;
    generateFutureDateForNMinutes: (minute?: number) => string;
};

declare const advancedTabsProperties: {
    chat: {
        display: string;
        name: string;
        tag: string;
        showHeader: boolean;
        prompts: {
            type: string;
            icon: string;
            summary: string;
            content: string;
        }[];
    };
    summarize: {
        display: string;
        showHeader: boolean;
        name: string;
        tag: string;
        prompts: {
            type: string;
            proactive: boolean;
            hide: boolean;
            content: string;
        }[];
    };
    translate: {
        display: string;
        showHeader: boolean;
        name: string;
        tag: string;
        description: string;
        metaDescription: string;
        prompts: ({
            type: string;
            hide: boolean;
            tag: string;
            summary: string;
            content: string;
        } | {
            type: string;
            summary: string;
            content: string;
            hide?: undefined;
            tag?: undefined;
        })[];
    };
    expand: {
        display: string;
        showHeader: boolean;
        name: string;
        tag: string;
        prompts: {
            type: string;
            proactive: boolean;
            hide: boolean;
            content: string;
        }[];
    };
};
declare const advancedTabs: ("chat" | "summarize" | "translate" | "expand")[];
type AdvancedTab = keyof typeof advancedTabsProperties;
declare const translatePrompt: (language: string) => string;

/**
 * File reference sent via WebSocket to backend
 * Backend uses this to retrieve file from S3
 */
interface FileReference {
    /** Unique identifier for the ChatFile record */
    file_id: string;
    /** S3 object key for the uploaded file */
    file_key: string;
    /** Original filename */
    file_name: string;
    /** MIME type of the file */
    content_type: string;
    /** File size in bytes */
    file_size: number;
    /** Presigned URL for displaying the file (optional, for UI) */
    upload_url?: string;
}
/**
 * File upload state for UI tracking
 */
interface FileUploadState {
    /** Original File object */
    file: File;
    /** Upload/processing status */
    status: "pending" | "uploading" | "processing" | "success" | "error";
    /** Upload progress (0-100) */
    progress: number;
    /** File reference after successful upload */
    fileReference?: FileReference;
    /** Error message if upload failed */
    error?: string;
}
/**
 * File processing event from WebSocket
 */
type FileProcessingEvent = {
    type: "file_processing_progress";
    file_name: string;
    progress: string;
} | {
    type: "file_processing_success";
    file_name: string;
    file_url: string;
} | {
    type: "file_error";
    file_name?: string;
    error: string;
    developer_error?: string;
};
/**
 * Upload progress callback
 */
type UploadProgressCallback = (progress: number) => void;
/**
 * File info extracted from File object
 */
interface FileInfo {
    fileName: string;
    contentType: string;
    fileSize: number;
}

type MessageActionTypes = "redirectToAuthSpaJoinTenant";
interface MessageAction {
    text: string;
    type: "primary" | "danger";
    actionType: MessageActionTypes;
}
interface FileAttachment {
    fileName: string;
    fileType: string;
    fileSize: number;
    uploadUrl?: string;
    fileId?: string;
}
interface ArtifactData {
    id: number;
    title: string;
    content: string;
    file_extension: string;
    llm_name?: string;
    llm_provider?: string;
    date_created: string;
    date_updated: string;
    metadata?: Record<string, unknown>;
    username?: string;
    session_id?: string;
    current_version_number?: number;
    version_count?: number;
}
interface ArtifactVersion {
    id: number;
    artifact: ArtifactData;
    title: string;
    content: string;
    session_id?: string;
    content_length?: number;
    is_current: boolean;
    is_partial?: boolean;
    chat_message?: number;
    version_number: number;
    date_created: string;
    created_by?: string;
    change_summary?: string;
}
interface Message {
    id: string;
    role: "user" | "assistant" | "system";
    content: string;
    timestamp: string;
    url?: string;
    fileType?: string;
    contentType?: string;
    visible: boolean;
    actions?: MessageAction[];
    fileAttachments?: FileAttachment[];
    artifactVersions?: ArtifactVersion[];
}
type ArtifactPayload = {
    title: string;
    file_extension: string;
    id: string;
    is_partial?: boolean;
    snippet_start?: number;
    snippet_end?: number;
};
type SendMessageOptions = {
    visible?: boolean;
    fileReferences?: FileReference[];
    artifact?: ArtifactPayload;
} | undefined;
interface OAuthRequiredData {
    serverName: string;
    serverId: number;
    authUrl: string;
    message: string;
}
interface OAuthResolvedData {
    serverName: string;
    serverId: number;
    message: string;
}
interface UseChatProps {
    wsUrl: string;
    wsToken: string;
    flowConfig: {
        name: string;
        tenant: string;
        username: string;
        pathway: string;
    };
    sessionId: string;
    stopGenerationWsUrl: string;
    activeTab: AdvancedTab;
    enableHaptics?: boolean;
    hapticFeedback?: {
        impactAsync: (style: any) => Promise<void>;
    };
    redirectToAuthSpa: (redirectTo?: string, platformKey?: string, logout?: boolean) => void;
    store?: {
        sendMessage?: (text: string) => Promise<void>;
    };
    WebSocketImpl?: typeof WebSocket;
    errorHandler?: (message: string, error?: any) => void;
    onStatusChange: (status: ChatStatus$1) => void;
    onStreamingChange: (streaming: boolean) => void;
    onStreamingMessageUpdate: (message: {
        id: string | null;
        content: string;
    }) => void;
    onAddUserMessage?: (activeTab: AdvancedTab, message: Message) => void;
    sendMessageToParentWebsite?: (payload: unknown) => void;
    on402Error?: (message: Error402MessageData$1) => void;
    onOAuthRequired?: (data: OAuthRequiredData) => void;
    onOAuthResolved?: (data: OAuthResolvedData) => void;
    onOfflineWithoutLocalLLM?: () => void;
    isOffline?: boolean;
}
interface UseChatReturn {
    sendMessage: (tab: AdvancedTab, text: string, options?: SendMessageOptions) => Promise<void>;
    ws: React__default.MutableRefObject<WebSocket | null>;
    isConnected: React__default.MutableRefObject<boolean>;
    messageQueue: React__default.MutableRefObject<any[]>;
    stopGenerating: () => void;
    resetConnection: () => void;
}
declare const useChat: ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, enableHaptics, hapticFeedback, store, errorHandler, onStatusChange, onStreamingChange, onStreamingMessageUpdate, WebSocketImpl, redirectToAuthSpa, sendMessageToParentWebsite, on402Error, onOAuthRequired, onOAuthResolved, onOfflineWithoutLocalLLM, isOffline, }: UseChatProps) => UseChatReturn;

declare const MENTOR_CHAT_DOCUMENTS_EXTENSIONS: string[];
declare const ANONYMOUS_USERNAME = "anonymous";
declare const MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS = 3;
declare const LOCAL_STORAGE_KEYS: {
    CURRENT_TENANT: string;
    TENANTS: string;
    REDIRECT_TO: string;
    AUTH_TOKEN: string;
    TOKEN_EXPIRY: string;
    USER_DATA: string;
    USER_TENANTS: string;
    EDX_TOKEN_KEY: string;
    DM_TOKEN_KEY: string;
    DM_TOKEN_EXPIRES: string;
};
declare const TOOLS: {
    readonly WEB_SEARCH: "web-search";
    readonly WIKIPEDIA_SEARCH: "wikipedia-search";
    readonly COURSE_CREATION: "course-creation";
    readonly MCP: "mcp";
    readonly IMAGE_GENERATION: "image-generation";
    readonly IBL_PATHWAY_DOCUMENTS_RETRIEVER: "ibl-pathway-documents-retriever";
    readonly TRAINED_DOCUMENTS: "trained-documents";
    readonly IBL_SESSION_DOCUMENTS_RETRIEVER: "ibl-session-documents-retriever";
    readonly PLAYWRIGHT_BROWSER: "playwright-browser";
    readonly HUMAN_SUPPORT: "human-support";
    readonly CODE_INTERPRETER: "code-interpreter";
    readonly DEEP_RESEARCH: "deep-research";
    readonly STUDY_MODE: "study-mode";
    readonly MEMORY: "memory";
    readonly SCREEN_SHARE: "screen-share";
    readonly POWERPOINT: "powerpoint";
    readonly PROMPT: "prompt";
    readonly QUIZ: "quiz";
    readonly RUBRIC: "rubric";
    readonly RESOURCE: "resource";
    readonly LESSON_PLAN: "lesson-plan";
    readonly SYLLABUS: "syllabus";
    readonly CANVAS: "canvas";
    readonly GOOGLE_SLIDES: "google-slides";
    readonly GOOGLE_DOCUMENT: "google-docs";
};
declare const REQUIRED_ACTIONS_FOR_GROUPS: {
    readonly NOTIFICATIONS: "Ibl.Notifications/Notification/action";
};

declare const isJSON: (text: string) => boolean;
declare const getInitials: (fullName: string) => string;
declare const ALPHANUMERIC_32_REGEX: RegExp;
declare const isAlphaNumeric32: (text: string) => boolean;
declare const addProtocolToUrl: (url: string) => string;
declare function getTimeAgo(createdAt: string): string;
declare const formatRelativeTime: (timestamp: string) => string;
/**
 * Convert markdown text to plain text by removing markdown formatting
 * @param text - The markdown text to convert
 * @returns Plain text without markdown formatting
 */
declare const markdownToPlainText: (text: string) => string;

/**
 * Authentication and Authorization Utilities
 *
 * This module provides utility functions for handling authentication flows,
 * including redirects to auth SPA, cookie management, and session handling.
 */
/**
 * Check if the current window is inside an iframe
 * @returns {boolean} True if running in an iframe, false otherwise
 */
declare function isInIframe(): boolean;
/**
 * Send a message to the parent website (when in iframe)
 * @param payload - The data to send to parent window
 */
declare function sendMessageToParentWebsite(payload: unknown): void;
/**
 * Delete a cookie with specific name, path, and domain
 * @param name - Cookie name
 * @param path - Cookie path
 * @param domain - Cookie domain
 */
declare function deleteCookie(name: string, path: string, domain: string): void;
/**
 * Get all possible domain parts for cookie deletion
 * @param domain - The domain to split
 * @returns Array of domain parts
 * @example
 * getDomainParts('app.example.com') // returns ['app.example.com', 'example.com', 'com']
 */
declare function getDomainParts(domain: string): string[];
/**
 * Delete a cookie across all possible domain variations
 * @param name - Cookie name to delete
 * @param childDomain - The current domain
 */
declare function deleteCookieOnAllDomains(name: string, childDomain: string): void;
/**
 * Get the parent domain from a given domain
 * @param domain - The domain to process
 * @returns The parent domain (e.g., 'app.example.com' → '.example.com')
 */
declare function getParentDomain(domain?: string): string;
/**
 * Set a cookie for authentication with cross-domain support
 * @param name - Cookie name
 * @param value - Cookie value
 * @param days - Number of days until expiration (default: 365)
 */
declare function setCookieForAuth(name: string, value: string, days?: number): void;
/**
 * Clear all cookies for the current domain
 */
declare function clearCookies(): void;
/**
 * Check if user is currently logged in
 * @param tokenKey - The localStorage key for the auth token (default: 'axd_token')
 * @returns True if logged in, false otherwise
 */
declare function isLoggedIn(tokenKey?: string): boolean;
/**
 * Extract platform/tenant key from URL
 * @param url - The URL to parse
 * @param pattern - RegExp pattern to match platform key (default matches /platform/[key]/...)
 * @returns The platform key or null if not found
 */
declare function getPlatformKey(url: string, pattern?: RegExp): string | null;
interface RedirectToAuthSpaOptions {
    /** URL to redirect to after auth (defaults to current path + search) */
    redirectTo?: string;
    /** Platform/tenant key */
    platformKey?: string;
    /** Whether this is a logout action */
    logout?: boolean;
    /** Whether to save redirect path to localStorage (default: true) */
    saveRedirect?: boolean;
    /** Auth SPA base URL */
    authUrl: string;
    /** Current app/platform identifier (e.g., 'mentor', 'skills') */
    appName: string;
    /** Query param names */
    queryParams?: {
        app?: string;
        redirectTo?: string;
        tenant?: string;
    };
    /** localStorage key for saving redirect path */
    redirectPathStorageKey?: string;
    /** Cookie names for cross-SPA sync */
    cookieNames?: {
        currentTenant?: string;
        userData?: string;
        tenant?: string;
        logoutTimestamp?: string;
    };
}
/**
 * Redirect to authentication SPA for login/logout
 *
 * This function handles the complete authentication flow:
 * - Clears localStorage and cookies on logout
 * - Saves redirect path for post-auth return
 * - Handles iframe scenarios
 * - Syncs logout across multiple SPAs via cookies
 *
 * @param options - Configuration options for the redirect
 *
 * @example
 * ```tsx
 * // Basic usage
 * redirectToAuthSpa({
 *   authUrl: 'https://auth.example.com',
 *   appName: 'mentor',
 * });
 *
 * // With logout
 * redirectToAuthSpa({
 *   authUrl: 'https://auth.example.com',
 *   appName: 'mentor',
 *   logout: true,
 *   platformKey: 'my-tenant',
 * });
 *
 * // With custom redirect
 * redirectToAuthSpa({
 *   authUrl: 'https://auth.example.com',
 *   appName: 'mentor',
 *   redirectTo: '/dashboard',
 *   platformKey: 'my-tenant',
 * });
 * ```
 */
declare function redirectToAuthSpa(options: RedirectToAuthSpaOptions): Promise<void>;
/**
 * Get the URL for joining a tenant (sign up flow)
 * @param authUrl - Auth SPA base URL
 * @param tenantKey - Tenant to join
 * @param redirectUrl - URL to redirect to after joining (defaults to current URL)
 * @returns The join URL
 */
declare function getAuthSpaJoinUrl(authUrl: string, tenantKey?: string, redirectUrl?: string): string;
/**
 * Redirect to auth SPA's join/signup page for a specific tenant
 * @param authUrl - Auth SPA base URL
 * @param tenantKey - Tenant to join
 * @param redirectUrl - URL to redirect to after joining (defaults to current URL)
 */
declare function redirectToAuthSpaJoinTenant(authUrl: string, tenantKey?: string, redirectUrl?: string): void;
interface HandleLogoutOptions {
    /** URL to redirect to after logout (defaults to current origin) */
    redirectUrl?: string;
    /** Auth SPA base URL */
    authUrl: string;
    /** localStorage key for tenant */
    tenantStorageKey?: string;
    /** Cookie name for logout timestamp */
    logoutTimestampCookie?: string;
    /** Callback to execute before logout */
    callback?: () => void;
}
/**
 * Handle user logout
 *
 * This function:
 * - Clears localStorage (preserving tenant)
 * - Sets logout timestamp cookie for cross-SPA sync
 * - Clears all cookies
 * - Redirects to auth SPA logout endpoint
 *
 * @param options - Logout configuration options
 *
 * @example
 * ```tsx
 * handleLogout({
 *   authUrl: 'https://auth.example.com',
 *   redirectUrl: 'https://app.example.com',
 * });
 * ```
 */
declare function handleLogout(options: HandleLogoutOptions): void;

declare const isReactNative: () => boolean;
declare const isWeb: () => boolean;
declare const isNode: () => string | false;
declare const isExpo: () => any;
declare const isTauri: () => boolean;
declare const getPlatform: () => "web" | "react-native" | "node" | "unknown";
declare const safeRequire: (moduleName: string) => any;
declare const getNextNavigation: () => any;

type ChatState = Record<AdvancedTab, Message[]>;
type SessionIds = Record<AdvancedTab, string>;
type StreamingMessage = {
    id: string;
    content: string;
};
type StreamingArtifact = {
    id?: number;
    title: string;
    fileExtension: string;
    content: string;
    isUpdate: boolean;
    isPartial: boolean;
    startIndex?: number;
    endIndex?: number;
    org?: string;
    userId?: string;
    sessionId?: string;
    versionNumber?: number;
    metadata?: Record<string, unknown>;
};
declare const STREAMING_CONTENT_BUFFER_THRESHOLD = 300;
declare const STREAMING_CONTENT_FLUSH_INTERVAL = 300;
declare const defaultSessionIds: SessionIds;
type ChatStatus = "idle" | "pending" | "streaming" | "stopped" | "error";
type ChatSliceState = {
    chats: ChatState;
    isTyping: boolean;
    streaming: boolean;
    currentStreamingMessage: StreamingMessage;
    currentStreamingArtifact: StreamingArtifact | null;
    activeTab: AdvancedTab;
    sessionId: string;
    sessionIds: SessionIds;
    status: ChatStatus;
    tools: string[];
    token: string | null;
    tokenEnabled: boolean;
    iframeContext: {
        hostInfo: {
            title: string;
            href: string;
        };
        pageContent: string;
        metadata: Record<string, string> | null;
    };
    documentFilter: Record<string, unknown> | null;
    shouldStartNewChat: boolean;
    showingSharedChat: boolean;
    artifactsEnabled: boolean;
    streamingArtifactContentBuffer: string;
    lastArtifactContentFlushTime: number;
    metadata: {
        edxCourseId: string;
        edxUsageId: string;
    };
};
declare const chatActions: _reduxjs_toolkit.CaseReducerActions<_reduxjs_toolkit.SliceCaseReducers<ChatSliceState>, string>;
declare const chatSliceReducerShared: Reducer<ChatSliceState>;
declare const selectChats: (state: {
    chatSliceShared: ChatSliceState;
}) => ChatState;
declare const selectIsTyping: (state: {
    chatSliceShared: ChatSliceState;
}) => boolean;
declare const selectStreaming: (state: {
    chatSliceShared: ChatSliceState;
}) => boolean;
declare const selectStatus: (state: {
    chatSliceShared: ChatSliceState;
}) => ChatStatus;
declare const selectIsPending: (state: {
    chatSliceShared: ChatSliceState;
}) => boolean;
declare const selectIsStopped: (state: {
    chatSliceShared: ChatSliceState;
}) => boolean;
declare const selectIsError: (state: {
    chatSliceShared: ChatSliceState;
}) => boolean;
declare const selectCurrentStreamingMessage: (state: {
    chatSliceShared: ChatSliceState;
}) => StreamingMessage;
declare const selectActiveTab: (state: {
    chatSliceShared: ChatSliceState;
}) => "chat" | "summarize" | "translate" | "expand";
declare const selectSessionId: (state: {
    chatSliceShared: ChatSliceState;
}) => string;
declare const selectSessionIds: (state: {
    chatSliceShared: ChatSliceState;
}) => SessionIds;
declare const selectIframeContext: (state: {
    chatSliceShared: ChatSliceState;
}) => {
    hostInfo: {
        title: string;
        href: string;
    };
    pageContent: string;
    metadata: Record<string, string> | null;
};
declare const selectMetadata: (state: {
    chatSliceShared: ChatSliceState;
}) => {
    edxCourseId: string;
    edxUsageId: string;
};
declare const selectDocumentFilter: (state: {
    chatSliceShared: ChatSliceState;
}) => Record<string, unknown> | null;
declare const selectTools: (state: {
    chatSliceShared: ChatSliceState;
}) => string[];
declare const selectToken: (state: {
    chatSliceShared: ChatSliceState;
}) => string | null;
declare const selectTokenEnabled: (state: {
    chatSliceShared: ChatSliceState;
}) => boolean;
declare const selectActiveChatMessages: (state: {
    chatSliceShared: ChatSliceState;
}) => Message[];
declare const selectNumberOfActiveChatMessages: (state: {
    chatSliceShared: ChatSliceState;
}) => number;
declare const selectShouldStartNewChat: (state: {
    chatSliceShared: ChatSliceState;
}) => boolean;
declare const selectShowingSharedChat: (state: {
    chatSliceShared: ChatSliceState;
}) => boolean;
declare const selectArtifactsEnabled: (state: {
    chatSliceShared: ChatSliceState;
}) => boolean;
declare const selectCurrentStreamingArtifact: (state: {
    chatSliceShared: ChatSliceState;
}) => StreamingArtifact | null;
declare const selectStreamingArtifactContentBuffer: (state: {
    chatSliceShared: ChatSliceState;
}) => string;
declare const selectLastArtifactContentFlushTime: (state: {
    chatSliceShared: ChatSliceState;
}) => number;
declare const selectStreamingArtifactFullContent: (state: {
    chatSliceShared: ChatSliceState;
}) => string | null;

interface TimeTrackerConfig {
    intervalSeconds: number;
    onTimeUpdate: (url: string, timeSpent: number) => void;
    getCurrentUrl: () => string;
    onRouteChange?: (callback: () => void) => () => void;
}
interface TimeTrackerState {
    currentUrl: string;
    startTime: number;
    intervalId: number | null;
    routeUnsubscribe: (() => void) | null;
}
declare class TimeTracker {
    private state;
    private config;
    constructor(config: TimeTrackerConfig);
    private initialize;
    private startTracking;
    private clearInterval;
    private resetTimer;
    private getTimeSpent;
    private sendTimeUpdate;
    private handleRouteChange;
    pause(): void;
    resume(): void;
    destroy(): void;
    getCurrentUrl(): string;
    getTimeSpentSinceLastReset(): number;
}

interface UseTimeTrackerConfig {
    intervalSeconds: number;
    onTimeUpdate: (url: string, timeSpent: number) => void;
    enabled?: boolean;
    getCurrentUrl?: () => string;
    onRouteChange?: (callback: () => void) => () => void;
}
interface UseTimeTrackerReturn {
    pause: () => void;
    resume: () => void;
    getCurrentUrl: () => string;
    getTimeSpentSinceLastReset: () => number;
}
declare function useTimeTracker(config: UseTimeTrackerConfig): UseTimeTrackerReturn;

interface UseTimeTrackerNativeConfig {
    intervalSeconds: number;
    onTimeUpdate: (url: string, timeSpent: number) => void;
    getCurrentRoute: () => string;
    onRouteChange?: (callback: () => void) => () => void;
    enabled?: boolean;
}
interface UseTimeTrackerNativeReturn {
    pause: () => void;
    resume: () => void;
    getCurrentUrl: () => string;
    getTimeSpentSinceLastReset: () => number;
}
declare function useTimeTrackerNative(config: UseTimeTrackerNativeConfig): UseTimeTrackerNativeReturn;

interface AttachedFile {
    id: string;
    fileName: string;
    fileType: string;
    fileSize: number;
    uploadUrl: string;
    uploadProgress: number;
    uploadStatus: "pending" | "uploading" | "processing" | "success" | "error";
    fileKey?: string;
    fileId?: string;
    retryCount?: number;
    fileUrl?: string;
}
interface FilesState {
    attachedFiles: AttachedFile[];
}
declare const filesSlice: Slice<FilesState>;
declare const addFiles: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const removeFile: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const clearFiles: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const updateFileProgress: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const updateFileStatus: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const updateFileUrl: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const updateFileMetadata: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const updateFileRetryCount: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const updateFileUrlFromWebSocket: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const filesReducer: Reducer<FilesState>;

/**
 * Combines multiple CSV data objects by merging rows based on a common column.
 * Duplicate columns across CSVs are included only once.
 *
 * @param csvDataArray - Array of CSV data objects with headers and rows
 * @param joinColumn - Column name to use for joining (default: 'email')
 * @returns Combined CSV data with merged headers and rows
 */
declare function combineCSVData(csvDataArray: Array<{
    headers: string[];
    rows: string[][];
}>, joinColumn?: string): {
    headers: string[];
    rows: string[][];
};
/**
 * Parses CSV text into headers and rows
 *
 * @param csvText - Raw CSV text content
 * @returns Object with headers and rows arrays
 */
declare function parseCSV(csvText: string): {
    headers: string[];
    rows: string[][];
};
/**
 * Converts CSV data back to CSV text format
 *
 * @param data - Object with headers and rows
 * @returns CSV text content
 */
declare function csvDataToText(data: {
    headers: string[];
    rows: string[][];
}): string;

interface showMonetizationCheckoutModalPayload {
    showModal?: boolean;
    paywallClosable: boolean;
    onClosePayload: string | undefined;
}
interface MonetizationState {
    displayMonetizationCheckoutModal: boolean;
    accessCheckResponse: (AccessCheckResponse & showMonetizationCheckoutModalPayload) | null;
    paywallClosable: boolean;
    onClosePayload: string | undefined;
}
declare const monetizationSlice: Slice;
declare const setDisplayMonetizationCheckoutModal: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const setAccessCheckResponse: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const showMonetizationCheckoutModal: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
declare const setAdvancedDisplayMonetizationCheckoutModal: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;

type ChatMode = "advanced" | "default";

interface UseExternalPricingProps {
    referenceId: string;
    customerEmail: string;
    publishableKey: string;
    pricingId?: string;
}
interface PricingModalData {
    referenceId: string;
    customerEmail: string;
    publishableKey: string;
    pricingTableId: string;
}
interface CreateStripeCustomerPortalRequest {
    org: string;
    userId: string;
    requestBody: StripeCustomerPortalRequest;
}
/**
 * Shape of the 402 Payment Required error response body.
 * Note: Only `error` is required. Other fields may not be present
 * in all error scenarios (e.g., generic API 402 vs WebSocket 402).
 */
interface Error402MessageData extends Partial<AccessCheckResponse> {
    error: string;
    message?: string;
    details?: {
        platform_key: string;
        current_balance_usd: string;
        required_usd: string;
        deficit_usd: string;
    };
    pricing_table?: {
        pricing_table_id: string;
        pricing_table_js: string;
        publishable_key?: string;
        client_reference_id?: string;
    };
}

declare const userDataSchema: z.ZodObject<{
    user_display_name: z.ZodString;
    user_email: z.ZodString;
    user_fullname: z.ZodString;
    user_id: z.ZodNumber;
    user_nicename: z.ZodString;
}, "strip", z.ZodTypeAny, {
    user_display_name: string;
    user_email: string;
    user_fullname: string;
    user_id: number;
    user_nicename: string;
}, {
    user_display_name: string;
    user_email: string;
    user_fullname: string;
    user_id: number;
    user_nicename: string;
}>;
declare const tenantSchema: z.ZodObject<{
    key: z.ZodString;
    is_admin: z.ZodBoolean;
    org: z.ZodString;
}, "strip", z.ZodTypeAny, {
    key: string;
    is_admin: boolean;
    org: string;
}, {
    key: string;
    is_admin: boolean;
    org: string;
}>;
declare const tenantKeySchema: z.ZodString;
type TenantKeyMentorIdParams = {
    tenantKey: string;
    mentorId: string;
};
interface TopTrialBannerProps {
    parentContainer: string;
    bannerText?: string;
    onUpgrade?: string;
    loading?: boolean;
    tooltipText?: string;
}
interface Prompt {
    type: "static" | "human" | "ai";
    icon?: string;
    summary?: string;
    content?: string;
    proactive?: boolean;
    hide?: boolean;
    tag?: string;
}
interface Tenant {
    key: string;
    is_admin: boolean;
    org: string;
    name?: string;
    platform_name: string;
    is_advertising?: boolean;
    is_enterprise?: boolean;
    show_paywall?: boolean;
}

type Props$5 = {
    mode?: ChatMode;
    tenantKey: string;
    mentorId: string;
    username: string;
    token: string;
    wsUrl: string;
    redirectToAuthSpa: (redirectTo?: string, platformKey?: string, logout?: boolean) => void;
    stopGenerationWsUrl: string;
    sendMessageToParentWebsite?: (payload: unknown) => void;
    errorHandler?: (message: string, error?: any) => void;
    isPreviewMode?: boolean;
    mentorShareableToken?: string | null;
    on402Error?: (message: Error402MessageData) => void;
    cachedSessionId?: Record<string, string>;
    onStartNewChat?: (sessionId: string) => void;
    onOAuthRequired?: (data: OAuthRequiredData) => void;
    onOAuthResolved?: (data: OAuthResolvedData) => void;
    isOffline?: boolean;
    onOfflineWithoutLocalLLM?: () => void;
    isPublicRoute?: boolean;
};
declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, cachedSessionId, onStartNewChat, onOAuthRequired, onOAuthResolved, isOffline, onOfflineWithoutLocalLLM, isPublicRoute, }: Props$5): {
    messages: Message[];
    isStreaming: boolean;
    status: ChatStatus;
    isPending: boolean;
    isStopped: boolean;
    isError: boolean;
    currentStreamingMessage: StreamingMessage;
    activeTab: "chat" | "summarize" | "translate" | "expand";
    uniqueMentorId: string;
    mentorName: string;
    profileImage: string;
    enabledGuidedPrompts: boolean;
    sendMessage: (tab: AdvancedTab, text: string, options?: SendMessageOptions) => Promise<void>;
    stopGenerating: () => void;
    setMessage: (message: Message) => void;
    changeTab: (tab: AdvancedTab) => Promise<void>;
    sessionId: string;
    startNewChat: () => Promise<void>;
    isLoadingSessionIds: boolean;
    ws: React__default.MutableRefObject<WebSocket | null>;
    isConnected: React__default.MutableRefObject<boolean>;
    messageQueue: React__default.MutableRefObject<any[]>;
    sessionIds: SessionIds;
    enableSafetyDisclaimer: boolean;
    resetConnection: () => void;
    isLoadingChats: boolean;
    refetchChats: () => Promise<void>;
};

type Props$4 = {
    tenantKey: string;
    mentorId: string;
    username: string;
    errorHandler?: (message: string, error?: any) => void;
    isPublicRoute?: boolean;
};
declare function useMentorTools({ tenantKey, mentorId, username, errorHandler, isPublicRoute, }: Props$4): {
    tools: any;
    activeTools: string[];
    updateSessionTools: (tool: string) => Promise<void>;
    setSessionTools: (tools: string[]) => Promise<void>;
    enableWebBrowsing: boolean;
    screenSharing: boolean;
    deepResearch: boolean;
    studyMode: boolean;
    imageGeneration: boolean;
    codeInterpreter: boolean;
    promptsIsEnabled: boolean;
    googleSlidesIsEnabled: boolean;
    googleDocumentIsEnabled: boolean;
    artifactsEnabled: boolean;
};

interface UserProfileUpdateData {
    name?: string;
    title?: string;
    about?: string;
    social_links?: {
        platform: string;
        social_link: string;
    }[];
    public_metadata?: {
        bio?: string;
        name?: string;
        about?: string;
        language?: string;
        social_links?: {
            platform: string;
            social_link: string;
        }[];
        [key: string]: any;
    };
    enable_sidebar_ai_mentor_display?: boolean;
    enable_skills_leaderboard_display?: boolean;
}
interface UseUserProfileUpdateResult {
    updateProfile: (data: UserProfileUpdateData) => Promise<void>;
    isLoading: boolean;
    error: any;
}
declare function useUserProfileUpdate(username: string): UseUserProfileUpdateResult;

interface UseProfileImageUploadOptions {
    onSuccess?: (imageUrl: string) => void;
    onError?: (error: any) => void;
}
interface UseProfileImageUploadReturn {
    uploadImage: (file: File, username: string) => Promise<UploadProfileImageResponse>;
    removeImage: (username: string) => Promise<RemoveProfileImageResponse>;
    isLoading: boolean;
    isRemoving: boolean;
    error: any;
}
declare function useProfileImageUpload(options?: UseProfileImageUploadOptions): UseProfileImageUploadReturn;

interface OllamaMessage {
    role: "user" | "assistant" | "system";
    content: string;
}
interface OllamaChatRequest {
    model: string;
    messages: OllamaMessage[];
    stream?: boolean;
}
interface OllamaChatStreamResponse {
    model: string;
    created_at: string;
    message: {
        role: "assistant";
        content: string;
    };
    done: boolean;
    total_duration?: number;
    load_duration?: number;
    prompt_eval_count?: number;
    prompt_eval_duration?: number;
    eval_count?: number;
    eval_duration?: number;
}
interface OllamaStreamCallbacks {
    onStart: (generationId: string) => void;
    onToken: (token: string, fullContent: string) => void;
    onEnd: (fullContent: string) => void;
    onError: (error: string) => void;
}
/**
 * Check if Ollama is running and accessible
 */
declare function checkOllamaHealth(): Promise<boolean>;
/**
 * Check if a specific model is available in Ollama
 */
declare function checkModelAvailable(model?: string): Promise<boolean>;
/**
 * Send a chat message to Ollama with streaming response
 * This mimics the WebSocket behavior of the main chat
 *
 * When running in Tauri, uses Tauri commands to proxy the request
 * to avoid mixed content (HTTPS -> HTTP) browser blocking.
 */
declare function streamOllamaChat(messages: OllamaMessage[], callbacks: OllamaStreamCallbacks, abortController?: AbortController): Promise<void>;
/**
 * Convert chat history to Ollama format
 */
declare function convertToOllamaMessages(messages: Array<{
    role: "user" | "assistant" | "system";
    content: string;
}>): OllamaMessage[];
/**
 * Get system prompt for the local LLM
 */
declare function getLocalLLMSystemPrompt(): OllamaMessage;

declare const useTenantMetadata: ({ org, spa, skip, }: {
    org: string;
    spa?: string;
    skip?: boolean;
}) => {
    metadata: any;
    platformName: string | undefined;
    isLoading: boolean;
    isError: boolean;
    isSkillsAssignmentsFeatureHidden: () => boolean;
    isSkillsResumeFeatureHidden: () => boolean;
    isMentorAIEnabled: () => boolean;
    isSkillsLeaderBoardEnabled: () => boolean;
    getEmbeddedMentorToUse: () => any;
    isMentorInappropriateContentEnabled: () => boolean;
    metadataLoaded: any;
    getAllMetadatas: () => {
        value: any;
        slug: string;
        label: string;
        defaultValue: any;
        SPA?: string;
        description?: string;
        type?: "boolean" | "string" | "number";
    }[];
    getSupportEmail: () => any;
};

interface TenantMetadata$1 {
    slug: string;
    label: string;
    defaultValue: any;
    SPA?: string;
    value?: any;
    description?: string;
    type?: "boolean" | "string" | "number";
}

/**
 * Loads all metadata configurations for a given SPA
 * @param spa - The SPA identifier (e.g., 'mentorAI', 'skillsAI', 'mentor', 'skills'). If not provided, returns all SPAs
 * @returns Array of TenantMetadata objects
 */
declare function loadMetadataConfig(spa?: string): TenantMetadata$1[];

interface TenantMetadata {
    slug: string;
    label: string;
    defaultValue: any;
    SPA?: string;
    value?: any;
}
declare const METADATAS: TenantMetadata$1[];

type Props$3 = {
    mentorId: string;
    tenantKey: string;
    username: string;
    isPublicRoute?: boolean;
};
type MentorSettingsData = {
    profileImage?: string | null;
    greetingMethod?: string | null;
    proactiveResponse?: string | null;
    llmProvider?: string | null;
    llmName?: string | null;
    mentorUniqueId?: string | null;
    mentorVisibility?: string | null | any;
    mentorName?: string | null;
    enableGuidedPrompts?: boolean | null;
    mentorSlug?: string | null;
    safetyDisclaimer: boolean;
    mentorTools?: any[] | null;
    allowAnonymous?: boolean | null;
};
type UseMentorSettingsReturn = {
    data: MentorSettingsData;
};
declare function useMentorSettings({ mentorId, tenantKey, username, isPublicRoute, }: Props$3): UseMentorSettingsReturn;

interface UseStripeUpgradeArgs {
    redirectUrl: string;
    sourcePlatformKey: string;
    mainPlatformKey: string;
    currentUserEmail: string;
}
type StripeUpgradePlan = "free" | "premium";
declare const useStripeUpgrade: ({ redirectUrl, sourcePlatformKey, mainPlatformKey, currentUserEmail, }: UseStripeUpgradeArgs) => {
    isLoading: boolean;
    freeUrl: string | null;
    premiumUrl: string | null;
    handleUpgrade: (redirectPlan?: StripeUpgradePlan) => Promise<void>;
};

/**
 * Sync authentication state to cookies (web only)
 * Should be called on login, logout, and tenant switch
 * On React Native, this is a no-op
 */
declare function syncAuthToCookies(storageService: StorageService): Promise<void>;
/**
 * Clear current tenant cookie only (web only)
 * Should be called before tenant switching
 * On React Native, this is a no-op
 */
declare function clearCurrentTenantCookie(): void;
/**
 * Clear all authentication cookies (web only)
 * Should be called on logout
 * On React Native, this is a no-op
 */
declare function clearAuthCookies(): void;
declare function getUserName(storageService: StorageService): Promise<any>;
declare function useAuthProvider({ middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, skipAuthCheck, token, enableStorageSync, }: Props$2): {
    isAuthenticating: boolean;
    userIsAccessingPublicRoute: boolean;
    setUserIsAccessingPublicRoute: React__default.Dispatch<React__default.SetStateAction<boolean>>;
};
/**
 * Type definition for the authentication context
 * Tracks whether the user is accessing a public route and provides a setter
 */
type AuthContextType = {
    userIsAccessingPublicRoute: boolean;
    isLoggedIn: boolean;
    setUserIsAccessingPublicRoute: (iuserIsAccessingPublicRoute: boolean) => void;
};
declare const AuthContext: React__default.Context<AuthContextType | undefined>;
/**
 * Hook to access the auth context
 * @throws Error if used outside of AuthContextProvider
 */
declare const useAuthContext: () => AuthContextType;
/**
 * Context Provider component that wraps children with auth context
 */
declare const AuthContextProvider: ({ value, children, }: {
    value: AuthContextType;
    children: React__default.ReactNode;
}) => react_jsx_runtime.JSX.Element;
/**
 * Props for the AuthProvider component
 */
type Props$2 = {
    children?: React__default.ReactNode;
    fallback?: React__default.ReactNode;
    middleware?: Map<string | RegExp, () => Promise<boolean>>;
    onAuthSuccess?: () => void;
    onAuthFailure?: (reason: string) => void;
    redirectToAuthSpa: (redirectTo?: string, platformKey?: string, logout?: boolean, saveRedirect?: boolean) => void;
    hasNonExpiredAuthToken: () => boolean;
    username: string;
    pathname: string;
    skipAuthCheck?: boolean;
    storageService?: StorageService;
    token?: string;
    enableStorageSync?: boolean;
    skip?: boolean;
};
/**
 * AuthProvider Component
 *
 * Main authentication provider that:
 * 1. Checks if the current route requires authentication
 * 2. Validates the auth token
 * 3. Fetches user metadata to verify authentication
 * 4. Handles redirects to auth SPA when needed
 * 5. Manages public route access state
 */
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, skipAuthCheck, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;

/**
 * Props for the MentorProvider component
 */
type Props$1 = {
    children?: React__default.ReactNode;
    fallback?: React__default.ReactNode;
    onAuthSuccess?: () => void;
    onAuthFailure?: (reason: string) => void;
    redirectToAuthSpa: () => void;
    redirectToMentor: (tenantKey: string, mentorId: string) => void;
    onLoadMentorsPermissions?: (rbacPermissions: Record<string, unknown> | undefined) => void;
    redirectToNoMentorsPage: () => void;
    redirectToCreateMentor: () => void;
    username: string;
    isAdmin: boolean;
    mainTenantKey: string;
    requestedMentorId?: string;
    handleMentorNotFound?: () => Promise<void>;
    forceDetermineMentor?: boolean;
    onComplete?: () => void;
    skip?: boolean;
};
/**
 * MentorProvider Component
 *
 * Main mentor provider that:
 * 1. Determines the most appropriate mentor for the user
 * 2. Handles mentor seeding for new tenants
 * 3. Manages redirection based on mentor availability
 * 4. Integrates with tenant context for access control
 */
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;

/**
 * Type definition for the tenant context
 * Tracks whether the user's path needs to be determined and provides a setter
 */
type TenantContextType = {
    determineUserPath: boolean;
    setDetermineUserPath: (value: boolean) => void;
    tenantKey: string;
    setTenantKey: (tenantKey: string) => void;
    metadata: Record<string, any>;
    setMetadata: (metadata: Record<string, any>) => void;
};
declare const TenantContext: React__default.Context<TenantContextType | undefined>;
/**
 * Context Provider component that wraps children with tenant context
 */
declare const TenantContextProvider: React__default.FC<{
    value: TenantContextType;
    children: React__default.ReactNode;
}>;
/**
 * Hook to access the tenant context
 * @returns TenantContextType
 */
declare const useTenantContext: () => TenantContextType;
/**
 * Props for the TenantProvider component
 */
type Props = {
    children?: React__default.ReactNode;
    fallback?: React__default.ReactNode;
    onAuthSuccess?: () => void;
    onAuthFailure?: (reason: string) => void;
    currentTenant: string;
    requestedTenant: string;
    handleTenantSwitch: (tenant: string, saveRedirect: boolean, useCustomDomain?: boolean) => Promise<void>;
    saveCurrentTenant: (tenant: Tenant$3) => void;
    saveUserTenants: (tenants: Tenant$3[]) => void;
    saveVisitingTenant?: (tenant: Tenant$3) => void;
    removeVisitingTenant?: () => void;
    saveUserTokens?: (tokens: TokenResponse) => void;
    saveTenant?: (tenant: string) => void;
    onAutoJoinUserToTenant?: (platformName: string) => void;
    redirectToAuthSpa?: (redirectTo?: string, platformKey?: string, logout?: boolean, saveRedirect?: boolean) => void;
    username?: string;
    isIframed?: boolean;
    setUseMentorProvider?: (useMentorProvider: boolean) => void;
    skip?: boolean;
    onLoadPlatformPermissions?: (rbacPermissions: Record<string, unknown> | undefined) => void;
    skipCustomDomainCheck?: boolean;
};
/**
 * TenantProvider Component
 *
 * Main tenant provider that:
 * 1. Validates user's access to requested tenant
 * 2. Manages tenant switching
 * 3. Retrieves and validates tenant metadata
 * 4. Handles tenant-specific domain redirects
 * 5. Maintains tenant access state
 */
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, }: Props): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;

/**
 * Chat area size constants
 */
declare const CHAT_AREA_SIZE: {
    readonly DEFAULT: 848;
    readonly MIN: 672;
    readonly MAX: 1024;
};

/**
 * Extract file information from File object
 */
declare function getFileInfo(file: File): FileInfo;
/**
 * Request presigned S3 URL from backend
 * Note: This function should be called via the RTK Query mutation hook
 * This is a helper to show the data flow
 */
declare function requestPresignedUrl(sessionId: string, file: File, getUploadUrlFn: (params: {
    org: string;
    userId: string;
    requestBody: {
        session_id: string;
        file_name: string;
        content_type: string;
        file_size: number;
    };
}) => Promise<FileUploadURLResponse>, org: string, userId: string): Promise<FileUploadURLResponse>;
/**
 * Upload file directly to S3 using presigned URL
 * Uses axios for cross-platform support (web + React Native)
 */
declare function uploadToS3(presignedUrl: string, file: File, contentType: string, onProgress?: UploadProgressCallback): Promise<void>;
/**
 * Complete file upload flow:
 * 1. Request presigned URL
 * 2. Upload to S3
 * 3. Return file reference
 */
declare function createFileReference(file: File, sessionId: string, getUploadUrlFn: (params: {
    org: string;
    userId: string;
    requestBody: {
        session_id: string;
        file_name: string;
        content_type: string;
        file_size: number;
    };
}) => Promise<FileUploadURLResponse>, org: string, userId: string, onProgress?: UploadProgressCallback): Promise<FileReference>;
/**
 * Upload multiple files and return their references
 */
declare function createMultipleFileReferences(files: File[], sessionId: string, getUploadUrlFn: (params: {
    org: string;
    userId: string;
    requestBody: {
        session_id: string;
        file_name: string;
        content_type: string;
        file_size: number;
    };
}) => Promise<FileUploadURLResponse>, org: string, userId: string, onFileProgress?: (fileIndex: number, progress: number) => void): Promise<FileReference[]>;
/**
 * Validate file before upload
 * Returns error message if invalid, null if valid
 */
declare function validateFile(file: File, maxSizeBytes?: number, allowedTypes?: string[]): string | null;

type WithFormPermissionsProps = {
    name: string | string[];
    permissions: Record<string, {
        read?: boolean;
        write: boolean;
        delete?: boolean;
    }>;
    children: (props: {
        disabled: boolean;
        canDelete?: boolean;
    }) => React__default.ReactNode;
    enableRBAC?: boolean;
};
declare const WithFormPermissions: React__default.FC<WithFormPermissionsProps>;

/**
 * Check if the user has the permissions to access the component
 * @param rbacResource - The resource in the permission rbac slice to check for. Supports:
 *   - Single resource: "mentors#read"
 *   - OR operator (|): "apitokens#create|apitokens#list" - returns true if ANY permission exists
 *   - AND operator (&): "apitokens#create&apitokens#list" - returns true if ALL permissions exist
 * @param rbacPermissions - The RBAC permissions object from the store.
 * @param children - The component to render if the user has the permissions.
 */
type WithPermissionsProps = {
    rbacResource: string;
    rbacPermissions: object;
    children: (props: {
        hasPermission: boolean;
    }) => React__default.ReactNode;
};
declare const WithPermissions: ({ rbacResource, rbacPermissions, children, }: WithPermissionsProps) => react_jsx_runtime.JSX.Element;
/**
 * Check RBAC permissions for a resource string that may contain operators
 * @param rbacPermissions - The RBAC permissions object
 * @param rbacResource - The resource path to check. Supports:
 *   - Single resource: "mentors#read"
 *   - OR operator (|): "apitokens#create|apitokens#list" - returns true if ANY permission exists
 *   - AND operator (&): "apitokens#create&apitokens#list" - returns true if ALL permissions exist
 * @param enableRBAC - Whether RBAC is enabled (if false, always returns true)
 * @returns boolean indicating if permission exists
 */
declare const checkRbacPermission: (rbacPermissions: object, rbacResource: string, enableRBAC?: boolean) => boolean;

export { ALPHANUMERIC_32_REGEX, ANONYMOUS_USERNAME, AuthContext, AuthContextProvider, AuthProvider, CHAT_AREA_SIZE, LOCAL_STORAGE_KEYS, MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, METADATAS, MentorProvider, REQUIRED_ACTIONS_FOR_GROUPS, STREAMING_CONTENT_BUFFER_THRESHOLD, STREAMING_CONTENT_FLUSH_INTERVAL, SUBSCRIPTION_MESSAGES, SUBSCRIPTION_PACKAGES, SUBSCRIPTION_PACKAGES_V2, SUBSCRIPTION_TRIGGERS, SUBSCRIPTION_V2_TRIGGERS, SubscriptionFlow, SubscriptionFlowV2, TOOLS, TenantContext, TenantContextProvider, TenantProvider, TimeTracker, WithFormPermissions, WithPermissions, addFiles, addProtocolToUrl, advancedTabs, advancedTabsProperties, chatActions, chatSliceReducerShared, checkModelAvailable, checkOllamaHealth, checkRbacPermission, clearAuthCookies, clearCookies, clearCurrentTenantCookie, clearFiles, combineCSVData, convertToOllamaMessages, createFileReference, createMultipleFileReferences, csvDataToText, defaultSessionIds, deleteCookie, deleteCookieOnAllDomains, filesReducer, filesSlice, formatRelativeTime, getAuthSpaJoinUrl, getDomainParts, getFileInfo, getInitials, getLocalLLMSystemPrompt, getNextNavigation, getParentDomain, getPlatform, getPlatformKey, getTimeAgo, getUserName, handleLogout, isAlphaNumeric32, isExpo, isInIframe, isJSON, isLoggedIn, isNode, isReactNative, isTauri, isWeb, loadMetadataConfig, markdownToPlainText, monetizationSlice, parseCSV, redirectToAuthSpa, redirectToAuthSpaJoinTenant, removeFile, requestPresignedUrl, safeRequire, selectActiveChatMessages, selectActiveTab, selectArtifactsEnabled, selectChats, selectCurrentStreamingArtifact, selectCurrentStreamingMessage, selectDocumentFilter, selectIframeContext, selectIsError, selectIsPending, selectIsStopped, selectIsTyping, selectLastArtifactContentFlushTime, selectMetadata, selectNumberOfActiveChatMessages, selectSessionId, selectSessionIds, selectShouldStartNewChat, selectShowingSharedChat, selectStatus, selectStreaming, selectStreamingArtifactContentBuffer, selectStreamingArtifactFullContent, selectToken, selectTokenEnabled, selectTools, sendMessageToParentWebsite, setAccessCheckResponse, setAdvancedDisplayMonetizationCheckoutModal, setCookieForAuth, setDisplayMonetizationCheckoutModal, showMonetizationCheckoutModal, streamOllamaChat, syncAuthToCookies, tenantKeySchema, tenantSchema, translatePrompt, updateFileMetadata, updateFileProgress, updateFileRetryCount, updateFileStatus, updateFileUrl, updateFileUrlFromWebSocket, uploadToS3, useAdvancedChat, useAuthContext, useAuthProvider, useChat, useDayJs, useExternalPricingPlan, useMentorSettings, useMentorTools, useProfileImageUpload, useStripeUpgrade, useSubscriptionHandler, useSubscriptionHandlerV2, useTenantContext, useTenantMetadata, useTimeTracker, useTimeTrackerNative, useUserProfileUpdate, userDataSchema, validateFile };
export type { AdvancedTab, ArtifactData, ArtifactPayload, ArtifactVersion, AttachedFile, AuthContextType, ChatMode, ChatSliceState, ChatState, ChatStatus, CreateStripeCustomerPortalRequest, Error402MessageData, FileAttachment, FileInfo, FileProcessingEvent, FileReference, FileUploadState, FilesState, HandleLogoutOptions, Message, MessageAction, MonetizationState, OAuthRequiredData, OAuthResolvedData, OllamaChatRequest, OllamaChatStreamResponse, OllamaMessage, OllamaStreamCallbacks, PricingModalData, Prompt, RedirectToAuthSpaOptions, SendMessageOptions, SessionIds, StreamingArtifact, StreamingMessage, StripeUpgradePlan, SubscriptionFlowConfig, SubscriptionFlowConfigV2, Tenant, TenantContextType, TenantKeyMentorIdParams, TenantMetadata, TimeTrackerConfig, TimeTrackerState, TopTrialBannerProps, UploadProgressCallback, UseChatProps, UseChatReturn, UseExternalPricingProps, UseProfileImageUploadOptions, UseProfileImageUploadReturn, UseTimeTrackerConfig, UseTimeTrackerNativeConfig, UseTimeTrackerNativeReturn, UseTimeTrackerReturn, UseUserProfileUpdateResult, UserProfileUpdateData };
