flowquery 1.0.5 → 1.0.7

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 (138) hide show
  1. package/README.md +74 -0
  2. package/dist/compute/runner.d.ts +1 -22
  3. package/dist/compute/runner.d.ts.map +1 -1
  4. package/dist/compute/runner.js.map +1 -1
  5. package/dist/extensibility.d.ts +35 -0
  6. package/dist/extensibility.d.ts.map +1 -0
  7. package/dist/extensibility.js +49 -0
  8. package/dist/extensibility.js.map +1 -0
  9. package/dist/flowquery.min.js +1 -1
  10. package/dist/index.browser.d.ts.map +1 -1
  11. package/dist/index.browser.js +0 -80
  12. package/dist/index.browser.js.map +1 -1
  13. package/dist/index.node.d.ts +3 -3
  14. package/dist/index.node.d.ts.map +1 -1
  15. package/dist/index.node.js +0 -80
  16. package/dist/index.node.js.map +1 -1
  17. package/dist/parsing/functions/avg.d.ts.map +1 -1
  18. package/dist/parsing/functions/avg.js +20 -2
  19. package/dist/parsing/functions/avg.js.map +1 -1
  20. package/dist/parsing/functions/collect.d.ts.map +1 -1
  21. package/dist/parsing/functions/collect.js +20 -2
  22. package/dist/parsing/functions/collect.js.map +1 -1
  23. package/dist/parsing/functions/function_factory.d.ts +26 -80
  24. package/dist/parsing/functions/function_factory.d.ts.map +1 -1
  25. package/dist/parsing/functions/function_factory.js +46 -168
  26. package/dist/parsing/functions/function_factory.js.map +1 -1
  27. package/dist/parsing/functions/function_metadata.d.ts +81 -20
  28. package/dist/parsing/functions/function_metadata.d.ts.map +1 -1
  29. package/dist/parsing/functions/function_metadata.js +154 -152
  30. package/dist/parsing/functions/function_metadata.js.map +1 -1
  31. package/dist/parsing/functions/functions.d.ts.map +1 -1
  32. package/dist/parsing/functions/functions.js +37 -2
  33. package/dist/parsing/functions/functions.js.map +1 -1
  34. package/dist/parsing/functions/join.d.ts.map +1 -1
  35. package/dist/parsing/functions/join.js +21 -2
  36. package/dist/parsing/functions/join.js.map +1 -1
  37. package/dist/parsing/functions/predicate_function.d.ts +1 -0
  38. package/dist/parsing/functions/predicate_function.d.ts.map +1 -1
  39. package/dist/parsing/functions/predicate_function.js +3 -0
  40. package/dist/parsing/functions/predicate_function.js.map +1 -1
  41. package/dist/parsing/functions/predicate_sum.d.ts.map +1 -1
  42. package/dist/parsing/functions/predicate_sum.js +23 -2
  43. package/dist/parsing/functions/predicate_sum.js.map +1 -1
  44. package/dist/parsing/functions/rand.d.ts.map +1 -1
  45. package/dist/parsing/functions/rand.js +18 -2
  46. package/dist/parsing/functions/rand.js.map +1 -1
  47. package/dist/parsing/functions/range.d.ts.map +1 -1
  48. package/dist/parsing/functions/range.js +21 -2
  49. package/dist/parsing/functions/range.js.map +1 -1
  50. package/dist/parsing/functions/replace.d.ts.map +1 -1
  51. package/dist/parsing/functions/replace.js +22 -2
  52. package/dist/parsing/functions/replace.js.map +1 -1
  53. package/dist/parsing/functions/round.d.ts.map +1 -1
  54. package/dist/parsing/functions/round.js +20 -2
  55. package/dist/parsing/functions/round.js.map +1 -1
  56. package/dist/parsing/functions/size.d.ts.map +1 -1
  57. package/dist/parsing/functions/size.js +20 -2
  58. package/dist/parsing/functions/size.js.map +1 -1
  59. package/dist/parsing/functions/split.d.ts.map +1 -1
  60. package/dist/parsing/functions/split.js +21 -2
  61. package/dist/parsing/functions/split.js.map +1 -1
  62. package/dist/parsing/functions/stringify.d.ts.map +1 -1
  63. package/dist/parsing/functions/stringify.js +20 -2
  64. package/dist/parsing/functions/stringify.js.map +1 -1
  65. package/dist/parsing/functions/sum.d.ts.map +1 -1
  66. package/dist/parsing/functions/sum.js +20 -2
  67. package/dist/parsing/functions/sum.js.map +1 -1
  68. package/dist/parsing/functions/to_json.d.ts.map +1 -1
  69. package/dist/parsing/functions/to_json.js +20 -2
  70. package/dist/parsing/functions/to_json.js.map +1 -1
  71. package/dist/parsing/parser.d.ts.map +1 -1
  72. package/dist/parsing/parser.js +1 -2
  73. package/dist/parsing/parser.js.map +1 -1
  74. package/docs/flowquery.min.js +1 -1
  75. package/flowquery-vscode/flowQueryEngine/flowquery.min.js +1 -1
  76. package/misc/apps/RAG/.env.example +14 -0
  77. package/misc/apps/RAG/README.md +0 -7
  78. package/misc/apps/RAG/package.json +16 -7
  79. package/misc/apps/RAG/public/index.html +18 -0
  80. package/misc/apps/RAG/src/App.css +42 -0
  81. package/misc/apps/RAG/src/App.tsx +50 -0
  82. package/misc/apps/RAG/src/components/ApiKeySettings.tsx +245 -0
  83. package/misc/apps/RAG/src/components/ChatContainer.css +67 -0
  84. package/misc/apps/RAG/src/components/ChatContainer.tsx +239 -0
  85. package/misc/apps/RAG/src/components/ChatInput.css +23 -0
  86. package/misc/apps/RAG/src/components/ChatInput.tsx +62 -0
  87. package/misc/apps/RAG/src/components/ChatMessage.css +136 -0
  88. package/misc/apps/RAG/src/components/ChatMessage.tsx +152 -0
  89. package/misc/apps/RAG/src/components/FlowQueryAgent.ts +390 -0
  90. package/misc/apps/RAG/src/components/FlowQueryRunner.css +104 -0
  91. package/misc/apps/RAG/src/components/FlowQueryRunner.tsx +332 -0
  92. package/misc/apps/RAG/src/components/index.ts +15 -0
  93. package/misc/apps/RAG/src/index.tsx +17 -0
  94. package/misc/apps/RAG/src/plugins/README.md +139 -0
  95. package/misc/apps/RAG/src/plugins/index.ts +68 -0
  96. package/misc/apps/RAG/src/plugins/loaders/CatFacts.ts +75 -0
  97. package/misc/apps/RAG/src/plugins/loaders/FetchJson.ts +67 -0
  98. package/misc/apps/RAG/src/plugins/loaders/Llm.ts +437 -0
  99. package/misc/apps/RAG/src/plugins/loaders/MockData.ts +151 -0
  100. package/misc/apps/RAG/src/prompts/FlowQuerySystemPrompt.ts +385 -0
  101. package/misc/apps/RAG/src/prompts/index.ts +10 -0
  102. package/misc/apps/RAG/src/utils/FlowQueryExecutor.ts +131 -0
  103. package/misc/apps/RAG/src/utils/FlowQueryExtractor.ts +203 -0
  104. package/misc/apps/RAG/src/utils/index.ts +9 -0
  105. package/misc/apps/RAG/tsconfig.json +4 -2
  106. package/misc/apps/RAG/webpack.config.js +23 -12
  107. package/package.json +7 -1
  108. package/src/compute/runner.ts +1 -26
  109. package/src/extensibility.ts +45 -0
  110. package/src/index.browser.ts +2 -88
  111. package/src/index.node.ts +3 -92
  112. package/src/parsing/functions/avg.ts +10 -0
  113. package/src/parsing/functions/collect.ts +10 -0
  114. package/src/parsing/functions/function_factory.ts +56 -194
  115. package/src/parsing/functions/function_metadata.ts +187 -168
  116. package/src/parsing/functions/functions.ts +27 -0
  117. package/src/parsing/functions/join.ts +11 -0
  118. package/src/parsing/functions/predicate_function.ts +4 -0
  119. package/src/parsing/functions/predicate_sum.ts +13 -0
  120. package/src/parsing/functions/rand.ts +8 -0
  121. package/src/parsing/functions/range.ts +11 -0
  122. package/src/parsing/functions/replace.ts +12 -0
  123. package/src/parsing/functions/round.ts +10 -0
  124. package/src/parsing/functions/size.ts +10 -0
  125. package/src/parsing/functions/split.ts +11 -0
  126. package/src/parsing/functions/stringify.ts +10 -0
  127. package/src/parsing/functions/sum.ts +10 -0
  128. package/src/parsing/functions/to_json.ts +10 -0
  129. package/src/parsing/parser.ts +1 -2
  130. package/tests/extensibility.test.ts +563 -0
  131. package/tsconfig.json +1 -0
  132. package/dist/parsing/functions/predicate_function_factory.d.ts +0 -6
  133. package/dist/parsing/functions/predicate_function_factory.d.ts.map +0 -1
  134. package/dist/parsing/functions/predicate_function_factory.js +0 -19
  135. package/dist/parsing/functions/predicate_function_factory.js.map +0 -1
  136. package/misc/apps/RAG/src/index.ts +0 -20
  137. package/src/parsing/functions/predicate_function_factory.ts +0 -15
  138. package/tests/parsing/function_plugins.test.ts +0 -369
