@sankhyalabs/sankhyablocks 1.1.28 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +75 -75
  3. package/dist/cjs/index-4720dab8.js +735 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  6. package/dist/cjs/snk-application.cjs.entry.js +668 -653
  7. package/dist/collection/collection-manifest.json +5 -34
  8. package/dist/collection/components/snk-application/snk-application.css +5 -5
  9. package/dist/collection/components/snk-application/snk-application.js +492 -492
  10. package/dist/collection/index.js +1 -1
  11. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +158 -158
  12. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js +23 -23
  13. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +188 -188
  14. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +25 -25
  15. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +2 -2
  16. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +59 -59
  17. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +30 -30
  18. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js +66 -66
  19. package/dist/collection/lib/utils/pesquisa.js +16 -16
  20. package/dist/collection/lib/utils/urlutils.js +23 -23
  21. package/dist/collection/lib/workspace/workspace.js +7 -7
  22. package/dist/components/snk-application.js +655 -640
  23. package/dist/esm/index-72d4e2e0.js +709 -0
  24. package/dist/esm/loader.js +2 -2
  25. package/dist/esm/polyfills/core-js.js +0 -0
  26. package/dist/esm/polyfills/dom.js +0 -0
  27. package/dist/esm/polyfills/es5-html-element.js +0 -0
  28. package/dist/esm/polyfills/index.js +0 -0
  29. package/dist/esm/polyfills/system.js +0 -0
  30. package/dist/esm/sankhyablocks.js +2 -2
  31. package/dist/esm/snk-application.entry.js +626 -611
  32. package/dist/sankhyablocks/p-5d8ddbda.entry.js +57 -0
  33. package/dist/sankhyablocks/p-a33afc3b.js +2 -0
  34. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  35. package/dist/types/components/snk-application/snk-application.d.ts +44 -44
  36. package/dist/types/index.d.ts +1 -1
  37. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +15 -15
  38. package/dist/types/lib/http/data-fetcher/fetchers/application-config-fetcher.d.ts +6 -6
  39. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +12 -12
  40. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +5 -5
  41. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +2 -2
  42. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +13 -13
  43. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +6 -6
  44. package/dist/types/lib/http/data-fetcher/state/LoadStateManager.d.ts +23 -23
  45. package/dist/types/lib/utils/pesquisa.d.ts +2 -2
  46. package/dist/types/lib/utils/urlutils.d.ts +4 -4
  47. package/dist/types/lib/workspace/workspace.d.ts +4 -4
  48. package/package.json +63 -52
  49. package/react/.keepfolder +1 -0
  50. package/react/components.d.ts +3 -32
  51. package/react/components.js +5 -34
  52. package/react/components.js.map +1 -1
  53. package/react/react-component-lib/createComponent.d.ts +10 -10
  54. package/react/react-component-lib/createComponent.js +58 -74
  55. package/react/react-component-lib/createComponent.js.map +1 -1
  56. package/react/react-component-lib/createOverlayComponent.d.ts +20 -21
  57. package/react/react-component-lib/createOverlayComponent.js +88 -108
  58. package/react/react-component-lib/createOverlayComponent.js.map +1 -1
  59. package/react/react-component-lib/index.d.ts +2 -2
  60. package/react/react-component-lib/index.js +2 -2
  61. package/react/react-component-lib/interfaces.d.ts +29 -29
  62. package/react/react-component-lib/utils/attachProps.d.ts +12 -12
  63. package/react/react-component-lib/utils/attachProps.js +95 -97
  64. package/react/react-component-lib/utils/attachProps.js.map +1 -1
  65. package/react/react-component-lib/utils/case.d.ts +2 -2
  66. package/react/react-component-lib/utils/case.js +6 -6
  67. package/react/react-component-lib/utils/dev.d.ts +2 -2
  68. package/react/react-component-lib/utils/dev.js +12 -12
  69. package/react/react-component-lib/utils/index.d.ts +7 -10
  70. package/react/react-component-lib/utils/index.js +20 -33
  71. package/react/react-component-lib/utils/index.js.map +1 -1
  72. package/dist/cjs/ApplicationUtils-05b74ee9.js +0 -39
  73. package/dist/cjs/AssetsUtils-7e3c38f9.js +0 -24
  74. package/dist/cjs/CSSVarsUtils-75ca9c64.js +0 -19
  75. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  76. package/dist/cjs/ez-action-chip.cjs.entry.js +0 -27
  77. package/dist/cjs/ez-application.cjs.entry.js +0 -26
  78. package/dist/cjs/ez-button_4.cjs.entry.js +0 -660
  79. package/dist/cjs/ez-calendar.cjs.entry.js +0 -223
  80. package/dist/cjs/ez-collapsible-box.cjs.entry.js +0 -47
  81. package/dist/cjs/ez-combo-box.cjs.entry.js +0 -278
  82. package/dist/cjs/ez-date-input.cjs.entry.js +0 -102
  83. package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -145
  84. package/dist/cjs/ez-dialog.cjs.entry.js +0 -89
  85. package/dist/cjs/ez-form.cjs.entry.js +0 -785
  86. package/dist/cjs/ez-grid.cjs.entry.js +0 -110485
  87. package/dist/cjs/ez-icon.cjs.entry.js +0 -41
  88. package/dist/cjs/ez-label-chip.cjs.entry.js +0 -104
  89. package/dist/cjs/ez-modal_2.cjs.entry.js +0 -316
  90. package/dist/cjs/ez-number-input.cjs.entry.js +0 -86
  91. package/dist/cjs/ez-popover.cjs.entry.js +0 -120
  92. package/dist/cjs/ez-popup.cjs.entry.js +0 -48
  93. package/dist/cjs/ez-search.cjs.entry.js +0 -64
  94. package/dist/cjs/ez-tabselector.cjs.entry.js +0 -198
  95. package/dist/cjs/ez-text-area.cjs.entry.js +0 -114
  96. package/dist/cjs/ez-text-input.cjs.entry.js +0 -201
  97. package/dist/cjs/ez-time-input.cjs.entry.js +0 -118
  98. package/dist/cjs/ez-toast.cjs.entry.js +0 -44
  99. package/dist/cjs/ez-upload.cjs.entry.js +0 -356
  100. package/dist/cjs/index-682c98b2.js +0 -1771
  101. package/dist/cjs/test-du.cjs.entry.js +0 -76
  102. package/dist/components/ApplicationUtils.js +0 -37
  103. package/dist/components/AssetsUtils.js +0 -22
  104. package/dist/components/CSSVarsUtils.js +0 -17
  105. package/dist/components/_commonjsHelpers.js +0 -17
  106. package/dist/components/ez-action-chip.js +0 -44
  107. package/dist/components/ez-application.js +0 -39
  108. package/dist/components/ez-button.js +0 -6
  109. package/dist/components/ez-button2.js +0 -105
  110. package/dist/components/ez-calendar.js +0 -6
  111. package/dist/components/ez-calendar2.js +0 -242
  112. package/dist/components/ez-check.js +0 -6
  113. package/dist/components/ez-check2.js +0 -94
  114. package/dist/components/ez-collapsible-box.js +0 -67
  115. package/dist/components/ez-combo-box.js +0 -6
  116. package/dist/components/ez-combo-box2.js +0 -311
  117. package/dist/components/ez-date-input.js +0 -135
  118. package/dist/components/ez-date-time-input.js +0 -179
  119. package/dist/components/ez-dialog.js +0 -124
  120. package/dist/components/ez-form.js +0 -6
  121. package/dist/components/ez-form2.js +0 -807
  122. package/dist/components/ez-grid.js +0 -110576
  123. package/dist/components/ez-icon.js +0 -6
  124. package/dist/components/ez-icon2.js +0 -56
  125. package/dist/components/ez-label-chip.js +0 -125
  126. package/dist/components/ez-list.js +0 -6
  127. package/dist/components/ez-list2.js +0 -523
  128. package/dist/components/ez-modal.js +0 -6
  129. package/dist/components/ez-modal2.js +0 -82
  130. package/dist/components/ez-number-input.js +0 -115
  131. package/dist/components/ez-popover.js +0 -145
  132. package/dist/components/ez-popup.js +0 -67
  133. package/dist/components/ez-search.js +0 -100
  134. package/dist/components/ez-tabselector.js +0 -6
  135. package/dist/components/ez-tabselector2.js +0 -213
  136. package/dist/components/ez-text-area.js +0 -137
  137. package/dist/components/ez-text-input.js +0 -6
  138. package/dist/components/ez-text-input2.js +0 -223
  139. package/dist/components/ez-time-input.js +0 -153
  140. package/dist/components/ez-toast.js +0 -64
  141. package/dist/components/ez-upload.js +0 -382
  142. package/dist/components/grid-config.js +0 -6
  143. package/dist/components/grid-config2.js +0 -318
  144. package/dist/components/select-box.js +0 -6
  145. package/dist/components/select-box2.js +0 -47
  146. package/dist/components/test-du.js +0 -101
  147. package/dist/esm/ApplicationUtils-e0b6d857.js +0 -37
  148. package/dist/esm/AssetsUtils-6e6624dc.js +0 -22
  149. package/dist/esm/CSSVarsUtils-0787c3f3.js +0 -17
  150. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  151. package/dist/esm/ez-action-chip.entry.js +0 -23
  152. package/dist/esm/ez-application.entry.js +0 -22
  153. package/dist/esm/ez-button_4.entry.js +0 -653
  154. package/dist/esm/ez-calendar.entry.js +0 -219
  155. package/dist/esm/ez-collapsible-box.entry.js +0 -43
  156. package/dist/esm/ez-combo-box.entry.js +0 -274
  157. package/dist/esm/ez-date-input.entry.js +0 -98
  158. package/dist/esm/ez-date-time-input.entry.js +0 -141
  159. package/dist/esm/ez-dialog.entry.js +0 -85
  160. package/dist/esm/ez-form.entry.js +0 -781
  161. package/dist/esm/ez-grid.entry.js +0 -110481
  162. package/dist/esm/ez-icon.entry.js +0 -37
  163. package/dist/esm/ez-label-chip.entry.js +0 -100
  164. package/dist/esm/ez-modal_2.entry.js +0 -311
  165. package/dist/esm/ez-number-input.entry.js +0 -82
  166. package/dist/esm/ez-popover.entry.js +0 -116
  167. package/dist/esm/ez-popup.entry.js +0 -44
  168. package/dist/esm/ez-search.entry.js +0 -60
  169. package/dist/esm/ez-tabselector.entry.js +0 -194
  170. package/dist/esm/ez-text-area.entry.js +0 -110
  171. package/dist/esm/ez-text-input.entry.js +0 -197
  172. package/dist/esm/ez-time-input.entry.js +0 -114
  173. package/dist/esm/ez-toast.entry.js +0 -40
  174. package/dist/esm/ez-upload.entry.js +0 -352
  175. package/dist/esm/index-35088a3f.js +0 -1740
  176. package/dist/esm/test-du.entry.js +0 -72
  177. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-action-chip/ez-action-chip.css +0 -67
  178. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-application/ez-application.css +0 -3
  179. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-button/ez-button.css +0 -180
  180. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-calendar/ez-calendar.css +0 -319
  181. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-check/ez-check.css +0 -327
  182. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +0 -162
  183. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -217
  184. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-input/ez-date-input.css +0 -49
  185. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-time-input/ez-date-time-input.css +0 -44
  186. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-dialog/ez-dialog.css +0 -527
  187. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-form/ez-form.css +0 -5
  188. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/ez-grid.css +0 -31
  189. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +0 -129
  190. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +0 -10
  191. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-icon/ez-icon.css +0 -176
  192. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-label-chip/ez-label-chip.css +0 -139
  193. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-list/ez-list.css +0 -335
  194. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-modal/ez-modal.css +0 -358
  195. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-number-input/ez-number-input.css +0 -4
  196. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popover/ez-popover.css +0 -44
  197. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popup/ez-popup.css +0 -405
  198. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-search/ez-search.css +0 -3
  199. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -138
  200. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-area/ez-text-area.css +0 -165
  201. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-input/ez-text-input.css +0 -196
  202. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-time-input/ez-time-input.css +0 -10
  203. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-toast/ez-toast.css +0 -127
  204. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-upload/ez-upload.css +0 -568
  205. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/test-du/test-du.css +0 -3
  206. package/dist/sankhyablocks/p-0183d259.entry.js +0 -1
  207. package/dist/sankhyablocks/p-01f23a70.entry.js +0 -1
  208. package/dist/sankhyablocks/p-07c32f68.entry.js +0 -1
  209. package/dist/sankhyablocks/p-0f90499d.entry.js +0 -1
  210. package/dist/sankhyablocks/p-105724a3.entry.js +0 -1
  211. package/dist/sankhyablocks/p-112455b1.js +0 -1
  212. package/dist/sankhyablocks/p-2ac02d48.entry.js +0 -1
  213. package/dist/sankhyablocks/p-35364a97.entry.js +0 -1
  214. package/dist/sankhyablocks/p-3f6aa9a7.entry.js +0 -1
  215. package/dist/sankhyablocks/p-4811bc0a.entry.js +0 -369
  216. package/dist/sankhyablocks/p-5f9af495.entry.js +0 -1
  217. package/dist/sankhyablocks/p-60967cf0.js +0 -1
  218. package/dist/sankhyablocks/p-70ad6c16.entry.js +0 -1
  219. package/dist/sankhyablocks/p-710bfffe.entry.js +0 -1
  220. package/dist/sankhyablocks/p-73397a0f.entry.js +0 -57
  221. package/dist/sankhyablocks/p-811b4b9d.js +0 -1
  222. package/dist/sankhyablocks/p-813fe4f7.js +0 -1
  223. package/dist/sankhyablocks/p-85a9446b.js +0 -2
  224. package/dist/sankhyablocks/p-89a1100f.entry.js +0 -1
  225. package/dist/sankhyablocks/p-8b543003.entry.js +0 -1
  226. package/dist/sankhyablocks/p-9750632b.entry.js +0 -1
  227. package/dist/sankhyablocks/p-a96272f7.entry.js +0 -1
  228. package/dist/sankhyablocks/p-ac8842e5.entry.js +0 -1
  229. package/dist/sankhyablocks/p-ba64cc41.entry.js +0 -1
  230. package/dist/sankhyablocks/p-c1ede043.entry.js +0 -1
  231. package/dist/sankhyablocks/p-d90ebb85.entry.js +0 -1
  232. package/dist/sankhyablocks/p-e5355a29.entry.js +0 -1
  233. package/dist/sankhyablocks/p-ef04b633.entry.js +0 -1
  234. package/dist/sankhyablocks/p-f6db07fb.entry.js +0 -1
  235. package/dist/sankhyablocks/p-f80cabc7.entry.js +0 -1
  236. package/dist/sankhyablocks/p-fcd9bd92.entry.js +0 -1
