import * as react_jsx_runtime from 'react/jsx-runtime'; import * as React from 'react'; import { Q as ListerSearchPayload, U as ListerId, W as ListerDefinition, X as ListerOption, Y as PresetMap, Z as ListerApi, _ as ListerStoreState, $ as ListerSessionId, a0 as ListerSearchTarget, a1 as ListerSearchMode, a2 as ListerFilterCtx, a3 as ListerDetails, a4 as ListerProviderHost, a5 as ListerRuntimeState, a6 as ShadcnJsonEditorProps, a7 as JsonEditorIndexHandle } from './core-Cg8uXa6v.js'; export { ad as ListerChangeEvent, am as ListerFilterApply, al as ListerFilterApplyMode, an as ListerFilterBindKey, ap as ListerFilterGroupOption, ao as ListerFilterInput, ar as ListerFilterInputOption, as as ListerFilterOption, at as ListerFilterSpec, aq as ListerFilterValueOption, af as ListerLogCode, ag as ListerLogEntry, ae as ListerLogLevel, ai as ListerMapping, a8 as ListerMode, ax as ListerOpenOptions, a9 as ListerOpenReason, ay as ListerOpenResult, aw as ListerOptionsForMode, ah as ListerPermissionCtx, av as ListerRawForMode, ak as ListerSearchSpec, aD as ListerSessionState, aj as ListerSource, au as ListerValueForMode, ac as OpenAnchor, aB as PresetFilters, aC as PresetMeta, az as PresetRaw, aA as PresetValue, ab as Resolver, aa as Selector } from './core-Cg8uXa6v.js'; import 'zod'; import './adapter-CvjXO9Gi.js'; import '@inertiajs/core'; import 'axios'; import 'react-day-picker'; import 'class-variance-authority/types'; import 'class-variance-authority'; import '@radix-ui/react-switch'; type HttpMethod = "GET" | "POST"; type HttpReq = { endpoint: string; method?: HttpMethod; params?: any; body?: any; headers?: Record; signal?: AbortSignal; requestId?: string; }; type ListerHttpClient = (req: HttpReq) => Promise; type ListerFetchOpts = { query?: string; search?: ListerSearchPayload; cursor?: string | null; /** request control */ signal?: AbortSignal; requestId?: string; /** mapping context override */ ctx?: TCtx; }; declare function fetchListerList(args: { def: ListerDefinition; http: ListerHttpClient; filters?: TFilters; opts?: ListerFetchOpts; }): Promise<{ rawList: TRaw[]; optionsList: Array>; responseBody: any; requestId?: string; }>; type ListerEngine = { http: ListerHttpClient; fetch: (args: { def: ListerDefinition; filters?: TFilters; opts?: ListerFetchOpts & { search?: ListerSearchPayload; }; }) => ReturnType>; }; type CreateListerRuntimeOptions

= { host: ListerProviderHost; /** Provide your own engine (for tests / custom http). */ engine?: ListerEngine; /** Initial preset map (kind => definition). */ presets?: P; /** Debounce used when searchMode is remote/hybrid and query changes. */ remoteDebounceMs?: number; now?: () => number; makeSessionId?: () => string; }; type ListerRuntime

= { engine: ListerEngine; api: ListerApi

; getState(): ListerStoreState; subscribe(fn: () => void): () => void; actions: { focus(sessionId: ListerSessionId): void; close(sessionId: ListerSessionId): void; cancel(sessionId: ListerSessionId): void; apply(sessionId: ListerSessionId): void; clear(sessionId: ListerSessionId): void; toggle(sessionId: ListerSessionId, value: any): void; select(sessionId: ListerSessionId, value: any): void; deselect(sessionId: ListerSessionId, value: any): void; setQuery(sessionId: ListerSessionId, query: string): void; setSearchTarget(sessionId: ListerSessionId, target?: ListerSearchTarget): void; setSearchMode(sessionId: ListerSessionId, mode: ListerSearchMode): void; setFiltersPatch(sessionId: ListerSessionId, patch: any): void; mergeFiltersPatch(sessionId: ListerSessionId, patch: any): void; getFilterCtx(id: ListerSessionId): ListerFilterCtx; applyFilterOption(id: ListerSessionId, optionId: string | number): void; refresh(sessionId: ListerSessionId): void; }; selectors: { effectiveFilters(sessionId: ListerSessionId): any; visibleOptions(sessionId: ListerSessionId): any[]; detailsPayload(sessionId: ListerSessionId, action: ListerDetails["action"]): any; }; }; /** * Context for Lister runtime bridge. */ declare const ListerContext: React.Context | null>; type ListerProviderProps

= React.PropsWithChildren>; /** * ListerProvider — creates a singleton runtime and exposes it via React context. * * Responsibilities: * - instantiate `createListerRuntime` once per provider * - subscribe to runtime store (if needed by descendants) * - expose `api`, `actions`, `selectors`, and `state` */ declare function ListerProvider

({ children, ...opts }: ListerProviderProps

): react_jsx_runtime.JSX.Element; /** * Helper: get current runtime or throw */ declare function useListerRuntime

(): ListerRuntime

; declare function ListerUI(): React.ReactPortal | null; /** * useLister — stable hook returning { api, store/state, actions, selectors }. * * It directly mirrors the current runtime, with stable reference equality * for top-level properties (api/actions/selectors), while `state` updates on * store changes. */ declare function useLister

