@askrjs/askr 0.0.73 → 0.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/actions/index.d.ts +1 -1
  2. package/dist/actions/index.js +2 -2
  3. package/dist/{activity-C2tPn9Fr.js → activity-386uXmPJ.js} +4 -4
  4. package/dist/{activity-CaeDxh-g.d.ts → activity-DaqZEUPh.d.ts} +1 -1
  5. package/dist/{authoring-BJ1KGHmR.js → authoring-ycOVkX1-.js} +3 -3
  6. package/dist/benchmark.js +7 -7
  7. package/dist/boot/index.d.ts +3 -3
  8. package/dist/boot/index.js +1 -1
  9. package/dist/{boot-C-cc9kcY.js → boot-eaBrci4W.js} +12 -12
  10. package/dist/{cleanup-D8Ufd9Ix.js → cleanup-e4Rn287s.js} +3 -3
  11. package/dist/{component-cleanup-1ZFoLLHt.js → component-cleanup-oWN45rfa.js} +2 -2
  12. package/dist/{component-internal-CPjM4n8M.js → component-internal-iJ7HAcpc.js} +83 -5
  13. package/dist/{component-scope-CC3cojX9.js → component-scope-DzJEbYGE.js} +5 -2
  14. package/dist/components/index.d.ts +1 -1
  15. package/dist/components/index.js +1 -1
  16. package/dist/control/index.d.ts +1 -1
  17. package/dist/control/index.js +1 -1
  18. package/dist/{control-DVRBkN2X.js → control-ByyOdVdr.js} +3 -3
  19. package/dist/{control-DO-iBEtV.d.ts → control-Uvq1GU4K.d.ts} +9 -5
  20. package/dist/{csp-nonce-CwSRP3Jl.js → csp-nonce-BLkoekFX.js} +1 -1
  21. package/dist/data/index.js +1 -1
  22. package/dist/{data-DFcSmGvN.js → data-E7oXei9c.js} +3 -3
  23. package/dist/{deferred-1BRV2Fso.js → deferred-iBBHEN5Z.js} +5 -5
  24. package/dist/{effect-CFUzIpqX.js → effect-2IIWvUjG.js} +1 -1
  25. package/dist/{fastlane-BTcFCMnm.js → fastlane-BbexfvHo.js} +1 -1
  26. package/dist/{for-internal-BtK9Htl0.js → for-internal-tNicxJY3.js} +50 -11
  27. package/dist/foundations/index.d.ts +1 -1
  28. package/dist/foundations/index.js +1 -1
  29. package/dist/foundations/state/index.d.ts +1 -1
  30. package/dist/foundations/state/index.js +1 -1
  31. package/dist/foundations/structures/index.d.ts +1 -1
  32. package/dist/foundations/structures/index.js +1 -1
  33. package/dist/fx/index.js +1 -1
  34. package/dist/{index-BHQmliBq.d.ts → index-CDACZEF2.d.ts} +1 -1
  35. package/dist/{index-5TeJ46BR.d.ts → index-CbRdEUPB.d.ts} +1 -1
  36. package/dist/{index-UmwPZ8ZN.d.ts → index-acX2RLxD.d.ts} +1 -1
  37. package/dist/{index-DSyleBRD.d.ts → index-vo_FDR-B.d.ts} +2 -2
  38. package/dist/index.d.ts +3 -3
  39. package/dist/index.js +9 -9
  40. package/dist/{lifecycle-batch-COgl8jMS.js → lifecycle-batch-CwHCDseR.js} +1 -1
  41. package/dist/{lifecycle-operations-Db-_MG-O.js → lifecycle-operations-D2wzCYYh.js} +2 -2
  42. package/dist/{navigate-BScgmpZP.js → navigate-BwCpLrSM.js} +10 -10
  43. package/dist/{navigate-CPpT8BpL.d.ts → navigate-DlaVqF4n.d.ts} +1 -1
  44. package/dist/{portal-wY3j0vvp.js → portal-EKmTCMKp.js} +4 -4
  45. package/dist/{readable-BYSoWJSv.js → readable-B3VIOfd7.js} +1 -1
  46. package/dist/{renderer-BJYY2Y8s.js → renderer-GFETYwZ6.js} +82 -57
  47. package/dist/resources/index.d.ts +2 -2
  48. package/dist/resources/index.js +5 -5
  49. package/dist/{route-matching-M-f1VQRu.js → route-matching-Dmb_MKUb.js} +4 -4
  50. package/dist/router/index.d.ts +4 -4
  51. package/dist/router/index.js +5 -5
  52. package/dist/{router-wmx6Uher.d.ts → router-Dd-LoJmM.d.ts} +2 -2
  53. package/dist/{selector-DEfqO1rA.js → selector-BzPPLXny.js} +2 -2
  54. package/dist/ssg/index.d.ts +2 -2
  55. package/dist/ssg/index.js +3 -3
  56. package/dist/ssr/index.d.ts +2 -2
  57. package/dist/ssr/index.js +1 -1
  58. package/dist/{ssr-B6pCWgdY.js → ssr-CtumC_es.js} +16 -12
  59. package/dist/{state-CVuQVjvK.js → state-rjmMPExl.js} +3 -3
  60. package/dist/testing/index.d.ts +2 -2
  61. package/dist/testing/index.js +2 -2
  62. package/dist/{verify-hydration-DxOs5H_6.js → verify-hydration-GMsdoOUX.js} +1 -1
  63. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import { a as action, i as ActionValidationError, n as ActionForm, o as defineAction, r as ActionStatus, t as ActionDescriptor } from "../index-DSyleBRD.js";
1
+ import { a as action, i as ActionValidationError, n as ActionForm, o as defineAction, r as ActionStatus, t as ActionDescriptor } from "../index-vo_FDR-B.js";
2
2
  export { ActionDescriptor, ActionForm, ActionStatus, ActionValidationError, action, defineAction };
@@ -1,6 +1,6 @@
1
- import { d as getCurrentAppRenderRuntime } from "../component-scope-CC3cojX9.js";
1
+ import { d as getCurrentAppRenderRuntime } from "../component-scope-DzJEbYGE.js";
2
2
  import { r as getCurrentRenderData } from "../render-context-Clw3rFiO.js";
3
- import { t as state } from "../state-CVuQVjvK.js";
3
+ import { t as state } from "../state-rjmMPExl.js";
4
4
  import { jsx, jsxs } from "../jsx-runtime.js";
5
5
  import { c as resolveDataRuntimeState, s as invalidateQueriesForRuntime } from "../data-runtime-rpV6-3XW.js";
