@stencil/core 4.40.1-dev.1766639216.64f6089 → 4.40.1-dev.1766985084.e893bd1

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.
@@ -340,422 +340,142 @@ var moduleLoaded = /* @__PURE__ */ new Map();
340
340
  var queuedLoadModules = [];
341
341
  var caughtErrors = [];
342
342
 
343
- // src/testing/platform/testing-host-ref.ts
344
- var getHostRef = (elm) => {
345
- if (elm.__stencil__getHostRef) {
346
- return elm.__stencil__getHostRef();
347
- }
348
- return void 0;
343
+ // src/runtime/event-emitter.ts
344
+ var import_app_data3 = require("@stencil/core/internal/app-data");
345
+
346
+ // src/utils/constants.ts
347
+ var SVG_NS = "http://www.w3.org/2000/svg";
348
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
349
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
350
+ PrimitiveType2["Undefined"] = "undefined";
351
+ PrimitiveType2["Null"] = "null";
352
+ PrimitiveType2["String"] = "string";
353
+ PrimitiveType2["Number"] = "number";
354
+ PrimitiveType2["SpecialNumber"] = "number";
355
+ PrimitiveType2["Boolean"] = "boolean";
356
+ PrimitiveType2["BigInt"] = "bigint";
357
+ return PrimitiveType2;
358
+ })(PrimitiveType || {});
359
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
360
+ NonPrimitiveType2["Array"] = "array";
361
+ NonPrimitiveType2["Date"] = "date";
362
+ NonPrimitiveType2["Map"] = "map";
363
+ NonPrimitiveType2["Object"] = "object";
364
+ NonPrimitiveType2["RegularExpression"] = "regexp";
365
+ NonPrimitiveType2["Set"] = "set";
366
+ NonPrimitiveType2["Channel"] = "channel";
367
+ NonPrimitiveType2["Symbol"] = "symbol";
368
+ return NonPrimitiveType2;
369
+ })(NonPrimitiveType || {});
370
+ var TYPE_CONSTANT = "type";
371
+ var VALUE_CONSTANT = "value";
372
+ var SERIALIZED_PREFIX = "serialized:";
373
+
374
+ // src/utils/helpers.ts
375
+ var isDef = (v) => v != null && v !== void 0;
376
+ var isComplexType = (o) => {
377
+ o = typeof o;
378
+ return o === "object" || o === "function";
349
379
  };
