@gracile/engine 0.8.2 → 0.9.0-next.11

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 (80) hide show
  1. package/dist/dev/development.d.ts.map +1 -1
  2. package/dist/dev/development.js +1 -1
  3. package/dist/dev/ssr-ce-tracker.d.ts +27 -0
  4. package/dist/dev/ssr-ce-tracker.d.ts.map +1 -0
  5. package/dist/dev/ssr-ce-tracker.js +113 -0
  6. package/dist/errors/create-vite-better-error.js +1 -1
  7. package/dist/plugin.d.ts.map +1 -1
  8. package/dist/plugin.js +56 -256
  9. package/dist/render/light-dom.d.ts +2 -0
  10. package/dist/render/light-dom.d.ts.map +1 -0
  11. package/dist/render/light-dom.js +31 -0
  12. package/dist/render/{utils.d.ts → lit-ssr.d.ts} +1 -1
  13. package/dist/render/lit-ssr.d.ts.map +1 -0
  14. package/dist/render/route-template-pipeline.d.ts +64 -0
  15. package/dist/render/route-template-pipeline.d.ts.map +1 -0
  16. package/dist/render/route-template-pipeline.js +144 -0
  17. package/dist/render/route-template.d.ts +4 -3
  18. package/dist/render/route-template.d.ts.map +1 -1
  19. package/dist/render/route-template.js +41 -87
  20. package/dist/routes/collect.d.ts +5 -1
  21. package/dist/routes/collect.d.ts.map +1 -1
  22. package/dist/routes/collect.js +11 -6
  23. package/dist/routes/load-module.d.ts.map +1 -1
  24. package/dist/routes/load-module.js +5 -2
  25. package/dist/routes/match.d.ts +31 -1
  26. package/dist/routes/match.d.ts.map +1 -1
  27. package/dist/routes/match.js +22 -4
  28. package/dist/routes/render.d.ts.map +1 -1
  29. package/dist/routes/render.js +12 -3
  30. package/dist/server/adapters/hono.d.ts +1 -1
  31. package/dist/server/adapters/hono.d.ts.map +1 -1
  32. package/dist/server/adapters/hono.js +1 -1
  33. package/dist/server/adapters/node.d.ts +1 -1
  34. package/dist/server/adapters/node.d.ts.map +1 -1
  35. package/dist/server/adapters/node.js +2 -2
  36. package/dist/server/request-pipeline.d.ts +109 -0
  37. package/dist/server/request-pipeline.d.ts.map +1 -0
  38. package/dist/server/request-pipeline.js +198 -0
  39. package/dist/server/request.d.ts +3 -16
  40. package/dist/server/request.d.ts.map +1 -1
  41. package/dist/server/request.js +78 -173
  42. package/dist/server/{utils.d.ts → utilities.d.ts} +1 -1
  43. package/dist/server/utilities.d.ts.map +1 -0
  44. package/dist/test/init.d.ts +2 -0
  45. package/dist/test/init.d.ts.map +1 -0
  46. package/dist/test/init.js +7 -0
  47. package/dist/user-config.d.ts +48 -0
  48. package/dist/user-config.d.ts.map +1 -1
  49. package/dist/vite/build-routes.d.ts +1 -2
  50. package/dist/vite/build-routes.d.ts.map +1 -1
  51. package/dist/vite/build-routes.js +0 -98
  52. package/dist/vite/plugin-build-environment.d.ts +21 -0
  53. package/dist/vite/plugin-build-environment.d.ts.map +1 -0
  54. package/dist/vite/plugin-build-environment.js +83 -0
  55. package/dist/vite/plugin-ce-tracker.d.ts +19 -0
  56. package/dist/vite/plugin-ce-tracker.d.ts.map +1 -0
  57. package/dist/vite/plugin-ce-tracker.js +87 -0
  58. package/dist/vite/plugin-client-build.d.ts +20 -0
  59. package/dist/vite/plugin-client-build.d.ts.map +1 -0
  60. package/dist/vite/plugin-client-build.js +55 -0
  61. package/dist/vite/plugin-html-routes-build.d.ts +22 -0
  62. package/dist/vite/plugin-html-routes-build.d.ts.map +1 -0
  63. package/dist/vite/plugin-html-routes-build.js +140 -0
  64. package/dist/vite/plugin-serve.d.ts +18 -0
  65. package/dist/vite/plugin-serve.d.ts.map +1 -0
  66. package/dist/vite/plugin-serve.js +61 -0
  67. package/dist/vite/plugin-server-build.d.ts +43 -0
  68. package/dist/vite/plugin-server-build.d.ts.map +1 -0
  69. package/dist/vite/plugin-server-build.js +108 -0
  70. package/dist/vite/plugin-shared-state.d.ts +33 -0
  71. package/dist/vite/plugin-shared-state.d.ts.map +1 -0
  72. package/dist/vite/plugin-shared-state.js +23 -0
  73. package/dist/vite/virtual-routes.d.ts +8 -5
  74. package/dist/vite/virtual-routes.d.ts.map +1 -1
  75. package/dist/vite/virtual-routes.js +32 -31
  76. package/package.json +11 -11
  77. package/dist/render/utils.d.ts.map +0 -1
  78. package/dist/server/utils.d.ts.map +0 -1
  79. /package/dist/render/{utils.js → lit-ssr.js} +0 -0
  80. /package/dist/server/{utils.js → utilities.js} +0 -0
