le-kit 0.1.4 → 0.1.5

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 (198) hide show
  1. package/dist/le-kit/assets/custom-elements.json +4305 -0
  2. package/dist/le-kit/index-Da-89pOc.js +4522 -0
  3. package/dist/le-kit/{index-D21JjI31.js.map → index-Da-89pOc.js.map} +1 -1
  4. package/dist/le-kit/index.esm.js +116 -2
  5. package/dist/le-kit/index.esm.js.map +1 -1
  6. package/dist/{esm → le-kit}/le-box.entry.js +3 -3
  7. package/dist/le-kit/le-button.entry.esm.js.map +1 -0
  8. package/dist/le-kit/le-button.entry.js +90 -0
  9. package/dist/{esm → le-kit}/le-card.entry.js +3 -3
  10. package/dist/le-kit/le-checkbox.entry.esm.js.map +1 -0
  11. package/dist/le-kit/le-checkbox.entry.js +59 -0
  12. package/dist/le-kit/le-component.entry.esm.js.map +1 -0
  13. package/dist/{collection/components/le-component/le-component.js → le-kit/le-component.entry.js} +19 -134
  14. package/dist/le-kit/le-kit.css +1010 -1
  15. package/dist/le-kit/le-kit.esm.js +48 -2
  16. package/dist/le-kit/le-kit.esm.js.map +1 -1
  17. package/dist/{esm → le-kit}/le-number-input.entry.js +5 -5
  18. package/dist/le-kit/le-popover.entry.esm.js.map +1 -0
  19. package/dist/{components/le-popover2.js → le-kit/le-popover.entry.js} +9 -45
  20. package/dist/{esm → le-kit}/le-popup.entry.js +6 -6
  21. package/dist/{esm → le-kit}/le-round-progress.entry.js +2 -2
  22. package/dist/le-kit/le-slot.entry.esm.js.map +1 -0
  23. package/dist/{collection/components/le-slot/le-slot.js → le-kit/le-slot.entry.js} +30 -279
  24. package/dist/{esm → le-kit}/le-stack.entry.js +3 -3
  25. package/dist/le-kit/le-string-input.entry.esm.js.map +1 -0
  26. package/dist/le-kit/le-string-input.entry.js +93 -0
  27. package/dist/{esm → le-kit}/le-text.entry.js +3 -3
  28. package/dist/{esm → le-kit}/le-turntable.entry.js +2 -2
  29. package/dist/{esm/utils-CJLZrrdC.js → le-kit/utils-FDOApZ53.js} +3 -3
  30. package/dist/le-kit/{utils-apol-Xc_.js.map → utils-FDOApZ53.js.map} +1 -1
  31. package/package.json +1 -1
  32. package/dist/cjs/index-CO4npcak.js +0 -1796
  33. package/dist/cjs/index-CO4npcak.js.map +0 -1
  34. package/dist/cjs/index.cjs.js +0 -117
  35. package/dist/cjs/index.cjs.js.map +0 -1
  36. package/dist/cjs/le-box.cjs.entry.js +0 -184
  37. package/dist/cjs/le-box.entry.cjs.js.map +0 -1
  38. package/dist/cjs/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.cjs.js.map +0 -1
  39. package/dist/cjs/le-button_6.cjs.entry.js +0 -1199
  40. package/dist/cjs/le-card.cjs.entry.js +0 -29
  41. package/dist/cjs/le-card.entry.cjs.js.map +0 -1
  42. package/dist/cjs/le-kit.cjs.js +0 -25
  43. package/dist/cjs/le-kit.cjs.js.map +0 -1
  44. package/dist/cjs/le-number-input.cjs.entry.js +0 -202
  45. package/dist/cjs/le-number-input.entry.cjs.js.map +0 -1
  46. package/dist/cjs/le-popup.cjs.entry.js +0 -212
  47. package/dist/cjs/le-popup.entry.cjs.js.map +0 -1
  48. package/dist/cjs/le-round-progress.cjs.entry.js +0 -106
  49. package/dist/cjs/le-round-progress.entry.cjs.js.map +0 -1
  50. package/dist/cjs/le-stack.cjs.entry.js +0 -135
  51. package/dist/cjs/le-stack.entry.cjs.js.map +0 -1
  52. package/dist/cjs/le-text.cjs.entry.js +0 -335
  53. package/dist/cjs/le-text.entry.cjs.js.map +0 -1
  54. package/dist/cjs/le-turntable.cjs.entry.js +0 -139
  55. package/dist/cjs/le-turntable.entry.cjs.js.map +0 -1
  56. package/dist/cjs/loader.cjs.js +0 -13
  57. package/dist/cjs/loader.cjs.js.map +0 -1
  58. package/dist/cjs/utils-BeT0iyCQ.js +0 -152
  59. package/dist/cjs/utils-BeT0iyCQ.js.map +0 -1
  60. package/dist/collection/collection-manifest.json +0 -26
  61. package/dist/collection/components/le-box/le-box.default.css +0 -37
  62. package/dist/collection/components/le-box/le-box.js +0 -614
  63. package/dist/collection/components/le-box/le-box.js.map +0 -1
  64. package/dist/collection/components/le-button/le-button.default.css +0 -263
  65. package/dist/collection/components/le-button/le-button.js +0 -368
  66. package/dist/collection/components/le-button/le-button.js.map +0 -1
  67. package/dist/collection/components/le-card/le-card.default.css +0 -74
  68. package/dist/collection/components/le-card/le-card.js +0 -102
  69. package/dist/collection/components/le-card/le-card.js.map +0 -1
  70. package/dist/collection/components/le-checkbox/le-checkbox.css +0 -93
  71. package/dist/collection/components/le-checkbox/le-checkbox.js +0 -192
  72. package/dist/collection/components/le-checkbox/le-checkbox.js.map +0 -1
  73. package/dist/collection/components/le-component/le-component.css +0 -189
  74. package/dist/collection/components/le-component/le-component.js.map +0 -1
  75. package/dist/collection/components/le-number-input/le-number-input.css +0 -135
  76. package/dist/collection/components/le-number-input/le-number-input.js +0 -515
  77. package/dist/collection/components/le-number-input/le-number-input.js.map +0 -1
  78. package/dist/collection/components/le-popover/le-popover.css +0 -143
  79. package/dist/collection/components/le-popover/le-popover.js +0 -693
  80. package/dist/collection/components/le-popover/le-popover.js.map +0 -1
  81. package/dist/collection/components/le-popup/le-popup.api.js +0 -101
  82. package/dist/collection/components/le-popup/le-popup.api.js.map +0 -1
  83. package/dist/collection/components/le-popup/le-popup.css +0 -222
  84. package/dist/collection/components/le-popup/le-popup.js +0 -596
  85. package/dist/collection/components/le-popup/le-popup.js.map +0 -1
  86. package/dist/collection/components/le-round-progress/le-round-progress.css +0 -34
  87. package/dist/collection/components/le-round-progress/le-round-progress.js +0 -184
  88. package/dist/collection/components/le-round-progress/le-round-progress.js.map +0 -1
  89. package/dist/collection/components/le-slot/le-slot.default.css +0 -222
  90. package/dist/collection/components/le-slot/le-slot.js.map +0 -1
  91. package/dist/collection/components/le-stack/le-stack.default.css +0 -37
  92. package/dist/collection/components/le-stack/le-stack.js +0 -389
  93. package/dist/collection/components/le-stack/le-stack.js.map +0 -1
  94. package/dist/collection/components/le-string-input/le-string-input.css +0 -83
  95. package/dist/collection/components/le-string-input/le-string-input.js +0 -359
  96. package/dist/collection/components/le-string-input/le-string-input.js.map +0 -1
  97. package/dist/collection/components/le-text/le-text.default.css +0 -169
  98. package/dist/collection/components/le-text/le-text.js +0 -475
  99. package/dist/collection/components/le-text/le-text.js.map +0 -1
  100. package/dist/collection/components/le-turntable/le-turntable.css +0 -10
  101. package/dist/collection/components/le-turntable/le-turntable.js +0 -210
  102. package/dist/collection/components/le-turntable/le-turntable.js.map +0 -1
  103. package/dist/collection/global/app.js +0 -130
  104. package/dist/collection/global/app.js.map +0 -1
  105. package/dist/collection/index.js +0 -15
  106. package/dist/collection/index.js.map +0 -1
  107. package/dist/collection/types/blocks.js +0 -115
  108. package/dist/collection/types/blocks.js.map +0 -1
  109. package/dist/collection/types/options.js +0 -2
  110. package/dist/collection/types/options.js.map +0 -1
  111. package/dist/collection/utils/utils.js +0 -141
  112. package/dist/collection/utils/utils.js.map +0 -1
  113. package/dist/components/index.js +0 -127
  114. package/dist/components/index.js.map +0 -1
  115. package/dist/components/le-box.js +0 -256
  116. package/dist/components/le-box.js.map +0 -1
  117. package/dist/components/le-button.js +0 -9
  118. package/dist/components/le-button.js.map +0 -1
  119. package/dist/components/le-button2.js +0 -1408
  120. package/dist/components/le-button2.js.map +0 -1
  121. package/dist/components/le-card.js +0 -83
  122. package/dist/components/le-card.js.map +0 -1
  123. package/dist/components/le-checkbox.js +0 -9
  124. package/dist/components/le-checkbox.js.map +0 -1
  125. package/dist/components/le-component.js +0 -9
  126. package/dist/components/le-component.js.map +0 -1
  127. package/dist/components/le-number-input.js +0 -271
  128. package/dist/components/le-number-input.js.map +0 -1
  129. package/dist/components/le-popover.js +0 -9
  130. package/dist/components/le-popover.js.map +0 -1
  131. package/dist/components/le-popover2.js.map +0 -1
  132. package/dist/components/le-popup.js +0 -279
  133. package/dist/components/le-popup.js.map +0 -1
  134. package/dist/components/le-round-progress.js +0 -135
  135. package/dist/components/le-round-progress.js.map +0 -1
  136. package/dist/components/le-slot.js +0 -9
  137. package/dist/components/le-slot.js.map +0 -1
  138. package/dist/components/le-stack.js +0 -198
  139. package/dist/components/le-stack.js.map +0 -1
  140. package/dist/components/le-string-input.js +0 -9
  141. package/dist/components/le-string-input.js.map +0 -1
  142. package/dist/components/le-text.js +0 -398
  143. package/dist/components/le-text.js.map +0 -1
  144. package/dist/components/le-turntable.js +0 -164
  145. package/dist/components/le-turntable.js.map +0 -1
  146. package/dist/docs.d.ts +0 -443
  147. package/dist/docs.json +0 -5185
  148. package/dist/esm/index-D71TXvJa.js +0 -1781
  149. package/dist/esm/index-D71TXvJa.js.map +0 -1
  150. package/dist/esm/index.js +0 -106
  151. package/dist/esm/index.js.map +0 -1
  152. package/dist/esm/le-box.entry.js.map +0 -1
  153. package/dist/esm/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.js.map +0 -1
  154. package/dist/esm/le-button_6.entry.js +0 -1192
  155. package/dist/esm/le-card.entry.js.map +0 -1
  156. package/dist/esm/le-kit.js +0 -21
  157. package/dist/esm/le-kit.js.map +0 -1
  158. package/dist/esm/le-number-input.entry.js.map +0 -1
  159. package/dist/esm/le-popup.entry.js.map +0 -1
  160. package/dist/esm/le-round-progress.entry.js.map +0 -1
  161. package/dist/esm/le-stack.entry.js.map +0 -1
  162. package/dist/esm/le-text.entry.js.map +0 -1
  163. package/dist/esm/le-turntable.entry.js.map +0 -1
  164. package/dist/esm/loader.js +0 -11
  165. package/dist/esm/loader.js.map +0 -1
  166. package/dist/esm/utils-CJLZrrdC.js.map +0 -1
  167. package/dist/index.cjs.js +0 -1
  168. package/dist/index.js +0 -1
  169. package/dist/le-kit/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.esm.js.map +0 -1
  170. package/dist/le-kit/p-024a764e.entry.js +0 -2
  171. package/dist/le-kit/p-024a764e.entry.js.map +0 -1
  172. package/dist/le-kit/p-073cf0b9.entry.js +0 -2
  173. package/dist/le-kit/p-073cf0b9.entry.js.map +0 -1
  174. package/dist/le-kit/p-0955b105.entry.js +0 -2
  175. package/dist/le-kit/p-0955b105.entry.js.map +0 -1
  176. package/dist/le-kit/p-18d79ee2.entry.js +0 -2
  177. package/dist/le-kit/p-18d79ee2.entry.js.map +0 -1
  178. package/dist/le-kit/p-4b1d3b6d.entry.js +0 -2
  179. package/dist/le-kit/p-4b1d3b6d.entry.js.map +0 -1
  180. package/dist/le-kit/p-79d179bd.entry.js +0 -2
  181. package/dist/le-kit/p-79d179bd.entry.js.map +0 -1
  182. package/dist/le-kit/p-D71TXvJa.js +0 -3
  183. package/dist/le-kit/p-D71TXvJa.js.map +0 -1
  184. package/dist/le-kit/p-c8a9288e.entry.js +0 -2
  185. package/dist/le-kit/p-c8a9288e.entry.js.map +0 -1
  186. package/dist/le-kit/p-cfc35bd3.entry.js +0 -2
  187. package/dist/le-kit/p-cfc35bd3.entry.js.map +0 -1
  188. package/dist/le-kit/p-d04da1f5.entry.js +0 -2
  189. package/dist/le-kit/p-d04da1f5.entry.js.map +0 -1
  190. package/dist/le-kit/p-qIai5-eB.js +0 -2
  191. package/dist/le-kit/p-qIai5-eB.js.map +0 -1
  192. package/dist/themes/base.css +0 -89
  193. package/dist/themes/dark.css +0 -100
  194. package/dist/themes/default.css +0 -108
  195. package/dist/themes/gradient.css +0 -100
  196. package/dist/themes/index.css +0 -413
  197. package/dist/themes/minimal.css +0 -100
  198. package/dist/themes/warm.css +0 -100
