@rindo/core 4.18.3-dev.1734304270.ca7046f → 4.19.0

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 (45) hide show
  1. package/cli/index.cjs +43 -16
  2. package/cli/index.js +43 -16
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/rindo.js +64 -55
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +3 -3
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +2 -2
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/client/index.js +531 -507
  14. package/internal/client/package.json +3 -1
  15. package/internal/client/patch-browser.js +1 -1
  16. package/internal/hydrate/index.js +104 -49
  17. package/internal/hydrate/package.json +1 -1
  18. package/internal/hydrate/runner.d.ts +29 -11
  19. package/internal/hydrate/runner.js +235 -258
  20. package/internal/package.json +1 -1
  21. package/internal/rindo-private.d.ts +29 -10
  22. package/internal/rindo-public-compiler.d.ts +14 -0
  23. package/internal/rindo-public-runtime.d.ts +0 -2
  24. package/internal/testing/index.js +435 -406
  25. package/internal/testing/package.json +1 -1
  26. package/mock-doc/index.cjs +133 -129
  27. package/mock-doc/index.d.ts +18 -4
  28. package/mock-doc/index.js +133 -129
  29. package/mock-doc/package.json +1 -1
  30. package/package.json +29 -1
  31. package/screenshot/index.js +1 -1
  32. package/screenshot/package.json +1 -1
  33. package/screenshot/pixel-match.js +1 -1
  34. package/sys/node/index.js +10 -10
  35. package/sys/node/package.json +1 -1
  36. package/sys/node/worker.js +1 -1
  37. package/testing/index.js +68 -4
  38. package/testing/jest/jest-27-and-under/matchers/events.d.ts +4 -0
  39. package/testing/jest/jest-27-and-under/matchers/index.d.ts +2 -1
  40. package/testing/jest/jest-28/matchers/events.d.ts +4 -0
  41. package/testing/jest/jest-28/matchers/index.d.ts +2 -1
  42. package/testing/jest/jest-29/matchers/events.d.ts +4 -0
  43. package/testing/jest/jest-29/matchers/index.d.ts +2 -1
  44. package/testing/package.json +1 -1
  45. package/testing/puppeteer/puppeteer-declarations.d.ts +11 -0
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Client Platform v4.18.3-dev.1734304270.ca7046f | MIT Licensed | https://rindojs.web.app
2
+ Rindo Client Platform v4.19.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -17,7 +17,226 @@ var Build = {
17
17
  };
18
18
 
19
19
  // src/client/client-host-ref.ts
