@rindo/core 4.23.0 → 4.23.2

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Hydrate Platform v4.23.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Hydrate Platform v4.23.2 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  };
9
9
 
10
10
  // src/hydrate/platform/index.ts
11
- import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
11
+ import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
12
12
 
13
13
  // src/runtime/asset-path.ts
14
14
  var getAssetPath = (path) => {
@@ -18,15 +18,14 @@ var getAssetPath = (path) => {
18
18
  var setAssetPath = (path) => plt.$resourcesUrl$ = path;
19
19
 
20
20
  // src/runtime/bootstrap-custom-element.ts
21
- import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
21
+ import { BUILD as BUILD19 } from "@rindo/core/internal/app-data";
22
22
 
23
23
  // src/utils/constants.ts
24
- var EMPTY_OBJ = {};
25
24
  var SVG_NS = "http://www.w3.org/2000/svg";
26
25
  var HTML_NS = "http://www.w3.org/1999/xhtml";
27
26
 
28
27
  // src/utils/helpers.ts
29
- var isDef = (v) => v != null;
28
+ var isDef = (v) => v != null && v !== void 0;
30
29
  var isComplexType = (o) => {
31
30
  o = typeof o;
32
31
  return o === "object" || o === "function";
@@ -88,13 +87,13 @@ var unwrapErr = (result) => {
88
87
  };
89
88
 
90
89
  // src/runtime/connected-callback.ts
91
- import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
90
+ import { BUILD as BUILD17 } from "@rindo/core/internal/app-data";
92
91
 
93
92
  // src/runtime/client-hydrate.ts
94
- import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
93
+ import { BUILD as BUILD8 } from "@rindo/core/internal/app-data";
95
94
 
96
95
  // src/runtime/dom-extras.ts
97
- import { BUILD as BUILD5 } from "@rindo/core/internal/app-data";
96
+ import { BUILD as BUILD6 } from "@rindo/core/internal/app-data";
98
97
 
99
98
  // src/runtime/runtime-constants.ts
100
99
  var CONTENT_REF_ID = "r";
@@ -121,11 +120,114 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
121
120
  "formStateRestoreCallback"
122
121
  ];
123
122
 
123
+ // src/runtime/slot-polyfill-utils.ts
124
+ import { BUILD } from "@rindo/core/internal/app-data";
125
+ var updateFallbackSlotVisibility = (elm) => {
126
+ const childNodes = elm.__childNodes || elm.childNodes;
127
+ if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
128
+ getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
129
+ var _a;
130
+ if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
131
+ if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
132
+ slotNode.hidden = true;
133
+ } else {
134
+ slotNode.hidden = false;
135
+ }
136
+ }
137
+ });
138
+ }
139
+ for (const childNode of childNodes) {
140
+ if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
141
+ updateFallbackSlotVisibility(childNode);
142
+ }
143
+ }
144
+ };
145
+ var getSlottedChildNodes = (childNodes) => {
146
+ const result = [];
147
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
148
+ const slottedNode = childNodes[i2]["s-nr"];
149
+ if (slottedNode && slottedNode.isConnected) {
150
+ result.push(slottedNode);
151
+ }
152
+ }
153
+ return result;
154
+ };
155
+ var getHostSlotNodes = (childNodes, hostName, slotName) => {
156
+ let i2 = 0;
157
+ let slottedNodes = [];
158
+ let childNode;
159
+ for (; i2 < childNodes.length; i2++) {
160
+ childNode = childNodes[i2];
161
+ if (childNode["s-sr"] && childNode["s-hn"] === hostName && (!slotName || childNode["s-sn"] === slotName)) {
162
+ slottedNodes.push(childNode);
163
+ if (typeof slotName !== "undefined") return slottedNodes;
164
+ }
165
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
166
+ }
167
+ return slottedNodes;
168
+ };
169
+ var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
170
+ const childNodes = [];
171
+ if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
172
+ while ((node = node.nextSibling) && node["s-sn"] === slotName) {
173
+ childNodes.push(node);
174
+ }
175
+ return childNodes;
176
+ };
177
+ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
178
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
179
+ if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
180
+ return true;
181
+ }
182
+ if (nodeToRelocate.getAttribute("slot") === slotName) {
183
+ return true;
184
+ }
185
+ return false;
186
+ }
187
+ if (nodeToRelocate["s-sn"] === slotName) {
188
+ return true;
189
+ }
190
+ return slotName === "";
191
+ };
192
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
193
+ let slottedNodeLocation;
194
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
195
+ slottedNodeLocation = newChild["s-ol"];
196
+ } else {
197
+ slottedNodeLocation = document.createTextNode("");
198
+ slottedNodeLocation["s-nr"] = newChild;
199
+ }
200
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
201
+ const parent = slotNode["s-cr"].parentNode;
202
+ const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
203
+ if (typeof position !== "undefined") {
204
+ if (BUILD.hydrateClientSide) {
205
+ slottedNodeLocation["s-oo"] = position;
206
+ const childNodes = parent.__childNodes || parent.childNodes;
207
+ const slotRelocateNodes = [slottedNodeLocation];
208
+ childNodes.forEach((n) => {
209
+ if (n["s-nr"]) slotRelocateNodes.push(n);
210
+ });
211
+ slotRelocateNodes.sort((a, b) => {
212
+ if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
213
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
214
+ return 0;
215
+ });
216
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
217
+ }
218
+ } else {
219
+ appendMethod.call(parent, slottedNodeLocation);
220
+ }
221
+ newChild["s-ol"] = slottedNodeLocation;
222
+ newChild["s-sh"] = slotNode["s-hn"];
223
+ };
224
+ var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
225
+
124
226
  // src/runtime/vdom/vdom-render.ts
125
- import { BUILD as BUILD4 } from "@rindo/core/internal/app-data";
227
+ import { BUILD as BUILD5 } from "@rindo/core/internal/app-data";
126
228
 
127
229
  // src/runtime/vdom/h.ts
