@axe-core/watcher 3.14.2-next.ffe74e2a → 3.14.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/dist/Controller.js +1 -0
  2. package/dist/Controller.js.map +1 -1
  3. package/dist/EventForwarder.js +7 -0
  4. package/dist/EventForwarder.js.map +1 -1
  5. package/dist/createDebugger.js +15 -0
  6. package/dist/createDebugger.js.map +1 -1
  7. package/dist/cypress.js +45 -0
  8. package/dist/cypress.js.map +1 -1
  9. package/dist/cypressCommands.js +68 -2
  10. package/dist/cypressCommands.js.map +1 -1
  11. package/dist/git.js +16 -0
  12. package/dist/git.js.map +1 -1
  13. package/dist/playwright.js +13 -1
  14. package/dist/playwright.js.map +1 -1
  15. package/dist/playwrightTest.js +15 -0
  16. package/dist/playwrightTest.js.map +1 -1
  17. package/dist/playwrightWrapping.js +11 -0
  18. package/dist/playwrightWrapping.js.map +1 -1
  19. package/dist/puppeteer.js +13 -1
  20. package/dist/puppeteer.js.map +1 -1
  21. package/dist/puppeteerWrapping.js +13 -2
  22. package/dist/puppeteerWrapping.js.map +1 -1
  23. package/dist/sendResultsToServer.js +15 -0
  24. package/dist/sendResultsToServer.js.map +1 -1
  25. package/dist/utils/constants.js +3 -0
  26. package/dist/utils/constants.js.map +1 -1
  27. package/dist/utils/initializeSession.js +7 -0
  28. package/dist/utils/initializeSession.js.map +1 -1
  29. package/dist/utils/initializeSession.test.js +6 -0
  30. package/dist/utils/initializeSession.test.js.map +1 -1
  31. package/dist/utils/mergeChromeArgs.js +40 -0
  32. package/dist/utils/mergeChromeArgs.js.map +1 -1
  33. package/dist/utils/mergeChromeArgs.test.js +3 -0
  34. package/dist/utils/mergeChromeArgs.test.js.map +1 -1
  35. package/dist/utils/proxyHandlers.js +19 -0
  36. package/dist/utils/proxyHandlers.js.map +1 -1
  37. package/dist/utils/proxyHandlers.test.js +1 -0
  38. package/dist/utils/proxyHandlers.test.js.map +1 -1
  39. package/dist/utils/readVariables.js +4 -0
  40. package/dist/utils/readVariables.js.map +1 -1
  41. package/dist/utils/updateAutoAnalyze.js +5 -0
  42. package/dist/utils/updateAutoAnalyze.js.map +1 -1
  43. package/dist/utils/validateAxeRunContext.js +16 -0
  44. package/dist/utils/validateAxeRunContext.js.map +1 -1
  45. package/dist/utils/validateAxeRunContext.test.js +3 -0
  46. package/dist/utils/validateAxeRunContext.test.js.map +1 -1
  47. package/dist/utils/validateAxeRunOptions.js +51 -0
  48. package/dist/utils/validateAxeRunOptions.js.map +1 -1
  49. package/dist/utils/validateAxeRunOptions.test.js +15 -0
  50. package/dist/utils/validateAxeRunOptions.test.js.map +1 -1
  51. package/dist/utils/writeExtensionManifest.js +1 -0
  52. package/dist/utils/writeExtensionManifest.js.map +1 -1
  53. package/dist/utils/writeVariables.js +14 -1
  54. package/dist/utils/writeVariables.js.map +1 -1
  55. package/dist/utils/writeVariables.test.js +1 -0
  56. package/dist/utils/writeVariables.test.js.map +1 -1
  57. package/dist/wdio.d.ts +3 -5
  58. package/dist/wdio.js +20 -0
  59. package/dist/wdio.js.map +1 -1
  60. package/dist/webdriver.js +12 -1
  61. package/dist/webdriver.js.map +1 -1
  62. package/extension/background.js +1 -1
  63. package/extension/content.js +1 -1
  64. package/package.json +5 -5
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const path_1 = __importDefault(require("path"));
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const constants_1 = require("./constants");
9
+ /** Update the extension manifest file. */
9
10
  function writeManifest({ all_frames, exclude_globs }) {
10
11
  const manifestPath = path_1.default.join(constants_1.PATH_TO_EXTENSION, 'manifest.json');
11
12
  const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf-8'));
@@ -1 +1 @@
1
- {"version":3,"file":"writeExtensionManifest.js","sourceRoot":"","sources":["../../src/utils/writeExtensionManifest.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AACvB,4CAAmB;AACnB,2CAA+C;AAQ/C,SAAS,aAAa,CAAC,EACrB,UAAU,EACV,aAAa,EACO;IACpB,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,6BAAiB,EAAE,eAAe,CAAC,CAAA;IAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;IACnE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,UAAU,CAAA;IACnD,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,aAAa,CAAA;IACzD,YAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AACnE,CAAC;AAED,kBAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"writeExtensionManifest.js","sourceRoot":"","sources":["../../src/utils/writeExtensionManifest.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AACvB,4CAAmB;AACnB,2CAA+C;AAO/C,0CAA0C;AAC1C,SAAS,aAAa,CAAC,EACrB,UAAU,EACV,aAAa,EACO;IACpB,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,6BAAiB,EAAE,eAAe,CAAC,CAAA;IAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;IACnE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,UAAU,CAAA;IACnD,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,aAAa,CAAA;IACzD,YAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AACnE,CAAC;AAED,kBAAe,aAAa,CAAA"}
@@ -35,8 +35,16 @@ const initializeSession_1 = __importDefault(require("./initializeSession"));
35
35
  const validateAxeRunContext_1 = require("./validateAxeRunContext");
36
36
  const isValidExcludePattern_1 = __importDefault(require("./isValidExcludePattern"));
37
37
  const debugLogger = (0, createDebugger_1.default)('config:writeVariables');
38
+ // Read the version from package.json, but do not include the file in the build.
39
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
38
40
  const { version } = require('../../package.json');
39
- function writeVariables({ apiKey, autoAnalyze, cypress, serverURL, sessionId, runContext, runOptions, takeScreenshots, experimentalAdvancedRules, excludeUrlPatterns, buildID }) {
41
+ /** Write the user's settings to the disk, so the extension can load them. */
42
+ function writeVariables({ apiKey, autoAnalyze, cypress, serverURL, sessionId, runContext, runOptions,
43
+ // @ts-expect-error Feature flag, not part of public type
44
+ takeScreenshots,
45
+ // @ts-expect-error Feature flag, not part of public type
46
+ experimentalAdvancedRules, excludeUrlPatterns, buildID }) {
47
+ // only log the properties if they are not undefined
40
48
  debugLogger('Received configuration:', {
41
49
  apiKey: '<redacted>',
42
50
  ...(autoAnalyze !== undefined && { autoAnalyze }),
@@ -95,7 +103,12 @@ function writeVariables({ apiKey, autoAnalyze, cypress, serverURL, sessionId, ru
95
103
  if (excludeUrlPatterns === null || excludeUrlPatterns === void 0 ? void 0 : excludeUrlPatterns.length) {
96
104
  (0, isValidExcludePattern_1.default)(excludeUrlPatterns);
97
105
  }
106
+ // Note: If a build ID is provided the session ID will be consistent
107
+ // so there is no need to write to the file.
108
+ // between workers/machines (parallel runners)
98
109
  if (!buildID) {
110
+ // When a custom session ID is not provided, attempt to read it from the filesystem.
111
+ // This enables multi-process/multi-browser test suites to all use the same session ID.
99
112
  if (!sessionId && fs_1.default.existsSync(constants_1.PATH_TO_SESSION_FILE)) {
100
113
  debugLogger('Reading session ID from file for WDIO Test Runner');
101
114
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"writeVariables.js","sourceRoot":"","sources":["../../src/utils/writeVariables.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;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AChE,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,gCAAoB,EAAE,MAAM,CAAC,CAAC,CAAA;gBACtE,SAAS,GAAG,IAAI,CAAC,EAAY,CAAA;YAC/B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,yCAAyC,KAAK,EAAE,CAAC,CAAA;YACnE,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAc;QAC3B,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,UAAU,IAAI,SAAS;QACnC,gBAAgB,EAAE,CAAC,CAAC,eAAe;QACnC,YAAY,EAAE,CAAC,CAAC,WAAW;QAC3B,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,2BAA2B,EAAE,CAAC,CAAC,yBAAyB;QACxD,WAAW,EAAE,UAAU,IAAI,IAAI;QAC/B,WAAW,EAAE,UAAU,IAAI,IAAI;QAC/B,QAAQ,EAAE,OAAO;QACjB,oBAAoB,EAAE,kBAAkB,IAAI,IAAI;KACjD,CAAA;IAED,YAAE,CAAC,aAAa,CAAC,uCAA2B,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAA;AAC1E,CAAC;AAED,kBAAe,cAAc,CAAA"}
@@ -61,6 +61,7 @@ describe('writeVariables', () => {
61
61
  apiKey: 'abc',
62
62
  serverURL: 'http://localhost:3000/',
63
63
  sessionId: '123',
64
+ // @ts-expect-error // Feature flag, not part of public type
64
65
  takeScreenshots: true,
65
66
  experimentalAdvancedRules: true
66
67
  });
@@ -1 +1 @@
1
- {"version":3,"file":"writeVariables.test.js","sourceRoot":"","sources":["../../src/utils/writeVariables.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBAAc;AACd,+BAA6B;AAC7B,kDAAyB;AACzB,4CAAmB;AACnB,4CAA6B;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AC,CAAC,CAAC,CAAW,CACtB,CAAA;gBAEd,aAAM,CAAC,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAA;YAC5C,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;YACnC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;gBACtB,aAAM,CAAC,MAAM,CAAC,GAAG,EAAE;oBACjB,IAAA,wBAAc,EAAC;wBACb,MAAM,EAAE,KAAK;wBACb,kBAAkB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAQ;qBAC7C,CAAC,CAAA;gBACJ,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/dist/wdio.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import type { Options } from '@wdio/types';
2
- import type { Browser as WDIOBrowser, BrowserCommandsType, ElementCommandsType, remote } from 'webdriverio';
2
+ import type { Browser, BrowserCommandsType, ElementCommandsType, RemoteOptions } from 'webdriverio';
3
3
  import Controller from './Controller';
4
4
  import { type Configuration } from './utils/writeVariables';
5
- type RemoteOptions = Parameters<typeof remote>[0];
6
5
  type Options = RemoteOptions & Configuration;
7
- type Browser = WebdriverIO.Browser | WDIOBrowser;
8
6
  /**
9
7
  * Creates a WebDriverIO config that uses axe extension
10
8
  *
@@ -12,9 +10,9 @@ type Browser = WebdriverIO.Browser | WDIOBrowser;
12
10
  */
13
11
  export declare function wdioConfig({ axe, ...options }: Options): RemoteOptions;
14
12
  /** @deprecated This method of configuring the TestRunner is no longer supported. */
15
- export declare function wdioTestRunner(axe: Configuration['axe'], config: WebdriverIO.Config): WebdriverIO.Config;
13
+ export declare function wdioTestRunner(axe: Configuration['axe'], config: Options.Testrunner): Options.Testrunner;
16
14
  /** Configure WDIO TestRunner with axe Watcher. */
17
- export declare function wdioTestRunner({ axe, ...config }: WebdriverIO.Config & Configuration): WebdriverIO.Config;
15
+ export declare function wdioTestRunner({ axe, ...config }: Options.Testrunner & Configuration): Options.Testrunner;
18
16
  export declare class WdioController extends Controller {
19
17
  private driver;
20
18
  constructor(driver: Browser);
package/dist/wdio.js CHANGED
@@ -13,10 +13,18 @@ const constants_1 = require("./utils/constants");
13
13
  const headlessNotSupportedError_1 = require("./utils/headlessNotSupportedError");
14
14
  const mergeChromeArgs_1 = __importDefault(require("./utils/mergeChromeArgs"));
15
15
  const noop = () => {
16
+ // Nothing.
16
17
  };
18
+ /**
19
+ * Creates a WebDriverIO config that uses axe extension
20
+ *
21
+ * @param arg Config to extend
22
+ */
17
23
  function wdioConfig({ axe, ...options }) {
18
24
  var _a;
19
25
  (0, writeVariables_1.default)(axe);
26
+ // Disable eslint. Wdio doesn't export this property even though they support it.
27
+ /* eslint-disable @typescript-eslint/no-explicit-any */
20
28
  const chromeOpts = ((_a = options.capabilities) === null || _a === void 0 ? void 0 : _a['goog:chromeOptions']) || {};
21
29
  const args = chromeOpts.args || [];
22
30
  if (['headless', '--headless'].some(flag => args.includes(flag))) {
@@ -28,6 +36,8 @@ function wdioConfig({ axe, ...options }) {
28
36
  ...options === null || options === void 0 ? void 0 : options.capabilities,
29
37
  browserName: 'chrome',
30
38
  'goog:chromeOptions': {
39
+ // Note: wdio v7 passes `--disable-extensions` as one of the default args.
40
+ // we need to make sure we still append our args to the list.
31
41
  args: (0, mergeChromeArgs_1.default)(args, { disableOtherExtensions: true })
32
42
  }
33
43
  }
@@ -49,6 +59,7 @@ function wdioTestRunner(...params) {
49
59
  const capabilities = config.capabilities || [
50
60
  { [CHROME_OPTIONS]: { args: [] } }
51
61
  ];
62
+ // has to be any because type is not exported
52
63
  const firstCapability = capabilities[0];
53
64
  firstCapability[CHROME_OPTIONS] = firstCapability[CHROME_OPTIONS] || {};
54
65
  const chromeOpts = firstCapability[CHROME_OPTIONS];
@@ -65,17 +76,23 @@ function wdioTestRunner(...params) {
65
76
  onPrepare(...prepareParams) {
66
77
  const sessionId = axe.sessionId;
67
78
  const buildID = axe.buildID;
79
+ // Note: we only want to write a file if a build ID is not provided.
80
+ // as the build ID will ensure the session ID is consistent between workers/machines.
68
81
  if (!buildID) {
69
82
  fs_1.default.writeFileSync(constants_1.PATH_TO_SESSION_FILE, JSON.stringify({ id: sessionId }));
70
83
  }
84
+ // @ts-expect-error TS is angry about calling this ¯\_(ツ)_/¯
71
85
  return onPrepare(...prepareParams);
72
86
  },
87
+ // Remove the file, preventing other sessions from reusing its ID.
73
88
  onComplete(...completeParams) {
74
89
  try {
75
90
  fs_1.default.unlinkSync(constants_1.PATH_TO_SESSION_FILE);
76
91
  }
77
92
  catch (_a) {
93
+ // Oh well.
78
94
  }
95
+ // @ts-expect-error TS is angry about calling this ¯\_(ツ)_/¯
79
96
  return onComplete(...completeParams);
80
97
  }
81
98
  };
@@ -97,6 +114,7 @@ class WdioController extends Controller_1.default {
97
114
  }
98
115
  }
99
116
  exports.WdioController = WdioController;
117
+ /** Webdriver `browser` methods. */
100
118
  exports.WRAPPED_BROWSER_METHODS = [
101
119
  'reloadSession',
102
120
  'setWindowSize',
@@ -107,6 +125,7 @@ exports.WRAPPED_BROWSER_METHODS = [
107
125
  'url',
108
126
  'waitUntil'
109
127
  ];
128
+ /** Wrapped `element` methods. */
110
129
  exports.WRAPPED_ELEMENT_METHODS = [
111
130
  'addValue',
112
131
  'clearValue',
@@ -123,6 +142,7 @@ exports.WRAPPED_ELEMENT_METHODS = [
123
142
  'waitForExist',
124
143
  'waitUntil'
125
144
  ];
145
+ /** Wrap the given WDIO `browser` object, ensuring axe-core analysis is run after each command. */
126
146
  const wrapWdio = (browser, controller) => {
127
147
  const wrapper = async (fn, ...args) => {
128
148
  const res = await fn(...args);
package/dist/wdio.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"wdio.js","sourceRoot":"","sources":["../src/wdio.ts"],"names":[],"mappings":";;;;;;AAkCA,gCA0B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,OAAO,CAAC,gBAAgB,CAAC,MAAa,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;IACxD,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAtBY,QAAA,QAAQ,YAsBpB"}
package/dist/webdriver.js CHANGED
@@ -11,17 +11,28 @@ const headlessNotSupportedError_1 = require("./utils/headlessNotSupportedError")
11
11
  const mergeChromeArgs_1 = __importDefault(require("./utils/mergeChromeArgs"));
12
12
  var webdriverWrapping_1 = require("./webdriverWrapping");
13
13
  Object.defineProperty(exports, "wrapWebdriver", { enumerable: true, get: function () { return webdriverWrapping_1.wrapDriver; } });
14
+ /**
15
+ * Creates a Selenium config that uses axe extension
16
+ *
17
+ * @param arg Config to extend
18
+ */
14
19
  function webdriverConfig(arg) {
15
20
  var _a;
21
+ // Lazily require `chrome` to avoid Puppeteer/Playwright/WDIO users from needing `selenium-webdriver` installed.
22
+ // eslint-disable-next-line import/no-extraneous-dependencies, @typescript-eslint/no-require-imports
16
23
  const chrome = require('selenium-webdriver/chrome');
17
24
  const { axe, options } = arg;
18
25
  (0, writeVariables_1.default)(axe);
19
26
  const opts = options ? options : new chrome.Options();
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
28
  const existingArgs = (((_a = opts === null || opts === void 0 ? void 0 : opts.options_) === null || _a === void 0 ? void 0 : _a.args) || []);
21
29
  opts.options_.args = (0, mergeChromeArgs_1.default)(existingArgs, {
22
30
  disableOtherExtensions: false
23
31
  });
24
- if (['headless', '--headless'].some(flag => { var _a, _b; return (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.options_) === null || _a === void 0 ? void 0 : _a.args) === null || _b === void 0 ? void 0 : _b.includes(flag); })) {
32
+ // Note: fragile, but selenium does not give us a real way to check this
33
+ if (['headless', '--headless'].some(flag => { var _a, _b;
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
+ return (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.options_) === null || _a === void 0 ? void 0 : _a.args) === null || _b === void 0 ? void 0 : _b.includes(flag); })) {
25
36
  throw new headlessNotSupportedError_1.HeadlessNotSupportedError('In WebdriverJS, use "chromeOptions.addArguments(\'--headless=new\')" instead of "setHeadless(true)" or "addArguments(\'--headless\')"');
26
37
  }
27
38
  return opts;
@@ -1 +1 @@
1
- {"version":3,"file":"webdriver.js","sourceRoot":"","sources":["../src/webdriver.ts"],"names":[],"mappings":";;;;;;AAmBA,0CA6BC;AA9CD,8DAAqC;AACrC,4EAA2E;AAC3E,iFAA6E;AAC7E,8EAAqD;AAErD,yDAAiE;AAAxD,kHAAA,UAAU,OAAiB;AAYpC,SAAgB,eAAe,CAAC,GAAkB;;IAGhD,MAAM,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;IAEnD,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,GAAG,CAAA;IAC5B,IAAA,wBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,MAAM,IAAI,GAAY,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAA;IAE9D,MAAM,YAAY,GAAG,CAAC,CAAA,MAAC,IAAY,aAAZ,IAAI,uBAAJ,IAAI,CAAU,QAAQ,0CAAE,IAAI,KAAI,EAAE,CAAa,CAErE;IAAC,IAAY,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAA,yBAAe,EAAC,YAAY,EAAE;QAC3D,sBAAsB,EAAE,KAAK;KAC9B,CAAC,CAAA;IAGF,IACE,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,eAErC,OAAA,MAAA,MAAC,IAAY,aAAZ,IAAI,uBAAJ,IAAI,CAAU,QAAQ,0CAAE,IAAI,0CAAE,QAAQ,CAAC,IAAI,CAAC,CAAA,EAAA,CAC9C,EACD,CAAC;QACD,MAAM,IAAI,qDAAyB,CACjC,wIAAwI,CACzI,CAAA;IACH,CAAC;IAED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