@spatial-elements/core 1.0.0-beta.3 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/catalog/CatalogSpatialElementLayer.d.ts +1 -0
  2. package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
  3. package/dist/catalog/CatalogSpatialElementLayer.js +13 -1
  4. package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
  5. package/dist/catalog/carouselMotion.d.ts +39 -0
  6. package/dist/catalog/carouselMotion.d.ts.map +1 -0
  7. package/dist/catalog/carouselMotion.js +104 -0
  8. package/dist/catalog/carouselMotion.js.map +1 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/spatial-element/messages.d.ts +32 -0
  14. package/dist/spatial-element/messages.d.ts.map +1 -0
  15. package/dist/spatial-element/messages.js +34 -0
  16. package/dist/spatial-element/messages.js.map +1 -0
  17. package/dist/stage/LiquidGlassPanel.d.ts +2 -0
  18. package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
  19. package/dist/stage/LiquidGlassPanel.js +11 -2
  20. package/dist/stage/LiquidGlassPanel.js.map +1 -1
  21. package/dist/stage/ModelPointerPreview.d.ts +22 -0
  22. package/dist/stage/ModelPointerPreview.d.ts.map +1 -0
  23. package/dist/stage/ModelPointerPreview.js +71 -0
  24. package/dist/stage/ModelPointerPreview.js.map +1 -0
  25. package/dist/stage/PageBindingController.d.ts.map +1 -1
  26. package/dist/stage/PageBindingController.js +3 -1
  27. package/dist/stage/PageBindingController.js.map +1 -1
  28. package/dist/stage/PanelPresentationController.d.ts +3 -1
  29. package/dist/stage/PanelPresentationController.d.ts.map +1 -1
  30. package/dist/stage/PanelPresentationController.js +64 -9
  31. package/dist/stage/PanelPresentationController.js.map +1 -1
  32. package/dist/stage/SpatialElementInteractionController.d.ts +10 -0
  33. package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
  34. package/dist/stage/SpatialElementInteractionController.js +104 -8
  35. package/dist/stage/SpatialElementInteractionController.js.map +1 -1
  36. package/dist/stage/StageExperience.d.ts +12 -0
  37. package/dist/stage/StageExperience.d.ts.map +1 -1
  38. package/dist/stage/StageExperience.js +113 -49
  39. package/dist/stage/StageExperience.js.map +1 -1
  40. package/dist/stage/StagePanelRuntime.d.ts +2 -1
  41. package/dist/stage/StagePanelRuntime.d.ts.map +1 -1
  42. package/dist/stage/StagePanelRuntime.js.map +1 -1
  43. package/dist/stage/StageRenderPipeline.js +1 -1
  44. package/dist/stage/StageRenderPipeline.js.map +1 -1
  45. package/dist/stage/interactionGuidance.d.ts +22 -0
  46. package/dist/stage/interactionGuidance.d.ts.map +1 -0
  47. package/dist/stage/interactionGuidance.js +53 -0
  48. package/dist/stage/interactionGuidance.js.map +1 -0
  49. package/dist/stage/mouseHover.d.ts +9 -0
  50. package/dist/stage/mouseHover.d.ts.map +1 -0
  51. package/dist/stage/mouseHover.js +55 -0
  52. package/dist/stage/mouseHover.js.map +1 -0
  53. package/dist/stage/panelContext.d.ts +8 -1
  54. package/dist/stage/panelContext.d.ts.map +1 -1
  55. package/dist/stage/panelContext.js.map +1 -1
  56. package/dist/stage/scrollFrame.d.ts +2 -0
  57. package/dist/stage/scrollFrame.d.ts.map +1 -1
  58. package/dist/stage/scrollFrame.js +18 -5
  59. package/dist/stage/scrollFrame.js.map +1 -1
  60. package/dist/stage/stageConstants.d.ts +3 -3
  61. package/dist/stage/stageConstants.d.ts.map +1 -1
  62. package/dist/stage/stageConstants.js +3 -3
  63. package/dist/stage/stageConstants.js.map +1 -1
  64. package/dist/stage/stageMath.d.ts +6 -7
  65. package/dist/stage/stageMath.d.ts.map +1 -1
  66. package/dist/stage/stageMath.js +12 -11
  67. package/dist/stage/stageMath.js.map +1 -1
  68. package/dist/stage/stageTypes.d.ts +12 -2
  69. package/dist/stage/stageTypes.d.ts.map +1 -1
  70. package/dist/stage/stageTypes.js.map +1 -1
  71. package/dist/stage/stageVisualTest.d.ts +3 -1
  72. package/dist/stage/stageVisualTest.d.ts.map +1 -1
  73. package/dist/stage/stageVisualTest.js.map +1 -1
  74. package/package.json +1 -1
