import { ReactElement } from 'react'; import { ImmutableTree } from '@react-awesome-query-builder/ui'; import { h as createAlertTree } from '../../config-D6f6KlFW.js'; /** * Create / edit a Smart List — a saved, **dynamic** contact segment: name + * optional description + a condition query (the published * `ContactAlertQueryBuilder` + `ALERT_QUERY_FIELDS`) with a live match-count * preview. * * Same saved-query engine as a Contact Alert but **without the alert * `severity`** — a Smart List's purpose is *targeting / sending* (the Email * Marketing composer consumes it as a recipient source), not monitoring. * Membership is dynamic: any client matching the conditions is included now * and in future; editing the conditions recomputes membership. At least one * complete condition is required — Save stays disabled otherwise. * * Lists are shared company assets; there is deliberately no per-list sharing * control. */ interface CreateSmartListPayload { name: string; description: string; /** The sanitized query tree — serialize with `QbUtils.getTree` for the API. */ filterSegment: ImmutableTree; /** Tags the segment matches — a contact with ANY of them is included. */ tags: string[]; } interface CreateSmartListDialogProps { open: boolean; onOpenChange: (open: boolean) => void; mode?: "create" | "edit"; initialName?: string; initialDescription?: string; /** Seed conditions — e.g. when saving the current Contacts filter as a list. */ initialQuery?: Parameters[0]; /** Live count of contacts matching the current conditions. */ matchingCount?: number; /** The broker's tag library, for the Tags condition autocomplete. */ availableTags?: string[]; initialTags?: string[]; onSave?: (payload: CreateSmartListPayload) => void; /** Fires as the tree changes so the host can refresh the live match count. */ onQueryChange?: (tree: ImmutableTree) => void; isLoading?: boolean; } declare function CreateSmartListDialog({ open, onOpenChange, mode, initialName, initialDescription, initialQuery, matchingCount, availableTags, initialTags, onSave, onQueryChange, isLoading, }: CreateSmartListDialogProps): ReactElement; export { CreateSmartListDialog, type CreateSmartListDialogProps, type CreateSmartListPayload, CreateSmartListDialog as default };