storion 0.8.3 → 0.10.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 (77) hide show
  1. package/CHANGELOG.md +127 -21
  2. package/README.md +42 -2021
  3. package/dist/async/abortable.d.ts +295 -0
  4. package/dist/async/abortable.d.ts.map +1 -0
  5. package/dist/async/async.d.ts +86 -5
  6. package/dist/async/async.d.ts.map +1 -1
  7. package/dist/async/context.d.ts +15 -0
  8. package/dist/async/context.d.ts.map +1 -0
  9. package/dist/async/index.d.ts +16 -3
  10. package/dist/async/index.d.ts.map +1 -1
  11. package/dist/async/index.js +407 -137
  12. package/dist/async/safe.d.ts +221 -0
  13. package/dist/async/safe.d.ts.map +1 -0
  14. package/dist/async/types.d.ts +77 -29
  15. package/dist/async/types.d.ts.map +1 -1
  16. package/dist/async/wrappers.d.ts +217 -0
  17. package/dist/async/wrappers.d.ts.map +1 -0
  18. package/dist/core/effect.d.ts +34 -26
  19. package/dist/core/effect.d.ts.map +1 -1
  20. package/dist/core/equality.d.ts +25 -0
  21. package/dist/core/equality.d.ts.map +1 -1
  22. package/dist/core/focus.d.ts +20 -0
  23. package/dist/core/focus.d.ts.map +1 -0
  24. package/dist/core/focusHelpers.d.ts +258 -0
  25. package/dist/core/focusHelpers.d.ts.map +1 -0
  26. package/dist/core/middleware.d.ts +4 -4
  27. package/dist/core/store.d.ts.map +1 -1
  28. package/dist/core/storeContext.d.ts +2 -9
  29. package/dist/core/storeContext.d.ts.map +1 -1
  30. package/dist/dev.d.ts +0 -10
  31. package/dist/dev.d.ts.map +1 -1
  32. package/dist/{index-C8B6Mo8r.js → effect-BDQU8Voz.js} +1241 -583
  33. package/dist/errors.d.ts +6 -0
  34. package/dist/errors.d.ts.map +1 -1
  35. package/dist/index.d.ts +5 -4
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/network/index.d.ts +69 -0
  38. package/dist/network/index.d.ts.map +1 -0
  39. package/dist/network/retry.d.ts +53 -0
  40. package/dist/network/retry.d.ts.map +1 -0
  41. package/dist/network/services.d.ts +58 -0
  42. package/dist/network/services.d.ts.map +1 -0
  43. package/dist/network/store.d.ts +36 -0
  44. package/dist/network/store.d.ts.map +1 -0
  45. package/dist/network/utils.d.ts +9 -0
  46. package/dist/network/utils.d.ts.map +1 -0
  47. package/dist/persist/index.d.ts +1 -1
  48. package/dist/persist/index.d.ts.map +1 -1
  49. package/dist/persist/index.js +55 -31
  50. package/dist/persist/persist.d.ts +119 -62
  51. package/dist/persist/persist.d.ts.map +1 -1
  52. package/dist/pool.d.ts +77 -0
  53. package/dist/pool.d.ts.map +1 -0
  54. package/dist/react/index.d.ts +2 -2
  55. package/dist/react/index.d.ts.map +1 -1
  56. package/dist/react/index.js +245 -244
  57. package/dist/react/stable.d.ts +27 -0
  58. package/dist/react/stable.d.ts.map +1 -0
  59. package/dist/react/useStore.d.ts +38 -13
  60. package/dist/react/useStore.d.ts.map +1 -1
  61. package/dist/react/withStore.d.ts.map +1 -1
  62. package/dist/storion.js +911 -37
  63. package/dist/trigger.d.ts +12 -7
  64. package/dist/trigger.d.ts.map +1 -1
  65. package/dist/types.d.ts +133 -22
  66. package/dist/types.d.ts.map +1 -1
  67. package/dist/utils/storeTuple.d.ts +7 -0
  68. package/dist/utils/storeTuple.d.ts.map +1 -0
  69. package/package.json +5 -1
  70. package/dist/collection.d.ts +0 -34
  71. package/dist/collection.d.ts.map +0 -1
  72. package/dist/core/proxy.d.ts +0 -47
  73. package/dist/core/proxy.d.ts.map +0 -1
  74. package/dist/effect-C6h0PDDI.js +0 -446
  75. package/dist/isPromiseLike-bFkfHAbm.js +0 -6
  76. package/dist/react/useLocalStore.d.ts +0 -48
  77. package/dist/react/useLocalStore.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { StoreMiddleware, StoreMiddlewareContext } from '../types';
