@elaraai/e3-ui 1.0.0

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 (53) hide show
  1. package/CLA.md +26 -0
  2. package/CONTRIBUTING.md +28 -0
  3. package/LICENSE.md +31 -0
  4. package/README.md +149 -0
  5. package/dist/src/buttons.d.ts +2 -0
  6. package/dist/src/buttons.d.ts.map +1 -0
  7. package/dist/src/buttons.js +2 -0
  8. package/dist/src/buttons.js.map +1 -0
  9. package/dist/src/data.d.ts +241 -0
  10. package/dist/src/data.d.ts.map +1 -0
  11. package/dist/src/data.js +195 -0
  12. package/dist/src/data.js.map +1 -0
  13. package/dist/src/derive.d.ts +33 -0
  14. package/dist/src/derive.d.ts.map +1 -0
  15. package/dist/src/derive.js +64 -0
  16. package/dist/src/derive.js.map +1 -0
  17. package/dist/src/diff.d.ts +335 -0
  18. package/dist/src/diff.d.ts.map +1 -0
  19. package/dist/src/diff.js +197 -0
  20. package/dist/src/diff.js.map +1 -0
  21. package/dist/src/index.d.ts +25 -0
  22. package/dist/src/index.d.ts.map +1 -0
  23. package/dist/src/index.js +25 -0
  24. package/dist/src/index.js.map +1 -0
  25. package/dist/src/manifest.d.ts +27 -0
  26. package/dist/src/manifest.d.ts.map +1 -0
  27. package/dist/src/manifest.js +29 -0
  28. package/dist/src/manifest.js.map +1 -0
  29. package/dist/src/ontology.d.ts +517 -0
  30. package/dist/src/ontology.d.ts.map +1 -0
  31. package/dist/src/ontology.js +311 -0
  32. package/dist/src/ontology.js.map +1 -0
  33. package/dist/src/ui.d.ts +57 -0
  34. package/dist/src/ui.d.ts.map +1 -0
  35. package/dist/src/ui.js +72 -0
  36. package/dist/src/ui.js.map +1 -0
  37. package/dist/src/utils.d.ts +21 -0
  38. package/dist/src/utils.d.ts.map +1 -0
  39. package/dist/src/utils.js +24 -0
  40. package/dist/src/utils.js.map +1 -0
  41. package/dist/test/data.examples.d.ts +20 -0
  42. package/dist/test/data.examples.d.ts.map +1 -0
  43. package/dist/test/data.examples.js +156 -0
  44. package/dist/test/data.examples.js.map +1 -0
  45. package/dist/test/diff.examples.d.ts +138 -0
  46. package/dist/test/diff.examples.d.ts.map +1 -0
  47. package/dist/test/diff.examples.js +964 -0
  48. package/dist/test/diff.examples.js.map +1 -0
  49. package/dist/test/ontology.examples.d.ts +412 -0
  50. package/dist/test/ontology.examples.d.ts.map +1 -0
  51. package/dist/test/ontology.examples.js +298 -0
  52. package/dist/test/ontology.examples.js.map +1 -0
  53. package/package.json +80 -0
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Diff component — transactional review of pending changes for any
7
+ * combination of {@link Data.bind} bindings.
8
+ *
9
+ * @remarks
10
+ * The Diff card surfaces the in-flight change for each binding the caller
11
+ * lists in `bindings`. Per-leaf Discard, per-group Discard-all, and a
12
+ * footer Apply button drive the binding's commit flow. Conflicts surface
13
+ * inline as orange chooser rows (staged-mode 3-way drift) and as orange
14
+ * "stale" warning badges (drift between a patch dataset's expectations
15
+ * and the current source).
16
+ *
17
+ * Declared via the `EastUI.component` extension API — the React renderer
18
+ * lives in `@elaraai/e3-ui-components` and is wired via
19
+ * `implementUIComponent(DiffComponent, EastChakraDiff)` at module load
20
+ * time.
21
+ *
22
+ * @packageDocumentation
23
+ */
24
+ import { East, StringType, BooleanType, NullType, IntegerType, StructType, OptionType, ArrayType, FunctionType, none, some, variant, } from "@elaraai/east";
25
+ import { EastUI, DensityType } from "@elaraai/east-ui";
26
+ import { DiffBindingType } from "./data.js";
27
+ // ============================================================================
28
+ // Sub-types — visual style escape hatches.
29
+ // ============================================================================
30
+ /**
31
+ * Visual style escape hatches for the Diff component. Every visible surface
32
+ * is tokenable; defaults come from the host's Chakra theme (Elara AI brand).
33
+ *
34
+ * @property addedBackground - Soft-tint background for added / inserted leaves.
35
+ * @property addedColor - Foreground for added leaves.
36
+ * @property addedBorderColor - Border for added chips.
37
+ * @property removedBackground - Soft-tint background for removed / deleted leaves.
38
+ * @property removedColor - Foreground for removed leaves.
39
+ * @property removedBorderColor - Border for removed chips.
40
+ * @property changedBackground - Soft-tint background for updated leaves.
41
+ * @property changedColor - Foreground for updated leaves.
42
+ * @property changedBorderColor - Border for updated chips.
43
+ * @property unchangedColor - Foreground for unchanged rows when shown.
44
+ * @property acceptedBackground - Lane background for accepted-row indicator.
45
+ * @property acceptedBorderColor - Left-edge accent stripe for accepted rows.
46
+ * @property rejectedBackground - Lane background for rejected rows.
47
+ * @property rejectedBorderColor - Border for rejected rows.
48
+ * @property headerBackground - Card header background.
49
+ * @property summaryBackground - Stats bar background.
50
+ * @property background - Card body background.
51
+ * @property borderColor - Card outer border.
52
+ * @property indentGuideColor - Vertical guide line for nested rows.
53
+ * @property lineNumberColor - Gutter line numbers in unified mode.
54
+ */
55
+ export const DiffStyleType = StructType({
56
+ addedBackground: OptionType(StringType),
57
+ addedColor: OptionType(StringType),
58
+ addedBorderColor: OptionType(StringType),
59
+ removedBackground: OptionType(StringType),
60
+ removedColor: OptionType(StringType),
61
+ removedBorderColor: OptionType(StringType),
62
+ changedBackground: OptionType(StringType),
63
+ changedColor: OptionType(StringType),
64
+ changedBorderColor: OptionType(StringType),
65
+ unchangedColor: OptionType(StringType),
66
+ acceptedBackground: OptionType(StringType),
67
+ acceptedBorderColor: OptionType(StringType),
68
+ rejectedBackground: OptionType(StringType),
69
+ rejectedBorderColor: OptionType(StringType),
70
+ headerBackground: OptionType(StringType),
71
+ summaryBackground: OptionType(StringType),
72
+ background: OptionType(StringType),
73
+ borderColor: OptionType(StringType),
74
+ indentGuideColor: OptionType(StringType),
75
+ lineNumberColor: OptionType(StringType),
76
+ });
77
+ // ============================================================================
78
+ // Re-export the binding descriptor — it lives in `data.ts` to keep the
79
+ // dependency direction one-way (Diff consumes; Data produces).
80
+ // ============================================================================
81
+ export { DiffBindingType } from "./data.js";
82
+ // ============================================================================
83
+ // Diff payload — IR shape consumed by the renderer.
84
+ // ============================================================================
85
+ /**
86
+ * Schema for the `Diff` extension component. Internal IR shape — the
87
+ * developer-facing factory `Diff.Root` accepts {@link DataBindHandleType}
88
+ * descriptors and forwards them as `bindings`.
89
+ *
90
+ * @property bindings - The set of bindings to surface in the card. Each
91
+ * entry is a {@link DiffBindingType} value (typically obtained via the
92
+ * `binding` field of a {@link Data.bind} handle).
93
+ * @property readonly - Render the Diff without per-leaf or per-group Discard
94
+ * buttons. The footer Apply / Discard-all still render. Default `false`
95
+ * (interactive review).
96
+ * @property hideUnchanged - Elide unchanged rows. None ⇒ false.
97
+ * @property maxDepth - Cap nesting depth before "Show more" collapses. None ⇒ no cap.
98
+ * @property density - Information-density preset (`comfortable` | `compact`
99
+ * | `condensed`). Defaults to `comfortable`.
100
+ * @property onCommitted - Fired after a successful commit (post-merge).
101
+ * @property onDiscarded - Fired after a successful discard.
102
+ * @property style - Visual style escape hatches.
103
+ */
104
+ export const DiffPayloadType = StructType({
105
+ bindings: ArrayType(DiffBindingType),
106
+ readonly: OptionType(BooleanType),
107
+ hideUnchanged: OptionType(BooleanType),
108
+ maxDepth: OptionType(IntegerType),
109
+ density: OptionType(DensityType),
110
+ onCommitted: OptionType(FunctionType([], NullType)),
111
+ onDiscarded: OptionType(FunctionType([], NullType)),
112
+ style: OptionType(DiffStyleType),
113
+ });
114
+ /**
115
+ * Internal `EastUI.component` carrier. Renderers register against this in
116
+ * `@elaraai/e3-ui-components`. Most callers should use {@link Diff.Root}
117
+ * (which wraps this with the handle-friendly API) rather than touching
118
+ * `DiffComponent` directly.
119
+ */
120
+ export const DiffComponent = EastUI.component("Diff", DiffPayloadType, { optional: true });
121
+ /**
122
+ * The Diff component namespace. Surfaces transactional pending edits for
123
+ * review and commit, with merge-aware conflict resolution and stale-patch
124
+ * drift detection.
125
+ *
126
+ * @remarks
127
+ * Use `Diff.Root({ bindings: [view.binding, ...] })` to render the panel.
128
+ * The `Component` property is the internal {@link EastUI.component}
129
+ * carrier that renderers register against — most callers shouldn't need
130
+ * it.
131
+ */
132
+ export const Diff = {
133
+ /**
134
+ * Build a Diff component. Surfaces every binding's in-flight change in
135
+ * a single review card, with per-leaf accept / reject and a footer
136
+ * Apply that runs the right commit per binding.
137
+ *
138
+ * @param options - {@link DiffOptions}. Only `bindings` is required;
139
+ * the rest default to absent / interactive.
140
+ * @returns An East expression of {@link UIComponentType} representing
141
+ * the Diff panel.
142
+ *
143
+ * @remarks
144
+ * The renderer reads each binding's IR descriptor (`source`, optional
145
+ * `patch`, `mode`), looks up the runtime types in the binding
146
+ * registry, and derives the in-flight change to display. Apply's
147
+ * commit code path depends on the binding's mode and patch presence —
148
+ * staged + no patch applies the buffer to source; staged + patch
149
+ * publishes the buffer as a fresh patch to the patch dataset; direct
150
+ * + patch applies the existing patch dataset to the source. Discard
151
+ * always drops the in-flight change in place.
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * import { East, FloatType } from "@elaraai/east";
156
+ * import { Reactive, UIComponentType } from "@elaraai/east-ui";
157
+ * import { Data, Diff } from "@elaraai/e3-ui";
158
+ * import * as e3 from "@elaraai/e3";
159
+ *
160
+ * const maxWeeklyHoursInput = e3.input("max_weekly_hours", FloatType, 38.0);
161
+ *
162
+ * // Mirrors `diffDefaults` in test/diff.examples.ts (wired via Assert.examples).
163
+ * const diffDefaults = East.function([], UIComponentType, _$ => {
164
+ * return Reactive.Root(East.function([], UIComponentType, $ => {
165
+ * const view = $.let(Data.bind([FloatType], maxWeeklyHoursInput.path));
166
+ * return Diff.Root({ bindings: [view.binding] });
167
+ * }));
168
+ * });
169
+ * ```
170
+ */
171
+ Root(options) {
172
+ const density = options.density === undefined
173
+ ? none
174
+ : typeof options.density === "string"
175
+ ? some(East.value(variant(options.density, null), DensityType))
176
+ : options.density;
177
+ return DiffComponent.Root({
178
+ bindings: options.bindings,
179
+ readonly: options.readonly ?? none,
180
+ hideUnchanged: options.hideUnchanged ?? none,
181
+ maxDepth: options.maxDepth ?? none,
182
+ density,
183
+ onCommitted: options.onCommitted ?? none,
184
+ onDiscarded: options.onDiscarded ?? none,
185
+ style: options.style ?? none,
186
+ });
187
+ },
188
+ /**
189
+ * The internal {@link EastUI.component} carrier. Renderers register
190
+ * against this in `@elaraai/e3-ui-components` via
191
+ * `implementUIComponent(Diff.Component, EastChakraDiff)`. Most callers
192
+ * should use {@link Diff.Root} (the handle-friendly factory) and never
193
+ * touch this directly.
194
+ */
195
+ Component: DiffComponent,
196
+ };
197
+ //# sourceMappingURL=diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/diff.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACH,IAAI,EACJ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,OAAO,GAGV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,WAAW,EAA6C,MAAM,kBAAkB,CAAC;AAElG,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,+EAA+E;AAC/E,2CAA2C;AAC3C,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACpC,eAAe,EAAM,UAAU,CAAC,UAAU,CAAC;IAC3C,UAAU,EAAW,UAAU,CAAC,UAAU,CAAC;IAC3C,gBAAgB,EAAK,UAAU,CAAC,UAAU,CAAC;IAC3C,iBAAiB,EAAI,UAAU,CAAC,UAAU,CAAC;IAC3C,YAAY,EAAS,UAAU,CAAC,UAAU,CAAC;IAC3C,kBAAkB,EAAG,UAAU,CAAC,UAAU,CAAC;IAC3C,iBAAiB,EAAI,UAAU,CAAC,UAAU,CAAC;IAC3C,YAAY,EAAS,UAA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safe).
7
+ *
8
+ * Provides:
9
+ * - `Data.bind` — workspace-scoped reactive dataset binding.
10
+ * - `Diff` — review pending changes for any combination of bindings.
11
+ * - `Ontology` — graph editor over an `OntologyType`-bound dataset.
12
+ * - `DataManifestType` — manifest type for reads/writes metadata.
13
+ *
14
+ * The author-side `ui()` factory lives at `@elaraai/e3-ui/ui` because it
15
+ * pulls in `@elaraai/e3` (which depends on Node-only modules like yazl).
16
+ * Separating it keeps this entry tree-shakeable for browser bundles.
17
+ *
18
+ * @packageDocumentation
19
+ */
20
+ export { Data, DataBindModeType, type DataBindModeLiteral, DiffBindingType, DataBindHandleType, type DataBindOptions, bindPlatformFn, } from './data.js';
21
+ export { DataManifestType, type DataManifest, encodeManifest, decodeManifest } from './manifest.js';
22
+ export { deriveManifest } from './derive.js';
23
+ export { Diff, DiffComponent, DiffPayloadType, DiffStyleType, type DiffOptions, } from './diff.js';
24
+ export { Ontology, OntologyComponent, OntologyPayloadType, OntologyStyleType, type OntologyOptions, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, } from './ontology.js';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACH,IAAI,EACJ,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,eAAe,EACf,kBAAkB,EAClB,KAAK,eAAe,EACpB,cAAc,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACH,IAAI,EACJ,aAAa,EACb,eAAe,EACf,aAAa,EACb,KAAK,WAAW,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,eAAe,EACpB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,YAAY,GACf,MAAM,eAAe,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * @elaraai/e3-ui — e3 + UI bridge (render-side, browser-safe).
7
+ *
8
+ * Provides:
9
+ * - `Data.bind` — workspace-scoped reactive dataset binding.
10
+ * - `Diff` — review pending changes for any combination of bindings.
11
+ * - `Ontology` — graph editor over an `OntologyType`-bound dataset.
12
+ * - `DataManifestType` — manifest type for reads/writes metadata.
13
+ *
14
+ * The author-side `ui()` factory lives at `@elaraai/e3-ui/ui` because it
15
+ * pulls in `@elaraai/e3` (which depends on Node-only modules like yazl).
16
+ * Separating it keeps this entry tree-shakeable for browser bundles.
17
+ *
18
+ * @packageDocumentation
19
+ */
20
+ export { Data, DataBindModeType, DiffBindingType, DataBindHandleType, bindPlatformFn, } from './data.js';
21
+ export { DataManifestType, encodeManifest, decodeManifest } from './manifest.js';
22
+ export { deriveManifest } from './derive.js';
23
+ export { Diff, DiffComponent, DiffPayloadType, DiffStyleType, } from './diff.js';
24
+ export { Ontology, OntologyComponent, OntologyPayloadType, OntologyStyleType, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, } from './ontology.js';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACH,IAAI,EACJ,gBAAgB,EAEhB,eAAe,EACf,kBAAkB,EAElB,cAAc,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAqB,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACH,IAAI,EACJ,aAAa,EACb,eAAe,EACf,aAAa,GAEhB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EAEjB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,YAAY,GACf,MAAM,eAAe,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Data manifest for UI tasks — declares which datasets a UI binds to via
7
+ * `Data.bind()`. Stored as a beast2-encoded blob in the task's `metadata`.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+ import { StructType, ArrayType, type ValueTypeOf } from '@elaraai/east';
12
+ /**
13
+ * East type for the UI binding manifest.
14
+ *
15
+ * @property paths - Dataset paths this UI accesses (read or write) via Data.bind.
16
+ */
17
+ export declare const DataManifestType: StructType<{
18
+ readonly paths: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
19
+ readonly field: import("@elaraai/east").StringType;
20
+ }>>>;
21
+ }>;
22
+ export type DataManifest = ValueTypeOf<typeof DataManifestType>;
23
+ /** Encode a manifest to beast2 bytes for storage in task metadata. */
24
+ export declare function encodeManifest(manifest: DataManifest): Uint8Array;
25
+ /** Decode a manifest from beast2 bytes. */
26
+ export declare function decodeManifest(blob: Uint8Array): DataManifest;
27
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/manifest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAoC,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG1G;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;EAE3B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,YAAY,GAAG,UAAU,CAEjE;AAED,2CAA2C;AAC3C,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAE7D"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Data manifest for UI tasks — declares which datasets a UI binds to via
7
+ * `Data.bind()`. Stored as a beast2-encoded blob in the task's `metadata`.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+ import { StructType, ArrayType, encodeBeast2For, decodeBeast2For } from '@elaraai/east';
12
+ import { TreePathType } from '@elaraai/e3-types';
13
+ /**
14
+ * East type for the UI binding manifest.
15
+ *
16
+ * @property paths - Dataset paths this UI accesses (read or write) via Data.bind.
17
+ */
18
+ export const DataManifestType = StructType({
19
+ paths: ArrayType(TreePathType),
20
+ });
21
+ /** Encode a manifest to beast2 bytes for storage in task metadata. */
22
+ export function encodeManifest(manifest) {
23
+ return encodeBeast2For(DataManifestType)(manifest);
24
+ }
25
+ /** Decode a manifest from beast2 bytes. */
26
+ export function decodeManifest(blob) {
27
+ return decodeBeast2For(DataManifestType)(blob);
28
+ }
29
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/manifest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAoB,MAAM,eAAe,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,KAAK,EAAE,SAAS,CAAC,YAAY,CAAC;CAC/B,CAAC,CAAC;AAIH,sEAAsE;AACtE,MAAM,UAAU,cAAc,CAAC,QAAsB;IACnD,OAAO,eAAe,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,cAAc,CAAC,IAAgB;IAC7C,OAAO,eAAe,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC"}