@kumix/ui 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +26 -25
  2. package/dist/cascader-types-BnH6wYD-.d.ts +183 -0
  3. package/dist/cascader-types-BnH6wYD-.d.ts.map +1 -0
  4. package/dist/components/agents/ai-sidebar.js +3 -5
  5. package/dist/components/agents/ai-sidebar.js.map +1 -1
  6. package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
  7. package/dist/components/motion/animated-sidebar.js +12 -3
  8. package/dist/components/motion/animated-sidebar.js.map +1 -1
  9. package/dist/components/motion/attachment-upload.d.ts.map +1 -1
  10. package/dist/components/motion/attachment-upload.js +9 -5
  11. package/dist/components/motion/attachment-upload.js.map +1 -1
  12. package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
  13. package/dist/components/motion/bottom-sheet.js +77 -74
  14. package/dist/components/motion/bottom-sheet.js.map +1 -1
  15. package/dist/components/motion/center-morph-modal.d.ts.map +1 -1
  16. package/dist/components/motion/center-morph-modal.js +82 -88
  17. package/dist/components/motion/center-morph-modal.js.map +1 -1
  18. package/dist/components/motion/combobox/content.js +1 -1
  19. package/dist/components/motion/combobox/context.d.ts +6 -0
  20. package/dist/components/motion/combobox/context.d.ts.map +1 -1
  21. package/dist/components/motion/combobox/context.js +1 -233
  22. package/dist/components/motion/combobox/list.js +1 -1
  23. package/dist/components/motion/combobox/trigger.js +7 -8
  24. package/dist/components/motion/combobox/trigger.js.map +1 -1
  25. package/dist/components/motion/combobox.js +1 -1
  26. package/dist/components/motion/command-palette.d.ts.map +1 -1
  27. package/dist/components/motion/command-palette.js +62 -45
  28. package/dist/components/motion/command-palette.js.map +1 -1
  29. package/dist/components/motion/drawer.d.ts.map +1 -1
  30. package/dist/components/motion/drawer.js +30 -30
  31. package/dist/components/motion/drawer.js.map +1 -1
  32. package/dist/components/motion/loader.js +20 -22
  33. package/dist/components/motion/loader.js.map +1 -1
  34. package/dist/components/motion/morphing-modal.d.ts.map +1 -1
  35. package/dist/components/motion/morphing-modal.js +83 -83
  36. package/dist/components/motion/morphing-modal.js.map +1 -1
  37. package/dist/components/motion/morphing-search.d.ts +28 -0
  38. package/dist/components/motion/morphing-search.d.ts.map +1 -0
  39. package/dist/components/motion/morphing-search.js +422 -0
  40. package/dist/components/motion/morphing-search.js.map +1 -0
  41. package/dist/components/motion/project-folder.js +20 -20
  42. package/dist/components/motion/project-folder.js.map +1 -1
  43. package/dist/components/reui/alert.d.ts +1 -1
  44. package/dist/components/reui/badge.d.ts +1 -1
  45. package/dist/components/reui/cascader/cascader-async.d.ts +90 -0
  46. package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -0
  47. package/dist/components/reui/cascader/cascader-async.js +549 -0
  48. package/dist/components/reui/cascader/cascader-async.js.map +1 -0
  49. package/dist/components/reui/cascader/cascader-columns.d.ts +29 -0
  50. package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -0
  51. package/dist/components/reui/cascader/cascader-columns.js +135 -0
  52. package/dist/components/reui/cascader/cascader-columns.js.map +1 -0
  53. package/dist/components/reui/cascader/cascader-context.d.ts +193 -0
  54. package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -0
  55. package/dist/components/reui/cascader/cascader-context.js +59 -0
  56. package/dist/components/reui/cascader/cascader-context.js.map +1 -0
  57. package/dist/components/reui/cascader/cascader-footer.d.ts +85 -0
  58. package/dist/components/reui/cascader/cascader-footer.d.ts.map +1 -0
  59. package/dist/components/reui/cascader/cascader-footer.js +456 -0
  60. package/dist/components/reui/cascader/cascader-footer.js.map +1 -0
  61. package/dist/components/reui/cascader/cascader-i18n.d.ts +17 -0
  62. package/dist/components/reui/cascader/cascader-i18n.d.ts.map +1 -0
  63. package/dist/components/reui/cascader/cascader-i18n.js +68 -0
  64. package/dist/components/reui/cascader/cascader-i18n.js.map +1 -0
  65. package/dist/components/reui/cascader/cascader-item.d.ts +115 -0
  66. package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -0
  67. package/dist/components/reui/cascader/cascader-item.js +530 -0
  68. package/dist/components/reui/cascader/cascader-item.js.map +1 -0
  69. package/dist/components/reui/cascader/cascader-lib.d.ts +141 -0
  70. package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -0
  71. package/dist/components/reui/cascader/cascader-lib.js +576 -0
  72. package/dist/components/reui/cascader/cascader-lib.js.map +1 -0
  73. package/dist/components/reui/cascader/cascader-nav.d.ts +59 -0
  74. package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -0
  75. package/dist/components/reui/cascader/cascader-nav.js +312 -0
  76. package/dist/components/reui/cascader/cascader-nav.js.map +1 -0
  77. package/dist/components/reui/cascader/cascader-types.d.ts +2 -0
  78. package/dist/components/reui/cascader/cascader-types.js +2 -0
  79. package/dist/components/reui/cascader/cascader-virtual.d.ts +65 -0
  80. package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -0
  81. package/dist/components/reui/cascader/cascader-virtual.js +240 -0
  82. package/dist/components/reui/cascader/cascader-virtual.js.map +1 -0
  83. package/dist/components/reui/cascader/cascader.d.ts +322 -0
  84. package/dist/components/reui/cascader/cascader.d.ts.map +1 -0
  85. package/dist/components/reui/cascader/cascader.js +1459 -0
  86. package/dist/components/reui/cascader/cascader.js.map +1 -0
  87. package/dist/components/reui/event-calendar/event-calendar-event.d.ts +28 -47
  88. package/dist/components/reui/event-calendar/event-calendar-event.d.ts.map +1 -1
  89. package/dist/components/reui/event-calendar/event-calendar-event.js +26 -44
  90. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
  91. package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
  92. package/dist/components/reui/event-calendar/event-calendar-types.d.ts +19 -57
  93. package/dist/components/reui/event-calendar/event-calendar-types.d.ts.map +1 -1
  94. package/dist/components/reui/filters/filters-advanced.d.ts +52 -0
  95. package/dist/components/reui/filters/filters-advanced.d.ts.map +1 -0
  96. package/dist/components/reui/filters/filters-advanced.js +1191 -0
  97. package/dist/components/reui/filters/filters-advanced.js.map +1 -0
  98. package/dist/components/reui/filters/filters-builder.d.ts +43 -0
  99. package/dist/components/reui/filters/filters-builder.d.ts.map +1 -0
  100. package/dist/components/reui/filters/filters-builder.js +152 -0
  101. package/dist/components/reui/filters/filters-builder.js.map +1 -0
  102. package/dist/components/reui/filters/filters-chip.d.ts +79 -0
  103. package/dist/components/reui/filters/filters-chip.d.ts.map +1 -0
  104. package/dist/components/reui/filters/filters-chip.js +553 -0
  105. package/dist/components/reui/filters/filters-chip.js.map +1 -0
  106. package/dist/components/reui/filters/filters-context.d.ts +290 -0
  107. package/dist/components/reui/filters/filters-context.d.ts.map +1 -0
  108. package/dist/components/reui/filters/filters-context.js +277 -0
  109. package/dist/components/reui/filters/filters-context.js.map +1 -0
  110. package/dist/components/reui/filters/filters-date.d.ts +43 -0
  111. package/dist/components/reui/filters/filters-date.d.ts.map +1 -0
  112. package/dist/components/reui/filters/filters-date.js +143 -0
  113. package/dist/components/reui/filters/filters-date.js.map +1 -0
  114. package/dist/components/reui/filters/filters-dnd.d.ts +101 -0
  115. package/dist/components/reui/filters/filters-dnd.d.ts.map +1 -0
  116. package/dist/components/reui/filters/filters-dnd.js +454 -0
  117. package/dist/components/reui/filters/filters-dnd.js.map +1 -0
  118. package/dist/components/reui/filters/filters-draft.d.ts +2 -0
  119. package/dist/components/reui/filters/filters-draft.js +128 -0
  120. package/dist/components/reui/filters/filters-draft.js.map +1 -0
  121. package/dist/components/reui/filters/filters-editors.d.ts +91 -0
  122. package/dist/components/reui/filters/filters-editors.d.ts.map +1 -0
  123. package/dist/components/reui/filters/filters-editors.js +773 -0
  124. package/dist/components/reui/filters/filters-editors.js.map +1 -0
  125. package/dist/components/reui/filters/filters-i18n.d.ts +24 -0
  126. package/dist/components/reui/filters/filters-i18n.d.ts.map +1 -0
  127. package/dist/components/reui/filters/filters-i18n.js +127 -0
  128. package/dist/components/reui/filters/filters-i18n.js.map +1 -0
  129. package/dist/components/reui/filters/filters-lib.d.ts +171 -0
  130. package/dist/components/reui/filters/filters-lib.d.ts.map +1 -0
  131. package/dist/components/reui/filters/filters-lib.js +336 -0
  132. package/dist/components/reui/filters/filters-lib.js.map +1 -0
  133. package/dist/components/reui/filters/filters-operators.d.ts +49 -0
  134. package/dist/components/reui/filters/filters-operators.d.ts.map +1 -0
  135. package/dist/components/reui/filters/filters-operators.js +300 -0
  136. package/dist/components/reui/filters/filters-operators.js.map +1 -0
  137. package/dist/components/reui/filters/filters-query.d.ts +132 -0
  138. package/dist/components/reui/filters/filters-query.d.ts.map +1 -0
  139. package/dist/components/reui/filters/filters-query.js +476 -0
  140. package/dist/components/reui/filters/filters-query.js.map +1 -0
  141. package/dist/components/reui/filters/filters-types.d.ts +452 -0
  142. package/dist/components/reui/filters/filters-types.d.ts.map +1 -0
  143. package/dist/components/reui/filters/filters-types.js +2 -0
  144. package/dist/components/reui/filters/filters.d.ts +114 -0
  145. package/dist/components/reui/filters/filters.d.ts.map +1 -0
  146. package/dist/components/reui/filters/filters.js +638 -0
  147. package/dist/components/reui/filters/filters.js.map +1 -0
  148. package/dist/components/reui/gantt/gantt-bar.js +1 -1
  149. package/dist/components/reui/gantt/gantt-nav.js +1 -1
  150. package/dist/components/reui/gantt/gantt-types.d.ts +25 -71
  151. package/dist/components/reui/gantt/gantt-types.d.ts.map +1 -1
  152. package/dist/components/reui/gantt/gantt-view.js +1 -1
  153. package/dist/components/ui/button.d.ts +1 -1
  154. package/dist/components/ui/checkbox.js +1 -1
  155. package/dist/components/ui/checkbox.js.map +1 -1
  156. package/dist/components/ui/field.js +2 -2
  157. package/dist/components/ui/field.js.map +1 -1
  158. package/dist/components/ui/radio-group.js +1 -1
  159. package/dist/components/ui/radio-group.js.map +1 -1
  160. package/dist/components/ui/sidebar.js +1 -1
  161. package/dist/components/ui/switch.js +1 -1
  162. package/dist/components/ui/switch.js.map +1 -1
  163. package/dist/context-BizvUNZv.js +298 -0
  164. package/dist/context-BizvUNZv.js.map +1 -0
  165. package/dist/filters-draft-DEAl3TO-.d.ts +70 -0
  166. package/dist/filters-draft-DEAl3TO-.d.ts.map +1 -0
  167. package/dist/hooks/use-on-open.d.ts +18 -0
  168. package/dist/hooks/use-on-open.d.ts.map +1 -0
  169. package/dist/hooks/use-on-open.js +27 -0
  170. package/dist/hooks/use-on-open.js.map +1 -0
  171. package/dist/hooks/use-row-cursor.d.ts +39 -0
  172. package/dist/hooks/use-row-cursor.d.ts.map +1 -0
  173. package/dist/hooks/use-row-cursor.js +77 -0
  174. package/dist/hooks/use-row-cursor.js.map +1 -0
  175. package/dist/lib/text-shimmer.d.ts +2 -2
  176. package/dist/lib/text-shimmer.d.ts.map +1 -1
  177. package/dist/lib/text-shimmer.js +2 -2
  178. package/dist/lib/text-shimmer.js.map +1 -1
  179. package/dist/presence-gate-BekdC4Bo.js +24 -0
  180. package/dist/presence-gate-BekdC4Bo.js.map +1 -0
  181. package/package.json +11 -11
  182. package/dist/components/motion/combobox/context.js.map +0 -1
  183. package/dist/components/reui/filters.d.ts +0 -176
  184. package/dist/components/reui/filters.d.ts.map +0 -1
  185. package/dist/components/reui/filters.js +0 -1223
  186. package/dist/components/reui/filters.js.map +0 -1