1
+ import { StoreMiddleware, StoreMiddlewareContext, StoreInstance } from '../types';
2
2
 
3
3
  /**
4
4
  * Mark stores or fields as not persisted.
@@ -27,8 +27,8 @@ import { StoreMiddleware, StoreMiddlewareContext } from '../types';
27
27
  * state: { name: '', password: '', token: '' },
28
28
  * setup: () => ({}),
29
29
  * meta: [
30
- * notPersisted('password'),
31
- * notPersisted('token'),
30
+ * notPersisted.for('password'),
31
+ * notPersisted.for('token'),
32
32
  * ],
33
33
  * });
34
34
  * ```
@@ -38,6 +38,33 @@ export declare const notPersisted: import('..').MetaType<any, [], true>;
38
38
  * Result from load function - can be sync or async
39
39
  */
40
40
  export type PersistLoadResult = Record<string, unknown> | null | undefined | Promise<Record<string, unknown> | null | undefined>;
41
+ /**
42
+ * Context passed to the handler function.
43
+ * Extends StoreMiddlewareContext with the created store instance.
44
+ */
45
+ export interface PersistContext extends StoreMiddlewareContext {
46
+ /** The store instance being persisted */
47
+ store: StoreInstance;
48
+ }
49
+ /**
50
+ * Handler returned by the handler function.
51
+ * Contains the load and save operations for a specific store.
52
+ */
53
+ export interface PersistHandler {
54
+ /**
55
+ * Load persisted state for the store.
56
+ * Can return sync or async result.
57
+ *
58
+ * @returns The persisted state, null/undefined if not found, or a Promise
59
+ */
60
+ load?: () => PersistLoadResult;
61
+ /**
62
+ * Save state to persistent storage.
63
+ *
64
+ * @param state - The dehydrated state to save
65
+ */
66
+ save?: (state: Record<string, unknown>) => void;
67
+ }
41
68
  /**
42
69
  * Options for persist middleware
43
70
  */
