@stencil/core 2.16.1-0 → 2.17.1

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 (50) hide show
  1. package/cli/config-flags.d.ts +102 -0
  2. package/cli/index.cjs +697 -224
  3. package/cli/index.d.ts +2 -1
  4. package/cli/index.js +697 -224
  5. package/cli/package.json +1 -1
  6. package/compiler/package.json +1 -1
  7. package/compiler/stencil.js +856 -290
  8. package/compiler/stencil.min.js +2 -2
  9. package/dependencies.json +1 -1
  10. package/dev-server/client/index.js +1 -1
  11. package/dev-server/client/package.json +1 -1
  12. package/dev-server/connector.html +2 -2
  13. package/dev-server/index.js +1 -1
  14. package/dev-server/package.json +1 -1
  15. package/dev-server/server-process.js +2 -2
  16. package/internal/app-data/package.json +1 -1
  17. package/internal/client/css-shim.js +1 -1
  18. package/internal/client/dom.js +1 -1
  19. package/internal/client/index.js +11 -6
  20. package/internal/client/package.json +1 -1
  21. package/internal/client/patch-browser.js +1 -1
  22. package/internal/client/patch-esm.js +1 -1
  23. package/internal/client/shadow-css.js +1 -1
  24. package/internal/hydrate/index.js +2 -2
  25. package/internal/hydrate/package.json +1 -1
  26. package/internal/package.json +1 -1
  27. package/internal/stencil-private.d.ts +6 -2
  28. package/internal/stencil-public-compiler.d.ts +67 -48
  29. package/internal/testing/index.js +1 -1
  30. package/internal/testing/package.json +1 -1
  31. package/mock-doc/index.cjs +140 -5
  32. package/mock-doc/index.d.ts +76 -1
  33. package/mock-doc/index.js +140 -5
  34. package/mock-doc/package.json +1 -1
  35. package/package.json +2 -1
  36. package/screenshot/package.json +1 -1
  37. package/sys/node/index.js +325 -314
  38. package/sys/node/package.json +1 -1
  39. package/sys/node/worker.js +1 -1
  40. package/testing/index.d.ts +1 -1
  41. package/testing/index.js +436 -381
  42. package/testing/jest/jest-config.d.ts +1 -1
  43. package/testing/jest/jest-runner.d.ts +3 -2
  44. package/testing/jest/jest-screenshot.d.ts +1 -1
  45. package/testing/mocks.d.ts +48 -3
  46. package/testing/package.json +1 -1
  47. package/testing/puppeteer/puppeteer-browser.d.ts +2 -2
  48. package/testing/test/testing-utils.spec.d.ts +1 -0
  49. package/testing/testing-utils.d.ts +74 -2
  50. package/testing/testing.d.ts +2 -2
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Testing v2.16.1-0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Testing v2.17.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _lazyRequire(e) {
5
5
  return new Proxy({}, {
@@ -45,28 +45,28 @@ async function startPuppeteerBrowser(e) {
45
45
  Array.isArray(e.testing.browserArgs) && e.logger.debug(`puppeteer args: ${e.testing.browserArgs.join(" ")}`),
46
46
  "boolean" == typeof e.testing.browserDevtools && e.logger.debug(`puppeteer devtools: ${e.testing.browserDevtools}`),
47
47
  "number" == typeof e.testing.browserSlowMo && e.logger.debug(`puppeteer slowMo: ${e.testing.browserSlowMo}`);
48
- const i = {
48
+ const o = {
49
49
  ignoreHTTPSErrors: !0,
50
50
  slowMo: e.testing.browserSlowMo
51
51
  };
52
- let o;
53
- if (e.testing.browserWSEndpoint) o = await n.connect({
52
+ let i;
53
+ if (e.testing.browserWSEndpoint) i = await n.connect({
54
54
  browserWSEndpoint: e.testing.browserWSEndpoint,
55
- ...i
55
+ ...o
56
56
  }); else {
57
57
  const t = {
58
58
  args: e.testing.browserArgs,
59
59
  headless: e.testing.browserHeadless,
60
60
  devtools: e.testing.browserDevtools,
61
- ...i
61
+ ...o
62
62
  };
63
63
  e.testing.browserExecutablePath && (t.executablePath = e.testing.browserExecutablePath),
64
- o = await n.launch({
64
+ i = await n.launch({
65
65
  ...t
66
66
  });
67
67
  }
68
- return t.__STENCIL_BROWSER_WS_ENDPOINT__ = o.wsEndpoint(), e.logger.debug(`puppeteer browser wsEndpoint: ${t.__STENCIL_BROWSER_WS_ENDPOINT__}`),
69
- o;
68
+ return t.__STENCIL_BROWSER_WS_ENDPOINT__ = i.wsEndpoint(), e.logger.debug(`puppeteer browser wsEndpoint: ${t.__STENCIL_BROWSER_WS_ENDPOINT__}`),
69
+ i;
70
70
  }
71
71
 
72
72
  function getAppStyleUrl(e, t) {
@@ -76,13 +76,13 @@ function getAppStyleUrl(e, t) {
76
76
  function getAppUrl(e, t, r) {
77
77
  const s = e.outputTargets.find(isOutputTargetWww);
78
78
  if (s) {
79
- const e = s.buildDir, n = path$2.join(e, r), i = path$2.relative(s.dir, n);
80
- return new URL(i, t).href;
79
+ const e = s.buildDir, n = path$2.join(e, r), o = path$2.relative(s.dir, n);
80
+ return new URL(o, t).href;
81
81
  }
82
82
  const n = e.outputTargets.find(isOutputTargetDistLazy);
83
83
  if (n) {
84
- const s = n.esmDir, i = path$2.join(s, r), o = path$2.relative(e.rootDir, i);
85
- return new URL(o, t).href;
84
+ const s = n.esmDir, o = path$2.join(s, r), i = path$2.relative(e.rootDir, o);
85
+ return new URL(i, t).href;
86
86
  }
87
87
  return t;
88
88
  }
@@ -170,11 +170,11 @@ async function runJest(e, t) {
170
170
  s.maxWorkers = parseInt(s.maxWorkers, 10);
171
171
  } catch (e) {}
172
172
  return "string" == typeof s.ci && (s.ci = "true" === s.ci || "" === s.ci), s;
173
- }(e), i = function i(e, t) {
173
+ }(e), o = function o(e, t) {
174
174
  const r = t.projects ? t.projects : [];
175
175
  return r.push(e.rootDir), r;
176
- }(e, n), {runCLI: o} = require("@jest/core");
177
- r = !!(await o(n, i)).results.success;
176
+ }(e, n), {runCLI: i} = require("@jest/core");
177
+ r = !!(await i(n, o)).results.success;
178
178
  } catch (t) {
179
179
  e.logger.error(`runJest: ${t}`);
180
180
  }
@@ -246,30 +246,30 @@ function getCompilerOptions(e) {
246
246
  };
247
247
  if (1 === e.category && (t.level = "error"), e.file) {
248
248
  t.absFilePath = e.file.fileName;
249
- const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start), i = {
249
+ const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start), o = {
250
250
  lineIndex: n.line,
251
251
  lineNumber: n.line + 1,
252
252
  text: s[n.line],
253
253
  errorCharStart: n.character,
254
254
  errorLength: Math.max(e.length, 1)
255
255
  };
256
- if (t.lineNumber = i.lineNumber, t.columnNumber = i.errorCharStart + 1, t.lines.push(i),
257
- 0 === i.errorLength && i.errorCharStart > 0 && (i.errorLength = 1, i.errorCharStart--),
258
- i.lineIndex > 0) {
256
+ if (t.lineNumber = o.lineNumber, t.columnNumber = o.errorCharStart + 1, t.lines.push(o),
257
+ 0 === o.errorLength && o.errorCharStart > 0 && (o.errorLength = 1, o.errorCharStart--),
258
+ o.lineIndex > 0) {
259
259
  const e = {
260
- lineIndex: i.lineIndex - 1,
261
- lineNumber: i.lineNumber - 1,
262
- text: s[i.lineIndex - 1],
260
+ lineIndex: o.lineIndex - 1,
261
+ lineNumber: o.lineNumber - 1,
262
+ text: s[o.lineIndex - 1],
263
263
  errorCharStart: -1,
264
264
  errorLength: -1
265
265
  };
266
266
  t.lines.unshift(e);
267
267
  }
268
- if (i.lineIndex + 1 < s.length) {
268
+ if (o.lineIndex + 1 < s.length) {
269
269
  const e = {
270
- lineIndex: i.lineIndex + 1,
271
- lineNumber: i.lineNumber + 1,
272
- text: s[i.lineIndex + 1],
270
+ lineIndex: o.lineIndex + 1,
271
+ lineNumber: o.lineNumber + 1,
272
+ text: s[o.lineIndex + 1],
273
273
  errorCharStart: -1,
274
274
  errorLength: -1
275
275
  };
@@ -313,11 +313,11 @@ function compareHtml(e, t, r) {
313
313
  });
314
314
  }
315
315
  }
316
- const i = index_cjs.parseHtmlToFragment(t), o = index_cjs.serializeNodeToHtml(i, {
316
+ const o = index_cjs.parseHtmlToFragment(t), i = index_cjs.serializeNodeToHtml(o, {
317
317
  prettyHtml: !0,
318
318
  excludeTags: [ "body" ]
319
319
  });
320
- return s !== o ? (expect(s).toBe(o), {
320
+ return s !== i ? (expect(s).toBe(i), {
321
321
  message: () => "HTML does not match",
322
322
  pass: !1
323
323
  }) : {
@@ -388,7 +388,7 @@ function assertPath(e) {
388
388
  }
389
389
 
390
390
  function normalizeStringPosix(e, t) {
391
- var r, s, n, i = "", o = 0, a = -1, l = 0;
391
+ var r, s, n, o = "", i = 0, a = -1, l = 0;
392
392
  for (s = 0; s <= e.length; ++s) {
393
393
  if (s < e.length) r = e.charCodeAt(s); else {
394
394
  if (47 === r) break;
@@ -396,27 +396,27 @@ function normalizeStringPosix(e, t) {
396
396
  }
397
397
  if (47 === r) {
398
398
  if (a === s - 1 || 1 === l) ; else if (a !== s - 1 && 2 === l) {
399
- if (i.length < 2 || 2 !== o || 46 !== i.charCodeAt(i.length - 1) || 46 !== i.charCodeAt(i.length - 2)) if (i.length > 2) {
400
- if ((n = i.lastIndexOf("/")) !== i.length - 1) {
401
- -1 === n ? (i = "", o = 0) : o = (i = i.slice(0, n)).length - 1 - i.lastIndexOf("/"),
399
+ if (o.length < 2 || 2 !== i || 46 !== o.charCodeAt(o.length - 1) || 46 !== o.charCodeAt(o.length - 2)) if (o.length > 2) {
400
+ if ((n = o.lastIndexOf("/")) !== o.length - 1) {
401
+ -1 === n ? (o = "", i = 0) : i = (o = o.slice(0, n)).length - 1 - o.lastIndexOf("/"),
402
402
  a = s, l = 0;
403
403
  continue;
404
404
  }
405
- } else if (2 === i.length || 1 === i.length) {
406
- i = "", o = 0, a = s, l = 0;
405
+ } else if (2 === o.length || 1 === o.length) {
406
+ o = "", i = 0, a = s, l = 0;
407
407
  continue;
408
408
  }
409
- t && (i.length > 0 ? i += "/.." : i = "..", o = 2);
410
- } else i.length > 0 ? i += "/" + e.slice(a + 1, s) : i = e.slice(a + 1, s), o = s - a - 1;
409
+ t && (o.length > 0 ? o += "/.." : o = "..", i = 2);
410
+ } else o.length > 0 ? o += "/" + e.slice(a + 1, s) : o = e.slice(a + 1, s), i = s - a - 1;
411
411
  a = s, l = 0;
412
412
  } else 46 === r && -1 !== l ? ++l : l = -1;
413
413
  }
414
- return i;
414
+ return o;
415
415
  }
416
416
 
417
417
  function specifierIncluded$1(e, t) {
418
- var r, s, n, i = e.split("."), o = t.split(" "), a = o.length > 1 ? o[0] : "=", l = (o.length > 1 ? o[1] : o[0]).split(".");
419
- for (r = 0; r < 3; ++r) if ((s = parseInt(i[r] || 0, 10)) !== (n = parseInt(l[r] || 0, 10))) return "<" === a ? s < n : ">=" === a && s >= n;
418
+ var r, s, n, o = e.split("."), i = t.split(" "), a = i.length > 1 ? i[0] : "=", l = (i.length > 1 ? i[1] : i[0]).split(".");
419
+ for (r = 0; r < 3; ++r) if ((s = parseInt(o[r] || 0, 10)) !== (n = parseInt(l[r] || 0, 10))) return "<" === a ? s < n : ">=" === a && s >= n;
420
420
  return ">=" === a;
421
421
  }
422
422
 
@@ -428,9 +428,9 @@ function matchesRange$1(e, t) {
428
428
  }
429
429
 
430
430
  function specifierIncluded(e) {
431
- var t, r, s, n = e.split(" "), i = n.length > 1 ? n[0] : "=", o = (n.length > 1 ? n[1] : n[0]).split(".");
432
- for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(o[t] || 0, 10))) return "<" === i ? r < s : ">=" === i && r >= s;
433
- return ">=" === i;
431
+ var t, r, s, n = e.split(" "), o = n.length > 1 ? n[0] : "=", i = (n.length > 1 ? n[1] : n[0]).split(".");
432
+ for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(i[t] || 0, 10))) return "<" === o ? r < s : ">=" === o && r >= s;
433
+ return ">=" === o;
434
434
  }
435
435
 
436
436
  function matchesRange(e) {
@@ -476,7 +476,11 @@ function mockConfig(e) {
476
476
  nodeResolve: {
477
477
  customResolveOptions: {}
478
478
  },
479
- sourceMap: !0
479
+ sourceMap: !0,
480
+ rollupPlugins: {
481
+ before: [],
482
+ after: []
483
+ }
480
484
  };
481
485
  }
482
486
 
@@ -499,7 +503,7 @@ function mockCompilerCtx(e) {
499
503
  compilerOptions: null,
500
504
  cache: null,
501
505
  cssModuleImports: new Map,
502
- events: null,
506
+ events: buildEvents(),
503
507
  fs: null,
504
508
  hasSuccessfulBuild: !1,
505
509
  isActivelyBuilding: !1,
@@ -539,23 +543,23 @@ function mockCompilerCtx(e) {
539
543
  if (!0 === r.inMemoryOnly) {
540
544
  let n = e;
541
545
  n.endsWith("/") || (n += "/");
542
- const i = e.split("/");
546
+ const o = e.split("/");
543
547
  t.forEach(((t, n) => {
544
548
  if (!n.startsWith(e)) return;
545
549
  const a = n.split("/");
546
- if ((a.length === i.length + 1 || r.recursive && a.length > i.length) && t.exists) {
550
+ if ((a.length === o.length + 1 || r.recursive && a.length > o.length) && t.exists) {
547
551
  const e = {
548
552
  absPath: n,
549
- relPath: a[i.length],
553
+ relPath: a[o.length],
550
554
  isDirectory: t.isDirectory,
551
555
  isFile: t.isFile
552
556
  };
553
- o(r, e) || s.push(e);
557
+ i(r, e) || s.push(e);
554
558
  }
555
559
  }));
556
- } else await i(e, e, r, s);
560
+ } else await o(e, e, r, s);
557
561
  return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
558
- }, i = async (t, r, s, n) => {
562
+ }, o = async (t, r, s, n) => {
559
563
  const a = await e.readDir(r);
560
564
  if (a.length > 0) {
561
565
  const e = b(r);
@@ -566,10 +570,10 @@ function mockCompilerCtx(e) {
566
570
  isDirectory: l.isDirectory,
567
571
  isFile: l.isFile
568
572
  };
569
- o(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await i(t, r, s, n));
573
+ i(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await o(t, r, s, n));
570
574
  })));
571
575
  }
572
- }, o = (e, t) => {
576
+ }, i = (e, t) => {
573
577
  if (t.isDirectory) {
574
578
  if (Array.isArray(e.excludeDirNames)) {
575
579
  const r = path$2.basename(t.absPath);
@@ -622,26 +626,26 @@ function mockCompilerCtx(e) {
622
626
  }, d = async (t, s, n) => {
623
627
  if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
624
628
  if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
625
- const i = {
629
+ const o = {
626
630
  ignored: !1,
627
631
  changedContent: !1,
628
632
  queuedWrite: !1
629
633
  };
630
- if (!0 === shouldIgnore(t)) return i.ignored = !0, i;
631
- const o = b(t);
632
- if (o.exists = !0, o.isFile = !0, o.isDirectory = !1, o.queueDeleteFromDisk = !1,
633
- "string" == typeof o.fileText ? i.changedContent = o.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : i.changedContent = !0,
634
- o.fileText = s, i.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
635
- !1 === n.useCache && (o.useCache = !1)), null != n && !0 === n.inMemoryOnly) o.queueWriteToDisk ? i.queuedWrite = !0 : o.queueWriteToDisk = !1,
634
+ if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
635
+ const i = b(t);
636
+ if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
637
+ "string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
638
+ i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
639
+ !1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
636
640
  await h(t, !0); else if (null != n && !0 === n.immediateWrite) {
637
- if (i.changedContent || !0 !== n.useCache) {
641
+ if (o.changedContent || !0 !== n.useCache) {
638
642
  const r = await e.readFile(t);
639
- "string" == typeof r && (i.changedContent = o.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
640
- i.changedContent && (await h(t, !1), await e.writeFile(t, o.fileText));
643
+ "string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
644
+ o.changedContent && (await h(t, !1), await e.writeFile(t, i.fileText));
641
645
  }
642
- } else o.queueWriteToDisk || !0 !== i.changedContent || (o.queueWriteToDisk = !0,
643
- i.queuedWrite = !0);
644
- return i;
646
+ } else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
647
+ o.queuedWrite = !0);
648
+ return o;
645
649
  }, h = async (e, t) => {
646
650
  const r = [];
647
651
  for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
@@ -724,12 +728,12 @@ function mockCompilerCtx(e) {
724
728
  clearDirCache: _,
725
729
  clearFileCache: v,
726
730
  commit: async () => {
727
- const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy), i = await y(e.filesToDelete), o = await w(e.dirsToDelete);
731
+ const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy), o = await y(e.filesToDelete), i = await w(e.dirsToDelete);
728
732
  return e.filesToDelete.forEach(v), e.dirsToDelete.forEach(_), {
729
733
  filesCopied: n,
730
734
  filesWritten: s,
731
- filesDeleted: i,
732
- dirsDeleted: o,
735
+ filesDeleted: o,
736
+ dirsDeleted: i,
733
737
  dirsAdded: r
734
738
  };
735
739
  },
@@ -813,6 +817,10 @@ function mockCompilerCtx(e) {
813
817
  }), t;
814
818
  }
815
819
 
820
+ function mockLogger() {
821
+ return new TestingLogger;
822
+ }
823
+
816
824
  function findRootComponent(e, t) {
817
825
  if (null != t) {
818
826
  const r = t.children, s = r.length;
@@ -839,19 +847,19 @@ async function initPageEvents(e) {
839
847
  }
840
848
 
841
849
  async function pageSpyOnEvent(e, t, r) {
842
- const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, i = await e.evaluateHandle(n);
843
- return await addE2EListener(e, i, t, (e => {
850
+ const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, o = await e.evaluateHandle(n);
851
+ return await addE2EListener(e, o, t, (e => {
844
852
  s.push(e);
845
853
  })), s;
846
854
  }
847
855
 
848
856
  async function waitForEvent(e, t, r) {
849
857
  const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
850
- const i = setTimeout((() => {
858
+ const o = setTimeout((() => {
851
859
  n(new Error(`waitForEvent() timeout, eventName: ${t}`));
852
860
  }), r);
853
861
  e.addEventListener(t, (e => {
854
- clearTimeout(i), s(window.stencilSerializeEvent(e));
862
+ clearTimeout(o), s(window.stencilSerializeEvent(e));
855
863
  }), {
856
864
  once: !0
857
865
  });
@@ -865,8 +873,8 @@ async function addE2EListener(e, t, r, s) {
865
873
  eventName: r,
866
874
  callback: s
867
875
  });
868
- const i = t.executionContext();
869
- await i.evaluate(((e, t, r) => {
876
+ const o = t.executionContext();
877
+ await o.evaluate(((e, t, r) => {
870
878
  e.addEventListener(r, (e => {
871
879
  window.stencilOnEvent(t, window.stencilSerializeEvent(e));
872
880
  }));
@@ -922,7 +930,7 @@ function browserContextEvents() {
922
930
  }
923
931
 
924
932
  async function find(e, t, r) {
925
- const {lightSelector: s, shadowSelector: n, text: i, contains: o} = getSelector(r);
933
+ const {lightSelector: s, shadowSelector: n, text: o, contains: i} = getSelector(r);
926
934
  let a;
927
935
  if (a = "string" == typeof s ? await async function l(e, t, r, s) {
928
936
  let n = await t.$(r);
@@ -950,20 +958,20 @@ async function find(e, t, r) {
950
958
  }(e), s;
951
959
  }), t, r, s);
952
960
  return n ? n.asElement() : null;
953
- }(e, t, i, o), !a) return null;
961
+ }(e, t, o, i), !a) return null;
954
962
  const u = new E2EElement(e, a);
955
963
  return await u.e2eSync(), u;
956
964
  }
957
965
 
958
966
  async function findAll(e, t, r) {
959
- const s = [], {lightSelector: n, shadowSelector: i} = getSelector(r), o = await t.$$(n);
960
- if (0 === o.length) return s;
961
- if (i) for (let t = 0; t < o.length; t++) {
962
- const r = o[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
967
+ const s = [], {lightSelector: n, shadowSelector: o} = getSelector(r), i = await t.$$(n);
968
+ if (0 === i.length) return s;
969
+ if (o) for (let t = 0; t < i.length; t++) {
970
+ const r = i[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
963
971
  if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
964
972
  return e.shadowRoot.querySelectorAll(t);
965
- }), o[t], i);
966
- await o[t].dispose();
973
+ }), i[t], o);
974
+ await i[t].dispose();
967
975
  const a = await n.getProperties();
968
976
  await n.dispose();
969
977
  for (const t of a.values()) {
@@ -973,8 +981,8 @@ async function findAll(e, t, r) {
973
981
  await t.e2eSync(), s.push(t);
974
982
  }
975
983
  }
976
- } else for (let t = 0; t < o.length; t++) {
977
- const r = new E2EElement(e, o[t]);
984
+ } else for (let t = 0; t < i.length; t++) {
985
+ const r = new E2EElement(e, i[t]);
978
986
  await r.e2eSync(), s.push(r);
979
987
  }
980
988
  return s;
@@ -1013,7 +1021,7 @@ function writeFile(e, t) {
1013
1021
  }));
1014
1022
  }
1015
1023
 
1016
- async function compareScreenshot(e, t, r, s, n, i, o, a) {
1024
+ async function compareScreenshot(e, t, r, s, n, o, i, a) {
1017
1025
  const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
1018
1026
  await async function u(e, t) {
1019
1027
  await function r(e) {
@@ -1021,7 +1029,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
1021
1029
  fs__default.default.access(e, (e => t(!e)));
1022
1030
  }));
1023
1031
  }(e) || await writeFile(e, t);
1024
- }(c, r), r = null, o && (o = normalizePath(path$2.relative(t.rootDir, o)));
1032
+ }(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
1025
1033
  const d = function h(e, t) {
1026
1034
  if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
1027
1035
  const r = crypto$3.createHash("md5");
@@ -1034,9 +1042,9 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
1034
1042
  device: e.device,
1035
1043
  userAgent: e.userAgent,
1036
1044
  desc: s,
1037
- testPath: o,
1045
+ testPath: i,
1038
1046
  width: n,
1039
- height: i,
1047
+ height: o,
1040
1048
  deviceScaleFactor: e.viewport.deviceScaleFactor,
1041
1049
  hasTouch: e.viewport.hasTouch,
1042
1050
  isLandscape: e.viewport.isLandscape,
@@ -1050,14 +1058,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
1050
1058
  device: e.device,
1051
1059
  userAgent: e.userAgent,
1052
1060
  width: n,
1053
- height: i,
1061
+ height: o,
1054
1062
  deviceScaleFactor: e.viewport.deviceScaleFactor,
1055
1063
  hasTouch: e.viewport.hasTouch,
1056
1064
  isLandscape: e.viewport.isLandscape,
1057
1065
  isMobile: e.viewport.isMobile,
1058
1066
  allowableMismatchedPixels: t.allowableMismatchedPixels,
1059
1067
  allowableMismatchedRatio: t.allowableMismatchedRatio,
1060
- testPath: o
1068
+ testPath: i
1061
1069
  }
1062
1070
  };
1063
1071
  if (t.updateMaster) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
@@ -1079,7 +1087,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
1079
1087
  };
1080
1088
  p.diff.mismatchedPixels = await async function g(e, t) {
1081
1089
  return new Promise(((r, s) => {
1082
- const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, i = setTimeout((() => {
1090
+ const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout((() => {
1083
1091
  s(`getMismatchedPixels timeout: ${n}ms`);
1084
1092
  }), n);
1085
1093
  try {
@@ -1088,14 +1096,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
1088
1096
  env: process.env,
1089
1097
  cwd: process.cwd(),
1090
1098
  stdio: [ "pipe", "pipe", "pipe", "ipc" ]
1091
- }, o = child_process$2.fork(e, [], n);
1092
- o.on("message", (e => {
1093
- o.kill(), clearTimeout(i), r(e);
1094
- })), o.on("error", (e => {
1095
- clearTimeout(i), s(e);
1096
- })), o.send(t);
1099
+ }, i = child_process$2.fork(e, [], n);
1100
+ i.on("message", (e => {
1101
+ i.kill(), clearTimeout(o), r(e);
1102
+ })), i.on("error", (e => {
1103
+ clearTimeout(o), s(e);
1104
+ })), i.send(t);
1097
1105
  } catch (e) {
1098
- clearTimeout(i), s(`getMismatchedPixels error: ${e}`);
1106
+ clearTimeout(o), s(`getMismatchedPixels error: ${e}`);
1099
1107
  }
1100
1108
  }));
1101
1109
  }(t.pixelmatchModulePath, n);
@@ -1112,9 +1120,9 @@ async function e2eGoTo(e, t, r = {}) {
1112
1120
  if ("string" != typeof s) throw new Error("invalid gotoTest() browser url");
1113
1121
  const n = s + t.substring(1);
1114
1122
  r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
1115
- const i = await e._e2eGoto(n, r);
1116
- if (!i.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${i.status()}`);
1117
- return await waitForStencil(e, r), i;
1123
+ const o = await e._e2eGoto(n, r);
1124
+ if (!o.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${o.status()}`);
1125
+ return await waitForStencil(e, r), o;
1118
1126
  }
1119
1127
 
1120
1128
  async function e2eSetContent(e, t, r = {}) {
@@ -1123,18 +1131,18 @@ async function e2eSetContent(e, t, r = {}) {
1123
1131
  const s = [], n = env.__STENCIL_APP_SCRIPT_URL__;
1124
1132
  if ("string" != typeof n) throw new Error("invalid e2eSetContent() app script url");
1125
1133
  s.push("<!doctype html>"), s.push("<html>"), s.push("<head>");
1126
- const i = env.__STENCIL_APP_STYLE_URL__;
1127
- "string" == typeof i && s.push(`<link rel="stylesheet" href="${i}">`), s.push(`<script type="module" src="${n}"><\/script>`),
1134
+ const o = env.__STENCIL_APP_STYLE_URL__;
1135
+ "string" == typeof o && s.push(`<link rel="stylesheet" href="${o}">`), s.push(`<script type="module" src="${n}"><\/script>`),
1128
1136
  s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
1129
- const o = env.__STENCIL_BROWSER_URL__;
1137
+ const i = env.__STENCIL_BROWSER_URL__;
1130
1138
  await e.setRequestInterception(!0), e.on("request", (e => {
1131
- o === e.url() ? e.respond({
1139
+ i === e.url() ? e.respond({
1132
1140
  status: 200,
1133
1141
  contentType: "text/html",
1134
1142
  body: s.join("\n")
1135
1143
  }) : e.continue();
1136
1144
  })), r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
1137
- const a = await e._e2eGoto(o, r);
1145
+ const a = await e._e2eGoto(i, r);
1138
1146
  if (!a.ok()) throw new Error("Testing unable to load content");
1139
1147
  return await waitForStencil(e, r), a;
1140
1148
  }
@@ -1242,8 +1250,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
1242
1250
  }, noop = () => {}, isFunction = e => "function" == typeof e, isString = e => "string" == typeof e, isIterable = e => (e => null != e)(e) && isFunction(e[Symbol.iterator]), windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/, hasError = e => null != e && 0 !== e.length && e.some((e => "error" === e.level && "runtime" !== e.type)), normalizePath = e => {
1243
1251
  if ("string" != typeof e) throw new Error("invalid path to normalize");
1244
1252
  e = normalizeSlashes(e.trim());
1245
- const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], i = s + r.slice(1).join("/");
1246
- return "" === i ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + i : i;
1253
+ const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], o = s + r.slice(1).join("/");
1254
+ return "" === o ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + o : o;
1247
1255
  }, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
1248
1256
  if (!Array.isArray(e) || 0 === e.length) return [];
1249
1257
  const t = [ e[0] ];
@@ -1280,8 +1288,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
1280
1288
  if (-1 !== r) {
1281
1289
  const t = r + "://".length, s = e.indexOf("/", t);
1282
1290
  if (-1 !== s) {
1283
- const n = e.slice(0, r), i = e.slice(t, s);
1284
- if ("file" === n && ("" === i || "localhost" === i) && isVolumeCharacter(e.charCodeAt(s + 1))) {
1291
+ const n = e.slice(0, r), o = e.slice(t, s);
1292
+ if ("file" === n && ("" === o || "localhost" === o) && isVolumeCharacter(e.charCodeAt(s + 1))) {
1285
1293
  const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
1286
1294
  if (-1 !== t) {
1287
1295
  if (47 === e.charCodeAt(t)) return ~(t + 1);
@@ -1334,12 +1342,12 @@ const jestPreprocessor = {
1334
1342
  currentDirectory: s.rootDir
1335
1343
  }, n = getCompilerOptions(s.rootDir);
1336
1344
  n && (n.baseUrl && (r.baseUrl = n.baseUrl), n.paths && (r.paths = n.paths));
1337
- const i = transpile(e, r), o = i.diagnostics.some((e => "error" === e.level));
1338
- if (i.diagnostics && o) {
1339
- const e = i.diagnostics.map(formatDiagnostic).join("\n\n");
1345
+ const o = transpile(e, r), i = o.diagnostics.some((e => "error" === e.level));
1346
+ if (o.diagnostics && i) {
1347
+ const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
1340
1348
  throw new Error(e);
1341
1349
  }
1342
- return i.code;
1350
+ return o.code;
1343
1351
  }
1344
1352
  return e;
1345
1353
  },
@@ -1354,10 +1362,10 @@ const jestPreprocessor = {
1354
1362
  if (t === r) return !0;
1355
1363
  if (t && r && "object" == typeof t && "object" == typeof r) {
1356
1364
  const s = Array.isArray(t), n = Array.isArray(r);
1357
- let i, o, a;
1365
+ let o, i, a;
1358
1366
  if (s && n) {
1359
- if (o = t.length, o != r.length) return !1;
1360
- for (i = o; 0 != i--; ) if (!e(t[i], r[i])) return !1;
1367
+ if (i = t.length, i != r.length) return !1;
1368
+ for (o = i; 0 != o--; ) if (!e(t[o], r[o])) return !1;
1361
1369
  return !0;
1362
1370
  }
1363
1371
  if (s != n) return !1;
@@ -1368,9 +1376,9 @@ const jestPreprocessor = {
1368
1376
  if (u != d) return !1;
1369
1377
  if (u && d) return t.toString() == r.toString();
1370
1378
  const h = Object.keys(t);
1371
- if (o = h.length, o !== Object.keys(r).length) return !1;
1372
- for (i = o; 0 != i--; ) if (!Object.prototype.hasOwnProperty.call(r, h[i])) return !1;
1373
- for (i = o; 0 != i--; ) if (a = h[i], !e(t[a], r[a])) return !1;
1379
+ if (i = h.length, i !== Object.keys(r).length) return !1;
1380
+ for (o = i; 0 != o--; ) if (!Object.prototype.hasOwnProperty.call(r, h[o])) return !1;
1381
+ for (o = i; 0 != o--; ) if (a = h[o], !e(t[a], r[a])) return !1;
1374
1382
  return !0;
1375
1383
  }
1376
1384
  return t != t && r != r;
@@ -1768,9 +1776,9 @@ class BuildContext {
1768
1776
  }
1769
1777
  return {
1770
1778
  duration: () => r.duration(),
1771
- finish: (e, s, n, i) => {
1779
+ finish: (e, s, n, o) => {
1772
1780
  if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
1773
- r.finish(e, s, n, i), !t)) {
1781
+ r.finish(e, s, n, o), !t)) {
1774
1782
  const e = {
1775
1783
  buildId: this.buildId,
1776
1784
  messages: this.buildMessages.slice(),
@@ -1886,12 +1894,12 @@ class Cache {
1886
1894
  if (null != t) {
1887
1895
  if (e - t < ONE_DAY) return;
1888
1896
  const r = this.cacheFs.sys, s = await r.readDir(this.config.cacheDir), n = s.map((e => path$2.join(this.config.cacheDir, e)));
1889
- let i = 0;
1890
- const o = n.map((async t => {
1897
+ let o = 0;
1898
+ const i = n.map((async t => {
1891
1899
  const s = (await r.stat(t)).mtimeMs;
1892
- e - s > ONE_WEEK && (await r.removeFile(t), i++);
1900
+ e - s > ONE_WEEK && (await r.removeFile(t), o++);
1893
1901
  }));
1894
- await Promise.all(o), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${i}`);
1902
+ await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${o}`);
1895
1903
  }
1896
1904
  this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
1897
1905
  }
@@ -1933,10 +1941,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
1933
1941
  } else if (!0 === e.queueDeleteFromDisk) e.isDirectory && !t.dirsToEnsure.includes(r) ? t.dirsToDelete.push(r) : e.isFile && !t.filesToWrite.includes(r) && t.filesToDelete.push(r); else if ("string" == typeof e.queueCopyFileToDest) {
1934
1942
  const s = r, n = e.queueCopyFileToDest;
1935
1943
  t.filesToCopy.push([ s, n ]);
1936
- const i = normalizePath(path$2.dirname(n));
1937
- t.dirsToEnsure.includes(i) || t.dirsToEnsure.push(i);
1938
- const o = t.dirsToDelete.indexOf(i);
1939
- o > -1 && t.dirsToDelete.splice(o, 1);
1944
+ const o = normalizePath(path$2.dirname(n));
1945
+ t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
1946
+ const i = t.dirsToDelete.indexOf(o);
1947
+ i > -1 && t.dirsToDelete.splice(i, 1);
1940
1948
  const a = t.filesToDelete.indexOf(n);
1941
1949
  a > -1 && t.filesToDelete.splice(a, 1);
1942
1950
  }
@@ -1969,10 +1977,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
1969
1977
 
1970
1978
  (posix = {
1971
1979
  resolve: function e() {
1972
- var t, r, s, n = "", i = !1;
1973
- for (r = arguments.length - 1; r >= -1 && !i; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
1974
- s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, i = 47 === s.charCodeAt(0));
1975
- return n = normalizeStringPosix(n, !i), i ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
1980
+ var t, r, s, n = "", o = !1;
1981
+ for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
1982
+ s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, o = 47 === s.charCodeAt(0));
1983
+ return n = normalizeStringPosix(n, !o), o ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
1976
1984
  },
1977
1985
  normalize: function e(t) {
1978
1986
  var r, s;
@@ -1990,70 +1998,70 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
1990
1998
  return void 0 === t ? "." : posix.normalize(t);
1991
1999
  },
1992
2000
  relative: function e(t, r) {
1993
- var s, n, i, o, a, l, c, u, d, h;
2001
+ var s, n, o, i, a, l, c, u, d, h;
1994
2002
  if (assertPath(t), assertPath(r), t === r) return "";
1995
2003
  if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
1996
2004
  for (s = 1; s < t.length && 47 === t.charCodeAt(s); ++s) ;
1997
- for (i = (n = t.length) - s, o = 1; o < r.length && 47 === r.charCodeAt(o); ++o) ;
1998
- for (l = i < (a = r.length - o) ? i : a, c = -1, u = 0; u <= l; ++u) {
2005
+ for (o = (n = t.length) - s, i = 1; i < r.length && 47 === r.charCodeAt(i); ++i) ;
2006
+ for (l = o < (a = r.length - i) ? o : a, c = -1, u = 0; u <= l; ++u) {
1999
2007
  if (u === l) {
2000
2008
  if (a > l) {
2001
- if (47 === r.charCodeAt(o + u)) return r.slice(o + u + 1);
2002
- if (0 === u) return r.slice(o + u);
2003
- } else i > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
2009
+ if (47 === r.charCodeAt(i + u)) return r.slice(i + u + 1);
2010
+ if (0 === u) return r.slice(i + u);
2011
+ } else o > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
2004
2012
  break;
2005
2013
  }
2006
- if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(o + u)) break;
2014
+ if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(i + u)) break;
2007
2015
  47 === d && (c = u);
2008
2016
  }
2009
2017
  for (h = "", u = s + c + 1; u <= n; ++u) u !== n && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
2010
- return h.length > 0 ? h + r.slice(o + c) : (o += c, 47 === r.charCodeAt(o) && ++o,
2011
- r.slice(o));
2018
+ return h.length > 0 ? h + r.slice(i + c) : (i += c, 47 === r.charCodeAt(i) && ++i,
2019
+ r.slice(i));
2012
2020
  },
2013
2021
  _makeLong: function e(t) {
2014
2022
  return t;
2015
2023
  },
2016
2024
  dirname: function e(t) {
2017
- var r, s, n, i;
2025
+ var r, s, n, o;
2018
2026
  if (assertPath(t), 0 === t.length) return ".";
2019
- for (r = 47 === t.charCodeAt(0), s = -1, n = !0, i = t.length - 1; i >= 1; --i) if (47 === t.charCodeAt(i)) {
2027
+ for (r = 47 === t.charCodeAt(0), s = -1, n = !0, o = t.length - 1; o >= 1; --o) if (47 === t.charCodeAt(o)) {
2020
2028
  if (!n) {
2021
- s = i;
2029
+ s = o;
2022
2030
  break;
2023
2031
  }
2024
2032
  } else n = !1;
2025
2033
  return -1 === s ? r ? "/" : "." : r && 1 === s ? "//" : t.slice(0, s);
2026
2034
  },
2027
2035
  basename: function e(t, r) {
2028
- var s, n, i, o, a, l, c;
2036
+ var s, n, o, i, a, l, c;
2029
2037
  if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
2030
- if (assertPath(t), s = 0, n = -1, i = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
2038
+ if (assertPath(t), s = 0, n = -1, o = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
2031
2039
  if (r.length === t.length && r === t) return "";
2032
- for (a = r.length - 1, l = -1, o = t.length - 1; o >= 0; --o) if (47 === (c = t.charCodeAt(o))) {
2033
- if (!i) {
2034
- s = o + 1;
2040
+ for (a = r.length - 1, l = -1, i = t.length - 1; i >= 0; --i) if (47 === (c = t.charCodeAt(i))) {
2041
+ if (!o) {
2042
+ s = i + 1;
2035
2043
  break;
2036
2044
  }
2037
- } else -1 === l && (i = !1, l = o + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = o) : (a = -1,
2045
+ } else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = i) : (a = -1,
2038
2046
  n = l));
2039
2047
  return s === n ? n = l : -1 === n && (n = t.length), t.slice(s, n);
2040
2048
  }
2041
- for (o = t.length - 1; o >= 0; --o) if (47 === t.charCodeAt(o)) {
2042
- if (!i) {
2043
- s = o + 1;
2049
+ for (i = t.length - 1; i >= 0; --i) if (47 === t.charCodeAt(i)) {
2050
+ if (!o) {
2051
+ s = i + 1;
2044
2052
  break;
2045
2053
  }
2046
- } else -1 === n && (i = !1, n = o + 1);
2054
+ } else -1 === n && (o = !1, n = i + 1);
2047
2055
  return -1 === n ? "" : t.slice(s, n);
2048
2056
  },
2049
2057
  extname: function e(t) {
2050
- var r, s, n, i, o, a, l;
2051
- for (assertPath(t), r = -1, s = 0, n = -1, i = !0, o = 0, a = t.length - 1; a >= 0; --a) if (47 !== (l = t.charCodeAt(a))) -1 === n && (i = !1,
2052
- n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== o && (o = 1) : -1 !== r && (o = -1); else if (!i) {
2058
+ var r, s, n, o, i, a, l;
2059
+ for (assertPath(t), r = -1, s = 0, n = -1, o = !0, i = 0, a = t.length - 1; a >= 0; --a) if (47 !== (l = t.charCodeAt(a))) -1 === n && (o = !1,
2060
+ n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== i && (i = 1) : -1 !== r && (i = -1); else if (!o) {
2053
2061
  s = a + 1;
2054
2062
  break;
2055
2063
  }
2056
- return -1 === r || -1 === n || 0 === o || 1 === o && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
2064
+ return -1 === r || -1 === n || 0 === i || 1 === i && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
2057
2065
  },
2058
2066
  format: function e(t) {
2059
2067
  if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
@@ -2063,7 +2071,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
2063
2071
  }("/", t);
2064
2072
  },
2065
2073
  parse: function e(t) {
2066
- var r, s, n, i, o, a, l, c, u, d;
2074
+ var r, s, n, o, i, a, l, c, u, d;
2067
2075
  if (assertPath(t), r = {
2068
2076
  root: "",
2069
2077
  dir: "",
@@ -2071,14 +2079,14 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
2071
2079
  ext: "",
2072
2080
  name: ""
2073
2081
  }, 0 === t.length) return r;
2074
- for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", i = 1) : i = 0, o = -1,
2075
- a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= i; --u) if (47 !== (s = t.charCodeAt(u))) -1 === l && (c = !1,
2076
- l = u + 1), 46 === s ? -1 === o ? o = u : 1 !== d && (d = 1) : -1 !== o && (d = -1); else if (!c) {
2082
+ for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", o = 1) : o = 0, i = -1,
2083
+ a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= o; --u) if (47 !== (s = t.charCodeAt(u))) -1 === l && (c = !1,
2084
+ l = u + 1), 46 === s ? -1 === i ? i = u : 1 !== d && (d = 1) : -1 !== i && (d = -1); else if (!c) {
2077
2085
  a = u + 1;
2078
2086
  break;
2079
2087
  }
2080
- return -1 === o || -1 === l || 0 === d || 1 === d && o === l - 1 && o === a + 1 ? -1 !== l && (r.base = r.name = 0 === a && n ? t.slice(1, l) : t.slice(a, l)) : (0 === a && n ? (r.name = t.slice(1, o),
2081
- r.base = t.slice(1, l)) : (r.name = t.slice(a, o), r.base = t.slice(a, l)), r.ext = t.slice(o, l)),
2088
+ return -1 === i || -1 === l || 0 === d || 1 === d && i === l - 1 && i === a + 1 ? -1 !== l && (r.base = r.name = 0 === a && n ? t.slice(1, l) : t.slice(a, l)) : (0 === a && n ? (r.name = t.slice(1, i),
2089
+ r.base = t.slice(1, l)) : (r.name = t.slice(a, i), r.base = t.slice(a, l)), r.ext = t.slice(i, l)),
2082
2090
  a > 0 ? r.dir = t.slice(0, a - 1) : n && (r.dir = "/"), r;
2083
2091
  },
2084
2092
  sep: "/",
@@ -2087,7 +2095,46 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
2087
2095
  posix: null
2088
2096
  }).posix = posix, pathBrowserify = posix;
2089
2097
 
2090
- const IS_NODE_ENV = !("undefined" == typeof global || "function" != typeof require || !global.process || "string" != typeof __filename || global.origin && "string" == typeof global.origin);
2098
+ const buildEvents = () => {
2099
+ const e = [], t = t => {
2100
+ const r = e.findIndex((e => e.callback === t));
2101
+ return r > -1 && (e.splice(r, 1), !0);
2102
+ };
2103
+ return {
2104
+ emit: (t, r) => {
2105
+ const s = t.toLowerCase().trim(), n = e.slice();
2106
+ for (const e of n) if (null == e.eventName) try {
2107
+ e.callback(t, r);
2108
+ } catch (e) {
2109
+ console.error(e);
2110
+ } else if (e.eventName === s) try {
2111
+ e.callback(r);
2112
+ } catch (e) {
2113
+ console.error(e);
2114
+ }
2115
+ },
2116
+ on: (r, s) => {
2117
+ if ("function" == typeof r) {
2118
+ const s = null, n = r;
2119
+ return e.push({
2120
+ eventName: s,
2121
+ callback: n
2122
+ }), () => t(n);
2123
+ }
2124
+ if ("string" == typeof r && "function" == typeof s) {
2125
+ const n = r.toLowerCase().trim(), o = s;
2126
+ return e.push({
2127
+ eventName: n,
2128
+ callback: o
2129
+ }), () => t(o);
2130
+ }
2131
+ return () => !1;
2132
+ },
2133
+ unsubscribeAll: () => {
2134
+ e.length = 0;
2135
+ }
2136
+ };
2137
+ }, IS_NODE_ENV = !("undefined" == typeof global || "function" != typeof require || !global.process || "string" != typeof __filename || global.origin && "string" == typeof global.origin);
2091
2138
 
2092
2139
  IS_NODE_ENV && process.platform;
2093
2140
 
@@ -2116,21 +2163,20 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
2116
2163
  let s = (r = normalizePath(r)).split("/").filter((e => e.length));
2117
2164
  const n = s.lastIndexOf("node_modules");
2118
2165
  n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
2119
- let i = s.shift();
2120
- i.startsWith("@") && (i += "/" + s.shift());
2121
- const o = s.join("/");
2122
- if ("@stencil/core" === i) {
2123
- return ((e, t) => {
2124
- let r = (t = normalizePath(t)).split("/");
2125
- const s = r.lastIndexOf("node_modules");
2126
- return s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
2127
- t = r.join("/")), new URL("./" + t, (e => new URL("../", e).href)(e)).href;
2128
- })(e.getCompilerExecutingPath(), o);
2129
- }
2130
- return e.getRemoteModuleUrl({
2131
- moduleId: i,
2132
- version: t.get(i),
2133
- path: o
2166
+ let o = s.shift();
2167
+ o.startsWith("@") && (o += "/" + s.shift());
2168
+ const i = s.join("/");
2169
+ return "@stencil/core" === o ? ((e, t) => {
2170
+ let r = (t = normalizePath(t)).split("/");
2171
+ const s = r.lastIndexOf("node_modules");
2172
+ s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
2173
+ t = r.join("/"));
2174
+ const n = new URL("../", e).href;
2175
+ return new URL("./" + t, n).href;
2176
+ })(e.getCompilerExecutingPath(), i) : e.getRemoteModuleUrl({
2177
+ moduleId: o,
2178
+ version: t.get(o),
2179
+ path: i
2134
2180
  });
2135
2181
  }, knownUrlSkips = [ "/@stencil/core/internal.js", "/@stencil/core/internal.json", "/@stencil/core/internal.mjs", "/@stencil/core/internal/stencil-core.js/index.json", "/@stencil/core/internal/stencil-core.js.json", "/@stencil/core/internal/stencil-core.js/package.json", "/@stencil/core.js", "/@stencil/core.json", "/@stencil/core.mjs", "/@stencil/core.css", "/@stencil/core/index.js", "/@stencil/core/index.json", "/@stencil/core/index.mjs", "/@stencil/core/index.css", "/@stencil/package.json" ], fetchModuleAsync = async (e, t, r, s, n) => {
2136
2182
  if (!((e => {
@@ -2139,11 +2185,11 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
2139
2185
  const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
2140
2186
  return !("node_modules" !== s || !isCommonDirModuleFile(n));
2141
2187
  })(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
2142
- const i = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r)))(e, s);
2143
- if (i) {
2144
- if (i.ok) {
2145
- const o = await i.clone().text();
2146
- return await (async (e, t, r, s, n, i) => {
2188
+ const o = await ((e, t, r) => e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r))(e, s);
2189
+ if (o) {
2190
+ if (o.ok) {
2191
+ const i = await o.clone().text();
2192
+ return await (async (e, t, r, s, n, o) => {
2147
2193
  r.endsWith("package.json") && ((e, t) => {
2148
2194
  try {
2149
2195
  const r = JSON.parse(t);
@@ -2151,14 +2197,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
2151
2197
  e.set(t, r);
2152
2198
  })(e, r.name, r.version);
2153
2199
  } catch (e) {}
2154
- })(i, n);
2155
- let o = path$2.dirname(s);
2156
- for (;"/" !== o && "" !== o; ) t ? (t.clearFileCache(o), await t.sys.createDir(o)) : await e.createDir(o),
2157
- o = path$2.dirname(o);
2200
+ })(o, n);
2201
+ let i = path$2.dirname(s);
2202
+ for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
2203
+ i = path$2.dirname(i);
2158
2204
  t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
2159
- })(e, t, s, n, o, r), o;
2205
+ })(e, t, s, n, i, r), i;
2160
2206
  }
2161
- 404 === i.status && known404Urls.add(s);
2207
+ 404 === o.status && known404Urls.add(s);
2162
2208
  }
2163
2209
  } catch (e) {
2164
2210
  console.error(e);
@@ -2181,7 +2227,7 @@ caller = function() {
2181
2227
  }
2182
2228
  }, r.exports), r.exports;
2183
2229
  }((function(e) {
2184
- var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, i = {
2230
+ var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, o = {
2185
2231
  parse: function(e) {
2186
2232
  if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
2187
2233
  var t = function r(e) {
@@ -2210,26 +2256,26 @@ caller = function() {
2210
2256
  ext: r[4],
2211
2257
  name: r[3]
2212
2258
  };
2213
- }, e.exports = s ? i.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = i.parse;
2259
+ }, e.exports = s ? o.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = o.parse;
2214
2260
  })), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
2215
- var s, n, i = "/";
2216
- for (/^([A-Za-z]:)/.test(t) ? i = "" : /^\\\\/.test(t) && (i = "\\\\"), s = [ t ],
2261
+ var s, n, o = "/";
2262
+ for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), s = [ t ],
2217
2263
  n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
2218
2264
  return s.reduce((function(e, t) {
2219
2265
  return e.concat(r.map((function(e) {
2220
- return path__default.default.resolve(i, t, e);
2266
+ return path__default.default.resolve(o, t, e);
2221
2267
  })));
2222
2268
  }), []);
2223
2269
  }, nodeModulesPaths = function e(t, r, s) {
2224
- var n, i = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
2270
+ var n, o = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
2225
2271
  return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
2226
- return getNodeModulesDirs(t, i);
2227
- }), r) : (n = getNodeModulesDirs(t, i), r && r.paths ? n.concat(r.paths) : n);
2272
+ return getNodeModulesDirs(t, o);
2273
+ }), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
2228
2274
  }, normalizeOptions = function(e, t) {
2229
2275
  return t || {};
2230
2276
  }, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
2231
2277
  toStr = Object.prototype.toString, implementation = function e(t) {
2232
- var r, s, n, i, o, a, l, c = this;
2278
+ var r, s, n, o, i, a, l, c = this;
2233
2279
  if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
2234
2280
  for (r = slice.call(arguments, 1), n = function() {
2235
2281
  if (this instanceof s) {
@@ -2237,8 +2283,8 @@ toStr = Object.prototype.toString, implementation = function e(t) {
2237
2283
  return Object(e) === e ? e : this;
2238
2284
  }
2239
2285
  return c.apply(t, r.concat(slice.call(arguments)));
2240
- }, i = Math.max(0, c.length - r.length), o = [], a = 0; a < i; a++) o.push("$" + a);
2241
- return s = Function("binder", "return function (" + o.join(",") + "){ return binder.apply(this,arguments); }")(n),
2286
+ }, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
2287
+ return s = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(n),
2242
2288
  c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
2243
2289
  l.prototype = null), s;
2244
2290
  }, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
@@ -2363,13 +2409,13 @@ defaultIsFile$1 = function e(t, r) {
2363
2409
  }
2364
2410
  }));
2365
2411
  }, getPackageCandidates$1 = function e(t, r, s) {
2366
- var n, i = nodeModulesPaths(r, s, t);
2367
- for (n = 0; n < i.length; n++) i[n] = path__default.default.join(i[n], t);
2368
- return i;
2412
+ var n, o = nodeModulesPaths(r, s, t);
2413
+ for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
2414
+ return o;
2369
2415
  }, async = function e(t, r, s) {
2370
2416
  function n(e) {
2371
2417
  if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) T = path__default.default.resolve(e, t),
2372
- "." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, i) : o(T, C.package, i); else {
2418
+ "." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, o) : i(T, C.package, o); else {
2373
2419
  if (_ && isCoreModule(t)) return S(null, t);
2374
2420
  !function r(e, t, s) {
2375
2421
  var n = function() {
@@ -2387,7 +2433,7 @@ defaultIsFile$1 = function e(t, r) {
2387
2433
  }));
2388
2434
  }
2389
2435
  }
2390
- function i(e, r, s) {
2436
+ function o(e, r, s) {
2391
2437
  e ? S(e) : r ? S(null, r, s) : l(T, (function(e, r, s) {
2392
2438
  if (e) S(e); else if (r) maybeRealpath(f, r, C, (function(e, t) {
2393
2439
  e ? S(e) : S(null, t, s);
@@ -2397,20 +2443,20 @@ defaultIsFile$1 = function e(t, r) {
2397
2443
  }
2398
2444
  }));
2399
2445
  }
2400
- function o(e, t, r) {
2446
+ function i(e, t, r) {
2401
2447
  var s = t, n = r;
2402
2448
  "function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
2403
- function i(s, i, a) {
2449
+ function o(s, o, a) {
2404
2450
  var u, h, p;
2405
- return c = i, s ? n(s) : a && c && C.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
2406
- p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, o);
2451
+ return c = o, s ? n(s) : a && c && C.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
2452
+ p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
2407
2453
  }
2408
- function o(s, i) {
2409
- return s ? n(s) : i ? n(null, l, c) : void e(t.slice(1), r, c);
2454
+ function i(s, o) {
2455
+ return s ? n(s) : o ? n(null, l, c) : void e(t.slice(1), r, c);
2410
2456
  }
2411
2457
  var l, c;
2412
2458
  if (0 === t.length) return n(null, void 0, s);
2413
- l = r + t[0], (c = s) ? i(null, c) : a(path__default.default.dirname(l), i);
2459
+ l = r + t[0], (c = s) ? o(null, c) : a(path__default.default.dirname(l), o);
2414
2460
  }([ "" ].concat(w), e, s);
2415
2461
  }
2416
2462
  function a(e, t) {
@@ -2421,8 +2467,8 @@ defaultIsFile$1 = function e(t, r) {
2421
2467
  if (!s) return a(path__default.default.dirname(e), t);
2422
2468
  m(p, n, (function(r, s) {
2423
2469
  r && t(r);
2424
- var i = s;
2425
- i && C.packageFilter && (i = C.packageFilter(i, n)), t(null, i, e);
2470
+ var o = s;
2471
+ o && C.packageFilter && (o = C.packageFilter(o, n)), t(null, o, e);
2426
2472
  }));
2427
2473
  }));
2428
2474
  }));
@@ -2431,31 +2477,31 @@ defaultIsFile$1 = function e(t, r) {
2431
2477
  var s = r, n = t;
2432
2478
  "function" == typeof n && (s = n, n = C.package), maybeRealpath(f, e, C, (function(t, r) {
2433
2479
  if (t) return s(t);
2434
- var i = path__default.default.join(r, "package.json");
2435
- d(i, (function(t, r) {
2436
- return t ? s(t) : r ? void m(p, i, (function(t, r) {
2480
+ var o = path__default.default.join(r, "package.json");
2481
+ d(o, (function(t, r) {
2482
+ return t ? s(t) : r ? void m(p, o, (function(t, r) {
2437
2483
  var n, a;
2438
- return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n, i)), n && n.main ? "string" != typeof n.main ? ((a = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
2439
- s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void o(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
2484
+ return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n, o)), n && n.main ? "string" != typeof n.main ? ((a = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
2485
+ s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void i(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
2440
2486
  return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
2441
- return t ? s(t) : r ? s(null, r, n) : void o(path__default.default.join(e, "index"), n, s);
2442
- })) : o(path__default.default.join(e, "index"), n, s);
2443
- }))) : void o(path__default.default.join(e, "/index"), n, s));
2444
- })) : o(path__default.default.join(e, "index"), n, s);
2487
+ return t ? s(t) : r ? s(null, r, n) : void i(path__default.default.join(e, "index"), n, s);
2488
+ })) : i(path__default.default.join(e, "index"), n, s);
2489
+ }))) : void i(path__default.default.join(e, "/index"), n, s));
2490
+ })) : i(path__default.default.join(e, "index"), n, s);
2445
2491
  }));