128
- import { BUILD } from "@rindo/core/internal/app-data";
230
+ import { BUILD as BUILD2 } from "@rindo/core/internal/app-data";
129
231
  var h = (nodeName, vnodeData, ...children) => {
130
232
  let child = null;
131
233
  let key = null;
@@ -141,7 +243,7 @@ var h = (nodeName, vnodeData, ...children) => {
141
243
  } else if (child != null && typeof child !== "boolean") {
142
244
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
143
245
  child = String(child);
144
- } else if (BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
246
+ } else if (BUILD2.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
145
247
  consoleDevError(`vNode passed as children has unexpected type.
146
248
  Make sure it's using the correct h() function.
147
249
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -157,28 +259,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
157
259
  };
158
260
  walk(children);
159
261
  if (vnodeData) {
160
- if (BUILD.isDev && nodeName === "input") {
262
+ if (BUILD2.isDev && nodeName === "input") {
161
263
  validateInputProperties(vnodeData);
162
264
  }
163
- if (BUILD.vdomKey && vnodeData.key) {
265
+ if (BUILD2.vdomKey && vnodeData.key) {
164
266
  key = vnodeData.key;
165
267
  }
166
- if (BUILD.slotRelocation && vnodeData.name) {
268
+ if (BUILD2.slotRelocation && vnodeData.name) {
167
269
  slotName = vnodeData.name;
168
270
  }
169
- if (BUILD.vdomClass) {
271
+ if (BUILD2.vdomClass) {
170
272
  const classData = vnodeData.className || vnodeData.class;
171
273
  if (classData) {
172
274
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
173
275
  }
174
276
  }
175
277
  }
176
- if (BUILD.isDev && vNodeChildren.some(isHost)) {
278
+ if (BUILD2.isDev && vNodeChildren.some(isHost)) {
177
279
  consoleDevError(`The <Host> must be the single root component. Make sure:
178
280
  - You are NOT using hostData() and <Host> in the same component.
179
281
  - <Host> is used once, and it's the single root component of the render() function.`);
180
282
  }
181
- if (BUILD.vdomFunctional && typeof nodeName === "function") {
283
+ if (BUILD2.vdomFunctional && typeof nodeName === "function") {
182
284
  return nodeName(
183
285
  vnodeData === null ? {} : vnodeData,
184
286
  vNodeChildren,
@@ -190,10 +292,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
190
292
  if (vNodeChildren.length > 0) {
191
293
  vnode.$children$ = vNodeChildren;
192
294
  }
193
- if (BUILD.vdomKey) {
295
+ if (BUILD2.vdomKey) {
194
296
  vnode.$key$ = key;
195
297
  }
196
- if (BUILD.slotRelocation) {
298
+ if (BUILD2.slotRelocation) {
197
299
  vnode.$name$ = slotName;
198
300
  }
199
301
  return vnode;
@@ -206,13 +308,13 @@ var newVNode = (tag, text) => {
206
308
  $elm$: null,
207
309
  $children$: null
208
310
  };
209
- if (BUILD.vdomAttribute) {
311
+ if (BUILD2.vdomAttribute) {
210
312
  vnode.$attrs$ = null;
211
313
  }
212
- if (BUILD.vdomKey) {
314
+ if (BUILD2.vdomKey) {
213
315
  vnode.$key$ = null;
214
316
  }
215
- if (BUILD.slotRelocation) {
317
+ if (BUILD2.slotRelocation) {
216
318
  vnode.$name$ = null;
217
319
  }
218
320
  return vnode;
@@ -265,28 +367,35 @@ var validateInputProperties = (inputElm) => {
265
367
  };
266
368
 
267
369
  // src/runtime/vdom/update-element.ts
268
- import { BUILD as BUILD3 } from "@rindo/core/internal/app-data";
370
+ import { BUILD as BUILD4 } from "@rindo/core/internal/app-data";
269
371
 
270
372
  // src/runtime/vdom/set-accessor.ts
271
- import { BUILD as BUILD2 } from "@rindo/core/internal/app-data";
373
+ import { BUILD as BUILD3 } from "@rindo/core/internal/app-data";
272
374
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
273
375
  if (oldValue !== newValue) {
274
376
  let isProp = isMemberInElement(elm, memberName);
275
377
  let ln = memberName.toLowerCase();
276
- if (BUILD2.vdomClass && memberName === "class") {
378
+ if (BUILD3.vdomClass && memberName === "class") {
277
379
  const classList = elm.classList;
278
380
  const oldClasses = parseClassList(oldValue);
279
- const newClasses = parseClassList(newValue);
280
- if (elm["s-si"] && newClasses.indexOf(elm["s-si"]) < 0) {
381
+ let newClasses = parseClassList(newValue);
382
+ if (elm["s-si"]) {
281
383
  newClasses.push(elm["s-si"]);
384
+ oldClasses.forEach((c) => {
385
+ if (c.startsWith(elm["s-si"])) newClasses.push(c);
386
+ });
387
+ newClasses = [...new Set(newClasses)];
388
+ classList.add(...newClasses);
389
+ delete elm["s-si"];
390
+ } else {
391
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
392
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
282
393
  }
283
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
284
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
285
- } else if (BUILD2.vdomStyle && memberName === "style") {
286
- if (BUILD2.updatable) {
394
+ } else if (BUILD3.vdomStyle && memberName === "style") {
395
+ if (BUILD3.updatable) {
287
396
  for (const prop in oldValue) {
288
397
  if (!newValue || newValue[prop] == null) {
289
- if (!BUILD2.hydrateServerSide && prop.includes("-")) {
398
+ if (!BUILD3.hydrateServerSide && prop.includes("-")) {
290
399
  elm.style.removeProperty(prop);
291
400
  } else {
292
401
  elm.style[prop] = "";
@@ -296,19 +405,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
296
405
  }
297
406
  for (const prop in newValue) {
298
407
  if (!oldValue || newValue[prop] !== oldValue[prop]) {
299
- if (!BUILD2.hydrateServerSide && prop.includes("-")) {
408
+ if (!BUILD3.hydrateServerSide && prop.includes("-")) {
300
409
  elm.style.setProperty(prop, newValue[prop]);
301
410
  } else {
302
411
  elm.style[prop] = newValue[prop];
303
412
  }
304
413
  }
305
414
  }
306
- } else if (BUILD2.vdomKey && memberName === "key") {
307
- } else if (BUILD2.vdomRef && memberName === "ref") {
415
+ } else if (BUILD3.vdomKey && memberName === "key") {
416
+ } else if (BUILD3.vdomRef && memberName === "ref") {
308
417
  if (newValue) {
309
418
  newValue(elm);
310
419
  }
311
- } else if (BUILD2.vdomListener && (BUILD2.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
420
+ } else if (BUILD3.vdomListener && (BUILD3.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
312
421
  if (memberName[2] === "-") {
313
422
  memberName = memberName.slice(3);
314
423
  } else if (isMemberInElement(win, ln)) {
@@ -326,7 +435,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
326
435
  plt.ael(elm, memberName, newValue, capture);
327
436
  }
328
437
  }
329
- } else if (BUILD2.vdomPropOrAttr) {
438
+ } else if (BUILD3.vdomPropOrAttr) {
330
439
  const isComplex = isComplexType(newValue);
331
440
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
332
441
  try {
@@ -348,7 +457,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
348
457
  }
349
458
  }
350
459
  let xlink = false;
351
- if (BUILD2.vdomXlink) {
460
+ if (BUILD3.vdomXlink) {
352
461
  if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
353
462
  memberName = ln;
354
463
  xlink = true;
@@ -356,7 +465,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
356
465
  }
357
466
  if (newValue == null || newValue === false) {
358
467
  if (newValue !== false || elm.getAttribute(memberName) === "") {
359
- if (BUILD2.vdomXlink && xlink) {
468
+ if (BUILD3.vdomXlink && xlink) {
360
469
  elm.removeAttributeNS(XLINK_NS, memberName);
361
470
  } else {
362
471
  elm.removeAttribute(memberName);
@@ -364,7 +473,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
364
473
  }
365
474
  } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
366
475
  newValue = newValue === true ? "" : newValue;
367
- if (BUILD2.vdomXlink && xlink) {
476
+ if (BUILD3.vdomXlink && xlink) {
368
477
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
369
478
  } else {
370
479
  elm.setAttribute(memberName, newValue);
@@ -374,16 +483,24 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
374
483
  }
375
484
  };
376
485
  var parseClassListRegex = /\s/;
377
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
486
+ var parseClassList = (value) => {
487
+ if (typeof value === "object" && "baseVal" in value) {
488
+ value = value.baseVal;
489
+ }
490
+ if (!value) {
491
+ return [];
492
+ }
493
+ return value.split(parseClassListRegex);
494
+ };
378
495
  var CAPTURE_EVENT_SUFFIX = "Capture";
379
496
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
380
497
 
381
498
  // src/runtime/vdom/update-element.ts
382
499
  var updateElement = (oldVnode, newVnode, isSvgMode2) => {
383
500
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
384
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
385
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
386
- if (BUILD3.updatable) {
501
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
502
+ const newVnodeAttrs = newVnode.$attrs$ || {};
503
+ if (BUILD4.updatable) {
387
504
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
388
505
  if (!(memberName in newVnodeAttrs)) {
389
506
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
@@ -412,19 +529,16 @@ var useNativeShadowDom = false;
412
529
  var checkSlotFallbackVisibility = false;
413
530
  var checkSlotRelocate = false;
414
531
  var isSvgMode = false;
415
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
532
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
416
533
  var _a;
417
534
  const newVNode2 = newParentVNode.$children$[childIndex];
418
535
  let i2 = 0;
419
536
  let elm;
420
537
  let childNode;
421
538
  let oldVNode;
422
- if (BUILD4.slotRelocation && !useNativeShadowDom) {
539
+ if (BUILD5.slotRelocation && !useNativeShadowDom) {
423
540
  checkSlotRelocate = true;
424
541
  if (newVNode2.$tag$ === "slot") {
425
- if (scopeId) {
426
- parentElm.classList.add(scopeId + "-s");
427
- }
428
542
  newVNode2.$flags$ |= newVNode2.$children$ ? (
429
543
  // slot element has fallback content
430
544
  // still create an element that "mocks" the slot element
@@ -437,48 +551,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
437
551
  );
438
552
  }
439
553
  }
440
- if (BUILD4.isDev && newVNode2.$elm$) {
554
+ if (BUILD5.isDev && newVNode2.$elm$) {
441
555
  consoleDevError(
442
556
  `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`
443
557
  );
444
558
  }
445
- if (BUILD4.vdomText && newVNode2.$text$ !== null) {
559
+ if (BUILD5.vdomText && newVNode2.$text$ !== null) {
446
560
  elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
447
- } else if (BUILD4.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
448
- elm = newVNode2.$elm$ = BUILD4.isDebug || BUILD4.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
561
+ } else if (BUILD5.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
562
+ elm = newVNode2.$elm$ = BUILD5.isDebug || BUILD5.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
449
563
  } else {
450
- if (BUILD4.svg && !isSvgMode) {
564
+ if (BUILD5.svg && !isSvgMode) {
451
565
  isSvgMode = newVNode2.$tag$ === "svg";
452
566
  }
453
- elm = newVNode2.$elm$ = BUILD4.svg ? doc.createElementNS(
567
+ elm = newVNode2.$elm$ = BUILD5.svg ? doc.createElementNS(
454
568
  isSvgMode ? SVG_NS : HTML_NS,
455
- !useNativeShadowDom && BUILD4.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
569
+ !useNativeShadowDom && BUILD5.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
456
570
  ) : doc.createElement(
457
- !useNativeShadowDom && BUILD4.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
571
+ !useNativeShadowDom && BUILD5.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
458
572
  );
459
- if (BUILD4.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
573
+ if (BUILD5.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
460
574
  isSvgMode = false;
461
575
  }
462
- if (BUILD4.vdomAttribute) {
576
+ if (BUILD5.vdomAttribute) {
463
577
  updateElement(null, newVNode2, isSvgMode);
464
578
  }
465
- const rootNode = elm.getRootNode();
466
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
467
- if (!isElementWithinShadowRoot && BUILD4.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
579
+ if (BUILD5.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
468
580
  elm.classList.add(elm["s-si"] = scopeId);
469
581
  }
470
- if (BUILD4.scoped) {
471
- updateElementScopeIds(elm, parentElm);
472
- }
473
582
  if (newVNode2.$children$) {
474
583
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
475
- childNode = createElm(oldParentVNode, newVNode2, i2, elm);
584
+ childNode = createElm(oldParentVNode, newVNode2, i2);
476
585
  if (childNode) {
477
586
  elm.appendChild(childNode);
478
587
  }
479
588
  }
480
589
  }
481
- if (BUILD4.svg) {
590
+ if (BUILD5.svg) {
482
591
  if (newVNode2.$tag$ === "svg") {
483
592
  isSvgMode = false;
484
593
  } else if (elm.tagName === "foreignObject") {
@@ -487,7 +596,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
487
596
  }
488
597
  }
489
598
  elm["s-hn"] = hostTagName;
490
- if (BUILD4.slotRelocation) {
599
+ if (BUILD5.slotRelocation) {
491
600
  if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
492
601
  elm["s-sr"] = true;
493
602
  elm["s-cr"] = contentRef;
@@ -495,12 +604,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
495
604
  elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
496
605
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
497
606
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
498
- if (BUILD4.experimentalSlotFixes) {
607
+ if (BUILD5.experimentalSlotFixes) {
499
608
  relocateToHostRoot(oldParentVNode.$elm$);
500
609
  } else {
501
610
  putBackInOriginalLocation(oldParentVNode.$elm$, false);
502
611
  }
503
612
  }
613
+ if (BUILD5.scoped) {
614
+ addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
615
+ }
504
616
  }
505
617
  }
506
618
  return elm;
@@ -528,7 +640,7 @@ var relocateToHostRoot = (parentElm) => {
528
640
  var putBackInOriginalLocation = (parentElm, recursive) => {
529
641
  plt.$flags$ |= 1 /* isTmpDisconnected */;
530
642
  const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
531
- if (parentElm["s-sr"] && BUILD4.experimentalSlotFixes) {
643
+ if (parentElm["s-sr"] && BUILD5.experimentalSlotFixes) {
532
644
  let node = parentElm;
533
645
  while (node = node.nextSibling) {
534
646
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -539,7 +651,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
539
651
  for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
540
652
  const childNode = oldSlotChildNodes[i2];
541
653
  if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
542
- insertBefore(parentReferenceNode(childNode), childNode, referenceNode(childNode));
654
+ insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
543
655
  childNode["s-ol"].remove();
544
656
  childNode["s-ol"] = void 0;
545
657
  childNode["s-sh"] = void 0;
@@ -552,17 +664,17 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
552
664
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
553
665
  };
554
666
  var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
555
- let containerElm = BUILD4.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
667
+ let containerElm = BUILD5.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
556
668
  let childNode;
557
- if (BUILD4.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
669
+ if (BUILD5.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
558
670
  containerElm = containerElm.shadowRoot;
559
671
  }
560
672
  for (; startIdx <= endIdx; ++startIdx) {
561
673
  if (vnodes[startIdx]) {
562
- childNode = createElm(null, parentVNode, startIdx, parentElm);
674
+ childNode = createElm(null, parentVNode, startIdx);
563
675
  if (childNode) {
564
676
  vnodes[startIdx].$elm$ = childNode;
565
- insertBefore(containerElm, childNode, BUILD4.slotRelocation ? referenceNode(before) : before);
677
+ insertBefore(containerElm, childNode, BUILD5.slotRelocation ? referenceNode(before) : before);
566
678
  }
567
679
  }
568
680
  }
@@ -574,7 +686,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
574
686
  const elm = vnode.$elm$;
575
687
  nullifyVNodeRefs(vnode);
576
688
  if (elm) {
577
- if (BUILD4.slotRelocation) {
689
+ if (BUILD5.slotRelocation) {
578
690
  checkSlotFallbackVisibility = true;
579
691
  if (elm["s-ol"]) {
580
692
  elm["s-ol"].remove();
@@ -618,7 +730,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
618
730
  oldEndVnode = oldCh[--oldEndIdx];
619
731
  newEndVnode = newCh[--newEndIdx];
620
732
  } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
621
- if (BUILD4.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
733
+ if (BUILD5.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
622
734
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
623
735
  }
624
736
  patch(oldStartVnode, newEndVnode, isInitialRender);
@@ -626,7 +738,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
626
738
  oldStartVnode = oldCh[++oldStartIdx];
627
739
  newEndVnode = newCh[--newEndIdx];
628
740
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
629
- if (BUILD4.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
741
+ if (BUILD5.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
630
742
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
631
743
  }
632
744
  patch(oldEndVnode, newStartVnode, isInitialRender);
@@ -635,7 +747,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
635
747
  newStartVnode = newCh[++newStartIdx];
636
748
  } else {
637
749
  idxInOld = -1;
638
- if (BUILD4.vdomKey) {
750
+ if (BUILD5.vdomKey) {
639
751
  for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
640
752
  if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
641
753
  idxInOld = i2;
@@ -643,10 +755,10 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
643
755
  }
644
756
  }
645
757
  }
646
- if (BUILD4.vdomKey && idxInOld >= 0) {
758
+ if (BUILD5.vdomKey && idxInOld >= 0) {
647
759
  elmToMove = oldCh[idxInOld];
648
760
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
649
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
761
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
650
762
  } else {
651
763
  patch(elmToMove, newStartVnode, isInitialRender);
652
764
  oldCh[idxInOld] = void 0;
@@ -654,12 +766,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
654
766
  }
655
767
  newStartVnode = newCh[++newStartIdx];
656
768
  } else {
657
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm);
769
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
658
770
  newStartVnode = newCh[++newStartIdx];
659
771
  }
660
772
  if (node) {
661
- if (BUILD4.slotRelocation) {
662
- insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
773
+ if (BUILD5.slotRelocation) {
774
+ insertBefore(
775
+ referenceNode(oldStartVnode.$elm$).parentNode,
776
+ node,
777
+ referenceNode(oldStartVnode.$elm$)
778
+ );
663
779
  } else {
664
780
  insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
665
781
  }
@@ -675,35 +791,26 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
675
791
  newStartIdx,
676
792
  newEndIdx
677
793
  );
678
- } else if (BUILD4.updatable && newStartIdx > newEndIdx) {
794
+ } else if (BUILD5.updatable && newStartIdx > newEndIdx) {
679
795
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
680
796
  }
681
797
  };
682
798
  var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
683
799
  if (leftVNode.$tag$ === rightVNode.$tag$) {
684
- if (BUILD4.slotRelocation && leftVNode.$tag$ === "slot") {
685
- if (
686
- // The component gets hydrated and no VDOM has been initialized.
687
- // Here the comparison can't happen as $name$ property is not set for `leftNode`.
688
- "$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
689
- // hydration comments to be removed
690
- leftVNode.$elm$.nodeType !== 8
691
- ) {
692
- return false;
693
- }
800
+ if (BUILD5.slotRelocation && leftVNode.$tag$ === "slot") {
694
801
  return leftVNode.$name$ === rightVNode.$name$;
695
802
  }
696
- if (BUILD4.vdomKey && !isInitialRender) {
803
+ if (BUILD5.vdomKey && !isInitialRender) {
697
804
  return leftVNode.$key$ === rightVNode.$key$;
698
805
  }
806
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
807
+ leftVNode.$key$ = rightVNode.$key$;
808
+ }
699
809
  return true;
700
810
  }
701
811
  return false;
702
812
  };
703
- var referenceNode = (node) => {
704
- return node && node["s-ol"] || node;
705
- };
706
- var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
813
+ var referenceNode = (node) => node && node["s-ol"] || node;
707
814
  var patch = (oldVNode, newVNode2, isInitialRender = false) => {
708
815
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
709
816
  const oldChildren = oldVNode.$children$;
@@ -711,13 +818,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
711
818
  const tag = newVNode2.$tag$;
712
819
  const text = newVNode2.$text$;
713
820
  let defaultHolder;
714
- if (!BUILD4.vdomText || text === null) {
715
- if (BUILD4.svg) {
821
+ if (!BUILD5.vdomText || text === null) {
822
+ if (BUILD5.svg) {
716
823
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
717
824
  }
718
- if (BUILD4.vdomAttribute || BUILD4.reflect) {
719
- if (BUILD4.slot && tag === "slot" && !useNativeShadowDom) {
720
- if (BUILD4.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
825
+ if (BUILD5.vdomAttribute || BUILD5.reflect) {
826
+ if (BUILD5.slot && tag === "slot" && !useNativeShadowDom) {
827
+ if (BUILD5.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
721
828
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
722
829
  relocateToHostRoot(newVNode2.$elm$.parentElement);
723
830
  }
@@ -725,55 +832,28 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
725
832
  updateElement(oldVNode, newVNode2, isSvgMode);
726
833
  }
727
834
  }
728
- if (BUILD4.updatable && oldChildren !== null && newChildren !== null) {
835
+ if (BUILD5.updatable && oldChildren !== null && newChildren !== null) {
729
836
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
730
837
  } else if (newChildren !== null) {
731
- if (BUILD4.updatable && BUILD4.vdomText && oldVNode.$text$ !== null) {
838
+ if (BUILD5.updatable && BUILD5.vdomText && oldVNode.$text$ !== null) {
732
839
  elm.textContent = "";
733
840
  }
734
841
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
735
842
  } else if (
736
843
  // don't do this on initial render as it can cause non-hydrated content to be removed
737
- !isInitialRender && BUILD4.updatable && oldChildren !== null
844
+ !isInitialRender && BUILD5.updatable && oldChildren !== null
738
845
  ) {
739
846
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
740
847
  }
741
- if (BUILD4.svg && isSvgMode && tag === "svg") {
848
+ if (BUILD5.svg && isSvgMode && tag === "svg") {
742
849
  isSvgMode = false;
743
850
  }
744
- } else if (BUILD4.vdomText && BUILD4.slotRelocation && (defaultHolder = elm["s-cr"])) {
851
+ } else if (BUILD5.vdomText && BUILD5.slotRelocation && (defaultHolder = elm["s-cr"])) {
745
852
  defaultHolder.parentNode.textContent = text;
746
- } else if (BUILD4.vdomText && oldVNode.$text$ !== text) {
853
+ } else if (BUILD5.vdomText && oldVNode.$text$ !== text) {
747
854
  elm.data = text;
748
855
  }
749
856
  };
750
- var updateFallbackSlotVisibility = (elm) => {
751
- const childNodes = elm.__childNodes || elm.childNodes;
752
- for (const childNode of childNodes) {
753
- if (childNode.nodeType === 1 /* ElementNode */) {
754
- if (childNode["s-sr"]) {
755
- const slotName = childNode["s-sn"];
756
- childNode.hidden = false;
757
- for (const siblingNode of childNodes) {
758
- if (siblingNode !== childNode) {
759
- if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
760
- if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
761
- childNode.hidden = true;
762
- break;
763
- }
764
- } else if (slotName === siblingNode["s-sn"]) {
765
- if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
766
- childNode.hidden = true;
767
- break;
768
- }
769
- }
770
- }
771
- }
772
- }
773
- updateFallbackSlotVisibility(childNode);
774
- }
775
- }
776
- };
777
857
  var relocateNodes = [];
778
858
  var markSlotContentForRelocation = (elm) => {
779
859
  let node;
@@ -786,7 +866,7 @@ var markSlotContentForRelocation = (elm) => {
786
866
  const slotName = childNode["s-sn"];
787
867
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
788
868
  node = hostContentNodes[j];
789
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD4.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
869
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD5.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
790
870
  if (isNodeLocatedInSlot(node, slotName)) {
791
871
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
792
872
  checkSlotFallbackVisibility = true;
@@ -824,60 +904,40 @@ var markSlotContentForRelocation = (elm) => {
824
904
  }
825
905
  }
826
906
  };
827
- var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
828
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
829
- if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
830
- return true;
831
- }
832
- if (nodeToRelocate.getAttribute("slot") === slotName) {
833
- return true;
834
- }
835
- return false;
836
- }
837
- if (nodeToRelocate["s-sn"] === slotName) {
838
- return true;
839
- }
840
- return slotName === "";
841
- };
842
907
  var nullifyVNodeRefs = (vNode) => {
843
- if (BUILD4.vdomRef) {
908
+ if (BUILD5.vdomRef) {
844
909
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
845
910
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
846
911
  }
847
912
  };
848
913
  var insertBefore = (parent, newNode, reference) => {
849
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
850
- if (BUILD4.scoped) {
851
- updateElementScopeIds(newNode, parent);
914
+ if (BUILD5.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
915
+ addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
852
916
  }
917
+ const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
853
918
  return inserted;
854
919
  };
855
- var findScopeIds = (element) => {
856
- const scopeIds = [];
857
- if (element) {
858
- scopeIds.push(
859
- ...element["s-scs"] || [],
860
- element["s-si"],
861
- element["s-sc"],
862
- ...findScopeIds(element.parentElement)
863
- );
864
- }
865
- return scopeIds;
866
- };
867
- var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
920
+ function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
868
921
  var _a;
869
- if (element && parent && element.nodeType === 1 /* ElementNode */) {
870
- const scopeIds = new Set(findScopeIds(parent).filter(Boolean));
871
- if (scopeIds.size) {
872
- (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = Array.from(scopeIds));
873
- if (element["s-ol"] || iterateChildNodes) {
874
- for (const childNode of Array.from(element.__childNodes || element.childNodes)) {
875
- updateElementScopeIds(childNode, element, true);
922
+ let scopeId2;
923
+ if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
924
+ const scopeName = slotNode["s-sn"];
925
+ const hostName = slotNode["s-hn"];
926
+ (_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
927
+ if (oldParent && oldParent.classList.contains(scopeId2 + "-s")) {
928
+ let child = (oldParent.__childNodes || oldParent.childNodes)[0];
929
+ let found = false;
930
+ while (child) {
931
+ if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
932
+ found = true;
933
+ break;
876
934
  }
935
+ child = child.nextSibling;
877
936
  }
937
+ if (!found) oldParent.classList.remove(scopeId2 + "-s");
878
938
  }
879
939
  }
880
- };
940
+ }
881
941
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
882
942
  var _a, _b, _c, _d, _e;
883
943
  const hostElm = hostRef.$hostElement$;
@@ -885,7 +945,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
885
945
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
886
946
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
887
947
  hostTagName = hostElm.tagName;
888
- if (BUILD4.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
948
+ if (BUILD5.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
889
949
  throw new Error(`The <Host> must be the single root component.
890
950
  Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
891
951
 
@@ -899,7 +959,7 @@ render() {
899
959
  }
900
960
  `);
901
961
  }
902
- if (BUILD4.reflect && cmpMeta.$attrsToReflect$) {
962
+ if (BUILD5.reflect && cmpMeta.$attrsToReflect$) {
903
963
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
904
964
  cmpMeta.$attrsToReflect$.map(
905
965
  ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
@@ -915,24 +975,24 @@ render() {
915
975
  rootVnode.$tag$ = null;
916
976
  rootVnode.$flags$ |= 4 /* isHost */;
917
977
  hostRef.$vnode$ = rootVnode;
918
- rootVnode.$elm$ = oldVNode.$elm$ = BUILD4.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
919
- if (BUILD4.scoped || BUILD4.shadowDom) {
978
+ rootVnode.$elm$ = oldVNode.$elm$ = BUILD5.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
979
+ if (BUILD5.scoped || BUILD5.shadowDom) {
920
980
  scopeId = hostElm["s-sc"];
921
981
  }
922
982
  useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
923
- if (BUILD4.slotRelocation) {
983
+ if (BUILD5.slotRelocation) {
924
984
  contentRef = hostElm["s-cr"];
925
985
  checkSlotFallbackVisibility = false;
926
986
  }
927
987
  patch(oldVNode, rootVnode, isInitialLoad);
928
- if (BUILD4.slotRelocation) {
988
+ if (BUILD5.slotRelocation) {
929
989
  plt.$flags$ |= 1 /* isTmpDisconnected */;
930
990
  if (checkSlotRelocate) {
931
991
  markSlotContentForRelocation(rootVnode.$elm$);
932
992
  for (const relocateData of relocateNodes) {
933
993
  const nodeToRelocate = relocateData.$nodeToRelocate$;
934
994
  if (!nodeToRelocate["s-ol"]) {
935
- const orgLocationNode = BUILD4.isDebug || BUILD4.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
995
+ const orgLocationNode = BUILD5.isDebug || BUILD5.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
936
996
  orgLocationNode["s-nr"] = nodeToRelocate;
937
997
  insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
938
998
  }
@@ -943,7 +1003,7 @@ render() {
943
1003
  if (slotRefNode) {
944
1004
  const parentNodeRef = slotRefNode.parentNode;
945
1005
  let insertBeforeNode = slotRefNode.nextSibling;
946
- if (!BUILD4.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1006
+ if (!BUILD5.hydrateServerSide && (!BUILD5.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
947
1007
  let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
948
1008
  while (orgLocationNode) {
949
1009
  let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
@@ -962,11 +1022,11 @@ render() {
962
1022
  }
963
1023
  if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
964
1024
  if (nodeToRelocate !== insertBeforeNode) {
965
- if (!BUILD4.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1025
+ if (!BUILD5.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
966
1026
  nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
967
1027
  }
968
1028
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
969
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1029
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
970
1030
  nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
971
1031
  }
972
1032
  }
@@ -988,7 +1048,7 @@ render() {
988
1048
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
989
1049
  relocateNodes.length = 0;
990
1050
  }
991
- if (BUILD4.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1051
+ if (BUILD5.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
992
1052
  const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
993
1053
  for (const childNode of children) {
994
1054
  if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
@@ -1025,9 +1085,9 @@ var patchCloneNode = (HostElementPrototype) => {
1025
1085
  const orgCloneNode = HostElementPrototype.cloneNode;
1026
1086
  HostElementPrototype.cloneNode = function(deep) {
1027
1087
  const srcNode = this;
1028
- const isShadowDom = BUILD5.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
1088
+ const isShadowDom = BUILD6.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
1029
1089
  const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
1030
- if (BUILD5.slot && !isShadowDom && deep) {
1090
+ if (BUILD6.slot && !isShadowDom && deep) {
1031
1091
  let i2 = 0;
1032
1092
  let slotted, nonRindoNode;
1033
1093
  const rindoPrivates = [
@@ -1052,7 +1112,7 @@ var patchCloneNode = (HostElementPrototype) => {
1052
1112
  slotted = childNodes[i2]["s-nr"];
1053
1113
  nonRindoNode = rindoPrivates.every((privateField) => !childNodes[i2][privateField]);
1054
1114
  if (slotted) {
1055
- if (BUILD5.appendChildSlotFix && clonedNode.__appendChild) {
1115
+ if (BUILD6.appendChildSlotFix && clonedNode.__appendChild) {
1056
1116
  clonedNode.__appendChild(slotted.cloneNode(true));
1057
1117
  } else {
1058
1118
  clonedNode.appendChild(slotted.cloneNode(true));
@@ -1070,7 +1130,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
1070
1130
  HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
1071
1131
  HostElementPrototype.appendChild = function(newChild) {
1072
1132
  const slotName = newChild["s-sn"] = getSlotName(newChild);
1073
- const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
1133
+ const slotNode = getHostSlotNodes(this.__childNodes || this.childNodes, this.tagName, slotName)[0];
1074
1134
  if (slotNode) {
1075
1135
  addSlotRelocateNode(newChild, slotNode);
1076
1136
  const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
@@ -1087,7 +1147,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
1087
1147
  ElementPrototype.removeChild = function(toRemove) {
1088
1148
  if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
1089
1149
  const childNodes = this.__childNodes || this.childNodes;
1090
- const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
1150
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
1091
1151
  if (slotNode && toRemove.isConnected) {
1092
1152
  toRemove.remove();
1093
1153
  updateFallbackSlotVisibility(this);
@@ -1106,7 +1166,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
1106
1166
  }
1107
1167
  const slotName = newChild["s-sn"] = getSlotName(newChild);
1108
1168
  const childNodes = this.__childNodes || this.childNodes;
1109
- const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
1169
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
1110
1170
  if (slotNode) {
1111
1171
  addSlotRelocateNode(newChild, slotNode, true);
1112
1172
  const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
@@ -1173,11 +1233,7 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
1173
1233
  };
1174
1234
  };
1175
1235
  var patchTextContent = (hostElementPrototype) => {
1176
- let descriptor = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
1177
- if (!descriptor) {
1178
- descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
1179
- }
1180
- if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
1236
+ patchHostOriginalAccessor("textContent", hostElementPrototype);
1181
1237
  Object.defineProperty(hostElementPrototype, "textContent", {
1182
1238
  get: function() {
1183
1239
  let text = "";
@@ -1201,16 +1257,7 @@ var patchChildSlotNodes = (elm) => {
1201
1257
  return this[n];
1202
1258
  }
1203
1259
  }
1204
- let childNodesFn = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "childNodes");
1205
- if (!childNodesFn) {
1206
- childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
1207
- }
1208
- if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
1209
- let childrenFn = Object.getOwnPropertyDescriptor(Element.prototype, "children");
1210
- if (!childrenFn) {
1211
- childrenFn = Object.getOwnPropertyDescriptor(elm, "children");
1212
- }
1213
- if (childrenFn) Object.defineProperty(elm, "__children", childrenFn);
1260
+ patchHostOriginalAccessor("children", elm);
1214
1261
  Object.defineProperty(elm, "children", {
1215
1262
  get() {
1216
1263
  return this.childNodes.filter((n) => n.nodeType === 1);
@@ -1221,7 +1268,19 @@ var patchChildSlotNodes = (elm) => {
1221
1268
  return this.children.length;
1222
1269
  }
1223
1270
  });
1224
- if (!childNodesFn) return;
1271
+ patchHostOriginalAccessor("firstChild", elm);
1272
+ Object.defineProperty(elm, "firstChild", {
1273
+ get() {
1274
+ return this.childNodes[0];
1275
+ }
1276
+ });
1277
+ patchHostOriginalAccessor("lastChild", elm);
1278
+ Object.defineProperty(elm, "lastChild", {
1279
+ get() {
1280
+ return this.childNodes[this.childNodes.length - 1];
1281
+ }
1282
+ });
1283
+ patchHostOriginalAccessor("childNodes", elm);
1225
1284
  Object.defineProperty(elm, "childNodes", {
1226
1285
  get() {
1227
1286
  var _a, _b;
@@ -1235,77 +1294,102 @@ var patchChildSlotNodes = (elm) => {
1235
1294
  }
1236
1295
  });
1237
1296
  };
1238
- var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
1239
- let slottedNodeLocation;
1240
- if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
1241
- slottedNodeLocation = newChild["s-ol"];
1242
- } else {
1243
- slottedNodeLocation = document.createTextNode("");
1244
- slottedNodeLocation["s-nr"] = newChild;
1297
+ var patchNextPrev = (node) => {
1298
+ if (!node || node.__nextSibling || !globalThis.Node) return;
1299
+ patchNextSibling(node);
1300
+ patchPreviousSibling(node);
1301
+ if (node.nodeType === Node.ELEMENT_NODE) {
1302
+ patchNextElementSibling(node);
1303
+ patchPreviousElementSibling(node);
1245
1304
  }
1246
- if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
1247
- const parent = slotNode["s-cr"].parentNode;
1248
- const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
1249
- if (typeof position !== "undefined") {
1250
- if (BUILD5.hydrateClientSide) {
1251
- slottedNodeLocation["s-oo"] = position;
1252
- const childNodes = parent.__childNodes || parent.childNodes;
1253
- const slotRelocateNodes = [slottedNodeLocation];
1254
- childNodes.forEach((n) => {
1255
- if (n["s-nr"]) slotRelocateNodes.push(n);
1256
- });
1257
- slotRelocateNodes.sort((a, b) => {
1258
- if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
1259
- else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
1260
- return 0;
1261
- });
1262
- slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
1305
+ };
1306
+ var patchNextSibling = (node) => {
1307
+ if (!node || node.__nextSibling) return;
1308
+ patchHostOriginalAccessor("nextSibling", node);
1309
+ Object.defineProperty(node, "nextSibling", {
1310
+ get: function() {
1311
+ var _a;
1312
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
1313
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
1314
+ if (parentNodes && index > -1) {
1315
+ return parentNodes[index + 1];
1316
+ }
1317
+ return this.__nextSibling;
1263
1318
  }
1264
- } else {
1265
- appendMethod.call(parent, slottedNodeLocation);
1266
- }
1267
- newChild["s-ol"] = slottedNodeLocation;
1268
- newChild["s-sh"] = slotNode["s-hn"];
1319
+ });
1269
1320
  };
1270
- var getSlottedChildNodes = (childNodes) => {
1271
- const result = [];
1272
- for (let i2 = 0; i2 < childNodes.length; i2++) {
1273
- const slottedNode = childNodes[i2]["s-nr"];
1274
- if (slottedNode && slottedNode.isConnected) {
1275
- result.push(slottedNode);
1321
+ var patchNextElementSibling = (element) => {
1322
+ if (!element || element.__nextElementSibling) return;
1323
+ patchHostOriginalAccessor("nextElementSibling", element);
1324
+ Object.defineProperty(element, "nextElementSibling", {
1325
+ get: function() {
1326
+ var _a;
1327
+ const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
1328
+ const index = parentEles == null ? void 0 : parentEles.indexOf(this);
1329
+ if (parentEles && index > -1) {
1330
+ return parentEles[index + 1];
1331
+ }
1332
+ return this.__nextElementSibling;
1276
1333
  }
1277
- }
1278
- return result;
1334
+ });
1279
1335
  };
1280
- var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
1281
- var getHostSlotNode = (childNodes, slotName, hostName) => {
1282
- let i2 = 0;
1283
- let childNode;
1284
- for (; i2 < childNodes.length; i2++) {
1285
- childNode = childNodes[i2];
1286
- if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
1287
- return childNode;
1336
+ var patchPreviousSibling = (node) => {
1337
+ if (!node || node.__previousSibling) return;
1338
+ patchHostOriginalAccessor("previousSibling", node);
1339
+ Object.defineProperty(node, "previousSibling", {
1340
+ get: function() {
1341
+ var _a;
1342
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
1343
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
1344
+ if (parentNodes && index > -1) {
1345
+ return parentNodes[index - 1];
1346
+ }
1347
+ return this.__previousSibling;
1288
1348
  }
1289
- childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
1290
- if (childNode) {
1291
- return childNode;
1349
+ });
1350
+ };
1351
+ var patchPreviousElementSibling = (element) => {
1352
+ if (!element || element.__previousElementSibling) return;
1353
+ patchHostOriginalAccessor("previousElementSibling", element);
1354
+ Object.defineProperty(element, "previousElementSibling", {
1355
+ get: function() {
1356
+ var _a;
1357
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
1358
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
1359
+ if (parentNodes && index > -1) {
1360
+ return parentNodes[index - 1];
1361
+ }
1362
+ return this.__previousElementSibling;
1292
1363
  }
1293
- }
1294
- return null;
1364
+ });
1295
1365
  };
1296
- var getHostSlotChildNodes = (n, slotName) => {
1297
- const childNodes = [n];
1298
- while ((n = n.nextSibling) && n["s-sn"] === slotName) {
1299
- childNodes.push(n);
1366
+ var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
1367
+ var validNodesPatches = [
1368
+ "childNodes",
1369
+ "firstChild",
1370
+ "lastChild",
1371
+ "nextSibling",
1372
+ "previousSibling",
1373
+ "textContent"
1374
+ ];
1375
+ function patchHostOriginalAccessor(accessorName, node) {
1376
+ let accessor;
1377
+ if (validElementPatches.includes(accessorName)) {
1378
+ accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
1379
+ } else if (validNodesPatches.includes(accessorName)) {
1380
+ accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
1300
1381
  }
1301
- return childNodes;
1302
- };
1382
+ if (!accessor) {
1383
+ accessor = Object.getOwnPropertyDescriptor(node, accessorName);
1384
+ }
1385
+ if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
1386
+ }
1303
1387
 
1304
1388
  // src/runtime/profile.ts
1305
- import { BUILD as BUILD6 } from "@rindo/core/internal/app-data";
1389
+ import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
1306
1390
  var i = 0;
1307
1391
  var createTime = (fnName, tagName = "") => {
1308
- if (BUILD6.profile && performance.mark) {
1392
+ if (BUILD7.profile && performance.mark) {
1309
1393
  const key = `st:${fnName}:${tagName}:${i++}`;
1310
1394
  performance.mark(key);
1311
1395
  return () => performance.measure(`[Rindo] ${fnName}() <${tagName}>`, key);
@@ -1316,7 +1400,7 @@ var createTime = (fnName, tagName = "") => {
1316
1400
  }
1317
1401
  };
1318
1402
  var uniqueTime = (key, measureText) => {
1319
- if (BUILD6.profile && performance.mark) {
1403
+ if (BUILD7.profile && performance.mark) {
1320
1404
  if (performance.getEntriesByName(key, "mark").length === 0) {
1321
1405
  performance.mark(key);
1322
1406
  }
@@ -1374,7 +1458,7 @@ var inspect = (ref) => {
1374
1458
  };
1375
1459
  };
1376
1460
  var installDevTools = () => {
1377
- if (BUILD6.devTools) {
1461
+ if (BUILD7.devTools) {
1378
1462
  const rindo = win.rindo = win.rindo || {};
1379
1463
  const originalInspect = rindo.inspect;
1380
1464
  rindo.inspect = (ref) => {
@@ -1394,9 +1478,19 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1394
1478
  const childRenderNodes = [];
1395
1479
  const slotNodes = [];
1396
1480
  const slottedNodes = [];
1397
- const shadowRootNodes = BUILD7.shadowDom && shadowRoot ? [] : null;
1481
+ const shadowRootNodes = BUILD8.shadowDom && shadowRoot ? [] : null;
1398
1482
  const vnode = newVNode(tagName, null);
1399
1483
  vnode.$elm$ = hostElm;
1484
+ let scopeId2;
1485
+ if (BUILD8.scoped) {
1486
+ const cmpMeta = hostRef.$cmpMeta$;
1487
+ if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1488
+ scopeId2 = hostElm["s-sc"];
1489
+ hostElm.classList.add(scopeId2 + "-h");
1490
+ } else if (hostElm["s-sc"]) {
1491
+ delete hostElm["s-sc"];
1492
+ }
1493
+ }
1400
1494
  if (!plt.$orgLocNodes$) {
1401
1495
  initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
1402
1496
  }
@@ -1426,6 +1520,18 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1426
1520
  node["s-cr"] = hostElm["s-cr"];
1427
1521
  }
1428
1522
  }
1523
+ if (childRenderNode.$tag$ === "slot") {
1524
+ if (childRenderNode.$children$) {
1525
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
1526
+ if (!childRenderNode.$elm$.childNodes.length) {
1527
+ childRenderNode.$children$.forEach((c) => {
1528
+ childRenderNode.$elm$.appendChild(c.$elm$);
1529
+ });
1530
+ }
1531
+ } else {
1532
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
1533
+ }
1534
+ }
1429
1535
  if (orgLocationNode && orgLocationNode.isConnected) {
1430
1536
  if (shadowRoot && orgLocationNode["s-en"] === "") {
1431
1537
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
@@ -1438,8 +1544,8 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1438
1544
  plt.$orgLocNodes$.delete(orgLocationId);
1439
1545
  }
1440
1546
  const hosts = [];
1441
- let snIndex = 0;
1442
1547
  const snLen = slottedNodes.length;
1548
+ let snIndex = 0;
1443
1549
  let slotGroup;
1444
1550
  let snGroupIdx;
1445
1551
  let snGroupLen;
@@ -1461,17 +1567,24 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1461
1567
  if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1462
1568
  slottedItem.slot["s-cr"] = hostEle;
1463
1569
  } else {
1464
- const hostChildren = hostEle.__childNodes || hostEle.childNodes;
1465
- slottedItem.slot["s-cr"] = hostChildren[0];
1570
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1466
1571
  }
1467
1572
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1573
+ if (BUILD8.experimentalSlotFixes) {
1574
+ patchNextPrev(slottedItem.node);
1575
+ }
1468
1576
  }
1469
1577
  if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1470
1578
  hostEle.appendChild(slottedItem.node);
1471
1579
  }
1472
1580
  }
1473
1581
  }
1474
- if (BUILD7.shadowDom && shadowRoot) {
1582
+ if (BUILD8.scoped && scopeId2 && slotNodes.length) {
1583
+ slotNodes.forEach((slot) => {
1584
+ slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1585
+ });
1586
+ }
1587
+ if (BUILD8.shadowDom && shadowRoot) {
1475
1588
  let rnIdex = 0;
1476
1589
  const rnLen = shadowRootNodes.length;
1477
1590
  for (rnIdex; rnIdex < rnLen; rnIdex++) {
@@ -1505,15 +1618,19 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1505
1618
  $index$: childIdSplt[3],
1506
1619
  $tag$: node.tagName.toLowerCase(),
1507
1620
  $elm$: node,
1508
- // If we don't add the initial classes to the VNode, the first `vdom-render.ts` reconciliation will fail:
1509
- // client side changes before componentDidLoad will be ignored, `set-accessor.ts` will just take the element's initial classes
1510
- $attrs$: { class: node.className }
1621
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
1622
+ // won't try to reconcile them. Classes set on the node will be blown away.
1623
+ $attrs$: { class: node.className || "" }
1511
1624
  });
1512
1625
  childRenderNodes.push(childVNode);
1513
1626
  node.removeAttribute(HYDRATE_CHILD_ID);
1514
1627
  if (!parentVNode.$children$) {
1515
1628
  parentVNode.$children$ = [];
1516
1629
  }
1630
+ if (BUILD8.scoped && scopeId2) {
1631
+ node["s-si"] = scopeId2;
1632
+ childVNode.$attrs$.class += " " + scopeId2;
1633
+ }
1517
1634
  const slotName = childVNode.$elm$.getAttribute("s-sn");
1518
1635
  if (typeof slotName === "string") {
1519
1636
  if (childVNode.$tag$ === "slot-fb") {
@@ -1528,6 +1645,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1528
1645
  shadowRootNodes,
1529
1646
  slottedNodes
1530
1647
  );
1648
+ if (BUILD8.scoped && scopeId2) {
1649
+ node.classList.add(scopeId2);
1650
+ }
1531
1651
  }
1532
1652
  childVNode.$elm$["s-sn"] = slotName;
1533
1653
  childVNode.$elm$.removeAttribute("s-sn");
@@ -1535,7 +1655,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1535
1655
  if (childVNode.$index$ !== void 0) {
1536
1656
  parentVNode.$children$[childVNode.$index$] = childVNode;
1537
1657
  }
1538
- if (scopeId2) node["s-si"] = scopeId2;
1539
1658
  parentVNode = childVNode;
1540
1659
  if (shadowRootNodes && childVNode.$depth$ === "0") {
1541
1660
  shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
@@ -1610,8 +1729,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1610
1729
  }
1611
1730
  } else if (childVNode.$hostId$ === hostId) {
1612
1731
  if (childNodeType === SLOT_NODE_ID) {
1613
- childVNode.$tag$ = "slot";
1614
- const slotName = node["s-sn"] = childVNode.$name$ = childIdSplt[5] || "";
1732
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
1615
1733
  addSlot(
1616
1734
  slotName,
1617
1735
  childIdSplt[2],
@@ -1624,9 +1742,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1624
1742
  slottedNodes
1625
1743
  );
1626
1744
  } else if (childNodeType === CONTENT_REF_ID) {
1627
- if (BUILD7.shadowDom && shadowRootNodes) {
1745
+ if (BUILD8.shadowDom && shadowRootNodes) {
1628
1746
  node.remove();
1629
- } else if (BUILD7.slotRelocation) {
1747
+ } else if (BUILD8.slotRelocation) {
1630
1748
  hostElm["s-cr"] = node;
1631
1749
  node["s-cn"] = true;
1632
1750
  }
@@ -1685,8 +1803,10 @@ var createSimpleVNode = (vnode) => {
1685
1803
  };
1686
1804
  function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
1687
1805
  node["s-sr"] = true;
1806
+ childVNode.$name$ = slotName || null;
1807
+ childVNode.$tag$ = "slot";
1688
1808
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1689
- if (BUILD7.shadowDom && shadowRootNodes) {
1809
+ if (BUILD8.shadowDom && shadowRootNodes) {
1690
1810
  const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
1691
1811
  if (childVNode.$name$) {
1692
1812
  childVNode.$elm$.setAttribute("name", slotName);
@@ -1727,7 +1847,7 @@ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) =>
1727
1847
  };
1728
1848
 
1729
1849
  // src/runtime/initialize-component.ts
1730
- import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
1850
+ import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
1731
1851
 
1732
1852
  // src/runtime/mode.ts
1733
1853
  var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
@@ -1735,22 +1855,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
1735
1855
  var getMode = (ref) => getHostRef(ref).$modeName$;
1736
1856
 
1737
1857
  // src/runtime/proxy-component.ts
1738
- import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
1858
+ import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
1739
1859
 
1740
1860
  // src/runtime/set-value.ts
1741
- import { BUILD as BUILD13 } from "@rindo/core/internal/app-data";
1861
+ import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
1742
1862
 
1743
1863
  // src/runtime/parse-property-value.ts
1744
- import { BUILD as BUILD8 } from "@rindo/core/internal/app-data";
1864
+ import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
1745
1865
  var parsePropertyValue = (propValue, propType) => {
1746
1866
  if (propValue != null && !isComplexType(propValue)) {
1747
- if (BUILD8.propBoolean && propType & 4 /* Boolean */) {
1867
+ if (BUILD9.propBoolean && propType & 4 /* Boolean */) {
1748
1868
  return propValue === "false" ? false : propValue === "" || !!propValue;
1749
1869
  }
1750
- if (BUILD8.propNumber && propType & 2 /* Number */) {
1870
+ if (BUILD9.propNumber && propType & 2 /* Number */) {
1751
1871
  return parseFloat(propValue);
1752
1872
  }
1753
- if (BUILD8.propString && propType & 1 /* String */) {
1873
+ if (BUILD9.propString && propType & 1 /* String */) {
1754
1874
  return String(propValue);
1755
1875
  }
1756
1876
  return propValue;
@@ -1759,21 +1879,21 @@ var parsePropertyValue = (propValue, propType) => {
1759
1879
  };
1760
1880
 
1761
1881
  // src/runtime/update-component.ts
1762
- import { BUILD as BUILD12, NAMESPACE } from "@rindo/core/internal/app-data";
1882
+ import { BUILD as BUILD13, NAMESPACE } from "@rindo/core/internal/app-data";
1763
1883
 
1764
1884
  // src/runtime/event-emitter.ts
1765
- import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
1885
+ import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
1766
1886
 
1767
1887
  // src/runtime/element.ts
1768
- import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
1769
- var getElement = (ref) => BUILD9.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
1888
+ import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
1889
+ var getElement = (ref) => BUILD10.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
1770
1890
 
1771
1891
  // src/runtime/event-emitter.ts
1772
1892
  var createEvent = (ref, name, flags) => {
1773
1893
  const elm = getElement(ref);
1774
1894
  return {
1775
1895
  emit: (detail) => {
1776
- if (BUILD10.isDev && !elm.isConnected) {
1896
+ if (BUILD11.isDev && !elm.isConnected) {
1777
1897
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
1778
1898
  }
1779
1899
  return emitEvent(elm, name, {
@@ -1792,7 +1912,7 @@ var emitEvent = (elm, name, opts) => {
1792
1912
  };
1793
1913
 
1794
1914
  // src/runtime/styles.ts
1795
- import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
1915
+ import { BUILD as BUILD12 } from "@rindo/core/internal/app-data";
1796
1916
  var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1797
1917
  var registerStyle = (scopeId2, cssText, allowCS) => {
1798
1918
  let style = styles.get(scopeId2);
@@ -1812,7 +1932,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1812
1932
  var _a;
1813
1933
  const scopeId2 = getScopeId(cmpMeta, mode);
1814
1934
  const style = styles.get(scopeId2);
1815
- if (!BUILD11.attachStyles) {
1935
+ if (!BUILD12.attachStyles) {
1816
1936
  return scopeId2;
1817
1937
  }
1818
1938
  styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
@@ -1825,16 +1945,16 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1825
1945
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1826
1946
  }
1827
1947
  if (!appliedStyles.has(scopeId2)) {
1828
- if (BUILD11.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1948
+ if (BUILD12.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1829
1949
  styleElm.innerHTML = style;
1830
1950
  } else {
1831
- styleElm = doc.createElement("style");
1951
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
1832
1952
  styleElm.innerHTML = style;
1833
1953
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1834
1954
  if (nonce != null) {
1835
1955
  styleElm.setAttribute("nonce", nonce);
1836
1956
  }
1837
- if ((BUILD11.hydrateServerSide || BUILD11.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1957
+ if ((BUILD12.hydrateServerSide || BUILD12.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1838
1958
  styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1839
1959
  }
1840
1960
  if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
@@ -1870,7 +1990,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1870
1990
  appliedStyles.add(scopeId2);
1871
1991
  }
1872
1992
  }
1873
- } else if (BUILD11.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1993
+ } else if (BUILD12.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1874
1994
  styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1875
1995
  }
1876
1996
  }
@@ -1882,43 +2002,40 @@ var attachStyles = (hostRef) => {
1882
2002
  const flags = cmpMeta.$flags$;
1883
2003
  const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1884
2004
  const scopeId2 = addStyle(
1885
- BUILD11.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2005
+ BUILD12.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1886
2006
  cmpMeta,
1887
2007
  hostRef.$modeName$
1888
2008
  );
1889
- if ((BUILD11.shadowDom || BUILD11.scoped) && BUILD11.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
2009
+ if ((BUILD12.shadowDom || BUILD12.scoped) && BUILD12.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
1890
2010
  elm["s-sc"] = scopeId2;
1891
2011
  elm.classList.add(scopeId2 + "-h");
1892
- if (BUILD11.scoped && flags & 2 /* scopedCssEncapsulation */) {
1893
- elm.classList.add(scopeId2 + "-s");
1894
- }
1895
2012
  }
1896
2013
  endAttachStyles();
1897
2014
  };
1898
- var getScopeId = (cmp, mode) => "sc-" + (BUILD11.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2015
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD12.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1899
2016
 
1900
2017
  // src/runtime/update-component.ts
1901
2018
  var attachToAncestor = (hostRef, ancestorComponent) => {
1902
- if (BUILD12.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
2019
+ if (BUILD13.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1903
2020
  ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
1904
2021
  }
1905
2022
  };
1906
2023
  var scheduleUpdate = (hostRef, isInitialLoad) => {
1907
- if (BUILD12.taskQueue && BUILD12.updatable) {
2024
+ if (BUILD13.taskQueue && BUILD13.updatable) {
1908
2025
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1909
2026
  }
1910
- if (BUILD12.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
2027
+ if (BUILD13.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1911
2028
  hostRef.$flags$ |= 512 /* needsRerender */;
1912
2029
  return;
1913
2030
  }
1914
2031
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1915
2032
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1916
- return BUILD12.taskQueue ? writeTask(dispatch) : dispatch();
2033
+ return BUILD13.taskQueue ? writeTask(dispatch) : dispatch();
1917
2034
  };
1918
2035
  var dispatchHooks = (hostRef, isInitialLoad) => {
1919
2036
  const elm = hostRef.$hostElement$;
1920
2037
  const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
1921
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
2038
+ const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
1922
2039
  if (!instance) {
1923
2040
  throw new Error(
1924
2041
  `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`
@@ -1926,7 +2043,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1926
2043
  }
1927
2044
  let maybePromise;
1928
2045
  if (isInitialLoad) {
1929
- if (BUILD12.lazyLoad && BUILD12.hostListener) {
2046
+ if (BUILD13.lazyLoad && BUILD13.hostListener) {
1930
2047
  hostRef.$flags$ |= 256 /* isListenReady */;
1931
2048
  if (hostRef.$queuedListeners$) {
1932
2049
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
@@ -1934,17 +2051,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1934
2051
  }
1935
2052
  }
1936
2053
  emitLifecycleEvent(elm, "componentWillLoad");
1937
- if (BUILD12.cmpWillLoad) {
2054
+ if (BUILD13.cmpWillLoad) {
1938
2055
  maybePromise = safeCall(instance, "componentWillLoad");
1939
2056
  }
1940
2057
  } else {
1941
2058
  emitLifecycleEvent(elm, "componentWillUpdate");
1942
- if (BUILD12.cmpWillUpdate) {
2059
+ if (BUILD13.cmpWillUpdate) {
1943
2060
  maybePromise = safeCall(instance, "componentWillUpdate");
1944
2061
  }
1945
2062
  }
1946
2063
  emitLifecycleEvent(elm, "componentWillRender");
1947
- if (BUILD12.cmpWillRender) {
2064
+ if (BUILD13.cmpWillRender) {
1948
2065
  maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
1949
2066
  }
1950
2067
  endSchedule();
@@ -1960,23 +2077,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1960
2077
  const elm = hostRef.$hostElement$;
1961
2078
  const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
1962
2079
  const rc = elm["s-rc"];
1963
- if (BUILD12.style && isInitialLoad) {
2080
+ if (BUILD13.style && isInitialLoad) {
1964
2081
  attachStyles(hostRef);
1965
2082
  }
1966
2083
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1967
- if (BUILD12.isDev) {
2084
+ if (BUILD13.isDev) {
1968
2085
  hostRef.$flags$ |= 1024 /* devOnRender */;
1969
2086
  }
1970
- if (BUILD12.hydrateServerSide) {
2087
+ if (BUILD13.hydrateServerSide) {
1971
2088
  await callRender(hostRef, instance, elm, isInitialLoad);
1972
2089
  } else {
1973
2090
  callRender(hostRef, instance, elm, isInitialLoad);
1974
2091
  }
1975
- if (BUILD12.isDev) {
2092
+ if (BUILD13.isDev) {
1976
2093
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
1977
2094
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1978
2095
  }
1979
- if (BUILD12.hydrateServerSide) {
2096
+ if (BUILD13.hydrateServerSide) {
1980
2097
  try {
1981
2098
  serverSideConnected(elm);
1982
2099
  if (isInitialLoad) {
@@ -1990,13 +2107,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1990
2107
  consoleError(e, elm);
1991
2108
  }
1992
2109
  }
1993
- if (BUILD12.asyncLoading && rc) {
2110
+ if (BUILD13.asyncLoading && rc) {
1994
2111
  rc.map((cb) => cb());
1995
2112
  elm["s-rc"] = void 0;
1996
2113
  }
1997
2114
  endRender();
1998
2115
  endUpdate();
1999
- if (BUILD12.asyncLoading) {
2116
+ if (BUILD13.asyncLoading) {
2000
2117
  const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
2001
2118
  const postUpdate = () => postUpdateComponent(hostRef);
2002
2119
  if (childrenPromises.length === 0) {
@@ -2012,10 +2129,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
2012
2129
  };
2013
2130
  var renderingRef = null;
2014
2131
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
2015
- const allRenderFn = BUILD12.allRenderFn ? true : false;
2016
- const lazyLoad = BUILD12.lazyLoad ? true : false;
2017
- const taskQueue = BUILD12.taskQueue ? true : false;
2018
- const updatable = BUILD12.updatable ? true : false;
2132
+ const allRenderFn = BUILD13.allRenderFn ? true : false;
2133
+ const lazyLoad = BUILD13.lazyLoad ? true : false;
2134
+ const taskQueue = BUILD13.taskQueue ? true : false;
2135
+ const updatable = BUILD13.updatable ? true : false;
2019
2136
  try {
2020
2137
  renderingRef = instance;
2021
2138
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
@@ -2025,9 +2142,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
2025
2142
  if (updatable || lazyLoad) {
2026
2143
  hostRef.$flags$ |= 2 /* hasRendered */;
2027
2144
  }
2028
- if (BUILD12.hasRenderFn || BUILD12.reflect) {
2029
- if (BUILD12.vdomRender || BUILD12.reflect) {
2030
- if (BUILD12.hydrateServerSide) {
2145
+ if (BUILD13.hasRenderFn || BUILD13.reflect) {
2146
+ if (BUILD13.vdomRender || BUILD13.reflect) {
2147
+ if (BUILD13.hydrateServerSide) {
2031
2148
  return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
2032
2149
  } else {
2033
2150
  renderVdom(hostRef, instance, isInitialLoad);
@@ -2052,57 +2169,57 @@ var postUpdateComponent = (hostRef) => {
2052
2169
  const tagName = hostRef.$cmpMeta$.$tagName$;
2053
2170
  const elm = hostRef.$hostElement$;
2054
2171
  const endPostUpdate = createTime("postUpdate", tagName);
2055
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
2172
+ const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
2056
2173
  const ancestorComponent = hostRef.$ancestorComponent$;
2057
- if (BUILD12.cmpDidRender) {
2058
- if (BUILD12.isDev) {
2174
+ if (BUILD13.cmpDidRender) {
2175
+ if (BUILD13.isDev) {
2059
2176
  hostRef.$flags$ |= 1024 /* devOnRender */;
2060
2177
  }
2061
2178
  safeCall(instance, "componentDidRender");
2062
- if (BUILD12.isDev) {
2179
+ if (BUILD13.isDev) {
2063
2180
  hostRef.$flags$ &= ~1024 /* devOnRender */;
2064
2181
  }
2065
2182
  }
2066
2183
  emitLifecycleEvent(elm, "componentDidRender");
2067
2184
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
2068
2185
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
2069
- if (BUILD12.asyncLoading && BUILD12.cssAnnotations) {
2186
+ if (BUILD13.asyncLoading && BUILD13.cssAnnotations) {
2070
2187
  addHydratedFlag(elm);
2071
2188
  }
2072
- if (BUILD12.cmpDidLoad) {
2073
- if (BUILD12.isDev) {
2189
+ if (BUILD13.cmpDidLoad) {
2190
+ if (BUILD13.isDev) {
2074
2191
  hostRef.$flags$ |= 2048 /* devOnDidLoad */;
2075
2192
  }
2076
2193
  safeCall(instance, "componentDidLoad");
2077
- if (BUILD12.isDev) {
2194
+ if (BUILD13.isDev) {
2078
2195
  hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
2079
2196
  }
2080
2197
  }
2081
2198
  emitLifecycleEvent(elm, "componentDidLoad");
2082
2199
  endPostUpdate();
2083
- if (BUILD12.asyncLoading) {
2200
+ if (BUILD13.asyncLoading) {
2084
2201
  hostRef.$onReadyResolve$(elm);
2085
2202
  if (!ancestorComponent) {
2086
2203
  appDidLoad(tagName);
2087
2204
  }
2088
2205
  }
2089
2206
  } else {
2090
- if (BUILD12.cmpDidUpdate) {
2091
- if (BUILD12.isDev) {
2207
+ if (BUILD13.cmpDidUpdate) {
2208
+ if (BUILD13.isDev) {
2092
2209
  hostRef.$flags$ |= 1024 /* devOnRender */;
2093
2210
  }
2094
2211
  safeCall(instance, "componentDidUpdate");
2095
- if (BUILD12.isDev) {
2212
+ if (BUILD13.isDev) {
2096
2213
  hostRef.$flags$ &= ~1024 /* devOnRender */;
2097
2214
  }
2098
2215
  }
2099
2216
  emitLifecycleEvent(elm, "componentDidUpdate");
2100
2217
  endPostUpdate();
2101
2218
  }
2102
- if (BUILD12.method && BUILD12.lazyLoad) {
2219
+ if (BUILD13.method && BUILD13.lazyLoad) {
2103
2220
  hostRef.$onInstanceResolve$(elm);
2104
2221
  }
2105
- if (BUILD12.asyncLoading) {
2222
+ if (BUILD13.asyncLoading) {
2106
2223
  if (hostRef.$onRenderResolve$) {
2107
2224
  hostRef.$onRenderResolve$();
2108
2225
  hostRef.$onRenderResolve$ = void 0;
@@ -2114,7 +2231,7 @@ var postUpdateComponent = (hostRef) => {
2114
2231
  }
2115
2232
  };
2116
2233
  var forceUpdate = (ref) => {
2117
- if (BUILD12.updatable && (Build.isBrowser || Build.isTesting)) {
2234
+ if (BUILD13.updatable && (Build.isBrowser || Build.isTesting)) {
2118
2235
  const hostRef = getHostRef(ref);
2119
2236
  const isConnected = hostRef.$hostElement$.isConnected;
2120
2237
  if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
@@ -2125,14 +2242,14 @@ var forceUpdate = (ref) => {
2125
2242
  return false;
2126
2243
  };
2127
2244
  var appDidLoad = (who) => {
2128
- if (BUILD12.cssAnnotations) {
2245
+ if (BUILD13.cssAnnotations) {
2129
2246
  addHydratedFlag(doc.documentElement);
2130
2247
  }
2131
- if (BUILD12.asyncQueue) {
2248
+ if (BUILD13.asyncQueue) {
2132
2249
  plt.$flags$ |= 2 /* appLoaded */;
2133
2250
  }
2134
2251
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
2135
- if (BUILD12.profile && performance.measure) {
2252
+ if (BUILD13.profile && performance.measure) {
2136
2253
  performance.measure(`[Rindo] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
2137
2254
  }
2138
2255
  };
@@ -2147,7 +2264,7 @@ var safeCall = (instance, method, arg) => {
2147
2264
  return void 0;
2148
2265
  };
2149
2266
  var emitLifecycleEvent = (elm, lifecycleName) => {
2150
- if (BUILD12.lifecycleDOMEvents) {
2267
+ if (BUILD13.lifecycleDOMEvents) {
2151
2268
  emitEvent(elm, "rindo_" + lifecycleName, {
2152
2269
  bubbles: true,
2153
2270
  composed: true,
@@ -2159,7 +2276,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
2159
2276
  };
2160
2277
  var addHydratedFlag = (elm) => {
2161
2278
  var _a, _b;
2162
- return BUILD12.hydratedClass ? elm.classList.add((_a = BUILD12.hydratedSelectorName) != null ? _a : "hydrated") : BUILD12.hydratedAttribute ? elm.setAttribute((_b = BUILD12.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
2279
+ return BUILD13.hydratedClass ? elm.classList.add((_a = BUILD13.hydratedSelectorName) != null ? _a : "hydrated") : BUILD13.hydratedAttribute ? elm.setAttribute((_b = BUILD13.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
2163
2280
  };
2164
2281
  var serverSideConnected = (elm) => {
2165
2282
  const children = elm.children;
@@ -2178,21 +2295,21 @@ var serverSideConnected = (elm) => {
2178
2295
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2179
2296
  var setValue = (ref, propName, newVal, cmpMeta) => {
2180
2297
  const hostRef = getHostRef(ref);
2181
- if (BUILD13.lazyLoad && !hostRef) {
2298
+ if (BUILD14.lazyLoad && !hostRef) {
2182
2299
  throw new Error(
2183
2300
  `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.`
2184
2301
  );
2185
2302
  }
2186
- const elm = BUILD13.lazyLoad ? hostRef.$hostElement$ : ref;
2303
+ const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : ref;
2187
2304
  const oldVal = hostRef.$instanceValues$.get(propName);
2188
2305
  const flags = hostRef.$flags$;
2189
- const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
2306
+ const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
2190
2307
  newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
2191
2308
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2192
2309
  const didValueChange = newVal !== oldVal && !areBothNaN;
2193
- if ((!BUILD13.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2310
+ if ((!BUILD14.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2194
2311
  hostRef.$instanceValues$.set(propName, newVal);
2195
- if (BUILD13.isDev) {
2312
+ if (BUILD14.isDev) {
2196
2313
  if (hostRef.$flags$ & 1024 /* devOnRender */) {
2197
2314
  consoleDevWarn(
2198
2315
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
@@ -2215,8 +2332,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2215
2332
  );
2216
2333
  }
2217
2334
  }
2218
- if (!BUILD13.lazyLoad || instance) {
2219
- if (BUILD13.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
2335
+ if (!BUILD14.lazyLoad || instance) {
2336
+ if (BUILD14.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
2220
2337
  const watchMethods = cmpMeta.$watchers$[propName];
2221
2338
  if (watchMethods) {
2222
2339
  watchMethods.map((watchMethodName) => {
@@ -2228,8 +2345,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2228
2345
  });
2229
2346
  }
2230
2347
  }
2231
- if (BUILD13.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2232
- if (BUILD13.cmpShouldUpdate && instance.componentShouldUpdate) {
2348
+ if (BUILD14.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2349
+ if (BUILD14.cmpShouldUpdate && instance.componentShouldUpdate) {
2233
2350
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
2234
2351
  return;
2235
2352
  }
@@ -2244,40 +2361,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2244
2361
  var proxyComponent = (Cstr, cmpMeta, flags) => {
2245
2362
  var _a, _b;
2246
2363
  const prototype = Cstr.prototype;
2247
- if (BUILD14.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
2364
+ if (BUILD15.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
2248
2365
  FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
2249
2366
  const originalFormAssociatedCallback = prototype[cbName];
2250
2367
  Object.defineProperty(prototype, cbName, {
2251
2368
  value(...args) {
2252
2369
  const hostRef = getHostRef(this);
2253
- const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : this;
2370
+ const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : this;
2254
2371
  if (!instance) {
2255
2372
  hostRef.$onReadyPromise$.then((asyncInstance) => {
2256
2373
  const cb = asyncInstance[cbName];
2257
2374
  typeof cb === "function" && cb.call(asyncInstance, ...args);
2258
2375
  });
2259
2376
  } else {
2260
- const cb = BUILD14.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
2377
+ const cb = BUILD15.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
2261
2378
  typeof cb === "function" && cb.call(instance, ...args);
2262
2379
  }
2263
2380
  }
2264
2381
  });
2265
2382
  });
2266
2383
  }
2267
- if (BUILD14.member && cmpMeta.$members$ || BUILD14.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
2268
- if (BUILD14.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
2384
+ if (BUILD15.member && cmpMeta.$members$ || BUILD15.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
2385
+ if (BUILD15.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
2269
2386
  cmpMeta.$watchers$ = Cstr.watchers;
2270
2387
  }
2271
2388
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
2272
2389
  members.map(([memberName, [memberFlags]]) => {
2273
- if ((BUILD14.prop || BUILD14.state) && (memberFlags & 31 /* Prop */ || (!BUILD14.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2390
+ if ((BUILD15.prop || BUILD15.state) && (memberFlags & 31 /* Prop */ || (!BUILD15.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2274
2391
  if ((memberFlags & 2048 /* Getter */) === 0) {
2275
2392
  Object.defineProperty(prototype, memberName, {
2276
2393
  get() {
2277
2394
  return getValue(this, memberName);
2278
2395
  },
2279
2396
  set(newValue) {
2280
- if (BUILD14.isDev) {
2397
+ if (BUILD15.isDev) {
2281
2398
  const ref = getHostRef(this);
2282
2399
  if (
2283
2400
  // we are proxying the instance (not element)
@@ -2298,11 +2415,11 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
2298
2415
  enumerable: true
2299
2416
  });
2300
2417
  } else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
2301
- if (BUILD14.lazyLoad) {
2418
+ if (BUILD15.lazyLoad) {
2302
2419
  Object.defineProperty(prototype, memberName, {
2303
2420
  get() {
2304
2421
  const ref = getHostRef(this);
2305
- const instance = BUILD14.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
2422
+ const instance = BUILD15.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
2306
2423
  if (!instance) return;
2307
2424
  return instance[memberName];
2308
2425
  },
@@ -2342,7 +2459,7 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
2342
2459
  });
2343
2460
  }
2344
2461
  }
2345
- } else if (BUILD14.lazyLoad && BUILD14.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2462
+ } else if (BUILD15.lazyLoad && BUILD15.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2346
2463
  Object.defineProperty(prototype, memberName, {
2347
2464
  value(...args) {
2348
2465
  var _a2;
@@ -2355,13 +2472,13 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
2355
2472
  });
2356
2473
  }
2357
2474
  });
2358
- if (BUILD14.observeAttribute && (!BUILD14.lazyLoad || flags & 1 /* isElementConstructor */)) {
2475
+ if (BUILD15.observeAttribute && (!BUILD15.lazyLoad || flags & 1 /* isElementConstructor */)) {
2359
2476
  const attrNameToPropName = /* @__PURE__ */ new Map();
2360
2477
  prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
2361
2478
  plt.jmp(() => {
2362
2479
  var _a2;
2363
2480
  const propName = attrNameToPropName.get(attrName);
2364
- if (this.hasOwnProperty(propName)) {
2481
+ if (this.hasOwnProperty(propName) && BUILD15.lazyLoad) {
2365
2482
  newValue = this[propName];
2366
2483
  delete this[propName];
2367
2484
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -2371,8 +2488,8 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
2371
2488
  const hostRef = getHostRef(this);
2372
2489
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
2373
2490
  if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
2374
- const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : this;
2375
- const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
2491
+ const elm = BUILD15.lazyLoad ? hostRef.$hostElement$ : this;
2492
+ const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : elm;
2376
2493
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
2377
2494
  entry == null ? void 0 : entry.forEach((callbackName) => {
2378
2495
  if (instance[callbackName] != null) {
@@ -2395,7 +2512,7 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
2395
2512
  var _a2;
2396
2513
  const attrName = m[1] || propName;
2397
2514
  attrNameToPropName.set(attrName, propName);
2398
- if (BUILD14.reflect && m[0] & 512 /* ReflectAttr */) {
2515
+ if (BUILD15.reflect && m[0] & 512 /* ReflectAttr */) {
2399
2516
  (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
2400
2517
  }
2401
2518
  return attrName;
@@ -2413,7 +2530,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2413
2530
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
2414
2531
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
2415
2532
  const bundleId = cmpMeta.$lazyBundleId$;
2416
- if ((BUILD15.lazyLoad || BUILD15.hydrateClientSide) && bundleId) {
2533
+ if ((BUILD16.lazyLoad || BUILD16.hydrateClientSide) && bundleId) {
2417
2534
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
2418
2535
  if (CstrImport && "then" in CstrImport) {
2419
2536
  const endLoad = uniqueTime(
@@ -2428,15 +2545,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2428
2545
  if (!Cstr) {
2429
2546
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
2430
2547
  }
2431
- if (BUILD15.member && !Cstr.isProxied) {
2432
- if (BUILD15.watchCallback) {
2548
+ if (BUILD16.member && !Cstr.isProxied) {
2549
+ if (BUILD16.watchCallback) {
2433
2550
  cmpMeta.$watchers$ = Cstr.watchers;
2434
2551
  }
2435
2552
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
2436
2553
  Cstr.isProxied = true;
2437
2554
  }
2438
2555
  const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
2439
- if (BUILD15.member) {
2556
+ if (BUILD16.member) {
2440
2557
  hostRef.$flags$ |= 8 /* isConstructingInstance */;
2441
2558
  }
2442
2559
  try {
@@ -2444,10 +2561,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2444
2561
  } catch (e) {
2445
2562
  consoleError(e);
2446
2563
  }
2447
- if (BUILD15.member) {
2564
+ if (BUILD16.member) {
2448
2565
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
2449
2566
  }
2450
- if (BUILD15.watchCallback) {
2567
+ if (BUILD16.watchCallback) {
2451
2568
  hostRef.$flags$ |= 128 /* isWatchReady */;
2452
2569
  }
2453
2570
  endNewInstance();
@@ -2457,24 +2574,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2457
2574
  const cmpTag = elm.localName;
2458
2575
  customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
2459
2576
  }
2460
- if (BUILD15.style && Cstr && Cstr.style) {
2577
+ if (BUILD16.style && Cstr && Cstr.style) {
2461
2578
  let style;
2462
2579
  if (typeof Cstr.style === "string") {
2463
2580
  style = Cstr.style;
2464
- } else if (BUILD15.mode && typeof Cstr.style !== "string") {
2581
+ } else if (BUILD16.mode && typeof Cstr.style !== "string") {
2465
2582
  hostRef.$modeName$ = computeMode(elm);
2466
2583
  if (hostRef.$modeName$) {
2467
2584
  style = Cstr.style[hostRef.$modeName$];
2468
2585
  }
2469
- if (BUILD15.hydrateServerSide && hostRef.$modeName$) {
2586
+ if (BUILD16.hydrateServerSide && hostRef.$modeName$) {
2470
2587
  elm.setAttribute("s-mode", hostRef.$modeName$);
2471
2588
  }
2472
2589
  }
2473
2590
  const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
2474
2591
  if (!styles.has(scopeId2)) {
2475
2592
  const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
2476
- if (!BUILD15.hydrateServerSide && BUILD15.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2477
- BUILD15.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2593
+ if (!BUILD16.hydrateServerSide && BUILD16.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2594
+ BUILD16.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2478
2595
  style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
2479
2596
  }
2480
2597
  registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
@@ -2484,14 +2601,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2484
2601
  }
2485
2602
  const ancestorComponent = hostRef.$ancestorComponent$;
2486
2603
  const schedule = () => scheduleUpdate(hostRef, true);
2487
- if (BUILD15.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2604
+ if (BUILD16.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2488
2605
  ancestorComponent["s-rc"].push(schedule);
2489
2606
  } else {
2490
2607
  schedule();
2491
2608
  }
2492
2609
  };
2493
2610
  var fireConnectedCallback = (instance) => {
2494
- if (BUILD15.lazyLoad && BUILD15.connectedCallback) {
2611
+ if (BUILD16.lazyLoad && BUILD16.connectedCallback) {
2495
2612
  safeCall(instance, "connectedCallback");
2496
2613
  }
2497
2614
  };
@@ -2502,41 +2619,41 @@ var connectedCallback = (elm) => {
2502
2619
  const hostRef = getHostRef(elm);
2503
2620
  const cmpMeta = hostRef.$cmpMeta$;
2504
2621
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
2505
- if (BUILD16.hostListenerTargetParent) {
2622
+ if (BUILD17.hostListenerTargetParent) {
2506
2623
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2507
2624
  }
2508
2625
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2509
2626
  hostRef.$flags$ |= 1 /* hasConnected */;
2510
2627
  let hostId;
2511
- if (BUILD16.hydrateClientSide) {
2628
+ if (BUILD17.hydrateClientSide) {
2512
2629
  hostId = elm.getAttribute(HYDRATE_ID);
2513
2630
  if (hostId) {
2514
- if (BUILD16.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2515
- const scopeId2 = BUILD16.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2631
+ if (BUILD17.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2632
+ const scopeId2 = BUILD17.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2516
2633
  elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
2517
- } else if (BUILD16.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2518
- const scopeId2 = getScopeId(cmpMeta, BUILD16.mode ? elm.getAttribute("s-mode") : void 0);
2634
+ } else if (BUILD17.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2635
+ const scopeId2 = getScopeId(cmpMeta, BUILD17.mode ? elm.getAttribute("s-mode") : void 0);
2519
2636
  elm["s-sc"] = scopeId2;
2520
2637
  }
2521
2638
  initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2522
2639
  }
2523
2640
  }
2524
- if (BUILD16.slotRelocation && !hostId) {
2525
- if (BUILD16.hydrateServerSide || (BUILD16.slot || BUILD16.shadowDom) && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2641
+ if (BUILD17.slotRelocation && !hostId) {
2642
+ if (BUILD17.hydrateServerSide || (BUILD17.slot || BUILD17.shadowDom) && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2526
2643
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
2527
2644
  setContentReference(elm);
2528
2645
  }
2529
2646
  }
2530
- if (BUILD16.asyncLoading) {
2647
+ if (BUILD17.asyncLoading) {
2531
2648
  let ancestorComponent = elm;
2532
2649
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
2533
- if (BUILD16.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2650
+ if (BUILD17.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2534
2651
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
2535
2652
  break;
2536
2653
  }
2537
2654
  }
2538
2655
  }
2539
- if (BUILD16.prop && !BUILD16.hydrateServerSide && cmpMeta.$members$) {
2656
+ if (BUILD17.prop && !BUILD17.hydrateServerSide && cmpMeta.$members$) {
2540
2657
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2541
2658
  if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
2542
2659
  const value = elm[memberName];
@@ -2545,7 +2662,7 @@ var connectedCallback = (elm) => {
2545
2662
  }
2546
2663
  });
2547
2664
  }
2548
- if (BUILD16.initializeNextTick) {
2665
+ if (BUILD17.initializeNextTick) {
2549
2666
  nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2550
2667
  } else {
2551
2668
  initializeComponent(elm, hostRef, cmpMeta);
@@ -2563,32 +2680,32 @@ var connectedCallback = (elm) => {
2563
2680
  };
2564
2681
  var setContentReference = (elm) => {
2565
2682
  const contentRefElm = elm["s-cr"] = doc.createComment(
2566
- BUILD16.isDebug ? `content-ref (host=${elm.localName})` : ""
2683
+ BUILD17.isDebug ? `content-ref (host=${elm.localName})` : ""
2567
2684
  );
2568
2685
  contentRefElm["s-cn"] = true;
2569
2686
  insertBefore(elm, contentRefElm, elm.firstChild);
2570
2687
  };
2571
2688
 
2572
2689
  // src/runtime/disconnected-callback.ts
2573
- import { BUILD as BUILD17 } from "@rindo/core/internal/app-data";
2690
+ import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
2574
2691
  var disconnectInstance = (instance) => {
2575
- if (BUILD17.lazyLoad && BUILD17.disconnectedCallback) {
2692
+ if (BUILD18.lazyLoad && BUILD18.disconnectedCallback) {
2576
2693
  safeCall(instance, "disconnectedCallback");
2577
2694
  }
2578
- if (BUILD17.cmpDidUnload) {
2695
+ if (BUILD18.cmpDidUnload) {
2579
2696
  safeCall(instance, "componentDidUnload");
2580
2697
  }
2581
2698
  };
2582
2699
  var disconnectedCallback = async (elm) => {
2583
2700
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2584
2701
  const hostRef = getHostRef(elm);
2585
- if (BUILD17.hostListener) {
2702
+ if (BUILD18.hostListener) {
2586
2703
  if (hostRef.$rmListeners$) {
2587
2704
  hostRef.$rmListeners$.map((rmListener) => rmListener());
2588
2705
  hostRef.$rmListeners$ = void 0;
2589
2706
  }
2590
2707
  }
2591
- if (!BUILD17.lazyLoad) {
2708
+ if (!BUILD18.lazyLoad) {
2592
2709
  disconnectInstance(elm);
2593
2710
  } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2594
2711
  disconnectInstance(hostRef.$lazyInstance$);
@@ -2596,6 +2713,12 @@ var disconnectedCallback = async (elm) => {
2596
2713
  hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2597
2714
  }
2598
2715
  }
2716
+ if (rootAppliedStyles.has(elm)) {
2717
+ rootAppliedStyles.delete(elm);
2718
+ }
2719
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
2720
+ rootAppliedStyles.delete(elm.shadowRoot);
2721
+ }
2599
2722
  };
2600
2723
 
2601
2724
  // src/runtime/bootstrap-custom-element.ts
@@ -2607,36 +2730,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2607
2730
  $flags$: compactMeta[0],
2608
2731
  $tagName$: compactMeta[1]
2609
2732
  };
2610
- if (BUILD18.member) {
2733
+ if (BUILD19.member) {
2611
2734
  cmpMeta.$members$ = compactMeta[2];
2612
2735
  }
2613
- if (BUILD18.hostListener) {
2736
+ if (BUILD19.hostListener) {
2614
2737
  cmpMeta.$listeners$ = compactMeta[3];
2615
2738
  }
2616
- if (BUILD18.watchCallback) {
2739
+ if (BUILD19.watchCallback) {
2617
2740
  cmpMeta.$watchers$ = Cstr.$watchers$;
2618
2741
  }
2619
- if (BUILD18.reflect) {
2742
+ if (BUILD19.reflect) {
2620
2743
  cmpMeta.$attrsToReflect$ = [];
2621
2744
  }
2622
- if (BUILD18.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2745
+ if (BUILD19.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2623
2746
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2624
2747
  }
2625
- if (BUILD18.experimentalSlotFixes) {
2626
- if (BUILD18.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2748
+ if (BUILD19.experimentalSlotFixes) {
2749
+ if (BUILD19.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2627
2750
  patchPseudoShadowDom(Cstr.prototype);
2628
2751
  }
2629
2752
  } else {
2630
- if (BUILD18.slotChildNodesFix) {
2753
+ if (BUILD19.slotChildNodesFix) {
2631
2754
  patchChildSlotNodes(Cstr.prototype);
2632
2755
  }
2633
- if (BUILD18.cloneNodeFix) {
2756
+ if (BUILD19.cloneNodeFix) {
2634
2757
  patchCloneNode(Cstr.prototype);
2635
2758
  }
2636
- if (BUILD18.appendChildSlotFix) {
2759
+ if (BUILD19.appendChildSlotFix) {
2637
2760
  patchSlotAppendChild(Cstr.prototype);
2638
2761
  }
2639
- if (BUILD18.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2762
+ if (BUILD19.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2640
2763
  patchTextContent(Cstr.prototype);
2641
2764
  }
2642
2765
  }
@@ -2654,20 +2777,30 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2654
2777
  this.__hasHostListenerAttached = true;
2655
2778
  }
2656
2779
  connectedCallback(this);
2657
- if (BUILD18.connectedCallback && originalConnectedCallback) {
2780
+ if (BUILD19.connectedCallback && originalConnectedCallback) {
2658
2781
  originalConnectedCallback.call(this);
2659
2782
  }
2660
2783
  },
2661
2784
  disconnectedCallback() {
2662
2785
  disconnectedCallback(this);
2663
- if (BUILD18.disconnectedCallback && originalDisconnectedCallback) {
2786
+ if (BUILD19.disconnectedCallback && originalDisconnectedCallback) {
2664
2787
  originalDisconnectedCallback.call(this);
2665
2788
  }
2789
+ plt.raf(() => {
2790
+ var _a;
2791
+ const hostRef = getHostRef(this);
2792
+ if (((_a = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
2793
+ delete hostRef.$vnode$;
2794
+ }
2795
+ if (this instanceof Node && !this.isConnected) {
2796
+ deleteHostRef(this);
2797
+ }
2798
+ });
2666
2799
  },
2667
2800
  __attachShadow() {
2668
2801
  if (supportsShadow) {
2669
2802
  if (!this.shadowRoot) {
2670
- if (BUILD18.shadowDelegatesFocus) {
2803
+ if (BUILD19.shadowDelegatesFocus) {
2671
2804
  this.attachShadow({
2672
2805
  mode: "open",
2673
2806
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
@@ -2691,7 +2824,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2691
2824
  return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
2692
2825
  };
2693
2826
  var forceModeUpdate = (elm) => {
2694
- if (BUILD18.style && BUILD18.mode && !BUILD18.lazyLoad) {
2827
+ if (BUILD19.style && BUILD19.mode && !BUILD19.lazyLoad) {
2695
2828
  const mode = computeMode(elm);
2696
2829
  const hostRef = getHostRef(elm);
2697
2830
  if (hostRef.$modeName$ !== mode) {
@@ -2714,7 +2847,7 @@ var forceModeUpdate = (elm) => {
2714
2847
  };
2715
2848
 
2716
2849
  // src/runtime/bootstrap-lazy.ts
2717
- import { BUILD as BUILD19 } from "@rindo/core/internal/app-data";
2850
+ import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
2718
2851
 
2719
2852
  // src/runtime/hmr-component.ts
2720
2853
  var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
@@ -2726,7 +2859,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
2726
2859
  // src/runtime/bootstrap-lazy.ts
2727
2860
  var bootstrapLazy = (lazyBundles, options = {}) => {
2728
2861
  var _a;
2729
- if (BUILD19.profile && performance.mark) {
2862
+ if (BUILD20.profile && performance.mark) {
2730
2863
  performance.mark("st:app:start");
2731
2864
  }
2732
2865
  installDevTools();
@@ -2742,12 +2875,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2742
2875
  let isBootstrapping = true;
2743
2876
  Object.assign(plt, options);
2744
2877
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
2745
- if (BUILD19.asyncQueue) {
2878
+ if (BUILD20.asyncQueue) {
2746
2879
  if (options.syncQueue) {
2747
2880
  plt.$flags$ |= 4 /* queueSync */;
2748
2881
  }
2749
2882
  }
2750
- if (BUILD19.hydrateClientSide) {
2883
+ if (BUILD20.hydrateClientSide) {
2751
2884
  plt.$flags$ |= 2 /* appLoaded */;
2752
2885
  }
2753
2886
  let hasSlotRelocation = false;
@@ -2763,22 +2896,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2763
2896
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2764
2897
  hasSlotRelocation = true;
2765
2898
  }
2766
- if (BUILD19.member) {
2899
+ if (BUILD20.member) {
2767
2900
  cmpMeta.$members$ = compactMeta[2];
2768
2901
  }
2769
- if (BUILD19.hostListener) {
2902
+ if (BUILD20.hostListener) {
2770
2903
  cmpMeta.$listeners$ = compactMeta[3];
2771
2904
  }
2772
- if (BUILD19.reflect) {
2905
+ if (BUILD20.reflect) {
2773
2906
  cmpMeta.$attrsToReflect$ = [];
2774
2907
  }
2775
- if (BUILD19.watchCallback) {
2908
+ if (BUILD20.watchCallback) {
2776
2909
  cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
2777
2910
  }
2778
- if (BUILD19.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2911
+ if (BUILD20.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2779
2912
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2780
2913
  }
2781
- const tagName = BUILD19.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2914
+ const tagName = BUILD20.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2782
2915
  const HostElement = class extends HTMLElement {
2783
2916
  // RindoLazyHost
2784
2917
  constructor(self) {
@@ -2786,10 +2919,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2786
2919
  this.hasRegisteredEventListeners = false;
2787
2920
  self = this;
2788
2921
  registerHost(self, cmpMeta);
2789
- if (BUILD19.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2922
+ if (BUILD20.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2790
2923
  if (supportsShadow) {
2791
2924
  if (!self.shadowRoot) {
2792
- if (BUILD19.shadowDelegatesFocus) {
2925
+ if (BUILD20.shadowDelegatesFocus) {
2793
2926
  self.attachShadow({
2794
2927
  mode: "open",
2795
2928
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
@@ -2804,7 +2937,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2804
2937
  );
2805
2938
  }
2806
2939
  }
2807
- } else if (!BUILD19.hydrateServerSide && !("shadowRoot" in self)) {
2940
+ } else if (!BUILD20.hydrateServerSide && !("shadowRoot" in self)) {
2808
2941
  self.shadowRoot = self;
2809
2942
  }
2810
2943
  }
@@ -2827,33 +2960,40 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2827
2960
  }
2828
2961
  disconnectedCallback() {
2829
2962
  plt.jmp(() => disconnectedCallback(this));
2963
+ plt.raf(() => {
2964
+ var _a3;
2965
+ const hostRef = getHostRef(this);
2966
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
2967
+ delete hostRef.$vnode$.$elm$;
2968
+ }
2969
+ });
2830
2970
  }
2831
2971
  componentOnReady() {
2832
2972
  return getHostRef(this).$onReadyPromise$;
2833
2973
  }
2834
2974
  };
2835
- if (BUILD19.experimentalSlotFixes) {
2836
- if (BUILD19.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2975
+ if (BUILD20.experimentalSlotFixes) {
2976
+ if (BUILD20.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2837
2977
  patchPseudoShadowDom(HostElement.prototype);
2838
2978
  }
2839
2979
  } else {
2840
- if (BUILD19.slotChildNodesFix) {
2980
+ if (BUILD20.slotChildNodesFix) {
2841
2981
  patchChildSlotNodes(HostElement.prototype);
2842
2982
  }
2843
- if (BUILD19.cloneNodeFix) {
2983
+ if (BUILD20.cloneNodeFix) {
2844
2984
  patchCloneNode(HostElement.prototype);
2845
2985
  }
2846
- if (BUILD19.appendChildSlotFix) {
2986
+ if (BUILD20.appendChildSlotFix) {
2847
2987
  patchSlotAppendChild(HostElement.prototype);
2848
2988
  }
2849
- if (BUILD19.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2989
+ if (BUILD20.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2850
2990
  patchTextContent(HostElement.prototype);
2851
2991
  }
2852
2992
  }
2853
- if (BUILD19.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2993
+ if (BUILD20.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2854
2994
  HostElement.formAssociated = true;
2855
2995
  }
2856
- if (BUILD19.hotModuleReplacement) {
2996
+ if (BUILD20.hotModuleReplacement) {
2857
2997
  HostElement.prototype["s-hmr"] = function(hmrVersionId) {
2858
2998
  hmrStart(this, cmpMeta, hmrVersionId);
2859
2999
  };
@@ -2872,7 +3012,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2872
3012
  if (hasSlotRelocation) {
2873
3013
  dataStyles.textContent += SLOT_FB_CSS;
2874
3014
  }
2875
- if (BUILD19.invisiblePrehydration && (BUILD19.hydratedClass || BUILD19.hydratedAttribute)) {
3015
+ if (BUILD20.invisiblePrehydration && (BUILD20.hydratedClass || BUILD20.hydratedAttribute)) {
2876
3016
  dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
2877
3017
  }
2878
3018
  if (dataStyles.innerHTML.length) {
@@ -2888,7 +3028,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2888
3028
  if (deferredConnectedCallbacks.length) {
2889
3029
  deferredConnectedCallbacks.map((host) => host.connectedCallback());
2890
3030
  } else {
2891
- if (BUILD19.profile) {
3031
+ if (BUILD20.profile) {
2892
3032
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
2893
3033
  } else {
2894
3034
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
@@ -2901,10 +3041,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2901
3041
  var Fragment = (_, children) => children;
2902
3042
 
2903
3043
  // src/runtime/host-listener.ts
2904
- import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
3044
+ import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
2905
3045
  var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2906
- if (BUILD20.hostListener && listeners) {
2907
- if (BUILD20.hostListenerTargetParent) {
3046
+ if (BUILD21.hostListener && listeners) {
3047
+ if (BUILD21.hostListenerTargetParent) {
2908
3048
  if (attachParentListeners) {
2909
3049
  listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
2910
3050
  } else {
@@ -2912,7 +3052,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2912
3052
  }
2913
3053
  }
2914
3054
  listeners.map(([flags, name, method]) => {
2915
- const target = BUILD20.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
3055
+ const target = BUILD21.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
2916
3056
  const handler = hostListenerProxy(hostRef, method);
2917
3057
  const opts = hostListenerOpts(flags);
2918
3058
  plt.ael(target, name, handler, opts);
@@ -2923,7 +3063,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2923
3063
  var hostListenerProxy = (hostRef, methodName) => (ev) => {
2924
3064
  var _a;
2925
3065
  try {
2926
- if (BUILD20.lazyLoad) {
3066
+ if (BUILD21.lazyLoad) {
2927
3067
  if (hostRef.$flags$ & 256 /* isListenReady */) {
2928
3068
  (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2929
3069
  } else {
@@ -2937,10 +3077,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
2937
3077
  }
2938
3078
  };
2939
3079
  var getHostListenerTarget = (elm, flags) => {
2940
- if (BUILD20.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2941
- if (BUILD20.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2942
- if (BUILD20.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2943
- if (BUILD20.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
3080
+ if (BUILD21.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
3081
+ if (BUILD21.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
3082
+ if (BUILD21.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
3083
+ if (BUILD21.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2944
3084
  return elm.parentElement;
2945
3085
  return elm;
2946
3086
  };
@@ -3118,7 +3258,7 @@ var hAsync = (nodeName, vnodeData, ...children) => {
3118
3258
  import { globalScripts } from "@rindo/core/internal/app-globals";
3119
3259
 
3120
3260
  // src/hydrate/platform/proxy-host-element.ts
3121
- import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
3261
+ import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
3122
3262
  function proxyHostElement(elm, cmpMeta) {
3123
3263
  if (typeof elm.componentOnReady !== "function") {
3124
3264
  elm.componentOnReady = componentOnReady;
@@ -3127,7 +3267,7 @@ function proxyHostElement(elm, cmpMeta) {
3127
3267
  elm.forceUpdate = forceUpdate2;
3128
3268
  }
3129
3269
  if (!elm.shadowRoot && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
3130
- if (BUILD21.shadowDelegatesFocus) {
3270
+ if (BUILD22.shadowDelegatesFocus) {
3131
3271
  elm.attachShadow({
3132
3272
  mode: "open",
3133
3273
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
@@ -3441,7 +3581,7 @@ function waitingOnElementsMsg(waitingElements) {
3441
3581
  }
3442
3582
 
3443
3583
  // src/hydrate/platform/index.ts
3444
- import { BUILD as BUILD23, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
3584
+ import { BUILD as BUILD24, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
3445
3585
  var customError;
3446
3586
  var cmpModules = /* @__PURE__ */ new Map();
3447
3587
  var getModule = (tagName) => {
@@ -3527,11 +3667,12 @@ var plt = {
3527
3667
  var setPlatformHelpers = (helpers) => {
3528
3668
  Object.assign(plt, helpers);
3529
3669
  };
3530
- var supportsShadow = BUILD22.shadowDom;
3670
+ var supportsShadow = BUILD23.shadowDom;
3531
3671
  var supportsListenerOptions = false;
3532
3672
  var supportsConstructableStylesheets = false;
3533
3673
  var hostRefs = /* @__PURE__ */ new WeakMap();
3534
3674
  var getHostRef = (ref) => hostRefs.get(ref);
3675
+ var deleteHostRef = (ref) => hostRefs.delete(ref);
3535
3676
  var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
3536
3677
  var registerHost = (elm, cmpMeta) => {
3537
3678
  const hostRef = {
@@ -3556,7 +3697,7 @@ var Build = {
3556
3697
  var styles = /* @__PURE__ */ new Map();
3557
3698
  var modeResolutionChain = [];
3558
3699
  export {
3559
- BUILD23 as BUILD,
3700
+ BUILD24 as BUILD,
3560
3701
  Build,
3561
3702
  Env,
3562
3703
  Fragment,
@@ -3572,6 +3713,7 @@ export {
3572
3713
  consoleError,
3573
3714
  createEvent,
3574
3715
  defineCustomElement,
3716
+ deleteHostRef,
3575
3717
  disconnectedCallback,
3576
3718
  doc,
3577
3719
  forceModeUpdate,