@wildo-ai/saas-frontend-lib 1.1.13 → 1.1.15

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 (143) hide show
  1. package/dist/esm/components/ai-elements/meta/agent-wrappers.d.ts +1 -0
  2. package/dist/esm/components/ai-elements/meta/agent-wrappers.d.ts.map +1 -1
  3. package/dist/esm/components/ai-elements/meta/agent-wrappers.js.map +1 -1
  4. package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts +38 -0
  5. package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts.map +1 -0
  6. package/dist/esm/components/compliance/EmbeddedSigningFrame.js +106 -0
  7. package/dist/esm/components/compliance/EmbeddedSigningFrame.js.map +1 -0
  8. package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
  9. package/dist/esm/components/data-display/DisplayValueDispatcher.js +17 -1
  10. package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
  11. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
  12. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +22 -0
  13. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
  14. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -1
  15. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +5 -2
  16. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -1
  17. package/dist/esm/components/flows-actors/agent-config.labels.d.ts.map +1 -1
  18. package/dist/esm/components/flows-actors/agent-config.labels.js +2 -0
  19. package/dist/esm/components/flows-actors/agent-config.labels.js.map +1 -1
  20. package/dist/esm/components/flows-actors/approval.d.ts +7 -1
  21. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  22. package/dist/esm/components/flows-actors/approval.js +22 -5
  23. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  24. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  25. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +20 -1
  26. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  27. package/dist/esm/components/form/chromes/FormFieldChrome.js +1 -1
  28. package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
  29. package/dist/esm/components/form/chromes/field-control-aria.d.ts +8 -1
  30. package/dist/esm/components/form/chromes/field-control-aria.d.ts.map +1 -1
  31. package/dist/esm/components/form/chromes/field-control-aria.js +19 -2
  32. package/dist/esm/components/form/chromes/field-control-aria.js.map +1 -1
  33. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts +5 -0
  34. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts.map +1 -1
  35. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js +6 -2
  36. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js.map +1 -1
  37. package/dist/esm/components/resources/ResourceCollectionBody_Table.d.ts.map +1 -1
  38. package/dist/esm/components/resources/ResourceCollectionBody_Table.js +8 -1
  39. package/dist/esm/components/resources/ResourceCollectionBody_Table.js.map +1 -1
  40. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
  41. package/dist/esm/components/resources/ResourceLayout_DangerZone.js +2 -2
  42. package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
  43. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +2 -2
  44. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
  45. package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
  46. package/dist/esm/components/resources/ResourceListItemRenderer.js +6 -1
  47. package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
  48. package/dist/esm/components/resources/skeleton/DisplayLayout.js +2 -2
  49. package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
  50. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
  51. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +71 -16
  52. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
  53. package/dist/esm/components/sections/surface.d.ts +12 -0
  54. package/dist/esm/components/sections/surface.d.ts.map +1 -1
  55. package/dist/esm/components/sections/surface.js +14 -0
  56. package/dist/esm/components/sections/surface.js.map +1 -1
  57. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.d.ts.map +1 -1
  58. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js +3 -2
  59. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js.map +1 -1
  60. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +15 -0
  61. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts.map +1 -1
  62. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +29 -0
  63. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
  64. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.d.ts.map +1 -1
  65. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js +2 -2
  66. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js.map +1 -1
  67. package/dist/esm/core/branding/useBrandPresentation.d.ts.map +1 -1
  68. package/dist/esm/core/branding/useBrandPresentation.js +17 -6
  69. package/dist/esm/core/branding/useBrandPresentation.js.map +1 -1
  70. package/dist/esm/core/events/events.frontend.schemas.d.ts +40 -0
  71. package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
  72. package/dist/esm/core/events/events.frontend.schemas.js +24 -1
  73. package/dist/esm/core/events/events.frontend.schemas.js.map +1 -1
  74. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.d.ts.map +1 -1
  75. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js +11 -1
  76. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js.map +1 -1
  77. package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
  78. package/dist/esm/core/i18n/I18nContext.js +8 -2
  79. package/dist/esm/core/i18n/I18nContext.js.map +1 -1
  80. package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
  81. package/dist/esm/core/i18n/component-label-resolution.utils.js +6 -1
  82. package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
  83. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +0 -15
  84. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
  85. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +102 -5
  86. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
  87. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.d.ts.map +1 -1
  88. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +12 -3
  89. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
  90. package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
  91. package/dist/esm/core/navigation/NavigationContext.js +60 -17
  92. package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
  93. package/dist/esm/core/navigation/launcher-resolution.d.ts +29 -0
  94. package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
  95. package/dist/esm/core/navigation/launcher-resolution.js +31 -0
  96. package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
  97. package/dist/esm/core/navigation/navigation-controller-internals.d.ts +48 -0
  98. package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -1
  99. package/dist/esm/core/navigation/navigation-controller-internals.js +56 -3
  100. package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -1
  101. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
  102. package/dist/esm/core/navigation/useNavigationRouterSync.js +30 -2
  103. package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
  104. package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts +6 -1
  105. package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts.map +1 -1
  106. package/dist/esm/core/resources/resource-read-cache.frontend.service.js +11 -1
  107. package/dist/esm/core/resources/resource-read-cache.frontend.service.js.map +1 -1
  108. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts +44 -0
  109. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts.map +1 -0
  110. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js +63 -0
  111. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js.map +1 -0
  112. package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -1
  113. package/dist/esm/core/resources/useOperationDirectExecution.js +45 -6
  114. package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -1
  115. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  116. package/dist/esm/core/runtime/AppRouter.js +18 -1
  117. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  118. package/dist/esm/core/runtime/ApplicationMainContext.d.ts +1 -1
  119. package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
  120. package/dist/esm/core/runtime/ApplicationMainContext.js +12 -3
  121. package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
  122. package/dist/esm/core/security/UserOrgsContext.d.ts +6 -1
  123. package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
  124. package/dist/esm/core/security/UserOrgsContext.js +87 -10
  125. package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
  126. package/dist/esm/core/security/consent-gate.frontend.utils.d.ts +17 -5
  127. package/dist/esm/core/security/consent-gate.frontend.utils.d.ts.map +1 -1
  128. package/dist/esm/core/security/consent-gate.frontend.utils.js +16 -7
  129. package/dist/esm/core/security/consent-gate.frontend.utils.js.map +1 -1
  130. package/dist/esm/core/security/useConsentGateBehavior.js +1 -1
  131. package/dist/esm/core/security/useConsentGateBehavior.js.map +1 -1
  132. package/dist/esm/core/security/useGrantedConsentPurposes.js +1 -1
  133. package/dist/esm/core/security/useGrantedConsentPurposes.js.map +1 -1
  134. package/dist/esm/core/ui/inner-control-activation.utils.d.ts +16 -0
  135. package/dist/esm/core/ui/inner-control-activation.utils.d.ts.map +1 -0
  136. package/dist/esm/core/ui/inner-control-activation.utils.js +44 -0
  137. package/dist/esm/core/ui/inner-control-activation.utils.js.map +1 -0
  138. package/dist/esm/index.d.ts +1 -0
  139. package/dist/esm/index.d.ts.map +1 -1
  140. package/dist/esm/index.js +1 -0
  141. package/dist/esm/index.js.map +1 -1
  142. package/dist/tsconfig.build.tsbuildinfo +1 -1
  143. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-controller-internals.js","sourceRoot":"","sources":["../../../../src/core/navigation/navigation-controller-internals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,gCAAgC,GAGjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AACpG,OAAO,EACL,mCAAmC,EACnC,0CAA0C,EAC1C,0CAA0C,GAC3C,MAAM,uEAAuE,CAAC;AAE/E,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAE9G,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,GAAG,qBAAqB,CAAC,SAAS,EAAE,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAiE,MAAM,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;AACpI,MAAM,CAAC,mBAAmB,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;;;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MAAM,CAAC,MAAM,CAAC,CAAC;IAClB,OAAO,UAAU,CAAC,UAAU,KAAK,IAAI,IAAI,UAAU,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU,CAAC;AACvF,CAAC;AAED;;;;;GAKG;AACH,SAAS,8CAA8C,CACrD,eAAiD,EACjD,QAAmC,EACnC,QAAwC;IAExC,MAAM,YAAY,GAAG,CAAC,eAAe,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC9H,MAAM,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,YAAY,GAAG,eAAe,CAAC,uBAAuB,CAAC,OAAO,CAAC,YAAY,EAAE,eAAe,CAAC,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACpJ,OAAO,4BAA4B,CAAC,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,QAAQ,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrI,CAAC","sourcesContent":["/**\n * What every layer of the navigation controller needs and no one layer owns: the debug channel, the one\n * function that writes the browser URL, and the resolver inputs a resource operation states about itself\n * (read by the click and by a reload alike, so the two cannot answer differently — #2130).\n *\n * Extracted 2026-09-25 when `useNavigationController.ts` was split — 2,322 lines holding click\n * resolution, URL reconciliation, the ancestor cascade, clean breaks, dismiss and the emit bridge in\n * one module. Measured across the seam, the ROUTER-SYNC half used exactly THREE symbols from the\n * controller half (`logDebug` and the two cascade functions), which is what made the split cheap\n * enough to be worth doing at all.\n *\n * ## The debug type name is DELIBERATELY still `useNavigationController`\n *\n * `logger.debugByType` keys on this string, and it is what an operator or a test types to turn the\n * channel on (`setDebugTypeLogging('useNavigationController', true)`). Giving each split module its\n * own name would be finer-grained and would silently stop every existing toggle from reaching the\n * router-sync logs — a split is not the moment to change what a diagnostic switch covers.\n */\n\nimport type { useNavigate } from 'react-router';\n\nimport {\n CoreResourceOperation,\n NavigationZoneName,\n ResourceOperationFrontendSurface,\n type NavigationLayout,\n type TransitionConfig,\n} from '@wildo-ai/saas-models';\nimport { ViewportBreakpoint } from '@wildo-ai/zod-decorators';\n\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport {\n resolveActionPresentationTransition,\n resolveEffectiveCoreOperationFromOperation,\n resolveResourceOperationActionPresentation,\n} from '~wildo-frontend-lib/core/resources/operation-semantics.frontend.utils';\nimport type { FrontendResourceOperationContext, FrontendResourcesRegistry } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { navigationPolicyResolver, resolveViewportDiscriminated } from './navigation-policy-resolver.service';\nimport type { NavigationContent, NavigationResolutionContext } from './navigation.schemas';\nimport { NavigationUtils } from './navigation.utils';\n\nconst logger = LoggerFrontendService.getLogger();\n\nexport const logDebug: (message: string, context?: Record<string, unknown>) => void = logger.debugByType('useNavigationController');\nlogger.setDebugTypeLogging('useNavigationController', false);\n\n/**\n * Update the browser URL via React Router's navigate function, so React Router's\n * `useLocation` hook updates. Everything derived from `useLocation` depends on\n * this: deep-link shareability, back-button state, and the sidebar's\n * most-specific-active highlight (`useSidebarBehavior` reads `useLocation`).\n *\n * ORDERING (why the transaction): the URL→state reconstruction hooks\n * (`useRouterSync`, `useViewRouterSync`, `useEnginePageRouterSync`,\n * `useSettingsHubOverlaySync`) observe `location` changes and rebuild zone state\n * from the URL — UNLESS the target zone already owns the URL, OR a navigation\n * transaction is active. A controller-driven navigation emits the zone-state\n * entry (event bus → `setState`) and THEN changes the URL; if the URL change is\n * observed before that state has committed, those hooks would re-derive stale\n * content (the race the old code papered over). We therefore open (or extend) a\n * navigation transaction so they skip during the commit window and re-validate\n * via their transaction-aware retry once state has committed — by then the\n * emitted entry owns the URL, so they no-op. This mirrors\n * `navigatePathWithFreshStart` / `emitFreshStartNavigationCleanup`, which already\n * pair `beginTransaction` with a synchronous `routerNavigate`.\n *\n * NOT PAINT-GATED (why not requestAnimationFrame): rAF callbacks are throttled to\n * ~0fps in occluded / backgrounded / throttled tabs, so a deferred\n * `routerNavigate` could be stranded indefinitely — zone content (event bus →\n * state) swaps instantly while the URL, sidebar highlight, and back-button state\n * lag until the tab is refocused (reproduced live: composite-view content visible\n * while `location.pathname` stayed stale for 8+ seconds, converging only on tab\n * activation). The transaction guard fills the ordering role rAF was standing in\n * for, without the paint dependency.\n */\n/**\n * Only a resource operation DECLARED `ADDRESSABLE` owns a browser URL.\n *\n * The URL builders are surface-blind — `resolveResourceUrl` happily produces a\n * pattern URL for any URL-bearing variant, including EMBEDDED (notAddressable)\n * ones — but `AppRouter` registers routes for ADDRESSABLE operations only, so\n * writing such a URL to the browser strands refresh / deep-link on the router\n * 404 (seen live 2026-08-19: a breadcrumb click on the EMBEDDED organizations\n * READ rewrote the URL to `/organizations/:id`, a route that does not exist).\n * EMBEDDED content navigates as pure zone/overlay content instead.\n *\n * An `undefined` surface (synthetic/legacy operation objects that never passed\n * through the registry's Step-2.5 posture resolution) keeps the historical\n * URL-writing behavior — only an EXPLICIT non-addressable declaration opts out.\n */\nexport function resourceOperationOwnsBrowserUrl(\n operation: { operationFrontendConfig?: { surface?: ResourceOperationFrontendSurface } } | undefined,\n): boolean {\n const surface = operation?.operationFrontendConfig?.surface;\n return surface !== ResourceOperationFrontendSurface.EMBEDDED\n && surface !== ResourceOperationFrontendSurface.API_ONLY;\n}\n\nexport function updateBrowserUrl(\n routerNavigate: ReturnType<typeof useNavigate>,\n urlPath: string,\n replace: boolean = false\n): void {\n // Preserve an in-flight transaction's source label (e.g. 'app_level_navigation'\n // opened by the APP_LEVEL clean break in navigate()) — only open a fresh window\n // when none is active (zone-level drill, goBack, non-app-level cascade). The\n // transaction auto-commits on setTimeout(0), after React has committed the\n // preceding zone-state emit.\n if (!NavigationUtils.isInTransaction()) {\n NavigationUtils.beginTransaction('controller_url_update');\n }\n routerNavigate(urlPath, { replace });\n}\n\n/**\n * The resolver inputs a navigation's CONTENT decides on its own: which operation, what it means, which resource,\n * the surface it declares, its own navigation overrides and its action presentation.\n *\n * One derivation, read by the click (`navigate`) and by a reload (`restoredEntryIsPersistent`), so a pane restored\n * from the URL is resolved from exactly what placed it (#2130). Content that is not a resource operation states\n * none of them, and is resolved as a LIST.\n */\nexport type OperationResolutionInputs = Pick<\n NavigationResolutionContext,\n 'operation' | 'effectiveOperation' | 'resourceType' | 'operationSurface' | 'operationOverrides'\n | 'actionPresentationTransition' | 'actionPresentationIsAuthored'\n>;\n\nexport function deriveOperationResolutionInputs(content: NavigationContent): OperationResolutionInputs {\n if (!NavigationUtils.isResourceOperationContent(content)) {\n return { operation: CoreResourceOperation.LIST, effectiveOperation: CoreResourceOperation.LIST, actionPresentationIsAuthored: false };\n }\n const operation = content.resourceContext.operation;\n return {\n operation: operation?.operationIdentifier ?? CoreResourceOperation.LIST,\n effectiveOperation: resolveEffectiveCoreOperationFromOperation(operation),\n resourceType: content.resourceContext.resourceType,\n operationSurface: operation?.operationFrontendConfig?.surface,\n operationOverrides: operation?.operationFrontendConfig?.navigationOverrides as NavigationResolutionContext['operationOverrides'],\n // The action-presentation ALIAS is read off the operation, never threaded in by a caller: navigation is reached\n // from several action surfaces, and a parameter would have to be passed correctly by every one of them.\n actionPresentationTransition: resolveActionPresentationTransition(resolveResourceOperationActionPresentation(operation)),\n actionPresentationIsAuthored: operation?.operationFrontendConfig?.actionPresentation !== undefined,\n };\n}\n\n/** The zone a split INTO `paneZone` was clicked from: the pane opens beside the zone below it. */\nconst ZONE_BELOW: Partial<Record<NavigationZoneName, NavigationZoneName>> = {\n [NavigationZoneName.SECONDARY]: NavigationZoneName.PRIMARY,\n [NavigationZoneName.COMPANION]: NavigationZoneName.SECONDARY,\n};\n\n/**\n * Whether an entry RESTORED from the URL stands for a `persistent` split, and so must carry `persistent` (#2130).\n *\n * A click resolves `persistent` from the transition chain, and the entry carries it; the zone-dependency cleanup\n * then keeps the pane when the page beneath it changes (`NavigationStackEntry.persistent`). A reload rebuilt the pane\n * from the URL by relationship depth and never asked, so the pane came back without it and the next unrelated\n * primary navigation closed it — `NAVIGATION_LAYOUT_TRIPLE` (APP_EMAIL, APP_ERP, KIT_WIDESCREEN) ships exactly this.\n *\n * So it asks the resolver the question the click asked: the restored content, opened from the zone below the pane it\n * belongs to (`paneZone`), with those zones occupied and the pane free, at the current viewport. It is persistent\n * when the resolver says so AND places it where the reload did (`placedZone`) — a pane collapsed into PRIMARY at this\n * width is placed there by a click too, and carries the flag the same way.\n *\n * RECOMPUTED rather than carried in the URL: everything persistence depends on is recoverable — the layout, the\n * operation's own overrides and action presentation, the viewport — and a URL flag would be a second record of a\n * fact the configuration already holds, one that survives the configuration changing.\n *\n * That includes the RELATIONSHIP's transition (`display.inParentNavigation.transition`, where a relationship declares\n * a companion pane as `{ transition: SPLIT, persistent: true }`). A click passes it only when the pane was opened from the parent's relationship\n * section, and no URL says which control opened a pane. But a reload rebuilds the chain THROUGH that relationship:\n * the ancestor cascade puts the pane's nearest parent in the zone below, found by the same relationship. So the pane\n * is resolved as opened from that parent's section, which is the chain the reload rebuilds. It is resolved for the\n * viewport the way the section resolves it (`resolveViewportDiscriminated`, desktop when unmeasured). A pane opened\n * some other way (a row of a list in the zone below) is restored as if opened through the relationship; the URL\n * cannot tell the two apart.\n */\nexport function restoredEntryIsPersistent(params: {\n content: NavigationContent;\n /** The zone the content belongs to — where a click from the zone below would open it. */\n paneZone: NavigationZoneName;\n /** The zone the reload actually placed it in (PRIMARY when the pane is collapsed at this width). */\n placedZone: NavigationZoneName;\n layout: NavigationLayout | undefined;\n registry: FrontendResourcesRegistry;\n viewport: ViewportBreakpoint;\n contentAreaWidth?: number;\n}): boolean {\n const clickSource = ZONE_BELOW[params.paneZone];\n if (!params.layout || !clickSource) return false;\n const relationshipTransition = NavigationUtils.isResourceOperationContent(params.content)\n ? resolveRelationshipTransitionFromNearestParent(params.content.resourceContext, params.registry, params.viewport)\n : undefined;\n const zoneOccupancy: Partial<Record<NavigationZoneName, boolean>> = { [NavigationZoneName.PRIMARY]: true };\n if (clickSource === NavigationZoneName.SECONDARY) zoneOccupancy[NavigationZoneName.SECONDARY] = true;\n const resolution = navigationPolicyResolver.resolve({\n ...deriveOperationResolutionInputs(params.content),\n relationshipTransition,\n sourceZone: clickSource,\n focusedZone: clickSource,\n viewport: params.viewport,\n contentAreaWidth: params.contentAreaWidth,\n zoneOccupancy,\n zoneDepth: {},\n }, params.layout);\n return resolution.persistent === true && resolution.targetZone === params.placedZone;\n}\n\n/**\n * The transition the relationship between a restored record and its NEAREST parent declares\n * (`display.inParentNavigation.transition`), resolved for the viewport as the parent's relationship section resolves\n * it. `undefined` when the record has no parent requirement or the relationship declares none. A primary-scope\n * parent (the organization, the user) is skipped: the cascade places no zone for it, so nothing was opened from it.\n */\nfunction resolveRelationshipTransitionFromNearestParent(\n resourceContext: FrontendResourceOperationContext,\n registry: FrontendResourcesRegistry,\n viewport: ViewportBreakpoint | undefined,\n): TransitionConfig | undefined {\n const requirements = (resourceContext.parentResourcesRequirements ?? []).filter((requirement) => !requirement.isPrimaryScope);\n const nearest = requirements[requirements.length - 1];\n if (!nearest) return undefined;\n const relationship = NavigationUtils.findRelationshipBetween(nearest.resourceType, resourceContext.resourceType, registry, nearest.foreignKeyField);\n return resolveViewportDiscriminated(relationship?.display?.inParentNavigation?.transition, viewport ?? ViewportBreakpoint.DESKTOP);\n}\n"]}
1
+ {"version":3,"file":"navigation-controller-internals.js","sourceRoot":"","sources":["../../../../src/core/navigation/navigation-controller-internals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,gCAAgC,GAGjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,O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WAAW,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC9H,MAAM,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,YAAY,GAAG,eAAe,CAAC,uBAAuB,CAAC,OAAO,CAAC,YAAY,EAAE,eAAe,CAAC,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACpJ,OAAO,4BAA4B,CAAC,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,QAAQ,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrI,CAAC","sourcesContent":["/**\n * What every layer of the navigation controller needs and no one layer owns: the debug channel, the one\n * function that writes the browser URL, and the resolver inputs a resource operation states about itself\n * (read by the click and by a reload alike, so the two cannot answer differently — #2130).\n *\n * Extracted 2026-09-25 when `useNavigationController.ts` was split — 2,322 lines holding click\n * resolution, URL reconciliation, the ancestor cascade, clean breaks, dismiss and the emit bridge in\n * one module. Measured across the seam, the ROUTER-SYNC half used exactly THREE symbols from the\n * controller half (`logDebug` and the two cascade functions), which is what made the split cheap\n * enough to be worth doing at all.\n *\n * ## The debug type name is DELIBERATELY still `useNavigationController`\n *\n * `logger.debugByType` keys on this string, and it is what an operator or a test types to turn the\n * channel on (`setDebugTypeLogging('useNavigationController', true)`). Giving each split module its\n * own name would be finer-grained and would silently stop every existing toggle from reaching the\n * router-sync logs — a split is not the moment to change what a diagnostic switch covers.\n */\n\nimport type { useNavigate } from 'react-router';\n\nimport {\n CoreResourceOperation,\n NavigationZoneName,\n ResourceOperationFrontendSurface,\n type NavigationLayout,\n type TransitionConfig,\n} from '@wildo-ai/saas-models';\nimport { ViewportBreakpoint } from '@wildo-ai/zod-decorators';\n\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport {\n resolveActionPresentationTransition,\n resolveEffectiveCoreOperationFromOperation,\n resolveResourceOperationActionPresentation,\n} from '~wildo-frontend-lib/core/resources/operation-semantics.frontend.utils';\nimport type { FrontendResourceOperationContext, FrontendResourcesRegistry } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { navigationPolicyResolver, resolveViewportDiscriminated } from './navigation-policy-resolver.service';\nimport type { NavigationContent, NavigationResolutionContext } from './navigation.schemas';\nimport { NavigationUtils } from './navigation.utils';\n\nconst logger = LoggerFrontendService.getLogger();\n\nexport const logDebug: (message: string, context?: Record<string, unknown>) => void = logger.debugByType('useNavigationController');\nlogger.setDebugTypeLogging('useNavigationController', false);\n\n/**\n * Update the browser URL via React Router's navigate function, so React Router's\n * `useLocation` hook updates. Everything derived from `useLocation` depends on\n * this: deep-link shareability, back-button state, and the sidebar's\n * most-specific-active highlight (`useSidebarBehavior` reads `useLocation`).\n *\n * ORDERING (why the transaction): the URL→state reconstruction hooks\n * (`useRouterSync`, `useViewRouterSync`, `useEnginePageRouterSync`,\n * `useSettingsHubOverlaySync`) observe `location` changes and rebuild zone state\n * from the URL — UNLESS the target zone already owns the URL, OR a navigation\n * transaction is active. A controller-driven navigation emits the zone-state\n * entry (event bus → `setState`) and THEN changes the URL; if the URL change is\n * observed before that state has committed, those hooks would re-derive stale\n * content (the race the old code papered over). We therefore open (or extend) a\n * navigation transaction so they skip during the commit window and re-validate\n * via their transaction-aware retry once state has committed — by then the\n * emitted entry owns the URL, so they no-op. This mirrors\n * `navigatePathWithFreshStart` / `emitFreshStartNavigationCleanup`, which already\n * pair `beginTransaction` with a synchronous `routerNavigate`.\n *\n * NOT PAINT-GATED (why not requestAnimationFrame): rAF callbacks are throttled to\n * ~0fps in occluded / backgrounded / throttled tabs, so a deferred\n * `routerNavigate` could be stranded indefinitely — zone content (event bus →\n * state) swaps instantly while the URL, sidebar highlight, and back-button state\n * lag until the tab is refocused (reproduced live: composite-view content visible\n * while `location.pathname` stayed stale for 8+ seconds, converging only on tab\n * activation). The transaction guard fills the ordering role rAF was standing in\n * for, without the paint dependency.\n */\n/**\n * Only a resource operation DECLARED `ADDRESSABLE` owns a browser URL.\n *\n * The URL builders are surface-blind — `resolveResourceUrl` happily produces a\n * pattern URL for any URL-bearing variant, including EMBEDDED (notAddressable)\n * ones — but `AppRouter` registers routes for ADDRESSABLE operations only, so\n * writing such a URL to the browser strands refresh / deep-link on the router\n * 404 (seen live 2026-08-19: a breadcrumb click on the EMBEDDED organizations\n * READ rewrote the URL to `/organizations/:id`, a route that does not exist).\n * EMBEDDED content navigates as pure zone/overlay content instead.\n *\n * An `undefined` surface (synthetic/legacy operation objects that never passed\n * through the registry's Step-2.5 posture resolution) keeps the historical\n * URL-writing behavior — only an EXPLICIT non-addressable declaration opts out.\n */\nexport function resourceOperationOwnsBrowserUrl(\n operation: { operationFrontendConfig?: { surface?: ResourceOperationFrontendSurface } } | undefined,\n): boolean {\n const surface = operation?.operationFrontendConfig?.surface;\n return surface !== ResourceOperationFrontendSurface.EMBEDDED\n && surface !== ResourceOperationFrontendSurface.API_ONLY;\n}\n\nexport function updateBrowserUrl(\n routerNavigate: ReturnType<typeof useNavigate>,\n urlPath: string,\n replace: boolean = false\n): void {\n // Preserve an in-flight transaction's source label (e.g. 'app_level_navigation'\n // opened by the APP_LEVEL clean break in navigate()) — only open a fresh window\n // when none is active (zone-level drill, goBack, non-app-level cascade). The\n // transaction auto-commits on setTimeout(0), after React has committed the\n // preceding zone-state emit.\n if (!NavigationUtils.isInTransaction()) {\n NavigationUtils.beginTransaction('controller_url_update');\n }\n routerNavigate(urlPath, { replace });\n}\n\n/**\n * The resolver inputs a navigation's CONTENT decides on its own: which operation, what it means, which resource,\n * the surface it declares, its own navigation overrides and its action presentation.\n *\n * One derivation, read by the click (`navigate`) and by a reload (`restoredEntryIsPersistent`), so a pane restored\n * from the URL is resolved from exactly what placed it (#2130). Content that is not a resource operation states\n * none of them, and is resolved as a LIST.\n */\nexport type OperationResolutionInputs = Pick<\n NavigationResolutionContext,\n 'operation' | 'effectiveOperation' | 'resourceType' | 'operationSurface' | 'operationOverrides'\n | 'actionPresentationTransition' | 'actionPresentationIsAuthored'\n>;\n\nexport function deriveOperationResolutionInputs(content: NavigationContent): OperationResolutionInputs {\n if (!NavigationUtils.isResourceOperationContent(content)) {\n return { operation: CoreResourceOperation.LIST, effectiveOperation: CoreResourceOperation.LIST, actionPresentationIsAuthored: false };\n }\n const operation = content.resourceContext.operation;\n return {\n operation: operation?.operationIdentifier ?? CoreResourceOperation.LIST,\n effectiveOperation: resolveEffectiveCoreOperationFromOperation(operation),\n resourceType: content.resourceContext.resourceType,\n operationSurface: operation?.operationFrontendConfig?.surface,\n operationOverrides: operation?.operationFrontendConfig?.navigationOverrides as NavigationResolutionContext['operationOverrides'],\n // The action-presentation ALIAS is read off the operation, never threaded in by a caller: navigation is reached\n // from several action surfaces, and a parameter would have to be passed correctly by every one of them.\n actionPresentationTransition: resolveActionPresentationTransition(resolveResourceOperationActionPresentation(operation)),\n actionPresentationIsAuthored: operation?.operationFrontendConfig?.actionPresentation !== undefined,\n };\n}\n\n/** The zone a split INTO `paneZone` was clicked from: the pane opens beside the zone below it. */\nconst ZONE_BELOW: Partial<Record<NavigationZoneName, NavigationZoneName>> = {\n [NavigationZoneName.SECONDARY]: NavigationZoneName.PRIMARY,\n [NavigationZoneName.COMPANION]: NavigationZoneName.SECONDARY,\n};\n\n/**\n * Whether an entry RESTORED from the URL stands for a `persistent` split, and so must carry `persistent` (#2130).\n *\n * A click resolves `persistent` from the transition chain, and the entry carries it; the zone-dependency cleanup\n * then keeps the pane when the page beneath it changes (`NavigationStackEntry.persistent`). A reload rebuilt the pane\n * from the URL by relationship depth and never asked, so the pane came back without it and the next unrelated\n * primary navigation closed it — `NAVIGATION_LAYOUT_TRIPLE` (APP_EMAIL, APP_ERP, KIT_WIDESCREEN) ships exactly this.\n *\n * So it asks the resolver the question the click asked: the restored content, opened from the zone below the pane it\n * belongs to (`paneZone`), with those zones occupied and the pane free, at the current viewport. It is persistent\n * when the resolver says so AND places it where the reload did (`placedZone`) — a pane collapsed into PRIMARY at this\n * width is placed there by a click too, and carries the flag the same way.\n *\n * RECOMPUTED rather than carried in the URL: everything persistence depends on is recoverable — the layout, the\n * operation's own overrides and action presentation, the viewport — and a URL flag would be a second record of a\n * fact the configuration already holds, one that survives the configuration changing.\n *\n * That includes the RELATIONSHIP's transition (`display.inParentNavigation.transition`, where a relationship declares\n * a companion pane as `{ transition: SPLIT, persistent: true }`). A click passes it only when the pane was opened from the parent's relationship\n * section, and no URL says which control opened a pane. But a reload rebuilds the chain THROUGH that relationship:\n * the ancestor cascade puts the pane's nearest parent in the zone below, found by the same relationship. So the pane\n * is resolved as opened from that parent's section, which is the chain the reload rebuilds. It is resolved for the\n * viewport the way the section resolves it (`resolveViewportDiscriminated`, desktop when unmeasured). A pane opened\n * some other way (a row of a list in the zone below) is restored as if opened through the relationship; the URL\n * cannot tell the two apart.\n */\nexport function restoredEntryIsPersistent(params: {\n content: NavigationContent;\n /** The zone the content belongs to — where a click from the zone below would open it. */\n paneZone: NavigationZoneName;\n /** The zone the reload actually placed it in (PRIMARY when the pane is collapsed at this width). */\n placedZone: NavigationZoneName;\n layout: NavigationLayout | undefined;\n registry: FrontendResourcesRegistry;\n viewport: ViewportBreakpoint;\n contentAreaWidth?: number;\n}): boolean {\n const resolution = resolveRestoredContentFromZoneBelow(params);\n return resolution?.persistent === true && resolution.targetZone === params.placedZone;\n}\n\n/**\n * Whether a CLICK from the zone below would keep nested content restored from the URL in PRIMARY, rather than in the\n * pane its relationship depth points at (`paneZone`, SECONDARY or COMPANION) (#3764).\n *\n * ## The defect: one address, two layouts, for every nested destination a click keeps in PRIMARY\n *\n * A reload places a resource by its relationship DEPTH (`NavigationUtils.resolveResourceTargetZone`: depth 1 →\n * SECONDARY, depth 2 → COMPANION) and the ancestor cascade fills the zones below it. That answers \"where does a\n * nested record sit beside its parent?\" without asking whether the application ever opens it beside its parent.\n * A click never reads depth: it asks the policy resolver, and the resolver keeps in PRIMARY everything nothing\n * declares a SPLIT for. So the two disagreed for every nested destination a click keeps in PRIMARY.\n *\n * Measured on Wonder Todos (2026-11-14), after its layout gained a `secondary` zone (664b47759): choosing a list in\n * the quick switcher promotes the todos listing to `/organizations/:org/todo-lists/:list/todos`, full width in\n * PRIMARY. Reloading that same address split the page: the list's READ in PRIMARY and the listing in a pane beside\n * it, with a back arrow on a page that had nothing to go back to. Wonder CRM declares the same intent in its own\n * layout (\"`primary.transitions.read` is still `PUSH`, so every other resource's drill-in is unchanged\"), and\n * every nested CRM record reloaded into the pane all the same.\n *\n * ## What this asks, and what it leaves alone\n *\n * The same question `restoredEntryIsPersistent` asks, through the same derivation: this content, opened from the\n * zone below the pane, with that zone occupied and the pane free, through the relationship to its nearest parent.\n * `true` only when the resolver places it in PRIMARY (a PUSH or REPLACE there, not a split the current width merely\n * collapses, which `collapsedFromZone` reports and the caller collapses itself): the reload then restores into\n * PRIMARY too, and the ancestor cascade has nothing to fill.\n *\n * Every other answer leaves the depth placement as it was, deliberately. A pane the click opens is the depth pane\n * or a sibling of it (a READ pushed inside SECONDARY, where depth said COMPANION), and an overlay outcome (an\n * addressable UPDATE route) has no structural zone a reload could open; neither is the defect, and the three-pane\n * reconstruction (#2115) is pinned on them as they are.\n *\n * Only a depth ≥ 1 placement is asked. A flat (depth-0) detail has its own reconstruction of the same chain,\n * `NavigationUtils.layoutSplitsOperationFromPrimary` (#203), and no parent the cascade could have placed.\n *\n * Rejected: deciding from the operation alone (\"a LIST never goes to a pane\"). A relationship may declare a SPLIT\n * for a child collection, and an operation may override its zone's verb; only the resolver reads every tier the\n * click reads, which is what keeps the two from drifting apart again.\n */\nexport function clickKeepsRestoredContentInPrimary(params: {\n content: NavigationContent;\n /** The pane the content's relationship depth points at. PRIMARY is no pane, and answers `false`. */\n paneZone: NavigationZoneName;\n layout: NavigationLayout | undefined;\n registry: FrontendResourcesRegistry;\n viewport: ViewportBreakpoint;\n contentAreaWidth?: number;\n}): boolean {\n const resolution = resolveRestoredContentFromZoneBelow(params);\n if (!resolution) return false;\n return (resolution.collapsedFromZone ?? resolution.targetZone) === NavigationZoneName.PRIMARY;\n}\n\n/**\n * The resolver's answer for restored content opened from the zone below `paneZone` (the click that would have opened\n * that pane), or `undefined` when `paneZone` has no zone below it (PRIMARY) or no layout is resolved yet. One\n * derivation for both questions a reload asks of a pane: where the content goes, and whether it persists.\n */\nfunction resolveRestoredContentFromZoneBelow(params: {\n content: NavigationContent;\n paneZone: NavigationZoneName;\n layout: NavigationLayout | undefined;\n registry: FrontendResourcesRegistry;\n viewport: ViewportBreakpoint;\n contentAreaWidth?: number;\n}): ReturnType<typeof navigationPolicyResolver.resolve> | undefined {\n const clickSource = ZONE_BELOW[params.paneZone];\n if (!params.layout || !clickSource) return undefined;\n const relationshipTransition = NavigationUtils.isResourceOperationContent(params.content)\n ? resolveRelationshipTransitionFromNearestParent(params.content.resourceContext, params.registry, params.viewport)\n : undefined;\n const zoneOccupancy: Partial<Record<NavigationZoneName, boolean>> = { [NavigationZoneName.PRIMARY]: true };\n if (clickSource === NavigationZoneName.SECONDARY) zoneOccupancy[NavigationZoneName.SECONDARY] = true;\n return navigationPolicyResolver.resolve({\n ...deriveOperationResolutionInputs(params.content),\n relationshipTransition,\n sourceZone: clickSource,\n focusedZone: clickSource,\n viewport: params.viewport,\n contentAreaWidth: params.contentAreaWidth,\n zoneOccupancy,\n zoneDepth: {},\n }, params.layout);\n}\n\n/**\n * The transition the relationship between a restored record and its NEAREST parent declares\n * (`display.inParentNavigation.transition`), resolved for the viewport as the parent's relationship section resolves\n * it. `undefined` when the record has no parent requirement or the relationship declares none. A primary-scope\n * parent (the organization, the user) is skipped: the cascade places no zone for it, so nothing was opened from it.\n */\nfunction resolveRelationshipTransitionFromNearestParent(\n resourceContext: FrontendResourceOperationContext,\n registry: FrontendResourcesRegistry,\n viewport: ViewportBreakpoint | undefined,\n): TransitionConfig | undefined {\n const requirements = (resourceContext.parentResourcesRequirements ?? []).filter((requirement) => !requirement.isPrimaryScope);\n const nearest = requirements[requirements.length - 1];\n if (!nearest) return undefined;\n const relationship = NavigationUtils.findRelationshipBetween(nearest.resourceType, resourceContext.resourceType, registry, nearest.foreignKeyField);\n return resolveViewportDiscriminated(relationship?.display?.inParentNavigation?.transition, viewport ?? ViewportBreakpoint.DESKTOP);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigationRouterSync.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/useNavigationRouterSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAgBH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iEAAiE,CAAC;AAerG,OAAO,EAGL,qBAAqB,EAGtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAIL,gDAAgD,EAEjD,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,uCAAuC,EACxC,MAAM,+DAA+D,CAAC;AAuBvE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,SAAS,EAAE,uCAAuC,GAAG,SAAS,EAC9D,mBAAmB,CAAC,EAAE,gDAAgD,EAAE,GACvE,IAAI,CAsXN;AAOD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,WAAW,EAAE,qBAAqB,GACjC,IAAI,CAmJN;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAqDhF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,gCAAgC,IAAI,IAAI,CAwGvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAyI7C;AA4BD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CA8EhD"}
1
+ {"version":3,"file":"useNavigationRouterSync.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/useNavigationRouterSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAgBH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iEAAiE,CAAC;AAerG,OAAO,EAGL,qBAAqB,EAGtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAIL,gDAAgD,EAEjD,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,uCAAuC,EACxC,MAAM,+DAA+D,CAAC;AAuBvE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,SAAS,EAAE,uCAAuC,GAAG,SAAS,EAC9D,mBAAmB,CAAC,EAAE,gDAAgD,EAAE,GACvE,IAAI,CAkZN;AAOD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,WAAW,EAAE,qBAAqB,GACjC,IAAI,CAmJN;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAqDhF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,gCAAgC,IAAI,IAAI,CAwGvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAyI7C;AA4BD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CA8EhD"}
@@ -38,7 +38,7 @@ import { CommonRoutePaths } from '../../core/runtime/routes.frontend.definitions
38
38
  import { FrontendResourceUtils, frontendResourceUtils } from '../../core/resources/frontend-resource.utils.js';
39
39
  import { normalizeContextResourceIdentifiersForTransport } from '../../core/resources/context-resource-identifiers.frontend.utils.js';
40
40
  import { adjacentZoneUsableAtViewport } from './zone-collapse.js';
41
- import { logDebug, restoredEntryIsPersistent } from './navigation-controller-internals.js';
41
+ import { clickKeepsRestoredContentInPrimary, logDebug, restoredEntryIsPersistent } from './navigation-controller-internals.js';
42
42
  import { useViewerMayPerformAncestor } from './launcher-runtime-availability.js';
43
43
  import { cascadeAncestorZones, cascadeSiblingListIntoPrimary } from './navigation-cascade.js';
44
44
  // ================================
@@ -170,11 +170,39 @@ export function useRouterSync(resourceType, operation, routePathParameters) {
170
170
  * disagree. Note the viewport was ALREADY threaded into `prefersAdjacentZoneForDetail` just
171
171
  * above — one invariant, two sites, one of them done.
172
172
  */
173
- const preferredZone = NavigationUtils.resolveResourceTargetZone(depth, {
173
+ const depthPreferredZone = NavigationUtils.resolveResourceTargetZone(depth, {
174
174
  hasSecondary,
175
175
  hasCompanion,
176
176
  prefersAdjacentZoneForDetail,
177
177
  });
178
+ /*
179
+ * ─── Depth says where a nested record COULD sit; only the policy says whether it is opened there (#3764) ───
180
+ *
181
+ * A click from the parent's zone keeps in PRIMARY every nested destination nothing declares a SPLIT for, so a
182
+ * reload that put it in the pane by depth alone rebuilt a different page from the one the same address showed a
183
+ * moment earlier. `clickKeepsRestoredContentInPrimary` asks the resolver the click's question; the context it reads
184
+ * is the operation and its parent chain, which is all the resolver decides on.
185
+ */
186
+ const preferredZone = depth >= 1
187
+ && depthPreferredZone !== NavigationZoneName.PRIMARY
188
+ && clickKeepsRestoredContentInPrimary({
189
+ content: {
190
+ contentType: NavigationContentType.RESOURCE_OPERATION,
191
+ resourceContext: frontendResourceUtils.createFrontendResourceOperationContextFromOperation({
192
+ resourceType,
193
+ operation,
194
+ contextResourceIdentifiers: {},
195
+ parentResourcesRequirements,
196
+ }),
197
+ },
198
+ paneZone: depthPreferredZone,
199
+ layout: resolvedNavigationLayout,
200
+ registry,
201
+ viewport: currentBreakpoint,
202
+ contentAreaWidth,
203
+ })
204
+ ? NavigationZoneName.PRIMARY
205
+ : depthPreferredZone;
178
206
  const targetZone = adjacentZoneUsableAtViewport({
179
207
  zone: preferredZone,
180
208
  layout: resolvedNavigationLayout,
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigationRouterSync.js","sourceRoot":"","sources":["../../../../src/core/navigation/useNavigationRouterSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACX,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAEhG,OAAO,EACL,2CAA2C,EAC3C,+BAA+B,GAChC,MAAM,6DAA6D,CAAC;AACrE,OAAO,EACL,+CAA+C,GAChD,MAAM,wDAAwD,CAAC;AAChE,OAAO,EACL,+CAA+C,EAC/C,8BAA8B,GAC/B,MAAM,wDAAwD,CAAC;AAChE,OAAO,EACL,cAAc,GACf,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,cAAc,EAEd,qBAAqB,EACrB,2BAA2B,GAE5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EAEjB,yCAAyC,GAC1C,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAI7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO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BAAiB,CAAC,MAAM;gBACpC,SAAS,EAAE,KAAK;aACjB,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,8EAA8E;QAC9E,qDAAqD;QACrD,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,cAAc,CAAC,gBAAgB,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;YAC5E,IAAI,WAAW,CAAC,OAAO,KAAK,OAAO;gBAAE,OAAO;YAC5C,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;YAC9B,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC;YACxE,OAAO;QACT,CAAC;QACD,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;AACtG,CAAC","sourcesContent":["/**\n * URL RECONCILIATION: what a browser URL means for the zone state.\n *\n * Six hooks, one invariant — **the URL names exactly one zone's content, and the zones around it are\n * reconstructed from that**. They cover the deep link and refresh (`useRouterSync`,\n * `useViewRouterSync`, `useEnginePageRouterSync`), the browser's own back and forward across\n * structural zones (`useStructuralZoneBackForwardSync`), the `?pane=` hosted pane\n * (`useHostedPaneRouteSync`) and the settings-hub overlay (`useSettingsHubOverlaySync`).\n *\n * Split out of `useNavigationController.ts` on 2026-09-25. That module held the click path and this\n * one in 2,322 lines, and reasoning about either in isolation meant holding both; the seam was\n * measured rather than guessed — this half used exactly THREE symbols from the other (`logDebug` and\n * the two cascade functions), which is what made the split worth doing.\n *\n * Nothing here decides a PLACEMENT POLICY. Where content goes is `navigationPolicyResolver`'s\n * answer, read through `NavigationUtils.resolveResourceTargetZone`; these hooks decide only which\n * content the URL is currently naming and what has to be rebuilt around it.\n */\n\nimport {\n useMemo,\n useEffect,\n useRef,\n} from 'react';\nimport {\n useLocation,\n useParams,\n} from 'react-router';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { useNavigationState } from './useNavigationState';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\nimport type { EnginePageRef } from '~wildo-frontend-lib/core/config/launcher-items.frontend.schemas';\nimport {\n extractChartRouteContextResourceIdentifiers,\n extractChartRouteUrlParamValues,\n} from '~wildo-frontend-lib/core/config/chart-view.frontend.schemas';\nimport {\n extractCompositeRouteContextResourceIdentifiers,\n} from '~wildo-frontend-lib/core/config/composite-view.schemas';\nimport {\n extractExecutionRouteContextResourceIdentifiers,\n resolveExecutionViewDefinition,\n} from '~wildo-frontend-lib/core/config/execution-view.schemas';\nimport {\n FrontendEvents,\n} from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport {\n NavigationZone,\n NavigationContent,\n NavigationContentType,\n NAVIGATION_STRUCTURAL_ZONES,\n type NavigationStackEntry,\n} from './navigation.schemas';\nimport {\n NavigationTransition,\n NavigationZoneName,\n OverlayAppearance,\n ResourceConfiguration_Operation_UrlParameterInfo,\n ResourcesConfigOperationsUrlsBuilderUtils,\n} from '@wildo-ai/saas-models';\nimport type {\n FrontendResourceConfiguration_Operation,\n} from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport {\n resolveViewportDiscriminated,\n} from './navigation-policy-resolver.service';\nimport { NavigationSource } from './navigation.schemas';\nimport { NavigationUtils } from './navigation.utils';\nimport { useTransactionAwareSyncRetry } from './useTransactionAwareSyncRetry';\nimport { useRouterLocationAheadOfCommit, useSynchronousBrowserLocation } from './useSynchronousBrowserLocation';\nimport { CommonRoutePaths } from '~wildo-frontend-lib/core/runtime/routes.frontend.definitions';\nimport { FrontendResourceUtils, frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { normalizeContextResourceIdentifiersForTransport } from '~wildo-frontend-lib/core/resources/context-resource-identifiers.frontend.utils';\n\nimport { adjacentZoneUsableAtViewport } from './zone-collapse';\nimport { logDebug, restoredEntryIsPersistent } from './navigation-controller-internals';\nimport { useViewerMayPerformAncestor } from './launcher-runtime-availability';\nimport { cascadeAncestorZones, cascadeSiblingListIntoPrimary } from './navigation-cascade';\n\n// ================================\n// Router Sync Hook (merged from RouterNavigationSync)\n// ================================\n\n\n/**\n * Hook to sync React Router URL changes with navigation state.\n *\n * When a user navigates via URL (bookmark, direct link, refresh),\n * this hook ensures the navigation state is updated accordingly.\n *\n * Uses NavigationSource to detect controller-initiated navigation:\n * - If top entry has source=CONTROLLER and matches current URL, skip sync\n * - Otherwise, this is an external URL change, sync it with source=URL_SYNC\n *\n * @param resourceType - The resource type for the current route\n * @param operation - The operation configuration\n * @param routePathParameters - Route path parameters with relationship info for deterministic URL selection\n */\nexport function useRouterSync(\n resourceType: string | undefined,\n operation: FrontendResourceConfiguration_Operation | undefined,\n routePathParameters?: ResourceConfiguration_Operation_UrlParameterInfo[]\n): void {\n const location = useLocation();\n const routerLocationAhead = useRouterLocationAheadOfCommit(location);\n const urlParameters = useParams<Record<string, string>>() as Record<string, string>;\n const { registry } = useResourceRegistry();\n const { emit } = useEventBus();\n const { getZoneState, contentAreaWidth } = useNavigationState();\n const appScope = useAppScopeSafe();\n const viewerMayPerformAncestor = useViewerMayPerformAncestor();\n const { navigationLayout: resolvedNavigationLayout, currentBreakpoint } = useUI();\n const currentBrowserUrl = useMemo(\n () => NavigationUtils.buildBrowserUrl(location.pathname, location.search),\n [location.pathname, location.search],\n );\n const liveAppScopeContextIdentifiers = useMemo(\n () => appScope?.buildContextResourceIdentifiers?.() ?? {},\n [appScope],\n );\n const liveAppScopeContextIdentifiersKey = useMemo(\n () => FrontendResourceUtils.buildContextResourceIdentifiersKey(liveAppScopeContextIdentifiers),\n [liveAppScopeContextIdentifiers],\n );\n\n // Track the last synced path to avoid duplicate updates\n const lastSyncedPath = useRef<string | null>(null);\n const {\n retryTick,\n scheduleRetry: scheduleTransactionRetry,\n clearRetry: clearTransactionRetry,\n } = useTransactionAwareSyncRetry(currentBrowserUrl);\n\n // Pre-compute this resource's route patterns (memoized) so the effect can\n // cheaply verify that the current URL actually belongs to this resource.\n // This prevents re-populating the navigation stack when the Outlet briefly\n // mounts this ResourcePageWrapper during a route transition (e.g., Home '/').\n const resourceRoutePatterns = useMemo(() => {\n if (!resourceType || !operation) return [];\n const resourceConfig = registry.resourceConfigurations?.[resourceType];\n if (!resourceConfig) return [];\n return ResourcesConfigOperationsUrlsBuilderUtils.buildOperationFrontendRoutePaths(\n resourceConfig as any, operation, registry.allResourceFieldIdentifiers\n ).map(rp => rp.url);\n }, [resourceType, operation, registry]);\n\n useEffect(() => {\n\n if (!resourceType || !operation) return;\n\n logDebug('useRouterSync: effect fired', {\n resourceType,\n operationId: operation.operationIdentifier,\n locationPathname: location.pathname,\n lastSyncedPath: lastSyncedPath.current,\n routePatternsCount: resourceRoutePatterns.length,\n });\n\n // Guard: A NavigationTransaction is active (e.g., home click, org switch, cascading).\n // The Outlet briefly mounts this ResourcePageWrapper before React Router commits\n // the route change (startTransition = low-priority). Skip sync to prevent\n // re-populating the stack with stale content.\n if (NavigationUtils.isInTransaction()) {\n logDebug('useRouterSync: SKIP — navigation transaction active', { source: NavigationUtils.getTransactionSource() });\n scheduleTransactionRetry();\n return;\n }\n\n clearTransactionRetry();\n\n // Guard: the router already left the URL this route committed with. The transaction above ends on\n // `setTimeout(0)`, but a location transition can still be pending after it — so the committed URL here\n // names the page the browser LEFT. Rebuilding from it re-pushes that page, and the always-mounted\n // reconciler (reading the router) clears it again: the ping-pong measured on an organization switch.\n // The effect re-runs when the committed location catches up. See `useRouterLocationAheadOfCommit`.\n if (routerLocationAhead) {\n logDebug('useRouterSync: SKIP — the router is ahead of the committed location', { committedUrl: currentBrowserUrl });\n return;\n }\n\n // Skip if we've already synced this path\n if (lastSyncedPath.current === currentBrowserUrl) {\n logDebug('useRouterSync: SKIP — already synced this path', { currentBrowserUrl });\n return;\n }\n\n // Guard: verify the current URL actually matches one of this resource's route patterns.\n // When navigating to a non-resource route (e.g., Home '/'), the Outlet may briefly\n // mount this ResourcePageWrapper before React Router unmounts it. Without this guard,\n // useRouterSync would re-populate the PRIMARY stack with stale content, preventing\n // the target route (Home) from ever rendering.\n if (resourceRoutePatterns.length > 0) {\n const isUrlRelevant = resourceRoutePatterns.some(pattern =>\n NavigationUtils.matchUrlPattern(pattern, location.pathname)\n );\n if (!isUrlRelevant) {\n logDebug('useRouterSync: SKIP — URL does not match any resource route pattern', {\n pathname: location.pathname,\n patterns: resourceRoutePatterns,\n });\n lastSyncedPath.current = currentBrowserUrl;\n return;\n }\n }\n\n // Get the target resource's primaryScope to filter global identifiers\n // This prevents border effects from URL sync\n const targetPrimaryScope = registry.resourceConfigurations?.[resourceType]?.resourcePrimaryScope;\n\n // Build parentResourcesRequirements from route path parameters if available\n const parentResourcesRequirements = routePathParameters\n ? frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(\n routePathParameters,\n resourceType,\n registry\n )\n : [];\n\n // Reverse reconstruction must only trust the current top owner of the URL.\n // A stale match buried elsewhere in a stack should not suppress rebuild.\n const zones = resolvedNavigationLayout?.zones;\n const hasSecondary = !!zones?.secondary;\n const hasCompanion = !!zones?.companion;\n const depth = NavigationUtils.calculateResourceRelationshipDepth(parentResourcesRequirements);\n const prefersAdjacentZoneForDetail = depth === 0\n && hasSecondary\n && operation !== undefined\n // The viewport goes in so a VIEWPORT-scoped override is reconstructed the way the click\n // resolved it. `undefined` until the first measurement, which matches only the unconditional\n // overrides — an unknown viewport is not a particular one.\n && NavigationUtils.layoutSplitsOperationFromPrimary(resolvedNavigationLayout, operation, currentBreakpoint);\n /*\n * ─── The viewport decides here too, and until 2026-09-25 it did not ─────────────────────────\n *\n * `resolveResourceTargetZone` took no viewport, so a depth ≥ 1 resource went to SECONDARY at any\n * width — and the content areas render PRIMARY and nothing else on a phone. A bookmarked or\n * refreshed nested record therefore showed its PARENT (the ancestor the cascade puts in primary)\n * with no error. The CLICK path was correct throughout, because the resolver applies collapse,\n * which is exactly what made it invisible: the same content reached the right place when clicked\n * and the wrong place when linked to.\n *\n * `adjacentZoneUsableAtViewport` is the resolver's own predicate, so the two paths cannot\n * disagree. Note the viewport was ALREADY threaded into `prefersAdjacentZoneForDetail` just\n * above — one invariant, two sites, one of them done.\n */\n const preferredZone = NavigationUtils.resolveResourceTargetZone(depth, {\n hasSecondary,\n hasCompanion,\n prefersAdjacentZoneForDetail,\n });\n const targetZone = adjacentZoneUsableAtViewport({\n zone: preferredZone,\n layout: resolvedNavigationLayout,\n viewport: currentBreakpoint,\n contentAreaWidth,\n })\n ? preferredZone\n : NavigationZoneName.PRIMARY;\n if (targetZone !== preferredZone) {\n logDebug('useRouterSync: adjacent zone is collapsed at this viewport — restoring into PRIMARY', {\n preferredZone, viewport: currentBreakpoint, contentAreaWidth,\n });\n }\n /*\n * Ownership is asked per ZONE and by DESTINATION: the entry the target zone shows must address\n * this URL, and a view-state query difference (`?dataMode=`) is not a different destination.\n * The always-mounted reconciler refreshes the entry's `urlPath` for such a change; this hook's\n * only job is to not rebuild what is already there.\n */\n const targetZoneOwnsUrl = NavigationUtils.zoneOwnsBrowserUrl(targetZone, currentBrowserUrl, getZoneState);\n\n logDebug('useRouterSync: checking guards', {\n currentBrowserUrl,\n targetZone,\n targetZoneOwnsUrl,\n targetZoneTopUrlPath: NavigationUtils.getTopEntry(getZoneState(targetZone))?.urlPath,\n });\n\n if (targetZoneOwnsUrl) {\n logDebug('useRouterSync: SKIP — target zone already owns current URL', { targetZone });\n lastSyncedPath.current = currentBrowserUrl;\n return;\n }\n\n /*\n * ─── ANOTHER structural zone may already be showing this destination ────────────────────────\n *\n * The ownership question above is asked of the zone THIS HOOK computed, and that zone is\n * derived from the URL alone — depth, plus whether the layout splits this operation out of\n * primary. It cannot see where the content actually IS, so a record placed in a pane BY A CLICK\n * and addressed by a bare URL is invisible to it: the hook computes PRIMARY, asks PRIMARY, is\n * told no, and rebuilds the record there. Primary's top entry then changes, which makes the\n * zone-dependency cleanup clear SECONDARY — so the pane the reader was using disappears and the\n * record they opened in it is on the left instead.\n *\n * Measured on Wonder CRM (2026-09-24), and it is the defect reported as \"click a linked\n * resource inside the pane and it goes on the left, not on the right\": a `contact` opened from\n * inside a deal's pane lands in SECONDARY correctly (the pane's own `transitions.read` is\n * `PUSH`, so `getStructuralSourceZone` keeps it there) and writes `/contact/:id` as the browser\n * URL, because primary holds a deals LIST and is therefore URL-derivable — no hosted pane, no\n * `?pane=`. That bare URL is what this hook then reconstructs from.\n *\n * `findStructuralRouteOwner` is the question worth asking instead — \"which structural zone's\n * VISIBLE entry does this URL address?\" — and it already exists, scanning COMPANION → SECONDARY\n * → PRIMARY by destination. If any zone owns the URL, the application is already showing what\n * the URL names and there is nothing to reconstruct. A view-state-only difference\n * (`searchDiffers`) is likewise not a rebuild: the always-mounted reconciler refreshes the\n * entry's `urlPath` in place.\n *\n * This does NOT subsume the check above — that one is what lets the target zone REBUILD when it\n * holds a different destination — it is the missing half: the other zones get a veto they never\n * had.\n */\n const structuralOwner = NavigationUtils.findStructuralRouteOwner(currentBrowserUrl, getZoneState);\n if (structuralOwner && structuralOwner.zone !== targetZone) {\n logDebug('useRouterSync: SKIP — another structural zone already shows this destination', {\n owningZone: structuralOwner.zone,\n targetZone,\n currentBrowserUrl,\n });\n lastSyncedPath.current = currentBrowserUrl;\n return;\n }\n\n // Build resource context from URL params\n // Pass routePathParameters for accurate FK field mapping (e.g., assignedToUserId → USERS)\n const urlContextIdentifiers = frontendResourceUtils.extractResourceIdentifiersFromUrlParams(\n urlParameters,\n registry,\n routePathParameters\n );\n\n const mergedContextIdentifiers = ScopeUtilsService.buildResourceOperationContextIdentifiers({\n currentUserId: appScope?.currentUserId,\n currentOrganizationId: appScope?.currentOrganizationId,\n currentApplicationId: appScope?.currentApplicationId,\n currentAnonymousUserId: appScope?.currentAnonymousUserId,\n primaryScope: targetPrimaryScope,\n liveAppScopeContextResourceIdentifiers: liveAppScopeContextIdentifiers,\n explicitContextResourceIdentifiers: urlContextIdentifiers,\n });\n\n const resourceContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation,\n contextResourceIdentifiers: mergedContextIdentifiers,\n parentResourcesRequirements,\n });\n\n // Create navigation content\n const content: NavigationContent = {\n contentType: NavigationContentType.RESOURCE_OPERATION,\n resourceContext,\n };\n\n // Generate stack entry ID\n const stackEntryId = NavigationUtils.generateStackEntryId();\n\n // ─── Reverse Cascade: place content in the correct zone ──────────\n // On page refresh / deep link, the URL-synced resource should land in the\n // zone matching its relationship depth, not always PRIMARY.\n // depth 0 → PRIMARY, depth 1 → SECONDARY, depth 2+ → COMPANION.\n // Ancestor zones are then populated via cascadeAncestorZones.\n //\n logDebug('useRouterSync: EMITTING NAVIGATION_REPLACE (URL_SYNC)', {\n resourceType,\n operationId: operation.operationIdentifier,\n currentBrowserUrl,\n mergedContextIdentifiers,\n depth,\n targetZone,\n });\n\n // For deep resources (depth >= 1), wrap in a transaction so cascading\n // events don't cause useRouterSync to re-fire mid-reconstruction.\n if (depth >= 1) {\n NavigationUtils.beginTransaction('url_reverse_cascade');\n }\n\n /*\n * ─── Restoring a pane's record at a width where the pane is collapsed ──────────────────────\n *\n * It lands in PRIMARY — but it must land the way a CLICK at that width lands: the list beneath\n * it, and stamped with the pane it belongs to. It used to REPLACE into primary with neither, so\n * Back had nothing to return to and, with no `collapsedFromZone`, widening the window could\n * never send the record to its pane: it stayed full-width beside an empty one. The stamp is what\n * `zone-collapse-migration.ts` reads to take it home; the cascade runs FIRST so the record is\n * pushed on top of the list rather than replacing it.\n */\n const collapsedIntoPrimary = targetZone !== preferredZone;\n /*\n * A pane a PERSISTENT split opened survives the page beneath it changing, and must still do so after a reload\n * (#2130). The click stamped it from the resolver; this asks the resolver the same question for the restored\n * content, opened through the relationship the ancestor cascade rebuilds the chain by — see\n * `restoredEntryIsPersistent`.\n */\n const restoredPersistent = restoredEntryIsPersistent({\n content,\n paneZone: preferredZone,\n placedZone: targetZone,\n layout: resolvedNavigationLayout,\n registry,\n viewport: currentBreakpoint,\n contentAreaWidth,\n });\n if (collapsedIntoPrimary && prefersAdjacentZoneForDetail && preferredZone === NavigationZoneName.SECONDARY) {\n cascadeSiblingListIntoPrimary({\n resourceType: resourceType as string,\n contextResourceIdentifiers: mergedContextIdentifiers as Record<string, string>,\n parentResourcesRequirements, registry, emit, getZoneState,\n });\n }\n\n emit(collapsedIntoPrimary ? FrontendEvents.NAVIGATION_PUSH : FrontendEvents.NAVIGATION_REPLACE, {\n zone: targetZone,\n content,\n urlPath: currentBrowserUrl,\n stackEntryId,\n initiator: { sourceZone: targetZone },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.REPLACE,\n ...(collapsedIntoPrimary ? { collapsedFromZone: preferredZone } : {}),\n ...(restoredPersistent ? { persistent: true } : {}),\n });\n\n if (prefersAdjacentZoneForDetail && targetZone === NavigationZoneName.SECONDARY) {\n cascadeSiblingListIntoPrimary({\n resourceType: resourceType as string,\n contextResourceIdentifiers: mergedContextIdentifiers as Record<string, string>,\n parentResourcesRequirements, registry, emit, getZoneState,\n });\n }\n\n // Populate ancestor panes for depth 1+ resources\n if (depth >= 1) {\n // Normalize context identifiers to plain strings for cascading\n const normalizedForCascade = normalizeContextResourceIdentifiersForTransport(mergedContextIdentifiers as any);\n cascadeAncestorZones(\n content as NavigationContent & { contentType: NavigationContentType.RESOURCE_OPERATION },\n targetZone,\n registry,\n normalizedForCascade,\n emit,\n null, // No URL update needed — browser already has the correct URL\n getZoneState,\n { overwriteExisting: true, viewerMayPerform: viewerMayPerformAncestor },\n );\n // Transaction auto-commits via setTimeout(0)\n }\n\n lastSyncedPath.current = currentBrowserUrl;\n\n }, [\n location.pathname,\n location.search,\n routerLocationAhead,\n urlParameters,\n resourceType,\n operation,\n registry,\n emit,\n getZoneState,\n appScope?.currentUserId,\n appScope?.currentOrganizationId,\n appScope?.currentApplicationId,\n appScope?.currentAnonymousUserId,\n liveAppScopeContextIdentifiersKey,\n routePathParameters,\n resourceRoutePatterns,\n resolvedNavigationLayout,\n currentBreakpoint,\n currentBrowserUrl,\n retryTick,\n scheduleTransactionRetry,\n clearTransactionRetry,\n ]);\n}\n\n\n// ================================\n// View Router Sync Hook\n// ================================\n\n/**\n * Hook to sync view routes (composite, chart, custom, flows-actors) with navigation state.\n *\n * Unlike useRouterSync (which handles resource operations), this handles non-resource\n * content types that only need a viewRef and contentType. Views are always depth 0\n * (placed in PRIMARY zone), have no parent chain, and no cascading.\n *\n * On refresh / deep link, this hook populates the PRIMARY zone's navigation stack\n * with the correct view content so that:\n * - ZoneContentRenderer renders the view\n * - Sidebar active state reflects the current view\n * - goBack() works correctly\n *\n * @param viewRef - The view reference from the URL\n * @param contentType - The navigation content type (COMPOSITE_VIEW, CHART_VIEW, etc.)\n */\nexport function useViewRouterSync(\n viewRef: string | undefined,\n contentType: NavigationContentType,\n): void {\n const location = useLocation();\n const routerLocationAhead = useRouterLocationAheadOfCommit(location);\n const { emit } = useEventBus();\n const { getZoneState } = useNavigationState();\n const { registry } = useResourceRegistry();\n const { fullCustomViews, flowsActorsViews } = useUI();\n\n const lastSyncedPath = useRef<string | null>(null);\n const currentUrl = NavigationUtils.buildBrowserUrl(location.pathname, location.search);\n const {\n retryTick,\n scheduleRetry: scheduleTransactionRetry,\n clearRetry: clearTransactionRetry,\n } = useTransactionAwareSyncRetry(currentUrl);\n\n useEffect(() => {\n if (!viewRef) return;\n\n // Guard: transaction active\n if (NavigationUtils.isInTransaction()) {\n scheduleTransactionRetry();\n return;\n }\n\n clearTransactionRetry();\n\n // Guard: the router already left the URL this route committed with (a pending location transition).\n // Rebuilding from it would restore the page the browser left. See `useRouterLocationAheadOfCommit`.\n if (routerLocationAhead) return;\n\n // Skip if already synced\n if (lastSyncedPath.current === currentUrl) return;\n\n // Asked about PRIMARY's half of the URL: under a composed URL the HOST is this view and the\n // `pane` parameter belongs to the secondary zone's own reconciler. A view-state change\n // (`?section=`) on the same view is owned too — the reconciler refreshes the stamp in place.\n if (NavigationUtils.zoneOwnsBrowserUrl(NavigationZoneName.PRIMARY, currentUrl, getZoneState)) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // Deep-link sync should rebuild the same typed view payload, but ambient\n // primary scope is derived live from AppScope by the view itself.\n let content: NavigationContent;\n const compositeRouteContextResourceIdentifiers = contentType === NavigationContentType.COMPOSITE_VIEW\n ? extractCompositeRouteContextResourceIdentifiers(new URLSearchParams(location.search))\n : undefined;\n const chartRouteContextResourceIdentifiers = contentType === NavigationContentType.CHART_VIEW\n ? extractChartRouteContextResourceIdentifiers(new URLSearchParams(location.search))\n : undefined;\n const chartRouteUrlParamValues = contentType === NavigationContentType.CHART_VIEW\n ? extractChartRouteUrlParamValues(new URLSearchParams(location.search))\n : undefined;\n const executionRouteContextResourceIdentifiers = contentType === NavigationContentType.EXECUTION_VIEW\n ? extractExecutionRouteContextResourceIdentifiers(new URLSearchParams(location.search))\n : undefined;\n const fullCustomView = contentType === NavigationContentType.FULL_CUSTOM_VIEW\n ? fullCustomViews?.find(view => view.ref === viewRef)\n : undefined;\n const flowsActorsView = contentType === NavigationContentType.FLOWS_ACTORS_VIEW\n ? flowsActorsViews?.find(view => view.ref === viewRef)\n : undefined;\n const executionView = contentType === NavigationContentType.EXECUTION_VIEW\n ? resolveExecutionViewDefinition({\n viewRef,\n registry,\n })\n : undefined;\n switch (contentType) {\n case NavigationContentType.COMPOSITE_VIEW:\n content = {\n contentType: NavigationContentType.COMPOSITE_VIEW,\n viewRef,\n contextResourceIdentifiers: compositeRouteContextResourceIdentifiers,\n };\n break;\n case NavigationContentType.CHART_VIEW:\n content = {\n contentType: NavigationContentType.CHART_VIEW,\n viewRef,\n contextResourceIdentifiers: chartRouteContextResourceIdentifiers,\n urlParamValues: chartRouteUrlParamValues,\n };\n break;\n case NavigationContentType.FULL_CUSTOM_VIEW:\n if (!fullCustomView) {\n return;\n }\n content = {\n contentType: NavigationContentType.FULL_CUSTOM_VIEW,\n viewRef,\n fullCustomComponentRef: fullCustomView.componentRef,\n };\n break;\n case NavigationContentType.FLOWS_ACTORS_VIEW:\n if (!flowsActorsView) {\n return;\n }\n content = {\n contentType: NavigationContentType.FLOWS_ACTORS_VIEW,\n viewRef,\n flowsActorsSystemRef: flowsActorsView.systemRef,\n };\n break;\n case NavigationContentType.EXECUTION_VIEW:\n if (\n !executionView\n || executionView.isAddressable !== true\n ) {\n return;\n }\n\n content = {\n contentType: NavigationContentType.EXECUTION_VIEW,\n viewRef,\n contextResourceIdentifiers: executionRouteContextResourceIdentifiers,\n };\n break;\n default:\n return;\n }\n\n const stackEntryId = NavigationUtils.generateStackEntryId();\n\n logDebug('useViewRouterSync: EMITTING NAVIGATION_REPLACE (URL_SYNC)', {\n viewRef,\n contentType,\n locationPathname: location.pathname,\n locationSearch: location.search,\n });\n\n emit(FrontendEvents.NAVIGATION_REPLACE, {\n zone: NavigationZoneName.PRIMARY,\n content,\n // The view's OWN address: under a composed URL the `pane` half belongs to the secondary\n // entry, and stamping it here would make the host look like a different destination the\n // moment the pane changed.\n urlPath: NavigationUtils.decomposeHostedPaneBrowserUrl(currentUrl).hostUrl,\n stackEntryId,\n initiator: { sourceZone: NavigationZoneName.PRIMARY },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.REPLACE,\n });\n\n lastSyncedPath.current = currentUrl;\n }, [viewRef, contentType, emit, getZoneState, fullCustomViews, flowsActorsViews, registry, currentUrl, routerLocationAhead, retryTick, scheduleTransactionRetry, clearTransactionRetry]);\n}\n\n/**\n * Router sync for typed engine pages.\n *\n * Engine pages are app-level routes that should still populate the PRIMARY stack\n * so launcher active-state and back-navigation remain coherent after refresh or\n * direct URL entry.\n */\nexport function useEnginePageRouterSync(pageRef: EnginePageRef | undefined): void {\n const location = useLocation();\n const routerLocationAhead = useRouterLocationAheadOfCommit(location);\n const { emit } = useEventBus();\n const { getZoneState } = useNavigationState();\n\n const lastSyncedPath = useRef<string | null>(null);\n const currentUrl = NavigationUtils.buildBrowserUrl(location.pathname, location.search);\n const {\n retryTick,\n scheduleRetry: scheduleTransactionRetry,\n clearRetry: clearTransactionRetry,\n } = useTransactionAwareSyncRetry(currentUrl);\n\n useEffect(() => {\n if (!pageRef) return;\n\n if (NavigationUtils.isInTransaction()) {\n scheduleTransactionRetry();\n return;\n }\n\n clearTransactionRetry();\n\n // Guard: the router already left the URL this route committed with (a pending location transition).\n // Rebuilding from it would restore the page the browser left. See `useRouterLocationAheadOfCommit`.\n if (routerLocationAhead) return;\n\n if (lastSyncedPath.current === currentUrl) return;\n\n // Same per-zone, destination-based ownership as the view sync above.\n if (NavigationUtils.zoneOwnsBrowserUrl(NavigationZoneName.PRIMARY, currentUrl, getZoneState)) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n const stackEntryId = NavigationUtils.generateStackEntryId();\n\n emit(FrontendEvents.NAVIGATION_REPLACE, {\n zone: NavigationZoneName.PRIMARY,\n content: {\n contentType: NavigationContentType.ENGINE_PAGE,\n pageRef,\n },\n urlPath: NavigationUtils.decomposeHostedPaneBrowserUrl(currentUrl).hostUrl,\n stackEntryId,\n initiator: { sourceZone: NavigationZoneName.PRIMARY },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.REPLACE,\n });\n\n lastSyncedPath.current = currentUrl;\n }, [pageRef, emit, getZoneState, currentUrl, routerLocationAhead, retryTick, scheduleTransactionRetry, clearTransactionRetry]);\n}\n\n/**\n * Persistent, always-mounted reconciler that maps browser **back/forward**\n * (history popstate) onto the STRUCTURAL zone stacks (PRIMARY / SECONDARY /\n * COMPANION).\n *\n * ── Why this exists (the gap it closes) ────────────────────────────────────\n * Structural-zone content is rendered from the navigation **stack state**, not\n * from the router `<Outlet/>`: `ZoneContentRenderer` renders `routerChildren`\n * (the Outlet, which hosts `useRouterSync` / `useViewRouterSync` /\n * `useEnginePageRouterSync`) ONLY when a zone's stack is empty. In-session the\n * PRIMARY stack is never empty, so the Outlet — and with it the per-route\n * URL→state sync hooks — is unmounted. Controller-driven navigation (sidebar,\n * links, Home) mutates the stack directly via events, so it is unaffected. But\n * a browser back/forward only changes `location`; with no mounted sync hook\n * observing it, the stack was never reconciled — the URL (and the\n * `useLocation`-derived sidebar highlight) moved while the rendered content\n * stayed on the previous entry. This is the structural-zone analogue of what\n * {@link useSettingsHubOverlaySync} already does for the overlay, and it is\n * mounted the same way: exactly once, at the navigation-runtime level.\n *\n * ── Contract ───────────────────────────────────────────────────────────────\n * On every `location` change — read from the data router synchronously, so a URL the\n * transition-committed location context coalesced away is still observed — (deferred while\n * a navigation transaction is mid-flight, so controller-driven URL updates are not double-handled):\n * 1. Settings-hub URLs (`/settings*`) are owned by {@link useSettingsHubOverlaySync}\n * (overlay layer) — skip them entirely so we never clobber the structural\n * content sitting beneath the hub.\n * 2. If the URL addresses the DESTINATION already at the visible top of a\n * structural zone → no rebuild. When it differs only in VIEW STATE\n * (`?section=`), the entry's `urlPath` is refreshed in place through\n * `NAVIGATION_URL_PATH_UPDATED` — same id, same content. Under a composed\n * URL (`?pane=`, see `useHostedPaneRouteSync`) the host's stamp on PRIMARY\n * and the pane's on SECONDARY are both refreshed.\n * 3. If the URL matches an entry still sitting LOWER in a zone's backstack →\n * restore it with a pure `NAVIGATION_POP` to that entry. This is the common\n * back-button case; popping preserves the revealed entry's live state\n * (scroll, expanded rows) instead of rebuilding it. A composed URL is\n * matched against the SECONDARY backstack while PRIMARY addresses the host.\n * 4. Otherwise the URL is not in any structural stack (forward to a\n * previously-popped entry, or a manual URL edit without reload) → clear the\n * structural zones inside a transaction so the Outlet fallback remounts and\n * the existing route-mounted sync hooks reconstruct from the URL. This\n * reuses the single URL→state derivation rather than duplicating it here,\n * matching the documented URL-first reconstruction model.\n *\n * We never call `routerNavigate` here — the browser already owns the URL; this\n * hook only brings zone state up to match it, so there is no URL-write loop.\n */\nexport function useStructuralZoneBackForwardSync(): void {\n // The router's own location, not the transition-committed one: a coalesced intermediate URL is what\n // left `lastSyncedPath` behind and turned browser back into a no-op. See `useSynchronousBrowserLocation`.\n const location = useSynchronousBrowserLocation();\n const { emit } = useEventBus();\n const { getZoneState } = useNavigationState();\n\n const lastSyncedPath = useRef<string | null>(null);\n const currentUrl = NavigationUtils.buildBrowserUrl(location.pathname, location.search);\n const { retryTick, scheduleRetry, clearRetry } = useTransactionAwareSyncRetry(currentUrl);\n\n useEffect(() => {\n // Defer while a controller-driven navigation transaction is committing; the\n // retry tick re-runs this reconciler once the emitted entry owns the URL, so\n // step 2 below no-ops instead of us fighting the controller.\n if (NavigationUtils.isInTransaction()) {\n scheduleRetry();\n return;\n }\n clearRetry();\n\n if (lastSyncedPath.current === currentUrl) return;\n\n // (1) Settings-hub URLs belong to the overlay reconciler — leave the\n // structural stack beneath the hub untouched.\n if (matchSettingsHubPath(location.pathname).isSettings) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n const owner = NavigationUtils.findStructuralStackEntryOwningUrl(currentUrl, getZoneState);\n\n // (2) Already the visible top of its zone — nothing to REBUILD. When the URL moved only in\n // VIEW STATE (`?section=` on a board, `?dataMode=` on a list) the entry's stamp is refreshed in\n // place, id and content untouched, so the next comparison sees the URL it will actually get.\n // Under a composed URL both halves are refreshed: the host's stamp on PRIMARY, the pane's on\n // SECONDARY. This is the branch that used to fall through to (4) and tear every zone down for\n // a tab click.\n if (owner?.isTop) {\n if (owner.searchDiffers) {\n const { hostUrl, paneUrl } = NavigationUtils.decomposeHostedPaneBrowserUrl(currentUrl);\n const refreshes: Array<{ zone: NavigationZoneName; entry: NavigationStackEntry | undefined; urlPath: string }> =\n paneUrl !== undefined\n ? [\n { zone: NavigationZoneName.PRIMARY, entry: NavigationUtils.getTopEntry(getZoneState(NavigationZoneName.PRIMARY)), urlPath: hostUrl },\n { zone: NavigationZoneName.SECONDARY, entry: owner.entry, urlPath: paneUrl },\n ]\n : [{ zone: owner.zone, entry: owner.entry, urlPath: currentUrl }];\n for (const refresh of refreshes) {\n if (refresh.entry && refresh.entry.urlPath !== refresh.urlPath) {\n logDebug('useStructuralZoneBackForwardSync: refreshing entry urlPath for a view-state change', {\n zone: refresh.zone,\n stackEntryId: refresh.entry.id,\n from: refresh.entry.urlPath,\n to: refresh.urlPath,\n });\n emit(FrontendEvents.NAVIGATION_URL_PATH_UPDATED, {\n zone: refresh.zone,\n stackEntryId: refresh.entry.id,\n urlPath: refresh.urlPath,\n });\n }\n }\n }\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (3) Previously-visited entry still in the backstack — restore via POP.\n if (owner) {\n logDebug('useStructuralZoneBackForwardSync: POP to backstack entry', {\n zone: owner.zone,\n toStackEntryId: owner.entry.id,\n currentUrl,\n });\n emit(FrontendEvents.NAVIGATION_POP, {\n zone: owner.zone,\n toStackEntryId: owner.entry.id,\n });\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (4) URL is not anywhere in the structural stacks. If a stack is currently\n // non-empty the Outlet (and its sync hooks) is unmounted, so clear the\n // structural zones inside a transaction and let the Outlet fallback rebuild\n // from the URL. When every structural stack is already empty (cold load /\n // deep-link) the Outlet is mounted and owns reconstruction — do nothing.\n const anyStructuralContent = NAVIGATION_STRUCTURAL_ZONES.some(\n (zone) => getZoneState(zone).stack.length > 0,\n );\n if (anyStructuralContent) {\n logDebug('useStructuralZoneBackForwardSync: clearing structural zones for URL rebuild', { currentUrl });\n NavigationUtils.beginTransaction('backforward_url_rebuild');\n for (const zone of NAVIGATION_STRUCTURAL_ZONES) {\n emit(FrontendEvents.NAVIGATION_CLEAR_ZONE, { zone });\n }\n // Transaction auto-commits (setTimeout(0)); the route-mounted sync hooks skip while it is\n // active, and also while the router is ahead of their committed location\n // (`useRouterLocationAheadOfCommit`). They rebuild when both have cleared: the transaction\n // epoch or the committed location changing re-runs their effects.\n }\n lastSyncedPath.current = currentUrl;\n }, [currentUrl, location.pathname, emit, getZoneState, retryTick, scheduleRetry, clearRetry]);\n}\n\n/**\n * Persistent, always-mounted reconciler that keeps a HOSTED PANE in step with the URL.\n *\n * A hosted pane is a SECONDARY resource destination opened beside a primary whose own address no\n * resource URL implies — a composite view, a canvas, a chart, an engine page. The browser URL is\n * the host's, carrying the pane as `?pane=` (see `HOSTED_PANE_QUERY_PARAM`), so the pane is never\n * the router's route and no route element ever mounts a sync hook for it. This hook is that sync,\n * mounted once at the navigation-runtime level like the two reconcilers beside it.\n *\n * Contract, on every `location` change (deferred while a transaction is committing; settings-hub\n * URLs are left to the overlay reconciler, the structural zones beneath the hub untouched):\n * 1. No `pane` in the URL and the secondary shows a hosted pane → the pane left the URL (browser\n * back, the host's `goBack`) → clear SECONDARY.\n * 2. The pane addresses what the secondary already shows → nothing to do (a view-state change\n * was refreshed by the back/forward reconciler).\n * 3. The pane addresses an entry lower in the secondary backstack → POP to it.\n * 4. Otherwise resolve the pane's URL against the same route table `AppRouter` registers, build\n * its resource context exactly as `useRouterSync` would from the router's params, and place\n * it in SECONDARY as a SPLIT flagged `hostedPane`. Placed regardless of whether PRIMARY has\n * landed yet: the dependency cleanup keeps a hosted pane beside a non-resource primary, so\n * the two halves of a deep link may arrive in either order.\n *\n * Placed into SECONDARY even when SECONDARY is collapsed at this width. This hook read the layout\n * and the breakpoint and used them only as effect dependencies, which looked like collapse handling\n * and was none: a narrow reload put the pane where nothing draws it. Collapse is now enforced for\n * EVERY path by `useResponsiveZoneMigration` (\"a collapsed zone holds nothing\"), which moves the\n * pane into PRIMARY the same way a click at that width would be placed — so this hook no longer\n * needs to know the width, and does not pretend to. What it must know is case 2's extension: a pane\n * held in PRIMARY on the collapsed secondary's behalf is still the pane, or every later URL change\n * would place it again and the migration would stack a duplicate.\n *\n * Never writes the URL — the browser owns it; this only brings the zone up to match.\n */\nexport function useHostedPaneRouteSync(): void {\n const location = useSynchronousBrowserLocation();\n const { emit } = useEventBus();\n const { getZoneState } = useNavigationState();\n const { registry } = useResourceRegistry();\n const appScope = useAppScopeSafe();\n\n const lastSyncedPath = useRef<string | null>(null);\n const currentUrl = NavigationUtils.buildBrowserUrl(location.pathname, location.search);\n const { retryTick, scheduleRetry, clearRetry } = useTransactionAwareSyncRetry(currentUrl);\n const liveAppScopeContextIdentifiers = useMemo(\n () => appScope?.buildContextResourceIdentifiers?.() ?? {},\n [appScope],\n );\n\n useEffect(() => {\n if (NavigationUtils.isInTransaction()) {\n scheduleRetry();\n return;\n }\n clearRetry();\n\n if (lastSyncedPath.current === currentUrl) return;\n\n // Settings-hub URLs belong to the overlay reconciler; the structural zones beneath the hub —\n // a hosted pane included — are left exactly as they are, the same exemption the back/forward\n // reconciler makes. Without it, opening Settings read as \"the pane left the URL\".\n if (matchSettingsHubPath(location.pathname).isSettings) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n const { paneUrl } = NavigationUtils.decomposeHostedPaneBrowserUrl(currentUrl);\n const secondaryState = getZoneState(NavigationZoneName.SECONDARY);\n const secondaryTop = NavigationUtils.getTopEntry(secondaryState);\n\n // (1) The pane left the URL.\n if (paneUrl === undefined) {\n if (secondaryTop?.hostedPane) {\n logDebug('useHostedPaneRouteSync: pane left the URL — clearing SECONDARY', { currentUrl });\n emit(FrontendEvents.NAVIGATION_CLEAR_ZONE, { zone: NavigationZoneName.SECONDARY });\n }\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (2) Already showing it.\n if (secondaryTop?.hostedPane && NavigationUtils.urlsAddressSameDestination(secondaryTop.urlPath, paneUrl)) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n const heldForCollapsedSecondary = NavigationUtils.getTopEntry(getZoneState(NavigationZoneName.PRIMARY));\n if (\n NavigationUtils.isHeldHostedPane(heldForCollapsedSecondary)\n && NavigationUtils.urlsAddressSameDestination(heldForCollapsedSecondary?.urlPath, paneUrl)\n ) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (3) Lower in the backstack — a browser back between two panes under one host.\n const buried = [...secondaryState.stack].reverse().find(\n (entry) => entry.hostedPane && NavigationUtils.urlsAddressSameDestination(entry.urlPath, paneUrl),\n );\n if (buried) {\n logDebug('useHostedPaneRouteSync: POP to a buried pane', { toStackEntryId: buried.id, paneUrl });\n emit(FrontendEvents.NAVIGATION_POP, { zone: NavigationZoneName.SECONDARY, toStackEntryId: buried.id });\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (4) Rebuild the pane from its own address.\n const route = NavigationUtils.resolveResourceRouteForUrl(paneUrl, registry);\n if (!route) {\n logDebug('useHostedPaneRouteSync: pane URL matches no addressable resource route — ignored', { paneUrl });\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n const parentResourcesRequirements = frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(\n route.routePathParameters,\n route.resourceType,\n registry,\n );\n const urlContextIdentifiers = frontendResourceUtils.extractResourceIdentifiersFromUrlParams(\n route.urlParameters,\n registry,\n route.routePathParameters,\n );\n const targetPrimaryScope = registry.resourceConfigurations?.[route.resourceType]?.resourcePrimaryScope;\n const contextResourceIdentifiers = ScopeUtilsService.buildResourceOperationContextIdentifiers({\n currentUserId: appScope?.currentUserId,\n currentOrganizationId: appScope?.currentOrganizationId,\n currentApplicationId: appScope?.currentApplicationId,\n currentAnonymousUserId: appScope?.currentAnonymousUserId,\n primaryScope: targetPrimaryScope,\n liveAppScopeContextResourceIdentifiers: liveAppScopeContextIdentifiers,\n explicitContextResourceIdentifiers: urlContextIdentifiers,\n });\n const resourceContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType: route.resourceType,\n operation: route.operation,\n contextResourceIdentifiers,\n parentResourcesRequirements,\n });\n\n logDebug('useHostedPaneRouteSync: EMITTING NAVIGATION_REPLACE (URL_SYNC) for the hosted pane', {\n paneUrl,\n resourceType: route.resourceType,\n operationId: route.operation.operationIdentifier,\n });\n emit(FrontendEvents.NAVIGATION_REPLACE, {\n zone: NavigationZoneName.SECONDARY,\n content: { contentType: NavigationContentType.RESOURCE_OPERATION, resourceContext },\n urlPath: paneUrl,\n stackEntryId: NavigationUtils.generateStackEntryId(),\n initiator: { sourceZone: NavigationZoneName.PRIMARY },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.SPLIT,\n hostedPane: true,\n });\n lastSyncedPath.current = currentUrl;\n }, [\n currentUrl,\n location.pathname,\n emit,\n getZoneState,\n registry,\n appScope?.currentUserId,\n appScope?.currentOrganizationId,\n appScope?.currentApplicationId,\n appScope?.currentAnonymousUserId,\n liveAppScopeContextIdentifiers,\n retryTick,\n scheduleRetry,\n clearRetry,\n ]);\n}\n\n/**\n * Matches the unified Settings Hub URL family.\n * `/settings` → `{ isSettings: true }`; `/settings/:sectionRef` →\n * `{ isSettings: true, sectionRef }`; `/settings/:sectionRef/:subTabRef` →\n * `{ isSettings: true, sectionRef, subTabRef }`.\n *\n * The remainder is SPLIT rather than taken whole, which it was until 2026-09-17. That mattered\n * before sub-tabs were addressable: `/settings/a/b` produced the section ref `\"a/b\"`, which\n * matches no destination, so the hub silently fell back to its default section — a deep link with\n * one segment too many opened Profile and said nothing. Splitting makes the second segment mean\n * what it looks like it means, and anything beyond the second is still ignored.\n */\nfunction matchSettingsHubPath(pathname: string): { isSettings: boolean; sectionRef?: string; subTabRef?: string } {\n if (pathname === CommonRoutePaths.settings) return { isSettings: true };\n const prefix = `${CommonRoutePaths.settings}/`;\n if (pathname.startsWith(prefix)) {\n const [sectionRef, subTabRef] = pathname.slice(prefix.length).split('/');\n return {\n isSettings: true,\n sectionRef: sectionRef && sectionRef.length > 0 ? sectionRef : undefined,\n subTabRef: subTabRef && subTabRef.length > 0 ? subTabRef : undefined,\n };\n }\n return { isSettings: false };\n}\n\n/**\n * Persistent, idempotent reconciler that keeps the Settings Hub overlay in sync\n * with the URL. The hub is overlay-rendered but URL-addressable, and the URL is\n * its single source of truth.\n *\n * Mounted ONCE at the navigation-runtime level (NOT per-route, NOT in the\n * `/settings` route element). This is deliberate: a route-mounted sync that\n * pushed on mount and tore down on unmount would, under React StrictMode, have\n * its unmount-teardown double-invoked and close the just-pushed overlay during\n * in-session navigation — the exact \"refresh works, in-session click does not\"\n * failure mode. A persistent reconciler reads the current URL + overlay state\n * and converges to the correct state on every run, so StrictMode double-invokes\n * and the `state.overlay` dependency re-running are both harmless no-ops.\n *\n * Contract:\n * - On `/settings` / `/settings/:sectionRef`: ensure the overlay top is a\n * `SETTINGS_HUB` at that section (push when absent, replace on section change,\n * no-op when already correct).\n * - Off the settings URL: close the hub if it is the top overlay — covers\n * dismiss-driven navigation, browser back/forward, and app-level navigation\n * away from settings, all through one URL-driven path.\n *\n * The PRIMARY surface beneath the hub is the route element's render (home as the\n * `routerChildren` fallback on a cold deep-link) or the persisted PRIMARY stack\n * (in-session) — see `NavigationContentAreas`'\n * `ZoneContentRenderer fallback={routerChildren}`.\n */\nexport function useSettingsHubOverlaySync(): void {\n const location = useSynchronousBrowserLocation();\n const { emit } = useEventBus();\n const { state } = useNavigationState();\n const { retryTick, scheduleRetry, clearRetry } = useTransactionAwareSyncRetry(location.pathname);\n\n // Dedupes the asynchronous overlay reconciliation emit. The reconciler reacts\n // to `state.overlay`, but PUSH/REPLACE/CLOSE land asynchronously (event →\n // setState), so the effect can re-run — including React StrictMode's\n // intentional setup/cleanup/setup double-invoke — and observe the SAME\n // pre-emit overlay before the previous emit has applied, stacking a duplicate\n // hub. Keying the emit on (action, path, section, observed stack length) makes\n // a repeat emit against an unchanged observation a no-op; it is cleared the\n // instant the overlay reaches the desired (converged / closed) state, so a\n // genuinely new transition still emits.\n const lastEmitRef = useRef<string | null>(null);\n\n useEffect(() => {\n // Defer while a navigation transaction is mid-flight; the retry tick re-runs\n // this reconciler once it commits.\n if (NavigationUtils.isInTransaction()) {\n scheduleRetry();\n return;\n }\n clearRetry();\n\n const { isSettings, sectionRef, subTabRef } = matchSettingsHubPath(location.pathname);\n\n const overlayStack = state.overlay;\n const topEntry = overlayStack.length > 0 ? overlayStack[overlayStack.length - 1] : undefined;\n let topIsHub = false;\n let topSectionRef: string | undefined;\n let topSubTabRef: string | undefined;\n if (topEntry && topEntry.content.contentType === NavigationContentType.SETTINGS_HUB) {\n topIsHub = true;\n topSectionRef = topEntry.content.sectionRef;\n topSubTabRef = topEntry.content.subTabRef;\n }\n\n if (isSettings) {\n // Already showing the hub at the requested section AND sub-tab → converged, nothing to do.\n // The sub-tab participates in convergence as well as the section: without it, moving between\n // two tabs of the same section leaves the reconciler believing it is already correct, so the\n // URL changes and the panel does not — which is the same class of inertness the section-level\n // `config`-in-deps bug produced in the hub itself.\n if (topIsHub && topSectionRef === sectionRef && topSubTabRef === subTabRef) {\n lastEmitRef.current = null;\n return;\n }\n const action = topIsHub ? FrontendEvents.NAVIGATION_REPLACE : FrontendEvents.NAVIGATION_PUSH;\n const emitKey = `${action}|${location.pathname}|${sectionRef ?? ''}|${subTabRef ?? ''}|${overlayStack.length}`;\n if (lastEmitRef.current === emitKey) return;\n lastEmitRef.current = emitKey;\n emit(action, {\n zone: NavigationZone.OVERLAY,\n content: { contentType: NavigationContentType.SETTINGS_HUB, sectionRef, subTabRef },\n urlPath: NavigationUtils.buildBrowserUrl(location.pathname, location.search),\n stackEntryId: NavigationUtils.generateStackEntryId(),\n initiator: { sourceZone: NavigationZone.OVERLAY },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.OVERLAY,\n appearance: OverlayAppearance.DIALOG,\n ephemeral: false,\n });\n return;\n }\n\n // Off the settings URL: if the hub is still the top overlay, the URL departed\n // (dismiss, browser back, app-level nav) → close it.\n if (topIsHub) {\n const emitKey = `${FrontendEvents.NAVIGATION_CLOSE}|${overlayStack.length}`;\n if (lastEmitRef.current === emitKey) return;\n lastEmitRef.current = emitKey;\n emit(FrontendEvents.NAVIGATION_CLOSE, { zone: NavigationZone.OVERLAY });\n return;\n }\n lastEmitRef.current = null;\n }, [location.pathname, location.search, emit, state.overlay, retryTick, scheduleRetry, clearRetry]);\n}\n"]}
1
+ {"version":3,"file":"useNavigationRouterSync.js","sourceRoot":"","sources":["../../../../src/core/navigation/useNavigationRouterSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACX,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAEhG,OAAO,EACL,2CAA2C,EAC3C,+BAA+B,GAChC,MAAM,6DAA6D,CAAC;AACrE,OAAO,EACL,+CAA+C,GAChD,MAAM,wDAAwD,CAAC;AAChE,OAAO,EACL,+CAA+C,EAC/C,8BAA8B,GAC/B,MAAM,wDAAwD,CAAC;AAChE,OAAO,EACL,cAAc,GACf,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,cAAc,EAEd,qBAAqB,EACrB,2BAA2B,GAE5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EAEjB,yCAAyC,GAC1C,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAI7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,iC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,OAAO,EAAE,EAAE,WAAW,EAAE,qBAAqB,CAAC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE;gBACnF,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAC5E,YAAY,EAAE,eAAe,CAAC,oBAAoB,EAAE;gBACpD,SAAS,EAAE,EAAE,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE;gBACjD,gBAAgB,EAAE,gBAAgB,CAAC,QAAQ;gBAC3C,UAAU,EAAE,oBAAoB,CAAC,OAAO;gBACxC,UAAU,EAAE,iBAAiB,CAAC,MAAM;gBACpC,SAAS,EAAE,KAAK;aACjB,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,8EAA8E;QAC9E,qDAAqD;QACrD,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,cAAc,CAAC,gBAAgB,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;YAC5E,IAAI,WAAW,CAAC,OAAO,KAAK,OAAO;gBAAE,OAAO;YAC5C,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;YAC9B,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC;YACxE,OAAO;QACT,CAAC;QACD,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;AACtG,CAAC","sourcesContent":["/**\n * URL RECONCILIATION: what a browser URL means for the zone state.\n *\n * Six hooks, one invariant — **the URL names exactly one zone's content, and the zones around it are\n * reconstructed from that**. They cover the deep link and refresh (`useRouterSync`,\n * `useViewRouterSync`, `useEnginePageRouterSync`), the browser's own back and forward across\n * structural zones (`useStructuralZoneBackForwardSync`), the `?pane=` hosted pane\n * (`useHostedPaneRouteSync`) and the settings-hub overlay (`useSettingsHubOverlaySync`).\n *\n * Split out of `useNavigationController.ts` on 2026-09-25. That module held the click path and this\n * one in 2,322 lines, and reasoning about either in isolation meant holding both; the seam was\n * measured rather than guessed — this half used exactly THREE symbols from the other (`logDebug` and\n * the two cascade functions), which is what made the split worth doing.\n *\n * Nothing here decides a PLACEMENT POLICY. Where content goes is `navigationPolicyResolver`'s\n * answer, read through `NavigationUtils.resolveResourceTargetZone`; these hooks decide only which\n * content the URL is currently naming and what has to be rebuilt around it.\n */\n\nimport {\n useMemo,\n useEffect,\n useRef,\n} from 'react';\nimport {\n useLocation,\n useParams,\n} from 'react-router';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { useNavigationState } from './useNavigationState';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\nimport type { EnginePageRef } from '~wildo-frontend-lib/core/config/launcher-items.frontend.schemas';\nimport {\n extractChartRouteContextResourceIdentifiers,\n extractChartRouteUrlParamValues,\n} from '~wildo-frontend-lib/core/config/chart-view.frontend.schemas';\nimport {\n extractCompositeRouteContextResourceIdentifiers,\n} from '~wildo-frontend-lib/core/config/composite-view.schemas';\nimport {\n extractExecutionRouteContextResourceIdentifiers,\n resolveExecutionViewDefinition,\n} from '~wildo-frontend-lib/core/config/execution-view.schemas';\nimport {\n FrontendEvents,\n} from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport {\n NavigationZone,\n NavigationContent,\n NavigationContentType,\n NAVIGATION_STRUCTURAL_ZONES,\n type NavigationStackEntry,\n} from './navigation.schemas';\nimport {\n NavigationTransition,\n NavigationZoneName,\n OverlayAppearance,\n ResourceConfiguration_Operation_UrlParameterInfo,\n ResourcesConfigOperationsUrlsBuilderUtils,\n} from '@wildo-ai/saas-models';\nimport type {\n FrontendResourceConfiguration_Operation,\n} from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport {\n resolveViewportDiscriminated,\n} from './navigation-policy-resolver.service';\nimport { NavigationSource } from './navigation.schemas';\nimport { NavigationUtils } from './navigation.utils';\nimport { useTransactionAwareSyncRetry } from './useTransactionAwareSyncRetry';\nimport { useRouterLocationAheadOfCommit, useSynchronousBrowserLocation } from './useSynchronousBrowserLocation';\nimport { CommonRoutePaths } from '~wildo-frontend-lib/core/runtime/routes.frontend.definitions';\nimport { FrontendResourceUtils, frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { normalizeContextResourceIdentifiersForTransport } from '~wildo-frontend-lib/core/resources/context-resource-identifiers.frontend.utils';\n\nimport { adjacentZoneUsableAtViewport } from './zone-collapse';\nimport { clickKeepsRestoredContentInPrimary, logDebug, restoredEntryIsPersistent } from './navigation-controller-internals';\nimport { useViewerMayPerformAncestor } from './launcher-runtime-availability';\nimport { cascadeAncestorZones, cascadeSiblingListIntoPrimary } from './navigation-cascade';\n\n// ================================\n// Router Sync Hook (merged from RouterNavigationSync)\n// ================================\n\n\n/**\n * Hook to sync React Router URL changes with navigation state.\n *\n * When a user navigates via URL (bookmark, direct link, refresh),\n * this hook ensures the navigation state is updated accordingly.\n *\n * Uses NavigationSource to detect controller-initiated navigation:\n * - If top entry has source=CONTROLLER and matches current URL, skip sync\n * - Otherwise, this is an external URL change, sync it with source=URL_SYNC\n *\n * @param resourceType - The resource type for the current route\n * @param operation - The operation configuration\n * @param routePathParameters - Route path parameters with relationship info for deterministic URL selection\n */\nexport function useRouterSync(\n resourceType: string | undefined,\n operation: FrontendResourceConfiguration_Operation | undefined,\n routePathParameters?: ResourceConfiguration_Operation_UrlParameterInfo[]\n): void {\n const location = useLocation();\n const routerLocationAhead = useRouterLocationAheadOfCommit(location);\n const urlParameters = useParams<Record<string, string>>() as Record<string, string>;\n const { registry } = useResourceRegistry();\n const { emit } = useEventBus();\n const { getZoneState, contentAreaWidth } = useNavigationState();\n const appScope = useAppScopeSafe();\n const viewerMayPerformAncestor = useViewerMayPerformAncestor();\n const { navigationLayout: resolvedNavigationLayout, currentBreakpoint } = useUI();\n const currentBrowserUrl = useMemo(\n () => NavigationUtils.buildBrowserUrl(location.pathname, location.search),\n [location.pathname, location.search],\n );\n const liveAppScopeContextIdentifiers = useMemo(\n () => appScope?.buildContextResourceIdentifiers?.() ?? {},\n [appScope],\n );\n const liveAppScopeContextIdentifiersKey = useMemo(\n () => FrontendResourceUtils.buildContextResourceIdentifiersKey(liveAppScopeContextIdentifiers),\n [liveAppScopeContextIdentifiers],\n );\n\n // Track the last synced path to avoid duplicate updates\n const lastSyncedPath = useRef<string | null>(null);\n const {\n retryTick,\n scheduleRetry: scheduleTransactionRetry,\n clearRetry: clearTransactionRetry,\n } = useTransactionAwareSyncRetry(currentBrowserUrl);\n\n // Pre-compute this resource's route patterns (memoized) so the effect can\n // cheaply verify that the current URL actually belongs to this resource.\n // This prevents re-populating the navigation stack when the Outlet briefly\n // mounts this ResourcePageWrapper during a route transition (e.g., Home '/').\n const resourceRoutePatterns = useMemo(() => {\n if (!resourceType || !operation) return [];\n const resourceConfig = registry.resourceConfigurations?.[resourceType];\n if (!resourceConfig) return [];\n return ResourcesConfigOperationsUrlsBuilderUtils.buildOperationFrontendRoutePaths(\n resourceConfig as any, operation, registry.allResourceFieldIdentifiers\n ).map(rp => rp.url);\n }, [resourceType, operation, registry]);\n\n useEffect(() => {\n\n if (!resourceType || !operation) return;\n\n logDebug('useRouterSync: effect fired', {\n resourceType,\n operationId: operation.operationIdentifier,\n locationPathname: location.pathname,\n lastSyncedPath: lastSyncedPath.current,\n routePatternsCount: resourceRoutePatterns.length,\n });\n\n // Guard: A NavigationTransaction is active (e.g., home click, org switch, cascading).\n // The Outlet briefly mounts this ResourcePageWrapper before React Router commits\n // the route change (startTransition = low-priority). Skip sync to prevent\n // re-populating the stack with stale content.\n if (NavigationUtils.isInTransaction()) {\n logDebug('useRouterSync: SKIP — navigation transaction active', { source: NavigationUtils.getTransactionSource() });\n scheduleTransactionRetry();\n return;\n }\n\n clearTransactionRetry();\n\n // Guard: the router already left the URL this route committed with. The transaction above ends on\n // `setTimeout(0)`, but a location transition can still be pending after it — so the committed URL here\n // names the page the browser LEFT. Rebuilding from it re-pushes that page, and the always-mounted\n // reconciler (reading the router) clears it again: the ping-pong measured on an organization switch.\n // The effect re-runs when the committed location catches up. See `useRouterLocationAheadOfCommit`.\n if (routerLocationAhead) {\n logDebug('useRouterSync: SKIP — the router is ahead of the committed location', { committedUrl: currentBrowserUrl });\n return;\n }\n\n // Skip if we've already synced this path\n if (lastSyncedPath.current === currentBrowserUrl) {\n logDebug('useRouterSync: SKIP — already synced this path', { currentBrowserUrl });\n return;\n }\n\n // Guard: verify the current URL actually matches one of this resource's route patterns.\n // When navigating to a non-resource route (e.g., Home '/'), the Outlet may briefly\n // mount this ResourcePageWrapper before React Router unmounts it. Without this guard,\n // useRouterSync would re-populate the PRIMARY stack with stale content, preventing\n // the target route (Home) from ever rendering.\n if (resourceRoutePatterns.length > 0) {\n const isUrlRelevant = resourceRoutePatterns.some(pattern =>\n NavigationUtils.matchUrlPattern(pattern, location.pathname)\n );\n if (!isUrlRelevant) {\n logDebug('useRouterSync: SKIP — URL does not match any resource route pattern', {\n pathname: location.pathname,\n patterns: resourceRoutePatterns,\n });\n lastSyncedPath.current = currentBrowserUrl;\n return;\n }\n }\n\n // Get the target resource's primaryScope to filter global identifiers\n // This prevents border effects from URL sync\n const targetPrimaryScope = registry.resourceConfigurations?.[resourceType]?.resourcePrimaryScope;\n\n // Build parentResourcesRequirements from route path parameters if available\n const parentResourcesRequirements = routePathParameters\n ? frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(\n routePathParameters,\n resourceType,\n registry\n )\n : [];\n\n // Reverse reconstruction must only trust the current top owner of the URL.\n // A stale match buried elsewhere in a stack should not suppress rebuild.\n const zones = resolvedNavigationLayout?.zones;\n const hasSecondary = !!zones?.secondary;\n const hasCompanion = !!zones?.companion;\n const depth = NavigationUtils.calculateResourceRelationshipDepth(parentResourcesRequirements);\n const prefersAdjacentZoneForDetail = depth === 0\n && hasSecondary\n && operation !== undefined\n // The viewport goes in so a VIEWPORT-scoped override is reconstructed the way the click\n // resolved it. `undefined` until the first measurement, which matches only the unconditional\n // overrides — an unknown viewport is not a particular one.\n && NavigationUtils.layoutSplitsOperationFromPrimary(resolvedNavigationLayout, operation, currentBreakpoint);\n /*\n * ─── The viewport decides here too, and until 2026-09-25 it did not ─────────────────────────\n *\n * `resolveResourceTargetZone` took no viewport, so a depth ≥ 1 resource went to SECONDARY at any\n * width — and the content areas render PRIMARY and nothing else on a phone. A bookmarked or\n * refreshed nested record therefore showed its PARENT (the ancestor the cascade puts in primary)\n * with no error. The CLICK path was correct throughout, because the resolver applies collapse,\n * which is exactly what made it invisible: the same content reached the right place when clicked\n * and the wrong place when linked to.\n *\n * `adjacentZoneUsableAtViewport` is the resolver's own predicate, so the two paths cannot\n * disagree. Note the viewport was ALREADY threaded into `prefersAdjacentZoneForDetail` just\n * above — one invariant, two sites, one of them done.\n */\n const depthPreferredZone = NavigationUtils.resolveResourceTargetZone(depth, {\n hasSecondary,\n hasCompanion,\n prefersAdjacentZoneForDetail,\n });\n /*\n * ─── Depth says where a nested record COULD sit; only the policy says whether it is opened there (#3764) ───\n *\n * A click from the parent's zone keeps in PRIMARY every nested destination nothing declares a SPLIT for, so a\n * reload that put it in the pane by depth alone rebuilt a different page from the one the same address showed a\n * moment earlier. `clickKeepsRestoredContentInPrimary` asks the resolver the click's question; the context it reads\n * is the operation and its parent chain, which is all the resolver decides on.\n */\n const preferredZone = depth >= 1\n && depthPreferredZone !== NavigationZoneName.PRIMARY\n && clickKeepsRestoredContentInPrimary({\n content: {\n contentType: NavigationContentType.RESOURCE_OPERATION,\n resourceContext: frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation,\n contextResourceIdentifiers: {},\n parentResourcesRequirements,\n }),\n },\n paneZone: depthPreferredZone,\n layout: resolvedNavigationLayout,\n registry,\n viewport: currentBreakpoint,\n contentAreaWidth,\n })\n ? NavigationZoneName.PRIMARY\n : depthPreferredZone;\n const targetZone = adjacentZoneUsableAtViewport({\n zone: preferredZone,\n layout: resolvedNavigationLayout,\n viewport: currentBreakpoint,\n contentAreaWidth,\n })\n ? preferredZone\n : NavigationZoneName.PRIMARY;\n if (targetZone !== preferredZone) {\n logDebug('useRouterSync: adjacent zone is collapsed at this viewport — restoring into PRIMARY', {\n preferredZone, viewport: currentBreakpoint, contentAreaWidth,\n });\n }\n /*\n * Ownership is asked per ZONE and by DESTINATION: the entry the target zone shows must address\n * this URL, and a view-state query difference (`?dataMode=`) is not a different destination.\n * The always-mounted reconciler refreshes the entry's `urlPath` for such a change; this hook's\n * only job is to not rebuild what is already there.\n */\n const targetZoneOwnsUrl = NavigationUtils.zoneOwnsBrowserUrl(targetZone, currentBrowserUrl, getZoneState);\n\n logDebug('useRouterSync: checking guards', {\n currentBrowserUrl,\n targetZone,\n targetZoneOwnsUrl,\n targetZoneTopUrlPath: NavigationUtils.getTopEntry(getZoneState(targetZone))?.urlPath,\n });\n\n if (targetZoneOwnsUrl) {\n logDebug('useRouterSync: SKIP — target zone already owns current URL', { targetZone });\n lastSyncedPath.current = currentBrowserUrl;\n return;\n }\n\n /*\n * ─── ANOTHER structural zone may already be showing this destination ────────────────────────\n *\n * The ownership question above is asked of the zone THIS HOOK computed, and that zone is\n * derived from the URL alone — depth, plus whether the layout splits this operation out of\n * primary. It cannot see where the content actually IS, so a record placed in a pane BY A CLICK\n * and addressed by a bare URL is invisible to it: the hook computes PRIMARY, asks PRIMARY, is\n * told no, and rebuilds the record there. Primary's top entry then changes, which makes the\n * zone-dependency cleanup clear SECONDARY — so the pane the reader was using disappears and the\n * record they opened in it is on the left instead.\n *\n * Measured on Wonder CRM (2026-09-24), and it is the defect reported as \"click a linked\n * resource inside the pane and it goes on the left, not on the right\": a `contact` opened from\n * inside a deal's pane lands in SECONDARY correctly (the pane's own `transitions.read` is\n * `PUSH`, so `getStructuralSourceZone` keeps it there) and writes `/contact/:id` as the browser\n * URL, because primary holds a deals LIST and is therefore URL-derivable — no hosted pane, no\n * `?pane=`. That bare URL is what this hook then reconstructs from.\n *\n * `findStructuralRouteOwner` is the question worth asking instead — \"which structural zone's\n * VISIBLE entry does this URL address?\" — and it already exists, scanning COMPANION → SECONDARY\n * → PRIMARY by destination. If any zone owns the URL, the application is already showing what\n * the URL names and there is nothing to reconstruct. A view-state-only difference\n * (`searchDiffers`) is likewise not a rebuild: the always-mounted reconciler refreshes the\n * entry's `urlPath` in place.\n *\n * This does NOT subsume the check above — that one is what lets the target zone REBUILD when it\n * holds a different destination — it is the missing half: the other zones get a veto they never\n * had.\n */\n const structuralOwner = NavigationUtils.findStructuralRouteOwner(currentBrowserUrl, getZoneState);\n if (structuralOwner && structuralOwner.zone !== targetZone) {\n logDebug('useRouterSync: SKIP — another structural zone already shows this destination', {\n owningZone: structuralOwner.zone,\n targetZone,\n currentBrowserUrl,\n });\n lastSyncedPath.current = currentBrowserUrl;\n return;\n }\n\n // Build resource context from URL params\n // Pass routePathParameters for accurate FK field mapping (e.g., assignedToUserId → USERS)\n const urlContextIdentifiers = frontendResourceUtils.extractResourceIdentifiersFromUrlParams(\n urlParameters,\n registry,\n routePathParameters\n );\n\n const mergedContextIdentifiers = ScopeUtilsService.buildResourceOperationContextIdentifiers({\n currentUserId: appScope?.currentUserId,\n currentOrganizationId: appScope?.currentOrganizationId,\n currentApplicationId: appScope?.currentApplicationId,\n currentAnonymousUserId: appScope?.currentAnonymousUserId,\n primaryScope: targetPrimaryScope,\n liveAppScopeContextResourceIdentifiers: liveAppScopeContextIdentifiers,\n explicitContextResourceIdentifiers: urlContextIdentifiers,\n });\n\n const resourceContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation,\n contextResourceIdentifiers: mergedContextIdentifiers,\n parentResourcesRequirements,\n });\n\n // Create navigation content\n const content: NavigationContent = {\n contentType: NavigationContentType.RESOURCE_OPERATION,\n resourceContext,\n };\n\n // Generate stack entry ID\n const stackEntryId = NavigationUtils.generateStackEntryId();\n\n // ─── Reverse Cascade: place content in the correct zone ──────────\n // On page refresh / deep link, the URL-synced resource should land in the\n // zone matching its relationship depth, not always PRIMARY.\n // depth 0 → PRIMARY, depth 1 → SECONDARY, depth 2+ → COMPANION.\n // Ancestor zones are then populated via cascadeAncestorZones.\n //\n logDebug('useRouterSync: EMITTING NAVIGATION_REPLACE (URL_SYNC)', {\n resourceType,\n operationId: operation.operationIdentifier,\n currentBrowserUrl,\n mergedContextIdentifiers,\n depth,\n targetZone,\n });\n\n // For deep resources (depth >= 1), wrap in a transaction so cascading\n // events don't cause useRouterSync to re-fire mid-reconstruction.\n if (depth >= 1) {\n NavigationUtils.beginTransaction('url_reverse_cascade');\n }\n\n /*\n * ─── Restoring a pane's record at a width where the pane is collapsed ──────────────────────\n *\n * It lands in PRIMARY — but it must land the way a CLICK at that width lands: the list beneath\n * it, and stamped with the pane it belongs to. It used to REPLACE into primary with neither, so\n * Back had nothing to return to and, with no `collapsedFromZone`, widening the window could\n * never send the record to its pane: it stayed full-width beside an empty one. The stamp is what\n * `zone-collapse-migration.ts` reads to take it home; the cascade runs FIRST so the record is\n * pushed on top of the list rather than replacing it.\n */\n const collapsedIntoPrimary = targetZone !== preferredZone;\n /*\n * A pane a PERSISTENT split opened survives the page beneath it changing, and must still do so after a reload\n * (#2130). The click stamped it from the resolver; this asks the resolver the same question for the restored\n * content, opened through the relationship the ancestor cascade rebuilds the chain by — see\n * `restoredEntryIsPersistent`.\n */\n const restoredPersistent = restoredEntryIsPersistent({\n content,\n paneZone: preferredZone,\n placedZone: targetZone,\n layout: resolvedNavigationLayout,\n registry,\n viewport: currentBreakpoint,\n contentAreaWidth,\n });\n if (collapsedIntoPrimary && prefersAdjacentZoneForDetail && preferredZone === NavigationZoneName.SECONDARY) {\n cascadeSiblingListIntoPrimary({\n resourceType: resourceType as string,\n contextResourceIdentifiers: mergedContextIdentifiers as Record<string, string>,\n parentResourcesRequirements, registry, emit, getZoneState,\n });\n }\n\n emit(collapsedIntoPrimary ? FrontendEvents.NAVIGATION_PUSH : FrontendEvents.NAVIGATION_REPLACE, {\n zone: targetZone,\n content,\n urlPath: currentBrowserUrl,\n stackEntryId,\n initiator: { sourceZone: targetZone },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.REPLACE,\n ...(collapsedIntoPrimary ? { collapsedFromZone: preferredZone } : {}),\n ...(restoredPersistent ? { persistent: true } : {}),\n });\n\n if (prefersAdjacentZoneForDetail && targetZone === NavigationZoneName.SECONDARY) {\n cascadeSiblingListIntoPrimary({\n resourceType: resourceType as string,\n contextResourceIdentifiers: mergedContextIdentifiers as Record<string, string>,\n parentResourcesRequirements, registry, emit, getZoneState,\n });\n }\n\n // Populate ancestor panes for depth 1+ resources\n if (depth >= 1) {\n // Normalize context identifiers to plain strings for cascading\n const normalizedForCascade = normalizeContextResourceIdentifiersForTransport(mergedContextIdentifiers as any);\n cascadeAncestorZones(\n content as NavigationContent & { contentType: NavigationContentType.RESOURCE_OPERATION },\n targetZone,\n registry,\n normalizedForCascade,\n emit,\n null, // No URL update needed — browser already has the correct URL\n getZoneState,\n { overwriteExisting: true, viewerMayPerform: viewerMayPerformAncestor },\n );\n // Transaction auto-commits via setTimeout(0)\n }\n\n lastSyncedPath.current = currentBrowserUrl;\n\n }, [\n location.pathname,\n location.search,\n routerLocationAhead,\n urlParameters,\n resourceType,\n operation,\n registry,\n emit,\n getZoneState,\n appScope?.currentUserId,\n appScope?.currentOrganizationId,\n appScope?.currentApplicationId,\n appScope?.currentAnonymousUserId,\n liveAppScopeContextIdentifiersKey,\n routePathParameters,\n resourceRoutePatterns,\n resolvedNavigationLayout,\n currentBreakpoint,\n currentBrowserUrl,\n retryTick,\n scheduleTransactionRetry,\n clearTransactionRetry,\n ]);\n}\n\n\n// ================================\n// View Router Sync Hook\n// ================================\n\n/**\n * Hook to sync view routes (composite, chart, custom, flows-actors) with navigation state.\n *\n * Unlike useRouterSync (which handles resource operations), this handles non-resource\n * content types that only need a viewRef and contentType. Views are always depth 0\n * (placed in PRIMARY zone), have no parent chain, and no cascading.\n *\n * On refresh / deep link, this hook populates the PRIMARY zone's navigation stack\n * with the correct view content so that:\n * - ZoneContentRenderer renders the view\n * - Sidebar active state reflects the current view\n * - goBack() works correctly\n *\n * @param viewRef - The view reference from the URL\n * @param contentType - The navigation content type (COMPOSITE_VIEW, CHART_VIEW, etc.)\n */\nexport function useViewRouterSync(\n viewRef: string | undefined,\n contentType: NavigationContentType,\n): void {\n const location = useLocation();\n const routerLocationAhead = useRouterLocationAheadOfCommit(location);\n const { emit } = useEventBus();\n const { getZoneState } = useNavigationState();\n const { registry } = useResourceRegistry();\n const { fullCustomViews, flowsActorsViews } = useUI();\n\n const lastSyncedPath = useRef<string | null>(null);\n const currentUrl = NavigationUtils.buildBrowserUrl(location.pathname, location.search);\n const {\n retryTick,\n scheduleRetry: scheduleTransactionRetry,\n clearRetry: clearTransactionRetry,\n } = useTransactionAwareSyncRetry(currentUrl);\n\n useEffect(() => {\n if (!viewRef) return;\n\n // Guard: transaction active\n if (NavigationUtils.isInTransaction()) {\n scheduleTransactionRetry();\n return;\n }\n\n clearTransactionRetry();\n\n // Guard: the router already left the URL this route committed with (a pending location transition).\n // Rebuilding from it would restore the page the browser left. See `useRouterLocationAheadOfCommit`.\n if (routerLocationAhead) return;\n\n // Skip if already synced\n if (lastSyncedPath.current === currentUrl) return;\n\n // Asked about PRIMARY's half of the URL: under a composed URL the HOST is this view and the\n // `pane` parameter belongs to the secondary zone's own reconciler. A view-state change\n // (`?section=`) on the same view is owned too — the reconciler refreshes the stamp in place.\n if (NavigationUtils.zoneOwnsBrowserUrl(NavigationZoneName.PRIMARY, currentUrl, getZoneState)) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // Deep-link sync should rebuild the same typed view payload, but ambient\n // primary scope is derived live from AppScope by the view itself.\n let content: NavigationContent;\n const compositeRouteContextResourceIdentifiers = contentType === NavigationContentType.COMPOSITE_VIEW\n ? extractCompositeRouteContextResourceIdentifiers(new URLSearchParams(location.search))\n : undefined;\n const chartRouteContextResourceIdentifiers = contentType === NavigationContentType.CHART_VIEW\n ? extractChartRouteContextResourceIdentifiers(new URLSearchParams(location.search))\n : undefined;\n const chartRouteUrlParamValues = contentType === NavigationContentType.CHART_VIEW\n ? extractChartRouteUrlParamValues(new URLSearchParams(location.search))\n : undefined;\n const executionRouteContextResourceIdentifiers = contentType === NavigationContentType.EXECUTION_VIEW\n ? extractExecutionRouteContextResourceIdentifiers(new URLSearchParams(location.search))\n : undefined;\n const fullCustomView = contentType === NavigationContentType.FULL_CUSTOM_VIEW\n ? fullCustomViews?.find(view => view.ref === viewRef)\n : undefined;\n const flowsActorsView = contentType === NavigationContentType.FLOWS_ACTORS_VIEW\n ? flowsActorsViews?.find(view => view.ref === viewRef)\n : undefined;\n const executionView = contentType === NavigationContentType.EXECUTION_VIEW\n ? resolveExecutionViewDefinition({\n viewRef,\n registry,\n })\n : undefined;\n switch (contentType) {\n case NavigationContentType.COMPOSITE_VIEW:\n content = {\n contentType: NavigationContentType.COMPOSITE_VIEW,\n viewRef,\n contextResourceIdentifiers: compositeRouteContextResourceIdentifiers,\n };\n break;\n case NavigationContentType.CHART_VIEW:\n content = {\n contentType: NavigationContentType.CHART_VIEW,\n viewRef,\n contextResourceIdentifiers: chartRouteContextResourceIdentifiers,\n urlParamValues: chartRouteUrlParamValues,\n };\n break;\n case NavigationContentType.FULL_CUSTOM_VIEW:\n if (!fullCustomView) {\n return;\n }\n content = {\n contentType: NavigationContentType.FULL_CUSTOM_VIEW,\n viewRef,\n fullCustomComponentRef: fullCustomView.componentRef,\n };\n break;\n case NavigationContentType.FLOWS_ACTORS_VIEW:\n if (!flowsActorsView) {\n return;\n }\n content = {\n contentType: NavigationContentType.FLOWS_ACTORS_VIEW,\n viewRef,\n flowsActorsSystemRef: flowsActorsView.systemRef,\n };\n break;\n case NavigationContentType.EXECUTION_VIEW:\n if (\n !executionView\n || executionView.isAddressable !== true\n ) {\n return;\n }\n\n content = {\n contentType: NavigationContentType.EXECUTION_VIEW,\n viewRef,\n contextResourceIdentifiers: executionRouteContextResourceIdentifiers,\n };\n break;\n default:\n return;\n }\n\n const stackEntryId = NavigationUtils.generateStackEntryId();\n\n logDebug('useViewRouterSync: EMITTING NAVIGATION_REPLACE (URL_SYNC)', {\n viewRef,\n contentType,\n locationPathname: location.pathname,\n locationSearch: location.search,\n });\n\n emit(FrontendEvents.NAVIGATION_REPLACE, {\n zone: NavigationZoneName.PRIMARY,\n content,\n // The view's OWN address: under a composed URL the `pane` half belongs to the secondary\n // entry, and stamping it here would make the host look like a different destination the\n // moment the pane changed.\n urlPath: NavigationUtils.decomposeHostedPaneBrowserUrl(currentUrl).hostUrl,\n stackEntryId,\n initiator: { sourceZone: NavigationZoneName.PRIMARY },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.REPLACE,\n });\n\n lastSyncedPath.current = currentUrl;\n }, [viewRef, contentType, emit, getZoneState, fullCustomViews, flowsActorsViews, registry, currentUrl, routerLocationAhead, retryTick, scheduleTransactionRetry, clearTransactionRetry]);\n}\n\n/**\n * Router sync for typed engine pages.\n *\n * Engine pages are app-level routes that should still populate the PRIMARY stack\n * so launcher active-state and back-navigation remain coherent after refresh or\n * direct URL entry.\n */\nexport function useEnginePageRouterSync(pageRef: EnginePageRef | undefined): void {\n const location = useLocation();\n const routerLocationAhead = useRouterLocationAheadOfCommit(location);\n const { emit } = useEventBus();\n const { getZoneState } = useNavigationState();\n\n const lastSyncedPath = useRef<string | null>(null);\n const currentUrl = NavigationUtils.buildBrowserUrl(location.pathname, location.search);\n const {\n retryTick,\n scheduleRetry: scheduleTransactionRetry,\n clearRetry: clearTransactionRetry,\n } = useTransactionAwareSyncRetry(currentUrl);\n\n useEffect(() => {\n if (!pageRef) return;\n\n if (NavigationUtils.isInTransaction()) {\n scheduleTransactionRetry();\n return;\n }\n\n clearTransactionRetry();\n\n // Guard: the router already left the URL this route committed with (a pending location transition).\n // Rebuilding from it would restore the page the browser left. See `useRouterLocationAheadOfCommit`.\n if (routerLocationAhead) return;\n\n if (lastSyncedPath.current === currentUrl) return;\n\n // Same per-zone, destination-based ownership as the view sync above.\n if (NavigationUtils.zoneOwnsBrowserUrl(NavigationZoneName.PRIMARY, currentUrl, getZoneState)) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n const stackEntryId = NavigationUtils.generateStackEntryId();\n\n emit(FrontendEvents.NAVIGATION_REPLACE, {\n zone: NavigationZoneName.PRIMARY,\n content: {\n contentType: NavigationContentType.ENGINE_PAGE,\n pageRef,\n },\n urlPath: NavigationUtils.decomposeHostedPaneBrowserUrl(currentUrl).hostUrl,\n stackEntryId,\n initiator: { sourceZone: NavigationZoneName.PRIMARY },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.REPLACE,\n });\n\n lastSyncedPath.current = currentUrl;\n }, [pageRef, emit, getZoneState, currentUrl, routerLocationAhead, retryTick, scheduleTransactionRetry, clearTransactionRetry]);\n}\n\n/**\n * Persistent, always-mounted reconciler that maps browser **back/forward**\n * (history popstate) onto the STRUCTURAL zone stacks (PRIMARY / SECONDARY /\n * COMPANION).\n *\n * ── Why this exists (the gap it closes) ────────────────────────────────────\n * Structural-zone content is rendered from the navigation **stack state**, not\n * from the router `<Outlet/>`: `ZoneContentRenderer` renders `routerChildren`\n * (the Outlet, which hosts `useRouterSync` / `useViewRouterSync` /\n * `useEnginePageRouterSync`) ONLY when a zone's stack is empty. In-session the\n * PRIMARY stack is never empty, so the Outlet — and with it the per-route\n * URL→state sync hooks — is unmounted. Controller-driven navigation (sidebar,\n * links, Home) mutates the stack directly via events, so it is unaffected. But\n * a browser back/forward only changes `location`; with no mounted sync hook\n * observing it, the stack was never reconciled — the URL (and the\n * `useLocation`-derived sidebar highlight) moved while the rendered content\n * stayed on the previous entry. This is the structural-zone analogue of what\n * {@link useSettingsHubOverlaySync} already does for the overlay, and it is\n * mounted the same way: exactly once, at the navigation-runtime level.\n *\n * ── Contract ───────────────────────────────────────────────────────────────\n * On every `location` change — read from the data router synchronously, so a URL the\n * transition-committed location context coalesced away is still observed — (deferred while\n * a navigation transaction is mid-flight, so controller-driven URL updates are not double-handled):\n * 1. Settings-hub URLs (`/settings*`) are owned by {@link useSettingsHubOverlaySync}\n * (overlay layer) — skip them entirely so we never clobber the structural\n * content sitting beneath the hub.\n * 2. If the URL addresses the DESTINATION already at the visible top of a\n * structural zone → no rebuild. When it differs only in VIEW STATE\n * (`?section=`), the entry's `urlPath` is refreshed in place through\n * `NAVIGATION_URL_PATH_UPDATED` — same id, same content. Under a composed\n * URL (`?pane=`, see `useHostedPaneRouteSync`) the host's stamp on PRIMARY\n * and the pane's on SECONDARY are both refreshed.\n * 3. If the URL matches an entry still sitting LOWER in a zone's backstack →\n * restore it with a pure `NAVIGATION_POP` to that entry. This is the common\n * back-button case; popping preserves the revealed entry's live state\n * (scroll, expanded rows) instead of rebuilding it. A composed URL is\n * matched against the SECONDARY backstack while PRIMARY addresses the host.\n * 4. Otherwise the URL is not in any structural stack (forward to a\n * previously-popped entry, or a manual URL edit without reload) → clear the\n * structural zones inside a transaction so the Outlet fallback remounts and\n * the existing route-mounted sync hooks reconstruct from the URL. This\n * reuses the single URL→state derivation rather than duplicating it here,\n * matching the documented URL-first reconstruction model.\n *\n * We never call `routerNavigate` here — the browser already owns the URL; this\n * hook only brings zone state up to match it, so there is no URL-write loop.\n */\nexport function useStructuralZoneBackForwardSync(): void {\n // The router's own location, not the transition-committed one: a coalesced intermediate URL is what\n // left `lastSyncedPath` behind and turned browser back into a no-op. See `useSynchronousBrowserLocation`.\n const location = useSynchronousBrowserLocation();\n const { emit } = useEventBus();\n const { getZoneState } = useNavigationState();\n\n const lastSyncedPath = useRef<string | null>(null);\n const currentUrl = NavigationUtils.buildBrowserUrl(location.pathname, location.search);\n const { retryTick, scheduleRetry, clearRetry } = useTransactionAwareSyncRetry(currentUrl);\n\n useEffect(() => {\n // Defer while a controller-driven navigation transaction is committing; the\n // retry tick re-runs this reconciler once the emitted entry owns the URL, so\n // step 2 below no-ops instead of us fighting the controller.\n if (NavigationUtils.isInTransaction()) {\n scheduleRetry();\n return;\n }\n clearRetry();\n\n if (lastSyncedPath.current === currentUrl) return;\n\n // (1) Settings-hub URLs belong to the overlay reconciler — leave the\n // structural stack beneath the hub untouched.\n if (matchSettingsHubPath(location.pathname).isSettings) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n const owner = NavigationUtils.findStructuralStackEntryOwningUrl(currentUrl, getZoneState);\n\n // (2) Already the visible top of its zone — nothing to REBUILD. When the URL moved only in\n // VIEW STATE (`?section=` on a board, `?dataMode=` on a list) the entry's stamp is refreshed in\n // place, id and content untouched, so the next comparison sees the URL it will actually get.\n // Under a composed URL both halves are refreshed: the host's stamp on PRIMARY, the pane's on\n // SECONDARY. This is the branch that used to fall through to (4) and tear every zone down for\n // a tab click.\n if (owner?.isTop) {\n if (owner.searchDiffers) {\n const { hostUrl, paneUrl } = NavigationUtils.decomposeHostedPaneBrowserUrl(currentUrl);\n const refreshes: Array<{ zone: NavigationZoneName; entry: NavigationStackEntry | undefined; urlPath: string }> =\n paneUrl !== undefined\n ? [\n { zone: NavigationZoneName.PRIMARY, entry: NavigationUtils.getTopEntry(getZoneState(NavigationZoneName.PRIMARY)), urlPath: hostUrl },\n { zone: NavigationZoneName.SECONDARY, entry: owner.entry, urlPath: paneUrl },\n ]\n : [{ zone: owner.zone, entry: owner.entry, urlPath: currentUrl }];\n for (const refresh of refreshes) {\n if (refresh.entry && refresh.entry.urlPath !== refresh.urlPath) {\n logDebug('useStructuralZoneBackForwardSync: refreshing entry urlPath for a view-state change', {\n zone: refresh.zone,\n stackEntryId: refresh.entry.id,\n from: refresh.entry.urlPath,\n to: refresh.urlPath,\n });\n emit(FrontendEvents.NAVIGATION_URL_PATH_UPDATED, {\n zone: refresh.zone,\n stackEntryId: refresh.entry.id,\n urlPath: refresh.urlPath,\n });\n }\n }\n }\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (3) Previously-visited entry still in the backstack — restore via POP.\n if (owner) {\n logDebug('useStructuralZoneBackForwardSync: POP to backstack entry', {\n zone: owner.zone,\n toStackEntryId: owner.entry.id,\n currentUrl,\n });\n emit(FrontendEvents.NAVIGATION_POP, {\n zone: owner.zone,\n toStackEntryId: owner.entry.id,\n });\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (4) URL is not anywhere in the structural stacks. If a stack is currently\n // non-empty the Outlet (and its sync hooks) is unmounted, so clear the\n // structural zones inside a transaction and let the Outlet fallback rebuild\n // from the URL. When every structural stack is already empty (cold load /\n // deep-link) the Outlet is mounted and owns reconstruction — do nothing.\n const anyStructuralContent = NAVIGATION_STRUCTURAL_ZONES.some(\n (zone) => getZoneState(zone).stack.length > 0,\n );\n if (anyStructuralContent) {\n logDebug('useStructuralZoneBackForwardSync: clearing structural zones for URL rebuild', { currentUrl });\n NavigationUtils.beginTransaction('backforward_url_rebuild');\n for (const zone of NAVIGATION_STRUCTURAL_ZONES) {\n emit(FrontendEvents.NAVIGATION_CLEAR_ZONE, { zone });\n }\n // Transaction auto-commits (setTimeout(0)); the route-mounted sync hooks skip while it is\n // active, and also while the router is ahead of their committed location\n // (`useRouterLocationAheadOfCommit`). They rebuild when both have cleared: the transaction\n // epoch or the committed location changing re-runs their effects.\n }\n lastSyncedPath.current = currentUrl;\n }, [currentUrl, location.pathname, emit, getZoneState, retryTick, scheduleRetry, clearRetry]);\n}\n\n/**\n * Persistent, always-mounted reconciler that keeps a HOSTED PANE in step with the URL.\n *\n * A hosted pane is a SECONDARY resource destination opened beside a primary whose own address no\n * resource URL implies — a composite view, a canvas, a chart, an engine page. The browser URL is\n * the host's, carrying the pane as `?pane=` (see `HOSTED_PANE_QUERY_PARAM`), so the pane is never\n * the router's route and no route element ever mounts a sync hook for it. This hook is that sync,\n * mounted once at the navigation-runtime level like the two reconcilers beside it.\n *\n * Contract, on every `location` change (deferred while a transaction is committing; settings-hub\n * URLs are left to the overlay reconciler, the structural zones beneath the hub untouched):\n * 1. No `pane` in the URL and the secondary shows a hosted pane → the pane left the URL (browser\n * back, the host's `goBack`) → clear SECONDARY.\n * 2. The pane addresses what the secondary already shows → nothing to do (a view-state change\n * was refreshed by the back/forward reconciler).\n * 3. The pane addresses an entry lower in the secondary backstack → POP to it.\n * 4. Otherwise resolve the pane's URL against the same route table `AppRouter` registers, build\n * its resource context exactly as `useRouterSync` would from the router's params, and place\n * it in SECONDARY as a SPLIT flagged `hostedPane`. Placed regardless of whether PRIMARY has\n * landed yet: the dependency cleanup keeps a hosted pane beside a non-resource primary, so\n * the two halves of a deep link may arrive in either order.\n *\n * Placed into SECONDARY even when SECONDARY is collapsed at this width. This hook read the layout\n * and the breakpoint and used them only as effect dependencies, which looked like collapse handling\n * and was none: a narrow reload put the pane where nothing draws it. Collapse is now enforced for\n * EVERY path by `useResponsiveZoneMigration` (\"a collapsed zone holds nothing\"), which moves the\n * pane into PRIMARY the same way a click at that width would be placed — so this hook no longer\n * needs to know the width, and does not pretend to. What it must know is case 2's extension: a pane\n * held in PRIMARY on the collapsed secondary's behalf is still the pane, or every later URL change\n * would place it again and the migration would stack a duplicate.\n *\n * Never writes the URL — the browser owns it; this only brings the zone up to match.\n */\nexport function useHostedPaneRouteSync(): void {\n const location = useSynchronousBrowserLocation();\n const { emit } = useEventBus();\n const { getZoneState } = useNavigationState();\n const { registry } = useResourceRegistry();\n const appScope = useAppScopeSafe();\n\n const lastSyncedPath = useRef<string | null>(null);\n const currentUrl = NavigationUtils.buildBrowserUrl(location.pathname, location.search);\n const { retryTick, scheduleRetry, clearRetry } = useTransactionAwareSyncRetry(currentUrl);\n const liveAppScopeContextIdentifiers = useMemo(\n () => appScope?.buildContextResourceIdentifiers?.() ?? {},\n [appScope],\n );\n\n useEffect(() => {\n if (NavigationUtils.isInTransaction()) {\n scheduleRetry();\n return;\n }\n clearRetry();\n\n if (lastSyncedPath.current === currentUrl) return;\n\n // Settings-hub URLs belong to the overlay reconciler; the structural zones beneath the hub —\n // a hosted pane included — are left exactly as they are, the same exemption the back/forward\n // reconciler makes. Without it, opening Settings read as \"the pane left the URL\".\n if (matchSettingsHubPath(location.pathname).isSettings) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n const { paneUrl } = NavigationUtils.decomposeHostedPaneBrowserUrl(currentUrl);\n const secondaryState = getZoneState(NavigationZoneName.SECONDARY);\n const secondaryTop = NavigationUtils.getTopEntry(secondaryState);\n\n // (1) The pane left the URL.\n if (paneUrl === undefined) {\n if (secondaryTop?.hostedPane) {\n logDebug('useHostedPaneRouteSync: pane left the URL — clearing SECONDARY', { currentUrl });\n emit(FrontendEvents.NAVIGATION_CLEAR_ZONE, { zone: NavigationZoneName.SECONDARY });\n }\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (2) Already showing it.\n if (secondaryTop?.hostedPane && NavigationUtils.urlsAddressSameDestination(secondaryTop.urlPath, paneUrl)) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n const heldForCollapsedSecondary = NavigationUtils.getTopEntry(getZoneState(NavigationZoneName.PRIMARY));\n if (\n NavigationUtils.isHeldHostedPane(heldForCollapsedSecondary)\n && NavigationUtils.urlsAddressSameDestination(heldForCollapsedSecondary?.urlPath, paneUrl)\n ) {\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (3) Lower in the backstack — a browser back between two panes under one host.\n const buried = [...secondaryState.stack].reverse().find(\n (entry) => entry.hostedPane && NavigationUtils.urlsAddressSameDestination(entry.urlPath, paneUrl),\n );\n if (buried) {\n logDebug('useHostedPaneRouteSync: POP to a buried pane', { toStackEntryId: buried.id, paneUrl });\n emit(FrontendEvents.NAVIGATION_POP, { zone: NavigationZoneName.SECONDARY, toStackEntryId: buried.id });\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n // (4) Rebuild the pane from its own address.\n const route = NavigationUtils.resolveResourceRouteForUrl(paneUrl, registry);\n if (!route) {\n logDebug('useHostedPaneRouteSync: pane URL matches no addressable resource route — ignored', { paneUrl });\n lastSyncedPath.current = currentUrl;\n return;\n }\n\n const parentResourcesRequirements = frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(\n route.routePathParameters,\n route.resourceType,\n registry,\n );\n const urlContextIdentifiers = frontendResourceUtils.extractResourceIdentifiersFromUrlParams(\n route.urlParameters,\n registry,\n route.routePathParameters,\n );\n const targetPrimaryScope = registry.resourceConfigurations?.[route.resourceType]?.resourcePrimaryScope;\n const contextResourceIdentifiers = ScopeUtilsService.buildResourceOperationContextIdentifiers({\n currentUserId: appScope?.currentUserId,\n currentOrganizationId: appScope?.currentOrganizationId,\n currentApplicationId: appScope?.currentApplicationId,\n currentAnonymousUserId: appScope?.currentAnonymousUserId,\n primaryScope: targetPrimaryScope,\n liveAppScopeContextResourceIdentifiers: liveAppScopeContextIdentifiers,\n explicitContextResourceIdentifiers: urlContextIdentifiers,\n });\n const resourceContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType: route.resourceType,\n operation: route.operation,\n contextResourceIdentifiers,\n parentResourcesRequirements,\n });\n\n logDebug('useHostedPaneRouteSync: EMITTING NAVIGATION_REPLACE (URL_SYNC) for the hosted pane', {\n paneUrl,\n resourceType: route.resourceType,\n operationId: route.operation.operationIdentifier,\n });\n emit(FrontendEvents.NAVIGATION_REPLACE, {\n zone: NavigationZoneName.SECONDARY,\n content: { contentType: NavigationContentType.RESOURCE_OPERATION, resourceContext },\n urlPath: paneUrl,\n stackEntryId: NavigationUtils.generateStackEntryId(),\n initiator: { sourceZone: NavigationZoneName.PRIMARY },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.SPLIT,\n hostedPane: true,\n });\n lastSyncedPath.current = currentUrl;\n }, [\n currentUrl,\n location.pathname,\n emit,\n getZoneState,\n registry,\n appScope?.currentUserId,\n appScope?.currentOrganizationId,\n appScope?.currentApplicationId,\n appScope?.currentAnonymousUserId,\n liveAppScopeContextIdentifiers,\n retryTick,\n scheduleRetry,\n clearRetry,\n ]);\n}\n\n/**\n * Matches the unified Settings Hub URL family.\n * `/settings` → `{ isSettings: true }`; `/settings/:sectionRef` →\n * `{ isSettings: true, sectionRef }`; `/settings/:sectionRef/:subTabRef` →\n * `{ isSettings: true, sectionRef, subTabRef }`.\n *\n * The remainder is SPLIT rather than taken whole, which it was until 2026-09-17. That mattered\n * before sub-tabs were addressable: `/settings/a/b` produced the section ref `\"a/b\"`, which\n * matches no destination, so the hub silently fell back to its default section — a deep link with\n * one segment too many opened Profile and said nothing. Splitting makes the second segment mean\n * what it looks like it means, and anything beyond the second is still ignored.\n */\nfunction matchSettingsHubPath(pathname: string): { isSettings: boolean; sectionRef?: string; subTabRef?: string } {\n if (pathname === CommonRoutePaths.settings) return { isSettings: true };\n const prefix = `${CommonRoutePaths.settings}/`;\n if (pathname.startsWith(prefix)) {\n const [sectionRef, subTabRef] = pathname.slice(prefix.length).split('/');\n return {\n isSettings: true,\n sectionRef: sectionRef && sectionRef.length > 0 ? sectionRef : undefined,\n subTabRef: subTabRef && subTabRef.length > 0 ? subTabRef : undefined,\n };\n }\n return { isSettings: false };\n}\n\n/**\n * Persistent, idempotent reconciler that keeps the Settings Hub overlay in sync\n * with the URL. The hub is overlay-rendered but URL-addressable, and the URL is\n * its single source of truth.\n *\n * Mounted ONCE at the navigation-runtime level (NOT per-route, NOT in the\n * `/settings` route element). This is deliberate: a route-mounted sync that\n * pushed on mount and tore down on unmount would, under React StrictMode, have\n * its unmount-teardown double-invoked and close the just-pushed overlay during\n * in-session navigation — the exact \"refresh works, in-session click does not\"\n * failure mode. A persistent reconciler reads the current URL + overlay state\n * and converges to the correct state on every run, so StrictMode double-invokes\n * and the `state.overlay` dependency re-running are both harmless no-ops.\n *\n * Contract:\n * - On `/settings` / `/settings/:sectionRef`: ensure the overlay top is a\n * `SETTINGS_HUB` at that section (push when absent, replace on section change,\n * no-op when already correct).\n * - Off the settings URL: close the hub if it is the top overlay — covers\n * dismiss-driven navigation, browser back/forward, and app-level navigation\n * away from settings, all through one URL-driven path.\n *\n * The PRIMARY surface beneath the hub is the route element's render (home as the\n * `routerChildren` fallback on a cold deep-link) or the persisted PRIMARY stack\n * (in-session) — see `NavigationContentAreas`'\n * `ZoneContentRenderer fallback={routerChildren}`.\n */\nexport function useSettingsHubOverlaySync(): void {\n const location = useSynchronousBrowserLocation();\n const { emit } = useEventBus();\n const { state } = useNavigationState();\n const { retryTick, scheduleRetry, clearRetry } = useTransactionAwareSyncRetry(location.pathname);\n\n // Dedupes the asynchronous overlay reconciliation emit. The reconciler reacts\n // to `state.overlay`, but PUSH/REPLACE/CLOSE land asynchronously (event →\n // setState), so the effect can re-run — including React StrictMode's\n // intentional setup/cleanup/setup double-invoke — and observe the SAME\n // pre-emit overlay before the previous emit has applied, stacking a duplicate\n // hub. Keying the emit on (action, path, section, observed stack length) makes\n // a repeat emit against an unchanged observation a no-op; it is cleared the\n // instant the overlay reaches the desired (converged / closed) state, so a\n // genuinely new transition still emits.\n const lastEmitRef = useRef<string | null>(null);\n\n useEffect(() => {\n // Defer while a navigation transaction is mid-flight; the retry tick re-runs\n // this reconciler once it commits.\n if (NavigationUtils.isInTransaction()) {\n scheduleRetry();\n return;\n }\n clearRetry();\n\n const { isSettings, sectionRef, subTabRef } = matchSettingsHubPath(location.pathname);\n\n const overlayStack = state.overlay;\n const topEntry = overlayStack.length > 0 ? overlayStack[overlayStack.length - 1] : undefined;\n let topIsHub = false;\n let topSectionRef: string | undefined;\n let topSubTabRef: string | undefined;\n if (topEntry && topEntry.content.contentType === NavigationContentType.SETTINGS_HUB) {\n topIsHub = true;\n topSectionRef = topEntry.content.sectionRef;\n topSubTabRef = topEntry.content.subTabRef;\n }\n\n if (isSettings) {\n // Already showing the hub at the requested section AND sub-tab → converged, nothing to do.\n // The sub-tab participates in convergence as well as the section: without it, moving between\n // two tabs of the same section leaves the reconciler believing it is already correct, so the\n // URL changes and the panel does not — which is the same class of inertness the section-level\n // `config`-in-deps bug produced in the hub itself.\n if (topIsHub && topSectionRef === sectionRef && topSubTabRef === subTabRef) {\n lastEmitRef.current = null;\n return;\n }\n const action = topIsHub ? FrontendEvents.NAVIGATION_REPLACE : FrontendEvents.NAVIGATION_PUSH;\n const emitKey = `${action}|${location.pathname}|${sectionRef ?? ''}|${subTabRef ?? ''}|${overlayStack.length}`;\n if (lastEmitRef.current === emitKey) return;\n lastEmitRef.current = emitKey;\n emit(action, {\n zone: NavigationZone.OVERLAY,\n content: { contentType: NavigationContentType.SETTINGS_HUB, sectionRef, subTabRef },\n urlPath: NavigationUtils.buildBrowserUrl(location.pathname, location.search),\n stackEntryId: NavigationUtils.generateStackEntryId(),\n initiator: { sourceZone: NavigationZone.OVERLAY },\n navigationSource: NavigationSource.URL_SYNC,\n transition: NavigationTransition.OVERLAY,\n appearance: OverlayAppearance.DIALOG,\n ephemeral: false,\n });\n return;\n }\n\n // Off the settings URL: if the hub is still the top overlay, the URL departed\n // (dismiss, browser back, app-level nav) → close it.\n if (topIsHub) {\n const emitKey = `${FrontendEvents.NAVIGATION_CLOSE}|${overlayStack.length}`;\n if (lastEmitRef.current === emitKey) return;\n lastEmitRef.current = emitKey;\n emit(FrontendEvents.NAVIGATION_CLOSE, { zone: NavigationZone.OVERLAY });\n return;\n }\n lastEmitRef.current = null;\n }, [location.pathname, location.search, emit, state.overlay, retryTick, scheduleRetry, clearRetry]);\n}\n"]}
@@ -161,7 +161,12 @@ export declare class ResourceReadCacheFrontendService {
161
161
  * without sorting the second phrasing of one question would always miss. Arrays keep their order,
162
162
  * because in a filter or a sort an array's order is part of the question.
163
163
  *
164
- * Returns `null` for anything that cannot be rendered — a cycle, a `BigInt`, a function in a filter —
164
+ * A `Date` renders as its instant. It has no own enumerable keys, so walked as a plain object it was `{}`, and every
165
+ * date window was one key: a calendar or timeline moving to another month was served the first month's rows from
166
+ * this cache, with no request (#3931). Any other object that is not a plain object or an array (a `Set`, a `Map`, a
167
+ * class instance) carries its identity somewhere its own keys do not, so it is refused rather than rendered as `{}`.
168
+ *
169
+ * Returns `null` for anything that cannot be rendered — a cycle, a `BigInt`, a function in a filter, such an object —
165
170
  * which every caller reads as "do not cache this", never as an error.
166
171
  */
167
172
  export declare function renderResourceReadCacheKey(operationPathKey: string, parameters: unknown): string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"resource-read-cache.frontend.service.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/resource-read-cache.frontend.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAiBxE;;;;;;;;;GASG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,0BAA0B,EAAE,GAAG,OAAO,CAAC;IAErF;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,0BAA0B,EAAE,GAAG,IAAI,CAAC;CAC5F;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,gCAAgC;IAC3C,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,cAAc,CAAuB;IAE7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,OAAO,CAAQ;IAEvB;;;;;;OAMG;IACH;;;;;;;;;;;;;OAaG;IACI,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIpD,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIxC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAItD,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAIlC,oBAAoB,CAAC,SAAS,EAAE,6BAA6B,GAAG,IAAI,GAAG,IAAI;IAMlF;;;;;;;;;;;;OAYG;IACI,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAKzC,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;;;;;OAMG;IACI,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAiB7C,sEAAsE;IAC/D,KAAK,CACV,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,SAAS,0BAA0B,EAAE,GAC5C,IAAI;IAcP;;;;;;OAMG;IACI,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAWzD;;;;;;OAMG;IACI,KAAK,IAAI,IAAI;IAMpB,6EAA6E;IAC7E,OAAO,CAAC,mBAAmB;CAY5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,OAAO,GAClB,MAAM,GAAG,IAAI,CAuBf"}
1
+ {"version":3,"file":"resource-read-cache.frontend.service.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/resource-read-cache.frontend.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAiBxE;;;;;;;;;GASG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,0BAA0B,EAAE,GAAG,OAAO,CAAC;IAErF;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,0BAA0B,EAAE,GAAG,IAAI,CAAC;CAC5F;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;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