@spatial-elements/core 0.1.0-beta.1
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.
- package/LICENSE +373 -0
- package/README.md +17 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts +24 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -0
- package/dist/catalog/CarouselGlassCompositor.js +132 -0
- package/dist/catalog/CarouselGlassCompositor.js.map +1 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts +59 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -0
- package/dist/catalog/CatalogEndpointRegistry.js +187 -0
- package/dist/catalog/CatalogEndpointRegistry.js.map +1 -0
- package/dist/catalog/CatalogGeometryFade.d.ts +12 -0
- package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -0
- package/dist/catalog/CatalogGeometryFade.js +67 -0
- package/dist/catalog/CatalogGeometryFade.js.map +1 -0
- package/dist/catalog/CatalogPreparation.d.ts +40 -0
- package/dist/catalog/CatalogPreparation.d.ts.map +1 -0
- package/dist/catalog/CatalogPreparation.js +141 -0
- package/dist/catalog/CatalogPreparation.js.map +1 -0
- package/dist/catalog/CatalogSections.d.ts +36 -0
- package/dist/catalog/CatalogSections.d.ts.map +1 -0
- package/dist/catalog/CatalogSections.js +51 -0
- package/dist/catalog/CatalogSections.js.map +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +149 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.js +920 -0
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -0
- package/dist/catalog/CatalogTransition.d.ts +93 -0
- package/dist/catalog/CatalogTransition.d.ts.map +1 -0
- package/dist/catalog/CatalogTransition.js +1299 -0
- package/dist/catalog/CatalogTransition.js.map +1 -0
- package/dist/catalog/EnvironmentCache.d.ts +30 -0
- package/dist/catalog/EnvironmentCache.d.ts.map +1 -0
- package/dist/catalog/EnvironmentCache.js +128 -0
- package/dist/catalog/EnvironmentCache.js.map +1 -0
- package/dist/catalog/PreparationGate.d.ts +10 -0
- package/dist/catalog/PreparationGate.d.ts.map +1 -0
- package/dist/catalog/PreparationGate.js +66 -0
- package/dist/catalog/PreparationGate.js.map +1 -0
- package/dist/catalog/PresentationLease.d.ts +16 -0
- package/dist/catalog/PresentationLease.d.ts.map +1 -0
- package/dist/catalog/PresentationLease.js +33 -0
- package/dist/catalog/PresentationLease.js.map +1 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts +63 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -0
- package/dist/catalog/SpatialGeometryCapture.js +158 -0
- package/dist/catalog/SpatialGeometryCapture.js.map +1 -0
- package/dist/catalog/assets/SpatialElementAssetManager.d.ts +92 -0
- package/dist/catalog/assets/SpatialElementAssetManager.d.ts.map +1 -0
- package/dist/catalog/assets/SpatialElementAssetManager.js +305 -0
- package/dist/catalog/assets/SpatialElementAssetManager.js.map +1 -0
- package/dist/catalog/assets/assetCosts.d.ts +4 -0
- package/dist/catalog/assets/assetCosts.d.ts.map +1 -0
- package/dist/catalog/assets/assetCosts.js +33 -0
- package/dist/catalog/assets/assetCosts.js.map +1 -0
- package/dist/catalog/assets/spatialElementAssetResources.d.ts +25 -0
- package/dist/catalog/assets/spatialElementAssetResources.d.ts.map +1 -0
- package/dist/catalog/assets/spatialElementAssetResources.js +100 -0
- package/dist/catalog/assets/spatialElementAssetResources.js.map +1 -0
- package/dist/catalog/carouselPanelProjection.d.ts +9 -0
- package/dist/catalog/carouselPanelProjection.d.ts.map +1 -0
- package/dist/catalog/carouselPanelProjection.js +33 -0
- package/dist/catalog/carouselPanelProjection.js.map +1 -0
- package/dist/catalog/carouselSelection.d.ts +7 -0
- package/dist/catalog/carouselSelection.d.ts.map +1 -0
- package/dist/catalog/carouselSelection.js +15 -0
- package/dist/catalog/carouselSelection.js.map +1 -0
- package/dist/catalog/catalogAction.d.ts +4 -0
- package/dist/catalog/catalogAction.d.ts.map +1 -0
- package/dist/catalog/catalogAction.js +9 -0
- package/dist/catalog/catalogAction.js.map +1 -0
- package/dist/catalog/catalogGeometryRequest.d.ts +13 -0
- package/dist/catalog/catalogGeometryRequest.d.ts.map +1 -0
- package/dist/catalog/catalogGeometryRequest.js +8 -0
- package/dist/catalog/catalogGeometryRequest.js.map +1 -0
- package/dist/catalog/catalogItems.d.ts +10 -0
- package/dist/catalog/catalogItems.d.ts.map +1 -0
- package/dist/catalog/catalogItems.js +23 -0
- package/dist/catalog/catalogItems.js.map +1 -0
- package/dist/catalog/catalogJourney.d.ts +38 -0
- package/dist/catalog/catalogJourney.d.ts.map +1 -0
- package/dist/catalog/catalogJourney.js +64 -0
- package/dist/catalog/catalogJourney.js.map +1 -0
- package/dist/catalog/catalogPage.d.ts +11 -0
- package/dist/catalog/catalogPage.d.ts.map +1 -0
- package/dist/catalog/catalogPage.js +2 -0
- package/dist/catalog/catalogPage.js.map +1 -0
- package/dist/catalog/catalogPose.d.ts +30 -0
- package/dist/catalog/catalogPose.d.ts.map +1 -0
- package/dist/catalog/catalogPose.js +35 -0
- package/dist/catalog/catalogPose.js.map +1 -0
- package/dist/catalog/catalogPresentation.d.ts +24 -0
- package/dist/catalog/catalogPresentation.d.ts.map +1 -0
- package/dist/catalog/catalogPresentation.js +56 -0
- package/dist/catalog/catalogPresentation.js.map +1 -0
- package/dist/catalog/catalogRecipes.d.ts +21 -0
- package/dist/catalog/catalogRecipes.d.ts.map +1 -0
- package/dist/catalog/catalogRecipes.js +84 -0
- package/dist/catalog/catalogRecipes.js.map +1 -0
- package/dist/catalog/catalogSurfaceCapture.d.ts +11 -0
- package/dist/catalog/catalogSurfaceCapture.d.ts.map +1 -0
- package/dist/catalog/catalogSurfaceCapture.js +11 -0
- package/dist/catalog/catalogSurfaceCapture.js.map +1 -0
- package/dist/catalog/catalogViewLink.d.ts +8 -0
- package/dist/catalog/catalogViewLink.d.ts.map +1 -0
- package/dist/catalog/catalogViewLink.js +37 -0
- package/dist/catalog/catalogViewLink.js.map +1 -0
- package/dist/catalog/rebasePresentation.d.ts +3 -0
- package/dist/catalog/rebasePresentation.d.ts.map +1 -0
- package/dist/catalog/rebasePresentation.js +26 -0
- package/dist/catalog/rebasePresentation.js.map +1 -0
- package/dist/catalog/spatialElementAssets.d.ts +158 -0
- package/dist/catalog/spatialElementAssets.d.ts.map +1 -0
- package/dist/catalog/spatialElementAssets.js +92 -0
- package/dist/catalog/spatialElementAssets.js.map +1 -0
- package/dist/catalog/spatialElementLodPair.d.ts +17 -0
- package/dist/catalog/spatialElementLodPair.d.ts.map +1 -0
- package/dist/catalog/spatialElementLodPair.js +5 -0
- package/dist/catalog/spatialElementLodPair.js.map +1 -0
- package/dist/catalog/transitionTiming.d.ts +15 -0
- package/dist/catalog/transitionTiming.d.ts.map +1 -0
- package/dist/catalog/transitionTiming.js +22 -0
- package/dist/catalog/transitionTiming.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts +101 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.js +627 -0
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -0
- package/dist/spatial-element/spatialElement.d.ts +28 -0
- package/dist/spatial-element/spatialElement.d.ts.map +1 -0
- package/dist/spatial-element/spatialElement.js +45 -0
- package/dist/spatial-element/spatialElement.js.map +1 -0
- package/dist/spatial-element/spatialElementDock.d.ts +43 -0
- package/dist/spatial-element/spatialElementDock.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementDock.js +126 -0
- package/dist/spatial-element/spatialElementDock.js.map +1 -0
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts +29 -0
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementSectionRegistry.js +67 -0
- package/dist/spatial-element/spatialElementSectionRegistry.js.map +1 -0
- package/dist/spatial-element/types.d.ts +165 -0
- package/dist/spatial-element/types.d.ts.map +1 -0
- package/dist/spatial-element/types.js +2 -0
- package/dist/spatial-element/types.js.map +1 -0
- package/dist/stage/LiquidGlassPanel.d.ts +55 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -0
- package/dist/stage/LiquidGlassPanel.js +447 -0
- package/dist/stage/LiquidGlassPanel.js.map +1 -0
- package/dist/stage/MinimapBlurPipeline.d.ts +34 -0
- package/dist/stage/MinimapBlurPipeline.d.ts.map +1 -0
- package/dist/stage/MinimapBlurPipeline.js +147 -0
- package/dist/stage/MinimapBlurPipeline.js.map +1 -0
- package/dist/stage/MinimapController.d.ts +113 -0
- package/dist/stage/MinimapController.d.ts.map +1 -0
- package/dist/stage/MinimapController.js +803 -0
- package/dist/stage/MinimapController.js.map +1 -0
- package/dist/stage/OrbitControlsInterop.d.ts +8 -0
- package/dist/stage/OrbitControlsInterop.d.ts.map +1 -0
- package/dist/stage/OrbitControlsInterop.js +19 -0
- package/dist/stage/OrbitControlsInterop.js.map +1 -0
- package/dist/stage/PageBindingController.d.ts +41 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -0
- package/dist/stage/PageBindingController.js +92 -0
- package/dist/stage/PageBindingController.js.map +1 -0
- package/dist/stage/PanelPresentationController.d.ts +92 -0
- package/dist/stage/PanelPresentationController.d.ts.map +1 -0
- package/dist/stage/PanelPresentationController.js +569 -0
- package/dist/stage/PanelPresentationController.js.map +1 -0
- package/dist/stage/PresentationReadiness.d.ts +30 -0
- package/dist/stage/PresentationReadiness.d.ts.map +1 -0
- package/dist/stage/PresentationReadiness.js +94 -0
- package/dist/stage/PresentationReadiness.js.map +1 -0
- package/dist/stage/SpaceMouseAdapter.d.ts +76 -0
- package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -0
- package/dist/stage/SpaceMouseAdapter.js +197 -0
- package/dist/stage/SpaceMouseAdapter.js.map +1 -0
- package/dist/stage/SpatialElementInteractionController.d.ts +126 -0
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -0
- package/dist/stage/SpatialElementInteractionController.js +581 -0
- package/dist/stage/SpatialElementInteractionController.js.map +1 -0
- package/dist/stage/SpatialElementPresentationController.d.ts +82 -0
- package/dist/stage/SpatialElementPresentationController.d.ts.map +1 -0
- package/dist/stage/SpatialElementPresentationController.js +372 -0
- package/dist/stage/SpatialElementPresentationController.js.map +1 -0
- package/dist/stage/SpatialElementRefinement.d.ts +26 -0
- package/dist/stage/SpatialElementRefinement.d.ts.map +1 -0
- package/dist/stage/SpatialElementRefinement.js +105 -0
- package/dist/stage/SpatialElementRefinement.js.map +1 -0
- package/dist/stage/StageExperience.d.ts +536 -0
- package/dist/stage/StageExperience.d.ts.map +1 -0
- package/dist/stage/StageExperience.js +2399 -0
- package/dist/stage/StageExperience.js.map +1 -0
- package/dist/stage/StagePanelLayout.d.ts +15 -0
- package/dist/stage/StagePanelLayout.d.ts.map +1 -0
- package/dist/stage/StagePanelLayout.js +20 -0
- package/dist/stage/StagePanelLayout.js.map +1 -0
- package/dist/stage/StagePanelRuntime.d.ts +20 -0
- package/dist/stage/StagePanelRuntime.d.ts.map +1 -0
- package/dist/stage/StagePanelRuntime.js +2 -0
- package/dist/stage/StagePanelRuntime.js.map +1 -0
- package/dist/stage/StageRenderPipeline.d.ts +179 -0
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -0
- package/dist/stage/StageRenderPipeline.js +901 -0
- package/dist/stage/StageRenderPipeline.js.map +1 -0
- package/dist/stage/VirtualScrollController.d.ts +64 -0
- package/dist/stage/VirtualScrollController.d.ts.map +1 -0
- package/dist/stage/VirtualScrollController.js +329 -0
- package/dist/stage/VirtualScrollController.js.map +1 -0
- package/dist/stage/cssProjection.d.ts +18 -0
- package/dist/stage/cssProjection.d.ts.map +1 -0
- package/dist/stage/cssProjection.js +52 -0
- package/dist/stage/cssProjection.js.map +1 -0
- package/dist/stage/damping.d.ts +3 -0
- package/dist/stage/damping.d.ts.map +1 -0
- package/dist/stage/damping.js +8 -0
- package/dist/stage/damping.js.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts +31 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.js +163 -0
- package/dist/stage/minimap/MinimapGeometry.js.map +1 -0
- package/dist/stage/minimap/MinimapModel.d.ts +16 -0
- package/dist/stage/minimap/MinimapModel.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapModel.js +51 -0
- package/dist/stage/minimap/MinimapModel.js.map +1 -0
- package/dist/stage/minimap/MinimapProjection.d.ts +41 -0
- package/dist/stage/minimap/MinimapProjection.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapProjection.js +113 -0
- package/dist/stage/minimap/MinimapProjection.js.map +1 -0
- package/dist/stage/minimap/MinimapState.d.ts +102 -0
- package/dist/stage/minimap/MinimapState.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapState.js +2 -0
- package/dist/stage/minimap/MinimapState.js.map +1 -0
- package/dist/stage/minimapMeasurement.d.ts +5 -0
- package/dist/stage/minimapMeasurement.d.ts.map +1 -0
- package/dist/stage/minimapMeasurement.js +11 -0
- package/dist/stage/minimapMeasurement.js.map +1 -0
- package/dist/stage/panelContext.d.ts +71 -0
- package/dist/stage/panelContext.d.ts.map +1 -0
- package/dist/stage/panelContext.js +6 -0
- package/dist/stage/panelContext.js.map +1 -0
- package/dist/stage/panelShadow.d.ts +20 -0
- package/dist/stage/panelShadow.d.ts.map +1 -0
- package/dist/stage/panelShadow.js +22 -0
- package/dist/stage/panelShadow.js.map +1 -0
- package/dist/stage/renderMeasurement.d.ts +3 -0
- package/dist/stage/renderMeasurement.d.ts.map +1 -0
- package/dist/stage/renderMeasurement.js +19 -0
- package/dist/stage/renderMeasurement.js.map +1 -0
- package/dist/stage/renderTargetInventory.d.ts +17 -0
- package/dist/stage/renderTargetInventory.d.ts.map +1 -0
- package/dist/stage/renderTargetInventory.js +27 -0
- package/dist/stage/renderTargetInventory.js.map +1 -0
- package/dist/stage/rendererState.d.ts +14 -0
- package/dist/stage/rendererState.d.ts.map +1 -0
- package/dist/stage/rendererState.js +35 -0
- package/dist/stage/rendererState.js.map +1 -0
- package/dist/stage/resolveStageProfile.d.ts +44 -0
- package/dist/stage/resolveStageProfile.d.ts.map +1 -0
- package/dist/stage/resolveStageProfile.js +30 -0
- package/dist/stage/resolveStageProfile.js.map +1 -0
- package/dist/stage/scrollAnimation.d.ts +10 -0
- package/dist/stage/scrollAnimation.d.ts.map +1 -0
- package/dist/stage/scrollAnimation.js +11 -0
- package/dist/stage/scrollAnimation.js.map +1 -0
- package/dist/stage/scrollFrame.d.ts +43 -0
- package/dist/stage/scrollFrame.d.ts.map +1 -0
- package/dist/stage/scrollFrame.js +232 -0
- package/dist/stage/scrollFrame.js.map +1 -0
- package/dist/stage/spatialElementFrame.d.ts +6 -0
- package/dist/stage/spatialElementFrame.d.ts.map +1 -0
- package/dist/stage/spatialElementFrame.js +22 -0
- package/dist/stage/spatialElementFrame.js.map +1 -0
- package/dist/stage/stageConstants.d.ts +85 -0
- package/dist/stage/stageConstants.d.ts.map +1 -0
- package/dist/stage/stageConstants.js +85 -0
- package/dist/stage/stageConstants.js.map +1 -0
- package/dist/stage/stageDom.d.ts +10 -0
- package/dist/stage/stageDom.d.ts.map +1 -0
- package/dist/stage/stageDom.js +22 -0
- package/dist/stage/stageDom.js.map +1 -0
- package/dist/stage/stageMath.d.ts +187 -0
- package/dist/stage/stageMath.d.ts.map +1 -0
- package/dist/stage/stageMath.js +344 -0
- package/dist/stage/stageMath.js.map +1 -0
- package/dist/stage/stageSceneUtils.d.ts +42 -0
- package/dist/stage/stageSceneUtils.d.ts.map +1 -0
- package/dist/stage/stageSceneUtils.js +154 -0
- package/dist/stage/stageSceneUtils.js.map +1 -0
- package/dist/stage/stageTypes.d.ts +189 -0
- package/dist/stage/stageTypes.d.ts.map +1 -0
- package/dist/stage/stageTypes.js +2 -0
- package/dist/stage/stageTypes.js.map +1 -0
- package/dist/stage/stageVisualTest.d.ts +92 -0
- package/dist/stage/stageVisualTest.d.ts.map +1 -0
- package/dist/stage/stageVisualTest.js +5 -0
- package/dist/stage/stageVisualTest.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CatalogTransition.js","sourceRoot":"","sources":["../../src/catalog/CatalogTransition.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAGhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EAIvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAA0B,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EACN,gBAAgB,EAIhB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAsB,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EACN,eAAe,IAAI,QAAQ,EAC3B,gBAAgB,EAEhB,MAAM,uBAAuB,CAAC;AAI/B,SAAS,cAAc,CAAC,MAAqB;IAC5C,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAC5C,CAAC;AACD,SAAS,UAAU,CAAC,IAAuB;IAC1C,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,gBAAgB,CAAC;AACzD,CAAC;AAED,mGAAmG;AACnG,SAAS,eAAe,CAAC,MAAmB,EAAE,MAAmB;IAChE,MAAM,IAA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AC,YAAY,CAAC,aAAa,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;QAC/E,CAAC;QACD,IACC,OAAO,CAAC,KAAK,EAAE,WAAW;YAC1B,CAAC,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,IAAI;gBACxC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;YAEnD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC;YACJ,IAAI,CAAC;gBACJ,IAAI,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;YAC5F,CAAC;oBAAS,CAAC;gBACV,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;gBAC5B,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;YACzB,CAAC;QACF,CAAC;QAAC,MAAM,CAAC;YACR,iFAAiF;QAClF,CAAC;gBAAS,CAAC;YACV,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QACrB,CAAC;IACF,CAAC;CACD","sourcesContent":["import {\n\tgeometryEndpoint,\n\ttype CatalogGeometryEndpoint,\n\ttype CatalogGeometryDestination\n} from './catalogGeometryRequest.js';\nimport {\n\tresolveCatalogJourney,\n\tplanCatalogParticipants,\n\ttype CatalogParticipantEndpoint,\n\ttype CatalogParticipantPair,\n\ttype CatalogViewContext\n} from './catalogJourney.js';\nimport { readCatalogViewContext } from './catalogViewLink.js';\nimport { captureCarouselElement } from './carouselPanelProjection.js';\nimport type { CatalogTransitionPresentation } from './catalogPresentation.js';\nimport { PresentationLease } from './PresentationLease.js';\nimport { rebasePresentation } from './rebasePresentation.js';\nimport { getProjectiveCssMatrix3d, type CssProjectionQuad } from '../stage/cssProjection.js';\nimport type { CatalogSurfaceCapture } from './catalogSurfaceCapture.js';\nimport {\n\tcatalogSharedKey,\n\ttype CatalogIdentity,\n\ttype CatalogSharedRole,\n\ttype CatalogEndpointRegistry\n} from './CatalogEndpointRegistry.js';\nimport { resolveCatalogIntent, selectCatalogRecipe, type CatalogRecipe } from './catalogRecipes.js';\nexport { catalogSharedKey } from './CatalogEndpointRegistry.js';\nexport type { CatalogSharedRole } from './CatalogEndpointRegistry.js';\nimport {\n\tMOTION_DURATION as DURATION,\n\ttransitionTiming,\n\ttype TransitionMode\n} from './transitionTiming.js';\n\nexport type CatalogTransitionIdentity = CatalogIdentity;\n\nfunction isReturnRecipe(recipe: CatalogRecipe) {\n\treturn recipe.source.startsWith('detail.');\n}\nfunction isRichRole(role: CatalogSharedRole) {\n\treturn role === 'features' || role === 'primary-action';\n}\n\n/** Full summaries retain authored row/icon layout; temporary controls never become interactive. */\nfunction copyRichContent(target: HTMLElement, source: HTMLElement) {\n\tconst copy = source.cloneNode(true) as HTMLElement;\n\tconst originals = [source, ...source.querySelectorAll<HTMLElement | SVGElement>('*')];\n\tconst copies = [copy, ...copy.querySelectorAll<HTMLElement | SVGElement>('*')];\n\tfor (let index = 0; index < originals.length; index++) {\n\t\tconst style = getComputedStyle(originals[index]);\n\t\tfor (const property of style)\n\t\t\tcopies[index].style.setProperty(property, style.getPropertyValue(property));\n\t\tcopies[index].style.visibility = 'visible';\n\t\tcopies[index].removeAttribute('id');\n\t\tfor (const attribute of [...copies[index].attributes])\n\t\t\tif (attribute.name.startsWith('data-')) copies[index].removeAttribute(attribute.name);\n\t}\n\tObject.assign(copy.style, {\n\t\tposition: 'relative',\n\t\tleft: '0',\n\t\ttop: '0',\n\t\twidth: '100%',\n\t\theight: '100%',\n\t\tmargin: '0',\n\t\ttransform: 'none',\n\t\tpointerEvents: 'none'\n\t});\n\tcopy.inert = true;\n\tcopy.setAttribute('aria-hidden', 'true');\n\ttarget.append(copy);\n}\n\n/** Only the forward list-to-hero edge is part of the first vertical slice. */\nexport function resolveCatalogTransition(\n\tfrom: URL,\n\tto: URL,\n\ttype: string\n): CatalogTransitionIdentity | undefined {\n\tif (\n\t\ttype === 'popstate' ||\n\t\tto.hash ||\n\t\t!from.pathname.replace(/\\/$/, '').endsWith('/categories/list')\n\t)\n\t\treturn;\n\treturn selectCatalogRecipe(resolveCatalogIntent(from, to, type), 'list', 'hero')?.identity;\n}\n\n/** A stale animation completion cannot settle a newer navigation. */\nexport class CatalogTransitionSequence {\n\tprivate generation = 0;\n\tprivate current?: { token: number; phase: 'captured' | 'animating' };\n\n\tget active() {\n\t\treturn this.current !== undefined;\n\t}\n\n\tget phase() {\n\t\treturn this.current?.phase ?? 'idle';\n\t}\n\n\tbegin() {\n\t\tconst token = ++this.generation;\n\t\tthis.current = { token, phase: 'captured' };\n\t\treturn token;\n\t}\n\n\tstart(token: number) {\n\t\tif (!this.current || this.current.token !== token || this.current.phase !== 'captured') {\n\t\t\treturn false;\n\t\t}\n\t\tthis.current.phase = 'animating';\n\t\treturn true;\n\t}\n\n\tisCurrent(token: number) {\n\t\treturn this.current?.token === token;\n\t}\n\n\tfinish(token: number) {\n\t\tif (!this.isCurrent(token)) return false;\n\t\tthis.current = undefined;\n\t\treturn true;\n\t}\n\n\tcancel() {\n\t\tthis.generation += 1;\n\t\tthis.current = undefined;\n\t}\n}\n\ninterface CatalogTransitionHooks {\n\tcaptureContentGeometry?(\n\t\tendpoint: CatalogParticipantEndpoint,\n\t\tsecondary: CatalogParticipantEndpoint[]\n\t): boolean;\n\tprepareContentParticipants?(\n\t\tpairs: CatalogParticipantPair[]\n\t): CatalogParticipantPair[] | undefined;\n\tadoptContentParticipants?(pairs: CatalogParticipantPair[]): void;\n\tpromoteContentParticipant?(source: CatalogParticipantEndpoint): boolean;\n\tbackgroundPrepared?(): boolean;\n\tcaptureElement?(\n\t\telement: HTMLElement\n\t): { width: number; height: number; corners: CssProjectionQuad } | undefined;\n\tadoptGeometry?(destination: CatalogGeometryDestination): boolean;\n\tgeometryPoint?(): { x: number; y: number } | null;\n\tbeginMotion?(): TransitionMode;\n\tcaptureGeometry(source: CatalogGeometryEndpoint): boolean;\n\tprepareDestination?(destination: CatalogGeometryDestination): boolean;\n\tsetGeometryProgress(progress: number): void;\n\tflushFrame(): void;\n\tfinishGeometry(): void;\n\tresolveSurface(element: HTMLElement): HTMLElement;\n\tcaptureSurface?(element: HTMLElement): CatalogSurfaceCapture;\n\tsetPresentation(presentation: CatalogTransitionPresentation): void;\n}\n\ninterface TransitionActor {\n\tsemantic?: string;\n\tlayoutWidth?: number;\n\tlayoutHeight?: number;\n\tcorners?: CssProjectionQuad;\n\tsourceOnly?: boolean;\n\tbaseOpacity?: number;\n\trebased?: boolean;\n\trole: CatalogSharedRole;\n\telement: HTMLDivElement;\n\tfrom: DOMRect;\n\tfontSize: number;\n\tto?: DOMRect;\n\tfontScale?: number;\n\tdestinationCopy?: HTMLDivElement;\n}\n\ninterface TransitionCapture {\n\tview?: {\n\t\tsource: CatalogParticipantEndpoint;\n\t\tsources: CatalogParticipantEndpoint[];\n\t\tpairs?: CatalogParticipantPair[];\n\t\talternates?: Map<string, TransitionActor[]>;\n\t\tcontext: CatalogViewContext;\n\t};\n\tpanelContent?: { element: HTMLElement; rect: DOMRect; panel: DOMRect; incoming: boolean }[];\n\tbackgroundPrepared?: boolean;\n\tretarget?: boolean;\n\tcaptureShell?: boolean;\n\tsuspendedPose?: { surface: DOMRect; geometry: { x: number; y: number } | null };\n\tlease?: PresentationLease<TransitionCapture>;\n\towner?: ReturnType<PresentationLease<TransitionCapture>['claim']>;\n\tpaused?: boolean;\n\telapsed: number;\n\tmode?: TransitionMode;\n\ttoken: number;\n\tidentity: CatalogTransitionIdentity;\n\trecipe: CatalogRecipe;\n\thost: HTMLDivElement;\n\tactors: TransitionActor[];\n\texiting: HTMLElement[];\n\trestore: (() => void)[];\n\tframe: number;\n\ttimeout: ReturnType<typeof setTimeout>;\n\tresolve?: () => void;\n\tobserver?: MutationObserver;\n\tlayoutObserver?: ResizeObserver;\n\tinert: Map<HTMLElement, boolean>;\n\tcontent?: HTMLElement;\n\tfocus?: HTMLElement;\n}\n\nfunction hasSize(rect: DOMRect) {\n\treturn rect.width > 0 && rect.height > 0;\n}\n\nfunction intersectsViewport(element: HTMLElement) {\n\tconst rect = element.getBoundingClientRect();\n\treturn (\n\t\thasSize(rect) &&\n\t\trect.right > 0 &&\n\t\trect.bottom > 0 &&\n\t\trect.left < innerWidth &&\n\t\trect.top < innerHeight\n\t);\n}\n\n/** A partial endpoint needs an explicit clip representation; otherwise use semantic navigation. */\nfunction fullyPresented(element: HTMLElement) {\n\tconst rect = element.getBoundingClientRect();\n\tif (\n\t\t!hasSize(rect) ||\n\t\trect.left < 0 ||\n\t\trect.top < 0 ||\n\t\trect.right > innerWidth ||\n\t\trect.bottom > innerHeight\n\t)\n\t\treturn false;\n\tfor (let ancestor = element.parentElement; ancestor; ancestor = ancestor.parentElement) {\n\t\tconst style = getComputedStyle(ancestor);\n\t\tconst clip = ancestor.getBoundingClientRect();\n\t\tif (\n\t\t\t/(hidden|clip|scroll|auto)/.test(style.overflowX) &&\n\t\t\t(rect.left < clip.left - 1 || rect.right > clip.right + 1)\n\t\t)\n\t\t\treturn false;\n\t\tif (\n\t\t\t/(hidden|clip|scroll|auto)/.test(style.overflowY) &&\n\t\t\t(rect.top < clip.top - 1 || rect.bottom > clip.bottom + 1)\n\t\t)\n\t\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction visiblyPresented(element: HTMLElement) {\n\tconst rect = element.getBoundingClientRect();\n\tif (!hasSize(rect) || rect.bottom <= 0 || rect.top >= innerHeight) return false;\n\tfor (let node: HTMLElement | null = element; node; node = node.parentElement) {\n\t\tconst style = getComputedStyle(node);\n\t\tif (style.visibility === 'hidden' || style.display === 'none' || Number(style.opacity) < 0.01)\n\t\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction copyTypography(element: HTMLElement, style: CSSStyleDeclaration) {\n\tfor (const property of [\n\t\t'font-family',\n\t\t'font-size',\n\t\t'font-weight',\n\t\t'font-style',\n\t\t'line-height',\n\t\t'letter-spacing',\n\t\t'text-transform',\n\t\t'text-align',\n\t\t'white-space',\n\t\t'overflow',\n\t\t'text-overflow',\n\t\t'color',\n\t\t'text-shadow'\n\t])\n\t\telement.style.setProperty(property, style.getPropertyValue(property));\n}\n\nfunction preserveStyle(element: HTMLElement, property: string, restore: (() => void)[]) {\n\tconst value = element.style.getPropertyValue(property);\n\tconst priority = element.style.getPropertyPriority(property);\n\tconst reset = () => {\n\t\tif (value) element.style.setProperty(property, value, priority);\n\t\telse element.style.removeProperty(property);\n\t};\n\trestore.push(reset);\n\treturn reset;\n}\n\n/** Owns decorative DOM only. Semantic pages and element geometry keep their respective owners. */\nexport class CatalogTransition {\n\tprivate readonly sequence = new CatalogTransitionSequence();\n\tprivate captureState?: TransitionCapture;\n\tprivate readonly interrupt = () => this.cancel();\n\tprivate readonly keydown = (event: KeyboardEvent) => {\n\t\tif (event.key === 'Escape') this.cancel();\n\t};\n\n\tconstructor(\n\t\tprivate readonly root: HTMLElement,\n\t\tprivate readonly endpoints: CatalogEndpointRegistry,\n\t\tprivate readonly hooks: CatalogTransitionHooks\n\t) {}\n\n\tget active() {\n\t\treturn this.sequence.active;\n\t}\n\n\t/** Pause at the last submitted DOM/GPU frame while a compatible navigation resolves. */\n\tsupersede(destination: URL) {\n\t\tconst capture = this.captureState;\n\t\tconst path = destination.pathname.replace(/\\/$/, '');\n\t\tconst compatible =\n\t\t\tcapture &&\n\t\t\tdestination.origin === location.origin &&\n\t\t\t(Boolean(\n\t\t\t\tresolveCatalogIntent(\n\t\t\t\t\tnew URL(\n\t\t\t\t\t\t`/${encodeURIComponent(capture.identity.brandId)}/elements/${encodeURIComponent(capture.identity.spatialElementId)}`,\n\t\t\t\t\t\tlocation.href\n\t\t\t\t\t),\n\t\t\t\t\tdestination,\n\t\t\t\t\t'link'\n\t\t\t\t)\n\t\t\t) ||\n\t\t\t\tpath ===\n\t\t\t\t\t`/${encodeURIComponent(capture.identity.brandId)}/elements/${encodeURIComponent(capture.identity.spatialElementId)}`);\n\t\tif (!capture || !compatible) {\n\t\t\tthis.cancel();\n\t\t\treturn;\n\t\t}\n\t\tcancelAnimationFrame(capture.frame);\n\t\t// The old destination can unmount while the successor binds asynchronously.\n\t\t// Its observer must not cancel the new owner when those old bounds disappear.\n\t\tcapture.layoutObserver?.disconnect();\n\t\tcapture.layoutObserver = undefined;\n\t\tcapture.suspendedPose = {\n\t\t\tsurface: capture.actors[0]?.element.getBoundingClientRect() ?? new DOMRect(),\n\t\t\tgeometry: this.hooks.geometryPoint?.() ?? null\n\t\t};\n\t\tcapture.paused = true;\n\t\tcapture.resolve?.();\n\t\tcapture.resolve = undefined;\n\t\tconst reverse = /\\/categories\\/(?:list|carousel|mixed)$/.test(path);\n\t\tif (\n\t\t\tcapture.view ||\n\t\t\tcapture.retarget ||\n\t\t\treverse !== isReturnRecipe(capture.recipe) ||\n\t\t\tdestination.hash\n\t\t) {\n\t\t\tif (\n\t\t\t\t!this.hooks.adoptGeometry?.({\n\t\t\t\t\tspatialElementId: capture.identity.spatialElementId,\n\t\t\t\t\tkind: reverse ? 'content' : destination.hash ? 'dock' : 'hero'\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\tthis.cancel();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcapture.retarget = true;\n\t\t\tconst panelRect = capture.actors\n\t\t\t\t.find((actor) => actor.role === 'summary-surface')\n\t\t\t\t?.element.getBoundingClientRect();\n\t\t\tif (panelRect)\n\t\t\t\tfor (const copy of capture.panelContent ?? []) {\n\t\t\t\t\tconst rect = copy.element.getBoundingClientRect();\n\t\t\t\t\tconst wrapper = rebasePresentation([copy.element], rect, 'summary-surface');\n\t\t\t\t\tdelete wrapper.dataset.catalogActorRole;\n\t\t\t\t\twrapper.dataset.catalogPanelContent = '';\n\t\t\t\t\tcapture.host.appendChild(wrapper);\n\t\t\t\t\tconst index = capture.exiting.indexOf(copy.element);\n\t\t\t\t\tif (index >= 0) capture.exiting[index] = wrapper;\n\t\t\t\t\telse capture.exiting.push(wrapper);\n\t\t\t\t\tcopy.element = wrapper;\n\t\t\t\t\tcopy.rect = rect;\n\t\t\t\t\tcopy.panel = panelRect;\n\t\t\t\t\tcopy.incoming = false;\n\t\t\t\t}\n\t\t\tconst extra: TransitionActor[] = [];\n\t\t\tconst opacity = Number(this.root.style.getPropertyValue('--catalog-shared-opacity')) || 0;\n\t\t\tfor (const actor of capture.actors) {\n\t\t\t\tconst rect = actor.element.getBoundingClientRect();\n\t\t\t\tif (!actor.sourceOnly && opacity > 0) {\n\t\t\t\t\tconst real = this.endpoints.resolve({\n\t\t\t\t\t\t...capture.identity,\n\t\t\t\t\t\tslot: capture.recipe.targetShared,\n\t\t\t\t\t\trole: actor.role\n\t\t\t\t\t});\n\t\t\t\t\tif (real) {\n\t\t\t\t\t\tconst bounds = (\n\t\t\t\t\t\t\tactor.role === 'summary-surface' ? this.hooks.resolveSurface(real) : real\n\t\t\t\t\t\t).getBoundingClientRect();\n\t\t\t\t\t\tconst copy = document.createElement('div');\n\t\t\t\t\t\tcopy.style.cssText = actor.element.style.cssText;\n\t\t\t\t\t\tObject.assign(copy.style, {\n\t\t\t\t\t\t\tleft: `${bounds.left}px`,\n\t\t\t\t\t\t\ttop: `${bounds.top}px`,\n\t\t\t\t\t\t\twidth: `${bounds.width}px`,\n\t\t\t\t\t\t\theight: `${bounds.height}px`,\n\t\t\t\t\t\t\ttransform: 'none',\n\t\t\t\t\t\t\tclipPath: 'none',\n\t\t\t\t\t\t\topacity: String(opacity)\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (actor.role !== 'summary-surface') {\n\t\t\t\t\t\t\tcopy.textContent = real.textContent;\n\t\t\t\t\t\t\tcopyTypography(copy, getComputedStyle(real));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcapture.host.appendChild(copy);\n\t\t\t\t\t\textra.push({\n\t\t\t\t\t\t\trole: actor.role,\n\t\t\t\t\t\t\telement: copy,\n\t\t\t\t\t\t\tfrom: bounds,\n\t\t\t\t\t\t\tfontSize: Number.parseFloat(getComputedStyle(real).fontSize),\n\t\t\t\t\t\t\tsourceOnly: true,\n\t\t\t\t\t\t\tbaseOpacity: opacity\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (actor.role !== 'summary-surface') {\n\t\t\t\t\t\t\tpreserveStyle(real, 'visibility', capture.restore);\n\t\t\t\t\t\t\treal.style.setProperty('visibility', 'hidden', 'important');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst layers = [actor.element, ...(actor.destinationCopy ? [actor.destinationCopy] : [])];\n\t\t\t\tconst wrapper = rebasePresentation(layers, rect, actor.role);\n\t\t\t\tcapture.host.appendChild(wrapper);\n\t\t\t\tactor.fontSize *= rect.width / actor.from.width;\n\t\t\t\tactor.element = wrapper;\n\t\t\t\tactor.corners = undefined;\n\t\t\t\tactor.from = rect;\n\t\t\t\tactor.to = undefined;\n\t\t\t\tactor.destinationCopy = undefined;\n\t\t\t\tactor.rebased = true;\n\t\t\t\tactor.baseOpacity = 1;\n\t\t\t}\n\t\t\tcapture.actors.push(...extra);\n\t\t\t// Retain visible secondary content before hiding its shared parent or awaiting route data.\n\t\t\tconst previousRecipe = capture.recipe;\n\t\t\tcapture.recipe = {\n\t\t\t\t...previousRecipe,\n\t\t\t\tsource: this.root.querySelector('[data-catalog-list]') ? 'catalog.card' : 'detail.summary'\n\t\t\t};\n\t\t\tthis.captureExitingContent(capture);\n\t\t\tcapture.recipe = previousRecipe;\n\t\t\tconst surface = this.endpoints.resolve({\n\t\t\t\t...capture.identity,\n\t\t\t\tslot: previousRecipe.targetShared,\n\t\t\t\trole: 'summary-surface'\n\t\t\t});\n\t\t\tif (surface) {\n\t\t\t\tpreserveStyle(surface, 'visibility', capture.restore);\n\t\t\t\tsurface.style.setProperty('visibility', 'hidden', 'important');\n\t\t\t}\n\t\t\tfor (const copy of capture.exiting)\n\t\t\t\tcopy.dataset.catalogBaseOpacity = copy.style.opacity || '1';\n\t\t}\n\t}\n\n\tgetOwnership() {\n\t\tconst capture = this.captureState;\n\t\treturn capture\n\t\t\t? {\n\t\t\t\t\trevision: capture.lease?.revision,\n\t\t\t\t\telapsed: capture.elapsed,\n\t\t\t\t\tidentity: capture.identity,\n\t\t\t\t\tsource: capture.recipe.source,\n\t\t\t\t\ttarget: capture.recipe.targetShared,\n\t\t\t\t\tsuspendedPose: capture.suspendedPose\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tsurface: capture.suspendedPose.surface.toJSON(),\n\t\t\t\t\t\t\t\tgeometry: capture.suspendedPose.geometry\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t: null;\n\t}\n\n\tprivate matchesDestination(capture: TransitionCapture, destination: URL) {\n\t\treturn (\n\t\t\tdestination.origin === location.origin &&\n\t\t\t!destination.hash &&\n\t\t\tdestination.pathname.replace(/\\/$/, '') ===\n\t\t\t\t`/${encodeURIComponent(capture.identity.brandId)}/elements/${encodeURIComponent(capture.identity.spatialElementId)}`\n\t\t);\n\t}\n\n\tprivate createActor(\n\t\tidentity: CatalogIdentity,\n\t\tsource: HTMLElement,\n\t\trole: CatalogSharedRole,\n\t\treverse: boolean\n\t): TransitionActor {\n\t\tconst paint =\n\t\t\trole === 'summary-surface' && reverse ? this.hooks.captureSurface?.(source) : undefined;\n\t\tconst projection =\n\t\t\tcaptureCarouselElement(source) ??\n\t\t\t(role !== 'summary-surface' && reverse ? this.hooks.captureElement?.(source) : undefined);\n\t\tconst bounds =\n\t\t\tpaint?.bounds ?? (role === 'summary-surface' ? this.hooks.resolveSurface(source) : source);\n\t\tconst from = bounds.getBoundingClientRect();\n\t\tconst style = getComputedStyle(\n\t\t\trole === 'summary-surface' && reverse ? bounds : source,\n\t\t\trole === 'summary-surface' && source.closest('[data-carousel-spatial-element]') ? '::before' : null\n\t\t);\n\t\tconst element = document.createElement('div');\n\t\telement.dataset.catalogSharedKey = catalogSharedKey(identity, role);\n\t\telement.dataset.catalogActorRole = role;\n\t\tObject.assign(element.style, {\n\t\t\tposition: 'fixed',\n\t\t\tleft: `${from.left}px`,\n\t\t\ttop: `${from.top}px`,\n\t\t\twidth: `${from.width}px`,\n\t\t\theight: `${from.height}px`,\n\t\t\tmargin: '0',\n\t\t\tboxSizing: 'border-box',\n\t\t\tpointerEvents: 'none',\n\t\t\ttransformOrigin: 'top left',\n\t\t\tzIndex: role === 'summary-surface' ? '20' : '22',\n\t\t\twillChange: 'transform, opacity'\n\t\t});\n\t\tif (role === 'summary-surface') {\n\t\t\tObject.assign(element.style, {\n\t\t\t\tbackground: paint?.background ?? style.backgroundColor,\n\t\t\t\tborder: paint?.border ?? style.border,\n\t\t\t\tborderRadius: paint?.borderRadius ?? style.borderRadius,\n\t\t\t\tboxShadow: paint?.boxShadow ?? style.boxShadow\n\t\t\t});\n\t\t} else {\n\t\t\tif (isRichRole(role)) copyRichContent(element, source);\n\t\t\telse element.textContent = source.textContent;\n\t\t\tcopyTypography(element, style);\n\t\t\tObject.assign(element.style, {\n\t\t\t\tfontFamily: style.fontFamily,\n\t\t\t\tfontSize: style.fontSize,\n\t\t\t\tfontWeight: style.fontWeight,\n\t\t\t\tfontStyle: style.fontStyle,\n\t\t\t\tlineHeight: style.lineHeight,\n\t\t\t\tletterSpacing: style.letterSpacing,\n\t\t\t\ttextTransform: style.textTransform,\n\t\t\t\ttextAlign: style.textAlign,\n\t\t\t\tcolor: style.color\n\t\t\t});\n\t\t}\n\t\tconst actor: TransitionActor = {\n\t\t\tsemantic: source.dataset.catalogSemantic,\n\t\t\trole,\n\t\t\telement,\n\t\t\tfrom,\n\t\t\tfontSize: Number.parseFloat(style.fontSize),\n\t\t\tcorners: projection?.corners ?? paint?.corners,\n\t\t\tlayoutWidth: projection?.width,\n\t\t\tlayoutHeight: projection?.height\n\t\t};\n\t\tconst corners = projection?.corners ?? paint?.corners;\n\t\tif (corners) {\n\t\t\tconst local = corners.map((point) => ({\n\t\t\t\tx: point.x - from.left,\n\t\t\t\ty: point.y - from.top\n\t\t\t})) as unknown as CssProjectionQuad;\n\t\t\tconst width = projection?.width ?? from.width;\n\t\t\tconst height = projection?.height ?? from.height;\n\t\t\telement.style.width = `${width}px`;\n\t\t\telement.style.height = `${height}px`;\n\t\t\telement.style.transform = getProjectiveCssMatrix3d(local, width, height) ?? '';\n\t\t}\n\t\treturn actor;\n\t}\n\n\tprivate contentEndpoints(brandId: string, requireSubmitted = true): CatalogParticipantEndpoint[] {\n\t\treturn this.endpoints\n\t\t\t.getContentEndpoints()\n\t\t\t.filter((entry) => entry.address.brandId === brandId)\n\t\t\t.map(({ address, element }) => {\n\t\t\t\tlet sectionId: string | undefined;\n\t\t\t\ttry {\n\t\t\t\t\tsectionId = JSON.parse(address.occurrence ?? '[]')[0];\n\t\t\t\t} catch {\n\t\t\t\t\t/* Legacy occurrence. */\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...address,\n\t\t\t\t\trole: 'geometry',\n\t\t\t\t\tsectionId,\n\t\t\t\t\torder: Number(element.dataset.catalogOrder ?? 0),\n\t\t\t\t\teligible:\n\t\t\t\t\t\taddress.slot === 'catalog.card' ? fullyPresented(element) : intersectsViewport(element),\n\t\t\t\t\tprepared: !requireSubmitted || element.hasAttribute('data-catalog-model-ready'),\n\t\t\t\t\tselected: address.slot === 'carousel.front',\n\t\t\t\t\tfocused: element.contains(document.activeElement)\n\t\t\t\t};\n\t\t\t});\n\t}\n\tcapture(fromURL: URL, toURL: URL, type: string) {\n\t\tconst retained = this.captureState;\n\n\t\tif (retained?.paused && retained.retarget) {\n\t\t\tconst journey = resolveCatalogJourney(fromURL, toURL, type);\n\t\t\tif (journey?.kind === 'content-view') {\n\t\t\t\tconst context = type === 'popstate' ? {} : readCatalogViewContext(toURL);\n\t\t\t\tconst previousPairs = retained.view?.pairs ?? [];\n\t\t\t\tconst candidates = previousPairs.length\n\t\t\t\t\t? previousPairs.map((pair) => pair.target)\n\t\t\t\t\t: this.contentEndpoints(journey.brandId, false);\n\t\t\t\tconst source = candidates.find(\n\t\t\t\t\t(p) =>\n\t\t\t\t\t\tp.spatialElementId === retained.identity.spatialElementId && p.slot === retained.recipe.targetShared\n\t\t\t\t);\n\t\t\t\tif (source && (!context.spatialElementId || context.spatialElementId === retained.identity.spatialElementId)) {\n\t\t\t\t\tthis.hooks.adoptContentParticipants?.(previousPairs);\n\t\t\t\t\tretained.view = {\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\tsources: candidates.filter((p) => p.sectionId === source.sectionId),\n\t\t\t\t\t\tcontext: {\n\t\t\t\t\t\t\t...context,\n\t\t\t\t\t\t\tspatialElementId: retained.identity.spatialElementId,\n\t\t\t\t\t\t\ttargetSection: journey.section ?? context.targetSection\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tretained.recipe = {\n\t\t\t\t\t\t...retained.recipe,\n\t\t\t\t\t\tsource: source.slot,\n\t\t\t\t\t\tid: source.slot === 'catalog.card' ? 'list-to-carousel' : 'carousel-to-list'\n\t\t\t\t\t};\n\t\t\t\t\tretained.owner = retained.lease!.claim();\n\t\t\t\t\tretained.token = this.sequence.begin();\n\t\t\t\t\tretained.elapsed = 0;\n\t\t\t\t\tretained.mode = undefined;\n\t\t\t\t\tretained.backgroundPrepared = undefined;\n\t\t\t\t\tretained.paused = false;\n\t\t\t\t\tretained.retarget = false;\n\t\t\t\t\tthis.captureExitingContent(retained);\n\t\t\t\t\tthis.root.dataset.catalogDirection = 'return';\n\t\t\t\t\tthis.root.dataset.catalogRecipe = retained.recipe.id;\n\t\t\t\t\tthis.root.dataset.catalogOwnershipRevision = String(retained.lease!.revision);\n\t\t\t\t\tthis.setPresentation({ active: true, exitOpacity: 1, enterOpacity: 0, sharedOpacity: 0 });\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst intent = resolveCatalogIntent(fromURL, toURL, type);\n\t\t\tconst reverse = intent?.direction === 'detail-to-list';\n\t\t\tconst content =\n\t\t\t\tretained.recipe.source.startsWith('carousel.') ||\n\t\t\t\tretained.recipe.targetShared.startsWith('carousel.')\n\t\t\t\t\t? 'carousel'\n\t\t\t\t\t: 'list';\n\t\t\tconst recipe = selectCatalogRecipe(\n\t\t\t\tintent,\n\t\t\t\treverse ? (retained.recipe.targetShared === 'detail.dock' ? 'dock' : 'hero') : content,\n\t\t\t\treverse ? content : 'hero'\n\t\t\t);\n\t\t\tif (recipe) {\n\t\t\t\tretained.view = undefined;\n\t\t\t\tthis.hooks.adoptContentParticipants?.([]);\n\t\t\t\tretained.owner = retained.lease!.claim();\n\t\t\t\tretained.token = this.sequence.begin();\n\t\t\t\tretained.recipe = recipe;\n\t\t\t\tretained.elapsed = 0;\n\t\t\t\tretained.mode = undefined;\n\t\t\t\tretained.backgroundPrepared = undefined;\n\t\t\t\tretained.paused = false;\n\t\t\t\tretained.retarget = false;\n\t\t\t\tthis.captureExitingContent(retained);\n\t\t\t\tthis.root.dataset.catalogDirection = reverse ? 'return' : 'forward';\n\t\t\t\tthis.root.dataset.catalogRecipe = recipe.id;\n\t\t\t\tthis.root.dataset.catalogOwnershipRevision = String(retained.lease!.revision);\n\t\t\t\tthis.setPresentation({ active: true, exitOpacity: 1, enterOpacity: 0, sharedOpacity: 0 });\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tretained?.paused &&\n\t\t\tretained.mode &&\n\t\t\ttype !== 'popstate' &&\n\t\t\tthis.matchesDestination(retained, toURL)\n\t\t) {\n\t\t\tretained.token = this.sequence.begin();\n\t\t\tretained.owner = retained.lease!.claim();\n\t\t\tthis.root.dataset.catalogOwnershipRevision = String(retained.lease!.revision);\n\t\t\treturn true;\n\t\t}\n\t\tthis.cancel();\n\t\tconst journey = resolveCatalogJourney(fromURL, toURL, type);\n\t\tconst context = type === 'popstate' ? {} : readCatalogViewContext(toURL);\n\t\tconst inventory =\n\t\t\tjourney?.kind === 'content-view' ? this.contentEndpoints(journey.brandId) : [];\n\t\tconst sourcePairs = planCatalogParticipants(\n\t\t\tinventory,\n\t\t\tinventory,\n\t\t\t{\n\t\t\t\tspatialElementId: context.spatialElementId,\n\t\t\t\tsourceSection: context.sourceSection,\n\t\t\t\tsourceOccurrence: context.sourceOccurrence\n\t\t\t},\n\t\t\t5\n\t\t);\n\t\tconst primary = sourcePairs[0];\n\t\tconst view =\n\t\t\tjourney?.kind === 'content-view' && primary\n\t\t\t\t? {\n\t\t\t\t\t\tsource: primary.source,\n\t\t\t\t\t\tsources: sourcePairs.map((pair) => pair.source),\n\t\t\t\t\t\tcontext: { ...context, targetSection: journey.section ?? context.targetSection }\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\tif (journey?.kind === 'content-view' && !view) return;\n\t\tif (view)\n\t\t\tthis.endpoints.prefer(\n\t\t\t\tview.source.brandId,\n\t\t\t\tview.source.spatialElementId,\n\t\t\t\tview.source.occurrence!,\n\t\t\t\tview.source.slot as 'catalog.card' | 'carousel.front' | 'carousel.neighbour'\n\t\t\t);\n\t\tconst intent = view\n\t\t\t? {\n\t\t\t\t\tidentity: primary!.identity,\n\t\t\t\t\tdirection: 'list-to-detail' as const,\n\t\t\t\t\thistory: type === 'popstate',\n\t\t\t\t\ttarget: 'hero' as const\n\t\t\t\t}\n\t\t\t: resolveCatalogIntent(fromURL, toURL, type);\n\t\tconst reverse = intent?.direction === 'detail-to-list';\n\t\tconst contentSlot = intent\n\t\t\t? reverse\n\t\t\t\t? this.endpoints.getPreferredContentSlot(intent.identity)\n\t\t\t\t: this.endpoints.getContentSlot(intent.identity)\n\t\t\t: undefined;\n\t\tconst composition =\n\t\t\treverse && intent\n\t\t\t\t? this.endpoints.getComposition(intent.identity)\n\t\t\t\t: contentSlot?.startsWith('carousel.')\n\t\t\t\t\t? 'carousel'\n\t\t\t\t\t: contentSlot === 'catalog.card'\n\t\t\t\t\t\t? 'list'\n\t\t\t\t\t\t: 'unavailable';\n\t\tconst recipe: CatalogRecipe | undefined = view\n\t\t\t? {\n\t\t\t\t\tid: view.source.slot === 'catalog.card' ? 'list-to-carousel' : 'carousel-to-list',\n\t\t\t\t\tidentity: primary!.identity,\n\t\t\t\t\tsource: view.source.slot,\n\t\t\t\t\ttargetGeometry: view.source.slot === 'catalog.card' ? 'carousel.front' : 'catalog.card',\n\t\t\t\t\ttargetShared: view.source.slot === 'catalog.card' ? 'carousel.front' : 'catalog.card',\n\t\t\t\t\troles: ['summary-surface', 'eyebrow', 'title']\n\t\t\t\t}\n\t\t\t: selectCatalogRecipe(\n\t\t\t\t\tintent,\n\t\t\t\t\tcomposition,\n\t\t\t\t\treverse ? (contentSlot?.startsWith('carousel.') ? 'carousel' : 'list') : 'hero'\n\t\t\t\t);\n\t\tif (recipe && !reverse && contentSlot === 'carousel.neighbour') {\n\t\t\trecipe.source = contentSlot;\n\t\t\trecipe.roles = [];\n\t\t}\n\t\tif (!recipe || matchMedia('(prefers-reduced-motion: reduce)').matches) return;\n\t\tconst identity = recipe.identity;\n\t\tconst dock = recipe.source === 'detail.dock';\n\t\tconst source = { ...identity, slot: recipe.source };\n\t\tconst card = this.endpoints.resolve({\n\t\t\t...source,\n\t\t\trole: reverse ? 'summary-surface' : 'container'\n\t\t});\n\t\tif (\n\t\t\t!card ||\n\t\t\t!this.endpoints.resolve({\n\t\t\t\t...source,\n\t\t\t\tslot: reverse && !dock ? 'detail.hero' : source.slot,\n\t\t\t\trole: 'geometry'\n\t\t\t})\n\t\t)\n\t\t\treturn;\n\t\tif (reverse)\n\t\t\trecipe.roles = recipe.roles.filter((role) => {\n\t\t\t\tconst element = this.endpoints.resolve({ ...source, role });\n\t\t\t\t// During docking the hero remains the geometry source. Do not resurrect\n\t\t\t\t// already clipped summary pieces just to retain their semantic roles.\n\t\t\t\treturn (\n\t\t\t\t\telement &&\n\t\t\t\t\tvisiblyPresented(element) &&\n\t\t\t\t\t(composition !== 'intermediate' || fullyPresented(element))\n\t\t\t\t);\n\t\t\t});\n\t\trecipe.roles = recipe.roles.filter(\n\t\t\t(role) => !isRichRole(role) || this.endpoints.resolve({ ...source, role })\n\t\t);\n\t\tconst sources = recipe.roles.map((role) => this.endpoints.resolve({ ...source, role }));\n\t\tif (sources.some((element) => !element || !hasSize(element.getBoundingClientRect()))) return;\n\t\tif (!reverse && !(composition === 'carousel' ? visiblyPresented(card) : fullyPresented(card)))\n\t\t\treturn;\n\t\tif (reverse && sources.some((element) => element && !fullyPresented(element))) return;\n\n\t\ttry {\n\t\t\tconst endpoint = geometryEndpoint({\n\t\t\t\t...source,\n\t\t\t\tslot: reverse && !dock ? 'detail.hero' : source.slot\n\t\t\t});\n\t\t\tif (\n\t\t\t\tview\n\t\t\t\t\t? !this.hooks.captureContentGeometry?.(view.source, view.sources.slice(1))\n\t\t\t\t\t: !this.hooks.captureGeometry(endpoint)\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tconst token = this.sequence.begin();\n\t\t\tconst host = document.createElement('div');\n\t\t\thost.dataset.catalogTransitionActors = '';\n\t\t\thost.setAttribute('aria-hidden', 'true');\n\t\t\thost.inert = true;\n\t\t\t// The host must not form a stacking context: surface < GPU overlay < text.\n\t\t\thost.style.pointerEvents = 'none';\n\t\t\tconst capture: TransitionCapture = {\n\t\t\t\tview,\n\t\t\t\tcaptureShell: !reverse && (intent?.history || intent?.target === 'section'),\n\t\t\t\telapsed: 0,\n\t\t\t\ttoken,\n\t\t\t\tidentity,\n\t\t\t\trecipe,\n\t\t\t\thost,\n\t\t\t\tactors: [],\n\t\t\t\texiting: [],\n\t\t\t\trestore: [],\n\t\t\t\tframe: 0,\n\t\t\t\tinert: new Map(),\n\t\t\t\ttimeout: setTimeout(() => {\n\t\t\t\t\tif (this.captureState === capture) this.cancel();\n\t\t\t\t}, 5000)\n\t\t\t};\n\t\t\tthis.captureState = capture;\n\t\t\tcapture.lease = new PresentationLease(capture, () => this.cleanup());\n\t\t\tcapture.owner = capture.lease.claim();\n\t\t\tfor (let index = 0; index < recipe.roles.length; index++) {\n\t\t\t\tconst actor = this.createActor(identity, sources[index]!, recipe.roles[index], reverse);\n\t\t\t\tcapture.actors.push(actor);\n\t\t\t\thost.appendChild(actor.element);\n\t\t\t}\n\t\t\tif (capture.view && !capture.view.context.spatialElementId) {\n\t\t\t\tcapture.view.alternates = new Map();\n\t\t\t\tfor (const endpoint of capture.view.sources.slice(1)) {\n\t\t\t\t\tconst actors: TransitionActor[] = [];\n\t\t\t\t\tfor (const role of ['summary-surface', 'eyebrow', 'title'] as const) {\n\t\t\t\t\t\tconst element = this.endpoints.resolve({ ...endpoint, role });\n\t\t\t\t\t\tif (element && visiblyPresented(element))\n\t\t\t\t\t\t\tactors.push(this.createActor(endpoint, element, role, false));\n\t\t\t\t\t}\n\t\t\t\t\tcapture.view.alternates.set(endpoint.occurrence!, actors);\n\t\t\t\t}\n\t\t\t\tthis.endpoints.prefer(\n\t\t\t\t\tidentity.brandId,\n\t\t\t\t\tidentity.spatialElementId,\n\t\t\t\t\tcapture.view.source.occurrence!,\n\t\t\t\t\tcapture.view.source.slot as 'catalog.card' | 'carousel.front' | 'carousel.neighbour'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdocument.body.appendChild(host);\n\t\t\tif (reverse) {\n\t\t\t\tfor (const source of sources) {\n\t\t\t\t\tif (source === card) continue;\n\t\t\t\t\tpreserveStyle(source!, 'visibility', capture.restore);\n\t\t\t\t\tsource!.style.setProperty('visibility', 'hidden', 'important');\n\t\t\t\t}\n\t\t\t\tthis.captureExitingContent(capture);\n\t\t\t}\n\t\t\tpreserveStyle(card, 'visibility', capture.restore);\n\t\t\tcard.style.setProperty('visibility', 'hidden', 'important');\n\t\t\tif (!reverse) this.captureExitingContent(capture);\n\t\t\tthis.root.dataset.catalogDirection = reverse || view ? 'return' : 'forward';\n\t\t\tthis.setPresentation({ active: true, exitOpacity: 1, enterOpacity: 0, sharedOpacity: 0 });\n\t\t\tthis.root.dataset.catalogTransition = 'captured';\n\t\t\tthis.root.dataset.catalogRecipe = recipe.id;\n\t\t\tthis.root.dataset.catalogOwnershipRevision = String(capture.lease.revision);\n\t\t\tthis.lockParticipants(capture);\n\t\t\tcapture.observer = new MutationObserver(() => this.lockParticipants(capture));\n\t\t\tcapture.observer.observe(this.root, { childList: true, subtree: true });\n\t\t\twindow.addEventListener('resize', this.interrupt, { passive: true });\n\t\t\twindow.addEventListener('wheel', this.interrupt, { passive: true, capture: true });\n\t\t\twindow.addEventListener('touchmove', this.interrupt, { passive: true, capture: true });\n\t\t\twindow.addEventListener('keydown', this.keydown);\n\t\t} catch {\n\t\t\tthis.cancel();\n\t\t}\n\t}\n\n\t/** Keep only decorative outgoing DOM; Kit can mount and measure the real destination now. */\n\tprivate captureExitingContent(capture: TransitionCapture) {\n\t\tconst selector = isReturnRecipe(capture.recipe)\n\t\t\t? '[data-catalog-transition-dom=\"enter\"], [data-catalog-transition-group=\"enter\"], [data-catalog-secondary]'\n\t\t\t: `[data-catalog-transition-dom=\"exit\"]${capture.captureShell ? ', [data-catalog-shell]' : ''}`;\n\t\tfor (const source of this.root.querySelectorAll<HTMLElement>(selector)) {\n\t\t\tif (source.parentElement?.closest(selector)) continue;\n\t\t\tif (\n\t\t\t\tcapture.actors.some(\n\t\t\t\t\t(actor) =>\n\t\t\t\t\t\tactor.role ===\n\t\t\t\t\t\tsource.closest<HTMLElement>('[data-catalog-rich-shared]')?.dataset.catalogRichShared\n\t\t\t\t)\n\t\t\t)\n\t\t\t\tcontinue;\n\t\t\tconst rect = source.getBoundingClientRect();\n\t\t\tif (!hasSize(rect) || rect.bottom <= 0 || rect.top >= window.innerHeight) continue;\n\t\t\tif (!visiblyPresented(source)) continue;\n\t\t\tconst copy = source.cloneNode(true) as HTMLElement;\n\t\t\tconst style = getComputedStyle(source);\n\t\t\tconst originals = [source, ...source.querySelectorAll<HTMLElement | SVGElement>('*')];\n\t\t\tconst copies = [copy, ...copy.querySelectorAll<HTMLElement | SVGElement>('*')];\n\t\t\tfor (let index = 0; index < originals.length; index++) {\n\t\t\t\tconst computed = getComputedStyle(originals[index]);\n\t\t\t\tfor (const property of computed)\n\t\t\t\t\tcopies[index].style.setProperty(property, computed.getPropertyValue(property));\n\t\t\t}\n\t\t\tfor (const element of [copy, ...copy.querySelectorAll('*')]) {\n\t\t\t\telement.removeAttribute('id');\n\t\t\t\tfor (const attribute of [...element.attributes]) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tattribute.name.startsWith('data-') &&\n\t\t\t\t\t\tattribute.name !== 'data-catalog-model-ready' &&\n\t\t\t\t\t\tattribute.name !== 'data-catalog-poster' &&\n\t\t\t\t\t\t![\n\t\t\t\t\t\t\t'data-stage-panel-content',\n\t\t\t\t\t\t\t'data-stage-panel-css-surface',\n\t\t\t\t\t\t\t'data-stage-panel-render-mode',\n\t\t\t\t\t\t\t'data-stage-panel-surface'\n\t\t\t\t\t\t].includes(attribute.name)\n\t\t\t\t\t)\n\t\t\t\t\t\telement.removeAttribute(attribute.name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let index = 0; index < originals.length; index++) {\n\t\t\t\tconst original = originals[index];\n\t\t\t\tif (original.matches('[data-catalog-card], [data-carousel-spatial-element]'))\n\t\t\t\t\t(copies[index] as HTMLElement).dataset.catalogExitOccurrence = (\n\t\t\t\t\t\toriginal as HTMLElement\n\t\t\t\t\t).dataset.catalogOccurrence;\n\t\t\t}\n\t\t\tcopy.dataset.catalogExitCopy = '';\n\t\t\tcopy.dataset.catalogBaseOpacity = style.opacity;\n\t\t\tif (source.hasAttribute('data-catalog-shell')) copy.dataset.catalogShellCopy = '';\n\t\t\tcopy.setAttribute('aria-hidden', 'true');\n\t\t\tcopy.inert = true;\n\t\t\tObject.assign(copy.style, {\n\t\t\t\tposition: 'fixed',\n\t\t\t\tleft: `${rect.left}px`,\n\t\t\t\ttop: `${rect.top}px`,\n\t\t\t\twidth: `${rect.width}px`,\n\t\t\t\theight: `${rect.height}px`,\n\t\t\t\tmargin: '0',\n\t\t\t\ttransform: 'none',\n\t\t\t\tzIndex: source.hasAttribute('data-catalog-secondary') ? '22' : '2',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\ttransition: 'none',\n\t\t\t\tanimation: 'none',\n\t\t\t\twillChange: 'opacity'\n\t\t\t});\n\t\t\tconst projection = this.hooks.captureElement?.(source);\n\t\t\tif (projection) {\n\t\t\t\tconst corners = projection.corners.map((point) => ({\n\t\t\t\t\tx: point.x - rect.left,\n\t\t\t\t\ty: point.y - rect.top\n\t\t\t\t})) as unknown as CssProjectionQuad;\n\t\t\t\tObject.assign(copy.style, {\n\t\t\t\t\twidth: `${projection.width}px`,\n\t\t\t\t\theight: `${projection.height}px`,\n\t\t\t\t\ttransformOrigin: 'top left',\n\t\t\t\t\ttransform:\n\t\t\t\t\t\tgetProjectiveCssMatrix3d(corners, projection.width, projection.height) ?? 'none'\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.root.appendChild(copy);\n\t\t\tcapture.exiting.push(copy);\n\t\t\tconst panel = capture.actors.find((actor) => actor.role === 'summary-surface');\n\t\t\tif (panel && source.closest('[data-spatial-element-hero-panel-content]')) {\n\t\t\t\t(capture.panelContent ??= []).push({\n\t\t\t\t\telement: copy,\n\t\t\t\t\trect,\n\t\t\t\t\tpanel: panel.from,\n\t\t\t\t\tincoming: false\n\t\t\t\t});\n\t\t\t}\n\t\t\tpreserveStyle(source, 'visibility', capture.restore);\n\t\t\tsource.style.setProperty('visibility', 'hidden', 'important');\n\t\t}\n\t}\n\n\tprivate lockParticipants(capture: TransitionCapture) {\n\t\tif (!this.sequence.isCurrent(capture.token)) return;\n\t\tfor (const element of this.root.querySelectorAll<HTMLElement>(\n\t\t\t'[data-catalog-transition-dom], [data-catalog-transition-group]'\n\t\t)) {\n\t\t\tif (capture.inert.has(element)) continue;\n\t\t\tcapture.inert.set(element, element.inert);\n\t\t\telement.inert = true;\n\t\t}\n\t}\n\n\tprivate setPresentation(presentation: CatalogTransitionPresentation) {\n\t\tfor (const channel of ['enter', 'exit', 'shared'] as const) {\n\t\t\tconst value = presentation[`${channel}Opacity`];\n\t\t\tif (presentation.active) {\n\t\t\t\tthis.root.style.setProperty(`--catalog-${channel}-opacity`, String(value));\n\t\t\t} else this.root.style.removeProperty(`--catalog-${channel}-opacity`);\n\t\t\tthis.root.toggleAttribute(\n\t\t\t\t`data-catalog-${channel}-hidden`,\n\t\t\t\tpresentation.active && value === 0\n\t\t\t);\n\t\t}\n\t\tfor (const copy of this.captureState?.exiting ?? []) {\n\t\t\tcopy.style.opacity = String(\n\t\t\t\tcopy.hasAttribute('data-catalog-shell-copy') &&\n\t\t\t\t\tthis.captureState?.recipe.targetGeometry !== 'detail.dock'\n\t\t\t\t\t? 1\n\t\t\t\t\t: presentation.exitOpacity * Number(copy.dataset.catalogBaseOpacity ?? 1)\n\t\t\t);\n\t\t}\n\t\tthis.hooks.setPresentation(presentation);\n\t}\n\n\t/** Call only after destination registration and scroll restoration have completed. */\n\tasync play(): Promise<void> {\n\t\tconst capture = this.captureState;\n\t\tif (!capture || !this.sequence.start(capture.token)) return;\n\t\ttry {\n\t\t\tconst reverse = Boolean(capture.view) || isReturnRecipe(capture.recipe);\n\t\t\tif (capture.view) {\n\t\t\t\tconst pairs = planCatalogParticipants(\n\t\t\t\t\tcapture.view.sources,\n\t\t\t\t\tthis.contentEndpoints(capture.identity.brandId, false),\n\t\t\t\t\tcapture.view.context,\n\t\t\t\t\t5\n\t\t\t\t);\n\t\t\t\tcapture.view.pairs = pairs;\n\t\t\t\tconst pair = pairs[0];\n\t\t\t\tif (\n\t\t\t\t\t!pair ||\n\t\t\t\t\tpair.source.slot === pair.target.slot ||\n\t\t\t\t\t(pair.source.slot.startsWith('carousel.') && pair.target.slot.startsWith('carousel.'))\n\t\t\t\t) {\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (pair.identity.spatialElementId !== capture.identity.spatialElementId) {\n\t\t\t\t\tconst actors = capture.view.alternates?.get(pair.source.occurrence!);\n\t\t\t\t\tif (!actors || !this.hooks.promoteContentParticipant?.(pair.source)) {\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tfor (const actor of capture.actors) capture.exiting.push(actor.element);\n\t\t\t\t\tcapture.actors = actors;\n\t\t\t\t\tfor (const actor of actors) capture.host.appendChild(actor.element);\n\t\t\t\t\tfor (const element of capture.host.querySelectorAll<HTMLElement>(\n\t\t\t\t\t\t'[data-catalog-exit-occurrence]'\n\t\t\t\t\t))\n\t\t\t\t\t\tif (element.dataset.catalogExitOccurrence === pair.source.occurrence)\n\t\t\t\t\t\t\telement.style.opacity = '0';\n\t\t\t\t\tcapture.identity = pair.identity;\n\t\t\t\t\tcapture.recipe.identity = pair.identity;\n\t\t\t\t\tcapture.recipe.source = pair.source.slot;\n\t\t\t\t\tcapture.recipe.roles = actors.map((actor) => actor.role);\n\t\t\t\t\tcapture.view.source = pair.source;\n\t\t\t\t}\n\t\t\t\tthis.endpoints.prefer(\n\t\t\t\t\tpair.target.brandId,\n\t\t\t\t\tpair.target.spatialElementId,\n\t\t\t\t\tpair.target.occurrence!,\n\t\t\t\t\tpair.target.slot as 'catalog.card' | 'carousel.front' | 'carousel.neighbour'\n\t\t\t\t);\n\t\t\t\tcapture.recipe.targetGeometry = capture.recipe.targetShared = pair.target.slot;\n\t\t\t\tif (pair.target.slot === 'carousel.neighbour') {\n\t\t\t\t\tfor (const actor of capture.actors) capture.exiting.push(actor.element);\n\t\t\t\t\tcapture.actors = [];\n\t\t\t\t\tcapture.recipe.roles = [];\n\t\t\t\t}\n\t\t\t} else if (reverse) {\n\t\t\t\tconst slot = this.endpoints.getContentSlot(capture.identity);\n\t\t\t\tif (!slot) {\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcapture.recipe = {\n\t\t\t\t\t...capture.recipe,\n\t\t\t\t\tid: slot.startsWith('carousel.')\n\t\t\t\t\t\t? capture.recipe.source === 'detail.dock'\n\t\t\t\t\t\t\t? 'dock-to-carousel'\n\t\t\t\t\t\t\t: 'hero-to-carousel'\n\t\t\t\t\t\t: capture.recipe.source === 'detail.dock'\n\t\t\t\t\t\t\t? 'dock-to-list'\n\t\t\t\t\t\t\t: 'hero-to-list',\n\t\t\t\t\ttargetGeometry: slot,\n\t\t\t\t\ttargetShared: slot\n\t\t\t\t};\n\t\t\t\tif (slot === 'carousel.neighbour') {\n\t\t\t\t\tfor (const actor of capture.actors) {\n\t\t\t\t\t\tcapture.exiting.push(actor.element);\n\t\t\t\t\t\tactor.destinationCopy?.remove();\n\t\t\t\t\t}\n\t\t\t\t\tcapture.actors = [];\n\t\t\t\t\tcapture.recipe.roles = [];\n\t\t\t\t}\n\t\t\t\tthis.root.dataset.catalogRecipe = capture.recipe.id;\n\t\t\t} else {\n\t\t\t\tconst composition = this.endpoints.getComposition(capture.identity);\n\t\t\t\tif (composition !== 'hero' && composition !== 'intermediate' && composition !== 'dock') {\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcapture.recipe = {\n\t\t\t\t\t...capture.recipe,\n\t\t\t\t\tid:\n\t\t\t\t\t\tcomposition === 'dock'\n\t\t\t\t\t\t\t? capture.recipe.source.startsWith('carousel.')\n\t\t\t\t\t\t\t\t? 'carousel-to-dock'\n\t\t\t\t\t\t\t\t: 'list-to-dock'\n\t\t\t\t\t\t\t: capture.recipe.source.startsWith('carousel.')\n\t\t\t\t\t\t\t\t? 'carousel-to-hero'\n\t\t\t\t\t\t\t\t: 'list-to-hero',\n\t\t\t\t\ttargetGeometry: composition === 'dock' ? 'detail.dock' : 'detail.hero',\n\t\t\t\t\ttargetShared: composition === 'dock' ? 'detail.dock' : 'detail.summary'\n\t\t\t\t};\n\t\t\t\tthis.root.dataset.catalogRecipe = capture.recipe.id;\n\t\t\t}\n\t\t\tconst page = this.root.querySelector<HTMLElement>('[data-spatial-element-root]');\n\t\t\tif (\n\t\t\t\t(!reverse && page?.dataset.spatialElementId !== capture.identity.spatialElementId) ||\n\t\t\t\t!this.endpoints.resolve({\n\t\t\t\t\t...capture.identity,\n\t\t\t\t\tslot: capture.recipe.targetGeometry,\n\t\t\t\t\trole: 'geometry'\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\tthis.cancel();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tthis.hooks.prepareDestination?.({\n\t\t\t\t\tspatialElementId: capture.identity.spatialElementId,\n\t\t\t\t\tkind: reverse ? 'content' : capture.recipe.targetGeometry === 'detail.dock' ? 'dock' : 'hero'\n\t\t\t\t}) === false\n\t\t\t) {\n\t\t\t\tthis.cancel();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (capture.view) {\n\t\t\t\tconst prepared = this.hooks.prepareContentParticipants?.(capture.view.pairs ?? []) ?? [];\n\t\t\t\tfor (const pair of prepared) {\n\t\t\t\t\tconst geometry = this.endpoints.resolve({ ...pair.target, role: 'geometry' });\n\t\t\t\t\tif (!geometry) continue;\n\t\t\t\t\tpreserveStyle(geometry, 'visibility', capture.restore);\n\t\t\t\t\tgeometry.style.setProperty('visibility', 'hidden', 'important');\n\t\t\t\t}\n\t\t\t\t// Remove prepared target pixels before yielding to the first moving frame.\n\t\t\t\tthis.hooks.flushFrame();\n\t\t\t}\n\t\t\tif (reverse) {\n\t\t\t\tconst card = this.endpoints.resolve({\n\t\t\t\t\t...capture.identity,\n\t\t\t\t\tslot: capture.recipe.targetShared,\n\t\t\t\t\trole: 'container'\n\t\t\t\t});\n\t\t\t\tif (\n\t\t\t\t\t!card ||\n\t\t\t\t\t!(capture.recipe.targetShared.startsWith('carousel.')\n\t\t\t\t\t\t? intersectsViewport(card)\n\t\t\t\t\t\t: fullyPresented(card))\n\t\t\t\t) {\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (capture.actors.length) {\n\t\t\t\t\tpreserveStyle(card, 'visibility', capture.restore);\n\t\t\t\t\tcard.style.setProperty('visibility', 'hidden', 'important');\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst measuredTargets = new Map<HTMLElement, DOMRect>();\n\t\t\tconst sharedTargets = new Set<HTMLElement>();\n\t\t\tfor (const actor of capture.actors) {\n\t\t\t\tlet target = this.endpoints.resolve({\n\t\t\t\t\t...capture.identity,\n\t\t\t\t\tslot: capture.recipe.targetShared,\n\t\t\t\t\trole: actor.role\n\t\t\t\t});\n\t\t\t\tconst missingRich = !target && isRichRole(actor.role);\n\t\t\t\tif (missingRich) {\n\t\t\t\t\ttarget = this.endpoints.resolve({\n\t\t\t\t\t\t...capture.identity,\n\t\t\t\t\t\tslot: capture.recipe.targetShared,\n\t\t\t\t\t\trole: 'summary-surface'\n\t\t\t\t\t});\n\t\t\t\t\tactor.sourceOnly = true;\n\t\t\t\t}\n\t\t\t\tif (!target) {\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst bounds =\n\t\t\t\t\tactor.role === 'summary-surface' ? this.hooks.resolveSurface(target) : target;\n\t\t\t\tsharedTargets.add(target);\n\t\t\t\tconst targetRect = bounds.getBoundingClientRect();\n\t\t\t\tif (\n\t\t\t\t\tcapture.paused &&\n\t\t\t\t\tactor.to &&\n\t\t\t\t\t['x', 'y', 'width', 'height'].some(\n\t\t\t\t\t\t(key) =>\n\t\t\t\t\t\t\tMath.abs(\n\t\t\t\t\t\t\t\t(targetRect[key as keyof DOMRect] as number) -\n\t\t\t\t\t\t\t\t\t(actor.to![key as keyof DOMRect] as number)\n\t\t\t\t\t\t\t) > 0.5\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tactor.to = targetRect;\n\t\t\t\tif (missingRich) {\n\t\t\t\t\tconst panel = capture.actors.find((item) => item.role === 'summary-surface')!;\n\t\t\t\t\tconst sx = targetRect.width / panel.from.width,\n\t\t\t\t\t\tsy = targetRect.height / panel.from.height;\n\t\t\t\t\tactor.to = new DOMRect(\n\t\t\t\t\t\ttargetRect.left + (actor.from.left - panel.from.left) * sx,\n\t\t\t\t\t\ttargetRect.top + (actor.from.top - panel.from.top) * sy,\n\t\t\t\t\t\tactor.from.width * sx,\n\t\t\t\t\t\tactor.from.height * sy\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (isRichRole(actor.role))\n\t\t\t\t\tactor.element.dataset.catalogContentMatch =\n\t\t\t\t\t\tactor.semantic && actor.semantic === target.dataset.catalogSemantic\n\t\t\t\t\t\t\t? 'shared'\n\t\t\t\t\t\t\t: 'replaced';\n\t\t\t\tmeasuredTargets.set(bounds, targetRect);\n\t\t\t\tif (!hasSize(actor.to)) {\n\t\t\t\t\tthis.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tactor.fontScale =\n\t\t\t\t\tNumber.parseFloat(getComputedStyle(target).fontSize) / actor.fontSize || 1;\n\t\t\t\tif (!actor.sourceOnly && !actor.destinationCopy) {\n\t\t\t\t\t// Keep both text layouts fixed. Crossfade their typography instead of stretching\n\t\t\t\t\t// the source line width beyond the destination panel or recomputing layout every frame.\n\t\t\t\t\tconst copy = document.createElement('div');\n\t\t\t\t\tcopy.style.cssText = actor.element.style.cssText;\n\t\t\t\t\tif (actor.role !== 'summary-surface') {\n\t\t\t\t\t\tif (isRichRole(actor.role)) copyRichContent(copy, target);\n\t\t\t\t\t\telse copy.textContent = target.textContent;\n\t\t\t\t\t\tcopyTypography(copy, getComputedStyle(target));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst paint = this.hooks.captureSurface?.(target);\n\t\t\t\t\t\tconst style = getComputedStyle(\n\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\ttarget.closest('[data-carousel-spatial-element]') ? '::before' : null\n\t\t\t\t\t\t);\n\t\t\t\t\t\tObject.assign(copy.style, {\n\t\t\t\t\t\t\tbackground: paint?.background ?? style.backgroundColor,\n\t\t\t\t\t\t\tborder: paint?.border ?? style.border,\n\t\t\t\t\t\t\tborderRadius: paint?.borderRadius ?? style.borderRadius,\n\t\t\t\t\t\t\tboxShadow: paint?.boxShadow ?? style.boxShadow\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tcopy.style.width = `${actor.to.width}px`;\n\t\t\t\t\tcopy.style.height = `${actor.to.height}px`;\n\t\t\t\t\tcopy.style.opacity = '0';\n\t\t\t\t\tcopy.style.overflow = 'hidden';\n\t\t\t\t\tcopy.dataset.catalogActorRole = actor.role;\n\t\t\t\t\tcopy.dataset.catalogActorVariant = 'destination';\n\t\t\t\t\tcapture.host.appendChild(copy);\n\t\t\t\t\tactor.destinationCopy = copy;\n\t\t\t\t}\n\t\t\t\tif (actor.role === 'summary-surface') {\n\t\t\t\t\tcapture.content = target;\n\t\t\t\t\tif (!capture.panelContent?.some((entry) => entry.incoming)) {\n\t\t\t\t\t\tfor (const source of target.querySelectorAll<HTMLElement>('[data-catalog-secondary]')) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tcapture.actors.some(\n\t\t\t\t\t\t\t\t\t(actor) =>\n\t\t\t\t\t\t\t\t\t\tactor.role ===\n\t\t\t\t\t\t\t\t\t\tsource.closest<HTMLElement>('[data-catalog-rich-shared]')?.dataset\n\t\t\t\t\t\t\t\t\t\t\t.catalogRichShared\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tconst rect = source.getBoundingClientRect();\n\t\t\t\t\t\t\tconst copy = source.cloneNode(true) as HTMLElement;\n\t\t\t\t\t\t\tconst originals = [source, ...source.querySelectorAll<HTMLElement | SVGElement>('*')];\n\t\t\t\t\t\t\tconst copies = [copy, ...copy.querySelectorAll<HTMLElement | SVGElement>('*')];\n\t\t\t\t\t\t\tfor (let index = 0; index < originals.length; index++) {\n\t\t\t\t\t\t\t\tconst style = getComputedStyle(originals[index]);\n\t\t\t\t\t\t\t\tfor (const property of style)\n\t\t\t\t\t\t\t\t\tcopies[index].style.setProperty(property, style.getPropertyValue(property));\n\t\t\t\t\t\t\t\t// The live destination is deliberately masked during binding.\n\t\t\t\t\t\t\t\tcopies[index].style.visibility = 'visible';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (const element of [copy, ...copy.querySelectorAll('*')]) {\n\t\t\t\t\t\t\t\telement.removeAttribute('id');\n\t\t\t\t\t\t\t\tfor (const attribute of [...element.attributes])\n\t\t\t\t\t\t\t\t\tif (attribute.name.startsWith('data-')) element.removeAttribute(attribute.name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcopy.inert = true;\n\t\t\t\t\t\t\tcopy.setAttribute('aria-hidden', 'true');\n\t\t\t\t\t\t\tcopy.dataset.catalogPanelContent = '';\n\t\t\t\t\t\t\tObject.assign(copy.style, {\n\t\t\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\t\t\tleft: '0',\n\t\t\t\t\t\t\t\ttop: '0',\n\t\t\t\t\t\t\t\twidth: `${rect.width}px`,\n\t\t\t\t\t\t\t\theight: `${rect.height}px`,\n\t\t\t\t\t\t\t\tmargin: '0',\n\t\t\t\t\t\t\t\ttransformOrigin: 'top left',\n\t\t\t\t\t\t\t\topacity: '0',\n\t\t\t\t\t\t\t\tvisibility: 'visible',\n\t\t\t\t\t\t\t\tzIndex: '22',\n\t\t\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t\t\t\ttransition: 'none',\n\t\t\t\t\t\t\t\tanimation: 'none'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcapture.host.appendChild(copy);\n\t\t\t\t\t\t\t(capture.panelContent ??= []).push({\n\t\t\t\t\t\t\t\telement: copy,\n\t\t\t\t\t\t\t\trect,\n\t\t\t\t\t\t\t\tpanel: targetRect,\n\t\t\t\t\t\t\t\tincoming: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const target of sharedTargets) {\n\t\t\t\tpreserveStyle(target, 'visibility', capture.restore);\n\t\t\t\ttarget.style.setProperty('visibility', 'hidden', 'important');\n\t\t\t}\n\t\t\tconst content = capture.content;\n\t\t\tcapture.layoutObserver?.disconnect();\n\t\t\tcapture.layoutObserver = new ResizeObserver(() => {\n\t\t\t\tif (this.captureState !== capture || capture.paused) return;\n\t\t\t\tfor (const [element, rect] of measuredTargets) {\n\t\t\t\t\tconst current = element.getBoundingClientRect();\n\t\t\t\t\tif (\n\t\t\t\t\t\tMath.abs(current.width - rect.width) > 1 ||\n\t\t\t\t\t\tMath.abs(current.height - rect.height) > 1\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tfor (const element of measuredTargets.keys()) capture.layoutObserver.observe(element);\n\t\t\tif (\n\t\t\t\tdocument.activeElement instanceof HTMLElement &&\n\t\t\t\tcontent?.contains(document.activeElement)\n\t\t\t) {\n\t\t\t\tcapture.focus = document.activeElement;\n\t\t\t}\n\t\t\tthis.lockParticipants(capture);\n\t\t\tthis.root.dataset.catalogTransition = 'animating';\n\t\t\tif (matchMedia('(prefers-reduced-motion: reduce)').matches) {\n\t\t\t\tthis.hooks.setGeometryProgress(1);\n\t\t\t\tthis.settle(capture.token);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\tconst mode =\n\t\t\t\t\tcapture.mode ?? (reverse ? 'synchronous' : this.hooks.beginMotion?.()) ?? 'asynchronous';\n\t\t\t\tcapture.mode = mode;\n\t\t\t\tcapture.backgroundPrepared ??= !reverse && Boolean(this.hooks.backgroundPrepared?.());\n\t\t\t\tcapture.paused = false;\n\t\t\t\tconst owner = capture.owner!;\n\t\t\t\tcapture.resolve = resolve;\n\t\t\t\tlet previous = performance.now();\n\t\t\t\tlet elapsed = capture.elapsed;\n\t\t\t\tconst frame = (now: number) => {\n\t\t\t\t\tif (!owner.isCurrent() || capture.paused) return;\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// A shader compilation or slow frame must not skip the entire content reveal.\n\t\t\t\t\t\t// The existing wall-clock timeout still bounds prolonged or hidden-page work.\n\t\t\t\t\t\tconst nextElapsed = elapsed + Math.min(Math.max(now - previous, 0), 50);\n\t\t\t\t\t\t// Submit one complete destination-pose frame before background/High work.\n\t\t\t\t\t\telapsed = elapsed < DURATION ? Math.min(nextElapsed, DURATION) : nextElapsed;\n\t\t\t\t\t\tcapture.elapsed = elapsed;\n\t\t\t\t\t\tprevious = now;\n\t\t\t\t\t\tconst timing = transitionTiming(elapsed, mode, capture.backgroundPrepared);\n\t\t\t\t\t\tconst progress = timing.motion;\n\t\t\t\t\t\tconst enter = timing.enter;\n\t\t\t\t\t\t// Moving actors exclusively own shared surfaces/type until the final pose.\n\t\t\t\t\t\tfor (const actor of capture.actors) {\n\t\t\t\t\t\t\tconst target = actor.to!;\n\t\t\t\t\t\t\tconst scaleX =\n\t\t\t\t\t\t\t\tactor.role === 'summary-surface'\n\t\t\t\t\t\t\t\t\t? target.width / actor.from.width\n\t\t\t\t\t\t\t\t\t: actor.fontScale!;\n\t\t\t\t\t\t\tconst scaleY =\n\t\t\t\t\t\t\t\tactor.role === 'summary-surface'\n\t\t\t\t\t\t\t\t\t? target.height / actor.from.height\n\t\t\t\t\t\t\t\t\t: actor.fontScale!;\n\t\t\t\t\t\t\tconst x = (target.left - actor.from.left) * progress;\n\t\t\t\t\t\t\tconst y = (target.top - actor.from.top) * progress;\n\t\t\t\t\t\t\tconst currentScaleX = 1 + (scaleX - 1) * progress;\n\t\t\t\t\t\t\tactor.element.style.transform = `translate3d(${x}px, ${y}px, 0) scale(${currentScaleX}, ${1 + (scaleY - 1) * progress})`;\n\t\t\t\t\t\t\tlet projectedCorners: CssProjectionQuad | undefined;\n\t\t\t\t\t\t\tif (actor.corners) {\n\t\t\t\t\t\t\t\tconst ends = [\n\t\t\t\t\t\t\t\t\t{ x: target.left, y: target.top },\n\t\t\t\t\t\t\t\t\t{ x: target.right, y: target.top },\n\t\t\t\t\t\t\t\t\t{ x: target.right, y: target.bottom },\n\t\t\t\t\t\t\t\t\t{ x: target.left, y: target.bottom }\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\tconst corners = actor.corners.map((point, index) => ({\n\t\t\t\t\t\t\t\t\tx: point.x + (ends[index].x - point.x) * progress - actor.from.left,\n\t\t\t\t\t\t\t\t\ty: point.y + (ends[index].y - point.y) * progress - actor.from.top\n\t\t\t\t\t\t\t\t})) as unknown as CssProjectionQuad;\n\t\t\t\t\t\t\t\tprojectedCorners = corners;\n\t\t\t\t\t\t\t\tactor.element.style.transform =\n\t\t\t\t\t\t\t\t\tgetProjectiveCssMatrix3d(\n\t\t\t\t\t\t\t\t\t\tcorners,\n\t\t\t\t\t\t\t\t\t\tactor.layoutWidth ?? actor.from.width,\n\t\t\t\t\t\t\t\t\t\tactor.layoutHeight ?? actor.from.height\n\t\t\t\t\t\t\t\t\t) ?? actor.element.style.transform;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (actor.destinationCopy) {\n\t\t\t\t\t\t\t\tconst typography =\n\t\t\t\t\t\t\t\t\tactor.role === 'summary-surface'\n\t\t\t\t\t\t\t\t\t\t? transitionTiming(elapsed, 'synchronous').enter\n\t\t\t\t\t\t\t\t\t\t: Math.min(1, Math.max(0, (progress - 0.25) / 0.55));\n\t\t\t\t\t\t\t\tconst destinationScale =\n\t\t\t\t\t\t\t\t\t1 / actor.fontScale! + (1 - 1 / actor.fontScale!) * progress;\n\t\t\t\t\t\t\t\tconst availableWidth =\n\t\t\t\t\t\t\t\t\tactor.from.width + (target.width - actor.from.width) * progress;\n\t\t\t\t\t\t\t\tconst clippedWidth = Math.max(0, actor.from.width - availableWidth / currentScaleX);\n\t\t\t\t\t\t\t\tactor.element.style.clipPath = actor.corners\n\t\t\t\t\t\t\t\t\t? 'none'\n\t\t\t\t\t\t\t\t\t: `inset(0 ${clippedWidth}px 0 0)`;\n\t\t\t\t\t\t\t\tactor.element.style.opacity = String(1 - typography);\n\t\t\t\t\t\t\t\tactor.destinationCopy.style.transform =\n\t\t\t\t\t\t\t\t\tactor.role === 'summary-surface'\n\t\t\t\t\t\t\t\t\t\t? `translate3d(${x}px, ${y}px, 0) scale(${(actor.from.width + (target.width - actor.from.width) * progress) / target.width}, ${(actor.from.height + (target.height - actor.from.height) * progress) / target.height})`\n\t\t\t\t\t\t\t\t\t\t: `translate3d(${x}px, ${y}px, 0) scale(${destinationScale})`;\n\t\t\t\t\t\t\t\tactor.destinationCopy.style.opacity = String(typography);\n\t\t\t\t\t\t\t\tif (projectedCorners && actor.role === 'summary-surface') {\n\t\t\t\t\t\t\t\t\tactor.destinationCopy.style.transform =\n\t\t\t\t\t\t\t\t\t\tgetProjectiveCssMatrix3d(projectedCorners, target.width, target.height) ??\n\t\t\t\t\t\t\t\t\t\tactor.destinationCopy.style.transform;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\tactor.element.style.opacity = String(\n\t\t\t\t\t\t\t\t\t(actor.baseOpacity ?? 1) * (actor.sourceOnly ? 1 - progress : 1)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst panel = capture.actors.find((actor) => actor.role === 'summary-surface');\n\t\t\t\t\t\tif (panel?.to)\n\t\t\t\t\t\t\tfor (const copy of capture.panelContent ?? []) {\n\t\t\t\t\t\t\t\tconst width = panel.from.width + (panel.to.width - panel.from.width) * progress;\n\t\t\t\t\t\t\t\tconst height = panel.from.height + (panel.to.height - panel.from.height) * progress;\n\t\t\t\t\t\t\t\tconst sx = width / copy.panel.width,\n\t\t\t\t\t\t\t\t\tsy = height / copy.panel.height;\n\t\t\t\t\t\t\t\tconst x =\n\t\t\t\t\t\t\t\t\tpanel.from.left +\n\t\t\t\t\t\t\t\t\t(panel.to.left - panel.from.left) * progress +\n\t\t\t\t\t\t\t\t\t(copy.rect.left - copy.panel.left) * sx;\n\t\t\t\t\t\t\t\tconst y =\n\t\t\t\t\t\t\t\t\tpanel.from.top +\n\t\t\t\t\t\t\t\t\t(panel.to.top - panel.from.top) * progress +\n\t\t\t\t\t\t\t\t\t(copy.rect.top - copy.panel.top) * sy;\n\t\t\t\t\t\t\t\tcopy.element.style.left = '0';\n\t\t\t\t\t\t\t\tcopy.element.style.top = '0';\n\t\t\t\t\t\t\t\tcopy.element.style.transform = `translate3d(${x}px, ${y}px, 0) scale(${sx}, ${sy})`;\n\t\t\t\t\t\t\t\tif (copy.incoming) copy.element.style.opacity = String(enter);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.setPresentation({\n\t\t\t\t\t\t\tactive: true,\n\t\t\t\t\t\t\texitOpacity: timing.exit,\n\t\t\t\t\t\t\tenterOpacity: enter,\n\t\t\t\t\t\t\tsharedOpacity: 0,\n\t\t\t\t\t\t\tbackgroundOpacity: timing.background,\n\t\t\t\t\t\t\tgeometryOpacity: timing.geometry\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.hooks.setGeometryProgress(progress);\n\t\t\t\t\t\tthis.hooks.flushFrame();\n\t\t\t\t\t\tif (timing.complete || matchMedia('(prefers-reduced-motion: reduce)').matches)\n\t\t\t\t\t\t\tthis.settle(capture.token);\n\t\t\t\t\t\telse capture.frame = requestAnimationFrame(frame);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tcapture.frame = requestAnimationFrame(frame);\n\t\t\t});\n\t\t} catch {\n\t\t\tthis.cancel();\n\t\t}\n\t}\n\n\tcancel() {\n\t\tthis.sequence.cancel();\n\t\tthis.captureState?.owner?.release();\n\t}\n\n\tdispose() {\n\t\tthis.cancel();\n\t}\n\n\tprivate settle(token: number) {\n\t\tif (this.sequence.finish(token)) this.captureState?.owner?.release();\n\t}\n\n\tprivate cleanup() {\n\t\tconst capture = this.captureState;\n\t\tthis.captureState = undefined;\n\t\tdelete this.root.dataset.catalogTransition;\n\t\tdelete this.root.dataset.catalogRecipe;\n\t\tdelete this.root.dataset.catalogOwnershipRevision;\n\t\tdelete this.root.dataset.catalogDirection;\n\t\twindow.removeEventListener('resize', this.interrupt);\n\t\twindow.removeEventListener('wheel', this.interrupt, true);\n\t\twindow.removeEventListener('touchmove', this.interrupt, true);\n\t\twindow.removeEventListener('keydown', this.keydown);\n\t\tif (!capture) return;\n\t\tcapture.observer?.disconnect();\n\t\tcapture.layoutObserver?.disconnect();\n\t\tcancelAnimationFrame(capture.frame);\n\t\tclearTimeout(capture.timeout);\n\t\tcapture.host.remove();\n\t\tfor (const copy of capture.exiting) copy.remove();\n\t\tfor (const restore of capture.restore.reverse()) restore();\n\t\tfor (const [element, inert] of capture.inert) {\n\t\t\t// Docking can change during route scroll restoration after this lock was acquired.\n\t\t\t// Preserve the controller's current semantic state instead of reviving a stale lock snapshot.\n\t\t\tconst dock = element.matches('[data-spatial-element-sticky-header], [data-spatial-element-sticky-tabs]');\n\t\t\telement.inert = dock ? element.getAttribute('aria-hidden') === 'true' : inert;\n\t\t}\n\t\tif (\n\t\t\tcapture.focus?.isConnected &&\n\t\t\t(document.activeElement === document.body ||\n\t\t\t\tcapture.content?.contains(document.activeElement))\n\t\t)\n\t\t\tcapture.focus.focus({ preventScroll: true });\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tthis.setPresentation({ active: false, enterOpacity: 1, exitOpacity: 1, sharedOpacity: 1 });\n\t\t\t} finally {\n\t\t\t\tthis.hooks.finishGeometry();\n\t\t\t\tthis.hooks.flushFrame();\n\t\t\t}\n\t\t} catch {\n\t\t\t// A renderer failure cannot prevent DOM restoration or completion of navigation.\n\t\t} finally {\n\t\t\tcapture.resolve?.();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
import type { PreparationGate } from './PreparationGate.js';
|
|
3
|
+
export interface PreparedEnvironment {
|
|
4
|
+
url: string;
|
|
5
|
+
source: THREE.DataTexture;
|
|
6
|
+
target: THREE.RenderTarget;
|
|
7
|
+
}
|
|
8
|
+
/** Renderer-owned HDR cache. References pin environments used by live or speculative elements. */
|
|
9
|
+
export declare class EnvironmentCache {
|
|
10
|
+
private renderer;
|
|
11
|
+
private gate;
|
|
12
|
+
getRenderTargets(): THREE.RenderTarget<THREE.Texture<unknown, THREE.TextureEventMap>, THREE.RenderTargetEventMap>[];
|
|
13
|
+
private entries;
|
|
14
|
+
constructor(renderer: THREE.WebGPURenderer, gate: PreparationGate);
|
|
15
|
+
acquire(url: string): {
|
|
16
|
+
ready: Promise<PreparedEnvironment>;
|
|
17
|
+
readonly value: PreparedEnvironment | undefined;
|
|
18
|
+
release: () => void;
|
|
19
|
+
};
|
|
20
|
+
/** Pin the precise texture already used by a moving representation; never start new work. */
|
|
21
|
+
pinTexture(texture: THREE.Texture | null | undefined): {
|
|
22
|
+
ready: Promise<PreparedEnvironment>;
|
|
23
|
+
readonly value: PreparedEnvironment | undefined;
|
|
24
|
+
release: () => void;
|
|
25
|
+
} | undefined;
|
|
26
|
+
private load;
|
|
27
|
+
private disposeEntry;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=EnvironmentCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvironmentCache.d.ts","sourceRoot":"","sources":["../../src/catalog/EnvironmentCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,mBAAmB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC;IAC1B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;CAC3B;AAQD,kGAAkG;AAClG,qBAAa,gBAAgB;IAM3B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,IAAI;IANb,gBAAgB;IAGhB,OAAO,CAAC,OAAO,CAA4B;gBAElC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,IAAI,EAAE,eAAe;IAE9B,OAAO,CAAC,GAAG,EAAE,MAAM;;;;;IAuCnB,6FAA6F;IAC7F,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;YAItC,IAAI;IAmDlB,OAAO,CAAC,YAAY;IAcpB,OAAO;CAIP"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
|
|
3
|
+
/** Renderer-owned HDR cache. References pin environments used by live or speculative elements. */
|
|
4
|
+
export class EnvironmentCache {
|
|
5
|
+
renderer;
|
|
6
|
+
gate;
|
|
7
|
+
getRenderTargets() {
|
|
8
|
+
return [...this.entries.values()].flatMap((entry) => (entry.value ? [entry.value.target] : []));
|
|
9
|
+
}
|
|
10
|
+
entries = new Map();
|
|
11
|
+
constructor(renderer, gate) {
|
|
12
|
+
this.renderer = renderer;
|
|
13
|
+
this.gate = gate;
|
|
14
|
+
}
|
|
15
|
+
acquire(url) {
|
|
16
|
+
let entry = this.entries.get(url);
|
|
17
|
+
if (!entry) {
|
|
18
|
+
const controller = new AbortController();
|
|
19
|
+
entry = { controller, refs: 0, promise: undefined };
|
|
20
|
+
const owned = entry;
|
|
21
|
+
entry.promise = this.load(url, controller.signal).then((value) => {
|
|
22
|
+
owned.value = value;
|
|
23
|
+
return value;
|
|
24
|
+
});
|
|
25
|
+
void entry.promise.catch(() => {
|
|
26
|
+
if (this.entries.get(url) === owned)
|
|
27
|
+
this.entries.delete(url);
|
|
28
|
+
});
|
|
29
|
+
this.entries.set(url, entry);
|
|
30
|
+
}
|
|
31
|
+
entry.refs++;
|
|
32
|
+
let released = false;
|
|
33
|
+
return {
|
|
34
|
+
ready: entry.promise,
|
|
35
|
+
get value() {
|
|
36
|
+
return entry.value;
|
|
37
|
+
},
|
|
38
|
+
release: () => {
|
|
39
|
+
if (released)
|
|
40
|
+
return;
|
|
41
|
+
released = true;
|
|
42
|
+
entry.refs--;
|
|
43
|
+
if (!entry.refs && !entry.value) {
|
|
44
|
+
entry.controller.abort();
|
|
45
|
+
if (this.entries.get(url) === entry)
|
|
46
|
+
this.entries.delete(url);
|
|
47
|
+
}
|
|
48
|
+
const idle = [...this.entries].filter(([, item]) => !item.refs);
|
|
49
|
+
for (const [key, item] of idle.slice(0, Math.max(0, idle.length - 1))) {
|
|
50
|
+
this.entries.delete(key);
|
|
51
|
+
this.disposeEntry(item);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Pin the precise texture already used by a moving representation; never start new work. */
|
|
57
|
+
pinTexture(texture) {
|
|
58
|
+
const entry = [...this.entries].find(([, value]) => value.value?.target.texture === texture);
|
|
59
|
+
return entry ? this.acquire(entry[0]) : undefined;
|
|
60
|
+
}
|
|
61
|
+
async load(url, signal) {
|
|
62
|
+
const response = await fetch(url, { signal });
|
|
63
|
+
if (!response.ok)
|
|
64
|
+
throw new Error(`Unable to load environment (${response.status})`);
|
|
65
|
+
const bytes = await response.arrayBuffer();
|
|
66
|
+
return this.gate.run(async () => {
|
|
67
|
+
const parsed = new HDRLoader().setDataType(THREE.HalfFloatType).parse(bytes);
|
|
68
|
+
const source = new THREE.DataTexture(parsed.data, parsed.width, parsed.height, THREE.RGBAFormat, THREE.HalfFloatType);
|
|
69
|
+
source.mapping = THREE.EquirectangularReflectionMapping;
|
|
70
|
+
source.colorSpace = THREE.LinearSRGBColorSpace;
|
|
71
|
+
source.minFilter = source.magFilter = THREE.LinearFilter;
|
|
72
|
+
source.generateMipmaps = false;
|
|
73
|
+
source.flipY = true;
|
|
74
|
+
source.needsUpdate = true;
|
|
75
|
+
const generator = new THREE.PMREMGenerator(this.renderer);
|
|
76
|
+
let target;
|
|
77
|
+
try {
|
|
78
|
+
target = generator.fromEquirectangular(source);
|
|
79
|
+
const destination = this.renderer.getRenderTarget();
|
|
80
|
+
const probe = new THREE.RenderTarget(16, 16, { type: THREE.HalfFloatType, samples: 4 });
|
|
81
|
+
const scene = new THREE.Scene();
|
|
82
|
+
const camera = new THREE.PerspectiveCamera();
|
|
83
|
+
try {
|
|
84
|
+
this.renderer.setRenderTarget(probe);
|
|
85
|
+
for (const background of [source, target.texture]) {
|
|
86
|
+
scene.background = background;
|
|
87
|
+
scene.backgroundBlurriness = background === source ? 0 : 0.2;
|
|
88
|
+
this.renderer.render(scene, camera);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
this.renderer.setRenderTarget(destination);
|
|
93
|
+
probe.dispose();
|
|
94
|
+
}
|
|
95
|
+
const device = this.renderer.backend.device;
|
|
96
|
+
await device?.queue.onSubmittedWorkDone();
|
|
97
|
+
signal.throwIfAborted();
|
|
98
|
+
return { url, source, target };
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
target?.dispose();
|
|
102
|
+
source.dispose();
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
generator.dispose();
|
|
107
|
+
}
|
|
108
|
+
}, signal);
|
|
109
|
+
}
|
|
110
|
+
disposeEntry(entry) {
|
|
111
|
+
entry.controller.abort();
|
|
112
|
+
if (entry.value) {
|
|
113
|
+
entry.value.target.dispose();
|
|
114
|
+
entry.value.source.dispose();
|
|
115
|
+
}
|
|
116
|
+
else
|
|
117
|
+
void entry.promise.then((value) => {
|
|
118
|
+
value.target.dispose();
|
|
119
|
+
value.source.dispose();
|
|
120
|
+
}, () => { });
|
|
121
|
+
}
|
|
122
|
+
dispose() {
|
|
123
|
+
for (const entry of this.entries.values())
|
|
124
|
+
this.disposeEntry(entry);
|
|
125
|
+
this.entries.clear();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=EnvironmentCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvironmentCache.js","sourceRoot":"","sources":["../../src/catalog/EnvironmentCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAe9D,kGAAkG;AAClG,MAAM,OAAO,gBAAgB;IAMnB;IACA;IANT,gBAAgB;QACf,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjG,CAAC;IACO,OAAO,GAAG,IAAI,GAAG,EAAiB,CAAC;IAC3C,YACS,QAA8B,EAC9B,IAAqB;QADrB,aAAQ,GAAR,QAAQ,CAAsB;QAC9B,SAAI,GAAJ,IAAI,CAAiB;IAC3B,CAAC;IACJ,OAAO,CAAC,GAAW;QAClB,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;YACzC,KAAK,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,SAAU,EAAE,CAAC;YACrD,MAAM,KAAK,GAAG,KAAK,CAAC;YACpB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK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AAC;IACD,OAAO;QACN,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACpE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACD","sourcesContent":["import * as THREE from 'three/webgpu';\nimport { HDRLoader } from 'three/addons/loaders/HDRLoader.js';\nimport type { PreparationGate } from './PreparationGate.js';\n\nexport interface PreparedEnvironment {\n\turl: string;\n\tsource: THREE.DataTexture;\n\ttarget: THREE.RenderTarget;\n}\ninterface Entry {\n\tcontroller: AbortController;\n\trefs: number;\n\tvalue?: PreparedEnvironment;\n\tpromise: Promise<PreparedEnvironment>;\n}\n\n/** Renderer-owned HDR cache. References pin environments used by live or speculative elements. */\nexport class EnvironmentCache {\n\tgetRenderTargets() {\n\t\treturn [...this.entries.values()].flatMap((entry) => (entry.value ? [entry.value.target] : []));\n\t}\n\tprivate entries = new Map<string, Entry>();\n\tconstructor(\n\t\tprivate renderer: THREE.WebGPURenderer,\n\t\tprivate gate: PreparationGate\n\t) {}\n\tacquire(url: string) {\n\t\tlet entry = this.entries.get(url);\n\t\tif (!entry) {\n\t\t\tconst controller = new AbortController();\n\t\t\tentry = { controller, refs: 0, promise: undefined! };\n\t\t\tconst owned = entry;\n\t\t\tentry.promise = this.load(url, controller.signal).then((value) => {\n\t\t\t\towned.value = value;\n\t\t\t\treturn value;\n\t\t\t});\n\t\t\tvoid entry.promise.catch(() => {\n\t\t\t\tif (this.entries.get(url) === owned) this.entries.delete(url);\n\t\t\t});\n\t\t\tthis.entries.set(url, entry);\n\t\t}\n\t\tentry.refs++;\n\t\tlet released = false;\n\t\treturn {\n\t\t\tready: entry.promise,\n\t\t\tget value() {\n\t\t\t\treturn entry.value;\n\t\t\t},\n\t\t\trelease: () => {\n\t\t\t\tif (released) return;\n\t\t\t\treleased = true;\n\t\t\t\tentry.refs--;\n\t\t\t\tif (!entry.refs && !entry.value) {\n\t\t\t\t\tentry.controller.abort();\n\t\t\t\t\tif (this.entries.get(url) === entry) this.entries.delete(url);\n\t\t\t\t}\n\t\t\t\tconst idle = [...this.entries].filter(([, item]) => !item.refs);\n\t\t\t\tfor (const [key, item] of idle.slice(0, Math.max(0, idle.length - 1))) {\n\t\t\t\t\tthis.entries.delete(key);\n\t\t\t\t\tthis.disposeEntry(item);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t/** Pin the precise texture already used by a moving representation; never start new work. */\n\tpinTexture(texture: THREE.Texture | null | undefined) {\n\t\tconst entry = [...this.entries].find(([, value]) => value.value?.target.texture === texture);\n\t\treturn entry ? this.acquire(entry[0]) : undefined;\n\t}\n\tprivate async load(url: string, signal: AbortSignal): Promise<PreparedEnvironment> {\n\t\tconst response = await fetch(url, { signal });\n\t\tif (!response.ok) throw new Error(`Unable to load environment (${response.status})`);\n\t\tconst bytes = await response.arrayBuffer();\n\t\treturn this.gate.run(async () => {\n\t\t\tconst parsed = new HDRLoader().setDataType(THREE.HalfFloatType).parse(bytes);\n\t\t\tconst source = new THREE.DataTexture(\n\t\t\t\tparsed.data,\n\t\t\t\tparsed.width,\n\t\t\t\tparsed.height,\n\t\t\t\tTHREE.RGBAFormat,\n\t\t\t\tTHREE.HalfFloatType\n\t\t\t);\n\t\t\tsource.mapping = THREE.EquirectangularReflectionMapping;\n\t\t\tsource.colorSpace = THREE.LinearSRGBColorSpace;\n\t\t\tsource.minFilter = source.magFilter = THREE.LinearFilter;\n\t\t\tsource.generateMipmaps = false;\n\t\t\tsource.flipY = true;\n\t\t\tsource.needsUpdate = true;\n\t\t\tconst generator = new THREE.PMREMGenerator(this.renderer);\n\t\t\tlet target: THREE.RenderTarget | undefined;\n\t\t\ttry {\n\t\t\t\ttarget = generator.fromEquirectangular(source);\n\t\t\t\tconst destination = this.renderer.getRenderTarget();\n\t\t\t\tconst probe = new THREE.RenderTarget(16, 16, { type: THREE.HalfFloatType, samples: 4 });\n\t\t\t\tconst scene = new THREE.Scene();\n\t\t\t\tconst camera = new THREE.PerspectiveCamera();\n\t\t\t\ttry {\n\t\t\t\t\tthis.renderer.setRenderTarget(probe);\n\t\t\t\t\tfor (const background of [source, target.texture]) {\n\t\t\t\t\t\tscene.background = background;\n\t\t\t\t\t\tscene.backgroundBlurriness = background === source ? 0 : 0.2;\n\t\t\t\t\t\tthis.renderer.render(scene, camera);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tthis.renderer.setRenderTarget(destination);\n\t\t\t\t\tprobe.dispose();\n\t\t\t\t}\n\t\t\t\tconst device = (this.renderer.backend as unknown as { device?: GPUDevice }).device;\n\t\t\t\tawait device?.queue.onSubmittedWorkDone();\n\t\t\t\tsignal.throwIfAborted();\n\t\t\t\treturn { url, source, target };\n\t\t\t} catch (error) {\n\t\t\t\ttarget?.dispose();\n\t\t\t\tsource.dispose();\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tgenerator.dispose();\n\t\t\t}\n\t\t}, signal);\n\t}\n\tprivate disposeEntry(entry: Entry) {\n\t\tentry.controller.abort();\n\t\tif (entry.value) {\n\t\t\tentry.value.target.dispose();\n\t\t\tentry.value.source.dispose();\n\t\t} else\n\t\t\tvoid entry.promise.then(\n\t\t\t\t(value) => {\n\t\t\t\t\tvalue.target.dispose();\n\t\t\t\t\tvalue.source.dispose();\n\t\t\t\t},\n\t\t\t\t() => {}\n\t\t\t);\n\t}\n\tdispose() {\n\t\tfor (const entry of this.entries.values()) this.disposeEntry(entry);\n\t\tthis.entries.clear();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Network work may continue while expensive decode/build/upload work is paused. */
|
|
2
|
+
export declare class PreparationGate {
|
|
3
|
+
private paused;
|
|
4
|
+
private waiters;
|
|
5
|
+
setPaused(paused: boolean): void;
|
|
6
|
+
wait(signal?: AbortSignal): Promise<void>;
|
|
7
|
+
/** Check the gate and invoke work atomically; an awaited permission alone has a microtask race. */
|
|
8
|
+
run<T>(work: () => T | Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=PreparationGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreparationGate.d.ts","sourceRoot":"","sources":["../../src/catalog/PreparationGate.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,qBAAa,eAAe;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAyB;IACxC,SAAS,CAAC,MAAM,EAAE,OAAO;IAInB,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW;IAsB/B,mGAAmG;IACnG,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;CA8BpE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** Network work may continue while expensive decode/build/upload work is paused. */
|
|
2
|
+
export class PreparationGate {
|
|
3
|
+
paused = false;
|
|
4
|
+
waiters = new Set();
|
|
5
|
+
setPaused(paused) {
|
|
6
|
+
this.paused = paused;
|
|
7
|
+
if (!paused)
|
|
8
|
+
for (const wake of [...this.waiters])
|
|
9
|
+
wake();
|
|
10
|
+
}
|
|
11
|
+
async wait(signal) {
|
|
12
|
+
signal?.throwIfAborted();
|
|
13
|
+
while (this.paused) {
|
|
14
|
+
await new Promise((resolve, reject) => {
|
|
15
|
+
const cleanup = () => {
|
|
16
|
+
this.waiters.delete(wake);
|
|
17
|
+
signal?.removeEventListener('abort', abort);
|
|
18
|
+
};
|
|
19
|
+
const wake = () => {
|
|
20
|
+
cleanup();
|
|
21
|
+
resolve();
|
|
22
|
+
};
|
|
23
|
+
const abort = () => {
|
|
24
|
+
cleanup();
|
|
25
|
+
reject(signal?.reason);
|
|
26
|
+
};
|
|
27
|
+
this.waiters.add(wake);
|
|
28
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
29
|
+
});
|
|
30
|
+
signal?.throwIfAborted();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Check the gate and invoke work atomically; an awaited permission alone has a microtask race. */
|
|
34
|
+
run(work, signal) {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
const cleanup = () => {
|
|
37
|
+
this.waiters.delete(start);
|
|
38
|
+
signal?.removeEventListener('abort', abort);
|
|
39
|
+
};
|
|
40
|
+
const abort = () => {
|
|
41
|
+
cleanup();
|
|
42
|
+
reject(signal?.reason);
|
|
43
|
+
};
|
|
44
|
+
const start = () => {
|
|
45
|
+
if (signal?.aborted) {
|
|
46
|
+
abort();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (this.paused) {
|
|
50
|
+
this.waiters.add(start);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
cleanup();
|
|
54
|
+
try {
|
|
55
|
+
resolve(work());
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
reject(error);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
62
|
+
start();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=PreparationGate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreparationGate.js","sourceRoot":"","sources":["../../src/catalog/PreparationGate.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,OAAO,eAAe;IACnB,MAAM,GAAG,KAAK,CAAC;IACf,OAAO,GAAG,IAAI,GAAG,EAAc,CAAC;IACxC,SAAS,CAAC,MAAe;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM;YAAE,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;gBAAE,IAAI,EAA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AAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACxB,CAAC,CAAC;YACF,MAAM,KAAK,GAAG,GAAG,EAAE;gBAClB,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;oBACrB,KAAK,EAAE,CAAC;oBACR,OAAO;gBACR,CAAC;gBACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;oBACjB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;oBACxB,OAAO;gBACR,CAAC;gBACD,OAAO,EAAE,CAAC;gBACV,IAAI,CAAC;oBACJ,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;gBACjB,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBAChB,MAAM,CAAC,KAAK,CAAC,CAAC;gBACf,CAAC;YACF,CAAC,CAAC;YACF,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YACzD,KAAK,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["/** Network work may continue while expensive decode/build/upload work is paused. */\nexport class PreparationGate {\n\tprivate paused = false;\n\tprivate waiters = new Set<() => void>();\n\tsetPaused(paused: boolean) {\n\t\tthis.paused = paused;\n\t\tif (!paused) for (const wake of [...this.waiters]) wake();\n\t}\n\tasync wait(signal?: AbortSignal) {\n\t\tsignal?.throwIfAborted();\n\t\twhile (this.paused) {\n\t\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\t\tconst cleanup = () => {\n\t\t\t\t\tthis.waiters.delete(wake);\n\t\t\t\t\tsignal?.removeEventListener('abort', abort);\n\t\t\t\t};\n\t\t\t\tconst wake = () => {\n\t\t\t\t\tcleanup();\n\t\t\t\t\tresolve();\n\t\t\t\t};\n\t\t\t\tconst abort = () => {\n\t\t\t\t\tcleanup();\n\t\t\t\t\treject(signal?.reason);\n\t\t\t\t};\n\t\t\t\tthis.waiters.add(wake);\n\t\t\t\tsignal?.addEventListener('abort', abort, { once: true });\n\t\t\t});\n\t\t\tsignal?.throwIfAborted();\n\t\t}\n\t}\n\t/** Check the gate and invoke work atomically; an awaited permission alone has a microtask race. */\n\trun<T>(work: () => T | Promise<T>, signal?: AbortSignal): Promise<T> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst cleanup = () => {\n\t\t\t\tthis.waiters.delete(start);\n\t\t\t\tsignal?.removeEventListener('abort', abort);\n\t\t\t};\n\t\t\tconst abort = () => {\n\t\t\t\tcleanup();\n\t\t\t\treject(signal?.reason);\n\t\t\t};\n\t\t\tconst start = () => {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tabort();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this.paused) {\n\t\t\t\t\tthis.waiters.add(start);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcleanup();\n\t\t\t\ttry {\n\t\t\t\t\tresolve(work());\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t};\n\t\t\tsignal?.addEventListener('abort', abort, { once: true });\n\t\t\tstart();\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** One resource owner at a time; transfer invalidates all earlier release callbacks. */
|
|
2
|
+
export declare class PresentationLease<T> {
|
|
3
|
+
readonly value: T;
|
|
4
|
+
private readonly dispose;
|
|
5
|
+
private owner;
|
|
6
|
+
private released;
|
|
7
|
+
private transfers;
|
|
8
|
+
constructor(value: T, dispose: (value: T) => void);
|
|
9
|
+
claim(): {
|
|
10
|
+
value: T;
|
|
11
|
+
isCurrent: () => boolean;
|
|
12
|
+
release: () => boolean;
|
|
13
|
+
};
|
|
14
|
+
get revision(): number;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=PresentationLease.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresentationLease.d.ts","sourceRoot":"","sources":["../../src/catalog/PresentationLease.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,qBAAa,iBAAiB,CAAC,CAAC;IAK9B,QAAQ,CAAC,KAAK,EAAE,CAAC;IACjB,OAAO,CAAC,QAAQ,CAAC,OAAO;IALzB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAK;gBAEZ,KAAK,EAAE,CAAC,EACA,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI;IAG7C,KAAK;;;;;IAgBL,IAAI,QAAQ,WAEX;CACD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** One resource owner at a time; transfer invalidates all earlier release callbacks. */
|
|
2
|
+
export class PresentationLease {
|
|
3
|
+
value;
|
|
4
|
+
dispose;
|
|
5
|
+
owner = {};
|
|
6
|
+
released = false;
|
|
7
|
+
transfers = 0;
|
|
8
|
+
constructor(value, dispose) {
|
|
9
|
+
this.value = value;
|
|
10
|
+
this.dispose = dispose;
|
|
11
|
+
}
|
|
12
|
+
claim() {
|
|
13
|
+
if (this.released)
|
|
14
|
+
throw new Error('Cannot adopt a released presentation');
|
|
15
|
+
const owner = (this.owner = {});
|
|
16
|
+
this.transfers++;
|
|
17
|
+
return {
|
|
18
|
+
value: this.value,
|
|
19
|
+
isCurrent: () => !this.released && this.owner === owner,
|
|
20
|
+
release: () => {
|
|
21
|
+
if (this.released || this.owner !== owner)
|
|
22
|
+
return false;
|
|
23
|
+
this.released = true;
|
|
24
|
+
this.dispose(this.value);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
get revision() {
|
|
30
|
+
return this.transfers;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=PresentationLease.js.map
|