pupt-lib 1.1.0 → 1.1.1

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 (39) hide show
  1. package/dist/api.d.ts +0 -4
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/components/index.d.ts.map +1 -1
  4. package/dist/components/meta/Uses.d.ts +74 -7
  5. package/dist/components/meta/Uses.d.ts.map +1 -1
  6. package/dist/components/reasoning/Steps.d.ts.map +1 -1
  7. package/dist/create-prompt.d.ts +21 -6
  8. package/dist/create-prompt.d.ts.map +1 -1
  9. package/dist/index.d.ts +5 -5
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +503 -389
  12. package/dist/jsx-runtime/index.d.ts.map +1 -1
  13. package/dist/jsx-runtime/index.js +3 -6
  14. package/dist/render.d.ts.map +1 -1
  15. package/dist/services/babel-plugins/index.d.ts +2 -0
  16. package/dist/services/babel-plugins/index.d.ts.map +1 -0
  17. package/dist/services/babel-plugins/uses-to-import.d.ts +16 -0
  18. package/dist/services/babel-plugins/uses-to-import.d.ts.map +1 -0
  19. package/dist/services/input-iterator.d.ts.map +1 -1
  20. package/dist/services/module-evaluator.d.ts +38 -0
  21. package/dist/services/module-evaluator.d.ts.map +1 -0
  22. package/dist/services/preprocessor.d.ts +52 -0
  23. package/dist/services/preprocessor.d.ts.map +1 -0
  24. package/dist/services/transformer.d.ts.map +1 -1
  25. package/dist/types/context.d.ts +254 -34
  26. package/dist/types/context.d.ts.map +1 -1
  27. package/dist/types/element.d.ts +0 -14
  28. package/dist/types/element.d.ts.map +1 -1
  29. package/dist/types/index.d.ts +3 -5
  30. package/dist/types/index.d.ts.map +1 -1
  31. package/dist/types/render.d.ts +1 -3
  32. package/dist/types/render.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/services/component-registry.d.ts +0 -11
  35. package/dist/services/component-registry.d.ts.map +0 -1
  36. package/dist/services/scope-loader.d.ts +0 -55
  37. package/dist/services/scope-loader.d.ts.map +0 -1
  38. package/dist/services/scope.d.ts +0 -14
  39. package/dist/services/scope.d.ts.map +0 -1
package/dist/api.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { PuptInitConfig, SearchResult, SearchOptions, RenderOptions, RenderResult, PuptElement } from './types';
2
2
  import { InputIterator } from './services/input-iterator';
3
- import { Scope } from './services/scope';
4
3
  /**
5
4
  * A discovered prompt with render and input iterator capabilities
6
5
  */
