@qwik.dev/core 2.0.0-alpha.4 → 2.0.0-alpha.6

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,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/testing 2.0.0-alpha.4-dev+374e0d6
3
+ * @qwik.dev/core/testing 2.0.0-alpha.6-dev+d848ba5
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -22309,7 +22309,7 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
22309
22309
  // 30
22310
22310
  "QRLs can not be dynamically resolved, because it does not have a chunk path",
22311
22311
  // 31
22312
- "The JSX ref attribute must be a Signal",
22312
+ "{{0}}\nThe JSX ref attribute must be a Signal",
22313
22313
  // 32
22314
22314
  "Serialization Error: Deserialization of data type {{0}} is not implemented",
22315
22315
  // 33
@@ -22325,7 +22325,7 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
22325
22325
  // 38
22326
22326
  "Serialization Error: Missing QRL chunk for {{0}}",
22327
22327
  // 39
22328
- "The value of the textarea must be a string",
22328
+ "{{0}}\nThe value of the textarea must be a string found {{1}}",
22329
22329
  // 40
22330
22330
  "Unable to find q:container",
22331
22331
  // 41
@@ -22335,8 +22335,6 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
22335
22335
  // 43
22336
22336
  "Materialize error: missing element: {{0}} {{1}} {{2}}",
22337
22337
  // 44
22338
- "SsrError: {{0}}",
22339
- // 45
22340
22338
  "Cannot coerce a Signal, use `.value` instead",
22341
22339
  // 46
22342
22340
  "useComputedSignal$ QRL {{0}} {{1}} returned a Promise",