2446
2492
  }));
2447
2493
  }
2448
2494
  function c(e, t) {
2449
- function r(t, r, i) {
2450
- return t ? e(t) : r ? e(null, r, i) : void l(n, C.package, s);
2495
+ function r(t, r, o) {
2496
+ return t ? e(t) : r ? e(null, r, o) : void l(n, C.package, s);
2451
2497
  }
2452
2498
  function s(r, s, n) {
2453
2499
  return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
2454
2500
  }
2455
2501
  if (0 === t.length) return e(null, void 0);
2456
2502
  var n = t[0];
2457
- h(path__default.default.dirname(n), (function i(s, a) {
2458
- return s ? e(s) : a ? void o(n, C.package, r) : c(e, t.slice(1));
2503
+ h(path__default.default.dirname(n), (function o(s, a) {
2504
+ return s ? e(s) : a ? void i(n, C.package, r) : c(e, t.slice(1));
2459
2505
  }));
2460
2506
  }
2461
2507
  var u, d, h, p, f, m, g, y, w, _, v, b, E, T, S = s, C = r;
@@ -2595,64 +2641,64 @@ defaultIsFile = function e(t) {
2595
2641
  return JSON.parse(s);
2596
2642
  } catch (e) {}
2597
2643
  }, getPackageCandidates = function e(t, r, s) {
2598
- var n, i = nodeModulesPaths(r, s, t);
2599
- for (n = 0; n < i.length; n++) i[n] = path__default.default.join(i[n], t);
2600
- return i;
2644
+ var n, o = nodeModulesPaths(r, s, t);
2645
+ for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
2646
+ return o;
2601
2647
  }, sync = function e(t, r) {
2602
2648
  function s(e) {
2603
- var t, r, s, i, l = n(path__default.default.dirname(e));
2604
- if (l && l.dir && l.pkg && o.pathFilter && (t = path__default.default.relative(l.dir, e),
2605
- (r = o.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
2649
+ var t, r, s, o, l = n(path__default.default.dirname(e));
2650
+ if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
2651
+ (r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
2606
2652
  a(e)) return e;
2607
- for (s = 0; s < p.length; s++) if (i = e + p[s], a(i)) return i;
2653
+ for (s = 0; s < p.length; s++) if (o = e + p[s], a(o)) return o;
2608
2654
  }
2609
2655
  function n(e) {
2610
2656
  var t, r;
2611
- if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e, o), "package.json"),
2612
- a(t) ? ((r = d(l, t)) && o.packageFilter && (r = o.packageFilter(r, e)), {
2657
+ if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e, i), "package.json"),
2658
+ a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
2613
2659
  pkg: r,
2614
2660
  dir: e
2615
2661
  }) : n(path__default.default.dirname(e));
2616
2662
  }
2617
- function i(e) {
2618
- var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, o), "/package.json");
2663
+ function o(e) {
2664
+ var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
2619
2665
  if (a(h)) {
2620
2666
  try {
2621
2667
  t = d(l, h);
2622
2668
  } catch (e) {}
2623
- if (t && o.packageFilter && (t = o.packageFilter(t, e)), t && t.main) {
2669
+ if (t && i.packageFilter && (t = i.packageFilter(t, e)), t && t.main) {
2624
2670
  if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
2625
2671
  r;
2626
2672
  "." !== t.main && "./" !== t.main || (t.main = "index");
2627
2673
  try {
2628
2674
  if (n = s(path__default.default.resolve(e, t.main))) return n;
2629
- if (c = i(path__default.default.resolve(e, t.main))) return c;
2675
+ if (c = o(path__default.default.resolve(e, t.main))) return c;
2630
2676
  } catch (e) {}
2631
2677
  }
2632
2678
  }
2633
2679
  return s(path__default.default.join(e, "/index"));
2634
2680
  }
2635
- var o, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
2681
+ var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
2636
2682
  if ("string" != typeof t) throw new TypeError("Path must be a string.");
2637
- if (o = normalizeOptions(0, r), a = o.isFile || defaultIsFile, l = o.readFileSync || fs__default.default.readFileSync,
2638
- c = o.isDirectory || defaultIsDir, u = o.realpathSync || defaultRealpathSync, d = o.readPackageSync || defaultReadPackageSync,
2639
- o.readFileSync && o.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
2640
- if (h = o.packageIterator, p = o.extensions || [ ".js" ], f = !1 !== o.includeCoreModules,
2641
- m = o.basedir || path__default.default.dirname(caller()), g = o.filename || m, o.paths = o.paths || [],
2642
- y = maybeRealpathSync(u, path__default.default.resolve(m), o), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
2683
+ if (i = normalizeOptions(0, r), a = i.isFile || defaultIsFile, l = i.readFileSync || fs__default.default.readFileSync,
2684
+ c = i.isDirectory || defaultIsDir, u = i.realpathSync || defaultRealpathSync, d = i.readPackageSync || defaultReadPackageSync,
2685
+ i.readFileSync && i.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
2686
+ if (h = i.packageIterator, p = i.extensions || [ ".js" ], f = !1 !== i.includeCoreModules,
2687
+ m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || [],
2688
+ y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
2643
2689
  if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
2644
- _ = s(w) || i(w)) return maybeRealpathSync(u, _, o);
2690
+ _ = s(w) || o(w)) return maybeRealpathSync(u, _, i);
2645
2691
  } else {
2646
2692
  if (f && isCoreModule(t)) return t;
2647
2693
  if (v = function E(e, t) {
2648
2694
  var r, n, a, l, u = function() {
2649
- return getPackageCandidates(e, t, o);
2650
- }, d = h ? h(e, t, u, o) : u();
2695
+ return getPackageCandidates(e, t, i);
2696
+ }, d = h ? h(e, t, u, i) : u();
2651
2697
  for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
2652
2698
  if (a = s(n)) return a;
2653
- if (l = i(n)) return l;
2699
+ if (l = o(n)) return l;
2654
2700
  }
2655
- }(t, y)) return maybeRealpathSync(u, v, o);
2701
+ }(t, y)) return maybeRealpathSync(u, v, i);
2656
2702
  }
