import { z } from "zod/v4";
const StringOrNumber = z.union([z.string(), z.number()]);
export const OmniFlowProxyConfigSchema = z.object({
    type: z.string().min(1),
    host: z.string().min(1),
    port: StringOrNumber,
    username: z.string().optional().default(""),
    password: z.string().optional().default(""),
});
export const OmniFlowExtensionStorageSchema = z
    .object({
    proxyConfig: OmniFlowProxyConfigSchema.optional().nullable(),
    timezoneEnabled: z.boolean().optional(),
    spoofTimezone: z.string().optional().default(""),
    webrtcDisabled: z.boolean().optional(),
    languagesEnabled: z.boolean().optional(),
    hardwareMaskingEnabled: z.boolean().optional(),
    antiBotEnabled: z.boolean().optional(),
})
    .passthrough();
export const OmniFlowCookieSchema = z
    .object({
    name: z.string().min(1),
    value: z.string(),
    domain: z.string().min(1),
    path: z.string().default("/"),
    secure: z.boolean().optional(),
    httpOnly: z.boolean().optional(),
    sameSite: z.string().optional(),
    expirationDate: z.number().optional(),
    session: z.boolean().optional(),
    storeId: z.string().optional(),
})
    .passthrough();
export const OmniFlowSessionExportSchema = z
    .object({
    app: z.literal("OmniFlow"),
    version: z.string().optional(),
    timestamp: z.number().optional(),
    extensionStorage: OmniFlowExtensionStorageSchema,
    cookies: z.array(OmniFlowCookieSchema).default([]),
})
    .passthrough();
export const OmniFlowSessionSummarySchema = z.object({
    proxy: OmniFlowProxyConfigSchema.nullable(),
    timezone: z.string().optional().default(""),
    cookie_count: z.number().int().nonnegative().default(0),
});
export function summarizeOmniFlowSession(payload) {
    const storage = payload.extensionStorage;
    const proxy = storage.proxyConfig ?? null;
    const timezone = storage.timezoneEnabled === false ? "" : storage.spoofTimezone ?? "";
    return {
        proxy,
        timezone,
        cookie_count: payload.cookies.length,
    };
}
//# sourceMappingURL=omni-flow-session.js.map