20
- import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
20
+ import { BUILD as BUILD2 } from "@rindo/core/internal/app-data";
21
+ var hostRefs = BUILD2.hotModuleReplacement ? window.__RINDO_HOSTREFS__ || (window.__RINDO_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
22
+ var getHostRef = (ref) => hostRefs.get(ref);
23
+ var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
24
+ var registerHost = (hostElement, cmpMeta) => {
25
+ const hostRef = {
26
+ $flags$: 0,
27
+ $hostElement$: hostElement,
28
+ $cmpMeta$: cmpMeta,
29
+ $instanceValues$: /* @__PURE__ */ new Map()
30
+ };
31
+ if (BUILD2.isDev) {
32
+ hostRef.$renderCount$ = 0;
33
+ }
34
+ if (BUILD2.method && BUILD2.lazyLoad) {
35
+ hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
36
+ }
37
+ if (BUILD2.asyncLoading) {
38
+ hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
39
+ hostElement["s-p"] = [];
40
+ hostElement["s-rc"] = [];
41
+ }
42
+ return hostRefs.set(hostElement, hostRef);
43
+ };
44
+ var isMemberInElement = (elm, memberName) => memberName in elm;
45
+
46
+ // src/client/client-load-module.ts
47
+ import { BUILD as BUILD4 } from "@rindo/core/internal/app-data";
48
+
49
+ // src/client/client-log.ts
50
+ import { BUILD as BUILD3 } from "@rindo/core/internal/app-data";
51
+ var customError;
52
+ var consoleError = (e, el) => (customError || console.error)(e, el);
53
+ var RINDO_DEV_MODE = BUILD3.isTesting ? ["RINDO:"] : [
54
+ "%crindo",
55
+ "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
56
+ ];
57
+ var consoleDevError = (...m) => console.error(...RINDO_DEV_MODE, ...m);
58
+ var consoleDevWarn = (...m) => console.warn(...RINDO_DEV_MODE, ...m);
59
+ var consoleDevInfo = (...m) => console.info(...RINDO_DEV_MODE, ...m);
60
+ var setErrorHandler = (handler) => customError = handler;
61
+
62
+ // src/client/client-load-module.ts
63
+ var cmpModules = /* @__PURE__ */ new Map();
64
+ var MODULE_IMPORT_PREFIX = "./";
65
+ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
66
+ const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
67
+ const bundleId = cmpMeta.$lazyBundleId$;
68
+ if (BUILD4.isDev && typeof bundleId !== "string") {
69
+ consoleDevError(
70
+ `Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`
71
+ );
72
+ return void 0;
73
+ } else if (!bundleId) {
74
+ return void 0;
75
+ }
76
+ const module = !BUILD4.hotModuleReplacement ? cmpModules.get(bundleId) : false;
77
+ if (module) {
78
+ return module[exportName];
79
+ }
80
+ /*!__RINDO_STATIC_IMPORT_SWITCH__*/
81
+ return import(
82
+ /* @wite-ignore */
83
+ /* @lahm-ignore */
84
+ /* webpackInclude: /\.entry\.js$/ */
85
+ /* webpackExclude: /\.system\.entry\.js$/ */
86
+ /* webpackMode: "lazy" */
87
+ `./${bundleId}.entry.js${BUILD4.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
88
+ ).then((importedModule) => {
89
+ if (!BUILD4.hotModuleReplacement) {
90
+ cmpModules.set(bundleId, importedModule);
91
+ }
92
+ return importedModule[exportName];
93
+ }, consoleError);
94
+ };
95
+
96
+ // src/client/client-style.ts
97
+ var styles = /* @__PURE__ */ new Map();
98
+ var modeResolutionChain = [];
99
+
100
+ // src/client/client-task-queue.ts
101
+ import { BUILD as BUILD6 } from "@rindo/core/internal/app-data";
102
+
103
+ // src/runtime/runtime-constants.ts
104
+ var CONTENT_REF_ID = "r";
105
+ var ORG_LOCATION_ID = "o";
106
+ var SLOT_NODE_ID = "s";
107
+ var TEXT_NODE_ID = "t";
108
+ var HYDRATE_ID = "s-id";
109
+ var HYDRATED_STYLE_ID = "sty-id";
110
+ var HYDRATE_CHILD_ID = "c-id";
111
+ var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
112
+ var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
113
+ var XLINK_NS = "http://www.w3.org/1999/xlink";
114
+ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
115
+ "formAssociatedCallback",
116
+ "formResetCallback",
117
+ "formDisabledCallback",
118
+ "formStateRestoreCallback"
119
+ ];
120
+
121
+ // src/client/client-window.ts
122
+ import { BUILD as BUILD5 } from "@rindo/core/internal/app-data";
123
+ var win = typeof window !== "undefined" ? window : {};
124
+ var doc = win.document || { head: {} };
125
+ var H = win.HTMLElement || class {
126
+ };
127
+ var plt = {
128
+ $flags$: 0,
129
+ $resourcesUrl$: "",
130
+ jmp: (h2) => h2(),
131
+ raf: (h2) => requestAnimationFrame(h2),
132
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
133
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
134
+ ce: (eventName, opts) => new CustomEvent(eventName, opts)
135
+ };
136
+ var setPlatformHelpers = (helpers) => {
137
+ Object.assign(plt, helpers);
138
+ };
139
+ var supportsShadow = BUILD5.shadowDom;
140
+ var supportsListenerOptions = /* @__PURE__ */ (() => {
141
+ let supportsListenerOptions2 = false;
142
+ try {
143
+ doc.addEventListener(
144
+ "e",
145
+ null,
146
+ Object.defineProperty({}, "passive", {
147
+ get() {
148
+ supportsListenerOptions2 = true;
149
+ }
150
+ })
151
+ );
152
+ } catch (e) {
153
+ }
154
+ return supportsListenerOptions2;
155
+ })();
156
+ var promiseResolve = (v) => Promise.resolve(v);
157
+ var supportsConstructableStylesheets = BUILD5.constructableCSS ? /* @__PURE__ */ (() => {
158
+ try {
159
+ new CSSStyleSheet();
160
+ return typeof new CSSStyleSheet().replaceSync === "function";
161
+ } catch (e) {
162
+ }
163
+ return false;
164
+ })() : false;
165
+
166
+ // src/client/client-task-queue.ts
167
+ var queueCongestion = 0;
168
+ var queuePending = false;
169
+ var queueDomReads = [];
170
+ var queueDomWrites = [];
171
+ var queueDomWritesLow = [];
172
+ var queueTask = (queue, write) => (cb) => {
173
+ queue.push(cb);
174
+ if (!queuePending) {
175
+ queuePending = true;
176
+ if (write && plt.$flags$ & 4 /* queueSync */) {
177
+ nextTick(flush);
178
+ } else {
179
+ plt.raf(flush);
180
+ }
181
+ }
182
+ };
183
+ var consume = (queue) => {
184
+ for (let i2 = 0; i2 < queue.length; i2++) {
185
+ try {
186
+ queue[i2](performance.now());
187
+ } catch (e) {
188
+ consoleError(e);
189
+ }
190
+ }
191
+ queue.length = 0;
192
+ };
193
+ var consumeTimeout = (queue, timeout) => {
194
+ let i2 = 0;
195
+ let ts = 0;
196
+ while (i2 < queue.length && (ts = performance.now()) < timeout) {
197
+ try {
198
+ queue[i2++](ts);
199
+ } catch (e) {
200
+ consoleError(e);
201
+ }
202
+ }
203
+ if (i2 === queue.length) {
204
+ queue.length = 0;
205
+ } else if (i2 !== 0) {
206
+ queue.splice(0, i2);
207
+ }
208
+ };
209
+ var flush = () => {
210
+ if (BUILD6.asyncQueue) {
211
+ queueCongestion++;
212
+ }
213
+ consume(queueDomReads);
214
+ if (BUILD6.asyncQueue) {
215
+ const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;
216
+ consumeTimeout(queueDomWrites, timeout);
217
+ consumeTimeout(queueDomWritesLow, timeout);
218
+ if (queueDomWrites.length > 0) {
219
+ queueDomWritesLow.push(...queueDomWrites);
220
+ queueDomWrites.length = 0;
221
+ }
222
+ if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
223
+ plt.raf(flush);
224
+ } else {
225
+ queueCongestion = 0;
226
+ }
227
+ } else {
228
+ consume(queueDomWrites);
229
+ if (queuePending = queueDomReads.length > 0) {
230
+ plt.raf(flush);
231
+ }
232
+ }
233
+ };
234
+ var nextTick = (cb) => promiseResolve().then(cb);
235
+ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
236
+ var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
237
+
238
+ // src/client/index.ts
239
+ import { BUILD as BUILD27, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
21
240
 
22
241
  // src/runtime/asset-path.ts
23
242
  var getAssetPath = (path) => {
@@ -27,7 +246,7 @@ var getAssetPath = (path) => {
27
246
  var setAssetPath = (path) => plt.$resourcesUrl$ = path;
28
247
 
29
248
  // src/runtime/bootstrap-custom-element.ts
30
- import { BUILD as BUILD19 } from "@rindo/core/internal/app-data";
249
+ import { BUILD as BUILD24 } from "@rindo/core/internal/app-data";
31
250
 
32
251
  // src/utils/constants.ts
33
252
  var EMPTY_OBJ = {};
@@ -97,16 +316,16 @@ var unwrapErr = (result) => {
97
316
  };
98
317
 
99
318
  // src/runtime/connected-callback.ts
100
- import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
319
+ import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
101
320
 
102
321
  // src/runtime/client-hydrate.ts
103
- import { BUILD as BUILD4 } from "@rindo/core/internal/app-data";
322
+ import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
104
323
 
105
324
  // src/runtime/profile.ts
106
- import { BUILD as BUILD2 } from "@rindo/core/internal/app-data";
325
+ import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
107
326
  var i = 0;
108
327
  var createTime = (fnName, tagName = "") => {
109
- if (BUILD2.profile && performance.mark) {
328
+ if (BUILD7.profile && performance.mark) {
110
329
  const key = `st:${fnName}:${tagName}:${i++}`;
111
330
  performance.mark(key);
112
331
  return () => performance.measure(`[Rindo] ${fnName}() <${tagName}>`, key);
@@ -117,7 +336,7 @@ var createTime = (fnName, tagName = "") => {
117
336
  }
118
337
  };
119
338
  var uniqueTime = (key, measureText) => {
120
- if (BUILD2.profile && performance.mark) {
339
+ if (BUILD7.profile && performance.mark) {
121
340
  if (performance.getEntriesByName(key, "mark").length === 0) {
122
341
  performance.mark(key);
123
342
  }
@@ -175,7 +394,7 @@ var inspect = (ref) => {
175
394
  };
176
395
  };
177
396
  var installDevTools = () => {
178
- if (BUILD2.devTools) {
397
+ if (BUILD7.devTools) {
179
398
  const rindo = win.rindo = win.rindo || {};
180
399
  const originalInspect = rindo.inspect;
181
400
  rindo.inspect = (ref) => {
@@ -188,26 +407,8 @@ var installDevTools = () => {
188
407
  }
189
408
  };
190
409
 
191
- // src/runtime/runtime-constants.ts
192
- var CONTENT_REF_ID = "r";
193
- var ORG_LOCATION_ID = "o";
194
- var SLOT_NODE_ID = "s";
195
- var TEXT_NODE_ID = "t";
196
- var HYDRATE_ID = "s-id";
197
- var HYDRATED_STYLE_ID = "sty-id";
198
- var HYDRATE_CHILD_ID = "c-id";
199
- var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
200
- var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
201
- var XLINK_NS = "http://www.w3.org/1999/xlink";
202
- var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
203
- "formAssociatedCallback",
204
- "formResetCallback",
205
- "formDisabledCallback",
206
- "formStateRestoreCallback"
207
- ];
208
-
209
410
  // src/runtime/vdom/h.ts
210
- import { BUILD as BUILD3 } from "@rindo/core/internal/app-data";
411
+ import { BUILD as BUILD8 } from "@rindo/core/internal/app-data";
211
412
  var h = (nodeName, vnodeData, ...children) => {
212
413
  let child = null;
213
414
  let key = null;
@@ -223,7 +424,7 @@ var h = (nodeName, vnodeData, ...children) => {
223
424
  } else if (child != null && typeof child !== "boolean") {
224
425
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
225
426
  child = String(child);
226
- } else if (BUILD3.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
427
+ } else if (BUILD8.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
227
428
  consoleDevError(`vNode passed as children has unexpected type.
228
429
  Make sure it's using the correct h() function.
229
430
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -239,28 +440,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
239
440
  };
240
441
  walk(children);
241
442
  if (vnodeData) {
242
- if (BUILD3.isDev && nodeName === "input") {
443
+ if (BUILD8.isDev && nodeName === "input") {
243
444
  validateInputProperties(vnodeData);
244
445
  }
245
- if (BUILD3.vdomKey && vnodeData.key) {
446
+ if (BUILD8.vdomKey && vnodeData.key) {
246
447
  key = vnodeData.key;
247
448
  }
248
- if (BUILD3.slotRelocation && vnodeData.name) {
449
+ if (BUILD8.slotRelocation && vnodeData.name) {
249
450
  slotName = vnodeData.name;
250
451
  }
251
- if (BUILD3.vdomClass) {
452
+ if (BUILD8.vdomClass) {
252
453
  const classData = vnodeData.className || vnodeData.class;
253
454
  if (classData) {
254
455
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
255
456
  }
256
457
  }
257
458
  }
258
- if (BUILD3.isDev && vNodeChildren.some(isHost)) {
459
+ if (BUILD8.isDev && vNodeChildren.some(isHost)) {
259
460
  consoleDevError(`The <Host> must be the single root component. Make sure:
260
461
  - You are NOT using hostData() and <Host> in the same component.
261
462
  - <Host> is used once, and it's the single root component of the render() function.`);
262
463
  }
263
- if (BUILD3.vdomFunctional && typeof nodeName === "function") {
464
+ if (BUILD8.vdomFunctional && typeof nodeName === "function") {
264
465
  return nodeName(
265
466
  vnodeData === null ? {} : vnodeData,
266
467
  vNodeChildren,
@@ -272,10 +473,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
272
473
  if (vNodeChildren.length > 0) {
273
474
  vnode.$children$ = vNodeChildren;
274
475
  }
275
- if (BUILD3.vdomKey) {
476
+ if (BUILD8.vdomKey) {
276
477
  vnode.$key$ = key;
277
478
  }
278
- if (BUILD3.slotRelocation) {
479
+ if (BUILD8.slotRelocation) {
279
480
  vnode.$name$ = slotName;
280
481
  }
281
482
  return vnode;
@@ -288,13 +489,13 @@ var newVNode = (tag, text) => {
288
489
  $elm$: null,
289
490
  $children$: null
290
491
  };
291
- if (BUILD3.vdomAttribute) {
492
+ if (BUILD8.vdomAttribute) {
292
493
  vnode.$attrs$ = null;
293
494
  }
294
- if (BUILD3.vdomKey) {
495
+ if (BUILD8.vdomKey) {
295
496
  vnode.$key$ = null;
296
497
  }
297
- if (BUILD3.slotRelocation) {
498
+ if (BUILD8.slotRelocation) {
298
499
  vnode.$name$ = null;
299
500
  }
300
501
  return vnode;
@@ -352,7 +553,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
352
553
  const shadowRoot = hostElm.shadowRoot;
353
554
  const childRenderNodes = [];
354
555
  const slotNodes = [];
355
- const shadowRootNodes = BUILD4.shadowDom && shadowRoot ? [] : null;
556
+ const shadowRootNodes = BUILD9.shadowDom && shadowRoot ? [] : null;
356
557
  const vnode = hostRef.$vnode$ = newVNode(tagName, null);
357
558
  if (!plt.$orgLocNodes$) {
358
559
  initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
@@ -376,7 +577,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
376
577
  }
377
578
  plt.$orgLocNodes$.delete(orgLocationId);
378
579
  });
379
- if (BUILD4.shadowDom && shadowRoot) {
580
+ if (BUILD9.shadowDom && shadowRoot) {
380
581
  shadowRootNodes.map((shadowRootNode) => {
381
582
  if (shadowRootNode) {
382
583
  shadowRoot.appendChild(shadowRootNode);
@@ -486,7 +687,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
486
687
  node["s-sn"] = "";
487
688
  }
488
689
  node["s-sr"] = true;
489
- if (BUILD4.shadowDom && shadowRootNodes) {
690
+ if (BUILD9.shadowDom && shadowRootNodes) {
490
691
  childVNode.$elm$ = doc.createElement(childVNode.$tag$);
491
692
  if (childVNode.$name$) {
492
693
  childVNode.$elm$.setAttribute("name", childVNode.$name$);
@@ -503,9 +704,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
503
704
  }
504
705
  parentVNode.$children$[childVNode.$index$] = childVNode;
505
706
  } else if (childNodeType === CONTENT_REF_ID) {
506
- if (BUILD4.shadowDom && shadowRootNodes) {
707
+ if (BUILD9.shadowDom && shadowRootNodes) {
507
708
  node.remove();
508
- } else if (BUILD4.slotRelocation) {
709
+ } else if (BUILD9.slotRelocation) {
509
710
  hostElm["s-cr"] = node;
510
711
  node["s-cn"] = true;
511
712
  }
@@ -541,7 +742,7 @@ var initializeDocumentHydrate = (node, orgLocNodes) => {
541
742
  };
542
743
 
543
744
  // src/runtime/initialize-component.ts
544
- import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
745
+ import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
545
746
 
546
747
  // src/runtime/mode.ts
547
748
  var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
@@ -549,22 +750,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
549
750
  var getMode = (ref) => getHostRef(ref).$modeName$;
550
751
 
551
752
  // src/runtime/proxy-component.ts
552
- import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
753
+ import { BUILD as BUILD19 } from "@rindo/core/internal/app-data";
553
754
 
554
755
  // src/runtime/set-value.ts
555
- import { BUILD as BUILD13 } from "@rindo/core/internal/app-data";
756
+ import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
556
757
 
557
758
  // src/runtime/parse-property-value.ts
558
- import { BUILD as BUILD5 } from "@rindo/core/internal/app-data";
759
+ import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
559
760
  var parsePropertyValue = (propValue, propType) => {
560
761
  if (propValue != null && !isComplexType(propValue)) {
561
- if (BUILD5.propBoolean && propType & 4 /* Boolean */) {
762
+ if (BUILD10.propBoolean && propType & 4 /* Boolean */) {
562
763
  return propValue === "false" ? false : propValue === "" || !!propValue;
563
764
  }
564
- if (BUILD5.propNumber && propType & 2 /* Number */) {
765
+ if (BUILD10.propNumber && propType & 2 /* Number */) {
565
766
  return parseFloat(propValue);
566
767
  }
567
- if (BUILD5.propString && propType & 1 /* String */) {
768
+ if (BUILD10.propString && propType & 1 /* String */) {
568
769
  return String(propValue);
569
770
  }
570
771
  return propValue;
@@ -573,21 +774,21 @@ var parsePropertyValue = (propValue, propType) => {
573
774
  };
574
775
 
575
776
  // src/runtime/update-component.ts
576
- import { BUILD as BUILD12, NAMESPACE } from "@rindo/core/internal/app-data";
777
+ import { BUILD as BUILD17, NAMESPACE } from "@rindo/core/internal/app-data";
577
778
 
578
779
  // src/runtime/event-emitter.ts
579
- import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
780
+ import { BUILD as BUILD12 } from "@rindo/core/internal/app-data";
580
781
 
581
782
  // src/runtime/element.ts
582
- import { BUILD as BUILD6 } from "@rindo/core/internal/app-data";
583
- var getElement = (ref) => BUILD6.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
783
+ import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
784
+ var getElement = (ref) => BUILD11.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
584
785
 
585
786
  // src/runtime/event-emitter.ts
586
787
  var createEvent = (ref, name, flags) => {
587
788
  const elm = getElement(ref);
588
789
  return {
589
790
  emit: (detail) => {
590
- if (BUILD7.isDev && !elm.isConnected) {
791
+ if (BUILD12.isDev && !elm.isConnected) {
591
792
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
592
793
  }
593
794
  return emitEvent(elm, name, {
@@ -606,7 +807,7 @@ var emitEvent = (elm, name, opts) => {
606
807
  };
607
808
 
608
809
  // src/runtime/styles.ts
609
- import { BUILD as BUILD8 } from "@rindo/core/internal/app-data";
810
+ import { BUILD as BUILD13 } from "@rindo/core/internal/app-data";
610
811
  var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
611
812
  var registerStyle = (scopeId2, cssText, allowCS) => {
612
813
  let style = styles.get(scopeId2);
@@ -624,22 +825,24 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
624
825
  };
625
826
  var addStyle = (styleContainerNode, cmpMeta, mode) => {
626
827
  var _a;
828
+ const styleContainerDocument = styleContainerNode;
829
+ const styleContainerShadowRoot = styleContainerNode;
627
830
  const scopeId2 = getScopeId(cmpMeta, mode);
628
831
  const style = styles.get(scopeId2);
629
- if (!BUILD8.attachStyles) {
832
+ if (!BUILD13.attachStyles) {
630
833
  return scopeId2;
631
834
  }
632
835
  styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
633
836
  if (style) {
634
837
  if (typeof style === "string") {
635
- styleContainerNode = styleContainerNode.head || styleContainerNode;
838
+ styleContainerNode = styleContainerDocument.head || styleContainerNode;
636
839
  let appliedStyles = rootAppliedStyles.get(styleContainerNode);
637
840
  let styleElm;
638
841
  if (!appliedStyles) {
639
842
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
640
843
  }
641
844
  if (!appliedStyles.has(scopeId2)) {
642
- if (BUILD8.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
845
+ if (BUILD13.hydrateClientSide && styleContainerShadowRoot.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
643
846
  styleElm.innerHTML = style;
644
847
  } else {
645
848
  styleElm = doc.createElement("style");
@@ -648,7 +851,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
648
851
  if (nonce != null) {
649
852
  styleElm.setAttribute("nonce", nonce);
650
853
  }
651
- if (BUILD8.hydrateServerSide || BUILD8.hotModuleReplacement) {
854
+ if (BUILD13.hydrateServerSide || BUILD13.hotModuleReplacement) {
652
855
  styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
653
856
  }
654
857
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
@@ -660,8 +863,8 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
660
863
  appliedStyles.add(scopeId2);
661
864
  }
662
865
  }
663
- } else if (BUILD8.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
664
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
866
+ } else if (BUILD13.constructableCSS && !styleContainerDocument.adoptedStyleSheets.includes(style)) {
867
+ styleContainerDocument.adoptedStyleSheets = [...styleContainerDocument.adoptedStyleSheets, style];
665
868
  }
666
869
  }
667
870
  return scopeId2;
@@ -672,45 +875,45 @@ var attachStyles = (hostRef) => {
672
875
  const flags = cmpMeta.$flags$;
673
876
  const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
674
877
  const scopeId2 = addStyle(
675
- BUILD8.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
878
+ BUILD13.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
676
879
  cmpMeta,
677
880
  hostRef.$modeName$
678
881
  );
679
- if ((BUILD8.shadowDom || BUILD8.scoped) && BUILD8.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
882
+ if ((BUILD13.shadowDom || BUILD13.scoped) && BUILD13.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
680
883
  elm["s-sc"] = scopeId2;
681
884
  elm.classList.add(scopeId2 + "-h");
682
- if (BUILD8.scoped && flags & 2 /* scopedCssEncapsulation */) {
885
+ if (BUILD13.scoped && flags & 2 /* scopedCssEncapsulation */) {
683
886
  elm.classList.add(scopeId2 + "-s");
684
887
  }
685
888
  }
686
889
  endAttachStyles();
687
890
  };
688
- var getScopeId = (cmp, mode) => "sc-" + (BUILD8.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
891
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD13.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
689
892
  var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
690
893
 
691
894
  // src/runtime/vdom/vdom-render.ts
692
- import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
895
+ import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
693
896
 
694
897
  // src/runtime/vdom/update-element.ts
695
- import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
898
+ import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
696
899
 
697
900
  // src/runtime/vdom/set-accessor.ts
698
- import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
901
+ import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
699
902
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
700
903
  if (oldValue !== newValue) {
701
904
  let isProp = isMemberInElement(elm, memberName);
702
905
  let ln = memberName.toLowerCase();
703
- if (BUILD9.vdomClass && memberName === "class") {
906
+ if (BUILD14.vdomClass && memberName === "class") {
704
907
  const classList = elm.classList;
705
908
  const oldClasses = parseClassList(oldValue);
706
909
  const newClasses = parseClassList(newValue);
707
910
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
708
911
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
709
- } else if (BUILD9.vdomStyle && memberName === "style") {
710
- if (BUILD9.updatable) {
912
+ } else if (BUILD14.vdomStyle && memberName === "style") {
913
+ if (BUILD14.updatable) {
711
914
  for (const prop in oldValue) {
712
915
  if (!newValue || newValue[prop] == null) {
713
- if (!BUILD9.hydrateServerSide && prop.includes("-")) {
916
+ if (!BUILD14.hydrateServerSide && prop.includes("-")) {
714
917
  elm.style.removeProperty(prop);
715
918
  } else {
716
919
  elm.style[prop] = "";
@@ -720,19 +923,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
720
923
  }
721
924
  for (const prop in newValue) {
722
925
  if (!oldValue || newValue[prop] !== oldValue[prop]) {
723
- if (!BUILD9.hydrateServerSide && prop.includes("-")) {
926
+ if (!BUILD14.hydrateServerSide && prop.includes("-")) {
724
927
  elm.style.setProperty(prop, newValue[prop]);
725
928
  } else {
726
929
  elm.style[prop] = newValue[prop];
727
930
  }
728
931
  }
729
932
  }
730
- } else if (BUILD9.vdomKey && memberName === "key") {
731
- } else if (BUILD9.vdomRef && memberName === "ref") {
933
+ } else if (BUILD14.vdomKey && memberName === "key") {
934
+ } else if (BUILD14.vdomRef && memberName === "ref") {
732
935
  if (newValue) {
733
936
  newValue(elm);
734
937
  }
735
- } else if (BUILD9.vdomListener && (BUILD9.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
938
+ } else if (BUILD14.vdomListener && (BUILD14.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
736
939
  if (memberName[2] === "-") {
737
940
  memberName = memberName.slice(3);
738
941
  } else if (isMemberInElement(win, ln)) {
@@ -750,7 +953,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
750
953
  plt.ael(elm, memberName, newValue, capture);
751
954
  }
752
955
  }
753
- } else if (BUILD9.vdomPropOrAttr) {
956
+ } else if (BUILD14.vdomPropOrAttr) {
754
957
  const isComplex = isComplexType(newValue);
755
958
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
756
959
  try {
@@ -768,7 +971,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
768
971
  }
769
972
  }
770
973
  let xlink = false;
771
- if (BUILD9.vdomXlink) {
974
+ if (BUILD14.vdomXlink) {
772
975
  if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
773
976
  memberName = ln;
774
977
  xlink = true;
@@ -776,7 +979,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
776
979
  }
777
980
  if (newValue == null || newValue === false) {
778
981
  if (newValue !== false || elm.getAttribute(memberName) === "") {
779
- if (BUILD9.vdomXlink && xlink) {
982
+ if (BUILD14.vdomXlink && xlink) {
780
983
  elm.removeAttributeNS(XLINK_NS, memberName);
781
984
  } else {
782
985
  elm.removeAttribute(memberName);
@@ -784,7 +987,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
784
987
  }
785
988
  } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
786
989
  newValue = newValue === true ? "" : newValue;
787
- if (BUILD9.vdomXlink && xlink) {
990
+ if (BUILD14.vdomXlink && xlink) {
788
991
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
789
992
  } else {
790
993
  elm.setAttribute(memberName, newValue);
@@ -803,7 +1006,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
803
1006
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
804
1007
  const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
805
1008
  const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
806
- if (BUILD10.updatable) {
1009
+ if (BUILD15.updatable) {
807
1010
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
808
1011
  if (!(memberName in newVnodeAttrs)) {
809
1012
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
@@ -839,7 +1042,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
839
1042
  let elm;
840
1043
  let childNode;
841
1044
  let oldVNode;
842
- if (BUILD11.slotRelocation && !useNativeShadowDom) {
1045
+ if (BUILD16.slotRelocation && !useNativeShadowDom) {
843
1046
  checkSlotRelocate = true;
844
1047
  if (newVNode2.$tag$ === "slot") {
845
1048
  if (scopeId) {
@@ -857,35 +1060,35 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
857
1060
  );
858
1061
  }
859
1062
  }
860
- if (BUILD11.isDev && newVNode2.$elm$) {
1063
+ if (BUILD16.isDev && newVNode2.$elm$) {
861
1064
  consoleDevError(
862
1065
  `The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://rindojs.web.app/docs/templating-jsx#avoid-shared-jsx-nodes`
863
1066
  );
864
1067
  }
865
- if (BUILD11.vdomText && newVNode2.$text$ !== null) {
1068
+ if (BUILD16.vdomText && newVNode2.$text$ !== null) {
866
1069
  elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
867
- } else if (BUILD11.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
868
- elm = newVNode2.$elm$ = BUILD11.isDebug || BUILD11.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
1070
+ } else if (BUILD16.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
1071
+ elm = newVNode2.$elm$ = BUILD16.isDebug || BUILD16.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
869
1072
  } else {
870
- if (BUILD11.svg && !isSvgMode) {
1073
+ if (BUILD16.svg && !isSvgMode) {
871
1074
  isSvgMode = newVNode2.$tag$ === "svg";
872
1075
  }
873
- elm = newVNode2.$elm$ = BUILD11.svg ? doc.createElementNS(
1076
+ elm = newVNode2.$elm$ = BUILD16.svg ? doc.createElementNS(
874
1077
  isSvgMode ? SVG_NS : HTML_NS,
875
- BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
1078
+ !useNativeShadowDom && BUILD16.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
876
1079
  ) : doc.createElement(
877
- BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
1080
+ !useNativeShadowDom && BUILD16.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
878
1081
  );
879
- if (BUILD11.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
1082
+ if (BUILD16.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
880
1083
  isSvgMode = false;
881
1084
  }
882
- if (BUILD11.vdomAttribute) {
1085
+ if (BUILD16.vdomAttribute) {
883
1086
  updateElement(null, newVNode2, isSvgMode);
884
1087
  }
885
- if ((BUILD11.shadowDom || BUILD11.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
1088
+ if ((BUILD16.shadowDom || BUILD16.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
886
1089
  elm.classList.add(elm["s-si"] = scopeId);
887
1090
  }
888
- if (BUILD11.scoped) {
1091
+ if (BUILD16.scoped) {
889
1092
  updateElementScopeIds(elm, parentElm);
890
1093
  }
891
1094
  if (newVNode2.$children$) {
@@ -896,7 +1099,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
896
1099
  }
897
1100
  }
898
1101
  }
899
- if (BUILD11.svg) {
1102
+ if (BUILD16.svg) {
900
1103
  if (newVNode2.$tag$ === "svg") {
901
1104
  isSvgMode = false;
902
1105
  } else if (elm.tagName === "foreignObject") {
@@ -905,7 +1108,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
905
1108
  }
906
1109
  }
907
1110
  elm["s-hn"] = hostTagName;
908
- if (BUILD11.slotRelocation) {
1111
+ if (BUILD16.slotRelocation) {
909
1112
  if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
910
1113
  elm["s-sr"] = true;
911
1114
  elm["s-cr"] = contentRef;
@@ -913,7 +1116,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
913
1116
  elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
914
1117
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
915
1118
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
916
- if (BUILD11.experimentalSlotFixes) {
1119
+ if (BUILD16.experimentalSlotFixes) {
917
1120
  relocateToHostRoot(oldParentVNode.$elm$);
918
1121
  } else {
919
1122
  putBackInOriginalLocation(oldParentVNode.$elm$, false);
@@ -942,7 +1145,7 @@ var relocateToHostRoot = (parentElm) => {
942
1145
  var putBackInOriginalLocation = (parentElm, recursive) => {
943
1146
  plt.$flags$ |= 1 /* isTmpDisconnected */;
944
1147
  const oldSlotChildNodes = Array.from(parentElm.childNodes);
945
- if (parentElm["s-sr"] && BUILD11.experimentalSlotFixes) {
1148
+ if (parentElm["s-sr"] && BUILD16.experimentalSlotFixes) {
946
1149
  let node = parentElm;
947
1150
  while (node = node.nextSibling) {
948
1151
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -966,9 +1169,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
966
1169
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
967
1170
  };
968
1171
  var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
969
- let containerElm = BUILD11.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
1172
+ let containerElm = BUILD16.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
970
1173
  let childNode;
971
- if (BUILD11.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1174
+ if (BUILD16.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
972
1175
  containerElm = containerElm.shadowRoot;
973
1176
  }
974
1177
  for (; startIdx <= endIdx; ++startIdx) {
@@ -976,7 +1179,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
976
1179
  childNode = createElm(null, parentVNode, startIdx, parentElm);
977
1180
  if (childNode) {
978
1181
  vnodes[startIdx].$elm$ = childNode;
979
- insertBefore(containerElm, childNode, BUILD11.slotRelocation ? referenceNode(before) : before);
1182
+ insertBefore(containerElm, childNode, BUILD16.slotRelocation ? referenceNode(before) : before);
980
1183
  }
981
1184
  }
982
1185
  }
@@ -988,7 +1191,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
988
1191
  const elm = vnode.$elm$;
989
1192
  nullifyVNodeRefs(vnode);
990
1193
  if (elm) {
991
- if (BUILD11.slotRelocation) {
1194
+ if (BUILD16.slotRelocation) {
992
1195
  checkSlotFallbackVisibility = true;
993
1196
  if (elm["s-ol"]) {
994
1197
  elm["s-ol"].remove();
@@ -1032,7 +1235,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1032
1235
  oldEndVnode = oldCh[--oldEndIdx];
1033
1236
  newEndVnode = newCh[--newEndIdx];
1034
1237
  } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
1035
- if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1238
+ if (BUILD16.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1036
1239
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1037
1240
  }
1038
1241
  patch(oldStartVnode, newEndVnode, isInitialRender);
@@ -1040,7 +1243,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1040
1243
  oldStartVnode = oldCh[++oldStartIdx];
1041
1244
  newEndVnode = newCh[--newEndIdx];
1042
1245
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
1043
- if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1246
+ if (BUILD16.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1044
1247
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1045
1248
  }
1046
1249
  patch(oldEndVnode, newStartVnode, isInitialRender);
@@ -1049,7 +1252,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1049
1252
  newStartVnode = newCh[++newStartIdx];
1050
1253
  } else {
1051
1254
  idxInOld = -1;
1052
- if (BUILD11.vdomKey) {
1255
+ if (BUILD16.vdomKey) {
1053
1256
  for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
1054
1257
  if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
1055
1258
  idxInOld = i2;
@@ -1057,7 +1260,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1057
1260
  }
1058
1261
  }
1059
1262
  }
1060
- if (BUILD11.vdomKey && idxInOld >= 0) {
1263
+ if (BUILD16.vdomKey && idxInOld >= 0) {
1061
1264
  elmToMove = oldCh[idxInOld];
1062
1265
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1063
1266
  node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
@@ -1072,7 +1275,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1072
1275
  newStartVnode = newCh[++newStartIdx];
1073
1276
  }
1074
1277
  if (node) {
1075
- if (BUILD11.slotRelocation) {
1278
+ if (BUILD16.slotRelocation) {
1076
1279
  insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
1077
1280
  } else {
1078
1281
  insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
@@ -1089,16 +1292,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1089
1292
  newStartIdx,
1090
1293
  newEndIdx
1091
1294
  );
1092
- } else if (BUILD11.updatable && newStartIdx > newEndIdx) {
1295
+ } else if (BUILD16.updatable && newStartIdx > newEndIdx) {
1093
1296
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1094
1297
  }
1095
1298
  };
1096
1299
  var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1097
1300
  if (leftVNode.$tag$ === rightVNode.$tag$) {
1098
- if (BUILD11.slotRelocation && leftVNode.$tag$ === "slot") {
1301
+ if (BUILD16.slotRelocation && leftVNode.$tag$ === "slot") {
1099
1302
  return leftVNode.$name$ === rightVNode.$name$;
1100
1303
  }
1101
- if (BUILD11.vdomKey && !isInitialRender) {
1304
+ if (BUILD16.vdomKey && !isInitialRender) {
1102
1305
  return leftVNode.$key$ === rightVNode.$key$;
1103
1306
  }
1104
1307
  return true;
@@ -1116,13 +1319,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1116
1319
  const tag = newVNode2.$tag$;
1117
1320
  const text = newVNode2.$text$;
1118
1321
  let defaultHolder;
1119
- if (!BUILD11.vdomText || text === null) {
1120
- if (BUILD11.svg) {
1322
+ if (!BUILD16.vdomText || text === null) {
1323
+ if (BUILD16.svg) {
1121
1324
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
1122
1325
  }
1123
- if (BUILD11.vdomAttribute || BUILD11.reflect) {
1124
- if (BUILD11.slot && tag === "slot" && !useNativeShadowDom) {
1125
- if (BUILD11.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
1326
+ if (BUILD16.vdomAttribute || BUILD16.reflect) {
1327
+ if (BUILD16.slot && tag === "slot" && !useNativeShadowDom) {
1328
+ if (BUILD16.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
1126
1329
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
1127
1330
  relocateToHostRoot(newVNode2.$elm$.parentElement);
1128
1331
  }
@@ -1130,22 +1333,22 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1130
1333
  updateElement(oldVNode, newVNode2, isSvgMode);
1131
1334
  }
1132
1335
  }
1133
- if (BUILD11.updatable && oldChildren !== null && newChildren !== null) {
1336
+ if (BUILD16.updatable && oldChildren !== null && newChildren !== null) {
1134
1337
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
1135
1338
  } else if (newChildren !== null) {
1136
- if (BUILD11.updatable && BUILD11.vdomText && oldVNode.$text$ !== null) {
1339
+ if (BUILD16.updatable && BUILD16.vdomText && oldVNode.$text$ !== null) {
1137
1340
  elm.textContent = "";
1138
1341
  }
1139
1342
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
1140
- } else if (BUILD11.updatable && oldChildren !== null) {
1343
+ } else if (BUILD16.updatable && oldChildren !== null) {
1141
1344
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
1142
1345
  }
1143
- if (BUILD11.svg && isSvgMode && tag === "svg") {
1346
+ if (BUILD16.svg && isSvgMode && tag === "svg") {
1144
1347
  isSvgMode = false;
1145
1348
  }
1146
- } else if (BUILD11.vdomText && BUILD11.slotRelocation && (defaultHolder = elm["s-cr"])) {
1349
+ } else if (BUILD16.vdomText && BUILD16.slotRelocation && (defaultHolder = elm["s-cr"])) {
1147
1350
  defaultHolder.parentNode.textContent = text;
1148
- } else if (BUILD11.vdomText && oldVNode.$text$ !== text) {
1351
+ } else if (BUILD16.vdomText && oldVNode.$text$ !== text) {
1149
1352
  elm.data = text;
1150
1353
  }
1151
1354
  };
@@ -1187,7 +1390,7 @@ var markSlotContentForRelocation = (elm) => {
1187
1390
  const slotName = childNode["s-sn"];
1188
1391
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
1189
1392
  node = hostContentNodes[j];
1190
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD11.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
1393
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD16.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
1191
1394
  if (isNodeLocatedInSlot(node, slotName)) {
1192
1395
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1193
1396
  checkSlotFallbackVisibility = true;
@@ -1241,14 +1444,14 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1241
1444
  return slotName === "";
1242
1445
  };
1243
1446
  var nullifyVNodeRefs = (vNode) => {
1244
- if (BUILD11.vdomRef) {
1447
+ if (BUILD16.vdomRef) {
1245
1448
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1246
1449
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1247
1450
  }
1248
1451
  };
1249
1452
  var insertBefore = (parent, newNode, reference) => {
1250
1453
  const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
1251
- if (BUILD11.scoped) {
1454
+ if (BUILD16.scoped) {
1252
1455
  updateElementScopeIds(newNode, parent);
1253
1456
  }
1254
1457
  return inserted;
@@ -1286,7 +1489,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1286
1489
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1287
1490
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1288
1491
  hostTagName = hostElm.tagName;
1289
- if (BUILD11.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1492
+ if (BUILD16.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1290
1493
  throw new Error(`The <Host> must be the single root component.
1291
1494
  Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
1292
1495
 
@@ -1300,7 +1503,7 @@ render() {
1300
1503
  }
1301
1504
  `);
1302
1505
  }
1303
- if (BUILD11.reflect && cmpMeta.$attrsToReflect$) {
1506
+ if (BUILD16.reflect && cmpMeta.$attrsToReflect$) {
1304
1507
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1305
1508
  cmpMeta.$attrsToReflect$.map(
1306
1509
  ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
@@ -1316,24 +1519,24 @@ render() {
1316
1519
  rootVnode.$tag$ = null;
1317
1520
  rootVnode.$flags$ |= 4 /* isHost */;
1318
1521
  hostRef.$vnode$ = rootVnode;
1319
- rootVnode.$elm$ = oldVNode.$elm$ = BUILD11.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
1320
- if (BUILD11.scoped || BUILD11.shadowDom) {
1522
+ rootVnode.$elm$ = oldVNode.$elm$ = BUILD16.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
1523
+ if (BUILD16.scoped || BUILD16.shadowDom) {
1321
1524
  scopeId = hostElm["s-sc"];
1322
1525
  }
1323
1526
  useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1324
- if (BUILD11.slotRelocation) {
1527
+ if (BUILD16.slotRelocation) {
1325
1528
  contentRef = hostElm["s-cr"];
1326
1529
  checkSlotFallbackVisibility = false;
1327
1530
  }
1328
1531
  patch(oldVNode, rootVnode, isInitialLoad);
1329
- if (BUILD11.slotRelocation) {
1532
+ if (BUILD16.slotRelocation) {
1330
1533
  plt.$flags$ |= 1 /* isTmpDisconnected */;
1331
1534
  if (checkSlotRelocate) {
1332
1535
  markSlotContentForRelocation(rootVnode.$elm$);
1333
1536
  for (const relocateData of relocateNodes) {
1334
1537
  const nodeToRelocate = relocateData.$nodeToRelocate$;
1335
1538
  if (!nodeToRelocate["s-ol"]) {
1336
- const orgLocationNode = BUILD11.isDebug || BUILD11.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
1539
+ const orgLocationNode = BUILD16.isDebug || BUILD16.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
1337
1540
  orgLocationNode["s-nr"] = nodeToRelocate;
1338
1541
  insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
1339
1542
  }
@@ -1344,7 +1547,7 @@ render() {
1344
1547
  if (slotRefNode) {
1345
1548
  const parentNodeRef = slotRefNode.parentNode;
1346
1549
  let insertBeforeNode = slotRefNode.nextSibling;
1347
- if (!BUILD11.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1550
+ if (!BUILD16.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1348
1551
  let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
1349
1552
  while (orgLocationNode) {
1350
1553
  let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
@@ -1363,7 +1566,7 @@ render() {
1363
1566
  }
1364
1567
  if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
1365
1568
  if (nodeToRelocate !== insertBeforeNode) {
1366
- if (!BUILD11.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1569
+ if (!BUILD16.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1367
1570
  nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
1368
1571
  }
1369
1572
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
@@ -1389,7 +1592,7 @@ render() {
1389
1592
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
1390
1593
  relocateNodes.length = 0;
1391
1594
  }
1392
- if (BUILD11.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1595
+ if (BUILD16.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1393
1596
  for (const childNode of rootVnode.$elm$.childNodes) {
1394
1597
  if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
1395
1598
  if (isInitialLoad && childNode["s-ih"] == null) {
@@ -1410,26 +1613,26 @@ var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
1410
1613
 
1411
1614
  // src/runtime/update-component.ts
1412
1615
  var attachToAncestor = (hostRef, ancestorComponent) => {
1413
- if (BUILD12.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1616
+ if (BUILD17.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1414
1617
  ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
1415
1618
  }
1416
1619
  };
1417
1620
  var scheduleUpdate = (hostRef, isInitialLoad) => {
1418
- if (BUILD12.taskQueue && BUILD12.updatable) {
1621
+ if (BUILD17.taskQueue && BUILD17.updatable) {
1419
1622
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1420
1623
  }
1421
- if (BUILD12.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1624
+ if (BUILD17.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1422
1625
  hostRef.$flags$ |= 512 /* needsRerender */;
1423
1626
  return;
1424
1627
  }
1425
1628
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1426
1629
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1427
- return BUILD12.taskQueue ? writeTask(dispatch) : dispatch();
1630
+ return BUILD17.taskQueue ? writeTask(dispatch) : dispatch();
1428
1631
  };
1429
1632
  var dispatchHooks = (hostRef, isInitialLoad) => {
1430
1633
  const elm = hostRef.$hostElement$;
1431
1634
  const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
1432
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
1635
+ const instance = BUILD17.lazyLoad ? hostRef.$lazyInstance$ : elm;
1433
1636
  if (!instance) {
1434
1637
  throw new Error(
1435
1638
  `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Rindo runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://rindojs.web.app/docs/custom-elements#externalruntime`
@@ -1437,7 +1640,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1437
1640
  }
1438
1641
  let maybePromise;
1439
1642
  if (isInitialLoad) {
1440
- if (BUILD12.lazyLoad && BUILD12.hostListener) {
1643
+ if (BUILD17.lazyLoad && BUILD17.hostListener) {
1441
1644
  hostRef.$flags$ |= 256 /* isListenReady */;
1442
1645
  if (hostRef.$queuedListeners$) {
1443
1646
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
@@ -1445,17 +1648,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1445
1648
  }
1446
1649
  }
1447
1650
  emitLifecycleEvent(elm, "componentWillLoad");
1448
- if (BUILD12.cmpWillLoad) {
1651
+ if (BUILD17.cmpWillLoad) {
1449
1652
  maybePromise = safeCall(instance, "componentWillLoad");
1450
1653
  }
1451
1654
  } else {
1452
1655
  emitLifecycleEvent(elm, "componentWillUpdate");
1453
- if (BUILD12.cmpWillUpdate) {
1656
+ if (BUILD17.cmpWillUpdate) {
1454
1657
  maybePromise = safeCall(instance, "componentWillUpdate");
1455
1658
  }
1456
1659
  }
1457
1660
  emitLifecycleEvent(elm, "componentWillRender");
1458
- if (BUILD12.cmpWillRender) {
1661
+ if (BUILD17.cmpWillRender) {
1459
1662
  maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
1460
1663
  }
1461
1664
  endSchedule();
@@ -1471,23 +1674,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1471
1674
  const elm = hostRef.$hostElement$;
1472
1675
  const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
1473
1676
  const rc = elm["s-rc"];
1474
- if (BUILD12.style && isInitialLoad) {
1677
+ if (BUILD17.style && isInitialLoad) {
1475
1678
  attachStyles(hostRef);
1476
1679
  }
1477
1680
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1478
- if (BUILD12.isDev) {
1681
+ if (BUILD17.isDev) {
1479
1682
  hostRef.$flags$ |= 1024 /* devOnRender */;
1480
1683
  }
1481
- if (BUILD12.hydrateServerSide) {
1684
+ if (BUILD17.hydrateServerSide) {
1482
1685
  await callRender(hostRef, instance, elm, isInitialLoad);
1483
1686
  } else {
1484
1687
  callRender(hostRef, instance, elm, isInitialLoad);
1485
1688
  }
1486
- if (BUILD12.isDev) {
1689
+ if (BUILD17.isDev) {
1487
1690
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
1488
1691
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1489
1692
  }
1490
- if (BUILD12.hydrateServerSide) {
1693
+ if (BUILD17.hydrateServerSide) {
1491
1694
  try {
1492
1695
  serverSideConnected(elm);
1493
1696
  if (isInitialLoad) {
@@ -1501,13 +1704,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1501
1704
  consoleError(e, elm);
1502
1705
  }
1503
1706
  }
1504
- if (BUILD12.asyncLoading && rc) {
1707
+ if (BUILD17.asyncLoading && rc) {
1505
1708
  rc.map((cb) => cb());
1506
1709
  elm["s-rc"] = void 0;
1507
1710
  }
1508
1711
  endRender();
1509
1712
  endUpdate();
1510
- if (BUILD12.asyncLoading) {
1713
+ if (BUILD17.asyncLoading) {
1511
1714
  const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
1512
1715
  const postUpdate = () => postUpdateComponent(hostRef);
1513
1716
  if (childrenPromises.length === 0) {
@@ -1523,10 +1726,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1523
1726
  };
1524
1727
  var renderingRef = null;
1525
1728
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
1526
- const allRenderFn = BUILD12.allRenderFn ? true : false;
1527
- const lazyLoad = BUILD12.lazyLoad ? true : false;
1528
- const taskQueue = BUILD12.taskQueue ? true : false;
1529
- const updatable = BUILD12.updatable ? true : false;
1729
+ const allRenderFn = BUILD17.allRenderFn ? true : false;
1730
+ const lazyLoad = BUILD17.lazyLoad ? true : false;
1731
+ const taskQueue = BUILD17.taskQueue ? true : false;
1732
+ const updatable = BUILD17.updatable ? true : false;
1530
1733
  try {
1531
1734
  renderingRef = instance;
1532
1735
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
@@ -1536,9 +1739,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
1536
1739
  if (updatable || lazyLoad) {
1537
1740
  hostRef.$flags$ |= 2 /* hasRendered */;
1538
1741
  }
1539
- if (BUILD12.hasRenderFn || BUILD12.reflect) {
1540
- if (BUILD12.vdomRender || BUILD12.reflect) {
1541
- if (BUILD12.hydrateServerSide) {
1742
+ if (BUILD17.hasRenderFn || BUILD17.reflect) {
1743
+ if (BUILD17.vdomRender || BUILD17.reflect) {
1744
+ if (BUILD17.hydrateServerSide) {
1542
1745
  return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
1543
1746
  } else {
1544
1747
  renderVdom(hostRef, instance, isInitialLoad);
@@ -1563,57 +1766,57 @@ var postUpdateComponent = (hostRef) => {
1563
1766
  const tagName = hostRef.$cmpMeta$.$tagName$;
1564
1767
  const elm = hostRef.$hostElement$;
1565
1768
  const endPostUpdate = createTime("postUpdate", tagName);
1566
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
1769
+ const instance = BUILD17.lazyLoad ? hostRef.$lazyInstance$ : elm;
1567
1770
  const ancestorComponent = hostRef.$ancestorComponent$;
1568
- if (BUILD12.cmpDidRender) {
1569
- if (BUILD12.isDev) {
1771
+ if (BUILD17.cmpDidRender) {
1772
+ if (BUILD17.isDev) {
1570
1773
  hostRef.$flags$ |= 1024 /* devOnRender */;
1571
1774
  }
1572
1775
  safeCall(instance, "componentDidRender");
1573
- if (BUILD12.isDev) {
1776
+ if (BUILD17.isDev) {
1574
1777
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1575
1778
  }
1576
1779
  }
1577
1780
  emitLifecycleEvent(elm, "componentDidRender");
1578
1781
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1579
1782
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1580
- if (BUILD12.asyncLoading && BUILD12.cssAnnotations) {
1783
+ if (BUILD17.asyncLoading && BUILD17.cssAnnotations) {
1581
1784
  addHydratedFlag(elm);
1582
1785
  }
1583
- if (BUILD12.cmpDidLoad) {
1584
- if (BUILD12.isDev) {
1786
+ if (BUILD17.cmpDidLoad) {
1787
+ if (BUILD17.isDev) {
1585
1788
  hostRef.$flags$ |= 2048 /* devOnDidLoad */;
1586
1789
  }
1587
1790
  safeCall(instance, "componentDidLoad");
1588
- if (BUILD12.isDev) {
1791
+ if (BUILD17.isDev) {
1589
1792
  hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
1590
1793
  }
1591
1794
  }
1592
1795
  emitLifecycleEvent(elm, "componentDidLoad");
1593
1796
  endPostUpdate();
1594
- if (BUILD12.asyncLoading) {
1797
+ if (BUILD17.asyncLoading) {
1595
1798
  hostRef.$onReadyResolve$(elm);
1596
1799
  if (!ancestorComponent) {
1597
1800
  appDidLoad(tagName);
1598
1801
  }
1599
1802
  }
1600
1803
  } else {
1601
- if (BUILD12.cmpDidUpdate) {
1602
- if (BUILD12.isDev) {
1804
+ if (BUILD17.cmpDidUpdate) {
1805
+ if (BUILD17.isDev) {
1603
1806
  hostRef.$flags$ |= 1024 /* devOnRender */;
1604
1807
  }
1605
1808
  safeCall(instance, "componentDidUpdate");
1606
- if (BUILD12.isDev) {
1809
+ if (BUILD17.isDev) {
1607
1810
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1608
1811
  }
1609
1812
  }
1610
1813
  emitLifecycleEvent(elm, "componentDidUpdate");
1611
1814
  endPostUpdate();
1612
1815
  }
1613
- if (BUILD12.method && BUILD12.lazyLoad) {
1816
+ if (BUILD17.method && BUILD17.lazyLoad) {
1614
1817
  hostRef.$onInstanceResolve$(elm);
1615
1818
  }
1616
- if (BUILD12.asyncLoading) {
1819
+ if (BUILD17.asyncLoading) {
1617
1820
  if (hostRef.$onRenderResolve$) {
1618
1821
  hostRef.$onRenderResolve$();
1619
1822
  hostRef.$onRenderResolve$ = void 0;
@@ -1625,7 +1828,7 @@ var postUpdateComponent = (hostRef) => {
1625
1828
  }
1626
1829
  };
1627
1830
  var forceUpdate = (ref) => {
1628
- if (BUILD12.updatable && (Build.isBrowser || Build.isTesting)) {
1831
+ if (BUILD17.updatable && (Build.isBrowser || Build.isTesting)) {
1629
1832
  const hostRef = getHostRef(ref);
1630
1833
  const isConnected = hostRef.$hostElement$.isConnected;
1631
1834
  if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
@@ -1636,14 +1839,14 @@ var forceUpdate = (ref) => {
1636
1839
  return false;
1637
1840
  };
1638
1841
  var appDidLoad = (who) => {
1639
- if (BUILD12.cssAnnotations) {
1842
+ if (BUILD17.cssAnnotations) {
1640
1843
  addHydratedFlag(doc.documentElement);
1641
1844
  }
1642
- if (BUILD12.asyncQueue) {
1845
+ if (BUILD17.asyncQueue) {
1643
1846
  plt.$flags$ |= 2 /* appLoaded */;
1644
1847
  }
1645
1848
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1646
- if (BUILD12.profile && performance.measure) {
1849
+ if (BUILD17.profile && performance.measure) {
1647
1850
  performance.measure(`[Rindo] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
1648
1851
  }
1649
1852
  };
@@ -1658,7 +1861,7 @@ var safeCall = (instance, method, arg) => {
1658
1861
  return void 0;
1659
1862
  };
1660
1863
  var emitLifecycleEvent = (elm, lifecycleName) => {
1661
- if (BUILD12.lifecycleDOMEvents) {
1864
+ if (BUILD17.lifecycleDOMEvents) {
1662
1865
  emitEvent(elm, "rindo_" + lifecycleName, {
1663
1866
  bubbles: true,
1664
1867
  composed: true,
@@ -1670,7 +1873,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
1670
1873
  };
1671
1874
  var addHydratedFlag = (elm) => {
1672
1875
  var _a, _b;
1673
- return BUILD12.hydratedClass ? elm.classList.add((_a = BUILD12.hydratedSelectorName) != null ? _a : "hydrated") : BUILD12.hydratedAttribute ? elm.setAttribute((_b = BUILD12.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
1876
+ return BUILD17.hydratedClass ? elm.classList.add((_a = BUILD17.hydratedSelectorName) != null ? _a : "hydrated") : BUILD17.hydratedAttribute ? elm.setAttribute((_b = BUILD17.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
1674
1877
  };
1675
1878
  var serverSideConnected = (elm) => {
1676
1879
  const children = elm.children;
@@ -1689,21 +1892,21 @@ var serverSideConnected = (elm) => {
1689
1892
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1690
1893
  var setValue = (ref, propName, newVal, cmpMeta) => {
1691
1894
  const hostRef = getHostRef(ref);
1692
- if (BUILD13.lazyLoad && !hostRef) {
1895
+ if (BUILD18.lazyLoad && !hostRef) {
1693
1896
  throw new Error(
1694
1897
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Rindo runtime. This usually happens when integrating a 3rd party Rindo component with another Rindo component or application.`
1695
1898
  );
1696
1899
  }
1697
- const elm = BUILD13.lazyLoad ? hostRef.$hostElement$ : ref;
1900
+ const elm = BUILD18.lazyLoad ? hostRef.$hostElement$ : ref;
1698
1901
  const oldVal = hostRef.$instanceValues$.get(propName);
1699
1902
  const flags = hostRef.$flags$;
1700
- const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
1903
+ const instance = BUILD18.lazyLoad ? hostRef.$lazyInstance$ : elm;
1701
1904
  newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1702
1905
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1703
1906
  const didValueChange = newVal !== oldVal && !areBothNaN;
1704
- if ((!BUILD13.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1907
+ if ((!BUILD18.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1705
1908
  hostRef.$instanceValues$.set(propName, newVal);
1706
- if (BUILD13.isDev) {
1909
+ if (BUILD18.isDev) {
1707
1910
  if (hostRef.$flags$ & 1024 /* devOnRender */) {
1708
1911
  consoleDevWarn(
1709
1912
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
@@ -1726,8 +1929,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1726
1929
  );
1727
1930
  }
1728
1931
  }
1729
- if (!BUILD13.lazyLoad || instance) {
1730
- if (BUILD13.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1932
+ if (!BUILD18.lazyLoad || instance) {
1933
+ if (BUILD18.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1731
1934
  const watchMethods = cmpMeta.$watchers$[propName];
1732
1935
  if (watchMethods) {
1733
1936
  watchMethods.map((watchMethodName) => {
@@ -1739,8 +1942,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1739
1942
  });
1740
1943
  }
1741
1944
  }
1742
- if (BUILD13.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1743
- if (BUILD13.cmpShouldUpdate && instance.componentShouldUpdate) {
1945
+ if (BUILD18.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1946
+ if (BUILD18.cmpShouldUpdate && instance.componentShouldUpdate) {
1744
1947
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1745
1948
  return;
1746
1949
  }
@@ -1753,15 +1956,15 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1753
1956
 
1754
1957
  // src/runtime/proxy-component.ts
1755
1958
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1756
- var _a;
1959
+ var _a, _b;
1757
1960
  const prototype = Cstr.prototype;
1758
- if (BUILD14.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1961
+ if (BUILD19.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1759
1962
  FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach(
1760
1963
  (cbName) => Object.defineProperty(prototype, cbName, {
1761
1964
  value(...args) {
1762
1965
  const hostRef = getHostRef(this);
1763
- const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : this;
1764
- const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
1966
+ const elm = BUILD19.lazyLoad ? hostRef.$hostElement$ : this;
1967
+ const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
1765
1968
  if (!instance) {
1766
1969
  hostRef.$onReadyPromise$.then((instance2) => {
1767
1970
  const cb = instance2[cbName];
@@ -1775,19 +1978,19 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1775
1978
  })
1776
1979
  );
1777
1980
  }
1778
- if (BUILD14.member && cmpMeta.$members$) {
1779
- if (BUILD14.watchCallback && Cstr.watchers) {
1981
+ if (BUILD19.member && cmpMeta.$members$ || BUILD19.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
1982
+ if (BUILD19.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
1780
1983
  cmpMeta.$watchers$ = Cstr.watchers;
1781
1984
  }
1782
- const members = Object.entries(cmpMeta.$members$);
1985
+ const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1783
1986
  members.map(([memberName, [memberFlags]]) => {
1784
- if ((BUILD14.prop || BUILD14.state) && (memberFlags & 31 /* Prop */ || (!BUILD14.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1987
+ if ((BUILD19.prop || BUILD19.state) && (memberFlags & 31 /* Prop */ || (!BUILD19.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1785
1988
  Object.defineProperty(prototype, memberName, {
1786
1989
  get() {
1787
1990
  return getValue(this, memberName);
1788
1991
  },
1789
1992
  set(newValue) {
1790
- if (BUILD14.isDev) {
1993
+ if (BUILD19.isDev) {
1791
1994
  const ref = getHostRef(this);
1792
1995
  if (
1793
1996
  // we are proxying the instance (not element)
@@ -1807,7 +2010,7 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
1807
2010
  configurable: true,
1808
2011
  enumerable: true
1809
2012
  });
1810
- } else if (BUILD14.lazyLoad && BUILD14.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2013
+ } else if (BUILD19.lazyLoad && BUILD19.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
1811
2014
  Object.defineProperty(prototype, memberName, {
1812
2015
  value(...args) {
1813
2016
  var _a2;
@@ -1820,7 +2023,7 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
1820
2023
  });
1821
2024
  }
1822
2025
  });
1823
- if (BUILD14.observeAttribute && (!BUILD14.lazyLoad || flags & 1 /* isElementConstructor */)) {
2026
+ if (BUILD19.observeAttribute && (!BUILD19.lazyLoad || flags & 1 /* isElementConstructor */)) {
1824
2027
  const attrNameToPropName = /* @__PURE__ */ new Map();
1825
2028
  prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
1826
2029
  plt.jmp(() => {
@@ -1835,8 +2038,8 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
1835
2038
  const hostRef = getHostRef(this);
1836
2039
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
1837
2040
  if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
1838
- const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : this;
1839
- const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
2041
+ const elm = BUILD19.lazyLoad ? hostRef.$hostElement$ : this;
2042
+ const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
1840
2043
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
1841
2044
  entry == null ? void 0 : entry.forEach((callbackName) => {
1842
2045
  if (instance[callbackName] != null) {
@@ -1851,12 +2054,12 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
1851
2054
  };
1852
2055
  Cstr.observedAttributes = Array.from(
1853
2056
  /* @__PURE__ */ new Set([
1854
- ...Object.keys((_a = cmpMeta.$watchers$) != null ? _a : {}),
2057
+ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
1855
2058
  ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
1856
2059
  var _a2;
1857
2060
  const attrName = m[1] || propName;
1858
2061
  attrNameToPropName.set(attrName, propName);
1859
- if (BUILD14.reflect && m[0] & 512 /* ReflectAttr */) {
2062
+ if (BUILD19.reflect && m[0] & 512 /* ReflectAttr */) {
1860
2063
  (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
1861
2064
  }
1862
2065
  return attrName;
@@ -1874,7 +2077,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1874
2077
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1875
2078
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1876
2079
  const bundleId = cmpMeta.$lazyBundleId$;
1877
- if ((BUILD15.lazyLoad || BUILD15.hydrateClientSide) && bundleId) {
2080
+ if ((BUILD20.lazyLoad || BUILD20.hydrateClientSide) && bundleId) {
1878
2081
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
1879
2082
  if (CstrImport && "then" in CstrImport) {
1880
2083
  const endLoad = uniqueTime(
@@ -1889,15 +2092,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1889
2092
  if (!Cstr) {
1890
2093
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1891
2094
  }
1892
- if (BUILD15.member && !Cstr.isProxied) {
1893
- if (BUILD15.watchCallback) {
2095
+ if (BUILD20.member && !Cstr.isProxied) {
2096
+ if (BUILD20.watchCallback) {
1894
2097
  cmpMeta.$watchers$ = Cstr.watchers;
1895
2098
  }
1896
2099
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1897
2100
  Cstr.isProxied = true;
1898
2101
  }
1899
2102
  const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
1900
- if (BUILD15.member) {
2103
+ if (BUILD20.member) {
1901
2104
  hostRef.$flags$ |= 8 /* isConstructingInstance */;
1902
2105
  }
1903
2106
  try {
@@ -1905,10 +2108,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1905
2108
  } catch (e) {
1906
2109
  consoleError(e);
1907
2110
  }
1908
- if (BUILD15.member) {
2111
+ if (BUILD20.member) {
1909
2112
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1910
2113
  }
1911
- if (BUILD15.watchCallback) {
2114
+ if (BUILD20.watchCallback) {
1912
2115
  hostRef.$flags$ |= 128 /* isWatchReady */;
1913
2116
  }
1914
2117
  endNewInstance();
@@ -1918,22 +2121,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1918
2121
  const cmpTag = elm.localName;
1919
2122
  customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1920
2123
  }
1921
- if (BUILD15.style && Cstr && Cstr.style) {
1922
- let style = Cstr.style;
1923
- if (BUILD15.mode && typeof style !== "string") {
2124
+ if (BUILD20.style && Cstr && Cstr.style) {
2125
+ let style;
2126
+ if (typeof Cstr.style === "string") {
2127
+ style = Cstr.style;
2128
+ } else if (BUILD20.mode && typeof Cstr.style !== "string") {
1924
2129
  hostRef.$modeName$ = computeMode(elm);
1925
2130
  if (hostRef.$modeName$) {
1926
- style = style[hostRef.$modeName$];
2131
+ style = Cstr.style[hostRef.$modeName$];
1927
2132
  }
1928
- if (BUILD15.hydrateServerSide && hostRef.$modeName$) {
2133
+ if (BUILD20.hydrateServerSide && hostRef.$modeName$) {
1929
2134
  elm.setAttribute("s-mode", hostRef.$modeName$);
1930
2135
  }
1931
2136
  }
1932
2137
  const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
1933
2138
  if (!styles.has(scopeId2)) {
1934
2139
  const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
1935
- if (!BUILD15.hydrateServerSide && BUILD15.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
1936
- BUILD15.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2140
+ if (!BUILD20.hydrateServerSide && BUILD20.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2141
+ BUILD20.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
1937
2142
  style = await import("./shadow-css.js").then((m) => m.scopeCss(style, scopeId2, false));
1938
2143
  }
1939
2144
  registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
@@ -1943,14 +2148,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1943
2148
  }
1944
2149
  const ancestorComponent = hostRef.$ancestorComponent$;
1945
2150
  const schedule = () => scheduleUpdate(hostRef, true);
1946
- if (BUILD15.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2151
+ if (BUILD20.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
1947
2152
  ancestorComponent["s-rc"].push(schedule);
1948
2153
  } else {
1949
2154
  schedule();
1950
2155
  }
1951
2156
  };
1952
2157
  var fireConnectedCallback = (instance) => {
1953
- if (BUILD15.lazyLoad && BUILD15.connectedCallback) {
2158
+ if (BUILD20.lazyLoad && BUILD20.connectedCallback) {
1954
2159
  safeCall(instance, "connectedCallback");
1955
2160
  }
1956
2161
  };
@@ -1961,38 +2166,38 @@ var connectedCallback = (elm) => {
1961
2166
  const hostRef = getHostRef(elm);
1962
2167
  const cmpMeta = hostRef.$cmpMeta$;
1963
2168
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
1964
- if (BUILD16.hostListenerTargetParent) {
2169
+ if (BUILD21.hostListenerTargetParent) {
1965
2170
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
1966
2171
  }
1967
2172
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1968
2173
  hostRef.$flags$ |= 1 /* hasConnected */;
1969
2174
  let hostId;
1970
- if (BUILD16.hydrateClientSide) {
2175
+ if (BUILD21.hydrateClientSide) {
1971
2176
  hostId = elm.getAttribute(HYDRATE_ID);
1972
2177
  if (hostId) {
1973
- if (BUILD16.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1974
- const scopeId2 = BUILD16.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2178
+ if (BUILD21.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2179
+ const scopeId2 = BUILD21.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
1975
2180
  elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
1976
2181
  }
1977
2182
  initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
1978
2183
  }
1979
2184
  }
1980
- if (BUILD16.slotRelocation && !hostId) {
1981
- if (BUILD16.hydrateServerSide || (BUILD16.slot || BUILD16.shadowDom) && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2185
+ if (BUILD21.slotRelocation && !hostId) {
2186
+ if (BUILD21.hydrateServerSide || (BUILD21.slot || BUILD21.shadowDom) && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
1982
2187
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
1983
2188
  setContentReference(elm);
1984
2189
  }
1985
2190
  }
1986
- if (BUILD16.asyncLoading) {
2191
+ if (BUILD21.asyncLoading) {
1987
2192
  let ancestorComponent = elm;
1988
2193
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1989
- if (BUILD16.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2194
+ if (BUILD21.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
1990
2195
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1991
2196
  break;
1992
2197
  }
1993
2198
  }
1994
2199
  }
1995
- if (BUILD16.prop && !BUILD16.hydrateServerSide && cmpMeta.$members$) {
2200
+ if (BUILD21.prop && !BUILD21.hydrateServerSide && cmpMeta.$members$) {
1996
2201
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1997
2202
  if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1998
2203
  const value = elm[memberName];
@@ -2001,7 +2206,7 @@ var connectedCallback = (elm) => {
2001
2206
  }
2002
2207
  });
2003
2208
  }
2004
- if (BUILD16.initializeNextTick) {
2209
+ if (BUILD21.initializeNextTick) {
2005
2210
  nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2006
2211
  } else {
2007
2212
  initializeComponent(elm, hostRef, cmpMeta);
@@ -2019,32 +2224,32 @@ var connectedCallback = (elm) => {
2019
2224
  };
2020
2225
  var setContentReference = (elm) => {
2021
2226
  const contentRefElm = elm["s-cr"] = doc.createComment(
2022
- BUILD16.isDebug ? `content-ref (host=${elm.localName})` : ""
2227
+ BUILD21.isDebug ? `content-ref (host=${elm.localName})` : ""
2023
2228
  );
2024
2229
  contentRefElm["s-cn"] = true;
2025
2230
  insertBefore(elm, contentRefElm, elm.firstChild);
2026
2231
  };
2027
2232
 
2028
2233
  // src/runtime/disconnected-callback.ts
2029
- import { BUILD as BUILD17 } from "@rindo/core/internal/app-data";
2234
+ import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
2030
2235
  var disconnectInstance = (instance) => {
2031
- if (BUILD17.lazyLoad && BUILD17.disconnectedCallback) {
2236
+ if (BUILD22.lazyLoad && BUILD22.disconnectedCallback) {
2032
2237
  safeCall(instance, "disconnectedCallback");
2033
2238
  }
2034
- if (BUILD17.cmpDidUnload) {
2239
+ if (BUILD22.cmpDidUnload) {
2035
2240
  safeCall(instance, "componentDidUnload");
2036
2241
  }
2037
2242
  };
2038
2243
  var disconnectedCallback = async (elm) => {
2039
2244
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2040
2245
  const hostRef = getHostRef(elm);
2041
- if (BUILD17.hostListener) {
2246
+ if (BUILD22.hostListener) {
2042
2247
  if (hostRef.$rmListeners$) {
2043
2248
  hostRef.$rmListeners$.map((rmListener) => rmListener());
2044
2249
  hostRef.$rmListeners$ = void 0;
2045
2250
  }
2046
2251
  }
2047
- if (!BUILD17.lazyLoad) {
2252
+ if (!BUILD22.lazyLoad) {
2048
2253
  disconnectInstance(elm);
2049
2254
  } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2050
2255
  disconnectInstance(hostRef.$lazyInstance$);
@@ -2055,7 +2260,7 @@ var disconnectedCallback = async (elm) => {
2055
2260
  };
2056
2261
 
2057
2262
  // src/runtime/dom-extras.ts
2058
- import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
2263
+ import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
2059
2264
  var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
2060
2265
  patchCloneNode(hostElementPrototype);
2061
2266
  patchSlotAppendChild(hostElementPrototype);
@@ -2072,9 +2277,9 @@ var patchCloneNode = (HostElementPrototype) => {
2072
2277
  const orgCloneNode = HostElementPrototype.cloneNode;
2073
2278
  HostElementPrototype.cloneNode = function(deep) {
2074
2279
  const srcNode = this;
2075
- const isShadowDom = BUILD18.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2280
+ const isShadowDom = BUILD23.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2076
2281
  const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2077
- if (BUILD18.slot && !isShadowDom && deep) {
2282
+ if (BUILD23.slot && !isShadowDom && deep) {
2078
2283
  let i2 = 0;
2079
2284
  let slotted, nonRindoNode;
2080
2285
  const rindoPrivates = [
@@ -2098,7 +2303,7 @@ var patchCloneNode = (HostElementPrototype) => {
2098
2303
  slotted = srcNode.childNodes[i2]["s-nr"];
2099
2304
  nonRindoNode = rindoPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]);
2100
2305
  if (slotted) {
2101
- if (BUILD18.appendChildSlotFix && clonedNode.__appendChild) {
2306
+ if (BUILD23.appendChildSlotFix && clonedNode.__appendChild) {
2102
2307
  clonedNode.__appendChild(slotted.cloneNode(true));
2103
2308
  } else {
2104
2309
  clonedNode.appendChild(slotted.cloneNode(true));
@@ -2224,7 +2429,7 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2224
2429
  var patchTextContent = (hostElementPrototype) => {
2225
2430
  const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
2226
2431
  Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
2227
- if (BUILD18.experimentalScopedSlotChanges) {
2432
+ if (BUILD23.experimentalScopedSlotChanges) {
2228
2433
  Object.defineProperty(hostElementPrototype, "textContent", {
2229
2434
  // To mimic shadow root behavior, we need to return the text content of all
2230
2435
  // nodes in a slot reference node
@@ -2376,36 +2581,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2376
2581
  $flags$: compactMeta[0],
2377
2582
  $tagName$: compactMeta[1]
2378
2583
  };
2379
- if (BUILD19.member) {
2584
+ if (BUILD24.member) {
2380
2585
  cmpMeta.$members$ = compactMeta[2];
2381
2586
  }
2382
- if (BUILD19.hostListener) {
2587
+ if (BUILD24.hostListener) {
2383
2588
  cmpMeta.$listeners$ = compactMeta[3];
2384
2589
  }
2385
- if (BUILD19.watchCallback) {
2590
+ if (BUILD24.watchCallback) {
2386
2591
  cmpMeta.$watchers$ = Cstr.$watchers$;
2387
2592
  }
2388
- if (BUILD19.reflect) {
2593
+ if (BUILD24.reflect) {
2389
2594
  cmpMeta.$attrsToReflect$ = [];
2390
2595
  }
2391
- if (BUILD19.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2596
+ if (BUILD24.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2392
2597
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2393
2598
  }
2394
- if (BUILD19.experimentalSlotFixes) {
2395
- if (BUILD19.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2599
+ if (BUILD24.experimentalSlotFixes) {
2600
+ if (BUILD24.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2396
2601
  patchPseudoShadowDom(Cstr.prototype, cmpMeta);
2397
2602
  }
2398
2603
  } else {
2399
- if (BUILD19.slotChildNodesFix) {
2604
+ if (BUILD24.slotChildNodesFix) {
2400
2605
  patchChildSlotNodes(Cstr.prototype, cmpMeta);
2401
2606
  }
2402
- if (BUILD19.cloneNodeFix) {
2607
+ if (BUILD24.cloneNodeFix) {
2403
2608
  patchCloneNode(Cstr.prototype);
2404
2609
  }
2405
- if (BUILD19.appendChildSlotFix) {
2610
+ if (BUILD24.appendChildSlotFix) {
2406
2611
  patchSlotAppendChild(Cstr.prototype);
2407
2612
  }
2408
- if (BUILD19.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2613
+ if (BUILD24.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2409
2614
  patchTextContent(Cstr.prototype);
2410
2615
  }
2411
2616
  }
@@ -2416,26 +2621,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2416
2621
  registerHost(this, cmpMeta);
2417
2622
  },
2418
2623
  connectedCallback() {
2624
+ const hostRef = getHostRef(this);
2625
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
2419
2626
  connectedCallback(this);
2420
- if (BUILD19.connectedCallback && originalConnectedCallback) {
2627
+ if (BUILD24.connectedCallback && originalConnectedCallback) {
2421
2628
  originalConnectedCallback.call(this);
2422
2629
  }
2423
2630
  },
2424
2631
  disconnectedCallback() {
2425
2632
  disconnectedCallback(this);
2426
- if (BUILD19.disconnectedCallback && originalDisconnectedCallback) {
2633
+ if (BUILD24.disconnectedCallback && originalDisconnectedCallback) {
2427
2634
  originalDisconnectedCallback.call(this);
2428
2635
  }
2429
2636
  },
2430
2637
  __attachShadow() {
2431
2638
  if (supportsShadow) {
2432
- if (BUILD19.shadowDelegatesFocus) {
2433
- this.attachShadow({
2434
- mode: "open",
2435
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2436
- });
2639
+ if (!this.shadowRoot) {
2640
+ if (BUILD24.shadowDelegatesFocus) {
2641
+ this.attachShadow({
2642
+ mode: "open",
2643
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2644
+ });
2645
+ } else {
2646
+ this.attachShadow({ mode: "open" });
2647
+ }
2437
2648
  } else {
2438
- this.attachShadow({ mode: "open" });
2649
+ if (this.shadowRoot.mode !== "open") {
2650
+ throw new Error(
2651
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Rindo only supports open shadow roots.`
2652
+ );
2653
+ }
2439
2654
  }
2440
2655
  } else {
2441
2656
  this.shadowRoot = this;
@@ -2446,7 +2661,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2446
2661
  return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
2447
2662
  };
2448
2663
  var forceModeUpdate = (elm) => {
2449
- if (BUILD19.style && BUILD19.mode && !BUILD19.lazyLoad) {
2664
+ if (BUILD24.style && BUILD24.mode && !BUILD24.lazyLoad) {
2450
2665
  const mode = computeMode(elm);
2451
2666
  const hostRef = getHostRef(elm);
2452
2667
  if (hostRef.$modeName$ !== mode) {
@@ -2469,7 +2684,7 @@ var forceModeUpdate = (elm) => {
2469
2684
  };
2470
2685
 
2471
2686
  // src/runtime/bootstrap-lazy.ts
2472
- import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
2687
+ import { BUILD as BUILD25 } from "@rindo/core/internal/app-data";
2473
2688
 
2474
2689
  // src/runtime/hmr-component.ts
2475
2690
  var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
@@ -2481,7 +2696,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
2481
2696
  // src/runtime/bootstrap-lazy.ts
2482
2697
  var bootstrapLazy = (lazyBundles, options = {}) => {
2483
2698
  var _a;
2484
- if (BUILD20.profile && performance.mark) {
2699
+ if (BUILD25.profile && performance.mark) {
2485
2700
  performance.mark("st:app:start");
2486
2701
  }
2487
2702
  installDevTools();
@@ -2499,15 +2714,15 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2499
2714
  let i2 = 0;
2500
2715
  Object.assign(plt, options);
2501
2716
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
2502
- if (BUILD20.asyncQueue) {
2717
+ if (BUILD25.asyncQueue) {
2503
2718
  if (options.syncQueue) {
2504
2719
  plt.$flags$ |= 4 /* queueSync */;
2505
2720
  }
2506
2721
  }
2507
- if (BUILD20.hydrateClientSide) {
2722
+ if (BUILD25.hydrateClientSide) {
2508
2723
  plt.$flags$ |= 2 /* appLoaded */;
2509
2724
  }
2510
- if (BUILD20.hydrateClientSide && BUILD20.shadowDom) {
2725
+ if (BUILD25.hydrateClientSide && BUILD25.shadowDom) {
2511
2726
  for (; i2 < styles2.length; i2++) {
2512
2727
  registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2513
2728
  }
@@ -2525,44 +2740,58 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2525
2740
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2526
2741
  hasSlotRelocation = true;
2527
2742
  }
2528
- if (BUILD20.member) {
2743
+ if (BUILD25.member) {
2529
2744
  cmpMeta.$members$ = compactMeta[2];
2530
2745
  }
2531
- if (BUILD20.hostListener) {
2746
+ if (BUILD25.hostListener) {
2532
2747
  cmpMeta.$listeners$ = compactMeta[3];
2533
2748
  }
2534
- if (BUILD20.reflect) {
2749
+ if (BUILD25.reflect) {
2535
2750
  cmpMeta.$attrsToReflect$ = [];
2536
2751
  }
2537
- if (BUILD20.watchCallback) {
2752
+ if (BUILD25.watchCallback) {
2538
2753
  cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
2539
2754
  }
2540
- if (BUILD20.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2755
+ if (BUILD25.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2541
2756
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2542
2757
  }
2543
- const tagName = BUILD20.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2758
+ const tagName = BUILD25.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2544
2759
  const HostElement = class extends HTMLElement {
2545
2760
  // RindoLazyHost
2546
2761
  constructor(self) {
2547
2762
  super(self);
2763
+ this.hasRegisteredEventListeners = false;
2548
2764
  self = this;
2549
2765
  registerHost(self, cmpMeta);
2550
- if (BUILD20.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2766
+ if (BUILD25.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2551
2767
  if (supportsShadow) {
2552
- if (BUILD20.shadowDelegatesFocus) {
2553
- self.attachShadow({
2554
- mode: "open",
2555
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2556
- });
2768
+ if (!self.shadowRoot) {
2769
+ if (BUILD25.shadowDelegatesFocus) {
2770
+ self.attachShadow({
2771
+ mode: "open",
2772
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2773
+ });
2774
+ } else {
2775
+ self.attachShadow({ mode: "open" });
2776
+ }
2557
2777
  } else {
2558
- self.attachShadow({ mode: "open" });
2778
+ if (self.shadowRoot.mode !== "open") {
2779
+ throw new Error(
2780
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Rindo only supports open shadow roots.`
2781
+ );
2782
+ }
2559
2783
  }
2560
- } else if (!BUILD20.hydrateServerSide && !("shadowRoot" in self)) {
2784
+ } else if (!BUILD25.hydrateServerSide && !("shadowRoot" in self)) {
2561
2785
  self.shadowRoot = self;
2562
2786
  }
2563
2787
  }
2564
2788
  }
2565
2789
  connectedCallback() {
2790
+ const hostRef = getHostRef(this);
2791
+ if (!this.hasRegisteredEventListeners) {
2792
+ this.hasRegisteredEventListeners = true;
2793
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
2794
+ }
2566
2795
  if (appLoadFallback) {
2567
2796
  clearTimeout(appLoadFallback);
2568
2797
  appLoadFallback = null;
@@ -2580,28 +2809,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2580
2809
  return getHostRef(this).$onReadyPromise$;
2581
2810
  }
2582
2811
  };
2583
- if (BUILD20.experimentalSlotFixes) {
2584
- if (BUILD20.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2812
+ if (BUILD25.experimentalSlotFixes) {
2813
+ if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2585
2814
  patchPseudoShadowDom(HostElement.prototype, cmpMeta);
2586
2815
  }
2587
2816
  } else {
2588
- if (BUILD20.slotChildNodesFix) {
2817
+ if (BUILD25.slotChildNodesFix) {
2589
2818
  patchChildSlotNodes(HostElement.prototype, cmpMeta);
2590
2819
  }
2591
- if (BUILD20.cloneNodeFix) {
2820
+ if (BUILD25.cloneNodeFix) {
2592
2821
  patchCloneNode(HostElement.prototype);
2593
2822
  }
2594
- if (BUILD20.appendChildSlotFix) {
2823
+ if (BUILD25.appendChildSlotFix) {
2595
2824
  patchSlotAppendChild(HostElement.prototype);
2596
2825
  }
2597
- if (BUILD20.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2826
+ if (BUILD25.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2598
2827
  patchTextContent(HostElement.prototype);
2599
2828
  }
2600
2829
  }
2601
- if (BUILD20.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2830
+ if (BUILD25.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2602
2831
  HostElement.formAssociated = true;
2603
2832
  }
2604
- if (BUILD20.hotModuleReplacement) {
2833
+ if (BUILD25.hotModuleReplacement) {
2605
2834
  HostElement.prototype["s-hmr"] = function(hmrVersionId) {
2606
2835
  hmrStart(this, cmpMeta, hmrVersionId);
2607
2836
  };
@@ -2620,8 +2849,8 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2620
2849
  if (hasSlotRelocation) {
2621
2850
  dataStyles.textContent += SLOT_FB_CSS;
2622
2851
  }
2623
- if (BUILD20.invisiblePrehydration && (BUILD20.hydratedClass || BUILD20.hydratedAttribute)) {
2624
- dataStyles.textContent += cmpTags + HYDRATED_CSS;
2852
+ if (BUILD25.invisiblePrehydration && (BUILD25.hydratedClass || BUILD25.hydratedAttribute)) {
2853
+ dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
2625
2854
  }
2626
2855
  if (dataStyles.innerHTML.length) {
2627
2856
  dataStyles.setAttribute("data-styles", "");
@@ -2636,7 +2865,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2636
2865
  if (deferredConnectedCallbacks.length) {
2637
2866
  deferredConnectedCallbacks.map((host) => host.connectedCallback());
2638
2867
  } else {
2639
- if (BUILD20.profile) {
2868
+ if (BUILD25.profile) {
2640
2869
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
2641
2870
  } else {
2642
2871
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
@@ -2649,10 +2878,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2649
2878
  var Fragment = (_, children) => children;
2650
2879
 
2651
2880
  // src/runtime/host-listener.ts
2652
- import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
2881
+ import { BUILD as BUILD26 } from "@rindo/core/internal/app-data";
2653
2882
  var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2654
- if (BUILD21.hostListener && listeners) {
2655
- if (BUILD21.hostListenerTargetParent) {
2883
+ if (BUILD26.hostListener && listeners) {
2884
+ if (BUILD26.hostListenerTargetParent) {
2656
2885
  if (attachParentListeners) {
2657
2886
  listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
2658
2887
  } else {
@@ -2660,7 +2889,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2660
2889
  }
2661
2890
  }
2662
2891
  listeners.map(([flags, name, method]) => {
2663
- const target = BUILD21.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
2892
+ const target = BUILD26.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
2664
2893
  const handler = hostListenerProxy(hostRef, method);
2665
2894
  const opts = hostListenerOpts(flags);
2666
2895
  plt.ael(target, name, handler, opts);
@@ -2671,7 +2900,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2671
2900
  var hostListenerProxy = (hostRef, methodName) => (ev) => {
2672
2901
  var _a;
2673
2902
  try {
2674
- if (BUILD21.lazyLoad) {
2903
+ if (BUILD26.lazyLoad) {
2675
2904
  if (hostRef.$flags$ & 256 /* isListenReady */) {
2676
2905
  (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2677
2906
  } else {
@@ -2685,10 +2914,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
2685
2914
  }
2686
2915
  };
2687
2916
  var getHostListenerTarget = (elm, flags) => {
2688
- if (BUILD21.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2689
- if (BUILD21.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2690
- if (BUILD21.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2691
- if (BUILD21.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2917
+ if (BUILD26.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2918
+ if (BUILD26.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2919
+ if (BUILD26.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2920
+ if (BUILD26.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2692
2921
  return elm.parentElement;
2693
2922
  return elm;
2694
2923
  };
@@ -2755,6 +2984,7 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
2755
2984
  }
2756
2985
  };
2757
2986
  var parseVNodeAnnotations = (doc2, node, docData, orgLocationNodes) => {
2987
+ var _a;
2758
2988
  if (node == null) {
2759
2989
  return;
2760
2990
  }
@@ -2762,7 +2992,8 @@ var parseVNodeAnnotations = (doc2, node, docData, orgLocationNodes) => {
2762
2992
  orgLocationNodes.push(node);
2763
2993
  }
2764
2994
  if (node.nodeType === 1 /* ElementNode */) {
2765
- node.childNodes.forEach((childNode) => {
2995
+ const childNodes = [...Array.from(node.childNodes), ...Array.from(((_a = node.shadowRoot) == null ? void 0 : _a.childNodes) || [])];
2996
+ childNodes.forEach((childNode) => {
2766
2997
  const hostRef = getHostRef(childNode);
2767
2998
  if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
2768
2999
  const cmpData = {
@@ -2838,213 +3069,6 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
2838
3069
  });
2839
3070
  }
2840
3071
  };
2841
-
2842
- // src/client/client-host-ref.ts
2843
- var hostRefs = BUILD22.hotModuleReplacement ? window.__RINDO_HOSTREFS__ || (window.__RINDO_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
2844
- var getHostRef = (ref) => hostRefs.get(ref);
2845
- var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
2846
- var registerHost = (hostElement, cmpMeta) => {
2847
- const hostRef = {
2848
- $flags$: 0,
2849
- $hostElement$: hostElement,
2850
- $cmpMeta$: cmpMeta,
2851
- $instanceValues$: /* @__PURE__ */ new Map()
2852
- };
2853
- if (BUILD22.isDev) {
2854
- hostRef.$renderCount$ = 0;
2855
- }
2856
- if (BUILD22.method && BUILD22.lazyLoad) {
2857
- hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
2858
- }
2859
- if (BUILD22.asyncLoading) {
2860
- hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
2861
- hostElement["s-p"] = [];
2862
- hostElement["s-rc"] = [];
2863
- }
2864
- addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$, false);
2865
- return hostRefs.set(hostElement, hostRef);
2866
- };
2867
- var isMemberInElement = (elm, memberName) => memberName in elm;
2868
-
2869
- // src/client/client-load-module.ts
2870
- import { BUILD as BUILD24 } from "@rindo/core/internal/app-data";
2871
-
2872
- // src/client/client-log.ts
2873
- import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
2874
- var customError;
2875
- var consoleError = (e, el) => (customError || console.error)(e, el);
2876
- var RINDO_DEV_MODE = BUILD23.isTesting ? ["RINDO:"] : [
2877
- "%crindo",
2878
- "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
2879
- ];
2880
- var consoleDevError = (...m) => console.error(...RINDO_DEV_MODE, ...m);
2881
- var consoleDevWarn = (...m) => console.warn(...RINDO_DEV_MODE, ...m);
2882
- var consoleDevInfo = (...m) => console.info(...RINDO_DEV_MODE, ...m);
2883
- var setErrorHandler = (handler) => customError = handler;
2884
-
2885
- // src/client/client-load-module.ts
2886
- var cmpModules = /* @__PURE__ */ new Map();
2887
- var MODULE_IMPORT_PREFIX = "./";
2888
- var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2889
- const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
2890
- const bundleId = cmpMeta.$lazyBundleId$;
2891
- if (BUILD24.isDev && typeof bundleId !== "string") {
2892
- consoleDevError(
2893
- `Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`
2894
- );
2895
- return void 0;
2896
- } else if (!bundleId) {
2897
- return void 0;
2898
- }
2899
- const module = !BUILD24.hotModuleReplacement ? cmpModules.get(bundleId) : false;
2900
- if (module) {
2901
- return module[exportName];
2902
- }
2903
- /*!__RINDO_STATIC_IMPORT_SWITCH__*/
2904
- return import(
2905
- /* @wite-ignore */
2906
- /* @lahm-ignore */
2907
- /* webpackInclude: /\.entry\.js$/ */
2908
- /* webpackExclude: /\.system\.entry\.js$/ */
2909
- /* webpackMode: "lazy" */
2910
- `./${bundleId}.entry.js${BUILD24.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
2911
- ).then((importedModule) => {
2912
- if (!BUILD24.hotModuleReplacement) {
2913
- cmpModules.set(bundleId, importedModule);
2914
- }
2915
- return importedModule[exportName];
2916
- }, consoleError);
2917
- };
2918
-
2919
- // src/client/client-style.ts
2920
- var styles = /* @__PURE__ */ new Map();
2921
- var modeResolutionChain = [];
2922
-
2923
- // src/client/client-task-queue.ts
2924
- import { BUILD as BUILD26 } from "@rindo/core/internal/app-data";
2925
-
2926
- // src/client/client-window.ts
2927
- import { BUILD as BUILD25 } from "@rindo/core/internal/app-data";
2928
- var win = typeof window !== "undefined" ? window : {};
2929
- var doc = win.document || { head: {} };
2930
- var H = win.HTMLElement || class {
2931
- };
2932
- var plt = {
2933
- $flags$: 0,
2934
- $resourcesUrl$: "",
2935
- jmp: (h2) => h2(),
2936
- raf: (h2) => requestAnimationFrame(h2),
2937
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2938
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2939
- ce: (eventName, opts) => new CustomEvent(eventName, opts)
2940
- };
2941
- var setPlatformHelpers = (helpers) => {
2942
- Object.assign(plt, helpers);
2943
- };
2944
- var supportsShadow = (
2945
- // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2946
- BUILD25.shadowDomShim && BUILD25.shadowDom ? /* @__PURE__ */ (() => (doc.head.attachShadow + "").indexOf("[native") > -1)() : true
2947
- );
2948
- var supportsListenerOptions = /* @__PURE__ */ (() => {
2949
- let supportsListenerOptions2 = false;
2950
- try {
2951
- doc.addEventListener(
2952
- "e",
2953
- null,
2954
- Object.defineProperty({}, "passive", {
2955
- get() {
2956
- supportsListenerOptions2 = true;
2957
- }
2958
- })
2959
- );
2960
- } catch (e) {
2961
- }
2962
- return supportsListenerOptions2;
2963
- })();
2964
- var promiseResolve = (v) => Promise.resolve(v);
2965
- var supportsConstructableStylesheets = BUILD25.constructableCSS ? /* @__PURE__ */ (() => {
2966
- try {
2967
- new CSSStyleSheet();
2968
- return typeof new CSSStyleSheet().replaceSync === "function";
2969
- } catch (e) {
2970
- }
2971
- return false;
2972
- })() : false;
2973
-
2974
- // src/client/client-task-queue.ts
2975
- var queueCongestion = 0;
2976
- var queuePending = false;
2977
- var queueDomReads = [];
2978
- var queueDomWrites = [];
2979
- var queueDomWritesLow = [];
2980
- var queueTask = (queue, write) => (cb) => {
2981
- queue.push(cb);
2982
- if (!queuePending) {
2983
- queuePending = true;
2984
- if (write && plt.$flags$ & 4 /* queueSync */) {
2985
- nextTick(flush);
2986
- } else {
2987
- plt.raf(flush);
2988
- }
2989
- }
2990
- };
2991
- var consume = (queue) => {
2992
- for (let i2 = 0; i2 < queue.length; i2++) {
2993
- try {
2994
- queue[i2](performance.now());
2995
- } catch (e) {
2996
- consoleError(e);
2997
- }
2998
- }
2999
- queue.length = 0;
3000
- };
3001
- var consumeTimeout = (queue, timeout) => {
3002
- let i2 = 0;
3003
- let ts = 0;
3004
- while (i2 < queue.length && (ts = performance.now()) < timeout) {
3005
- try {
3006
- queue[i2++](ts);
3007
- } catch (e) {
3008
- consoleError(e);
3009
- }
3010
- }
3011
- if (i2 === queue.length) {
3012
- queue.length = 0;
3013
- } else if (i2 !== 0) {
3014
- queue.splice(0, i2);
3015
- }
3016
- };
3017
- var flush = () => {
3018
- if (BUILD26.asyncQueue) {
3019
- queueCongestion++;
3020
- }
3021
- consume(queueDomReads);
3022
- if (BUILD26.asyncQueue) {
3023
- const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;
3024
- consumeTimeout(queueDomWrites, timeout);
3025
- consumeTimeout(queueDomWritesLow, timeout);
3026
- if (queueDomWrites.length > 0) {
3027
- queueDomWritesLow.push(...queueDomWrites);
3028
- queueDomWrites.length = 0;
3029
- }
3030
- if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
3031
- plt.raf(flush);
3032
- } else {
3033
- queueCongestion = 0;
3034
- }
3035
- } else {
3036
- consume(queueDomWrites);
3037
- if (queuePending = queueDomReads.length > 0) {
3038
- plt.raf(flush);
3039
- }
3040
- }
3041
- };
3042
- var nextTick = (cb) => promiseResolve().then(cb);
3043
- var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
3044
- var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
3045
-
3046
- // src/client/index.ts
3047
- import { BUILD as BUILD27, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
3048
3072
  export {
3049
3073
  BUILD27 as BUILD,
3050
3074
  Build,