@dxos/test-utils 0.11.0 → 0.12.0-next-2be9f24c465d98f4bd186aa03ece788902e6c17a

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.
@@ -24,7 +24,8 @@ var findWorkspaceRoot = (startDir) => {
24
24
  let dir = resolve(startDir);
25
25
  while (dir !== "/") {
26
26
  try {
27
- if (existsSync(join(dir, "pnpm-workspace.yaml"))) return dir;
27
+ const workspaceYamlPath = join(dir, "pnpm-workspace.yaml");
28
+ if (existsSync(workspaceYamlPath)) return dir;
28
29
  const pkgPath = join(dir, "package.json");
29
30
  if (JSON.parse(readFileSync(pkgPath, "utf-8")).workspaces) return dir;
30
31
  } catch {}
@@ -42,10 +43,23 @@ var e2ePreset = (testDir) => {
42
43
  const testResultOuputDir = join(workspaceRoot, "test-results/playwright/output", packageDirName);
43
44
  const reporterOutputFile = join(workspaceRoot, "test-results/playwright/report", `${packageDirName}.json`);
44
45
  const browser = process.env.PLAYWRIGHT_BROWSER || (process.env.CI ? "all" : "chromium");
46
+ const sandboxProxy = process.env.CLAUDE_CODE_REMOTE ? process.env.HTTPS_PROXY : void 0;
47
+ const sandboxChromium = sandboxProxy ? { launchOptions: {
48
+ executablePath: "/opt/pw-browsers/chromium",
49
+ args: [
50
+ "--no-sandbox",
51
+ `--proxy-server=${sandboxProxy}`,
52
+ "--proxy-bypass-list=127.0.0.1;localhost",
53
+ "--ssl-version-max=tls1.2"
54
+ ]
55
+ } } : {};
45
56
  const projects = [
46
57
  {
47
58
  name: "chromium",
48
- use: { ...devices["Desktop Chrome"] }
59
+ use: {
60
+ ...devices["Desktop Chrome"],
61
+ ...sandboxChromium
62
+ }
49
63
  },
50
64
  {
51
65
  name: "firefox",
@@ -64,13 +78,13 @@ var e2ePreset = (testDir) => {
64
78
  timeout: 6e4,
65
79
  fullyParallel: true,
66
80
  forbidOnly: !!process.env.CI,
67
- retries: process.env.CI ? 2 : 0,
68
- workers: process.env.CI ? 1 : 4,
69
- reporter: process.env.CI ? [
81
+ retries: 0,
82
+ workers: Number(process.env.PLAYWRIGHT_WORKERS) || 2,
83
+ reporter: [...process.env.CI ? [
70
84
  ["list"],
71
85
  ["json", { outputFile: reporterOutputFile }],
72
86
  ["junit", { outputFile: reporterOutputFile.replace(/\.json$/, ".xml") }]
73
- ] : [["list"]],
87
+ ] : [["list"]]],
74
88
  use: {
75
89
  trace: "retain-on-failure",
76
90
  actionTimeout: 3e4
@@ -110,7 +124,17 @@ var setupPage = async (browser, options = {}) => {
110
124
  };
111
125
  };
112
126
  var storybookUrl = (storyId, port = 9009) => `http://localhost:${port}/iframe.html?id=${storyId}&viewMode=story`;
127
+ /**
128
+ * Playwright `webServer` for a Storybook-backed suite. Readiness is probed by `url` rather than
129
+ * `port` because a `port` probe is a bare TCP check, which `storybook dev` satisfies by binding the
130
+ * socket before it can serve — tests starting in that gap get ERR_CONNECTION_REFUSED.
131
+ */
132
+ var storybookWebServer = (port) => ({
133
+ command: `pnpm storybook dev --ci --quiet --port=${port} --config-dir=.storybook`,
134
+ url: `http://localhost:${port}`,
135
+ reuseExistingServer: false
136
+ });
113
137
  //#endregion
114
- export { e2ePreset, setupPage, storybookUrl };
138
+ export { e2ePreset, setupPage, storybookUrl, storybookWebServer };
115
139
 
116
140
  //# sourceMappingURL=playwright.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"playwright.mjs","names":[],"sources":["../../src/lock.ts","../../src/playwright.ts"],"sourcesContent":["//\n// Copyright 2022 DXOS.org\n//\n\nimport { trigger } from '@dxos/async';\n\n// Copied from @dxos/async.\nexport class Lock {\n private _lastPromise = Promise.resolve();\n\n async executeSynchronized<T>(fun: () => Promise<T>): Promise<T> {\n const prevPromise = this._lastPromise;\n const [getPromise, resolve] = trigger();\n this._lastPromise = getPromise();\n\n await prevPromise;\n try {\n const value = await fun();\n return value;\n } finally {\n resolve();\n }\n }\n}\n","//\n// Copyright 2023 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport { type Browser, type BrowserContext, type Page, type PlaywrightTestConfig, devices } from '@playwright/test';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport pkgUp from 'pkg-up';\n\nimport { Lock } from './lock';\n\nconst findWorkspaceRoot = (startDir: string): string => {\n let dir = resolve(startDir);\n while (dir !== '/') {\n try {\n // Check for pnpm-workspace.yaml first (modern pnpm approach)\n const workspaceYamlPath = join(dir, 'pnpm-workspace.yaml');\n if (existsSync(workspaceYamlPath)) {\n return dir;\n }\n\n // Check for package.json with workspaces field (legacy approach)\n const pkgPath = join(dir, 'package.json');\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n if (pkg.workspaces) {\n return dir;\n }\n } catch {}\n const parent = dirname(dir);\n if (parent === dir) {\n break;\n }\n dir = parent;\n }\n\n throw new Error('Could not find pnpm workspace root');\n};\n\nexport const e2ePreset = (testDir: string): PlaywrightTestConfig => {\n const packageJson = pkgUp.sync({ cwd: testDir });\n const packageDir = packageJson!.split('/').slice(0, -1).join('/');\n const packageDirName = packageDir.split('/').pop();\n if (!packageDirName) {\n throw new Error('packageDirName not found');\n }\n\n const workspaceRoot = findWorkspaceRoot(packageDir);\n const testResultOuputDir = join(workspaceRoot, 'test-results/playwright/output', packageDirName);\n const reporterOutputFile = join(workspaceRoot, 'test-results/playwright/report', `${packageDirName}.json`);\n\n const browser = process.env.PLAYWRIGHT_BROWSER || (process.env.CI ? 'all' : 'chromium');\n const projects = [\n {\n name: 'chromium',\n use: { ...devices['Desktop Chrome'] },\n },\n {\n name: 'firefox',\n use: { ...devices['Desktop Firefox'] },\n },\n {\n name: 'webkit',\n use: { ...devices['Desktop Safari'] },\n },\n ].filter((project) => {\n return browser === 'all' || project.name === browser;\n });\n\n return {\n testDir,\n outputDir: testResultOuputDir,\n // Playwright's default is 30s, which equals the action bound below — leaving a test no budget beyond\n // a single slow action. Storybook-backed suites also pay an on-demand story compile in the first\n // test's `beforeEach`, which alone exceeded 30s. Individual configs may still raise this.\n timeout: 60_000,\n // Run tests in files in parallel.\n fullyParallel: true,\n // Fail the build on CI if you accidentally left test.only in the source code.\n forbidOnly: !!process.env.CI,\n // Retry on CI to ride out the residual d&d / startup flakes while the\n // underlying causes are still being chased. Local runs stay strict so\n // flakes are visible while iterating.\n retries: process.env.CI ? 2 : 0,\n // Opt out of parallel tests on CI.\n workers: process.env.CI ? 1 : 4,\n // Reporter to use. See https://playwright.dev/docs/test-reporters.\n reporter: process.env.CI\n ? [\n ['list'],\n [\n 'json',\n {\n outputFile: reporterOutputFile,\n },\n ],\n ['junit', { outputFile: reporterOutputFile.replace(/\\.json$/, '.xml') }],\n ]\n : [['list']],\n use: {\n trace: 'retain-on-failure',\n // Playwright's default is no limit, so a stuck locator would absorb the whole per-test budget and\n // report a bare `Test timeout` naming nothing.\n actionTimeout: 30_000,\n },\n projects,\n };\n};\n\nexport type SetupOptions = {\n url?: string;\n bridgeLogs?: boolean;\n viewportSize?: Parameters<Page['setViewportSize']>[0];\n};\n\nexport const setupPage = async (browser: Browser | BrowserContext, options: SetupOptions = {}) => {\n const { url, bridgeLogs, viewportSize } = options;\n\n const context = 'newContext' in browser ? await browser.newContext() : browser;\n const page = await context.newPage();\n\n if (viewportSize) {\n await page.setViewportSize(viewportSize);\n }\n\n // TODO(wittjosiah): Remove?\n if (bridgeLogs) {\n const lock = new Lock();\n\n page.on('pageerror', async (error) => {\n await lock.executeSynchronized(async () => {\n // eslint-disable-next-line no-console\n console.log(error);\n });\n });\n\n page.on('console', async (msg) => {\n try {\n const argsPromise = Promise.all(msg.args().map((x) => x.jsonValue()));\n await lock.executeSynchronized(async () => {\n const args = await argsPromise;\n\n if (args.length > 0) {\n console.log(...args);\n } else {\n console.log(msg);\n }\n });\n } catch (err) {\n console.error('Failed to parse message', err);\n }\n });\n }\n\n if (url) {\n await page.goto(url);\n }\n\n return { context, page };\n};\n\nexport const storybookUrl = (storyId: string, port = 9009) =>\n `http://localhost:${port}/iframe.html?id=${story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ChB,QAAQ,IAAI,GAAG,IAAI;UAEnB,QAAQ,IAAI,GAAG;IAEnB,CAAC;GACH,SAAS,KAAK;IACZ,QAAQ,MAAM,2BAA2B,GAAG;GAC9C;EACF,CAAC;CACH;CAEA,IAAI,KACF,MAAM,KAAK,KAAK,GAAG;CAGrB,OAAO;EAAE;EAAS;CAAK;AACzB;AAEA,IAAa,gBAAgB,SAAiB,OAAO,SACnD,oBAAoB,KAAK,kBAAkB,QAAQ"}
1
+ {"version":3,"file":"playwright.mjs","names":[],"sources":["../../src/lock.ts","../../src/playwright.ts"],"sourcesContent":["//\n// Copyright 2022 DXOS.org\n//\n\nimport { trigger } from '@dxos/async';\n\n// Copied from @dxos/async.\nexport class Lock {\n private _lastPromise = Promise.resolve();\n\n async executeSynchronized<T>(fun: () => Promise<T>): Promise<T> {\n const prevPromise = this._lastPromise;\n const [getPromise, resolve] = trigger();\n this._lastPromise = getPromise();\n\n await prevPromise;\n try {\n const value = await fun();\n return value;\n } finally {\n resolve();\n }\n }\n}\n","//\n// Copyright 2023 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport {\n type Browser,\n type BrowserContext,\n type Page,\n type PlaywrightTestConfig,\n type ReporterDescription,\n devices,\n} from '@playwright/test';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport pkgUp from 'pkg-up';\n\nimport { Lock } from './lock';\n\nconst findWorkspaceRoot = (startDir: string): string => {\n let dir = resolve(startDir);\n while (dir !== '/') {\n try {\n // Check for pnpm-workspace.yaml first (modern pnpm approach)\n const workspaceYamlPath = join(dir, 'pnpm-workspace.yaml');\n if (existsSync(workspaceYamlPath)) {\n return dir;\n }\n\n // Check for package.json with workspaces field (legacy approach)\n const pkgPath = join(dir, 'package.json');\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n if (pkg.workspaces) {\n return dir;\n }\n } catch {}\n const parent = dirname(dir);\n if (parent === dir) {\n break;\n }\n dir = parent;\n }\n\n throw new Error('Could not find pnpm workspace root');\n};\n\nexport const e2ePreset = (testDir: string): PlaywrightTestConfig => {\n const packageJson = pkgUp.sync({ cwd: testDir });\n const packageDir = packageJson!.split('/').slice(0, -1).join('/');\n const packageDirName = packageDir.split('/').pop();\n if (!packageDirName) {\n throw new Error('packageDirName not found');\n }\n\n const workspaceRoot = findWorkspaceRoot(packageDir);\n const testResultOuputDir = join(workspaceRoot, 'test-results/playwright/output', packageDirName);\n const reporterOutputFile = join(workspaceRoot, 'test-results/playwright/report', `${packageDirName}.json`);\n\n const browser = process.env.PLAYWRIGHT_BROWSER || (process.env.CI ? 'all' : 'chromium');\n // In the Claude Code cloud sandbox chromium needs a pinned executable, the egress proxy passed via\n // ARGS (Playwright's `proxy:` option drops its bypass list for non-default contexts), and a TLS 1.2\n // cap (see the cloud-sandbox skill). Gated so real dev/CI runs are never silently downgraded.\n const sandboxProxy = process.env.CLAUDE_CODE_REMOTE ? process.env.HTTPS_PROXY : undefined;\n const sandboxChromium = sandboxProxy\n ? {\n launchOptions: {\n executablePath: '/opt/pw-browsers/chromium',\n args: [\n '--no-sandbox',\n `--proxy-server=${sandboxProxy}`,\n '--proxy-bypass-list=127.0.0.1;localhost',\n '--ssl-version-max=tls1.2',\n ],\n },\n }\n : {};\n const projects = [\n {\n name: 'chromium',\n use: { ...devices['Desktop Chrome'], ...sandboxChromium },\n },\n {\n name: 'firefox',\n use: { ...devices['Desktop Firefox'] },\n },\n {\n name: 'webkit',\n use: { ...devices['Desktop Safari'] },\n },\n ].filter((project) => {\n return browser === 'all' || project.name === browser;\n });\n\n return {\n testDir,\n outputDir: testResultOuputDir,\n // Playwright's default is 30s, which equals the action bound below — leaving a test no budget beyond\n // a single slow action. Storybook-backed suites also pay an on-demand story compile in the first\n // test's `beforeEach`, which alone exceeded 30s. Individual configs may still raise this.\n timeout: 60_000,\n // Run tests in files in parallel.\n fullyParallel: true,\n // Fail the build on CI if you accidentally left test.only in the source code.\n forbidOnly: !!process.env.CI,\n // No retries anywhere: retrying hides flakes behind a 3x time cost, making shard timings unusable\n // for sizing the suite. A flake now fails loudly and gets skipped with a TODO instead.\n retries: 0,\n // 4 workers starved shared setup into false \"not stable\"/\"detached\" failures, so 2 is the\n // compromise. `|| 2`, not `??`: an env var set to the empty string (common in Actions) would\n // otherwise coerce to 0 workers.\n workers: Number(process.env.PLAYWRIGHT_WORKERS) || 2,\n // Reporter to use. See https://playwright.dev/docs/test-reporters.\n reporter: [\n ...(process.env.CI\n ? ([\n ['list'],\n [\n 'json',\n {\n outputFile: reporterOutputFile,\n },\n ],\n ['junit', { outputFile: reporterOutputFile.replace(/\\.json$/, '.xml') }],\n ] satisfies ReporterDescription[])\n : ([['list']] satisfies ReporterDescription[])),\n ],\n use: {\n trace: 'retain-on-failure',\n // Playwright's default is no limit, so a stuck locator would absorb the whole per-test budget and\n // report a bare `Test timeout` naming nothing.\n actionTimeout: 30_000,\n },\n projects,\n };\n};\n\nexport type SetupOptions = {\n url?: string;\n bridgeLogs?: boolean;\n viewportSize?: Parameters<Page['setViewportSize']>[0];\n};\n\nexport const setupPage = async (browser: Browser | BrowserContext, options: SetupOptions = {}) => {\n const { url, bridgeLogs, viewportSize } = options;\n\n const context = 'newContext' in browser ? await browser.newContext() : browser;\n const page = await context.newPage();\n\n if (viewportSize) {\n await page.setViewportSize(viewportSize);\n }\n\n // TODO(wittjosiah): Remove?\n if (bridgeLogs) {\n const lock = new Lock();\n\n page.on('pageerror', async (error) => {\n await lock.executeSynchronized(async () => {\n // eslint-disable-next-line no-console\n console.log(error);\n });\n });\n\n page.on('console', async (msg) => {\n try {\n const argsPromise = Promise.all(msg.args().map((x) => x.jsonValue()));\n await lock.executeSynchronized(async () => {\n const args = await argsPromise;\n\n if (args.length > 0) {\n console.log(...args);\n } else {\n console.log(msg);\n }\n });\n } catch (err) {\n console.error('Failed to parse message', err);\n }\n });\n }\n\n if (url) {\n await page.goto(url);\n }\n\n return { context, page };\n};\n\nexport const storybookUrl = (storyId: string, port = 9009) =>\n `http://localhost:${port}/iframe.html?id=${storyId}&viewMode=story`;\n\n/**\n * Playwright `webServer` for a Storybook-backed suite. Readiness is probed by `url` rather than\n * `port` because a `port` probe is a bare TCP check, which `storybook dev` satisfies by binding the\n * socket before it can serve — tests starting in that gap get ERR_CONNECTION_REFUSED.\n */\nexport const storybookWebServer = (port: number) => ({\n command: `pnpm storybook dev --ci --quiet --port=${port} --config-dir=.storybook`,\n url: `http://localhost:${port}`,\n reuseExistingServer: false,\n});\n"],"mappings":";;;;;;AAOA,IAAa,OAAb,MAAkB;CAChB,eAAuB,QAAQ,QAAQ;CAEvC,MAAM,oBAAuB,KAAmC;EAC9D,MAAM,cAAc,KAAK;EACzB,MAAM,CAAC,YAAY,WAAW,QAAQ;EACtC,KAAK,eAAe,WAAW;EAE/B,MAAM;EACN,IAAI;GAEF,OAAO,MADa,IAAI;EAE1B,UAAU;GACR,QAAQ;EACV;CACF;AACF;;;ACHA,IAAM,qBAAqB,aAA6B;CACtD,IAAI,MAAM,QAAQ,QAAQ;CAC1B,OAAO,QAAQ,KAAK;EAClB,IAAI;GAEF,MAAM,oBAAoB,KAAK,KAAK,qBAAqB;GACzD,IAAI,WAAW,iBAAiB,GAC9B,OAAO;GAIT,MAAM,UAAU,KAAK,KAAK,cAAc;GAExC,IADY,KAAK,MAAM,aAAa,SAAS,OAAO,CAChD,CAAA,CAAI,YACN,OAAO;EAEX,QAAQ,CAAC;EACT,MAAM,SAAS,QAAQ,GAAG;EAC1B,IAAI,WAAW,KACb;EAEF,MAAM;CACR;CAEA,MAAM,IAAI,MAAM,oCAAoC;AACtD;AAEA,IAAa,aAAa,YAA0C;CAElE,MAAM,aADc,MAAM,KAAK,EAAE,KAAK,QAAQ,CAC3B,CAAA,CAAa,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,GAAG;CAChE,MAAM,iBAAiB,WAAW,MAAM,GAAG,CAAC,CAAC,IAAI;CACjD,IAAI,CAAC,gBACH,MAAM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U,MAAM,QAAQ,WAAW,IAAI;CACvE,MAAM,OAAO,MAAM,QAAQ,QAAQ;CAEnC,IAAI,cACF,MAAM,KAAK,gBAAgB,YAAY;CAIzC,IAAI,YAAY;EACd,MAAM,OAAO,IAAI,KAAK;EAEtB,KAAK,GAAG,aAAa,OAAO,UAAU;GACpC,MAAM,KAAK,oBAAoB,YAAY;IAEzC,QAAQ,IAAI,KAAK;GACnB,CAAC;EACH,CAAC;EAED,KAAK,GAAG,WAAW,OAAO,QAAQ;GAChC,IAAI;IACF,MAAM,cAAc,QAAQ,IAAI,IAAI,KAAK,CAAC,CAAC,KAAK,MAAM,EAAE,UAAU,CAAC,CAAC;IACpE,MAAM,KAAK,oBAAoB,YAAY;KACzC,MAAM,OAAO,MAAM;KAEnB,IAAI,KAAK,SAAS,GAChB,QAAQ,IAAI,GAAG,IAAI;UAEnB,QAAQ,IAAI,GAAG;IAEnB,CAAC;GACH,SAAS,KAAK;IACZ,QAAQ,MAAM,2BAA2B,GAAG;GAC9C;EACF,CAAC;CACH;CAEA,IAAI,KACF,MAAM,KAAK,KAAK,GAAG;CAGrB,OAAO;EAAE;EAAS;CAAK;AACzB;AAEA,IAAa,gBAAgB,SAAiB,OAAO,SACnD,oBAAoB,KAAK,kBAAkB,QAAQ;;;;;;AAOrD,IAAa,sBAAsB,UAAkB;CACnD,SAAS,0CAA0C,KAAK;CACxD,KAAK,oBAAoB;CACzB,qBAAqB;AACvB"}
@@ -10,4 +10,14 @@ export declare const setupPage: (browser: Browser | BrowserContext, options?: Se
10
10
  page: Page;
11
11
  }>;
12
12
  export declare const storybookUrl: (storyId: string, port?: number) => string;
13
+ /**
14
+ * Playwright `webServer` for a Storybook-backed suite. Readiness is probed by `url` rather than
15
+ * `port` because a `port` probe is a bare TCP check, which `storybook dev` satisfies by binding the
16
+ * socket before it can serve — tests starting in that gap get ERR_CONNECTION_REFUSED.
17
+ */
18
+ export declare const storybookWebServer: (port: number) => {
19
+ command: string;
20
+ url: string;
21
+ reuseExistingServer: boolean;
22
+ };
13
23
  //# sourceMappingURL=playwright.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../../../src/playwright.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAE,KAAK,oBAAoB,EAAW,MAAM,kBAAkB,CAAC;AAkCpH,eAAO,MAAM,SAAS,YAAa,MAAM,KAAG,oBAoE3C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,SAAS,YAAmB,OAAO,GAAG,cAAc,YAAW,YAAY;;;EA4CvF,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa,MAAM,0BACyB,CAAC"}
1
+ {"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../../../src/playwright.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,KAAK,oBAAoB,EAG1B,MAAM,kBAAkB,CAAC;AAkC1B,eAAO,MAAM,SAAS,YAAa,MAAM,KAAG,oBAwF3C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,SAAS,YAAmB,OAAO,GAAG,cAAc,YAAW,YAAY;;;EA4CvF,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa,MAAM,0BACyB,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,SAAU,MAAM;IAC7C,OAAO;IACP,GAAG;IACH,mBAAmB;CACnB,CAAC"}