@rarui/components 1.0.0 → 1.1.0-rc.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 (158) hide show
  1. package/dist/exhibition/Avatar/src/Avatar.d.ts +7 -0
  2. package/dist/exhibition/Avatar/src/avatar.types.d.ts +6 -0
  3. package/dist/exhibition/Avatar/src/index.d.ts +1 -0
  4. package/dist/exhibition/Badge/src/Badge.d.ts +24 -0
  5. package/dist/exhibition/Badge/src/badge.types.d.ts +8 -0
  6. package/dist/exhibition/Badge/src/index.d.ts +1 -0
  7. package/dist/exhibition/Text/src/Text.d.ts +7 -0
  8. package/dist/exhibition/Text/src/index.d.ts +1 -0
  9. package/dist/exhibition/Text/src/text.types.d.ts +6 -0
  10. package/dist/exhibition/Title/src/Title.d.ts +7 -0
  11. package/dist/exhibition/Title/src/index.d.ts +1 -0
  12. package/dist/exhibition/Title/src/title.types.d.ts +6 -0
  13. package/dist/index.d.ts +6 -0
  14. package/dist/index.js +116 -1
  15. package/dist/input/Button/src/Button.d.ts +11 -0
  16. package/dist/input/Button/src/button.types.d.ts +6 -0
  17. package/dist/input/Button/src/index.d.ts +1 -0
  18. package/dist/layout/Box/src/Box.d.ts +6 -0
  19. package/dist/layout/Box/src/box.types.d.ts +6 -0
  20. package/dist/layout/Box/src/index.d.ts +1 -0
  21. package/dist/navigation/Tabs/src/Tabs.d.ts +16 -0
  22. package/dist/navigation/Tabs/src/index.d.ts +1 -0
  23. package/dist/navigation/Tabs/src/tabs.types.d.ts +6 -0
  24. package/package.json +8 -9
  25. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  26. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  27. package/dist/cjs/index-b5398c4a.js +0 -1428
  28. package/dist/cjs/index-b5398c4a.js.map +0 -1
  29. package/dist/cjs/index.cjs.js +0 -4
  30. package/dist/cjs/index.cjs.js.map +0 -1
  31. package/dist/cjs/loader.cjs.js +0 -17
  32. package/dist/cjs/loader.cjs.js.map +0 -1
  33. package/dist/cjs/rarui-box.cjs.entry.js +0 -28
  34. package/dist/cjs/rarui-box.cjs.entry.js.map +0 -1
  35. package/dist/cjs/rarui-button.cjs.entry.js +0 -35
  36. package/dist/cjs/rarui-button.cjs.entry.js.map +0 -1
  37. package/dist/cjs/rarui-components.cjs.js +0 -27
  38. package/dist/cjs/rarui-components.cjs.js.map +0 -1
  39. package/dist/cjs/rarui-tabs-item.cjs.entry.js +0 -20
  40. package/dist/cjs/rarui-tabs-item.cjs.entry.js.map +0 -1
  41. package/dist/cjs/rarui-tabs.cjs.entry.js +0 -39
  42. package/dist/cjs/rarui-tabs.cjs.entry.js.map +0 -1
  43. package/dist/cjs/rarui-text.cjs.entry.js +0 -35
  44. package/dist/cjs/rarui-text.cjs.entry.js.map +0 -1
  45. package/dist/cjs/rarui-title.cjs.entry.js +0 -35
  46. package/dist/cjs/rarui-title.cjs.entry.js.map +0 -1
  47. package/dist/cjs/tslib.es6-512c1da2.js +0 -32
  48. package/dist/cjs/tslib.es6-512c1da2.js.map +0 -1
  49. package/dist/collection/collection-manifest.json +0 -17
  50. package/dist/collection/exhibition/Text/src/Text.js +0 -66
  51. package/dist/collection/exhibition/Text/src/Text.js.map +0 -1
  52. package/dist/collection/exhibition/Text/src/index.js +0 -2
  53. package/dist/collection/exhibition/Text/src/index.js.map +0 -1
  54. package/dist/collection/exhibition/Text/stencil.config.js +0 -5
  55. package/dist/collection/exhibition/Text/stencil.config.js.map +0 -1
  56. package/dist/collection/exhibition/Title/src/Title.js +0 -66
  57. package/dist/collection/exhibition/Title/src/Title.js.map +0 -1
  58. package/dist/collection/exhibition/Title/src/index.js +0 -2
  59. package/dist/collection/exhibition/Title/src/index.js.map +0 -1
  60. package/dist/collection/exhibition/Title/stencil.config.js +0 -5
  61. package/dist/collection/exhibition/Title/stencil.config.js.map +0 -1
  62. package/dist/collection/input/Button/src/Button.js +0 -229
  63. package/dist/collection/input/Button/src/Button.js.map +0 -1
  64. package/dist/collection/input/Button/src/index.js +0 -2
  65. package/dist/collection/input/Button/src/index.js.map +0 -1
  66. package/dist/collection/input/Button/stencil.config.js +0 -5
  67. package/dist/collection/input/Button/stencil.config.js.map +0 -1
  68. package/dist/collection/layout/Box/src/Box.js +0 -42
  69. package/dist/collection/layout/Box/src/Box.js.map +0 -1
  70. package/dist/collection/layout/Box/src/index.js +0 -2
  71. package/dist/collection/layout/Box/src/index.js.map +0 -1
  72. package/dist/collection/layout/Box/stencil.config.js +0 -5
  73. package/dist/collection/layout/Box/stencil.config.js.map +0 -1
  74. package/dist/collection/navigation/Tabs/Item/src/Item.js +0 -34
  75. package/dist/collection/navigation/Tabs/Item/src/Item.js.map +0 -1
  76. package/dist/collection/navigation/Tabs/Item/src/index.js +0 -2
  77. package/dist/collection/navigation/Tabs/Item/src/index.js.map +0 -1
  78. package/dist/collection/navigation/Tabs/Item/stencil.config.js +0 -5
  79. package/dist/collection/navigation/Tabs/Item/stencil.config.js.map +0 -1
  80. package/dist/collection/navigation/Tabs/Root/src/Root.js +0 -143
  81. package/dist/collection/navigation/Tabs/Root/src/Root.js.map +0 -1
  82. package/dist/collection/navigation/Tabs/Root/src/index.js +0 -2
  83. package/dist/collection/navigation/Tabs/Root/src/index.js.map +0 -1
  84. package/dist/collection/navigation/Tabs/Root/stencil.config.js +0 -5
  85. package/dist/collection/navigation/Tabs/Root/stencil.config.js.map +0 -1
  86. package/dist/esm/app-globals-0f993ce5.js +0 -5
  87. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  88. package/dist/esm/index-81e77ca5.js +0 -1399
  89. package/dist/esm/index-81e77ca5.js.map +0 -1
  90. package/dist/esm/index.js +0 -3
  91. package/dist/esm/index.js.map +0 -1
  92. package/dist/esm/loader.js +0 -13
  93. package/dist/esm/loader.js.map +0 -1
  94. package/dist/esm/rarui-box.entry.js +0 -24
  95. package/dist/esm/rarui-box.entry.js.map +0 -1
  96. package/dist/esm/rarui-button.entry.js +0 -31
  97. package/dist/esm/rarui-button.entry.js.map +0 -1
  98. package/dist/esm/rarui-components.js +0 -22
  99. package/dist/esm/rarui-components.js.map +0 -1
  100. package/dist/esm/rarui-tabs-item.entry.js +0 -16
  101. package/dist/esm/rarui-tabs-item.entry.js.map +0 -1
  102. package/dist/esm/rarui-tabs.entry.js +0 -35
  103. package/dist/esm/rarui-tabs.entry.js.map +0 -1
  104. package/dist/esm/rarui-text.entry.js +0 -31
  105. package/dist/esm/rarui-text.entry.js.map +0 -1
  106. package/dist/esm/rarui-title.entry.js +0 -31
  107. package/dist/esm/rarui-title.entry.js.map +0 -1
  108. package/dist/esm/tslib.es6-46fef1fc.js +0 -30
  109. package/dist/esm/tslib.es6-46fef1fc.js.map +0 -1
  110. package/dist/index.cjs.js +0 -1
  111. package/dist/loader/cdn.js +0 -1
  112. package/dist/loader/index.cjs.js +0 -1
  113. package/dist/loader/index.d.ts +0 -24
  114. package/dist/loader/index.es2017.js +0 -1
  115. package/dist/loader/index.js +0 -2
  116. package/dist/loader/package.json +0 -11
  117. package/dist/rarui-components/index.esm.js +0 -2
  118. package/dist/rarui-components/index.esm.js.map +0 -1
  119. package/dist/rarui-components/p-4235f9e9.entry.js +0 -2
  120. package/dist/rarui-components/p-4235f9e9.entry.js.map +0 -1
  121. package/dist/rarui-components/p-460d0eb2.entry.js +0 -2
  122. package/dist/rarui-components/p-460d0eb2.entry.js.map +0 -1
  123. package/dist/rarui-components/p-8495565d.js +0 -2
  124. package/dist/rarui-components/p-8495565d.js.map +0 -1
  125. package/dist/rarui-components/p-8a339b04.entry.js +0 -2
  126. package/dist/rarui-components/p-8a339b04.entry.js.map +0 -1
  127. package/dist/rarui-components/p-9492df61.js +0 -3
  128. package/dist/rarui-components/p-9492df61.js.map +0 -1
  129. package/dist/rarui-components/p-981fe085.entry.js +0 -2
  130. package/dist/rarui-components/p-981fe085.entry.js.map +0 -1
  131. package/dist/rarui-components/p-98b92162.entry.js +0 -2
  132. package/dist/rarui-components/p-98b92162.entry.js.map +0 -1
  133. package/dist/rarui-components/p-e1255160.js +0 -2
  134. package/dist/rarui-components/p-e1255160.js.map +0 -1
  135. package/dist/rarui-components/p-ffb1013c.entry.js +0 -2
  136. package/dist/rarui-components/p-ffb1013c.entry.js.map +0 -1
  137. package/dist/rarui-components/rarui-components.esm.js +0 -2
  138. package/dist/rarui-components/rarui-components.esm.js.map +0 -1
  139. package/dist/types/components.d.ts +0 -156
  140. package/dist/types/exhibition/Text/src/Text.d.ts +0 -7
  141. package/dist/types/exhibition/Text/src/index.d.ts +0 -10
  142. package/dist/types/exhibition/Text/stencil.config.d.ts +0 -54
  143. package/dist/types/exhibition/Title/src/Title.d.ts +0 -7
  144. package/dist/types/exhibition/Title/src/index.d.ts +0 -10
  145. package/dist/types/exhibition/Title/stencil.config.d.ts +0 -54
  146. package/dist/types/input/Button/src/Button.d.ts +0 -14
  147. package/dist/types/input/Button/src/index.d.ts +0 -10
  148. package/dist/types/input/Button/stencil.config.d.ts +0 -54
  149. package/dist/types/layout/Box/src/Box.d.ts +0 -6
  150. package/dist/types/layout/Box/src/index.d.ts +0 -10
  151. package/dist/types/layout/Box/stencil.config.d.ts +0 -54
  152. package/dist/types/navigation/Tabs/Item/src/Item.d.ts +0 -5
  153. package/dist/types/navigation/Tabs/Item/src/index.d.ts +0 -10
  154. package/dist/types/navigation/Tabs/Item/stencil.config.d.ts +0 -54
  155. package/dist/types/navigation/Tabs/Root/src/Root.d.ts +0 -14
  156. package/dist/types/navigation/Tabs/Root/src/index.d.ts +0 -10
  157. package/dist/types/navigation/Tabs/Root/stencil.config.d.ts +0 -54
  158. package/dist/types/stencil-public-runtime.d.ts +0 -1674
