@qwik.dev/core 2.0.0-beta.28 → 2.0.0-beta.29

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-beta.28-dev+fac55b7
3
+ * @qwik.dev/core/testing 2.0.0-beta.29-dev+bc61b71
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
@@ -23891,11 +23891,8 @@ function assertQrl(qrl) {
23891
23891
  }
23892
23892
  }
23893
23893
  var getSymbolHash = (symbolName) => {
23894
- const index = symbolName.lastIndexOf("_");
23895
- if (index > -1) {
23896
- return symbolName.slice(index + 1);
23897
- }
23898
- return symbolName;
23894
+ const index = symbolName.lastIndexOf("_") + 1;
23895
+ return symbolName.slice(index);
23899
23896
  };
23900
23897
 
23901
23898
  // packages/qwik/src/core/shared/types.ts
@@ -23940,6 +23937,7 @@ var VirtualTypeName = {
23940
23937
 
23941
23938
  // packages/qwik/src/core/shared/utils/markers.ts
23942
23939
  var OnRenderProp = "q:renderFn";
23940
+ var QTargetElement = "q:targetEl";
23943
23941
  var ComponentStylesPrefixContent = "\u26A1\uFE0F";
23944
23942
  var QSlot = "q:slot";
23945
23943
  var QSlotParent = "q:sparent";
@@ -24293,72 +24291,17 @@ Object.freeze(EMPTY_OBJ);
24293
24291
  import { isBrowser as isBrowser3, isDev as isDev19 } from "@qwik.dev/core/build";
24294
24292
  import { p as preload } from "@qwik.dev/core/preloader";
24295
24293
 
24296
- // packages/qwik/src/core/reactive-primitives/backref.ts
24297
- var _EFFECT_BACK_REF = /* @__PURE__ */ Symbol("backRef");
24298
- var _a;
24299
- _a = _EFFECT_BACK_REF;
24300
- var BackRef = class {
24301
- constructor() {
24302
- __publicField(this, _a);
24303
- }
24304
- };
24305
-
24306
- // packages/qwik/src/core/shared/vnode/vnode.ts
24307
- import { isDev as isDev5 } from "@qwik.dev/core/build";
24308
- var _a2;
24309
- _a2 = _EFFECT_BACK_REF;
24310
- var VNode = class {
24311
- constructor(flags, parent, previousSibling, nextSibling, props) {
24312
- this.flags = flags;
24313
- this.parent = parent;
24314
- this.previousSibling = previousSibling;
24315
- this.nextSibling = nextSibling;
24316
- this.props = props;
24317
- __publicField(this, _a2);
24318
- __publicField(this, "slotParent", null);
24319
- __publicField(this, "dirty", 0 /* NONE */);
24320
- __publicField(this, "dirtyChildren", null);
24321
- __publicField(this, "nextDirtyChildIndex", 0);
24322
- }
24323
- // TODO: this creates debug issues
24324
- toString() {
24325
- if (isDev5) {
24326
- return vnode_toString.call(this);
24327
- }
24328
- return Object.prototype.toString.call(this);
24329
- }
24330
- };
24331
-
24332
- // packages/qwik/src/core/shared/vnode/virtual-vnode.ts
24333
- var VirtualVNode = class extends VNode {
24334
- constructor(key, flags, parent, previousSibling, nextSibling, props, firstChild, lastChild) {
24335
- super(flags, parent, previousSibling, nextSibling, props);
24336
- this.key = key;
24337
- this.firstChild = firstChild;
24338
- this.lastChild = lastChild;
24339
- }
24340
- };
24341
-
24342
- // packages/qwik/src/core/shared/vnode/element-vnode.ts
24343
- var ElementVNode = class extends VirtualVNode {
24344
- constructor(key, flags, parent, previousSibling, nextSibling, props, firstChild, lastChild, node, elementName) {
24345
- super(key, flags, parent, previousSibling, nextSibling, props, firstChild, lastChild);
24346
- this.node = node;
24347
- this.elementName = elementName;
24348
- }
24349
- };
24350
-
24351
24294
  // packages/qwik/src/core/shared/serdes/inflate.ts
24352
24295
  import { isServer as isServer9 } from "@qwik.dev/core/build";
24353
24296
 
24354
24297
  // packages/qwik/src/core/shared/serdes/qrl-to-string.ts
24355
- import { isDev as isDev6 } from "@qwik.dev/core/build";
24298
+ import { isDev as isDev5 } from "@qwik.dev/core/build";
24356
24299
  function qrlToString(serializationContext, qrl, raw) {
24357
24300
  let symbol = qrl.$symbol$;
24358
24301
  let chunk = qrl.$chunk$;
24359
24302
  const platform = getPlatform();
24360
24303
  if (platform) {
24361
- const result2 = isDev6 ? platform.chunkForSymbol(symbol, chunk, qrl.dev?.file) : platform.chunkForSymbol(symbol, chunk);
24304
+ const result2 = isDev5 ? platform.chunkForSymbol(symbol, chunk, qrl.dev?.file) : platform.chunkForSymbol(symbol, chunk);
24362
24305
  if (result2) {
24363
24306
  chunk = result2[1];
24364
24307
  symbol = result2[0];
@@ -24369,9 +24312,10 @@ function qrlToString(serializationContext, qrl, raw) {
24369
24312
  if (!chunk) {
24370
24313
  chunk = serializationContext.$symbolToChunkResolver$(qrl.$hash$);
24371
24314
  }
24372
- if (isDev6) {
24315
+ if (isDev5) {
24373
24316
  const backChannel = globalThis.__qrl_back_channel__ || (globalThis.__qrl_back_channel__ = /* @__PURE__ */ new Map());
24374
- backChannel.set(qrl.$symbol$, qrl.$symbolRef$);
24317
+ const lazy = qrl.$lazy$;
24318
+ backChannel.set(lazy.$symbol$, lazy.$ref$);
24375
24319
  if (!chunk) {
24376
24320
  chunk = QRL_RUNTIME_CHUNK;
24377
24321
  }
@@ -24401,21 +24345,21 @@ function qrlToString(serializationContext, qrl, raw) {
24401
24345
  }
24402
24346
  return qrlStringInline;
24403
24347
  }
24404
- function createQRLWithBackChannel(chunk, symbol, captures) {
24348
+ function createQRLWithBackChannel(chunk, symbol, captures, container) {
24405
24349
  let qrlImporter = null;
24406
- if (isDev6 && chunk === QRL_RUNTIME_CHUNK) {
24350
+ if (isDev5 && chunk === QRL_RUNTIME_CHUNK) {
24407
24351
  const backChannel = globalThis.__qrl_back_channel__;
24408
- isDev6 && assertDefined(backChannel, "Missing QRL_RUNTIME_CHUNK");
24352
+ isDev5 && assertDefined(backChannel, "Missing QRL_RUNTIME_CHUNK");
24409
24353
  const fn = backChannel.get(symbol);
24410
24354
  if (fn) {
24411
24355
  qrlImporter = () => Promise.resolve({ [symbol]: fn });
24412
24356
  }
24413
24357
  }
24414
- return createQRL(chunk, symbol, null, qrlImporter, captures);
24358
+ return createQRL(chunk, symbol, null, qrlImporter, captures, container);
24415
24359
  }
24416
- function parseQRL(qrl) {
24360
+ function parseQRL(qrl, container) {
24417
24361
  const [chunk, symbol, captures] = qrl.split("#");
24418
- return createQRLWithBackChannel(chunk, symbol, captures || null);
24362
+ return createQRLWithBackChannel(chunk, symbol, captures || null, container);
24419
24363
  }
24420
24364
  var QRL_RUNTIME_CHUNK = "mock-chunk";
24421
24365
 
@@ -24459,9 +24403,9 @@ function runEventHandlerQRL(handler, event, element, ctx) {
24459
24403
  }
24460
24404
 
24461
24405
  // packages/qwik/src/core/client/util-mapArray.ts
24462
- import { isDev as isDev7 } from "@qwik.dev/core/build";
24406
+ import { isDev as isDev6 } from "@qwik.dev/core/build";
24463
24407
  var mapApp_findIndx = (array, key, start) => {
24464
- isDev7 && assertTrue(start % 2 === 0, "Expecting even number.");
24408
+ isDev6 && assertTrue(start % 2 === 0, "Expecting even number.");
24465
24409
  let bottom = start >> 1;
24466
24410
  let top = array.length - 2 >> 1;
24467
24411
  while (bottom <= top) {
@@ -24512,8 +24456,18 @@ var mapArray_has = (array, key, start) => {
24512
24456
  return mapApp_findIndx(array, key, start) >= 0;
24513
24457
  };
24514
24458
 
24459
+ // packages/qwik/src/core/reactive-primitives/backref.ts
24460
+ var _EFFECT_BACK_REF = /* @__PURE__ */ Symbol("backRef");
24461
+ var _a;
24462
+ _a = _EFFECT_BACK_REF;
24463
+ var BackRef = class {
24464
+ constructor() {
24465
+ __publicField(this, _a);
24466
+ }
24467
+ };
24468
+
24515
24469
  // packages/qwik/src/core/reactive-primitives/impl/signal-impl.ts
24516
- import { isDev as isDev8, isServer as isServer3 } from "@qwik.dev/core/build";
24470
+ import { isDev as isDev7, isServer as isServer3 } from "@qwik.dev/core/build";
24517
24471
  var DEBUG = false;
24518
24472
  var log = (...args) => console.log("SIGNAL", ...args.map(qwikDebugToString));
24519
24473
  var SignalImpl = class {
@@ -24555,7 +24509,7 @@ var SignalImpl = class {
24555
24509
  if (this.$container$ === null) {
24556
24510
  this.$container$ = ctx.$container$;
24557
24511
  } else {
24558
- isDev8 && assertTrue(
24512
+ isDev7 && assertTrue(
24559
24513
  !ctx.$container$ || ctx.$container$ === this.$container$,
24560
24514
  "Do not use signals across containers"
24561
24515
  );
@@ -24592,7 +24546,7 @@ var SignalImpl = class {
24592
24546
  }
24593
24547
  }
24594
24548
  toString() {
24595
- if (isDev8) {
24549
+ if (isDev7) {
24596
24550
  try {
24597
24551
  return `[${this.constructor.name}${this.$flags$ & 1 /* INVALID */ ? " INVALID" : ""} ${this.$untrackedValue$}]` + (Array.from(this.$effects$ || []).map((e) => "\n -> " + pad(qwikDebugToString(e.consumer), " ")).join("\n") || "");
24598
24552
  } catch (e) {
@@ -24608,7 +24562,7 @@ var SignalImpl = class {
24608
24562
  };
24609
24563
 
24610
24564
  // packages/qwik/src/core/shared/jsx/props-proxy.ts
24611
- import { isDev as isDev9 } from "@qwik.dev/core/build";
24565
+ import { isDev as isDev8 } from "@qwik.dev/core/build";
24612
24566
  function createPropsProxy(owner) {
24613
24567
  return new Proxy({}, new PropsProxyHandler(owner));
24614
24568
  }
@@ -24741,7 +24695,7 @@ var addPropsProxyEffect = (propsProxy, prop) => {
24741
24695
  propsProxy.$container$ = ctx.$container$;
24742
24696
  }
24743
24697
  } else {
24744
- isDev9 && assertTrue(
24698
+ isDev8 && assertTrue(
24745
24699
  !ctx.$container$ || ctx.$container$ === propsProxy.$container$,
24746
24700
  "Do not use props across containers"
24747
24701
  );
@@ -24770,7 +24724,7 @@ var isPropsProxy = (obj) => {
24770
24724
  };
24771
24725
 
24772
24726
  // packages/qwik/src/core/reactive-primitives/impl/async-signal-impl.ts
24773
- import { isBrowser, isDev as isDev11, isServer as isServer5 } from "@qwik.dev/core/build";
24727
+ import { isBrowser, isDev as isDev10, isServer as isServer5 } from "@qwik.dev/core/build";
24774
24728
 
24775
24729
  // packages/qwik/src/core/reactive-primitives/subscriber.ts
24776
24730
  import { isServer as isServer4 } from "@qwik.dev/core/build";
@@ -24847,13 +24801,13 @@ var cleanupFn = (target, handleError) => {
24847
24801
  };
24848
24802
 
24849
24803
  // packages/qwik/src/core/reactive-primitives/impl/computed-signal-impl.ts
24850
- import { isDev as isDev10 } from "@qwik.dev/core/build";
24804
+ import { isDev as isDev9 } from "@qwik.dev/core/build";
24851
24805
  var DEBUG2 = false;
24852
24806
  var log2 = (...args) => console.log("COMPUTED SIGNAL", ...args.map(qwikDebugToString));
24853
- var _a3, _b;
24854
- var ComputedSignalImpl = class extends (_b = SignalImpl, _a3 = _EFFECT_BACK_REF, _b) {
24807
+ var _a2, _b;
24808
+ var ComputedSignalImpl = class extends (_b = SignalImpl, _a2 = _EFFECT_BACK_REF, _b) {
24855
24809
  constructor(container, fn, flags = 1 /* INVALID */ | 16 /* SERIALIZATION_STRATEGY_ALWAYS */) {
24856
- super(container || fn.$container$, NEEDS_COMPUTATION);
24810
+ super(container || tryGetInvokeContext()?.$container$, NEEDS_COMPUTATION);
24857
24811
  /**
24858
24812
  * The compute function is stored here.
24859
24813
  *
@@ -24862,7 +24816,7 @@ var ComputedSignalImpl = class extends (_b = SignalImpl, _a3 = _EFFECT_BACK_REF,
24862
24816
  */
24863
24817
  __publicField(this, "$computeQrl$");
24864
24818
  __publicField(this, "$flags$");
24865
- __publicField(this, _a3);
24819
+ __publicField(this, _a2);
24866
24820
  this.$computeQrl$ = fn;
24867
24821
  this.$flags$ = flags;
24868
24822
  }
@@ -24883,7 +24837,7 @@ var ComputedSignalImpl = class extends (_b = SignalImpl, _a3 = _EFFECT_BACK_REF,
24883
24837
  }
24884
24838
  get untrackedValue() {
24885
24839
  this.$computeIfNeeded$();
24886
- isDev10 && assertFalse(this.$untrackedValue$ === NEEDS_COMPUTATION, "Invalid state");
24840
+ isDev9 && assertFalse(this.$untrackedValue$ === NEEDS_COMPUTATION, "Invalid state");
24887
24841
  return this.$untrackedValue$;
24888
24842
  }
24889
24843
  set untrackedValue(value) {
@@ -24946,7 +24900,7 @@ var AsyncJob = class {
24946
24900
  }
24947
24901
  /** Backward compatible cache method for resource */
24948
24902
  cache() {
24949
- isDev11 && console.error(
24903
+ isDev10 && console.error(
24950
24904
  "useResource cache() method does not do anything. Use `useAsync$` instead of `useResource$`, use the `interval` option for polling behavior."
24951
24905
  );
24952
24906
  }
@@ -24962,8 +24916,8 @@ var AsyncJob = class {
24962
24916
  }
24963
24917
  }
24964
24918
  };
24965
- var _a4, _b2;
24966
- var AsyncSignalImpl = class extends (_b2 = ComputedSignalImpl, _a4 = _EFFECT_BACK_REF, _b2) {
24919
+ var _a3, _b2;
24920
+ var AsyncSignalImpl = class extends (_b2 = ComputedSignalImpl, _a3 = _EFFECT_BACK_REF, _b2) {
24967
24921
  constructor(container, fn, flags = 1 /* INVALID */ | 16 /* SERIALIZATION_STRATEGY_ALWAYS */, options) {
24968
24922
  super(container, fn, flags);
24969
24923
  __publicField(this, "$untrackedLoading$", false);
@@ -24976,7 +24930,7 @@ var AsyncSignalImpl = class extends (_b2 = ComputedSignalImpl, _a4 = _EFFECT_BAC
24976
24930
  __publicField(this, "$concurrency$", 1);
24977
24931
  __publicField(this, "$interval$", 0);
24978
24932
  __publicField(this, "$timeoutMs$");
24979
- __publicField(this, _a4);
24933
+ __publicField(this, _a3);
24980
24934
  const interval = options?.interval;
24981
24935
  const concurrency = options?.concurrency ?? 1;
24982
24936
  const initial = options?.initial;
@@ -25017,7 +24971,7 @@ var AsyncSignalImpl = class extends (_b2 = ComputedSignalImpl, _a4 = _EFFECT_BAC
25017
24971
  }
25018
24972
  if ((import.meta.env.TEST ? isServerPlatform() : isServer5) && this.$flags$ & 64 /* CLIENT_ONLY */ && this.$untrackedValue$ === NEEDS_COMPUTATION) {
25019
24973
  throw new Error(
25020
- isDev11 ? "During SSR, cannot read .value from clientOnly async signal without an initial value. Use .loading or provide an initial value." : "Cannot read .value from clientOnly"
24974
+ isDev10 ? "During SSR, cannot read .value from clientOnly async signal without an initial value. Use .loading or provide an initial value." : "Cannot read .value from clientOnly"
25021
24975
  );
25022
24976
  }
25023
24977
  return this.$untrackedValue$;
@@ -25036,7 +24990,7 @@ var AsyncSignalImpl = class extends (_b2 = ComputedSignalImpl, _a4 = _EFFECT_BAC
25036
24990
  const val = this.untrackedLoading;
25037
24991
  const ctx = tryGetInvokeContext();
25038
24992
  if (ctx && (this.$container$ || (this.$container$ = ctx.$container$ || null))) {
25039
- isDev11 && assertTrue(
24993
+ isDev10 && assertTrue(
25040
24994
  !ctx.$container$ || ctx.$container$ === this.$container$,
25041
24995
  "Do not use signals across containers"
25042
24996
  );
@@ -25069,7 +25023,7 @@ var AsyncSignalImpl = class extends (_b2 = ComputedSignalImpl, _a4 = _EFFECT_BAC
25069
25023
  const val = this.untrackedError;
25070
25024
  const ctx = tryGetInvokeContext();
25071
25025
  if (ctx && (this.$container$ || (this.$container$ = ctx.$container$ || null))) {
25072
- isDev11 && assertTrue(
25026
+ isDev10 && assertTrue(
25073
25027
  !ctx.$container$ || ctx.$container$ === this.$container$,
25074
25028
  "Do not use signals across containers"
25075
25029
  );
@@ -25474,7 +25428,7 @@ function setCursorData(vNode, cursorData) {
25474
25428
  }
25475
25429
 
25476
25430
  // packages/qwik/src/core/client/vnode-diff.ts
25477
- import { isDev as isDev15 } from "@qwik.dev/core/build";
25431
+ import { isDev as isDev14 } from "@qwik.dev/core/build";
25478
25432
 
25479
25433
  // packages/qwik/src/core/reactive-primitives/subscription-data.ts
25480
25434
  var SubscriptionData = class {
@@ -25485,14 +25439,14 @@ var SubscriptionData = class {
25485
25439
  };
25486
25440
 
25487
25441
  // packages/qwik/src/core/shared/component-execution.ts
25488
- import { isDev as isDev13, isServer as isServer6 } from "@qwik.dev/core/build";
25442
+ import { isDev as isDev12, isServer as isServer6 } from "@qwik.dev/core/build";
25489
25443
 
25490
25444
  // packages/qwik/src/core/shared/component.public.ts
25491
- import { isDev as isDev12 } from "@qwik.dev/core/build";
25445
+ import { isDev as isDev11 } from "@qwik.dev/core/build";
25492
25446
  var componentQrl = (componentQrl3) => {
25493
25447
  function QwikComponent(props, key, flags = 0) {
25494
- isDev12 && assertQrl(componentQrl3);
25495
- isDev12 && assertNumber(flags, "The Qwik Component was not invoked correctly");
25448
+ isDev11 && assertQrl(componentQrl3);
25449
+ isDev11 && assertNumber(flags, "The Qwik Component was not invoked correctly");
25496
25450
  const hash3 = qTest ? "sX" : componentQrl3.$hash$.slice(0, 4);
25497
25451
  const finalKey = hash3 + ":" + (key ? key : "");
25498
25452
  const InnerCmp = () => {
@@ -25597,7 +25551,7 @@ var executeComponent = (container, renderHost, subscriptionHost, componentQRL, p
25597
25551
  let isInlineComponent = false;
25598
25552
  if (componentQRL === null) {
25599
25553
  componentQRL = container.getHostProp(renderHost, OnRenderProp);
25600
- isDev13 && assertDefined(componentQRL, "No Component found at this location");
25554
+ isDev12 && assertDefined(componentQRL, "No Component found at this location");
25601
25555
  }
25602
25556
  if (isQrl(componentQRL)) {
25603
25557
  props = props || container.getHostProp(renderHost, ELEMENT_PROPS) || EMPTY_OBJ;
@@ -25676,7 +25630,7 @@ function addUseOnEvents(jsx2, useOnEvents) {
25676
25630
  }
25677
25631
  targetElement = placeholderElement;
25678
25632
  } else {
25679
- if (isDev13) {
25633
+ if (isDev12) {
25680
25634
  logWarn(
25681
25635
  'You are trying to add an event "' + key + '" using `useOn` hook, but a node to which you can add an event is not found. Please make sure that the component has a valid element node. '
25682
25636
  );
@@ -25687,7 +25641,7 @@ function addUseOnEvents(jsx2, useOnEvents) {
25687
25641
  if (targetElement) {
25688
25642
  if (targetElement.type === "script" && key === qVisibleEvent) {
25689
25643
  eventKey = "q-d:qinit";
25690
- if (isDev13) {
25644
+ if (isDev12) {
25691
25645
  logWarn(
25692
25646
  'You are trying to add an event "' + key + '" using the `useVisibleTask$` hook with the "intersection-observer" strategy, but a node to which you can add an event is not found. Using "document-ready" or "document-idle" instead.'
25693
25647
  );
@@ -25774,9 +25728,9 @@ var SSRRaw = () => null;
25774
25728
  var SSRComment = () => null;
25775
25729
 
25776
25730
  // packages/qwik/src/core/client/vnode-namespace.ts
25777
- import { isDev as isDev14 } from "@qwik.dev/core/build";
25731
+ import { isDev as isDev13 } from "@qwik.dev/core/build";
25778
25732
  var isForeignObjectElement = (elementName) => {
25779
- return isDev14 ? elementName.toLowerCase() === "foreignobject" : elementName === "foreignObject";
25733
+ return isDev13 ? elementName.toLowerCase() === "foreignobject" : elementName === "foreignObject";
25780
25734
  };
25781
25735
  var isSvgElement = (elementName) => elementName === "svg" || isForeignObjectElement(elementName);
25782
25736
  var isMathElement = (elementName) => elementName === "math";
@@ -26633,8 +26587,8 @@ var vnode_diff = (container, journal, jsxNode, vStartNode, cursor, scopedStyleId
26633
26587
  }
26634
26588
  };
26635
26589
  function diff(diffContext, jsxNode, vStartNode) {
26636
- isDev15 && assertFalse(vnode_isVNode(jsxNode), "JSXNode should not be a VNode");
26637
- isDev15 && assertTrue(vnode_isVNode(vStartNode), "vStartNode should be a VNode");
26590
+ isDev14 && assertFalse(vnode_isVNode(jsxNode), "JSXNode should not be a VNode");
26591
+ isDev14 && assertTrue(vnode_isVNode(vStartNode), "vStartNode should be a VNode");
26638
26592
  diffContext.$vParent$ = vStartNode;
26639
26593
  diffContext.$vNewNode$ = null;
26640
26594
  diffContext.$vCurrent$ = vnode_getFirstChild(vStartNode);
@@ -26644,7 +26598,7 @@ function diff(diffContext, jsxNode, vStartNode) {
26644
26598
  }
26645
26599
  while (diffContext.$stack$.length) {
26646
26600
  while (diffContext.$jsxIdx$ < diffContext.$jsxCount$) {
26647
- isDev15 && assertFalse(
26601
+ isDev14 && assertFalse(
26648
26602
  diffContext.$vParent$ === diffContext.$vCurrent$,
26649
26603
  "Parent and current can't be the same"
26650
26604
  );
@@ -26775,7 +26729,7 @@ function descend(diffContext, children, descendVNode, shouldExpectNoChildren = t
26775
26729
  }
26776
26730
  stackPush(diffContext, children, descendVNode);
26777
26731
  if (descendVNode) {
26778
- isDev15 && assertDefined(
26732
+ isDev14 && assertDefined(
26779
26733
  diffContext.$vCurrent$ || diffContext.$vNewNode$,
26780
26734
  "Expecting vCurrent to be defined."
26781
26735
  );
@@ -26903,8 +26857,8 @@ function expectProjection(diffContext) {
26903
26857
  diffContext.$vCurrent$ = diffContext.$vCurrent$ && diffContext.$vCurrent$.flags & 32 /* Deleted */ ? null : diffContext.$vCurrent$;
26904
26858
  if (diffContext.$vCurrent$ == null) {
26905
26859
  diffContext.$vNewNode$ = vnode_newVirtual();
26906
- isDev15 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "P" /* Projection */);
26907
- isDev15 && vnode_setProp(diffContext.$vNewNode$, "q:code", "expectProjection");
26860
+ isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "P" /* Projection */);
26861
+ isDev14 && vnode_setProp(diffContext.$vNewNode$, "q:code", "expectProjection");
26908
26862
  vnode_setProp(diffContext.$vNewNode$, QSlot, slotName);
26909
26863
  diffContext.$vNewNode$.slotParent = diffContext.$vParent$;
26910
26864
  vnode_setProp(diffContext.$vParent$, slotName, diffContext.$vNewNode$);
@@ -26925,7 +26879,7 @@ function expectSlot(diffContext) {
26925
26879
  diffContext.$vNewNode$ = vnode_newVirtual();
26926
26880
  vnode_setProp(diffContext.$vNewNode$, QSlot, slotNameKey);
26927
26881
  vHost && vnode_setProp(vHost, slotNameKey, diffContext.$vNewNode$);
26928
- isDev15 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "P" /* Projection */);
26882
+ isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "P" /* Projection */);
26929
26883
  vnode_insertBefore(
26930
26884
  diffContext.$journal$,
26931
26885
  diffContext.$vParent$,
@@ -26939,7 +26893,7 @@ function expectSlot(diffContext) {
26939
26893
  diffContext.$vNewNode$ = vProjectedNode;
26940
26894
  vnode_setProp(diffContext.$vNewNode$, QSlot, slotNameKey);
26941
26895
  vHost && vnode_setProp(vHost, slotNameKey, diffContext.$vNewNode$);
26942
- isDev15 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "P" /* Projection */);
26896
+ isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "P" /* Projection */);
26943
26897
  vnode_inflateProjectionTrailingText(
26944
26898
  diffContext.$journal$,
26945
26899
  diffContext.$vNewNode$
@@ -27035,7 +26989,7 @@ function expectNoChildren(diffContext, removeDOM = true) {
27035
26989
  }
27036
26990
  }
27037
26991
  function expectNoMore(diffContext) {
27038
- isDev15 && assertFalse(
26992
+ isDev14 && assertFalse(
27039
26993
  diffContext.$vParent$ === diffContext.$vCurrent$,
27040
26994
  "Parent and current can't be the same"
27041
26995
  );
@@ -27121,7 +27075,7 @@ function createNewElement(diffContext, jsx2, elementName, currentFile) {
27121
27075
  }
27122
27076
  if (elementName === "textarea" && key2 === "value") {
27123
27077
  if (value && typeof value !== "string") {
27124
- if (isDev15) {
27078
+ if (isDev14) {
27125
27079
  throw qError(23 /* wrongTextareaValue */, [currentFile, value]);
27126
27080
  }
27127
27081
  continue;
@@ -27220,7 +27174,7 @@ function expectElement(diffContext, jsx2, elementName) {
27220
27174
  const jsxProps = jsx2.varProps;
27221
27175
  const vNode = diffContext.$vNewNode$ || diffContext.$vCurrent$;
27222
27176
  if (jsxProps) {
27223
- diffProps(diffContext, vNode, jsxProps, isDev15 && getFileLocationFromJsx(jsx2.dev) || null);
27177
+ diffProps(diffContext, vNode, jsxProps, isDev14 && getFileLocationFromJsx(jsx2.dev) || null);
27224
27178
  }
27225
27179
  }
27226
27180
  function diffProps(diffContext, vnode, newAttrs, currentFile) {
@@ -27486,7 +27440,7 @@ function expectVirtual(diffContext, type, jsxKey) {
27486
27440
  diffContext.$vCurrent$ && getInsertBefore(diffContext)
27487
27441
  );
27488
27442
  diffContext.$vNewNode$.key = jsxKey;
27489
- isDev15 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, type);
27443
+ isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, type);
27490
27444
  return;
27491
27445
  }
27492
27446
  if (moveOrCreateKeyedNode(
@@ -27504,7 +27458,7 @@ function expectVirtual(diffContext, type, jsxKey) {
27504
27458
  diffContext.$vCurrent$ && getInsertBefore(diffContext)
27505
27459
  );
27506
27460
  diffContext.$vNewNode$.key = jsxKey;
27507
- isDev15 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, type);
27461
+ isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, type);
27508
27462
  }
27509
27463
  }
27510
27464
  function expectComponent(diffContext, component) {
@@ -27617,7 +27571,7 @@ function insertNewComponent(diffContext, host, componentQRL, jsxProps) {
27617
27571
  diffContext.$vCurrent$ && getInsertBefore(diffContext)
27618
27572
  );
27619
27573
  const jsxNode = diffContext.$jsxValue$;
27620
- isDev15 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "C" /* Component */);
27574
+ isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "C" /* Component */);
27621
27575
  vnode_setProp(diffContext.$vNewNode$, OnRenderProp, componentQRL);
27622
27576
  vnode_setProp(diffContext.$vNewNode$, ELEMENT_PROPS, jsxProps);
27623
27577
  diffContext.$vNewNode$.key = jsxNode.key;
@@ -27630,7 +27584,7 @@ function insertNewInlineComponent(diffContext) {
27630
27584
  diffContext.$vCurrent$ && getInsertBefore(diffContext)
27631
27585
  );
27632
27586
  const jsxNode = diffContext.$jsxValue$;
27633
- isDev15 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "I" /* InlineComponent */);
27587
+ isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "I" /* InlineComponent */);
27634
27588
  vnode_setProp(diffContext.$vNewNode$, ELEMENT_PROPS, jsxNode.props);
27635
27589
  if (jsxNode.key) {
27636
27590
  diffContext.$vNewNode$.key = jsxNode.key;
@@ -28242,7 +28196,7 @@ var createMacroTask = (fn) => {
28242
28196
  };
28243
28197
 
28244
28198
  // packages/qwik/src/core/shared/cursor/cursor-walker.ts
28245
- import { isBrowser as isBrowser2, isDev as isDev16, isServer as isServer7 } from "@qwik.dev/core/build";
28199
+ import { isBrowser as isBrowser2, isDev as isDev15, isServer as isServer7 } from "@qwik.dev/core/build";
28246
28200
  var DEBUG6 = false;
28247
28201
  var nextMicroTask = createMicroTask(processCursorQueue);
28248
28202
  var nextMacroTask = createMacroTask(processCursorQueue);
@@ -28279,7 +28233,7 @@ function walkCursor(cursor, options) {
28279
28233
  return;
28280
28234
  }
28281
28235
  const container = cursorData.container;
28282
- isDev16 && assertDefined(container, "Cursor container not found");
28236
+ isDev15 && assertDefined(container, "Cursor container not found");
28283
28237
  if (!cursor.dirty) {
28284
28238
  finishWalk(container, cursor, cursorData, isRunningOnServer);
28285
28239
  return;
@@ -28357,7 +28311,7 @@ function walkCursor(cursor, options) {
28357
28311
  }
28358
28312
  }
28359
28313
  }
28360
- isDev16 && assertFalse(
28314
+ isDev15 && assertFalse(
28361
28315
  !!(cursor.dirty & 127 /* DIRTY_MASK */ && !cursorData.position),
28362
28316
  "Cursor is still dirty and position is not set after walking"
28363
28317
  );
@@ -28595,9 +28549,9 @@ function addVNodeOperation(journal, operation) {
28595
28549
  }
28596
28550
 
28597
28551
  // packages/qwik/src/core/reactive-primitives/impl/wrapped-signal-impl.ts
28598
- import { isDev as isDev17 } from "@qwik.dev/core/build";
28599
- var _a5, _b3;
28600
- var WrappedSignalImpl = class extends (_b3 = SignalImpl, _a5 = _EFFECT_BACK_REF, _b3) {
28552
+ import { isDev as isDev16 } from "@qwik.dev/core/build";
28553
+ var _a4, _b3;
28554
+ var WrappedSignalImpl = class extends (_b3 = SignalImpl, _a4 = _EFFECT_BACK_REF, _b3) {
28601
28555
  constructor(container, fn, args, fnStr, flags = 1 /* INVALID */ | 4 /* UNWRAP */) {
28602
28556
  super(container, NEEDS_COMPUTATION);
28603
28557
  __publicField(this, "$args$");
@@ -28607,7 +28561,7 @@ var WrappedSignalImpl = class extends (_b3 = SignalImpl, _a5 = _EFFECT_BACK_REF,
28607
28561
  __publicField(this, "$hostElement$");
28608
28562
  // important: don't use implemnets BackRef here
28609
28563
  // it causes v8 optimizations eager bailouts, because of not consistent class shape
28610
- __publicField(this, _a5);
28564
+ __publicField(this, _a4);
28611
28565
  this.$args$ = args;
28612
28566
  this.$func$ = fn;
28613
28567
  this.$funcStr$ = fnStr;
@@ -28630,7 +28584,7 @@ var WrappedSignalImpl = class extends (_b3 = SignalImpl, _a5 = _EFFECT_BACK_REF,
28630
28584
  }
28631
28585
  get untrackedValue() {
28632
28586
  this.$computeIfNeeded$();
28633
- isDev17 && assertFalse(this.$untrackedValue$ === NEEDS_COMPUTATION, "Invalid state");
28587
+ isDev16 && assertFalse(this.$untrackedValue$ === NEEDS_COMPUTATION, "Invalid state");
28634
28588
  return this.$untrackedValue$;
28635
28589
  }
28636
28590
  $computeIfNeeded$() {
@@ -28867,7 +28821,7 @@ function _chk(_, element) {
28867
28821
  var version = globalThis.QWIK_VERSION;
28868
28822
 
28869
28823
  // packages/qwik/src/core/shared/serdes/serialize.ts
28870
- import { isDev as isDev18 } from "@qwik.dev/core/build";
28824
+ import { isDev as isDev17 } from "@qwik.dev/core/build";
28871
28825
 
28872
28826
  // packages/qwik/src/core/shared/ssr-const.ts
28873
28827
  var LT = "<";
@@ -29251,7 +29205,7 @@ var Serializer = class {
29251
29205
  } else if (value instanceof Error) {
29252
29206
  const out = [value.message];
29253
29207
  out.push(...Object.entries(value).flat());
29254
- if (isDev18) {
29208
+ if (isDev17) {
29255
29209
  out.push("stack", value.stack);
29256
29210
  }
29257
29211
  this.output(15 /* Error */, out);
@@ -29705,11 +29659,15 @@ var allocate = (container, typeId, value) => {
29705
29659
  const [chunkId, symbolId, captureIds] = value.split("#");
29706
29660
  const chunk = container.$getObjectById$(chunkId);
29707
29661
  const symbol = container.$getObjectById$(symbolId);
29708
- qrl = createQRLWithBackChannel(chunk, symbol, captureIds || null);
29662
+ qrl = createQRLWithBackChannel(
29663
+ chunk,
29664
+ symbol,
29665
+ captureIds || null,
29666
+ container
29667
+ );
29709
29668
  } else {
29710
- qrl = createQRLWithBackChannel("", String(value), null);
29669
+ qrl = createQRLWithBackChannel("", String(value), null, container);
29711
29670
  }
29712
- qrl.$container$ = container;
29713
29671
  return qrl;
29714
29672
  }
29715
29673
  case 20 /* Task */:
@@ -29803,6 +29761,17 @@ function retrieveVNodeOrDocument(container, value) {
29803
29761
 
29804
29762
  // packages/qwik/src/core/shared/serdes/inflate.ts
29805
29763
  var loading = Promise.resolve();
29764
+ var dangerousObjectKeys = /* @__PURE__ */ new Set([
29765
+ "constructor",
29766
+ "prototype",
29767
+ "toString",
29768
+ "valueOf",
29769
+ "toJSON",
29770
+ "then"
29771
+ ]);
29772
+ var isSafeObjectKV = (key, value) => {
29773
+ return typeof key === "string" && key !== "__proto__" && (typeof value !== "function" || !dangerousObjectKeys.has(key));
29774
+ };
29806
29775
  var inflate = (container, target, typeId, data) => {
29807
29776
  if (typeId === 0 /* Plain */) {
29808
29777
  return;
@@ -29821,6 +29790,9 @@ var inflate = (container, target, typeId, data) => {
29821
29790
  for (let i2 = 0; i2 < data.length; i2 += 2) {
29822
29791
  const key = data[i2];
29823
29792
  const value = data[i2 + 1];
29793
+ if (!isSafeObjectKV(key, value)) {
29794
+ continue;
29795
+ }
29824
29796
  target[key] = value;
29825
29797
  }
29826
29798
  break;
@@ -30083,7 +30055,212 @@ function restoreEffectBackRefForEffectsMap(effectsMap, consumer) {
30083
30055
  }
30084
30056
  }
30085
30057
 
30058
+ // packages/qwik/src/core/shared/vnode/vnode.ts
30059
+ import { isDev as isDev18 } from "@qwik.dev/core/build";
30060
+ var _a5;
30061
+ _a5 = _EFFECT_BACK_REF;
30062
+ var VNode = class {
30063
+ constructor(flags, parent, previousSibling, nextSibling, props) {
30064
+ this.flags = flags;
30065
+ this.parent = parent;
30066
+ this.previousSibling = previousSibling;
30067
+ this.nextSibling = nextSibling;
30068
+ this.props = props;
30069
+ __publicField(this, _a5);
30070
+ __publicField(this, "slotParent", null);
30071
+ __publicField(this, "dirty", 0 /* NONE */);
30072
+ __publicField(this, "dirtyChildren", null);
30073
+ __publicField(this, "nextDirtyChildIndex", 0);
30074
+ }
30075
+ // TODO: this creates debug issues
30076
+ toString() {
30077
+ if (isDev18) {
30078
+ return vnode_toString.call(this);
30079
+ }
30080
+ return Object.prototype.toString.call(this);
30081
+ }
30082
+ };
30083
+
30084
+ // packages/qwik/src/core/shared/vnode/virtual-vnode.ts
30085
+ var VirtualVNode = class extends VNode {
30086
+ constructor(key, flags, parent, previousSibling, nextSibling, props, firstChild, lastChild) {
30087
+ super(flags, parent, previousSibling, nextSibling, props);
30088
+ this.key = key;
30089
+ this.firstChild = firstChild;
30090
+ this.lastChild = lastChild;
30091
+ }
30092
+ };
30093
+
30094
+ // packages/qwik/src/core/shared/vnode/element-vnode.ts
30095
+ var ElementVNode = class extends VirtualVNode {
30096
+ constructor(key, flags, parent, previousSibling, nextSibling, props, firstChild, lastChild, node, elementName) {
30097
+ super(key, flags, parent, previousSibling, nextSibling, props, firstChild, lastChild);
30098
+ this.node = node;
30099
+ this.elementName = elementName;
30100
+ }
30101
+ };
30102
+
30086
30103
  // packages/qwik/src/core/shared/qrl/qrl-class.ts
30104
+ var LazyRef = class {
30105
+ constructor($chunk$, $symbol$, $symbolFn$, $ref$, container) {
30106
+ this.$chunk$ = $chunk$;
30107
+ this.$symbol$ = $symbol$;
30108
+ this.$symbolFn$ = $symbolFn$;
30109
+ this.$ref$ = $ref$;
30110
+ __publicField(this, "$container$");
30111
+ // Don't allocate dev property immediately so that in prod we don't have this property
30112
+ __publicField(this, "dev");
30113
+ if ($ref$) {
30114
+ this.$setRef$($ref$);
30115
+ }
30116
+ if (container && !$ref$ && typeof $chunk$ === "string" && !$symbolFn$) {
30117
+ this.$container$ = container;
30118
+ }
30119
+ if (qDev) {
30120
+ this.dev = null;
30121
+ }
30122
+ if (isBrowser3 && $chunk$) {
30123
+ preload($chunk$, 0.8);
30124
+ }
30125
+ }
30126
+ /** We don't read hash very often so let's not allocate a string for every QRL */
30127
+ get $hash$() {
30128
+ return getSymbolHash(this.$symbol$);
30129
+ }
30130
+ $setRef$(ref) {
30131
+ this.$ref$ = ref;
30132
+ if (isPromise(ref)) {
30133
+ ref.then(
30134
+ (r) => this.$ref$ = r,
30135
+ (err) => {
30136
+ console.error(`qrl ${this.$symbol$} failed to load`, err);
30137
+ this.$ref$ = null;
30138
+ }
30139
+ );
30140
+ }
30141
+ }
30142
+ /** Load the raw module export without capture binding. */
30143
+ $load$() {
30144
+ if (this.$ref$ != null) {
30145
+ return this.$ref$;
30146
+ }
30147
+ if (this.$chunk$ === "") {
30148
+ isDev19 && assertDefined(this.$container$, "Sync QRL must have container element");
30149
+ const hash3 = this.$container$.$instanceHash$;
30150
+ const doc2 = this.$container$.element?.ownerDocument || document;
30151
+ const qFuncs2 = getQFuncs(doc2, hash3);
30152
+ return this.$ref$ = qFuncs2[Number(this.$symbol$)];
30153
+ }
30154
+ if (isBrowser3 && this.$chunk$) {
30155
+ preload(this.$chunk$, 1);
30156
+ }
30157
+ const symbol = this.$symbol$;
30158
+ const importP = this.$symbolFn$ ? this.$symbolFn$().then((module) => module[symbol]) : getPlatform().importSymbol(
30159
+ this.$container$?.element,
30160
+ this.$chunk$,
30161
+ symbol
30162
+ );
30163
+ this.$setRef$(importP);
30164
+ return this.$ref$;
30165
+ }
30166
+ };
30167
+ var getInstance = (instance) => {
30168
+ return Object.prototype.hasOwnProperty.call(instance, "resolved") ? instance : Object.getPrototypeOf(instance);
30169
+ };
30170
+ var QRLClass = class _QRLClass extends Function {
30171
+ constructor($lazy$, $captures$, container) {
30172
+ super();
30173
+ this.$lazy$ = $lazy$;
30174
+ __publicField(this, "resolved");
30175
+ // This is defined or undefined for the lifetime of the QRL, so we set it lazily
30176
+ __publicField(this, "$captures$");
30177
+ __publicField(this, "$container$");
30178
+ if ($captures$) {
30179
+ this.$captures$ = $captures$;
30180
+ if (typeof $captures$ === "string") {
30181
+ this.$container$ = container;
30182
+ }
30183
+ if (qDev) {
30184
+ if ($captures$ && typeof $captures$ === "object") {
30185
+ for (const item of $captures$) {
30186
+ verifySerializable(item, "Captured variable in the closure can not be serialized");
30187
+ }
30188
+ }
30189
+ }
30190
+ }
30191
+ if ($lazy$.$ref$ != null && typeof this.$captures$ !== "string" && !isPromise($lazy$.$ref$)) {
30192
+ this.resolved = bindCaptures(this, $lazy$.$ref$);
30193
+ }
30194
+ }
30195
+ w(captures) {
30196
+ const newQrl = new _QRLClass(
30197
+ this.$lazy$,
30198
+ captures,
30199
+ this.$captures$ ? this.$container$ : void 0
30200
+ );
30201
+ return makeQrlFn(newQrl);
30202
+ }
30203
+ s(ref) {
30204
+ const qrl = getInstance(this);
30205
+ qrl.$lazy$.$setRef$(ref);
30206
+ qrl.resolved = bindCaptures(qrl, ref);
30207
+ }
30208
+ // --- Getter proxies for backward compat ---
30209
+ get $chunk$() {
30210
+ return this.$lazy$.$chunk$;
30211
+ }
30212
+ get $symbol$() {
30213
+ return this.$lazy$.$symbol$;
30214
+ }
30215
+ get $hash$() {
30216
+ return this.$lazy$.$hash$;
30217
+ }
30218
+ get dev() {
30219
+ return this.$lazy$.dev;
30220
+ }
30221
+ $callFn$(withThis, ...args) {
30222
+ if (this.resolved) {
30223
+ return this.resolved.apply(withThis, args);
30224
+ }
30225
+ const ctx = tryGetInvokeContext();
30226
+ return this.resolve(ctx?.$container$).then(
30227
+ () => invokeApply.call(withThis, ctx, this.resolved, args)
30228
+ );
30229
+ }
30230
+ async resolve(container) {
30231
+ const qrl = getInstance(this);
30232
+ return maybeThen($resolve$(qrl, container), () => qrl.resolved);
30233
+ }
30234
+ getSymbol() {
30235
+ return this.$symbol$;
30236
+ }
30237
+ getHash() {
30238
+ return this.$hash$;
30239
+ }
30240
+ getCaptured() {
30241
+ const qrl = getInstance(this);
30242
+ ensureQrlCaptures(qrl);
30243
+ return qrl.$captures$;
30244
+ }
30245
+ getFn(currentCtx, beforeFn) {
30246
+ const qrl = getInstance(this);
30247
+ const bound = (...args) => {
30248
+ if (!qrl.resolved) {
30249
+ return qrl.resolve().then((fn) => {
30250
+ if (qDev && !isFunction(fn)) {
30251
+ throw qError(5 /* qrlIsNotFunction */);
30252
+ }
30253
+ return bound(...args);
30254
+ });
30255
+ }
30256
+ if (beforeFn && beforeFn() === false) {
30257
+ return void 0;
30258
+ }
30259
+ return invokeApply(currentCtx, qrl.resolved, args);
30260
+ };
30261
+ return bound;
30262
+ }
30263
+ };
30087
30264
  var _captures = null;
30088
30265
  var setCaptures = (captures) => {
30089
30266
  _captures = captures;
@@ -30097,166 +30274,71 @@ var deserializeCaptures = (container, captures) => {
30097
30274
  };
30098
30275
  var ensureQrlCaptures = (qrl) => {
30099
30276
  _captures = qrl.$captures$;
30277
+ const container = qrl.$container$;
30100
30278
  if (typeof _captures === "string") {
30101
- if (!qrl.$container$) {
30279
+ if (!container) {
30102
30280
  throw qError(13 /* qrlMissingContainer */);
30103
30281
  }
30104
30282
  const prevLoading = loading;
30105
- _captures = qrl.$captures$ = deserializeCaptures(qrl.$container$, _captures);
30283
+ _captures = qrl.$captures$ = deserializeCaptures(container, _captures);
30106
30284
  if (loading !== prevLoading) {
30107
30285
  return loading;
30108
30286
  }
30109
30287
  }
30110
30288
  };
30111
- function bindFnToContext(qrl, currentCtx, beforeFn) {
30112
- const bound = (...args) => {
30113
- if (!qrl.resolved) {
30114
- return qrl.resolve().then((fn) => {
30115
- if (!isFunction(fn)) {
30116
- throw qError(5 /* qrlIsNotFunction */);
30117
- }
30118
- return bound(...args);
30119
- });
30120
- }
30121
- if (beforeFn && beforeFn() === false) {
30122
- return;
30123
- }
30124
- return invokeApply.call(this, currentCtx, qrl.resolved, args);
30125
- };
30126
- return bound;
30127
- }
30128
- var bindCaptures = (qrl, fn) => {
30129
- if (typeof fn !== "function" || !qrl.$captures$) {
30130
- return fn;
30289
+ var bindCaptures = (qrl, ref) => {
30290
+ if (typeof ref !== "function" || !qrl.$captures$) {
30291
+ return ref;
30131
30292
  }
30132
- return function withCaptures(...args) {
30293
+ return function boundCaptures(...args) {
30133
30294
  ensureQrlCaptures(qrl);
30134
- return fn.apply(this, args);
30295
+ return ref.apply(this, args);
30135
30296
  };
30136
30297
  };
30137
- var makeResolveFunction = (qrl, symbolFn) => {
30138
- let symbolRef;
30139
- return async (container) => {
30140
- if (symbolRef != null) {
30141
- return symbolRef;
30142
- }
30298
+ var $resolve$ = (qrl, container) => {
30299
+ const lazy = qrl.$lazy$;
30300
+ const shouldDeserialize = typeof qrl.$captures$ === "string";
30301
+ if (shouldDeserialize && !qrl.$container$) {
30143
30302
  if (container) {
30144
30303
  qrl.$container$ = container;
30145
- } else if (!qrl.$container$) {
30146
- const ctx = tryGetInvokeContext();
30147
- if (ctx?.$container$) {
30148
- qrl.$container$ = ctx.$container$;
30149
- }
30150
- }
30151
- if (qrl.$chunk$ === "") {
30152
- isDev19 && assertDefined(qrl.$container$, "Sync QRL must have container element");
30153
- const hash3 = qrl.$container$.$instanceHash$;
30154
- const doc2 = qrl.$container$.element?.ownerDocument || document;
30155
- const qFuncs2 = getQFuncs(doc2, hash3);
30156
- return qrl.resolved = symbolRef = qFuncs2[Number(qrl.$symbol$)];
30157
- }
30158
- if (isBrowser3 && qrl.$chunk$) {
30159
- preload(qrl.$chunk$, 1);
30160
- }
30161
- const start = now();
30162
- const symbol = qrl.$symbol$;
30163
- const importP = symbolFn ? symbolFn().then((module) => module[symbol]) : getPlatform().importSymbol(
30164
- qrl.$container$?.element,
30165
- qrl.$chunk$,
30166
- symbol
30167
- );
30168
- symbolRef = maybeThen(importP, (resolved) => {
30169
- if (!isDev19 && symbolFn) {
30170
- symbolFn[symbol] = resolved;
30171
- }
30172
- return symbolRef = qrl.resolved = bindCaptures(qrl, resolved);
30173
- });
30174
- if (isPromise(symbolRef)) {
30175
- const ctx = tryGetInvokeContext();
30176
- symbolRef.then(
30177
- () => emitUsedSymbol(
30178
- symbol,
30179
- ctx?.$hostElement$ instanceof ElementVNode ? ctx?.$hostElement$.node : void 0,
30180
- start
30181
- ),
30182
- (err) => {
30183
- console.error(`qrl ${symbol} failed to load`, err);
30184
- symbolRef = null;
30185
- }
30186
- );
30187
- }
30188
- if (qrl.$container$) {
30189
- await ensureQrlCaptures(qrl);
30190
- }
30191
- return symbolRef;
30192
- };
30193
- };
30194
- function getSymbol() {
30195
- return this.$symbol$;
30196
- }
30197
- function getHash() {
30198
- return this.$hash$;
30199
- }
30200
- function getCaptured() {
30201
- ensureQrlCaptures(this);
30202
- return this.$captures$;
30203
- }
30204
- var createQRL = (chunk, symbol, symbolRef, symbolFn, captures) => {
30205
- const origSymbolRef = symbolRef;
30206
- if (qDev && qSerialize) {
30207
- if (captures && typeof captures === "object") {
30208
- for (const item of captures) {
30209
- verifySerializable(item, "Captured variable in the closure can not be serialized");
30210
- }
30304
+ } else {
30305
+ qrl.$container$ = tryGetInvokeContext()?.$container$;
30211
30306
  }
30212
30307
  }
30213
- const qrl = async function qrlFn(...args) {
30214
- if (qrl.resolved) {
30215
- return qrl.resolved.apply(this, args);
30216
- }
30217
- const ctx = tryGetInvokeContext();
30218
- await qrl.resolve(ctx?.$container$);
30219
- return invokeApply.call(this, ctx, qrl.resolved, args);
30220
- };
30221
- if (symbolFn && symbol in symbolFn) {
30222
- symbolRef = symbolFn[symbol];
30223
- }
30224
- const resolve = symbolRef != null ? async () => symbolRef : makeResolveFunction(qrl, symbolFn);
30225
- const hash3 = getSymbolHash(symbol);
30226
- Object.assign(qrl, {
30227
- getSymbol,
30228
- getHash,
30229
- getCaptured,
30230
- // This can be called with other `this`
30231
- getFn: function(currentCtx, beforeFn) {
30232
- return bindFnToContext.call(this, qrl, currentCtx, beforeFn);
30233
- },
30234
- resolve,
30235
- resolved: void 0,
30236
- $chunk$: chunk,
30237
- $symbol$: symbol,
30238
- $hash$: hash3,
30239
- $captures$: captures,
30240
- $container$: null
30308
+ if (qrl.resolved) {
30309
+ return;
30310
+ }
30311
+ const start = now();
30312
+ const ctx = tryGetInvokeContext();
30313
+ const rawOrPromise = lazy.$load$();
30314
+ const maybePromise = maybeThen(rawOrPromise, (raw) => {
30315
+ qrl.resolved = bindCaptures(qrl, raw);
30241
30316
  });
30242
- if (qDev) {
30243
- qrl.dev = null;
30244
- qrl.$symbolRef$ = origSymbolRef;
30245
- seal(qrl);
30246
- }
30247
- if (symbolRef != null) {
30248
- symbolRef = maybeThen(
30249
- ensureQrlCaptures(qrl),
30250
- () => maybeThen(symbolRef, (resolved) => {
30251
- symbolRef = qrl.resolved = bindCaptures(qrl, resolved);
30252
- return symbolRef;
30253
- })
30317
+ if (maybePromise) {
30318
+ const symbol = lazy.$symbol$;
30319
+ emitUsedSymbol(
30320
+ symbol,
30321
+ ctx?.$hostElement$ instanceof ElementVNode ? ctx?.$hostElement$.node : void 0,
30322
+ start
30254
30323
  );
30255
30324
  }
30256
- if (isBrowser3 && chunk) {
30257
- preload(chunk, 0.8);
30325
+ const capturedPromise = shouldDeserialize && qrl.$container$ && ensureQrlCaptures(qrl);
30326
+ if (capturedPromise) {
30327
+ return capturedPromise.then(() => maybePromise);
30258
30328
  }
30259
- return qrl;
30329
+ return maybePromise;
30330
+ };
30331
+ var createQRL = (chunk, symbol, symbolRef, symbolFn, captures, container) => {
30332
+ const lazy = new LazyRef(chunk, symbol, symbolFn, symbolRef, container);
30333
+ const qrl = new QRLClass(lazy, captures, container);
30334
+ return makeQrlFn(qrl);
30335
+ };
30336
+ var makeQrlFn = (qrl) => {
30337
+ const qrlFn = async function(...args) {
30338
+ return qrl.$callFn$(this, ...args);
30339
+ };
30340
+ Object.setPrototypeOf(qrlFn, qrl);
30341
+ return qrlFn;
30260
30342
  };
30261
30343
  var EMITTED = /* @__PURE__ */ new Set();
30262
30344
  var emitUsedSymbol = (symbol, element, reqTime) => {
@@ -30758,12 +30840,14 @@ function processVNodeData(document2) {
30758
30840
  nextNode = null;
30759
30841
  } else if (nodeType === 64 /* COMMENT_ISLAND_END */) {
30760
30842
  nextNode = node;
30843
+ let nextNodeType;
30761
30844
  do {
30762
30845
  nextNode = walker2.nextNode();
30763
30846
  if (!nextNode) {
30764
30847
  throw new Error(`Ignore block not closed!`);
30765
30848
  }
30766
- } while (getFastNodeType(nextNode) !== 32 /* COMMENT_IGNORE_END */);
30849
+ nextNodeType = getFastNodeType(nextNode);
30850
+ } while (nextNodeType !== 32 /* COMMENT_IGNORE_END */ && nextNodeType !== 65 /* COMMENT_ISLAND_START */);
30767
30851
  nextNode = null;
30768
30852
  } else if (nodeType === 9 /* COMMENT_SKIP_START */) {
30769
30853
  nextNode = node;
@@ -30958,8 +31042,7 @@ var DomContainer = class extends _SharedContainer {
30958
31042
  this.$stateData$[id] = vParent;
30959
31043
  }
30960
31044
  parseQRL(qrlStr) {
30961
- const qrl = parseQRL(qrlStr);
30962
- qrl.$container$ = this;
31045
+ const qrl = parseQRL(qrlStr, this);
30963
31046
  return qrl;
30964
31047
  }
30965
31048
  handleError(err, host) {
@@ -32242,7 +32325,7 @@ var vnode_newElement = (element, elementName, key = null) => {
32242
32325
  isDev25 && assertEqual(fastNodeType(element), 1, "Expecting element node.");
32243
32326
  const vnode = new ElementVNode(
32244
32327
  key,
32245
- 1 /* Element */ | 8 /* Inflated */ | -1 << 11 /* shift */,
32328
+ 1 /* Element */ | 8 /* Inflated */ | -1 << 12 /* shift */,
32246
32329
  // Flag
32247
32330
  null,
32248
32331
  null,
@@ -32260,7 +32343,7 @@ var vnode_newUnMaterializedElement = (element) => {
32260
32343
  isDev25 && assertEqual(fastNodeType(element), 1, "Expecting element node.");
32261
32344
  const vnode = new ElementVNode(
32262
32345
  null,
32263
- 1 /* Element */ | -1 << 11 /* shift */,
32346
+ 1 /* Element */ | -1 << 12 /* shift */,
32264
32347
  // Flag
32265
32348
  null,
32266
32349
  null,
@@ -32277,7 +32360,7 @@ var vnode_newUnMaterializedElement = (element) => {
32277
32360
  var vnode_newSharedText = (previousTextNode, sharedTextNode, textContent) => {
32278
32361
  isDev25 && sharedTextNode && assertEqual(fastNodeType(sharedTextNode), 3, "Expecting text node.");
32279
32362
  const vnode = new TextVNode(
32280
- 4 /* Text */ | -1 << 11 /* shift */,
32363
+ 4 /* Text */ | -1 << 12 /* shift */,
32281
32364
  // Flag
32282
32365
  null,
32283
32366
  // Parent
@@ -32293,7 +32376,7 @@ var vnode_newSharedText = (previousTextNode, sharedTextNode, textContent) => {
32293
32376
  };
32294
32377
  var vnode_newText = (textNode, textContent) => {
32295
32378
  const vnode = new TextVNode(
32296
- 4 /* Text */ | 8 /* Inflated */ | -1 << 11 /* shift */,
32379
+ 4 /* Text */ | 8 /* Inflated */ | -1 << 12 /* shift */,
32297
32380
  // Flags
32298
32381
  null,
32299
32382
  // Parent
@@ -32316,7 +32399,7 @@ var vnode_newText = (textNode, textContent) => {
32316
32399
  var vnode_newVirtual = () => {
32317
32400
  const vnode = new VirtualVNode(
32318
32401
  null,
32319
- 2 /* Virtual */ | -1 << 11 /* shift */,
32402
+ 2 /* Virtual */ | -1 << 12 /* shift */,
32320
32403
  // Flags
32321
32404
  null,
32322
32405
  null,
@@ -32480,8 +32563,7 @@ function registerQrlHandlers(attr, key, container, element) {
32480
32563
  const scopedKebabName = key.slice(2);
32481
32564
  const qrls = value.split("|");
32482
32565
  const handlers = qrls.map((qrl) => {
32483
- const handler = parseQRL(qrl);
32484
- handler.$container$ = container;
32566
+ const handler = parseQRL(qrl, container);
32485
32567
  return handler;
32486
32568
  });
32487
32569
  (element._qDispatch || (element._qDispatch = {}))[scopedKebabName] = handlers;
@@ -32710,7 +32792,7 @@ var vnode_locate = (rootVNode, id) => {
32710
32792
  var vnode_getChildWithIdx = (vNode, childIdx) => {
32711
32793
  let child = vnode_getFirstChild(vNode);
32712
32794
  isDev25 && assertDefined(child, "Missing child.");
32713
- while (child.flags >>> 11 /* shift */ !== childIdx) {
32795
+ while (child.flags >>> 12 /* shift */ !== childIdx) {
32714
32796
  child = child.nextSibling;
32715
32797
  isDev25 && assertDefined(child, "Missing child.");
32716
32798
  }
@@ -32882,8 +32964,9 @@ var vnode_insertVirtualBefore = (journal, parent, newChild, insertBefore) => {
32882
32964
  }
32883
32965
  vnode_unlinkFromOldParent(journal, newChildCurrentParent, parent, newChild);
32884
32966
  const parentIsDeleted = parent.flags & 32 /* Deleted */;
32885
- const domParentVNode = parentIsElement ? parent : vnode_getDomParentVNode(parent, false);
32886
- const parentNode = domParentVNode?.node;
32967
+ const targetEl = !parentIsElement && parent.flags & 2048 /* HasTargetElement */ ? parent.props?.[QTargetElement] : null;
32968
+ const domParentVNode = targetEl ? null : parentIsElement ? parent : vnode_getDomParentVNode(parent, false);
32969
+ const parentNode = targetEl || domParentVNode?.node;
32887
32970
  const adjustedInsertBefore = vnode_findInsertBefore(journal, parent, insertBefore);
32888
32971
  const adjustedInsertBeforeNode = adjustedInsertBefore?.node ?? null;
32889
32972
  const isProjection = vnode_isProjection(newChild);
@@ -32986,8 +33069,13 @@ var vnode_insertBefore = (journal, parent, newChild, insertBefore) => {
32986
33069
  }
32987
33070
  };
32988
33071
  var vnode_getDomParent = (vnode, includeProjection) => {
32989
- vnode = vnode_getDomParentVNode(vnode, includeProjection);
32990
- return vnode && vnode.node;
33072
+ while (vnode && !vnode_isElementVNode(vnode)) {
33073
+ if (vnode.flags & 2048 /* HasTargetElement */) {
33074
+ return vnode.props?.[QTargetElement];
33075
+ }
33076
+ vnode = vnode.parent || (includeProjection ? vnode.slotParent : null);
33077
+ }
33078
+ return vnode ? vnode.node : null;
32991
33079
  };
32992
33080
  var vnode_getDomParentVNode = (vnode, includeProjection) => {
32993
33081
  while (vnode && !vnode_isElementVNode(vnode)) {
@@ -33170,7 +33258,12 @@ var fastNextSibling = (node) => {
33170
33258
  if (nodeValue?.startsWith(QIgnore)) {
33171
33259
  return getNodeAfterCommentNode(node, QContainerIsland, _fastNextSibling, _fastFirstChild);
33172
33260
  } else if (node.nodeValue?.startsWith(QContainerIslandEnd)) {
33173
- return getNodeAfterCommentNode(node, QIgnoreEnd, _fastNextSibling, _fastFirstChild);
33261
+ return getNodeAfterCommentNode(
33262
+ node,
33263
+ [QContainerIsland, QIgnoreEnd],
33264
+ _fastNextSibling,
33265
+ _fastFirstChild
33266
+ );
33174
33267
  } else if (nodeValue?.startsWith(QContainerAttr)) {
33175
33268
  while (node && (node = _fastNextSibling.call(node))) {
33176
33269
  if (fastNodeType(node) === /* Node.COMMENT_NODE */
@@ -33185,8 +33278,22 @@ var fastNextSibling = (node) => {
33185
33278
  return node;
33186
33279
  };
33187
33280
  function getNodeAfterCommentNode(node, commentValue, nextSibling, firstChild) {
33281
+ const isSingleValue = typeof commentValue === "string";
33282
+ const length = commentValue.length;
33188
33283
  while (node) {
33189
- if (node.nodeValue?.startsWith(commentValue)) {
33284
+ const nodeValue = node.nodeValue;
33285
+ let isMatch;
33286
+ if (isSingleValue) {
33287
+ isMatch = nodeValue?.startsWith(commentValue);
33288
+ } else {
33289
+ for (let i = 0; i < length; i++) {
33290
+ if (nodeValue?.startsWith(commentValue[i])) {
33291
+ isMatch = true;
33292
+ break;
33293
+ }
33294
+ }
33295
+ }
33296
+ if (isMatch) {
33190
33297
  node = nextSibling.call(node) || null;
33191
33298
  return node;
33192
33299
  }
@@ -33194,11 +33301,13 @@ function getNodeAfterCommentNode(node, commentValue, nextSibling, firstChild) {
33194
33301
  if (!nextNode) {
33195
33302
  nextNode = nextSibling.call(node);
33196
33303
  }
33197
- if (!nextNode) {
33304
+ while (!nextNode) {
33198
33305
  nextNode = fastParentNode(node);
33199
- if (nextNode) {
33200
- nextNode = nextSibling.call(nextNode);
33306
+ if (!nextNode) {
33307
+ break;
33201
33308
  }
33309
+ node = nextNode;
33310
+ nextNode = nextSibling.call(nextNode);
33202
33311
  }
33203
33312
  node = nextNode;
33204
33313
  }
@@ -33211,6 +33320,13 @@ var fastFirstChild = (node) => {
33211
33320
  _fastFirstChild = fastGetter(node, "firstChild");
33212
33321
  }
33213
33322
  node = node && _fastFirstChild.call(node);
33323
+ if (node && fastNodeType(node) === /* Node.COMMENT_NODE */
33324
+ 8 && node.nodeValue?.startsWith(QIgnore)) {
33325
+ if (!_fastNextSibling) {
33326
+ _fastNextSibling = fastGetter(node, "nextSibling");
33327
+ }
33328
+ return getNodeAfterCommentNode(node, QContainerIsland, _fastNextSibling, _fastFirstChild);
33329
+ }
33214
33330
  while (node && !fastIsTextOrElement(node)) {
33215
33331
  node = fastNextSibling(node);
33216
33332
  }
@@ -33392,7 +33508,7 @@ function vnode_toString(depth = 20, offset = "", materialize2 = false, siblings
33392
33508
  if (vnode_isTextVNode(vnode)) {
33393
33509
  strings.push(qwikDebugToString(vnode_getText(vnode)));
33394
33510
  } else if (vnode_isVirtualVNode(vnode)) {
33395
- const idx = vnode.flags >>> 11 /* shift */;
33511
+ const idx = vnode.flags >>> 12 /* shift */;
33396
33512
  const attrs = ["[" + String(idx) + "]"];
33397
33513
  if (vnode.dirty) {
33398
33514
  attrs.push(` dirty:${vnode.dirty}`);
@@ -33482,7 +33598,7 @@ function materializeFromVNodeData(vParent, vData, element, child) {
33482
33598
  let vLast = null;
33483
33599
  let previousTextNode = null;
33484
33600
  const addVNode = (node) => {
33485
- node.flags = node.flags & 2047 /* mask */ | idx << 11 /* shift */;
33601
+ node.flags = node.flags & 4095 /* mask */ | idx << 12 /* shift */;
33486
33602
  idx++;
33487
33603
  vLast && (vLast.nextSibling = node);
33488
33604
  node.previousSibling = vLast;