350
- var registerInstance = (lazyInstance, hostRef) => {
351
- if (lazyInstance == null || lazyInstance.constructor == null) {
352
- throw new Error(`Invalid component constructor`);
380
+
381
+ // node_modules/minimatch/dist/esm/index.js
382
+ var import_brace_expansion = __toESM(require_brace_expansion(), 1);
383
+
384
+ // node_modules/minimatch/dist/esm/assert-valid-pattern.js
385
+ var MAX_PATTERN_LENGTH = 1024 * 64;
386
+ var assertValidPattern = (pattern) => {
387
+ if (typeof pattern !== "string") {
388
+ throw new TypeError("invalid pattern");
353
389
  }
354
- if (hostRef == null) {
355
- const Cstr = lazyInstance.constructor;
356
- const tagName = Cstr.COMPILER_META && Cstr.COMPILER_META.tagName ? Cstr.COMPILER_META.tagName : "div";
357
- const elm = document.createElement(tagName);
358
- registerHost(elm, { $flags$: 0, $tagName$: tagName });
359
- hostRef = getHostRef(elm);
390
+ if (pattern.length > MAX_PATTERN_LENGTH) {
391
+ throw new TypeError("pattern is too long");
360
392
  }
361
- lazyInstance.__stencil__getHostRef = () => hostRef;
362
- hostRef.$lazyInstance$ = lazyInstance;
363
- };
364
- var registerHost = (elm, cmpMeta) => {
365
- const hostRef = {
366
- $flags$: 0,
367
- $hostElement$: elm,
368
- $cmpMeta$: cmpMeta,
369
- $instanceValues$: /* @__PURE__ */ new Map(),
370
- $serializerValues$: /* @__PURE__ */ new Map(),
371
- $renderCount$: 0
372
- };
373
- hostRef.$fetchedCbList$ = [];
374
- hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
375
- hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
376
- elm["s-p"] = [];
377
- elm["s-rc"] = [];
378
- elm.__stencil__getHostRef = () => hostRef;
379
- };
380
-
381
- // src/testing/platform/testing-log.ts
382
- var customError;
383
- var defaultConsoleError = (e) => {
384
- caughtErrors.push(e);
385
- };
386
- var consoleError = (e, el) => (customError || defaultConsoleError)(e, el);
387
- var consoleDevError = (...e) => {
388
- caughtErrors.push(new Error(e.join(", ")));
389
393
  };
390
- var consoleDevWarn = (...args) => {
391
- const params = args.filter((a) => typeof a === "string" || typeof a === "number" || typeof a === "boolean");
392
- console.warn(...params);
393
- };
394
- var consoleDevInfo = (..._) => {
395
- };
396
- var setErrorHandler = (handler) => customError = handler;
397
394
 
398
- // src/testing/platform/testing-task-queue.ts
399
- function resetTaskQueue() {
400
- queuedTicks.length = 0;
401
- queuedWriteTasks.length = 0;
402
- queuedReadTasks.length = 0;
403
- moduleLoaded.clear();
404
- queuedLoadModules.length = 0;
405
- caughtErrors.length = 0;
406
- }
407
- var nextTick = (cb) => {
408
- queuedTicks.push(cb);
395
+ // node_modules/minimatch/dist/esm/brace-expressions.js
396
+ var posixClasses = {
397
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
398
+ "[:alpha:]": ["\\p{L}\\p{Nl}", true],
399
+ "[:ascii:]": ["\\x00-\\x7f", false],
400
+ "[:blank:]": ["\\p{Zs}\\t", true],
401
+ "[:cntrl:]": ["\\p{Cc}", true],
402
+ "[:digit:]": ["\\p{Nd}", true],
403
+ "[:graph:]": ["\\p{Z}\\p{C}", true, true],
404
+ "[:lower:]": ["\\p{Ll}", true],
405
+ "[:print:]": ["\\p{C}", true],
406
+ "[:punct:]": ["\\p{P}", true],
407
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
408
+ "[:upper:]": ["\\p{Lu}", true],
409
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
410
+ "[:xdigit:]": ["A-Fa-f0-9", false]
409
411
  };
410
- function flushTicks() {
411
- return new Promise((resolve, reject) => {
412
- function drain() {
413
- try {
414
- if (queuedTicks.length > 0) {
415
- const writeTasks = queuedTicks.slice();
416
- queuedTicks.length = 0;
417
- let cb;
418
- while (cb = writeTasks.shift()) {
419
- cb(Date.now());
420
- }
421
- }
422
- if (queuedTicks.length > 0) {
423
- process.nextTick(drain);
424
- } else {
425
- resolve();
426
- }
427
- } catch (e) {
428
- reject(`flushTicks: ${e}`);
412
+ var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
413
+ var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
414
+ var rangesToString = (ranges) => ranges.join("");
415
+ var parseClass = (glob, position) => {
416
+ const pos = position;
417
+ if (glob.charAt(pos) !== "[") {
418
+ throw new Error("not in a brace expression");
419
+ }
420
+ const ranges = [];
421
+ const negs = [];
422
+ let i2 = pos + 1;
423
+ let sawStart = false;
424
+ let uflag = false;
425
+ let escaping = false;
426
+ let negate = false;
427
+ let endPos = pos;
428
+ let rangeStart = "";
429
+ WHILE: while (i2 < glob.length) {
430
+ const c = glob.charAt(i2);
431
+ if ((c === "!" || c === "^") && i2 === pos + 1) {
432
+ negate = true;
433
+ i2++;
434
+ continue;
435
+ }
436
+ if (c === "]" && sawStart && !escaping) {
437
+ endPos = i2 + 1;
438
+ break;
439
+ }
440
+ sawStart = true;
441
+ if (c === "\\") {
442
+ if (!escaping) {
443
+ escaping = true;
444
+ i2++;
445
+ continue;
429
446
  }
430
447
  }
431
- process.nextTick(drain);
432
- });
433
- }
434
- function writeTask(cb) {
435
- queuedWriteTasks.push(cb);
436
- }
437
- function readTask(cb) {
438
- queuedReadTasks.push(cb);
439
- }
440
- function flushQueue() {
441
- return new Promise((resolve, reject) => {
442
- async function drain() {
443
- try {
444
- if (queuedReadTasks.length > 0) {
445
- const readTasks = queuedReadTasks.slice();
446
- queuedReadTasks.length = 0;
447
- let cb;
448
- while (cb = readTasks.shift()) {
449
- const result = cb(Date.now());
450
- if (result != null && typeof result.then === "function") {
451
- await result;
452
- }
453
- }
454
- }
455
- if (queuedWriteTasks.length > 0) {
456
- const writeTasks = queuedWriteTasks.slice();
457
- queuedWriteTasks.length = 0;
458
- let cb;
459
- while (cb = writeTasks.shift()) {
460
- const result = cb(Date.now());
461
- if (result != null && typeof result.then === "function") {
462
- await result;
463
- }
448
+ if (c === "[" && !escaping) {
449
+ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
450
+ if (glob.startsWith(cls, i2)) {
451
+ if (rangeStart) {
452
+ return ["$.", false, glob.length - pos, true];
464
453
  }
454
+ i2 += cls.length;
455
+ if (neg)
456
+ negs.push(unip);
457
+ else
458
+ ranges.push(unip);
459
+ uflag = uflag || u;
460
+ continue WHILE;
465
461
  }
466
- if (queuedReadTasks.length + queuedWriteTasks.length > 0) {
467
- process.nextTick(drain);
468
- } else {
469
- resolve();
470
- }
471
- } catch (e) {
472
- reject(`flushQueue: ${e}`);
473
462
  }
474
463
  }
475
- process.nextTick(drain);
476
- });
477
- }
478
- async function flushAll() {
479
- while (queuedTicks.length + queuedLoadModules.length + queuedWriteTasks.length + queuedReadTasks.length > 0) {
480
- await flushTicks();
481
- await flushLoadModule();
482
- await flushQueue();
483
- }
484
- if (caughtErrors.length > 0) {
485
- const err2 = caughtErrors[0];
486
- if (err2 == null) {
487
- throw new Error("Error!");
464
+ escaping = false;
465
+ if (rangeStart) {
466
+ if (c > rangeStart) {
467
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
468
+ } else if (c === rangeStart) {
469
+ ranges.push(braceEscape(c));
470
+ }
471
+ rangeStart = "";
472
+ i2++;
473
+ continue;
488
474
  }
489
- if (typeof err2 === "string") {
490
- throw new Error(err2);
491
- }
492
- throw err2;
493
- }
494
- return new Promise((resolve) => process.nextTick(resolve));
495
- }
496
- function loadModule(cmpMeta, _hostRef, _hmrVersionId) {
497
- return new Promise((resolve) => {
498
- queuedLoadModules.push({
499
- bundleId: cmpMeta.$lazyBundleId$,
500
- resolve: () => resolve(moduleLoaded.get(cmpMeta.$lazyBundleId$))
501
- });
502
- });
503
- }
504
- function flushLoadModule(bundleId) {
505
- return new Promise((resolve, reject) => {
506
- try {
507
- process.nextTick(() => {
508
- if (bundleId != null) {
509
- for (let i2 = 0; i2 < queuedLoadModules.length; i2++) {
510
- if (queuedLoadModules[i2].bundleId === bundleId) {
511
- queuedLoadModules[i2].resolve();
512
- queuedLoadModules.splice(i2, 1);
513
- i2--;
514
- }
515
- }
516
- } else {
517
- let queuedLoadModule;
518
- while (queuedLoadModule = queuedLoadModules.shift()) {
519
- queuedLoadModule.resolve();
520
- }
521
- }
522
- resolve();
523
- });
524
- } catch (e) {
525
- reject(`flushLoadModule: ${e}`);
526
- }
527
- });
528
- }
529
-
530
- // src/testing/platform/testing-window.ts
531
- var import_mock_doc = require("../../mock-doc/index.cjs");
532
- var win = (0, import_mock_doc.setupGlobal)(global);
533
-
534
- // src/testing/platform/testing-platform.ts
535
- var supportsShadow = true;
536
- var plt = {
537
- $flags$: 0,
538
- $resourcesUrl$: "",
539
- jmp: (h2) => h2(),
540
- raf: (h2) => requestAnimationFrame(h2),
541
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
542
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
543
- ce: (eventName, opts) => new win.CustomEvent(eventName, opts)
544
- };
545
- var setPlatformHelpers = (helpers) => {
546
- Object.assign(plt, helpers);
547
- };
548
- var supportsListenerOptions = true;
549
- var supportsConstructableStylesheets = false;
550
- var supportsMutableAdoptedStyleSheets = false;
551
- var setSupportsShadowDom = (supports) => {
552
- supportsShadow = supports;
553
- };
554
- function resetPlatform(defaults2 = {}) {
555
- if (win && typeof win.close === "function") {
556
- win.close();
557
- }
558
- styles.clear();
559
- plt.$flags$ = 0;
560
- Object.assign(plt, defaults2);
561
- if (plt.$orgLocNodes$ != null) {
562
- plt.$orgLocNodes$.clear();
563
- plt.$orgLocNodes$ = void 0;
564
- }
565
- win.location.href = plt.$resourcesUrl$ = `http://testing.stenciljs.com/`;
566
- resetTaskQueue();
567
- stopAutoApplyChanges();
568
- cstrs.clear();
569
- }
570
- var isAutoApplyingChanges = false;
571
- var autoApplyTimer = void 0;
572
- function stopAutoApplyChanges() {
573
- isAutoApplyingChanges = false;
574
- if (autoApplyTimer) {
575
- clearTimeout(autoApplyTimer);
576
- autoApplyTimer = void 0;
577
- }
578
- }
579
- async function startAutoApplyChanges() {
580
- isAutoApplyingChanges = true;
581
- flushAll().then(() => {
582
- if (isAutoApplyingChanges) {
583
- autoApplyTimer = setTimeout(() => {
584
- startAutoApplyChanges();
585
- }, 100);
586
- }
587
- });
588
- }
589
- var registerComponents = (Cstrs) => {
590
- Cstrs.filter((Cstr) => Cstr.COMPILER_META).forEach((Cstr) => {
591
- cstrs.set(Cstr.COMPILER_META.tagName, Cstr);
592
- });
593
- };
594
- function registerModule(bundleId, Cstr) {
595
- moduleLoaded.set(bundleId, Cstr);
596
- }
597
- var isMemberInElement = (elm, memberName) => {
598
- if (elm != null) {
599
- if (memberName in elm) {
600
- return true;
601
- }
602
- const nodeName = elm.nodeName;
603
- if (nodeName) {
604
- const cstr = cstrs.get(nodeName.toLowerCase());
605
- if (cstr != null && cstr.COMPILER_META != null && cstr.COMPILER_META.properties != null) {
606
- return cstr.COMPILER_META.properties.some((p) => p.name === memberName);
607
- }
608
- }
609
- }
610
- return false;
611
- };
612
-
613
- // src/testing/platform/index.ts
614
- var import_app_data24 = require("@stencil/core/internal/app-data");
615
-
616
- // src/runtime/asset-path.ts
617
- var getAssetPath = (path2) => {
618
- const assetUrl = new URL(path2, plt.$resourcesUrl$);
619
- return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
620
- };
621
- var setAssetPath = (path2) => plt.$resourcesUrl$ = path2;
622
-
623
- // src/runtime/bootstrap-custom-element.ts
624
- var import_app_data20 = require("@stencil/core/internal/app-data");
625
-
626
- // src/utils/constants.ts
627
- var SVG_NS = "http://www.w3.org/2000/svg";
628
- var HTML_NS = "http://www.w3.org/1999/xhtml";
629
- var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
630
- PrimitiveType2["Undefined"] = "undefined";
631
- PrimitiveType2["Null"] = "null";
632
- PrimitiveType2["String"] = "string";
633
- PrimitiveType2["Number"] = "number";
634
- PrimitiveType2["SpecialNumber"] = "number";
635
- PrimitiveType2["Boolean"] = "boolean";
636
- PrimitiveType2["BigInt"] = "bigint";
637
- return PrimitiveType2;
638
- })(PrimitiveType || {});
639
- var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
640
- NonPrimitiveType2["Array"] = "array";
641
- NonPrimitiveType2["Date"] = "date";
642
- NonPrimitiveType2["Map"] = "map";
643
- NonPrimitiveType2["Object"] = "object";
644
- NonPrimitiveType2["RegularExpression"] = "regexp";
645
- NonPrimitiveType2["Set"] = "set";
646
- NonPrimitiveType2["Channel"] = "channel";
647
- NonPrimitiveType2["Symbol"] = "symbol";
648
- return NonPrimitiveType2;
649
- })(NonPrimitiveType || {});
650
- var TYPE_CONSTANT = "type";
651
- var VALUE_CONSTANT = "value";
652
- var SERIALIZED_PREFIX = "serialized:";
653
-
654
- // src/utils/helpers.ts
655
- var isDef = (v) => v != null && v !== void 0;
656
- var isComplexType = (o) => {
657
- o = typeof o;
658
- return o === "object" || o === "function";
659
- };
660
-
661
- // node_modules/minimatch/dist/esm/index.js
662
- var import_brace_expansion = __toESM(require_brace_expansion(), 1);
663
-
664
- // node_modules/minimatch/dist/esm/assert-valid-pattern.js
665
- var MAX_PATTERN_LENGTH = 1024 * 64;
666
- var assertValidPattern = (pattern) => {
667
- if (typeof pattern !== "string") {
668
- throw new TypeError("invalid pattern");
669
- }
670
- if (pattern.length > MAX_PATTERN_LENGTH) {
671
- throw new TypeError("pattern is too long");
672
- }
673
- };
674
-
675
- // node_modules/minimatch/dist/esm/brace-expressions.js
676
- var posixClasses = {
677
- "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
678
- "[:alpha:]": ["\\p{L}\\p{Nl}", true],
679
- "[:ascii:]": ["\\x00-\\x7f", false],
680
- "[:blank:]": ["\\p{Zs}\\t", true],
681
- "[:cntrl:]": ["\\p{Cc}", true],
682
- "[:digit:]": ["\\p{Nd}", true],
683
- "[:graph:]": ["\\p{Z}\\p{C}", true, true],
684
- "[:lower:]": ["\\p{Ll}", true],
685
- "[:print:]": ["\\p{C}", true],
686
- "[:punct:]": ["\\p{P}", true],
687
- "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
688
- "[:upper:]": ["\\p{Lu}", true],
689
- "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
690
- "[:xdigit:]": ["A-Fa-f0-9", false]
691
- };
692
- var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
693
- var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
694
- var rangesToString = (ranges) => ranges.join("");
695
- var parseClass = (glob, position) => {
696
- const pos = position;
697
- if (glob.charAt(pos) !== "[") {
698
- throw new Error("not in a brace expression");
699
- }
700
- const ranges = [];
701
- const negs = [];
702
- let i2 = pos + 1;
703
- let sawStart = false;
704
- let uflag = false;
705
- let escaping = false;
706
- let negate = false;
707
- let endPos = pos;
708
- let rangeStart = "";
709
- WHILE: while (i2 < glob.length) {
710
- const c = glob.charAt(i2);
711
- if ((c === "!" || c === "^") && i2 === pos + 1) {
712
- negate = true;
713
- i2++;
714
- continue;
715
- }
716
- if (c === "]" && sawStart && !escaping) {
717
- endPos = i2 + 1;
718
- break;
719
- }
720
- sawStart = true;
721
- if (c === "\\") {
722
- if (!escaping) {
723
- escaping = true;
724
- i2++;
725
- continue;
726
- }
727
- }
728
- if (c === "[" && !escaping) {
729
- for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
730
- if (glob.startsWith(cls, i2)) {
731
- if (rangeStart) {
732
- return ["$.", false, glob.length - pos, true];
733
- }
734
- i2 += cls.length;
735
- if (neg)
736
- negs.push(unip);
737
- else
738
- ranges.push(unip);
739
- uflag = uflag || u;
740
- continue WHILE;
741
- }
742
- }
743
- }
744
- escaping = false;
745
- if (rangeStart) {
746
- if (c > rangeStart) {
747
- ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
748
- } else if (c === rangeStart) {
749
- ranges.push(braceEscape(c));
750
- }
751
- rangeStart = "";
752
- i2++;
753
- continue;
754
- }
755
- if (glob.startsWith("-]", i2 + 1)) {
756
- ranges.push(braceEscape(c + "-"));
757
- i2 += 2;
758
- continue;
475
+ if (glob.startsWith("-]", i2 + 1)) {
476
+ ranges.push(braceEscape(c + "-"));
477
+ i2 += 2;
478
+ continue;
759
479
  }
760
480
  if (glob.startsWith("-", i2 + 1)) {
761
481
  rangeStart = c;
@@ -2105,175 +1825,520 @@ var RemoteValue = class _RemoteValue {
2105
1825
  if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
2106
1826
  return false;
2107
1827
  }
2108
- const type = obj[TYPE_CONSTANT];
2109
- const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
2110
- if (!hasTypeProperty) {
2111
- return false;
1828
+ const type = obj[TYPE_CONSTANT];
1829
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
1830
+ if (!hasTypeProperty) {
1831
+ return false;
1832
+ }
1833
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
1834
+ return obj.hasOwnProperty(VALUE_CONSTANT);
1835
+ }
1836
+ return true;
1837
+ }
1838
+ };
1839
+
1840
+ // src/utils/result.ts
1841
+ var result_exports = {};
1842
+ __export(result_exports, {
1843
+ err: () => err,
1844
+ map: () => map,
1845
+ ok: () => ok,
1846
+ unwrap: () => unwrap,
1847
+ unwrapErr: () => unwrapErr
1848
+ });
1849
+ var ok = (value) => ({
1850
+ isOk: true,
1851
+ isErr: false,
1852
+ value
1853
+ });
1854
+ var err = (value) => ({
1855
+ isOk: false,
1856
+ isErr: true,
1857
+ value
1858
+ });
1859
+ function map(result, fn) {
1860
+ if (result.isOk) {
1861
+ const val = fn(result.value);
1862
+ if (val instanceof Promise) {
1863
+ return val.then((newVal) => ok(newVal));
1864
+ } else {
1865
+ return ok(val);
1866
+ }
1867
+ }
1868
+ if (result.isErr) {
1869
+ const value = result.value;
1870
+ return err(value);
1871
+ }
1872
+ throw "should never get here";
1873
+ }
1874
+ var unwrap = (result) => {
1875
+ if (result.isOk) {
1876
+ return result.value;
1877
+ } else {
1878
+ throw result.value;
1879
+ }
1880
+ };
1881
+ var unwrapErr = (result) => {
1882
+ if (result.isErr) {
1883
+ return result.value;
1884
+ } else {
1885
+ throw result.value;
1886
+ }
1887
+ };
1888
+
1889
+ // src/utils/serialize.ts
1890
+ function deserializeProperty(value) {
1891
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
1892
+ return value;
1893
+ }
1894
+ return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
1895
+ }
1896
+
1897
+ // src/utils/shadow-root.ts
1898
+ var import_app_data = require("@stencil/core/internal/app-data");
1899
+
1900
+ // src/app-globals/index.ts
1901
+ var globalStyles = (
1902
+ /* default */
1903
+ ""
1904
+ );
1905
+
1906
+ // src/runtime/runtime-constants.ts
1907
+ var CONTENT_REF_ID = "r";
1908
+ var ORG_LOCATION_ID = "o";
1909
+ var SLOT_NODE_ID = "s";
1910
+ var TEXT_NODE_ID = "t";
1911
+ var COMMENT_NODE_ID = "c";
1912
+ var HYDRATE_ID = "s-id";
1913
+ var HYDRATED_STYLE_ID = "sty-id";
1914
+ var HYDRATE_CHILD_ID = "c-id";
1915
+ var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
1916
+ var STENCIL_DOC_DATA = "_stencilDocData";
1917
+ var DEFAULT_DOC_DATA = {
1918
+ hostIds: 0,
1919
+ rootLevelIds: 0,
1920
+ staticComponents: /* @__PURE__ */ new Set()
1921
+ };
1922
+ var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
1923
+ var XLINK_NS = "http://www.w3.org/1999/xlink";
1924
+ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
1925
+ "formAssociatedCallback",
1926
+ "formResetCallback",
1927
+ "formDisabledCallback",
1928
+ "formStateRestoreCallback"
1929
+ ];
1930
+
1931
+ // src/utils/style.ts
1932
+ function createStyleSheetIfNeededAndSupported(styles2) {
1933
+ if (!styles2 || !supportsConstructableStylesheets) return void 0;
1934
+ const sheet = new CSSStyleSheet();
1935
+ sheet.replaceSync(styles2);
1936
+ return sheet;
1937
+ }
1938
+
1939
+ // src/utils/shadow-root.ts
1940
+ var globalStyleSheet;
1941
+ var GLOBAL_STYLE_ID = "sc-global";
1942
+ function createShadowRoot(cmpMeta) {
1943
+ var _a;
1944
+ const opts = { mode: "open" };
1945
+ if (import_app_data.BUILD.shadowDelegatesFocus) {
1946
+ opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
1947
+ }
1948
+ if (import_app_data.BUILD.shadowSlotAssignmentManual) {
1949
+ const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
1950
+ if (isManual) {
1951
+ opts.slotAssignment = "manual";
1952
+ }
1953
+ }
1954
+ const shadowRoot = this.attachShadow(opts);
1955
+ if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null;
1956
+ if (globalStyleSheet) {
1957
+ if (supportsMutableAdoptedStyleSheets) {
1958
+ shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
1959
+ } else {
1960
+ shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
2112
1961
  }
2113
- if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
2114
- return obj.hasOwnProperty(VALUE_CONSTANT);
1962
+ } else if (globalStyles && !supportsConstructableStylesheets) {
1963
+ const styleElm = document.createElement("style");
1964
+ styleElm.innerHTML = globalStyles;
1965
+ if (import_app_data.BUILD.hotModuleReplacement) {
1966
+ styleElm.setAttribute(HYDRATED_STYLE_ID, GLOBAL_STYLE_ID);
2115
1967
  }
2116
- return true;
1968
+ shadowRoot.prepend(styleElm);
2117
1969
  }
1970
+ }
1971
+
1972
+ // src/utils/util.ts
1973
+ var lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
1974
+ var isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
1975
+ var isTsFile = lowerPathParam(
1976
+ (p) => !isDtsFile(p) && (p.endsWith(".ts") || p.endsWith(".mts") || p.endsWith(".cts"))
1977
+ );
1978
+ var isTsxFile = lowerPathParam(
1979
+ (p) => p.endsWith(".tsx") || p.endsWith(".mtsx") || p.endsWith(".ctsx")
1980
+ );
1981
+ var isJsxFile = lowerPathParam(
1982
+ (p) => p.endsWith(".jsx") || p.endsWith(".mjsx") || p.endsWith(".cjsx")
1983
+ );
1984
+ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") || p.endsWith(".cjs"));
1985
+
1986
+ // src/runtime/element.ts
1987
+ var import_app_data2 = require("@stencil/core/internal/app-data");
1988
+ var getElement = (ref) => {
1989
+ var _a;
1990
+ return import_app_data2.BUILD.lazyLoad ? (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ : ref;
2118
1991
  };
2119
1992
 
2120
- // src/utils/result.ts
2121
- var result_exports = {};
2122
- __export(result_exports, {
2123
- err: () => err,
2124
- map: () => map,
2125
- ok: () => ok,
2126
- unwrap: () => unwrap,
2127
- unwrapErr: () => unwrapErr
2128
- });
2129
- var ok = (value) => ({
2130
- isOk: true,
2131
- isErr: false,
2132
- value
2133
- });
2134
- var err = (value) => ({
2135
- isOk: false,
2136
- isErr: true,
2137
- value
2138
- });
2139
- function map(result, fn) {
2140
- if (result.isOk) {
2141
- const val = fn(result.value);
2142
- if (val instanceof Promise) {
2143
- return val.then((newVal) => ok(newVal));
2144
- } else {
2145
- return ok(val);
1993
+ // src/runtime/event-emitter.ts
1994
+ var createEvent = (ref, name, flags) => {
1995
+ const elm = getElement(ref);
1996
+ return {
1997
+ emit: (detail) => {
1998
+ if (import_app_data3.BUILD.isDev && !elm.isConnected) {
1999
+ consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
2000
+ }
2001
+ return emitEvent(elm, name, {
2002
+ bubbles: !!(flags & 4 /* Bubbles */),
2003
+ composed: !!(flags & 2 /* Composed */),
2004
+ cancelable: !!(flags & 1 /* Cancellable */),
2005
+ detail
2006
+ });
2146
2007
  }
2008
+ };
2009
+ };
2010
+ var emitEvent = (elm, name, opts) => {
2011
+ const ev = plt.ce(name, opts);
2012
+ elm.dispatchEvent(ev);
2013
+ return ev;
2014
+ };
2015
+
2016
+ // src/testing/platform/testing-host-ref.ts
2017
+ var getHostRef = (elm) => {
2018
+ if (elm.__stencil__getHostRef) {
2019
+ return elm.__stencil__getHostRef();
2147
2020
  }
2148
- if (result.isErr) {
2149
- const value = result.value;
2150
- return err(value);
2021
+ return void 0;
2022
+ };
2023
+ var registerInstance = (lazyInstance, hostRef) => {
2024
+ if (lazyInstance == null || lazyInstance.constructor == null) {
2025
+ throw new Error(`Invalid component constructor`);
2151
2026
  }
2152
- throw "should never get here";
2153
- }
2154
- var unwrap = (result) => {
2155
- if (result.isOk) {
2156
- return result.value;
2157
- } else {
2158
- throw result.value;
2027
+ if (hostRef == null) {
2028
+ const Cstr2 = lazyInstance.constructor;
2029
+ const tagName = Cstr2.COMPILER_META && Cstr2.COMPILER_META.tagName ? Cstr2.COMPILER_META.tagName : "div";
2030
+ const elm = document.createElement(tagName);
2031
+ registerHost(elm, { $flags$: 0, $tagName$: tagName });
2032
+ hostRef = getHostRef(elm);
2159
2033
  }
2160
- };
2161
- var unwrapErr = (result) => {
2162
- if (result.isErr) {
2163
- return result.value;
2164
- } else {
2165
- throw result.value;
2034
+ lazyInstance.__stencil__getHostRef = () => hostRef;
2035
+ hostRef.$lazyInstance$ = lazyInstance;
2036
+ const Cstr = lazyInstance.constructor;
2037
+ const allEvents = [];
2038
+ const seenEventMethods = /* @__PURE__ */ new Set();
2039
+ if (Cstr.COMPILER_META && Cstr.COMPILER_META.events) {
2040
+ Cstr.COMPILER_META.events.forEach((event) => {
2041
+ if (!seenEventMethods.has(event.method)) {
2042
+ allEvents.push(event);
2043
+ seenEventMethods.add(event.method);
2044
+ }
2045
+ });
2046
+ }
2047
+ let currentProto = Object.getPrototypeOf(Cstr);
2048
+ while (currentProto && currentProto !== Function.prototype && currentProto.name) {
2049
+ if (typeof currentProto.events === "object" && Array.isArray(currentProto.events)) {
2050
+ currentProto.events.forEach((event) => {
2051
+ if (!seenEventMethods.has(event.method)) {
2052
+ allEvents.push(event);
2053
+ seenEventMethods.add(event.method);
2054
+ }
2055
+ });
2056
+ }
2057
+ currentProto = Object.getPrototypeOf(currentProto);
2166
2058
  }
2059
+ allEvents.forEach((eventMeta) => {
2060
+ if (!lazyInstance[eventMeta.method]) {
2061
+ let flags = 0;
2062
+ if (eventMeta.bubbles) flags |= 4 /* Bubbles */;
2063
+ if (eventMeta.composed) flags |= 2 /* Composed */;
2064
+ if (eventMeta.cancelable) flags |= 1 /* Cancellable */;
2065
+ lazyInstance[eventMeta.method] = createEvent(lazyInstance, eventMeta.name, flags);
2066
+ }
2067
+ });
2068
+ };
2069
+ var registerHost = (elm, cmpMeta) => {
2070
+ const hostRef = {
2071
+ $flags$: 0,
2072
+ $hostElement$: elm,
2073
+ $cmpMeta$: cmpMeta,
2074
+ $instanceValues$: /* @__PURE__ */ new Map(),
2075
+ $serializerValues$: /* @__PURE__ */ new Map(),
2076
+ $renderCount$: 0
2077
+ };
2078
+ hostRef.$fetchedCbList$ = [];
2079
+ hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
2080
+ hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
2081
+ elm["s-p"] = [];
2082
+ elm["s-rc"] = [];
2083
+ elm.__stencil__getHostRef = () => hostRef;
2167
2084
  };
2168
2085
 
2169
- // src/utils/serialize.ts
2170
- function deserializeProperty(value) {
2171
- if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
2172
- return value;
2086
+ // src/testing/platform/testing-log.ts
2087
+ var customError;
2088
+ var defaultConsoleError = (e) => {
2089
+ caughtErrors.push(e);
2090
+ };
2091
+ var consoleError = (e, el) => (customError || defaultConsoleError)(e, el);
2092
+ var consoleDevError = (...e) => {
2093
+ caughtErrors.push(new Error(e.join(", ")));
2094
+ };
2095
+ var consoleDevWarn = (...args) => {
2096
+ const params = args.filter((a) => typeof a === "string" || typeof a === "number" || typeof a === "boolean");
2097
+ console.warn(...params);
2098
+ };
2099
+ var consoleDevInfo = (..._) => {
2100
+ };
2101
+ var setErrorHandler = (handler) => customError = handler;
2102
+
2103
+ // src/testing/platform/testing-task-queue.ts
2104
+ function resetTaskQueue() {
2105
+ queuedTicks.length = 0;
2106
+ queuedWriteTasks.length = 0;
2107
+ queuedReadTasks.length = 0;
2108
+ moduleLoaded.clear();
2109
+ queuedLoadModules.length = 0;
2110
+ caughtErrors.length = 0;
2111
+ }
2112
+ var nextTick = (cb) => {
2113
+ queuedTicks.push(cb);
2114
+ };
2115
+ function flushTicks() {
2116
+ return new Promise((resolve, reject) => {
2117
+ function drain() {
2118
+ try {
2119
+ if (queuedTicks.length > 0) {
2120
+ const writeTasks = queuedTicks.slice();
2121
+ queuedTicks.length = 0;
2122
+ let cb;
2123
+ while (cb = writeTasks.shift()) {
2124
+ cb(Date.now());
2125
+ }
2126
+ }
2127
+ if (queuedTicks.length > 0) {
2128
+ process.nextTick(drain);
2129
+ } else {
2130
+ resolve();
2131
+ }
2132
+ } catch (e) {
2133
+ reject(`flushTicks: ${e}`);
2134
+ }
2135
+ }
2136
+ process.nextTick(drain);
2137
+ });
2138
+ }
2139
+ function writeTask(cb) {
2140
+ queuedWriteTasks.push(cb);
2141
+ }
2142
+ function readTask(cb) {
2143
+ queuedReadTasks.push(cb);
2144
+ }
2145
+ function flushQueue() {
2146
+ return new Promise((resolve, reject) => {
2147
+ async function drain() {
2148
+ try {
2149
+ if (queuedReadTasks.length > 0) {
2150
+ const readTasks = queuedReadTasks.slice();
2151
+ queuedReadTasks.length = 0;
2152
+ let cb;
2153
+ while (cb = readTasks.shift()) {
2154
+ const result = cb(Date.now());
2155
+ if (result != null && typeof result.then === "function") {
2156
+ await result;
2157
+ }
2158
+ }
2159
+ }
2160
+ if (queuedWriteTasks.length > 0) {
2161
+ const writeTasks = queuedWriteTasks.slice();
2162
+ queuedWriteTasks.length = 0;
2163
+ let cb;
2164
+ while (cb = writeTasks.shift()) {
2165
+ const result = cb(Date.now());
2166
+ if (result != null && typeof result.then === "function") {
2167
+ await result;
2168
+ }
2169
+ }
2170
+ }
2171
+ if (queuedReadTasks.length + queuedWriteTasks.length > 0) {
2172
+ process.nextTick(drain);
2173
+ } else {
2174
+ resolve();
2175
+ }
2176
+ } catch (e) {
2177
+ reject(`flushQueue: ${e}`);
2178
+ }
2179
+ }
2180
+ process.nextTick(drain);
2181
+ });
2182
+ }
2183
+ async function flushAll() {
2184
+ while (queuedTicks.length + queuedLoadModules.length + queuedWriteTasks.length + queuedReadTasks.length > 0) {
2185
+ await flushTicks();
2186
+ await flushLoadModule();
2187
+ await flushQueue();
2173
2188
  }
2174
- return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
2189
+ if (caughtErrors.length > 0) {
2190
+ const err2 = caughtErrors[0];
2191
+ if (err2 == null) {
2192
+ throw new Error("Error!");
2193
+ }
2194
+ if (typeof err2 === "string") {
2195
+ throw new Error(err2);
2196
+ }
2197
+ throw err2;
2198
+ }
2199
+ return new Promise((resolve) => process.nextTick(resolve));
2200
+ }
2201
+ function loadModule(cmpMeta, _hostRef, _hmrVersionId) {
2202
+ return new Promise((resolve) => {
2203
+ queuedLoadModules.push({
2204
+ bundleId: cmpMeta.$lazyBundleId$,
2205
+ resolve: () => resolve(moduleLoaded.get(cmpMeta.$lazyBundleId$))
2206
+ });
2207
+ });
2208
+ }
2209
+ function flushLoadModule(bundleId) {
2210
+ return new Promise((resolve, reject) => {
2211
+ try {
2212
+ process.nextTick(() => {
2213
+ if (bundleId != null) {
2214
+ for (let i2 = 0; i2 < queuedLoadModules.length; i2++) {
2215
+ if (queuedLoadModules[i2].bundleId === bundleId) {
2216
+ queuedLoadModules[i2].resolve();
2217
+ queuedLoadModules.splice(i2, 1);
2218
+ i2--;
2219
+ }
2220
+ }
2221
+ } else {
2222
+ let queuedLoadModule;
2223
+ while (queuedLoadModule = queuedLoadModules.shift()) {
2224
+ queuedLoadModule.resolve();
2225
+ }
2226
+ }
2227
+ resolve();
2228
+ });
2229
+ } catch (e) {
2230
+ reject(`flushLoadModule: ${e}`);
2231
+ }
2232
+ });
2175
2233
  }
2176
2234
 
2177
- // src/utils/shadow-root.ts
2178
- var import_app_data = require("@stencil/core/internal/app-data");
2179
-
2180
- // src/app-globals/index.ts
2181
- var globalStyles = (
2182
- /* default */
2183
- ""
2184
- );
2235
+ // src/testing/platform/testing-window.ts
2236
+ var import_mock_doc = require("../../mock-doc/index.cjs");
2237
+ var win = (0, import_mock_doc.setupGlobal)(global);
2185
2238
 
2186
- // src/runtime/runtime-constants.ts
2187
- var CONTENT_REF_ID = "r";
2188
- var ORG_LOCATION_ID = "o";
2189
- var SLOT_NODE_ID = "s";
2190
- var TEXT_NODE_ID = "t";
2191
- var COMMENT_NODE_ID = "c";
2192
- var HYDRATE_ID = "s-id";
2193
- var HYDRATED_STYLE_ID = "sty-id";
2194
- var HYDRATE_CHILD_ID = "c-id";
2195
- var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
2196
- var STENCIL_DOC_DATA = "_stencilDocData";
2197
- var DEFAULT_DOC_DATA = {
2198
- hostIds: 0,
2199
- rootLevelIds: 0,
2200
- staticComponents: /* @__PURE__ */ new Set()
2239
+ // src/testing/platform/testing-platform.ts
2240
+ var supportsShadow = true;
2241
+ var plt = {
2242
+ $flags$: 0,
2243
+ $resourcesUrl$: "",
2244
+ jmp: (h2) => h2(),
2245
+ raf: (h2) => requestAnimationFrame(h2),
2246
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2247
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2248
+ ce: (eventName, opts) => new win.CustomEvent(eventName, opts)
2201
2249
  };
2202
- var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
2203
- var XLINK_NS = "http://www.w3.org/1999/xlink";
2204
- var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
2205
- "formAssociatedCallback",
2206
- "formResetCallback",
2207
- "formDisabledCallback",
2208
- "formStateRestoreCallback"
2209
- ];
2210
-
2211
- // src/utils/style.ts
2212
- function createStyleSheetIfNeededAndSupported(styles2) {
2213
- if (!styles2 || !supportsConstructableStylesheets) return void 0;
2214
- const sheet = new CSSStyleSheet();
2215
- sheet.replaceSync(styles2);
2216
- return sheet;
2250
+ var setPlatformHelpers = (helpers) => {
2251
+ Object.assign(plt, helpers);
2252
+ };
2253
+ var supportsListenerOptions = true;
2254
+ var supportsConstructableStylesheets = false;
2255
+ var supportsMutableAdoptedStyleSheets = false;
2256
+ var setSupportsShadowDom = (supports) => {
2257
+ supportsShadow = supports;
2258
+ };
2259
+ function resetPlatform(defaults2 = {}) {
2260
+ if (win && typeof win.close === "function") {
2261
+ win.close();
2262
+ }
2263
+ styles.clear();
2264
+ plt.$flags$ = 0;
2265
+ Object.assign(plt, defaults2);
2266
+ if (plt.$orgLocNodes$ != null) {
2267
+ plt.$orgLocNodes$.clear();
2268
+ plt.$orgLocNodes$ = void 0;
2269
+ }
2270
+ win.location.href = plt.$resourcesUrl$ = `http://testing.stenciljs.com/`;
2271
+ resetTaskQueue();
2272
+ stopAutoApplyChanges();
2273
+ cstrs.clear();
2217
2274
  }
2218
-
2219
- // src/utils/shadow-root.ts
2220
- var globalStyleSheet;
2221
- var GLOBAL_STYLE_ID = "sc-global";
2222
- function createShadowRoot(cmpMeta) {
2223
- var _a;
2224
- const opts = { mode: "open" };
2225
- if (import_app_data.BUILD.shadowDelegatesFocus) {
2226
- opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
2275
+ var isAutoApplyingChanges = false;
2276
+ var autoApplyTimer = void 0;
2277
+ function stopAutoApplyChanges() {
2278
+ isAutoApplyingChanges = false;
2279
+ if (autoApplyTimer) {
2280
+ clearTimeout(autoApplyTimer);
2281
+ autoApplyTimer = void 0;
2227
2282
  }
2228
- if (import_app_data.BUILD.shadowSlotAssignmentManual) {
2229
- const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
2230
- if (isManual) {
2231
- opts.slotAssignment = "manual";
2283
+ }
2284
+ async function startAutoApplyChanges() {
2285
+ isAutoApplyingChanges = true;
2286
+ flushAll().then(() => {
2287
+ if (isAutoApplyingChanges) {
2288
+ autoApplyTimer = setTimeout(() => {
2289
+ startAutoApplyChanges();
2290
+ }, 100);
2232
2291
  }
2233
- }
2234
- const shadowRoot = this.attachShadow(opts);
2235
- if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null;
2236
- if (globalStyleSheet) {
2237
- if (supportsMutableAdoptedStyleSheets) {
2238
- shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
2239
- } else {
2240
- shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
2292
+ });
2293
+ }
2294
+ var registerComponents = (Cstrs) => {
2295
+ Cstrs.filter((Cstr) => Cstr.COMPILER_META).forEach((Cstr) => {
2296
+ cstrs.set(Cstr.COMPILER_META.tagName, Cstr);
2297
+ });
2298
+ };
2299
+ function registerModule(bundleId, Cstr) {
2300
+ moduleLoaded.set(bundleId, Cstr);
2301
+ }
2302
+ var isMemberInElement = (elm, memberName) => {
2303
+ if (elm != null) {
2304
+ if (memberName in elm) {
2305
+ return true;
2241
2306
  }
2242
- } else if (globalStyles && !supportsConstructableStylesheets) {
2243
- const styleElm = document.createElement("style");
2244
- styleElm.innerHTML = globalStyles;
2245
- if (import_app_data.BUILD.hotModuleReplacement) {
2246
- styleElm.setAttribute(HYDRATED_STYLE_ID, GLOBAL_STYLE_ID);
2307
+ const nodeName = elm.nodeName;
2308
+ if (nodeName) {
2309
+ const cstr = cstrs.get(nodeName.toLowerCase());
2310
+ if (cstr != null && cstr.COMPILER_META != null && cstr.COMPILER_META.properties != null) {
2311
+ return cstr.COMPILER_META.properties.some((p) => p.name === memberName);
2312
+ }
2247
2313
  }
2248
- shadowRoot.prepend(styleElm);
2249
2314
  }
2250
- }
2315
+ return false;
2316
+ };
2251
2317
 
2252
- // src/utils/util.ts
2253
- var lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
2254
- var isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
2255
- var isTsFile = lowerPathParam(
2256
- (p) => !isDtsFile(p) && (p.endsWith(".ts") || p.endsWith(".mts") || p.endsWith(".cts"))
2257
- );
2258
- var isTsxFile = lowerPathParam(
2259
- (p) => p.endsWith(".tsx") || p.endsWith(".mtsx") || p.endsWith(".ctsx")
2260
- );
2261
- var isJsxFile = lowerPathParam(
2262
- (p) => p.endsWith(".jsx") || p.endsWith(".mjsx") || p.endsWith(".cjsx")
2263
- );
2264
- var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") || p.endsWith(".cjs"));
2318
+ // src/testing/platform/index.ts
2319
+ var import_app_data24 = require("@stencil/core/internal/app-data");
2320
+
2321
+ // src/runtime/asset-path.ts
2322
+ var getAssetPath = (path2) => {
2323
+ const assetUrl = new URL(path2, plt.$resourcesUrl$);
2324
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
2325
+ };
2326
+ var setAssetPath = (path2) => plt.$resourcesUrl$ = path2;
2327
+
2328
+ // src/runtime/bootstrap-custom-element.ts
2329
+ var import_app_data20 = require("@stencil/core/internal/app-data");
2265
2330
 
2266
2331
  // src/runtime/connected-callback.ts
2267
2332
  var import_app_data18 = require("@stencil/core/internal/app-data");
2268
2333
 
2269
2334
  // src/runtime/client-hydrate.ts
2270
- var import_app_data7 = require("@stencil/core/internal/app-data");
2335
+ var import_app_data9 = require("@stencil/core/internal/app-data");
2271
2336
 
2272
2337
  // src/runtime/dom-extras.ts
2273
- var import_app_data3 = require("@stencil/core/internal/app-data");
2338
+ var import_app_data5 = require("@stencil/core/internal/app-data");
2274
2339
 
2275
2340
  // src/runtime/slot-polyfill-utils.ts
2276
- var import_app_data2 = require("@stencil/core/internal/app-data");
2341
+ var import_app_data4 = require("@stencil/core/internal/app-data");
2277
2342
  var updateFallbackSlotVisibility = (elm) => {
2278
2343
  const childNodes = internalCall(elm, "childNodes");
2279
2344
  if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
@@ -2352,7 +2417,7 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
2352
2417
  if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
2353
2418
  const parent = slotNode["s-cr"].parentNode;
2354
2419
  const appendMethod = prepend ? internalCall(parent, "prepend") : internalCall(parent, "appendChild");
2355
- if (import_app_data2.BUILD.hydrateClientSide && typeof position !== "undefined") {
2420
+ if (import_app_data4.BUILD.hydrateClientSide && typeof position !== "undefined") {
2356
2421
  slottedNodeLocation["s-oo"] = position;
2357
2422
  const childNodes = internalCall(parent, "childNodes");
2358
2423
  const slotRelocateNodes = [slottedNodeLocation];
@@ -2427,12 +2492,13 @@ var patchPseudoShadowDom = (hostElementPrototype) => {
2427
2492
  patchSlotRemoveChild(hostElementPrototype);
2428
2493
  };
2429
2494
  var patchCloneNode = (HostElementPrototype) => {
2430
- const orgCloneNode = HostElementPrototype.cloneNode;
2495
+ if (HostElementPrototype.__cloneNode) return;
2496
+ const orgCloneNode = HostElementPrototype.__cloneNode = HostElementPrototype.cloneNode;
2431
2497
  HostElementPrototype.cloneNode = function(deep) {
2432
2498
  const srcNode = this;
2433
- const isShadowDom = import_app_data3.BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2499
+ const isShadowDom = import_app_data5.BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2434
2500
  const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2435
- if (import_app_data3.BUILD.slot && !isShadowDom && deep) {
2501
+ if (import_app_data5.BUILD.slot && !isShadowDom && deep) {
2436
2502
  let i2 = 0;
2437
2503
  let slotted, nonStencilNode;
2438
2504
  const stencilPrivates = [
@@ -2457,7 +2523,7 @@ var patchCloneNode = (HostElementPrototype) => {
2457
2523
  slotted = childNodes[i2]["s-nr"];
2458
2524
  nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
2459
2525
  if (slotted) {
2460
- if (import_app_data3.BUILD.appendChildSlotFix && clonedNode.__appendChild) {
2526
+ if (import_app_data5.BUILD.appendChildSlotFix && clonedNode.__appendChild) {
2461
2527
  clonedNode.__appendChild(slotted.cloneNode(true));
2462
2528
  } else {
2463
2529
  clonedNode.appendChild(slotted.cloneNode(true));
@@ -2472,6 +2538,7 @@ var patchCloneNode = (HostElementPrototype) => {
2472
2538
  };
2473
2539
  };
2474
2540
  var patchSlotAppendChild = (HostElementPrototype) => {
2541
+ if (HostElementPrototype.__appendChild) return;
2475
2542
  HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2476
2543
  HostElementPrototype.appendChild = function(newChild) {
2477
2544
  const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
@@ -2489,6 +2556,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
2489
2556
  };
2490
2557
  };
2491
2558
  var patchSlotRemoveChild = (ElementPrototype) => {
2559
+ if (ElementPrototype.__removeChild) return;
2492
2560
  ElementPrototype.__removeChild = ElementPrototype.removeChild;
2493
2561
  ElementPrototype.removeChild = function(toRemove) {
2494
2562
  if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
@@ -2504,6 +2572,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
2504
2572
  };
2505
2573
  };
2506
2574
  var patchSlotPrepend = (HostElementPrototype) => {
2575
+ if (HostElementPrototype.__prepend) return;
2507
2576
  HostElementPrototype.__prepend = HostElementPrototype.prepend;
2508
2577
  HostElementPrototype.prepend = function(...newChildren) {
2509
2578
  newChildren.forEach((newChild) => {
@@ -2530,6 +2599,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
2530
2599
  };
2531
2600
  };
2532
2601
  var patchSlotAppend = (HostElementPrototype) => {
2602
+ if (HostElementPrototype.__append) return;
2533
2603
  HostElementPrototype.__append = HostElementPrototype.append;
2534
2604
  HostElementPrototype.append = function(...newChildren) {
2535
2605
  newChildren.forEach((newChild) => {
@@ -2541,6 +2611,7 @@ var patchSlotAppend = (HostElementPrototype) => {
2541
2611
  };
2542
2612
  };
2543
2613
  var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
2614
+ if (HostElementPrototype.__insertAdjacentHTML) return;
2544
2615
  const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
2545
2616
  HostElementPrototype.insertAdjacentHTML = function(position, text) {
2546
2617
  if (position !== "afterbegin" && position !== "beforeend") {
@@ -2566,6 +2637,7 @@ var patchSlotInsertAdjacentText = (HostElementPrototype) => {
2566
2637
  };
2567
2638
  };
2568
2639
  var patchInsertBefore = (HostElementPrototype) => {
2640
+ if (HostElementPrototype.__insertBefore) return;
2569
2641
  const eleProto = HostElementPrototype;
2570
2642
  if (eleProto.__insertBefore) return;
2571
2643
  eleProto.__insertBefore = HostElementPrototype.insertBefore;
@@ -2600,6 +2672,7 @@ var patchInsertBefore = (HostElementPrototype) => {
2600
2672
  };
2601
2673
  };
2602
2674
  var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2675
+ if (HostElementPrototype.__insertAdjacentElement) return;
2603
2676
  const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
2604
2677
  HostElementPrototype.insertAdjacentElement = function(position, element) {
2605
2678
  if (position !== "afterbegin" && position !== "beforeend") {
@@ -2792,10 +2865,10 @@ function internalCall(node, method) {
2792
2865
  }
2793
2866
 
2794
2867
  // src/runtime/profile.ts
2795
- var import_app_data4 = require("@stencil/core/internal/app-data");
2868
+ var import_app_data6 = require("@stencil/core/internal/app-data");
2796
2869
  var i = 0;
2797
2870
  var createTime = (fnName, tagName = "") => {
2798
- if (import_app_data4.BUILD.profile && performance.mark) {
2871
+ if (import_app_data6.BUILD.profile && performance.mark) {
2799
2872
  const key = `st:${fnName}:${tagName}:${i++}`;
2800
2873
  performance.mark(key);
2801
2874
  return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
@@ -2806,7 +2879,7 @@ var createTime = (fnName, tagName = "") => {
2806
2879
  }
2807
2880
  };
2808
2881
  var uniqueTime = (key, measureText) => {
2809
- if (import_app_data4.BUILD.profile && performance.mark) {
2882
+ if (import_app_data6.BUILD.profile && performance.mark) {
2810
2883
  if (performance.getEntriesByName(key, "mark").length === 0) {
2811
2884
  performance.mark(key);
2812
2885
  }
@@ -2866,7 +2939,7 @@ var inspect = (ref) => {
2866
2939
  };
2867
2940
  };
2868
2941
  var installDevTools = () => {
2869
- if (import_app_data4.BUILD.devTools) {
2942
+ if (import_app_data6.BUILD.devTools) {
2870
2943
  const stencil = win.stencil = win.stencil || {};
2871
2944
  const originalInspect = stencil.inspect;
2872
2945
  stencil.inspect = (ref) => {
@@ -2880,7 +2953,7 @@ var installDevTools = () => {
2880
2953
  };
2881
2954
 
2882
2955
  // src/runtime/styles.ts
2883
- var import_app_data5 = require("@stencil/core/internal/app-data");
2956
+ var import_app_data7 = require("@stencil/core/internal/app-data");
2884
2957
  var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
2885
2958
  var registerStyle = (scopeId2, cssText, allowCS) => {
2886
2959
  let style = styles.get(scopeId2);
@@ -2900,7 +2973,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2900
2973
  var _a, _b, _c;
2901
2974
  const scopeId2 = getScopeId(cmpMeta, mode);
2902
2975
  const style = styles.get(scopeId2);
2903
- if (!import_app_data5.BUILD.attachStyles || !win.document) {
2976
+ if (!import_app_data7.BUILD.attachStyles || !win.document) {
2904
2977
  return scopeId2;
2905
2978
  }
2906
2979
  styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
@@ -2912,7 +2985,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2912
2985
  if (!appliedStyles) {
2913
2986
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2914
2987
  }
2915
- const existingStyleElm = (import_app_data5.BUILD.hydrateClientSide || import_app_data5.BUILD.hotModuleReplacement) && styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
2988
+ const existingStyleElm = (import_app_data7.BUILD.hydrateClientSide || import_app_data7.BUILD.hotModuleReplacement) && styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
2916
2989
  if (existingStyleElm) {
2917
2990
  existingStyleElm.innerHTML = style;
2918
2991
  } else if (!appliedStyles.has(scopeId2)) {
@@ -2922,7 +2995,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2922
2995
  if (nonce != null) {
2923
2996
  styleElm.setAttribute("nonce", nonce);
2924
2997
  }
2925
- if ((import_app_data5.BUILD.hydrateServerSide || import_app_data5.BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */ || cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2998
+ if ((import_app_data7.BUILD.hydrateServerSide || import_app_data7.BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */ || cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2926
2999
  styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
2927
3000
  }
2928
3001
  if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
@@ -2965,7 +3038,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2965
3038
  appliedStyles.add(scopeId2);
2966
3039
  }
2967
3040
  }
2968
- } else if (import_app_data5.BUILD.constructableCSS) {
3041
+ } else if (import_app_data7.BUILD.constructableCSS) {
2969
3042
  let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2970
3043
  if (!appliedStyles) {
2971
3044
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
@@ -2998,17 +3071,17 @@ var attachStyles = (hostRef) => {
2998
3071
  const flags = cmpMeta.$flags$;
2999
3072
  const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
3000
3073
  const scopeId2 = addStyle(
3001
- import_app_data5.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
3074
+ import_app_data7.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
3002
3075
  cmpMeta,
3003
3076
  hostRef.$modeName$
3004
3077
  );
3005
- if ((import_app_data5.BUILD.shadowDom || import_app_data5.BUILD.scoped) && import_app_data5.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
3078
+ if ((import_app_data7.BUILD.shadowDom || import_app_data7.BUILD.scoped) && import_app_data7.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
3006
3079
  elm["s-sc"] = scopeId2;
3007
3080
  elm.classList.add(scopeId2 + "-h");
3008
3081
  }
3009
3082
  endAttachStyles();
3010
3083
  };
3011
- var getScopeId = (cmp, mode) => "sc-" + (import_app_data5.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
3084
+ var getScopeId = (cmp, mode) => "sc-" + (import_app_data7.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
3012
3085
  var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
3013
3086
  var hydrateScopedToShadow = () => {
3014
3087
  if (!win.document) {
@@ -3022,7 +3095,7 @@ var hydrateScopedToShadow = () => {
3022
3095
  };
3023
3096
 
3024
3097
  // src/runtime/vdom/h.ts
3025
- var import_app_data6 = require("@stencil/core/internal/app-data");
3098
+ var import_app_data8 = require("@stencil/core/internal/app-data");
3026
3099
  var h = (nodeName, vnodeData, ...children) => {
3027
3100
  if (typeof nodeName === "string") {
3028
3101
  nodeName = transformTag(nodeName);
@@ -3041,7 +3114,7 @@ var h = (nodeName, vnodeData, ...children) => {
3041
3114
  } else if (child != null && typeof child !== "boolean") {
3042
3115
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
3043
3116
  child = String(child);
3044
- } else if (import_app_data6.BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
3117
+ } else if (import_app_data8.BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
3045
3118
  consoleDevError(`vNode passed as children has unexpected type.
3046
3119
  Make sure it's using the correct h() function.
3047
3120
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -3057,28 +3130,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
3057
3130
  };
3058
3131
  walk(children);
3059
3132
  if (vnodeData) {
3060
- if (import_app_data6.BUILD.isDev && nodeName === "input") {
3133
+ if (import_app_data8.BUILD.isDev && nodeName === "input") {
3061
3134
  validateInputProperties(vnodeData);
3062
3135
  }
3063
- if (import_app_data6.BUILD.vdomKey && vnodeData.key) {
3136
+ if (import_app_data8.BUILD.vdomKey && vnodeData.key) {
3064
3137
  key = vnodeData.key;
3065
3138
  }
3066
- if (import_app_data6.BUILD.slotRelocation && vnodeData.name) {
3139
+ if (import_app_data8.BUILD.slotRelocation && vnodeData.name) {
3067
3140
  slotName = vnodeData.name;
3068
3141
  }
3069
- if (import_app_data6.BUILD.vdomClass) {
3142
+ if (import_app_data8.BUILD.vdomClass) {
3070
3143
  const classData = vnodeData.className || vnodeData.class;
3071
3144
  if (classData) {
3072
3145
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
3073
3146
  }
3074
3147
  }
3075
3148
  }
3076
- if (import_app_data6.BUILD.isDev && vNodeChildren.some(isHost)) {
3149
+ if (import_app_data8.BUILD.isDev && vNodeChildren.some(isHost)) {
3077
3150
  consoleDevError(`The <Host> must be the single root component. Make sure:
3078
3151
  - You are NOT using hostData() and <Host> in the same component.
3079
3152
  - <Host> is used once, and it's the single root component of the render() function.`);
3080
3153
  }
3081
- if (import_app_data6.BUILD.vdomFunctional && typeof nodeName === "function") {
3154
+ if (import_app_data8.BUILD.vdomFunctional && typeof nodeName === "function") {
3082
3155
  return nodeName(
3083
3156
  vnodeData === null ? {} : vnodeData,
3084
3157
  vNodeChildren,
@@ -3090,10 +3163,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
3090
3163
  if (vNodeChildren.length > 0) {
3091
3164
  vnode.$children$ = vNodeChildren;
3092
3165
  }
3093
- if (import_app_data6.BUILD.vdomKey) {
3166
+ if (import_app_data8.BUILD.vdomKey) {
3094
3167
  vnode.$key$ = key;
3095
3168
  }
3096
- if (import_app_data6.BUILD.slotRelocation) {
3169
+ if (import_app_data8.BUILD.slotRelocation) {
3097
3170
  vnode.$name$ = slotName;
3098
3171
  }
3099
3172
  return vnode;
@@ -3106,13 +3179,13 @@ var newVNode = (tag, text) => {
3106
3179
  $elm$: null,
3107
3180
  $children$: null
3108
3181
  };
3109
- if (import_app_data6.BUILD.vdomAttribute) {
3182
+ if (import_app_data8.BUILD.vdomAttribute) {
3110
3183
  vnode.$attrs$ = null;
3111
3184
  }
3112
- if (import_app_data6.BUILD.vdomKey) {
3185
+ if (import_app_data8.BUILD.vdomKey) {
3113
3186
  vnode.$key$ = null;
3114
3187
  }
3115
- if (import_app_data6.BUILD.slotRelocation) {
3188
+ if (import_app_data8.BUILD.slotRelocation) {
3116
3189
  vnode.$name$ = null;
3117
3190
  }
3118
3191
  return vnode;
@@ -3172,11 +3245,11 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
3172
3245
  const childRenderNodes = [];
3173
3246
  const slotNodes = [];
3174
3247
  const slottedNodes = [];
3175
- const shadowRootNodes = import_app_data7.BUILD.shadowDom && shadowRoot ? [] : null;
3248
+ const shadowRootNodes = import_app_data9.BUILD.shadowDom && shadowRoot ? [] : null;
3176
3249
  const vnode = newVNode(tagName, null);
3177
3250
  vnode.$elm$ = hostElm;
3178
3251
  let scopeId2;
3179
- if (import_app_data7.BUILD.scoped) {
3252
+ if (import_app_data9.BUILD.scoped) {
3180
3253
  const cmpMeta = hostRef.$cmpMeta$;
3181
3254
  if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
3182
3255
  scopeId2 = hostElm["s-sc"];
@@ -3218,7 +3291,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
3218
3291
  if (cmpMeta) {
3219
3292
  const scopeId3 = getScopeId(
3220
3293
  cmpMeta.$cmpMeta$,
3221
- import_app_data7.BUILD.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
3294
+ import_app_data9.BUILD.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
3222
3295
  );
3223
3296
  const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
3224
3297
  if (styleSheet) {
@@ -3288,19 +3361,19 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
3288
3361
  if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
3289
3362
  slottedItem.node.removeAttribute("slot");
3290
3363
  }
3291
- if (import_app_data7.BUILD.experimentalSlotFixes) {
3364
+ if (import_app_data9.BUILD.experimentalSlotFixes) {
3292
3365
  patchSlottedNode(slottedItem.node);
3293
3366
  }
3294
3367
  }
3295
3368
  currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
3296
3369
  }
3297
3370
  }
3298
- if (import_app_data7.BUILD.scoped && scopeId2 && slotNodes.length) {
3371
+ if (import_app_data9.BUILD.scoped && scopeId2 && slotNodes.length) {
3299
3372
  slotNodes.forEach((slot) => {
3300
3373
  slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
3301
3374
  });
3302
3375
  }
3303
- if (import_app_data7.BUILD.shadowDom && shadowRoot) {
3376
+ if (import_app_data9.BUILD.shadowDom && shadowRoot) {
3304
3377
  let rnIdex = 0;
3305
3378
  const rnLen = shadowRootNodes.length;
3306
3379
  if (rnLen) {
@@ -3352,7 +3425,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
3352
3425
  if (!parentVNode.$children$) {
3353
3426
  parentVNode.$children$ = [];
3354
3427
  }
3355
- if (import_app_data7.BUILD.scoped && scopeId2 && childIdSplt[0] === hostId) {
3428
+ if (import_app_data9.BUILD.scoped && scopeId2 && childIdSplt[0] === hostId) {
3356
3429
  node["s-si"] = scopeId2;
3357
3430
  childVNode.$attrs$.class += " " + scopeId2;
3358
3431
  }
@@ -3370,7 +3443,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
3370
3443
  shadowRootNodes,
3371
3444
  slottedNodes
3372
3445
  );
3373
- if (import_app_data7.BUILD.scoped && scopeId2) {
3446
+ if (import_app_data9.BUILD.scoped && scopeId2) {
3374
3447
  node.classList.add(scopeId2);
3375
3448
  }
3376
3449
  }
@@ -3467,9 +3540,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
3467
3540
  slottedNodes
3468
3541
  );
3469
3542
  } else if (childNodeType === CONTENT_REF_ID) {
3470
- if (import_app_data7.BUILD.shadowDom && shadowRootNodes) {
3543
+ if (import_app_data9.BUILD.shadowDom && shadowRootNodes) {
3471
3544
  node.remove();
3472
- } else if (import_app_data7.BUILD.slotRelocation) {
3545
+ } else if (import_app_data9.BUILD.slotRelocation) {
3473
3546
  hostElm["s-cr"] = node;
3474
3547
  node["s-cn"] = true;
3475
3548
  }
@@ -3531,7 +3604,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
3531
3604
  childVNode.$name$ = slotName || null;
3532
3605
  childVNode.$tag$ = "slot";
3533
3606
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
3534
- if (import_app_data7.BUILD.shadowDom && shadowRootNodes && win.document) {
3607
+ if (import_app_data9.BUILD.shadowDom && shadowRootNodes && win.document) {
3535
3608
  const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
3536
3609
  if (childVNode.$name$) {
3537
3610
  childVNode.$elm$.setAttribute("name", slotName);
@@ -4007,24 +4080,24 @@ var import_app_data16 = require("@stencil/core/internal/app-data");
4007
4080
  var import_app_data15 = require("@stencil/core/internal/app-data");
4008
4081
 
4009
4082
  // src/runtime/parse-property-value.ts
4010
- var import_app_data8 = require("@stencil/core/internal/app-data");
4083
+ var import_app_data10 = require("@stencil/core/internal/app-data");
4011
4084
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
4012
- if ((import_app_data8.BUILD.hydrateClientSide || import_app_data8.BUILD.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
4085
+ if ((import_app_data10.BUILD.hydrateClientSide || import_app_data10.BUILD.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
4013
4086
  propValue = deserializeProperty(propValue);
4014
4087
  return propValue;
4015
4088
  }
4016
4089
  if (propValue != null && !isComplexType(propValue)) {
4017
- if (import_app_data8.BUILD.propBoolean && propType & 4 /* Boolean */) {
4018
- if (import_app_data8.BUILD.formAssociated && isFormAssociated && typeof propValue === "string") {
4090
+ if (import_app_data10.BUILD.propBoolean && propType & 4 /* Boolean */) {
4091
+ if (import_app_data10.BUILD.formAssociated && isFormAssociated && typeof propValue === "string") {
4019
4092
  return propValue === "" || !!propValue;
4020
4093
  } else {
4021
4094
  return propValue === "false" ? false : propValue === "" || !!propValue;
4022
4095
  }
4023
4096
  }
4024
- if (import_app_data8.BUILD.propNumber && propType & 2 /* Number */) {
4097
+ if (import_app_data10.BUILD.propNumber && propType & 2 /* Number */) {
4025
4098
  return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
4026
4099
  }
4027
- if (import_app_data8.BUILD.propString && propType & 1 /* String */) {
4100
+ if (import_app_data10.BUILD.propString && propType & 1 /* String */) {
4028
4101
  return String(propValue);
4029
4102
  }
4030
4103
  return propValue;
@@ -4035,39 +4108,6 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
4035
4108
  // src/runtime/update-component.ts
4036
4109
  var import_app_data14 = require("@stencil/core/internal/app-data");
4037
4110
 
4038
- // src/runtime/event-emitter.ts
4039
- var import_app_data10 = require("@stencil/core/internal/app-data");
4040
-
4041
- // src/runtime/element.ts
4042
- var import_app_data9 = require("@stencil/core/internal/app-data");
4043
- var getElement = (ref) => {
4044
- var _a;
4045
- return import_app_data9.BUILD.lazyLoad ? (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ : ref;
4046
- };
4047
-
4048
- // src/runtime/event-emitter.ts
4049
- var createEvent = (ref, name, flags) => {
4050
- const elm = getElement(ref);
4051
- return {
4052
- emit: (detail) => {
4053
- if (import_app_data10.BUILD.isDev && !elm.isConnected) {
4054
- consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
4055
- }
4056
- return emitEvent(elm, name, {
4057
- bubbles: !!(flags & 4 /* Bubbles */),
4058
- composed: !!(flags & 2 /* Composed */),
4059
- cancelable: !!(flags & 1 /* Cancellable */),
4060
- detail
4061
- });
4062
- }
4063
- };
4064
- };
4065
- var emitEvent = (elm, name, opts) => {
4066
- const ev = plt.ce(name, opts);
4067
- elm.dispatchEvent(ev);
4068
- return ev;
4069
- };
4070
-
4071
4111
  // src/runtime/vdom/vdom-render.ts
4072
4112
  var import_app_data13 = require("@stencil/core/internal/app-data");
4073
4113
 
@@ -5698,6 +5738,8 @@ var proxyCustomElement = (Cstr, compactMeta) => {
5698
5738
  patchTextContent(Cstr.prototype);
5699
5739
  }
5700
5740
  }
5741
+ } else if (import_app_data20.BUILD.cloneNodeFix) {
5742
+ patchCloneNode(Cstr.prototype);
5701
5743
  }
5702
5744
  if (import_app_data20.BUILD.hydrateClientSide && import_app_data20.BUILD.shadowDom) {
5703
5745
  hydrateScopedToShadow();
@@ -5850,10 +5892,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
5850
5892
  }
5851
5893
  const tagName = import_app_data21.BUILD.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : transformTag(cmpMeta.$tagName$);
5852
5894
  const HostElement = class extends HTMLElement {
5895
+ ["s-p"];
5896
+ ["s-rc"];
5897
+ hasRegisteredEventListeners = false;
5853
5898
  // StencilLazyHost
5854
5899
  constructor(self) {
5855
5900
  super(self);
5856
- this.hasRegisteredEventListeners = false;
5857
5901
  self = this;
5858
5902
  registerHost(self, cmpMeta);
5859
5903
  if (import_app_data21.BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
@@ -5930,6 +5974,8 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
5930
5974
  patchTextContent(HostElement.prototype);
5931
5975
  }
5932
5976
  }
5977
+ } else if (import_app_data21.BUILD.cloneNodeFix) {
5978
+ patchCloneNode(HostElement.prototype);
5933
5979
  }
5934
5980
  if (import_app_data21.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
5935
5981
  HostElement.formAssociated = true;