package/README.md CHANGED
@@ -143,6 +143,80 @@ post {
143
143
  return data
144
144
  ```
145
145
 
146
+ ## Extending FlowQuery with Custom Functions
147
+
148
+ FlowQuery provides a plugin system that allows you to register custom functions using the `@FunctionDef` decorator. Import from the extensibility module for a clean API:
149
+
150
+ ```typescript
151
+ import { Function, FunctionDef } from "flowquery/extensibility";
152
+
153
+ @FunctionDef({
154
+ description: "Converts a string to uppercase",
155
+ category: "string",
156
+ parameters: [
157
+ { name: "text", description: "String to convert", type: "string" }
158
+ ],
159
+ output: {
160
+ description: "Uppercase string",
161
+ type: "string",
162
+ example: "HELLO WORLD"
163
+ },
164
+ examples: ["WITH 'hello' AS s RETURN uppercase(s)"]
165
+ })
166
+ class UpperCase extends Function {
167
+ constructor() {
168
+ super("uppercase"); // Function name used in queries
169
+ this._expectedParameterCount = 1; // Number of required parameters
170
+ }
171
+
172
+ public value(): string {
173
+ const input = this.getChildren()[0].value();
174
+ return String(input).toUpperCase();
175
+ }
176
+ }
177
+ ```
178
+
179
+ The decorator automatically registers the function with the FlowQuery function factory.
180
+
181
+ ### Creating Async Data Providers
182
+
183
+ For functions that fetch data asynchronously (used with `LOAD JSON FROM`), use the `@FunctionDef` decorator with `category: "async"`. The class must have a `fetch` method that returns an async generator:
184
+
185
+ ```typescript
186
+ import { FunctionDef } from "flowquery/extensibility";
187
+
188
+ @FunctionDef({
189
+ description: "Provides example data for testing",
190
+ category: "async",
191
+ parameters: [],
192
+ output: { description: "Example data object", type: "object" }
193
+ })
194
+ class GetExampleDataLoader {
195
+ async *fetch(): AsyncGenerator<any> {
196
+ yield { id: 1, name: "Alice" };
197
+ yield { id: 2, name: "Bob" };
198
+ }
199
+ }
200
+ ```
201
+
202
+ The function name is derived from the class name by removing the `Loader` suffix (if present) and converting to camelCase. In this example, `GetExampleDataLoader` becomes `getExampleData`.
203
+
204
+ Use the async provider in a FlowQuery statement:
205
+
206
+ ```cypher
207
+ LOAD JSON FROM getExampleData() AS data
208
+ RETURN data.id AS id, data.name AS name
209
+ ```
210
+
211
+ The extensibility module (`flowquery/extensibility`) exports:
212
+ - `Function` - Base class for scalar functions
213
+ - `AggregateFunction` - Base class for aggregate functions (like `sum`, `avg`, `collect`)
214
+ - `AsyncFunction` - Base class for async function calls
215
+ - `PredicateFunction` - Base class for predicate functions (like list comprehensions)
216
+ - `ReducerElement` - Helper class for aggregate function state
217
+ - `FunctionDef` - Decorator for registering functions with metadata
218
+ - `FunctionMetadata`, `FunctionDefOptions`, `ParameterSchema`, `OutputSchema`, `FunctionCategory` - TypeScript types for metadata definitions
219
+
146
220
  ## Contributing
147
221
 
148
222
  This project welcomes contributions and suggestions. Most contributions require you to agree to a
@@ -1,5 +1,4 @@
1
- import { FunctionCreator, AsyncDataProvider } from "../parsing/functions/function_factory";
2
- import { FunctionMetadata, RegisterFunctionOptions, RegisterAsyncProviderOptions } from "../parsing/functions/function_metadata";
1
+ import { FunctionMetadata } from "../parsing/functions/function_metadata";
3
2
  import Function from "../parsing/functions/function";
4
3
  /**
5
4
  * Executes a FlowQuery statement and retrieves the results.
@@ -17,26 +16,6 @@ import Function from "../parsing/functions/function";
17
16
  declare class Runner {
18
17
  private first;
19
18
  private last;
20
- /**
21
- * Register a synchronous plugin function.
22
- * Added dynamically in index.browser.ts / index.node.ts
23
- */
24
- static registerFunction: (name: string, factoryOrOptions: FunctionCreator | RegisterFunctionOptions) => void;
25
- /**
26
- * Unregister a synchronous plugin function.
27
- * Added dynamically in index.browser.ts / index.node.ts
28
- */
29
- static unregisterFunction: (name: string) => void;
30
- /**
31
- * Register an async data provider function for use in LOAD operations.
32
- * Added dynamically in index.browser.ts / index.node.ts
33
- */
34
- static registerAsyncProvider: (name: string, providerOrOptions: AsyncDataProvider | RegisterAsyncProviderOptions) => void;
35
- /**
36
- * Unregister an async data provider function.
37
- * Added dynamically in index.browser.ts / index.node.ts
38
- */
39
- static unregisterAsyncProvider: (name: string) => void;
40
19
  /**
41
20
  * List all registered functions with their metadata.
42
21
  * Added dynamically in index.browser.ts / index.node.ts
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/compute/runner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,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../../src/compute/runner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,cAAM,MAAM;IACR,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,IAAI,CAAY;IAExB;;;OAGG;IACH,MAAM,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,gBAAgB,EAAE,CAAC;IAEvH;;;OAGG;IACH,MAAM,CAAC,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAAS,CAAC;IAE3E;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAEjC;;;;;OAKG;gBACS,SAAS,GAAE,MAAM,GAAG,IAAW;IAU3C;;;;;OAKG;IACU,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAYjC;;;;OAIG;IACH,IAAW,OAAO,IAAI,GAAG,CAExB;CACJ;AAED,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/compute/runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,+DAAuC;AAKvC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM;IA8CR;;;;;OAKG;IACH,YAAY,YAA2B,IAAI;QACvC,IAAG,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,gBAAM,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAA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IACU,GAAG;;YACZ,OAAO,IAAI,OAAO,CAAO,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC/C,IAAI,CAAC;oBACD,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;oBACvB,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;oBAC1B,OAAO,EAAE,CAAC;gBACd,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACT,MAAM,CAAC,CAAC,CAAC,CAAC;gBACd,CAAC;YACL,CAAC,CAAA,CAAC,CAAC;QACP,CAAC;KAAA;IAED;;;;OAIG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC7B,CAAC;CACJ;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * FlowQuery Extensibility API
3
+ *
4
+ * This module provides all the exports needed to create custom FlowQuery functions.
5
+ *
6
+ * @packageDocumentation
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { Function, FunctionDef } from 'flowquery/extensibility';
11
+ *
12
+ * @FunctionDef({
13
+ * description: "Converts a string to uppercase",
14
+ * category: "string",
15
+ * parameters: [{ name: "text", description: "String to convert", type: "string" }],
16
+ * output: { description: "Uppercase string", type: "string" }
17
+ * })
18
+ * class UpperCase extends Function {
19
+ * constructor() {
20
+ * super("uppercase");
21
+ * this._expectedParameterCount = 1;
22
+ * }
23
+ * public value(): string {
24
+ * return String(this.getChildren()[0].value()).toUpperCase();
25
+ * }
26
+ * }
27
+ * ```
28
+ */
29
+ export { default as Function } from "./parsing/functions/function";
30
+ export { default as AggregateFunction } from "./parsing/functions/aggregate_function";
31
+ export { default as AsyncFunction } from "./parsing/functions/async_function";
32
+ export { default as PredicateFunction } from "./parsing/functions/predicate_function";
33
+ export { default as ReducerElement } from "./parsing/functions/reducer_element";
34
+ export { FunctionDef, FunctionMetadata, FunctionDefOptions, ParameterSchema, OutputSchema, FunctionCategory } from "./parsing/functions/function_metadata";
35
+ //# sourceMappingURL=extensibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensibility.d.ts","sourceRoot":"","sources":["../src/extensibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAGhF,OAAO,EACH,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,gBAAgB,EACnB,MAAM,uCAAuC,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /**
3
+ * FlowQuery Extensibility API
4
+ *
5
+ * This module provides all the exports needed to create custom FlowQuery functions.
6
+ *
7
+ * @packageDocumentation
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { Function, FunctionDef } from 'flowquery/extensibility';
12
+ *
13
+ * @FunctionDef({
14
+ * description: "Converts a string to uppercase",
15
+ * category: "string",
16
+ * parameters: [{ name: "text", description: "String to convert", type: "string" }],
17
+ * output: { description: "Uppercase string", type: "string" }
18
+ * })
19
+ * class UpperCase extends Function {
20
+ * constructor() {
21
+ * super("uppercase");
22
+ * this._expectedParameterCount = 1;
23
+ * }
24
+ * public value(): string {
25
+ * return String(this.getChildren()[0].value()).toUpperCase();
26
+ * }
27
+ * }
28
+ * ```
29
+ */
30
+ var __importDefault = (this && this.__importDefault) || function (mod) {
31
+ return (mod && mod.__esModule) ? mod : { "default": mod };
32
+ };
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.FunctionDef = exports.ReducerElement = exports.PredicateFunction = exports.AsyncFunction = exports.AggregateFunction = exports.Function = void 0;
35
+ // Base function classes for creating custom functions
36
+ var function_1 = require("./parsing/functions/function");
37
+ Object.defineProperty(exports, "Function", { enumerable: true, get: function () { return __importDefault(function_1).default; } });
38
+ var aggregate_function_1 = require("./parsing/functions/aggregate_function");
39
+ Object.defineProperty(exports, "AggregateFunction", { enumerable: true, get: function () { return __importDefault(aggregate_function_1).default; } });
40
+ var async_function_1 = require("./parsing/functions/async_function");
41
+ Object.defineProperty(exports, "AsyncFunction", { enumerable: true, get: function () { return __importDefault(async_function_1).default; } });
42
+ var predicate_function_1 = require("./parsing/functions/predicate_function");
43
+ Object.defineProperty(exports, "PredicateFunction", { enumerable: true, get: function () { return __importDefault(predicate_function_1).default; } });
44
+ var reducer_element_1 = require("./parsing/functions/reducer_element");
45
+ Object.defineProperty(exports, "ReducerElement", { enumerable: true, get: function () { return __importDefault(reducer_element_1).default; } });
46
+ // Decorator and metadata types for function registration
47
+ var function_metadata_1 = require("./parsing/functions/function_metadata");
48
+ Object.defineProperty(exports, "FunctionDef", { enumerable: true, get: function () { return function_metadata_1.FunctionDef; } });
49
+ //# sourceMappingURL=extensibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensibility.js","sourceRoot":"","sources":["../src/extensibility.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;;;;AAEH,sDAAsD;AACtD,yDAAmE;AAA1D,qHAAA,OAAO,OAAY;AAC5B,6EAAsF;AAA7E,wIAAA,OAAO,OAAqB;AACrC,qEAA8E;AAArE,gIAAA,OAAO,OAAiB;AACjC,6EAAsF;AAA7E,wIAAA,OAAO,OAAqB;AACrC,uEAAgF;AAAvE,kIAAA,OAAO,OAAkB;AAElC,yDAAyD;AACzD,2EAO+C;AAN3C,gHAAA,WAAW,OAAA"}