6
6
  //#region src/actions/runtime.ts
@@ -1,8 +1,8 @@
1
- import { a as registerCommitOperation } from "./component-internal-CPjM4n8M.js";
2
- import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BYSoWJSv.js";
3
- import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-CC3cojX9.js";
1
+ import { a as registerCommitOperation } from "./component-internal-iJ7HAcpc.js";
2
+ import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B3VIOfd7.js";
3
+ import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-DzJEbYGE.js";
4
4
  import { n as getActiveRenderContext } from "./render-context-Clw3rFiO.js";
5
- import { c as deepFreeze, g as getActiveRoutes, l as makeQuery, n as computeMatchesFromRoutes, u as parseLocation } from "./route-matching-M-f1VQRu.js";
5
+ import { c as deepFreeze, g as getActiveRoutes, l as makeQuery, n as computeMatchesFromRoutes, u as parseLocation } from "./route-matching-Dmb_MKUb.js";
6
6
  import { n as syncRouteActivitySnapshot } from "./route-activity-CNJfpwx-.js";
7
7
  //#region src/common/app-render-runtime.ts
8
8
  const stagedRouteLocations = /* @__PURE__ */ new WeakMap();
@@ -1,4 +1,4 @@
1
- import { B as RouteSnapshot, E as RouteParams } from "./router-wmx6Uher.js";
1
+ import { B as RouteSnapshot, E as RouteParams } from "./router-Dd-LoJmM.js";
2
2
  //#region src/router/activity.d.ts