2657
2703
  throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
2658
2704
  b;
@@ -2689,8 +2735,8 @@ const createSystem = e => {
2689
2735
  let r = BLUE, s = "Build", n = "";
2690
2736
  "error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
2691
2737
  s = "Warning"), e.header && (s = e.header);
2692
- const i = e.relFilePath || e.absFilePath;
2693
- if (i && (n += i, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
2738
+ const o = e.relFilePath || e.absFilePath;
2739
+ if (o && (n += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
2694
2740
  "number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
2695
2741
  n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
2696
2742
  n += "\n" + e.lineNumber + ": " + e.text;
@@ -2701,46 +2747,7 @@ const createSystem = e => {
2701
2747
  })(t, e)));
2702
2748
  }
2703
2749
  };
2704
- })(), r = new Map, s = new Set, n = e => s.add(e), i = e => s.delete(e), o = (() => {
2705
- const e = [], t = t => {
2706
- const r = e.findIndex((e => e.callback === t));
2707
- return r > -1 && (e.splice(r, 1), !0);
2708
- };
2709
- return {
2710
- emit: (t, r) => {
2711
- const s = t.toLowerCase().trim(), n = e.slice();
2712
- for (const e of n) if (null == e.eventName) try {
2713
- e.callback(t, r);
2714
- } catch (e) {
2715
- console.error(e);
2716
- } else if (e.eventName === s) try {
2717
- e.callback(r);
2718
- } catch (e) {
2719
- console.error(e);
2720
- }
2721
- },
2722
- on: (r, s) => {
2723
- if ("function" == typeof r) {
2724
- const s = null, n = r;
2725
- return e.push({
2726
- eventName: s,
2727
- callback: n
2728
- }), () => t(n);
2729
- }
2730
- if ("string" == typeof r && "function" == typeof s) {
2731
- const n = r.toLowerCase().trim(), i = s;
2732
- return e.push({
2733
- eventName: n,
2734
- callback: i
2735
- }), () => t(i);
2736
- }
2737
- return () => !1;
2738
- },
2739
- unsubscribeAll: () => {
2740
- e.length = 0;
2741
- }
2742
- };
2743
- })(), a = IS_BROWSER_ENV && navigator.hardwareConcurrency || 1, l = e => {
2750
+ })(), r = new Map, s = new Set, n = e => s.add(e), o = e => s.delete(e), i = buildEvents(), a = IS_BROWSER_ENV && navigator.hardwareConcurrency || 1, l = e => {
2744
2751
  if ("/" === e || "" === e) return "/";
2745
2752
  const t = path$2.dirname(e), r = path$2.basename(e);
2746
2753
  return t.endsWith("/") ? normalizePath(`${t}${r}`) : normalizePath(`${t}/${r}`);
@@ -2760,8 +2767,8 @@ const createSystem = e => {
2760
2767
  }, d = (e, t, s) => {
2761
2768
  const n = path$2.dirname(e);
2762
2769
  t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
2763
- const i = r.get(e);
2764
- i ? (i.isDirectory = !0, i.isFile = !1) : (r.set(e, {
2770
+ const o = r.get(e);
2771
+ o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
2765
2772
  basename: path$2.basename(e),
2766
2773
  dirname: n,
2767
2774
  isDirectory: !0,
@@ -2785,10 +2792,10 @@ const createSystem = e => {
2785
2792
  }), m = (e, t, s) => {
2786
2793
  const n = w(e);
2787
2794
  if (!n.error && !s.error) if (n.isFile) {
2788
- const n = path$2.dirname(t), i = u(n, {
2795
+ const n = path$2.dirname(t), o = u(n, {
2789
2796
  recursive: !0
2790
- }), o = r.get(e).data, a = b(t, o);
2791
- s.newDirs.push(...i.newDirs), s.renamed.push({
2797
+ }), i = r.get(e).data, a = b(t, i);
2798
+ s.newDirs.push(...o.newDirs), s.renamed.push({
2792
2799
  oldPath: e,
2793
2800
  newPath: t,
2794
2801
  isDirectory: !1,
@@ -2886,8 +2893,8 @@ const createSystem = e => {
2886
2893
  u("/");
2887
2894
  const S = {
2888
2895
  name: "in-memory",
2889
- version: "2.16.1-0",
2890
- events: o,
2896
+ version: "2.17.1",
2897
+ events: i,
2891
2898
  access: async e => c(e),
2892
2899
  accessSync: c,
2893
2900
  addDestory: n,
@@ -2934,7 +2941,7 @@ const createSystem = e => {
2934
2941
  readFileSync: p,
2935
2942
  realpath: async e => f(e),
2936
2943
  realpathSync: f,
2937
- removeDestory: i,
2944
+ removeDestory: o,
2938
2945
  rename: async (e, t) => {
2939
2946
  const r = {
2940
2947
  oldPath: e = normalizePath(e),
@@ -2971,14 +2978,14 @@ const createSystem = e => {
2971
2978
  removeFileSync: _,
2972
2979
  watchDirectory: (e, t) => {
2973
2980
  e = l(e);
2974
- const s = r.get(e), o = () => {
2981
+ const s = r.get(e), i = () => {
2975
2982
  const s = r.get(e);
2976
2983
  if (s && s.watcherCallbacks) {
2977
2984
  const e = s.watcherCallbacks.indexOf(t);
2978
2985
  e > -1 && s.watcherCallbacks.splice(e, 1);
2979
2986
  }
2980
2987
  };
2981
- return n(o), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
2988
+ return n(i), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
2982
2989
  s.watcherCallbacks.push(t)) : r.set(e, {
2983
2990
  basename: path$2.basename(e),
2984
2991
  dirname: path$2.dirname(e),
@@ -2988,20 +2995,20 @@ const createSystem = e => {
2988
2995
  data: void 0
2989
2996
  }), {
2990
2997
  close() {
2991
- i(o), o();
2998
+ o(i), i();
2992
2999
  }
2993
3000
  };
2994
3001
  },
2995
3002
  watchFile: (e, t) => {
2996
3003
  e = l(e);
2997
- const s = r.get(e), o = () => {
3004
+ const s = r.get(e), i = () => {
2998
3005
  const s = r.get(e);
2999
3006
  if (s && s.watcherCallbacks) {
3000
3007
  const e = s.watcherCallbacks.indexOf(t);
3001
3008
  e > -1 && s.watcherCallbacks.splice(e, 1);
3002
3009
  }
3003
3010
  };
3004
- return n(o), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
3011
+ return n(i), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
3005
3012
  s.watcherCallbacks.push(t)) : r.set(e, {
3006
3013
  basename: path$2.basename(e),
3007
3014
  dirname: path$2.dirname(e),
@@ -3011,7 +3018,7 @@ const createSystem = e => {
3011
3018
  data: void 0
3012
3019
  }), {
3013
3020
  close() {
3014
- i(o), o();
3021
+ o(i), i();
3015
3022
  }
3016
3023
  };
3017
3024
  },
@@ -3024,18 +3031,18 @@ const createSystem = e => {
3024
3031
  return "number" == typeof t && (s = s.slice(0, t)), s;
3025
3032
  },
3026
3033
  createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
3027
- let r, s = 0, n = !1, i = !1, o = 0;
3034
+ let r, s = 0, n = !1, o = !1, i = 0;
3028
3035
  const a = new Map, l = [], c = [], u = Math.max(Math.min(t, e.hardwareConcurrency), 2) - 1, d = Promise.resolve(), h = e => console.error(e), p = () => {
3029
3036
  let t = null;
3030
- const s = e.getCompilerExecutingPath(), i = {
3031
- name: "stencil.worker." + o++
3037
+ const s = e.getCompilerExecutingPath(), o = {
3038
+ name: "stencil.worker." + i++
3032
3039
  };
3033
3040
  try {
3034
- t = new Worker(s, i);
3041
+ t = new Worker(s, o);
3035
3042
  } catch (e) {
3036
3043
  null == r && (r = new Blob([ `importScripts('${s}');` ], {
3037
3044
  type: "application/javascript"
3038
- })), t = new Worker(URL.createObjectURL(r), i);
3045
+ })), t = new Worker(URL.createObjectURL(r), o);
3039
3046
  }
3040
3047
  const l = {
3041
3048
  worker: t,
@@ -3064,7 +3071,7 @@ const createSystem = e => {
3064
3071
  } else t = p(), c.push(t);
3065
3072
  t.activeTasks++, t.sendQueue.push(e);
3066
3073
  }, g = () => {
3067
- i = !1, l.forEach(m), l.length = 0, c.forEach(f);
3074
+ o = !1, l.forEach(m), l.length = 0, c.forEach(f);
3068
3075
  }, y = (...e) => new Promise(((t, r) => {
3069
3076
  if (n) r("task canceled"); else {
3070
3077
  const n = {
@@ -3074,7 +3081,7 @@ const createSystem = e => {
3074
3081
  l.push(n), a.set(n.stencilId, {
3075
3082
  resolve: t,
3076
3083
  reject: r
3077
- }), i || (i = !0, d.then(g));
3084
+ }), o || (o = !0, d.then(g));
3078
3085
  }
3079
3086
  }));
3080
3087
  return {
@@ -3105,11 +3112,11 @@ const createSystem = e => {
3105
3112
  return S.resolveModuleId = e => ((e, t, r) => {
3106
3113
  const s = ((e, t, r) => ({
3107
3114
  async isFile(s, n) {
3108
- const i = normalizeFsPath(s);
3109
- if ((await t.stat(i)).isFile) n(null, !0); else {
3110
- if (shouldFetchModule(i) && r.some((e => i.endsWith(e)))) {
3111
- const r = getNodeModuleFetchUrl(e, packageVersions, i);
3112
- return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, i));
3115
+ const o = normalizeFsPath(s);
3116
+ if ((await t.stat(o)).isFile) n(null, !0); else {
3117
+ if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
3118
+ const r = getNodeModuleFetchUrl(e, packageVersions, o);
3119
+ return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
3113
3120
  }
3114
3121
  n(null, !1);
3115
3122
  }
@@ -3122,7 +3129,7 @@ const createSystem = e => {
3122
3129
  void s(null, !0);
3123
3130
  if (isCommonDirModuleFile(n)) return void s(null, !1);
3124
3131
  for (const r of COMMON_DIR_FILENAMES) {
3125
- const i = getCommonDirUrl(e, packageVersions, n, r), o = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, i, o);
3132
+ const o = getCommonDirUrl(e, packageVersions, n, r), i = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, o, i);
3126
3133
  if (isString(a)) return void s(null, !0);
3127
3134
  }
3128
3135
  }
@@ -3141,13 +3148,13 @@ const createSystem = e => {
3141
3148
  }))(e, null, r.exts);
3142
3149
  return s.basedir = path$2.dirname(normalizeFsPath(r.containingFile)), r.packageFilter ? s.packageFilter = r.packageFilter : null !== r.packageFilter && (s.packageFilter = e => (isString(e.main) && "" !== e.main || (e.main = "package.json"),
3143
3150
  e)), new Promise(((e, t) => {
3144
- resolve(r.moduleId, s, ((s, n, i) => {
3151
+ resolve(r.moduleId, s, ((s, n, o) => {
3145
3152
  if (s) t(s); else {
3146
3153
  n = normalizePath(n);
3147
3154
  const t = {
3148
3155
  moduleId: r.moduleId,
3149
3156
  resolveId: n,
3150
- pkgData: i,
3157
+ pkgData: o,
3151
3158
  pkgDirPath: getPackageDirPath(n, r.moduleId)
3152
3159
  };
3153
3160
  e(t);
@@ -3174,7 +3181,8 @@ const createSystem = e => {
3174
3181
  r.readDirSync = s(r.readDirSync), r.stat = s(r.stat), r.statSync = s(r.statSync),
3175
3182
  r.copyFile = n(r.copyFile), r.createDir = n(r.createDir), r.createDirSync = n(r.createDirSync),
3176
3183
  r.removeFile = n(r.removeFile), r.removeFileSync = n(r.removeFileSync), r.writeFile = n(r.writeFile),
3177
- r.writeFileSync = n(r.writeFileSync), Object.defineProperties(r, {
3184
+ r.writeFileSync = n(r.writeFileSync), r.getCompilerExecutingPath = () => "bin/stencil.js",
3185
+ Object.defineProperties(r, {
3178
3186
  diskReads: {
3179
3187
  get: () => e,
3180
3188
  set(t) {
@@ -3187,7 +3195,7 @@ const createSystem = e => {
3187
3195
  t = e;
3188
3196
  }
3189
3197
  }
3190
- }), !function i(e) {
3198
+ }), !function o(e) {
3191
3199
  return "diskReads" in e && "diskWrites" in e;
3192
3200
  }(r)) throw new Error("could not generate TestingSystem");
3193
3201
  return r;
@@ -3359,8 +3367,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
3359
3367
  waitForVisible() {
3360
3368
  return new Promise(((e, t) => {
3361
3369
  const r = setInterval((async () => {
3362
- await this.isVisible() && (clearInterval(r), clearTimeout(i), e());
3363
- }), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), i = setTimeout((() => {
3370
+ await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
3371
+ }), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout((() => {
3364
3372
  clearTimeout(r), t(n);
3365
3373
  }), s);
3366
3374
  }));
@@ -3368,8 +3376,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
3368
3376
  waitForNotVisible() {
3369
3377
  return new Promise(((e, t) => {
3370
3378
  const r = setInterval((async () => {
3371
- await this.isVisible() || (clearInterval(r), clearTimeout(i), e());
3372
- }), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), i = setTimeout((() => {
3379
+ await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
3380
+ }), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout((() => {
3373
3381
  clearTimeout(r), t(n);
3374
3382
  }), s);
3375
3383
  }));
@@ -3628,34 +3636,34 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3628
3636
  var e;
3629
3637
  const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
3630
3638
  return class r extends t {
3631
- async runTests(e, t, r, s, n, i) {
3632
- const o = process.env;
3639
+ async runTests(e, t, r, s, n, o) {
3640
+ const i = process.env;
3633
3641
  if (e = e.filter((e => function t(e, r) {
3634
3642
  const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
3635
3643
  return !("true" !== r.__STENCIL_E2E_TESTS__ || !s) || "true" === r.__STENCIL_SPEC_TESTS__ && !s;
3636
- }(e.path, o))), "true" === o.__STENCIL_SCREENSHOT__) {
3637
- const a = JSON.parse(o.__STENCIL_EMULATE_CONFIGS__);
3638
- for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], o), await super.runTests(e, t, r, s, n, i);
3639
- } else await super.runTests(e, t, r, s, n, i);
3644
+ }(e.path, i))), "true" === i.__STENCIL_SCREENSHOT__) {
3645
+ const a = JSON.parse(i.__STENCIL_EMULATE_CONFIGS__);
3646
+ for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, s, n, o);
3647
+ } else await super.runTests(e, t, r, s, n, o);
3640
3648
  }
3641
3649
  };
3642
3650
  }, exports.createTesting = async e => {
3643
3651
  e = function t(e) {
3644
3652
  return e.buildEs5 = !1, e.devMode = !0, e.minifyCss = !1, e.minifyJs = !1, e.hashFileNames = !1,
3645
- e.validateTypes = !1, e._isTesting = !0, e.buildDist = !0, e.flags = e.flags || {},
3646
- e.flags.serve = !1, e.flags.open = !1, e.outputTargets.forEach((e => {
3653
+ e.validateTypes = !1, e._isTesting = !0, e.buildDist = !0, e.flags.serve = !1, e.flags.open = !1,
3654
+ e.outputTargets.forEach((e => {
3647
3655
  "www" === e.type && (e.serviceWorker = null);
3648
3656
  })), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
3649
3657
  }(e);
3650
3658
  const {createCompiler: r} = require("../compiler/stencil.js"), s = await r(e);
3651
- let n, i;
3652
- const o = async () => {
3659
+ let n, o;
3660
+ const i = async () => {
3653
3661
  const t = [];
3654
3662
  e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
3655
- n = null), i && (i.close && t.push(i.close()), i = null), await Promise.all(t);
3663
+ n = null), o && (o.close && t.push(o.close()), o = null), await Promise.all(t);
3656
3664
  };
3657
3665
  return {
3658
- destroy: o,
3666
+ destroy: i,
3659
3667
  run: async (t = {}) => {
3660
3668
  let r, a = !1, l = !1, c = null;
3661
3669
  const u = [];
@@ -3678,9 +3686,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3678
3686
  })), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
3679
3687
  e.devServer.reloadStrategy = null;
3680
3688
  const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
3681
- if (n = l[0], i = l[1], t) {
3689
+ if (n = l[0], o = l[1], t) {
3682
3690
  const r = await t;
3683
- if (!r || !e.watch && hasError(r && r.diagnostics)) return await o(), !1;
3691
+ if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
3684
3692
  }
3685
3693
  n && (r.__STENCIL_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__STENCIL_BROWSER_URL__}`),
3686
3694
  r.__STENCIL_APP_SCRIPT_URL__ = function d(e, t) {
@@ -3714,13 +3722,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3714
3722
  waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
3715
3723
  pixelmatchModulePath: s
3716
3724
  }), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
3717
- const i = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), o = i[0], a = i[1];
3718
- t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(o, a);
3725
+ const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
3726
+ t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(i, a);
3719
3727
  const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
3720
3728
  l.finish(`screenshot, tests finished, passed: ${c}`);
3721
3729
  try {
3722
3730
  const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
3723
- let s = await r.completeBuild(o);
3731
+ let s = await r.completeBuild(i);
3724
3732
  if (t.finish("screenshot, completeTimespan finished"), s) {
3725
3733
  const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
3726
3734
  if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
@@ -3777,12 +3785,57 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3777
3785
  }
3778
3786
  }, exports.mockBuildCtx = function mockBuildCtx(e, t) {
3779
3787
  return e || (e = mockConfig()), t || (t = mockCompilerCtx(e)), new BuildContext(e, t);
3780
- }, exports.mockCompilerCtx = mockCompilerCtx, exports.mockConfig = mockConfig, exports.mockDocument = function mockDocument(e = null) {
3781
- return new index_cjs.MockWindow(e).document;
3782
- }, exports.mockFetch = mockFetch, exports.mockLogger = function mockLogger() {
3783
- return new TestingLogger;
3784
- }, exports.mockStencilSystem = function mockStencilSystem() {
3788
+ }, exports.mockCompilerCtx = mockCompilerCtx, exports.mockCompilerSystem = function mockCompilerSystem() {
3785
3789
  return createTestingSystem();
3790
+ }, exports.mockConfig = mockConfig, exports.mockDocument = function mockDocument(e = null) {
3791
+ return new index_cjs.MockWindow(e).document;
3792
+ }, exports.mockFetch = mockFetch, exports.mockLoadConfigInit = e => ({
3793
+ config: {},
3794
+ configPath: void 0,
3795
+ initTsConfig: !0,
3796
+ logger: void 0,
3797
+ sys: void 0,
3798
+ ...e
3799
+ }), exports.mockLogger = mockLogger, exports.mockModule = (e = {}) => ({
3800
+ cmps: [],
3801
+ coreRuntimeApis: [],
3802
+ collectionName: "",
3803
+ dtsFilePath: "",
3804
+ excludeFromCollection: !1,
3805
+ externalImports: [],
3806
+ htmlAttrNames: [],
3807
+ htmlTagNames: [],
3808
+ htmlParts: [],
3809
+ isCollectionDependency: !1,
3810
+ isLegacy: !1,
3811
+ jsFilePath: "",
3812
+ localImports: [],
3813
+ originalImports: [],
3814
+ originalCollectionComponentPath: "",
3815
+ potentialCmpRefs: [],
3816
+ sourceFilePath: "",
3817
+ staticSourceFile: "",
3818
+ staticSourceFileText: "",
3819
+ sourceMapPath: "",
3820
+ sourceMapFileText: "",
3821
+ hasVdomAttribute: !1,
3822
+ hasVdomClass: !1,
3823
+ hasVdomFunctional: !1,
3824
+ hasVdomKey: !1,
3825
+ hasVdomListener: !1,
3826
+ hasVdomPropOrAttr: !1,
3827
+ hasVdomRef: !1,
3828
+ hasVdomRender: !1,
3829
+ hasVdomStyle: !1,
3830
+ hasVdomText: !1,
3831
+ hasVdomXlink: !1,
3832
+ ...e
3833
+ }), exports.mockValidatedConfig = function mockValidatedConfig(e) {
3834
+ return {
3835
+ ...mockConfig(e),
3836
+ flags: {},
3837
+ logger: mockLogger()
3838
+ };
3786
3839
  }, exports.mockWindow = function mockWindow(e = null) {
3787
3840
  return new index_cjs.MockWindow(e);
3788
3841
  }, exports.newE2EPage = async function newE2EPage(e = {}) {
@@ -3802,19 +3855,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3802
3855
  const t = process.env;
3803
3856
  "true" === t.__STENCIL_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
3804
3857
  const n = global;
3805
- let i, o = "", a = "";
3806
- if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (o = n.currentSpec.fullName),
3807
- "string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (o.length > 0 ? o += ", " + r : o = r,
3808
- "object" == typeof s && (i = s)) : "object" == typeof r && (i = r), o = o.trim(),
3809
- i = i || {}, !o) throw new Error(`Invalid screenshot description in "${a}"`);
3810
- if (n.screenshotDescriptions.has(o)) throw new Error(`Screenshot description "${o}" found in "${a}" cannot be used for multiple screenshots and must be unique. To make screenshot descriptions unique within the same test, use the first argument to "compareScreenshot", such as "compareScreenshot('more to the description')".`);
3811
- return n.screenshotDescriptions.add(o), async function l(e, t, r, s, n) {
3858
+ let o, i = "", a = "";
3859
+ if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (i = n.currentSpec.fullName),
3860
+ "string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (i.length > 0 ? i += ", " + r : i = r,
3861
+ "object" == typeof s && (o = s)) : "object" == typeof r && (o = r), i = i.trim(),
3862
+ o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
3863
+ if (n.screenshotDescriptions.has(i)) throw new Error(`Screenshot description "${i}" found in "${a}" cannot be used for multiple screenshots and must be unique. To make screenshot descriptions unique within the same test, use the first argument to "compareScreenshot", such as "compareScreenshot('more to the description')".`);
3864
+ return n.screenshotDescriptions.add(i), async function l(e, t, r, s, n) {
3812
3865
  if ("string" != typeof t.__STENCIL_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
3813
3866
  if ("string" != typeof t.__STENCIL_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
3814
- const i = JSON.parse(t.__STENCIL_EMULATE__), o = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
3867
+ const o = JSON.parse(t.__STENCIL_EMULATE__), i = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
3815
3868
  await function a(e) {
3816
3869
  return new Promise((t => setTimeout(t, e)));
3817
- }(o.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
3870
+ }(i.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
3818
3871
  window.requestAnimationFrame((() => {
3819
3872
  e();
3820
3873
  }));
@@ -3832,11 +3885,11 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3832
3885
  width: e.clip.width,
3833
3886
  height: e.clip.height
3834
3887
  }), t;
3835
- }(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : o.pixelmatchThreshold;
3836
- let h = i.viewport.width, p = i.viewport.height;
3888
+ }(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : i.pixelmatchThreshold;
3889
+ let h = o.viewport.width, p = o.viewport.height;
3837
3890
  return n && n.clip && ("number" == typeof n.clip.width && (h = n.clip.width), "number" == typeof n.clip.height && (p = n.clip.height)),
3838
- await compareScreenshot(i, o, u, r, h, p, s, d);
3839
- }(e, t, o, a, i);
3891
+ await compareScreenshot(o, i, u, r, h, p, s, d);
3892
+ }(e, t, i, a, o);
3840
3893
  } : e.compareScreenshot = async () => ({
3841
3894
  mismatchedPixels: 0,
3842
3895
  allowableMismatchedPixels: 1,
@@ -3884,28 +3937,30 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3884
3937
  e();
3885
3938
  }))));
3886
3939
  };
3887
- const i = !0 === e.failOnConsoleError, o = !0 === e.failOnNetworkError;
3940
+ const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
3888
3941
  t.on("console", (e => {
3889
- "error" === e.type() && (r.push({
3942
+ if ("error" === e.type() && (r.push({
3890
3943
  type: "error",
3891
3944
  message: e.text(),
3892
3945
  location: e.location().url
3893
- }), i && fail(new Error(serializeConsoleMessage(e)))), function t(e) {
3946
+ }), o)) throw new Error(serializeConsoleMessage(e));
3947
+ !function t(e) {
3894
3948
  const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
3895
3949
  "debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
3896
3950
  }(e);
3897
3951
  })), t.on("pageerror", (e => {
3898
- r.push({
3952
+ throw r.push({
3899
3953
  type: "pageerror",
3900
3954
  message: e.message,
3901
3955
  location: e.stack
3902
- }), fail(e);
3956
+ }), e;
3903
3957
  })), t.on("requestfailed", (e => {
3904
- r.push({
3958
+ if (r.push({
3905
3959
  type: "requestfailed",
3906
3960
  message: e.failure().errorText,
3907
3961
  location: e.url()
3908
- }), o ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
3962
+ }), i) throw new Error(e.failure().errorText);
3963
+ console.error("requestfailed", e.url());
3909
3964
  })), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
3910
3965
  waitUntil: e.waitUntil
3911
3966
  }) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
@@ -3971,7 +4026,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3971
4026
  const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
3972
4027
  return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
3973
4028
  })(e, !0))) ])(s, [ e.COMPILER_META ]);
3974
- })), i = (e => {
4029
+ })), o = (e => {
3975
4030
  const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)), s = e.some((e => "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot"))), n = {
3976
4031
  allRenderFn: e.every((e => e.hasRenderFn)),
3977
4032
  cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
@@ -4031,8 +4086,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
4031
4086
  return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
4032
4087
  n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
4033
4088
  })(e.components.map((e => e.COMPILER_META)));
4034
- if (e.strictBuild ? Object.assign(appData.BUILD, i) : Object.keys(i).forEach((e => {
4035
- !0 === i[e] && (appData.BUILD[e] = !0);
4089
+ if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
4090
+ !0 === o[e] && (appData.BUILD[e] = !0);
4036
4091
  })), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
4037
4092
  appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
4038
4093
  appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
@@ -4062,10 +4117,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
4062
4117
  testing.renderVdom(t, e.template());
4063
4118
  } else "string" == typeof e.html && (s.body.innerHTML = e.html);
4064
4119
  !1 !== e.flushQueue && await s.waitForChanges();
4065
- let o = null;
4120
+ let i = null;
4066
4121
  return Object.defineProperty(s, "root", {
4067
4122
  get() {
4068
- if (null == o && (o = findRootComponent(t, s.body)), null != o) return o;
4123
+ if (null == i && (i = findRootComponent(t, s.body)), null != i) return i;
4069
4124
  const e = s.body.firstElementChild;
4070
4125
  return null != e ? e : null;
4071
4126
  }