@axe-core/watcher 0.0.1-next.47b61783 → 0.0.1-next.4e9657cb
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/dist/Controller.d.ts +9 -0
- package/dist/Controller.js +137 -0
- package/dist/Controller.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +134 -0
- package/dist/cli.js.map +1 -0
- package/dist/cypress.d.ts +8 -0
- package/dist/cypress.js +60 -0
- package/dist/cypress.js.map +1 -0
- package/dist/cypressCommands.d.ts +15 -0
- package/dist/cypressCommands.js +43 -0
- package/dist/cypressCommands.js.map +1 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/playwright.d.ts +3 -2
- package/dist/playwright.js +13 -9
- package/dist/playwright.js.map +1 -1
- package/dist/puppeteer.d.ts +3 -2
- package/dist/puppeteer.js +13 -9
- package/dist/puppeteer.js.map +1 -1
- package/dist/util.d.ts +12 -5
- package/dist/util.js +56 -135
- package/dist/util.js.map +1 -1
- package/dist/wdio.d.ts +3 -2
- package/dist/wdio.js +14 -10
- package/dist/wdio.js.map +1 -1
- package/dist/webdriver.d.ts +3 -2
- package/dist/webdriver.js +13 -9
- package/dist/webdriver.js.map +1 -1
- package/extension/content.js +1 -1
- package/extension/content.js.LICENSE.txt +3 -1
- package/extension/manifest.json +1 -0
- package/extension/worker.js +1 -1
- package/extension/worker.js.LICENSE.txt +1 -0
- package/package.json +41 -48
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare abstract class Controller {
|
|
2
|
+
protected abstract executeScript(fn: string | (() => Promise<void>)): Promise<void>;
|
|
3
|
+
start(): Promise<void>;
|
|
4
|
+
stop(): Promise<void>;
|
|
5
|
+
analyze(): Promise<void>;
|
|
6
|
+
/** Flush all axe-core results by sending them to the server. */
|
|
7
|
+
flush(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export default Controller;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var fs_1 = __importDefault(require("fs"));
|
|
43
|
+
var util_1 = require("./util");
|
|
44
|
+
var updateAutoAnalyze = function (val) {
|
|
45
|
+
var fileContents = fs_1.default.readFileSync(util_1.PATH_TO_EXTENSION_VARIABLES, 'utf-8');
|
|
46
|
+
var jsonValue = JSON.parse(fileContents);
|
|
47
|
+
jsonValue.auto_analyze = val;
|
|
48
|
+
fs_1.default.writeFileSync(util_1.PATH_TO_EXTENSION_VARIABLES, JSON.stringify(jsonValue));
|
|
49
|
+
};
|
|
50
|
+
var Controller = /** @class */ (function () {
|
|
51
|
+
function Controller() {
|
|
52
|
+
}
|
|
53
|
+
Controller.prototype.start = function () {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
+
return __generator(this, function (_a) {
|
|
56
|
+
switch (_a.label) {
|
|
57
|
+
case 0:
|
|
58
|
+
updateAutoAnalyze(true);
|
|
59
|
+
return [4 /*yield*/, this.executeScript(function () {
|
|
60
|
+
var event = new CustomEvent('axe:start-auto-mode');
|
|
61
|
+
window.dispatchEvent(event);
|
|
62
|
+
return Promise.resolve();
|
|
63
|
+
})];
|
|
64
|
+
case 1:
|
|
65
|
+
_a.sent();
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
Controller.prototype.stop = function () {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0:
|
|
76
|
+
updateAutoAnalyze(false);
|
|
77
|
+
return [4 /*yield*/, this.executeScript(function () {
|
|
78
|
+
var event = new CustomEvent('axe:stop-auto-mode');
|
|
79
|
+
window.dispatchEvent(event);
|
|
80
|
+
return Promise.resolve();
|
|
81
|
+
})];
|
|
82
|
+
case 1:
|
|
83
|
+
_a.sent();
|
|
84
|
+
return [2 /*return*/];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
Controller.prototype.analyze = function () {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
switch (_a.label) {
|
|
93
|
+
case 0: return [4 /*yield*/, this.executeScript(function () {
|
|
94
|
+
return new Promise(function (resolve) {
|
|
95
|
+
var event = new CustomEvent('axe:manual-mode-analyze');
|
|
96
|
+
var fn = function () {
|
|
97
|
+
window.removeEventListener('axe:manual-mode-analyze-done', fn);
|
|
98
|
+
resolve();
|
|
99
|
+
};
|
|
100
|
+
window.addEventListener('axe:manual-mode-analyze-done', fn);
|
|
101
|
+
window.dispatchEvent(event);
|
|
102
|
+
});
|
|
103
|
+
})];
|
|
104
|
+
case 1:
|
|
105
|
+
_a.sent();
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
/** Flush all axe-core results by sending them to the server. */
|
|
112
|
+
Controller.prototype.flush = function () {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
return __generator(this, function (_a) {
|
|
115
|
+
switch (_a.label) {
|
|
116
|
+
case 0: return [4 /*yield*/, this.executeScript(function () {
|
|
117
|
+
return new Promise(function (resolve) {
|
|
118
|
+
var fn = function () {
|
|
119
|
+
window.removeEventListener('axe:flush-end', fn);
|
|
120
|
+
resolve();
|
|
121
|
+
};
|
|
122
|
+
window.addEventListener('axe:flush-end', fn);
|
|
123
|
+
var event = new CustomEvent('axe:flush-start');
|
|
124
|
+
window.dispatchEvent(event);
|
|
125
|
+
});
|
|
126
|
+
})];
|
|
127
|
+
case 1:
|
|
128
|
+
_a.sent();
|
|
129
|
+
return [2 /*return*/];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
return Controller;
|
|
135
|
+
}());
|
|
136
|
+
exports.default = Controller;
|
|
137
|
+
//# sourceMappingURL=Controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Controller.js","sourceRoot":"","sources":["../src/Controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAmB;AACnB,+BAAoD;AAEpD,IAAM,iBAAiB,GAAG,UAAC,GAAY;IACrC,IAAM,YAAY,GAAG,YAAE,CAAC,YAAY,CAAC,kCAA2B,EAAE,OAAO,CAAC,CAAA;IAC1E,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IAC1C,SAAS,CAAC,YAAY,GAAG,GAAG,CAAA;IAC5B,YAAE,CAAC,aAAa,CAAC,kCAA2B,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAA;AAC1E,CAAC,CAAA;AAED;IAAA;IAmDA,CAAC;IA9Cc,0BAAK,GAAlB;;;;;wBACE,iBAAiB,CAAC,IAAI,CAAC,CAAA;wBACvB,qBAAM,IAAI,CAAC,a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E,CAAC,CAAA;oCAC/C,OAAO,EAAE,CAAA;gCACX,CAAC,CAAA;gCACD,MAAM,CAAC,gBAAgB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAA;gCAC5C,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,iBAAiB,CAAC,CAAA;gCAChD,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;4BAC7B,CAAC,CAAC,CAAA;wBACJ,CAAC,CAAC,EAAA;;wBAVF,SAUE,CAAA;;;;;KACH;IACH,iBAAC;AAAD,CAAC,AAnDD,IAmDC;AAED,kBAAe,UAAU,CAAA"}
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
+
function step(op) {
|
|
28
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
+
while (_) try {
|
|
30
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
31
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
+
switch (op[0]) {
|
|
33
|
+
case 0: case 1: t = op; break;
|
|
34
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
+
default:
|
|
38
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
+
if (t[2]) _.ops.pop();
|
|
43
|
+
_.trys.pop(); continue;
|
|
44
|
+
}
|
|
45
|
+
op = body.call(thisArg, _);
|
|
46
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
var uuid_1 = require("uuid");
|
|
55
|
+
var pkg_up_1 = __importDefault(require("pkg-up"));
|
|
56
|
+
var fs_1 = __importDefault(require("fs"));
|
|
57
|
+
var assert_1 = __importDefault(require("assert"));
|
|
58
|
+
var util_1 = require("./util");
|
|
59
|
+
var start = function () {
|
|
60
|
+
var sessionId = (0, uuid_1.v4)();
|
|
61
|
+
fs_1.default.writeFileSync(util_1.PATH_TO_SESSION_FILE, JSON.stringify({ id: sessionId }));
|
|
62
|
+
};
|
|
63
|
+
var stop = function () {
|
|
64
|
+
try {
|
|
65
|
+
fs_1.default.unlinkSync(util_1.PATH_TO_SESSION_FILE);
|
|
66
|
+
}
|
|
67
|
+
catch (_a) {
|
|
68
|
+
// Oh well.
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var init = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
72
|
+
var packageJSON, pkg, _a, _b, pretest, _c, test, _d, posttest;
|
|
73
|
+
return __generator(this, function (_e) {
|
|
74
|
+
switch (_e.label) {
|
|
75
|
+
case 0: return [4 /*yield*/, (0, pkg_up_1.default)()];
|
|
76
|
+
case 1:
|
|
77
|
+
packageJSON = _e.sent();
|
|
78
|
+
(0, assert_1.default)(packageJSON, 'Unable to find package.json');
|
|
79
|
+
pkg = JSON.parse(fs_1.default.readFileSync(packageJSON, 'utf8'));
|
|
80
|
+
_a = pkg.scripts || {}, _b = _a.pretest, pretest = _b === void 0 ? '' : _b, _c = _a.test, test = _c === void 0 ? '' : _c, _d = _a.posttest, posttest = _d === void 0 ? '' : _d;
|
|
81
|
+
if (!pretest.includes('axe-watcher start')) {
|
|
82
|
+
if (pretest) {
|
|
83
|
+
pretest += ' && ';
|
|
84
|
+
}
|
|
85
|
+
pretest += 'axe-watcher start';
|
|
86
|
+
}
|
|
87
|
+
if (!(test === null || test === void 0 ? void 0 : test.trim())) {
|
|
88
|
+
test = 'echo "Error: no test specified" && exit 1';
|
|
89
|
+
}
|
|
90
|
+
if (!posttest.includes('axe-watcher stop')) {
|
|
91
|
+
if (posttest) {
|
|
92
|
+
posttest += ' && ';
|
|
93
|
+
}
|
|
94
|
+
posttest += 'axe-watcher stop';
|
|
95
|
+
}
|
|
96
|
+
fs_1.default.writeFileSync(packageJSON, JSON.stringify(__assign(__assign({}, pkg), { scripts: __assign(__assign({}, pkg.scripts), { pretest: pretest, test: test, posttest: posttest }) }), null, 2));
|
|
97
|
+
return [2 /*return*/];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}); };
|
|
101
|
+
var main = function (command) { return __awaiter(void 0, void 0, void 0, function () {
|
|
102
|
+
var _a;
|
|
103
|
+
return __generator(this, function (_b) {
|
|
104
|
+
switch (_b.label) {
|
|
105
|
+
case 0:
|
|
106
|
+
_a = command;
|
|
107
|
+
switch (_a) {
|
|
108
|
+
case 'start': return [3 /*break*/, 1];
|
|
109
|
+
case 'stop': return [3 /*break*/, 2];
|
|
110
|
+
case 'init': return [3 /*break*/, 3];
|
|
111
|
+
}
|
|
112
|
+
return [3 /*break*/, 5];
|
|
113
|
+
case 1:
|
|
114
|
+
start();
|
|
115
|
+
return [3 /*break*/, 6];
|
|
116
|
+
case 2:
|
|
117
|
+
stop();
|
|
118
|
+
return [3 /*break*/, 6];
|
|
119
|
+
case 3: return [4 /*yield*/, init()];
|
|
120
|
+
case 4:
|
|
121
|
+
_b.sent();
|
|
122
|
+
return [3 /*break*/, 6];
|
|
123
|
+
case 5: throw new Error('Unsupported or missing subcommand');
|
|
124
|
+
case 6: return [2 /*return*/];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}); };
|
|
128
|
+
var command = process.argv.slice(2)[0];
|
|
129
|
+
main(command).catch(function (error) {
|
|
130
|
+
// eslint-disable-next-line no-console
|
|
131
|
+
console.error(error);
|
|
132
|
+
process.exit(1);
|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+1,8 @@
|
|
|
1
|
+
import type Cypress from 'cypress';
|
|
2
|
+
import { Configuration } from './util';
|
|
3
|
+
/**
|
|
4
|
+
* Create a Cypress config that uses the axe Watcher extension.
|
|
5
|
+
*
|
|
6
|
+
* @param config Cypress config to extend
|
|
7
|
+
*/
|
|
8
|
+
export declare const cypressConfig: (config: Cypress.ConfigOptions & Configuration) => Cypress.ConfigOptions;
|
package/dist/cypress.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.cypressConfig = void 0;
|
|
26
|
+
var util_1 = require("./util");
|
|
27
|
+
/**
|
|
28
|
+
* Create a Cypress config that uses the axe Watcher extension.
|
|
29
|
+
*
|
|
30
|
+
* @param config Cypress config to extend
|
|
31
|
+
*/
|
|
32
|
+
var cypressConfig = function (config) {
|
|
33
|
+
var axe = config.axe, userConfig = __rest(config, ["axe"]);
|
|
34
|
+
(0, util_1.writeVariables)(axe);
|
|
35
|
+
(0, util_1.writeManifest)({
|
|
36
|
+
all_frames: true,
|
|
37
|
+
exclude_globs: [
|
|
38
|
+
// Top-level Cypress page.
|
|
39
|
+
'*/__/#/specs/runner?file=*',
|
|
40
|
+
// Cypress-specific iframes.
|
|
41
|
+
'*/__cypress/iframes/*'
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
return __assign(__assign({}, userConfig), { e2e: __assign(__assign({}, userConfig.e2e), { setupNodeEvents: function (on) {
|
|
45
|
+
on('before:browser:launch', function (browser, launchOptions) {
|
|
46
|
+
var _a;
|
|
47
|
+
// We only support Chrome.
|
|
48
|
+
if (browser.name === 'chrome') {
|
|
49
|
+
if (browser.isHeadless) {
|
|
50
|
+
throw new util_1.HeadlessNotSupportedError();
|
|
51
|
+
}
|
|
52
|
+
// Load the extension.
|
|
53
|
+
(_a = launchOptions.args).push.apply(_a, util_1.extensionArgs);
|
|
54
|
+
}
|
|
55
|
+
return launchOptions;
|
|
56
|
+
});
|
|
57
|
+
} }) });
|
|
58
|
+
};
|
|
59
|
+
exports.cypressConfig = cypressConfig;
|
|
60
|
+
//# sourceMappingURL=cypress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cypress.js","sourceRoot":"","sources":["../src/cypress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAMe;AAEf;;;;GAIG;AAEI,IAAM,aAAa,GAAG,UAC3B,MAA6C;IAErC,IAAA,GAAG,GAAoB,MAAM,IAA1B,EAAK,UAAU,UAAK,MAAM,EAA/B,OAAsB,CAAF,CAAW;IAErC,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IACnB,IAAA,oBAAa,EAAC;QACZ,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE;YACb,0BAA0B;YAC1B,4BAA4B;YAC5B,4BAA4B;YAC5B,uBAAuB;SACxB;KACF,CAAC,CAAA;IAEF,6BACK,UAAU,KACb,GAAG,wBACE,UAAU,CAAC,GAAG,KACjB,eAAe,YAAC,EAAE;gBAChB,EAAE,CAAC,uBAAuB,EAAE,UAAC,OAAO,EAAE,aAAa;;oBACjD,0BAA0B;oBAC1B,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;wBAC7B,IAAI,OAAO,CAAC,UAAU,EAAE;4BACtB,MAAM,IAAI,gCAAyB,EAAE,CAAA;yBACtC;wBAED,sBAAsB;wBACtB,CAAA,KAAA,aAAa,CAAC,IAAI,CAAA,CAAC,IAAI,WAAI,oBAAa,EAAC;qBAC1C;oBAED,OAAO,aAAa,CAAA;gBACtB,CAAC,CAAC,CAAA;YACJ,CAAC,OAEJ;AACH,CAAC,CAAA;AArCY,QAAA,aAAa,iBAqCzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Cypress {
|
|
4
|
+
interface Chainable {
|
|
5
|
+
/** Flush the axe-core result queue by sending results to the server. */
|
|
6
|
+
axeFlush(): Chainable<void>;
|
|
7
|
+
/** Perform a manual axe-core analysis. */
|
|
8
|
+
axeAnalyze(): Chainable<void>;
|
|
9
|
+
/** Start automatic analysis mode. */
|
|
10
|
+
axeStart(): Chainable<void>;
|
|
11
|
+
/** Stop automatic analysis mode. */
|
|
12
|
+
axeStop(): Chainable<void>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
Cypress.Commands.add('axeFlush', function () {
|
|
4
|
+
cy.window().then(function (win) {
|
|
5
|
+
return new Promise(function (resolve) {
|
|
6
|
+
var fn = function () {
|
|
7
|
+
win.removeEventListener('axe:flush-end', fn);
|
|
8
|
+
resolve();
|
|
9
|
+
};
|
|
10
|
+
win.addEventListener('axe:flush-end', fn);
|
|
11
|
+
var event = new CustomEvent('axe:flush-start');
|
|
12
|
+
win.dispatchEvent(event);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
Cypress.Commands.add('axeAnalyze', function () {
|
|
17
|
+
cy.window().then(function (win) {
|
|
18
|
+
return new Promise(function (resolve) {
|
|
19
|
+
var event = new CustomEvent('axe:manual-mode-analyze');
|
|
20
|
+
var fn = function () {
|
|
21
|
+
win.removeEventListener('axe:manual-mode-analyze-done', fn);
|
|
22
|
+
resolve();
|
|
23
|
+
};
|
|
24
|
+
win.addEventListener('axe:manual-mode-analyze-done', fn);
|
|
25
|
+
win.dispatchEvent(event);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
Cypress.Commands.add('axeStart', function () {
|
|
30
|
+
cy.window().then(function (win) {
|
|
31
|
+
var event = new CustomEvent('axe:start-auto-mode');
|
|
32
|
+
win.dispatchEvent(event);
|
|
33
|
+
return Promise.resolve();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
Cypress.Commands.add('axeStop', function () {
|
|
37
|
+
cy.window().then(function (win) {
|
|
38
|
+
var event = new CustomEvent('axe:stop-auto-mode');
|
|
39
|
+
win.dispatchEvent(event);
|
|
40
|
+
return Promise.resolve();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=cypressCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cypressCommands.js","sourceRoot":"","sources":["../src/cypressCommands.ts"],"names":[],"mappings":";;AAmBA,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE;IAC/B,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,UAAA,GAAG;QAClB,OAAO,IAAI,OAAO,CAAO,UAAA,OAAO;YAC9B,IAAM,EAAE,GAAG;gBACT,GAAG,CAAC,mBAAmB,C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AAE;IAC9B,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,UAAA,GAAG;QAClB,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,oBAAoB,CAAC,CAAA;QACnD,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACxB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
/*! Copyright Deque 2021-2022 All Rights Reserved */
|
|
2
|
+
export { puppeteerConfig, PuppeteerController } from './puppeteer';
|
|
3
|
+
export { wdioConfig, wdioTestRunner, WdioController } from './wdio';
|
|
4
|
+
export { webdriverConfig, WebdriverController } from './webdriver';
|
|
5
|
+
export { playwrightConfig, PlaywrightController } from './playwright';
|
|
6
|
+
export { cypressConfig } from './cypress';
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*! Copyright Deque 2021-2022 All Rights Reserved */
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
+
exports.cypressConfig = exports.PlaywrightController = exports.playwrightConfig = exports.WebdriverController = exports.webdriverConfig = exports.WdioController = exports.wdioTestRunner = exports.wdioConfig = exports.PuppeteerController = exports.puppeteerConfig = void 0;
|
|
4
5
|
var puppeteer_1 = require("./puppeteer");
|
|
5
6
|
Object.defineProperty(exports, "puppeteerConfig", { enumerable: true, get: function () { return puppeteer_1.puppeteerConfig; } });
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
+
Object.defineProperty(exports, "PuppeteerController", { enumerable: true, get: function () { return puppeteer_1.PuppeteerController; } });
|
|
7
8
|
var wdio_1 = require("./wdio");
|
|
8
9
|
Object.defineProperty(exports, "wdioConfig", { enumerable: true, get: function () { return wdio_1.wdioConfig; } });
|
|
9
10
|
Object.defineProperty(exports, "wdioTestRunner", { enumerable: true, get: function () { return wdio_1.wdioTestRunner; } });
|
|
10
|
-
Object.defineProperty(exports, "
|
|
11
|
+
Object.defineProperty(exports, "WdioController", { enumerable: true, get: function () { return wdio_1.WdioController; } });
|
|
11
12
|
var webdriver_1 = require("./webdriver");
|
|
12
13
|
Object.defineProperty(exports, "webdriverConfig", { enumerable: true, get: function () { return webdriver_1.webdriverConfig; } });
|
|
13
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "WebdriverController", { enumerable: true, get: function () { return webdriver_1.WebdriverController; } });
|
|
14
15
|
var playwright_1 = require("./playwright");
|
|
15
16
|
Object.defineProperty(exports, "playwrightConfig", { enumerable: true, get: function () { return playwright_1.playwrightConfig; } });
|
|
16
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "PlaywrightController", { enumerable: true, get: function () { return playwright_1.PlaywrightController; } });
|
|
18
|
+
var cypress_1 = require("./cypress");
|
|
19
|
+
Object.defineProperty(exports, "cypressConfig", { enumerable: true, get: function () { return cypress_1.cypressConfig; } });
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,+BAAmE;AAA1D,kGAAA,UAAU,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,sGAAA,cAAc,OAAA;AACnD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,2CAAqE;AAA5D,8GAAA,gBAAgB,OAAA;AAAE,kHAAA,oBAAoB,OAAA;AAC/C,qCAAyC;AAAhC,wGAAA,aAAa,OAAA"}
|
package/dist/playwright.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Configuration, ManualController } from './util';
|
|
2
1
|
import type { LaunchOptions, Page } from 'playwright';
|
|
2
|
+
import { Configuration } from './util';
|
|
3
|
+
import Controller from './Controller';
|
|
3
4
|
/**
|
|
4
5
|
* Creates a Playwright config that uses axe extension
|
|
5
6
|
*
|
|
6
7
|
* @param opts Playwright config to extend
|
|
7
8
|
*/
|
|
8
9
|
export declare function playwrightConfig(opts: Configuration & LaunchOptions): LaunchOptions;
|
|
9
|
-
export declare class
|
|
10
|
+
export declare class PlaywrightController extends Controller {
|
|
10
11
|
private driver;
|
|
11
12
|
constructor(driver: Page);
|
|
12
13
|
protected executeScript(fn: string | (() => Promise<void>)): Promise<void>;
|
package/dist/playwright.js
CHANGED
|
@@ -72,9 +72,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
72
72
|
}
|
|
73
73
|
return t;
|
|
74
74
|
};
|
|
75
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
76
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
77
|
+
};
|
|
75
78
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
-
exports.
|
|
79
|
+
exports.PlaywrightController = exports.playwrightConfig = void 0;
|
|
77
80
|
var util_1 = require("./util");
|
|
81
|
+
var Controller_1 = __importDefault(require("./Controller"));
|
|
78
82
|
/**
|
|
79
83
|
* Creates a Playwright config that uses axe extension
|
|
80
84
|
*
|
|
@@ -85,20 +89,20 @@ function playwrightConfig(opts) {
|
|
|
85
89
|
var _a = config.args, args = _a === void 0 ? [] : _a;
|
|
86
90
|
(0, util_1.writeVariables)(axe);
|
|
87
91
|
if (config.headless) {
|
|
88
|
-
throw new
|
|
92
|
+
throw new util_1.HeadlessNotSupportedError();
|
|
89
93
|
}
|
|
90
94
|
args = args.concat(util_1.extensionArgs);
|
|
91
95
|
return __assign(__assign({}, config), { headless: false, args: args });
|
|
92
96
|
}
|
|
93
97
|
exports.playwrightConfig = playwrightConfig;
|
|
94
|
-
var
|
|
95
|
-
__extends(
|
|
96
|
-
function
|
|
98
|
+
var PlaywrightController = /** @class */ (function (_super) {
|
|
99
|
+
__extends(PlaywrightController, _super);
|
|
100
|
+
function PlaywrightController(driver) {
|
|
97
101
|
var _this = _super.call(this) || this;
|
|
98
102
|
_this.driver = driver;
|
|
99
103
|
return _this;
|
|
100
104
|
}
|
|
101
|
-
|
|
105
|
+
PlaywrightController.prototype.executeScript = function (fn) {
|
|
102
106
|
return __awaiter(this, void 0, void 0, function () {
|
|
103
107
|
return __generator(this, function (_a) {
|
|
104
108
|
switch (_a.label) {
|
|
@@ -110,7 +114,7 @@ var PlaywrightManualController = /** @class */ (function (_super) {
|
|
|
110
114
|
});
|
|
111
115
|
});
|
|
112
116
|
};
|
|
113
|
-
return
|
|
114
|
-
}(
|
|
115
|
-
exports.
|
|
117
|
+
return PlaywrightController;
|
|
118
|
+
}(Controller_1.default));
|
|
119
|
+
exports.PlaywrightController = PlaywrightController;
|
|
116
120
|
//# sourceMappingURL=playwright.js.map
|
package/dist/playwright.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAKe;AACf,4DAAqC;AAErC;;;;GAIG;AAEH,SAAgB,gBAAgB,CAC9B,IAAmC;IAE3B,IAAA,GAAG,GAAgB,IAAI,IAApB,EAAK,MAAM,UAAK,IAAI,EAAzB,OAAkB,CAAF,CAAS;IACzB,IAAA,KAAc,MAAM,KAAX,EAAT,IAAI,mBAAG,EAAE,KAAA,CAAW;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,6BACK,MAAM,KACT,QAAQ,EAAE,KAAK,EACf,IAAI,MAAA,IACL;AACH,CAAC;AAlBD,4CAkBC;AAED;IAA0C,wCAAU;IAGlD,8BAAY,MAAY;QAAxB,YACE,iBAAO,SAER;QADC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAA;;IACtB,CAAC;IAEe,4CAAa,GAA7B,UACE,EAAkC;;;;4BAElC,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;wBAA9B,SAA8B,CAAA;;;;;KAC/B;IACH,2BAAC;AAAD,CAAC,AAbD,CAA0C,oBAAU,GAanD;AAbY,oDAAoB"}
|
package/dist/puppeteer.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Configuration, ManualController } from './util';
|
|
2
1
|
import type { LaunchOptions, BrowserLaunchArgumentOptions, BrowserConnectOptions, Page } from 'puppeteer';
|
|
2
|
+
import { Configuration } from './util';
|
|
3
|
+
import Controller from './Controller';
|
|
3
4
|
declare type Options = LaunchOptions & BrowserLaunchArgumentOptions & BrowserConnectOptions;
|
|
4
5
|
/**
|
|
5
6
|
* Creates a Puppeteer config that uses axe extension.
|
|
@@ -7,7 +8,7 @@ declare type Options = LaunchOptions & BrowserLaunchArgumentOptions & BrowserCon
|
|
|
7
8
|
* @param opts Config to extend
|
|
8
9
|
*/
|
|
9
10
|
export declare function puppeteerConfig(opts: Configuration & Options): Options;
|
|
10
|
-
export declare class
|
|
11
|
+
export declare class PuppeteerController extends Controller {
|
|
11
12
|
private driver;
|
|
12
13
|
constructor(driver: Page);
|
|
13
14
|
protected executeScript(fn: string | (() => Promise<void>)): Promise<void>;
|
package/dist/puppeteer.js
CHANGED
|
@@ -72,9 +72,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
72
72
|
}
|
|
73
73
|
return t;
|
|
74
74
|
};
|
|
75
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
76
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
77
|
+
};
|
|
75
78
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
-
exports.
|
|
79
|
+
exports.PuppeteerController = exports.puppeteerConfig = void 0;
|
|
77
80
|
var util_1 = require("./util");
|
|
81
|
+
var Controller_1 = __importDefault(require("./Controller"));
|
|
78
82
|
/**
|
|
79
83
|
* Creates a Puppeteer config that uses axe extension.
|
|
80
84
|
*
|
|
@@ -85,20 +89,20 @@ function puppeteerConfig(opts) {
|
|
|
85
89
|
var _a = config.args, args = _a === void 0 ? [] : _a;
|
|
86
90
|
(0, util_1.writeVariables)(axe);
|
|
87
91
|
if (config.headless) {
|
|
88
|
-
throw new
|
|
92
|
+
throw new util_1.HeadlessNotSupportedError();
|
|
89
93
|
}
|
|
90
94
|
args = args.concat(util_1.extensionArgs);
|
|
91
95
|
return __assign(__assign({}, config), { headless: false, args: args });
|
|
92
96
|
}
|
|
93
97
|
exports.puppeteerConfig = puppeteerConfig;
|
|
94
|
-
var
|
|
95
|
-
__extends(
|
|
96
|
-
function
|
|
98
|
+
var PuppeteerController = /** @class */ (function (_super) {
|
|
99
|
+
__extends(PuppeteerController, _super);
|
|
100
|
+
function PuppeteerController(driver) {
|
|
97
101
|
var _this = _super.call(this) || this;
|
|
98
102
|
_this.driver = driver;
|
|
99
103
|
return _this;
|
|
100
104
|
}
|
|
101
|
-
|
|
105
|
+
PuppeteerController.prototype.executeScript = function (fn) {
|
|
102
106
|
return __awaiter(this, void 0, void 0, function () {
|
|
103
107
|
return __generator(this, function (_a) {
|
|
104
108
|
switch (_a.label) {
|
|
@@ -110,7 +114,7 @@ var PuppeteerManualController = /** @class */ (function (_super) {
|
|
|
110
114
|
});
|
|
111
115
|
});
|
|
112
116
|
};
|
|
113
|
-
return
|
|
114
|
-
}(
|
|
115
|
-
exports.
|
|
117
|
+
return PuppeteerController;
|
|
118
|
+
}(Controller_1.default));
|
|
119
|
+
exports.PuppeteerController = PuppeteerController;
|
|
116
120
|
//# sourceMappingURL=puppeteer.js.map
|
package/dist/puppeteer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../src/puppeteer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../src/puppeteer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,+BAKe;AACf,4DAAqC;AAMrC;;;;GAIG;AAEH,SAAgB,eAAe,CAAC,IAA6B;IACnD,IAAA,GAAG,GAAgB,IAAI,IAApB,EAAK,MAAM,UAAK,IAAI,EAAzB,OAAkB,CAAF,CAAS;IACzB,IAAA,KAAc,MAAM,KAAX,EAAT,IAAI,mBAAG,EAAE,KAAA,CAAW;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,6BACK,MAAM,KACT,QAAQ,EAAE,KAAK,EACf,IAAI,MAAA,IACL;AACH,CAAC;AAhBD,0CAgBC;AAED;IAAyC,uCAAU;IAGjD,6BAAY,MAAY;QAAxB,YACE,iBAAO,SAER;QADC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAA;;IACtB,CAAC;IAEe,2CAAa,GAA7B,UACE,EAAkC;;;;4BAElC,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;wBAA9B,SAA8B,CAAA;;;;;KAC/B;IACH,0BAAC;AAAD,CAAC,AAbD,CAAyC,oBAAU,GAalD;AAbY,kDAAmB"}
|