@@ -1,1796 +0,0 @@
1
- 'use strict';
2
-
3
- const NAMESPACE = 'le-kit';
4
- const BUILD = /* le-kit */ { hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
5
-
6
- /**
7
- * Global mode initialization for le-kit components.
8
- *
9
- * Mode inheritance works as follows:
10
- * 1. Check the element's own `mode` attribute
11
- * 2. Traverse up the DOM to find a parent with `mode` attribute
12
- * 3. Check the document root element (html) for `mode` attribute
13
- * 4. Fall back to 'default'
14
- *
15
- * This allows setting mode at any level:
16
- * - `<html mode="admin">` - all components in admin mode
17
- * - `<le-card mode="admin">` - this card and its children in admin mode
18
- */
19
- function initializeMode() {
20
- }
21
- /**
22
- * Helper function to get the current mode for an element.
23
- * Can be used programmatically in components.
24
- *
25
- * This function traverses both regular DOM and shadow DOM boundaries
26
- * to find the nearest mode attribute.
27
- */
28
- function getMode(el) {
29
- // Check element's own mode
30
- const ownMode = el.getAttribute('mode');
31
- if (ownMode) {
32
- return ownMode;
33
- }
34
- // Traverse up DOM, crossing shadow boundaries
35
- let current = el;
36
- while (current) {
37
- // Try parent element first
38
- if (current instanceof Element && current.parentElement) {
39
- current = current.parentElement;
40
- const mode = current.getAttribute?.('mode');
41
- if (mode) {
42
- return mode;
43
- }
44
- }
45
- else {
46
- // No parent element - check if we're in a shadow root
47
- const root = current.getRootNode();
48
- if (root instanceof ShadowRoot) {
49
- // Cross the shadow boundary to the host element
50
- current = root.host;
51
- const mode = current.getAttribute?.('mode');
52
- if (mode) {
53
- return mode;
54
- }
55
- }
56
- else {
57
- // We've reached the document root
58
- break;
59
- }
60
- }
61
- }
62
- // Check document root
63
- const rootMode = document.documentElement.getAttribute('mode');
64
- if (rootMode) {
65
- return rootMode;
66
- }
67
- return 'default';
68
- }
69
- /**
70
- * Helper function to get the current theme for an element.
71
- * Theme inheritance works the same as mode - cascades through DOM.
72
- */
73
- function getTheme(el) {
74
- // Check element's own theme
75
- const ownTheme = el.getAttribute('theme');
76
- if (ownTheme) {
77
- return ownTheme;
78
- }
79
- // Traverse up DOM
80
- let parent = el.parentElement;
81
- while (parent) {
82
- const parentTheme = parent.getAttribute('theme');
83
- if (parentTheme) {
84
- return parentTheme;
85
- }
86
- parent = parent.parentElement;
87
- }
88
- // Check root
89
- const rootTheme = document.documentElement.getAttribute('theme');
90
- if (rootTheme) {
91
- return rootTheme;
92
- }
93
- return 'default';
94
- }
95
- /**
96
- * Helper function to set mode on the document root.
97
- * Useful for switching all components to admin mode.
98
- */
99
- function setGlobalMode(mode) {
100
- document.documentElement.setAttribute('mode', mode);
101
- }
102
- /**
103
- * Helper function to set theme on the document root.
104
- * Useful for switching all components to a different theme.
105
- */
106
- function setGlobalTheme(theme) {
107
- document.documentElement.setAttribute('theme', theme);
108
- }
109
-
110
- const globalScripts = initializeMode;
111
- const globalStyles = ":root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--le-spacing-0:0;--le-spacing-1:0.25rem;--le-spacing-2:0.5rem;--le-spacing-3:0.75rem;--le-spacing-4:1rem;--le-spacing-5:1.25rem;--le-spacing-6:1.5rem;--le-spacing-8:2rem;--le-spacing-10:2.5rem;--le-spacing-12:3rem;--le-spacing-16:4rem;--le-font-family-base:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;--le-font-family-mono:'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;--le-font-size-xs:0.75rem;--le-font-size-sm:0.875rem;--le-font-size-md:1rem;--le-font-size-lg:1.125rem;--le-font-size-xl:1.25rem;--le-font-size-2xl:1.5rem;--le-font-size-3xl:1.875rem;--le-font-size-4xl:2.25rem;--le-font-weight-normal:400;--le-font-weight-medium:500;--le-font-weight-semibold:600;--le-font-weight-bold:700;--le-line-height-tight:1.25;--le-line-height-normal:1.5;--le-line-height-relaxed:1.75;--le-radius-none:0;--le-radius-xs:0.066rem;--le-radius-sm:0.125rem;--le-radius-md:0.25rem;--le-radius-lg:0.5rem;--le-radius-xl:0.75rem;--le-radius-2xl:1rem;--le-radius-full:9999px;--le-transition-fast:100ms;--le-transition-normal:200ms;--le-transition-slow:300ms;--le-transition-easing:cubic-bezier(0.4, 0, 0.2, 1);--le-z-dropdown:1000;--le-z-sticky:1020;--le-z-fixed:1030;--le-z-modal-backdrop:1040;--le-z-modal:1050;--le-z-popover:1060;--le-z-tooltip:1070}:root,[theme=\"default\"]{--le-color-primary:#0088ff;--le-color-primary-light:#4da6ff;--le-color-primary-dark:#0066cc;--le-color-primary-contrast:#ffffff;--le-color-secondary:#6c757d;--le-color-secondary-light:#868e96;--le-color-secondary-dark:#545b62;--le-color-secondary-contrast:#ffffff;--le-color-success:#28a745;--le-color-success-light:#48c764;--le-color-success-dark:#1e7e34;--le-color-success-contrast:#ffffff;--le-color-warning:#ffc107;--le-color-warning-light:#ffcd39;--le-color-warning-dark:#d39e00;--le-color-warning-contrast:#212529;--le-color-danger:#dc3545;--le-color-danger-light:#e4606d;--le-color-danger-dark:#bd2130;--le-color-danger-contrast:#ffffff;--le-color-info:#17a2b8;--le-color-info-light:#3ab0c3;--le-color-info-dark:#117a8b;--le-color-info-contrast:#ffffff;--le-color-white:#ffffff;--le-color-black:#000000;--le-color-gray-50:#fafafa;--le-color-gray-100:#f5f5f5;--le-color-gray-200:#eeeeee;--le-color-gray-300:#e0e0e0;--le-color-gray-400:#bdbdbd;--le-color-gray-500:#9e9e9e;--le-color-gray-600:#757575;--le-color-gray-700:#616161;--le-color-gray-800:#424242;--le-color-gray-900:#212121;--le-color-background:#ffffff;--le-color-background-secondary:#f5f5f5;--le-color-background-tertiary:#eeeeee;--le-color-surface:#ffffff;--le-color-surface-elevated:#ffffff;--le-color-text-primary:#212121;--le-color-text-secondary:#757575;--le-color-text-disabled:#9e9e9e;--le-color-text-inverse:#ffffff;--le-color-border:#e0e0e0;--le-color-border-light:#eeeeee;--le-color-border-dark:#bdbdbd;--le-border-width:2px;--le-color-border-input:#c4d6e6;--le-color-focus:rgba(0, 136, 255, 0.5);--le-radius-none:0;--le-radius-sm:0.125rem;--le-radius-md:0.25rem;--le-radius-lg:0.5rem;--le-radius-xl:0.75rem;--le-radius-2xl:1rem;--le-radius-full:9999px;--le-shadow-none:none;--le-shadow-sm:0 1px 2px rgba(0, 0, 0, 0.05);--le-shadow-md:0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);--le-shadow-lg:0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);--le-shadow-xl:0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);--le-shadow-2xl:0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)}[theme=\"dark\"]{--le-color-primary:#4da6ff;--le-color-primary-light:#80c1ff;--le-color-primary-dark:#0088ff;--le-color-primary-contrast:#000000;--le-color-secondary:#868e96;--le-color-secondary-light:#adb5bd;--le-color-secondary-dark:#6c757d;--le-color-secondary-contrast:#000000;--le-color-success:#48c764;--le-color-success-light:#6dd587;--le-color-success-dark:#28a745;--le-color-success-contrast:#000000;--le-color-warning:#ffcd39;--le-color-warning-light:#ffda6a;--le-color-warning-dark:#ffc107;--le-color-warning-contrast:#000000;--le-color-danger:#e4606d;--le-color-danger-light:#ea868f;--le-color-danger-dark:#dc3545;--le-color-danger-contrast:#000000;--le-color-info:#3ab0c3;--le-color-info-light:#6dc4d3;--le-color-info-dark:#17a2b8;--le-color-info-contrast:#000000;--le-color-white:#ffffff;--le-color-black:#000000;--le-color-gray-50:#212121;--le-color-gray-100:#424242;--le-color-gray-200:#616161;--le-color-gray-300:#757575;--le-color-gray-400:#9e9e9e;--le-color-gray-500:#bdbdbd;--le-color-gray-600:#e0e0e0;--le-color-gray-700:#eeeeee;--le-color-gray-800:#f5f5f5;--le-color-gray-900:#fafafa;--le-color-background:#121212;--le-color-background-secondary:#1e1e1e;--le-color-background-tertiary:#2d2d2d;--le-color-surface:#1e1e1e;--le-color-surface-elevated:#2d2d2d;--le-color-text-primary:#ffffff;--le-color-text-secondary:#b3b3b3;--le-color-text-disabled:#666666;--le-color-text-inverse:#121212;--le-color-border:#333333;--le-color-border-light:#2d2d2d;--le-color-border-dark:#444444;--le-border-width:2px;--le-color-border-input:#515c6b;--le-color-focus:rgba(77, 166, 255, 0.5);--le-radius-none:0;--le-radius-sm:0.125rem;--le-radius-md:0.25rem;--le-radius-lg:0.5rem;--le-radius-xl:0.75rem;--le-radius-2xl:1rem;--le-radius-full:9999px;--le-shadow-none:none;--le-shadow-sm:0 1px 2px rgba(0, 0, 0, 0.3);--le-shadow-md:0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);--le-shadow-lg:0 4px 6px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);--le-shadow-xl:0 10px 15px rgba(0, 0, 0, 0.4), 0 4px 6px rgba(0, 0, 0, 0.3);--le-shadow-2xl:0 20px 25px rgba(0, 0, 0, 0.4), 0 10px 10px rgba(0, 0, 0, 0.3)}[theme=\"gradient\"]{--le-color-primary:#8b5cf6;--le-color-primary-light:#a78bfa;--le-color-primary-dark:#7c3aed;--le-color-primary-contrast:#ffffff;--le-color-secondary:#ec4899;--le-color-secondary-light:#f472b6;--le-color-secondary-dark:#db2777;--le-color-secondary-contrast:#ffffff;--le-color-success:#10b981;--le-color-success-light:#34d399;--le-color-success-dark:#059669;--le-color-success-contrast:#ffffff;--le-color-warning:#f59e0b;--le-color-warning-light:#fbbf24;--le-color-warning-dark:#d97706;--le-color-warning-contrast:#000000;--le-color-danger:#ef4444;--le-color-danger-light:#f87171;--le-color-danger-dark:#dc2626;--le-color-danger-contrast:#ffffff;--le-color-info:#06b6d4;--le-color-info-light:#22d3ee;--le-color-info-dark:#0891b2;--le-color-info-contrast:#ffffff;--le-color-white:#ffffff;--le-color-black:#000000;--le-color-gray-50:#faf5ff;--le-color-gray-100:#f3e8ff;--le-color-gray-200:#e9d5ff;--le-color-gray-300:#d8b4fe;--le-color-gray-400:#c084fc;--le-color-gray-500:#a855f7;--le-color-gray-600:#9333ea;--le-color-gray-700:#7e22ce;--le-color-gray-800:#6b21a8;--le-color-gray-900:#581c87;--le-color-background:linear-gradient(135deg, #667eea 0%, #764ba2 100%);--le-color-background-secondary:rgba(255, 255, 255, 0.1);--le-color-background-tertiary:rgba(255, 255, 255, 0.05);--le-color-surface:rgba(255, 255, 255, 0.95);--le-color-surface-elevated:#ffffff;--le-color-text-primary:#1f2937;--le-color-text-secondary:#6b7280;--le-color-text-disabled:#9ca3af;--le-color-text-inverse:#ffffff;--le-color-border:rgba(139, 92, 246, 0.3);--le-color-border-light:rgba(139, 92, 246, 0.1);--le-color-border-dark:rgba(139, 92, 246, 0.5);--le-border-width:2px;--le-color-border-input:#eccddd;--le-color-focus:rgba(139, 92, 246, 0.5);--le-radius-none:0;--le-radius-sm:0.25rem;--le-radius-md:0.5rem;--le-radius-lg:1rem;--le-radius-xl:1.5rem;--le-radius-2xl:2rem;--le-radius-full:9999px;--le-shadow-none:none;--le-shadow-sm:0 1px 2px rgba(139, 92, 246, 0.1);--le-shadow-md:0 4px 6px rgba(139, 92, 246, 0.15), 0 2px 4px rgba(139, 92, 246, 0.1);--le-shadow-lg:0 10px 20px rgba(139, 92, 246, 0.2), 0 4px 8px rgba(139, 92, 246, 0.1);--le-shadow-xl:0 20px 40px rgba(139, 92, 246, 0.25), 0 8px 16px rgba(139, 92, 246, 0.15);--le-shadow-2xl:0 30px 60px rgba(139, 92, 246, 0.3), 0 15px 30px rgba(139, 92, 246, 0.2)}[theme=\"minimal\"]{--le-color-primary:#111827;--le-color-primary-light:#374151;--le-color-primary-dark:#030712;--le-color-primary-contrast:#ffffff;--le-color-secondary:#6b7280;--le-color-secondary-light:#9ca3af;--le-color-secondary-dark:#4b5563;--le-color-secondary-contrast:#ffffff;--le-color-success:#059669;--le-color-success-light:#10b981;--le-color-success-dark:#047857;--le-color-success-contrast:#ffffff;--le-color-warning:#d97706;--le-color-warning-light:#f59e0b;--le-color-warning-dark:#b45309;--le-color-warning-contrast:#ffffff;--le-color-danger:#dc2626;--le-color-danger-light:#ef4444;--le-color-danger-dark:#b91c1c;--le-color-danger-contrast:#ffffff;--le-color-info:#0284c7;--le-color-info-light:#0ea5e9;--le-color-info-dark:#0369a1;--le-color-info-contrast:#ffffff;--le-color-white:#ffffff;--le-color-black:#000000;--le-color-gray-50:#f9fafb;--le-color-gray-100:#f3f4f6;--le-color-gray-200:#e5e7eb;--le-color-gray-300:#d1d5db;--le-color-gray-400:#9ca3af;--le-color-gray-500:#6b7280;--le-color-gray-600:#4b5563;--le-color-gray-700:#374151;--le-color-gray-800:#1f2937;--le-color-gray-900:#111827;--le-color-background:#ffffff;--le-color-background-secondary:#fafafa;--le-color-background-tertiary:#f5f5f5;--le-color-surface:#ffffff;--le-color-surface-elevated:#ffffff;--le-color-text-primary:#111827;--le-color-text-secondary:#6b7280;--le-color-text-disabled:#9ca3af;--le-color-text-inverse:#ffffff;--le-color-border:#e5e7eb;--le-color-border-light:#f3f4f6;--le-color-border-dark:#d1d5db;--le-border-width:1px;--le-color-border-input:#c8cfdd;--le-color-focus:rgba(17, 24, 39, 0.3);--le-radius-none:0;--le-radius-sm:0;--le-radius-md:2px;--le-radius-lg:4px;--le-radius-xl:6px;--le-radius-2xl:8px;--le-radius-full:9999px;--le-shadow-none:none;--le-shadow-sm:none;--le-shadow-md:0 1px 2px rgba(0, 0, 0, 0.05);--le-shadow-lg:0 1px 3px rgba(0, 0, 0, 0.08);--le-shadow-xl:0 2px 4px rgba(0, 0, 0, 0.1);--le-shadow-2xl:0 4px 8px rgba(0, 0, 0, 0.1)}[theme=\"warm\"]{--le-color-primary:#ea580c;--le-color-primary-light:#fb923c;--le-color-primary-dark:#c2410c;--le-color-primary-contrast:#ffffff;--le-color-secondary:#b45309;--le-color-secondary-light:#d97706;--le-color-secondary-dark:#92400e;--le-color-secondary-contrast:#ffffff;--le-color-success:#16a34a;--le-color-success-light:#22c55e;--le-color-success-dark:#15803d;--le-color-success-contrast:#ffffff;--le-color-warning:#ca8a04;--le-color-warning-light:#eab308;--le-color-warning-dark:#a16207;--le-color-warning-contrast:#000000;--le-color-danger:#dc2626;--le-color-danger-light:#ef4444;--le-color-danger-dark:#b91c1c;--le-color-danger-contrast:#ffffff;--le-color-info:#0891b2;--le-color-info-light:#06b6d4;--le-color-info-dark:#0e7490;--le-color-info-contrast:#ffffff;--le-color-white:#ffffff;--le-color-black:#000000;--le-color-gray-50:#fffbeb;--le-color-gray-100:#fef3c7;--le-color-gray-200:#fde68a;--le-color-gray-300:#fcd34d;--le-color-gray-400:#fbbf24;--le-color-gray-500:#f59e0b;--le-color-gray-600:#d97706;--le-color-gray-700:#b45309;--le-color-gray-800:#92400e;--le-color-gray-900:#78350f;--le-color-background:#fffbeb;--le-color-background-secondary:#fef3c7;--le-color-background-tertiary:#fde68a;--le-color-surface:#ffffff;--le-color-surface-elevated:#ffffff;--le-color-text-primary:#78350f;--le-color-text-secondary:#92400e;--le-color-text-disabled:#d97706;--le-color-text-inverse:#ffffff;--le-color-border:#fcd34d;--le-color-border-light:#fde68a;--le-color-border-dark:#fbbf24;--le-border-width:2px;--le-color-border-input:#e7d4c4;--le-color-focus:rgba(234, 88, 12, 0.5);--le-radius-none:0;--le-radius-sm:0.125rem;--le-radius-md:0.375rem;--le-radius-lg:0.625rem;--le-radius-xl:0.875rem;--le-radius-2xl:1.125rem;--le-radius-full:9999px;--le-shadow-none:none;--le-shadow-sm:0 1px 2px rgba(234, 88, 12, 0.05);--le-shadow-md:0 4px 6px rgba(234, 88, 12, 0.1), 0 2px 4px rgba(234, 88, 12, 0.06);--le-shadow-lg:0 10px 15px rgba(234, 88, 12, 0.15), 0 4px 6px rgba(234, 88, 12, 0.08);--le-shadow-xl:0 20px 25px rgba(234, 88, 12, 0.15), 0 10px 10px rgba(234, 88, 12, 0.1);--le-shadow-2xl:0 25px 50px rgba(234, 88, 12, 0.2), 0 12px 24px rgba(234, 88, 12, 0.12)}:root{--le-space-xs:4px;--le-space-sm:8px;--le-space-md:16px;--le-space-lg:24px;--le-space-xl:32px;--le-space-2xl:48px;--le-space-3xl:64px;--le-font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;--le-font-family-mono:'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;--le-font-size-xs:0.75rem;--le-font-size-sm:0.875rem;--le-font-size-md:1rem;--le-font-size-lg:1.125rem;--le-font-size-xl:1.25rem;--le-font-size-2xl:1.5rem;--le-font-size-3xl:2rem;--le-font-size-4xl:2.5rem;--le-font-weight-normal:400;--le-font-weight-medium:500;--le-font-weight-semibold:600;--le-font-weight-bold:700;--le-line-height-tight:1.25;--le-line-height-normal:1.5;--le-line-height-relaxed:1.75;--le-transition-fast:150ms ease;--le-transition-normal:250ms ease;--le-transition-slow:400ms ease;--le-transition-bounce:400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);--le-z-dropdown:1000;--le-z-sticky:1020;--le-z-fixed:1030;--le-z-modal-backdrop:1040;--le-z-modal:1050;--le-z-popover:1060;--le-z-tooltip:1070}:root,[theme=\"default\"]{--le-color-primary:#3b82f6;--le-color-primary-hover:#2563eb;--le-color-primary-active:#1d4ed8;--le-color-primary-subtle:#eff6ff;--le-color-on-primary:#ffffff;--le-color-secondary:#64748b;--le-color-secondary-hover:#475569;--le-color-secondary-active:#334155;--le-color-secondary-subtle:#f1f5f9;--le-color-on-secondary:#ffffff;--le-color-success:#22c55e;--le-color-success-subtle:#f0fdf4;--le-color-on-success:#ffffff;--le-color-warning:#f59e0b;--le-color-warning-subtle:#fffbeb;--le-color-on-warning:#000000;--le-color-error:#ef4444;--le-color-error-subtle:#fef2f2;--le-color-on-error:#ffffff;--le-color-info:#06b6d4;--le-color-info-subtle:#ecfeff;--le-color-on-info:#ffffff;--le-color-background:#ffffff;--le-color-surface:#ffffff;--le-color-surface-raised:#ffffff;--le-color-surface-overlay:rgba(0, 0, 0, 0.5);--le-color-text:#1e293b;--le-color-text-secondary:#64748b;--le-color-text-muted:#94a3b8;--le-color-text-inverse:#ffffff;--le-color-border:#e2e8f0;--le-color-border-strong:#cbd5e1;--le-color-border-focus:var(--le-color-primary);--le-radius-none:0;--le-radius-sm:4px;--le-radius-md:7px;--le-radius-lg:12px;--le-radius-xl:16px;--le-radius-2xl:24px;--le-radius-full:9999px;--le-shadow-sm:0 1px 2px 0 rgba(0, 0, 0, 0.05);--le-shadow-md:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);--le-shadow-lg:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);--le-shadow-xl:0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);--le-shadow-focus:0 0 0 3px rgba(59, 130, 246, 0.3)}[theme=\"dark\"]{--le-color-primary:#60a5fa;--le-color-primary-hover:#93c5fd;--le-color-primary-active:#3b82f6;--le-color-primary-subtle:#1e3a5f;--le-color-on-primary:#0f172a;--le-color-secondary:#94a3b8;--le-color-secondary-hover:#cbd5e1;--le-color-secondary-active:#64748b;--le-color-secondary-subtle:#1e293b;--le-color-on-secondary:#0f172a;--le-color-success:#4ade80;--le-color-success-subtle:#14532d;--le-color-on-success:#0f172a;--le-color-warning:#fbbf24;--le-color-warning-subtle:#422006;--le-color-on-warning:#0f172a;--le-color-error:#f87171;--le-color-error-subtle:#450a0a;--le-color-on-error:#0f172a;--le-color-info:#22d3ee;--le-color-info-subtle:#164e63;--le-color-on-info:#0f172a;--le-color-background:#0f172a;--le-color-surface:#1e293b;--le-color-surface-raised:#334155;--le-color-surface-overlay:rgba(0, 0, 0, 0.7);--le-color-text:#f1f5f9;--le-color-text-secondary:#94a3b8;--le-color-text-muted:#64748b;--le-color-text-inverse:#0f172a;--le-color-border:#334155;--le-color-border-strong:#475569;--le-color-border-focus:var(--le-color-primary);--le-shadow-sm:0 1px 2px 0 rgba(0, 0, 0, 0.3);--le-shadow-md:0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);--le-shadow-lg:0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);--le-shadow-xl:0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);--le-shadow-focus:0 0 0 3px rgba(96, 165, 250, 0.4)}[theme=\"gradient\"]{--le-color-primary:#8b5cf6;--le-color-primary-hover:#a78bfa;--le-color-primary-active:#7c3aed;--le-color-primary-subtle:#f5f3ff;--le-color-on-primary:#ffffff;--le-color-secondary:#ec4899;--le-color-secondary-hover:#f472b6;--le-color-secondary-active:#db2777;--le-color-secondary-subtle:#fdf2f8;--le-color-on-secondary:#ffffff;--le-color-success:#10b981;--le-color-success-subtle:#ecfdf5;--le-color-on-success:#ffffff;--le-color-warning:#f59e0b;--le-color-warning-subtle:#fffbeb;--le-color-on-warning:#000000;--le-color-error:#f43f5e;--le-color-error-subtle:#fff1f2;--le-color-on-error:#ffffff;--le-color-info:#06b6d4;--le-color-info-subtle:#ecfeff;--le-color-on-info:#ffffff;--le-color-background:linear-gradient(135deg, #faf5ff 0%, #fdf2f8 50%, #fff7ed 100%);--le-color-surface:rgba(255, 255, 255, 0.9);--le-color-surface-raised:#ffffff;--le-color-surface-overlay:rgba(139, 92, 246, 0.3);--le-color-text:#1f2937;--le-color-text-secondary:#6b7280;--le-color-text-muted:#9ca3af;--le-color-text-inverse:#ffffff;--le-color-border:rgba(139, 92, 246, 0.2);--le-color-border-strong:rgba(139, 92, 246, 0.4);--le-color-border-focus:var(--le-color-primary);--le-radius-sm:6px;--le-radius-md:12px;--le-radius-lg:16px;--le-radius-xl:20px;--le-radius-2xl:28px;--le-shadow-sm:0 1px 3px 0 rgba(139, 92, 246, 0.1);--le-shadow-md:0 4px 6px -1px rgba(139, 92, 246, 0.15), 0 2px 4px -2px rgba(236, 72, 153, 0.1);--le-shadow-lg:0 10px 15px -3px rgba(139, 92, 246, 0.2), 0 4px 6px -4px rgba(236, 72, 153, 0.15);--le-shadow-xl:0 20px 25px -5px rgba(139, 92, 246, 0.25), 0 8px 10px -6px rgba(236, 72, 153, 0.2);--le-shadow-focus:0 0 0 3px rgba(139, 92, 246, 0.4)}[theme=\"minimal\"]{--le-color-primary:#374151;--le-color-primary-hover:#1f2937;--le-color-primary-active:#111827;--le-color-primary-subtle:#f3f4f6;--le-color-on-primary:#ffffff;--le-color-secondary:#9ca3af;--le-color-secondary-hover:#6b7280;--le-color-secondary-active:#4b5563;--le-color-secondary-subtle:#f9fafb;--le-color-on-secondary:#ffffff;--le-color-success:#059669;--le-color-success-subtle:#f0fdf4;--le-color-on-success:#ffffff;--le-color-warning:#d97706;--le-color-warning-subtle:#fffbeb;--le-color-on-warning:#ffffff;--le-color-error:#dc2626;--le-color-error-subtle:#fef2f2;--le-color-on-error:#ffffff;--le-color-info:#0891b2;--le-color-info-subtle:#ecfeff;--le-color-on-info:#ffffff;--le-color-background:#fafafa;--le-color-surface:#ffffff;--le-color-surface-raised:#ffffff;--le-color-surface-overlay:rgba(0, 0, 0, 0.4);--le-color-text:#111827;--le-color-text-secondary:#6b7280;--le-color-text-muted:#9ca3af;--le-color-text-inverse:#ffffff;--le-color-border:#e5e7eb;--le-color-border-strong:#d1d5db;--le-color-border-focus:var(--le-color-primary);--le-radius-none:0;--le-radius-sm:2px;--le-radius-md:4px;--le-radius-lg:6px;--le-radius-xl:8px;--le-radius-2xl:12px;--le-radius-full:9999px;--le-shadow-sm:0 1px 2px 0 rgba(0, 0, 0, 0.03);--le-shadow-md:0 2px 4px -1px rgba(0, 0, 0, 0.06);--le-shadow-lg:0 4px 8px -2px rgba(0, 0, 0, 0.08);--le-shadow-xl:0 8px 16px -4px rgba(0, 0, 0, 0.1);--le-shadow-focus:0 0 0 2px rgba(55, 65, 81, 0.2)}[theme=\"warm\"]{--le-color-primary:#ea580c;--le-color-primary-hover:#f97316;--le-color-primary-active:#c2410c;--le-color-primary-subtle:#fff7ed;--le-color-on-primary:#ffffff;--le-color-secondary:#78716c;--le-color-secondary-hover:#57534e;--le-color-secondary-active:#44403c;--le-color-secondary-subtle:#fafaf9;--le-color-on-secondary:#ffffff;--le-color-success:#65a30d;--le-color-success-subtle:#f7fee7;--le-color-on-success:#ffffff;--le-color-warning:#d97706;--le-color-warning-subtle:#fffbeb;--le-color-on-warning:#000000;--le-color-error:#dc2626;--le-color-error-subtle:#fef2f2;--le-color-on-error:#ffffff;--le-color-info:#0891b2;--le-color-info-subtle:#ecfeff;--le-color-on-info:#ffffff;--le-color-background:#fffbf5;--le-color-surface:#ffffff;--le-color-surface-raised:#ffffff;--le-color-surface-overlay:rgba(120, 53, 15, 0.4);--le-color-text:#292524;--le-color-text-secondary:#78716c;--le-color-text-muted:#a8a29e;--le-color-text-inverse:#ffffff;--le-color-border:#e7e5e4;--le-color-border-strong:#d6d3d1;--le-color-border-focus:var(--le-color-primary);--le-radius-sm:4px;--le-radius-md:8px;--le-radius-lg:12px;--le-radius-xl:16px;--le-radius-2xl:24px;--le-shadow-sm:0 1px 2px 0 rgba(120, 53, 15, 0.05);--le-shadow-md:0 4px 6px -1px rgba(120, 53, 15, 0.1), 0 2px 4px -2px rgba(120, 53, 15, 0.08);--le-shadow-lg:0 10px 15px -3px rgba(120, 53, 15, 0.12), 0 4px 6px -4px rgba(120, 53, 15, 0.1);--le-shadow-xl:0 20px 25px -5px rgba(120, 53, 15, 0.15), 0 8px 10px -6px rgba(120, 53, 15, 0.12);--le-shadow-focus:0 0 0 3px rgba(234, 88, 12, 0.3)}";
112
-
113
- /*
114
- Stencil Client Platform v4.38.3 | MIT Licensed | https://stenciljs.com
115
- */
116
- var __defProp = Object.defineProperty;
117
- var __export = (target, all) => {
118
- for (var name in all)
119
- __defProp(target, name, { get: all[name], enumerable: true });
120
- };
121
-
122
- // src/utils/constants.ts
123
- var SVG_NS = "http://www.w3.org/2000/svg";
124
- var HTML_NS = "http://www.w3.org/1999/xhtml";
125
- var reWireGetterSetter = (instance, hostRef) => {
126
- var _a;
127
- const cmpMeta = hostRef.$cmpMeta$;
128
- const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
129
- members.map(([memberName, [memberFlags]]) => {
130
- if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
131
- const ogValue = instance[memberName];
132
- const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
133
- if (ogDescriptor) {
134
- Object.defineProperty(instance, memberName, {
135
- get() {
136
- return ogDescriptor.get.call(this);
137
- },
138
- set(newValue) {
139
- ogDescriptor.set.call(this, newValue);
140
- },
141
- configurable: true,
142
- enumerable: true
143
- });
144
- }
145
- instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
146
- }
147
- });
148
- };
149
- function getPropertyDescriptor(obj, memberName) {
150
- while (obj) {
151
- const desc = Object.getOwnPropertyDescriptor(obj, memberName);
152
- if (desc == null ? void 0 : desc.get) return desc;
153
- obj = Object.getPrototypeOf(obj);
154
- }
155
- return void 0;
156
- }
157
-
158
- // src/client/client-host-ref.ts
159
- var getHostRef = (ref) => {
160
- if (ref.__stencil__getHostRef) {
161
- return ref.__stencil__getHostRef();
162
- }
163
- return void 0;
164
- };
165
- var registerInstance = (lazyInstance, hostRef) => {
166
- if (!hostRef) return;
167
- lazyInstance.__stencil__getHostRef = () => hostRef;
168
- hostRef.$lazyInstance$ = lazyInstance;
169
- if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
170
- reWireGetterSetter(lazyInstance, hostRef);
171
- }
172
- };
173
- var registerHost = (hostElement, cmpMeta) => {
174
- const hostRef = {
175
- $flags$: 0,
176
- $hostElement$: hostElement,
177
- $cmpMeta$: cmpMeta,
178
- $instanceValues$: /* @__PURE__ */ new Map(),
179
- $serializerValues$: /* @__PURE__ */ new Map()
180
- };
181
- {
182
- hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
183
- }
184
- {
185
- hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
186
- hostElement["s-p"] = [];
187
- hostElement["s-rc"] = [];
188
- }
189
- {
190
- hostRef.$fetchedCbList$ = [];
191
- }
192
- const ref = hostRef;
193
- hostElement.__stencil__getHostRef = () => ref;
194
- return ref;
195
- };
196
- var isMemberInElement = (elm, memberName) => memberName in elm;
197
- var consoleError = (e, el) => (0, console.error)(e, el);
198
-
199
- // src/client/client-load-module.ts
200
- var cmpModules = /* @__PURE__ */ new Map();
201
- var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
202
- const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
203
- const bundleId = cmpMeta.$lazyBundleId$;
204
- if (!bundleId) {
205
- return void 0;
206
- }
207
- const module = cmpModules.get(bundleId) ;
208
- if (module) {
209
- return module[exportName];
210
- }
211
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
212
- return import(
213
- /* @vite-ignore */
214
- /* webpackInclude: /\.entry\.js$/ */
215
- /* webpackExclude: /\.system\.entry\.js$/ */
216
- /* webpackMode: "lazy" */
217
- `./${bundleId}.entry.js${""}`
218
- ).then(
219
- (importedModule) => {
220
- {
221
- cmpModules.set(bundleId, importedModule);
222
- }
223
- return importedModule[exportName];
224
- },
225
- (e) => {
226
- consoleError(e, hostRef.$hostElement$);
227
- }
228
- );
229
- };
230
-
231
- // src/client/client-style.ts
232
- var styles = /* @__PURE__ */ new Map();
233
- var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
234
- var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
235
- var XLINK_NS = "http://www.w3.org/1999/xlink";
236
- var win = typeof window !== "undefined" ? window : {};
237
- var plt = {
238
- $flags$: 0,
239
- $resourcesUrl$: "",
240
- jmp: (h2) => h2(),
241
- raf: (h2) => requestAnimationFrame(h2),
242
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
243
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
244
- ce: (eventName, opts) => new CustomEvent(eventName, opts)
245
- };
246
- var supportsListenerOptions = /* @__PURE__ */ (() => {
247
- var _a;
248
- let supportsListenerOptions2 = false;
249
- try {
250
- (_a = win.document) == null ? void 0 : _a.addEventListener(
251
- "e",
252
- null,
253
- Object.defineProperty({}, "passive", {
254
- get() {
255
- supportsListenerOptions2 = true;
256
- }
257
- })
258
- );
259
- } catch (e) {
260
- }
261
- return supportsListenerOptions2;
262
- })();
263
- var promiseResolve = (v) => Promise.resolve(v);
264
- var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
265
- try {
266
- new CSSStyleSheet();
267
- return typeof new CSSStyleSheet().replaceSync === "function";
268
- } catch (e) {
269
- }
270
- return false;
271
- })() ;
272
- var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
273
- var queuePending = false;
274
- var queueDomReads = [];
275
- var queueDomWrites = [];
276
- var queueTask = (queue, write) => (cb) => {
277
- queue.push(cb);
278
- if (!queuePending) {
279
- queuePending = true;
280
- if (write && plt.$flags$ & 4 /* queueSync */) {
281
- nextTick(flush);
282
- } else {
283
- plt.raf(flush);
284
- }
285
- }
286
- };
287
- var consume = (queue) => {
288
- for (let i2 = 0; i2 < queue.length; i2++) {
289
- try {
290
- queue[i2](performance.now());
291
- } catch (e) {
292
- consoleError(e);
293
- }
294
- }
295
- queue.length = 0;
296
- };
297
- var flush = () => {
298
- consume(queueDomReads);
299
- {
300
- consume(queueDomWrites);
301
- if (queuePending = queueDomReads.length > 0) {
302
- plt.raf(flush);
303
- }
304
- }
305
- };
306
- var nextTick = (cb) => promiseResolve().then(cb);
307
- var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
308
- var isComplexType = (o) => {
309
- o = typeof o;
310
- return o === "object" || o === "function";
311
- };
312
-
313
- // src/utils/query-nonce-meta-tag-content.ts
314
- function queryNonceMetaTagContent(doc) {
315
- var _a, _b, _c;
316
- return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
317
- }
318
-
319
- // src/utils/regular-expression.ts
320
- var escapeRegExpSpecialCharacters = (text) => {
321
- return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
322
- };
323
-
324
- // src/utils/result.ts
325
- var result_exports = {};
326
- __export(result_exports, {
327
- err: () => err,
328
- map: () => map,
329
- ok: () => ok,
330
- unwrap: () => unwrap,
331
- unwrapErr: () => unwrapErr
332
- });
333
- var ok = (value) => ({
334
- isOk: true,
335
- isErr: false,
336
- value
337
- });
338
- var err = (value) => ({
339
- isOk: false,
340
- isErr: true,
341
- value
342
- });
343
- function map(result, fn) {
344
- if (result.isOk) {
345
- const val = fn(result.value);
346
- if (val instanceof Promise) {
347
- return val.then((newVal) => ok(newVal));
348
- } else {
349
- return ok(val);
350
- }
351
- }
352
- if (result.isErr) {
353
- const value = result.value;
354
- return err(value);
355
- }
356
- throw "should never get here";
357
- }
358
- var unwrap = (result) => {
359
- if (result.isOk) {
360
- return result.value;
361
- } else {
362
- throw result.value;
363
- }
364
- };
365
- var unwrapErr = (result) => {
366
- if (result.isErr) {
367
- return result.value;
368
- } else {
369
- throw result.value;
370
- }
371
- };
372
-
373
- // src/utils/style.ts
374
- function createStyleSheetIfNeededAndSupported(styles2) {
375
- if (!supportsConstructableStylesheets) return void 0;
376
- const sheet = new CSSStyleSheet();
377
- sheet.replaceSync(styles2);
378
- return sheet;
379
- }
380
-
381
- // src/utils/shadow-root.ts
382
- var globalStyleSheet;
383
- function createShadowRoot(cmpMeta) {
384
- var _a;
385
- const shadowRoot = this.attachShadow({ mode: "open" });
386
- if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null;
387
- if (globalStyleSheet) {
388
- if (supportsMutableAdoptedStyleSheets) {
389
- shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
390
- } else {
391
- shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
392
- }
393
- }
394
- }
395
- var createTime = (fnName, tagName = "") => {
396
- {
397
- return () => {
398
- return;
399
- };
400
- }
401
- };
402
- var uniqueTime = (key, measureText) => {
403
- {
404
- return () => {
405
- return;
406
- };
407
- }
408
- };
409
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
410
- var registerStyle = (scopeId2, cssText, allowCS) => {
411
- let style = styles.get(scopeId2);
412
- if (supportsConstructableStylesheets && allowCS) {
413
- style = style || new CSSStyleSheet();
414
- if (typeof style === "string") {
415
- style = cssText;
416
- } else {
417
- style.replaceSync(cssText);
418
- }
419
- } else {
420
- style = cssText;
421
- }
422
- styles.set(scopeId2, style);
423
- };
424
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
425
- var _a;
426
- const scopeId2 = getScopeId(cmpMeta);
427
- const style = styles.get(scopeId2);
428
- if (!win.document) {
429
- return scopeId2;
430
- }
431
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
432
- if (style) {
433
- if (typeof style === "string") {
434
- styleContainerNode = styleContainerNode.head || styleContainerNode;
435
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
436
- let styleElm;
437
- if (!appliedStyles) {
438
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
439
- }
440
- if (!appliedStyles.has(scopeId2)) {
441
- {
442
- styleElm = win.document.createElement("style");
443
- styleElm.innerHTML = style;
444
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
445
- if (nonce != null) {
446
- styleElm.setAttribute("nonce", nonce);
447
- }
448
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
449
- if (styleContainerNode.nodeName === "HEAD") {
450
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
451
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
452
- styleContainerNode.insertBefore(
453
- styleElm,
454
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
455
- );
456
- } else if ("host" in styleContainerNode) {
457
- if (supportsConstructableStylesheets) {
458
- const stylesheet = new CSSStyleSheet();
459
- stylesheet.replaceSync(style);
460
- if (supportsMutableAdoptedStyleSheets) {
461
- styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
462
- } else {
463
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
464
- }
465
- } else {
466
- const existingStyleContainer = styleContainerNode.querySelector("style");
467
- if (existingStyleContainer) {
468
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
469
- } else {
470
- styleContainerNode.prepend(styleElm);
471
- }
472
- }
473
- } else {
474
- styleContainerNode.append(styleElm);
475
- }
476
- }
477
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
478
- styleContainerNode.insertBefore(styleElm, null);
479
- }
480
- }
481
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
482
- styleElm.innerHTML += SLOT_FB_CSS;
483
- }
484
- if (appliedStyles) {
485
- appliedStyles.add(scopeId2);
486
- }
487
- }
488
- } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
489
- if (supportsMutableAdoptedStyleSheets) {
490
- styleContainerNode.adoptedStyleSheets.push(style);
491
- } else {
492
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
493
- }
494
- }
495
- }
496
- return scopeId2;
497
- };
498
- var attachStyles = (hostRef) => {
499
- const cmpMeta = hostRef.$cmpMeta$;
500
- const elm = hostRef.$hostElement$;
501
- const flags = cmpMeta.$flags$;
502
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
503
- const scopeId2 = addStyle(
504
- elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
505
- cmpMeta);
506
- if (flags & 10 /* needsScopedEncapsulation */) {
507
- elm["s-sc"] = scopeId2;
508
- elm.classList.add(scopeId2 + "-h");
509
- }
510
- endAttachStyles();
511
- };
512
- var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
513
- var h = (nodeName, vnodeData, ...children) => {
514
- let child = null;
515
- let key = null;
516
- let simple = false;
517
- let lastSimple = false;
518
- const vNodeChildren = [];
519
- const walk = (c) => {
520
- for (let i2 = 0; i2 < c.length; i2++) {
521
- child = c[i2];
522
- if (Array.isArray(child)) {
523
- walk(child);
524
- } else if (child != null && typeof child !== "boolean") {
525
- if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
526
- child = String(child);
527
- }
528
- if (simple && lastSimple) {
529
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
530
- } else {
531
- vNodeChildren.push(simple ? newVNode(null, child) : child);
532
- }
533
- lastSimple = simple;
534
- }
535
- }
536
- };
537
- walk(children);
538
- if (vnodeData) {
539
- if (vnodeData.key) {
540
- key = vnodeData.key;
541
- }
542
- {
543
- const classData = vnodeData.className || vnodeData.class;
544
- if (classData) {
545
- vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
546
- }
547
- }
548
- }
549
- if (typeof nodeName === "function") {
550
- return nodeName(
551
- vnodeData === null ? {} : vnodeData,
552
- vNodeChildren,
553
- vdomFnUtils
554
- );
555
- }
556
- const vnode = newVNode(nodeName, null);
557
- vnode.$attrs$ = vnodeData;
558
- if (vNodeChildren.length > 0) {
559
- vnode.$children$ = vNodeChildren;
560
- }
561
- {
562
- vnode.$key$ = key;
563
- }
564
- return vnode;
565
- };
566
- var newVNode = (tag, text) => {
567
- const vnode = {
568
- $flags$: 0,
569
- $tag$: tag,
570
- $text$: text,
571
- $elm$: null,
572
- $children$: null
573
- };
574
- {
575
- vnode.$attrs$ = null;
576
- }
577
- {
578
- vnode.$key$ = null;
579
- }
580
- return vnode;
581
- };
582
- var Host = {};
583
- var isHost = (node) => node && node.$tag$ === Host;
584
- var vdomFnUtils = {
585
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
586
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
587
- };
588
- var convertToPublic = (node) => ({
589
- vattrs: node.$attrs$,
590
- vchildren: node.$children$,
591
- vkey: node.$key$,
592
- vname: node.$name$,
593
- vtag: node.$tag$,
594
- vtext: node.$text$
595
- });
596
- var convertToPrivate = (node) => {
597
- if (typeof node.vtag === "function") {
598
- const vnodeData = { ...node.vattrs };
599
- if (node.vkey) {
600
- vnodeData.key = node.vkey;
601
- }
602
- if (node.vname) {
603
- vnodeData.name = node.vname;
604
- }
605
- return h(node.vtag, vnodeData, ...node.vchildren || []);
606
- }
607
- const vnode = newVNode(node.vtag, node.vtext);
608
- vnode.$attrs$ = node.vattrs;
609
- vnode.$children$ = node.vchildren;
610
- vnode.$key$ = node.vkey;
611
- vnode.$name$ = node.vname;
612
- return vnode;
613
- };
614
- var createSupportsRuleRe = (selector) => {
615
- const safeSelector2 = escapeRegExpSpecialCharacters(selector);
616
- return new RegExp(
617
- // First capture group: match any context before the selector that's not inside @supports selector()
618
- // Using negative lookahead to avoid matching inside @supports selector(...) condition
619
- `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
620
- "g"
621
- );
622
- };
623
- createSupportsRuleRe("::slotted");
624
- createSupportsRuleRe(":host");
625
- createSupportsRuleRe(":host-context");
626
- var parsePropertyValue = (propValue, propType, isFormAssociated) => {
627
- if (propValue != null && !isComplexType(propValue)) {
628
- if (propType & 4 /* Boolean */) {
629
- {
630
- return propValue === "false" ? false : propValue === "" || !!propValue;
631
- }
632
- }
633
- if (propType & 2 /* Number */) {
634
- return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
635
- }
636
- if (propType & 1 /* String */) {
637
- return String(propValue);
638
- }
639
- return propValue;
640
- }
641
- return propValue;
642
- };
643
- var getElement = (ref) => {
644
- var _a;
645
- return (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ ;
646
- };
647
-
648
- // src/runtime/event-emitter.ts
649
- var createEvent = (ref, name, flags) => {
650
- const elm = getElement(ref);
651
- return {
652
- emit: (detail) => {
653
- return emitEvent(elm, name, {
654
- bubbles: true,
655
- composed: true,
656
- cancelable: true,
657
- detail
658
- });
659
- }
660
- };
661
- };
662
- var emitEvent = (elm, name, opts) => {
663
- const ev = plt.ce(name, opts);
664
- elm.dispatchEvent(ev);
665
- return ev;
666
- };
667
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
668
- if (oldValue === newValue) {
669
- return;
670
- }
671
- let isProp = isMemberInElement(elm, memberName);
672
- let ln = memberName.toLowerCase();
673
- if (memberName === "class") {
674
- const classList = elm.classList;
675
- const oldClasses = parseClassList(oldValue);
676
- let newClasses = parseClassList(newValue);
677
- {
678
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
679
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
680
- }
681
- } else if (memberName === "style") {
682
- {
683
- for (const prop in oldValue) {
684
- if (!newValue || newValue[prop] == null) {
685
- if (prop.includes("-")) {
686
- elm.style.removeProperty(prop);
687
- } else {
688
- elm.style[prop] = "";
689
- }
690
- }
691
- }
692
- }
693
- for (const prop in newValue) {
694
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
695
- if (prop.includes("-")) {
696
- elm.style.setProperty(prop, newValue[prop]);
697
- } else {
698
- elm.style[prop] = newValue[prop];
699
- }
700
- }
701
- }
702
- } else if (memberName === "key") ; else if (memberName === "ref") {
703
- if (newValue) {
704
- newValue(elm);
705
- }
706
- } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
707
- if (memberName[2] === "-") {
708
- memberName = memberName.slice(3);
709
- } else if (isMemberInElement(win, ln)) {
710
- memberName = ln.slice(2);
711
- } else {
712
- memberName = ln[2] + memberName.slice(3);
713
- }
714
- if (oldValue || newValue) {
715
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
716
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
717
- if (oldValue) {
718
- plt.rel(elm, memberName, oldValue, capture);
719
- }
720
- if (newValue) {
721
- plt.ael(elm, memberName, newValue, capture);
722
- }
723
- }
724
- } else {
725
- const isComplex = isComplexType(newValue);
726
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
727
- try {
728
- if (!elm.tagName.includes("-")) {
729
- const n = newValue == null ? "" : newValue;
730
- if (memberName === "list") {
731
- isProp = false;
732
- } else if (oldValue == null || elm[memberName] != n) {
733
- if (typeof elm.__lookupSetter__(memberName) === "function") {
734
- elm[memberName] = n;
735
- } else {
736
- elm.setAttribute(memberName, n);
737
- }
738
- }
739
- } else if (elm[memberName] !== newValue) {
740
- elm[memberName] = newValue;
741
- }
742
- } catch (e) {
743
- }
744
- }
745
- let xlink = false;
746
- {
747
- if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
748
- memberName = ln;
749
- xlink = true;
750
- }
751
- }
752
- if (newValue == null || newValue === false) {
753
- if (newValue !== false || elm.getAttribute(memberName) === "") {
754
- if (xlink) {
755
- elm.removeAttributeNS(XLINK_NS, memberName);
756
- } else {
757
- elm.removeAttribute(memberName);
758
- }
759
- }
760
- } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
761
- newValue = newValue === true ? "" : newValue;
762
- if (xlink) {
763
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
764
- } else {
765
- elm.setAttribute(memberName, newValue);
766
- }
767
- }
768
- }
769
- };
770
- var parseClassListRegex = /\s/;
771
- var parseClassList = (value) => {
772
- if (typeof value === "object" && value && "baseVal" in value) {
773
- value = value.baseVal;
774
- }
775
- if (!value || typeof value !== "string") {
776
- return [];
777
- }
778
- return value.split(parseClassListRegex);
779
- };
780
- var CAPTURE_EVENT_SUFFIX = "Capture";
781
- var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
782
-
783
- // src/runtime/vdom/update-element.ts
784
- var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
785
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
786
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
787
- const newVnodeAttrs = newVnode.$attrs$ || {};
788
- {
789
- for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
790
- if (!(memberName in newVnodeAttrs)) {
791
- setAccessor(
792
- elm,
793
- memberName,
794
- oldVnodeAttrs[memberName],
795
- void 0,
796
- isSvgMode2,
797
- newVnode.$flags$);
798
- }
799
- }
800
- }
801
- for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
802
- setAccessor(
803
- elm,
804
- memberName,
805
- oldVnodeAttrs[memberName],
806
- newVnodeAttrs[memberName],
807
- isSvgMode2,
808
- newVnode.$flags$);
809
- }
810
- };
811
- function sortedAttrNames(attrNames) {
812
- return attrNames.includes("ref") ? (
813
- // we need to sort these to ensure that `'ref'` is the last attr
814
- [...attrNames.filter((attr) => attr !== "ref"), "ref"]
815
- ) : (
816
- // no need to sort, return the original array
817
- attrNames
818
- );
819
- }
820
- var hostTagName;
821
- var isSvgMode = false;
822
- var createElm = (oldParentVNode, newParentVNode, childIndex) => {
823
- const newVNode2 = newParentVNode.$children$[childIndex];
824
- let i2 = 0;
825
- let elm;
826
- let childNode;
827
- if (newVNode2.$text$ !== null) {
828
- elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
829
- } else {
830
- if (!isSvgMode) {
831
- isSvgMode = newVNode2.$tag$ === "svg";
832
- }
833
- if (!win.document) {
834
- throw new Error(
835
- "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
836
- );
837
- }
838
- elm = newVNode2.$elm$ = win.document.createElementNS(
839
- isSvgMode ? SVG_NS : HTML_NS,
840
- newVNode2.$tag$
841
- ) ;
842
- if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
843
- isSvgMode = false;
844
- }
845
- {
846
- updateElement(null, newVNode2, isSvgMode);
847
- }
848
- if (newVNode2.$children$) {
849
- for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
850
- childNode = createElm(oldParentVNode, newVNode2, i2);
851
- if (childNode) {
852
- elm.appendChild(childNode);
853
- }
854
- }
855
- }
856
- {
857
- if (newVNode2.$tag$ === "svg") {
858
- isSvgMode = false;
859
- } else if (elm.tagName === "foreignObject") {
860
- isSvgMode = true;
861
- }
862
- }
863
- }
864
- elm["s-hn"] = hostTagName;
865
- return elm;
866
- };
867
- var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
868
- let containerElm = parentElm;
869
- let childNode;
870
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
871
- containerElm = containerElm.shadowRoot;
872
- }
873
- for (; startIdx <= endIdx; ++startIdx) {
874
- if (vnodes[startIdx]) {
875
- childNode = createElm(null, parentVNode, startIdx);
876
- if (childNode) {
877
- vnodes[startIdx].$elm$ = childNode;
878
- insertBefore(containerElm, childNode, before);
879
- }
880
- }
881
- }
882
- };
883
- var removeVnodes = (vnodes, startIdx, endIdx) => {
884
- for (let index = startIdx; index <= endIdx; ++index) {
885
- const vnode = vnodes[index];
886
- if (vnode) {
887
- const elm = vnode.$elm$;
888
- nullifyVNodeRefs(vnode);
889
- if (elm) {
890
- elm.remove();
891
- }
892
- }
893
- }
894
- };
895
- var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
896
- let oldStartIdx = 0;
897
- let newStartIdx = 0;
898
- let idxInOld = 0;
899
- let i2 = 0;
900
- let oldEndIdx = oldCh.length - 1;
901
- let oldStartVnode = oldCh[0];
902
- let oldEndVnode = oldCh[oldEndIdx];
903
- let newEndIdx = newCh.length - 1;
904
- let newStartVnode = newCh[0];
905
- let newEndVnode = newCh[newEndIdx];
906
- let node;
907
- let elmToMove;
908
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
909
- if (oldStartVnode == null) {
910
- oldStartVnode = oldCh[++oldStartIdx];
911
- } else if (oldEndVnode == null) {
912
- oldEndVnode = oldCh[--oldEndIdx];
913
- } else if (newStartVnode == null) {
914
- newStartVnode = newCh[++newStartIdx];
915
- } else if (newEndVnode == null) {
916
- newEndVnode = newCh[--newEndIdx];
917
- } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
918
- patch(oldStartVnode, newStartVnode, isInitialRender);
919
- oldStartVnode = oldCh[++oldStartIdx];
920
- newStartVnode = newCh[++newStartIdx];
921
- } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
922
- patch(oldEndVnode, newEndVnode, isInitialRender);
923
- oldEndVnode = oldCh[--oldEndIdx];
924
- newEndVnode = newCh[--newEndIdx];
925
- } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
926
- patch(oldStartVnode, newEndVnode, isInitialRender);
927
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
928
- oldStartVnode = oldCh[++oldStartIdx];
929
- newEndVnode = newCh[--newEndIdx];
930
- } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
931
- patch(oldEndVnode, newStartVnode, isInitialRender);
932
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
933
- oldEndVnode = oldCh[--oldEndIdx];
934
- newStartVnode = newCh[++newStartIdx];
935
- } else {
936
- idxInOld = -1;
937
- {
938
- for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
939
- if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
940
- idxInOld = i2;
941
- break;
942
- }
943
- }
944
- }
945
- if (idxInOld >= 0) {
946
- elmToMove = oldCh[idxInOld];
947
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
948
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
949
- } else {
950
- patch(elmToMove, newStartVnode, isInitialRender);
951
- oldCh[idxInOld] = void 0;
952
- node = elmToMove.$elm$;
953
- }
954
- newStartVnode = newCh[++newStartIdx];
955
- } else {
956
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
957
- newStartVnode = newCh[++newStartIdx];
958
- }
959
- if (node) {
960
- {
961
- insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
962
- }
963
- }
964
- }
965
- }
966
- if (oldStartIdx > oldEndIdx) {
967
- addVnodes(
968
- parentElm,
969
- newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
970
- newVNode2,
971
- newCh,
972
- newStartIdx,
973
- newEndIdx
974
- );
975
- } else if (newStartIdx > newEndIdx) {
976
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
977
- }
978
- };
979
- var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
980
- if (leftVNode.$tag$ === rightVNode.$tag$) {
981
- if (!isInitialRender) {
982
- return leftVNode.$key$ === rightVNode.$key$;
983
- }
984
- if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
985
- leftVNode.$key$ = rightVNode.$key$;
986
- }
987
- return true;
988
- }
989
- return false;
990
- };
991
- var patch = (oldVNode, newVNode2, isInitialRender = false) => {
992
- const elm = newVNode2.$elm$ = oldVNode.$elm$;
993
- const oldChildren = oldVNode.$children$;
994
- const newChildren = newVNode2.$children$;
995
- const tag = newVNode2.$tag$;
996
- const text = newVNode2.$text$;
997
- if (text === null) {
998
- {
999
- isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
1000
- }
1001
- {
1002
- updateElement(oldVNode, newVNode2, isSvgMode);
1003
- }
1004
- if (oldChildren !== null && newChildren !== null) {
1005
- updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
1006
- } else if (newChildren !== null) {
1007
- if (oldVNode.$text$ !== null) {
1008
- elm.textContent = "";
1009
- }
1010
- addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
1011
- } else if (
1012
- // don't do this on initial render as it can cause non-hydrated content to be removed
1013
- !isInitialRender && BUILD.updatable && oldChildren !== null
1014
- ) {
1015
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
1016
- } else ;
1017
- if (isSvgMode && tag === "svg") {
1018
- isSvgMode = false;
1019
- }
1020
- } else if (oldVNode.$text$ !== text) {
1021
- elm.data = text;
1022
- }
1023
- };
1024
- var nullifyVNodeRefs = (vNode) => {
1025
- {
1026
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1027
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1028
- }
1029
- };
1030
- var insertBefore = (parent, newNode, reference) => {
1031
- {
1032
- return parent == null ? void 0 : parent.insertBefore(newNode, reference);
1033
- }
1034
- };
1035
- var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1036
- const hostElm = hostRef.$hostElement$;
1037
- const cmpMeta = hostRef.$cmpMeta$;
1038
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1039
- const isHostElement = isHost(renderFnResults);
1040
- const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
1041
- hostTagName = hostElm.tagName;
1042
- if (cmpMeta.$attrsToReflect$) {
1043
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1044
- cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
1045
- {
1046
- rootVnode.$attrs$[attribute] = hostElm[propName];
1047
- }
1048
- });
1049
- }
1050
- if (isInitialLoad && rootVnode.$attrs$) {
1051
- for (const key of Object.keys(rootVnode.$attrs$)) {
1052
- if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
1053
- rootVnode.$attrs$[key] = hostElm[key];
1054
- }
1055
- }
1056
- }
1057
- rootVnode.$tag$ = null;
1058
- rootVnode.$flags$ |= 4 /* isHost */;
1059
- hostRef.$vnode$ = rootVnode;
1060
- rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
1061
- patch(oldVNode, rootVnode, isInitialLoad);
1062
- };
1063
-
1064
- // src/runtime/update-component.ts
1065
- var attachToAncestor = (hostRef, ancestorComponent) => {
1066
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1067
- const index = ancestorComponent["s-p"].push(
1068
- new Promise(
1069
- (r) => hostRef.$onRenderResolve$ = () => {
1070
- ancestorComponent["s-p"].splice(index - 1, 1);
1071
- r();
1072
- }
1073
- )
1074
- );
1075
- }
1076
- };
1077
- var scheduleUpdate = (hostRef, isInitialLoad) => {
1078
- {
1079
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1080
- }
1081
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1082
- hostRef.$flags$ |= 512 /* needsRerender */;
1083
- return;
1084
- }
1085
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1086
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1087
- if (isInitialLoad) {
1088
- queueMicrotask(() => {
1089
- dispatch();
1090
- });
1091
- return;
1092
- }
1093
- return writeTask(dispatch) ;
1094
- };
1095
- var dispatchHooks = (hostRef, isInitialLoad) => {
1096
- const elm = hostRef.$hostElement$;
1097
- const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
1098
- const instance = hostRef.$lazyInstance$ ;
1099
- if (!instance) {
1100
- throw new Error(
1101
- `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
1102
- );
1103
- }
1104
- let maybePromise;
1105
- if (isInitialLoad) {
1106
- {
1107
- {
1108
- hostRef.$flags$ |= 256 /* isListenReady */;
1109
- if (hostRef.$queuedListeners$) {
1110
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
1111
- hostRef.$queuedListeners$ = void 0;
1112
- }
1113
- }
1114
- if (hostRef.$fetchedCbList$.length) {
1115
- hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
1116
- }
1117
- }
1118
- maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
1119
- } else {
1120
- maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
1121
- }
1122
- maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
1123
- endSchedule();
1124
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1125
- };
1126
- var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
1127
- console.error(err2);
1128
- fn();
1129
- }) : fn();
1130
- var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
1131
- var updateComponent = async (hostRef, instance, isInitialLoad) => {
1132
- var _a;
1133
- const elm = hostRef.$hostElement$;
1134
- const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
1135
- const rc = elm["s-rc"];
1136
- if (isInitialLoad) {
1137
- attachStyles(hostRef);
1138
- }
1139
- const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1140
- {
1141
- callRender(hostRef, instance, elm, isInitialLoad);
1142
- }
1143
- if (rc) {
1144
- rc.map((cb) => cb());
1145
- elm["s-rc"] = void 0;
1146
- }
1147
- endRender();
1148
- endUpdate();
1149
- {
1150
- const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
1151
- const postUpdate = () => postUpdateComponent(hostRef);
1152
- if (childrenPromises.length === 0) {
1153
- postUpdate();
1154
- } else {
1155
- Promise.all(childrenPromises).then(postUpdate);
1156
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1157
- childrenPromises.length = 0;
1158
- }
1159
- }
1160
- };
1161
- var callRender = (hostRef, instance, elm, isInitialLoad) => {
1162
- try {
1163
- instance = instance.render() ;
1164
- {
1165
- hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
1166
- }
1167
- {
1168
- hostRef.$flags$ |= 2 /* hasRendered */;
1169
- }
1170
- {
1171
- {
1172
- {
1173
- renderVdom(hostRef, instance, isInitialLoad);
1174
- }
1175
- }
1176
- }
1177
- } catch (e) {
1178
- consoleError(e, hostRef.$hostElement$);
1179
- }
1180
- return null;
1181
- };
1182
- var postUpdateComponent = (hostRef) => {
1183
- const tagName = hostRef.$cmpMeta$.$tagName$;
1184
- const elm = hostRef.$hostElement$;
1185
- const endPostUpdate = createTime("postUpdate", tagName);
1186
- const instance = hostRef.$lazyInstance$ ;
1187
- const ancestorComponent = hostRef.$ancestorComponent$;
1188
- safeCall(instance, "componentDidRender", void 0, elm);
1189
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1190
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1191
- {
1192
- addHydratedFlag(elm);
1193
- }
1194
- safeCall(instance, "componentDidLoad", void 0, elm);
1195
- endPostUpdate();
1196
- {
1197
- hostRef.$onReadyResolve$(elm);
1198
- if (!ancestorComponent) {
1199
- appDidLoad();
1200
- }
1201
- }
1202
- } else {
1203
- safeCall(instance, "componentDidUpdate", void 0, elm);
1204
- endPostUpdate();
1205
- }
1206
- {
1207
- hostRef.$onInstanceResolve$(elm);
1208
- }
1209
- {
1210
- if (hostRef.$onRenderResolve$) {
1211
- hostRef.$onRenderResolve$();
1212
- hostRef.$onRenderResolve$ = void 0;
1213
- }
1214
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1215
- nextTick(() => scheduleUpdate(hostRef, false));
1216
- }
1217
- hostRef.$flags$ &= -517;
1218
- }
1219
- };
1220
- var appDidLoad = (who) => {
1221
- nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1222
- };
1223
- var safeCall = (instance, method, arg, elm) => {
1224
- if (instance && instance[method]) {
1225
- try {
1226
- return instance[method](arg);
1227
- } catch (e) {
1228
- consoleError(e, elm);
1229
- }
1230
- }
1231
- return void 0;
1232
- };
1233
- var addHydratedFlag = (elm) => {
1234
- var _a;
1235
- return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
1236
- };
1237
-
1238
- // src/runtime/set-value.ts
1239
- var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1240
- var setValue = (ref, propName, newVal, cmpMeta) => {
1241
- const hostRef = getHostRef(ref);
1242
- if (!hostRef) {
1243
- return;
1244
- }
1245
- if (!hostRef) {
1246
- throw new Error(
1247
- `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
1248
- );
1249
- }
1250
- const elm = hostRef.$hostElement$ ;
1251
- const oldVal = hostRef.$instanceValues$.get(propName);
1252
- const flags = hostRef.$flags$;
1253
- const instance = hostRef.$lazyInstance$ ;
1254
- newVal = parsePropertyValue(
1255
- newVal,
1256
- cmpMeta.$members$[propName][0]);
1257
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1258
- const didValueChange = newVal !== oldVal && !areBothNaN;
1259
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1260
- hostRef.$instanceValues$.set(propName, newVal);
1261
- if (instance) {
1262
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1263
- const watchMethods = cmpMeta.$watchers$[propName];
1264
- if (watchMethods) {
1265
- watchMethods.map((watchMethodName) => {
1266
- try {
1267
- instance[watchMethodName](newVal, oldVal, propName);
1268
- } catch (e) {
1269
- consoleError(e, elm);
1270
- }
1271
- });
1272
- }
1273
- }
1274
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1275
- if (instance.componentShouldUpdate) {
1276
- if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1277
- return;
1278
- }
1279
- }
1280
- scheduleUpdate(hostRef, false);
1281
- }
1282
- }
1283
- }
1284
- };
1285
-
1286
- // src/runtime/proxy-component.ts
1287
- var proxyComponent = (Cstr, cmpMeta, flags) => {
1288
- var _a, _b;
1289
- const prototype = Cstr.prototype;
1290
- if (cmpMeta.$members$ || BUILD.propChangeCallback) {
1291
- {
1292
- if (Cstr.watchers && !cmpMeta.$watchers$) {
1293
- cmpMeta.$watchers$ = Cstr.watchers;
1294
- }
1295
- if (Cstr.deserializers && !cmpMeta.$deserializers$) {
1296
- cmpMeta.$deserializers$ = Cstr.deserializers;
1297
- }
1298
- if (Cstr.serializers && !cmpMeta.$serializers$) {
1299
- cmpMeta.$serializers$ = Cstr.serializers;
1300
- }
1301
- }
1302
- const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1303
- members.map(([memberName, [memberFlags]]) => {
1304
- if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1305
- const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
1306
- if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
1307
- if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
1308
- if (flags & 1 /* isElementConstructor */ || !origGetter) {
1309
- Object.defineProperty(prototype, memberName, {
1310
- get() {
1311
- {
1312
- if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
1313
- return getValue(this, memberName);
1314
- }
1315
- const ref = getHostRef(this);
1316
- const instance = ref ? ref.$lazyInstance$ : prototype;
1317
- if (!instance) return;
1318
- return instance[memberName];
1319
- }
1320
- },
1321
- configurable: true,
1322
- enumerable: true
1323
- });
1324
- }
1325
- Object.defineProperty(prototype, memberName, {
1326
- set(newValue) {
1327
- const ref = getHostRef(this);
1328
- if (!ref) {
1329
- return;
1330
- }
1331
- if (origSetter) {
1332
- const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1333
- if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
1334
- newValue = ref.$instanceValues$.get(memberName);
1335
- }
1336
- origSetter.apply(this, [
1337
- parsePropertyValue(
1338
- newValue,
1339
- memberFlags)
1340
- ]);
1341
- newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1342
- setValue(this, memberName, newValue, cmpMeta);
1343
- return;
1344
- }
1345
- {
1346
- if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1347
- setValue(this, memberName, newValue, cmpMeta);
1348
- if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1349
- ref.$fetchedCbList$.push(() => {
1350
- if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1351
- ref.$lazyInstance$[memberName] = newValue;
1352
- }
1353
- });
1354
- }
1355
- return;
1356
- }
1357
- const setterSetVal = () => {
1358
- const currentValue = ref.$lazyInstance$[memberName];
1359
- if (!ref.$instanceValues$.get(memberName) && currentValue) {
1360
- ref.$instanceValues$.set(memberName, currentValue);
1361
- }
1362
- ref.$lazyInstance$[memberName] = parsePropertyValue(
1363
- newValue,
1364
- memberFlags);
1365
- setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1366
- };
1367
- if (ref.$lazyInstance$) {
1368
- setterSetVal();
1369
- } else {
1370
- ref.$fetchedCbList$.push(() => {
1371
- setterSetVal();
1372
- });
1373
- }
1374
- }
1375
- }
1376
- });
1377
- } else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
1378
- Object.defineProperty(prototype, memberName, {
1379
- value(...args) {
1380
- var _a2;
1381
- const ref = getHostRef(this);
1382
- return (_a2 = ref == null ? void 0 : ref.$onInstancePromise$) == null ? void 0 : _a2.then(() => {
1383
- var _a3;
1384
- return (_a3 = ref.$lazyInstance$) == null ? void 0 : _a3[memberName](...args);
1385
- });
1386
- }
1387
- });
1388
- }
1389
- });
1390
- if ((flags & 1 /* isElementConstructor */)) {
1391
- const attrNameToPropName = /* @__PURE__ */ new Map();
1392
- prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
1393
- plt.jmp(() => {
1394
- var _a2;
1395
- const propName = attrNameToPropName.get(attrName);
1396
- const hostRef = getHostRef(this);
1397
- if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
1398
- newValue = this[propName];
1399
- delete this[propName];
1400
- }
1401
- if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
1402
- this[propName] == newValue) {
1403
- return;
1404
- } else if (propName == null) {
1405
- const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
1406
- if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
1407
- const instance = hostRef.$lazyInstance$ ;
1408
- const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
1409
- entry == null ? void 0 : entry.forEach((callbackName) => {
1410
- if (instance[callbackName] != null) {
1411
- instance[callbackName].call(instance, newValue, oldValue, attrName);
1412
- }
1413
- });
1414
- }
1415
- return;
1416
- }
1417
- const propFlags = members.find(([m]) => m === propName);
1418
- if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
1419
- newValue = newValue === null || newValue === "false" ? false : true;
1420
- }
1421
- const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1422
- if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
1423
- this[propName] = newValue;
1424
- }
1425
- });
1426
- };
1427
- Cstr.observedAttributes = Array.from(
1428
- /* @__PURE__ */ new Set([
1429
- ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
1430
- ...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
1431
- var _a2;
1432
- const attrName = m[1] || propName;
1433
- attrNameToPropName.set(attrName, propName);
1434
- if (m[0] & 512 /* ReflectAttr */) {
1435
- (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
1436
- }
1437
- return attrName;
1438
- })
1439
- ])
1440
- );
1441
- }
1442
- }
1443
- return Cstr;
1444
- };
1445
-
1446
- // src/runtime/initialize-component.ts
1447
- var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1448
- let Cstr;
1449
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1450
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1451
- const bundleId = cmpMeta.$lazyBundleId$;
1452
- if (bundleId) {
1453
- const CstrImport = loadModule(cmpMeta, hostRef);
1454
- if (CstrImport && "then" in CstrImport) {
1455
- const endLoad = uniqueTime();
1456
- Cstr = await CstrImport;
1457
- endLoad();
1458
- } else {
1459
- Cstr = CstrImport;
1460
- }
1461
- if (!Cstr) {
1462
- throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1463
- }
1464
- if (!Cstr.isProxied) {
1465
- {
1466
- cmpMeta.$watchers$ = Cstr.watchers;
1467
- cmpMeta.$serializers$ = Cstr.serializers;
1468
- cmpMeta.$deserializers$ = Cstr.deserializers;
1469
- }
1470
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1471
- Cstr.isProxied = true;
1472
- }
1473
- const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
1474
- {
1475
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1476
- }
1477
- try {
1478
- new Cstr(hostRef);
1479
- } catch (e) {
1480
- consoleError(e, elm);
1481
- }
1482
- {
1483
- hostRef.$flags$ &= -9 /* isConstructingInstance */;
1484
- }
1485
- {
1486
- hostRef.$flags$ |= 128 /* isWatchReady */;
1487
- }
1488
- endNewInstance();
1489
- fireConnectedCallback(hostRef.$lazyInstance$, elm);
1490
- } else {
1491
- Cstr = elm.constructor;
1492
- const cmpTag = elm.localName;
1493
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1494
- }
1495
- if (Cstr && Cstr.style) {
1496
- let style;
1497
- if (typeof Cstr.style === "string") {
1498
- style = Cstr.style;
1499
- }
1500
- const scopeId2 = getScopeId(cmpMeta);
1501
- if (!styles.has(scopeId2)) {
1502
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
1503
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1504
- endRegisterStyles();
1505
- }
1506
- }
1507
- }
1508
- const ancestorComponent = hostRef.$ancestorComponent$;
1509
- const schedule = () => scheduleUpdate(hostRef, true);
1510
- if (ancestorComponent && ancestorComponent["s-rc"]) {
1511
- ancestorComponent["s-rc"].push(schedule);
1512
- } else {
1513
- schedule();
1514
- }
1515
- };
1516
- var fireConnectedCallback = (instance, elm) => {
1517
- {
1518
- safeCall(instance, "connectedCallback", void 0, elm);
1519
- }
1520
- };
1521
-
1522
- // src/runtime/connected-callback.ts
1523
- var connectedCallback = (elm) => {
1524
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1525
- const hostRef = getHostRef(elm);
1526
- if (!hostRef) {
1527
- return;
1528
- }
1529
- const cmpMeta = hostRef.$cmpMeta$;
1530
- const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
1531
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1532
- hostRef.$flags$ |= 1 /* hasConnected */;
1533
- {
1534
- let ancestorComponent = elm;
1535
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1536
- if (ancestorComponent["s-p"]) {
1537
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1538
- break;
1539
- }
1540
- }
1541
- }
1542
- if (cmpMeta.$members$) {
1543
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1544
- if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
1545
- const value = elm[memberName];
1546
- delete elm[memberName];
1547
- elm[memberName] = value;
1548
- }
1549
- });
1550
- }
1551
- {
1552
- initializeComponent(elm, hostRef, cmpMeta);
1553
- }
1554
- } else {
1555
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1556
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1557
- fireConnectedCallback(hostRef.$lazyInstance$, elm);
1558
- } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1559
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1560
- }
1561
- }
1562
- endConnected();
1563
- }
1564
- };
1565
- var disconnectInstance = (instance, elm) => {
1566
- {
1567
- safeCall(instance, "disconnectedCallback", void 0, elm || instance);
1568
- }
1569
- };
1570
- var disconnectedCallback = async (elm) => {
1571
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1572
- const hostRef = getHostRef(elm);
1573
- {
1574
- if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
1575
- hostRef.$rmListeners$.map((rmListener) => rmListener());
1576
- hostRef.$rmListeners$ = void 0;
1577
- }
1578
- }
1579
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1580
- disconnectInstance(hostRef.$lazyInstance$, elm);
1581
- } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1582
- hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
1583
- }
1584
- }
1585
- if (rootAppliedStyles.has(elm)) {
1586
- rootAppliedStyles.delete(elm);
1587
- }
1588
- if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1589
- rootAppliedStyles.delete(elm.shadowRoot);
1590
- }
1591
- };
1592
-
1593
- // src/runtime/bootstrap-lazy.ts
1594
- var bootstrapLazy = (lazyBundles, options = {}) => {
1595
- var _a;
1596
- if (!win.document) {
1597
- console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
1598
- return;
1599
- }
1600
- const endBootstrap = createTime();
1601
- const cmpTags = [];
1602
- const exclude = options.exclude || [];
1603
- const customElements2 = win.customElements;
1604
- const head = win.document.head;
1605
- const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
1606
- const dataStyles = /* @__PURE__ */ win.document.createElement("style");
1607
- const deferredConnectedCallbacks = [];
1608
- let appLoadFallback;
1609
- let isBootstrapping = true;
1610
- Object.assign(plt, options);
1611
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
1612
- let hasSlotRelocation = false;
1613
- lazyBundles.map((lazyBundle) => {
1614
- lazyBundle[1].map((compactMeta) => {
1615
- var _a2, _b, _c;
1616
- const cmpMeta = {
1617
- $flags$: compactMeta[0],
1618
- $tagName$: compactMeta[1],
1619
- $members$: compactMeta[2],
1620
- $listeners$: compactMeta[3]
1621
- };
1622
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1623
- hasSlotRelocation = true;
1624
- }
1625
- {
1626
- cmpMeta.$members$ = compactMeta[2];
1627
- }
1628
- {
1629
- cmpMeta.$listeners$ = compactMeta[3];
1630
- }
1631
- {
1632
- cmpMeta.$attrsToReflect$ = [];
1633
- }
1634
- {
1635
- cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
1636
- cmpMeta.$serializers$ = (_b = compactMeta[5]) != null ? _b : {};
1637
- cmpMeta.$deserializers$ = (_c = compactMeta[6]) != null ? _c : {};
1638
- }
1639
- const tagName = cmpMeta.$tagName$;
1640
- const HostElement = class extends HTMLElement {
1641
- // StencilLazyHost
1642
- constructor(self) {
1643
- super(self);
1644
- this.hasRegisteredEventListeners = false;
1645
- self = this;
1646
- registerHost(self, cmpMeta);
1647
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1648
- {
1649
- if (!self.shadowRoot) {
1650
- createShadowRoot.call(self, cmpMeta);
1651
- } else {
1652
- if (self.shadowRoot.mode !== "open") {
1653
- throw new Error(
1654
- `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.`
1655
- );
1656
- }
1657
- }
1658
- }
1659
- }
1660
- }
1661
- connectedCallback() {
1662
- const hostRef = getHostRef(this);
1663
- if (!hostRef) {
1664
- return;
1665
- }
1666
- if (!this.hasRegisteredEventListeners) {
1667
- this.hasRegisteredEventListeners = true;
1668
- addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
1669
- }
1670
- if (appLoadFallback) {
1671
- clearTimeout(appLoadFallback);
1672
- appLoadFallback = null;
1673
- }
1674
- if (isBootstrapping) {
1675
- deferredConnectedCallbacks.push(this);
1676
- } else {
1677
- plt.jmp(() => connectedCallback(this));
1678
- }
1679
- }
1680
- disconnectedCallback() {
1681
- plt.jmp(() => disconnectedCallback(this));
1682
- plt.raf(() => {
1683
- var _a3;
1684
- const hostRef = getHostRef(this);
1685
- if (!hostRef) {
1686
- return;
1687
- }
1688
- const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
1689
- if (i2 > -1) {
1690
- deferredConnectedCallbacks.splice(i2, 1);
1691
- }
1692
- if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1693
- delete hostRef.$vnode$.$elm$;
1694
- }
1695
- });
1696
- }
1697
- componentOnReady() {
1698
- var _a3;
1699
- return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
1700
- }
1701
- };
1702
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1703
- if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
1704
- cmpTags.push(tagName);
1705
- customElements2.define(
1706
- tagName,
1707
- proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)
1708
- );
1709
- }
1710
- });
1711
- });
1712
- if (cmpTags.length > 0) {
1713
- if (hasSlotRelocation) {
1714
- dataStyles.textContent += SLOT_FB_CSS;
1715
- }
1716
- {
1717
- dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
1718
- }
1719
- if (dataStyles.innerHTML.length) {
1720
- dataStyles.setAttribute("data-styles", "");
1721
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1722
- if (nonce != null) {
1723
- dataStyles.setAttribute("nonce", nonce);
1724
- }
1725
- head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1726
- }
1727
- }
1728
- isBootstrapping = false;
1729
- if (deferredConnectedCallbacks.length) {
1730
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
1731
- } else {
1732
- {
1733
- plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
1734
- }
1735
- }
1736
- endBootstrap();
1737
- };
1738
-
1739
- // src/runtime/fragment.ts
1740
- var Fragment = (_, children) => children;
1741
- var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1742
- if (listeners && win.document) {
1743
- listeners.map(([flags, name, method]) => {
1744
- const target = getHostListenerTarget(win.document, elm, flags) ;
1745
- const handler = hostListenerProxy(hostRef, method);
1746
- const opts = hostListenerOpts(flags);
1747
- plt.ael(target, name, handler, opts);
1748
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1749
- });
1750
- }
1751
- };
1752
- var hostListenerProxy = (hostRef, methodName) => (ev) => {
1753
- var _a;
1754
- try {
1755
- {
1756
- if (hostRef.$flags$ & 256 /* isListenReady */) {
1757
- (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
1758
- } else {
1759
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1760
- }
1761
- }
1762
- } catch (e) {
1763
- consoleError(e, hostRef.$hostElement$);
1764
- }
1765
- };
1766
- var getHostListenerTarget = (doc, elm, flags) => {
1767
- if (flags & 8 /* TargetWindow */) {
1768
- return win;
1769
- }
1770
- return elm;
1771
- };
1772
- var hostListenerOpts = (flags) => supportsListenerOptions ? {
1773
- passive: (flags & 1 /* Passive */) !== 0,
1774
- capture: (flags & 2 /* Capture */) !== 0
1775
- } : (flags & 2 /* Capture */) !== 0;
1776
-
1777
- // src/runtime/nonce.ts
1778
- var setNonce = (nonce) => plt.$nonce$ = nonce;
1779
-
1780
- exports.Fragment = Fragment;
1781
- exports.Host = Host;
1782
- exports.bootstrapLazy = bootstrapLazy;
1783
- exports.createEvent = createEvent;
1784
- exports.getElement = getElement;
1785
- exports.getMode = getMode;
1786
- exports.getTheme = getTheme;
1787
- exports.globalScripts = globalScripts;
1788
- exports.h = h;
1789
- exports.promiseResolve = promiseResolve;
1790
- exports.registerInstance = registerInstance;
1791
- exports.setGlobalMode = setGlobalMode;
1792
- exports.setGlobalTheme = setGlobalTheme;
1793
- exports.setNonce = setNonce;
1794
- //# sourceMappingURL=index-CO4npcak.js.map
1795
-
1796
- //# sourceMappingURL=index-CO4npcak.js.map