import { $ as ValueProcessorOptions, $t as DefaultRuleGroupType, A as FormatQueryFinalOptions, An as SetRequired, At as ValidationMap, B as RQBJsonLogicStartsWith, Bt as RuleGroupTypeAny, C as DiagnosticEntry, Cn as OptionList, Ct as ValueSource, D as ExportFormat, Dn as ToFullOption, Dt as WithRequired, E as DiagnosticsStats, En as ToFlexibleOption, Et as ValueSources, F as NLTranslations, Fn as IsNever, Ft as DefaultRuleOrGroupArray, G as RuleGroupICDiagnosticsArray, Gt as CommonRuleAndGroupProperties, H as RuleDiagnosticsResult, Ht as RuleOrGroupArray, I as ParameterizedNamedSQL, In as IsAny, It as GenericizeRuleGroupType, J as RuleProcessor, Jt as DefaultCombinatorName, K as RuleGroupICDiagnosticsResult, Kt as DefaultCombinator, L as ParameterizedSQL, Lt as GetRuleGroupType, M as FormatQueryValidateRule, Mt as DefaultRuleGroupICArray, N as GroupVariantCondition, Nn as Simplify, Nt as DefaultRuleGroupTypeAny, O as ExportObjectFormats, On as ValueOption, Ot as QueryValidator, P as NLTranslationKey, Pn as If, Pt as DefaultRuleGroupTypeIC, Q as ValueProcessorLegacy, Qt as DefaultRuleGroupArray, R as RQBJsonLogic, Rt as GetRuleTypeFromGroupWithFieldAndOperator, S as ConstituentWordOrderString, Sn as OptionGroup, St as ValueEditorType, T as DiagnosticsResult, Tn as StringUnionToFullOptionArray, Tt as ValueSourceFullOptions, U as RuleGroupDiagnosticsArray, Ut as ToRuleGroupType, V as RQBJsonLogicVar, Vt as RuleGroupTypeIC, W as RuleGroupDiagnosticsResult, Wt as ToRuleGroupTypeIC, X as ValueProcessor, Xt as DefaultOperator, Y as SQLPreset, Yt as DefaultCombinatorNameExtended, Z as ValueProcessorByRule, Zt as DefaultOperatorName, _ as JsonLogicSome, _n as FullOptionRecord, _t as ParseNumberMethod, a as JsonLogicGreaterThan, an as UpdateableProperties, at as CombinatorByValue, b as JsonLogicVar, bn as NameLabelPair, bt as RemoveNullability, c as JsonLogicInString, cn as BaseOption, ct as FullCombinator, d as JsonLogicNegation, dn as FlexibleOptionGroup, dt as InputType, en as DefaultRuleType, et as AccessibleDescriptionGenerator, f as JsonLogicNone, fn as FlexibleOptionList, ft as MatchConfig, g as JsonLogicRulesLogic, gn as FullOptionMap, gt as OperatorByValue, h as JsonLogicReservedOperations, hn as FullOptionList, ht as Operator, i as JsonLogicEqual, in as UpdateValueMap, it as Combinator, j as FormatQueryOptions, jn as Except, jt as ValidationResult, k as ExportOperatorMap, kn as WithUnknownIndex, kt as RuleValidator, l as JsonLogicLessThan, ln as BaseOptionMap, lt as FullField, m as JsonLogicOr, mn as FullOption, mt as MatchModeOptions, n as JsonLogicAnd, nn as RuleGroupType, nt as Arity, o as JsonLogicGreaterThanOrEqual, on as ExpressionNode, ot as Field, p as JsonLogicNotEqual, pn as FlexibleOptionListProp, pt as MatchMode, q as RuleGroupProcessor, qt as DefaultCombinatorExtended, r as JsonLogicDoubleNegation, rn as RuleType, rt as Classname, s as JsonLogicInArray, sn as BaseFullOption, st as FieldByValue, t as JsonLogicAll, tn as RuleGroupArray, tt as ActionElementEventHandler, u as JsonLogicLessThanOrEqual, un as FlexibleOption, ut as FullOperator, v as JsonLogicStrictEqual, vn as GetOptionIdentifierType, vt as ParseNumbersPropConfig, w as DiagnosticsFieldSummaryEntry, wn as StringUnionToFlexibleOptionArray, wt as ValueSourceFlexibleOptions, x as ConstituentWordOrder, xn as Option, xt as ValueChangeEventHandler, y as JsonLogicStrictNotEqual, yn as GetOptionType, yt as Path, z as RQBJsonLogicEndsWith, zt as RuleGroupICArray } from "./index-DOIE2pwx.mjs"; import "./index-OF2Q1gTp.mjs"; import { n as transformQuery, t as TransformQueryOptions } from "./transformQuery-B7d9AWUf.mjs"; import { produce } from "immer"; //#region src/controlPropKeys.d.ts /** * Runtime data describing the set of query builder controls and the props each one receives. * * These live in `@react-querybuilder/core` (not `react-querybuilder`) so that non-React ports * can consume them without a React dependency. * * Nothing here can drift from the React implementation unnoticed: * `react-querybuilder`'s `types/controlPropKeys.test.ts` gates {@link controlKeys} against * `defaultControlElements` and `ControlElementsProp`, and every entry of * {@link controlPropKeys} against the corresponding props interface—both at runtime and at * compile time, in both directions. */ /** * The name of every query builder control, alphabetized. * * @group Props */ declare const controlKeys: readonly ["actionElement", "addGroupAction", "addRuleAction", "cloneGroupAction", "cloneRuleAction", "combinatorSelector", "dragHandle", "fieldSelector", "inlineCombinator", "lockGroupAction", "lockRuleAction", "matchModeEditor", "muteGroupAction", "muteRuleAction", "notToggle", "operatorSelector", "removeGroupAction", "removeRuleAction", "rule", "ruleGroup", "ruleGroupBodyElements", "ruleGroupHeaderElements", "shiftActions", "undoRedoActions", "valueEditor", "valueSelector", "valueSourceSelector"]; /** * The name of a query builder control. * * @group Props */ type ControlKey = (typeof controlKeys)[number]; /** * The full set of prop names each default control receives. Ports can use this to declare * every prop explicitly instead of relying on fall-through/attribute inheritance. * * Each array is the complete, alphabetized key set of the control's props interface in * `react-querybuilder`. The lists are written out in full rather than composed from shared * bases because `--isolatedDeclarations` cannot infer array types built with spreads. A * compile-time gate in `react-querybuilder` (`types/controlPropKeys.test.ts`) fails the build * if any list drifts from its interface in either direction. * * @group Props */ declare const controlPropKeys: { readonly actionElement: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly addGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly addRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly cloneGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly cloneRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly combinatorSelector: readonly ["className", "context", "disabled", "handleOnChange", "level", "options", "path", "ruleGroup", "rules", "schema", "testID", "title", "validation", "value"]; readonly dragHandle: readonly ["className", "context", "disabled", "dragHandleAttributes", "label", "level", "path", "ruleOrGroup", "schema", "testID", "title", "validation"]; readonly fieldSelector: readonly ["className", "context", "disabled", "handleOnChange", "level", "operator", "options", "path", "rule", "schema", "testID", "title", "validation", "value"]; readonly inlineCombinator: readonly ["className", "component", "context", "disabled", "handleOnChange", "level", "options", "path", "ruleGroup", "rules", "schema", "testID", "title", "validation", "value"]; readonly lockGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly lockRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly matchModeEditor: readonly ["className", "classNames", "context", "disabled", "field", "fieldData", "handleOnChange", "level", "match", "numericEditorComponent", "options", "path", "rule", "schema", "selectorComponent", "testID", "thresholdPlaceholder", "title", "validation", "value"]; readonly muteGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly muteRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly notToggle: readonly ["checked", "className", "context", "disabled", "handleOnChange", "label", "level", "path", "ruleGroup", "schema", "testID", "title", "validation"]; readonly operatorSelector: readonly ["className", "context", "disabled", "field", "fieldData", "handleOnChange", "level", "options", "path", "rule", "schema", "testID", "title", "validation", "value"]; readonly removeGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly removeRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"]; readonly rule: readonly ["actions", "context", "disabled", "dndRef", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "field", "groupItems", "id", "isDragging", "isOver", "operator", "parentDisabled", "parentMuted", "path", "rule", "schema", "shiftDownDisabled", "shiftUpDisabled", "translations", "value", "valueSource"]; readonly ruleGroup: readonly ["actions", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "not", "parentDisabled", "parentMuted", "path", "previewRef", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftUpDisabled", "translations"]; readonly ruleGroupBodyElements: readonly ["accessibleDescription", "actions", "addGroup", "addRule", "classNames", "cloneGroup", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "muted", "not", "onCombinatorChange", "onGroupAdd", "onIndependentCombinatorChange", "onNotToggleChange", "outerClassName", "parentDisabled", "parentMuted", "path", "pathsMemo", "previewRef", "removeGroup", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftGroupDown", "shiftGroupUp", "shiftUpDisabled", "toggleLockGroup", "toggleMuteGroup", "translations", "validationClassName", "validationResult"]; readonly ruleGroupHeaderElements: readonly ["accessibleDescription", "actions", "addGroup", "addRule", "classNames", "cloneGroup", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "muted", "not", "onCombinatorChange", "onGroupAdd", "onIndependentCombinatorChange", "onNotToggleChange", "outerClassName", "parentDisabled", "parentMuted", "path", "pathsMemo", "previewRef", "removeGroup", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftGroupDown", "shiftGroupUp", "shiftUpDisabled", "toggleLockGroup", "toggleMuteGroup", "translations", "validationClassName", "validationResult"]; readonly shiftActions: readonly ["className", "context", "disabled", "labels", "level", "path", "ruleOrGroup", "schema", "shiftDown", "shiftDownDisabled", "shiftUp", "shiftUpDisabled", "testID", "title", "titles", "validation"]; readonly undoRedoActions: readonly ["className", "classNames", "context", "disabled", "labels", "level", "path", "ruleOrGroup", "schema", "testID", "title", "titles", "validation"]; readonly valueEditor: readonly ["className", "context", "disabled", "field", "fieldData", "handleOnChange", "inputType", "level", "listsAsArrays", "operator", "parseNumbers", "path", "rule", "schema", "selectorComponent", "separator", "skipHook", "testID", "title", "type", "validation", "value", "valueSource", "values"]; readonly valueSelector: readonly ["className", "context", "disabled", "handleOnChange", "level", "listsAsArrays", "multiple", "options", "path", "schema", "testID", "title", "validation", "value"]; readonly valueSourceSelector: readonly ["className", "context", "disabled", "field", "fieldData", "handleOnChange", "level", "options", "path", "rule", "schema", "testID", "title", "validation", "value"]; }; /** * Which bulk override, if any, applies to each control: `"action"` for controls that a supplied * `actionElement` replaces, `"selector"` for controls that a supplied `valueSelector` replaces, * and `null` for controls that neither replaces. * * `actionElement` and `valueSelector` are themselves `null`—they are the _source_ of a bulk * override, not a target of one. * * Replaces name-suffix sniffing (`key.endsWith('Action')`), which would silently misclassify a * future control named e.g. `pathSelector`, and which disagrees between implementations about * whether `shiftActions`/`undoRedoActions` (plural) match. They do not: neither receives the * `actionElement` bulk override. * * @group Props */ declare const controlKind: { readonly actionElement: null; readonly addGroupAction: "action"; readonly addRuleAction: "action"; readonly cloneGroupAction: "action"; readonly cloneRuleAction: "action"; readonly combinatorSelector: "selector"; readonly dragHandle: null; readonly fieldSelector: "selector"; readonly inlineCombinator: null; readonly lockGroupAction: "action"; readonly lockRuleAction: "action"; readonly matchModeEditor: null; readonly muteGroupAction: "action"; readonly muteRuleAction: "action"; readonly notToggle: null; readonly operatorSelector: "selector"; readonly removeGroupAction: "action"; readonly removeRuleAction: "action"; readonly rule: null; readonly ruleGroup: null; readonly ruleGroupBodyElements: null; readonly ruleGroupHeaderElements: null; readonly shiftActions: null; readonly undoRedoActions: null; readonly valueEditor: null; readonly valueSelector: null; readonly valueSourceSelector: "selector"; }; //#endregion //#region ../../node_modules/type-fest/source/primitive.d.ts /** Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). @category Type */ type Primitive = null | undefined | string | number | boolean | symbol | bigint; //#endregion //#region ../../node_modules/type-fest/source/internal/type.d.ts /** Matches any primitive, `void`, `Date`, or `RegExp` value. */ type BuiltIns = Primitive | void | Date | RegExp; /** Test if the given function has multiple call signatures. Needed to handle the case of a single call signature with properties. Multiple call signatures cannot currently be supported due to a TypeScript limitation. @see https://github.com/microsoft/TypeScript/issues/29732 */ type HasMultipleCallSignatures unknown> = T extends { (...arguments_: infer A): unknown; (...arguments_: infer B): unknown; } ? B extends A ? A extends B ? false : true : true : false; /** An if-else-like type that resolves depending on whether the given type is `any` or `never`. @example ``` // When `T` is neither `any` nor `never` (like `string`) => Returns `IfNot` branch type A = IfNotAnyOrNever; //=> 'VALID' // When `T` is `any` => Returns `IfAny` branch type B = IfNotAnyOrNever; //=> 'IS_ANY' // When `T` is `never` => Returns `IfNever` branch type C = IfNotAnyOrNever; //=> 'IS_NEVER' ``` Note: Wrapping a tail-recursive type with `IfNotAnyOrNever` makes the implementation non-tail-recursive. To fix this, move the recursion into a helper type. Refer to the following example: @example ```ts import type {StringRepeat} from 'type-fest'; type NineHundredNinetyNineSpaces = StringRepeat<' ', 999>; // The following implementation is not tail recursive type TrimLeft = IfNotAnyOrNever : S}>; // Hence, instantiations with long strings will fail // @ts-expect-error type T1 = TrimLeft; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Error: Type instantiation is excessively deep and possibly infinite. // To fix this, move the recursion into a helper type type TrimLeftOptimised = IfNotAnyOrNever}>; type _TrimLeftOptimised = S extends ` ${infer R}` ? _TrimLeftOptimised : S; type T2 = TrimLeftOptimised; //=> '' ``` */ type IfNotAnyOrNever = IsAny extends true ? 'ifAny' extends keyof Cases ? Cases['ifAny'] : any : IsNever extends true ? 'ifNever' extends keyof Cases ? Cases['ifNever'] : never : Cases['ifNot']; //#endregion //#region ../../node_modules/type-fest/source/require-at-least-one.d.ts /** Create a type that requires at least one of the given keys, while keeping the remaining keys as is. @example ``` import type {RequireAtLeastOne} from 'type-fest'; type Responder = { text?: () => string; json?: () => string; secure?: boolean; }; const responder: RequireAtLeastOne = { json: () => '{"message": "ok"}', secure: true, }; ``` @category Object */ type RequireAtLeastOne = IfNotAnyOrNever, never, _RequireAtLeastOne, keyof ObjectType, KeysType>>>; }>; type _RequireAtLeastOne = { [ // For each `Key` in `KeysType` make a mapped type: Key in KeysType]-?: Required> // 1. Make `Key`'s type required & Partial>> // 2. Make all other keys in `KeysType` optional ; }[KeysType] & Except; // 3. Add the remaining keys not in `KeysType` //#endregion //#region ../../node_modules/type-fest/source/required-deep.d.ts /** Create a deeply required version of another type. Use-cases: - Creating optional configuration interfaces where the underlying implementation still requires all options to be fully specified. - Modeling the resulting type after a deep merge with a set of defaults. Use [`Required`](https://www.typescriptlang.org/docs/handbook/utility-types.html#requiredtype) if you only need one level deep. @example ``` import type {RequiredDeep} from 'type-fest'; type Settings = { textEditor?: { fontSize?: number; fontColor?: string; fontWeight?: number | undefined; }; autocomplete?: boolean; autosave?: boolean | undefined; }; type RequiredSettings = RequiredDeep; //=> { // textEditor: { // fontSize: number; // fontColor: string; // fontWeight: number | undefined; // }; // autocomplete: boolean; // autosave: boolean | undefined; // } ``` Note that types containing overloaded functions are not made deeply required due to a [TypeScript limitation](https://github.com/microsoft/TypeScript/issues/29732). @category Utilities @category Object @category Array @category Set @category Map */ type RequiredDeep = T extends BuiltIns ? T : T extends Map ? Map, RequiredDeep> : T extends Set ? Set> : T extends ReadonlyMap ? ReadonlyMap, RequiredDeep> : T extends ReadonlySet ? ReadonlySet> : T extends WeakMap ? WeakMap, RequiredDeep> : T extends WeakSet ? WeakSet> : T extends Promise ? Promise> : T extends ((...arguments_: any[]) => unknown) ? IsNever extends true ? T : HasMultipleCallSignatures extends true ? T : ((...arguments_: Parameters) => ReturnType) & RequiredObjectDeep : T extends object ? Simplify> // `Simplify` to prevent `RequiredObjectDeep` from appearing in the resulting type : unknown; type RequiredObjectDeep = { [KeyType in keyof ObjectType]-?: RequiredDeep; }; //#endregion //#region src/types/dnd.d.ts type DndDropTargetType = "rule" | "ruleGroup" | "inlineCombinator"; type DraggedItem = (RuleType & { path: Path; qbId: string; }) | (RuleGroupTypeAny & { path: Path; qbId: string; }); type DropEffect = "move" | "copy"; interface DropResult { path: Path; type: DndDropTargetType; dropEffect?: DropEffect; groupItems?: boolean; qbId: string; getQuery: () => RuleGroupTypeAny; dispatchQuery: (query: RuleGroupTypeAny) => void; } interface DragCollection { isDragging: boolean; dragMonitorId: string | symbol; } interface DropCollection { dropNotAllowed: boolean; isOver: boolean; dropMonitorId: string | symbol; dropEffect?: DropEffect; groupItems?: boolean; } //#endregion //#region src/types/history.d.ts /** * Options controlling how query changes are recorded for undo/redo. * * Shared by the `react-querybuilder/history` entry point and the * {@link index!QueryManager QueryManager} utility. */ interface QueryHistoryOptions { /** * Maximum number of undo steps to retain. Older entries are discarded. * * @default 50 */ maxHistory?: number; /** * Consecutive changes to the same property of the same rule within this many milliseconds * are merged into a single undo step, so that (for example) typing a multi-character value * produces one history entry rather than one per keystroke. * * Set to `0` to record every change separately. * * @default 500 */ coalesceMs?: number; } //#endregion //#region src/types/queryBuilder.d.ts /** * Base interface for all rule subcomponents. * * @group Props */ interface CommonRuleSubComponentProps { rule: RuleType; } /** * Classnames applied to each component. * * @group Props */ interface Classnames { /** * Classnames applied to the root `
` element. */ queryBuilder: Classname; /** * Classnames applied to the `
` containing the RuleGroup. */ ruleGroup: Classname; /** * Classnames applied to the `
` containing the RuleGroup header controls. */ header: Classname; /** * Classnames applied to the `
` containing the RuleGroup child rules/groups. */ body: Classname; /** * Classnames applied to the `` control for fields. */ fields: Classname; /** * Classnames applied to the `` for match thresholds. */ matchThreshold: Classname; /** * Classnames applied to the `` for the rule value. */ value: Classname; /** * Classnames applied to the `