3
3
  interface RouteChangeOptions {
4
4
  immediate?: boolean;
@@ -1,6 +1,6 @@
1
- import { f as getCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
2
- import { E as getExecutionModel, x as createRouteHandler } from "./deferred-1BRV2Fso.js";
3
- import { A as insertRecordSorted, C as getCurrentPathPrefix, I as computeRank, L as normalizeRouteSegmentName, M as pushRegistrationScope, O as hasActivePageScope, R as parseSegments, S as getCurrentPageScope, _ as getCurrentInheritedAuthRequirements, b as getCurrentLayoutChain, f as addRouteToStores, p as assertRouteRegistrationUnlocked, v as getCurrentInheritedMeta, w as getCurrentScopeKind, x as getCurrentPageChain, y as getCurrentInheritedPolicies } from "./route-matching-M-f1VQRu.js";
1
+ import { f as getCurrentComponentInstance } from "./component-scope-DzJEbYGE.js";
2
+ import { E as getExecutionModel, x as createRouteHandler } from "./deferred-iBBHEN5Z.js";
3
+ import { A as insertRecordSorted, C as getCurrentPathPrefix, I as computeRank, L as normalizeRouteSegmentName, M as pushRegistrationScope, O as hasActivePageScope, R as parseSegments, S as getCurrentPageScope, _ as getCurrentInheritedAuthRequirements, b as getCurrentLayoutChain, f as addRouteToStores, p as assertRouteRegistrationUnlocked, v as getCurrentInheritedMeta, w as getCurrentScopeKind, x as getCurrentPageChain, y as getCurrentInheritedPolicies } from "./route-matching-Dmb_MKUb.js";
4
4
  import { allOf } from "@askrjs/auth";
5
5
  //#region src/router/access.ts
6
6
  function compileNodePolicies(node) {
package/dist/benchmark.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { r as flushRuntimeScheduler } from "./access-ePqdQqkV.js";
2
- import { t as installRendererBridge } from "./renderer-BJYY2Y8s.js";
3
- import { t as state } from "./state-CVuQVjvK.js";
4
- import { t as selector } from "./selector-DEfqO1rA.js";
2
+ import { t as installRendererBridge } from "./renderer-GFETYwZ6.js";
3
+ import { t as state } from "./state-rjmMPExl.js";
4
+ import { t as selector } from "./selector-BzPPLXny.js";
5
5
  import { jsx, jsxs } from "./jsx-runtime.js";
6
- import { i as For } from "./control-DVRBkN2X.js";
7
- import { t as createIsland } from "./boot-C-cc9kcY.js";
6
+ import { i as For } from "./control-ByyOdVdr.js";
7
+ import { t as createIsland } from "./boot-eaBrci4W.js";
8
8
  //#region src/bench/components/benchmark-row.tsx
9
9
  function BenchmarkRow({ item, isSelected, onSelect, onRemove }) {
10
10
  return /* @__PURE__ */ jsxs("tr", {
@@ -63,8 +63,8 @@ function BenchmarkTable({ rows, isSelected, onSelect, onRemove }) {
63
63
  installRendererBridge();
64
64
  const benchmarkMetadata = {
65
65
  packageName: "@askrjs/askr",
66
- packageVersion: "0.0.73",
67
- buildLabel: "0.0.73-local"
66
+ packageVersion: "0.0.75",
67
+ buildLabel: "0.0.75-local"
68
68
  };
69
69
  function getBenchmarkMetadata() {
70
70
  return { ...benchmarkMetadata };
@@ -1,7 +1,7 @@
1
- import { s as ComponentFunction } from "../control-DO-iBEtV.js";
1
+ import { s as ComponentFunction } from "../control-Uvq1GU4K.js";
2
2
  import { v as DataRuntime } from "../index-Bki2rqcr.js";
3
- import { N as RouteRegistry, p as RouteAuthOptions } from "../router-wmx6Uher.js";
4
- import { a as ScrollRestorationOptions } from "../navigate-CPpT8BpL.js";
3
+ import { N as RouteRegistry, p as RouteAuthOptions } from "../router-Dd-LoJmM.js";
4
+ import { a as ScrollRestorationOptions } from "../navigate-DlaVqF4n.js";
5
5
  //#region src/boot/types.d.ts
6
6
  type IslandConfig = {
7
7
  root: Element | string;
@@ -1,2 +1,2 @@
1
- import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-C-cc9kcY.js";
1
+ import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-eaBrci4W.js";
2
2
  export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
@@ -1,19 +1,19 @@
1
1
  import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.js";
2
2
  import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
3
- import { n as createComponentInstance, r as executeComponent } from "./component-internal-CPjM4n8M.js";
4
- import { t as cleanupComponent } from "./component-cleanup-1ZFoLLHt.js";
5
- import { p as isPromiseLike } from "./lifecycle-batch-COgl8jMS.js";
6
- import { a as withIntrinsicHydrationAdoption, c as beginHydrationListenerTransaction, d as setStaticChildSlotsCacheEnabled, i as registerDeferredHydrationBoundary, l as commitHydrationListenerTransaction, n as activateHydrationBoundary$1, o as beginHydrationDirectListenerMode, r as clearDeferredHydrationBoundaries, s as endHydrationDirectListenerMode, t as installRendererBridge, u as discardHydrationListenerTransaction } from "./renderer-BJYY2Y8s.js";
7
- import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-D8Ufd9Ix.js";
8
- import { T as assertExecutionModel, c as _applyManifest, d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, o as reviveDeferredValue, p as hasRouteRenderData, v as pageRenderEnvelope } from "./deferred-1BRV2Fso.js";
3
+ import { n as createComponentInstance, r as executeComponent } from "./component-internal-iJ7HAcpc.js";
4
+ import { t as cleanupComponent } from "./component-cleanup-oWN45rfa.js";
5
+ import { p as isPromiseLike } from "./lifecycle-batch-CwHCDseR.js";
6
+ import { a as withIntrinsicHydrationAdoption, c as beginHydrationListenerTransaction, d as setStaticChildSlotsCacheEnabled, i as registerDeferredHydrationBoundary, l as commitHydrationListenerTransaction, n as activateHydrationBoundary$1, o as beginHydrationDirectListenerMode, r as clearDeferredHydrationBoundaries, s as endHydrationDirectListenerMode, t as installRendererBridge, u as discardHydrationListenerTransaction } from "./renderer-GFETYwZ6.js";
7
+ import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-e4Rn287s.js";
8
+ import { T as assertExecutionModel, c as _applyManifest, d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, o as reviveDeferredValue, p as hasRouteRenderData, v as pageRenderEnvelope } from "./deferred-iBBHEN5Z.js";
9
9
  import { a as startHydrationRenderPhase, s as stopHydrationRenderPhase } from "./render-context-Clw3rFiO.js";
10
- import { d as _setActiveRouteAuthOptions, j as lockRouteRegistration, k as hasRegisteredRoutes, m as clearRouteState } from "./route-matching-M-f1VQRu.js";
11
- import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-wY3j0vvp.js";
12
- import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-CwSRP3Jl.js";
10
+ import { d as _setActiveRouteAuthOptions, j as lockRouteRegistration, k as hasRegisteredRoutes, m as clearRouteState } from "./route-matching-Dmb_MKUb.js";
11
+ import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-EKmTCMKp.js";
12
+ import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-BLkoekFX.js";
13
13
  import { i as getDefaultDataRuntime } from "./data-runtime-rpV6-3XW.js";
14
14
  import { a as hydrateDataRuntime } from "./query-registry-Bu_cuMch.js";
15
- import { o as createAppRenderRuntime, r as setServerLocation } from "./activity-C2tPn9Fr.js";
16
- import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation } from "./navigate-BScgmpZP.js";
15
+ import { o as createAppRenderRuntime, r as setServerLocation } from "./activity-386uXmPJ.js";
16
+ import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation } from "./navigate-BwCpLrSM.js";
17
17
  import "./ssr-CbQO5xd3.js";
18
18
  //#region src/boot/hydration.ts
19
19
  const DEFERRED_PAYLOAD = "__askr_deferred__";
@@ -585,7 +585,7 @@ async function hydrateSPA(config) {
585
585
  cspNonce: config.cspNonce
586
586
  }));
587
587
  if (shouldVerifyHydrationMarkup(config)) {
588
- const { verifyHydrationSyncForUrl } = await import("./verify-hydration-DxOs5H_6.js");
588
+ const { verifyHydrationSyncForUrl } = await import("./verify-hydration-GMsdoOUX.js");
589
589
  if (!verifyHydrationSyncForUrl({
590
590
  root: rootElement,
591
591
  url: currentUrl,
@@ -1,7 +1,7 @@
1
1
  import { c as runRuntimeHandlerScope, v as logger } from "./access-ePqdQqkV.js";
2
- import "./fastlane-BTcFCMnm.js";
3
- import { t as cleanupComponent } from "./component-cleanup-1ZFoLLHt.js";
4
- import { u as registerLifecycleTransaction } from "./lifecycle-batch-COgl8jMS.js";
2
+ import "./fastlane-BbexfvHo.js";
3
+ import { t as cleanupComponent } from "./component-cleanup-oWN45rfa.js";
4
+ import { u as registerLifecycleTransaction } from "./lifecycle-batch-CwHCDseR.js";
5
5
  //#region src/runtime/events.ts
6
6
  /**
7
7
  * Event delegation system for Askr
@@ -1,6 +1,6 @@
1
1
  import { b as isDevelopmentEnvironment, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.js";
2
- import { n as cleanupReadableSubscriptions, t as cleanupReadableSubscriptionSources } from "./readable-BYSoWJSv.js";
3
- import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-CC3cojX9.js";
2
+ import { n as cleanupReadableSubscriptions, t as cleanupReadableSubscriptionSources } from "./readable-B3VIOfd7.js";
3
+ import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-DzJEbYGE.js";
4
4
  //#region src/runtime/state-diagnostics.ts
5
5
  /**
6
6
  * Report state cells that were never read during a component's completed
@@ -1,11 +1,31 @@
1
1
  import { r as markEagerControlPrimitive } from "./control-DhFRTIoE.js";
2
2
  import { b as isDevelopmentEnvironment, n as enqueueRuntimeTask, o as getRuntimeRenderer, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.js";
3
- import { r as tryRuntimeFastLaneSync, t as isBulkCommitActive } from "./fastlane-BTcFCMnm.js";
3
+ import { r as tryRuntimeFastLaneSync, t as isBulkCommitActive } from "./fastlane-BbexfvHo.js";
4
4
  import { r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
5
- import { i as finalizeReadableSubscriptions } from "./readable-BYSoWJSv.js";
6
- import { C as restoreRenderScopedComponent, S as restoreInlineRenderTracking, _ as getSignalForInstance, b as restoreDomCommitScope, c as enterDomCommitScope, f as getCurrentComponentInstance, l as enterRenderScopedComponent, m as getCurrentPortalScope, n as captureInlineComponentScope, o as clearRenderTracking, p as getCurrentInstance, r as captureInlineRenderTracking, s as enterComponentExecutionScope, t as beginRenderTracking, u as exitComponentExecutionScope, v as resetRenderState, x as restoreInlineComponentScope } from "./component-scope-CC3cojX9.js";
7
- import { a as enqueueLifecycleCommitForInstance, d as discardCommitOperations, f as executeCommittedLifecycleOperations, n as captureInlineRenderSnapshot$1, o as finalizeInlineReadSubscriptions, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-COgl8jMS.js";
5
+ import { i as finalizeReadableSubscriptions } from "./readable-B3VIOfd7.js";
6
+ import { C as restoreRenderScopedComponent, S as restoreInlineRenderTracking, _ as getSignalForInstance, b as restoreDomCommitScope, c as enterDomCommitScope, f as getCurrentComponentInstance, l as enterRenderScopedComponent, m as getCurrentPortalScope, n as captureInlineComponentScope, o as clearRenderTracking, p as getCurrentInstance, r as captureInlineRenderTracking, s as enterComponentExecutionScope, t as beginRenderTracking, u as exitComponentExecutionScope, v as resetRenderState, x as restoreInlineComponentScope } from "./component-scope-DzJEbYGE.js";
7
+ import { a as enqueueLifecycleCommitForInstance, d as discardCommitOperations, f as executeCommittedLifecycleOperations, n as captureInlineRenderSnapshot$1, o as finalizeInlineReadSubscriptions, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-CwHCDseR.js";
8
8
  //#region src/runtime/context.ts
9
+ /** @internal Compare immutable context snapshots by provider identity and value. */
10
+ function haveEquivalentContextFrames(left, right) {
11
+ let leftFrame = left;
12
+ let rightFrame = right;
13
+ while (true) {
14
+ while (leftFrame && !leftFrame.values?.size) leftFrame = leftFrame.parent;
15
+ while (rightFrame && !rightFrame.values?.size) rightFrame = rightFrame.parent;
16
+ if (leftFrame === rightFrame) return true;
17
+ if (!leftFrame || !rightFrame) return false;
18
+ const leftValues = leftFrame.values;
19
+ const rightValues = rightFrame.values;
20
+ if (leftValues?.size !== rightValues?.size) return false;
21
+ if (leftValues) {
22
+ if (!rightValues) return false;
23
+ for (const [key, value] of leftValues) if (!rightValues.has(key) || !Object.is(rightValues.get(key), value)) return false;
24
+ }
25
+ leftFrame = leftFrame.parent;
26
+ rightFrame = rightFrame.parent;
27
+ }
28
+ }
9
29
  const ROOT_EXECUTION_FRAME = {
10
30
  parent: null,
11
31
  values: null
@@ -81,6 +101,64 @@ function markVNodeTreeWithContextFrame(node, frame, overwrite = false) {
81
101
  }
82
102
  return node;
83
103
  }
104
+ function isContextFrameDescendantOf(frame, ancestor) {
105
+ let current = frame;
106
+ while (current) {
107
+ if (current === ancestor) return true;
108
+ current = current.parent;
109
+ }
110
+ return false;
111
+ }
112
+ function rebaseContextFrame(frame, previousOwnerFrame, ownerFrame) {
113
+ if (isContextFrameDescendantOf(frame, ownerFrame)) return frame;
114
+ if (!previousOwnerFrame || !isContextFrameDescendantOf(frame, previousOwnerFrame)) return ownerFrame;
115
+ const nestedFrames = [];
116
+ let current = frame;
117
+ while (current && current !== previousOwnerFrame) {
118
+ nestedFrames.push(current);
119
+ current = current.parent;
120
+ }
121
+ let rebasedFrame = ownerFrame;
122
+ for (let index = nestedFrames.length - 1; index >= 0; index -= 1) {
123
+ const nestedFrame = nestedFrames[index];
124
+ rebasedFrame = {
125
+ parent: rebasedFrame,
126
+ values: nestedFrame.values ? new Map(nestedFrame.values) : null
127
+ };
128
+ }
129
+ return rebasedFrame;
130
+ }
131
+ /**
132
+ * Stamp a child-scope result with its current owner while retaining frames
133
+ * introduced by providers nested beneath that owner. Frames from an unrelated
134
+ * or previous owner are rebased so reused vnodes cannot keep stale context.
135
+ */
136
+ function rebaseVNodeTreeWithContextFrame(node, ownerFrame, previousOwnerFrame = null) {
137
+ if (!ownerFrame) return node;
138
+ if (Array.isArray(node)) {
139
+ for (const child of node) rebaseVNodeTreeWithContextFrame(child, ownerFrame, previousOwnerFrame);
140
+ return node;
141
+ }
142
+ if (typeof node !== "object" || node === null) return node;
143
+ const existingFrame = getVNodeContextFrame(node);
144
+ const inheritedFrame = existingFrame ? rebaseContextFrame(existingFrame, previousOwnerFrame, ownerFrame) : ownerFrame;
145
+ markVNodeWithContextFrame(node, inheritedFrame, true);
146
+ const inheritedPreviousFrame = existingFrame ?? previousOwnerFrame;
147
+ const objectNode = node;
148
+ const props = typeof objectNode.props === "object" && objectNode.props !== null ? objectNode.props : null;
149
+ const children = props?.children ?? objectNode.children;
150
+ if (Array.isArray(children)) for (const child of children) rebaseVNodeTreeWithContextFrame(child, inheritedFrame, inheritedPreviousFrame);
151
+ else if (children) rebaseVNodeTreeWithContextFrame(children, inheritedFrame, inheritedPreviousFrame);
152
+ if (props) {
153
+ for (const key in props) if (key !== "children") {
154
+ const value = props[key];
155
+ if (Array.isArray(value)) {
156
+ for (const item of value) if (isVNodeLike(item)) rebaseVNodeTreeWithContextFrame(item, inheritedFrame, inheritedPreviousFrame);
157
+ } else if (isVNodeLike(value)) rebaseVNodeTreeWithContextFrame(value, inheritedFrame, inheritedPreviousFrame);
158
+ }
159
+ }
160
+ return node;
161
+ }
84
162
  let currentContextFrame = null;
85
163
  let currentAsyncResourceFrame = null;
86
164
  /**
@@ -615,4 +693,4 @@ function warnInstanceOnce(instance, key, message) {
615
693
  logger.warn(message);
616
694
  }
617
695
  //#endregion
618
- export { withContext as _, registerCommitOperation as a, registerCommitOperationForInstance as c, getCurrentContextFrame as d, getExecutionContextFrame as f, withAsyncResourceContext as g, readScope as h, mountInstanceInline as i, callWithContext as l, markVNodeTreeWithContextFrame as m, createComponentInstance as n, renderComponentInline as o, getVNodeContextFrame as p, executeComponent as r, renderScopedComponent as s, captureInlineRenderSnapshot as t, defineScope as u };
696
+ export { rebaseVNodeTreeWithContextFrame as _, registerCommitOperation as a, registerCommitOperationForInstance as c, getCurrentContextFrame as d, getExecutionContextFrame as f, readScope as g, markVNodeTreeWithContextFrame as h, mountInstanceInline as i, callWithContext as l, haveEquivalentContextFrames as m, createComponentInstance as n, renderComponentInline as o, getVNodeContextFrame as p, executeComponent as r, renderScopedComponent as s, captureInlineRenderSnapshot as t, defineScope as u, withAsyncResourceContext as v, withContext as y };
@@ -163,13 +163,16 @@ function restoreCurrentComponentScope(snapshot) {
163
163
  function getNextStateIndex() {
164
164
  return stateIndex++;
165
165
  }
166
+ function hookOrderGuidance(hookName) {
167
+ return `The render-scoped hook sequence changed between renders. This can happen when ${hookName}() is called conditionally, or when a conditional subtree skips an outer control boundary through a plain if, ternary, && branch, or loop. Keep render-scoped hooks and their outer control boundaries unconditional. Use <Show> or <Case> with <Match> children for conditional branches, and <For> for changing collections.`;
168
+ }
166
169
  function claimHookIndex(instance, hookName) {
167
170
  const index = getNextStateIndex();
168
- if (index < instance.stateIndexCheck) throw new Error(`Hook index violation: ${hookName}() call at index ${index}, but previously saw index ${instance.stateIndexCheck}. This happens when render-scoped hooks are called conditionally (inside if/for/etc). Move all ${hookName}() calls to the top level of your component function, before any conditionals.`);
171
+ if (index < instance.stateIndexCheck) throw new Error(`Hook index violation: ${hookName}() call at index ${index}, but previously saw index ${instance.stateIndexCheck}. ` + hookOrderGuidance(hookName));
169
172
  instance.stateIndexCheck = index;
170
173
  const expectedStateIndices = instance.expectedStateIndices ??= [];
171
174
  if (instance.firstRenderComplete) {
172
- if (expectedStateIndices[index] !== index) throw new Error(`Hook order violation: ${hookName}() called at index ${index}, but this index was not in the first render's sequence [${expectedStateIndices.join(", ")}]. This usually means ${hookName}() is inside a conditional or loop. Move all render-scoped hooks to the top level of your component function.`);
175
+ if (expectedStateIndices[index] !== index) throw new Error(`Hook order violation: ${hookName}() called at index ${index}, but this index was not in the first render's sequence [${expectedStateIndices.join(", ")}]. ` + hookOrderGuidance(hookName));
173
176
  } else expectedStateIndices.push(index);
174
177
  return index;
175
178
  }
@@ -1,4 +1,4 @@
1
- import { l as VNode } from "../control-DO-iBEtV.js";
1
+ import { l as VNode } from "../control-Uvq1GU4K.js";
2
2
  import { r as JSXElement, s as Props } from "../jsx-Dvr2SGRG.js";
3
3
  //#region src/common/error-boundary.d.ts
4
4
  type ErrorBoundaryContent = VNode | readonly VNode[];
@@ -1,6 +1,6 @@
1
1
  import { t as __ERROR_BOUNDARY__ } from "../vnode-D24p6IW2.js";
2
2
  import { t as ELEMENT_TYPE } from "../jsx-CUpRxrLH.js";
3
- import { f as getCurrentComponentInstance } from "../component-scope-CC3cojX9.js";
3
+ import { f as getCurrentComponentInstance } from "../component-scope-DzJEbYGE.js";
4
4
  //#region src/components/error-boundary.tsx
5
5
  function ensureBoundaryState(instance, resetKey) {
6
6
  const boundaryState = instance.errorBoundaryState ?? (instance.errorBoundaryState = {
@@ -1,2 +1,2 @@
1
- import { a as Show, c as ForProps, i as MatchProps, n as CaseProps, o as ShowProps, r as Match, s as For, t as Case } from "../index-UmwPZ8ZN.js";
1
+ import { a as Show, c as ForProps, i as MatchProps, n as CaseProps, o as ShowProps, r as Match, s as For, t as Case } from "../index-acX2RLxD.js";
2
2
  export { Case, type CaseProps, For, type ForProps, Match, type MatchProps, Show, type ShowProps };
@@ -1,2 +1,2 @@
1
- import { i as For, n as Match, r as Show, t as Case } from "../control-DVRBkN2X.js";
1
+ import { i as For, n as Match, r as Show, t as Case } from "../control-ByyOdVdr.js";
2
2
  export { Case, For, Match, Show };
@@ -1,9 +1,9 @@
1
1
  import { r as markEagerControlPrimitive, t as __CONTROL_BOUNDARY__ } from "./control-DhFRTIoE.js";
2
2
  import { b as isDevelopmentEnvironment } from "./access-ePqdQqkV.js";
3
3
  import { n as Fragment } from "./jsx-CUpRxrLH.js";
4
- import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-BtK9Htl0.js";
5
- import { t as createFineGrainedEffect } from "./effect-CFUzIpqX.js";
6
- import { t as state } from "./state-CVuQVjvK.js";
4
+ import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-tNicxJY3.js";
5
+ import { t as createFineGrainedEffect } from "./effect-2IIWvUjG.js";
6
+ import { t as state } from "./state-rjmMPExl.js";
7
7
  //#region src/control/shared.ts
8
8
  function normalizeBoundaryChild(value) {
9
9
  if (Array.isArray(value)) {
@@ -254,6 +254,7 @@ interface ChildScopeTransactionSnapshot {
254
254
  needsDomUpdate: boolean;
255
255
  hydrationPending: boolean;
256
256
  renderFn: (() => VNode) | undefined;
257
+ renderedOwnerFrame: ContextFrame | null;
257
258
  }
258
259
  //#endregion
259
260
  //#region src/runtime/for-signals.d.ts
@@ -297,7 +298,7 @@ interface FineGrainedEffectHandle<T> {
297
298
  }
298
299
  //#endregion
299
300
  //#region src/runtime/for-types.d.ts
300
- type ForEachSource<T> = T[] | (() => T[]);
301
+ type ForEachSource<T> = readonly T[] | (() => readonly T[]);
301
302
  type ForKeySelector<T> = (item: T, index: number) => string | number;
302
303
  type ForRenderItem<T> = (item: T, index: () => number) => VNode;
303
304
  //#endregion
@@ -305,8 +306,10 @@ type ForRenderItem<T> = (item: T, index: () => number) => VNode;
305
306
  type ForCommitStrategy = 'APPEND' | 'INSERT_ONE' | 'REMOVE_ONE' | 'TRUNCATE' | 'NO_REORDER' | 'SWAP' | 'FULL_KEYED';
306
307
  interface ForState<T> {
307
308
  kind: 'for';
308
- currentItems: T[];
309
- _committedItems: T[];
309
+ _contextFrame: ContextFrame | null;
310
+ _contextFrameChanged: boolean;
311
+ currentItems: readonly T[];
312
+ _committedItems: readonly T[];
310
313
  eachSource: ForEachSource<T>;
311
314
  fallback: VNode | null;
312
315
  fallbackScope: ChildScope | null;
@@ -328,7 +331,7 @@ interface ForState<T> {
328
331
  pendingAppendStart: number | null;
329
332
  _hasResolvedItemDom: boolean;
330
333
  _needsSourceReconcile: boolean;
331
- _sourceEffect: FineGrainedEffectHandle<T[]> | null;
334
+ _sourceEffect: FineGrainedEffectHandle<readonly T[]> | null;
332
335
  _suspendSourceCommit: boolean;
333
336
  _enqueueBoundaryCommit?: (() => void) | null;
334
337
  _hasPendingBoundaryCommit?: boolean;
@@ -353,7 +356,7 @@ interface ForItemTransactionSnapshot<T> {
353
356
  }
354
357
  interface ForTransaction<T> {
355
358
  collectionSnapshotMode: 'copy' | 'reset-empty' | 'preserve-clear' | 'reuse';
356
- currentItems: T[];
359
+ currentItems: readonly T[];
357
360
  items: Map<string | number, ForItemInstance<T>>;
358
361
  orderedKeys: Array<string | number>;
359
362
  orderedItems: ForItemInstance<T>[];
@@ -393,6 +396,7 @@ interface MatchBranch {
393
396
  when: unknown;
394
397
  }
395
398
  interface BranchControlStateBase {
399
+ _contextFrame: ContextFrame | null;
396
400
  activeKey: string | number | null;
397
401
  activeScope: ChildScope | null;
398
402
  activeVNodes: VNode[];
@@ -1,4 +1,4 @@
1
- import { h as readScope, u as defineScope } from "./component-internal-CPjM4n8M.js";
1
+ import { g as readScope, u as defineScope } from "./component-internal-iJ7HAcpc.js";
2
2
  //#region src/common/url.ts
3
3
  const SAFE_URL_SCHEMES = /* @__PURE__ */ new Set([
4
4
  "http",
@@ -1,4 +1,4 @@
1
1
  import { i as getDefaultDataRuntime, t as createDataRuntime } from "../data-runtime-rpV6-3XW.js";
2
- import { a as queryScope, i as invalidateOnInterval, n as createMutation, r as invalidate, t as createQuery } from "../data-DFcSmGvN.js";
2
+ import { a as queryScope, i as invalidateOnInterval, n as createMutation, r as invalidate, t as createQuery } from "../data-E7oXei9c.js";
3
3
  import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery, t as createQueryPrefetchContext } from "../query-registry-Bu_cuMch.js";
4
4
  export { createDataRuntime, createMutation, createQuery, createQueryPrefetchContext, defineQuery, defineServerQueries, dehydrateDataRuntime, getDefaultDataRuntime, hydrateDataRuntime, invalidate, invalidateOnInterval, prefetchQuery, queryScope, serveQuery };
@@ -1,8 +1,8 @@
1
1
  import { n as enqueueRuntimeTask, v as logger } from "./access-ePqdQqkV.js";
2
- import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BYSoWJSv.js";
3
- import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-CC3cojX9.js";
2
+ import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B3VIOfd7.js";
3
+ import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-DzJEbYGE.js";
4
4
  import { n as getActiveRenderContext } from "./render-context-Clw3rFiO.js";
5
- import { i as routeActive, n as documentVisible, o as timer, s as windowFocused } from "./lifecycle-operations-Db-_MG-O.js";
5
+ import { i as routeActive, n as documentVisible, o as timer, s as windowFocused } from "./lifecycle-operations-D2wzCYYh.js";
6
6
  import { a as getMutationSlotStore, c as resolveDataRuntimeState, i as getDefaultDataRuntime, n as ensureMutationCleanup, o as getQuerySlotStore, r as ensureQueryCleanup, s as invalidateQueriesForRuntime } from "./data-runtime-rpV6-3XW.js";
7
7
  //#region src/data/query-key.ts
8
8
  function serializeQueryKeyNumber(part) {
@@ -1,10 +1,10 @@
1
1
  import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
2
- import { h as readScope, u as defineScope } from "./component-internal-CPjM4n8M.js";
3
- import { d as getCurrentAppRenderRuntime } from "./component-scope-CC3cojX9.js";
4
- import { p as isPromiseLike } from "./lifecycle-batch-COgl8jMS.js";
2
+ import { g as readScope, u as defineScope } from "./component-internal-iJ7HAcpc.js";
3
+ import { d as getCurrentAppRenderRuntime } from "./component-scope-DzJEbYGE.js";
4
+ import { p as isPromiseLike } from "./lifecycle-batch-CwHCDseR.js";
5
5
  import { n as getActiveRenderContext, r as getCurrentRenderData } from "./render-context-Clw3rFiO.js";
6
- import { A as insertRecordSorted, D as getRouteRecords, E as getRouteList, F as snapshotRouteState, N as restoreRouteState, P as setDefaultRouteAuthOptions, T as getDefaultRouteAuthOptions, f as addRouteToStores, h as getActiveRouteAuthOptions, i as getMatchingRouteRecord, m as clearRouteState, o as buildRouteContext, s as buildRouteContextBase, z as resource } from "./route-matching-M-f1VQRu.js";
7
- import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-CwSRP3Jl.js";
6
+ import { A as insertRecordSorted, D as getRouteRecords, E as getRouteList, F as snapshotRouteState, N as restoreRouteState, P as setDefaultRouteAuthOptions, T as getDefaultRouteAuthOptions, f as addRouteToStores, h as getActiveRouteAuthOptions, i as getMatchingRouteRecord, m as clearRouteState, o as buildRouteContext, s as buildRouteContextBase, z as resource } from "./route-matching-Dmb_MKUb.js";
7
+ import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-BLkoekFX.js";
8
8
  import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-Bu_cuMch.js";
9
9
  //#region src/runtime/execution-model.ts
10
10
  const EXECUTION_MODEL_KEY = Symbol.for("__ASKR_EXECUTION_MODEL__");
@@ -1,5 +1,5 @@
1
1
  import { t as enqueueRuntimeLane } from "./access-ePqdQqkV.js";
2
- import { m as withFineGrainedReadTracking } from "./readable-BYSoWJSv.js";
2
+ import { m as withFineGrainedReadTracking } from "./readable-B3VIOfd7.js";
3
3
  //#region src/runtime/effect.ts
4
4
  const SOURCE_EFFECTS = Symbol("askr.source-effects");
5
5
  const effectSources = /* @__PURE__ */ new WeakMap();
@@ -1,6 +1,6 @@
1
1
  import { b as isDevelopmentEnvironment, l as runRuntimeWithSyncProgress, o as getRuntimeRenderer, u as setRuntimeBulkCommitProbe } from "./access-ePqdQqkV.js";
2
2
  import { n as Fragment } from "./jsx-CUpRxrLH.js";
3
- import { i as finalizeReadableSubscriptions } from "./readable-BYSoWJSv.js";
3
+ import { i as finalizeReadableSubscriptions } from "./readable-B3VIOfd7.js";
4
4
  //#region src/runtime/dev-namespace.ts
5
5
  /**
6
6
  * Set a value in the dev namespace (no-op in production).
@@ -1,10 +1,10 @@
1
1
  import { n as _isDOMElement } from "./vnode-D24p6IW2.js";
2
2
  import { b as isDevelopmentEnvironment, o as getRuntimeRenderer, v as logger } from "./access-ePqdQqkV.js";
3
- import { n as createComponentInstance, s as renderScopedComponent } from "./component-internal-CPjM4n8M.js";
4
- import { d as shouldCoalesceFineGrainedItemReads, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BYSoWJSv.js";
5
- import { h as getCurrentStateIndex, i as claimHookIndex, o as clearRenderTracking, p as getCurrentInstance } from "./component-scope-CC3cojX9.js";
6
- import { i as unregisterOwnedChildScope, r as registerOwnedChildScope, t as cleanupComponent } from "./component-cleanup-1ZFoLLHt.js";
7
- import { o as finalizeInlineReadSubscriptions, u as registerLifecycleTransaction } from "./lifecycle-batch-COgl8jMS.js";
3
+ import { _ as rebaseVNodeTreeWithContextFrame, m as haveEquivalentContextFrames, n as createComponentInstance, s as renderScopedComponent } from "./component-internal-iJ7HAcpc.js";
4
+ import { d as shouldCoalesceFineGrainedItemReads, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B3VIOfd7.js";
5
+ import { h as getCurrentStateIndex, i as claimHookIndex, o as clearRenderTracking, p as getCurrentInstance } from "./component-scope-DzJEbYGE.js";
6
+ import { i as unregisterOwnedChildScope, r as registerOwnedChildScope, t as cleanupComponent } from "./component-cleanup-oWN45rfa.js";
7
+ import { o as finalizeInlineReadSubscriptions, u as registerLifecycleTransaction } from "./lifecycle-batch-CwHCDseR.js";
8
8
  //#region src/runtime/child-scope.ts
9
9
  const EMPTY_CHILD_SCOPE_PROPS = {};
10
10
  const childScopesByInstance = /* @__PURE__ */ new WeakMap();
@@ -35,6 +35,7 @@ var ChildScopeImpl = class {
35
35
  this.blueprintOwner = void 0;
36
36
  this._renderFn = void 0;
37
37
  this._disposed = false;
38
+ this._renderedOwnerFrame = null;
38
39
  this.key = key;
39
40
  this._parent = parent;
40
41
  this._onDirty = onDirty;
@@ -84,10 +85,11 @@ function renderScope(scope) {
84
85
  const { componentInstance } = scope;
85
86
  const previousVNode = scope.vnode;
86
87
  try {
87
- const nextVNode = renderScopedComponent(componentInstance, scope._startStateIndex, scope._renderFn);
88
+ const nextVNode = rebaseVNodeTreeWithContextFrame(renderScopedComponent(componentInstance, scope._startStateIndex, scope._renderFn), componentInstance.ownerFrame, scope._renderedOwnerFrame);
88
89
  if (previousVNode && nextVNode && _isDOMElement(previousVNode) && _isDOMElement(nextVNode) && typeof previousVNode.type === "function" && previousVNode.type === nextVNode.type && "__instance" in previousVNode && !("__instance" in nextVNode)) nextVNode.__instance = previousVNode.__instance;
89
90
  scope.previousVnode = previousVNode;
90
91
  scope.vnode = nextVNode;
92
+ scope._renderedOwnerFrame = componentInstance.ownerFrame;
91
93
  scope.markDirty();
92
94
  if ((componentInstance._pendingReadSources?.size ?? 0) > 0) ensureChildScopeFlushTask(scope);
93
95
  finalizeInlineReadSubscriptions(componentInstance, componentInstance._currentRenderToken, componentInstance._pendingReadSources, componentInstance._pendingReadSourceVersions);
@@ -112,7 +114,8 @@ function captureChildScopeTransactionSnapshot(scope) {
112
114
  domTextData: scope.dom?.nodeType === 3 ? scope.dom.data : void 0,
113
115
  needsDomUpdate: scope.needsDomUpdate,
114
116
  hydrationPending: scope.hydrationPending,
115
- renderFn: mutableScope._renderFn
117
+ renderFn: mutableScope._renderFn,
118
+ renderedOwnerFrame: mutableScope._renderedOwnerFrame
116
119
  };
117
120
  }
118
121
  /** @internal */
@@ -126,6 +129,7 @@ function restoreChildScopeTransactionSnapshot(scope, snapshot) {
126
129
  scope.needsDomUpdate = snapshot.needsDomUpdate;
127
130
  scope.hydrationPending = snapshot.hydrationPending;
128
131
  mutableScope._renderFn = snapshot.renderFn;
132
+ mutableScope._renderedOwnerFrame = snapshot.renderedOwnerFrame;
129
133
  }
130
134
  function disposeChildScope(scope) {
131
135
  scope.dispose();
@@ -135,6 +139,24 @@ function createChildScope(parent, key, onDirty, ownership) {
135
139
  }
136
140
  //#endregion
137
141
  //#region src/runtime/control.ts
142
+ function setScopeContextFrame(scope, frame) {
143
+ if (scope) scope.componentInstance.ownerFrame = frame;
144
+ }
145
+ function setControlBoundaryContextFrame(controlState, frame) {
146
+ const previousFrame = controlState._contextFrame;
147
+ controlState._contextFrame = frame;
148
+ if (controlState.kind === "for") {
149
+ controlState._contextFrameChanged ||= previousFrame !== null && !haveEquivalentContextFrames(previousFrame, frame);
150
+ setScopeContextFrame(controlState.fallbackScope, frame);
151
+ for (const item of controlState.items.values()) setScopeContextFrame(item.scope, frame);
152
+ return;
153
+ }
154
+ setScopeContextFrame(controlState.activeScope, frame);
155
+ if (controlState.kind === "show") {
156
+ setScopeContextFrame(controlState.truthyScope, frame);
157
+ setScopeContextFrame(controlState.fallbackScope, frame);
158
+ }
159
+ }
138
160
  const SHOW_TRUTHY_KEY = "__show-truthy__";
139
161
  const SHOW_FALLBACK_KEY = "__show-fallback__";
140
162
  const CASE_FALLBACK_KEY = "__case-fallback__";
@@ -228,17 +250,20 @@ function finishImmediateControlTransaction(state, transaction) {
228
250
  if (state._transaction === transaction && !transaction.registered) commitControlTransaction(state, transaction);
229
251
  }
230
252
  function createBranchScope(state, key) {
231
- return createChildScope(state.parentInstance, key, () => {
253
+ const scope = createChildScope(state.parentInstance, key, () => {
232
254
  if (state._enqueueBoundaryCommit) {
233
255
  state._enqueueBoundaryCommit();
234
256
  return;
235
257
  }
236
258
  state.parentInstance?._enqueueRun?.();
237
259
  });
260
+ if (state._contextFrame) scope.componentInstance.ownerFrame = state._contextFrame;
261
+ return scope;
238
262
  }
239
263
  function createShowState(value, renderTruthy, renderFallback) {
240
264
  return {
241
265
  kind: "show",
266
+ _contextFrame: null,
242
267
  activeKey: null,
243
268
  activeScope: null,
244
269
  activeVNodes: [],
@@ -313,6 +338,7 @@ function clearShowDomUpdateState(state) {
313
338
  function createCaseState(matches, fallback) {
314
339
  return {
315
340
  kind: "case",
341
+ _contextFrame: null,
316
342
  activeKey: null,
317
343
  activeScope: null,
318
344
  activeVNodes: [],
@@ -607,7 +633,9 @@ function enqueueForBoundaryScopeCommit() {
607
633
  enqueueForScopeUpdate(forState.parentInstance);
608
634
  }
609
635
  function createForOwnedChildScope(forState, key) {
610
- return createChildScope(forState.parentInstance, key, enqueueForBoundaryScopeCommit, forState._scopeOwnership);
636
+ const scope = createChildScope(forState.parentInstance, key, enqueueForBoundaryScopeCommit, forState._scopeOwnership);
637
+ if (forState._contextFrame) scope.componentInstance.ownerFrame = forState._contextFrame;
638
+ return scope;
611
639
  }
612
640
  function captureForItemTransactionSnapshot(forState, itemInstance) {
613
641
  const transaction = forState._transaction;
@@ -750,6 +778,12 @@ function createItemInstance(key, item, index, forState) {
750
778
  function rerenderItemInstance(forState, itemInstance, item) {
751
779
  renderItemScope(forState, itemInstance.scope, item, itemInstance.indexSignal, itemInstance.key);
752
780
  }
781
+ function refreshForContextScopes(forState) {
782
+ for (const itemInstance of forState.items.values()) {
783
+ captureForItemTransactionSnapshot(forState, itemInstance);
784
+ rerenderItemInstance(forState, itemInstance, itemInstance.reactiveItem);
785
+ }
786
+ }
753
787
  function updateItemInstance(forState, itemInstance, item) {
754
788
  if (itemInstance.item === item) return false;
755
789
  captureForItemTransactionSnapshot(forState, itemInstance);
@@ -1289,6 +1323,8 @@ function createForState(eachSource, byFn, renderFn, fallback) {
1289
1323
  });
1290
1324
  return {
1291
1325
  kind: "for",
1326
+ _contextFrame: null,
1327
+ _contextFrameChanged: false,
1292
1328
  currentItems: [],
1293
1329
  _committedItems: [],
1294
1330
  eachSource,
@@ -1349,7 +1385,10 @@ function evaluateForState(forState) {
1349
1385
  beginForStateTransaction(forState);
1350
1386
  forState._needsSourceReconcile = false;
1351
1387
  try {
1352
- return reconcileForItems(forState, forState.currentItems);
1388
+ if (forState._contextFrameChanged) refreshForContextScopes(forState);
1389
+ const result = reconcileForItems(forState, forState.currentItems);
1390
+ forState._contextFrameChanged = false;
1391
+ return result;
1353
1392
  } catch (error) {
1354
1393
  rollbackForStateTransaction(forState);
1355
1394
  throw error;
@@ -1561,4 +1600,4 @@ function clearForDomUpdateState(forState) {
1561
1600
  forState._hasResolvedItemDom = forState.orderedKeys.length > 0;
1562
1601
  }
1563
1602
  //#endregion
1564
- export { createChildScope as _, registerForStateTransaction as a, captureForFallbackTransactionSnapshot as c, clearCaseDomUpdateState as d, clearShowDomUpdateState as f, evaluateShowState as g, evaluateCaseState as h, evaluateForState as i, captureForItemTransactionSnapshot as l, createShowState as m, clearForDomUpdateState as n, rollbackForStateTransaction as o, createCaseState as p, commitForStateTransaction as r, useForState as s, beginForStateTransaction as t, recordBenchEvent as u, disposeChildScope as v, rerenderChildScope as y };
1603
+ export { setControlBoundaryContextFrame as _, registerForStateTransaction as a, rerenderChildScope as b, captureForFallbackTransactionSnapshot as c, clearCaseDomUpdateState as d, clearShowDomUpdateState as f, evaluateShowState as g, evaluateCaseState as h, evaluateForState as i, captureForItemTransactionSnapshot as l, createShowState as m, clearForDomUpdateState as n, rollbackForStateTransaction as o, createCaseState as p, commitForStateTransaction as r, useForState as s, beginForStateTransaction as t, recordBenchEvent as u, createChildScope as v, disposeChildScope as y };
@@ -1,3 +1,3 @@
1
1
  import { r as JSXElement } from "../jsx-Dvr2SGRG.js";
2
- import { _ as definePortal, c as Presence, d as SlotProps, f as LayoutComponent, g as PortalProps, h as Portal, l as PresenceProps, m as DefaultPortal, p as layout, u as Slot } from "../index-5TeJ46BR.js";
2
+ import { _ as definePortal, c as Presence, d as SlotProps, f as LayoutComponent, g as PortalProps, h as Portal, l as PresenceProps, m as DefaultPortal, p as layout, u as Slot } from "../index-CbRdEUPB.js";
3
3
  export { DefaultPortal, type JSXElement, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, definePortal, layout };