@@ -0,0 +1,452 @@
1
+ import * as React$1 from "react";
2
+ //#region src/components/reui/filters/filters-types.d.ts
3
+ type FilterCombinator = "and" | "or";
4
+ /**
5
+ * One condition. `path` maps one to one onto the cascader's `details.path`, so
6
+ * a field selection commits untranslated. `value` is SINGULAR and the
7
+ * operator's `arity` decides its shape: `"many"` holds an array, `"range"` a
8
+ * tuple, `"none"` undefined.
9
+ */
10
+ interface FilterRule<V = unknown> {
11
+ id: string;
12
+ type: "rule";
13
+ /** Field path, root first. `["name", "first"]` for a nested attribute. */
14
+ path: string[];
15
+ operator: string;
16
+ value: V | undefined;
17
+ /** Flips the meaning in place. Set by Negate when there is no `inverse`. */
18
+ negated?: boolean;
19
+ }
20
+ /** Rules under one combinator; nests, so nesting is never a later break. */
21
+ interface FilterGroupNode<V = unknown> {
22
+ id: string;
23
+ type: "group";
24
+ combinator: FilterCombinator;
25
+ rules: FilterNode<V>[];
26
+ }
27
+ type FilterNode<V = unknown> = FilterRule<V> | FilterGroupNode<V>;
28
+ /** A whole query. Always a group, so flat and nested are one code path. */
29
+ type FilterQuery<V = unknown> = FilterGroupNode<V>;
30
+ type FilterChangeReason = "add" | "update" | "remove" | "duplicate" | "negate" | "reorder" | "combinator" | "clear";
31
+ /** Second argument to `onQueryChange`, so nobody has to diff two trees. */
32
+ interface FilterChangeDetails<V = unknown, O = unknown> {
33
+ reason: FilterChangeReason;
34
+ /** The rule that changed, or null for whole-query changes like `clear`. */
35
+ rule: FilterRule<V> | null;
36
+ /** The field the rule points at, resolved. Null when the path is unknown. */
37
+ field: FilterField<V, O> | null;
38
+ }
39
+ /**
40
+ * How many values an operator takes. Answers "does this need a value editor"
41
+ * for every operator, a consumer's own included, in place of the hardcoded
42
+ * `operator === "empty"` checks it replaced.
43
+ */
44
+ type FilterOperatorArity = "none" | "one" | "many" | "range";
45
+ interface FilterOperator {
46
+ value: string;
47
+ label: string;
48
+ /** Defaults to `"one"`. */
49
+ arity?: FilterOperatorArity;
50
+ /** The opposite operator. Negate flips to it, else sets `rule.negated`. */
51
+ inverse?: string;
52
+ /** Hidden from the operator list but still valid in a restored query. */
53
+ hidden?: boolean;
54
+ }
55
+ /**
56
+ * Which built-in editor a field uses by DEFAULT: `editor` overrides it, and an
57
+ * operator may override both. No date type on purpose - every product wants a
58
+ * different date control, and a built-in one would add a calendar dependency to
59
+ * every install, so a date ships as an `editor`.
60
+ */
61
+ type FilterValueType = "text" | "number" | "range" | "select" | "multiselect" | "boolean";
62
+ interface FilterOption<O = unknown> {
63
+ value: string;
64
+ label: string;
65
+ icon?: React$1.ReactNode;
66
+ description?: string;
67
+ keywords?: string[];
68
+ disabled?: boolean;
69
+ /**
70
+ * The row that means NONE OF THE ABOVE: Unassigned, No label, No due date.
71
+ * Picking it clears every other pick and picking anything else clears it, and
72
+ * it is drawn apart under a rule of its own, because a list that wipes a
73
+ * selection must not look like one that does not; hide that line with
74
+ * `"[&_[data-slot=filter-menu-divider]]:hidden"`. Applied under EVERY
75
+ * operator, negative ones included. The value must be RESOLVABLE, since the
76
+ * rule runs through the option service: an option that exists only in an
77
+ * unfetched `loadOptions` page is invisible to it.
78
+ */
79
+ exclusive?: boolean;
80
+ /** Arbitrary payload, carried untouched through every render callback. */
81
+ data?: O;
82
+ }
83
+ interface FilterLoadContext {
84
+ /** Aborted when the query changes, the editor closes, or a load supersedes. */
85
+ signal: AbortSignal;
86
+ cursor?: string;
87
+ }
88
+ /** Result of `loadOptions`, or a bare array. Shape-locked to the cascader. */
89
+ interface FilterLoadResult<O = unknown> {
90
+ items: FilterOption<O>[];
91
+ nextCursor?: string;
92
+ /** Defaults to whether `nextCursor` was supplied. */
93
+ hasMore?: boolean;
94
+ }
95
+ /** A field, or a branch. A group is a field with `fields`, not `selectable`. */
96
+ interface FilterField<V = unknown, O = unknown> {
97
+ /** Stable id. Unique among its siblings; the full path must be unique. */
98
+ id: string;
99
+ label: string;
100
+ icon?: React$1.ReactNode;
101
+ description?: string;
102
+ keywords?: string[];
103
+ /** Trailing count. Defaults to known children; set it when they are lazy. */
104
+ count?: number;
105
+ fields?: FilterField<V, O>[];
106
+ /** Whether a BRANCH is itself filterable. Leaves always are. */
107
+ selectable?: boolean;
108
+ disabled?: boolean;
109
+ type?: FilterValueType;
110
+ options?: FilterOption<O>[];
111
+ /** Async options, paged via `cursor`. Any `options` also seed the cache. */
112
+ loadOptions?: (query: string, context: FilterLoadContext) => FilterOption<O>[] | Promise<FilterOption<O>[] | FilterLoadResult<O>>;
113
+ /** Resolves stored values the loader never returned, for restored chips. */
114
+ resolveValues?: (values: string[]) => FilterOption<O>[] | Promise<FilterOption<O>[]>;
115
+ /** Operators for this field. Falls back to the catalog for its `type`. */
116
+ operators?: FilterOperator[] | ((field: FilterField<V, O>) => FilterOperator[]);
117
+ defaultOperator?: string;
118
+ /** Overrides the editor chosen from `type`. See `FilterEditorProps`. */
119
+ editor?: FilterEditorRef<V, O>;
120
+ renderValue?: (context: FilterValueDisplayContext<V, O>) => React$1.ReactNode;
121
+ /** The value as PLAIN TEXT for a11y; the default is `String(value)`. */
122
+ valueText?: (context: FilterValueDisplayContext<V, O>) => string;
123
+ /** Placeholder for the value editor's input, or an option list's search. */
124
+ placeholder?: string;
125
+ /** SHOWS the search box (default true). Off keeps it, hidden: it owns focus. */
126
+ searchable?: boolean;
127
+ /**
128
+ * Whether an option-backed editor STACKS the picks at the top of its list.
129
+ * Off by default, because a short closed list is read as a whole and lifting
130
+ * a row out of a memorised order costs more than it buys. The partition is
131
+ * taken LIVE unless `sortSelected: "snapshot"`, so ticking a row moves the
132
+ * rows below it and the highlight is carried across by VALUE. Exclusive
133
+ * options never join the stack; they are grouped by ROLE.
134
+ */
135
+ pinSelected?: boolean;
136
+ /**
137
+ * How an option list is ordered INSIDE each group, plus WHEN the partition is
138
+ * taken under `pinSelected`. With pinning off there is no partition, so
139
+ * `"snapshot"` is the same thing as `"none"`.
140
+ *
141
+ * - `"none"` (default) keeps declaration order. Not alphabetical, because
142
+ * option order is usually semantic (To do, In progress, Done).
143
+ * - `"label"` sorts with `localeCompare`, so "Ålesund" files next to
144
+ * "Alesund" rather than after "Zurich".
145
+ * - `"snapshot"` keeps declaration order too, and freezes the partition as
146
+ * the menu opened it: a steady pointer target where the other two re-pin
147
+ * live.
148
+ */
149
+ sortSelected?: "none" | "label" | "snapshot";
150
+ /**
151
+ * This field's own validity check. Return a MESSAGE to mark the value cell
152
+ * invalid, or `null` / `undefined` / `false` when the value is fine. A string
153
+ * rather than a schema object keeps the primitive library-agnostic.
154
+ *
155
+ * ORDER MATTERS: the built-in checks run first and this runs only when they
156
+ * pass, so a validator never re-answers "is there a value at all". Not called
157
+ * for a valueless operator, nor for a rule whose field the schema no longer
158
+ * has, and shown only once the user has committed a value to that rule.
159
+ */
160
+ validate?: (context: FilterValidateContext<V, O>) => string | null | undefined | false;
161
+ /**
162
+ * Reaches the value editor's PANEL. Merged last through tailwind-merge, so a
163
+ * `w-*` here beats the default rather than losing to it on source order.
164
+ *
165
+ * HEIGHT IS A VARIABLE, NOT A UTILITY: a `max-h-*` here bounds the PANEL and
166
+ * does nothing to the list inside it, which owns its own `max-height`. Write
167
+ * `--cascader-max-height: 28rem` as an arbitrary property instead; the cap is
168
+ * the SMALLER of that and the space the popup has.
169
+ */
170
+ className?: string;
171
+ /** The storage column when it differs from the UI path. Never read here. */
172
+ column?: string;
173
+ data?: unknown;
174
+ }
175
+ /**
176
+ * Where an editor renders. The SAME component serves both: `"create"` is the
177
+ * wizard step, which has Back and advances on commit, `"amend"` the
178
+ * chip-anchored popover, which offers Discard instead.
179
+ */
180
+ type FilterEditorHost = "create" | "amend";
181
+ interface FilterOptionsState<O = unknown> {
182
+ items: FilterOption<O>[];
183
+ loading: boolean;
184
+ error: boolean;
185
+ hasMore: boolean;
186
+ /** Current search text. Debounced before it reaches `loadOptions`. */
187
+ query: string;
188
+ setQuery: (query: string) => void;
189
+ loadMore: () => void;
190
+ retry: () => void;
191
+ /** Resolves a stored value to its option, from cache when possible. */
192
+ resolve: (value: string) => FilterOption<O> | undefined;
193
+ }
194
+ interface FilterCommitOptions {
195
+ /** Dismiss the host after writing. Defaults to true. */
196
+ close?: boolean;
197
+ }
198
+ interface FilterEditorProps<V = unknown, O = unknown> {
199
+ field: FilterField<V, O>;
200
+ operator: FilterOperator;
201
+ /** The DRAFT value. An editor edits a draft; the host commits it. */
202
+ value: V | undefined;
203
+ onValueChange: (value: V | undefined) => void;
204
+ host: FilterEditorHost;
205
+ /**
206
+ * Spread onto whichever element should take focus, so no editor reaches for
207
+ * `setTimeout`. A CALLBACK ref at `HTMLElement` is the one shape assignable
208
+ * to every element's own ref prop, so it spreads onto an input, a slider or a
209
+ * button without a cast.
210
+ */
211
+ autoFocusProps: {
212
+ ref: React$1.RefCallback<HTMLElement>;
213
+ autoFocus: boolean;
214
+ };
215
+ /** Accept the draft. `{ close: false }` writes through without dismissing. */
216
+ commit: (value?: V, options?: FilterCommitOptions) => void;
217
+ cancel: () => void;
218
+ /** Step back. Only meaningful when `host === "create"`. */
219
+ back: () => void;
220
+ options: FilterOptionsState<O>;
221
+ labels: FilterLabels;
222
+ }
223
+ type FilterEditor<V = unknown, O = unknown> = React$1.ComponentType<FilterEditorProps<V, O>>;
224
+ /**
225
+ * An editor with its generics erased, for the registry. `unknown` rather than
226
+ * `never`: props are contravariant, so a `FilterEditor<never, never>` registry
227
+ * accepts nothing at all. The single widening cast happens where it renders.
228
+ */
229
+ type AnyFilterEditor = React$1.ComponentType<FilterEditorProps<unknown, unknown>>;
230
+ type FilterEditorRegistry = Record<string, AnyFilterEditor>;
231
+ /**
232
+ * A registered editor's name, or a component. The `any` arm lets a CONCRETE
233
+ * editor sit on an unknown-typed field without a cast: props are contravariant,
234
+ * so `FilterEditor<DateValue>` is not a `FilterEditor<unknown>`. The widening
235
+ * happens once, inside `resolveFilterEditor`.
236
+ */
237
+ type FilterEditorRef<V = unknown, O = unknown> = string | FilterEditor<V, O> | FilterEditor<any, any>;
238
+ /** Context for a custom builder empty state. Its actions ARE the footer's. */
239
+ interface FilterEmptyStateContext {
240
+ labels: FilterLabels;
241
+ /** The bar is locked. A custom state should not offer an action here. */
242
+ readOnly: boolean;
243
+ /** Which box the builder is in, for a state that wants to be denser inline. */
244
+ mode: "popover" | "inline";
245
+ /** Appends a condition and opens its attribute picker. */
246
+ addFilter: () => void;
247
+ addGroup: () => void;
248
+ }
249
+ interface FilterValueDisplayContext<V = unknown, O = unknown> {
250
+ value: V | undefined;
251
+ /** `value` normalised to an array, so callbacks never re-derive it. */
252
+ values: unknown[];
253
+ field: FilterField<V, O>;
254
+ operator: FilterOperator;
255
+ /** Options already resolved for `value`, when the field is option-backed. */
256
+ options: FilterOption<O>[];
257
+ labels: FilterLabels;
258
+ }
259
+ /** Normalized schema, keyed by SIGNATURE: call sites inline the array. */
260
+ interface FilterIndex<V = unknown, O = unknown> {
261
+ /** Every field by its joined path, `"name.first"`. */
262
+ byPath: Map<string, FilterField<V, O>>;
263
+ /** Child fields by parent path. Root fields are keyed by `FILTER_ROOT_KEY`. */
264
+ childrenOf: Map<string, FilterField<V, O>[]>;
265
+ /** Parent path by path. Empty string for a root field. */
266
+ parentOf: Map<string, string>;
267
+ /** Every field in stable, depth-first order. Deep search walks it, and the
268
+ * builder seeds a new row from the FIRST pickable entry, so order is load
269
+ * bearing, not incidental. */
270
+ all: {
271
+ field: FilterField<V, O>;
272
+ path: string[];
273
+ }[];
274
+ /** Top level fields, in input order. */
275
+ roots: FilterField<V, O>[];
276
+ /** Content hash; equal schemas share one, so a rebuild reuses the index. */
277
+ signature: string;
278
+ }
279
+ type FilterDraftStep = "field" | "operator" | "value";
280
+ /**
281
+ * The in-flight filter. `cascaderPath` is kept SEPARATE from `path`: `path` is
282
+ * what the user chose, `cascaderPath` is where they were browsing when they
283
+ * chose it, and Back has to return there. Deriving it from `path` breaks the
284
+ * moment a deep search jumps across the tree.
285
+ */
286
+ interface FilterDraft<V = unknown> {
287
+ step: FilterDraftStep;
288
+ /** `"ready"` = complete: the host writes it into the query and closes. The
289
+ * pure reducer decides that, not a click handler. */
290
+ status: "editing" | "ready";
291
+ /** Set when amending an existing rule, null when creating a new one. */
292
+ ruleId: string | null;
293
+ /** The chosen field path. Empty until the field step commits. */
294
+ path: string[];
295
+ cascaderPath: string[];
296
+ operator: string | null;
297
+ value: V | undefined;
298
+ query: string;
299
+ }
300
+ /** Every user facing string. `stepAnnouncement` alone is headless-only. */
301
+ interface FilterLabels {
302
+ addFilter: string;
303
+ advancedFilter: string;
304
+ /** The line above the builder's rows, "In this view, show records". */
305
+ showRecords: string;
306
+ /** Empty-state title. The HINT below is withheld from a read-only bar. */
307
+ builderEmpty: string;
308
+ builderEmptyHint: string;
309
+ /** Appends a condition to the root group, from the builder's footer. */
310
+ addCondition: string;
311
+ addConditionGroup: string;
312
+ /** A group's own add button: the only keyboard route into a nested group. It
313
+ * NAMES a button that shows `addCondition`, so a translation must contain
314
+ * that string, which is what WCAG Label in Name asks for. */
315
+ addToGroup: string;
316
+ removeGroup: string;
317
+ wrapInGroup: string;
318
+ /** Dissolves a group into its parent. The inverse of `wrapInGroup`. */
319
+ ungroup: string;
320
+ /** Moves a condition to the root group. The keyboard path to that drag. */
321
+ moveToTopLevel: string;
322
+ /** Groups have no names, so they are numbered in document order, one-based. */
323
+ moveToGroup: (position: number) => string;
324
+ /** Accessible name of a row's or a group's drag handle. */
325
+ reorder: string;
326
+ /** Description on the drag handle, teaching the Alt+Arrow keyboard model. */
327
+ reorderHint: string;
328
+ groupAll: string;
329
+ groupAny: string;
330
+ groupPlaceholder: string;
331
+ /** Names a builder row. Depth is in it: indentation is invisible to AT. */
332
+ rowLabel: (condition: string, depth: number) => string;
333
+ groupLabel: (description: string, depth: number) => string;
334
+ groupAnnouncement: (added: boolean) => string;
335
+ /** Alt+Arrow is otherwise silent. The total says whether this is the end. */
336
+ reorderAnnouncement: (label: string, position: number, total: number) => string;
337
+ /** A cross-PARENT move; a plain reorder announcement cannot be told apart.
338
+ * `destination` is the group's own headline, or the bar's label at the top
339
+ * level. */
340
+ moveAnnouncement: (label: string, destination: string, position: number, total: number) => string;
341
+ clearAll: string;
342
+ /** Names a group's menu; distinct from `chipMenu`, which is per-rule. */
343
+ groupMenu: string;
344
+ searchFields: string;
345
+ searchOperators: string;
346
+ searchOptions: string;
347
+ back: string;
348
+ clear: string;
349
+ apply: string;
350
+ discard: string;
351
+ empty: string;
352
+ loading: string;
353
+ loadingMore: string;
354
+ loadMore: string;
355
+ error: string;
356
+ retry: string;
357
+ /** Leading word before the first chip, where a combinator would otherwise go. */
358
+ where: string;
359
+ and: string;
360
+ or: string;
361
+ /** Accessible name of the combinator toggle between two chips. */
362
+ combinator: string;
363
+ /** Builder combinator toggle. English "and" wants 58.72px of a 64px track,
364
+ * so the name must CONTAIN the word: truncated, the pill shows "a...". */
365
+ combinatorLabel: (word: string) => string;
366
+ duplicate: string;
367
+ negate: string;
368
+ /** Chip kebab's route into the builder. Needs `onConvertToAdvanced`. */
369
+ convertToAdvanced: string;
370
+ remove: string;
371
+ /** Names a chip's menu button. The builder's row menu reads the same key. */
372
+ chipMenu: (fieldLabel: string) => string;
373
+ filtersLabel: string;
374
+ filterLabel: (condition: string) => string;
375
+ /** Prose, not ARIA: `aria-readonly` is invalid on toolbar, group and button. */
376
+ readOnly: string;
377
+ /** Joins ancestors in a nested field path, "Name > First", for the names
378
+ * `formatFilterPath` builds. The chip draws a decorative chevron instead. */
379
+ pathSeparator: string;
380
+ valuePlaceholder: string;
381
+ /** Empty word for an OPTION value; `placeholder` is the search prompt. */
382
+ selectPlaceholder: string;
383
+ /** Spoken for an empty value: "contains enter text..." is not a name. */
384
+ noValue: string;
385
+ /** Shown in the operator segment before a condition has been chosen. */
386
+ selectCondition: string;
387
+ /** Appended to a chip with no condition, matching the dashed outline. */
388
+ incomplete: string;
389
+ /** Appended to a branch row's accessible name in the field picker. */
390
+ branchAffordance: string;
391
+ /** A FRAGMENT, appended after a comma to an exclusive row's accessible name.
392
+ * Warns before the press; `exclusiveAnnouncement` is the receipt after. */
393
+ exclusiveHint: string;
394
+ /** The clearing moves nothing on screen, so it is otherwise silent. */
395
+ exclusiveAnnouncement: (label: string, cleared: number) => string;
396
+ itemCount: (count: number) => string;
397
+ fieldsLabel: string;
398
+ /** Live-region text after a query narrows an option list or the picker. */
399
+ resultsAnnouncement: (count: number) => string;
400
+ /** Accessible name of an option menu's footer (Load more, Retry). */
401
+ actionsLabel: string;
402
+ /** For a CONSUMER-composed wizard; the shipped flow announces counts. */
403
+ stepAnnouncement: (step: FilterDraftStep, label: string) => string;
404
+ countAnnouncement: (count: number) => string;
405
+ valueCount: (count: number) => string;
406
+ /** Spells out the list behind the `valueCount` summary, and contains it. */
407
+ valueDetail: (summary: string, values: string[]) => string;
408
+ valueRange: (from: string, to: string) => string;
409
+ rangeFrom: (fieldLabel: string) => string;
410
+ rangeTo: (fieldLabel: string) => string;
411
+ rangeSeparator: string;
412
+ /** Rendered for a `negated` rule, wrapping the operator label. */
413
+ negated: (operatorLabel: string) => string;
414
+ /** Guidance ("Choose a condition"), not diagnosis: shown three ways over. */
415
+ issueOperator: string;
416
+ issueValue: string;
417
+ issueRange: string;
418
+ issueRangeOrder: string;
419
+ issueEmptyGroup: string;
420
+ /** The roll-up, and the name of the button that jumps to the first issue. */
421
+ issueSummary: (count: number) => string;
422
+ }
423
+ /** Why a node cannot run as written. `collectFilterIssues` produces these. */
424
+ type FilterIssueReason = "missing-operator" | "missing-value" | "incomplete-range" | "reversed-range" | "empty-group" |
425
+ /** The one reason whose message is the validator's, not `FilterLabels`. */
426
+ "custom";
427
+ interface FilterIssue {
428
+ nodeId: string;
429
+ /** WHICH cell to mark. Two reasons share the value cell; groups have none. */
430
+ column: "operator" | "value" | "group";
431
+ reason: FilterIssueReason;
432
+ /** Set only for `reason: "custom"`; the rest look up `FilterLabels`. */
433
+ message?: string;
434
+ }
435
+ /**
436
+ * What a field's `validate` is handed. Mirrors `FilterValueDisplayContext`.
437
+ * SYNCHRONOUS: issues are collected in a pure memo pass, so a check that has to
438
+ * hit a server belongs in the consumer's own submit path.
439
+ */
440
+ interface FilterValidateContext<V = unknown, O = unknown> {
441
+ value: V | undefined;
442
+ values: unknown[];
443
+ field: FilterField<V, O>;
444
+ operator: FilterOperator;
445
+ /** How many values this operator takes, already resolved. */
446
+ arity: FilterOperatorArity;
447
+ rule: FilterRule<V>;
448
+ labels: FilterLabels;
449
+ }
450
+ //#endregion
451
+ export { AnyFilterEditor, FilterChangeDetails, FilterChangeReason, FilterCombinator, FilterCommitOptions, FilterDraft, FilterDraftStep, FilterEditor, FilterEditorHost, FilterEditorProps, FilterEditorRef, FilterEditorRegistry, FilterEmptyStateContext, FilterField, FilterGroupNode, FilterIndex, FilterIssue, FilterIssueReason, FilterLabels, FilterLoadContext, FilterLoadResult, FilterNode, FilterOperator, FilterOperatorArity, FilterOption, FilterOptionsState, FilterQuery, FilterRule, FilterValidateContext, FilterValueDisplayContext, FilterValueType };
452
+ //# sourceMappingURL=filters-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters-types.d.ts","names":[],"sources":["../../../../src/components/reui/filters/filters-types.tsx"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export {};
@@ -0,0 +1,114 @@
1
+ import { AnyFilterEditor, FilterChangeDetails, FilterChangeReason, FilterCombinator, FilterCommitOptions, FilterDraft, FilterDraftStep, FilterEditor, FilterEditorHost, FilterEditorProps, FilterEditorRef, FilterEditorRegistry, FilterEmptyStateContext, FilterField, FilterGroupNode, FilterIndex, FilterIssue, FilterIssueReason, FilterLabels, FilterLoadContext, FilterLoadResult, FilterNode, FilterOperator, FilterOperatorArity, FilterOption, FilterOptionsState, FilterQuery, FilterRule, FilterValidateContext, FilterValueDisplayContext, FilterValueType } from "./filters-types.js";
2
+ import { FilterAdvancedRow, FiltersAdvanced, FiltersAdvancedPanel } from "./filters-advanced.js";
3
+ import { FilterFieldPicker, FiltersBuilder } from "./filters-builder.js";
4
+ import { FilterChip, FilterOperatorPopover, FilterRuleMenuItems, FilterValuePopover, useFilterRuleDisplay } from "./filters-chip.js";
5
+ import { FilterPathCollapse } from "./filters-lib.js";
6
+ import { filterReadOnlyProps, isFilterLocked, useFilterActions, useFilterChipAutoOpen, useFilterChipFocused, useFilterFocus, useFilterFocusEmpty, useFilterFocusStore, useFilterRender, useFilterSegmentFocus, useFilterState } from "./filters-context.js";
7
+ import { DEFAULT_FILTER_EDITORS, useFilterOptions, useFilterValueResolution } from "./filters-editors.js";
8
+ import { DEFAULT_FILTER_LABELS } from "./filters-i18n.js";
9
+ import { DEFAULT_FILTER_OPERATORS, DEFAULT_FILTER_OPERATOR_LABELS, FilterOperatorLabels } from "./filters-operators.js";
10
+ import { FilterArityResolver, FilterValidateResolver, collectFilterIssues, copyFilterNodeTo, countFilterRules, createFilterGroup, createFilterQuery, createFilterRule, flattenFilterConditions, flattenFilterRules, isFilterQueryEmpty, isFilterRuleComplete, moveFilterNodeTo, pruneFilterQuery, unwrapFilterGroup, wrapFilterNodeInGroup } from "./filters-query.js";
11
+ import * as React$1 from "react";
12
+ //#region src/components/reui/filters/filters.d.ts
13
+ interface FiltersProps<V = unknown, O = unknown> {
14
+ /** The field schema. Nested via each field's own `fields`. */
15
+ fields: FilterField<V, O>[];
16
+ query?: FilterQuery<V>;
17
+ defaultQuery?: FilterQuery<V>;
18
+ onQueryChange?: (query: FilterQuery<V>, details: FilterChangeDetails<V, O>) => void;
19
+ labels?: Partial<FilterLabels>;
20
+ /** Operator wording, overridden independently of the chrome copy. */
21
+ operatorLabels?: FilterOperatorLabels;
22
+ /** Extra or replacement value editors, resolved by a field's `editor` name. */
23
+ editors?: FilterEditorRegistry;
24
+ /**
25
+ * Which chrome draws the query. `"basic"` is the flat chip row, joined by an
26
+ * implicit AND and drawing no combinator, because a chip row has nowhere to
27
+ * put a parenthesis, and it draws a nested rule at any depth as a flat chip.
28
+ */
29
+ variant?: "basic" | "advanced";
30
+ /** Where the advanced builder lives. `"inline"` renders the panel in place. */
31
+ advancedMode?: "popover" | "inline";
32
+ /**
33
+ * Where the panel sits against its trigger. Stating it settles a twin split:
34
+ * on overflow Base UI flips edges, Radix only shifts along the axis.
35
+ */
36
+ advancedAlign?: "start" | "center" | "end";
37
+ /**
38
+ * Whether the advanced builder's rows can be REORDERED. Off by default: a
39
+ * move changes nothing about what the query MEANS, and costs a grip on every
40
+ * row plus a gesture a touch screen starts by accident. On, drag and
41
+ * Alt+Arrow move any row but the lone root.
42
+ */
43
+ reorderable?: boolean;
44
+ /**
45
+ * The density of the whole bar, chips included. TWO RUNGS and no `lg`,
46
+ * resolved through `filterControlSizes` to whatever the ACTIVE STYLE calls
47
+ * that rung (nova 7/8, sera 9/10, mira 6/7, maia and luma 8/9, lyra and rhea
48
+ * 7/8, vega 8/9). Chips need no `ButtonGroup` variant: `items-stretch` gives
49
+ * the pill the height of its one definite-height child, the kebab.
50
+ */
51
+ size?: "sm" | "default";
52
+ disabled?: boolean;
53
+ readOnly?: boolean;
54
+ /**
55
+ * ONE VETO POINT for every change the BAR makes to the query, and only those.
56
+ * Return `false` to refuse; anything else commits, and `details.reason` names
57
+ * the action. One hook and not fourteen because every write goes through
58
+ * `emit`: the Delete key, Alt+Arrow and a drag alike. It can only refuse, and
59
+ * it sits BEHIND the lock, so a locked bar never asks it. Returning a
60
+ * REPLACEMENT tree was rejected: the announcement is already computed from
61
+ * the proposed tree, so the bar would say one thing and commit another.
62
+ */
63
+ onBeforeQueryChange?: (query: FilterQuery<V>, details: FilterChangeDetails<V, O>) => boolean | undefined;
64
+ /**
65
+ * Offers "Convert to advanced filter" in every chip's kebab; its presence IS
66
+ * the switch, since `variant` belongs to the consumer. Not drawn in advanced.
67
+ */
68
+ onConvertToAdvanced?: () => void;
69
+ /**
70
+ * Classes for the dropdown MENUS and the field PICKER panel, one prop each
71
+ * rather than one per mount point. Merged after the default, so `w-*` wins.
72
+ */
73
+ menuClassName?: string;
74
+ fieldPickerClassName?: string;
75
+ /**
76
+ * How a NESTED attribute path is shortened when too deep to read. `"none"` is
77
+ * the default, so an upgrade changes nothing under a consumer; the collapser
78
+ * is the cascader's, and the full path survives as the accessible NAME.
79
+ */
80
+ pathCollapse?: FilterPathCollapse;
81
+ /**
82
+ * How many names survive the collapse, the elided run not counted. Inert
83
+ * while `pathCollapse` is `"none"`. Three is the cascader's own default.
84
+ */
85
+ maxPathSegments?: number;
86
+ /** Replaces the default Add filter button. */
87
+ trigger?: React$1.ReactNode;
88
+ /** Renders a Clear button once the query holds anything. */
89
+ showClear?: boolean;
90
+ renderValue?: (context: FilterValueDisplayContext<V, O>) => React$1.ReactNode;
91
+ renderChip?: (rule: FilterRule<V>) => React$1.ReactNode;
92
+ /**
93
+ * Replaces the advanced builder's empty state, which exists at all because a
94
+ * builder with no rows is a footer floating in blank space. `null` for none.
95
+ */
96
+ renderEmpty?: (context: FilterEmptyStateContext) => React$1.ReactNode;
97
+ className?: string;
98
+ children?: React$1.ReactNode;
99
+ }
100
+ declare function Filters<V = unknown, O = unknown>({ fields, query: controlledQuery, defaultQuery, onQueryChange, labels: labelsProp, operatorLabels: operatorLabelsProp, editors: editorsProp, variant, advancedMode, advancedAlign, reorderable, size, disabled, readOnly, onBeforeQueryChange, onConvertToAdvanced, menuClassName, fieldPickerClassName, pathCollapse, maxPathSegments, trigger, showClear, renderValue, renderChip, renderEmpty, className, children }: FiltersProps<V, O>): React$1.JSX.Element;
101
+ interface FiltersRowProps {
102
+ trigger?: React$1.ReactNode;
103
+ showClear?: boolean;
104
+ className?: string;
105
+ }
106
+ /**
107
+ * The chip row: a toolbar with a roving tabindex, where the predecessor made
108
+ * every segment of every chip its own tab stop. There is NO combinator here,
109
+ * because a chip row can draw a word between two pills but not a parenthesis.
110
+ */
111
+ declare function FiltersRow({ trigger, showClear, className }: FiltersRowProps): React$1.JSX.Element;
112
+ //#endregion
113
+ export { type AnyFilterEditor, DEFAULT_FILTER_EDITORS, DEFAULT_FILTER_LABELS, DEFAULT_FILTER_OPERATORS, DEFAULT_FILTER_OPERATOR_LABELS, FilterAdvancedRow, type FilterArityResolver, type FilterChangeDetails, type FilterChangeReason, FilterChip, type FilterCombinator, type FilterCommitOptions, type FilterDraft, type FilterDraftStep, type FilterEditor, type FilterEditorHost, type FilterEditorProps, type FilterEditorRef, type FilterEditorRegistry, type FilterEmptyStateContext, type FilterField, FilterFieldPicker, type FilterGroupNode, type FilterIndex, type FilterIssue, type FilterIssueReason, type FilterLabels, type FilterLoadContext, type FilterLoadResult, type FilterNode, type FilterOperator, type FilterOperatorArity, FilterOperatorPopover, type FilterOption, type FilterOptionsState, type FilterQuery, type FilterRule, FilterRuleMenuItems, type FilterValidateContext, type FilterValidateResolver, type FilterValueDisplayContext, FilterValuePopover, type FilterValueType, Filters, FiltersAdvanced, FiltersAdvancedPanel, FiltersBuilder, FiltersProps, FiltersRow, FiltersRowProps, collectFilterIssues, copyFilterNodeTo, countFilterRules, createFilterGroup, createFilterQuery, createFilterRule, filterReadOnlyProps, flattenFilterConditions, flattenFilterRules, isFilterLocked, isFilterQueryEmpty, isFilterRuleComplete, moveFilterNodeTo, pruneFilterQuery, unwrapFilterGroup, useFilterActions, useFilterChipAutoOpen, useFilterChipFocused, useFilterFocus, useFilterFocusEmpty, useFilterFocusStore, useFilterOptions, useFilterRender, useFilterRuleDisplay, useFilterSegmentFocus, useFilterState, useFilterValueResolution, wrapFilterNodeInGroup };
114
+ //# sourceMappingURL=filters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.d.ts","names":[],"sources":["../../../../src/components/reui/filters/filters.tsx"],"mappings":";;;;;;;;;;;;UAqJiB,aAAa,aAAa;;EAEzC,QAAQ,YAAY,GAAG;EAEvB,QAAQ,YAAY;EACpB,eAAe,YAAY;EAC3B,iBAAiB,OAAO,YAAY,IAAI,SAAS,oBAAoB,GAAG;EAExE,SAAS,QAAQ;;EAEjB,iBAAiB;;EAEjB,UAAU;;;;;;EAOV;;EAEA;;;;;EAKA;;;;;;;EAOA;;;;;;;;EASA;EACA;EACA;;;;;;;;;;EAWA,uBACE,OAAO,YAAY,IACnB,SAAS,oBAAoB,GAAG;;;;;EAOlC;;;;;EAMA;EACA;;;;;;EAOA,eAAe;;;;;EAKf;;EAGA,UAAU,QAAM;;EAEhB;EAEA,eAAe,SAAS,0BAA0B,GAAG,OAAO,QAAM;EAClE,cAAc,MAAM,WAAW,OAAO,QAAM;;;;;EAK5C,eAAe,SAAS,4BAA4B,QAAM;EAE1D;EACA,WAAW,QAAM;;iBAGH,QAAQ,aAAa,eACnC,QACA,OAAO,iBACP,cACA,eACA,QAAQ,YACR,gBAAgB,oBAChB,SAAS,aACT,SACA,cACA,eACA,aACA,MACA,UACA,UACA,qBACA,qBACA,eACA,sBACA,cACA,iBACA,SACA,WACA,aACA,YACA,aACA,WACA,YACC,aAAa,GAAG,KAAE,QAAA,IAAA;UAwoBJ;EACf,UAAU,QAAM;EAChB;EACA;;;;;;;iBAQc,aAAa,SAAS,WAAW,aAAa,kBAAe,QAAA,IAAA"}