@geotrekce/geotrek-rando-widget 0.0.10 → 0.0.13

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 (92) hide show
  1. package/dist/cjs/css-shim-6f592941.js +6 -0
  2. package/dist/cjs/dom-d5e52c7e.js +75 -0
  3. package/dist/cjs/geotrek-rando-widget.cjs.js +73 -6
  4. package/dist/cjs/grw-app.cjs.entry.js +14 -12
  5. package/dist/cjs/grw-filter_6.cjs.entry.js +17 -13
  6. package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +11 -6
  7. package/dist/cjs/grw-trek-card.cjs.entry.js +3 -3
  8. package/dist/cjs/{index-4c76daa3.js → index-66d58516.js} +90 -7
  9. package/dist/cjs/loader.cjs.js +16 -2
  10. package/dist/cjs/shadow-css-cf936b02.js +389 -0
  11. package/dist/cjs/{store-b4c3c507.js → store-d301af22.js} +13 -5
  12. package/dist/collection/collection-manifest.json +1 -1
  13. package/dist/collection/components/grw-app/grw-app.js +12 -10
  14. package/dist/collection/components/grw-map/grw-map.js +4 -3
  15. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +1 -1
  16. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +6 -1
  17. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +1 -1
  18. package/dist/collection/store/grw-trek-provider.js +6 -3
  19. package/dist/collection/store/store.js +1 -0
  20. package/dist/components/grw-app.js +12 -10
  21. package/dist/components/grw-filter2.js +1 -1
  22. package/dist/components/grw-information-desk-detail2.js +1 -1
  23. package/dist/components/grw-map2.js +5 -4
  24. package/dist/components/grw-poi-detail2.js +1 -1
  25. package/dist/components/grw-sensitive-area-detail2.js +7 -2
  26. package/dist/components/grw-trek-card2.js +1 -1
  27. package/dist/components/grw-trek-detail2.js +2 -2
  28. package/dist/components/grw-trek-provider2.js +6 -3
  29. package/dist/components/grw-treks-list2.js +1 -1
  30. package/dist/components/index.d.ts +11 -5
  31. package/dist/components/index.js +11 -0
  32. package/dist/components/store.js +12 -4
  33. package/dist/esm/css-shim-2d0a698c.js +4 -0
  34. package/dist/esm/dom-9794f747.js +73 -0
  35. package/dist/esm/geotrek-rando-widget.js +73 -6
  36. package/dist/esm/grw-app.entry.js +14 -12
  37. package/dist/esm/grw-filter_6.entry.js +17 -13
  38. package/dist/esm/grw-information-desk-detail_3.entry.js +11 -6
  39. package/dist/esm/grw-trek-card.entry.js +3 -3
  40. package/dist/esm/{index-ee473772.js → index-899307bb.js} +86 -8
  41. package/dist/esm/loader.js +16 -2
  42. package/dist/esm/shadow-css-4cd4480f.js +387 -0
  43. package/dist/esm/{store-a5f523fd.js → store-70461a28.js} +13 -5
  44. package/dist/esm-es5/css-shim-2d0a698c.js +1 -0
  45. package/dist/esm-es5/dom-9794f747.js +21 -0
  46. package/dist/esm-es5/geotrek-rando-widget.js +1 -0
  47. package/dist/esm-es5/grw-app.entry.js +1 -0
  48. package/dist/esm-es5/grw-filter_6.entry.js +6 -0
  49. package/dist/esm-es5/grw-information-desk-detail_3.entry.js +1 -0
  50. package/dist/esm-es5/grw-trek-card.entry.js +1 -0
  51. package/dist/esm-es5/index-899307bb.js +2 -0
  52. package/dist/esm-es5/index.js +0 -0
  53. package/dist/esm-es5/length-d82189db.js +1 -0
  54. package/dist/esm-es5/loader.js +1 -0
  55. package/dist/esm-es5/shadow-css-4cd4480f.js +12 -0
  56. package/dist/esm-es5/store-70461a28.js +1 -0
  57. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  58. package/dist/geotrek-rando-widget/geotrek-rando-widget.js +133 -0
  59. package/dist/geotrek-rando-widget/p-067c02c4.system.js +1 -0
  60. package/dist/geotrek-rando-widget/p-0c5b047c.js +1 -0
  61. package/dist/geotrek-rando-widget/p-18038011.js +1 -0
  62. package/dist/geotrek-rando-widget/p-2712caa8.system.entry.js +6 -0
  63. package/dist/geotrek-rando-widget/p-2bd0278f.system.entry.js +1 -0
  64. package/dist/geotrek-rando-widget/p-32d97a4f.system.js +1 -0
  65. package/dist/geotrek-rando-widget/p-3ed52659.entry.js +1 -0
  66. package/dist/geotrek-rando-widget/p-4690907e.js +2 -0
  67. package/dist/geotrek-rando-widget/p-48d5dde7.entry.js +1 -0
  68. package/dist/geotrek-rando-widget/p-4eaf20b7.js +12 -0
  69. package/dist/geotrek-rando-widget/p-50ea2036.system.js +1 -0
  70. package/dist/geotrek-rando-widget/p-533fc2bb.entry.js +1 -0
  71. package/dist/geotrek-rando-widget/p-82ca029f.system.js +1 -0
  72. package/dist/geotrek-rando-widget/p-8f9914f4.system.js +2 -0
  73. package/dist/geotrek-rando-widget/p-a99db140.system.js +1 -0
  74. package/dist/geotrek-rando-widget/p-b1530d9c.system.js +13 -0
  75. package/dist/geotrek-rando-widget/p-c8c96517.system.js +21 -0
  76. package/dist/geotrek-rando-widget/p-d1582cff.js +19 -0
  77. package/dist/geotrek-rando-widget/p-e1431f36.system.entry.js +1 -0
  78. package/dist/geotrek-rando-widget/p-e38f4ff4.system.entry.js +1 -0
  79. package/dist/geotrek-rando-widget/p-f5d98aae.entry.js +1 -0
  80. package/dist/index.js +1 -1
  81. package/dist/types/components/grw-app/grw-app.d.ts +1 -0
  82. package/dist/types/store/grw-trek-provider.d.ts +0 -1
  83. package/dist/types/store/store.d.ts +3 -1
  84. package/dist/types/types/types.d.ts +6 -5
  85. package/loader/index.js +1 -1
  86. package/package.json +12 -12
  87. package/dist/geotrek-rando-widget/p-0510e16b.entry.js +0 -1
  88. package/dist/geotrek-rando-widget/p-22562f4d.js +0 -1
  89. package/dist/geotrek-rando-widget/p-34fbbb97.entry.js +0 -1
  90. package/dist/geotrek-rando-widget/p-500436f1.entry.js +0 -1
  91. package/dist/geotrek-rando-widget/p-94f0db4d.entry.js +0 -1
  92. package/dist/geotrek-rando-widget/p-b62909db.js +0 -2
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-4c76daa3.js');
6
- const store = require('./store-b4c3c507.js');
5
+ const index = require('./index-66d58516.js');
6
+ const store = require('./store-d301af22.js');
7
7
 
