@multiplatform.one/core 7.11.0 → 7.15.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.
- package/README.md +25 -0
- package/package.json +13 -13
- package/src/app/CreateApp.frappe.spec.tsx +109 -0
- package/src/app/CreateApp.origin.spec.tsx +182 -0
- package/src/app/CreateApp.tsx +67 -16
- package/src/app/CreateRootLayout.hydration.spec.tsx +97 -0
- package/src/app/CreateRootLayout.schemeClass.spec.tsx +165 -0
- package/src/app/CreateRootLayout.web.spec.tsx +12 -1
- package/src/app/CreateRootLayout.web.tsx +7 -10
- package/src/app/TanstackProvider.devtools.spec.tsx +77 -0
- package/src/app/TanstackProvider.tsx +3 -2
- package/src/app/deepLinkPath.spec.ts +23 -0
- package/src/app/deepLinkPath.ts +16 -3
- package/src/app/frappeSocketPort.spec.ts +65 -0
- package/src/app/frappeSocketPort.ts +28 -0
- package/src/app/frappeSyncOptions.ts +20 -0
- package/src/app/index.ts +1 -0
- package/src/app/oneFrappeNavigation.ts +11 -0
- package/src/app/rootLayoutShared.ts +2 -0
- package/src/app/runtimePublicConfigMiddleware.spec.ts +111 -0
- package/src/app/runtimePublicConfigMiddleware.ts +50 -0
- package/types/app/CreateApp.d.ts +37 -10
- package/types/app/CreateApp.d.ts.map +1 -1
- package/types/app/CreateRootLayout.web.d.ts.map +1 -1
- package/types/app/TanstackProvider.d.ts.map +1 -1
- package/types/app/deepLinkPath.d.ts +4 -0
- package/types/app/deepLinkPath.d.ts.map +1 -1
- package/types/app/frappeSocketPort.d.ts +12 -0
- package/types/app/frappeSocketPort.d.ts.map +1 -0
- package/types/app/frappeSyncOptions.d.ts +13 -0
- package/types/app/frappeSyncOptions.d.ts.map +1 -0
- package/types/app/index.d.ts +1 -0
- package/types/app/index.d.ts.map +1 -1
- package/types/app/oneFrappeNavigation.d.ts +4 -0
- package/types/app/oneFrappeNavigation.d.ts.map +1 -0
- package/types/app/rootLayoutShared.d.ts +2 -0
- package/types/app/rootLayoutShared.d.ts.map +1 -1
- package/types/app/runtimePublicConfigMiddleware.d.ts +24 -0
- package/types/app/runtimePublicConfigMiddleware.d.ts.map +1 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { runtimePublicConfigKey, serializeRuntimePublicConfig } from "@multiplatform.one/platform";
|
|
2
|
+
|
|
3
|
+
type MaybeResponse = Response | null | undefined | void;
|
|
4
|
+
|
|
5
|
+
/** The props One hands a route middleware (`one`'s `Middleware`). */
|
|
6
|
+
export interface RuntimePublicConfigMiddlewareProps {
|
|
7
|
+
request: Request;
|
|
8
|
+
next: () => Promise<MaybeResponse>;
|
|
9
|
+
context: unknown;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Publishes the server's runtime PUBLIC config into HTML documents that do
|
|
14
|
+
* not carry it yet: One's SPA-mode shells.
|
|
15
|
+
*
|
|
16
|
+
* An SSR document gets the payload from `RuntimePublicConfigScript`. A SPA
|
|
17
|
+
* shell (`defaultRenderMode: "spa"`: `/`, `/backoffice/*`, `/moves`) is
|
|
18
|
+
* written once by `one build`, so without this every read of `config` on it
|
|
19
|
+
* answered with the build's baked `.env` instead of the deployment's: a
|
|
20
|
+
* `FRAPPE_CATCH_UP_STRATEGY` or `DEBUG` set on the container never reached
|
|
21
|
+
* those pages (MPO-349). The payload goes first in `<head>`, ahead of the
|
|
22
|
+
* app's module scripts, exactly as the SSR document has it.
|
|
23
|
+
*
|
|
24
|
+
* Mount it as the app's root `routes/_middleware.ts`.
|
|
25
|
+
*/
|
|
26
|
+
export async function runtimePublicConfigMiddleware({
|
|
27
|
+
next,
|
|
28
|
+
}: RuntimePublicConfigMiddlewareProps): Promise<MaybeResponse> {
|
|
29
|
+
const response = await next();
|
|
30
|
+
if (!response?.headers.get("content-type")?.startsWith("text/html")) return response;
|
|
31
|
+
// One sends SSR documents as a stream marked no-cache, and those already
|
|
32
|
+
// carry the payload; reading one here would buffer the whole render.
|
|
33
|
+
if (response.headers.has("cache-control")) return response;
|
|
34
|
+
const html = await response.text();
|
|
35
|
+
const headers = new Headers(response.headers);
|
|
36
|
+
headers.delete("content-length");
|
|
37
|
+
return new Response(withRuntimePublicConfig(html), {
|
|
38
|
+
status: response.status,
|
|
39
|
+
statusText: response.statusText,
|
|
40
|
+
headers,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function withRuntimePublicConfig(html: string): string {
|
|
45
|
+
if (html.includes(runtimePublicConfigKey)) return html;
|
|
46
|
+
const head = html.match(/<head(\s[^>]*)?>/i);
|
|
47
|
+
if (head?.index === undefined) return html;
|
|
48
|
+
const at = head.index + head[0].length;
|
|
49
|
+
return `${html.slice(0, at)}<script>${serializeRuntimePublicConfig()}</script>${html.slice(at)}`;
|
|
50
|
+
}
|
package/types/app/CreateApp.d.ts
CHANGED
|
@@ -1,20 +1,41 @@
|
|
|
1
1
|
import { type ComponentType, type PropsWithChildren } from "react";
|
|
2
2
|
import type { ThemeConfig } from "@multiplatform.one/theme";
|
|
3
|
-
import type { FixtureProvider } from "@multiplatform.one/frappe";
|
|
3
|
+
import type { FixtureProvider, SyncOptions } from "@multiplatform.one/frappe";
|
|
4
4
|
export type ProviderComponent = ComponentType<PropsWithChildren>;
|
|
5
|
+
/** The parts of `window.location` the loopback rewrite reads. */
|
|
6
|
+
export interface PageLocation {
|
|
7
|
+
protocol: string;
|
|
8
|
+
hostname: string;
|
|
9
|
+
port: string;
|
|
10
|
+
}
|
|
5
11
|
/**
|
|
6
12
|
* Follow the page origin when a loopback-configured backend is opened from a
|
|
7
|
-
* non-loopback host.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* the
|
|
13
|
-
*
|
|
13
|
+
* non-loopback host.
|
|
14
|
+
*
|
|
15
|
+
* Dev: configs point at `http://localhost:8000`, which is correct on the dev
|
|
16
|
+
* machine but breaks the moment the app is opened via a LAN IP
|
|
17
|
+
* (`http://10.x.x.x:3456` → the API and the Socket.IO handshake would target
|
|
18
|
+
* the *visitor's* machine, and Chromium's Local Network Access policy flags
|
|
19
|
+
* the cross-origin loopback fetch). Rewriting only the hostname keeps the
|
|
20
|
+
* configured scheme and port, so the dev bench beside the dev server answers.
|
|
21
|
+
*
|
|
22
|
+
* Production: One renders SPA-mode pages (`/`, `/backoffice/*`) to static
|
|
23
|
+
* HTML at build time, so their config payload carries the build's `.env`
|
|
24
|
+
* BASE_URL, not the container's. A deployment serves the bench through its
|
|
25
|
+
* own origin (MPO-322), so scheme, host and port all follow the page, and
|
|
26
|
+
* `frappeSocketPort` then drops the baked socketio port (MPO-328).
|
|
27
|
+
*
|
|
28
|
+
* Only ever triggers in a browser whose page host is itself not loopback, so
|
|
29
|
+
* SSR, native and same-machine dev are untouched. Non-http(s) pages (Tauri,
|
|
30
|
+
* extensions) keep the dev rewrite.
|
|
14
31
|
*/
|
|
15
|
-
export declare function followPageOriginForLoopback(configured: string): string;
|
|
32
|
+
export declare function followPageOriginForLoopback(configured: string, page?: PageLocation | undefined, dev?: boolean): string;
|
|
16
33
|
export interface TanstackConfig {
|
|
17
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Show React Query devtools (web only, ignored on native and in Storybook).
|
|
36
|
+
* Omitted, they show in a dev build or when DEBUG=1, and a production
|
|
37
|
+
* visitor never loads them.
|
|
38
|
+
*/
|
|
18
39
|
debug?: boolean;
|
|
19
40
|
/**
|
|
20
41
|
* Shake the device to open the devtools shell (web only; requires
|
|
@@ -97,6 +118,12 @@ export interface FrappeConfig {
|
|
|
97
118
|
token?: string | (() => string | Promise<string>);
|
|
98
119
|
type?: string;
|
|
99
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* Options for the live data engine. When `catchUpStrategy` is omitted,
|
|
123
|
+
* FRAPPE_CATCH_UP_STRATEGY (`cdc` or `snapshot`) is read at runtime; a
|
|
124
|
+
* bench without the `live` app needs `snapshot`, since CDC catch-up calls it.
|
|
125
|
+
*/
|
|
126
|
+
syncOptions?: SyncOptions;
|
|
100
127
|
/**
|
|
101
128
|
* Fixture corpus every Frappe read and write is served from — the whole
|
|
102
129
|
* app runs with no bench and no network. Setting it enables the provider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateApp.d.ts","sourceRoot":"","sources":["../../src/app/CreateApp.tsx"],"names":[],"mappings":"AAAA,OAAc,
|
|
1
|
+
{"version":3,"file":"CreateApp.d.ts","sourceRoot":"","sources":["../../src/app/CreateApp.tsx"],"names":[],"mappings":"AAAA,OAAc,EAMZ,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAEvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAW9E,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;AAIjE,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAOD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,YAAY,GAAG,SAAiC,EACtD,GAAG,GAAE,OAAe,GACnB,MAAM,CAcR;AAMD,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM;QACpB,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;QACrC,KAAK,EAAE,OAAO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AAE,OAAO,GAAG,MAAM,CAAC;IAC/B,gFAAgF;IAChF,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAQD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,eAAe;;iDAyMW,gBAAgB;;;cA2B5D,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,aAAa,CAAC,CAAC,CAAC,KAAG,aAAa,CAAC,CAAC,CAAC;wBAatE,eAAe;EAKzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateRootLayout.web.d.ts","sourceRoot":"","sources":["../../src/app/CreateRootLayout.web.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreateRootLayout.web.d.ts","sourceRoot":"","sources":["../../src/app/CreateRootLayout.web.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAQtD,OAAO,KAAK,EAAE,sBAAsB,EAAkB,MAAM,oBAAoB,CAAC;AAEjF,YAAY,EACV,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,sBAAsB,GAAG,aAAa,CAqL3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TanstackProvider.d.ts","sourceRoot":"","sources":["../../src/app/TanstackProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAiBrE,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,cAAc,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TanstackProvider.d.ts","sourceRoot":"","sources":["../../src/app/TanstackProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAiBrE,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,cAAc,GAAG,iBAAiB,CA6CxF"}
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
* the first path segment: `myapp://pos` → `/pos`). Returns null for empty /
|
|
12
12
|
* root-only URLs so callers can no-op instead of clobbering the current
|
|
13
13
|
* route.
|
|
14
|
+
*
|
|
15
|
+
* Expo Go launches with `exp://<dev host>` and carries a route only after
|
|
16
|
+
* `/--/`; the dev client launches with `<scheme>://expo-development-client`.
|
|
17
|
+
* Both name the dev server, not a route.
|
|
14
18
|
*/
|
|
15
19
|
export declare function deepLinkUrlToPath(url: string | null | undefined): string | null;
|
|
16
20
|
//# sourceMappingURL=deepLinkPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepLinkPath.d.ts","sourceRoot":"","sources":["../../src/app/deepLinkPath.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"deepLinkPath.d.ts","sourceRoot":"","sources":["../../src/app/deepLinkPath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAS/E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Socket.IO port for FRAPPE_SOCKETIO_PORT, or undefined when the page
|
|
3
|
+
* reaches the bench through its own origin.
|
|
4
|
+
*
|
|
5
|
+
* FRAPPE_SOCKETIO_PORT is the dev bench's socketio port beside its web port
|
|
6
|
+
* (9000 next to 8000), and every build bakes it in from .env. A deployment
|
|
7
|
+
* whose BASE_URL is the page origin routes /socket.io/ on that origin too, so
|
|
8
|
+
* the baked port sent realtime to <page host>:9000, where nothing listens.
|
|
9
|
+
* Without a port the socket derives from BASE_URL, which is the page origin.
|
|
10
|
+
*/
|
|
11
|
+
export declare function frappeSocketPort(configured: string | undefined, baseURL: string | undefined, pageOrigin?: string | undefined): number | undefined;
|
|
12
|
+
//# sourceMappingURL=frappeSocketPort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frappeSocketPort.d.ts","sourceRoot":"","sources":["../../src/app/frappeSocketPort.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,UAAU,GAAE,MAAM,GAAG,SAA+B,GACnD,MAAM,GAAG,SAAS,CAQpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SyncOptions } from "@multiplatform.one/frappe";
|
|
2
|
+
/**
|
|
3
|
+
* The sync options the Frappe provider runs with: the app's own, plus the
|
|
4
|
+
* catch-up strategy FRAPPE_CATCH_UP_STRATEGY names when the app sets none.
|
|
5
|
+
*
|
|
6
|
+
* CDC catch-up calls the bench's `live` app, so a deployment whose bench does
|
|
7
|
+
* not carry it sets FRAPPE_CATCH_UP_STRATEGY=snapshot and every catch-up
|
|
8
|
+
* re-reads through /api/resource instead. The value is read when the page
|
|
9
|
+
* runs, not baked into the build, so one image serves both kinds of bench.
|
|
10
|
+
* Anything other than `cdc` or `snapshot` is ignored.
|
|
11
|
+
*/
|
|
12
|
+
export declare function frappeSyncOptions(syncOptions: SyncOptions | undefined, configuredStrategy: string | undefined): SyncOptions | undefined;
|
|
13
|
+
//# sourceMappingURL=frappeSyncOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frappeSyncOptions.d.ts","sourceRoot":"","sources":["../../src/app/frappeSyncOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACrC,WAAW,GAAG,SAAS,CAIzB"}
|
package/types/app/index.d.ts
CHANGED
package/types/app/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oneFrappeNavigation.d.ts","sourceRoot":"","sources":["../../src/app/oneFrappeNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,EAAE,gBAMjC,CAAC"}
|
|
@@ -4,6 +4,8 @@ import type { AppProviderProps } from "./CreateApp";
|
|
|
4
4
|
export interface HeadConfig {
|
|
5
5
|
/** Path to favicon (e.g. "/favicon.svg"). */
|
|
6
6
|
favicon?: string;
|
|
7
|
+
/** The document `<title>`. */
|
|
8
|
+
title?: string;
|
|
7
9
|
/**
|
|
8
10
|
* Preload + declare the default Inter faces (400/700) in the document
|
|
9
11
|
* head with `font-display: optional` so first paint is font-stable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootLayoutShared.d.ts","sourceRoot":"","sources":["../../src/app/rootLayoutShared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,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CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type MaybeResponse = Response | null | undefined | void;
|
|
2
|
+
/** The props One hands a route middleware (`one`'s `Middleware`). */
|
|
3
|
+
export interface RuntimePublicConfigMiddlewareProps {
|
|
4
|
+
request: Request;
|
|
5
|
+
next: () => Promise<MaybeResponse>;
|
|
6
|
+
context: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Publishes the server's runtime PUBLIC config into HTML documents that do
|
|
10
|
+
* not carry it yet: One's SPA-mode shells.
|
|
11
|
+
*
|
|
12
|
+
* An SSR document gets the payload from `RuntimePublicConfigScript`. A SPA
|
|
13
|
+
* shell (`defaultRenderMode: "spa"`: `/`, `/backoffice/*`, `/moves`) is
|
|
14
|
+
* written once by `one build`, so without this every read of `config` on it
|
|
15
|
+
* answered with the build's baked `.env` instead of the deployment's: a
|
|
16
|
+
* `FRAPPE_CATCH_UP_STRATEGY` or `DEBUG` set on the container never reached
|
|
17
|
+
* those pages (MPO-349). The payload goes first in `<head>`, ahead of the
|
|
18
|
+
* app's module scripts, exactly as the SSR document has it.
|
|
19
|
+
*
|
|
20
|
+
* Mount it as the app's root `routes/_middleware.ts`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function runtimePublicConfigMiddleware({ next, }: RuntimePublicConfigMiddlewareProps): Promise<MaybeResponse>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=runtimePublicConfigMiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimePublicConfigMiddleware.d.ts","sourceRoot":"","sources":["../../src/app/runtimePublicConfigMiddleware.ts"],"names":[],"mappings":"AAEA,KAAK,aAAa,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;AAExD,qEAAqE;AACrE,MAAM,WAAW,kCAAkC;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,6BAA6B,CAAC,EAClD,IAAI,GACL,EAAE,kCAAkC,GAAG,OAAO,CAAC,aAAa,CAAC,CAc7D"}
|