@@ -1,1399 +0,0 @@
1
- const NAMESPACE = 'rarui-components';
2
- const BUILD = /* rarui-components */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: false, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: false };
3
-
4
- /*
5
- Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
6
- */
7
- var __defProp = Object.defineProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var hostRefs = /* @__PURE__ */ new WeakMap();
13
- var getHostRef = (ref) => hostRefs.get(ref);
14
- var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
15
- var registerHost = (hostElement, cmpMeta) => {
16
- const hostRef = {
17
- $flags$: 0,
18
- $hostElement$: hostElement,
19
- $cmpMeta$: cmpMeta,
20
- $instanceValues$: /* @__PURE__ */ new Map()
21
- };
22
- {
23
- hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
24
- hostElement["s-p"] = [];
25
- hostElement["s-rc"] = [];
26
- }
27
- return hostRefs.set(hostElement, hostRef);
28
- };
29
- var isMemberInElement = (elm, memberName) => memberName in elm;
30
- var consoleError = (e, el) => (0, console.error)(e, el);
31
-
32
- // src/client/client-load-module.ts
33
- var cmpModules = /* @__PURE__ */ new Map();
34
- var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
35
- const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
36
- const bundleId = cmpMeta.$lazyBundleId$;
37
- if (!bundleId) {
38
- return void 0;
39
- }
40
- const module = cmpModules.get(bundleId) ;
41
- if (module) {
42
- return module[exportName];
43
- }
44
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
45
- return import(
46
- /* @vite-ignore */
47
- /* webpackInclude: /\.entry\.js$/ */
48
- /* webpackExclude: /\.system\.entry\.js$/ */
49
- /* webpackMode: "lazy" */
50
- `./${bundleId}.entry.js${""}`
51
- ).then((importedModule) => {
52
- {
53
- cmpModules.set(bundleId, importedModule);
54
- }
55
- return importedModule[exportName];
56
- }, consoleError);
57
- };
58
- var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
59
- var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
60
- var XLINK_NS = "http://www.w3.org/1999/xlink";
61
- var win = typeof window !== "undefined" ? window : {};
62
- var doc = win.document || { head: {} };
63
- var plt = {
64
- $flags$: 0,
65
- $resourcesUrl$: "",
66
- jmp: (h2) => h2(),
67
- raf: (h2) => requestAnimationFrame(h2),
68
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
69
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
70
- ce: (eventName, opts) => new CustomEvent(eventName, opts)
71
- };
72
- var supportsShadow = BUILD.shadowDom;
73
- var promiseResolve = (v) => Promise.resolve(v);
74
- var queuePending = false;
75
- var queueDomReads = [];
76
- var queueDomWrites = [];
77
- var queueTask = (queue, write) => (cb) => {
78
- queue.push(cb);
79
- if (!queuePending) {
80
- queuePending = true;
81
- if (write && plt.$flags$ & 4 /* queueSync */) {
82
- nextTick(flush);
83
- } else {
84
- plt.raf(flush);
85
- }
86
- }
87
- };
88
- var consume = (queue) => {
89
- for (let i2 = 0; i2 < queue.length; i2++) {
90
- try {
91
- queue[i2](performance.now());
92
- } catch (e) {
93
- consoleError(e);
94
- }
95
- }
96
- queue.length = 0;
97
- };
98
- var flush = () => {
99
- consume(queueDomReads);
100
- {
101
- consume(queueDomWrites);
102
- if (queuePending = queueDomReads.length > 0) {
103
- plt.raf(flush);
104
- }
105
- }
106
- };
107
- var nextTick = (cb) => promiseResolve().then(cb);
108
- var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
109
-
110
- // src/utils/constants.ts
111
- var EMPTY_OBJ = {};
112
-
113
- // src/utils/helpers.ts
114
- var isDef = (v) => v != null;
115
- var isComplexType = (o) => {
116
- o = typeof o;
117
- return o === "object" || o === "function";
118
- };
119
-
120
- // src/utils/query-nonce-meta-tag-content.ts
121
- function queryNonceMetaTagContent(doc2) {
122
- var _a, _b, _c;
123
- return (_c = (_b = (_a = doc2.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
124
- }
125
-
126
- // src/utils/result.ts
127
- var result_exports = {};
128
- __export(result_exports, {
129
- err: () => err,
130
- map: () => map,
131
- ok: () => ok,
132
- unwrap: () => unwrap,
133
- unwrapErr: () => unwrapErr
134
- });
135
- var ok = (value) => ({
136
- isOk: true,
137
- isErr: false,
138
- value
139
- });
140
- var err = (value) => ({
141
- isOk: false,
142
- isErr: true,
143
- value
144
- });
145
- function map(result, fn) {
146
- if (result.isOk) {
147
- const val = fn(result.value);
148
- if (val instanceof Promise) {
149
- return val.then((newVal) => ok(newVal));
150
- } else {
151
- return ok(val);
152
- }
153
- }
154
- if (result.isErr) {
155
- const value = result.value;
156
- return err(value);
157
- }
158
- throw "should never get here";
159
- }
160
- var unwrap = (result) => {
161
- if (result.isOk) {
162
- return result.value;
163
- } else {
164
- throw result.value;
165
- }
166
- };
167
- var unwrapErr = (result) => {
168
- if (result.isErr) {
169
- return result.value;
170
- } else {
171
- throw result.value;
172
- }
173
- };
174
- var createTime = (fnName, tagName = "") => {
175
- {
176
- return () => {
177
- return;
178
- };
179
- }
180
- };
181
- var uniqueTime = (key, measureText) => {
182
- {
183
- return () => {
184
- return;
185
- };
186
- }
187
- };
188
- var h = (nodeName, vnodeData, ...children) => {
189
- let child = null;
190
- let key = null;
191
- let slotName = null;
192
- let simple = false;
193
- let lastSimple = false;
194
- const vNodeChildren = [];
195
- const walk = (c) => {
196
- for (let i2 = 0; i2 < c.length; i2++) {
197
- child = c[i2];
198
- if (Array.isArray(child)) {
199
- walk(child);
200
- } else if (child != null && typeof child !== "boolean") {
201
- if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
202
- child = String(child);
203
- }
204
- if (simple && lastSimple) {
205
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
206
- } else {
207
- vNodeChildren.push(simple ? newVNode(null, child) : child);
208
- }
209
- lastSimple = simple;
210
- }
211
- }
212
- };
213
- walk(children);
214
- if (vnodeData) {
215
- if (vnodeData.key) {
216
- key = vnodeData.key;
217
- }
218
- if (vnodeData.name) {
219
- slotName = vnodeData.name;
220
- }
221
- {
222
- const classData = vnodeData.className || vnodeData.class;
223
- if (classData) {
224
- vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
225
- }
226
- }
227
- }
228
- if (typeof nodeName === "function") {
229
- return nodeName(
230
- vnodeData === null ? {} : vnodeData,
231
- vNodeChildren,
232
- vdomFnUtils
233
- );
234
- }
235
- const vnode = newVNode(nodeName, null);
236
- vnode.$attrs$ = vnodeData;
237
- if (vNodeChildren.length > 0) {
238
- vnode.$children$ = vNodeChildren;
239
- }
240
- {
241
- vnode.$key$ = key;
242
- }
243
- {
244
- vnode.$name$ = slotName;
245
- }
246
- return vnode;
247
- };
248
- var newVNode = (tag, text) => {
249
- const vnode = {
250
- $flags$: 0,
251
- $tag$: tag,
252
- $text$: text,
253
- $elm$: null,
254
- $children$: null
255
- };
256
- {
257
- vnode.$attrs$ = null;
258
- }
259
- {
260
- vnode.$key$ = null;
261
- }
262
- {
263
- vnode.$name$ = null;
264
- }
265
- return vnode;
266
- };
267
- var Host = {};
268
- var isHost = (node) => node && node.$tag$ === Host;
269
- var vdomFnUtils = {
270
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
271
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
272
- };
273
- var convertToPublic = (node) => ({
274
- vattrs: node.$attrs$,
275
- vchildren: node.$children$,
276
- vkey: node.$key$,
277
- vname: node.$name$,
278
- vtag: node.$tag$,
279
- vtext: node.$text$
280
- });
281
- var convertToPrivate = (node) => {
282
- if (typeof node.vtag === "function") {
283
- const vnodeData = { ...node.vattrs };
284
- if (node.vkey) {
285
- vnodeData.key = node.vkey;
286
- }
287
- if (node.vname) {
288
- vnodeData.name = node.vname;
289
- }
290
- return h(node.vtag, vnodeData, ...node.vchildren || []);
291
- }
292
- const vnode = newVNode(node.vtag, node.vtext);
293
- vnode.$attrs$ = node.vattrs;
294
- vnode.$children$ = node.vchildren;
295
- vnode.$key$ = node.vkey;
296
- vnode.$name$ = node.vname;
297
- return vnode;
298
- };
299
- var parsePropertyValue = (propValue, propType) => {
300
- if (propValue != null && !isComplexType(propValue)) {
301
- if (propType & 4 /* Boolean */) {
302
- return propValue === "false" ? false : propValue === "" || !!propValue;
303
- }
304
- if (propType & 2 /* Number */) {
305
- return parseFloat(propValue);
306
- }
307
- if (propType & 1 /* String */) {
308
- return String(propValue);
309
- }
310
- return propValue;
311
- }
312
- return propValue;
313
- };
314
- var getElement = (ref) => getHostRef(ref).$hostElement$ ;
315
-
316
- // src/runtime/event-emitter.ts
317
- var createEvent = (ref, name, flags) => {
318
- const elm = getElement(ref);
319
- return {
320
- emit: (detail) => {
321
- return emitEvent(elm, name, {
322
- bubbles: !!(flags & 4 /* Bubbles */),
323
- composed: !!(flags & 2 /* Composed */),
324
- cancelable: !!(flags & 1 /* Cancellable */),
325
- detail
326
- });
327
- }
328
- };
329
- };
330
- var emitEvent = (elm, name, opts) => {
331
- const ev = plt.ce(name, opts);
332
- elm.dispatchEvent(ev);
333
- return ev;
334
- };
335
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
336
- if (oldValue !== newValue) {
337
- let isProp = isMemberInElement(elm, memberName);
338
- let ln = memberName.toLowerCase();
339
- if (memberName === "class") {
340
- const classList = elm.classList;
341
- const oldClasses = parseClassList(oldValue);
342
- const newClasses = parseClassList(newValue);
343
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
344
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
345
- } else if (memberName === "style") {
346
- {
347
- for (const prop in oldValue) {
348
- if (!newValue || newValue[prop] == null) {
349
- if (prop.includes("-")) {
350
- elm.style.removeProperty(prop);
351
- } else {
352
- elm.style[prop] = "";
353
- }
354
- }
355
- }
356
- }
357
- for (const prop in newValue) {
358
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
359
- if (prop.includes("-")) {
360
- elm.style.setProperty(prop, newValue[prop]);
361
- } else {
362
- elm.style[prop] = newValue[prop];
363
- }
364
- }
365
- }
366
- } else if (memberName === "key") ; else if (memberName === "ref") {
367
- if (newValue) {
368
- newValue(elm);
369
- }
370
- } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
371
- if (memberName[2] === "-") {
372
- memberName = memberName.slice(3);
373
- } else if (isMemberInElement(win, ln)) {
374
- memberName = ln.slice(2);
375
- } else {
376
- memberName = ln[2] + memberName.slice(3);
377
- }
378
- if (oldValue || newValue) {
379
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
380
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
381
- if (oldValue) {
382
- plt.rel(elm, memberName, oldValue, capture);
383
- }
384
- if (newValue) {
385
- plt.ael(elm, memberName, newValue, capture);
386
- }
387
- }
388
- } else {
389
- const isComplex = isComplexType(newValue);
390
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
391
- try {
392
- if (!elm.tagName.includes("-")) {
393
- const n = newValue == null ? "" : newValue;
394
- if (memberName === "list") {
395
- isProp = false;
396
- } else if (oldValue == null || elm[memberName] != n) {
397
- elm[memberName] = n;
398
- }
399
- } else {
400
- elm[memberName] = newValue;
401
- }
402
- } catch (e) {
403
- }
404
- }
405
- let xlink = false;
406
- {
407
- if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
408
- memberName = ln;
409
- xlink = true;
410
- }
411
- }
412
- if (newValue == null || newValue === false) {
413
- if (newValue !== false || elm.getAttribute(memberName) === "") {
414
- if (xlink) {
415
- elm.removeAttributeNS(XLINK_NS, memberName);
416
- } else {
417
- elm.removeAttribute(memberName);
418
- }
419
- }
420
- } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
421
- newValue = newValue === true ? "" : newValue;
422
- if (xlink) {
423
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
424
- } else {
425
- elm.setAttribute(memberName, newValue);
426
- }
427
- }
428
- }
429
- }
430
- };
431
- var parseClassListRegex = /\s/;
432
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
433
- var CAPTURE_EVENT_SUFFIX = "Capture";
434
- var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
435
-
436
- // src/runtime/vdom/update-element.ts
437
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
438
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
439
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
440
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
441
- {
442
- for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
443
- if (!(memberName in newVnodeAttrs)) {
444
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
445
- }
446
- }
447
- }
448
- for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
449
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
450
- }
451
- };
452
- function sortedAttrNames(attrNames) {
453
- return attrNames.includes("ref") ? (
454
- // we need to sort these to ensure that `'ref'` is the last attr
455
- [...attrNames.filter((attr) => attr !== "ref"), "ref"]
456
- ) : (
457
- // no need to sort, return the original array
458
- attrNames
459
- );
460
- }
461
-
462
- // src/runtime/vdom/vdom-render.ts
463
- var scopeId;
464
- var contentRef;
465
- var hostTagName;
466
- var useNativeShadowDom = false;
467
- var checkSlotFallbackVisibility = false;
468
- var checkSlotRelocate = false;
469
- var isSvgMode = false;
470
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
471
- var _a;
472
- const newVNode2 = newParentVNode.$children$[childIndex];
473
- let i2 = 0;
474
- let elm;
475
- let childNode;
476
- let oldVNode;
477
- if (!useNativeShadowDom) {
478
- checkSlotRelocate = true;
479
- if (newVNode2.$tag$ === "slot") {
480
- if (scopeId) {
481
- parentElm.classList.add(scopeId + "-s");
482
- }
483
- newVNode2.$flags$ |= newVNode2.$children$ ? (
484
- // slot element has fallback content
485
- // still create an element that "mocks" the slot element
486
- 2 /* isSlotFallback */
487
- ) : (
488
- // slot element does not have fallback content
489
- // create an html comment we'll use to always reference
490
- // where actual slot content should sit next to
491
- 1 /* isSlotReference */
492
- );
493
- }
494
- }
495
- if (newVNode2.$text$ !== null) {
496
- elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
497
- } else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
498
- elm = newVNode2.$elm$ = doc.createTextNode("");
499
- } else {
500
- elm = newVNode2.$elm$ = doc.createElement(
501
- !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
502
- );
503
- {
504
- updateElement(null, newVNode2, isSvgMode);
505
- }
506
- if (isDef(scopeId) && elm["s-si"] !== scopeId) {
507
- elm.classList.add(elm["s-si"] = scopeId);
508
- }
509
- {
510
- updateElementScopeIds(elm, parentElm);
511
- }
512
- if (newVNode2.$children$) {
513
- for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
514
- childNode = createElm(oldParentVNode, newVNode2, i2, elm);
515
- if (childNode) {
516
- elm.appendChild(childNode);
517
- }
518
- }
519
- }
520
- }
521
- elm["s-hn"] = hostTagName;
522
- {
523
- if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
524
- elm["s-sr"] = true;
525
- elm["s-cr"] = contentRef;
526
- elm["s-sn"] = newVNode2.$name$ || "";
527
- elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
528
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
529
- if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
530
- {
531
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
532
- }
533
- }
534
- }
535
- }
536
- return elm;
537
- };
538
- var putBackInOriginalLocation = (parentElm, recursive) => {
539
- plt.$flags$ |= 1 /* isTmpDisconnected */;
540
- const oldSlotChildNodes = Array.from(parentElm.childNodes);
541
- if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
542
- let node = parentElm;
543
- while (node = node.nextSibling) {
544
- if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
545
- oldSlotChildNodes.push(node);
546
- }
547
- }
548
- }
549
- for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
550
- const childNode = oldSlotChildNodes[i2];
551
- if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
552
- insertBefore(parentReferenceNode(childNode), childNode, referenceNode(childNode));
553
- childNode["s-ol"].remove();
554
- childNode["s-ol"] = void 0;
555
- childNode["s-sh"] = void 0;
556
- checkSlotRelocate = true;
557
- }
558
- if (recursive) {
559
- putBackInOriginalLocation(childNode, recursive);
560
- }
561
- }
562
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
563
- };
564
- var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
565
- let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
566
- let childNode;
567
- for (; startIdx <= endIdx; ++startIdx) {
568
- if (vnodes[startIdx]) {
569
- childNode = createElm(null, parentVNode, startIdx, parentElm);
570
- if (childNode) {
571
- vnodes[startIdx].$elm$ = childNode;
572
- insertBefore(containerElm, childNode, referenceNode(before) );
573
- }
574
- }
575
- }
576
- };
577
- var removeVnodes = (vnodes, startIdx, endIdx) => {
578
- for (let index = startIdx; index <= endIdx; ++index) {
579
- const vnode = vnodes[index];
580
- if (vnode) {
581
- const elm = vnode.$elm$;
582
- nullifyVNodeRefs(vnode);
583
- if (elm) {
584
- {
585
- checkSlotFallbackVisibility = true;
586
- if (elm["s-ol"]) {
587
- elm["s-ol"].remove();
588
- } else {
589
- putBackInOriginalLocation(elm, true);
590
- }
591
- }
592
- elm.remove();
593
- }
594
- }
595
- }
596
- };
597
- var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
598
- let oldStartIdx = 0;
599
- let newStartIdx = 0;
600
- let idxInOld = 0;
601
- let i2 = 0;
602
- let oldEndIdx = oldCh.length - 1;
603
- let oldStartVnode = oldCh[0];
604
- let oldEndVnode = oldCh[oldEndIdx];
605
- let newEndIdx = newCh.length - 1;
606
- let newStartVnode = newCh[0];
607
- let newEndVnode = newCh[newEndIdx];
608
- let node;
609
- let elmToMove;
610
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
611
- if (oldStartVnode == null) {
612
- oldStartVnode = oldCh[++oldStartIdx];
613
- } else if (oldEndVnode == null) {
614
- oldEndVnode = oldCh[--oldEndIdx];
615
- } else if (newStartVnode == null) {
616
- newStartVnode = newCh[++newStartIdx];
617
- } else if (newEndVnode == null) {
618
- newEndVnode = newCh[--newEndIdx];
619
- } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
620
- patch(oldStartVnode, newStartVnode, isInitialRender);
621
- oldStartVnode = oldCh[++oldStartIdx];
622
- newStartVnode = newCh[++newStartIdx];
623
- } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
624
- patch(oldEndVnode, newEndVnode, isInitialRender);
625
- oldEndVnode = oldCh[--oldEndIdx];
626
- newEndVnode = newCh[--newEndIdx];
627
- } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
628
- if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
629
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
630
- }
631
- patch(oldStartVnode, newEndVnode, isInitialRender);
632
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
633
- oldStartVnode = oldCh[++oldStartIdx];
634
- newEndVnode = newCh[--newEndIdx];
635
- } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
636
- if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
637
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
638
- }
639
- patch(oldEndVnode, newStartVnode, isInitialRender);
640
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
641
- oldEndVnode = oldCh[--oldEndIdx];
642
- newStartVnode = newCh[++newStartIdx];
643
- } else {
644
- idxInOld = -1;
645
- {
646
- for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
647
- if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
648
- idxInOld = i2;
649
- break;
650
- }
651
- }
652
- }
653
- if (idxInOld >= 0) {
654
- elmToMove = oldCh[idxInOld];
655
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
656
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
657
- } else {
658
- patch(elmToMove, newStartVnode, isInitialRender);
659
- oldCh[idxInOld] = void 0;
660
- node = elmToMove.$elm$;
661
- }
662
- newStartVnode = newCh[++newStartIdx];
663
- } else {
664
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm);
665
- newStartVnode = newCh[++newStartIdx];
666
- }
667
- if (node) {
668
- {
669
- insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
670
- }
671
- }
672
- }
673
- }
674
- if (oldStartIdx > oldEndIdx) {
675
- addVnodes(
676
- parentElm,
677
- newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
678
- newVNode2,
679
- newCh,
680
- newStartIdx,
681
- newEndIdx
682
- );
683
- } else if (newStartIdx > newEndIdx) {
684
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
685
- }
686
- };
687
- var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
688
- if (leftVNode.$tag$ === rightVNode.$tag$) {
689
- if (leftVNode.$tag$ === "slot") {
690
- return leftVNode.$name$ === rightVNode.$name$;
691
- }
692
- if (!isInitialRender) {
693
- return leftVNode.$key$ === rightVNode.$key$;
694
- }
695
- return true;
696
- }
697
- return false;
698
- };
699
- var referenceNode = (node) => {
700
- return node && node["s-ol"] || node;
701
- };
702
- var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
703
- var patch = (oldVNode, newVNode2, isInitialRender = false) => {
704
- const elm = newVNode2.$elm$ = oldVNode.$elm$;
705
- const oldChildren = oldVNode.$children$;
706
- const newChildren = newVNode2.$children$;
707
- const tag = newVNode2.$tag$;
708
- const text = newVNode2.$text$;
709
- let defaultHolder;
710
- if (text === null) {
711
- {
712
- if (tag === "slot" && !useNativeShadowDom) ; else {
713
- updateElement(oldVNode, newVNode2, isSvgMode);
714
- }
715
- }
716
- if (oldChildren !== null && newChildren !== null) {
717
- updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
718
- } else if (newChildren !== null) {
719
- if (oldVNode.$text$ !== null) {
720
- elm.textContent = "";
721
- }
722
- addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
723
- } else if (oldChildren !== null) {
724
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
725
- }
726
- } else if ((defaultHolder = elm["s-cr"])) {
727
- defaultHolder.parentNode.textContent = text;
728
- } else if (oldVNode.$text$ !== text) {
729
- elm.data = text;
730
- }
731
- };
732
- var updateFallbackSlotVisibility = (elm) => {
733
- const childNodes = elm.childNodes;
734
- for (const childNode of childNodes) {
735
- if (childNode.nodeType === 1 /* ElementNode */) {
736
- if (childNode["s-sr"]) {
737
- const slotName = childNode["s-sn"];
738
- childNode.hidden = false;
739
- for (const siblingNode of childNodes) {
740
- if (siblingNode !== childNode) {
741
- if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
742
- if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
743
- childNode.hidden = true;
744
- break;
745
- }
746
- } else {
747
- if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
748
- childNode.hidden = true;
749
- break;
750
- }
751
- }
752
- }
753
- }
754
- }
755
- updateFallbackSlotVisibility(childNode);
756
- }
757
- }
758
- };
759
- var relocateNodes = [];
760
- var markSlotContentForRelocation = (elm) => {
761
- let node;
762
- let hostContentNodes;
763
- let j;
764
- for (const childNode of elm.childNodes) {
765
- if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
766
- hostContentNodes = node.parentNode.childNodes;
767
- const slotName = childNode["s-sn"];
768
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
769
- node = hostContentNodes[j];
770
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes )) {
771
- if (isNodeLocatedInSlot(node, slotName)) {
772
- let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
773
- checkSlotFallbackVisibility = true;
774
- node["s-sn"] = node["s-sn"] || slotName;
775
- if (relocateNodeData) {
776
- relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
777
- relocateNodeData.$slotRefNode$ = childNode;
778
- } else {
779
- node["s-sh"] = childNode["s-hn"];
780
- relocateNodes.push({
781
- $slotRefNode$: childNode,
782
- $nodeToRelocate$: node
783
- });
784
- }
785
- if (node["s-sr"]) {
786
- relocateNodes.map((relocateNode) => {
787
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
788
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
789
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
790
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
791
- }
792
- }
793
- });
794
- }
795
- } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
796
- relocateNodes.push({
797
- $nodeToRelocate$: node
798
- });
799
- }
800
- }
801
- }
802
- }
803
- if (childNode.nodeType === 1 /* ElementNode */) {
804
- markSlotContentForRelocation(childNode);
805
- }
806
- }
807
- };
808
- var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
809
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
810
- if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
811
- return true;
812
- }
813
- if (nodeToRelocate.getAttribute("slot") === slotName) {
814
- return true;
815
- }
816
- return false;
817
- }
818
- if (nodeToRelocate["s-sn"] === slotName) {
819
- return true;
820
- }
821
- return slotName === "";
822
- };
823
- var nullifyVNodeRefs = (vNode) => {
824
- {
825
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
826
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
827
- }
828
- };
829
- var insertBefore = (parent, newNode, reference) => {
830
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
831
- {
832
- updateElementScopeIds(newNode, parent);
833
- }
834
- return inserted;
835
- };
836
- var findScopeIds = (element) => {
837
- const scopeIds = [];
838
- if (element) {
839
- scopeIds.push(
840
- ...element["s-scs"] || [],
841
- element["s-si"],
842
- element["s-sc"],
843
- ...findScopeIds(element.parentElement)
844
- );
845
- }
846
- return scopeIds;
847
- };
848
- var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
849
- var _a;
850
- if (element && parent && element.nodeType === 1 /* ElementNode */) {
851
- const scopeIds = new Set(findScopeIds(parent).filter(Boolean));
852
- if (scopeIds.size) {
853
- (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = [...scopeIds]);
854
- if (element["s-ol"] || iterateChildNodes) {
855
- for (const childNode of Array.from(element.childNodes)) {
856
- updateElementScopeIds(childNode, element, true);
857
- }
858
- }
859
- }
860
- }
861
- };
862
- var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
863
- var _a, _b, _c, _d;
864
- const hostElm = hostRef.$hostElement$;
865
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
866
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
867
- hostTagName = hostElm.tagName;
868
- if (isInitialLoad && rootVnode.$attrs$) {
869
- for (const key of Object.keys(rootVnode.$attrs$)) {
870
- if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
871
- rootVnode.$attrs$[key] = hostElm[key];
872
- }
873
- }
874
- }
875
- rootVnode.$tag$ = null;
876
- rootVnode.$flags$ |= 4 /* isHost */;
877
- hostRef.$vnode$ = rootVnode;
878
- rootVnode.$elm$ = oldVNode.$elm$ = hostElm;
879
- {
880
- scopeId = hostElm["s-sc"];
881
- }
882
- useNativeShadowDom = supportsShadow ;
883
- {
884
- contentRef = hostElm["s-cr"];
885
- checkSlotFallbackVisibility = false;
886
- }
887
- patch(oldVNode, rootVnode, isInitialLoad);
888
- {
889
- plt.$flags$ |= 1 /* isTmpDisconnected */;
890
- if (checkSlotRelocate) {
891
- markSlotContentForRelocation(rootVnode.$elm$);
892
- for (const relocateData of relocateNodes) {
893
- const nodeToRelocate = relocateData.$nodeToRelocate$;
894
- if (!nodeToRelocate["s-ol"]) {
895
- const orgLocationNode = doc.createTextNode("");
896
- orgLocationNode["s-nr"] = nodeToRelocate;
897
- insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
898
- }
899
- }
900
- for (const relocateData of relocateNodes) {
901
- const nodeToRelocate = relocateData.$nodeToRelocate$;
902
- const slotRefNode = relocateData.$slotRefNode$;
903
- if (slotRefNode) {
904
- const parentNodeRef = slotRefNode.parentNode;
905
- let insertBeforeNode = slotRefNode.nextSibling;
906
- {
907
- let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
908
- while (orgLocationNode) {
909
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
910
- if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === refNode.parentNode) {
911
- refNode = refNode.nextSibling;
912
- while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
913
- refNode = refNode == null ? void 0 : refNode.nextSibling;
914
- }
915
- if (!refNode || !refNode["s-nr"]) {
916
- insertBeforeNode = refNode;
917
- break;
918
- }
919
- }
920
- orgLocationNode = orgLocationNode.previousSibling;
921
- }
922
- }
923
- if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
924
- if (nodeToRelocate !== insertBeforeNode) {
925
- if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
926
- nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
927
- }
928
- insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
929
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
930
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
931
- }
932
- }
933
- }
934
- nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate);
935
- } else {
936
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
937
- if (isInitialLoad) {
938
- nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
939
- }
940
- nodeToRelocate.hidden = true;
941
- }
942
- }
943
- }
944
- }
945
- if (checkSlotFallbackVisibility) {
946
- updateFallbackSlotVisibility(rootVnode.$elm$);
947
- }
948
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
949
- relocateNodes.length = 0;
950
- }
951
- contentRef = void 0;
952
- };
953
-
954
- // src/runtime/update-component.ts
955
- var attachToAncestor = (hostRef, ancestorComponent) => {
956
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
957
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
958
- }
959
- };
960
- var scheduleUpdate = (hostRef, isInitialLoad) => {
961
- {
962
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
963
- }
964
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
965
- hostRef.$flags$ |= 512 /* needsRerender */;
966
- return;
967
- }
968
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
969
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
970
- return writeTask(dispatch) ;
971
- };
972
- var dispatchHooks = (hostRef, isInitialLoad) => {
973
- const elm = hostRef.$hostElement$;
974
- const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
975
- const instance = hostRef.$lazyInstance$ ;
976
- if (!instance) {
977
- throw new Error(
978
- `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`
979
- );
980
- }
981
- let maybePromise;
982
- if (isInitialLoad) {
983
- {
984
- maybePromise = safeCall(instance, "componentWillLoad");
985
- }
986
- }
987
- endSchedule();
988
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
989
- };
990
- var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
991
- console.error(err2);
992
- fn();
993
- }) : fn();
994
- var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
995
- var updateComponent = async (hostRef, instance, isInitialLoad) => {
996
- var _a;
997
- const elm = hostRef.$hostElement$;
998
- const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
999
- const rc = elm["s-rc"];
1000
- const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1001
- {
1002
- callRender(hostRef, instance, elm, isInitialLoad);
1003
- }
1004
- if (rc) {
1005
- rc.map((cb) => cb());
1006
- elm["s-rc"] = void 0;
1007
- }
1008
- endRender();
1009
- endUpdate();
1010
- {
1011
- const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
1012
- const postUpdate = () => postUpdateComponent(hostRef);
1013
- if (childrenPromises.length === 0) {
1014
- postUpdate();
1015
- } else {
1016
- Promise.all(childrenPromises).then(postUpdate);
1017
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1018
- childrenPromises.length = 0;
1019
- }
1020
- }
1021
- };
1022
- var callRender = (hostRef, instance, elm, isInitialLoad) => {
1023
- try {
1024
- instance = instance.render() ;
1025
- {
1026
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1027
- }
1028
- {
1029
- hostRef.$flags$ |= 2 /* hasRendered */;
1030
- }
1031
- {
1032
- {
1033
- {
1034
- renderVdom(hostRef, instance, isInitialLoad);
1035
- }
1036
- }
1037
- }
1038
- } catch (e) {
1039
- consoleError(e, hostRef.$hostElement$);
1040
- }
1041
- return null;
1042
- };
1043
- var postUpdateComponent = (hostRef) => {
1044
- const tagName = hostRef.$cmpMeta$.$tagName$;
1045
- const elm = hostRef.$hostElement$;
1046
- const endPostUpdate = createTime("postUpdate", tagName);
1047
- const ancestorComponent = hostRef.$ancestorComponent$;
1048
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1049
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1050
- {
1051
- addHydratedFlag(elm);
1052
- }
1053
- endPostUpdate();
1054
- {
1055
- hostRef.$onReadyResolve$(elm);
1056
- if (!ancestorComponent) {
1057
- appDidLoad();
1058
- }
1059
- }
1060
- } else {
1061
- endPostUpdate();
1062
- }
1063
- {
1064
- if (hostRef.$onRenderResolve$) {
1065
- hostRef.$onRenderResolve$();
1066
- hostRef.$onRenderResolve$ = void 0;
1067
- }
1068
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1069
- nextTick(() => scheduleUpdate(hostRef, false));
1070
- }
1071
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1072
- }
1073
- };
1074
- var appDidLoad = (who) => {
1075
- {
1076
- addHydratedFlag(doc.documentElement);
1077
- }
1078
- nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1079
- };
1080
- var safeCall = (instance, method, arg) => {
1081
- if (instance && instance[method]) {
1082
- try {
1083
- return instance[method](arg);
1084
- } catch (e) {
1085
- consoleError(e);
1086
- }
1087
- }
1088
- return void 0;
1089
- };
1090
- var addHydratedFlag = (elm) => {
1091
- var _a;
1092
- return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
1093
- };
1094
-
1095
- // src/runtime/set-value.ts
1096
- var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1097
- var setValue = (ref, propName, newVal, cmpMeta) => {
1098
- const hostRef = getHostRef(ref);
1099
- if (!hostRef) {
1100
- throw new Error(
1101
- `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/ionic-team/stencil/issues/5457).`
1102
- );
1103
- }
1104
- const oldVal = hostRef.$instanceValues$.get(propName);
1105
- const flags = hostRef.$flags$;
1106
- const instance = hostRef.$lazyInstance$ ;
1107
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1108
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1109
- const didValueChange = newVal !== oldVal && !areBothNaN;
1110
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1111
- hostRef.$instanceValues$.set(propName, newVal);
1112
- if (instance) {
1113
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1114
- scheduleUpdate(hostRef, false);
1115
- }
1116
- }
1117
- }
1118
- };
1119
-
1120
- // src/runtime/proxy-component.ts
1121
- var proxyComponent = (Cstr, cmpMeta, flags) => {
1122
- var _a, _b;
1123
- const prototype = Cstr.prototype;
1124
- if (cmpMeta.$members$ || BUILD.watchCallback ) {
1125
- const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1126
- members.map(([memberName, [memberFlags]]) => {
1127
- if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1128
- Object.defineProperty(prototype, memberName, {
1129
- get() {
1130
- return getValue(this, memberName);
1131
- },
1132
- set(newValue) {
1133
- setValue(this, memberName, newValue, cmpMeta);
1134
- },
1135
- configurable: true,
1136
- enumerable: true
1137
- });
1138
- }
1139
- });
1140
- if ((flags & 1 /* isElementConstructor */)) {
1141
- const attrNameToPropName = /* @__PURE__ */ new Map();
1142
- prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
1143
- plt.jmp(() => {
1144
- var _a2;
1145
- const propName = attrNameToPropName.get(attrName);
1146
- if (this.hasOwnProperty(propName)) {
1147
- newValue = this[propName];
1148
- delete this[propName];
1149
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
1150
- return;
1151
- } else if (propName == null) {
1152
- const hostRef = getHostRef(this);
1153
- const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
1154
- if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
1155
- const instance = hostRef.$lazyInstance$ ;
1156
- const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
1157
- entry == null ? void 0 : entry.forEach((callbackName) => {
1158
- if (instance[callbackName] != null) {
1159
- instance[callbackName].call(instance, newValue, oldValue, attrName);
1160
- }
1161
- });
1162
- }
1163
- return;
1164
- }
1165
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1166
- });
1167
- };
1168
- Cstr.observedAttributes = Array.from(
1169
- /* @__PURE__ */ new Set([
1170
- ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
1171
- ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
1172
- const attrName = m[1] || propName;
1173
- attrNameToPropName.set(attrName, propName);
1174
- return attrName;
1175
- })
1176
- ])
1177
- );
1178
- }
1179
- }
1180
- return Cstr;
1181
- };
1182
-
1183
- // src/runtime/initialize-component.ts
1184
- var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1185
- let Cstr;
1186
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1187
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1188
- const bundleId = cmpMeta.$lazyBundleId$;
1189
- if (bundleId) {
1190
- const CstrImport = loadModule(cmpMeta);
1191
- if (CstrImport && "then" in CstrImport) {
1192
- const endLoad = uniqueTime();
1193
- Cstr = await CstrImport;
1194
- endLoad();
1195
- } else {
1196
- Cstr = CstrImport;
1197
- }
1198
- if (!Cstr) {
1199
- throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1200
- }
1201
- if (!Cstr.isProxied) {
1202
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1203
- Cstr.isProxied = true;
1204
- }
1205
- const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
1206
- {
1207
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1208
- }
1209
- try {
1210
- new Cstr(hostRef);
1211
- } catch (e) {
1212
- consoleError(e);
1213
- }
1214
- {
1215
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1216
- }
1217
- endNewInstance();
1218
- } else {
1219
- Cstr = elm.constructor;
1220
- const cmpTag = elm.localName;
1221
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1222
- }
1223
- }
1224
- const ancestorComponent = hostRef.$ancestorComponent$;
1225
- const schedule = () => scheduleUpdate(hostRef, true);
1226
- if (ancestorComponent && ancestorComponent["s-rc"]) {
1227
- ancestorComponent["s-rc"].push(schedule);
1228
- } else {
1229
- schedule();
1230
- }
1231
- };
1232
- var fireConnectedCallback = (instance) => {
1233
- };
1234
-
1235
- // src/runtime/connected-callback.ts
1236
- var connectedCallback = (elm) => {
1237
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1238
- const hostRef = getHostRef(elm);
1239
- const cmpMeta = hostRef.$cmpMeta$;
1240
- const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
1241
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1242
- hostRef.$flags$ |= 1 /* hasConnected */;
1243
- {
1244
- if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
1245
- cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
1246
- setContentReference(elm);
1247
- }
1248
- }
1249
- {
1250
- let ancestorComponent = elm;
1251
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1252
- if (ancestorComponent["s-p"]) {
1253
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1254
- break;
1255
- }
1256
- }
1257
- }
1258
- if (cmpMeta.$members$) {
1259
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1260
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1261
- const value = elm[memberName];
1262
- delete elm[memberName];
1263
- elm[memberName] = value;
1264
- }
1265
- });
1266
- }
1267
- {
1268
- initializeComponent(elm, hostRef, cmpMeta);
1269
- }
1270
- } else {
1271
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1272
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1273
- }
1274
- }
1275
- endConnected();
1276
- }
1277
- };
1278
- var setContentReference = (elm) => {
1279
- const contentRefElm = elm["s-cr"] = doc.createComment(
1280
- ""
1281
- );
1282
- contentRefElm["s-cn"] = true;
1283
- insertBefore(elm, contentRefElm, elm.firstChild);
1284
- };
1285
- var disconnectInstance = (instance) => {
1286
- };
1287
- var disconnectedCallback = async (elm) => {
1288
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1289
- const hostRef = getHostRef(elm);
1290
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1291
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
1292
- }
1293
- }
1294
- };
1295
-
1296
- // src/runtime/bootstrap-lazy.ts
1297
- var bootstrapLazy = (lazyBundles, options = {}) => {
1298
- var _a;
1299
- const endBootstrap = createTime();
1300
- const cmpTags = [];
1301
- const exclude = options.exclude || [];
1302
- const customElements2 = win.customElements;
1303
- const head = doc.head;
1304
- const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
1305
- const dataStyles = /* @__PURE__ */ doc.createElement("style");
1306
- const deferredConnectedCallbacks = [];
1307
- let appLoadFallback;
1308
- let isBootstrapping = true;
1309
- Object.assign(plt, options);
1310
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
1311
- let hasSlotRelocation = false;
1312
- lazyBundles.map((lazyBundle) => {
1313
- lazyBundle[1].map((compactMeta) => {
1314
- const cmpMeta = {
1315
- $flags$: compactMeta[0],
1316
- $tagName$: compactMeta[1],
1317
- $members$: compactMeta[2],
1318
- $listeners$: compactMeta[3]
1319
- };
1320
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1321
- hasSlotRelocation = true;
1322
- }
1323
- {
1324
- cmpMeta.$members$ = compactMeta[2];
1325
- }
1326
- const tagName = cmpMeta.$tagName$;
1327
- const HostElement = class extends HTMLElement {
1328
- // StencilLazyHost
1329
- constructor(self) {
1330
- super(self);
1331
- this.hasRegisteredEventListeners = false;
1332
- self = this;
1333
- registerHost(self, cmpMeta);
1334
- }
1335
- connectedCallback() {
1336
- getHostRef(this);
1337
- if (!this.hasRegisteredEventListeners) {
1338
- this.hasRegisteredEventListeners = true;
1339
- }
1340
- if (appLoadFallback) {
1341
- clearTimeout(appLoadFallback);
1342
- appLoadFallback = null;
1343
- }
1344
- if (isBootstrapping) {
1345
- deferredConnectedCallbacks.push(this);
1346
- } else {
1347
- plt.jmp(() => connectedCallback(this));
1348
- }
1349
- }
1350
- disconnectedCallback() {
1351
- plt.jmp(() => disconnectedCallback(this));
1352
- }
1353
- componentOnReady() {
1354
- return getHostRef(this).$onReadyPromise$;
1355
- }
1356
- };
1357
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1358
- if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
1359
- cmpTags.push(tagName);
1360
- customElements2.define(
1361
- tagName,
1362
- proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)
1363
- );
1364
- }
1365
- });
1366
- });
1367
- if (cmpTags.length > 0) {
1368
- if (hasSlotRelocation) {
1369
- dataStyles.textContent += SLOT_FB_CSS;
1370
- }
1371
- {
1372
- dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
1373
- }
1374
- if (dataStyles.innerHTML.length) {
1375
- dataStyles.setAttribute("data-styles", "");
1376
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1377
- if (nonce != null) {
1378
- dataStyles.setAttribute("nonce", nonce);
1379
- }
1380
- head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1381
- }
1382
- }
1383
- isBootstrapping = false;
1384
- if (deferredConnectedCallbacks.length) {
1385
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
1386
- } else {
1387
- {
1388
- plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
1389
- }
1390
- }
1391
- endBootstrap();
1392
- };
1393
-
1394
- // src/runtime/nonce.ts
1395
- var setNonce = (nonce) => plt.$nonce$ = nonce;
1396
-
1397
- export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1398
-
1399
- //# sourceMappingURL=index-81e77ca5.js.map