declare class ProactiveWebCampaignPlugin { name: string; config: any; hostInstance: any; enablePWC: boolean; campInfo: any; location: any; visible: boolean; authInfo: any; timeSpent: any; elementHoverDuration: number; timeSpentTimers: any; activeTimerIds: any; pageChangeDebounceTimer: any; customDataObject: any; isInitialPageLoaded: boolean; browserSessionId: string; isPWEChatTriggered: string; flattenedCustomData: any; previousFlattenedCustomData: any; customColumnConfig: Set; customDataDebounceTimer: any; customDataChangeMap: any; static readonly CUSTOM_OPERATORS: string[]; static readonly MAX_FLATTEN_DEPTH = 10; private static readonly ACTIVE_CAMPAIGN_SELECTOR; private static readonly CHAT_CONTAINER_SELECTOR; private static readonly MAX_API_RETRIES; private static readonly RETRY_DELAY_MS; private static readonly TEMPLATE_PERSIST_DURATION; isPendingSendAPIEvent: boolean; private currentPersistedTemplate; private isTemplateRestored; coolDownTime: number; cooldownState: { isActive: boolean; startTime: number; expiryTime: number; }; constructor(config: any); /** * Generates a unique browser session ID for the campaign trigger session * @returns Unique browser session ID */ generateBrowserSessionId(): string; onHostCreate(): void; onInit(): void; handleAvatarClick(): void; /** * Called when view is initialized (DOM ready) * Attempts template restoration for chat templates that need DOM access */ onViewInit(): void; onUrlChange(callback: () => void): void; onTitleChange(callback: (newTitle: string) => void): void; /** * - Custom Data Listener, listens to pwcCustomData event and processes the data * - 1-second debouncing for performance */ customDataListener(): void; /** * Processes custom data update with flattening and change detection * persists flattened data to sessionStorage with merge strategy * @param rawData - Raw nested JSON data from pwcCustomData event */ processCustomDataUpdate(rawData: any): void; /** * Recursively flattens nested JSON object into dot-notation keys with array support * @param obj - Object to flatten * @param prefix - Current prefix for nested keys * @param maxDepth - Maximum nesting depth (default 10) * @param currentDepth - Current recursion depth * @returns Flattened object with dot-notation keys * * Examples: * {user: {profile: {age: 25}}} → {"user.profile.age": 25} * {skills: ["sit", "stand"]} → {"skills[0]": "sit", "skills[1]": "stand"} * {users: [{name: "John", tags: ["admin"]}]} → {"users[0].name": "John", "users[0].tags[0]": "admin"} */ flattenObject(obj: any, prefix?: string, maxDepth?: number, currentDepth?: number): any; /** * Detects changes between old and new flattened custom data * Returns only the changed keys for performance optimization * @param newFlattenedData - New flattened data * @returns Object containing only changed keys with change metadata */ detectCustomDataChanges(newFlattenedData: any): any; /** * Handles custom data changes by updating relevant campaigns * Only processes campaigns that have custom conditions matching the changed keys * @param changes - Object containing changed keys with metadata */ handleCustomDataChanges(changes: any): void; /** * Retrieves persisted custom data from sessionStorage * @returns Object containing flattened custom data or empty object if none exists */ getPersistedCustomData(): any; /** * Merges existing custom data with new custom data * New data takes precedence over existing data for same keys * @param existingData - Existing flattened custom data * @param newData - New flattened custom data * @returns Merged custom data object */ mergeCustomData(existingData: any, newData: any): any; /** * Persists custom data to sessionStorage with error handling * @param customData - Flattened custom data to persist */ persistCustomDataToSession(customData: any): void; /** * Checks if a campaign has custom conditions that match the changed keys * @param campaign - Campaign object * @param changedKeys - Array of changed custom data keys * @returns Boolean indicating if campaign is affected by the changes */ campaignHasCustomConditionsForKeys(campaign: any, changedKeys: string[]): boolean; /** * Checks if a rules/exclusions section has custom conditions matching changed keys * @param groups - Array of groups to check * @param changedKeys - Array of changed custom data keys * @returns Boolean indicating if section is affected */ checkCustomConditionsInSection(groups: any[], changedKeys: string[]): boolean; /** * Checks if a campaign has a custom condition for a specific key * @param campaign - Campaign object * @param key - Custom data key to check * @returns Boolean indicating if campaign has condition for this key */ /** * Updates or populates actual.rules OR actual.exclusions with custom actual values based on where condition is configured * @param campInstanceId - Campaign instance ID * @param changes - Object containing changed custom data */ updateCustomActualValues(campInstanceId: string, changes: any): void; /** * Extracts custom column configurations from campaigns during pwe_verify * Creates a whitelist of custom data keys that campaigns actually use * @param campaigns - Array of campaign data */ extractCustomColumns(campaigns: any[]): void; installPWCTemplates(): void; /** * Creates targeted timers for timeSpent conditions instead of polling every second * IMPORTANT: Only sets up timers for campaigns that match the current page */ setupTimeSpentTimers(): void; /** * Handles isNot: true timeSpent conditions by immediately updating actual value and evaluating * @param campInstanceId - Campaign instance ID * @param groupId - Group ID containing the condition * @param conditionId - Condition ID * @param thresholdSeconds - Threshold value in seconds */ handleIsNotTimeSpentCondition(campInstanceId: string, groupId: string, conditionId: string, thresholdSeconds: number): void; /** * Creates an individual timer for a specific timeSpent condition * For regular conditions: timer fires when condition becomes satisfied * For isNot conditions: timer fires when condition becomes NOT satisfied * @param campInstanceId - Campaign instance ID * @param groupId - Group ID containing the condition * @param conditionId - Condition ID * @param timeoutMs - Timeout in milliseconds */ createTimeSpentTimer(campInstanceId: string, groupId: string, conditionId: string, timeoutMs: number): void; /** * Handles when a timeSpent condition timer fires * For regular conditions: condition becomes satisfied (timeSpent >= threshold) * For isNot conditions: condition becomes NOT satisfied (timeSpent >= threshold, so isNot becomes false) * @param campInstanceId - Campaign instance ID * @param groupId - Group ID * @param conditionId - Condition ID * @param timeSpentSeconds - Time spent in seconds */ handleTimeSpentConditionMet(campInstanceId: string, groupId: string, conditionId: string, timeSpentSeconds: number): void; /** * Updates timeSpent actual value for a campaign * CORRECTED: Only populates actual.rules OR actual.exclusions based on where condition is configured * CRITICAL: Triggers re-evaluation since exclusions can flip based on timeSpent changes * @param campInstanceId - Campaign instance ID * @param timeSpentSeconds - Time spent in seconds */ updateTimeSpentActualValue(campInstanceId: string, timeSpentSeconds: number): void; /** * Re-evaluates exclusions when timeSpent changes (dynamic exclusion behavior) * This allows exclusions to flip from satisfied ↔ not satisfied as time progresses * @param campInstanceId - Campaign instance ID */ reevaluateExclusionsForTimeSpentChange(campInstanceId: string): void; /** * Evaluates rules for a specific campaign (more efficient than evaluating all) * @param campInstanceId - Campaign instance ID * @param triggerType - What triggered this evaluation */ evaluateSpecificCampaign(campInstanceId: string, triggerType: string): void; /** * Clears a specific timeSpent timer * @param timerKey - Timer key to clear */ clearTimeSpentTimer(timerKey: string): void; /** * Clears all timeSpent timers (useful for cleanup) */ clearAllTimeSpentTimers(): void; /** * Restarts timers when URL changes (more efficient than continuous polling) * Now includes hoverOn reset and hover listener management * Now retrieves custom data from sessionStorage to handle navigation */ handlePageChange(): void; /** * Resets all hoverOn values to false while keeping the key structure * This maintains performance by avoiding recreation of keys */ resetHoverOnValues(): void; /** * Clears all hover listeners to prevent memory leaks * Note: This is a placeholder for future implementation of listener tracking */ clearHoverListeners(): void; /** * Resets timeSpent values for active campaigns when URL/page changes * @param currentUrl - Current page URL * @param currentPageTitle - Current page title */ resetTimeSpentForActiveCampaigns(currentUrl: string, currentPageTitle: string): void; /** * Updates page visit counts for campaigns that have pageVisitCount conditions * Only populates actual.rules OR actual.exclusions based on where condition is configured * NOTE: This method only updates the counts, evaluation happens in sendEvent() */ updatePageVisitCounts(): void; /** * Lightweight initialization - replaces the heavy eventLoop * Only sets up initial tracking and timers */ initializePWCTracking(): Promise; /** * Checks if the journey is valid based on the page visit array and website array * implements reverse-order matching (checks last N entries only) * @param pageVisitArray - The page visit array (pageVisitHistory) from sessionStorage * @param websiteArray - The website array configured in the campaign * @returns true if the recent journey matches the required sequence, false otherwise */ isJourneyValid(pageVisitArray: any, websiteArray: any): boolean; /** * Checks if the current time is within the engagement hours specified in engStrategy * @param engStrategy - Engagement strategy object with engagement hours settings * @returns {boolean} - Returns true if current time is within engagement hours, false otherwise */ checkEngagementHours(engStrategy: any): boolean; createTimeSpentObjs(): void; getLocationDetails(): void; /** * Detects and stores device type using hybrid detection approach * HYBRID METHOD: Combines screen size, touch detection, and user agent for 95%+ accuracy * CACHED: Detects once per session for optimal performance */ getDeviceDetails(): void; /** * Hybrid device detection algorithm * Combines multiple signals for maximum accuracy across all devices and edge cases * @returns Device type: 'mobile', 'tablet', or 'laptop' */ detectDeviceType(): string; /** * Calls the location API with coordinates and handles retry logic * @param coordinates - Object containing latitude and longitude */ callLocationAPI(coordinates: any): Promise; /** * Sends the actual API request to the location endpoint * @param payload - Request payload with latitude and longitude * @returns Promise with API response */ sendLocationAPIRequest(payload: any): Promise; /** * Schedules a retry of the location API call after 1 minute * @param coordinates - Original coordinates for retry */ scheduleLocationAPIRetry(coordinates: any): void; /** * Parses API response and saves location data to sessionStorage * @param apiResponse - Array response from location API * @param coordinates - Original coordinates */ parseAndSaveLocationData(apiResponse: any[], coordinates: any): void; /** * Finds location data by type from API response * @param response - API response array * @param targetType - Type to search for (country, locality, administrative_area_level_1) * @returns Location name or null if not found */ findLocationByType(response: any[], targetType: string): string | null; /** * Sends API event with retry logic * @param payload - Event payload * @param route - API route * @param retryCount - Number of retries remaining (default: MAX_API_RETRIES) * @returns Promise with API response */ sendApiEvent(payload: any, route: string, retryCount?: number): Promise; /** * Determines if an HTTP status code should trigger a retry * Retries: 429 (Rate Limit), 5xx (Server Errors) * Does NOT retry: 4xx (Client Errors, except 429) * @param statusCode - HTTP status code * @returns Boolean indicating if retry should happen */ private shouldRetryStatusCode; /** * Initializes PWC campaigns by calling the pwe_verify API */ initializePWCCampaigns(): Promise; /** * Restores PWC state from sessionStorage for multi-page apps * Called when pwe_data exists but in-memory state is lost (page navigation) * Reconstructs campInfo from stored data to avoid redundant API calls * @returns Boolean indicating if restoration was successful */ restorePWCStateFromStorage(): boolean; /** * Handles the pwe_verify API response * Processes campaign configuration and initializes PWC system * @param responseData - API response data */ handlePweVerifyResponse(responseData: any): Promise; /** * Handles the pwe_event API response and renders campaign templates * @param responseData - API response data */ handlePweEventResponse(responseData: any): void; /** * Persists template data to sessionStorage for multi-page persistence * @param templateData - Template data to persist */ private persistTemplate; /** * Public method for templates to call when closing * Clears persisted template from both memory and sessionStorage */ clearPersistedTemplateFromStorage(): void; /** * Checks if a persisted template has expired * @param template - Persisted template to check * @returns Boolean indicating if template has expired */ private isTemplateExpired; /** * Restores persisted template from sessionStorage if valid * Called during onInit after PWC state restoration */ private restorePersistedTemplate; /** * Re-renders a persisted template in the DOM * @param template - Persisted template to render */ private renderPersistedTemplate; /** * Constructs the pwe_data object based on the new campaign structure * Extracts custom column configurations and initializes custom data * @param campaignData - Campaign data received from API * @returns Constructed pwe_data object */ constructPweData(campaignData: any): any; /** * Initializes custom data for all campaigns based on current flattened custom data * This ensures campaigns have initial custom data values if pwcCustomData was received earlier */ initializeCustomDataForCampaigns(campaigns: any[]): void; /** * Initializes custom actual values for a specific campaign * Retrieves custom data from sessionStorage for initialization * @param campInstanceId - Campaign instance ID * @param campaign - Campaign configuration * @param campaignData - Campaign data structure to populate */ initializeCustomActualValuesForCampaign(campInstanceId: string, campaign: any, campaignData: any): void; /** * Sets up hover event listeners for campaigns with hoverOn rules * Only sets up listeners for campaigns that match current page (website-aware) */ setupHoverListeners(): void; /** * Initializes hoverOn structure for a campaign (only for active campaigns) * Smart key creation - only create keys that don't exist * @param campaign - Campaign object */ initializeHoverOnForCampaign(campaign: any): void; /** * Sets up hover listeners for a specific campaign * @param campaign - Campaign object */ setupHoverListenersForCampaign(campaign: any): void; /** * Sets up hover listener for a specific hoverOn condition * ENHANCED: Now uses key-based structure and supports both rules and exclusions * @param condition - The hoverOn condition configuration * @param campInstanceId - Campaign instance ID * @param group - Group object * @param groupIndex - Group index (fallback for missing group.id) * @param conditionIndex - Condition index (fallback for missing condition.id) * @param type - 'rules' or 'exclusions' */ setupHoverListenerForCondition(condition: any, campInstanceId: string, group: any, groupIndex: number, conditionIndex: number, type: string): void; /** * Constructs rules/exclusions structure with proper grouping and condition tracking * Reads 'globalType' from API response but stores as 'groupType' internally * @param rulesConfig - Rules or exclusions configuration * @returns Structured rules object */ constructRulesStructure(rulesConfig: any): any; /** * Groups conditions by column type for easier evaluation * @param conditions - Array of conditions * @returns Object with conditions grouped by column */ groupConditionsByColumn(conditions: any[]): any; /** * Reconstructs RAW rules format from PROCESSED format stored in pwe_data * @param processedRules - Processed rules structure from pwe_data.expected * @returns RAW rules structure matching original API format */ reconstructRawRulesFromProcessed(processedRules: any): any; /** * Checks if a campaign has a specific condition type configured in RULES * @param campaign - Campaign object * @param conditionType - Type of condition to check for (e.g., 'pageVisitCount', 'timeSpent', 'user', etc.) * @returns Boolean indicating if campaign has the condition type in rules */ campaignHasConditionType(campaign: any, conditionType: string): boolean; /** * Checks if a campaign has a specific condition type configured in EXCLUSIONS * @param campaign - Campaign object * @param conditionType - Type of condition to check for (e.g., 'pageVisitCount', 'timeSpent', 'user', etc.) * @returns Boolean indicating if campaign has the condition type in exclusions */ campaignHasExclusionConditionType(campaign: any, conditionType: string): boolean; /** * Gets active campaigns based on current URL and page title * @param currentUrl - Current page URL * @param currentPageTitle - Current page title * @returns Array of active campaigns */ getActiveCampaigns(currentUrl: string, currentPageTitle: string): any[]; /** * Checks if website configuration matches current page * @param websiteConfig - Website configuration array * @param currentUrl - Current page URL * @param currentPageTitle - Current page title * @returns Boolean indicating if website matches */ checkWebsiteMatching(websiteConfig: any[], currentUrl: string, currentPageTitle: string): boolean; /** * Checks journey matching for 'then' operator * @param websiteConfig - Website configuration array * @returns Boolean indicating if journey matches */ checkJourneyMatching(websiteConfig: any[]): boolean; /** * Evaluates active campaigns with OPTIMIZED FLOW: check Exclusions as blockers First, Only evaluate Rules if not blocked * @param activeCampaigns - Array of active campaigns * @param currentUrl - Current page URL * @param currentPageTitle - Current page title * @param eventType - Type of event triggering evaluation */ evaluateActiveCampaigns(activeCampaigns: any[], currentUrl: string, currentPageTitle: string, eventType: string): void; /** * Updates actual values in pwe_data based on current user behavior * ENHANCED: Now handles custom conditionType with customData event type * CRITICAL: Updates BOTH rules AND exclusions with the same behavioral data * ONLY updates values for condition types that are configured in the campaign * @param campInstanceId - Campaign instance ID * @param currentUrl - Current page URL * @param currentPageTitle - Current page title * @param eventType - Type of event triggering update */ updateActualValues(campInstanceId: string, currentUrl: string, currentPageTitle: string, eventType: string): void; /** * Checks if a campaign has any custom conditions in rules or exclusions * @param campaign - Campaign object * @returns Boolean indicating if campaign has custom conditions */ campaignHasCustomConditions(campaign: any): boolean; /** * Ensures custom data is up-to-date for a campaign based on current flattened custom data * Now retrieves custom data from sessionStorage to handle navigation * @param campInstanceId - Campaign instance ID * @param campaign - Campaign configuration * @param campaignData - Campaign data structure to update */ ensureCustomDataUpToDate(campInstanceId: string, campaign: any, campaignData: any): void; /** * Updates time spent data * Only populates actual.rules OR actual.exclusions based on where condition is configured * @param campaignData - Campaign data object * @param campInstanceId - Campaign instance ID */ updateTimeSpentData(campaignData: any, campInstanceId: string): void; /** * Updates general data like user type, country, city * Only populates actual.rules OR actual.exclusions based on where condition is configured * @param campaignData - Campaign data object * @param campInstanceId - Campaign instance ID */ updateGeneralData(campaignData: any, campInstanceId: string): void; /** * Re-evaluates campaigns that have location-based conditions when location data becomes available * Called when geolocation API completes to handle location-based campaigns */ reevaluateLocationBasedCampaigns(): void; /** * Evaluates rules for a campaign and updates satisfaction status * @param campInstanceId - Campaign instance ID */ evaluateRulesForCampaign(campInstanceId: string): void; /** * Evaluates exclusions for a campaign and updates satisfaction status * Supports dynamic exclusion evaluation (can flip satisfied ↔ not satisfied) * @param campInstanceId - Campaign instance ID */ evaluateExclusionsForCampaign(campInstanceId: string): void; /** * Evaluates conditions within a group * Implements persistence for pageVisitCount conditions (once satisfied, stays satisfied) * @param groupConditions - Group conditions object * @param actualValues - Actual values to compare against * @returns Boolean indicating if group conditions are satisfied */ evaluateGroupConditions(groupConditions: any, actualValues: any): boolean; /** * Updates individual condition satisfaction states with different persistence logic for rules vs exclusions * RULES: Selective persistence (country, city persist; pageVisitCount, user, timeSpent, hoverOn dynamic) * EXCLUSIONS: Always dynamic re-evaluation (no persistence for any condition type) * @param groupConditions - Group conditions object * @param actualValues - Actual values to compare against * @param isExclusions - Whether these are exclusion conditions (determines persistence behavior) * @param groupId - Group ID for hoverOn condition evaluation */ updateIndividualConditionStates(groupConditions: any, actualValues: any, isExclusions?: boolean, groupId?: string): void; /** * Evaluates a single condition with support for custom conditionType operators * ENHANCED: Now supports 10 custom operators for custom conditionType * @param condition - Condition object * @param actualValue - Actual value to compare * @returns Boolean indicating if condition is satisfied */ evaluateCondition(condition: any, actualValue: any): boolean; /** * Evaluates hoverOn conditions with new key-based structure: * - actualValue is an object: { "group1_co-1": true, "group2_co-3": false } * - Looks up the specific key for this condition * - Returns boolean result (no type mismatch issues) */ evaluateHoverOnCondition(condition: any, actualValue: any): boolean; /** * Evaluates hoverOn conditions with group context for precise key matching * @param condition - The hoverOn condition * @param actualValue - The hoverOn object * @param groupId - The group ID for key construction * @returns Boolean result */ evaluateHoverOnConditionWithContext(condition: any, actualValue: any, groupId: string): boolean; /** * Evaluates url and pageName conditions with case-sensitive string operations: * URL operators: contains, ends_with * PageName operators: is, contains * * @param condition - The condition configuration * @param actualValue - Current URL or page name from actual data * @param expectedValue - Expected value from condition configuration * @returns Boolean evaluation result */ evaluateUrlPageNameCondition(condition: any, actualValue: any, expectedValue: any): boolean; /** * Evaluates device conditions with simple "is" operator comparison: * - Supports: Mobile, Tablet, Laptop * - Case-sensitive string matching * - Works with isNot flag for exclusions * * @param condition - The condition configuration * @param actualValue - Current device type from actual data * @param expectedValue - Expected device type from condition configuration * @returns Boolean evaluation result */ evaluateDeviceCondition(condition: any, actualValue: any, expectedValue: any): boolean; /** * Evaluates custom conditions with all 10 supported operators: * - equals: Case-sensitive exact match * - in: Array membership check * - gt, ge, lt, le: Numeric comparisons (greater/less than/equal) * - between: Inclusive range check {start, end} * - begins_with, ends_with, contains: String operations */ evaluateCustomCondition(condition: any, actualValue: any, expectedValue: any): boolean; /** * Evaluates equals operator (case-sensitive) */ evaluateEquals(actualValue: any, expectedValue: any): boolean; /** * Evaluates in operator (array membership) */ evaluateIn(actualValue: any, expectedValue: any): boolean; /** * Evaluates greater than operator */ evaluateGreaterThan(actualValue: any, expectedValue: any): boolean; /** * Evaluates greater than or equal operator */ evaluateGreaterEqual(actualValue: any, expectedValue: any): boolean; /** * Evaluates less than operator */ evaluateLessThan(actualValue: any, expectedValue: any): boolean; /** * Evaluates less than or equal operator */ evaluateLessEqual(actualValue: any, expectedValue: any): boolean; /** * Evaluates between operator (inclusive range) * 'between' operator requires numeric start and end values */ evaluateBetween(actualValue: any, expectedValue: any): boolean; /** * Evaluates begins_with operator (string prefix) */ evaluateBeginsWith(actualValue: any, expectedValue: any): boolean; /** * Evaluates ends_with operator (string suffix) */ evaluateEndsWith(actualValue: any, expectedValue: any): boolean; /** * Evaluates contains operator (string substring) */ evaluateContains(actualValue: any, expectedValue: any): boolean; /** * Converts value to number, returns null if conversion fails * @param value - Value to convert * @returns Number or null if conversion fails */ convertToNumber(value: any): number | null; /** * Evaluates overall satisfaction of groups based on groupType * @param groups - Array of groups * @param groupType - Type of group logic (AND/OR) * @returns Boolean indicating if groups are satisfied */ evaluateGroupsSatisfaction(groups: any[], groupType: string): boolean; /** * Checks if campaign should be triggered based on rules and exclusions * @param campInstanceId - Campaign instance ID * @param campId - Campaign ID */ checkCampaignTrigger(campInstanceId: string, campId: string): void; /** * Updates isSatisfied flags for rules and exclusions based on current evaluation * This method should be called whenever a campaign is triggered to ensure flags are consistent * @param campInstanceId - Campaign instance ID */ updateSatisfactionFlags(campInstanceId: string): void; /** * Triggers campaign event using API and handles response * @param campInstanceId - Campaign instance ID * @param campId - Campaign ID */ triggerCampaignEvent(campInstanceId: string, campId: string, campaignData: any): Promise; /** * Generic function to send campaign event with eventInfo * PUBLIC METHOD - Can be called from templates and internal code * @param campInstanceId - Campaign instance ID * @param campId - Campaign ID * @param metricData - Metric data {action: 'impression'|'click'|'close', data: {}} * @returns Promise */ recordCampaignMetric(campInstanceId: string, campId: string, metricData: any): Promise; /** * Prepares eventInfo object for campaign events * @param campInstanceId - Campaign instance ID * @param campId - Campaign ID * @param data - Data object {ruleInfo: {isAllRulesSatisfied: true, browser_session_id: this.browserSessionId, rules: campaignData.actual.rules, exclusions: campaignData.actual.exclusions, goals: campaignData.actual.goals, ...suppressed}, eventInfo: {action: 'impression'|'click'|'close', data: {}}} * @returns payload object */ preparePwePayload(campInstanceId: string, campId: string, data: any): any; /** * Checks if any campaign template is active * @returns Boolean indicating if any campaign template is active */ isActiveCampaignTemplate(): boolean; /** * Enhanced sendEvent method to work with new campaign structure * @param pageObject - Page object with url and pageName * @param type - Event type */ sendEvent(pageObject: any, type: any): void; /** * Checks if cooldown is currently active * Optimized: Check in-memory state first, then handle expiry * @returns Boolean indicating if cooldown is active */ isCooldownActive(): boolean; /** * Starts cooldown timer after a campaign is triggered * Converts minutes to milliseconds for calculations */ startCooldown(): void; /** * Clears cooldown state from memory and sessionStorage */ clearCooldown(): void; /** * Persists cooldown state to sessionStorage for multi-page apps * No error handling needed - in-memory state continues to work in SPAs */ persistCooldownState(): void; /** * Restores cooldown state from sessionStorage on initialization * Only called during page load/refresh - has error handling fallback */ restoreCooldownState(): void; /** * Check if chat window is currently open * Note: When minimize class is present, chat window is actually OPEN * @returns true if chat window is open, false if closed/minimized */ isChatWindowOpen(): boolean; } export default ProactiveWebCampaignPlugin;