@@ -18,7 +17,6 @@ export interface DiscoveredPromptWithMethods {
18
17
  */
19
18
  export declare class Pupt {
20
19
  private config;
21
- private scopeLoader;
22
20
  private moduleLoader;
23
21
  private searchEngine;
24
22
  private prompts;
@@ -32,8 +30,6 @@ export declare class Pupt {
32
30
  searchPrompts(query: string, options?: Partial<SearchOptions>): SearchResult[];
33
31
  getTags(): string[];
34
32
  getPromptsByTag(tag: string): DiscoveredPromptWithMethods[];
35
- hasComponent(name: string): boolean;
36
- getRegistry(): Scope;
37
33
  private discoverPrompts;
38
34
  private loadModuleExports;
39
35
  private isPromptElement;
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACZ,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAA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,CAAC;AACf,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAG7B,cAAc,WAAW,CAAC;AAG1B,cAAc,QAAQ,CAAC;AAGvB,OAAO,EACL,GAAG,EACH,SAAS,EACT,QAAQ,EACR,OAAO,EACP,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,EACd,OAAO,EACP,OAAO,EACP,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,aAAa,GACd,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAG5B,cAAc,QAAQ,CAAC;AAGvB,cAAc,kBAAkB,CAAC"}
@@ -1,31 +1,98 @@
1
1
  import { z } from 'zod';
2
2
  import { Component } from '../../component';
3
3
  import { PuptNode, RenderContext } from '../../types';
4
+ /**
5
+ * Schema for <Uses> component props.
6
+ *
7
+ * Examples:
8
+ * - <Uses component="Card" from="my-lib" />
9
+ * - <Uses component="Card" as="MyCard" from="my-lib" />
10
+ * - <Uses default="Card" from="my-lib" />
11
+ * - <Uses component="A, B, C" from="my-lib" />
12
+ */
4
13
  export declare const usesSchema: z.ZodObject<{
5
- prompt: z.ZodString;
14
+ /** Named export(s) to import (comma-separated for multiple) */
15
+ component: z.ZodOptional<z.ZodString>;
16
+ /** Import the default export with this name */
17
+ default: z.ZodOptional<z.ZodString>;
18
+ /** Alias for the imported component (only valid with single component) */
6
19
  as: z.ZodOptional<z.ZodString>;
20
+ /** Module specifier (npm package, URL, or local path) */
21
+ from: z.ZodString;
7
22
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
8
- prompt: z.ZodString;
23
+ /** Named export(s) to import (comma-separated for multiple) */
24
+ component: z.ZodOptional<z.ZodString>;
25
+ /** Import the default export with this name */
26
+ default: z.ZodOptional<z.ZodString>;
27
+ /** Alias for the imported component (only valid with single component) */
9
28
  as: z.ZodOptional<z.ZodString>;
29
+ /** Module specifier (npm package, URL, or local path) */
30
+ from: z.ZodString;
10
31
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
11
- prompt: z.ZodString;
32
+ /** Named export(s) to import (comma-separated for multiple) */
33
+ component: z.ZodOptional<z.ZodString>;
34
+ /** Import the default export with this name */
35
+ default: z.ZodOptional<z.ZodString>;
36
+ /** Alias for the imported component (only valid with single component) */
12
37
  as: z.ZodOptional<z.ZodString>;
38
+ /** Module specifier (npm package, URL, or local path) */
39
+ from: z.ZodString;
13
40
  }, z.ZodTypeAny, "passthrough">>;
14
41
  type UsesProps = z.infer<typeof usesSchema> & {
15
42
  children?: PuptNode;
16
43
  };
44
+ /**
45
+ * The <Uses> component declares dependencies on external components.
46
+ *
47
+ * This component is transformed into an import statement by the Babel plugin
48
+ * during compilation. If the render method is called, it means the plugin
49
+ * did not run, which is a configuration error.
50
+ *
51
+ * @example
52
+ * ```xml
53
+ * <!-- Import a named export -->
54
+ * <Uses component="CustomCard" from="my-components" />
55
+ *
56
+ * <!-- Import with alias -->
57
+ * <Uses component="Card" as="MyCard" from="my-components" />
58
+ *
59
+ * <!-- Import default export -->
60
+ * <Uses default="CustomCard" from="my-components" />
61
+ *
62
+ * <!-- Import multiple components -->
63
+ * <Uses component="Card, Button, Input" from="my-components" />
64
+ * ```
65
+ */
17
66
  export declare class Uses extends Component<UsesProps> {
18
67
  static schema: z.ZodObject<{
19
- prompt: z.ZodString;
68
+ /** Named export(s) to import (comma-separated for multiple) */
69
+ component: z.ZodOptional<z.ZodString>;
70
+ /** Import the default export with this name */
71
+ default: z.ZodOptional<z.ZodString>;
72
+ /** Alias for the imported component (only valid with single component) */
20
73
  as: z.ZodOptional<z.ZodString>;
74
+ /** Module specifier (npm package, URL, or local path) */
75
+ from: z.ZodString;
21
76
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
22
- prompt: z.ZodString;
77
+ /** Named export(s) to import (comma-separated for multiple) */
78
+ component: z.ZodOptional<z.ZodString>;
79
+ /** Import the default export with this name */
80
+ default: z.ZodOptional<z.ZodString>;
81
+ /** Alias for the imported component (only valid with single component) */
23
82
  as: z.ZodOptional<z.ZodString>;
83
+ /** Module specifier (npm package, URL, or local path) */
84
+ from: z.ZodString;
24
85
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
25
- prompt: z.ZodString;
86
+ /** Named export(s) to import (comma-separated for multiple) */
87
+ component: z.ZodOptional<z.ZodString>;
88
+ /** Import the default export with this name */
89
+ default: z.ZodOptional<z.ZodString>;
90
+ /** Alias for the imported component (only valid with single component) */
26
91
  as: z.ZodOptional<z.ZodString>;
92
+ /** Module specifier (npm package, URL, or local path) */
93
+ from: z.ZodString;
27
94
  }, z.ZodTypeAny, "passthrough">>;
28
- render(_props: UsesProps, _context: RenderContext): PuptNode;
95
+ render(props: UsesProps, _context: RenderContext): PuptNode;
29
96
  }
30
97
  export {};
31
98
  //# sourceMappingURL=Uses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Uses.d.ts","sourceRoot":"","sources":["../../../src/components/meta/Uses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3D,eAAO,MAAM,UAAU;;;;;;;;;gCAGP,CAAC;AAEjB,KAAK,SAAS,GAAG,CAAC,CAAC,KA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AAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,QAAQ;CAS5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/reasoning/Steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAe,aAAa,EAAE,MAAM,aAAa,CAAC;AAExE,eAAO,MAAM,WAAW,uJAA6B,CAAC;AAEtD,KAAK,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvE,qBAAa,KAAM,SAAQ,SAAS,CAAC,UAAU,CAAC;IAC9C,MAAM,CAAC,MAAM,wJAAe;IAE5B,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,GAAG,QAAQ;IAuBnE,OAAO,CAAC,aAAa;CAStB"}
1
+ {"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/reasoning/Steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAe,aAAa,EAAE,MAAM,aAAa,CAAC;AAExE,eAAO,MAAM,WAAW,uJAA6B,CAAC;AAEtD,KAAK,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvE,qBAAa,KAAM,SAAQ,SAAS,CAAC,UAAU,CAAC;IAC9C,MAAM,CAAC,MAAM,wJAAe;IAE5B,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,GAAG,QAAQ;IAuBnE,OAAO,CAAC,aAAa;CAwBtB"}
@@ -1,20 +1,24 @@
1
1
  import { PuptElement } from './types';
2
- export interface CreatePromptOptions {
3
- /** Additional scope variables available during evaluation */
4
- scope?: Record<string, unknown>;
5
- }
2
+ export type CreatePromptOptions = Record<string, never>;
6
3
  /**
7
4
  * Create a PuptElement from a TSX source string.
8
5
  * Transforms the JSX and evaluates it to produce an element tree.
9
6
  *
7
+ * For .prompt files or raw JSX without imports, built-in component imports
8
+ * are automatically injected.
9
+ *
10
+ * For .tsx files with imports, the source is used as-is.
11
+ *
10
12
  * @param source - TSX source code
11
13
  * @param filename - Filename for error messages and source maps
12
- * @param options - Optional configuration
14
+ * @param _options - Optional configuration (reserved for future use)
13
15
  * @returns The default export as a PuptElement
14
16
  *
15
17
  * @example
16
18
  * ```typescript
19
+ * // .tsx file with imports
17
20
  * const source = `
21
+ * import { Prompt, Role } from 'pupt-lib';
18
22
  * export default (
19
23
  * <Prompt name="test">
20
24
  * <Role>Assistant</Role>
@@ -23,8 +27,19 @@ export interface CreatePromptOptions {
23
27
  * `;
24
28
  * const element = await createPromptFromSource(source, 'test.tsx');
25
29
  * ```
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * // .prompt file (auto-imports built-in components)
34
+ * const source = `
35
+ * <Prompt name="test">
36
+ * <Role>Assistant</Role>
37
+ * </Prompt>
38
+ * `;
39
+ * const element = await createPromptFromSource(source, 'test.prompt');
40
+ * ```
26
41
  */
27
- export declare function createPromptFromSource(source: string, filename: string, options?: CreatePromptOptions): Promise<PuptElement>;
42
+ export declare function createPromptFromSource(source: string, filename: string, _options?: CreatePromptOptions): Promise<PuptElement>;
28
43
  /**
29
44
  * Create a PuptElement by loading and transforming a TSX file.
30
45
  * Reads the file, transforms the JSX, and evaluates it.
@@ -1 +1 @@
1
- {"version":3,"file":"create-prompt.d.ts","sourceRoot":"","sources":["../src/create-prompt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA2E3C,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAqID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,WAAW,CAAC,CAKtB"}
1
+ {"version":3,"file":"create-prompt.d.ts","sourceRoot":"","sources":["../src/create-prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,mBAAwB,GACjC,OAAO,CAAC,WAAW,CAAC,CAiBtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,WAAW,CAAC,CAKtB"}
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  export declare const VERSION = "0.0.0-development";
2
- export type { PuptNode, PuptElement, ComponentType, LlmConfig, OutputConfig, CodeConfig, RuntimeConfig, EnvironmentContext, RenderContext, RenderOptions, RenderResult, RenderSuccess, RenderFailure, RenderError, RenderMetadata, PostExecutionAction, InputRequirement, ValidationResult, ValidationError, ValidationWarning, CollectedInputs, ComponentProps, PromptProps, StructuralProps, CommonProps, SearchablePrompt, SearchOptions, SearchResult, SearchResultMatch, SearchEngineConfig, PuptConfig, PuptLibrary, DiscoveredPrompt, LibraryLoadResult, PuptInitConfig, } from './types';
2
+ export type { PuptNode, PuptElement, ComponentType, LlmConfig, OutputConfig, CodeConfig, UserConfig, RuntimeConfig, EnvironmentContext, RenderContext, RenderOptions, RenderResult, RenderSuccess, RenderFailure, RenderError, RenderMetadata, PostExecutionAction, InputRequirement, ValidationResult, ValidationError, ValidationWarning, CollectedInputs, ComponentProps, PromptProps, StructuralProps, CommonProps, SearchablePrompt, SearchOptions, SearchResult, SearchResultMatch, SearchEngineConfig, PuptConfig, PuptLibrary, DiscoveredPrompt, LibraryLoadResult, PuptInitConfig, } from './types';
3
3
  export { DEFAULT_ENVIRONMENT, createEnvironment, createRuntimeConfig, } from './types';
4
4
  export { Component, isComponentClass, COMPONENT_MARKER } from './component';
5
5
  export { render } from './render';
6
- export { createRegistry, defaultRegistry } from './services/component-registry';
7
- export type { ComponentRegistry } from './services/component-registry';
8
- export { Scope, createScope } from './services/scope';
9
6
  export { createInputIterator } from './services/input-iterator';
10
7
  export type { InputIterator, InputIteratorOptions, OnMissingDefaultStrategy } from './services/input-iterator';
11
8
  export { evaluateFormula } from './services/formula-parser';
12
9
  export { Transformer } from './services/transformer';
10
+ export { evaluateModule } from './services/module-evaluator';
11
+ export type { EvaluateOptions } from './services/module-evaluator';
12
+ export { preprocessSource, isPromptFile, needsPreprocessing, BUILTIN_COMPONENTS } from './services/preprocessor';
13
+ export type { PreprocessOptions } from './services/preprocessor';
13
14
  export { ModuleLoader } from './services/module-loader';
14
15
  export type { SourceType, LoadedLibrary, ParsedPackageSource } from './services/module-loader';
15
- export { ScopeLoader, createScopeLoader } from './services/scope-loader';
16
16
  export { resolveCdn, generateImportMap, serializeImportMap, generateImportMapScript, } from './services/browser-support';
17
17
  export type { CdnProvider, CdnOptions, Dependency, ImportMap, } from './services/browser-support';
18
18
  export * from './components';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAG3C,YAAY,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,WAAW,EACX,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG5E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChF,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC/G,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MA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