@@ -0,0 +1,709 @@
1
+ const NAMESPACE = 'sankhyablocks';
2
+
3
+ let scopeId;
4
+ let queuePending = false;
5
+ const win = typeof window !== 'undefined' ? window : {};
6
+ const doc = win.document || { head: {} };
7
+ const plt = {
8
+ $flags$: 0,
9
+ $resourcesUrl$: '',
10
+ jmp: (h) => h(),
11
+ raf: (h) => requestAnimationFrame(h),
12
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
13
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
14
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
15
+ };
16
+ const promiseResolve = (v) => Promise.resolve(v);
17
+ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
18
+ try {
19
+ new CSSStyleSheet();
20
+ return typeof new CSSStyleSheet().replace === 'function';
21
+ }
22
+ catch (e) { }
23
+ return false;
24
+ })()
25
+ ;
26
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
27
+ const createTime = (fnName, tagName = '') => {
28
+ {
29
+ return () => {
30
+ return;
31
+ };
32
+ }
33
+ };
34
+ const uniqueTime = (key, measureText) => {
35
+ {
36
+ return () => {
37
+ return;
38
+ };
39
+ }
40
+ };
41
+ const rootAppliedStyles = new WeakMap();
42
+ const registerStyle = (scopeId, cssText, allowCS) => {
43
+ let style = styles.get(scopeId);
44
+ if (supportsConstructibleStylesheets && allowCS) {
45
+ style = (style || new CSSStyleSheet());
46
+ style.replace(cssText);
47
+ }
48
+ else {
49
+ style = cssText;
50
+ }
51
+ styles.set(scopeId, style);
52
+ };
53
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
54
+ let scopeId = getScopeId(cmpMeta);
55
+ const style = styles.get(scopeId);
56
+ // if an element is NOT connected then getRootNode() will return the wrong root node
57
+ // so the fallback is to always use the document for the root node in those cases
58
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
59
+ if (style) {
60
+ if (typeof style === 'string') {
61
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
62
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
63
+ let styleElm;
64
+ if (!appliedStyles) {
65
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
66
+ }
67
+ if (!appliedStyles.has(scopeId)) {
68
+ {
69
+ {
70
+ styleElm = doc.createElement('style');
71
+ styleElm.innerHTML = style;
72
+ }
73
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
74
+ }
75
+ if (appliedStyles) {
76
+ appliedStyles.add(scopeId);
77
+ }
78
+ }
79
+ }
80
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
81
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
82
+ }
83
+ }
84
+ return scopeId;
85
+ };
86
+ const attachStyles = (hostRef) => {
87
+ const cmpMeta = hostRef.$cmpMeta$;
88
+ const elm = hostRef.$hostElement$;
89
+ const flags = cmpMeta.$flags$;
90
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
91
+ const scopeId = addStyle(elm.getRootNode(), cmpMeta);
92
+ if (flags & 10 /* needsScopedEncapsulation */) {
93
+ // only required when we're NOT using native shadow dom (slot)
94
+ // or this browser doesn't support native shadow dom
95
+ // and this host element was NOT created with SSR
96
+ // let's pick out the inner content for slot projection
97
+ // create a node to represent where the original
98
+ // content was first placed, which is useful later on
99
+ // DOM WRITE!!
100
+ elm['s-sc'] = scopeId;
101
+ elm.classList.add(scopeId + '-h');
102
+ if (flags & 2 /* scopedCssEncapsulation */) {
103
+ elm.classList.add(scopeId + '-s');
104
+ }
105
+ }
106
+ endAttachStyles();
107
+ };
108
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
109
+ const isDef = (v) => v != null;
110
+ const isComplexType = (o) => {
111
+ // https://jsperf.com/typeof-fn-object/5
112
+ o = typeof o;
113
+ return o === 'object' || o === 'function';
114
+ };
115
+ /**
116
+ * Production h() function based on Preact by
117
+ * Jason Miller (@developit)
118
+ * Licensed under the MIT License
119
+ * https://github.com/developit/preact/blob/master/LICENSE
120
+ *
121
+ * Modified for Stencil's compiler and vdom
122
+ */
123
+ // const stack: any[] = [];
124
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
125
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
126
+ const h = (nodeName, vnodeData, ...children) => {
127
+ let child = null;
128
+ let simple = false;
129
+ let lastSimple = false;
130
+ const vNodeChildren = [];
131
+ const walk = (c) => {
132
+ for (let i = 0; i < c.length; i++) {
133
+ child = c[i];
134
+ if (Array.isArray(child)) {
135
+ walk(child);
136
+ }
137
+ else if (child != null && typeof child !== 'boolean') {
138
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
139
+ child = String(child);
140
+ }
141
+ if (simple && lastSimple) {
142
+ // If the previous child was simple (string), we merge both
143
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
144
+ }
145
+ else {
146
+ // Append a new vNode, if it's text, we create a text vNode
147
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
148
+ }
149
+ lastSimple = simple;
150
+ }
151
+ }
152
+ };
153
+ walk(children);
154
+ const vnode = newVNode(nodeName, null);
155
+ vnode.$attrs$ = vnodeData;
156
+ if (vNodeChildren.length > 0) {
157
+ vnode.$children$ = vNodeChildren;
158
+ }
159
+ return vnode;
160
+ };
161
+ const newVNode = (tag, text) => {
162
+ const vnode = {
163
+ $flags$: 0,
164
+ $tag$: tag,
165
+ $text$: text,
166
+ $elm$: null,
167
+ $children$: null,
168
+ };
169
+ return vnode;
170
+ };
171
+ const Host = {};
172
+ const isHost = (node) => node && node.$tag$ === Host;
173
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
174
+ // tslint:disable-next-line: prefer-const
175
+ const newVNode = newParentVNode.$children$[childIndex];
176
+ let i = 0;
177
+ let elm;
178
+ let childNode;
179
+ {
180
+ // create element
181
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
182
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
183
+ // if there is a scopeId and this is the initial render
184
+ // then let's add the scopeId as a css class
185
+ elm.classList.add((elm['s-si'] = scopeId));
186
+ }
187
+ if (newVNode.$children$) {
188
+ for (i = 0; i < newVNode.$children$.length; ++i) {
189
+ // create the node
190
+ childNode = createElm(oldParentVNode, newVNode, i);
191
+ // return node could have been null
192
+ if (childNode) {
193
+ // append our new node
194
+ elm.appendChild(childNode);
195
+ }
196
+ }
197
+ }
198
+ }
199
+ return elm;
200
+ };
201
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
202
+ let containerElm = (parentElm);
203
+ let childNode;
204
+ for (; startIdx <= endIdx; ++startIdx) {
205
+ if (vnodes[startIdx]) {
206
+ childNode = createElm(null, parentVNode, startIdx);
207
+ if (childNode) {
208
+ vnodes[startIdx].$elm$ = childNode;
209
+ containerElm.insertBefore(childNode, before);
210
+ }
211
+ }
212
+ }
213
+ };
214
+ const patch = (oldVNode, newVNode) => {
215
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
216
+ const newChildren = newVNode.$children$;
217
+ {
218
+ if (newChildren !== null) {
219
+ // add the new vnode children
220
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
221
+ }
222
+ else ;
223
+ }
224
+ };
225
+ const renderVdom = (hostRef, renderFnResults) => {
226
+ const hostElm = hostRef.$hostElement$;
227
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
228
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
229
+ rootVnode.$tag$ = null;
230
+ rootVnode.$flags$ |= 4 /* isHost */;
231
+ hostRef.$vnode$ = rootVnode;
232
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
233
+ {
234
+ scopeId = hostElm['s-sc'];
235
+ }
236
+ // synchronous patch
237
+ patch(oldVNode, rootVnode);
238
+ };
239
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
240
+ const createEvent = (ref, name, flags) => {
241
+ const elm = getElement(ref);
242
+ return {
243
+ emit: (detail) => {
244
+ return emitEvent(elm, name, {
245
+ bubbles: !!(flags & 4 /* Bubbles */),
246
+ composed: !!(flags & 2 /* Composed */),
247
+ cancelable: !!(flags & 1 /* Cancellable */),
248
+ detail,
249
+ });
250
+ },
251
+ };
252
+ };
253
+ /**
254
+ * Helper function to create & dispatch a custom Event on a provided target
255
+ * @param elm the target of the Event
256
+ * @param name the name to give the custom Event
257
+ * @param opts options for configuring a custom Event
258
+ * @returns the custom Event
259
+ */
260
+ const emitEvent = (elm, name, opts) => {
261
+ const ev = plt.ce(name, opts);
262
+ elm.dispatchEvent(ev);
263
+ return ev;
264
+ };
265
+ const attachToAncestor = (hostRef, ancestorComponent) => {
266
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
267
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
268
+ }
269
+ };
270
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
271
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
272
+ hostRef.$flags$ |= 512 /* needsRerender */;
273
+ return;
274
+ }
275
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
276
+ // there is no ancestor component or the ancestor component
277
+ // has already fired off its lifecycle update then
278
+ // fire off the initial update
279
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
280
+ return writeTask(dispatch) ;
281
+ };
282
+ const dispatchHooks = (hostRef, isInitialLoad) => {
283
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
284
+ const instance = hostRef.$lazyInstance$ ;
285
+ let promise;
286
+ if (isInitialLoad) {
287
+ {
288
+ promise = safeCall(instance, 'componentWillLoad');
289
+ }
290
+ }
291
+ endSchedule();
292
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
293
+ };
294
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
295
+ // updateComponent
296
+ const elm = hostRef.$hostElement$;
297
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
298
+ const rc = elm['s-rc'];
299
+ if (isInitialLoad) {
300
+ // DOM WRITE!
301
+ attachStyles(hostRef);
302
+ }
303
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
304
+ {
305
+ callRender(hostRef, instance);
306
+ }
307
+ if (rc) {
308
+ // ok, so turns out there are some child host elements
309
+ // waiting on this parent element to load
310
+ // let's fire off all update callbacks waiting
311
+ rc.map((cb) => cb());
312
+ elm['s-rc'] = undefined;
313
+ }
314
+ endRender();
315
+ endUpdate();
316
+ {
317
+ const childrenPromises = elm['s-p'];
318
+ const postUpdate = () => postUpdateComponent(hostRef);
319
+ if (childrenPromises.length === 0) {
320
+ postUpdate();
321
+ }
322
+ else {
323
+ Promise.all(childrenPromises).then(postUpdate);
324
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
325
+ childrenPromises.length = 0;
326
+ }
327
+ }
328
+ };
329
+ const callRender = (hostRef, instance, elm) => {
330
+ try {
331
+ instance = instance.render() ;
332
+ {
333
+ hostRef.$flags$ |= 2 /* hasRendered */;
334
+ }
335
+ {
336
+ {
337
+ // looks like we've got child nodes to render into this host element
338
+ // or we need to update the css class/attrs on the host element
339
+ // DOM WRITE!
340
+ {
341
+ renderVdom(hostRef, instance);
342
+ }
343
+ }
344
+ }
345
+ }
346
+ catch (e) {
347
+ consoleError(e, hostRef.$hostElement$);
348
+ }
349
+ return null;
350
+ };
351
+ const postUpdateComponent = (hostRef) => {
352
+ const tagName = hostRef.$cmpMeta$.$tagName$;
353
+ const elm = hostRef.$hostElement$;
354
+ const endPostUpdate = createTime('postUpdate', tagName);
355
+ const instance = hostRef.$lazyInstance$ ;
356
+ const ancestorComponent = hostRef.$ancestorComponent$;
357
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
358
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
359
+ {
360
+ // DOM WRITE!
361
+ addHydratedFlag(elm);
362
+ }
363
+ {
364
+ safeCall(instance, 'componentDidLoad');
365
+ }
366
+ endPostUpdate();
367
+ {
368
+ hostRef.$onReadyResolve$(elm);
369
+ if (!ancestorComponent) {
370
+ appDidLoad();
371
+ }
372
+ }
373
+ }
374
+ else {
375
+ endPostUpdate();
376
+ }
377
+ {
378
+ hostRef.$onInstanceResolve$(elm);
379
+ }
380
+ // load events fire from bottom to top
381
+ // the deepest elements load first then bubbles up
382
+ {
383
+ if (hostRef.$onRenderResolve$) {
384
+ hostRef.$onRenderResolve$();
385
+ hostRef.$onRenderResolve$ = undefined;
386
+ }
387
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
388
+ nextTick(() => scheduleUpdate(hostRef, false));
389
+ }
390
+ hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
391
+ }
392
+ // ( •_•)
393
+ // ( •_•)>⌐■-■
394
+ // (⌐■_■)
395
+ };
396
+ const appDidLoad = (who) => {
397
+ // on appload
398
+ // we have finish the first big initial render
399
+ {
400
+ addHydratedFlag(doc.documentElement);
401
+ }
402
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
403
+ };
404
+ const safeCall = (instance, method, arg) => {
405
+ if (instance && instance[method]) {
406
+ try {
407
+ return instance[method](arg);
408
+ }
409
+ catch (e) {
410
+ consoleError(e);
411
+ }
412
+ }
413
+ return undefined;
414
+ };
415
+ const then = (promise, thenFn) => {
416
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
417
+ };
418
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
419
+ ;
420
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
421
+ if (cmpMeta.$members$) {
422
+ // It's better to have a const than two Object.entries()
423
+ const members = Object.entries(cmpMeta.$members$);
424
+ const prototype = Cstr.prototype;
425
+ members.map(([memberName, [memberFlags]]) => {
426
+ if (flags & 1 /* isElementConstructor */ &&
427
+ memberFlags & 64 /* Method */) {
428
+ // proxyComponent - method
429
+ Object.defineProperty(prototype, memberName, {
430
+ value(...args) {
431
+ const ref = getHostRef(this);
432
+ return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
433
+ },
434
+ });
435
+ }
436
+ });
437
+ }
438
+ return Cstr;
439
+ };
440
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
441
+ // initializeComponent
442
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
443
+ {
444
+ // we haven't initialized this element yet
445
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
446
+ // lazy loaded components
447
+ // request the component's implementation to be
448
+ // wired up with the host element
449
+ Cstr = loadModule(cmpMeta);
450
+ if (Cstr.then) {
451
+ // Await creates a micro-task avoid if possible
452
+ const endLoad = uniqueTime();
453
+ Cstr = await Cstr;
454
+ endLoad();
455
+ }
456
+ if (!Cstr.isProxied) {
457
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
458
+ Cstr.isProxied = true;
459
+ }
460
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
461
+ // ok, time to construct the instance
462
+ // but let's keep track of when we start and stop
463
+ // so that the getters/setters don't incorrectly step on data
464
+ {
465
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
466
+ }
467
+ // construct the lazy-loaded component implementation
468
+ // passing the hostRef is very important during
469
+ // construction in order to directly wire together the
470
+ // host element and the lazy-loaded instance
471
+ try {
472
+ new Cstr(hostRef);
473
+ }
474
+ catch (e) {
475
+ consoleError(e);
476
+ }
477
+ {
478
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
479
+ }
480
+ endNewInstance();
481
+ }
482
+ if (Cstr.style) {
483
+ // this component has styles but we haven't registered them yet
484
+ let style = Cstr.style;
485
+ const scopeId = getScopeId(cmpMeta);
486
+ if (!styles.has(scopeId)) {
487
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
488
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
489
+ endRegisterStyles();
490
+ }
491
+ }
492
+ }
493
+ // we've successfully created a lazy instance
494
+ const ancestorComponent = hostRef.$ancestorComponent$;
495
+ const schedule = () => scheduleUpdate(hostRef, true);
496
+ if (ancestorComponent && ancestorComponent['s-rc']) {
497
+ // this is the initial load and this component it has an ancestor component
498
+ // but the ancestor component has NOT fired its will update lifecycle yet
499
+ // so let's just cool our jets and wait for the ancestor to continue first
500
+ // this will get fired off when the ancestor component
501
+ // finally gets around to rendering its lazy self
502
+ // fire off the initial update
503
+ ancestorComponent['s-rc'].push(schedule);
504
+ }
505
+ else {
506
+ schedule();
507
+ }
508
+ };
509
+ const connectedCallback = (elm) => {
510
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
511
+ const hostRef = getHostRef(elm);
512
+ const cmpMeta = hostRef.$cmpMeta$;
513
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
514
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
515
+ // first time this component has connected
516
+ hostRef.$flags$ |= 1 /* hasConnected */;
517
+ {
518
+ // find the first ancestor component (if there is one) and register
519
+ // this component as one of the actively loading child components for its ancestor
520
+ let ancestorComponent = elm;
521
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
522
+ // climb up the ancestors looking for the first
523
+ // component that hasn't finished its lifecycle update yet
524
+ if (ancestorComponent['s-p']) {
525
+ // we found this components first ancestor component
526
+ // keep a reference to this component's ancestor component
527
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
528
+ break;
529
+ }
530
+ }
531
+ }
532
+ {
533
+ initializeComponent(elm, hostRef, cmpMeta);
534
+ }
535
+ }
536
+ endConnected();
537
+ }
538
+ };
539
+ const disconnectedCallback = (elm) => {
540
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
541
+ getHostRef(elm);
542
+ }
543
+ };
544
+ const bootstrapLazy = (lazyBundles, options = {}) => {
545
+ const endBootstrap = createTime();
546
+ const cmpTags = [];
547
+ const exclude = options.exclude || [];
548
+ const customElements = win.customElements;
549
+ const head = doc.head;
550
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
551
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
552
+ const deferredConnectedCallbacks = [];
553
+ let appLoadFallback;
554
+ let isBootstrapping = true;
555
+ Object.assign(plt, options);
556
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
557
+ lazyBundles.map((lazyBundle) => {
558
+ lazyBundle[1].map((compactMeta) => {
559
+ const cmpMeta = {
560
+ $flags$: compactMeta[0],
561
+ $tagName$: compactMeta[1],
562
+ $members$: compactMeta[2],
563
+ $listeners$: compactMeta[3],
564
+ };
565
+ {
566
+ cmpMeta.$members$ = compactMeta[2];
567
+ }
568
+ const tagName = cmpMeta.$tagName$;
569
+ const HostElement = class extends HTMLElement {
570
+ // StencilLazyHost
571
+ constructor(self) {
572
+ // @ts-ignore
573
+ super(self);
574
+ self = this;
575
+ registerHost(self, cmpMeta);
576
+ }
577
+ connectedCallback() {
578
+ if (appLoadFallback) {
579
+ clearTimeout(appLoadFallback);
580
+ appLoadFallback = null;
581
+ }
582
+ if (isBootstrapping) {
583
+ // connectedCallback will be processed once all components have been registered
584
+ deferredConnectedCallbacks.push(this);
585
+ }
586
+ else {
587
+ plt.jmp(() => connectedCallback(this));
588
+ }
589
+ }
590
+ disconnectedCallback() {
591
+ plt.jmp(() => disconnectedCallback(this));
592
+ }
593
+ componentOnReady() {
594
+ return getHostRef(this).$onReadyPromise$;
595
+ }
596
+ };
597
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
598
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
599
+ cmpTags.push(tagName);
600
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
601
+ }
602
+ });
603
+ });
604
+ {
605
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
606
+ visibilityStyle.setAttribute('data-styles', '');
607
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
608
+ }
609
+ // Process deferred connectedCallbacks now all components have been registered
610
+ isBootstrapping = false;
611
+ if (deferredConnectedCallbacks.length) {
612
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
613
+ }
614
+ else {
615
+ {
616
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
617
+ }
618
+ }
619
+ // Fallback appLoad event
620
+ endBootstrap();
621
+ };
622
+ const hostRefs = new WeakMap();
623
+ const getHostRef = (ref) => hostRefs.get(ref);
624
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
625
+ const registerHost = (elm, cmpMeta) => {
626
+ const hostRef = {
627
+ $flags$: 0,
628
+ $hostElement$: elm,
629
+ $cmpMeta$: cmpMeta,
630
+ $instanceValues$: new Map(),
631
+ };
632
+ {
633
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
634
+ }
635
+ {
636
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
637
+ elm['s-p'] = [];
638
+ elm['s-rc'] = [];
639
+ }
640
+ return hostRefs.set(elm, hostRef);
641
+ };
642
+ const consoleError = (e, el) => (0, console.error)(e, el);
643
+ const cmpModules = /*@__PURE__*/ new Map();
644
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
645
+ // loadModuleImport
646
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
647
+ const bundleId = cmpMeta.$lazyBundleId$;
648
+ const module = cmpModules.get(bundleId) ;
649
+ if (module) {
650
+ return module[exportName];
651
+ }
652
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
653
+ return import(
654
+ /* @vite-ignore */
655
+ /* webpackInclude: /\.entry\.js$/ */
656
+ /* webpackExclude: /\.system\.entry\.js$/ */
657
+ /* webpackMode: "lazy" */
658
+ `./${bundleId}.entry.js${''}`).then((importedModule) => {
659
+ {
660
+ cmpModules.set(bundleId, importedModule);
661
+ }
662
+ return importedModule[exportName];
663
+ }, consoleError);
664
+ };
665
+ const styles = new Map();
666
+ const queueDomReads = [];
667
+ const queueDomWrites = [];
668
+ const queueTask = (queue, write) => (cb) => {
669
+ queue.push(cb);
670
+ if (!queuePending) {
671
+ queuePending = true;
672
+ if (write && plt.$flags$ & 4 /* queueSync */) {
673
+ nextTick(flush);
674
+ }
675
+ else {
676
+ plt.raf(flush);
677
+ }
678
+ }
679
+ };
680
+ const consume = (queue) => {
681
+ for (let i = 0; i < queue.length; i++) {
682
+ try {
683
+ queue[i](performance.now());
684
+ }
685
+ catch (e) {
686
+ consoleError(e);
687
+ }
688
+ }
689
+ queue.length = 0;
690
+ };
691
+ const flush = () => {
692
+ // always force a bunch of medium callbacks to run, but still have
693
+ // a throttle on how many can run in a certain time
694
+ // DOM READS!!!
695
+ consume(queueDomReads);
696
+ // DOM WRITES!!!
697
+ {
698
+ consume(queueDomWrites);
699
+ if ((queuePending = queueDomReads.length > 0)) {
700
+ // still more to do yet, but we've run out of time
701
+ // let's let this thing cool off and try again in the next tick
702
+ plt.raf(flush);
703
+ }
704
+ }
705
+ };
706
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
707
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
708
+
709
+ export { bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r };