@@ -22372,6 +22370,106 @@ var qError = (code2, errorMessageArgs = []) => {
22372
22370
 
22373
22371
  // packages/qwik/src/core/shared/platform/platform.ts
22374
22372
  var import_build = require("@qwik.dev/core/build");
22373
+
22374
+ // packages/qwik/src/core/shared/types.ts
22375
+ var DEBUG_TYPE = "q:type";
22376
+ var START = "\x1B[34m";
22377
+ var END = "\x1B[0m";
22378
+ var VirtualTypeName = {
22379
+ ["V" /* Virtual */]: (
22380
+ /* ********* */
22381
+ START + "Virtual" + END
22382
+ ),
22383
+ //
22384
+ ["F" /* Fragment */]: (
22385
+ /* ******** */
22386
+ START + "Fragment" + END
22387
+ ),
22388
+ //
22389
+ ["S" /* WrappedSignal */]: (
22390
+ /* *** */
22391
+ START + "Signal" + END
22392
+ ),
22393
+ //
22394
+ ["A" /* Awaited */]: (
22395
+ /* ********* */
22396
+ START + "Awaited" + END
22397
+ ),
22398
+ //
22399
+ ["C" /* Component */]: (
22400
+ /* ******* */
22401
+ START + "Component" + END
22402
+ ),
22403
+ //
22404
+ ["I" /* InlineComponent */]: (
22405
+ /* * */
22406
+ START + "InlineComponent" + END
22407
+ ),
22408
+ //
22409
+ ["P" /* Projection */]: (
22410
+ /* ****** */
22411
+ START + "Projection" + END
22412
+ )
22413
+ //
22414
+ };
22415
+
22416
+ // packages/qwik/src/core/shared/utils/markers.ts
22417
+ var OnRenderProp = "q:renderFn";
22418
+ var ComponentStylesPrefixContent = "\u2B50\uFE0F";
22419
+ var QSlot = "q:slot";
22420
+ var QSlotParent = ":";
22421
+ var QSlotRef = "q:sref";
22422
+ var QSlotS = "q:s";
22423
+ var QStyle = "q:style";
22424
+ var QStyleSelector = "style[q\\:style]";
22425
+ var QStyleSSelector = "style[q\\:sstyle]";
22426
+ var QStylesAllSelector = QStyleSelector + "," + QStyleSSelector;
22427
+ var QScopedStyle = "q:sstyle";
22428
+ var QCtxAttr = "q:ctx";
22429
+ var QSubscribers = "q:subs";
22430
+ var QFuncsPrefix = "qFuncs_";
22431
+ var getQFuncs = (document2, hash3) => {
22432
+ return document2[QFuncsPrefix + hash3] || [];
22433
+ };
22434
+ var QRenderAttr = "q:render";
22435
+ var QRuntimeAttr = "q:runtime";
22436
+ var QVersionAttr = "q:version";
22437
+ var QBaseAttr = "q:base";
22438
+ var QLocaleAttr = "q:locale";
22439
+ var QManifestHashAttr = "q:manifest-hash";
22440
+ var QInstanceAttr = "q:instance";
22441
+ var QContainerIsland = "q:container-island";
22442
+ var QContainerIslandEnd = "/" + QContainerIsland;
22443
+ var QIgnore = "q:ignore";
22444
+ var QIgnoreEnd = "/" + QIgnore;
22445
+ var QContainerAttr = "q:container";
22446
+ var QContainerAttrEnd = "/" + QContainerAttr;
22447
+ var QTemplate = "q:template";
22448
+ var QContainerSelector = "[q\\:container]:not([q\\:container=" + "html" /* HTML */ + "]):not([q\\:container=" + "text" /* TEXT */ + "])";
22449
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
22450
+ var SVG_NS = "http://www.w3.org/2000/svg";
22451
+ var MATH_NS = "http://www.w3.org/1998/Math/MathML";
22452
+ var ResourceEvent = "qResource";
22453
+ var RenderEvent = "qRender";
22454
+ var TaskEvent = "qTask";
22455
+ var QDefaultSlot = "";
22456
+ var ELEMENT_ID = "q:id";
22457
+ var ELEMENT_KEY = "q:key";
22458
+ var ELEMENT_PROPS = "q:props";
22459
+ var ELEMENT_SEQ = "q:seq";
22460
+ var ELEMENT_SEQ_IDX = "q:seqIdx";
22461
+ var Q_PREFIX = "q:";
22462
+ var NON_SERIALIZABLE_MARKER_PREFIX = ":";
22463
+ var USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + "on";
22464
+ var USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + "onIdx";
22465
+ var USE_ON_LOCAL_FLAGS = NON_SERIALIZABLE_MARKER_PREFIX + "onFlags";
22466
+ var FLUSH_COMMENT = "qkssr-f";
22467
+ var STREAM_BLOCK_START_COMMENT = "qkssr-pu";
22468
+ var STREAM_BLOCK_END_COMMENT = "qkssr-po";
22469
+ var Q_PROPS_SEPARATOR = ":";
22470
+ var dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
22471
+
22472
+ // packages/qwik/src/core/shared/platform/platform.ts
22375
22473
  var createPlatform = () => {
22376
22474
  return {
22377
22475
  isServer: import_build.isServer,
@@ -22422,7 +22520,7 @@ var createPlatform = () => {
22422
22520
  };
22423
22521
  var toUrl = (doc, containerEl, url) => {
22424
22522
  const baseURI = doc.baseURI;
22425
- const base = new URL(containerEl.getAttribute("q:base") ?? baseURI, baseURI);
22523
+ const base = new URL(containerEl.getAttribute(QBaseAttr) ?? baseURI, baseURI);
22426
22524
  return new URL(url, base);
22427
22525
  };
22428
22526
  var _platform = /* @__PURE__ */ createPlatform();
@@ -22477,13 +22575,20 @@ var delay = (timeout) => {
22477
22575
  });
22478
22576
  };
22479
22577
  function retryOnPromise(fn, retryCount = 0) {
22480
- try {
22481
- return fn();
22482
- } catch (e) {
22578
+ const retryOrThrow = (e) => {
22483
22579
  if (isPromise(e) && retryCount < MAX_RETRY_ON_PROMISE_COUNT) {
22484
22580
  return e.then(retryOnPromise.bind(null, fn, retryCount++));
22485
22581
  }
22486
22582
  throw e;
22583
+ };
22584
+ try {
22585
+ const result = fn();
22586
+ if (isPromise(result)) {
22587
+ return result.catch((e) => retryOrThrow(e));
22588
+ }
22589
+ return result;
22590
+ } catch (e) {
22591
+ return retryOrThrow(e);
22487
22592
  }
22488
22593
  }
22489
22594
 
@@ -22508,104 +22613,6 @@ var isFunction = (v) => {
22508
22613
  // packages/qwik/src/build/index.dev.ts
22509
22614
  var isDev = true;
22510
22615
 
22511
- // packages/qwik/src/core/shared/types.ts
22512
- var DEBUG_TYPE = "q:type";
22513
- var START = "\x1B[34m";
22514
- var END = "\x1B[0m";
22515
- var VirtualTypeName = {
22516
- ["V" /* Virtual */]: (
22517
- /* ********* */
22518
- START + "Virtual" + END
22519
- ),
22520
- //
22521
- ["F" /* Fragment */]: (
22522
- /* ******** */
22523
- START + "Fragment" + END
22524
- ),
22525
- //
22526
- ["S" /* WrappedSignal */]: (
22527
- /* *** */
22528
- START + "Signal" + END
22529
- ),
22530
- //
22531
- ["A" /* Awaited */]: (
22532
- /* ********* */
22533
- START + "Awaited" + END
22534
- ),
22535
- //
22536
- ["C" /* Component */]: (
22537
- /* ******* */
22538
- START + "Component" + END
22539
- ),
22540
- //
22541
- ["I" /* InlineComponent */]: (
22542
- /* * */
22543
- START + "InlineComponent" + END
22544
- ),
22545
- //
22546
- ["P" /* Projection */]: (
22547
- /* ****** */
22548
- START + "Projection" + END
22549
- )
22550
- //
22551
- };
22552
-
22553
- // packages/qwik/src/core/shared/utils/markers.ts
22554
- var OnRenderProp = "q:renderFn";
22555
- var ComponentStylesPrefixContent = "\u2B50\uFE0F";
22556
- var QSlot = "q:slot";
22557
- var QSlotParent = ":";
22558
- var QSlotRef = "q:sref";
22559
- var QSlotS = "q:s";
22560
- var QStyle = "q:style";
22561
- var QStyleSelector = "style[q\\:style]";
22562
- var QStyleSSelector = "style[q\\:sstyle]";
22563
- var QStylesAllSelector = QStyleSelector + "," + QStyleSSelector;
22564
- var QScopedStyle = "q:sstyle";
22565
- var QCtxAttr = "q:ctx";
22566
- var QSubscribers = "q:subs";
22567
- var QFuncsPrefix = "qFuncs_";
22568
- var getQFuncs = (document2, hash3) => {
22569
- return document2[QFuncsPrefix + hash3] || [];
22570
- };
22571
- var QRenderAttr = "q:render";
22572
- var QRuntimeAttr = "q:runtime";
22573
- var QVersionAttr = "q:version";
22574
- var QBaseAttr = "q:base";
22575
- var QLocaleAttr = "q:locale";
22576
- var QManifestHashAttr = "q:manifest-hash";
22577
- var QInstanceAttr = "q:instance";
22578
- var QContainerIsland = "q:container-island";
22579
- var QContainerIslandEnd = "/" + QContainerIsland;
22580
- var QIgnore = "q:ignore";
22581
- var QIgnoreEnd = "/" + QIgnore;
22582
- var QContainerAttr = "q:container";
22583
- var QContainerAttrEnd = "/" + QContainerAttr;
22584
- var QTemplate = "q:template";
22585
- var QContainerSelector = "[q\\:container]:not([q\\:container=" + "html" /* HTML */ + "]):not([q\\:container=" + "text" /* TEXT */ + "])";
22586
- var HTML_NS = "http://www.w3.org/1999/xhtml";
22587
- var SVG_NS = "http://www.w3.org/2000/svg";
22588
- var MATH_NS = "http://www.w3.org/1998/Math/MathML";
22589
- var ResourceEvent = "qResource";
22590
- var RenderEvent = "qRender";
22591
- var TaskEvent = "qTask";
22592
- var QDefaultSlot = "";
22593
- var ELEMENT_ID = "q:id";
22594
- var ELEMENT_KEY = "q:key";
22595
- var ELEMENT_PROPS = "q:props";
22596
- var ELEMENT_SEQ = "q:seq";
22597
- var ELEMENT_SEQ_IDX = "q:seqIdx";
22598
- var Q_PREFIX = "q:";
22599
- var NON_SERIALIZABLE_MARKER_PREFIX = ":";
22600
- var USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + "on";
22601
- var USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + "onIdx";
22602
- var USE_ON_LOCAL_FLAGS = NON_SERIALIZABLE_MARKER_PREFIX + "onFlags";
22603
- var FLUSH_COMMENT = "qkssr-f";
22604
- var STREAM_BLOCK_START_COMMENT = "qkssr-pu";
22605
- var STREAM_BLOCK_END_COMMENT = "qkssr-po";
22606
- var Q_PROPS_SEPARATOR = ":";
22607
- var dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
22608
-
22609
22616
  // packages/qwik/src/core/use/use-locale.ts
22610
22617
  var _locale = void 0;
22611
22618
  function setLocale(locale) {
@@ -23058,7 +23065,6 @@ var StoreHandler = class {
23058
23065
  }
23059
23066
  /** In the case of oldValue and value are the same, the effects are not triggered. */
23060
23067
  set(target, prop, value) {
23061
- target = unwrapDeserializerProxy(target);
23062
23068
  if (typeof prop === "symbol") {
23063
23069
  target[prop] = value;
23064
23070
  return true;
@@ -23126,6 +23132,11 @@ function addEffect(target, prop, store, effectSubscriber) {
23126
23132
  const effects = Object.prototype.hasOwnProperty.call(effectsMap, prop) && effectsMap[prop] || (effectsMap[prop] = []);
23127
23133
  ensureContainsEffect(effects, effectSubscriber);
23128
23134
  ensureContains(effectSubscriber, target);
23135
+ ensureEffectContainsSubscriber(
23136
+ effectSubscriber[0 /* EFFECT */],
23137
+ target,
23138
+ store.$container$
23139
+ );
23129
23140
  DEBUG && log("sub", pad("\n" + store.$effects$.toString(), " "));
23130
23141
  }
23131
23142
  function setNewValueAndTriggerEffects(prop, value, target, currentStore) {
@@ -23195,32 +23206,39 @@ function clearVNodeEffectDependencies(container, value) {
23195
23206
  }
23196
23207
  for (let i = effects.length - 1; i >= 0; i--) {
23197
23208
  const subscriber = effects[i];
23198
- const subscriptionRemoved = clearEffects(subscriber, value);
23199
- if (subscriptionRemoved) {
23200
- effects.splice(i, 1);
23201
- }
23209
+ clearEffects(subscriber, value, effects, i, container);
23210
+ }
23211
+ if (effects.length === 0) {
23212
+ vnode_setProp(value, QSubscribers, null);
23202
23213
  }
23203
23214
  }
23204
- function clearSubscriberEffectDependencies(value) {
23215
+ function clearSubscriberEffectDependencies(container, value) {
23205
23216
  if (value.$effectDependencies$) {
23206
23217
  for (let i = value.$effectDependencies$.length - 1; i >= 0; i--) {
23207
23218
  const subscriber = value.$effectDependencies$[i];
23208
- const subscriptionRemoved = clearEffects(subscriber, value);
23209
- if (subscriptionRemoved) {
23210
- value.$effectDependencies$.splice(i, 1);
23211
- }
23219
+ clearEffects(subscriber, value, value.$effectDependencies$, i, container);
23220
+ }
23221
+ if (value.$effectDependencies$.length === 0) {
23222
+ value.$effectDependencies$ = null;
23212
23223
  }
23213
23224
  }
23214
23225
  }
23215
- function clearEffects(subscriber, value) {
23216
- if (!isSignal(subscriber)) {
23217
- return false;
23226
+ function clearEffects(subscriber, value, effectArray, indexToRemove, container) {
23227
+ let subscriptionRemoved = false;
23228
+ const seenSet = /* @__PURE__ */ new Set();
23229
+ if (subscriber instanceof WrappedSignal) {
23230
+ subscriptionRemoved = clearSignalEffects(subscriber, value, seenSet);
23231
+ } else if (container.$storeProxyMap$.has(subscriber)) {
23232
+ const store = container.$storeProxyMap$.get(subscriber);
23233
+ const handler = getStoreHandler(store);
23234
+ subscriptionRemoved = clearStoreEffects(handler, value);
23218
23235
  }
23219
- const effectSubscriptions = subscriber.$effects$;
23220
- const hostElement = subscriber.$hostElement$;
23221
- if (hostElement && hostElement === value) {
23222
- subscriber.$hostElement$ = null;
23236
+ if (subscriptionRemoved) {
23237
+ effectArray.splice(indexToRemove, 1);
23223
23238
  }
23239
+ }
23240
+ function clearSignalEffects(subscriber, value, seenSet) {
23241
+ const effectSubscriptions = subscriber.$effects$;
23224
23242
  let subscriptionRemoved = false;
23225
23243
  if (effectSubscriptions) {
23226
23244
  for (let i = effectSubscriptions.length - 1; i >= 0; i--) {
@@ -23231,14 +23249,76 @@ function clearEffects(subscriber, value) {
23231
23249
  }
23232
23250
  }
23233
23251
  }
23234
- const args = subscriber.$args$;
23235
- if (args) {
23236
- for (let i = args.length - 1; i >= 0; i--) {
23237
- clearEffects(args[i], subscriber);
23252
+ if (subscriber instanceof WrappedSignal) {
23253
+ const hostElement = subscriber.$hostElement$;
23254
+ if (hostElement && hostElement === value) {
23255
+ subscriber.$hostElement$ = null;
23256
+ }
23257
+ const args = subscriber.$args$;
23258
+ if (args) {
23259
+ clearArgsEffects(args, subscriber, seenSet);
23238
23260
  }
23239
23261
  }
23240
23262
  return subscriptionRemoved;
23241
23263
  }
23264
+ function clearStoreEffects(storeHandler, value) {
23265
+ const effectSubscriptions = storeHandler.$effects$;
23266
+ if (!effectSubscriptions) {
23267
+ return false;
23268
+ }
23269
+ let subscriptionRemoved = false;
23270
+ for (const key in effectSubscriptions) {
23271
+ const effects = effectSubscriptions[key];
23272
+ for (let i = effects.length - 1; i >= 0; i--) {
23273
+ const effect = effects[i];
23274
+ if (effect[0 /* EFFECT */] === value) {
23275
+ effects.splice(i, 1);
23276
+ subscriptionRemoved = true;
23277
+ }
23278
+ }
23279
+ if (effects.length === 0) {
23280
+ delete effectSubscriptions[key];
23281
+ }
23282
+ }
23283
+ return subscriptionRemoved;
23284
+ }
23285
+ function clearArgsEffects(args, subscriber, seenSet) {
23286
+ for (let i = args.length - 1; i >= 0; i--) {
23287
+ const arg = args[i];
23288
+ clearArgEffect(arg, subscriber, seenSet);
23289
+ }
23290
+ }
23291
+ function clearArgEffect(arg, subscriber, seenSet) {
23292
+ if (seenSet.has(arg)) {
23293
+ return;
23294
+ }
23295
+ seenSet.add(arg);
23296
+ if (isSignal(arg)) {
23297
+ clearSignalEffects(arg, subscriber, seenSet);
23298
+ } else if (typeof arg === "object" && arg !== null) {
23299
+ if (isStore(arg)) {
23300
+ clearStoreEffects(getStoreHandler(arg), subscriber);
23301
+ } else if (isPropsProxy(arg)) {
23302
+ const constProps = arg[_CONST_PROPS];
23303
+ const varProps = arg[_VAR_PROPS];
23304
+ if (constProps) {
23305
+ for (const key in constProps) {
23306
+ clearArgEffect(constProps[key], subscriber, seenSet);
23307
+ }
23308
+ }
23309
+ for (const key in varProps) {
23310
+ clearArgEffect(varProps[key], subscriber, seenSet);
23311
+ }
23312
+ } else {
23313
+ for (const key in arg) {
23314
+ clearArgEffect(arg[key], subscriber, seenSet);
23315
+ }
23316
+ }
23317
+ } else if (Array.isArray(arg)) {
23318
+ clearArgsEffects(arg, subscriber, seenSet);
23319
+ } else {
23320
+ }
23321
+ }
23242
23322
 
23243
23323
  // packages/qwik/src/core/use/use-resource.ts
23244
23324
  var _createResourceReturn = (opts) => {
@@ -23264,7 +23344,7 @@ var runResource = (task, container, host) => {
23264
23344
  cleanupTask(task);
23265
23345
  const iCtx = newInvokeContext(container.$locale$, host, void 0, ResourceEvent);
23266
23346
  iCtx.$container$ = container;
23267
- const taskFn = task.$qrl$.getFn(iCtx, () => clearSubscriberEffectDependencies(task));
23347
+ const taskFn = task.$qrl$.getFn(iCtx, () => clearSubscriberEffectDependencies(container, task));
23268
23348
  const resource = task.$state$;
23269
23349
  assertDefined(
23270
23350
  resource,
@@ -23752,6 +23832,19 @@ function escapeHTML(html) {
23752
23832
  }
23753
23833
  }
23754
23834
 
23835
+ // packages/qwik/src/core/shared/utils/jsx-filename.ts
23836
+ function getFileLocationFromJsx(jsxDev) {
23837
+ var _a;
23838
+ if (!jsxDev) {
23839
+ return null;
23840
+ }
23841
+ const sanitizedFileName = (_a = jsxDev.fileName) == null ? void 0 : _a.replace(/\\/g, "/");
23842
+ if (sanitizedFileName) {
23843
+ return `${sanitizedFileName}:${jsxDev.lineNumber}:${jsxDev.columnNumber}`;
23844
+ }
23845
+ return null;
23846
+ }
23847
+
23755
23848
  // packages/qwik/src/core/client/vnode-diff.ts
23756
23849
  var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
23757
23850
  let journal = container.$journal$;
@@ -24092,7 +24185,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24092
24185
  vnode_remove(journal, vParent, toRemove, true);
24093
24186
  }
24094
24187
  }
24095
- function createNewElement(jsx4, elementName) {
24188
+ function createNewElement(jsx4, elementName, currentFile) {
24096
24189
  const element = createElementWithNamespace(elementName);
24097
24190
  const { constProps } = jsx4;
24098
24191
  let needsQDispatchEventPatch = false;
@@ -24120,6 +24213,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24120
24213
  } else if (typeof value === "function") {
24121
24214
  value(element);
24122
24215
  continue;
24216
+ } else {
24217
+ throw qError(32 /* invalidRefValue */, [currentFile]);
24123
24218
  }
24124
24219
  }
24125
24220
  if (isSignal(value)) {
@@ -24141,13 +24236,13 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24141
24236
  continue;
24142
24237
  }
24143
24238
  if (elementName === "textarea" && key2 === "value") {
24144
- if (typeof value !== "string") {
24239
+ if (value && typeof value !== "string") {
24145
24240
  if (import_build4.isDev) {
24146
- throw qError(40 /* wrongTextareaValue */);
24241
+ throw qError(40 /* wrongTextareaValue */, [currentFile, value]);
24147
24242
  }
24148
24243
  continue;
24149
24244
  }
24150
- element.value = escapeHTML(value);
24245
+ element.value = escapeHTML(value || "");
24151
24246
  continue;
24152
24247
  }
24153
24248
  value = serializeAttribute(key2, value, scopedStyleIdPrefix);
@@ -24183,19 +24278,24 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24183
24278
  const isSameElementName = vCurrent && vnode_isElementVNode(vCurrent) && elementName === vnode_getElementName(vCurrent);
24184
24279
  const jsxKey = jsx4.key;
24185
24280
  let needsQDispatchEventPatch = false;
24281
+ const currentFile = getFileLocationFromJsx(jsx4.dev);
24186
24282
  if (!isSameElementName || jsxKey !== getKey(vCurrent)) {
24187
24283
  vNewNode = retrieveChildWithKey(elementName, jsxKey);
24188
24284
  if (vNewNode === null) {
24189
24285
  needsQDispatchEventPatch = createNewElement(jsx4, elementName);
24190
24286
  } else {
24191
24287
  vnode_insertBefore(journal, vParent, vNewNode, vCurrent);
24288
+ vCurrent = vNewNode;
24289
+ vNewNode = null;
24290
+ if (vSiblings !== null) {
24291
+ vSiblingsIdx -= 3 /* Size */;
24292
+ }
24192
24293
  }
24193
24294
  }
24194
24295
  const jsxAttrs = [];
24195
24296
  const props = jsx4.varProps;
24196
24297
  for (const key in props) {
24197
- let value = props[key];
24198
- value = serializeAttribute(key, value, scopedStyleIdPrefix);
24298
+ const value = props[key];
24199
24299
  if (value != null) {
24200
24300
  mapArray_set(jsxAttrs, key, value, 0);
24201
24301
  }
@@ -24204,7 +24304,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24204
24304
  mapArray_set(jsxAttrs, ELEMENT_KEY, jsxKey, 0);
24205
24305
  }
24206
24306
  const vNode = vNewNode || vCurrent;
24207
- needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs) || needsQDispatchEventPatch;
24307
+ needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs, currentFile) || needsQDispatchEventPatch;
24208
24308
  if (needsQDispatchEventPatch) {
24209
24309
  const element = vnode_getNode(vNode);
24210
24310
  if (!element.qDispatchEvent) {
@@ -24227,7 +24327,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24227
24327
  }
24228
24328
  }
24229
24329
  }
24230
- function setBulkProps(vnode, srcAttrs) {
24330
+ function setBulkProps(vnode, srcAttrs, currentFile) {
24231
24331
  vnode_ensureElementInflated(vnode);
24232
24332
  const dstAttrs = vnode;
24233
24333
  let srcIdx = 0;
@@ -24250,12 +24350,18 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24250
24350
  } else if (typeof value === "function") {
24251
24351
  value(element);
24252
24352
  return;
24353
+ } else {
24354
+ throw qError(32 /* invalidRefValue */, [currentFile]);
24253
24355
  }
24254
24356
  }
24255
24357
  if (isSignal(value)) {
24256
- value = untrack(() => value.value);
24358
+ const signalData = new EffectPropData({
24359
+ $scopedStyleIdPrefix$: scopedStyleIdPrefix,
24360
+ $isConst$: false
24361
+ });
24362
+ value = trackSignalAndAssignHost(value, vnode, key, container, signalData);
24257
24363
  }
24258
- vnode_setAttr(journal, vnode, key, value);
24364
+ vnode_setAttr(journal, vnode, key, serializeAttribute(key, value, scopedStyleIdPrefix));
24259
24365
  if (value === null) {
24260
24366
  dstLength = dstAttrs.length;
24261
24367
  }
@@ -24297,6 +24403,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24297
24403
  }
24298
24404
  srcIdx++;
24299
24405
  srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null;
24406
+ dstIdx++;
24407
+ dstKey = dstIdx < dstLength ? dstAttrs[dstIdx++] : null;
24300
24408
  } else if (srcKey == dstKey) {
24301
24409
  const srcValue = srcAttrs[srcIdx++];
24302
24410
  const dstValue = dstAttrs[dstIdx++];
@@ -24373,7 +24481,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
24373
24481
  vnode_insertBefore(
24374
24482
  journal,
24375
24483
  vParent,
24376
- vNewNode = vnode_newVirtual(),
24484
+ vNewNode,
24377
24485
  vCurrent && getInsertBefore()
24378
24486
  );
24379
24487
  return;
@@ -24571,7 +24679,7 @@ function cleanup(container, vNode) {
24571
24679
  const obj = seq[i];
24572
24680
  if (isTask(obj)) {
24573
24681
  const task = obj;
24574
- clearSubscriberEffectDependencies(task);
24682
+ clearSubscriberEffectDependencies(container, task);
24575
24683
  if (task.$flags$ & 1 /* VISIBLE_TASK */) {
24576
24684
  container.$scheduler$(48 /* CLEANUP_VISIBLE */, task);
24577
24685
  } else {
@@ -24663,6 +24771,81 @@ var implicit$FirstArg = (fn) => {
24663
24771
  };
24664
24772
  };
24665
24773
 
24774
+ // packages/qwik/src/core/shared/scheduler-document-position.ts
24775
+ var aVNodePath = [];
24776
+ var bVNodePath = [];
24777
+ var vnode_documentPosition = (a, b, rootVNode) => {
24778
+ if (a === b) {
24779
+ return 0;
24780
+ }
24781
+ let aDepth = -1;
24782
+ let bDepth = -1;
24783
+ while (a) {
24784
+ const vNode = aVNodePath[++aDepth] = a;
24785
+ a = vNode[1 /* parent */] || rootVNode && vnode_getProp(a, QSlotParent, (id) => vnode_locate(rootVNode, id));
24786
+ }
24787
+ while (b) {
24788
+ const vNode = bVNodePath[++bDepth] = b;
24789
+ b = vNode[1 /* parent */] || rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id));
24790
+ }
24791
+ while (aDepth >= 0 && bDepth >= 0) {
24792
+ a = aVNodePath[aDepth];
24793
+ b = bVNodePath[bDepth];
24794
+ if (a === b) {
24795
+ aDepth--;
24796
+ bDepth--;
24797
+ } else {
24798
+ let cursor = b;
24799
+ do {
24800
+ cursor = vnode_getNextSibling(cursor);
24801
+ if (cursor === a) {
24802
+ return 1;
24803
+ }
24804
+ } while (cursor);
24805
+ cursor = b;
24806
+ do {
24807
+ cursor = vnode_getPreviousSibling(cursor);
24808
+ if (cursor === a) {
24809
+ return -1;
24810
+ }
24811
+ } while (cursor);
24812
+ if (rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id))) {
24813
+ return -1;
24814
+ }
24815
+ return 1;
24816
+ }
24817
+ }
24818
+ return aDepth < bDepth ? -1 : 1;
24819
+ };
24820
+ var aSsrNodePath = [];
24821
+ var bSsrNodePath = [];
24822
+ var ssrNodeDocumentPosition = (a, b) => {
24823
+ if (a === b) {
24824
+ return 0;
24825
+ }
24826
+ let aDepth = -1;
24827
+ let bDepth = -1;
24828
+ while (a) {
24829
+ const ssrNode = aSsrNodePath[++aDepth] = a;
24830
+ a = ssrNode.currentComponentNode;
24831
+ }
24832
+ while (b) {
24833
+ const ssrNode = bSsrNodePath[++bDepth] = b;
24834
+ b = ssrNode.currentComponentNode;
24835
+ }
24836
+ while (aDepth >= 0 && bDepth >= 0) {
24837
+ a = aSsrNodePath[aDepth];
24838
+ b = bSsrNodePath[bDepth];
24839
+ if (a === b) {
24840
+ aDepth--;
24841
+ bDepth--;
24842
+ } else {
24843
+ return 1;
24844
+ }
24845
+ }
24846
+ return aDepth < bDepth ? -1 : 1;
24847
+ };
24848
+
24666
24849
  // packages/qwik/src/core/shared/scheduler.ts
24667
24850
  var DEBUG2 = false;
24668
24851
  var createScheduler = (container, scheduleDrain, journalFlush) => {
@@ -24689,7 +24872,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24689
24872
  };
24690
24873
  chore.$promise$ = new Promise((resolve) => chore.$resolve$ = resolve);
24691
24874
  DEBUG2 && debugTrace("schedule", chore, currentChore, choreQueue);
24692
- chore = sortedInsert(choreQueue, chore);
24875
+ chore = sortedInsert(choreQueue, chore, container.rootVNode || null);
24693
24876
  if (!journalFlushScheduled && runLater) {
24694
24877
  journalFlushScheduled = true;
24695
24878
  schedule(16 /* JOURNAL_FLUSH */);
@@ -24698,10 +24881,10 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24698
24881
  if (runLater) {
24699
24882
  return chore.$promise$;
24700
24883
  } else {
24701
- return drainUpTo(chore);
24884
+ return drainUpTo(chore, container.rootVNode || null);
24702
24885
  }
24703
24886
  }
24704
- function drainUpTo(runUptoChore) {
24887
+ function drainUpTo(runUptoChore, rootVNode) {
24705
24888
  if (runUptoChore.$executed$) {
24706
24889
  return runUptoChore.$returnValue$;
24707
24890
  }
@@ -24710,7 +24893,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24710
24893
  }
24711
24894
  while (choreQueue.length) {
24712
24895
  const nextChore = choreQueue.shift();
24713
- const order = choreComparator(nextChore, runUptoChore, false);
24896
+ const order = choreComparator(nextChore, runUptoChore, rootVNode);
24714
24897
  if (order === null) {
24715
24898
  continue;
24716
24899
  }
@@ -24725,7 +24908,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24725
24908
  }
24726
24909
  const returnValue = executeChore(nextChore);
24727
24910
  if (isPromise(returnValue)) {
24728
- const promise = returnValue.then(() => drainUpTo(runUptoChore));
24911
+ const promise = returnValue.then(() => drainUpTo(runUptoChore, rootVNode));
24729
24912
  return promise;
24730
24913
  }
24731
24914
  }
@@ -24756,11 +24939,13 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24756
24939
  (jsx5) => {
24757
24940
  if (chore.$type$ === 7 /* COMPONENT */) {
24758
24941
  const styleScopedId = container.getHostProp(host, QScopedStyle);
24759
- return vnode_diff(
24760
- container,
24761
- jsx5,
24762
- host,
24763
- addComponentStylePrefix(styleScopedId)
24942
+ return retryOnPromise(
24943
+ () => vnode_diff(
24944
+ container,
24945
+ jsx5,
24946
+ host,
24947
+ addComponentStylePrefix(styleScopedId)
24948
+ )
24764
24949
  );
24765
24950
  } else {
24766
24951
  return jsx5;
@@ -24789,7 +24974,9 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
24789
24974
  if (isSignal(jsx4)) {
24790
24975
  jsx4 = jsx4.value;
24791
24976
  }
24792
- returnValue = vnode_diff(container, jsx4, parentVirtualNode, null);
24977
+ returnValue = retryOnPromise(
24978
+ () => vnode_diff(container, jsx4, parentVirtualNode, null)
24979
+ );
24793
24980
  break;
24794
24981
  case 5 /* NODE_PROP */:
24795
24982
  const virtualNode = chore.$host$;
@@ -24852,7 +25039,7 @@ var choreUpdate = (existing, newChore) => {
24852
25039
  function vNodeAlreadyDeleted(chore) {
24853
25040
  return !!(chore.$host$ && vnode_isVNode(chore.$host$) && chore.$host$[0 /* flags */] & 32 /* Deleted */);
24854
25041
  }
24855
- function choreComparator(a, b, shouldThrowOnHostMismatch) {
25042
+ function choreComparator(a, b, rootVNode) {
24856
25043
  const macroTypeDiff = (a.$type$ & 240 /* MACRO */) - (b.$type$ & 240 /* MACRO */);
24857
25044
  if (macroTypeDiff !== 0) {
24858
25045
  return macroTypeDiff;
@@ -24862,7 +25049,7 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
24862
25049
  const bHost = b.$host$;
24863
25050
  if (aHost !== bHost && aHost !== null && bHost !== null) {
24864
25051
  if (vnode_isVNode(aHost) && vnode_isVNode(bHost)) {
24865
- const hostDiff = vnode_documentPosition(aHost, bHost);
25052
+ const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
24866
25053
  if (hostDiff !== 0) {
24867
25054
  return hostDiff;
24868
25055
  }
@@ -24871,11 +25058,11 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
24871
25058
  You are attempting to change a state that has already been streamed to the client.
24872
25059
  This can lead to inconsistencies between Server-Side Rendering (SSR) and Client-Side Rendering (CSR).
24873
25060
  Problematic Node: ${aHost.toString()}`;
24874
- if (shouldThrowOnHostMismatch) {
24875
- throw qError(45 /* serverHostMismatch */, [errorMessage]);
24876
- }
24877
25061
  logWarn(errorMessage);
24878
- return null;
25062
+ const hostDiff = ssrNodeDocumentPosition(aHost, bHost);
25063
+ if (hostDiff !== 0) {
25064
+ return hostDiff;
25065
+ }
24879
25066
  }
24880
25067
  }
24881
25068
  const microTypeDiff = (a.$type$ & 15 /* MICRO */) - (b.$type$ & 15 /* MICRO */);
@@ -24892,13 +25079,13 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
24892
25079
  }
24893
25080
  return 0;
24894
25081
  }
24895
- function sortedFindIndex(sortedArray, value) {
25082
+ function sortedFindIndex(sortedArray, value, rootVNode) {
24896
25083
  let bottom = 0;
24897
25084
  let top = sortedArray.length;
24898
25085
  while (bottom < top) {
24899
25086
  const middle = bottom + (top - bottom >> 1);
24900
25087
  const midChore = sortedArray[middle];
24901
- const comp = choreComparator(value, midChore, true);
25088
+ const comp = choreComparator(value, midChore, rootVNode);
24902
25089
  if (comp < 0) {
24903
25090
  top = middle;
24904
25091
  } else if (comp > 0) {
@@ -24909,8 +25096,8 @@ function sortedFindIndex(sortedArray, value) {
24909
25096
  }
24910
25097
  return ~bottom;
24911
25098
  }
24912
- function sortedInsert(sortedArray, value) {
24913
- const idx = sortedFindIndex(sortedArray, value);
25099
+ function sortedInsert(sortedArray, value, rootVNode) {
25100
+ const idx = sortedFindIndex(sortedArray, value, rootVNode);
24914
25101
  if (idx < 0) {
24915
25102
  sortedArray.splice(~idx, 0, value);
24916
25103
  return value;
@@ -24963,7 +25150,10 @@ var runTask = (task, container, host) => {
24963
25150
  cleanupTask(task);
24964
25151
  const iCtx = newInvokeContext(container.$locale$, host, void 0, TaskEvent);
24965
25152
  iCtx.$container$ = container;
24966
- const taskFn = task.$qrl$.getFn(iCtx, () => clearSubscriberEffectDependencies(task));
25153
+ const taskFn = task.$qrl$.getFn(
25154
+ iCtx,
25155
+ () => clearSubscriberEffectDependencies(container, task)
25156
+ );
24967
25157
  const track = (obj, prop) => {
24968
25158
  const ctx = newInvokeContext();
24969
25159
  ctx.$effectSubscriber$ = [task, ":" /* COMPONENT */];
@@ -25120,7 +25310,7 @@ var Signal = class {
25120
25310
  // prevent accidental use as value
25121
25311
  valueOf() {
25122
25312
  if (qDev) {
25123
- throw qError(46 /* cannotCoerceSignal */);
25313
+ throw qError(45 /* cannotCoerceSignal */);
25124
25314
  }
25125
25315
  }
25126
25316
  toString() {
@@ -25287,7 +25477,7 @@ var ComputedSignal = class extends Signal {
25287
25477
  try {
25288
25478
  const untrackedValue = computeQrl.getFn(ctx)();
25289
25479
  if (isPromise(untrackedValue)) {
25290
- throw qError(47 /* computedNotSync */, [
25480
+ throw qError(46 /* computedNotSync */, [
25291
25481
  computeQrl.dev ? computeQrl.dev.file : "",
25292
25482
  computeQrl.$hash$
25293
25483
  ]);
@@ -25310,7 +25500,7 @@ var ComputedSignal = class extends Signal {
25310
25500
  return super.value;
25311
25501
  }
25312
25502
  set value(_) {
25313
- throw qError(48 /* computedReadOnly */);
25503
+ throw qError(47 /* computedReadOnly */);
25314
25504
  }
25315
25505
  };
25316
25506
  var WrappedSignal = class extends Signal {
@@ -25377,7 +25567,7 @@ var WrappedSignal = class extends Signal {
25377
25567
  return super.value;
25378
25568
  }
25379
25569
  set value(_) {
25380
- throw qError(49 /* wrappedReadOnly */);
25570
+ throw qError(48 /* wrappedReadOnly */);
25381
25571
  }
25382
25572
  };
25383
25573
 
@@ -27014,7 +27204,7 @@ var vnode_getNode = (vnode) => {
27014
27204
  assertTrue(vnode_isTextVNode(vnode), "Expecting Text Node.");
27015
27205
  return vnode[4 /* node */];
27016
27206
  };
27017
- function vnode_toString(depth = 10, offset = "", materialize2 = false, siblings = false) {
27207
+ function vnode_toString(depth = 20, offset = "", materialize2 = false, siblings = false) {
27018
27208
  var _a;
27019
27209
  let vnode = this;
27020
27210
  if (depth === 0) {
@@ -27211,52 +27401,15 @@ var vnode_getType = (vnode) => {
27211
27401
  };
27212
27402
  var isElement = (node) => node && typeof node == "object" && fastNodeType(node) === /** Node.ELEMENT_NODE* */
27213
27403
  1;
27214
- var aPath = [];
27215
- var bPath = [];
27216
- var vnode_documentPosition = (a, b) => {
27217
- if (a === b) {
27218
- return 0;
27219
- }
27220
- let aDepth = -1;
27221
- let bDepth = -1;
27222
- while (a) {
27223
- a = (aPath[++aDepth] = a)[1 /* parent */];
27224
- }
27225
- while (b) {
27226
- b = (bPath[++bDepth] = b)[1 /* parent */];
27227
- }
27228
- while (aDepth >= 0 && bDepth >= 0) {
27229
- a = aPath[aDepth];
27230
- b = bPath[bDepth];
27231
- if (a === b) {
27232
- aDepth--;
27233
- bDepth--;
27234
- } else {
27235
- let cursor = b;
27236
- do {
27237
- cursor = vnode_getNextSibling(cursor);
27238
- if (cursor === a) {
27239
- return 1;
27240
- }
27241
- } while (cursor);
27242
- cursor = b;
27243
- do {
27244
- cursor = vnode_getPreviousSibling(cursor);
27245
- if (cursor === a) {
27246
- return -1;
27247
- }
27248
- } while (cursor);
27249
- return 1;
27250
- }
27251
- }
27252
- return aDepth < bDepth ? -1 : 1;
27253
- };
27254
27404
  var vnode_getProjectionParentComponent = (vHost, rootVNode) => {
27255
27405
  let projectionDepth = 1;
27256
27406
  while (projectionDepth--) {
27257
27407
  while (vHost && (vnode_isVirtualVNode(vHost) ? vnode_getProp(vHost, OnRenderProp, null) === null : true)) {
27258
- const qSlotParentProp = vnode_getProp(vHost, QSlotParent, null);
27259
- const qSlotParent = qSlotParentProp && (typeof qSlotParentProp === "string" ? vnode_locate(rootVNode, qSlotParentProp) : qSlotParentProp);
27408
+ const qSlotParent = vnode_getProp(
27409
+ vHost,
27410
+ QSlotParent,
27411
+ (id) => vnode_locate(rootVNode, id)
27412
+ );
27260
27413
  const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
27261
27414
  if (vProjectionParent) {
27262
27415
  projectionDepth++;
@@ -27834,13 +27987,11 @@ var DomContainer = class extends _SharedContainer {
27834
27987
  if (vnode_getProp(vNode, OnRenderProp, null) !== null) {
27835
27988
  return vNode;
27836
27989
  }
27837
- const parent = vnode_getProp(vNode, QSlotParent, this.$vnodeLocate$);
27838
- if (parent) {
27839
- vNode = parent;
27840
- continue;
27841
- }
27990
+ vNode = vnode_getParent(vNode) || // If virtual node, than it could be a slot so we need to read its parent.
27991
+ vnode_getProp(vNode, QSlotParent, this.$vnodeLocate$);
27992
+ } else {
27993
+ vNode = vnode_getParent(vNode);
27842
27994
  }
27843
- vNode = vnode_getParent(vNode);
27844
27995
  }
27845
27996
  return null;
27846
27997
  }
@@ -27943,10 +28094,6 @@ var DomContainer = class extends _SharedContainer {
27943
28094
 
27944
28095
  // packages/qwik/src/core/shared/shared-serialization.ts
27945
28096
  var deserializedProxyMap = /* @__PURE__ */ new WeakMap();
27946
- var unwrapDeserializerProxy = (value) => {
27947
- const unwrapped = typeof value === "object" && value !== null && value[SERIALIZER_PROXY_UNWRAP];
27948
- return unwrapped ? unwrapped : value;
27949
- };
27950
28097
  var isDeserializerProxy = (value) => {
27951
28098
  return typeof value === "object" && value !== null && SERIALIZER_PROXY_UNWRAP in value;
27952
28099
  };
@@ -27988,13 +28135,13 @@ var DeserializationHandler = class {
27988
28135
  return value;
27989
28136
  }
27990
28137
  const container = this.$container$;
27991
- const propValue = allocate(container, typeId, value);
28138
+ let propValue = allocate(container, typeId, value);
28139
+ if (typeId >= 12 /* Error */) {
28140
+ propValue = inflate(container, propValue, typeId, value);
28141
+ }
27992
28142
  Reflect.set(target, property, propValue);
27993
28143
  this.$data$[idx] = void 0;
27994
28144
  this.$data$[idx + 1] = propValue;
27995
- if (typeId >= 12 /* Error */) {
27996
- inflate(container, propValue, typeId, value);
27997
- }
27998
28145
  return propValue;
27999
28146
  }
28000
28147
  has(target, property) {
@@ -28029,7 +28176,7 @@ var resolvers = /* @__PURE__ */ new WeakMap();
28029
28176
  var inflate = (container, target, typeId, data) => {
28030
28177
  var _a;
28031
28178
  if (typeId === void 0) {
28032
- return;
28179
+ return target;
28033
28180
  }
28034
28181
  if (typeId !== 13 /* Object */ && Array.isArray(data)) {
28035
28182
  data = _eagerDeserializeArray(container, data);
@@ -28100,14 +28247,13 @@ var inflate = (container, target, typeId, data) => {
28100
28247
  case 25 /* Store */:
28101
28248
  case 26 /* StoreArray */: {
28102
28249
  const [value, flags, effects2, storeEffect] = data;
28103
- const handler = getStoreHandler(target);
28104
- handler.$flags$ = flags;
28105
- Object.assign(getStoreTarget(target), value);
28250
+ const store = getOrCreateStore(value, flags, container);
28251
+ const storeHandler = getStoreHandler(store);
28106
28252
  if (storeEffect) {
28107
28253
  effects2[STORE_ARRAY_PROP] = storeEffect;
28108
28254
  }
28109
- handler.$effects$ = effects2;
28110
- container.$storeProxyMap$.set(value, target);
28255
+ storeHandler.$effects$ = effects2;
28256
+ target = store;
28111
28257
  break;
28112
28258
  }
28113
28259
  case 22 /* Signal */: {
@@ -28229,6 +28375,7 @@ var inflate = (container, target, typeId, data) => {
28229
28375
  default:
28230
28376
  throw qError(33 /* serializeErrorNotImplemented */, [typeId]);
28231
28377
  }
28378
+ return target;
28232
28379
  };
28233
28380
  var _constants = [
28234
28381
  void 0,
@@ -28314,9 +28461,8 @@ var allocate = (container, typeId, value) => {
28314
28461
  case 24 /* ComputedSignal */:
28315
28462
  return new ComputedSignal(container, null);
28316
28463
  case 25 /* Store */:
28317
- return createStore(container, {}, 0);
28318
28464
  case 26 /* StoreArray */:
28319
- return createStore(container, [], 0);
28465
+ return null;
28320
28466
  case 11 /* URLSearchParams */:
28321
28467
  return new URLSearchParams(value);
28322
28468
  case 27 /* FormData */:
@@ -28968,15 +29114,15 @@ function qrlToString(serializationContext, value) {
28968
29114
  }
28969
29115
  return qrlStringInline;
28970
29116
  }
28971
- function deserializeData(container, typeId, propValue) {
29117
+ function deserializeData(container, typeId, value) {
28972
29118
  if (typeId === void 0) {
28973
- return propValue;
29119
+ return value;
28974
29120
  }
28975
- const value = allocate(container, typeId, propValue);
29121
+ let propValue = allocate(container, typeId, value);
28976
29122
  if (typeId >= 12 /* Error */) {
28977
- inflate(container, value, typeId, propValue);
29123
+ propValue = inflate(container, propValue, typeId, value);
28978
29124
  }
28979
- return value;
29125
+ return propValue;
28980
29126
  }
28981
29127
  function shouldTrackObj(obj) {
28982
29128
  return (
@@ -30828,7 +30974,7 @@ var SsrComponentFrame = class {
30828
30974
  if ((0, import_core4._isJSXNode)(children)) {
30829
30975
  const slotName = this.getSlotName(children);
30830
30976
  mapArray_set(this.slots, slotName, children, 0);
30831
- } else if (Array.isArray(children)) {
30977
+ } else if (Array.isArray(children) && children.length > 0) {
30832
30978
  const defaultSlot = [];
30833
30979
  for (let i = 0; i < children.length; i++) {
30834
30980
  const child = children[i];
@@ -30843,7 +30989,7 @@ var SsrComponentFrame = class {
30843
30989
  defaultSlot.push(child);
30844
30990
  }
30845
30991
  }
30846
- defaultSlot.length && mapArray_set(this.slots, QDefaultSlot, defaultSlot, 0);
30992
+ defaultSlot.length > 0 && mapArray_set(this.slots, QDefaultSlot, defaultSlot, 0);
30847
30993
  } else {
30848
30994
  mapArray_set(this.slots, QDefaultSlot, children, 0);
30849
30995
  }
@@ -31457,12 +31603,12 @@ var SSRContainer = class extends import_core6._SharedContainer {
31457
31603
  this.write("<");
31458
31604
  this.write(elementName);
31459
31605
  if (varAttrs) {
31460
- innerHTML = this.writeAttrs(elementName, varAttrs, false);
31606
+ innerHTML = this.writeAttrs(elementName, varAttrs, false, currentFile);
31461
31607
  }
31462
31608
  this.write(" " + Q_PROPS_SEPARATOR);
31463
31609
  import_build12.isDev && this.write('=""');
31464
31610
  if (constAttrs && constAttrs.length) {
31465
- innerHTML = this.writeAttrs(elementName, constAttrs, true) || innerHTML;
31611
+ innerHTML = this.writeAttrs(elementName, constAttrs, true, currentFile) || innerHTML;
31466
31612
  }
31467
31613
  this.write(">");
31468
31614
  this.lastNode = null;
@@ -31537,14 +31683,10 @@ var SSRContainer = class extends import_core6._SharedContainer {
31537
31683
  }
31538
31684
  }
31539
31685
  openProjection(attrs) {
31540
- var _a;
31541
31686
  this.openFragment(attrs);
31542
- const vNode = (_a = this.currentElementFrame) == null ? void 0 : _a.vNodeData;
31543
- if (vNode) {
31544
- vNode[0] |= 16 /* SERIALIZE */;
31545
- }
31546
31687
  const componentFrame = this.getComponentFrame();
31547
31688
  if (componentFrame) {
31689
+ this.serializationCtx.$addRoot$(componentFrame.componentNode);
31548
31690
  componentFrame.projectionDepth++;
31549
31691
  }
31550
31692
  }
@@ -32110,7 +32252,7 @@ var SSRContainer = class extends import_core6._SharedContainer {
32110
32252
  this.write(element);
32111
32253
  }
32112
32254
  }
32113
- writeAttrs(tag, attrs, isConst) {
32255
+ writeAttrs(tag, attrs, isConst, currentFile) {
32114
32256
  let innerHTML = void 0;
32115
32257
  if (attrs.length) {
32116
32258
  for (let i = 0; i < attrs.length; i++) {
@@ -32119,7 +32261,7 @@ var SSRContainer = class extends import_core6._SharedContainer {
32119
32261
  let styleScopedId = null;
32120
32262
  if (isSSRUnsafeAttr(key)) {
32121
32263
  if (import_build12.isDev) {
32122
- throw qError(51 /* unsafeAttr */);
32264
+ throw qError(50 /* unsafeAttr */);
32123
32265
  }
32124
32266
  continue;
32125
32267
  }
@@ -32137,7 +32279,7 @@ var SSRContainer = class extends import_core6._SharedContainer {
32137
32279
  value(new DomRef(lastNode));
32138
32280
  continue;
32139
32281
  } else {
32140
- throw qError(32 /* invalidRefValue */);
32282
+ throw qError(32 /* invalidRefValue */, [currentFile]);
32141
32283
  }
32142
32284
  }
32143
32285
  if ((0, import_core6.isSignal)(value)) {
@@ -32157,13 +32299,13 @@ var SSRContainer = class extends import_core6._SharedContainer {
32157
32299
  }
32158
32300
  }
32159
32301
  if (tag === "textarea" && key === "value") {
32160
- if (typeof value !== "string") {
32302
+ if (value && typeof value !== "string") {
32161
32303
  if (import_build12.isDev) {
32162
- throw qError(40 /* wrongTextareaValue */);
32304
+ throw qError(40 /* wrongTextareaValue */, [currentFile, value]);
32163
32305
  }
32164
32306
  continue;
32165
32307
  }
32166
- innerHTML = escapeHTML(value);
32308
+ innerHTML = escapeHTML(value || "");
32167
32309
  key = QContainerAttr;
32168
32310
  value = "text" /* TEXT */;
32169
32311
  }