(): { api: ListerApi

; actions: { focus(sessionId: ListerSessionId): void; close(sessionId: ListerSessionId): void; cancel(sessionId: ListerSessionId): void; apply(sessionId: ListerSessionId): void; clear(sessionId: ListerSessionId): void; toggle(sessionId: ListerSessionId, value: any): void; select(sessionId: ListerSessionId, value: any): void; deselect(sessionId: ListerSessionId, value: any): void; setQuery(sessionId: ListerSessionId, query: string): void; setSearchTarget(sessionId: ListerSessionId, target?: ListerSearchTarget): void; setSearchMode(sessionId: ListerSessionId, mode: ListerSearchMode): void; setFiltersPatch(sessionId: ListerSessionId, patch: any): void; mergeFiltersPatch(sessionId: ListerSessionId, patch: any): void; getFilterCtx(id: ListerSessionId): ListerFilterCtx; applyFilterOption(id: ListerSessionId, optionId: string | number): void; refresh(sessionId: ListerSessionId): void; }; selectors: { effectiveFilters(sessionId: ListerSessionId): any; visibleOptions(sessionId: ListerSessionId): any[]; detailsPayload(sessionId: ListerSessionId, action: ListerDetails["action"]): any; }; state: ListerStoreState; store: ListerStoreState; }; /** * useListerSession — convenience hook for one active session. * Example: UI overlays or modals can call this to get the current session. */ declare function useListerSession

(sessionId?: ListerSessionId): { session: ListerRuntimeState | undefined; activeId: string | undefined; }; /** * Minimal selector contract (matches extractArray contract used by lister) * - function: (body) => array * - string: path selector */ type DataSelector = ((body: any) => T[]) | string; type DataSearchConfig = { default?: string; }; type DataBuildRequestCtx = { filters?: TFilters; query: string; cursor: any; }; type DataBuildRequestResult = { params?: any; body?: any; headers?: any; }; type DataKey = string | number; type DataSelectionMode = "none" | "single" | "multiple"; type DataSelectionKey = keyof TItem | string | ((item: TItem) => DataKey | null | undefined); type DataSelectionConfig = { mode?: Exclude; /** * How to resolve the ID for an item. * - string/ keyof: item[key] * - function: (item) => id * Defaults to: item.id ?? item.value */ key?: DataSelectionKey; /** * If "missing", selection IDs that don't exist in the *latest fetched list* are removed. * Default: "never" (recommended; avoids wiping selection on remote searches). */ prune?: "never" | "missing"; }; type UseDataOptions> = { id?: string; endpoint: string; method?: "GET" | "POST"; selector?: DataSelector; /** * Passed through into request builder (same signature shape as legacy provider) */ buildRequest?: (ctx: DataBuildRequestCtx) => DataBuildRequestResult; /** * Minimal search config (default subject column). */ search?: DataSearchConfig; /** * Raw filters object */ filters?: TFilters; initial?: TItem[]; enabled?: boolean; fetchOnMount?: boolean; searchMode?: ListerSearchMode; debounceMs?: number; autoFetchOnFilterChange?: boolean; /** * Optional selection support (by stable item key) */ selection?: DataSelectionConfig; /** * Optional override: custom http client (otherwise uses global axios / axios import) */ http?: ListerHttpClient; }; type UseDataResult> = { id?: string; data: TItem[]; visible: TItem[]; res?: any; loading: boolean; error: any; query: string; setQuery: (q: string) => void; searchMode: ListerSearchMode; setSearchMode: (m: ListerSearchMode) => void; searchTarget?: ListerSearchTarget; setSearchTarget: (t: ListerSearchTarget) => void; filters?: TFilters; setFilters: (next: TFilters | undefined) => void; patchFilters: (patch: Partial) => void; clearFilters: () => void; selectionMode: DataSelectionMode; selectedIds: DataKey | DataKey[] | null; selected: TItem | TItem[] | null; select: (id: DataKey | DataKey[]) => void; deselect: (id: DataKey | DataKey[]) => void; toggle: (id: DataKey) => void; clearSelection: () => void; isSelected: (id: DataKey) => boolean; getSelection: () => TItem | TItem[] | null; refresh: () => Promise; override(data: TItem[]): void; fetch: (override?: { query?: string; filters?: TFilters; searchTarget?: ListerSearchTarget; search?: ListerSearchPayload; }) => Promise; }; declare function useData>(opts: UseDataOptions, deps?: any[]): UseDataResult; declare const ShadcnJsonEditorVariant: React.ForwardRefExoticComponent>; export { type DataBuildRequestCtx, type DataBuildRequestResult, type DataKey, type DataSearchConfig, type DataSelectionConfig, type DataSelectionKey, type DataSelectionMode, type DataSelector, ShadcnJsonEditorVariant as JsonEditor, ListerApi, ListerContext, ListerDefinition, ListerDetails, ListerFilterCtx, ListerId, ListerOption, ListerProvider, ListerProviderHost, type ListerProviderProps, ListerRuntimeState, ListerSearchMode, ListerSearchPayload, ListerSearchTarget, ListerSessionId, ListerStoreState, ListerUI, PresetMap, type UseDataOptions, type UseDataResult, useData, useLister, useListerRuntime, useListerSession };