import { type AttributionTouch } from "./attribution-source.js"; /** * The durable copy of first touch. Our server sets it, because Safari caps * cookies written by page JavaScript at seven days; the browser's own `an_ft` * cookie and localStorage copy stay the immediate, 30-day copies. Signup and * the browser both pick between the copies with `preferFirstTouch`, so they * agree on which visit is first touch. */ export declare const FIRST_TOUCH_SERVER_COOKIE_NAME = "an_fts"; export declare const FIRST_TOUCH_SERVER_COOKIE_VERSION = "1"; export declare const FIRST_TOUCH_SERVER_PATH = "/_agent-native/auth/attribution"; /** Counted from the first visit, never extended by later ones. */ export declare const FIRST_TOUCH_SERVER_LIFETIME_SECONDS: number; /** `name=value` budget, so this and the browser's cookies fit one header. */ export declare const FIRST_TOUCH_SERVER_COOKIE_MAX_BYTES = 1500; export interface TimedFirstTouch extends AttributionTouch { landed_at?: string; } /** * Which of two records is first touch: the first visit that had a source, * else the first visit. `incumbent` wins a tie, so a copy never displaces the * value it came from. */ export declare function preferFirstTouch(incumbent: T | null | undefined, challenger: T | null | undefined): T | null; /** Whether two records are the same visit, however each copy was trimmed. */ export declare function isSameFirstTouch(a: TimedFirstTouch | null | undefined, b: TimedFirstTouch | null | undefined): boolean; /** * When the durable copy expires: a year after the visit, or `null` once that * year is over. A missing or future visit time counts from now. */ export declare function firstTouchServerExpiry(touch: TimedFirstTouch, now?: number): Date | null;