@@ -82,7 +82,7 @@ export function nodeAdapter(handler, options) {
82
82
  return response.end(result.body);
83
83
  if (result.response.body) {
84
84
  const piped = await result.response.body
85
- .pipeTo(Writable.toWeb(response))
85
+ .pipeTo(Writable.toWeb(response) /* NOTE: Minor typing mismatch (node:stream/web vs. TS global) */)
86
86
  .catch((error) => logger.error(String(error)));
87
87
  return piped;
88
88
  }
@@ -109,5 +109,5 @@ export function nodeAdapter(handler, options) {
109
109
  export function getClientBuildPath(root) {
110
110
  return fileURLToPath(new URL(constants.CLIENT_DIST_DIR, root));
111
111
  }
112
- export { printUrls } from '../utils.js';
112
+ export { printUrls } from '../utilities.js';
113
113
  export {} from '../request.js';
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Pure, testable pipeline steps extracted from the request handler.
3
+ *
4
+ * Each function here is a focused stage of the Gracile request lifecycle.
5
+ * They are composed by `createGracileHandler` in `./request.ts`.
6
+ *
7
+ * @internal
8
+ */
9
+ import { Readable } from 'node:stream';
10
+ import type { Logger, ViteDevServer } from 'vite';
11
+ import { renderRouteTemplate } from '../render/route-template.js';
12
+ import type { RouteInfos } from '../routes/match.js';
13
+ import type { GracileConfig } from '../user-config.js';
14
+ export type StandardResponse = {
15
+ response: Response;
16
+ body?: never;
17
+ init?: never;
18
+ };
19
+ export type ResponseWithNodeReadable = {
20
+ response?: never;
21
+ body: Readable;
22
+ init: ResponseInit;
23
+ };
24
+ export type HandlerResult = StandardResponse | ResponseWithNodeReadable | null;
25
+ export declare const CONTENT_TYPE_HTML: {
26
+ readonly 'Content-Type': "text/html";
27
+ };
28
+ export declare const PREMISE_REGEXES: {
29
+ readonly properties: RegExp;
30
+ readonly document: RegExp;
31
+ };
32
+ /** Describes which premises endpoint was requested, if any. */
33
+ export interface PremisesDescriptor {
34
+ propertiesOnly: boolean;
35
+ documentOnly: boolean;
36
+ }
37
+ /**
38
+ * Strip the `/__…` suffix so hidden-sibling URLs (premises) resolve to
39
+ * the parent route.
40
+ *
41
+ * @example
42
+ * rewriteHiddenRoutes('http://localhost/blog/__index.props.json')
43
+ * // → 'http://localhost/blog/'
44
+ */
45
+ export declare function rewriteHiddenRoutes(url: string): string;
46
+ /**
47
+ * Determine if the incoming request targets a premises endpoint
48
+ * (`__index.props.json` or `__index.doc.html`) and whether the config
49
+ * allows it.
50
+ *
51
+ * @returns A descriptor when premises are enabled, or `null` when not.
52
+ * @throws When a premise URL is hit but premises are not enabled.
53
+ */
54
+ export declare function resolvePremises(requestedUrl: string, gracileConfig: GracileConfig): PremisesDescriptor | null;
55
+ export interface ExecuteHandlerOptions {
56
+ routeInfos: RouteInfos;
57
+ method: string;
58
+ request: Request;
59
+ fullUrl: string;
60
+ locals: unknown;
61
+ responseInit: ResponseInit;
62
+ premises: PremisesDescriptor | null;
63
+ routeTemplateOptions: Parameters<typeof renderRouteTemplate>[0];
64
+ }
65
+ /**
66
+ * Result from `executeHandler`:
67
+ *
68
+ * - `{ type: 'response', value }` — return this response directly
69
+ * - `{ type: 'output', value }` — pass to response building
70
+ * - `{ type: 'fallthrough' }` — no handler, proceed to template-only render
71
+ */
72
+ export type ExecuteHandlerResult = {
73
+ type: 'response';
74
+ value: StandardResponse;
75
+ } | {
76
+ type: 'output';
77
+ value: Readable | Response | null;
78
+ } | {
79
+ type: 'fallthrough';
80
+ };
81
+ /**
82
+ * Dispatch the user's route handler (top-level function or method-map).
83
+ *
84
+ * This determines whether to call the handler, which method to use,
85
+ * and whether to short-circuit with premises or a 405.
86
+ */
87
+ export declare function executeHandler(options: ExecuteHandlerOptions): Promise<ExecuteHandlerResult>;
88
+ /**
89
+ * Render a page that has no handler — just a document/template.
90
+ * Handles premises short-circuits.
91
+ */
92
+ export declare function renderWithoutHandler(options: {
93
+ premises: PremisesDescriptor | null;
94
+ routeTemplateOptions: Parameters<typeof renderRouteTemplate>[0];
95
+ }): Promise<StandardResponse | Readable | null>;
96
+ export declare function isRedirect(response: Response): {
97
+ location: string;
98
+ } | null;
99
+ /**
100
+ * Convert a handler/render output (Response or Readable stream) into
101
+ * the final `HandlerResult` shape expected by adapters.
102
+ */
103
+ export declare function buildResponse(options: {
104
+ output: Readable | Response | null;
105
+ responseInit: ResponseInit;
106
+ vite: ViteDevServer | undefined;
107
+ logger: Logger;
108
+ }): HandlerResult;
109
+ //# sourceMappingURL=request-pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-pipeline.d.ts","sourceRoot":"","sources":["../../src/server/request-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,OAAO,KAAK,EAAc,MAAM,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC;CACb,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG,wBAAwB,GAAG,IAAI,CAAC;AAE/E,eAAO,MAAM,iBAAiB;;CAA2C,CAAC;AAE1E,eAAO,MAA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,OAAO,CAAC,gBAAgB,GAAG,QAAQ,GAAG,IAAI,CAAC,CAoB9C;AAID,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAM1E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE;IACtC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAC;IACnC,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CACf,GAAG,aAAa,CAqDhB"}
@@ -0,0 +1,198 @@
1
+ /**
2
+ * Pure, testable pipeline steps extracted from the request handler.
3
+ *
4
+ * Each function here is a focused stage of the Gracile request lifecycle.
5
+ * They are composed by `createGracileHandler` in `./request.ts`.
6
+ *
7
+ * @internal
8
+ */
9
+ import { Readable } from 'node:stream';
10
+ import * as assert from '@gracile/internal-utils/assertions';
11
+ import { renderRouteTemplate } from '../render/route-template.js';
12
+ export const CONTENT_TYPE_HTML = { 'Content-Type': 'text/html' };
13
+ export const PREMISE_REGEXES = {
14
+ properties: /\/__(.*?)\.props\.json$/,
15
+ document: /\/__(.*?)\.doc\.html$/,
16
+ };
17
+ // ── 1. Rewrite hidden route siblings ─────────────────────────────────
18
+ /**
19
+ * Strip the `/__…` suffix so hidden-sibling URLs (premises) resolve to
20
+ * the parent route.
21
+ *
22
+ * @example
23
+ * rewriteHiddenRoutes('http://localhost/blog/__index.props.json')
24
+ * // → 'http://localhost/blog/'
25
+ */
26
+ export function rewriteHiddenRoutes(url) {
27
+ return url.replace(/\/__(.*)$/, '/');
28
+ }
29
+ // ── 2. Resolve premises ──────────────────────────────────────────────
30
+ /**
31
+ * Determine if the incoming request targets a premises endpoint
32
+ * (`__index.props.json` or `__index.doc.html`) and whether the config
33
+ * allows it.
34
+ *
35
+ * @returns A descriptor when premises are enabled, or `null` when not.
36
+ * @throws When a premise URL is hit but premises are not enabled.
37
+ */
38
+ export function resolvePremises(requestedUrl, gracileConfig) {
39
+ const propertiesOnly = PREMISE_REGEXES.properties.test(requestedUrl);
40
+ const documentOnly = PREMISE_REGEXES.document.test(requestedUrl);
41
+ const allowPremises = Boolean(gracileConfig.pages?.premises?.expose);
42
+ if (allowPremises === false && (propertiesOnly || documentOnly))
43
+ throw new Error('Accessed a page premise but they are not activated. You must enable `pages.premises.expose`.');
44
+ if (allowPremises)
45
+ return { propertiesOnly, documentOnly };
46
+ return null;
47
+ }
48
+ /**
49
+ * Dispatch the user's route handler (top-level function or method-map).
50
+ *
51
+ * This determines whether to call the handler, which method to use,
52
+ * and whether to short-circuit with premises or a 405.
53
+ */
54
+ export async function executeHandler(options) {
55
+ const { routeInfos, method, request, fullUrl, locals, responseInit, premises, routeTemplateOptions, } = options;
56
+ const handler = routeInfos.routeModule.handler;
57
+ const shouldDispatch = ('handler' in routeInfos.routeModule && handler !== undefined) ||
58
+ // NOTE: When a handler exists but has no GET key, and the request
59
+ // method is not GET, we still dispatch to let it handle the method.
60
+ (handler && 'GET' in handler === false && method !== 'GET');
61
+ if (!shouldDispatch)
62
+ return { type: 'fallthrough' };
63
+ // Build the frozen context passed to the user handler.
64
+ let providedLocals = {};
65
+ if (locals && assert.isUnknownObject(locals))
66
+ providedLocals = locals;
67
+ const routeContext = Object.freeze({
68
+ request,
69
+ url: new URL(fullUrl),
70
+ responseInit,
71
+ params: routeInfos.params,
72
+ locals: providedLocals,
73
+ });
74
+ const hasTopLevelHandler = typeof handler === 'function';
75
+ if (!hasTopLevelHandler && !(method in handler)) {
76
+ const statusText = `This route doesn't handle the \`${method}\` method!`;
77
+ return {
78
+ type: 'response',
79
+ value: {
80
+ response: new Response(statusText, { status: 405, statusText }),
81
+ },
82
+ };
83
+ }
84
+ const handlerWithMethod = hasTopLevelHandler
85
+ ? handler
86
+ : handler[method];
87
+ if (typeof handlerWithMethod !== 'function')
88
+ throw new TypeError('Handler must be a function.');
89
+ const handlerOutput = await Promise.resolve(handlerWithMethod(routeContext));
90
+ // User returned a raw Response — pass it through.
91
+ if (assert.isResponseOrPatchedResponse(handlerOutput))
92
+ return { type: 'output', value: handlerOutput };
93
+ // User returned data — merge into routeInfos.props for template rendering.
94
+ routeTemplateOptions.routeInfos.props = hasTopLevelHandler
95
+ ? handlerOutput
96
+ : { [method]: handlerOutput };
97
+ // Short-circuit for premises.
98
+ if (premises?.documentOnly) {
99
+ const { document } = await renderRouteTemplate(routeTemplateOptions);
100
+ return {
101
+ type: 'response',
102
+ value: {
103
+ response: new Response(document, {
104
+ headers: { ...CONTENT_TYPE_HTML },
105
+ }),
106
+ },
107
+ };
108
+ }
109
+ if (premises?.propertiesOnly)
110
+ return {
111
+ type: 'response',
112
+ value: {
113
+ response: Response.json(routeTemplateOptions.routeInfos.props),
114
+ },
115
+ };
116
+ const output = await renderRouteTemplate(routeTemplateOptions).then((r) => r.output);
117
+ return { type: 'output', value: output };
118
+ }
119
+ // ── 4. Render without handler (template-only) ────────────────────────
120
+ /**
121
+ * Render a page that has no handler — just a document/template.
122
+ * Handles premises short-circuits.
123
+ */
124
+ export async function renderWithoutHandler(options) {
125
+ const { premises, routeTemplateOptions } = options;
126
+ if (premises?.documentOnly) {
127
+ const { document } = await renderRouteTemplate(routeTemplateOptions);
128
+ return {
129
+ response: new Response(document, {
130
+ headers: { ...CONTENT_TYPE_HTML },
131
+ }),
132
+ };
133
+ }
134
+ if (premises?.propertiesOnly)
135
+ return {
136
+ response: Response.json(routeTemplateOptions.routeInfos.props || {}),
137
+ };
138
+ const output = await renderRouteTemplate(routeTemplateOptions).then((r) => r.output);
139
+ return output;
140
+ }
141
+ // ── 5. Build the final response from output ──────────────────────────
142
+ export function isRedirect(response) {
143
+ const location = response.headers.get('location');
144
+ if (response.status >= 300 && response.status <= 303 && location) {
145
+ return { location };
146
+ }
147
+ return null;
148
+ }
149
+ /**
150
+ * Convert a handler/render output (Response or Readable stream) into
151
+ * the final `HandlerResult` shape expected by adapters.
152
+ */
153
+ export function buildResponse(options) {
154
+ const { output, responseInit, vite, logger } = options;
155
+ // Direct Response pass-through (e.g. from handler returning Response)
156
+ if (assert.isResponseOrPatchedResponse(output)) {
157
+ const redirect = isRedirect(output);
158
+ if (redirect?.location)
159
+ return {
160
+ response: Response.redirect(redirect.location, output.status),
161
+ };
162
+ return { response: output };
163
+ }
164
+ // Readable stream — the SSR page render
165
+ if (output instanceof Readable) {
166
+ responseInit.headers = {
167
+ ...responseInit.headers,
168
+ ...CONTENT_TYPE_HTML,
169
+ };
170
+ return {
171
+ body: output.on('error', (error) => {
172
+ const errorMessage = `[SSR Error] There was an error while rendering a template chunk on server-side.\n` +
173
+ `It was omitted from the resulting HTML.\n`;
174
+ if (vite) {
175
+ logger.error(errorMessage + error.stack);
176
+ const payload = {
177
+ type: 'error',
178
+ err: {
179
+ name: 'StreamingError',
180
+ message: errorMessage,
181
+ stack: error.stack ?? 'No stack trace available',
182
+ hint: 'This is often caused by a wrong template location dynamic interpolation.',
183
+ cause: error,
184
+ },
185
+ };
186
+ setTimeout(() => {
187
+ vite.hot.send(payload);
188
+ }, 200);
189
+ }
190
+ else {
191
+ logger.error(errorMessage);
192
+ }
193
+ }),
194
+ init: responseInit,
195
+ };
196
+ }
197
+ return null;
198
+ }
@@ -1,27 +1,14 @@
1
- import { Readable } from 'node:stream';
2
1
  import type { Logger, ViteDevServer } from 'vite';
3
2
  import type * as R from '../routes/route.js';
4
3
  import type { GracileConfig } from '../user-config.js';
5
- type StandardResponse = {
6
- response: Response;
7
- body?: never;
8
- init?: never;
9
- };
10
- type ResponseWithNodeReadable = {
11
- response?: never;
12
- body: Readable;
13
- init: ResponseInit;
14
- };
4
+ import { type HandlerResult } from './request-pipeline.js';
15
5
  export interface AdapterOptions {
16
6
  logger?: Logger;
17
7
  }
18
8
  /**
19
9
  * The underlying handler interface that you can use to build your own adapter.
20
10
  */
21
- export type GracileHandler = (request: Request, locals?: unknown) => Promise<StandardResponse | ResponseWithNodeReadable | null>;
22
- export declare function isRedirect(response: Response): {
23
- location: string;
24
- } | null;
11
+ export type GracileHandler = (request: Request, locals?: unknown) => Promise<HandlerResult>;
25
12
  export declare function createGracileHandler({ vite, routes, routeImports, routeAssets, root, serverMode, gracileConfig, }: {
26
13
  vite?: ViteDevServer | undefined;
27
14
  routes: R.RoutesManifest;
@@ -31,5 +18,5 @@ export declare function createGracileHandler({ vite, routes, routeImports, route
31
18
  serverMode?: boolean | undefined;
32
19
  gracileConfig: GracileConfig;
33
20
  }): GracileHandler;
34
- export {};
21
+ export { type StandardResponse, type ResponseWithNodeReadable, isRedirect, } from './request-pipeline.js';
35
22
  //# sourceMappingURL=request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/server/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAOvC,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAQlD,OAAO,KAAK,KAAK,CAAC,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,KAAK,gBAAgB,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAC3E,KAAK,wBAAwB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAC5B,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,OAAO,KACZ,OAAO,CAAC,gBAAgB,GAAG,wBAAwB,GA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