@@ -12,7 +12,8 @@ export interface StagePanelRuntime {
12
12
  nativeRestFrames: number;
13
13
  options: Required<LiquidGlassPanelOptions>;
14
14
  pointerLift: number;
15
- pointerReactive: boolean;
15
+ pointerReactive: boolean | 'lift';
16
+ focusReactive?: boolean | 'top-right';
16
17
  projectionRoot?: THREE.Group;
17
18
  surface: StagePanelSurface;
18
19
  transitionGroup?: CatalogTransitionGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"StagePanelRuntime.d.ts","sourceRoot":"","sources":["../../src/stage/StagePanelRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,MAAM,WAAW,iBAAiB;IACjC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,qBAAqB,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;IACpC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC;IACpC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;IAC7B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,eAAe,CAAC,EAAE,sBAAsB,CAAC;CACzC"}
1
+ {"version":3,"file":"StagePanelRuntime.d.ts","sourceRoot":"","sources":["../../src/stage/StagePanelRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,MAAM,WAAW,iBAAiB;IACjC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,qBAAqB,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;IACpC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC;IACpC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IACtC,cAAc,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;IAC7B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,eAAe,CAAC,EAAE,sBAAsB,CAAC;CACzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StagePanelRuntime.js","sourceRoot":"","sources":["../../src/stage/StagePanelRuntime.ts"],"names":[],"mappings":"","sourcesContent":["import type * as THREE from 'three/webgpu';\nimport type { CSS3DObject } from 'three/addons/renderers/CSS3DRenderer.js';\nimport type { LiquidGlassPanel, LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport type { StagePanelSurface } from './stageTypes.js';\nimport type { CatalogTransitionGroup } from '../catalog/catalogPresentation.js';\nexport interface StagePanelRuntime {\n\tcontent?: CSS3DObject;\n\tcontentProjectionRoot?: THREE.Group;\n\tdomRenderMode: 'native' | 'spatial';\n\tglass?: LiquidGlassPanel;\n\tgroup: THREE.Group;\n\tnativeRestFrames: number;\n\toptions: Required<LiquidGlassPanelOptions>;\n\tpointerLift: number;\n\tpointerReactive: boolean;\n\tprojectionRoot?: THREE.Group;\n\tsurface: StagePanelSurface;\n\ttransitionGroup?: CatalogTransitionGroup;\n}\n"]}
1
+ {"version":3,"file":"StagePanelRuntime.js","sourceRoot":"","sources":["../../src/stage/StagePanelRuntime.ts"],"names":[],"mappings":"","sourcesContent":["import type * as THREE from 'three/webgpu';\nimport type { CSS3DObject } from 'three/addons/renderers/CSS3DRenderer.js';\nimport type { LiquidGlassPanel, LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport type { StagePanelSurface } from './stageTypes.js';\nimport type { CatalogTransitionGroup } from '../catalog/catalogPresentation.js';\nexport interface StagePanelRuntime {\n\tcontent?: CSS3DObject;\n\tcontentProjectionRoot?: THREE.Group;\n\tdomRenderMode: 'native' | 'spatial';\n\tglass?: LiquidGlassPanel;\n\tgroup: THREE.Group;\n\tnativeRestFrames: number;\n\toptions: Required<LiquidGlassPanelOptions>;\n\tpointerLift: number;\n\tpointerReactive: boolean | 'lift';\n\tfocusReactive?: boolean | 'top-right';\n\tprojectionRoot?: THREE.Group;\n\tsurface: StagePanelSurface;\n\ttransitionGroup?: CatalogTransitionGroup;\n}\n"]}
@@ -728,7 +728,7 @@ export class StageRenderPipeline {
728
728
  try {
729
729
  return withRendererState(this.ports.renderer, () => {
730
730
  if (!this.ports.frame().stageViewportVisible ||
731
- !(this.ports.frame().modelHover || this.ports.frame().modelInteractionActive) ||
731
+ !this.ports.frame().modelHover ||
732
732
  !this.outlineMaskTarget ||
733
733
  !this.outlineQuad)
734
734
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"StageRenderPipeline.js","sourceRoot":"","sources":["../../src/stage/StageRenderPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIvE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EACN,EAAE,EACF,KAAK,EACL,EAAE,EACF,GAAG,EACH,KAAK,EACL,GAAG,IAAI,MAAM,EACb,GAAG,IAAI,MAAM,EACb,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,MAAM,WAAW,CAAC;AAEnB,OAAO,EACN,sBAAsB,EACtB,2BAA2B,EAE3B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAc3F,MAAM,mBAAmB,GAAG,IAAI,CAAC;AA4CjC,gGAAgG;AAChG,MAAM,OAAO,mBAAmB;IA2GF;IA1GZ,eAAe,GAAG,yBAAyB,EAAE,CAAC;IAC9C,iBAAiB,GAAG,sBAAsB,CAC1D,OAAO,MAAM,KAAK,WAAW,CAAC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CAAC,IAAI,CAAC,CAAC;gBAC1C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,kBAAkB,EAAE,CAAC;oBAC5C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBACxC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;gBAC7B,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,IAAI,CAAC,oBAAoB;oBAAE,OAAO;gBACvC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;gBAC5E,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;gBACzB,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;gBACxD,IAAI,OAAO;oBAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;gBAChF,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC1B,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC/B,CAAC;YACD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { getRefinementSize } from './SpatialElementRefinement.js';\nimport { getMinimapMeasurementMode } from './minimapMeasurement.js';\nimport { parseRenderMeasurement } from './renderMeasurement.js';\nimport type { PreparedHigh } from '../catalog/CatalogPreparation.js';\nimport { gaussianTargets } from './renderTargetInventory.js';\nimport { withRendererState, withVisibility } from './rendererState.js';\n\nimport type { StagePanelRuntime } from './StagePanelRuntime.js';\n\nimport * as THREE from 'three/webgpu';\n\nimport { CatalogSpatialElementLayer } from '../catalog/CatalogSpatialElementLayer.js';\nimport { SpatialGeometryCapture } from '../catalog/SpatialGeometryCapture.js';\n\nimport { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';\nimport {\n\tFn,\n\tfloat,\n\tIf,\n\tmix,\n\tcolor,\n\tmax as tslMax,\n\tmin as tslMin,\n\tpremultiplyAlpha,\n\ttexture,\n\tuniform,\n\tuv,\n\tvec2,\n\tvec4\n} from 'three/tsl';\nimport type { Mesh, Object3D } from 'three';\nimport {\n\tinverseAcesToneMapping,\n\tSTAGE_TONE_MAPPING_EXPOSURE,\n\ttype LiquidGlassPanelOptions\n} from './LiquidGlassPanel.js';\n\nimport type { StageMinimapState } from './minimap/MinimapState.js';\nimport { isMesh } from './stageSceneUtils.js';\nimport type { StageInteractionTheme, StageRenderSettings } from './stageTypes.js';\nimport { getStageRenderPixelRatio, resolveStageRenderSettings } from './renderSettings.js';\ninterface PanelBlurCapture {\n\t/** Intermediate pixels per CSS pixel; independent of output DPR/scroll quality. */\n\tresolutionScale: number;\n\teffect?: ReturnType<typeof gaussianBlur>;\n\tmaterial: THREE.NodeMaterial;\n\tquad: THREE.QuadMesh;\n\ttarget: THREE.RenderTarget;\n}\ninterface StageRenderTargetSet {\n\tscale: number;\n\tsceneCapture: THREE.RenderTarget;\n\tpanelBlurCaptures: Map<number, PanelBlurCapture>;\n}\nconst SCROLL_RENDER_SCALE = 0.82;\n\nexport interface StageRenderPorts {\n\tpageBackground?: string;\n\trenderSettings?: StageRenderSettings;\n\trenderer: THREE.WebGPURenderer;\n\tcontainer: HTMLElement;\n\tbackgroundCanvas: HTMLCanvasElement;\n\tbackgroundCanvasTarget: THREE.CanvasTarget;\n\tscene: THREE.Scene;\n\tbackgroundScene: THREE.Scene;\n\ttintScene: THREE.Scene;\n\tpanelScene: THREE.Scene;\n\tcamera: THREE.PerspectiveCamera;\n\tpanelCamera: THREE.PerspectiveCamera;\n\ttintCamera: THREE.OrthographicCamera;\n\tpanelRuntimes(): readonly StagePanelRuntime[];\n\tminimaps(): ReadonlyMap<number, StageMinimapState>;\n\tminimapScene(): THREE.Scene;\n\tcatalogLayer(): Pick<CatalogSpatialElementLayer, 'hasCarousel' | 'renderRear' | 'draw'> | undefined;\n\tspatialCapture(): SpatialGeometryCapture | undefined;\n\texitingMinimaps(): readonly { capture: SpatialGeometryCapture; minimap: StageMinimapState }[];\n\tcontentSecondaries(): readonly { capture: SpatialGeometryCapture }[];\n\tfallbackPanelOptions(): readonly LiquidGlassPanelOptions[];\n\tinteractionTheme(): StageInteractionTheme;\n\tframe(): Readonly<{\n\t\toutgoingBackground: boolean;\n\t\tcatalogDockTarget: boolean;\n\t\tcatalogHandoff: boolean;\n\t\tcatalogMotionComplete: boolean;\n\t\tstageViewportVisible: boolean;\n\t\tmodelHover: boolean;\n\t\tmodelInteractionActive: boolean;\n\t\tcatalog: boolean;\n\t\tpageModelReady: boolean;\n\t\tbackgroundReveal: number;\n\t}>;\n\trenderStage(): void;\n\trenderMinimapBlur(minimap: StageMinimapState): void;\n\trenderMinimapPanelCapture(minimap: StageMinimapState): void;\n\tgetPanelTransitionOpacity(panel?: StagePanelRuntime): number;\n\tisInteractionMesh(mesh: Mesh): boolean;\n}\n\n/** Owns GPU output bands, passes and target lifetimes; never schedules frames or navigation. */\nexport class StageRenderPipeline {\n\tprivate readonly measurementMode = getMinimapMeasurementMode();\n\tprivate readonly renderMeasurement = parseRenderMeasurement(\n\t\ttypeof window === 'undefined' ? '' : (window.location?.search ?? '')\n\t);\n\tprivate readonly fuseOutline = ![\n\t\t'halo-separate',\n\t\t'halo-mask-only',\n\t\t'halo-frozen-mask',\n\t\t'halo-half-mask'\n\t].includes(this.renderMeasurement);\n\tprivate readonly measuredBackdropSeeds = new WeakMap<THREE.RenderTarget, string>();\n\tprivate readonly preparedZoomViews = new WeakSet<StageMinimapState>();\n\tprivate disposed = false;\n\tprivate renderSettings = resolveStageRenderSettings();\n\t/** Retain the last DETAIL background while its geometry is owned by a transition. */\n\tfreezeBackground() {\n\t\tconst targets = this._activeRenderTargets;\n\t\tif (!targets) return false;\n\t\twithRendererState(this.ports.renderer, () => {\n\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\tthis.ports.renderer.setRenderTarget(targets.sceneCapture);\n\t\t\tthis.renderStageContents();\n\t\t\tthis.renderStageDisplay();\n\t\t\tthis.renderBackgroundPanels();\n\t\t});\n\t\treturn true;\n\t}\n\tasync warmHigh(high: PreparedHigh, environment: THREE.Texture, drawLow: () => void) {\n\t\tconst scene = new THREE.Scene();\n\t\tscene.environment = environment;\n\t\tscene.environmentIntensity = 0.5;\n\t\tscene.add(high.pose);\n\t\tconst camera = new THREE.PerspectiveCamera(\n\t\t\t45,\n\t\t\twindow.innerWidth / window.innerHeight,\n\t\t\t0.01,\n\t\t\t100\n\t\t);\n\t\tcamera.position.z = 5;\n\t\tconst size = this.ports.renderer.getDrawingBufferSize(new THREE.Vector2());\n\t\tconst warmSize = getRefinementSize(size.x, size.y);\n\t\tconst target = new THREE.RenderTarget(warmSize.width, warmSize.height, {\n\t\t\ttype: THREE.HalfFloatType,\n\t\t\tsamples: 4\n\t\t});\n\t\tconst destination = this.ports.renderer.getRenderTarget();\n\t\tconst clear = this.ports.renderer.getClearColor(new THREE.Color());\n\t\tconst alpha = this.ports.renderer.getClearAlpha();\n\t\ttry {\n\t\t\tthis.ports.renderer.setRenderTarget(target);\n\t\t\tthis.ports.renderer.setClearColor(0, 0);\n\t\t\thigh.blend.render(\n\t\t\t\tthis.ports.renderer,\n\t\t\t\t(useHigh) => {\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t\tif (useHigh) this.ports.renderer.render(scene, camera);\n\t\t\t\t\telse drawLow();\n\t\t\t\t},\n\t\t\t\tfalse,\n\t\t\t\t0\n\t\t\t);\n\t\t} finally {\n\t\t\tthis.ports.renderer.setRenderTarget(destination);\n\t\t\tthis.ports.renderer.setClearColor(clear, alpha);\n\t\t\thigh.pose.removeFromParent();\n\t\t\ttarget.dispose();\n\t\t}\n\t\tconst device = (this.ports.renderer.backend as unknown as { device?: GPUDevice }).device;\n\t\tawait device?.queue.onSubmittedWorkDone();\n\t}\n\n\tgetRenderTargets() {\n\t\treturn [\n\t\t\t...(this.outlineMaskTarget ? [this.outlineMaskTarget] : []),\n\t\t\t...[this.fullQualityTargets, this.scrollQualityTargets].flatMap((set) =>\n\t\t\t\tset\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tset.sceneCapture,\n\t\t\t\t\t\t\t...[...set.panelBlurCaptures.values()].flatMap((blur) => [\n\t\t\t\t\t\t\t\tblur.target,\n\t\t\t\t\t\t\t\t...gaussianTargets(blur.effect)\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)\n\t\t];\n\t}\n\tgetCanvasOutputs() {\n\t\treturn [\n\t\t\tthis.ports.backgroundCanvasTarget,\n\t\t\tthis.foregroundCanvasTarget,\n\t\t\tthis.carouselRearTarget\n\t\t].flatMap((target, index) => {\n\t\t\tif (!target) return [];\n\t\t\tconst size = target.getDrawingBufferSize(new THREE.Vector2());\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tband: ['background', 'foreground', 'carousel-rear'][index],\n\t\t\t\t\twidth: size.x,\n\t\t\t\t\theight: size.y,\n\t\t\t\t\tcolorAttachments: 1,\n\t\t\t\t\tdepthAttachments: 1\n\t\t\t\t}\n\t\t\t];\n\t\t});\n\t}\n\tconstructor(private readonly ports: StageRenderPorts) {\n\t\tthis.setRenderSettings(ports.renderSettings);\n\t\tthis.setPageBackground(ports.pageBackground ?? '#ffffff');\n\t\tthis.backgroundCoverMaterial.fragmentNode = premultiplyAlpha(\n\t\t\tvec4(inverseAcesToneMapping(this.backgroundCoverColor), this.backgroundCoverOpacity)\n\t\t);\n\t\tthis.backgroundCoverMaterial.depthTest = this.backgroundCoverMaterial.depthWrite = false;\n\t\tthis.backgroundCoverMaterial.transparent =\n\t\t\tthis.backgroundCoverMaterial.premultipliedAlpha = true;\n\t\tthis.backgroundCoverMaterial.toneMapped = false;\n\t}\n\tprivate readonly backgroundCoverOpacity = uniform(0);\n\tprivate readonly backgroundCoverColor = uniform(new THREE.Vector3(1, 1, 1));\n\tsetPageBackground(value: string) {\n\t\tconst color = new THREE.Color(value);\n\t\tthis.backgroundCoverColor.value.set(color.r, color.g, color.b);\n\t}\n\tprivate readonly backgroundCoverMaterial = new THREE.NodeMaterial();\n\tprivate readonly backgroundCover = new THREE.QuadMesh(this.backgroundCoverMaterial);\n\tprivate readonly outlineMaskScene = new THREE.Scene();\n\tprivate _minimapOverlayCapturePasses = 0;\n\tprivate _renderTargetSetCreations = 0;\n\tprivate _renderTargetSetResizes = 0;\n\tprivate _renderTargetSetWarmups = 0;\n\tprivate _stageModelRenderPasses = 0;\n\tprivate _panelBlurRenderPasses = 0;\n\tprivate _panelSceneRenderPasses = 0;\n\tprivate _minimapSceneRenderPasses = 0;\n\tprivate outlineMaskModel?: Object3D;\n\tprivate outlineMaskMaterial?: THREE.MeshBasicMaterial;\n\tprivate outlineCompositeMaterial?: THREE.MeshBasicNodeMaterial;\n\tprivate outlineQuad?: THREE.QuadMesh;\n\tprivate outlineMaskTarget?: THREE.RenderTarget;\n\tprivate outlineMaskValid = false;\n\tprivate readonly emptyOutlineMask = new THREE.DataTexture(new Uint8Array(4), 1, 1);\n\tprivate readonly displayOutlineMask = texture(this.emptyOutlineMask);\n\tprivate readonly displayOutlineOpacity = uniform(0);\n\tprivate outlineWidth = 1;\n\tprivate outlineHeight = 1;\n\tprivate outlineTexel = uniform(new THREE.Vector2(1, 1));\n\tprivate outlineGlowTexel = uniform(new THREE.Vector2(1, 1));\n\tprivate outlineOpacityScale = uniform(1);\n\tprivate fullQualityTargets?: StageRenderTargetSet;\n\tprivate scrollQualityTargets?: StageRenderTargetSet;\n\tprivate _activeRenderTargets?: StageRenderTargetSet;\n\tprivate stageDisplayMaterial?: THREE.NodeMaterial;\n\tprivate _stageDisplayQuad?: THREE.QuadMesh;\n\tprivate stageDisplayTextureNode?: THREE.TextureNode;\n\tprivate foregroundCanvasTarget?: THREE.CanvasTarget;\n\tprivate carouselRearTarget?: THREE.CanvasTarget;\n\tprivate carouselRearCanvas?: HTMLCanvasElement;\n\tprivate carouselRearSize = new THREE.Vector3();\n\tprivate foregroundCanvas?: HTMLCanvasElement;\n\tconfigureRenderer() {\n\t\tthis.ports.renderer.toneMapping = THREE.ACESFilmicToneMapping;\n\t\tthis.ports.renderer.toneMappingExposure = STAGE_TONE_MAPPING_EXPOSURE;\n\t\tthis.ports.renderer.setClearColor(0xffffff, 1);\n\t\tthis.ports.renderer.autoClear = false;\n\t\tthis.ports.backgroundCanvas.tabIndex = -1;\n\t\tthis.ports.backgroundCanvas.style.touchAction = 'pan-y';\n\t}\n\trenderCarouselRear() {\n\t\tif (!this.carouselRearTarget && !this.ports.catalogLayer()?.hasCarousel()) return;\n\t\tif (!this.carouselRearTarget) {\n\t\t\tconst canvas = document.createElement('canvas');\n\t\t\tcanvas.className = 'stage-webgpu-carousel-rear';\n\t\t\tcanvas.setAttribute('aria-hidden', 'true');\n\t\t\tthis.carouselRearCanvas = canvas;\n\t\t\tthis.carouselRearTarget = new THREE.CanvasTarget(canvas);\n\t\t\tthis.ports.container.appendChild(canvas);\n\t\t}\n\t\tconst target = this.carouselRearTarget;\n\t\tconst width = window.innerWidth,\n\t\t\theight = window.innerHeight,\n\t\t\tratio = this.getFullPixelRatio();\n\t\tif (\n\t\t\tthis.carouselRearSize.x !== width ||\n\t\t\tthis.carouselRearSize.y !== height ||\n\t\t\tthis.carouselRearSize.z !== ratio\n\t\t) {\n\t\t\tthis.resizeCanvasTarget(target, width, height, ratio);\n\t\t\tthis.carouselRearSize.set(width, height, ratio);\n\t\t}\n\t\tthis.ports.renderer.setCanvasTarget(target);\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\tthis.ports.renderer.clear();\n\t\tthis.ports.catalogLayer()?.renderRear(this.ports.renderer);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t}\n\tcreateForegroundCanvas() {\n\t\tconst canvas = document.createElement('canvas');\n\t\tcanvas.className = 'stage-webgpu-foreground';\n\t\tcanvas.setAttribute('aria-hidden', 'true');\n\t\tthis.foregroundCanvas = canvas;\n\t\tthis.foregroundCanvasTarget = new THREE.CanvasTarget(canvas);\n\t\tthis.ports.container.appendChild(canvas);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t}\n\tcreateModelOutline(model: Object3D) {\n\t\tthis.outlineMaskModel?.removeFromParent();\n\t\tthis.outlineMaskMaterial?.dispose();\n\t\tthis.outlineCompositeMaterial?.dispose();\n\t\tthis.outlineMaskTarget?.dispose();\n\t\tthis.outlineMaskMaterial = new THREE.MeshBasicMaterial({\n\t\t\tcolor: 0xffffff,\n\t\t\tdepthTest: true,\n\t\t\tdepthWrite: true,\n\t\t\tside: THREE.DoubleSide,\n\t\t\ttoneMapped: false\n\t\t});\n\n\t\tconst maskModel = model.clone(true);\n\t\tmaskModel.traverse((child) => {\n\t\t\tif (!isMesh(child)) return;\n\n\t\t\tconst sourceMesh = this.findSourceMeshByName(model, child.name);\n\t\t\tconst include = sourceMesh\n\t\t\t\t? this.ports.isInteractionMesh(sourceMesh)\n\t\t\t\t: this.ports.isInteractionMesh(child);\n\t\t\tchild.visible = include;\n\t\t\tchild.material = this.outlineMaskMaterial!;\n\t\t});\n\n\t\tthis.outlineMaskModel = maskModel;\n\t\tthis.outlineMaskScene.add(maskModel);\n\t\tthis.outlineMaskTarget = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tsamples: 4\n\t\t});\n\t\tthis.outlineMaskTarget.texture.minFilter = THREE.LinearFilter;\n\t\tthis.outlineMaskTarget.texture.magFilter = THREE.LinearFilter;\n\t\tthis.outlineMaskTarget.texture.generateMipmaps = false;\n\t\tthis.displayOutlineMask.value = this.outlineMaskTarget.texture;\n\t\tthis.outlineCompositeMaterial = this.createOutlineCompositeMaterial(\n\t\t\tthis.outlineMaskTarget.texture\n\t\t);\n\t\tthis.outlineQuad = new THREE.QuadMesh(this.outlineCompositeMaterial);\n\t\t// High refinement can replace the silhouette long after the last window resize.\n\t\tthis.resizeOutline(this.outlineWidth, this.outlineHeight);\n\t}\n\tprivate findSourceMeshByName(root: Object3D, name: string) {\n\t\tlet source: Mesh | undefined;\n\t\troot.traverse((child) => {\n\t\t\tif (!source && isMesh(child) && child.name === name) source = child;\n\t\t});\n\n\t\treturn source;\n\t}\n\tprivate createOutlineOpacity(mask: THREE.TextureNode) {\n\t\tconst calculate = () => {\n\t\t\tconst texel = this.outlineTexel;\n\t\t\tconst glowTexel = this.outlineGlowTexel;\n\t\t\tconst sampleMaskRing = (sampleTexel: typeof texel, scale = 1) => {\n\t\t\t\tconst centerUv = uv();\n\t\t\t\tconst sampleX = sampleTexel.x.mul(scale);\n\t\t\t\tconst sampleY = sampleTexel.y.mul(scale);\n\t\t\t\tconst left = mask.sample(centerUv.sub(vec2(sampleX, 0))).r;\n\t\t\t\tconst right = mask.sample(centerUv.add(vec2(sampleX, 0))).r;\n\t\t\t\tconst up = mask.sample(centerUv.add(vec2(0, sampleY))).r;\n\t\t\t\tconst down = mask.sample(centerUv.sub(vec2(0, sampleY))).r;\n\t\t\t\tconst upLeft = mask.sample(centerUv.add(vec2(0, sampleY)).sub(vec2(sampleX, 0))).r;\n\t\t\t\tconst upRight = mask.sample(centerUv.add(vec2(sampleX, sampleY))).r;\n\t\t\t\tconst downLeft = mask.sample(centerUv.sub(vec2(sampleX, sampleY))).r;\n\t\t\t\tconst downRight = mask.sample(centerUv.add(vec2(sampleX, 0)).sub(vec2(0, sampleY))).r;\n\n\t\t\t\treturn {\n\t\t\t\t\taverage: left\n\t\t\t\t\t\t.add(right)\n\t\t\t\t\t\t.add(up)\n\t\t\t\t\t\t.add(down)\n\t\t\t\t\t\t.add(upLeft)\n\t\t\t\t\t\t.add(upRight)\n\t\t\t\t\t\t.add(downLeft)\n\t\t\t\t\t\t.add(downRight)\n\t\t\t\t\t\t.div(8),\n\t\t\t\t\tmax: tslMax(\n\t\t\t\t\t\ttslMax(tslMax(left, right), tslMax(up, down)),\n\t\t\t\t\t\ttslMax(tslMax(upLeft, upRight), tslMax(downLeft, downRight))\n\t\t\t\t\t),\n\t\t\t\t\tmin: tslMin(\n\t\t\t\t\t\ttslMin(tslMin(left, right), tslMin(up, down)),\n\t\t\t\t\t\ttslMin(tslMin(upLeft, upRight), tslMin(downLeft, downRight))\n\t\t\t\t\t)\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst edgeNeighbor = sampleMaskRing(texel);\n\t\t\tconst glowNearNeighbor = sampleMaskRing(glowTexel, 0.45);\n\t\t\tconst glowMidNeighbor = sampleMaskRing(glowTexel, 0.7);\n\t\t\tconst glowFarNeighbor = sampleMaskRing(glowTexel);\n\t\t\tconst center = mask.sample(uv()).r;\n\t\t\tconst outside = center.oneMinus();\n\t\t\tconst edgeGradient = edgeNeighbor.max.sub(center).max(0);\n\t\t\tconst core = edgeGradient.mul(this.ports.interactionTheme().outlineOpacity);\n\t\t\t// Average neighbouring coverage, rather than dilating a solid band. Keep the\n\t\t\t// halo outside the spatialElement so it cannot be mistaken for painted geometry.\n\t\t\tconst glowNear = glowNearNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.ports.interactionTheme().outlineGlow * 0.6);\n\t\t\tconst glowMid = glowMidNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.ports.interactionTheme().outlineGlow * 0.3);\n\t\t\tconst glowFar = glowFarNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.ports.interactionTheme().outlineGlow * 0.1);\n\t\t\tconst opacity = tslMin(core.add(glowNear).add(glowMid).add(glowFar), 1).mul(\n\t\t\t\tthis.outlineOpacityScale\n\t\t\t);\n\n\t\t\treturn opacity;\n\t\t};\n\t\tif (this.renderMeasurement === 'halo-unconditional') return calculate();\n\t\treturn Fn(() => {\n\t\t\tconst opacity = float(0).toVar();\n\t\t\t// A fully covered pixel has zero outer halo. Skip all 32 neighbour taps there.\n\t\t\tIf(mask.sample(uv()).r.lessThan(1), () => {\n\t\t\t\topacity.assign(calculate());\n\t\t\t});\n\t\t\treturn opacity;\n\t\t})();\n\t}\n\tprivate createOutlineCompositeMaterial(maskTexture: THREE.Texture) {\n\t\tconst material = new THREE.MeshBasicNodeMaterial({\n\t\t\tblending: THREE.NormalBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false,\n\t\t\ttransparent: true\n\t\t});\n\t\tmaterial.colorNode = color(new THREE.Color(this.ports.interactionTheme().outlineColor));\n\t\tmaterial.opacityNode = this.createOutlineOpacity(texture(maskTexture));\n\t\tmaterial.toneMapped = false;\n\t\treturn material;\n\t}\n\tdisposeSceneCapture() {\n\t\tthis.disposeRenderTargetSet(this.fullQualityTargets);\n\t\tthis.disposeRenderTargetSet(this.scrollQualityTargets);\n\t\tthis.stageDisplayMaterial?.dispose();\n\t\tthis.fullQualityTargets = undefined;\n\t\tthis.scrollQualityTargets = undefined;\n\t\tthis._activeRenderTargets = undefined;\n\t\tthis.stageDisplayMaterial = undefined;\n\t\tthis._stageDisplayQuad = undefined;\n\t\tthis.stageDisplayTextureNode = undefined;\n\t}\n\tcreateSceneCapture() {\n\t\tconst blurKeys = new Set(\n\t\t\tthis.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options))\n\t\t);\n\t\tthis.fullQualityTargets = this.createRenderTargetSet(1, blurKeys);\n\t\tthis.scrollQualityTargets = this.createRenderTargetSet(SCROLL_RENDER_SCALE, blurKeys);\n\t\tthis._activeRenderTargets = this.fullQualityTargets;\n\n\t\tthis.stageDisplayTextureNode = texture(this.fullQualityTargets.sceneCapture.texture);\n\t\tthis.stageDisplayMaterial = new THREE.NodeMaterial();\n\t\t// CanvasTarget already runs WebGPURenderer's output transform after this\n\t\t// fullscreen copy. Keep the capture linear here so ACES and sRGB are applied\n\t\t// exactly once; using renderOutput() here would wash out the entire stage.\n\t\t// CanvasTarget unpremultiplies before tone mapping and premultiplies afterwards.\n\t\t// Environment visibility is applied before the hero; the composed capture stays opaque.\n\t\tthis.stageDisplayMaterial.fragmentNode = vec4(this.stageDisplayTextureNode.rgb, 1);\n\t\tif (this.fuseOutline) {\n\t\t\tthis.emptyOutlineMask.needsUpdate = true;\n\t\t\tconst source = this.stageDisplayTextureNode;\n\t\t\tconst haloColor = color(new THREE.Color(this.ports.interactionTheme().outlineColor));\n\t\t\tconst haloOpacity = this.createOutlineOpacity(this.displayOutlineMask);\n\t\t\t// Merge into the existing linear display pass before the canvas output transform.\n\t\t\tthis.stageDisplayMaterial.fragmentNode = Fn(() => {\n\t\t\t\tconst rgb = source.rgb.toVar();\n\t\t\t\tIf(this.displayOutlineOpacity.greaterThan(0), () => {\n\t\t\t\t\trgb.assign(mix(rgb, haloColor, haloOpacity.mul(this.displayOutlineOpacity)));\n\t\t\t\t});\n\t\t\t\treturn vec4(rgb, 1);\n\t\t\t})();\n\t\t}\n\t\tthis.stageDisplayMaterial.depthTest = false;\n\t\tthis.stageDisplayMaterial.depthWrite = false;\n\t\tthis.stageDisplayMaterial.blending = THREE.NoBlending;\n\t\tthis.stageDisplayMaterial.toneMapped = false;\n\t\tthis.stageDisplayMaterial.needsUpdate = true;\n\t\tthis._stageDisplayQuad = new THREE.QuadMesh(this.stageDisplayMaterial);\n\t}\n\tprivate createRenderTargetSet(\n\t\tscale: number,\n\t\tblurKeys: ReadonlySet<number>\n\t): StageRenderTargetSet {\n\t\tthis._renderTargetSetCreations += 1;\n\t\tconst sceneCapture = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tsamples: 4,\n\t\t\ttype: THREE.HalfFloatType\n\t\t});\n\t\tsceneCapture.texture.minFilter = THREE.LinearFilter;\n\t\tsceneCapture.texture.magFilter = THREE.LinearFilter;\n\t\tsceneCapture.texture.generateMipmaps = false;\n\t\tsceneCapture.texture.colorSpace = THREE.NoColorSpace;\n\n\t\tconst panelBlurCaptures = new Map<number, PanelBlurCapture>();\n\t\tblurKeys.forEach((blur) => {\n\t\t\tpanelBlurCaptures.set(blur, this.createPanelBlurCapture(sceneCapture.texture, blur, scale));\n\t\t});\n\n\t\treturn { scale, sceneCapture, panelBlurCaptures };\n\t}\n\tprivate disposeRenderTargetSet(targets?: StageRenderTargetSet) {\n\t\tif (!targets) return;\n\t\ttargets.sceneCapture.dispose();\n\t\ttargets.panelBlurCaptures.forEach(({ target, material, effect }) => {\n\t\t\ttarget.dispose();\n\t\t\tmaterial.dispose();\n\t\t\teffect?.dispose();\n\t\t});\n\t\ttargets.panelBlurCaptures.clear();\n\t}\n\tresizeRenderTargets() {\n\t\tconst width = window.innerWidth;\n\t\tconst height = window.innerHeight;\n\t\tconst pixelRatio = this.getFullPixelRatio();\n\t\tif (!this.ports.frame().outgoingBackground)\n\t\t\tthis.resizeCanvasTarget(this.ports.backgroundCanvasTarget, width, height, pixelRatio);\n\t\tif (this.foregroundCanvasTarget) {\n\t\t\tthis.resizeCanvasTarget(this.foregroundCanvasTarget, width, height, pixelRatio);\n\t\t}\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.resizeRenderTargetSet(this.fullQualityTargets, width, height, pixelRatio);\n\t\tthis.resizeRenderTargetSet(this.scrollQualityTargets, width, height, pixelRatio);\n\t}\n\tprivate resizeRenderTargetSet(\n\t\ttargets: StageRenderTargetSet | undefined,\n\t\twidth: number,\n\t\theight: number,\n\t\tpixelRatio: number\n\t) {\n\t\tif (!targets) return;\n\t\tthis._renderTargetSetResizes += 1;\n\t\tconst captureWidth = Math.max(1, Math.round(width * pixelRatio * targets.scale));\n\t\tconst captureHeight = Math.max(1, Math.round(height * pixelRatio * targets.scale));\n\t\ttargets.sceneCapture.setSize(captureWidth, captureHeight);\n\t\ttargets.panelBlurCaptures.forEach(({ target, effect, resolutionScale }) => {\n\t\t\tif (effect) {\n\t\t\t\tconst effectScale = resolutionScale / (pixelRatio * targets.scale);\n\t\t\t\teffect.resolutionScale = effectScale;\n\t\t\t\teffect.setSize(captureWidth, captureHeight);\n\t\t\t\t// Consumers sample normalized screen UVs. Preserve the blur's actual\n\t\t\t\t// density instead of copying it back to a full-DPR viewport texture.\n\t\t\t\ttarget.setSize(\n\t\t\t\t\tMath.max(1, Math.round(captureWidth * effectScale)),\n\t\t\t\t\tMath.max(1, Math.round(captureHeight * effectScale))\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// A zero-blur backdrop still contains sharp scene detail.\n\t\t\t\ttarget.setSize(captureWidth, captureHeight);\n\t\t\t}\n\t\t});\n\t}\n\tgetFullPixelRatio() {\n\t\treturn getStageRenderPixelRatio(\n\t\t\twindow.innerWidth,\n\t\t\twindow.innerHeight,\n\t\t\twindow.devicePixelRatio,\n\t\t\tthis.renderSettings\n\t\t);\n\t}\n\tsetRenderSettings(settings?: StageRenderSettings) {\n\t\tthis.renderSettings = resolveStageRenderSettings(settings);\n\t}\n\tgetRenderSettings() {\n\t\treturn { ...this.renderSettings };\n\t}\n\tsetScrollRenderQuality(active: boolean) {\n\t\tthis.ports.container.toggleAttribute('data-stage-scroll-rendering', active);\n\t\tconst nextTargets = active ? this.scrollQualityTargets : this.fullQualityTargets;\n\t\tif (!nextTargets || this._activeRenderTargets === nextTargets) return;\n\t\tthis.activateRenderTargetSet(nextTargets);\n\t}\n\tprivate activateRenderTargetSet(nextTargets: StageRenderTargetSet) {\n\t\tthis._activeRenderTargets = nextTargets;\n\t\tif (this.stageDisplayTextureNode) {\n\t\t\tthis.stageDisplayTextureNode.value = nextTargets.sceneCapture.texture;\n\t\t}\n\t\tthis.ports.panelRuntimes().forEach((runtime) => {\n\t\t\truntime.glass?.setBackdropTexture(this.getPanelBlurTexture(runtime.options, nextTargets));\n\t\t});\n\t\tthis.ports.minimaps().forEach((minimap) => {\n\t\t\tminimap.stageCaptureTexture.value = nextTargets.sceneCapture.texture;\n\t\t\tconst panel = this.ports.panelRuntimes()[minimap.panelIndex];\n\t\t\tif (panel) {\n\t\t\t\tminimap.stageBlurTexture.value =\n\t\t\t\t\tpanel.surface === 'solid'\n\t\t\t\t\t\t? nextTargets.sceneCapture.texture\n\t\t\t\t\t\t: this.getPanelBlurTexture(panel.options, nextTargets);\n\t\t\t}\n\t\t\tminimap.overlayCaptureDirty = true;\n\t\t});\n\t}\n\twarmRenderTargetSets() {\n\t\tconst previousTargets = this._activeRenderTargets;\n\t\tconst availableTargets = [this.fullQualityTargets, this.scrollQualityTargets].filter(\n\t\t\t(targets): targets is StageRenderTargetSet => Boolean(targets)\n\t\t);\n\t\tif (!previousTargets || !this._stageDisplayQuad || availableTargets.length !== 2) return;\n\t\t// Finish with the active/full-quality set so the warm-up itself cannot\n\t\t// leave a lower-resolution frame on the visible canvas.\n\t\tconst targetSets = [\n\t\t\t...availableTargets.filter((targets) => targets !== previousTargets),\n\t\t\tpreviousTargets\n\t\t];\n\n\t\ttry {\n\t\t\twithRendererState(this.ports.renderer, () => {\n\t\t\t\ttargetSets.forEach((targets) => {\n\t\t\t\t\tthis.activateRenderTargetSet(targets);\n\t\t\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\t\t\tthis.ports.renderer.setRenderTarget(targets.sceneCapture);\n\t\t\t\t\tthis.ports.renderStage();\n\t\t\t\t\tthis.renderPanelBlurCaptures(targets, true);\n\t\t\t\t\tthis.renderStageDisplay();\n\t\t\t\t\tthis.renderBackgroundPanels();\n\t\t\t\t\tthis._renderTargetSetWarmups += 1;\n\t\t\t\t});\n\t\t\t});\n\t\t} finally {\n\t\t\tthis.activateRenderTargetSet(previousTargets);\n\t\t}\n\t}\n\tprivate resizeCanvasTarget(\n\t\ttarget: THREE.CanvasTarget,\n\t\twidth: number,\n\t\theight: number,\n\t\tpixelRatio: number\n\t) {\n\t\tthis.ports.renderer.setCanvasTarget(target);\n\t\tthis.ports.renderer.setPixelRatio(pixelRatio);\n\t\tthis.ports.renderer.setSize(width, height, false);\n\t}\n\tprivate createPanelBlurCapture(\n\t\tsceneTexture: THREE.Texture,\n\t\tblur: number,\n\t\trenderScale: number\n\t): PanelBlurCapture {\n\t\tconst target = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: false,\n\t\t\tstencilBuffer: false\n\t\t});\n\t\ttarget.texture.minFilter = THREE.LinearFilter;\n\t\ttarget.texture.magFilter = THREE.LinearFilter;\n\t\ttarget.texture.generateMipmaps = false;\n\t\ttarget.texture.colorSpace = THREE.NoColorSpace;\n\n\t\tconst sourceTexture = texture(sceneTexture);\n\t\t// Scale resolution and sample offsets together to retain the CSS blur radius.\n\t\t// The final texture uses the same density and normalized screen-space mapping.\n\t\tconst query = new URLSearchParams(typeof window === 'undefined' ? '' : window.location?.search);\n\t\tconst fullResolutionProbe =\n\t\t\tquery.get('stage-test') === '1' && query.get('stage-backdrop') === 'full';\n\t\tconst blurResolution = blur >= 4 && !fullResolutionProbe ? 0.5 : 1;\n\t\tconst effect =\n\t\t\tblur > 0\n\t\t\t\t? gaussianBlur(sourceTexture, blurResolution, Math.max(1, Math.round(blur)), {\n\t\t\t\t\t\tresolutionScale: blurResolution / (this.getFullPixelRatio() * renderScale)\n\t\t\t\t\t})\n\t\t\t\t: undefined;\n\t\tconst material = new THREE.NodeMaterial();\n\t\tmaterial.colorNode = effect ?? sourceTexture;\n\t\tmaterial.needsUpdate = true;\n\n\t\treturn {\n\t\t\tresolutionScale: blurResolution,\n\t\t\teffect,\n\t\t\tmaterial,\n\t\t\tquad: new THREE.QuadMesh(material),\n\t\t\ttarget\n\t\t};\n\t}\n\tprivate getPanelBlurKey(options: LiquidGlassPanelOptions) {\n\t\tconst value = Number.isFinite(options.backdropBlur) ? (options.backdropBlur ?? 0) : 0;\n\t\treturn Math.round(THREE.MathUtils.clamp(value, 0, 100) * 100) / 100;\n\t}\n\tgetPanelBlurTexture(options: LiquidGlassPanelOptions, targets = this._activeRenderTargets) {\n\t\tconst blur = this.getPanelBlurKey(options);\n\t\tconst capture = targets?.panelBlurCaptures.get(blur);\n\t\tif (!capture) {\n\t\t\tthrow new Error(`No backdrop capture exists for panel blur ${blur}`);\n\t\t}\n\t\treturn capture.target.texture;\n\t}\n\t/** Prepare hidden close-up effects during page binding, never during camera motion.\n\t * Captures stay invalid: the first visible frame must still sample the live element.\n\t * Only compile the foreground scene, so preparation cannot paint an overlay on screen.\n\t */\n\tasync prepareZoomEffects() {\n\t\tif (!this.foregroundCanvasTarget || this.disposed) return;\n\t\tconst views = [...this.ports.minimaps().values()].filter(\n\t\t\t(view) => !this.preparedZoomViews.has(view)\n\t\t);\n\t\tif (!views.length) return;\n\t\tconst pending: Promise<unknown>[] = [];\n\t\tfor (const view of views) {\n\t\t\twithRendererState(this.ports.renderer, () => {\n\t\t\t\tthis.ports.renderMinimapBlur(view);\n\t\t\t\tif (this.ports.panelRuntimes()[view.panelIndex]?.surface === 'glass')\n\t\t\t\t\tthis.ports.renderMinimapPanelCapture(view);\n\t\t\t\tthis.ports.renderer.setCanvasTarget(this.foregroundCanvasTarget!);\n\t\t\t\tthis.ports.renderer.setRenderTarget(null);\n\t\t\t\tconst ringMaterial = view.overlayRing.material;\n\t\t\t\tconst compositeCulled = view.overlayComposite.frustumCulled;\n\t\t\t\tconst ringCulled = view.overlayRing.frustumCulled;\n\t\t\t\ttry {\n\t\t\t\t\t// A newly bound minimap camera may not yet have its screen projection.\n\t\t\t\t\t// Compile the hidden effects even if that initial frustum excludes them.\n\t\t\t\t\tview.overlayComposite.frustumCulled = false;\n\t\t\t\t\tview.overlayRing.frustumCulled = false;\n\t\t\t\t\twithVisibility(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...[...this.ports.minimaps().values()].map((entry) => entry.layer),\n\t\t\t\t\t\t\tview.overlayComposite,\n\t\t\t\t\t\t\tview.overlayRing\n\t\t\t\t\t\t],\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tfor (const entry of this.ports.minimaps().values())\n\t\t\t\t\t\t\t\tentry.layer.visible = entry === view;\n\t\t\t\t\t\t\tview.overlayComposite.visible = true;\n\t\t\t\t\t\t\tview.overlayRing.visible = true;\n\t\t\t\t\t\t\tfor (const material of [view.ringRestMaterial, view.ringForegroundMaterial]) {\n\t\t\t\t\t\t\t\tview.overlayRing.material = material;\n\t\t\t\t\t\t\t\tpending.push(\n\t\t\t\t\t\t\t\t\tthis.ports.renderer.compileAsync(this.ports.minimapScene(), view.screenCamera)\n\t\t\t\t\t\t\t\t);\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} finally {\n\t\t\t\t\tview.overlayRing.material = ringMaterial;\n\t\t\t\t\tview.overlayComposite.frustumCulled = compositeCulled;\n\t\t\t\t\tview.overlayRing.frustumCulled = ringCulled;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tawait Promise.all(pending);\n\t\tconst device = (this.ports.renderer.backend as unknown as { device?: GPUDevice }).device;\n\t\tawait device?.queue.onSubmittedWorkDone();\n\t\tif (!this.disposed) for (const view of views) this.preparedZoomViews.add(view);\n\t}\n\trenderForegroundLayer() {\n\t\tif (!this.foregroundCanvasTarget) return;\n\n\t\tthis.ports.renderer.setCanvasTarget(this.foregroundCanvasTarget);\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\tthis.ports.renderer.clear();\n\t\tthis.renderMinimapScene();\n\t\tfor (const entry of this.ports.exitingMinimaps())\n\t\t\tif (entry.minimap.displayOpacity > 0) entry.capture.render(this.ports.renderer);\n\t\tthis.ports.catalogLayer()?.draw(this.ports.renderer, 'front');\n\t\tfor (const entry of this.ports.contentSecondaries()) entry.capture.render(this.ports.renderer);\n\t\tthis.ports.spatialCapture()?.render(this.ports.renderer);\n\t}\n\trenderBackgroundPanels() {\n\t\treturn withVisibility(\n\t\t\tthis.ports.panelRuntimes().map((panel) => panel.group),\n\t\t\t() => {\n\t\t\t\tconst minimaps = Array.from(this.ports.minimaps().values());\n\t\t\t\tconst minimapPanelIndices = new Set(minimaps.map((minimap) => minimap.panelIndex));\n\t\t\t\tconst panelVisibility = this.ports.panelRuntimes().map((panel) => panel.group.visible);\n\t\t\t\tconst visibleMinimaps = minimaps.filter(\n\t\t\t\t\t(minimap) =>\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tpanelVisibility[minimap.panelIndex] &&\n\t\t\t\t\t\tBoolean(this.ports.panelRuntimes()[minimap.panelIndex]?.glass)\n\t\t\t\t);\n\t\t\t\tconst hasVisibleRegularPanel = this.ports\n\t\t\t\t\t.panelRuntimes()\n\t\t\t\t\t.some(\n\t\t\t\t\t\t(panel, index) =>\n\t\t\t\t\t\t\tBoolean(panel.glass) && panelVisibility[index] && !minimapPanelIndices.has(index)\n\t\t\t\t\t);\n\n\t\t\t\t// Regular panels share the stage camera. Minimap panels use an off-axis\n\t\t\t\t// screen camera, so leave them out of this pass and draw them separately.\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tif (panel.glass) {\n\t\t\t\t\t\tpanel.group.visible = panelVisibility[index] && !minimapPanelIndices.has(index);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (hasVisibleRegularPanel) {\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tthis.ports.renderer.render(this.ports.panelScene, this.ports.panelCamera);\n\t\t\t\t\tthis._panelSceneRenderPasses += 1;\n\t\t\t\t}\n\n\t\t\t\t// Keep the glass body in the same compositing layer as the other panels,\n\t\t\t\t// but retain the exact camera and transform used by its foreground model.\n\t\t\t\tvisibleMinimaps.forEach((active) => {\n\t\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\t\tif (panel.glass) {\n\t\t\t\t\t\t\tpanel.group.visible = panelVisibility[index] && index === active.panelIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tthis.ports.renderer.render(this.ports.panelScene, active.screenCamera);\n\t\t\t\t\tthis._panelSceneRenderPasses += 1;\n\t\t\t\t});\n\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tpanel.group.visible = panelVisibility[index];\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\tprivate renderMinimapScene() {\n\t\treturn withVisibility(\n\t\t\t[\n\t\t\t\t...this.ports.panelRuntimes().map((panel) => panel.group),\n\t\t\t\t...[...this.ports.minimaps().values()].flatMap((view) => [view.layer, view.spatialElementRoot])\n\t\t\t],\n\t\t\t() => {\n\t\t\t\tif (!this.ports.minimaps().size) return;\n\n\t\t\t\tconst minimaps = Array.from(this.ports.minimaps().values());\n\t\t\t\tconst visibleMinimaps = minimaps.filter(\n\t\t\t\t\t(minimap) =>\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tthis.ports.getPanelTransitionOpacity(this.ports.panelRuntimes()[minimap.panelIndex]) >\n\t\t\t\t\t\t\t0.001\n\t\t\t\t);\n\t\t\t\tif (!visibleMinimaps.length) return;\n\t\t\t\tconst panelVisibility = this.ports.panelRuntimes().map((panel) => panel.group.visible);\n\n\t\t\t\tvisibleMinimaps.forEach((active) => {\n\t\t\t\t\tminimaps.forEach((minimap) => {\n\t\t\t\t\t\tminimap.layer.visible = minimap === active;\n\t\t\t\t\t});\n\t\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\t\tif (panel.glass) panel.group.visible = index === active.panelIndex;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tactive.overlayComposite.visible &&\n\t\t\t\t\t\t(!active.overlayCaptureValid ||\n\t\t\t\t\t\t\t(this.measurementMode !== 'reuse-capture' && active.overlayCaptureDirty))\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.ports.renderMinimapBlur(active);\n\t\t\t\t\t\tactive.overlayCaptureDirty = false;\n\t\t\t\t\t\tactive.overlayCaptureValid = true;\n\t\t\t\t\t\tthis._minimapOverlayCapturePasses += 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tactive.overlayComposite.visible &&\n\t\t\t\t\t\tthis.ports.panelRuntimes()[active.panelIndex]?.surface === 'glass' &&\n\t\t\t\t\t\t(!active.panelCaptureValid ||\n\t\t\t\t\t\t\t(this.measurementMode !== 'reuse-capture' && active.panelCaptureDirty))\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.ports.renderMinimapPanelCapture(active);\n\t\t\t\t\t\tactive.panelCaptureDirty = false;\n\t\t\t\t\t\tactive.panelCaptureValid = true;\n\t\t\t\t\t}\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tconst spatialElementVisible = active.spatialElementRoot.visible;\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.ports.frame().catalogDockTarget &&\n\t\t\t\t\t\tthis.ports.frame().catalogHandoff &&\n\t\t\t\t\t\t!this.ports.frame().catalogMotionComplete\n\t\t\t\t\t)\n\t\t\t\t\t\tactive.spatialElementRoot.visible = false;\n\t\t\t\t\tthis.ports.renderer.render(this.ports.minimapScene(), active.screenCamera);\n\t\t\t\t\tactive.spatialElementRoot.visible = spatialElementVisible;\n\t\t\t\t\tthis._minimapSceneRenderPasses += 1;\n\t\t\t\t});\n\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tpanel.group.visible = panelVisibility[index];\n\t\t\t\t});\n\t\t\t\tminimaps.forEach((minimap) => {\n\t\t\t\t\tminimap.layer.visible =\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tthis.ports.getPanelTransitionOpacity(this.ports.panelRuntimes()[minimap.panelIndex]) >\n\t\t\t\t\t\t\t0.001;\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\trenderModelOutline(target: THREE.RenderTarget | null, opacity = 1) {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\tif (this.renderMeasurement === 'no-halo') return;\n\t\tconst opacityBefore = this.outlineOpacityScale.value;\n\t\ttry {\n\t\t\treturn withRendererState(this.ports.renderer, () => {\n\t\t\t\tif (\n\t\t\t\t\t!this.ports.frame().stageViewportVisible ||\n\t\t\t\t\t!(this.ports.frame().modelHover || this.ports.frame().modelInteractionActive) ||\n\t\t\t\t\t!this.outlineMaskTarget ||\n\t\t\t\t\t!this.outlineQuad\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tconst previousClearAlpha = this.ports.renderer.getClearAlpha();\n\t\t\t\tconst previousClearColor = this.ports.renderer.getClearColor(new THREE.Color());\n\t\t\t\tconst previousOpacity = this.outlineOpacityScale.value;\n\n\t\t\t\tif (this.renderMeasurement !== 'halo-frozen-mask' || !this.outlineMaskValid) {\n\t\t\t\t\tthis.ports.renderer.setRenderTarget(this.outlineMaskTarget);\n\t\t\t\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t\tthis.ports.renderer.render(this.outlineMaskScene, this.ports.camera);\n\t\t\t\t\tthis.outlineMaskValid = true;\n\t\t\t\t}\n\t\t\t\tthis.ports.renderer.setClearColor(previousClearColor, previousClearAlpha);\n\t\t\t\tthis.ports.renderer.setRenderTarget(target);\n\n\t\t\t\tthis.outlineOpacityScale.value = opacity;\n\t\t\t\t// Glass can refract the sharp scene capture, so keep the halo in that\n\t\t\t\t// capture while a glass surface is visible. Forced fusion is a test probe.\n\t\t\t\tconst fuseThisFrame =\n\t\t\t\t\tthis.fuseOutline &&\n\t\t\t\t\t(this.renderMeasurement === 'halo-fused' ||\n\t\t\t\t\t\t!this.ports\n\t\t\t\t\t\t\t.panelRuntimes()\n\t\t\t\t\t\t\t.some((panel) => panel.surface === 'glass' && panel.group.visible));\n\t\t\t\tif (fuseThisFrame) this.displayOutlineOpacity.value = opacity;\n\t\t\t\telse if (this.renderMeasurement !== 'halo-mask-only')\n\t\t\t\t\tthis.outlineQuad.render(this.ports.renderer);\n\t\t\t\tthis.outlineOpacityScale.value = previousOpacity;\n\t\t\t});\n\t\t} finally {\n\t\t\tthis.outlineOpacityScale.value = opacityBefore;\n\t\t}\n\t}\n\trenderPanelBlurCaptures(renderTargets: StageRenderTargetSet, forceAll = false) {\n\t\tconst visibleBlurKeys = forceAll\n\t\t\t? undefined\n\t\t\t: new Set(\n\t\t\t\t\tthis.ports.panelRuntimes().flatMap((panel, index) => {\n\t\t\t\t\t\tif (!panel.group.visible) return [];\n\t\t\t\t\t\tconst needsGlassCapture = panel.surface === 'glass' && Boolean(panel.glass);\n\t\t\t\t\t\tconst needsFrostedMinimapCapture =\n\t\t\t\t\t\t\tpanel.surface === 'frosted' &&\n\t\t\t\t\t\t\tBoolean(this.ports.minimaps().get(index)?.overlayComposite.visible);\n\t\t\t\t\t\treturn needsGlassCapture || needsFrostedMinimapCapture\n\t\t\t\t\t\t\t? [this.getPanelBlurKey(panel.options)]\n\t\t\t\t\t\t\t: [];\n\t\t\t\t\t})\n\t\t\t\t);\n\t\trenderTargets.panelBlurCaptures.forEach(({ target, quad }, blurKey) => {\n\t\t\tif (visibleBlurKeys && !visibleBlurKeys.has(blurKey)) return;\n\t\t\tconst size = `${target.width}:${target.height}`;\n\t\t\tif (\n\t\t\t\tthis.renderMeasurement === 'frozen-backdrop' &&\n\t\t\t\tthis.measuredBackdropSeeds.get(target) === size\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tthis.ports.renderer.setRenderTarget(target);\n\t\t\tthis.ports.renderer.clear();\n\t\t\tquad.render(this.ports.renderer);\n\t\t\tif (this.renderMeasurement === 'frozen-backdrop')\n\t\t\t\tthis.measuredBackdropSeeds.set(target, size);\n\t\t\tthis._panelBlurRenderPasses += 1;\n\t\t});\n\t}\n\trenderStageDisplay() {\n\t\tif (!this._stageDisplayQuad) return;\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.ports.renderer.setClearColor(0xffffff, 1);\n\t\tthis.ports.renderer.clear();\n\t\tthis._stageDisplayQuad.render(this.ports.renderer);\n\t}\n\trenderStageContents() {\n\t\tthis.ports.renderer.clear();\n\t\tthis.ports.renderer.render(this.ports.backgroundScene, this.ports.camera);\n\t\tthis.ports.renderer.render(this.ports.tintScene, this.ports.tintCamera);\n\t\tthis.backgroundCoverOpacity.value = 1 - this.ports.frame().backgroundReveal;\n\t\tif (this.backgroundCoverOpacity.value > 0) this.backgroundCover.render(this.ports.renderer);\n\t\tif (\n\t\t\tthis.ports.frame().stageViewportVisible &&\n\t\t\t(!this.ports.frame().catalogHandoff || this.ports.frame().catalogMotionComplete) &&\n\t\t\t(!this.ports.frame().catalog || this.ports.frame().pageModelReady)\n\t\t) {\n\t\t\tthis.ports.renderer.clearDepth();\n\t\t\tthis.ports.renderer.render(this.ports.scene, this.ports.camera);\n\t\t\tthis._stageModelRenderPasses += 1;\n\t\t}\n\t}\n\treleaseOutline() {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\tthis.displayOutlineMask.value = this.emptyOutlineMask;\n\t\tthis.outlineMaskModel?.removeFromParent();\n\t\tthis.outlineMaskMaterial?.dispose();\n\t\tthis.outlineCompositeMaterial?.dispose();\n\t\tthis.outlineMaskTarget?.dispose();\n\t\tthis.outlineMaskModel = undefined;\n\t\tthis.outlineMaskMaterial = undefined;\n\t\tthis.outlineCompositeMaterial = undefined;\n\t\tthis.outlineMaskTarget = undefined;\n\t\tthis.outlineQuad = undefined;\n\t}\n\tresizeOutline(width: number, height: number) {\n\t\tthis.outlineWidth = width;\n\t\tthis.outlineHeight = height;\n\t\tconst scale = this.renderMeasurement === 'halo-half-mask' ? 0.5 : 1;\n\t\tthis.outlineMaskTarget?.setSize(\n\t\t\tMath.max(1, Math.round(width * scale)),\n\t\t\tMath.max(1, Math.round(height * scale))\n\t\t);\n\t\tthis.outlineMaskValid = false;\n\t\tthis.outlineTexel.value.set(\n\t\t\tthis.ports.interactionTheme().outlineThickness / Math.max(width, 1),\n\t\t\tthis.ports.interactionTheme().outlineThickness / Math.max(height, 1)\n\t\t);\n\t\tthis.outlineGlowTexel.value.set(\n\t\t\t(this.ports.interactionTheme().outlineThickness *\n\t\t\t\tthis.ports.interactionTheme().outlineGlowThickness) /\n\t\t\t\tMath.max(width, 1),\n\t\t\t(this.ports.interactionTheme().outlineThickness *\n\t\t\t\tthis.ports.interactionTheme().outlineGlowThickness) /\n\t\t\t\tMath.max(height, 1)\n\t\t);\n\t}\n\tdispose() {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.releaseOutline();\n\t\tthis.emptyOutlineMask.dispose();\n\t\tthis.disposeSceneCapture();\n\t\tthis.backgroundCoverMaterial.dispose();\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.foregroundCanvasTarget?.dispose();\n\t\tthis.foregroundCanvasTarget = undefined;\n\t\tthis.carouselRearTarget?.dispose();\n\t\tthis.carouselRearTarget = undefined;\n\t\tthis.carouselRearCanvas?.remove();\n\t\tthis.foregroundCanvas?.remove();\n\t}\n\n\tget activeRenderTargets() {\n\t\treturn this._activeRenderTargets;\n\t}\n\tget stageDisplayQuad() {\n\t\treturn this._stageDisplayQuad;\n\t}\n\tget minimapOverlayCapturePasses() {\n\t\treturn this._minimapOverlayCapturePasses;\n\t}\n\tget renderTargetSetCreations() {\n\t\treturn this._renderTargetSetCreations;\n\t}\n\tget renderTargetSetResizes() {\n\t\treturn this._renderTargetSetResizes;\n\t}\n\tget renderTargetSetWarmups() {\n\t\treturn this._renderTargetSetWarmups;\n\t}\n\tget stageModelRenderPasses() {\n\t\treturn this._stageModelRenderPasses;\n\t}\n\tget panelBlurRenderPasses() {\n\t\treturn this._panelBlurRenderPasses;\n\t}\n\tget panelSceneRenderPasses() {\n\t\treturn this._panelSceneRenderPasses;\n\t}\n\tget minimapSceneRenderPasses() {\n\t\treturn this._minimapSceneRenderPasses;\n\t}\n\n\t/** The facade advances owners first; this command submits the ordered GPU passes. */\n\trenderFrame(contentOnly: boolean, outline: boolean) {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\treturn withRendererState(this.ports.renderer, () => {\n\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\tif (contentOnly) {\n\t\t\t\tthis.ports.renderer.setRenderTarget(null);\n\t\t\t\tif (!this.ports.frame().outgoingBackground) {\n\t\t\t\t\tthis.ports.renderer.setClearColor(0, 0);\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!this._activeRenderTargets) return;\n\t\t\t\tthis.ports.renderer.setRenderTarget(this._activeRenderTargets.sceneCapture);\n\t\t\t\tthis.ports.renderStage();\n\t\t\t\tthis.renderPanelBlurCaptures(this._activeRenderTargets);\n\t\t\t\tif (outline) this.renderModelOutline(this._activeRenderTargets.sceneCapture, 1);\n\t\t\t\tthis.renderStageDisplay();\n\t\t\t\tthis.renderBackgroundPanels();\n\t\t\t}\n\t\t\tthis.renderCarouselRear();\n\t\t\tthis.renderForegroundLayer();\n\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"StageRenderPipeline.js","sourceRoot":"","sources":["../../src/stage/StageRenderPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIvE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,C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CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;gBAChF,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC1B,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC/B,CAAC;YACD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { getRefinementSize } from './SpatialElementRefinement.js';\nimport { getMinimapMeasurementMode } from './minimapMeasurement.js';\nimport { parseRenderMeasurement } from './renderMeasurement.js';\nimport type { PreparedHigh } from '../catalog/CatalogPreparation.js';\nimport { gaussianTargets } from './renderTargetInventory.js';\nimport { withRendererState, withVisibility } from './rendererState.js';\n\nimport type { StagePanelRuntime } from './StagePanelRuntime.js';\n\nimport * as THREE from 'three/webgpu';\n\nimport { CatalogSpatialElementLayer } from '../catalog/CatalogSpatialElementLayer.js';\nimport { SpatialGeometryCapture } from '../catalog/SpatialGeometryCapture.js';\n\nimport { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';\nimport {\n\tFn,\n\tfloat,\n\tIf,\n\tmix,\n\tcolor,\n\tmax as tslMax,\n\tmin as tslMin,\n\tpremultiplyAlpha,\n\ttexture,\n\tuniform,\n\tuv,\n\tvec2,\n\tvec4\n} from 'three/tsl';\nimport type { Mesh, Object3D } from 'three';\nimport {\n\tinverseAcesToneMapping,\n\tSTAGE_TONE_MAPPING_EXPOSURE,\n\ttype LiquidGlassPanelOptions\n} from './LiquidGlassPanel.js';\n\nimport type { StageMinimapState } from './minimap/MinimapState.js';\nimport { isMesh } from './stageSceneUtils.js';\nimport type { StageInteractionTheme, StageRenderSettings } from './stageTypes.js';\nimport { getStageRenderPixelRatio, resolveStageRenderSettings } from './renderSettings.js';\ninterface PanelBlurCapture {\n\t/** Intermediate pixels per CSS pixel; independent of output DPR/scroll quality. */\n\tresolutionScale: number;\n\teffect?: ReturnType<typeof gaussianBlur>;\n\tmaterial: THREE.NodeMaterial;\n\tquad: THREE.QuadMesh;\n\ttarget: THREE.RenderTarget;\n}\ninterface StageRenderTargetSet {\n\tscale: number;\n\tsceneCapture: THREE.RenderTarget;\n\tpanelBlurCaptures: Map<number, PanelBlurCapture>;\n}\nconst SCROLL_RENDER_SCALE = 0.82;\n\nexport interface StageRenderPorts {\n\tpageBackground?: string;\n\trenderSettings?: StageRenderSettings;\n\trenderer: THREE.WebGPURenderer;\n\tcontainer: HTMLElement;\n\tbackgroundCanvas: HTMLCanvasElement;\n\tbackgroundCanvasTarget: THREE.CanvasTarget;\n\tscene: THREE.Scene;\n\tbackgroundScene: THREE.Scene;\n\ttintScene: THREE.Scene;\n\tpanelScene: THREE.Scene;\n\tcamera: THREE.PerspectiveCamera;\n\tpanelCamera: THREE.PerspectiveCamera;\n\ttintCamera: THREE.OrthographicCamera;\n\tpanelRuntimes(): readonly StagePanelRuntime[];\n\tminimaps(): ReadonlyMap<number, StageMinimapState>;\n\tminimapScene(): THREE.Scene;\n\tcatalogLayer(): Pick<CatalogSpatialElementLayer, 'hasCarousel' | 'renderRear' | 'draw'> | undefined;\n\tspatialCapture(): SpatialGeometryCapture | undefined;\n\texitingMinimaps(): readonly { capture: SpatialGeometryCapture; minimap: StageMinimapState }[];\n\tcontentSecondaries(): readonly { capture: SpatialGeometryCapture }[];\n\tfallbackPanelOptions(): readonly LiquidGlassPanelOptions[];\n\tinteractionTheme(): StageInteractionTheme;\n\tframe(): Readonly<{\n\t\toutgoingBackground: boolean;\n\t\tcatalogDockTarget: boolean;\n\t\tcatalogHandoff: boolean;\n\t\tcatalogMotionComplete: boolean;\n\t\tstageViewportVisible: boolean;\n\t\tmodelHover: boolean;\n\t\tmodelInteractionActive: boolean;\n\t\tcatalog: boolean;\n\t\tpageModelReady: boolean;\n\t\tbackgroundReveal: number;\n\t}>;\n\trenderStage(): void;\n\trenderMinimapBlur(minimap: StageMinimapState): void;\n\trenderMinimapPanelCapture(minimap: StageMinimapState): void;\n\tgetPanelTransitionOpacity(panel?: StagePanelRuntime): number;\n\tisInteractionMesh(mesh: Mesh): boolean;\n}\n\n/** Owns GPU output bands, passes and target lifetimes; never schedules frames or navigation. */\nexport class StageRenderPipeline {\n\tprivate readonly measurementMode = getMinimapMeasurementMode();\n\tprivate readonly renderMeasurement = parseRenderMeasurement(\n\t\ttypeof window === 'undefined' ? '' : (window.location?.search ?? '')\n\t);\n\tprivate readonly fuseOutline = ![\n\t\t'halo-separate',\n\t\t'halo-mask-only',\n\t\t'halo-frozen-mask',\n\t\t'halo-half-mask'\n\t].includes(this.renderMeasurement);\n\tprivate readonly measuredBackdropSeeds = new WeakMap<THREE.RenderTarget, string>();\n\tprivate readonly preparedZoomViews = new WeakSet<StageMinimapState>();\n\tprivate disposed = false;\n\tprivate renderSettings = resolveStageRenderSettings();\n\t/** Retain the last DETAIL background while its geometry is owned by a transition. */\n\tfreezeBackground() {\n\t\tconst targets = this._activeRenderTargets;\n\t\tif (!targets) return false;\n\t\twithRendererState(this.ports.renderer, () => {\n\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\tthis.ports.renderer.setRenderTarget(targets.sceneCapture);\n\t\t\tthis.renderStageContents();\n\t\t\tthis.renderStageDisplay();\n\t\t\tthis.renderBackgroundPanels();\n\t\t});\n\t\treturn true;\n\t}\n\tasync warmHigh(high: PreparedHigh, environment: THREE.Texture, drawLow: () => void) {\n\t\tconst scene = new THREE.Scene();\n\t\tscene.environment = environment;\n\t\tscene.environmentIntensity = 0.5;\n\t\tscene.add(high.pose);\n\t\tconst camera = new THREE.PerspectiveCamera(\n\t\t\t45,\n\t\t\twindow.innerWidth / window.innerHeight,\n\t\t\t0.01,\n\t\t\t100\n\t\t);\n\t\tcamera.position.z = 5;\n\t\tconst size = this.ports.renderer.getDrawingBufferSize(new THREE.Vector2());\n\t\tconst warmSize = getRefinementSize(size.x, size.y);\n\t\tconst target = new THREE.RenderTarget(warmSize.width, warmSize.height, {\n\t\t\ttype: THREE.HalfFloatType,\n\t\t\tsamples: 4\n\t\t});\n\t\tconst destination = this.ports.renderer.getRenderTarget();\n\t\tconst clear = this.ports.renderer.getClearColor(new THREE.Color());\n\t\tconst alpha = this.ports.renderer.getClearAlpha();\n\t\ttry {\n\t\t\tthis.ports.renderer.setRenderTarget(target);\n\t\t\tthis.ports.renderer.setClearColor(0, 0);\n\t\t\thigh.blend.render(\n\t\t\t\tthis.ports.renderer,\n\t\t\t\t(useHigh) => {\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t\tif (useHigh) this.ports.renderer.render(scene, camera);\n\t\t\t\t\telse drawLow();\n\t\t\t\t},\n\t\t\t\tfalse,\n\t\t\t\t0\n\t\t\t);\n\t\t} finally {\n\t\t\tthis.ports.renderer.setRenderTarget(destination);\n\t\t\tthis.ports.renderer.setClearColor(clear, alpha);\n\t\t\thigh.pose.removeFromParent();\n\t\t\ttarget.dispose();\n\t\t}\n\t\tconst device = (this.ports.renderer.backend as unknown as { device?: GPUDevice }).device;\n\t\tawait device?.queue.onSubmittedWorkDone();\n\t}\n\n\tgetRenderTargets() {\n\t\treturn [\n\t\t\t...(this.outlineMaskTarget ? [this.outlineMaskTarget] : []),\n\t\t\t...[this.fullQualityTargets, this.scrollQualityTargets].flatMap((set) =>\n\t\t\t\tset\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tset.sceneCapture,\n\t\t\t\t\t\t\t...[...set.panelBlurCaptures.values()].flatMap((blur) => [\n\t\t\t\t\t\t\t\tblur.target,\n\t\t\t\t\t\t\t\t...gaussianTargets(blur.effect)\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)\n\t\t];\n\t}\n\tgetCanvasOutputs() {\n\t\treturn [\n\t\t\tthis.ports.backgroundCanvasTarget,\n\t\t\tthis.foregroundCanvasTarget,\n\t\t\tthis.carouselRearTarget\n\t\t].flatMap((target, index) => {\n\t\t\tif (!target) return [];\n\t\t\tconst size = target.getDrawingBufferSize(new THREE.Vector2());\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tband: ['background', 'foreground', 'carousel-rear'][index],\n\t\t\t\t\twidth: size.x,\n\t\t\t\t\theight: size.y,\n\t\t\t\t\tcolorAttachments: 1,\n\t\t\t\t\tdepthAttachments: 1\n\t\t\t\t}\n\t\t\t];\n\t\t});\n\t}\n\tconstructor(private readonly ports: StageRenderPorts) {\n\t\tthis.setRenderSettings(ports.renderSettings);\n\t\tthis.setPageBackground(ports.pageBackground ?? '#ffffff');\n\t\tthis.backgroundCoverMaterial.fragmentNode = premultiplyAlpha(\n\t\t\tvec4(inverseAcesToneMapping(this.backgroundCoverColor), this.backgroundCoverOpacity)\n\t\t);\n\t\tthis.backgroundCoverMaterial.depthTest = this.backgroundCoverMaterial.depthWrite = false;\n\t\tthis.backgroundCoverMaterial.transparent =\n\t\t\tthis.backgroundCoverMaterial.premultipliedAlpha = true;\n\t\tthis.backgroundCoverMaterial.toneMapped = false;\n\t}\n\tprivate readonly backgroundCoverOpacity = uniform(0);\n\tprivate readonly backgroundCoverColor = uniform(new THREE.Vector3(1, 1, 1));\n\tsetPageBackground(value: string) {\n\t\tconst color = new THREE.Color(value);\n\t\tthis.backgroundCoverColor.value.set(color.r, color.g, color.b);\n\t}\n\tprivate readonly backgroundCoverMaterial = new THREE.NodeMaterial();\n\tprivate readonly backgroundCover = new THREE.QuadMesh(this.backgroundCoverMaterial);\n\tprivate readonly outlineMaskScene = new THREE.Scene();\n\tprivate _minimapOverlayCapturePasses = 0;\n\tprivate _renderTargetSetCreations = 0;\n\tprivate _renderTargetSetResizes = 0;\n\tprivate _renderTargetSetWarmups = 0;\n\tprivate _stageModelRenderPasses = 0;\n\tprivate _panelBlurRenderPasses = 0;\n\tprivate _panelSceneRenderPasses = 0;\n\tprivate _minimapSceneRenderPasses = 0;\n\tprivate outlineMaskModel?: Object3D;\n\tprivate outlineMaskMaterial?: THREE.MeshBasicMaterial;\n\tprivate outlineCompositeMaterial?: THREE.MeshBasicNodeMaterial;\n\tprivate outlineQuad?: THREE.QuadMesh;\n\tprivate outlineMaskTarget?: THREE.RenderTarget;\n\tprivate outlineMaskValid = false;\n\tprivate readonly emptyOutlineMask = new THREE.DataTexture(new Uint8Array(4), 1, 1);\n\tprivate readonly displayOutlineMask = texture(this.emptyOutlineMask);\n\tprivate readonly displayOutlineOpacity = uniform(0);\n\tprivate outlineWidth = 1;\n\tprivate outlineHeight = 1;\n\tprivate outlineTexel = uniform(new THREE.Vector2(1, 1));\n\tprivate outlineGlowTexel = uniform(new THREE.Vector2(1, 1));\n\tprivate outlineOpacityScale = uniform(1);\n\tprivate fullQualityTargets?: StageRenderTargetSet;\n\tprivate scrollQualityTargets?: StageRenderTargetSet;\n\tprivate _activeRenderTargets?: StageRenderTargetSet;\n\tprivate stageDisplayMaterial?: THREE.NodeMaterial;\n\tprivate _stageDisplayQuad?: THREE.QuadMesh;\n\tprivate stageDisplayTextureNode?: THREE.TextureNode;\n\tprivate foregroundCanvasTarget?: THREE.CanvasTarget;\n\tprivate carouselRearTarget?: THREE.CanvasTarget;\n\tprivate carouselRearCanvas?: HTMLCanvasElement;\n\tprivate carouselRearSize = new THREE.Vector3();\n\tprivate foregroundCanvas?: HTMLCanvasElement;\n\tconfigureRenderer() {\n\t\tthis.ports.renderer.toneMapping = THREE.ACESFilmicToneMapping;\n\t\tthis.ports.renderer.toneMappingExposure = STAGE_TONE_MAPPING_EXPOSURE;\n\t\tthis.ports.renderer.setClearColor(0xffffff, 1);\n\t\tthis.ports.renderer.autoClear = false;\n\t\tthis.ports.backgroundCanvas.tabIndex = -1;\n\t\tthis.ports.backgroundCanvas.style.touchAction = 'pan-y';\n\t}\n\trenderCarouselRear() {\n\t\tif (!this.carouselRearTarget && !this.ports.catalogLayer()?.hasCarousel()) return;\n\t\tif (!this.carouselRearTarget) {\n\t\t\tconst canvas = document.createElement('canvas');\n\t\t\tcanvas.className = 'stage-webgpu-carousel-rear';\n\t\t\tcanvas.setAttribute('aria-hidden', 'true');\n\t\t\tthis.carouselRearCanvas = canvas;\n\t\t\tthis.carouselRearTarget = new THREE.CanvasTarget(canvas);\n\t\t\tthis.ports.container.appendChild(canvas);\n\t\t}\n\t\tconst target = this.carouselRearTarget;\n\t\tconst width = window.innerWidth,\n\t\t\theight = window.innerHeight,\n\t\t\tratio = this.getFullPixelRatio();\n\t\tif (\n\t\t\tthis.carouselRearSize.x !== width ||\n\t\t\tthis.carouselRearSize.y !== height ||\n\t\t\tthis.carouselRearSize.z !== ratio\n\t\t) {\n\t\t\tthis.resizeCanvasTarget(target, width, height, ratio);\n\t\t\tthis.carouselRearSize.set(width, height, ratio);\n\t\t}\n\t\tthis.ports.renderer.setCanvasTarget(target);\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\tthis.ports.renderer.clear();\n\t\tthis.ports.catalogLayer()?.renderRear(this.ports.renderer);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t}\n\tcreateForegroundCanvas() {\n\t\tconst canvas = document.createElement('canvas');\n\t\tcanvas.className = 'stage-webgpu-foreground';\n\t\tcanvas.setAttribute('aria-hidden', 'true');\n\t\tthis.foregroundCanvas = canvas;\n\t\tthis.foregroundCanvasTarget = new THREE.CanvasTarget(canvas);\n\t\tthis.ports.container.appendChild(canvas);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t}\n\tcreateModelOutline(model: Object3D) {\n\t\tthis.outlineMaskModel?.removeFromParent();\n\t\tthis.outlineMaskMaterial?.dispose();\n\t\tthis.outlineCompositeMaterial?.dispose();\n\t\tthis.outlineMaskTarget?.dispose();\n\t\tthis.outlineMaskMaterial = new THREE.MeshBasicMaterial({\n\t\t\tcolor: 0xffffff,\n\t\t\tdepthTest: true,\n\t\t\tdepthWrite: true,\n\t\t\tside: THREE.DoubleSide,\n\t\t\ttoneMapped: false\n\t\t});\n\n\t\tconst maskModel = model.clone(true);\n\t\tmaskModel.traverse((child) => {\n\t\t\tif (!isMesh(child)) return;\n\n\t\t\tconst sourceMesh = this.findSourceMeshByName(model, child.name);\n\t\t\tconst include = sourceMesh\n\t\t\t\t? this.ports.isInteractionMesh(sourceMesh)\n\t\t\t\t: this.ports.isInteractionMesh(child);\n\t\t\tchild.visible = include;\n\t\t\tchild.material = this.outlineMaskMaterial!;\n\t\t});\n\n\t\tthis.outlineMaskModel = maskModel;\n\t\tthis.outlineMaskScene.add(maskModel);\n\t\tthis.outlineMaskTarget = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tsamples: 4\n\t\t});\n\t\tthis.outlineMaskTarget.texture.minFilter = THREE.LinearFilter;\n\t\tthis.outlineMaskTarget.texture.magFilter = THREE.LinearFilter;\n\t\tthis.outlineMaskTarget.texture.generateMipmaps = false;\n\t\tthis.displayOutlineMask.value = this.outlineMaskTarget.texture;\n\t\tthis.outlineCompositeMaterial = this.createOutlineCompositeMaterial(\n\t\t\tthis.outlineMaskTarget.texture\n\t\t);\n\t\tthis.outlineQuad = new THREE.QuadMesh(this.outlineCompositeMaterial);\n\t\t// High refinement can replace the silhouette long after the last window resize.\n\t\tthis.resizeOutline(this.outlineWidth, this.outlineHeight);\n\t}\n\tprivate findSourceMeshByName(root: Object3D, name: string) {\n\t\tlet source: Mesh | undefined;\n\t\troot.traverse((child) => {\n\t\t\tif (!source && isMesh(child) && child.name === name) source = child;\n\t\t});\n\n\t\treturn source;\n\t}\n\tprivate createOutlineOpacity(mask: THREE.TextureNode) {\n\t\tconst calculate = () => {\n\t\t\tconst texel = this.outlineTexel;\n\t\t\tconst glowTexel = this.outlineGlowTexel;\n\t\t\tconst sampleMaskRing = (sampleTexel: typeof texel, scale = 1) => {\n\t\t\t\tconst centerUv = uv();\n\t\t\t\tconst sampleX = sampleTexel.x.mul(scale);\n\t\t\t\tconst sampleY = sampleTexel.y.mul(scale);\n\t\t\t\tconst left = mask.sample(centerUv.sub(vec2(sampleX, 0))).r;\n\t\t\t\tconst right = mask.sample(centerUv.add(vec2(sampleX, 0))).r;\n\t\t\t\tconst up = mask.sample(centerUv.add(vec2(0, sampleY))).r;\n\t\t\t\tconst down = mask.sample(centerUv.sub(vec2(0, sampleY))).r;\n\t\t\t\tconst upLeft = mask.sample(centerUv.add(vec2(0, sampleY)).sub(vec2(sampleX, 0))).r;\n\t\t\t\tconst upRight = mask.sample(centerUv.add(vec2(sampleX, sampleY))).r;\n\t\t\t\tconst downLeft = mask.sample(centerUv.sub(vec2(sampleX, sampleY))).r;\n\t\t\t\tconst downRight = mask.sample(centerUv.add(vec2(sampleX, 0)).sub(vec2(0, sampleY))).r;\n\n\t\t\t\treturn {\n\t\t\t\t\taverage: left\n\t\t\t\t\t\t.add(right)\n\t\t\t\t\t\t.add(up)\n\t\t\t\t\t\t.add(down)\n\t\t\t\t\t\t.add(upLeft)\n\t\t\t\t\t\t.add(upRight)\n\t\t\t\t\t\t.add(downLeft)\n\t\t\t\t\t\t.add(downRight)\n\t\t\t\t\t\t.div(8),\n\t\t\t\t\tmax: tslMax(\n\t\t\t\t\t\ttslMax(tslMax(left, right), tslMax(up, down)),\n\t\t\t\t\t\ttslMax(tslMax(upLeft, upRight), tslMax(downLeft, downRight))\n\t\t\t\t\t),\n\t\t\t\t\tmin: tslMin(\n\t\t\t\t\t\ttslMin(tslMin(left, right), tslMin(up, down)),\n\t\t\t\t\t\ttslMin(tslMin(upLeft, upRight), tslMin(downLeft, downRight))\n\t\t\t\t\t)\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst edgeNeighbor = sampleMaskRing(texel);\n\t\t\tconst glowNearNeighbor = sampleMaskRing(glowTexel, 0.45);\n\t\t\tconst glowMidNeighbor = sampleMaskRing(glowTexel, 0.7);\n\t\t\tconst glowFarNeighbor = sampleMaskRing(glowTexel);\n\t\t\tconst center = mask.sample(uv()).r;\n\t\t\tconst outside = center.oneMinus();\n\t\t\tconst edgeGradient = edgeNeighbor.max.sub(center).max(0);\n\t\t\tconst core = edgeGradient.mul(this.ports.interactionTheme().outlineOpacity);\n\t\t\t// Average neighbouring coverage, rather than dilating a solid band. Keep the\n\t\t\t// halo outside the spatialElement so it cannot be mistaken for painted geometry.\n\t\t\tconst glowNear = glowNearNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.ports.interactionTheme().outlineGlow * 0.6);\n\t\t\tconst glowMid = glowMidNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.ports.interactionTheme().outlineGlow * 0.3);\n\t\t\tconst glowFar = glowFarNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.ports.interactionTheme().outlineGlow * 0.1);\n\t\t\tconst opacity = tslMin(core.add(glowNear).add(glowMid).add(glowFar), 1).mul(\n\t\t\t\tthis.outlineOpacityScale\n\t\t\t);\n\n\t\t\treturn opacity;\n\t\t};\n\t\tif (this.renderMeasurement === 'halo-unconditional') return calculate();\n\t\treturn Fn(() => {\n\t\t\tconst opacity = float(0).toVar();\n\t\t\t// A fully covered pixel has zero outer halo. Skip all 32 neighbour taps there.\n\t\t\tIf(mask.sample(uv()).r.lessThan(1), () => {\n\t\t\t\topacity.assign(calculate());\n\t\t\t});\n\t\t\treturn opacity;\n\t\t})();\n\t}\n\tprivate createOutlineCompositeMaterial(maskTexture: THREE.Texture) {\n\t\tconst material = new THREE.MeshBasicNodeMaterial({\n\t\t\tblending: THREE.NormalBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false,\n\t\t\ttransparent: true\n\t\t});\n\t\tmaterial.colorNode = color(new THREE.Color(this.ports.interactionTheme().outlineColor));\n\t\tmaterial.opacityNode = this.createOutlineOpacity(texture(maskTexture));\n\t\tmaterial.toneMapped = false;\n\t\treturn material;\n\t}\n\tdisposeSceneCapture() {\n\t\tthis.disposeRenderTargetSet(this.fullQualityTargets);\n\t\tthis.disposeRenderTargetSet(this.scrollQualityTargets);\n\t\tthis.stageDisplayMaterial?.dispose();\n\t\tthis.fullQualityTargets = undefined;\n\t\tthis.scrollQualityTargets = undefined;\n\t\tthis._activeRenderTargets = undefined;\n\t\tthis.stageDisplayMaterial = undefined;\n\t\tthis._stageDisplayQuad = undefined;\n\t\tthis.stageDisplayTextureNode = undefined;\n\t}\n\tcreateSceneCapture() {\n\t\tconst blurKeys = new Set(\n\t\t\tthis.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options))\n\t\t);\n\t\tthis.fullQualityTargets = this.createRenderTargetSet(1, blurKeys);\n\t\tthis.scrollQualityTargets = this.createRenderTargetSet(SCROLL_RENDER_SCALE, blurKeys);\n\t\tthis._activeRenderTargets = this.fullQualityTargets;\n\n\t\tthis.stageDisplayTextureNode = texture(this.fullQualityTargets.sceneCapture.texture);\n\t\tthis.stageDisplayMaterial = new THREE.NodeMaterial();\n\t\t// CanvasTarget already runs WebGPURenderer's output transform after this\n\t\t// fullscreen copy. Keep the capture linear here so ACES and sRGB are applied\n\t\t// exactly once; using renderOutput() here would wash out the entire stage.\n\t\t// CanvasTarget unpremultiplies before tone mapping and premultiplies afterwards.\n\t\t// Environment visibility is applied before the hero; the composed capture stays opaque.\n\t\tthis.stageDisplayMaterial.fragmentNode = vec4(this.stageDisplayTextureNode.rgb, 1);\n\t\tif (this.fuseOutline) {\n\t\t\tthis.emptyOutlineMask.needsUpdate = true;\n\t\t\tconst source = this.stageDisplayTextureNode;\n\t\t\tconst haloColor = color(new THREE.Color(this.ports.interactionTheme().outlineColor));\n\t\t\tconst haloOpacity = this.createOutlineOpacity(this.displayOutlineMask);\n\t\t\t// Merge into the existing linear display pass before the canvas output transform.\n\t\t\tthis.stageDisplayMaterial.fragmentNode = Fn(() => {\n\t\t\t\tconst rgb = source.rgb.toVar();\n\t\t\t\tIf(this.displayOutlineOpacity.greaterThan(0), () => {\n\t\t\t\t\trgb.assign(mix(rgb, haloColor, haloOpacity.mul(this.displayOutlineOpacity)));\n\t\t\t\t});\n\t\t\t\treturn vec4(rgb, 1);\n\t\t\t})();\n\t\t}\n\t\tthis.stageDisplayMaterial.depthTest = false;\n\t\tthis.stageDisplayMaterial.depthWrite = false;\n\t\tthis.stageDisplayMaterial.blending = THREE.NoBlending;\n\t\tthis.stageDisplayMaterial.toneMapped = false;\n\t\tthis.stageDisplayMaterial.needsUpdate = true;\n\t\tthis._stageDisplayQuad = new THREE.QuadMesh(this.stageDisplayMaterial);\n\t}\n\tprivate createRenderTargetSet(\n\t\tscale: number,\n\t\tblurKeys: ReadonlySet<number>\n\t): StageRenderTargetSet {\n\t\tthis._renderTargetSetCreations += 1;\n\t\tconst sceneCapture = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tsamples: 4,\n\t\t\ttype: THREE.HalfFloatType\n\t\t});\n\t\tsceneCapture.texture.minFilter = THREE.LinearFilter;\n\t\tsceneCapture.texture.magFilter = THREE.LinearFilter;\n\t\tsceneCapture.texture.generateMipmaps = false;\n\t\tsceneCapture.texture.colorSpace = THREE.NoColorSpace;\n\n\t\tconst panelBlurCaptures = new Map<number, PanelBlurCapture>();\n\t\tblurKeys.forEach((blur) => {\n\t\t\tpanelBlurCaptures.set(blur, this.createPanelBlurCapture(sceneCapture.texture, blur, scale));\n\t\t});\n\n\t\treturn { scale, sceneCapture, panelBlurCaptures };\n\t}\n\tprivate disposeRenderTargetSet(targets?: StageRenderTargetSet) {\n\t\tif (!targets) return;\n\t\ttargets.sceneCapture.dispose();\n\t\ttargets.panelBlurCaptures.forEach(({ target, material, effect }) => {\n\t\t\ttarget.dispose();\n\t\t\tmaterial.dispose();\n\t\t\teffect?.dispose();\n\t\t});\n\t\ttargets.panelBlurCaptures.clear();\n\t}\n\tresizeRenderTargets() {\n\t\tconst width = window.innerWidth;\n\t\tconst height = window.innerHeight;\n\t\tconst pixelRatio = this.getFullPixelRatio();\n\t\tif (!this.ports.frame().outgoingBackground)\n\t\t\tthis.resizeCanvasTarget(this.ports.backgroundCanvasTarget, width, height, pixelRatio);\n\t\tif (this.foregroundCanvasTarget) {\n\t\t\tthis.resizeCanvasTarget(this.foregroundCanvasTarget, width, height, pixelRatio);\n\t\t}\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.resizeRenderTargetSet(this.fullQualityTargets, width, height, pixelRatio);\n\t\tthis.resizeRenderTargetSet(this.scrollQualityTargets, width, height, pixelRatio);\n\t}\n\tprivate resizeRenderTargetSet(\n\t\ttargets: StageRenderTargetSet | undefined,\n\t\twidth: number,\n\t\theight: number,\n\t\tpixelRatio: number\n\t) {\n\t\tif (!targets) return;\n\t\tthis._renderTargetSetResizes += 1;\n\t\tconst captureWidth = Math.max(1, Math.round(width * pixelRatio * targets.scale));\n\t\tconst captureHeight = Math.max(1, Math.round(height * pixelRatio * targets.scale));\n\t\ttargets.sceneCapture.setSize(captureWidth, captureHeight);\n\t\ttargets.panelBlurCaptures.forEach(({ target, effect, resolutionScale }) => {\n\t\t\tif (effect) {\n\t\t\t\tconst effectScale = resolutionScale / (pixelRatio * targets.scale);\n\t\t\t\teffect.resolutionScale = effectScale;\n\t\t\t\teffect.setSize(captureWidth, captureHeight);\n\t\t\t\t// Consumers sample normalized screen UVs. Preserve the blur's actual\n\t\t\t\t// density instead of copying it back to a full-DPR viewport texture.\n\t\t\t\ttarget.setSize(\n\t\t\t\t\tMath.max(1, Math.round(captureWidth * effectScale)),\n\t\t\t\t\tMath.max(1, Math.round(captureHeight * effectScale))\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// A zero-blur backdrop still contains sharp scene detail.\n\t\t\t\ttarget.setSize(captureWidth, captureHeight);\n\t\t\t}\n\t\t});\n\t}\n\tgetFullPixelRatio() {\n\t\treturn getStageRenderPixelRatio(\n\t\t\twindow.innerWidth,\n\t\t\twindow.innerHeight,\n\t\t\twindow.devicePixelRatio,\n\t\t\tthis.renderSettings\n\t\t);\n\t}\n\tsetRenderSettings(settings?: StageRenderSettings) {\n\t\tthis.renderSettings = resolveStageRenderSettings(settings);\n\t}\n\tgetRenderSettings() {\n\t\treturn { ...this.renderSettings };\n\t}\n\tsetScrollRenderQuality(active: boolean) {\n\t\tthis.ports.container.toggleAttribute('data-stage-scroll-rendering', active);\n\t\tconst nextTargets = active ? this.scrollQualityTargets : this.fullQualityTargets;\n\t\tif (!nextTargets || this._activeRenderTargets === nextTargets) return;\n\t\tthis.activateRenderTargetSet(nextTargets);\n\t}\n\tprivate activateRenderTargetSet(nextTargets: StageRenderTargetSet) {\n\t\tthis._activeRenderTargets = nextTargets;\n\t\tif (this.stageDisplayTextureNode) {\n\t\t\tthis.stageDisplayTextureNode.value = nextTargets.sceneCapture.texture;\n\t\t}\n\t\tthis.ports.panelRuntimes().forEach((runtime) => {\n\t\t\truntime.glass?.setBackdropTexture(this.getPanelBlurTexture(runtime.options, nextTargets));\n\t\t});\n\t\tthis.ports.minimaps().forEach((minimap) => {\n\t\t\tminimap.stageCaptureTexture.value = nextTargets.sceneCapture.texture;\n\t\t\tconst panel = this.ports.panelRuntimes()[minimap.panelIndex];\n\t\t\tif (panel) {\n\t\t\t\tminimap.stageBlurTexture.value =\n\t\t\t\t\tpanel.surface === 'solid'\n\t\t\t\t\t\t? nextTargets.sceneCapture.texture\n\t\t\t\t\t\t: this.getPanelBlurTexture(panel.options, nextTargets);\n\t\t\t}\n\t\t\tminimap.overlayCaptureDirty = true;\n\t\t});\n\t}\n\twarmRenderTargetSets() {\n\t\tconst previousTargets = this._activeRenderTargets;\n\t\tconst availableTargets = [this.fullQualityTargets, this.scrollQualityTargets].filter(\n\t\t\t(targets): targets is StageRenderTargetSet => Boolean(targets)\n\t\t);\n\t\tif (!previousTargets || !this._stageDisplayQuad || availableTargets.length !== 2) return;\n\t\t// Finish with the active/full-quality set so the warm-up itself cannot\n\t\t// leave a lower-resolution frame on the visible canvas.\n\t\tconst targetSets = [\n\t\t\t...availableTargets.filter((targets) => targets !== previousTargets),\n\t\t\tpreviousTargets\n\t\t];\n\n\t\ttry {\n\t\t\twithRendererState(this.ports.renderer, () => {\n\t\t\t\ttargetSets.forEach((targets) => {\n\t\t\t\t\tthis.activateRenderTargetSet(targets);\n\t\t\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\t\t\tthis.ports.renderer.setRenderTarget(targets.sceneCapture);\n\t\t\t\t\tthis.ports.renderStage();\n\t\t\t\t\tthis.renderPanelBlurCaptures(targets, true);\n\t\t\t\t\tthis.renderStageDisplay();\n\t\t\t\t\tthis.renderBackgroundPanels();\n\t\t\t\t\tthis._renderTargetSetWarmups += 1;\n\t\t\t\t});\n\t\t\t});\n\t\t} finally {\n\t\t\tthis.activateRenderTargetSet(previousTargets);\n\t\t}\n\t}\n\tprivate resizeCanvasTarget(\n\t\ttarget: THREE.CanvasTarget,\n\t\twidth: number,\n\t\theight: number,\n\t\tpixelRatio: number\n\t) {\n\t\tthis.ports.renderer.setCanvasTarget(target);\n\t\tthis.ports.renderer.setPixelRatio(pixelRatio);\n\t\tthis.ports.renderer.setSize(width, height, false);\n\t}\n\tprivate createPanelBlurCapture(\n\t\tsceneTexture: THREE.Texture,\n\t\tblur: number,\n\t\trenderScale: number\n\t): PanelBlurCapture {\n\t\tconst target = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: false,\n\t\t\tstencilBuffer: false\n\t\t});\n\t\ttarget.texture.minFilter = THREE.LinearFilter;\n\t\ttarget.texture.magFilter = THREE.LinearFilter;\n\t\ttarget.texture.generateMipmaps = false;\n\t\ttarget.texture.colorSpace = THREE.NoColorSpace;\n\n\t\tconst sourceTexture = texture(sceneTexture);\n\t\t// Scale resolution and sample offsets together to retain the CSS blur radius.\n\t\t// The final texture uses the same density and normalized screen-space mapping.\n\t\tconst query = new URLSearchParams(typeof window === 'undefined' ? '' : window.location?.search);\n\t\tconst fullResolutionProbe =\n\t\t\tquery.get('stage-test') === '1' && query.get('stage-backdrop') === 'full';\n\t\tconst blurResolution = blur >= 4 && !fullResolutionProbe ? 0.5 : 1;\n\t\tconst effect =\n\t\t\tblur > 0\n\t\t\t\t? gaussianBlur(sourceTexture, blurResolution, Math.max(1, Math.round(blur)), {\n\t\t\t\t\t\tresolutionScale: blurResolution / (this.getFullPixelRatio() * renderScale)\n\t\t\t\t\t})\n\t\t\t\t: undefined;\n\t\tconst material = new THREE.NodeMaterial();\n\t\tmaterial.colorNode = effect ?? sourceTexture;\n\t\tmaterial.needsUpdate = true;\n\n\t\treturn {\n\t\t\tresolutionScale: blurResolution,\n\t\t\teffect,\n\t\t\tmaterial,\n\t\t\tquad: new THREE.QuadMesh(material),\n\t\t\ttarget\n\t\t};\n\t}\n\tprivate getPanelBlurKey(options: LiquidGlassPanelOptions) {\n\t\tconst value = Number.isFinite(options.backdropBlur) ? (options.backdropBlur ?? 0) : 0;\n\t\treturn Math.round(THREE.MathUtils.clamp(value, 0, 100) * 100) / 100;\n\t}\n\tgetPanelBlurTexture(options: LiquidGlassPanelOptions, targets = this._activeRenderTargets) {\n\t\tconst blur = this.getPanelBlurKey(options);\n\t\tconst capture = targets?.panelBlurCaptures.get(blur);\n\t\tif (!capture) {\n\t\t\tthrow new Error(`No backdrop capture exists for panel blur ${blur}`);\n\t\t}\n\t\treturn capture.target.texture;\n\t}\n\t/** Prepare hidden close-up effects during page binding, never during camera motion.\n\t * Captures stay invalid: the first visible frame must still sample the live element.\n\t * Only compile the foreground scene, so preparation cannot paint an overlay on screen.\n\t */\n\tasync prepareZoomEffects() {\n\t\tif (!this.foregroundCanvasTarget || this.disposed) return;\n\t\tconst views = [...this.ports.minimaps().values()].filter(\n\t\t\t(view) => !this.preparedZoomViews.has(view)\n\t\t);\n\t\tif (!views.length) return;\n\t\tconst pending: Promise<unknown>[] = [];\n\t\tfor (const view of views) {\n\t\t\twithRendererState(this.ports.renderer, () => {\n\t\t\t\tthis.ports.renderMinimapBlur(view);\n\t\t\t\tif (this.ports.panelRuntimes()[view.panelIndex]?.surface === 'glass')\n\t\t\t\t\tthis.ports.renderMinimapPanelCapture(view);\n\t\t\t\tthis.ports.renderer.setCanvasTarget(this.foregroundCanvasTarget!);\n\t\t\t\tthis.ports.renderer.setRenderTarget(null);\n\t\t\t\tconst ringMaterial = view.overlayRing.material;\n\t\t\t\tconst compositeCulled = view.overlayComposite.frustumCulled;\n\t\t\t\tconst ringCulled = view.overlayRing.frustumCulled;\n\t\t\t\ttry {\n\t\t\t\t\t// A newly bound minimap camera may not yet have its screen projection.\n\t\t\t\t\t// Compile the hidden effects even if that initial frustum excludes them.\n\t\t\t\t\tview.overlayComposite.frustumCulled = false;\n\t\t\t\t\tview.overlayRing.frustumCulled = false;\n\t\t\t\t\twithVisibility(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...[...this.ports.minimaps().values()].map((entry) => entry.layer),\n\t\t\t\t\t\t\tview.overlayComposite,\n\t\t\t\t\t\t\tview.overlayRing\n\t\t\t\t\t\t],\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tfor (const entry of this.ports.minimaps().values())\n\t\t\t\t\t\t\t\tentry.layer.visible = entry === view;\n\t\t\t\t\t\t\tview.overlayComposite.visible = true;\n\t\t\t\t\t\t\tview.overlayRing.visible = true;\n\t\t\t\t\t\t\tfor (const material of [view.ringRestMaterial, view.ringForegroundMaterial]) {\n\t\t\t\t\t\t\t\tview.overlayRing.material = material;\n\t\t\t\t\t\t\t\tpending.push(\n\t\t\t\t\t\t\t\t\tthis.ports.renderer.compileAsync(this.ports.minimapScene(), view.screenCamera)\n\t\t\t\t\t\t\t\t);\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} finally {\n\t\t\t\t\tview.overlayRing.material = ringMaterial;\n\t\t\t\t\tview.overlayComposite.frustumCulled = compositeCulled;\n\t\t\t\t\tview.overlayRing.frustumCulled = ringCulled;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tawait Promise.all(pending);\n\t\tconst device = (this.ports.renderer.backend as unknown as { device?: GPUDevice }).device;\n\t\tawait device?.queue.onSubmittedWorkDone();\n\t\tif (!this.disposed) for (const view of views) this.preparedZoomViews.add(view);\n\t}\n\trenderForegroundLayer() {\n\t\tif (!this.foregroundCanvasTarget) return;\n\n\t\tthis.ports.renderer.setCanvasTarget(this.foregroundCanvasTarget);\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\tthis.ports.renderer.clear();\n\t\tthis.renderMinimapScene();\n\t\tfor (const entry of this.ports.exitingMinimaps())\n\t\t\tif (entry.minimap.displayOpacity > 0) entry.capture.render(this.ports.renderer);\n\t\tthis.ports.catalogLayer()?.draw(this.ports.renderer, 'front');\n\t\tfor (const entry of this.ports.contentSecondaries()) entry.capture.render(this.ports.renderer);\n\t\tthis.ports.spatialCapture()?.render(this.ports.renderer);\n\t}\n\trenderBackgroundPanels() {\n\t\treturn withVisibility(\n\t\t\tthis.ports.panelRuntimes().map((panel) => panel.group),\n\t\t\t() => {\n\t\t\t\tconst minimaps = Array.from(this.ports.minimaps().values());\n\t\t\t\tconst minimapPanelIndices = new Set(minimaps.map((minimap) => minimap.panelIndex));\n\t\t\t\tconst panelVisibility = this.ports.panelRuntimes().map((panel) => panel.group.visible);\n\t\t\t\tconst visibleMinimaps = minimaps.filter(\n\t\t\t\t\t(minimap) =>\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tpanelVisibility[minimap.panelIndex] &&\n\t\t\t\t\t\tBoolean(this.ports.panelRuntimes()[minimap.panelIndex]?.glass)\n\t\t\t\t);\n\t\t\t\tconst hasVisibleRegularPanel = this.ports\n\t\t\t\t\t.panelRuntimes()\n\t\t\t\t\t.some(\n\t\t\t\t\t\t(panel, index) =>\n\t\t\t\t\t\t\tBoolean(panel.glass) && panelVisibility[index] && !minimapPanelIndices.has(index)\n\t\t\t\t\t);\n\n\t\t\t\t// Regular panels share the stage camera. Minimap panels use an off-axis\n\t\t\t\t// screen camera, so leave them out of this pass and draw them separately.\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tif (panel.glass) {\n\t\t\t\t\t\tpanel.group.visible = panelVisibility[index] && !minimapPanelIndices.has(index);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (hasVisibleRegularPanel) {\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tthis.ports.renderer.render(this.ports.panelScene, this.ports.panelCamera);\n\t\t\t\t\tthis._panelSceneRenderPasses += 1;\n\t\t\t\t}\n\n\t\t\t\t// Keep the glass body in the same compositing layer as the other panels,\n\t\t\t\t// but retain the exact camera and transform used by its foreground model.\n\t\t\t\tvisibleMinimaps.forEach((active) => {\n\t\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\t\tif (panel.glass) {\n\t\t\t\t\t\t\tpanel.group.visible = panelVisibility[index] && index === active.panelIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tthis.ports.renderer.render(this.ports.panelScene, active.screenCamera);\n\t\t\t\t\tthis._panelSceneRenderPasses += 1;\n\t\t\t\t});\n\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tpanel.group.visible = panelVisibility[index];\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\tprivate renderMinimapScene() {\n\t\treturn withVisibility(\n\t\t\t[\n\t\t\t\t...this.ports.panelRuntimes().map((panel) => panel.group),\n\t\t\t\t...[...this.ports.minimaps().values()].flatMap((view) => [view.layer, view.spatialElementRoot])\n\t\t\t],\n\t\t\t() => {\n\t\t\t\tif (!this.ports.minimaps().size) return;\n\n\t\t\t\tconst minimaps = Array.from(this.ports.minimaps().values());\n\t\t\t\tconst visibleMinimaps = minimaps.filter(\n\t\t\t\t\t(minimap) =>\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tthis.ports.getPanelTransitionOpacity(this.ports.panelRuntimes()[minimap.panelIndex]) >\n\t\t\t\t\t\t\t0.001\n\t\t\t\t);\n\t\t\t\tif (!visibleMinimaps.length) return;\n\t\t\t\tconst panelVisibility = this.ports.panelRuntimes().map((panel) => panel.group.visible);\n\n\t\t\t\tvisibleMinimaps.forEach((active) => {\n\t\t\t\t\tminimaps.forEach((minimap) => {\n\t\t\t\t\t\tminimap.layer.visible = minimap === active;\n\t\t\t\t\t});\n\t\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\t\tif (panel.glass) panel.group.visible = index === active.panelIndex;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tactive.overlayComposite.visible &&\n\t\t\t\t\t\t(!active.overlayCaptureValid ||\n\t\t\t\t\t\t\t(this.measurementMode !== 'reuse-capture' && active.overlayCaptureDirty))\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.ports.renderMinimapBlur(active);\n\t\t\t\t\t\tactive.overlayCaptureDirty = false;\n\t\t\t\t\t\tactive.overlayCaptureValid = true;\n\t\t\t\t\t\tthis._minimapOverlayCapturePasses += 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tactive.overlayComposite.visible &&\n\t\t\t\t\t\tthis.ports.panelRuntimes()[active.panelIndex]?.surface === 'glass' &&\n\t\t\t\t\t\t(!active.panelCaptureValid ||\n\t\t\t\t\t\t\t(this.measurementMode !== 'reuse-capture' && active.panelCaptureDirty))\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.ports.renderMinimapPanelCapture(active);\n\t\t\t\t\t\tactive.panelCaptureDirty = false;\n\t\t\t\t\t\tactive.panelCaptureValid = true;\n\t\t\t\t\t}\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tconst spatialElementVisible = active.spatialElementRoot.visible;\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.ports.frame().catalogDockTarget &&\n\t\t\t\t\t\tthis.ports.frame().catalogHandoff &&\n\t\t\t\t\t\t!this.ports.frame().catalogMotionComplete\n\t\t\t\t\t)\n\t\t\t\t\t\tactive.spatialElementRoot.visible = false;\n\t\t\t\t\tthis.ports.renderer.render(this.ports.minimapScene(), active.screenCamera);\n\t\t\t\t\tactive.spatialElementRoot.visible = spatialElementVisible;\n\t\t\t\t\tthis._minimapSceneRenderPasses += 1;\n\t\t\t\t});\n\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tpanel.group.visible = panelVisibility[index];\n\t\t\t\t});\n\t\t\t\tminimaps.forEach((minimap) => {\n\t\t\t\t\tminimap.layer.visible =\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tthis.ports.getPanelTransitionOpacity(this.ports.panelRuntimes()[minimap.panelIndex]) >\n\t\t\t\t\t\t\t0.001;\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\trenderModelOutline(target: THREE.RenderTarget | null, opacity = 1) {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\tif (this.renderMeasurement === 'no-halo') return;\n\t\tconst opacityBefore = this.outlineOpacityScale.value;\n\t\ttry {\n\t\t\treturn withRendererState(this.ports.renderer, () => {\n\t\t\t\tif (\n\t\t\t\t\t!this.ports.frame().stageViewportVisible ||\n\t\t\t\t\t!this.ports.frame().modelHover ||\n\t\t\t\t\t!this.outlineMaskTarget ||\n\t\t\t\t\t!this.outlineQuad\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tconst previousClearAlpha = this.ports.renderer.getClearAlpha();\n\t\t\t\tconst previousClearColor = this.ports.renderer.getClearColor(new THREE.Color());\n\t\t\t\tconst previousOpacity = this.outlineOpacityScale.value;\n\n\t\t\t\tif (this.renderMeasurement !== 'halo-frozen-mask' || !this.outlineMaskValid) {\n\t\t\t\t\tthis.ports.renderer.setRenderTarget(this.outlineMaskTarget);\n\t\t\t\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t\tthis.ports.renderer.render(this.outlineMaskScene, this.ports.camera);\n\t\t\t\t\tthis.outlineMaskValid = true;\n\t\t\t\t}\n\t\t\t\tthis.ports.renderer.setClearColor(previousClearColor, previousClearAlpha);\n\t\t\t\tthis.ports.renderer.setRenderTarget(target);\n\n\t\t\t\tthis.outlineOpacityScale.value = opacity;\n\t\t\t\t// Glass can refract the sharp scene capture, so keep the halo in that\n\t\t\t\t// capture while a glass surface is visible. Forced fusion is a test probe.\n\t\t\t\tconst fuseThisFrame =\n\t\t\t\t\tthis.fuseOutline &&\n\t\t\t\t\t(this.renderMeasurement === 'halo-fused' ||\n\t\t\t\t\t\t!this.ports\n\t\t\t\t\t\t\t.panelRuntimes()\n\t\t\t\t\t\t\t.some((panel) => panel.surface === 'glass' && panel.group.visible));\n\t\t\t\tif (fuseThisFrame) this.displayOutlineOpacity.value = opacity;\n\t\t\t\telse if (this.renderMeasurement !== 'halo-mask-only')\n\t\t\t\t\tthis.outlineQuad.render(this.ports.renderer);\n\t\t\t\tthis.outlineOpacityScale.value = previousOpacity;\n\t\t\t});\n\t\t} finally {\n\t\t\tthis.outlineOpacityScale.value = opacityBefore;\n\t\t}\n\t}\n\trenderPanelBlurCaptures(renderTargets: StageRenderTargetSet, forceAll = false) {\n\t\tconst visibleBlurKeys = forceAll\n\t\t\t? undefined\n\t\t\t: new Set(\n\t\t\t\t\tthis.ports.panelRuntimes().flatMap((panel, index) => {\n\t\t\t\t\t\tif (!panel.group.visible) return [];\n\t\t\t\t\t\tconst needsGlassCapture = panel.surface === 'glass' && Boolean(panel.glass);\n\t\t\t\t\t\tconst needsFrostedMinimapCapture =\n\t\t\t\t\t\t\tpanel.surface === 'frosted' &&\n\t\t\t\t\t\t\tBoolean(this.ports.minimaps().get(index)?.overlayComposite.visible);\n\t\t\t\t\t\treturn needsGlassCapture || needsFrostedMinimapCapture\n\t\t\t\t\t\t\t? [this.getPanelBlurKey(panel.options)]\n\t\t\t\t\t\t\t: [];\n\t\t\t\t\t})\n\t\t\t\t);\n\t\trenderTargets.panelBlurCaptures.forEach(({ target, quad }, blurKey) => {\n\t\t\tif (visibleBlurKeys && !visibleBlurKeys.has(blurKey)) return;\n\t\t\tconst size = `${target.width}:${target.height}`;\n\t\t\tif (\n\t\t\t\tthis.renderMeasurement === 'frozen-backdrop' &&\n\t\t\t\tthis.measuredBackdropSeeds.get(target) === size\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tthis.ports.renderer.setRenderTarget(target);\n\t\t\tthis.ports.renderer.clear();\n\t\t\tquad.render(this.ports.renderer);\n\t\t\tif (this.renderMeasurement === 'frozen-backdrop')\n\t\t\t\tthis.measuredBackdropSeeds.set(target, size);\n\t\t\tthis._panelBlurRenderPasses += 1;\n\t\t});\n\t}\n\trenderStageDisplay() {\n\t\tif (!this._stageDisplayQuad) return;\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.ports.renderer.setClearColor(0xffffff, 1);\n\t\tthis.ports.renderer.clear();\n\t\tthis._stageDisplayQuad.render(this.ports.renderer);\n\t}\n\trenderStageContents() {\n\t\tthis.ports.renderer.clear();\n\t\tthis.ports.renderer.render(this.ports.backgroundScene, this.ports.camera);\n\t\tthis.ports.renderer.render(this.ports.tintScene, this.ports.tintCamera);\n\t\tthis.backgroundCoverOpacity.value = 1 - this.ports.frame().backgroundReveal;\n\t\tif (this.backgroundCoverOpacity.value > 0) this.backgroundCover.render(this.ports.renderer);\n\t\tif (\n\t\t\tthis.ports.frame().stageViewportVisible &&\n\t\t\t(!this.ports.frame().catalogHandoff || this.ports.frame().catalogMotionComplete) &&\n\t\t\t(!this.ports.frame().catalog || this.ports.frame().pageModelReady)\n\t\t) {\n\t\t\tthis.ports.renderer.clearDepth();\n\t\t\tthis.ports.renderer.render(this.ports.scene, this.ports.camera);\n\t\t\tthis._stageModelRenderPasses += 1;\n\t\t}\n\t}\n\treleaseOutline() {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\tthis.displayOutlineMask.value = this.emptyOutlineMask;\n\t\tthis.outlineMaskModel?.removeFromParent();\n\t\tthis.outlineMaskMaterial?.dispose();\n\t\tthis.outlineCompositeMaterial?.dispose();\n\t\tthis.outlineMaskTarget?.dispose();\n\t\tthis.outlineMaskModel = undefined;\n\t\tthis.outlineMaskMaterial = undefined;\n\t\tthis.outlineCompositeMaterial = undefined;\n\t\tthis.outlineMaskTarget = undefined;\n\t\tthis.outlineQuad = undefined;\n\t}\n\tresizeOutline(width: number, height: number) {\n\t\tthis.outlineWidth = width;\n\t\tthis.outlineHeight = height;\n\t\tconst scale = this.renderMeasurement === 'halo-half-mask' ? 0.5 : 1;\n\t\tthis.outlineMaskTarget?.setSize(\n\t\t\tMath.max(1, Math.round(width * scale)),\n\t\t\tMath.max(1, Math.round(height * scale))\n\t\t);\n\t\tthis.outlineMaskValid = false;\n\t\tthis.outlineTexel.value.set(\n\t\t\tthis.ports.interactionTheme().outlineThickness / Math.max(width, 1),\n\t\t\tthis.ports.interactionTheme().outlineThickness / Math.max(height, 1)\n\t\t);\n\t\tthis.outlineGlowTexel.value.set(\n\t\t\t(this.ports.interactionTheme().outlineThickness *\n\t\t\t\tthis.ports.interactionTheme().outlineGlowThickness) /\n\t\t\t\tMath.max(width, 1),\n\t\t\t(this.ports.interactionTheme().outlineThickness *\n\t\t\t\tthis.ports.interactionTheme().outlineGlowThickness) /\n\t\t\t\tMath.max(height, 1)\n\t\t);\n\t}\n\tdispose() {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.releaseOutline();\n\t\tthis.emptyOutlineMask.dispose();\n\t\tthis.disposeSceneCapture();\n\t\tthis.backgroundCoverMaterial.dispose();\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.foregroundCanvasTarget?.dispose();\n\t\tthis.foregroundCanvasTarget = undefined;\n\t\tthis.carouselRearTarget?.dispose();\n\t\tthis.carouselRearTarget = undefined;\n\t\tthis.carouselRearCanvas?.remove();\n\t\tthis.foregroundCanvas?.remove();\n\t}\n\n\tget activeRenderTargets() {\n\t\treturn this._activeRenderTargets;\n\t}\n\tget stageDisplayQuad() {\n\t\treturn this._stageDisplayQuad;\n\t}\n\tget minimapOverlayCapturePasses() {\n\t\treturn this._minimapOverlayCapturePasses;\n\t}\n\tget renderTargetSetCreations() {\n\t\treturn this._renderTargetSetCreations;\n\t}\n\tget renderTargetSetResizes() {\n\t\treturn this._renderTargetSetResizes;\n\t}\n\tget renderTargetSetWarmups() {\n\t\treturn this._renderTargetSetWarmups;\n\t}\n\tget stageModelRenderPasses() {\n\t\treturn this._stageModelRenderPasses;\n\t}\n\tget panelBlurRenderPasses() {\n\t\treturn this._panelBlurRenderPasses;\n\t}\n\tget panelSceneRenderPasses() {\n\t\treturn this._panelSceneRenderPasses;\n\t}\n\tget minimapSceneRenderPasses() {\n\t\treturn this._minimapSceneRenderPasses;\n\t}\n\n\t/** The facade advances owners first; this command submits the ordered GPU passes. */\n\trenderFrame(contentOnly: boolean, outline: boolean) {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\treturn withRendererState(this.ports.renderer, () => {\n\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\tif (contentOnly) {\n\t\t\t\tthis.ports.renderer.setRenderTarget(null);\n\t\t\t\tif (!this.ports.frame().outgoingBackground) {\n\t\t\t\t\tthis.ports.renderer.setClearColor(0, 0);\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!this._activeRenderTargets) return;\n\t\t\t\tthis.ports.renderer.setRenderTarget(this._activeRenderTargets.sceneCapture);\n\t\t\t\tthis.ports.renderStage();\n\t\t\t\tthis.renderPanelBlurCaptures(this._activeRenderTargets);\n\t\t\t\tif (outline) this.renderModelOutline(this._activeRenderTargets.sceneCapture, 1);\n\t\t\t\tthis.renderStageDisplay();\n\t\t\t\tthis.renderBackgroundPanels();\n\t\t\t}\n\t\t\tthis.renderCarouselRear();\n\t\t\tthis.renderForegroundLayer();\n\t\t});\n\t}\n}\n"]}
@@ -0,0 +1,22 @@
1
+ export declare const MODEL_INPUT_EVENT = "stage:model-input";
2
+ export interface ModelInputState {
3
+ hovered: boolean;
4
+ active: boolean;
5
+ }
6
+ export interface InteractionGuidanceState {
7
+ interacted: boolean;
8
+ }
9
+ /** One learning state per browser tab, shared across products and stage remounts. */
10
+ export declare class InteractionGuidance {
11
+ private readonly storage?;
12
+ private state;
13
+ private readonly listeners;
14
+ constructor(storage?: Pick<Storage, "getItem" | "setItem"> | undefined);
15
+ get snapshot(): Readonly<InteractionGuidanceState>;
16
+ interact(): void;
17
+ subscribe(listener: (state: Readonly<InteractionGuidanceState>) => void): () => void;
18
+ private update;
19
+ }
20
+ /** Lazy browser access keeps server rendering isolated between requests. */
21
+ export declare function getInteractionGuidance(target?: (Window & typeof globalThis) | undefined): InteractionGuidance;
22
+ //# sourceMappingURL=interactionGuidance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactionGuidance.d.ts","sourceRoot":"","sources":["../../src/stage/interactionGuidance.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,MAAM,WAAW,eAAe;IAAG,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE;AACtE,MAAM,WAAW,wBAAwB;IAAG,UAAU,EAAE,OAAO,CAAA;CAAE;AAGjE,qFAAqF;AACrF,qBAAa,mBAAmB;IAGnB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAFrC,OAAO,CAAC,KAAK,CAAmD;IAChE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkE;gBAC/D,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC,YAAA;IAM3E,IAAI,QAAQ,IAAI,QAAQ,CAAC,wBAAwB,CAAC,CAAuB;IACzE,QAAQ;IAGR,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,wBAAwB,CAAC,KAAK,IAAI;IAKvE,OAAO,CAAC,MAAM;CAKd;AAGD,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,MAAM,2CAAqD,uBAUjG"}
@@ -0,0 +1,53 @@
1
+ export const MODEL_INPUT_EVENT = 'stage:model-input';
2
+ const STORAGE_KEY = 'spatial-elements:interaction-guidance:v1';
3
+ /** One learning state per browser tab, shared across products and stage remounts. */
4
+ export class InteractionGuidance {
5
+ storage;
6
+ state = { interacted: false };
7
+ listeners = new Set();
8
+ constructor(storage) {
9
+ this.storage = storage;
10
+ try {
11
+ const saved = JSON.parse(storage?.getItem(STORAGE_KEY) ?? '{}');
12
+ this.state = { interacted: saved.interacted === true };
13
+ }
14
+ catch { /* Storage is optional, including in private browsing. */ }
15
+ }
16
+ get snapshot() { return this.state; }
17
+ interact() {
18
+ if (!this.state.interacted)
19
+ this.update({ interacted: true });
20
+ }
21
+ subscribe(listener) {
22
+ this.listeners.add(listener);
23
+ listener(this.state);
24
+ return () => { this.listeners.delete(listener); };
25
+ }
26
+ update(state) {
27
+ this.state = state;
28
+ try {
29
+ this.storage?.setItem(STORAGE_KEY, JSON.stringify(state));
30
+ }
31
+ catch { /* In-memory fallback. */ }
32
+ for (const listener of this.listeners)
33
+ listener(state);
34
+ }
35
+ }
36
+ const sessions = new WeakMap();
37
+ /** Lazy browser access keeps server rendering isolated between requests. */
38
+ export function getInteractionGuidance(target = typeof window === 'undefined' ? undefined : window) {
39
+ if (!target)
40
+ return new InteractionGuidance();
41
+ let session = sessions.get(target);
42
+ if (!session) {
43
+ let storage;
44
+ try {
45
+ storage = target.sessionStorage;
46
+ }
47
+ catch { /* Sandboxed/private context. */ }
48
+ session = new InteractionGuidance(storage);
49
+ sessions.set(target, session);
50
+ }
51
+ return session;
52
+ }
53
+ //# sourceMappingURL=interactionGuidance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactionGuidance.js","sourceRoot":"","sources":["../../src/stage/interactionGuidance.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAGrD,MAAM,WAAW,GAAG,0CAA0C,CAAC;AAE/D,qFAAqF;AACrF,MAAM,OAAO,mBAAmB;IAGF;IAFrB,KAAK,GAA6B,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;IAC/C,SAAS,GAAG,IAAI,GAAG,EAAuD,CAAC;IAC5F,YAA6B,OAA8C;QAA9C,YAAO,GAAP,OAAO,CAAuC;QAC1E,IAAI,CAAC;YACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,CAAC;YAChE,IAAI,CAAC,KAAK,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;QACxD,CAAC;QAAC,MAAM,CAAC,CAAC,yDAAyD,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,QAAQ,KAAyC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE,QAAQ;QACP,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU;YAAE,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,SAAS,CAAC,QAA6D;QACtE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC;IACO,MAAM,CAAC,KAA+B;QAC7C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC;YAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,yBAAyB,CAAC,CAAC;QACtG,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS;YAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;CACD;AAED,MAAM,QAAQ,GAAG,IAAI,OAAO,EAA+B,CAAC;AAC5D,4EAA4E;AAC5E,MAAM,UAAU,sBAAsB,CAAC,MAAM,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;IACjG,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,mBAAmB,EAAE,CAAC;IAC9C,IAAI,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,IAAI,OAA4B,CAAC;QACjC,IAAI,CAAC;YAAC,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,gCAAgC,CAAC,CAAC;QACnF,OAAO,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC3C,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["export const MODEL_INPUT_EVENT = 'stage:model-input';\nexport interface ModelInputState { hovered: boolean; active: boolean }\nexport interface InteractionGuidanceState { interacted: boolean }\nconst STORAGE_KEY = 'spatial-elements:interaction-guidance:v1';\n\n/** One learning state per browser tab, shared across products and stage remounts. */\nexport class InteractionGuidance {\n\tprivate state: InteractionGuidanceState = { interacted: false };\n\tprivate readonly listeners = new Set<(state: Readonly<InteractionGuidanceState>) => void>();\n\tconstructor(private readonly storage?: Pick<Storage, 'getItem' | 'setItem'>) {\n\t\ttry {\n\t\t\tconst saved = JSON.parse(storage?.getItem(STORAGE_KEY) ?? '{}');\n\t\t\tthis.state = { interacted: saved.interacted === true };\n\t\t} catch { /* Storage is optional, including in private browsing. */ }\n\t}\n\tget snapshot(): Readonly<InteractionGuidanceState> { return this.state; }\n\tinteract() {\n\t\tif (!this.state.interacted) this.update({ interacted: true });\n\t}\n\tsubscribe(listener: (state: Readonly<InteractionGuidanceState>) => void) {\n\t\tthis.listeners.add(listener);\n\t\tlistener(this.state);\n\t\treturn () => { this.listeners.delete(listener); };\n\t}\n\tprivate update(state: InteractionGuidanceState) {\n\t\tthis.state = state;\n\t\ttry { this.storage?.setItem(STORAGE_KEY, JSON.stringify(state)); } catch { /* In-memory fallback. */ }\n\t\tfor (const listener of this.listeners) listener(state);\n\t}\n}\n\nconst sessions = new WeakMap<Window, InteractionGuidance>();\n/** Lazy browser access keeps server rendering isolated between requests. */\nexport function getInteractionGuidance(target = typeof window === 'undefined' ? undefined : window) {\n\tif (!target) return new InteractionGuidance();\n\tlet session = sessions.get(target);\n\tif (!session) {\n\t\tlet storage: Storage | undefined;\n\t\ttry { storage = target.sessionStorage; } catch { /* Sandboxed/private context. */ }\n\t\tsession = new InteractionGuidance(storage);\n\t\tsessions.set(target, session);\n\t}\n\treturn session;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Gates CSS hover effects by the actual pointer, including on touch laptops.
3
+ * Capability media queries alone still allow sticky touch :hover on hybrid devices.
4
+ * The returned lifecycle also works as a Svelte action.
5
+ */
6
+ export declare function mouseHover(node: HTMLElement): {
7
+ destroy(): void;
8
+ };
9
+ //# sourceMappingURL=mouseHover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mouseHover.d.ts","sourceRoot":"","sources":["../../src/stage/mouseHover.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW;;EAuC3C"}