8
- const grwInformationDeskDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.information-desk-img{width:180px}.information-desk-img img{width:180px;border-radius:8px}.information-desk-sub-container{display:flex;flex-direction:column}.information-desk-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.information-desk-description{font-size:16px}";
8
+ const grwInformationDeskDetailCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host a{color:var(--color-primary)}.information-desk-img{width:180px}.information-desk-img img{width:180px;border-radius:8px}.information-desk-sub-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.information-desk-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.information-desk-description{font-size:16px}";
9
9
 
10
10
  const GrwInformationDeskDetail = class {
11
11
  constructor(hostRef) {
@@ -19,7 +19,7 @@ const GrwInformationDeskDetail = class {
19
19
  };
20
20
  GrwInformationDeskDetail.style = grwInformationDeskDetailCss;
21
21
 
22
- const grwPoiDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.poi-img{width:180px}.poi-img img{width:180px;border-radius:8px}.poi-sub-container{display:flex;flex-direction:column}.poi-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.poi-description{font-size:16px}";
22
+ const grwPoiDetailCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host a{color:var(--color-primary)}.poi-img{width:180px}.poi-img img{width:180px;border-radius:8px}.poi-sub-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.poi-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.poi-description{font-size:16px}";
23
23
 
24
24
  const GrwPoiDetail = class {
25
25
  constructor(hostRef) {
@@ -31,14 +31,19 @@ const GrwPoiDetail = class {
31
31
  };
32
32
  GrwPoiDetail.style = grwPoiDetailCss;
33
33
 
34
- const grwSensitiveAreaDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.sensitive-area-title{color:var(--color-primary);font-size:24px;padding:12px 0px;font-weight:bold}.sensitive-area-description{font-size:16px}.sensitive-area-period-container .sensitive-area-period-title,.sensitive-area-period-container .sensitive-area-practice-title,.sensitive-area-period-container .sensitive-area-contact-title,.sensitive-area-practice-container .sensitive-area-period-title,.sensitive-area-practice-container .sensitive-area-practice-title,.sensitive-area-practice-container .sensitive-area-contact-title,.sensitive-area-contact-container .sensitive-area-period-title,.sensitive-area-contact-container .sensitive-area-practice-title,.sensitive-area-contact-container .sensitive-area-contact-title{color:var(--color-primary);font-size:24px;padding:12px 0px}.sensitive-area-period-container .sensitive-area-period-values,.sensitive-area-period-container .sensitive-area-practice-values,.sensitive-area-practice-container .sensitive-area-period-values,.sensitive-area-practice-container .sensitive-area-practice-values,.sensitive-area-contact-container .sensitive-area-period-values,.sensitive-area-contact-container .sensitive-area-practice-values{display:flex}";
34
+ const grwSensitiveAreaDetailCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host a{color:var(--color-primary)}.sensitive-area-title{color:var(--color-primary);font-size:24px;padding:12px 0px;font-weight:bold}.sensitive-area-description{font-size:16px}.sensitive-area-period-container .sensitive-area-period-title,.sensitive-area-period-container .sensitive-area-practice-title,.sensitive-area-period-container .sensitive-area-contact-title,.sensitive-area-practice-container .sensitive-area-period-title,.sensitive-area-practice-container .sensitive-area-practice-title,.sensitive-area-practice-container .sensitive-area-contact-title,.sensitive-area-contact-container .sensitive-area-period-title,.sensitive-area-contact-container .sensitive-area-practice-title,.sensitive-area-contact-container .sensitive-area-contact-title{color:var(--color-primary);font-size:24px;padding:12px 0px}.sensitive-area-period-container .sensitive-area-period-values,.sensitive-area-period-container .sensitive-area-practice-values,.sensitive-area-practice-container .sensitive-area-period-values,.sensitive-area-practice-container .sensitive-area-practice-values,.sensitive-area-contact-container .sensitive-area-period-values,.sensitive-area-contact-container .sensitive-area-practice-values{display:-ms-flexbox;display:flex}";
35
35
 
36
36
  const GrwSensitiveAreaDetail = class {
37
37
  constructor(hostRef) {
38
38
  index.registerInstance(this, hostRef);
39
39
  }
40
40
  render() {
41
- return (index.h(index.Host, null, index.h("div", { class: "sensitive-area-title" }, this.sensitiveArea.name), index.h("div", { class: "sensitive-area-description", innerHTML: this.sensitiveArea.description }), this.sensitiveArea.practices && this.sensitiveArea.practices.length > 0 && (index.h("div", { class: "sensitive-area-practice-container" }, index.h("div", { class: "sensitive-area-practice-title" }, "Domaines d'activit\u00E9s concern\u00E9s :"), index.h("div", { class: "sensitive-area-practice-values" }, this.sensitiveArea.practices.map((practice, index$1) => (index.h("div", { innerHTML: `${store.state.practices.find(statePractice => statePractice.id === practice).name.toUpperCase()}${index$1 + 1 !== this.sensitiveArea.practices.length ? ' - ' : ''}` })))))), this.sensitiveArea.period && this.sensitiveArea.period.length > 0 && (index.h("div", { class: "sensitive-area-period-container" }, index.h("div", { class: "sensitive-area-period-title" }, "P\u00E9riodes de sensibilit\u00E9"), index.h("div", { class: "sensitive-area-period-values" }, this.sensitiveArea.period.map((month, index$1) => {
41
+ return (index.h(index.Host, null, index.h("div", { class: "sensitive-area-title" }, this.sensitiveArea.name), index.h("div", { class: "sensitive-area-description", innerHTML: this.sensitiveArea.description }), this.sensitiveArea.practices && this.sensitiveArea.practices.length > 0 && (index.h("div", { class: "sensitive-area-practice-container" }, index.h("div", { class: "sensitive-area-practice-title" }, "Domaines d'activit\u00E9s concern\u00E9s :"), index.h("div", { class: "sensitive-area-practice-values" }, this.sensitiveArea.practices.map((sensitiveAreaPractice, index$1) => {
42
+ const practice = store.state.practices.find(statePractice => statePractice.id === sensitiveAreaPractice);
43
+ if (practice) {
44
+ return index.h("div", { innerHTML: `${practice.name.toUpperCase()}${index$1 + 1 !== this.sensitiveArea.practices.length ? ' - ' : ''}` });
45
+ }
46
+ })))), this.sensitiveArea.period && this.sensitiveArea.period.length > 0 && (index.h("div", { class: "sensitive-area-period-container" }, index.h("div", { class: "sensitive-area-period-title" }, "P\u00E9riodes de sensibilit\u00E9"), index.h("div", { class: "sensitive-area-period-values" }, this.sensitiveArea.period.map((month, index$1) => {
42
47
  if (month) {
43
48
  return (index.h("div", { innerHTML: `${new Date(0, index$1 + 1, 0).toLocaleDateString('fr', { month: 'long' }).toUpperCase()}${this.sensitiveArea.period.slice(index$1 + 1).find(month => month) ? ' - ' : ''}` }));
44
49
  }
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-4c76daa3.js');
6
- const store = require('./store-b4c3c507.js');
5
+ const index = require('./index-66d58516.js');
6
+ const store = require('./store-d301af22.js');
7
7
  const length = require('./length-d315d156.js');
8
8
 
9
- const grwTrekCardCss = ".trek-card-container,.trek-card-large-view-container{font-family:\"Roboto\";border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image,.trek-card-large-view-container .image{object-fit:cover}.trek-card-container .sub-container,.trek-card-large-view-container .sub-container{display:flex;flex-direction:column;justify-content:center;padding:12px}.trek-card-container .sub-container .name,.trek-card-large-view-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:8px}.trek-card-container .sub-container .departure,.trek-card-large-view-container .sub-container .departure{color:rgba(0, 0, 0, 0.7);font-size:16px;margin:4px 0px}.trek-card-container .sub-container .themes-container,.trek-card-large-view-container .sub-container .themes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .themes-container .theme,.trek-card-large-view-container .sub-container .themes-container .theme{background-color:var(--color-primary-tint);color:#ffffff;border-radius:8px;padding:8px;margin:0px 8px 8px 0px}.trek-card-container .sub-container .icons-labels-container,.trek-card-large-view-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row,.trek-card-large-view-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child),.trek-card-large-view-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label{display:flex;align-items:center;width:50%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2),.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:8px}.trek-card-container .sub-container .icons-labels-container .row .practice img,.trek-card-large-view-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-card-container{width:350px;height:auto}.trek-card-container .image{width:100%}.trek-card-large-view-container{height:auto;display:flex;flex-direction:row}.trek-card-large-view-container .image{width:250px}";
9
+ const grwTrekCardCss = ".trek-card-container,.trek-card-large-view-container{font-family:\"Roboto\";border-radius:8px;-webkit-box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image,.trek-card-large-view-container .image{-o-object-fit:cover;object-fit:cover}.trek-card-container .sub-container,.trek-card-large-view-container .sub-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;padding:12px}.trek-card-container .sub-container .name,.trek-card-large-view-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:8px}.trek-card-container .sub-container .departure,.trek-card-large-view-container .sub-container .departure{color:rgba(0, 0, 0, 0.7);font-size:16px;margin:4px 0px}.trek-card-container .sub-container .themes-container,.trek-card-large-view-container .sub-container .themes-container{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.trek-card-container .sub-container .themes-container .theme,.trek-card-large-view-container .sub-container .themes-container .theme{background-color:var(--color-primary-tint);color:#ffffff;border-radius:8px;padding:8px;margin:0px 8px 8px 0px}.trek-card-container .sub-container .icons-labels-container,.trek-card-large-view-container .sub-container .icons-labels-container{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row,.trek-card-large-view-container .sub-container .icons-labels-container .row{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child),.trek-card-large-view-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:50%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2),.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:8px}.trek-card-container .sub-container .icons-labels-container .row .practice img,.trek-card-large-view-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-card-container{width:350px;height:auto}.trek-card-container .image{width:100%}.trek-card-large-view-container{height:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.trek-card-large-view-container .image{width:250px}";
10
10
 
11
11
  const GrwTrekCard = class {
12
12
  constructor(hostRef) {
@@ -28,6 +28,7 @@ let isSvgMode = false;
28
28
  let renderingRef = null;
29
29
  let queuePending = false;
30
30
  const win = typeof window !== 'undefined' ? window : {};
31
+ const CSS = win.CSS ;
31
32
  const doc = win.document || { head: {} };
32
33
  const plt = {
33
34
  $flags$: 0,
@@ -38,11 +39,13 @@ const plt = {
38
39
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
39
40
  ce: (eventName, opts) => new CustomEvent(eventName, opts),
40
41
  };
42
+ const supportsShadow = /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
43
+ ;
41
44
  const promiseResolve = (v) => Promise.resolve(v);
42
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
45
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
43
46
  try {
44
47
  new CSSStyleSheet();
45
- return typeof new CSSStyleSheet().replace === 'function';
48
+ return typeof new CSSStyleSheet().replaceSync === 'function';
46
49
  }
47
50
  catch (e) { }
48
51
  return false;
@@ -100,9 +103,14 @@ const uniqueTime = (key, measureText) => {
100
103
  const rootAppliedStyles = new WeakMap();
101
104
  const registerStyle = (scopeId, cssText, allowCS) => {
102
105
  let style = styles.get(scopeId);
103
- if (supportsConstructibleStylesheets && allowCS) {
106
+ if (supportsConstructableStylesheets && allowCS) {
104
107
  style = (style || new CSSStyleSheet());
105
- style.replace(cssText);
108
+ if (typeof style === 'string') {
109
+ style = cssText;
110
+ }
111
+ else {
112
+ style.replaceSync(cssText);
113
+ }
106
114
  }
107
115
  else {
108
116
  style = cssText;
@@ -125,7 +133,18 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
125
133
  }
126
134
  if (!appliedStyles.has(scopeId)) {
127
135
  {
128
- {
136
+ if (plt.$cssShim$) {
137
+ styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */));
138
+ const newScopeId = styleElm['s-sc'];
139
+ if (newScopeId) {
140
+ scopeId = newScopeId;
141
+ // we don't want to add this styleID to the appliedStyles Set
142
+ // since the cssVarShim might need to apply several different
143
+ // stylesheets for the same component
144
+ appliedStyles = null;
145
+ }
146
+ }
147
+ else {
129
148
  styleElm = doc.createElement('style');
130
149
  styleElm.innerHTML = style;
131
150
  }
@@ -147,7 +166,7 @@ const attachStyles = (hostRef) => {
147
166
  const elm = hostRef.$hostElement$;
148
167
  const flags = cmpMeta.$flags$;
149
168
  const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
150
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
169
+ const scopeId = addStyle(supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
151
170
  if (flags & 10 /* needsScopedEncapsulation */) {
152
171
  // only required when we're NOT using native shadow dom (slot)
153
172
  // or this browser doesn't support native shadow dom
@@ -681,6 +700,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
681
700
  hostRef.$queuedListeners$ = null;
682
701
  }
683
702
  }
703
+ {
704
+ promise = safeCall(instance, 'componentWillLoad');
705
+ }
684
706
  }
685
707
  endSchedule();
686
708
  return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
@@ -698,6 +720,9 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
698
720
  {
699
721
  callRender(hostRef, instance);
700
722
  }
723
+ if (plt.$cssShim$) {
724
+ plt.$cssShim$.updateHost(elm);
725
+ }
701
726
  if (rc) {
702
727
  // ok, so turns out there are some child host elements
703
728
  // waiting on this parent element to load
@@ -1066,6 +1091,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1066
1091
  const scopeId = getScopeId(cmpMeta);
1067
1092
  if (!styles.has(scopeId)) {
1068
1093
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1094
+ if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
1095
+ style = await Promise.resolve().then(function () { return require('./shadow-css-cf936b02.js'); }).then((m) => m.scopeCss(style, scopeId, false));
1096
+ }
1069
1097
  registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1070
1098
  endRegisterStyles();
1071
1099
  }
@@ -1151,11 +1179,52 @@ const disconnectedCallback = (elm) => {
1151
1179
  hostRef.$rmListeners$ = undefined;
1152
1180
  }
1153
1181
  }
1182
+ // clear CSS var-shim tracking
1183
+ if (plt.$cssShim$) {
1184
+ plt.$cssShim$.removeHost(elm);
1185
+ }
1154
1186
  {
1155
1187
  safeCall(instance, 'disconnectedCallback');
1156
1188
  }
1157
1189
  }
1158
1190
  };
1191
+ const patchChildSlotNodes = (elm, cmpMeta) => {
1192
+ class FakeNodeList extends Array {
1193
+ item(n) {
1194
+ return this[n];
1195
+ }
1196
+ }
1197
+ if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
1198
+ const childNodesFn = elm.__lookupGetter__('childNodes');
1199
+ Object.defineProperty(elm, 'children', {
1200
+ get() {
1201
+ return this.childNodes.map((n) => n.nodeType === 1);
1202
+ },
1203
+ });
1204
+ Object.defineProperty(elm, 'childElementCount', {
1205
+ get() {
1206
+ return elm.children.length;
1207
+ },
1208
+ });
1209
+ Object.defineProperty(elm, 'childNodes', {
1210
+ get() {
1211
+ const childNodes = childNodesFn.call(this);
1212
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 &&
1213
+ getHostRef(this).$flags$ & 2 /* hasRendered */) {
1214
+ const result = new FakeNodeList();
1215
+ for (let i = 0; i < childNodes.length; i++) {
1216
+ const slot = childNodes[i]['s-nr'];
1217
+ if (slot) {
1218
+ result.push(slot);
1219
+ }
1220
+ }
1221
+ return result;
1222
+ }
1223
+ return FakeNodeList.from(childNodes);
1224
+ },
1225
+ });
1226
+ }
1227
+ };
1159
1228
  const bootstrapLazy = (lazyBundles, options = {}) => {
1160
1229
  const endBootstrap = createTime();
1161
1230
  const cmpTags = [];
@@ -1186,6 +1255,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1186
1255
  {
1187
1256
  cmpMeta.$watchers$ = {};
1188
1257
  }
1258
+ if (!supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1259
+ cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
1260
+ }
1189
1261
  const tagName = cmpMeta.$tagName$;
1190
1262
  const HostElement = class extends HTMLElement {
1191
1263
  // StencilLazyHost
@@ -1199,11 +1271,17 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1199
1271
  // and this browser supports shadow dom
1200
1272
  // add the read-only property "shadowRoot" to the host element
1201
1273
  // adding the shadow root build conditionals to minimize runtime
1202
- {
1274
+ if (supportsShadow) {
1203
1275
  {
1204
1276
  self.attachShadow({ mode: 'open' });
1205
1277
  }
1206
1278
  }
1279
+ else if (!('shadowRoot' in self)) {
1280
+ self.shadowRoot = self;
1281
+ }
1282
+ }
1283
+ {
1284
+ patchChildSlotNodes(self, cmpMeta);
1207
1285
  }
1208
1286
  }
1209
1287
  connectedCallback() {
@@ -1337,12 +1415,17 @@ const flush = () => {
1337
1415
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1338
1416
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1339
1417
 
1418
+ exports.CSS = CSS;
1340
1419
  exports.Host = Host;
1420
+ exports.NAMESPACE = NAMESPACE;
1341
1421
  exports.bootstrapLazy = bootstrapLazy;
1342
1422
  exports.createEvent = createEvent;
1423
+ exports.doc = doc;
1343
1424
  exports.forceUpdate = forceUpdate;
1344
1425
  exports.getElement = getElement;
1345
1426
  exports.getRenderingRef = getRenderingRef;
1346
1427
  exports.h = h;
1428
+ exports.plt = plt;
1347
1429
  exports.promiseResolve = promiseResolve;
1348
1430
  exports.registerInstance = registerInstance;
1431
+ exports.win = win;
@@ -2,12 +2,26 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-4c76daa3.js');
5
+ const index = require('./index-66d58516.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.16.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.17.4 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
+ // NOTE!! This fn cannot use async/await!
12
+ // @ts-ignore
13
+ if (!(index.CSS && index.CSS.supports && index.CSS.supports('color', 'var(--c)'))) {
14
+ // @ts-ignore
15
+ return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-css-shim" */ './css-shim-6f592941.js'); }).then(() => {
16
+ if ((index.plt.$cssShim$ = index.win.__cssshim)) {
17
+ return index.plt.$cssShim$.i();
18
+ }
19
+ else {
20
+ // for better minification
21
+ return 0;
22
+ }
23
+ });
24
+ }
11
25
  return index.promiseResolve();
12
26
  };
13
27