@@ -46,41 +73,56 @@ export interface PersistOptions {
46
73
  * Filter which stores should be persisted.
47
74
  * If not provided, all stores are persisted.
48
75
  *
49
- * @param context - The middleware context
76
+ * @param context - The persist context with store instance
50
77
  * @returns true to persist, false to skip
51
78
  */
52
- filter?: (context: StoreMiddlewareContext) => boolean;
79
+ filter?: (context: PersistContext) => boolean;
53
80
  /**
54
81
  * Filter which fields should be persisted.
55
82
  * If not provided, all fields are persisted.
56
83
  *
57
- * @param context - The middleware context
84
+ * @param context - The persist context with store instance
58
85
  * @returns the fields to persist
59
86
  */
60
- fields?: (context: StoreMiddlewareContext) => string[];
87
+ fields?: (context: PersistContext) => string[];
61
88
  /**
62
- * Load persisted state for a store.
63
- * Can return sync or async result.
89
+ * Handler factory that creates load/save operations for each store.
90
+ * Receives context with store instance, returns handler with load/save.
91
+ * Can be sync or async (e.g., for IndexedDB initialization).
64
92
  *
65
- * @param context - The middleware context
66
- * @returns The persisted state, null/undefined if not found, or a Promise
67
- */
68
- load?: (context: StoreMiddlewareContext) => PersistLoadResult;
69
- /**
70
- * Save state to persistent storage.
93
+ * @param context - The persist context with store instance
94
+ * @returns Handler with load/save operations, or Promise of handler
71
95
  *
72
- * @param context - The middleware context
73
- * @param state - The dehydrated state to save
96
+ * @example Sync handler (localStorage)
97
+ * ```ts
98
+ * handler: (ctx) => {
99
+ * const key = `app:${ctx.displayName}`;
100
+ * return {
101
+ * load: () => JSON.parse(localStorage.getItem(key) || 'null'),
102
+ * save: (state) => localStorage.setItem(key, JSON.stringify(state)),
103
+ * };
104
+ * }
105
+ * ```
106
+ *
107
+ * @example Async handler (IndexedDB)
108
+ * ```ts
109
+ * handler: async (ctx) => {
110
+ * const db = await openDB('app-db');
111
+ * return {
112
+ * load: () => db.get('stores', ctx.displayName),
113
+ * save: (state) => db.put('stores', state, ctx.displayName),
114
+ * };
115
+ * }
116
+ * ```
74
117
  */
75
- save?: (context: StoreMiddlewareContext, state: Record<string, unknown>) => void;
118
+ handler: (context: PersistContext) => PersistHandler | PromiseLike<PersistHandler>;
76
119
  /**
77
- * Called when an error occurs during load or save.
120
+ * Called when an error occurs during init, load, or save.
78
121
  *
79
- * @param context - The middleware context
80
122
  * @param error - The error that occurred
81
- * @param operation - Whether the error occurred during 'load' or 'save'
123
+ * @param operation - Whether the error occurred during 'init', 'load', or 'save'
82
124
  */
83
- onError?: (context: StoreMiddlewareContext, error: unknown, operation: "load" | "save") => void;
125
+ onError?: (error: unknown, operation: "init" | "load" | "save") => void;
84
126
  /**
85
127
  * Force hydration to overwrite dirty (modified) state properties.
86
128
  *
@@ -96,62 +138,77 @@ export interface PersistOptions {
96
138
  /**
97
139
  * Creates a persist middleware that automatically saves and restores store state.
98
140
  *
99
- * @example
141
+ * @example localStorage (sync handler)
100
142
  * ```ts
101
- * import { container } from "storion";
102
- * import { persistMiddleware } from "storion/persist";
143
+ * import { container, forStores } from "storion";
144
+ * import { persist } from "storion/persist";
103
145
  *
104
146
  * const app = container({
105
- * middleware: [persistMiddleware({
106
- * load: (ctx) => {
107
- * const key = `storion:${ctx.spec.displayName}`;
108
- * const data = localStorage.getItem(key);
109
- * return data ? JSON.parse(data) : null;
110
- * },
111
- * save: (ctx, state) => {
112
- * const key = `storion:${ctx.spec.displayName}`;
113
- * localStorage.setItem(key, JSON.stringify(state));
114
- * },
115
- * onError: (ctx, error, op) => {
116
- * console.error(`Persist ${op} error for ${ctx.spec.displayName}:`, error);
117
- * },
118
- * })],
147
+ * middleware: forStores([
148
+ * persist({
149
+ * handler: (ctx) => {
150
+ * const key = `app:${ctx.displayName}`;
151
+ * return {
152
+ * load: () => JSON.parse(localStorage.getItem(key) || 'null'),
153
+ * save: (state) => localStorage.setItem(key, JSON.stringify(state)),
154
+ * };
155
+ * },
156
+ * onError: (error, op) => console.error(`Persist ${op} failed:`, error),
157
+ * }),
158
+ * ]),
119
159
  * });
120
160
  * ```
121
161
  *
122
- * @example Async load (e.g., IndexedDB)
162
+ * @example IndexedDB (async handler)
123
163
  * ```ts
124
- * persistMiddleware({
125
- * load: async (ctx) => {
126
- * const db = await openDB();
127
- * return db.get('stores', ctx.spec.displayName);
128
- * },
129
- * save: (ctx, state) => {
130
- * openDB().then(db => db.put('stores', state, ctx.spec.displayName));
164
+ * persist({
165
+ * handler: async (ctx) => {
166
+ * const db = await openDB('app-db', 1, {
167
+ * upgrade(db) { db.createObjectStore('stores'); },
168
+ * });
169
+ * return {
170
+ * load: () => db.get('stores', ctx.displayName),
171
+ * save: (state) => db.put('stores', state, ctx.displayName),
172
+ * };
131
173
  * },
132
174
  * });
133
175
  * ```
134
176
  *
135
- * @example Using meta in callbacks
177
+ * @example With shared debounce
136
178
  * ```ts
137
- * import { meta } from "storion";
179
+ * persist({
180
+ * handler: (ctx) => {
181
+ * const key = `app:${ctx.displayName}`;
182
+ * const debouncedSave = debounce(
183
+ * (s) => localStorage.setItem(key, JSON.stringify(s)),
184
+ * 300
185
+ * );
186
+ * return {
187
+ * load: () => JSON.parse(localStorage.getItem(key) || 'null'),
188
+ * save: debouncedSave,
189
+ * };
190
+ * },
191
+ * });
192
+ * ```
138
193
  *
139
- * const persistKey = meta<string>();
194
+ * @example Multi-storage with meta
195
+ * ```ts
196
+ * const inSession = meta();
197
+ * const inLocal = meta();
140
198
  *
141
- * persistMiddleware({
142
- * load: (ctx) => {
143
- * // Use custom key from meta, fallback to displayName
144
- * const customKey = ctx.meta(persistKey).store;
145
- * const key = customKey ?? ctx.spec.displayName;
146
- * return JSON.parse(localStorage.getItem(key) || 'null');
147
- * },
148
- * save: (ctx, state) => {
149
- * const customKey = ctx.meta(persistKey).store;
150
- * const key = customKey ?? ctx.spec.displayName;
151
- * localStorage.setItem(key, JSON.stringify(state));
199
+ * // Session storage middleware
200
+ * persist({
201
+ * filter: ({ meta }) => meta.any(inSession),
202
+ * fields: ({ meta }) => meta.fields(inSession),
203
+ * handler: (ctx) => {
204
+ * const key = `session:${ctx.displayName}`;
205
+ * return {
206
+ * load: () => JSON.parse(sessionStorage.getItem(key) || 'null'),
207
+ * save: (state) => sessionStorage.setItem(key, JSON.stringify(state)),
208
+ * };
152
209
  * },
153
210
  * });
154
211
  * ```
155
212
  */
156
- export declare function persistMiddleware(options: PersistOptions): StoreMiddleware;
213
+ export declare function persist(options: PersistOptions): StoreMiddleware;
157
214
  //# sourceMappingURL=persist.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../src/persist/persist.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIxE;;;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;;;;;;GA0EG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,eAAe,CAmJhE"}
package/dist/pool.d.ts ADDED
@@ -0,0 +1,77 @@
1
+ import { AutoDisposeOptions, Equality } from './types';
2
+
3
+ /**
4
+ * A lazy-instantiation Map with factory function.
5
+ * Items are created on-demand via `get()`.
6
+ */
7
+ export interface Pool<TKey, TValue> {
8
+ (key: TKey): TValue;
9
+ /** Call callback if key exists (does NOT create item). Chainable. */
10
+ tap(key: TKey, callback: (item: TValue) => void): this;
11
+ /** Check if key exists (does NOT create item). */
12
+ has(key: TKey): boolean;
13
+ /** Get item by key, creating it via factory if it doesn't exist. */
14
+ get(key: TKey): TValue;
15
+ /** Explicitly set an item. Chainable. */
16
+ set(key: TKey, value: TValue): this;
17
+ /** Number of items in the pool. */
18
+ size(): number;
19
+ /** Remove all items. Calls dispose if autoDispose enabled. Chainable. */
20
+ clear(): this;
21
+ /** Remove item by key. Calls dispose if autoDispose enabled. Chainable. */
22
+ delete(key: TKey): this;
23
+ /** Iterate over keys. */
24
+ keys(): IterableIterator<TKey>;
25
+ /** Iterate over values. */
26
+ values(): IterableIterator<TValue>;
27
+ /** Iterate over [key, value] pairs. */
28
+ entries(): IterableIterator<[TKey, TValue]>;
29
+ }
30
+ export interface PoolOptions<TKey, TValue> {
31
+ initial?: readonly [TKey, TValue][];
32
+ /**
33
+ * Custom equality function for keys (O(n) lookup).
34
+ * For better performance, use `keyOf` instead.
35
+ */
36
+ equality?: Equality<TKey>;
37
+ /**
38
+ * Hash function to normalize keys (O(1) lookup).
39
+ * Converts complex keys to a hashable string/number.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * // Object keys hashed by id
44
+ * pool(createUser, { keyOf: (user) => user.id })
45
+ *
46
+ * // Array keys hashed by JSON
47
+ * pool(createItem, { keyOf: JSON.stringify })
48
+ * ```
49
+ */
50
+ keyOf?: (key: TKey) => string | number;
51
+ /**
52
+ * Automatically call dispose method of the item when it is removed from the pool.
53
+ */
54
+ autoDispose?: AutoDisposeOptions | boolean;
55
+ }
56
+ /**
57
+ * Lazy-instantiation Map wrapper.
58
+ *
59
+ * Creates items on first access via `get()`. Useful for managing
60
+ * pools where items should be created on-demand.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * // Create a pool of emitters, one per property key
65
+ * const emitters = pool((key: string) => emitter<void>());
66
+ *
67
+ * // First access creates the emitter
68
+ * const countEmitter = emitters.get("count"); // creates new emitter
69
+ * const countEmitter2 = emitters.get("count"); // returns same emitter
70
+ * ```
71
+ *
72
+ * @param createItem - Factory function to create new items
73
+ * @param optionsOrInitial - Optional options or initial entries
74
+ * @returns A Map-like object with lazy instantiation on `get()`
75
+ */
76
+ export declare function pool<TValue, TKey = unknown>(createItem: (key: TKey) => TValue, optionsOrInitial?: PoolOptions<TKey, TValue> | readonly [TKey, TValue][]): Pool<TKey, TValue>;
77
+ //# sourceMappingURL=pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,IAAI,CAAC,IAAI,EAAE,MAAM;IAChC,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,qEAAqE;IACrE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;IACvD,kDAAkD;IAClD,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC;IACxB,oEAAoE;IACpE,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;IACvB,yCAAyC;IACzC,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,mCAAmC;IACnC,IAAI,IAAI,MAAM,CAAC;IACf,yEAAyE;IACzE,KAAK,IAAI,IAAI,CAAC;IACd,2EAA2E;IAC3E,MAAM,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,yBAAyB;IACzB,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC/B,2BAA2B;IAC3B,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACnC,uCAAuC;IACvC,OAAO,IAAI,gBAAgB,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,MAAM;IACvC,OAAO,CAAC,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC1B;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,MAAM,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,EACzC,UAAU,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,MAAM,EACjC,gBAAgB,CAAC,EAAE,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,GACvE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CA6LpB"}
@@ -5,8 +5,8 @@
5
5
  */
6
6
  export { StoreProvider, useContainer } from './context';
7
7
  export { useStore } from './useStore';
8
- export { type LocalStoreResult } from './useLocalStore';
9
- export { withStore, createWithStore, type WithStoreHook, type WithStoreRender, type WithStoreRenderWithRef, type WithStoreOptions, type BoundWithStore, type GenericWithStoreHook, type UseContextHook, } from './withStore';
8
+ export { withStore, type WithStoreHook, type WithStoreRender, type WithStoreRenderWithRef, type WithStoreOptions, type BoundWithStore, type GenericWithStoreHook, type UseContextHook, } from './withStore';
10
9
  export { create, type CreateSelector, type UseCreatedStore, type CreateResult, type CreatedStoreContext, type WithCreatedStore, } from './create';
10
+ export { stable, type PropEqualityConfig } from './stable';
11
11
  export * from '../index';
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,SAAS,EACT,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,MAAM,EACN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAGlB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,MAAM,EACN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,MAAM,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG3D,cAAc,UAAU,CAAC"}