@roomle/web-sdk 5.1.0-alpha.3 → 5.1.0-alpha.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 (56) hide show
  1. package/lib/ConfiguratorKernel.wasm +0 -0
  2. package/lib/RoomleCore.wasm +0 -0
  3. package/lib/RoomleToolsCore.wasm +0 -0
  4. package/lib/{api-KWh-ESd5.mjs → api-Bznmr-xZ.mjs} +2 -2
  5. package/lib/{api-KWh-ESd5.mjs.map → api-Bznmr-xZ.mjs.map} +1 -1
  6. package/lib/asset-loader.worker-CzI1oyTY.mjs.map +1 -1
  7. package/lib/budgeteer.sw-D80jTmYa.mjs.map +1 -1
  8. package/lib/{component-dimensioning-luQ3LgrU.mjs → component-dimensioning-BaUqwqYJ.mjs} +2 -2
  9. package/lib/{component-dimensioning-luQ3LgrU.mjs.map → component-dimensioning-BaUqwqYJ.mjs.map} +1 -1
  10. package/lib/{component-raycast-helper-hj6sm7jw.mjs → component-raycast-helper-4i8b4E5B.mjs} +2 -2
  11. package/lib/{component-raycast-helper-hj6sm7jw.mjs.map → component-raycast-helper-4i8b4E5B.mjs.map} +1 -1
  12. package/lib/configurator-BYQdWEvf.mjs +2 -0
  13. package/lib/{configurator-CQ7KsW0O.mjs → configurator-CDw_c6tB.mjs} +4 -4
  14. package/lib/{configurator-CQ7KsW0O.mjs.map → configurator-CDw_c6tB.mjs.map} +1 -1
  15. package/lib/{glb-viewer-BWMMzvuG.mjs → glb-viewer-B-Zr743e.mjs} +4 -4
  16. package/lib/{glb-viewer-BWMMzvuG.mjs.map → glb-viewer-B-Zr743e.mjs.map} +1 -1
  17. package/lib/glb-viewer-Bd5Xn6Oq.mjs +2 -0
  18. package/lib/{highlight-coordinator-DYjBxYpy.mjs → highlight-coordinator-4gkjde82.mjs} +2 -2
  19. package/lib/{highlight-coordinator-DYjBxYpy.mjs.map → highlight-coordinator-4gkjde82.mjs.map} +1 -1
  20. package/lib/{homag-intelligence-lbse0Y0v.mjs → homag-intelligence-D7S7r-Gc.mjs} +3 -3
  21. package/lib/{homag-intelligence-lbse0Y0v.mjs.map → homag-intelligence-D7S7r-Gc.mjs.map} +1 -1
  22. package/lib/kernel-BWfRHWkW.mjs.map +1 -1
  23. package/lib/{material-viewer-BKTxh5Ui.mjs → material-viewer-CTsSfTfL.mjs} +4 -4
  24. package/lib/{material-viewer-BKTxh5Ui.mjs.map → material-viewer-CTsSfTfL.mjs.map} +1 -1
  25. package/lib/{packages-B4K6xrdJ.mjs → packages-BXAZEcKa.mjs} +5 -5
  26. package/lib/{packages-B4K6xrdJ.mjs.map → packages-BXAZEcKa.mjs.map} +1 -1
  27. package/lib/planner-DMk3T4ts.mjs +2 -0
  28. package/lib/{planner-HMMHSMAp.mjs → planner-jvLAnYww.mjs} +3 -3
  29. package/lib/{planner-HMMHSMAp.mjs.map → planner-jvLAnYww.mjs.map} +1 -1
  30. package/lib/roomle-headless.d.ts +21 -4
  31. package/lib/roomle-headless.js +8 -8
  32. package/lib/roomle-renderer-Ato6RMrd.mjs.map +1 -1
  33. package/lib/{roomle-sdk-5aB4wxLW.mjs → roomle-sdk-CBwhwX_e.mjs} +1263 -1226
  34. package/lib/roomle-sdk-CBwhwX_e.mjs.map +1 -0
  35. package/lib/roomle-sdk.d.ts +21 -4
  36. package/lib/roomle-sdk.js +7 -7
  37. package/lib/{scene-renderer-DXvavD4L.mjs → scene-renderer-BHYZac3H.mjs} +2 -2
  38. package/lib/{scene-renderer-DXvavD4L.mjs.map → scene-renderer-BHYZac3H.mjs.map} +1 -1
  39. package/lib/{script-loader-axxcKvph.mjs → script-loader-CvnG6LgL.mjs} +2 -2
  40. package/lib/{script-loader-axxcKvph.mjs.map → script-loader-CvnG6LgL.mjs.map} +1 -1
  41. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  42. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  43. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  44. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  45. package/lib/{stats-helper-BSmoG68E.mjs → stats-helper-PndcZCzL.mjs} +2 -2
  46. package/lib/{stats-helper-BSmoG68E.mjs.map → stats-helper-PndcZCzL.mjs.map} +1 -1
  47. package/lib/{threejs-utils-CLdyrCet.mjs → threejs-utils-v1uOvccg.mjs} +171 -180
  48. package/lib/threejs-utils-v1uOvccg.mjs.map +1 -0
  49. package/lib/{tools-core-DusxT3AY.mjs → tools-core-B29U-88K.mjs} +3 -3
  50. package/lib/{tools-core-DusxT3AY.mjs.map → tools-core-B29U-88K.mjs.map} +1 -1
  51. package/package.json +2 -2
  52. package/lib/configurator-ymHt9qjg.mjs +0 -2
  53. package/lib/glb-viewer-D5QHd6Da.mjs +0 -2
  54. package/lib/planner-BM825oIz.mjs +0 -2
  55. package/lib/roomle-sdk-5aB4wxLW.mjs.map +0 -1
  56. package/lib/threejs-utils-CLdyrCet.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"material-viewer-BKTxh5Ui.mjs","names":[],"sources":["../../packages/common-core/src/cameracontrol/material-viewer-camera-behaviour.ts","../../packages/material-viewer/src/webgl/material-viewer-scene-manager.ts","../../packages/material-viewer/src/roomle-material-viewer.ts","../../packages/material-viewer/src/roomle-material-viewer-ui-callback.ts","../../packages/material-viewer/src/utils/injectables.ts","../../packages/material-viewer/src/material-viewer.ts"],"sourcesContent":["import CameraBehaviour from './camera-behaviour';\nimport type AdjustableCameraControl3D from '../../../glb-viewer-core/src/camera-control/adjustable-camera-control-3d';\n\nexport default class MaterialViewerCameraBehaviour extends CameraBehaviour {\n public get cameraControl(): AdjustableCameraControl3D {\n return this._cameraControl as AdjustableCameraControl3D;\n }\n}\n","import SceneManager from '../../../common-core/src/webgl/scene-manager';\nimport type { GenericGUIParamFolder } from '../../../common-core/src/webgl/gui-types';\nimport type { RoomleWebGPURenderer } from '../../../common-core/src/webgpu/roomle-webgpu-renderer';\nimport type { CanvasOffset } from '../../../common-core/src/common-interfaces';\nimport type InputManager from '../../../common-core/src/input/input-manager';\nimport inject from '../../../common-core/src/di/inject';\nimport CameraControl3D from '../../../common-core/src/cameracontrol/camera-control-3d';\nimport type {\n RapiId,\n RapiMaterial,\n RapiMaterialShading,\n RapiTexture,\n} from '../../../typings/rapi-types';\nimport { RAPI_TEXTURE_TYPE } from '../../../typings/rapi-types';\nimport {\n addExistingTexture,\n addTexture,\n getWebGLGUI,\n getMaterialShading,\n setMaterial,\n getMaxTextures,\n} from '../../../common-core/src/utils/threejs-utils';\nimport { CAMERA_TYPE } from '../../../common-core/src/cameracontrol/camera-type';\nimport type ConfiguratorMeshGenerator from '../../../configurator-core/src/webgl/configurator-mesh-generator';\nimport type RoomleMaterialViewerUiCallback from '../roomle-material-viewer-ui-callback';\nimport BackgroundEnvironment from '../../../common-core/src/environment/background-environment';\nimport FloorEnvironment from '../../../configurator-core/src/webgl/environment/floor-environment';\nimport { type RapiAccess } from '../../../common-core/src/rapi-access';\nimport DynamicLightSettingLoader, {\n PREDEFINED_LIGHTSETTING,\n} from '../../../common-core/src/lightsetting/dynamic-light-setting-loader';\nimport { CANVAS_ID } from '../../../common-core/src/utils/dom-helper';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { MeshPhysicalMaterial } from 'three';\nimport {\n Box3,\n BoxGeometry,\n Color,\n DoubleSide,\n FrontSide,\n Mesh,\n PlaneGeometry,\n SphereGeometry,\n Texture,\n} from 'three';\nimport MaterialCreator from '../../../common-core/src/utils/material-creator';\nimport MaterialViewerCameraBehaviour from '../../../common-core/src/cameracontrol/material-viewer-camera-behaviour';\n\nexport const enum GEOMETRY {\n CUBE = 'cube',\n SPHERE = 'sphere',\n PLANE_VERTICAL = 'plane_vertical',\n PLANE_HORIZONTAL = 'plane_horizontal',\n}\n\nconst SIZE = { x: 1, y: 1, z: 1 };\nexport default class MaterialViewerSceneManager extends SceneManager {\n @inject\n private _inputManager: InputManager;\n\n @inject\n private _configuratorMeshGenerator: ConfiguratorMeshGenerator;\n\n @inject\n private _roomleMaterialViewerUiCallback: RoomleMaterialViewerUiCallback;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n private _gui: GenericGUIParamFolder | null;\n private _guiGeometryFolder: GenericGUIParamFolder | undefined;\n private _guiMaterialFolder: GenericGUIParamFolder | undefined;\n private _mesh: Mesh;\n private _material: MeshPhysicalMaterial;\n private _sceneParams = {\n type: GEOMETRY.CUBE,\n };\n private _materialParams = {\n color: '#ffffff',\n metallic: 0.5,\n alpha: 0,\n alphaCutoff: 0,\n doubleSided: false,\n };\n\n constructor(creator: string, offset: CanvasOffset) {\n super(creator, offset, CANVAS_ID.RMV, CAMERA_TYPE.CAMERA_3D);\n\n // Use lazy initialization for renderer-dependent settings\n this._initializeRendererSettings();\n\n this._initScene();\n }\n\n // If renderer is not ready yet, will retry on next tick.\n // This is necessary for dynamic WebGPU renderer imports.\n private _initializeRendererSettings(): void {\n if (!this._renderer) {\n // Retry on next tick if renderer not ready\n setTimeout(() => this._initializeRendererSettings(), 0);\n return;\n }\n\n const maxTextures = getMaxTextures(this._renderer);\n if (maxTextures > 8) {\n const lightSource =\n DynamicLightSettingLoader.createDynamicLightSettingSource(\n null,\n PREDEFINED_LIGHTSETTING.CAMERA,\n );\n if (lightSource) {\n this.loadDynamicLightSetting(lightSource);\n }\n }\n }\n\n private _initScene() {\n const geometry = new BoxGeometry(SIZE.x, SIZE.y, SIZE.z, 100, 100, 100);\n const meshPhysicalMaterial = MaterialCreator.createMeshPhysicalMaterial({\n color: this._initData.colors.PRIMARY,\n });\n this._setMaterial(meshPhysicalMaterial);\n this._mesh = new Mesh(geometry, this._material);\n this._mesh.castShadow = true;\n this._mesh.position.setY(SIZE.y / 2);\n this._scene.add(this._mesh);\n\n const { initialFloorMaterial } = this._initData;\n\n if (initialFloorMaterial) {\n this.changeFloorMaterialById(initialFloorMaterial);\n } else {\n this._environment = new BackgroundEnvironment(\n this._scene,\n undefined,\n new Color(0xffffff),\n );\n }\n\n if (this.cameraBehaviour.cameraControl instanceof CameraControl3D) {\n const boundingBox = new Box3();\n boundingBox.setFromObject(this._mesh);\n console.trace('reset camera');\n this.cameraBehaviour.cameraControl.updateAndReset(boundingBox);\n }\n\n void this.showGUI();\n }\n\n public loadMaterialId(materialId: RapiId): Promise<void> {\n return new Promise<void>((resolve) => {\n this._configuratorMeshGenerator\n .loadMaterial(materialId, SIZE.x * 1000, SIZE.y * 1000)\n .then((material) => {\n this._setMaterial(material as MeshPhysicalMaterial);\n this._mesh.material = this._material;\n this._updateGUI();\n this._requestRender();\n resolve();\n });\n });\n }\n\n public loadMaterial(material: RapiMaterial): Promise<void> {\n return new Promise<void>((resolve) => {\n // eslint-disable-next-line\n if (!material.__rapi_path__) {\n // eslint-disable-next-line\n material.__rapi_path__ = 'materials';\n }\n this._mesh.material = this._material;\n this._configuratorMeshGenerator\n .loadTextures(material, this._material, SIZE.x * 100, SIZE.y * 100)\n .then(() => {\n this._updateGUI();\n this._requestRender();\n });\n resolve();\n });\n }\n\n public loadMaterialShading(\n materialShading: RapiMaterialShading,\n ): Promise<void> {\n return new Promise<void>((resolve) => {\n let material = { shading: materialShading };\n this._setMaterial(setMaterial(this._material, material as RapiMaterial));\n this._mesh.material = this._material;\n this._updateGUI();\n this._requestRender();\n resolve();\n });\n }\n\n private _setMaterial(material: MeshPhysicalMaterial) {\n this._material = material;\n this._materialParams.alpha = material.opacity;\n this._materialParams.alphaCutoff = material.alphaTest;\n this._materialParams.color = '#' + material.color.getHexString();\n this._materialParams.doubleSided = material.side === DoubleSide;\n this._materialParams.metallic =\n material.metalness === 1 ? 1 : material.reflectivity;\n }\n\n public getMaterialShading(version: number = 1): RapiMaterialShading {\n return getMaterialShading(this._material, version);\n }\n\n protected createCameraControl(\n _mode: Enumify<typeof CAMERA_TYPE>,\n _offset: CanvasOffset,\n ) {\n this._changeCameraBehaviour(\n new MaterialViewerCameraBehaviour(\n new CameraControl3D(this._creator_, this._getInputManager(), undefined),\n this._cameraBehaviourState,\n ),\n );\n }\n\n protected _getInputManager(): InputManager {\n return this._inputManager;\n }\n\n public sceneChanged(): void {\n //override when needed\n }\n\n public getBounds(): Box3 | null {\n if (!this._mesh) {\n return null;\n }\n return new Box3().setFromObject(this._mesh);\n }\n\n getGeometryBounds(): Box3 | null {\n return null;\n }\n\n protected initializeWebGLGUI() {\n this._gui = getWebGLGUI();\n this._updateGUI();\n }\n\n protected override initializeWebGPUGUI(\n roomleWebGPURenderer: RoomleWebGPURenderer,\n ): void {\n super.initializeWebGPUGUI(roomleWebGPURenderer);\n this._gui =\n roomleWebGPURenderer.getOrCreateGUIParameters('Material Viewer');\n this._updateGUI();\n }\n\n private _updateGUI() {\n const gui = this._gui;\n if (!gui) {\n return;\n }\n if (!this._guiGeometryFolder) {\n this._guiGeometryFolder = gui.addFolder('Geometry');\n this._guiGeometryFolder\n .add(this._sceneParams, 'type', {\n Cube: GEOMETRY.CUBE,\n Sphere: GEOMETRY.SPHERE,\n PlaneVertical: GEOMETRY.PLANE_VERTICAL,\n PlaneHorizontal: GEOMETRY.PLANE_HORIZONTAL,\n })\n .onChange((type: number) => {\n console.log(type);\n this._setGeometry();\n });\n }\n if (this._material) {\n if (!this._guiMaterialFolder) {\n this._guiMaterialFolder = gui.addFolder('Material');\n this._guiMaterialFolder\n .addColor(this._materialParams, 'color')\n .onChange((color: string) => {\n this._material.color = new Color(color);\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._materialParams, 'metallic', 0, 1, 0.01)\n .onChange((metallic: number) => {\n this._material.metalness = metallic === 1 ? 1 : 0.5;\n this._material.reflectivity = metallic || 0.5;\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._material, 'roughness', 0, 1, 0.01)\n .onChange((_roughness: number) => {\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._material, 'transmission', 0, 1, 0.01)\n .onChange((transmission: number) => {\n this._material.transmission = transmission;\n if (transmission > 0) {\n this._material.opacity = 1;\n this._material.alphaTest = 0.5;\n this._material.depthWrite = true;\n this._material.metalness = 0;\n }\n this._mesh.castShadow = !this._material.transparent;\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._materialParams, 'alpha', 0, 1, 0.01)\n .onChange((alpha: number) => {\n this._material.transparent = alpha < 1;\n this._material.opacity = alpha;\n this._material.depthWrite = alpha >= 1;\n this._mesh.castShadow = !this._material.transparent;\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._materialParams, 'alphaCutoff', 0, 1, 0.01)\n .onChange((alphaCutoff: number) => {\n if (alphaCutoff) {\n this._material.alphaTest = alphaCutoff;\n } else {\n this._material.alphaTest = 0;\n }\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._materialParams, 'doubleSided')\n .onChange((doubleSided: boolean) => {\n if (doubleSided) {\n this._material.side = DoubleSide;\n } else {\n this._material.side = FrontSide;\n }\n this._shadingChanged();\n });\n }\n }\n }\n\n private _shadingChanged() {\n this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(\n getMaterialShading(this._material),\n );\n this._requestRender();\n }\n\n public setGeometry(type: GEOMETRY) {\n this._sceneParams.type = type;\n this._setGeometry();\n }\n\n private _setGeometry() {\n let geometry;\n if (this._sceneParams.type === GEOMETRY.CUBE) {\n geometry = new BoxGeometry(SIZE.x, SIZE.y, SIZE.z, 100, 100, 100);\n } else if (this._sceneParams.type === GEOMETRY.SPHERE) {\n geometry = new SphereGeometry(0.5, 100, 100);\n } else if (this._sceneParams.type === GEOMETRY.PLANE_HORIZONTAL) {\n geometry = new PlaneGeometry(SIZE.x, SIZE.z);\n geometry.rotateX(-Math.PI / 2);\n } else if (this._sceneParams.type === GEOMETRY.PLANE_VERTICAL) {\n geometry = new PlaneGeometry(SIZE.x, SIZE.z);\n } else {\n console.error(\n `MaterialViewerSceneManager: unexpected geometry type \"${this._sceneParams.type}\"`,\n );\n return;\n }\n this._mesh.geometry = geometry;\n this._renderEverything();\n }\n\n public async changeFloorMaterialById(materialId: string): Promise<void> {\n const material = await this._rapiAccess.getMaterial(materialId);\n if (\n !this._environment ||\n !(this._environment instanceof FloorEnvironment)\n ) {\n this._environment = new FloorEnvironment(\n this._scene,\n this._environment,\n !this._initData.webGpu,\n );\n }\n return new Promise((resolve, reject) => {\n (this._environment as FloorEnvironment)\n .changeFloorMaterial(material, this._maxAnisotropy)\n .then(() => {\n this._requestRender();\n resolve();\n }, reject);\n });\n }\n\n public async addTexture(rapiTexture: RapiTexture, base64Image?: string) {\n const width = SIZE.x * 100;\n const height = SIZE.y * 100;\n const repeatWidth =\n width / (rapiTexture.mmWidth === 0 ? 1 : rapiTexture.mmWidth);\n const repeatHeight =\n height / (rapiTexture.mmHeight === 0 ? 1 : rapiTexture.mmHeight);\n const maxTextures = getMaxTextures(this._renderer);\n if (base64Image) {\n const image = new Image();\n image.src = base64Image;\n const texture = new Texture();\n texture.image = image;\n image.onload = function () {\n texture.needsUpdate = true;\n };\n addExistingTexture(\n texture,\n rapiTexture,\n this._material,\n this._maxAnisotropy,\n repeatWidth,\n repeatHeight,\n maxTextures,\n );\n } else {\n await addTexture(\n rapiTexture.image,\n rapiTexture,\n this._material,\n this._maxAnisotropy,\n repeatWidth,\n repeatHeight,\n maxTextures,\n );\n }\n this._requestRender();\n }\n\n public removeTexture(rapiTexture: RapiTexture) {\n if (rapiTexture.mapping === RAPI_TEXTURE_TYPE.ORM) {\n this._material.aoMap = null;\n this._material.roughnessMap = null;\n this._material.metalnessMap = null;\n }\n if (\n rapiTexture.mapping === RAPI_TEXTURE_TYPE.RGB ||\n rapiTexture.mapping === RAPI_TEXTURE_TYPE.RGBA\n ) {\n this._material.map = null;\n }\n if (rapiTexture.mapping === RAPI_TEXTURE_TYPE.XYZ) {\n this._material.normalMap = null;\n }\n this._material.needsUpdate = true;\n this._requestRender();\n }\n\n public clearCache() {\n this._configuratorMeshGenerator.clear();\n }\n}\n","import type ScriptLoader from '../../common-core/src/script-loader';\nimport type DomHelper from '../../common-core/src/utils/dom-helper';\nimport inject from '../../common-core/src/di/inject';\nimport type { ExternalEmbeddable, GlobalAPI } from '../../common-core/src/main';\nimport type { Main } from '../../common-core/src/main';\nimport type { Context } from '../../common-core/src/di/context';\nimport type { LifeCycleManager } from '../../common-core/src/life-cycle-manager';\nimport type { SceneSettings } from '../../common-core/src/scene-settings-loader';\nimport type { GEOMETRY } from './webgl/material-viewer-scene-manager';\nimport MaterialViewerSceneManager from './webgl/material-viewer-scene-manager';\nimport type {\n RapiId,\n RapiMaterial,\n RapiMaterialShading,\n RapiTexture,\n} from '../../typings/rapi-types';\nimport type RoomleMaterialViewerUiCallback from './roomle-material-viewer-ui-callback';\nimport type { InitDataDefinition } from '../../common-core/src/utils/shims';\nimport type InitData from '../../common-core/src/utils/init-data';\nimport { type RapiAccess } from '../../common-core/src/rapi-access';\nimport type { CanvasOffset } from '../../common-core/src/common-interfaces';\nimport type UnitFormatter from '../../configurator-core/src/services/unit-formatter';\nimport type { Scene } from 'three';\nimport { type IdbManager } from '../../common-core/src/services/idb-manager';\nimport type { GlobalCallback } from '../../common-core/src/services/global-callback';\n\nexport default class RoomleMaterialViewer\n implements\n GlobalAPI,\n Context,\n ExternalEmbeddable<RoomleMaterialViewerUiCallback>\n{\n public _creator_: string;\n\n @inject\n private _domHelper: DomHelper;\n\n @inject\n private _scriptLoader: ScriptLoader;\n\n @inject\n private _lifeCycleManager: LifeCycleManager;\n\n @inject\n private _roomleMaterialViewerUiCallback: RoomleMaterialViewerUiCallback;\n\n @inject\n private _initData: InitData;\n\n @inject\n private _globalCallback: GlobalCallback;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n @inject\n protected _idbManager: IdbManager;\n\n private _sceneManager: MaterialViewerSceneManager;\n\n constructor(creator: string) {\n this._creator_ = creator;\n }\n\n public setCameraOffset(offset: CanvasOffset): void {\n this._sceneManager.setCameraOffset(offset);\n }\n\n public getCameraOffset(): CanvasOffset {\n return this._sceneManager.getCameraOffset();\n }\n\n public init(element: HTMLElement): Promise<void> {\n this._domHelper.setDomElement(element);\n\n if (this._sceneManager) {\n this._lifeCycleManager.resume();\n return Promise.resolve();\n }\n\n return new Promise<void>(this._initPromiseCallback.bind(this));\n }\n\n private _initPromiseCallback(resolve: () => void, _reject: () => void) {\n this._sceneManager = new MaterialViewerSceneManager(this._creator_, {\n left: 0,\n top: 1,\n right: 1,\n bottom: 0,\n });\n this._sceneManager.enableHD();\n resolve();\n }\n\n get callbacks(): RoomleMaterialViewerUiCallback {\n return this._roomleMaterialViewerUiCallback;\n }\n\n set callbacks(callback: RoomleMaterialViewerUiCallback) {\n this._roomleMaterialViewerUiCallback = callback;\n }\n\n public loadMaterialShading(\n materialShading: RapiMaterialShading,\n ): Promise<void> {\n return this._sceneManager.loadMaterialShading(materialShading);\n }\n\n public loadMaterial(\n material: RapiMaterial,\n options: { flushCache?: boolean } = {},\n ): Promise<void> {\n if (options.flushCache) {\n this._clearCaches();\n }\n return this._sceneManager.loadMaterial(material);\n }\n\n public loadMaterialId(\n materialId: RapiId,\n options: { flushCache?: boolean } = {},\n ): Promise<void> {\n if (options.flushCache) {\n this._clearCaches();\n }\n return this._sceneManager.loadMaterialId(materialId);\n }\n\n public getMaterialShading(version: number = 1): RapiMaterialShading {\n return this._sceneManager.getMaterialShading(version);\n }\n\n /**\n * Loads a SceneSettings object, currently it can can contain a light setting definition\n * (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}).\n * @param sceneSettings\n */\n public loadSceneSetting(sceneSettings: SceneSettings): Promise<void> {\n return this._sceneManager.loadSceneSettings(sceneSettings);\n }\n\n public setOverrides(initData: InitDataDefinition): void {\n if (!initData) {\n return;\n }\n this._initData.setOverrides(initData);\n }\n\n public updateSize(): void {\n this._sceneManager.updateCamera();\n }\n\n /**\n * Return the main class which has access to lifecycle events and RapiAccess.\n * Hidden because it's only useful for embedding API.\n * Has to be overridden by main class.\n * @hidden\n */\n public getMain(): Main | undefined {\n return undefined;\n }\n\n public resumeTest(element: HTMLElement) {\n this._domHelper.setDomElement(element);\n this._lifeCycleManager.resume();\n }\n\n public pauseTest() {\n this._lifeCycleManager.pause();\n }\n\n public showGUI() {\n this._sceneManager.showGUI();\n }\n\n /**\n * Sets the material of the floor to the given material id.\n * If the current environment is not floor environment it will be changed\n *\n * Example material ids are:\n * roomle_floor:DresdenEiche\n * roomle_floor:Ibiza\n * roomle_floor:Palma\n * roomle_floor:Elba\n * roomle_floor:Manacor\n * roomle_floor:KernEiche\n * roomle_floor:KieferScandic\n * roomle_floor:EicheHabsburg\n * roomle_floor:FuldaKiefer\n * roomle_floor:Ashton\n * roomle_floor:EicheLondon\n *\n * @param materialId\n * @returns promise that resolves when material has been changed\n */\n public async changeFloorMaterialById(materialId: string): Promise<void> {\n return this._sceneManager.changeFloorMaterialById(materialId);\n }\n\n /**\n * Set the geometry of the demo material mesh\n *\n * Possible parameter:\n * 'cube',\n * 'sphere',\n * 'plane_vertical',\n * 'plane_horizontal'\n *\n * @param type\n */\n public setGeometry(type: GEOMETRY) {\n this._sceneManager.setGeometry(type);\n }\n\n /**\n * Set a texture on the demo material, if no base64Image is set, the image field of rapiTexture is used\n * @param rapiTexture\n * @param base64Image for example \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg==\"\n */\n public async addTexture(rapiTexture: RapiTexture, base64Image?: string) {\n return this._sceneManager.addTexture(rapiTexture, base64Image);\n }\n\n /**\n * Remove texture from the demo material\n * @param rapiTexture\n */\n public removeTexture(rapiTexture: RapiTexture) {\n return this._sceneManager.removeTexture(rapiTexture);\n }\n\n private _clearCaches() {\n this._rapiAccess.cleanUp();\n this._sceneManager.clearCache();\n }\n\n public getScene(): Scene {\n return this._sceneManager.getScene();\n }\n\n public updateScene(): void {\n this._sceneManager.updateScene();\n }\n\n /**\n * returns unit formatter for formatting input und output values in scene\n */\n public getUnitFormatter(): UnitFormatter {\n return this._unitFormatter;\n }\n\n /**\n * returns manager class to interface with indexedDB storage\n */\n public getStorage(): IdbManager {\n return this._idbManager;\n }\n\n public setEnvironmentMap(params: {\n url?: string;\n intensity?: number;\n rotation?: number;\n maxLightSources?: number;\n }): void {\n const { url, intensity, rotation, maxLightSources } = params;\n this._sceneManager.setEnvironmentMap(\n url,\n intensity,\n rotation,\n maxLightSources,\n );\n }\n\n /**\n * @internal\n * Use this callbacks to hook in your functionality\n */\n public get globalCallbacks(): GlobalCallback {\n return this._globalCallback;\n }\n}\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { UiCallback } from '../../common-core/src/utils/ui-callback';\nimport type { RapiMaterialShading } from '../../typings/rapi-types';\n\nexport default class RoomleMaterialViewerUiCallback extends UiCallback {\n constructor(creator: string) {\n super(creator);\n }\n\n /**\n * Gets called when a material parameter has been changed using the graphical user interface\n * @param materialShading\n */\n public onMaterialShadingChanged = (\n materialShading: RapiMaterialShading,\n ): void => undefined;\n}\n","import Logger from '../../../common-core/src/logger';\nimport ScriptLoader from '../../../common-core/src/script-loader';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport InputManager from '../../../common-core/src/input/input-manager';\nimport ConfiguratorMeshGenerator from '../../../configurator-core/src/webgl/configurator-mesh-generator';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\nimport RoomleMaterialViewerUiCallback from '../roomle-material-viewer-ui-callback';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment(\n 'input-manager',\n InputManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment(\n 'configurator-mesh-generator',\n ConfiguratorMeshGenerator,\n ),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n new DependencyInjectionAssignment(\n 'roomle-material-viewer-ui-callback',\n RoomleMaterialViewerUiCallback,\n DI_TYPE.CONTEXT,\n ),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport type Logger from '../../common-core/src/logger';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport RoomleMaterialViewer from './roomle-material-viewer';\nimport { INJECTABLES } from './utils/injectables';\n\nexport class MaterialViewer extends Main {\n private _viewer: RoomleMaterialViewer;\n\n protected setupGlobals(): void {\n //globals are initialized in bootFinished()\n }\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n this.lookup<Logger>('logger', this._context);\n }\n\n protected cleanUpGlobals(): void {\n throw new Error('Method not implemented.');\n }\n\n protected cleanUpDependencies(): void {\n throw new Error('Method not implemented.');\n }\n\n protected async bootFinished(): Promise<void> {\n this._viewer = new RoomleMaterialViewer(this._context);\n\n if (!window.RoomleMaterialViewer) {\n window.RoomleMaterialViewer = this._viewer;\n }\n }\n\n public getApi(): RoomleMaterialViewer {\n return this._viewer;\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.MATERIAL_VIEWER;\n }\n}\n"],"mappings":";;;;;;;AAGA,IAAqB,IAArB,cAA2D,EAAgB;CACzE,IAAW,gBAA2C;AACpD,SAAO,KAAK;;GC2CE,IAAX,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,SAAA,UACA,EAAA,iBAAA,kBACA,EAAA,mBAAA;KACD,EAEK,IAAO;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,EACZ,IAArB,cAAwD,EAAa;CA6BnE,YAAY,GAAiB,GAAsB;AAMjD,EALA,MAAM,GAAS,GAAQ,EAAU,KAAK,EAAY,UAAU,sBAZvC,EACrB,MAAM,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ameracontrol/material-viewer-camera-behaviour.ts","../../packages/material-viewer/src/webgl/material-viewer-scene-manager.ts","../../packages/material-viewer/src/roomle-material-viewer.ts","../../packages/material-viewer/src/roomle-material-viewer-ui-callback.ts","../../packages/material-viewer/src/utils/injectables.ts","../../packages/material-viewer/src/material-viewer.ts"],"sourcesContent":["import CameraBehaviour from './camera-behaviour';\nimport type AdjustableCameraControl3D from '../../../glb-viewer-core/src/camera-control/adjustable-camera-control-3d';\n\nexport default class MaterialViewerCameraBehaviour extends CameraBehaviour {\n public get cameraControl(): AdjustableCameraControl3D {\n return this._cameraControl as AdjustableCameraControl3D;\n }\n}\n","import SceneManager from '../../../common-core/src/webgl/scene-manager';\nimport type { GenericGUIParamFolder } from '../../../common-core/src/webgl/gui-types';\nimport type { RoomleWebGPURenderer } from '../../../common-core/src/webgpu/roomle-webgpu-renderer';\nimport type { CanvasOffset } from '../../../common-core/src/common-interfaces';\nimport type InputManager from '../../../common-core/src/input/input-manager';\nimport inject from '../../../common-core/src/di/inject';\nimport CameraControl3D from '../../../common-core/src/cameracontrol/camera-control-3d';\nimport type {\n RapiId,\n RapiMaterial,\n RapiMaterialShading,\n RapiTexture,\n} from '../../../typings/rapi-types';\nimport { RAPI_TEXTURE_TYPE } from '../../../typings/rapi-types';\nimport {\n addExistingTexture,\n addTexture,\n getWebGLGUI,\n getMaterialShading,\n setMaterial,\n getMaxTextures,\n} from '../../../common-core/src/utils/threejs-utils';\nimport { CAMERA_TYPE } from '../../../common-core/src/cameracontrol/camera-type';\nimport type ConfiguratorMeshGenerator from '../../../configurator-core/src/webgl/configurator-mesh-generator';\nimport type RoomleMaterialViewerUiCallback from '../roomle-material-viewer-ui-callback';\nimport BackgroundEnvironment from '../../../common-core/src/environment/background-environment';\nimport FloorEnvironment from '../../../configurator-core/src/webgl/environment/floor-environment';\nimport { type RapiAccess } from '../../../common-core/src/rapi-access';\nimport DynamicLightSettingLoader, {\n PREDEFINED_LIGHTSETTING,\n} from '../../../common-core/src/lightsetting/dynamic-light-setting-loader';\nimport { CANVAS_ID } from '../../../common-core/src/utils/dom-helper';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { MeshPhysicalMaterial } from 'three';\nimport {\n Box3,\n BoxGeometry,\n Color,\n DoubleSide,\n FrontSide,\n Mesh,\n PlaneGeometry,\n SphereGeometry,\n Texture,\n} from 'three';\nimport MaterialCreator from '../../../common-core/src/utils/material-creator';\nimport MaterialViewerCameraBehaviour from '../../../common-core/src/cameracontrol/material-viewer-camera-behaviour';\n\nexport const enum GEOMETRY {\n CUBE = 'cube',\n SPHERE = 'sphere',\n PLANE_VERTICAL = 'plane_vertical',\n PLANE_HORIZONTAL = 'plane_horizontal',\n}\n\nconst SIZE = { x: 1, y: 1, z: 1 };\nexport default class MaterialViewerSceneManager extends SceneManager {\n @inject\n private _inputManager: InputManager;\n\n @inject\n private _configuratorMeshGenerator: ConfiguratorMeshGenerator;\n\n @inject\n private _roomleMaterialViewerUiCallback: RoomleMaterialViewerUiCallback;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n private _gui: GenericGUIParamFolder | null;\n private _guiGeometryFolder: GenericGUIParamFolder | undefined;\n private _guiMaterialFolder: GenericGUIParamFolder | undefined;\n private _mesh: Mesh;\n private _material: MeshPhysicalMaterial;\n private _sceneParams = {\n type: GEOMETRY.CUBE,\n };\n private _materialParams = {\n color: '#ffffff',\n metallic: 0.5,\n alpha: 0,\n alphaCutoff: 0,\n doubleSided: false,\n };\n\n constructor(creator: string, offset: CanvasOffset) {\n super(creator, offset, CANVAS_ID.RMV, CAMERA_TYPE.CAMERA_3D);\n\n // Use lazy initialization for renderer-dependent settings\n this._initializeRendererSettings();\n\n this._initScene();\n }\n\n // If renderer is not ready yet, will retry on next tick.\n // This is necessary for dynamic WebGPU renderer imports.\n private _initializeRendererSettings(): void {\n if (!this._renderer) {\n // Retry on next tick if renderer not ready\n setTimeout(() => this._initializeRendererSettings(), 0);\n return;\n }\n\n const maxTextures = getMaxTextures(this._renderer);\n if (maxTextures > 8) {\n const lightSource =\n DynamicLightSettingLoader.createDynamicLightSettingSource(\n null,\n PREDEFINED_LIGHTSETTING.CAMERA,\n );\n if (lightSource) {\n this.loadDynamicLightSetting(lightSource);\n }\n }\n }\n\n private _initScene() {\n const geometry = new BoxGeometry(SIZE.x, SIZE.y, SIZE.z, 100, 100, 100);\n const meshPhysicalMaterial = MaterialCreator.createMeshPhysicalMaterial({\n color: this._initData.colors.PRIMARY,\n });\n this._setMaterial(meshPhysicalMaterial);\n this._mesh = new Mesh(geometry, this._material);\n this._mesh.castShadow = true;\n this._mesh.position.setY(SIZE.y / 2);\n this._scene.add(this._mesh);\n\n const { initialFloorMaterial } = this._initData;\n\n if (initialFloorMaterial) {\n this.changeFloorMaterialById(initialFloorMaterial);\n } else {\n this._environment = new BackgroundEnvironment(\n this._scene,\n undefined,\n new Color(0xffffff),\n );\n }\n\n if (this.cameraBehaviour.cameraControl instanceof CameraControl3D) {\n const boundingBox = new Box3();\n boundingBox.setFromObject(this._mesh);\n console.trace('reset camera');\n this.cameraBehaviour.cameraControl.updateAndReset(boundingBox);\n }\n\n void this.showGUI();\n }\n\n public loadMaterialId(materialId: RapiId): Promise<void> {\n return new Promise<void>((resolve) => {\n this._configuratorMeshGenerator\n .loadMaterial(materialId, SIZE.x * 1000, SIZE.y * 1000)\n .then((material) => {\n this._setMaterial(material as MeshPhysicalMaterial);\n this._mesh.material = this._material;\n this._updateGUI();\n this._requestRender();\n resolve();\n });\n });\n }\n\n public loadMaterial(material: RapiMaterial): Promise<void> {\n return new Promise<void>((resolve) => {\n // eslint-disable-next-line\n if (!material.__rapi_path__) {\n // eslint-disable-next-line\n material.__rapi_path__ = 'materials';\n }\n this._mesh.material = this._material;\n this._configuratorMeshGenerator\n .loadTextures(material, this._material, SIZE.x * 100, SIZE.y * 100)\n .then(() => {\n this._updateGUI();\n this._requestRender();\n });\n resolve();\n });\n }\n\n public loadMaterialShading(\n materialShading: RapiMaterialShading,\n ): Promise<void> {\n return new Promise<void>((resolve) => {\n let material = { shading: materialShading };\n this._setMaterial(setMaterial(this._material, material as RapiMaterial));\n this._mesh.material = this._material;\n this._updateGUI();\n this._requestRender();\n resolve();\n });\n }\n\n private _setMaterial(material: MeshPhysicalMaterial) {\n this._material = material;\n this._materialParams.alpha = material.opacity;\n this._materialParams.alphaCutoff = material.alphaTest;\n this._materialParams.color = '#' + material.color.getHexString();\n this._materialParams.doubleSided = material.side === DoubleSide;\n this._materialParams.metallic =\n material.metalness === 1 ? 1 : material.reflectivity;\n }\n\n public getMaterialShading(version: number = 1): RapiMaterialShading {\n return getMaterialShading(this._material, version);\n }\n\n protected createCameraControl(\n _mode: Enumify<typeof CAMERA_TYPE>,\n _offset: CanvasOffset,\n ) {\n this._changeCameraBehaviour(\n new MaterialViewerCameraBehaviour(\n new CameraControl3D(this._creator_, this._getInputManager(), undefined),\n this._cameraBehaviourState,\n ),\n );\n }\n\n protected _getInputManager(): InputManager {\n return this._inputManager;\n }\n\n public sceneChanged(): void {\n //override when needed\n }\n\n public getBounds(): Box3 | null {\n if (!this._mesh) {\n return null;\n }\n return new Box3().setFromObject(this._mesh);\n }\n\n getGeometryBounds(): Box3 | null {\n return null;\n }\n\n protected initializeWebGLGUI() {\n this._gui = getWebGLGUI();\n this._updateGUI();\n }\n\n protected override initializeWebGPUGUI(\n roomleWebGPURenderer: RoomleWebGPURenderer,\n ): void {\n super.initializeWebGPUGUI(roomleWebGPURenderer);\n this._gui =\n roomleWebGPURenderer.getOrCreateGUIParameters('Material Viewer');\n this._updateGUI();\n }\n\n private _updateGUI() {\n const gui = this._gui;\n if (!gui) {\n return;\n }\n if (!this._guiGeometryFolder) {\n this._guiGeometryFolder = gui.addFolder('Geometry');\n this._guiGeometryFolder\n .add(this._sceneParams, 'type', {\n Cube: GEOMETRY.CUBE,\n Sphere: GEOMETRY.SPHERE,\n PlaneVertical: GEOMETRY.PLANE_VERTICAL,\n PlaneHorizontal: GEOMETRY.PLANE_HORIZONTAL,\n })\n .onChange((type: number) => {\n console.log(type);\n this._setGeometry();\n });\n }\n if (this._material) {\n if (!this._guiMaterialFolder) {\n this._guiMaterialFolder = gui.addFolder('Material');\n this._guiMaterialFolder\n .addColor(this._materialParams, 'color')\n .onChange((color: string) => {\n this._material.color = new Color(color);\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._materialParams, 'metallic', 0, 1, 0.01)\n .onChange((metallic: number) => {\n this._material.metalness = metallic === 1 ? 1 : 0.5;\n this._material.reflectivity = metallic || 0.5;\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._material, 'roughness', 0, 1, 0.01)\n .onChange((_roughness: number) => {\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._material, 'transmission', 0, 1, 0.01)\n .onChange((transmission: number) => {\n this._material.transmission = transmission;\n if (transmission > 0) {\n this._material.opacity = 1;\n this._material.alphaTest = 0.5;\n this._material.depthWrite = true;\n this._material.metalness = 0;\n }\n this._mesh.castShadow = !this._material.transparent;\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._materialParams, 'alpha', 0, 1, 0.01)\n .onChange((alpha: number) => {\n this._material.transparent = alpha < 1;\n this._material.opacity = alpha;\n this._material.depthWrite = alpha >= 1;\n this._mesh.castShadow = !this._material.transparent;\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._materialParams, 'alphaCutoff', 0, 1, 0.01)\n .onChange((alphaCutoff: number) => {\n if (alphaCutoff) {\n this._material.alphaTest = alphaCutoff;\n } else {\n this._material.alphaTest = 0;\n }\n this._shadingChanged();\n });\n this._guiMaterialFolder\n .add(this._materialParams, 'doubleSided')\n .onChange((doubleSided: boolean) => {\n if (doubleSided) {\n this._material.side = DoubleSide;\n } else {\n this._material.side = FrontSide;\n }\n this._shadingChanged();\n });\n }\n }\n }\n\n private _shadingChanged() {\n this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(\n getMaterialShading(this._material),\n );\n this._requestRender();\n }\n\n public setGeometry(type: GEOMETRY) {\n this._sceneParams.type = type;\n this._setGeometry();\n }\n\n private _setGeometry() {\n let geometry;\n if (this._sceneParams.type === GEOMETRY.CUBE) {\n geometry = new BoxGeometry(SIZE.x, SIZE.y, SIZE.z, 100, 100, 100);\n } else if (this._sceneParams.type === GEOMETRY.SPHERE) {\n geometry = new SphereGeometry(0.5, 100, 100);\n } else if (this._sceneParams.type === GEOMETRY.PLANE_HORIZONTAL) {\n geometry = new PlaneGeometry(SIZE.x, SIZE.z);\n geometry.rotateX(-Math.PI / 2);\n } else if (this._sceneParams.type === GEOMETRY.PLANE_VERTICAL) {\n geometry = new PlaneGeometry(SIZE.x, SIZE.z);\n } else {\n console.error(\n `MaterialViewerSceneManager: unexpected geometry type \"${this._sceneParams.type}\"`,\n );\n return;\n }\n this._mesh.geometry = geometry;\n this._renderEverything();\n }\n\n public async changeFloorMaterialById(materialId: string): Promise<void> {\n const material = await this._rapiAccess.getMaterial(materialId);\n if (\n !this._environment ||\n !(this._environment instanceof FloorEnvironment)\n ) {\n this._environment = new FloorEnvironment(\n this._scene,\n this._environment,\n !this._initData.webGpu,\n );\n }\n return new Promise((resolve, reject) => {\n (this._environment as FloorEnvironment)\n .changeFloorMaterial(material, this._maxAnisotropy)\n .then(() => {\n this._requestRender();\n resolve();\n }, reject);\n });\n }\n\n public async addTexture(rapiTexture: RapiTexture, base64Image?: string) {\n const width = SIZE.x * 100;\n const height = SIZE.y * 100;\n const repeatWidth =\n width / (rapiTexture.mmWidth === 0 ? 1 : rapiTexture.mmWidth);\n const repeatHeight =\n height / (rapiTexture.mmHeight === 0 ? 1 : rapiTexture.mmHeight);\n const maxTextures = getMaxTextures(this._renderer);\n if (base64Image) {\n const image = new Image();\n image.src = base64Image;\n const texture = new Texture();\n texture.image = image;\n image.onload = function () {\n texture.needsUpdate = true;\n };\n addExistingTexture(\n texture,\n rapiTexture,\n this._material,\n this._maxAnisotropy,\n repeatWidth,\n repeatHeight,\n maxTextures,\n );\n } else {\n await addTexture(\n rapiTexture.image,\n rapiTexture,\n this._material,\n this._maxAnisotropy,\n repeatWidth,\n repeatHeight,\n maxTextures,\n );\n }\n this._requestRender();\n }\n\n public removeTexture(rapiTexture: RapiTexture) {\n if (rapiTexture.mapping === RAPI_TEXTURE_TYPE.ORM) {\n this._material.aoMap = null;\n this._material.roughnessMap = null;\n this._material.metalnessMap = null;\n }\n if (\n rapiTexture.mapping === RAPI_TEXTURE_TYPE.RGB ||\n rapiTexture.mapping === RAPI_TEXTURE_TYPE.RGBA\n ) {\n this._material.map = null;\n }\n if (rapiTexture.mapping === RAPI_TEXTURE_TYPE.XYZ) {\n this._material.normalMap = null;\n }\n this._material.needsUpdate = true;\n this._requestRender();\n }\n\n public clearCache() {\n this._configuratorMeshGenerator.clear();\n }\n}\n","import type ScriptLoader from '../../common-core/src/script-loader';\nimport type DomHelper from '../../common-core/src/utils/dom-helper';\nimport inject from '../../common-core/src/di/inject';\nimport type { ExternalEmbeddable, GlobalAPI } from '../../common-core/src/main';\nimport type { Main } from '../../common-core/src/main';\nimport type { Context } from '../../common-core/src/di/context';\nimport type { LifeCycleManager } from '../../common-core/src/life-cycle-manager';\nimport type { SceneSettings } from '../../common-core/src/scene-settings-loader';\nimport type { GEOMETRY } from './webgl/material-viewer-scene-manager';\nimport MaterialViewerSceneManager from './webgl/material-viewer-scene-manager';\nimport type {\n RapiId,\n RapiMaterial,\n RapiMaterialShading,\n RapiTexture,\n} from '../../typings/rapi-types';\nimport type RoomleMaterialViewerUiCallback from './roomle-material-viewer-ui-callback';\nimport type { InitDataDefinition } from '../../common-core/src/utils/shims';\nimport type InitData from '../../common-core/src/utils/init-data';\nimport { type RapiAccess } from '../../common-core/src/rapi-access';\nimport type { CanvasOffset } from '../../common-core/src/common-interfaces';\nimport type UnitFormatter from '../../configurator-core/src/services/unit-formatter';\nimport type { Scene } from 'three';\nimport { type IdbManager } from '../../common-core/src/services/idb-manager';\nimport type { GlobalCallback } from '../../common-core/src/services/global-callback';\n\nexport default class RoomleMaterialViewer\n implements\n GlobalAPI,\n Context,\n ExternalEmbeddable<RoomleMaterialViewerUiCallback>\n{\n public _creator_: string;\n\n @inject\n private _domHelper: DomHelper;\n\n @inject\n private _scriptLoader: ScriptLoader;\n\n @inject\n private _lifeCycleManager: LifeCycleManager;\n\n @inject\n private _roomleMaterialViewerUiCallback: RoomleMaterialViewerUiCallback;\n\n @inject\n private _initData: InitData;\n\n @inject\n private _globalCallback: GlobalCallback;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n @inject\n protected _idbManager: IdbManager;\n\n private _sceneManager: MaterialViewerSceneManager;\n\n constructor(creator: string) {\n this._creator_ = creator;\n }\n\n public setCameraOffset(offset: CanvasOffset): void {\n this._sceneManager.setCameraOffset(offset);\n }\n\n public getCameraOffset(): CanvasOffset {\n return this._sceneManager.getCameraOffset();\n }\n\n public init(element: HTMLElement): Promise<void> {\n this._domHelper.setDomElement(element);\n\n if (this._sceneManager) {\n this._lifeCycleManager.resume();\n return Promise.resolve();\n }\n\n return new Promise<void>(this._initPromiseCallback.bind(this));\n }\n\n private _initPromiseCallback(resolve: () => void, _reject: () => void) {\n this._sceneManager = new MaterialViewerSceneManager(this._creator_, {\n left: 0,\n top: 1,\n right: 1,\n bottom: 0,\n });\n this._sceneManager.enableHD();\n resolve();\n }\n\n get callbacks(): RoomleMaterialViewerUiCallback {\n return this._roomleMaterialViewerUiCallback;\n }\n\n set callbacks(callback: RoomleMaterialViewerUiCallback) {\n this._roomleMaterialViewerUiCallback = callback;\n }\n\n public loadMaterialShading(\n materialShading: RapiMaterialShading,\n ): Promise<void> {\n return this._sceneManager.loadMaterialShading(materialShading);\n }\n\n public loadMaterial(\n material: RapiMaterial,\n options: { flushCache?: boolean } = {},\n ): Promise<void> {\n if (options.flushCache) {\n this._clearCaches();\n }\n return this._sceneManager.loadMaterial(material);\n }\n\n public loadMaterialId(\n materialId: RapiId,\n options: { flushCache?: boolean } = {},\n ): Promise<void> {\n if (options.flushCache) {\n this._clearCaches();\n }\n return this._sceneManager.loadMaterialId(materialId);\n }\n\n public getMaterialShading(version: number = 1): RapiMaterialShading {\n return this._sceneManager.getMaterialShading(version);\n }\n\n /**\n * Loads a SceneSettings object, currently it can can contain a light setting definition\n * (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}).\n * @param sceneSettings\n */\n public loadSceneSetting(sceneSettings: SceneSettings): Promise<void> {\n return this._sceneManager.loadSceneSettings(sceneSettings);\n }\n\n public setOverrides(initData: InitDataDefinition): void {\n if (!initData) {\n return;\n }\n this._initData.setOverrides(initData);\n }\n\n public updateSize(): void {\n this._sceneManager.updateCamera();\n }\n\n /**\n * Return the main class which has access to lifecycle events and RapiAccess.\n * Hidden because it's only useful for embedding API.\n * Has to be overridden by main class.\n * @hidden\n */\n public getMain(): Main | undefined {\n return undefined;\n }\n\n public resumeTest(element: HTMLElement) {\n this._domHelper.setDomElement(element);\n this._lifeCycleManager.resume();\n }\n\n public pauseTest() {\n this._lifeCycleManager.pause();\n }\n\n public showGUI() {\n this._sceneManager.showGUI();\n }\n\n /**\n * Sets the material of the floor to the given material id.\n * If the current environment is not floor environment it will be changed\n *\n * Example material ids are:\n * roomle_floor:DresdenEiche\n * roomle_floor:Ibiza\n * roomle_floor:Palma\n * roomle_floor:Elba\n * roomle_floor:Manacor\n * roomle_floor:KernEiche\n * roomle_floor:KieferScandic\n * roomle_floor:EicheHabsburg\n * roomle_floor:FuldaKiefer\n * roomle_floor:Ashton\n * roomle_floor:EicheLondon\n *\n * @param materialId\n * @returns promise that resolves when material has been changed\n */\n public async changeFloorMaterialById(materialId: string): Promise<void> {\n return this._sceneManager.changeFloorMaterialById(materialId);\n }\n\n /**\n * Set the geometry of the demo material mesh\n *\n * Possible parameter:\n * 'cube',\n * 'sphere',\n * 'plane_vertical',\n * 'plane_horizontal'\n *\n * @param type\n */\n public setGeometry(type: GEOMETRY) {\n this._sceneManager.setGeometry(type);\n }\n\n /**\n * Set a texture on the demo material, if no base64Image is set, the image field of rapiTexture is used\n * @param rapiTexture\n * @param base64Image for example \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg==\"\n */\n public async addTexture(rapiTexture: RapiTexture, base64Image?: string) {\n return this._sceneManager.addTexture(rapiTexture, base64Image);\n }\n\n /**\n * Remove texture from the demo material\n * @param rapiTexture\n */\n public removeTexture(rapiTexture: RapiTexture) {\n return this._sceneManager.removeTexture(rapiTexture);\n }\n\n private _clearCaches() {\n this._rapiAccess.cleanUp();\n this._sceneManager.clearCache();\n }\n\n public getScene(): Scene {\n return this._sceneManager.getScene();\n }\n\n public updateScene(): void {\n this._sceneManager.updateScene();\n }\n\n /**\n * returns unit formatter for formatting input und output values in scene\n */\n public getUnitFormatter(): UnitFormatter {\n return this._unitFormatter;\n }\n\n /**\n * returns manager class to interface with indexedDB storage\n */\n public getStorage(): IdbManager {\n return this._idbManager;\n }\n\n public setEnvironmentMap(params: {\n url?: string;\n intensity?: number;\n rotation?: number;\n maxLightSources?: number;\n }): void {\n const { url, intensity, rotation, maxLightSources } = params;\n this._sceneManager.setEnvironmentMap(\n url,\n intensity,\n rotation,\n maxLightSources,\n );\n }\n\n /**\n * @internal\n * Use this callbacks to hook in your functionality\n */\n public get globalCallbacks(): GlobalCallback {\n return this._globalCallback;\n }\n}\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { UiCallback } from '../../common-core/src/utils/ui-callback';\nimport type { RapiMaterialShading } from '../../typings/rapi-types';\n\nexport default class RoomleMaterialViewerUiCallback extends UiCallback {\n constructor(creator: string) {\n super(creator);\n }\n\n /**\n * Gets called when a material parameter has been changed using the graphical user interface\n * @param materialShading\n */\n public onMaterialShadingChanged = (\n materialShading: RapiMaterialShading,\n ): void => undefined;\n}\n","import Logger from '../../../common-core/src/logger';\nimport ScriptLoader from '../../../common-core/src/script-loader';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport InputManager from '../../../common-core/src/input/input-manager';\nimport ConfiguratorMeshGenerator from '../../../configurator-core/src/webgl/configurator-mesh-generator';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\nimport RoomleMaterialViewerUiCallback from '../roomle-material-viewer-ui-callback';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment(\n 'input-manager',\n InputManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment(\n 'configurator-mesh-generator',\n ConfiguratorMeshGenerator,\n ),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n new DependencyInjectionAssignment(\n 'roomle-material-viewer-ui-callback',\n RoomleMaterialViewerUiCallback,\n DI_TYPE.CONTEXT,\n ),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport type Logger from '../../common-core/src/logger';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport RoomleMaterialViewer from './roomle-material-viewer';\nimport { INJECTABLES } from './utils/injectables';\n\nexport class MaterialViewer extends Main {\n private _viewer: RoomleMaterialViewer;\n\n protected setupGlobals(): void {\n //globals are initialized in bootFinished()\n }\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n this.lookup<Logger>('logger', this._context);\n }\n\n protected cleanUpGlobals(): void {\n throw new Error('Method not implemented.');\n }\n\n protected cleanUpDependencies(): void {\n throw new Error('Method not implemented.');\n }\n\n protected async bootFinished(): Promise<void> {\n this._viewer = new RoomleMaterialViewer(this._context);\n\n if (!window.RoomleMaterialViewer) {\n window.RoomleMaterialViewer = this._viewer;\n }\n }\n\n public getApi(): RoomleMaterialViewer {\n return this._viewer;\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.MATERIAL_VIEWER;\n }\n}\n"],"mappings":";;;;;;;AAGA,IAAqB,IAArB,cAA2D,EAAgB;CACzE,IAAW,gBAA2C;AACpD,SAAO,KAAK;;GC2CE,IAAX,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,SAAA,UACA,EAAA,iBAAA,kBACA,EAAA,mBAAA;KACD,EAEK,IAAO;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,EACZ,IAArB,cAAwD,EAAa;CA6BnE,YAAY,GAAiB,GAAsB;AAMjD,EALA,MAAM,GAAS,GAAQ,EAAU,KAAK,EAAY,UAAU,sBAZvC,EACrB,MAAM,EAAS,MAChB,yBACyB;GACxB,OAAO;GACP,UAAU;GACV,OAAO;GACP,aAAa;GACb,aAAa;GACd,EAMC,KAAK,6BAA6B,EAElC,KAAK,YAAY;;CAKnB,8BAA4C;AAC1C,MAAI,CAAC,KAAK,WAAW;AAEnB,oBAAiB,KAAK,6BAA6B,EAAE,EAAE;AACvD;;AAIF,MADoB,EAAe,KAAK,UAAU,GAChC,GAAG;GACnB,IAAM,IACJ,EAA0B,gCACxB,MACA,EAAwB,OACzB;AACH,GAAI,KACF,KAAK,wBAAwB,EAAY;;;CAK/C,aAAqB;EACnB,IAAM,IAAW,IAAI,EAAY,EAAK,GAAG,EAAK,GAAG,EAAK,GAAG,KAAK,KAAK,IAAI,EACjE,IAAuB,EAAgB,2BAA2B,EACtE,OAAO,KAAK,UAAU,OAAO,SAC9B,CAAC;AAKF,EAJA,KAAK,aAAa,EAAqB,EACvC,KAAK,QAAQ,IAAI,EAAK,GAAU,KAAK,UAAU,EAC/C,KAAK,MAAM,aAAa,IACxB,KAAK,MAAM,SAAS,KAAK,EAAK,IAAI,EAAE,EACpC,KAAK,OAAO,IAAI,KAAK,MAAM;EAE3B,IAAM,EAAE,4BAAyB,KAAK;AAYtC,MAVI,IACF,KAAK,wBAAwB,EA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BY,IAAb,cAAoC,EAAK;CAGvC,eAA+B;CAI/B,oBAAoC;AAElC,EADA,EAA0B,MAAM,EAAY,EAC5C,KAAK,OAAe,UAAU,KAAK,SAAS;;CAG9C,iBAAiC;AAC/B,QAAU,MAAM,0BAA0B;;CAG5C,sBAAsC;AACpC,QAAU,MAAM,0BAA0B;;CAG5C,MAAgB,eAA8B;AAG5C,EAFA,KAAK,UAAU,IAAI,EAAqB,KAAK,SAAS,EAEjD,OAAO,yBACV,OAAO,uBAAuB,KAAK;;CAIvC,SAAsC;AACpC,SAAO,KAAK;;CAGd,iBAAmC;AACjC,SAAO,EAAa"}
@@ -1,10 +1,10 @@
1
- import "./roomle-sdk-5aB4wxLW.mjs";
2
- import "./configurator-CQ7KsW0O.mjs";
3
- import "./planner-HMMHSMAp.mjs";
4
- import "./glb-viewer-BWMMzvuG.mjs";
1
+ import "./roomle-sdk-CBwhwX_e.mjs";
2
+ import "./configurator-CDw_c6tB.mjs";
3
+ import "./planner-jvLAnYww.mjs";
4
+ import "./glb-viewer-B-Zr743e.mjs";
5
5
  //#region ../common/src/utils/id-inferrer.ts
6
6
  var e = (e) => e.split(":").length - 1 == 1, t = (e) => e.split(":").length - 1 <= 0, n = (e) => e ? e.startsWith("component@") : !1, r = (e) => e.startsWith("{") && e.endsWith("}"), i = (e) => e.startsWith("ps_");
7
7
  //#endregion
8
8
  export { i as a, e as i, r as n, t as r, n as t };
9
9
 
10
- //# sourceMappingURL=packages-B4K6xrdJ.mjs.map
10
+ //# sourceMappingURL=packages-BXAZEcKa.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"packages-B4K6xrdJ.mjs","names":[],"sources":["../../../common/src/utils/id-inferrer.ts"],"sourcesContent":["import type { RapiId, RapiPlanSnapshotId } from '@roomle/web-sdk';\n\nexport const isIdAnItem = (id: string) => id.split(':').length - 1 === 1;\n\nexport const isIdAPlan = (id: string) => id.split(':').length - 1 <= 0;\n\nexport const isIdAComponent = (id: string) =>\n id ? id.startsWith('component@') : false;\n\nexport const isIdAConfigurationString = (id: string) =>\n id.startsWith('{') && id.endsWith('}');\n\nexport const isPlanSnapshotId = (\n id: string | RapiId,\n): id is RapiPlanSnapshotId => id.startsWith('ps_');\n"],"mappings":";;;;;AAEA,IAAa,KAAc,MAAe,EAAG,MAAM,IAAI,CAAC,SAAS,KAAM,GAE1D,KAAa,MAAe,EAAG,MAAM,IAAI,CAAC,SAAS,KAAK,GAExD,KAAkB,MAC7B,IAAK,EAAG,WAAW,aAAa,GAAG,IAExB,KAA4B,MACvC,EAAG,WAAW,IAAI,IAAI,EAAG,SAAS,IAAI,EAE3B,KACX,MAC6B,EAAG,WAAW,MAAM"}
1
+ {"version":3,"file":"packages-BXAZEcKa.mjs","names":[],"sources":["../../../common/src/utils/id-inferrer.ts"],"sourcesContent":["import type { RapiId, RapiPlanSnapshotId } from '@roomle/web-sdk';\n\nexport const isIdAnItem = (id: string) => id.split(':').length - 1 === 1;\n\nexport const isIdAPlan = (id: string) => id.split(':').length - 1 <= 0;\n\nexport const isIdAComponent = (id: string) =>\n id ? id.startsWith('component@') : false;\n\nexport const isIdAConfigurationString = (id: string) =>\n id.startsWith('{') && id.endsWith('}');\n\nexport const isPlanSnapshotId = (\n id: string | RapiId,\n): id is RapiPlanSnapshotId => id.startsWith('ps_');\n"],"mappings":";;;;;AAEA,IAAa,KAAc,MAAe,EAAG,MAAM,IAAI,CAAC,SAAS,KAAM,GAE1D,KAAa,MAAe,EAAG,MAAM,IAAI,CAAC,SAAS,KAAK,GAExD,KAAkB,MAC7B,IAAK,EAAG,WAAW,aAAa,GAAG,IAExB,KAA4B,MACvC,EAAG,WAAW,IAAI,IAAI,EAAG,SAAS,IAAI,EAE3B,KACX,MAC6B,EAAG,WAAW,MAAM"}
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./planner-jvLAnYww.mjs";
2
+ export { e as Planner };
@@ -1,5 +1,5 @@
1
- import { A as e, C as t, H as n, I as r, V as i, Z as a, c as o, ct as s, ft as c, n as l, ot as u, st as d, tt as f, u as p, w as m } from "./roomle-sdk-5aB4wxLW.mjs";
2
- import { t as h } from "./script-loader-axxcKvph.mjs";
1
+ import { A as e, C as t, H as n, I as r, V as i, Z as a, c as o, ct as s, ft as c, n as l, ot as u, st as d, tt as f, u as p, w as m } from "./roomle-sdk-CBwhwX_e.mjs";
2
+ import { t as h } from "./script-loader-CvnG6LgL.mjs";
3
3
  //#region packages/planner-core/src/input/planner-input-manager.ts
4
4
  var g = class extends r {
5
5
  _canDrag(e) {
@@ -41,4 +41,4 @@ var g = class extends r {
41
41
  //#endregion
42
42
  export { v as t };
43
43
 
44
- //# sourceMappingURL=planner-HMMHSMAp.mjs.map
44
+ //# sourceMappingURL=planner-jvLAnYww.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-HMMHSMAp.mjs","names":[],"sources":["../../packages/planner-core/src/input/planner-input-manager.ts","../../packages/planner-core/src/utils/injectables.ts","../../packages/planner-core/src/planner.ts"],"sourcesContent":["import type { INPUT_EVENT_TYPE } from '../../../common-core/src/input/input-manager';\nimport InputManager from '../../../common-core/src/input/input-manager';\n\nexport default class PlannerInputManager extends InputManager {\n protected _canDrag(_type: INPUT_EVENT_TYPE): boolean {\n return true;\n }\n}\n","import ScriptLoader from '../../../common-core/src/script-loader';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport Logger from '../../../common-core/src/logger';\nimport { default as PlannerMeshGenerator } from '../webgl/planner-mesh-generator';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\nimport PlannerInputManager from '../input/planner-input-manager';\nimport PlannerSelectionHandler from './planner-selection-handler';\nimport GlobalInitData from '../../../common-core/src/utils/global-init-data';\nimport ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment(\n 'planner-input-manager',\n PlannerInputManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment(\n 'planner-mesh-generator',\n PlannerMeshGenerator,\n ),\n new DependencyInjectionAssignment(\n 'configurator-view-model',\n ConfiguratorViewModel,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n new DependencyInjectionAssignment('global-init-data', GlobalInitData),\n new DependencyInjectionAssignment(\n 'planner-selection-handler',\n PlannerSelectionHandler,\n ),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport { RoomlePlanner } from './roomle-planner';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport { INJECTABLES } from './utils/injectables';\nimport type PlannerKernelAccess from './services/planner-kernel-access';\nimport type Logger from '../../common-core/src/logger';\nimport { KERNEL_TYPE } from '../../common-core/src/services/common-kernel-access';\nimport type { PluginName } from '../../configurator-core/src/utils/plugin-types';\nimport type InitData from '../../common-core/src/utils/init-data';\nimport { isInIframe } from '../../common-core/src/utils/rapi-utils';\n\nexport class Planner<\n P extends readonly PluginName[] = readonly [],\n> extends Main {\n private _planner: RoomlePlanner<P>;\n private _activePlugins: P;\n\n constructor(creator?: string, activePlugins?: P) {\n super(creator);\n this._activePlugins = (activePlugins || []) as P;\n }\n protected setupGlobals(): void {\n //globals are initialized in bootFinished()\n }\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n this.lookup<Logger>('logger', this._context);\n // instantiate kernel acccess\n // instantiate pka\n // set pka on kernel access\n const plannerKernelAccess = this.lookup<PlannerKernelAccess>(\n 'planner-kernel-access',\n this._context,\n );\n plannerKernelAccess.init(KERNEL_TYPE.PLANNER);\n }\n\n protected cleanUpGlobals(): void {\n throw new Error('Method not implemented.');\n }\n\n protected cleanUpDependencies(): void {\n throw new Error('Method not implemented.');\n }\n\n protected async bootFinished(): Promise<void> {\n this._planner = new RoomlePlanner<P>(this._context, this._activePlugins);\n\n this._planner.getMain = () => {\n return this;\n };\n\n if (!window.RoomlePlanner) {\n if (this._activePlugins.length === 0) {\n // cast to unknown because we know that the planner is a RoomlePlanner\n window.RoomlePlanner = this._planner as unknown as RoomlePlanner;\n } else {\n window.RoomlePlanner = this._planner as RoomlePlanner<\n readonly PluginName[]\n >;\n }\n }\n\n const initData = this.lookup<InitData>('init-data', this._context);\n\n if (initData?.hi && isInIframe()) {\n await this._planner.setupHomagIntelligence();\n }\n }\n\n public getApi(): RoomlePlanner<P> {\n return this._planner;\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.PLANNER;\n }\n}\n"],"mappings":";;;AAGA,IAAqB,IAArB,cAAiD,EAAa;CAC5D,SAAmB,GAAkC;AACnD,SAAO;;GCQE,IAA+C;CAC1D,IAAI,EAA8B,iBAAiB,EAAa;CAChE,IAAI,EACF,yBACA,GACA,EAAQ,QACT;CACD,IAAI,EAA8B,UAAU,EAAO;CACnD,IAAI,EACF,0BACA,EACD;CACD,IAAI,EACF,2BACA,GACA,EAAQ,QACT;CACD,IAAI,EAA8B,eAAe,EAAW;CAC5D,IAAI,EAA8B,oBAAoB,EAAe;CACrE,IAAI,EACF,6BACA,EACD;CACF,ECxBY,IAAb,cAEU,EAAK;CAIb,YAAY,GAAkB,GAAmB;AAE/C,EADA,MAAM,EAAQ,EACd,KAAK,iBAAkB,KAAiB,EAAE;;CAE5C,eAA+B;CAI/B,oBAAoC;AAMN,EAL5B,EAA0B,MAAM,EAAY,EAC5C,KAAK,OAAe,UAAU,KAAK,SAAS,EAIhB,KAAK,OAC/B,yBACA,KAAK,SACN,CACmB,KAAK,EAAY,QAAQ;;CAG/C,iBAAiC;AAC/B,QAAU,MAAM,0BAA0B;;CAG5C,sBAAsC;AACpC,QAAU,MAAM,0BAA0B;;CAG5C,MAAgB,eAA8B;AAoB5C,EAnBA,KAAK,WAAW,IAAI,EAAiB,KAAK,UAAU,KAAK,eAAe,EAExE,KAAK,SAAS,gBACL,MAGJ,OAAO,kBACN,KAAK,eAAe,QAEtB,OAAO,gBAAgB,KAAK,WAQf,KAAK,OAAiB,aAAa,KAAK,SAAS,EAEpD,MAAM,GAAY,IAC9B,MAAM,KAAK,SAAS,wBAAwB;;CAIhD,SAAkC;AAChC,SAAO,KAAK;;CAGd,iBAAmC;AACjC,SAAO,EAAa"}
1
+ {"version":3,"file":"planner-jvLAnYww.mjs","names":[],"sources":["../../packages/planner-core/src/input/planner-input-manager.ts","../../packages/planner-core/src/utils/injectables.ts","../../packages/planner-core/src/planner.ts"],"sourcesContent":["import type { INPUT_EVENT_TYPE } from '../../../common-core/src/input/input-manager';\nimport InputManager from '../../../common-core/src/input/input-manager';\n\nexport default class PlannerInputManager extends InputManager {\n protected _canDrag(_type: INPUT_EVENT_TYPE): boolean {\n return true;\n }\n}\n","import ScriptLoader from '../../../common-core/src/script-loader';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport Logger from '../../../common-core/src/logger';\nimport { default as PlannerMeshGenerator } from '../webgl/planner-mesh-generator';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\nimport PlannerInputManager from '../input/planner-input-manager';\nimport PlannerSelectionHandler from './planner-selection-handler';\nimport GlobalInitData from '../../../common-core/src/utils/global-init-data';\nimport ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment(\n 'planner-input-manager',\n PlannerInputManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment(\n 'planner-mesh-generator',\n PlannerMeshGenerator,\n ),\n new DependencyInjectionAssignment(\n 'configurator-view-model',\n ConfiguratorViewModel,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n new DependencyInjectionAssignment('global-init-data', GlobalInitData),\n new DependencyInjectionAssignment(\n 'planner-selection-handler',\n PlannerSelectionHandler,\n ),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport { RoomlePlanner } from './roomle-planner';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport { INJECTABLES } from './utils/injectables';\nimport type PlannerKernelAccess from './services/planner-kernel-access';\nimport type Logger from '../../common-core/src/logger';\nimport { KERNEL_TYPE } from '../../common-core/src/services/common-kernel-access';\nimport type { PluginName } from '../../configurator-core/src/utils/plugin-types';\nimport type InitData from '../../common-core/src/utils/init-data';\nimport { isInIframe } from '../../common-core/src/utils/rapi-utils';\n\nexport class Planner<\n P extends readonly PluginName[] = readonly [],\n> extends Main {\n private _planner: RoomlePlanner<P>;\n private _activePlugins: P;\n\n constructor(creator?: string, activePlugins?: P) {\n super(creator);\n this._activePlugins = (activePlugins || []) as P;\n }\n protected setupGlobals(): void {\n //globals are initialized in bootFinished()\n }\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n this.lookup<Logger>('logger', this._context);\n // instantiate kernel acccess\n // instantiate pka\n // set pka on kernel access\n const plannerKernelAccess = this.lookup<PlannerKernelAccess>(\n 'planner-kernel-access',\n this._context,\n );\n plannerKernelAccess.init(KERNEL_TYPE.PLANNER);\n }\n\n protected cleanUpGlobals(): void {\n throw new Error('Method not implemented.');\n }\n\n protected cleanUpDependencies(): void {\n throw new Error('Method not implemented.');\n }\n\n protected async bootFinished(): Promise<void> {\n this._planner = new RoomlePlanner<P>(this._context, this._activePlugins);\n\n this._planner.getMain = () => {\n return this;\n };\n\n if (!window.RoomlePlanner) {\n if (this._activePlugins.length === 0) {\n // cast to unknown because we know that the planner is a RoomlePlanner\n window.RoomlePlanner = this._planner as unknown as RoomlePlanner;\n } else {\n window.RoomlePlanner = this._planner as RoomlePlanner<\n readonly PluginName[]\n >;\n }\n }\n\n const initData = this.lookup<InitData>('init-data', this._context);\n\n if (initData?.hi && isInIframe()) {\n await this._planner.setupHomagIntelligence();\n }\n }\n\n public getApi(): RoomlePlanner<P> {\n return this._planner;\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.PLANNER;\n }\n}\n"],"mappings":";;;AAGA,IAAqB,IAArB,cAAiD,EAAa;CAC5D,SAAmB,GAAkC;AACnD,SAAO;;GCQE,IAA+C;CAC1D,IAAI,EAA8B,iBAAiB,EAAa;CAChE,IAAI,EACF,yBACA,GACA,EAAQ,QACT;CACD,IAAI,EAA8B,UAAU,EAAO;CACnD,IAAI,EACF,0BACA,EACD;CACD,IAAI,EACF,2BACA,GACA,EAAQ,QACT;CACD,IAAI,EAA8B,eAAe,EAAW;CAC5D,IAAI,EAA8B,oBAAoB,EAAe;CACrE,IAAI,EACF,6BACA,EACD;CACF,ECxBY,IAAb,cAEU,EAAK;CAIb,YAAY,GAAkB,GAAmB;AAE/C,EADA,MAAM,EAAQ,EACd,KAAK,iBAAkB,KAAiB,EAAE;;CAE5C,eAA+B;CAI/B,oBAAoC;AAMN,EAL5B,EAA0B,MAAM,EAAY,EAC5C,KAAK,OAAe,UAAU,KAAK,SAAS,EAIhB,KAAK,OAC/B,yBACA,KAAK,SACN,CACmB,KAAK,EAAY,QAAQ;;CAG/C,iBAAiC;AAC/B,QAAU,MAAM,0BAA0B;;CAG5C,sBAAsC;AACpC,QAAU,MAAM,0BAA0B;;CAG5C,MAAgB,eAA8B;AAoB5C,EAnBA,KAAK,WAAW,IAAI,EAAiB,KAAK,UAAU,KAAK,eAAe,EAExE,KAAK,SAAS,gBACL,MAGJ,OAAO,kBACN,KAAK,eAAe,QAEtB,OAAO,gBAAgB,KAAK,WAQf,KAAK,OAAiB,aAAa,KAAK,SAAS,EAEpD,MAAM,GAAY,IAC9B,MAAM,KAAK,SAAS,wBAAwB;;CAIhD,SAAkC;AAChC,SAAO,KAAK;;CAGd,iBAAmC;AACjC,SAAO,EAAa"}
@@ -1408,6 +1408,7 @@ export declare interface ConfiguratorKernelClass {
1408
1408
  getPlanObjectParameters(planObjectId: number): KernelParameter[];
1409
1409
  getCommonPlanObjectParameters(planObjectIds: EmsArray<number>): KernelParameter[];
1410
1410
  getPlanObjectAnimations(planObjectId: number): KernelAnimation[];
1411
+ getPlanViews(planObjectId: number): KernelConfigurationPlanView[];
1411
1412
  setPlanObjectParameter(planObjectId: number, parameterKey: string, value: string): void;
1412
1413
  setPlanObjectsParameter(planObjectIds: any, parameterKey: string, value: string): void;
1413
1414
  dockComponent(childId: number, childDockId: number, parentId: number, parentDockId: number, position?: KernelVector3): void;
@@ -2674,6 +2675,7 @@ export declare interface Element_2 {
2674
2675
  export declare interface ElevationPlan {
2675
2676
  planSvg: string;
2676
2677
  viewType?: PlanViewType;
2678
+ label: string;
2677
2679
  }
2678
2680
 
2679
2681
  export declare interface ElevationPlans {
@@ -4644,6 +4646,13 @@ export declare interface KernelConfiguration {
4644
4646
  children: KernelConfiguration[];
4645
4647
  }
4646
4648
 
4649
+ export declare interface KernelConfigurationPlanView {
4650
+ viewType: PlanViewType;
4651
+ lineOfSight: KernelVector3f;
4652
+ enabled: boolean;
4653
+ label: string | null;
4654
+ }
4655
+
4647
4656
  export declare interface KernelCube {
4648
4657
  origin: KernelVector3;
4649
4658
  size: KernelVector3;
@@ -8405,11 +8414,12 @@ export declare class RoomleConfigurator<P extends readonly PluginName[] = readon
8405
8414
  private _onInitDone;
8406
8415
  constructor(creator: string, activePlugins?: P);
8407
8416
  /**
8408
- * Creates the 2D plans of the current configuration: the floor plan, the front
8409
- * elevation and the side elevation seen from the left. Each plan is returned as
8410
- * raw SVG markup (wireframe rendering with dimensionings).
8417
+ * Creates the 2D plans of the current configuration: the enabled plan views its root
8418
+ * component defines, or the floor plan, the front elevation and the side elevation seen
8419
+ * from the left when it defines none. Each plan is returned as raw SVG markup (wireframe
8420
+ * rendering with dimensionings).
8411
8421
  *
8412
- * @returns the plans, each containing its SVG markup and its view type
8422
+ * @returns the plans, each containing its SVG markup, its view type and its label
8413
8423
  */
8414
8424
  create2DPlanViews(): Promise<ElevationPlans>;
8415
8425
  /**
@@ -11441,6 +11451,7 @@ export declare class WebGpuGroundReflectionConfig implements WebGpuGroundReflect
11441
11451
  intensity: number;
11442
11452
  startFadeout: number;
11443
11453
  endFadeout: number;
11454
+ reflectionScale: number;
11444
11455
  }
11445
11456
 
11446
11457
  export declare interface WebGpuGroundReflectionConfigDefinition {
@@ -11467,6 +11478,12 @@ export declare interface WebGpuGroundReflectionConfigDefinition {
11467
11478
  * @default 0.15
11468
11479
  */
11469
11480
  endFadeout?: number;
11481
+ /**
11482
+ * @description How much the resolution of the scene is scaled by for the reflection resolution
11483
+ * If transmissive objects are not in use, this can be set to a lower value like 0.5 to improve performance.
11484
+ * @default 1
11485
+ */
11486
+ reflectionScale?: number;
11470
11487
  }
11471
11488
 
11472
11489
  export declare class WebGpuSkyConfig implements WebGpuSkyConfigDefinition {
@@ -1,16 +1,16 @@
1
- import { a as e, i as t, n, r, t as i } from "./packages-B4K6xrdJ.mjs";
1
+ import { a as e, i as t, n, r, t as i } from "./packages-BXAZEcKa.mjs";
2
2
  import { i as a, t as o } from "./kernel-BWfRHWkW.mjs";
3
- import { ht as s, yt as c } from "./threejs-utils-CLdyrCet.mjs";
3
+ import { ht as s, yt as c } from "./threejs-utils-v1uOvccg.mjs";
4
4
  import { Si as l, m as u, nt as d } from "./three.core-0KaTx8dm.mjs";
5
5
  import { i as f } from "./decorate-Bl-JF_YY.mjs";
6
6
  import { V as p } from "./common-utils-DbL4tku0.mjs";
7
- import { A as m, F as h, G as ee, J as te, K as ne, M as re, N as ie, P as ae, S as oe, V as se, W as ce, a as g, at as le, b as ue, ct as de, dt as fe, i as pe, j as me, k as he, l as ge, lt as _e, m as ve, mt as ye, o as _, ot as v, q as y, r as b, s as x, st as S, t as C, u as w, ut as T, x as E, y as D, z as O } from "./roomle-sdk-5aB4wxLW.mjs";
7
+ import { A as m, F as h, G as ee, J as te, K as ne, M as re, N as ie, P as ae, S as oe, V as se, W as ce, a as g, at as le, b as ue, ct as de, dt as fe, i as pe, j as me, k as he, l as ge, lt as _e, m as ve, mt as ye, o as _, ot as v, q as y, r as b, s as x, st as S, t as C, u as w, ut as T, x as E, y as D, z as O } from "./roomle-sdk-CBwhwX_e.mjs";
8
8
  import { n as k } from "./roomle-renderer-Ato6RMrd.mjs";
9
- import { n as A } from "./script-loader-axxcKvph.mjs";
10
- import { t as j } from "./configurator-CQ7KsW0O.mjs";
11
- import { t as M } from "./planner-HMMHSMAp.mjs";
12
- import { n as N, t as P } from "./glb-viewer-BWMMzvuG.mjs";
13
- import { t as be } from "./api-KWh-ESd5.mjs";
9
+ import { n as A } from "./script-loader-CvnG6LgL.mjs";
10
+ import { t as j } from "./configurator-CDw_c6tB.mjs";
11
+ import { t as M } from "./planner-jvLAnYww.mjs";
12
+ import { n as N, t as P } from "./glb-viewer-B-Zr743e.mjs";
13
+ import { t as be } from "./api-Bznmr-xZ.mjs";
14
14
  import { t as xe } from "./roomle-headless-setup-ps3I0vOP.mjs";
15
15
  import { createRequire as Se } from "module";
16
16
  //#region packages/headless-core/src/headless-tween-stub.ts
@@ -1 +1 @@
1
- {"version":3,"file":"roomle-renderer-Ato6RMrd.mjs","names":[],"sources":["../../packages/common-core/src/utils/shims.ts","../../packages/common-core/src/utils/fps-counter.ts","../../packages/common-core/src/roomle-renderer.ts"],"sourcesContent":["import type { ROOMLE_COLORS } from './common-utils';\nimport type {\n HexColorNumber,\n HexColorString,\n RapiId,\n RapiServerUrlType,\n} from '../../../typings/rapi-types';\nimport type { CAMERA_TYPE } from '../cameracontrol/camera-type';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { ROOMLE_HIGHLIGHTNG } from './common-utils';\nimport type { DefaultEnvironmentSceneType } from '../webgl/renderer/environment-scene';\nimport type {\n CustomShadingParameters,\n SceneShadingType,\n} from '../webgl/renderer/shading-settings';\nimport type { Color } from 'three';\nimport type { HomagIntelligenceInitData } from '../../../homag-intelligence/src/hi-api-types';\n\nexport const enum WINDOW_EVENT {\n RESIZE = 'resize',\n KEY_DOWN = 'keydown',\n KEY_UP = 'keyup',\n VISIBILITY_CHANGE = 'visibilitychange',\n}\n\nexport const DRAW_PREVIEW_MODES = {\n DEFAULT: 'default',\n VECTOR: 'vector',\n} as const;\n\nexport const WEBGPU_TONE_MAPPINGS = {\n NONE: 'none',\n LINEAR: 'linear',\n REINHARD: 'reinhard',\n CINEON: 'cineon',\n ACES_FILMIC: 'acesFilmic',\n AGX: 'agx',\n NEUTRAL: 'neutral',\n} as const;\n\nexport type WebGpuToneMapping = Enumify<typeof WEBGPU_TONE_MAPPINGS>;\n\n/**\n * Init data parameters which are not context specific\n */\nexport interface GlobalInitDataDefinition {\n /**\n * @description locale to use for the\n * embedding instance\n */\n locale?: string;\n\n /**\n * @internal\n * @deprecated\n * @description Can be used for content testing\n */\n overrideTenant?: number;\n\n /**\n * @description Set country to use for the Roomle price service. If not used the customer IP address will be used to determine the location. usage: overrideCountry=de\n */\n overrideCountry?: string | null;\n\n /**\n * @internal\n * @description Set which RAPI (Roomle API) backend should be used options: live, test\n */\n overrideRapi?: RapiServerUrlType;\n\n /**\n * @description The id which should be used for this embedding instance. When this id is set all InitData parameter can be set and changed in Rubens Admin. This is the way we recommend to set init data params. Ask your Roomle contact for your configuratorId.\n */\n configuratorId?: string;\n\n /**\n * @description Set which RAPI (Roomle API) backend should be used usage: customApiUrl=https://www.roomle.com/api/v2\n */\n customApiUrl?: string;\n\n /**\n * @internal\n * @description Can be set to true if started as an end-to-end test. This will disable post-processing\n */\n e2e?: boolean;\n\n /**\n * @internal\n * @description If set to true, the Roomle Renderer is used for perspective and top images this should help the E2E tests of Joe to migrate from comparing Roomle Renderer images to Three.js Renderer images\n */\n e2eRoomleRendererForImages?: boolean;\n\n /**\n * @internal\n * @description When loading a plan, the external objects from the plan XML are discarded\n */\n discardExternalObjectsWhenLoadingPlan?: boolean;\n\n /**\n * @description If set to true, the plan will be locked and no changes can be made to walls, floors or construction elements.\n * @default false\n */\n lockPlan?: boolean;\n\n /**\n * @description If set to true, the plan is in read-only mode. Hides all editing UI and prevents interaction with plan elements.\n * Automatically sets edit=false and lockPlan=true and saveToIdb=false\n * @default false\n */\n readonly?: boolean;\n}\n\nexport interface WebGpuTopLightConfigDefinition {\n /**\n * @description Intensity (brightness) of the WebGPU top light.\n * @default 1\n */\n intensity?: number;\n\n /**\n * @description Intensity of the shadow cast by the top light.\n * 0 means no shadow, 1 means a fully opaque shadow.\n * @default 1\n */\n shadowIntensity?: number;\n\n /**\n * @description Softness (blur radius) of the top light's shadow edges.\n * Higher values produce softer shadows.\n * @default 1.1\n */\n shadowRadius?: number;\n}\n\nexport interface WebGpuGroundReflectionConfigDefinition {\n /**\n * @description Enables or disables the ground reflection entirely.\n * When disabled the floor still receives shadows but does not render a reflection,\n * which also avoids the extra reflection render pass.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * @description Strength of the ground reflection.\n * 0 means no reflection, 1 means a full mirror-like reflection.\n * @default 0.1\n */\n intensity?: number;\n\n /**\n * @description Depth at which the reflection starts to fade out.\n * @default 0.05\n */\n startFadeout?: number;\n\n /**\n * @description Depth at which the reflection is fully faded out.\n * @default 0.15\n */\n endFadeout?: number;\n}\n\nexport interface WebGpuFogConfigDefinition {\n /**\n * @description If true, a fog is added to the scene in webGPU mode.\n * This is mainly so you cant see the outer edge of the\n * floor (which makes it blends smoothly into the background).\n * This fog exists in a cylindrical shape around the origin and the\n * farBlend and nearBlend parameters indirectly control the radius\n * at which the fog starts and ends.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * @description Radial distance from the start of the fog to the end of the fog.\n * This creates a smooth transition from full fog to no fog.\n * Larger values produce a softer, more gradual fog transition.\n * @default 7\n */\n nearBlend?: number;\n\n /**\n * @description Distance from the far end of the camera view/floor boundaries\n * at which the fully opaque fog should start to appear.\n * Larger values move the fully opaque(/end of the) fog\n * closer to the center of the scene.\n * @default 10\n */\n farBlend?: number;\n}\n\nexport interface WebGpuSkyConfigDefinition {\n /**\n * @description If true, adds a physically based (Hosek-Wilkie) sky and a matching\n * sun providing light to the scene.\n * @default false\n */\n enabled?: boolean;\n\n /**\n * @description Value determining the amount of aerosol particles in the sky. This\n * very much impacts the sky's color and clearness.\n * From the original paper: T = 2 yields a very clear, Arctic-like sky,\n * T = 3 a clear sky in a temperate climate,\n * T = 6 a sky on a warm, moist day,\n * T = 10 a slightly hazy sky\n * Valid range: `[1,10]`\n * @default 2.5\n */\n turbidity?: number;\n\n /**\n * @description Represents how much light the ground bounces back into the atmosphere,\n * which brightens the sky near the horizon if this value is high.\n * Valid range: `[0,1]`\n * @default 0.9\n */\n albedo?: number;\n\n /**\n * @description Horizontal orientation of the sun in radians.\n * Changing this value rotates the sun clockwise around\n * the scene without changing its height.\n * Valid range: `[-pi, pi]`\n * @default 0\n */\n azimuthAngle?: number;\n\n /**\n * @description Height of the sun measured as the angle\n * from straight up (the zenith), in radians. Smaller values raise the sun toward\n * noon; larger values lower it toward the horizon.\n * Valid range: `[0,pi/2≈1.57]`.\n * @default 1\n */\n polarAngle?: number;\n\n /**\n * @description Intensity of the sun that lights the scene and casts shadows.\n * This does not influence how the sun disc looks in the sky.\n * @default 10\n */\n sunLightIntensity?: number;\n\n /**\n * @description Radius of the visible sun disc in the sky.\n * @default 0.03\n */\n sunRadius?: number;\n\n /**\n * @description Blurryness of the edge of the visible sun disc in the sky.\n * @default 0.002\n */\n sunSoftness?: number;\n\n /**\n * @description Exposure multiplier applied during the sky-specific tone mapping.\n * Higher values make the sky brighter.\n * @default 0.5\n */\n tonemapExposure?: number;\n\n /**\n * @description The HDR brightness value which the sky-specific tone mapping considers as white.\n * Lower values clip bright areas (like the sun) to white sooner, increasing contrast.\n * Higher values preserve more detail in the brightest regions.\n * @default 14\n */\n tonemapWhite?: number;\n\n /**\n * @description Fraction of the sky covered by clouds.\n * At `0` no clouds are rendered. at `1` the sky is fully covered by clouds.\n * @default 0.25\n */\n cloudCoverage?: number;\n\n /**\n * @description Opacity of the clouds when they are blended over the sky. At `0` clouds\n * are invisible even if coverage is high; at `1` they fully replace the sky color\n * beneath them.\n * @default 0.3\n */\n cloudDensity?: number;\n\n /**\n * @description Height of the virtual cloud plane. A value of `0` places the plane\n * very high (clouds appear small and distant); `1` pulls it down towards the horizon\n * so clouds appear lower and larger.\n * @default 0.7\n */\n cloudElevation?: number;\n\n /**\n * @description Intensity of the environment map lighting while the sky is\n * enabled. Because the sky already contributes its own image-based lighting,\n * the environment map is dimmed to this value to keep the overall scene brightness balanced.\n * @default 0.5\n */\n overrideEnvironmentMapIntensity?: number;\n}\n\nexport interface WebGpuSSGIConfigDefinition {\n /**\n * @description Radius of the denoising filter applied to the indirect lighting.\n * Higher values produce a stronger denoising effect, which can help reduce noise\n * in the indirect lighting but may also blur fine details.\n * @default 20\n */\n giDenoiseRadius?: number;\n\n /**\n * @description Radius of the denoising filter applied to the ambient occlusion (AO) pass.\n * Higher values produce a stronger denoising effect, which can help reduce noise\n * in the AO but may also blur fine details.\n * @default 10\n */\n aoDenoiseRadius?: number;\n}\n\nexport interface WebGpuConfigDefinition {\n /**\n * @description If true, the initial webgpu quality level is autodetected based on\n * a benchmark of the graphics hardware. If false, the default quality level is used.\n * @default true\n */\n autoDetectQualityLevel?: boolean;\n\n /**\n * @description This can be used to configure the lower bound of webgpu auto quality\n * meaning the fps bound which, when hit, will set the quality setting lower\n * To disable: set to 0\n * @default 24\n */\n autoQualityMinFps?: number;\n\n /**\n * @description This can be used to configure the upper bound of webgpu auto quality\n * meaning the fps bound which, when hit, will set the quality setting higher\n * This should be sufficiently larger than the minFps to not cause the quality to go up and down all the time\n * To disable: set to something very high\n * @default 59\n */\n autoQualityMaxFps?: number;\n\n /**\n * @description Visual configuration for the WebGPU top light and its shadow.\n */\n topLight?: WebGpuTopLightConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU ground reflection.\n */\n groundReflection?: WebGpuGroundReflectionConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU fog.\n */\n fog?: WebGpuFogConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU sky and sun.\n */\n sky?: WebGpuSkyConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU screen space global illumination (SSGI) effect.\n */\n ssgi?: WebGpuSSGIConfigDefinition;\n\n /**\n * @description Tone mapping operator applied by the WebGPU renderer.\n * @default 'none'\n */\n toneMapping?: WebGpuToneMapping;\n\n /**\n * @description Exposure (intensity) of the tone mapping applied by the\n * WebGPU renderer. Higher values produce a brighter image.\n * @default 1\n */\n toneMappingExposure?: number;\n}\n\nexport interface FeatureFlags {\n pulsePreview?: boolean;\n reDock?: boolean;\n\n /**\n * @description Sets whether the snapping behavior of objects in the planner is initially enabled.\n */\n enableSnapping?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced docking behavior is enabled (for test purposes only)\n */\n advancedDocking?: boolean;\n\n /**\n * @internal\n * @description If true, when inserting new objects in the planner, we will try to merge them into existing groups if possible.\n * This is for test purposes only and should not be enabled in production yet, as it can lead to unexpected behavior.\n */\n mergeOnInsert?: boolean;\n\n /**\n * @internal\n * @description If “vector”, the vector preview is activated when drawing walls (for test purposes only).\n * By default, the walls are immediately drawn with their actual thickness,\n * but this leads to problems when displaying the dimensions of the walls,\n * as it is not possible to guess which side of the wall of the room currently being entered is the inside of the wall.\n */\n drawPreviewMode?: Enumify<typeof DRAW_PREVIEW_MODES>;\n /**\n * @internal\n * @description TO BE REMOVED ONCE RML-13218 IS RESOLVED.\n * Forces new thumbnails to be generated on configuration save\n */\n forceSaveThumbnails?: boolean;\n\n /**\n * @internal\n * @description Enables dynamically placed interior lights in the room planner.\n */\n interiorLights?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced dimensioning is enabled (for test purposes only)\n */\n advancedDimensioning?: boolean;\n\n /**\n * @internal\n * @deprecated Use the top-level `webGpu` init data property instead.\n * @description If true, the scene will be rendered with WebGPU instead of WebGL\n */\n webGpu?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced highlighting behavior is enabled (for test purposes only)\n */\n advancedHighlighting?: boolean;\n\n /**\n * @internal\n * @description If true, enables the POC for planning fences (e.g. garden fences) in the room planner.\n */\n fence?: boolean;\n\n /**\n * @internal\n * @description If true, `onRequestPlan` waits until every pending configuration\n * save in the plan has been persisted to the Roomle backend before firing.\n * See RML-17394\n */\n awaitConfigurationSavesBeforeRequestPlan?: boolean;\n}\n\nexport type RoomleColors = keyof typeof ROOMLE_COLORS;\n\nexport type ColorsIn3dScene = Record<\n RoomleColors,\n HexColorString | HexColorNumber\n>;\n\nexport type ThreeJsColorsIn3dScene = Record<keyof typeof ROOMLE_COLORS, Color>;\n\n/**\n * Init data parameter which can be used in configurator AND planner\n */\nexport interface CommonInitData {\n /**\n * @description If set to true the configurator will make sure every device has great user experience with fluid frame rate.\n * If set to false the configurator will always show the highest quality possible.\n * That could lead to stutter and other problems on low-end devices. We advise you to only turn off \"autoQuality\" if you really know what you are doing.\n * usage: autoQuality=false\n * @groups scene-settings\n */\n autoQuality?: boolean;\n\n /**\n * @description Can be used to personalize colors used in the 3D scene\n * @groups scene-settings\n */\n colors?: ColorsIn3dScene;\n\n /**\n * @description The item id or configuration id of the item which should be loaded.\n * Examples:\n * Configuration id: usm:frame:2449773A7F54278EBB61A67A10EF6A10E8BB6F38BE775B028AC050B438414507\n * Item id: usm:frame\n */\n id?: RapiId;\n\n /**\n * @internal\n * @deprecated\n * @description Use prices which are hardcoded in the configuration script.\n * Only used for trade show demos.\n */\n useRoomlePrice?: boolean;\n\n /**\n * @description Set how many positions after the decimal point should be shown.\n * For example:\n * 8' 1.68\" -> precisionCm=2 -> 8' 1.68\"\n * 8' 1.68\" -> precisionCm=1 -> 8' 1.7\"\n * 8' 1.68\" -> precisionCm=0 -> 8' 2\"\n */\n precisionInch?: number;\n\n /**\n * @description Set how many positions after the decimal point should be shown.\n * For example:\n * 123,45 -> precisionCm=2 -> 123,45\n * 123,45 -> precisionCm=1 -> 123,5\n * 123,45 -> precisionCm=0 -> 124\n */\n precisionCm?: number;\n\n /**\n * @description Defines which unit should be used for measurements/dimensions\n * Options: 'cm', 'mm', 'inchfeet'\n */\n unit?: string;\n\n /**\n * @description How the current unit should be formatted\n * Options:\n * - 'none': No unit string added, for example '200'\n * - 'long': Long unit string, for example '200 meters'\n * - 'short': Short unit string, for example '200 m'\n */\n unitStringType?: string;\n\n /**\n * @description When mesh selection is enabled, the meshes of the object are used directly for highlighting.\n * Setting it to false could be useful for square/rectangular (shelf) items.\n */\n meshSelection?: boolean;\n\n /**\n * @description if set to true it shows a little overlay with performance stats\n */\n stats?: boolean;\n\n /**\n * @description This flag enables:\n * - Scripter debug logs (e.g. which parameter is not assigned to a parameter group)\n * - Free camera movement (no restrictions, camera stays after reload, panning using Shift key)\n */\n debug?: boolean;\n\n /**\n * @description This flag enables:\n * - External object docking vector debug geometry\n */\n debugGeometry?: boolean;\n\n /**\n * @description If true this flag shows component bounding boxes\n */\n debugBoundingBox?: boolean;\n\n /**\n * @description This flag enables:\n * - Help line geometry in the planner\n * @internal\n */\n debugLines?: boolean;\n\n /**\n * @description If set to true, prices are calculated using the Roomle price service.\n * For more information ask your Roomle contact.\n */\n usePriceService?: boolean;\n\n /**\n * @description Url to an exr or hdr env map\n * @groups scene-settings\n */\n envMapUrl?: string;\n\n /**\n * @description Set the intensity of the environment map\n * @groups scene-settings\n */\n envMapIntensity?: number;\n\n /**\n * @description Set the rotation of the environment map in radians, between 0 and 2 * PI, rotates counter-clockwise\n * @groups scene-settings\n */\n envMapRotation?: number;\n\n /**\n * @description Set the maximum number of light sources extracted from the environment map\n * @groups scene-settings\n */\n maxLightSources?: number;\n\n /**\n * @description Use old light setting instead of env maps. Ignored when using the WebGPU renderer\n * @groups scene-settings\n */\n legacyLight?: boolean;\n\n /**\n * @description Generate environment map from a scene instead of env maps\n * use all_around for an surrounding light\n * use front for a mainly frontal light\n * @groups scene-settings\n */\n sceneLight?: DefaultEnvironmentSceneType;\n\n /**\n * @description General shading properties for the overall appearance\n * default: for planner and a configurator with colorful, metallic or wooden materials\n * bright: for a configurator with white and bright materials\n * @groups scene-settings\n */\n shading?: SceneShadingType;\n\n /**\n * @description Customized shading properties for the overall appearance\n * @groups scene-settings\n */\n customShading?: CustomShadingParameters;\n\n /**\n * @description Activates the linear AO filter mode to reduce AO anti-aliasing artifacts\n * @groups scene-settings\n */\n linearAoFilter?: boolean;\n\n /**\n * @description Customized shading properties for the overall appearance in MOC\n * @groups scene-settings\n */\n customShadingMoc?: CustomShadingParameters;\n\n /**\n * @description restrictionLevel defines visibility of parameters and possible children\n */\n restrictionLevel?: number;\n\n /**\n * @description Settings for Homag Intelligence\n * @internal\n */\n hi?: HomagIntelligenceInitData;\n\n /**\n * @description disable injection of default styles for measurements and component dimension labels\n * to enable easier customization of these styles (via the assigned classes)\n */\n disableDefaultLabelStyles?: boolean;\n}\n\nexport interface ConfiguratorInitData {\n /**\n * @description Sets the behavior of the highlighting of a hovered component.\n * usage: highlighting=smart\n */\n highlighting?: Enumify<typeof ROOMLE_HIGHLIGHTNG>;\n\n /**\n * @description Set the floor material which is used when loading the configurator\n * For different options see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}\n */\n initialFloorMaterial?: string;\n\n /**\n * @internal\n * @description Load a light setting using an URL.\n * Check lights in {@link @roomle/web-sdk/configurator-core/src/scene-settings-loader#SceneSettings} for an example.\n * value is a dynamic light setting url\n */\n dls?: string;\n\n /**\n * @description Load a predefined light setting, eg: ls=sofa\n * @groups scene-settings\n */\n ls?: string;\n\n /**\n * @description Set the distance to which the user can zoom (in centimeters).\n * default: object size divided by 10 or 10 cm\n * usage: zoomDistance=3\n * @groups scene-settings\n */\n zoomDistance?: number;\n\n /**\n * @description When set this param restricts the camera rotation to the given angle (e.g. 45 degree), this overrides minHorizontalCameraAngle and maxHorizontalCameraAngle\n * default: not set -> no camera restriction\n * usage: cameraRestriction=45\n * @groups scene-settings\n */\n cameraRestriction?: number;\n\n /**\n * @description Sets the default/initial vertical camera angle (pitch)\n * default: 10\n * usage: verticalCameraAngle=45\n * @groups scene-settings\n */\n verticalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the down/vertical camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: minVerticalCameraAngle=45\n * @groups scene-settings\n */\n minVerticalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the up/vertical camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: maxVerticalCameraAngle=45\n * @groups scene-settings\n */\n maxVerticalCameraAngle?: number;\n\n /**\n * @description Sets the default/initial horizontal camera angle (yaw)\n * default: -30\n * usage: horizontalCameraAngle=45\n * @groups scene-settings\n */\n horizontalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the left/horizontal camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: minHorizontalCameraAngle=45\n * @groups scene-settings\n */\n minHorizontalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the right/horizontal camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: maxHorizontalCameraAngle=45\n * @groups scene-settings\n */\n maxHorizontalCameraAngle?: number;\n\n /**\n * @description If set to false the camera will just jump to a new position\n * default: true\n * usage: animateCamera=false\n * @groups scene-settings\n */\n animateCamera?: boolean;\n\n /**\n * @internal\n * @description Easter Egg\n * */\n bananaForScale?: boolean;\n\n /**\n * @description If set to true, components which are between the camera and the selected component/preview will be rendered transparent\n * usage: transparentHighlighting=true\n * @groups scene-settings\n */\n transparentHighlighting?: boolean;\n\n /**\n * @description If set to true, the background is transparent and allows elements behind the configurator to be visible through the scene.\n * Not compatible with the WebGPU sky feature\n * usage: transparentBackground=true\n * @groups scene-settings\n */\n transparentBackground?: boolean;\n\n /**\n * @description If set to true it will try to apply all current global parameters to the loaded object\n */\n applyCurrentGlobalParameters?: boolean;\n\n /**\n * @description If set to true, component dimension labels stay visible even when the distance-based proximity check would normally hide them.\n * @default false\n */\n disableMeasurementCollisionDetection?: boolean;\n\n /**\n * @description Adds the given spacing (in centimeters) to the loaded object. This is then used to calculate the initial camera distance\n * default: 0\n * usage:\n * cameraSpacing=100, zoom out further by increasing camera spacing by 100 centimeters\n * cameraSpacing=-30, zoom in further by decreasing camera spacing by 30 centimeters\n * @groups scene-settings\n */\n cameraSpacing?: number;\n\n /**\n * @internal\n * @description If set to true, screen space reflections are enabled\n */\n ssr?: boolean;\n\n /**\n * @internal\n * @description features that can be enabled/disabled\n */\n featureFlags?: FeatureFlags;\n\n /**\n * @internal\n * @description If true, the scene will be rendered with WebGPU instead of WebGL\n * @default false\n * usage: webGpu=true\n */\n webGpu?: boolean;\n\n /**\n * @internal\n * @description Configuration for the WebGPU renderer (e.g. auto quality fps bounds).\n */\n webGpuConfig?: WebGpuConfigDefinition;\n\n /**\n * @description if true, the meshes of the component will be used, in addition to the bounding box, for raycasting (selecting)\n * Warning: this will decrease performance when hovering over components with complex meshes\n * @default false\n * usage: meshRaycasting=true\n */\n meshRaycasting?: boolean;\n}\n\nexport interface PlannerInitData {\n /**\n * @description Sets the default floor material when creating a new plan or drawing.\n * Can be a number (RGB color) or a string (material ID).\n */\n defaultFloorMaterial?: number | string;\n\n /**\n * @description Select with which camera mode to start initially.\n * usage: mode=2D\n * options: 2D, 3D, FP\n */\n mode?: Enumify<typeof CAMERA_TYPE>;\n\n /**\n * @internal\n * @description If set to true the plan can be edited.\n */\n edit?: boolean;\n\n /**\n * @description If set to true it will treat the planner as a multi object configurator (moc).\n * This means:\n * - do not merge geometries\n * - set configurator environment & lights in planner\n * - reduce initial spacing of camera (higher zoom)\n */\n moc?: boolean;\n\n /**\n * @description If set to true we will not hide other items while configuring in the planner\n */\n configureInRoom?: boolean;\n\n /**\n * @description If set to true docking of configurable objects in the planner is enabled.\n * The default value is true.\n */\n dockInRoom?: boolean;\n\n /**\n * @description If set to true the 3D planner camera zooms in as close to objects as the configurator does,\n * instead of stopping at the bounds of the plan. Objects which would be cut by the camera near plane are\n * hidden while they are cut.\n * @default false\n * usage: configuratorZoom=false\n */\n configuratorZoom?: boolean;\n}\n\nexport interface InitDataDefinition\n extends CommonInitData,\n ConfiguratorInitData,\n PlannerInitData {}\n","const FPS_LIST_SIZE = 10;\nconst FPS_MEASUREMENT_INTERVAL_MS = 20;\n\nexport default class FpsCounter {\n private _index: number = 0;\n private _fpsList: number[];\n private _prevTime: number = 0;\n private _frames: number = 0;\n private _fps: number = -1;\n\n constructor() {\n this._fpsList = Array(FPS_LIST_SIZE).fill(0);\n this._prevTime = (performance || Date).now();\n this.reset();\n }\n\n public update() {\n this._frames++;\n const time = (performance || Date).now();\n\n if (time >= this._prevTime + FPS_MEASUREMENT_INTERVAL_MS) {\n this._fpsList[this._index % FPS_LIST_SIZE] =\n (this._frames * 1000) / (time - this._prevTime);\n\n if (this._index >= FPS_LIST_SIZE) {\n this._fps =\n this._fpsList.reduce((pv, cv) => pv + cv) / this._fpsList.length;\n }\n\n this._prevTime = time;\n this._frames = 0;\n this._index++;\n }\n }\n\n public start() {\n this._prevTime = (performance || Date).now();\n this._frames = 0;\n }\n\n public reset() {\n this._fps = -1;\n this._fpsList = Array(FPS_LIST_SIZE).fill(0);\n this._index = 0;\n }\n\n public getFps() {\n return this._fps;\n }\n}\n","import type { Camera, Object3D, Scene, Vector2, WebGLRenderer } from 'three';\nimport { Box3 } from 'three';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { CAMERA_TYPE } from './cameracontrol/camera-type';\nimport type { WebGPURenderer } from 'three/webgpu';\nimport type { SceneShadingType } from './webgl/renderer/shading-settings';\nimport type { OutlineCustomParameters } from './webgl/renderer/scene-renderer';\n\nexport type GenericRoomleRenderer = RoomleRenderer<\n WebGLRenderer | WebGPURenderer\n>;\n\nexport enum PlannerRenderMode {\n Mode3D,\n Mode2D,\n}\n\nexport abstract class RoomleRenderer<\n RendererType extends WebGLRenderer | WebGPURenderer,\n> {\n public _creator_: string;\n public renderer: RendererType;\n protected isConfiguratorMode: boolean = true;\n protected isCameraMoving: boolean = false;\n protected cameraType: Enumify<typeof CAMERA_TYPE>;\n protected shadowNeedsUpdate: boolean = false;\n protected boundingBox: Box3 = new Box3();\n protected boundingBoxNeedsUpdate: boolean = false;\n\n protected constructor(creator: string, renderer: RendererType) {\n this._creator_ = creator;\n this.renderer = renderer;\n }\n\n public get isConfiguring(): boolean {\n return this.isConfiguratorMode;\n }\n\n public dispose(): void {\n this.renderer.dispose();\n }\n\n public setSize(width: number, height: number): void {\n this.renderer.setSize(width, height);\n }\n\n public getSize(target: Vector2): Vector2 {\n return this.renderer.getSize(target);\n }\n\n public setCameraType(cameraType: Enumify<typeof CAMERA_TYPE>) {\n this.cameraType = cameraType;\n }\n\n public movingCameraStarts(): void {\n this.isCameraMoving = true;\n }\n\n public movingCameraStops(): void {\n this.isCameraMoving = false;\n }\n\n public forceShadowUpdates(_updateBakedGroundShadow: boolean): void {\n this.shadowNeedsUpdate = true;\n }\n\n public clear() {\n this.renderer.clear();\n }\n\n public updateBounds(geometryBounds: Box3) {\n this.boundingBox.copy(geometryBounds);\n this.boundingBoxNeedsUpdate = true;\n }\n\n public switchToConfigurator(): void {\n this.isConfiguratorMode = true;\n }\n\n public switchToPlanner(_renderMode: PlannerRenderMode) {\n this.isConfiguratorMode = false;\n }\n\n public abstract setShadingType(shadingType: SceneShadingType): void;\n\n public abstract setCustomOutlineParameters(\n outlineCustomParameters: OutlineCustomParameters,\n ): void;\n\n public abstract render(scene: Scene, camera: Camera): void;\n\n public abstract showGUI(updateCallback: () => void): void;\n\n public abstract clearCache(): void;\n\n public abstract highlightObjects(selectedMeshes: Object3D[]): void;\n\n public abstract setGroundShadow(enabled: boolean, scene: Scene): void;\n\n public abstract enableUiInteractionMode(): void;\n\n public abstract disableUiInteractionMode(): void;\n}\n"],"mappings":";;AAkBA,IAAkB,IAAX,yBAAA,GAAA;QACL,EAAA,SAAA,UACA,EAAA,WAAA,WACA,EAAA,SAAA,SACA,EAAA,oBAAA;KACD,EAEY,IAAqB;CAChC,SAAS;CACT,QAAQ;CACT,EAE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AQ,EAAO;;CAGtC,cAAqB,GAAyC;AAC5D,OAAK,aAAa;;CAGpB,qBAAkC;AAChC,OAAK,iBAAiB;;CAGxB,oBAAiC;AAC/B,OAAK,iBAAiB;;CAGxB,mBAA0B,GAAyC;AACjE,OAAK,oBAAoB;;CAG3B,QAAe;AACb,OAAK,SAAS,OAAO;;CAGvB,aAAoB,GAAsB;AAExC,EADA,KAAK,YAAY,KAAK,EAAe,EACrC,KAAK,yBAAyB;;CAGhC,uBAAoC;AAClC,OAAK,qBAAqB;;CAG5B,gBAAuB,GAAgC;AACrD,OAAK,qBAAqB"}
1
+ {"version":3,"file":"roomle-renderer-Ato6RMrd.mjs","names":[],"sources":["../../packages/common-core/src/utils/shims.ts","../../packages/common-core/src/utils/fps-counter.ts","../../packages/common-core/src/roomle-renderer.ts"],"sourcesContent":["import type { ROOMLE_COLORS } from './common-utils';\nimport type {\n HexColorNumber,\n HexColorString,\n RapiId,\n RapiServerUrlType,\n} from '../../../typings/rapi-types';\nimport type { CAMERA_TYPE } from '../cameracontrol/camera-type';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { ROOMLE_HIGHLIGHTNG } from './common-utils';\nimport type { DefaultEnvironmentSceneType } from '../webgl/renderer/environment-scene';\nimport type {\n CustomShadingParameters,\n SceneShadingType,\n} from '../webgl/renderer/shading-settings';\nimport type { Color } from 'three';\nimport type { HomagIntelligenceInitData } from '../../../homag-intelligence/src/hi-api-types';\n\nexport const enum WINDOW_EVENT {\n RESIZE = 'resize',\n KEY_DOWN = 'keydown',\n KEY_UP = 'keyup',\n VISIBILITY_CHANGE = 'visibilitychange',\n}\n\nexport const DRAW_PREVIEW_MODES = {\n DEFAULT: 'default',\n VECTOR: 'vector',\n} as const;\n\nexport const WEBGPU_TONE_MAPPINGS = {\n NONE: 'none',\n LINEAR: 'linear',\n REINHARD: 'reinhard',\n CINEON: 'cineon',\n ACES_FILMIC: 'acesFilmic',\n AGX: 'agx',\n NEUTRAL: 'neutral',\n} as const;\n\nexport type WebGpuToneMapping = Enumify<typeof WEBGPU_TONE_MAPPINGS>;\n\n/**\n * Init data parameters which are not context specific\n */\nexport interface GlobalInitDataDefinition {\n /**\n * @description locale to use for the\n * embedding instance\n */\n locale?: string;\n\n /**\n * @internal\n * @deprecated\n * @description Can be used for content testing\n */\n overrideTenant?: number;\n\n /**\n * @description Set country to use for the Roomle price service. If not used the customer IP address will be used to determine the location. usage: overrideCountry=de\n */\n overrideCountry?: string | null;\n\n /**\n * @internal\n * @description Set which RAPI (Roomle API) backend should be used options: live, test\n */\n overrideRapi?: RapiServerUrlType;\n\n /**\n * @description The id which should be used for this embedding instance. When this id is set all InitData parameter can be set and changed in Rubens Admin. This is the way we recommend to set init data params. Ask your Roomle contact for your configuratorId.\n */\n configuratorId?: string;\n\n /**\n * @description Set which RAPI (Roomle API) backend should be used usage: customApiUrl=https://www.roomle.com/api/v2\n */\n customApiUrl?: string;\n\n /**\n * @internal\n * @description Can be set to true if started as an end-to-end test. This will disable post-processing\n */\n e2e?: boolean;\n\n /**\n * @internal\n * @description If set to true, the Roomle Renderer is used for perspective and top images this should help the E2E tests of Joe to migrate from comparing Roomle Renderer images to Three.js Renderer images\n */\n e2eRoomleRendererForImages?: boolean;\n\n /**\n * @internal\n * @description When loading a plan, the external objects from the plan XML are discarded\n */\n discardExternalObjectsWhenLoadingPlan?: boolean;\n\n /**\n * @description If set to true, the plan will be locked and no changes can be made to walls, floors or construction elements.\n * @default false\n */\n lockPlan?: boolean;\n\n /**\n * @description If set to true, the plan is in read-only mode. Hides all editing UI and prevents interaction with plan elements.\n * Automatically sets edit=false and lockPlan=true and saveToIdb=false\n * @default false\n */\n readonly?: boolean;\n}\n\nexport interface WebGpuTopLightConfigDefinition {\n /**\n * @description Intensity (brightness) of the WebGPU top light.\n * @default 1\n */\n intensity?: number;\n\n /**\n * @description Intensity of the shadow cast by the top light.\n * 0 means no shadow, 1 means a fully opaque shadow.\n * @default 1\n */\n shadowIntensity?: number;\n\n /**\n * @description Softness (blur radius) of the top light's shadow edges.\n * Higher values produce softer shadows.\n * @default 1.1\n */\n shadowRadius?: number;\n}\n\nexport interface WebGpuGroundReflectionConfigDefinition {\n /**\n * @description Enables or disables the ground reflection entirely.\n * When disabled the floor still receives shadows but does not render a reflection,\n * which also avoids the extra reflection render pass.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * @description Strength of the ground reflection.\n * 0 means no reflection, 1 means a full mirror-like reflection.\n * @default 0.1\n */\n intensity?: number;\n\n /**\n * @description Depth at which the reflection starts to fade out.\n * @default 0.05\n */\n startFadeout?: number;\n\n /**\n * @description Depth at which the reflection is fully faded out.\n * @default 0.15\n */\n endFadeout?: number;\n\n /**\n * @description How much the resolution of the scene is scaled by for the reflection resolution\n * If transmissive objects are not in use, this can be set to a lower value like 0.5 to improve performance.\n * @default 1\n */\n reflectionScale?: number;\n}\n\nexport interface WebGpuFogConfigDefinition {\n /**\n * @description If true, a fog is added to the scene in webGPU mode.\n * This is mainly so you cant see the outer edge of the\n * floor (which makes it blends smoothly into the background).\n * This fog exists in a cylindrical shape around the origin and the\n * farBlend and nearBlend parameters indirectly control the radius\n * at which the fog starts and ends.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * @description Radial distance from the start of the fog to the end of the fog.\n * This creates a smooth transition from full fog to no fog.\n * Larger values produce a softer, more gradual fog transition.\n * @default 7\n */\n nearBlend?: number;\n\n /**\n * @description Distance from the far end of the camera view/floor boundaries\n * at which the fully opaque fog should start to appear.\n * Larger values move the fully opaque(/end of the) fog\n * closer to the center of the scene.\n * @default 10\n */\n farBlend?: number;\n}\n\nexport interface WebGpuSkyConfigDefinition {\n /**\n * @description If true, adds a physically based (Hosek-Wilkie) sky and a matching\n * sun providing light to the scene.\n * @default false\n */\n enabled?: boolean;\n\n /**\n * @description Value determining the amount of aerosol particles in the sky. This\n * very much impacts the sky's color and clearness.\n * From the original paper: T = 2 yields a very clear, Arctic-like sky,\n * T = 3 a clear sky in a temperate climate,\n * T = 6 a sky on a warm, moist day,\n * T = 10 a slightly hazy sky\n * Valid range: `[1,10]`\n * @default 2.5\n */\n turbidity?: number;\n\n /**\n * @description Represents how much light the ground bounces back into the atmosphere,\n * which brightens the sky near the horizon if this value is high.\n * Valid range: `[0,1]`\n * @default 0.9\n */\n albedo?: number;\n\n /**\n * @description Horizontal orientation of the sun in radians.\n * Changing this value rotates the sun clockwise around\n * the scene without changing its height.\n * Valid range: `[-pi, pi]`\n * @default 0\n */\n azimuthAngle?: number;\n\n /**\n * @description Height of the sun measured as the angle\n * from straight up (the zenith), in radians. Smaller values raise the sun toward\n * noon; larger values lower it toward the horizon.\n * Valid range: `[0,pi/2≈1.57]`.\n * @default 1\n */\n polarAngle?: number;\n\n /**\n * @description Intensity of the sun that lights the scene and casts shadows.\n * This does not influence how the sun disc looks in the sky.\n * @default 10\n */\n sunLightIntensity?: number;\n\n /**\n * @description Radius of the visible sun disc in the sky.\n * @default 0.03\n */\n sunRadius?: number;\n\n /**\n * @description Blurryness of the edge of the visible sun disc in the sky.\n * @default 0.002\n */\n sunSoftness?: number;\n\n /**\n * @description Exposure multiplier applied during the sky-specific tone mapping.\n * Higher values make the sky brighter.\n * @default 0.5\n */\n tonemapExposure?: number;\n\n /**\n * @description The HDR brightness value which the sky-specific tone mapping considers as white.\n * Lower values clip bright areas (like the sun) to white sooner, increasing contrast.\n * Higher values preserve more detail in the brightest regions.\n * @default 14\n */\n tonemapWhite?: number;\n\n /**\n * @description Fraction of the sky covered by clouds.\n * At `0` no clouds are rendered. at `1` the sky is fully covered by clouds.\n * @default 0.25\n */\n cloudCoverage?: number;\n\n /**\n * @description Opacity of the clouds when they are blended over the sky. At `0` clouds\n * are invisible even if coverage is high; at `1` they fully replace the sky color\n * beneath them.\n * @default 0.3\n */\n cloudDensity?: number;\n\n /**\n * @description Height of the virtual cloud plane. A value of `0` places the plane\n * very high (clouds appear small and distant); `1` pulls it down towards the horizon\n * so clouds appear lower and larger.\n * @default 0.7\n */\n cloudElevation?: number;\n\n /**\n * @description Intensity of the environment map lighting while the sky is\n * enabled. Because the sky already contributes its own image-based lighting,\n * the environment map is dimmed to this value to keep the overall scene brightness balanced.\n * @default 0.5\n */\n overrideEnvironmentMapIntensity?: number;\n}\n\nexport interface WebGpuSSGIConfigDefinition {\n /**\n * @description Radius of the denoising filter applied to the indirect lighting.\n * Higher values produce a stronger denoising effect, which can help reduce noise\n * in the indirect lighting but may also blur fine details.\n * @default 20\n */\n giDenoiseRadius?: number;\n\n /**\n * @description Radius of the denoising filter applied to the ambient occlusion (AO) pass.\n * Higher values produce a stronger denoising effect, which can help reduce noise\n * in the AO but may also blur fine details.\n * @default 10\n */\n aoDenoiseRadius?: number;\n}\n\nexport interface WebGpuConfigDefinition {\n /**\n * @description If true, the initial webgpu quality level is autodetected based on\n * a benchmark of the graphics hardware. If false, the default quality level is used.\n * @default true\n */\n autoDetectQualityLevel?: boolean;\n\n /**\n * @description This can be used to configure the lower bound of webgpu auto quality\n * meaning the fps bound which, when hit, will set the quality setting lower\n * To disable: set to 0\n * @default 24\n */\n autoQualityMinFps?: number;\n\n /**\n * @description This can be used to configure the upper bound of webgpu auto quality\n * meaning the fps bound which, when hit, will set the quality setting higher\n * This should be sufficiently larger than the minFps to not cause the quality to go up and down all the time\n * To disable: set to something very high\n * @default 59\n */\n autoQualityMaxFps?: number;\n\n /**\n * @description Visual configuration for the WebGPU top light and its shadow.\n */\n topLight?: WebGpuTopLightConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU ground reflection.\n */\n groundReflection?: WebGpuGroundReflectionConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU fog.\n */\n fog?: WebGpuFogConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU sky and sun.\n */\n sky?: WebGpuSkyConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU screen space global illumination (SSGI) effect.\n */\n ssgi?: WebGpuSSGIConfigDefinition;\n\n /**\n * @description Tone mapping operator applied by the WebGPU renderer.\n * @default 'none'\n */\n toneMapping?: WebGpuToneMapping;\n\n /**\n * @description Exposure (intensity) of the tone mapping applied by the\n * WebGPU renderer. Higher values produce a brighter image.\n * @default 1\n */\n toneMappingExposure?: number;\n}\n\nexport interface FeatureFlags {\n pulsePreview?: boolean;\n reDock?: boolean;\n\n /**\n * @description Sets whether the snapping behavior of objects in the planner is initially enabled.\n */\n enableSnapping?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced docking behavior is enabled (for test purposes only)\n */\n advancedDocking?: boolean;\n\n /**\n * @internal\n * @description If true, when inserting new objects in the planner, we will try to merge them into existing groups if possible.\n * This is for test purposes only and should not be enabled in production yet, as it can lead to unexpected behavior.\n */\n mergeOnInsert?: boolean;\n\n /**\n * @internal\n * @description If “vector”, the vector preview is activated when drawing walls (for test purposes only).\n * By default, the walls are immediately drawn with their actual thickness,\n * but this leads to problems when displaying the dimensions of the walls,\n * as it is not possible to guess which side of the wall of the room currently being entered is the inside of the wall.\n */\n drawPreviewMode?: Enumify<typeof DRAW_PREVIEW_MODES>;\n /**\n * @internal\n * @description TO BE REMOVED ONCE RML-13218 IS RESOLVED.\n * Forces new thumbnails to be generated on configuration save\n */\n forceSaveThumbnails?: boolean;\n\n /**\n * @internal\n * @description Enables dynamically placed interior lights in the room planner.\n */\n interiorLights?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced dimensioning is enabled (for test purposes only)\n */\n advancedDimensioning?: boolean;\n\n /**\n * @internal\n * @deprecated Use the top-level `webGpu` init data property instead.\n * @description If true, the scene will be rendered with WebGPU instead of WebGL\n */\n webGpu?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced highlighting behavior is enabled (for test purposes only)\n */\n advancedHighlighting?: boolean;\n\n /**\n * @internal\n * @description If true, enables the POC for planning fences (e.g. garden fences) in the room planner.\n */\n fence?: boolean;\n\n /**\n * @internal\n * @description If true, `onRequestPlan` waits until every pending configuration\n * save in the plan has been persisted to the Roomle backend before firing.\n * See RML-17394\n */\n awaitConfigurationSavesBeforeRequestPlan?: boolean;\n}\n\nexport type RoomleColors = keyof typeof ROOMLE_COLORS;\n\nexport type ColorsIn3dScene = Record<\n RoomleColors,\n HexColorString | HexColorNumber\n>;\n\nexport type ThreeJsColorsIn3dScene = Record<keyof typeof ROOMLE_COLORS, Color>;\n\n/**\n * Init data parameter which can be used in configurator AND planner\n */\nexport interface CommonInitData {\n /**\n * @description If set to true the configurator will make sure every device has great user experience with fluid frame rate.\n * If set to false the configurator will always show the highest quality possible.\n * That could lead to stutter and other problems on low-end devices. We advise you to only turn off \"autoQuality\" if you really know what you are doing.\n * usage: autoQuality=false\n * @groups scene-settings\n */\n autoQuality?: boolean;\n\n /**\n * @description Can be used to personalize colors used in the 3D scene\n * @groups scene-settings\n */\n colors?: ColorsIn3dScene;\n\n /**\n * @description The item id or configuration id of the item which should be loaded.\n * Examples:\n * Configuration id: usm:frame:2449773A7F54278EBB61A67A10EF6A10E8BB6F38BE775B028AC050B438414507\n * Item id: usm:frame\n */\n id?: RapiId;\n\n /**\n * @internal\n * @deprecated\n * @description Use prices which are hardcoded in the configuration script.\n * Only used for trade show demos.\n */\n useRoomlePrice?: boolean;\n\n /**\n * @description Set how many positions after the decimal point should be shown.\n * For example:\n * 8' 1.68\" -> precisionCm=2 -> 8' 1.68\"\n * 8' 1.68\" -> precisionCm=1 -> 8' 1.7\"\n * 8' 1.68\" -> precisionCm=0 -> 8' 2\"\n */\n precisionInch?: number;\n\n /**\n * @description Set how many positions after the decimal point should be shown.\n * For example:\n * 123,45 -> precisionCm=2 -> 123,45\n * 123,45 -> precisionCm=1 -> 123,5\n * 123,45 -> precisionCm=0 -> 124\n */\n precisionCm?: number;\n\n /**\n * @description Defines which unit should be used for measurements/dimensions\n * Options: 'cm', 'mm', 'inchfeet'\n */\n unit?: string;\n\n /**\n * @description How the current unit should be formatted\n * Options:\n * - 'none': No unit string added, for example '200'\n * - 'long': Long unit string, for example '200 meters'\n * - 'short': Short unit string, for example '200 m'\n */\n unitStringType?: string;\n\n /**\n * @description When mesh selection is enabled, the meshes of the object are used directly for highlighting.\n * Setting it to false could be useful for square/rectangular (shelf) items.\n */\n meshSelection?: boolean;\n\n /**\n * @description if set to true it shows a little overlay with performance stats\n */\n stats?: boolean;\n\n /**\n * @description This flag enables:\n * - Scripter debug logs (e.g. which parameter is not assigned to a parameter group)\n * - Free camera movement (no restrictions, camera stays after reload, panning using Shift key)\n */\n debug?: boolean;\n\n /**\n * @description This flag enables:\n * - External object docking vector debug geometry\n */\n debugGeometry?: boolean;\n\n /**\n * @description If true this flag shows component bounding boxes\n */\n debugBoundingBox?: boolean;\n\n /**\n * @description This flag enables:\n * - Help line geometry in the planner\n * @internal\n */\n debugLines?: boolean;\n\n /**\n * @description If set to true, prices are calculated using the Roomle price service.\n * For more information ask your Roomle contact.\n */\n usePriceService?: boolean;\n\n /**\n * @description Url to an exr or hdr env map\n * @groups scene-settings\n */\n envMapUrl?: string;\n\n /**\n * @description Set the intensity of the environment map\n * @groups scene-settings\n */\n envMapIntensity?: number;\n\n /**\n * @description Set the rotation of the environment map in radians, between 0 and 2 * PI, rotates counter-clockwise\n * @groups scene-settings\n */\n envMapRotation?: number;\n\n /**\n * @description Set the maximum number of light sources extracted from the environment map\n * @groups scene-settings\n */\n maxLightSources?: number;\n\n /**\n * @description Use old light setting instead of env maps. Ignored when using the WebGPU renderer\n * @groups scene-settings\n */\n legacyLight?: boolean;\n\n /**\n * @description Generate environment map from a scene instead of env maps\n * use all_around for an surrounding light\n * use front for a mainly frontal light\n * @groups scene-settings\n */\n sceneLight?: DefaultEnvironmentSceneType;\n\n /**\n * @description General shading properties for the overall appearance\n * default: for planner and a configurator with colorful, metallic or wooden materials\n * bright: for a configurator with white and bright materials\n * @groups scene-settings\n */\n shading?: SceneShadingType;\n\n /**\n * @description Customized shading properties for the overall appearance\n * @groups scene-settings\n */\n customShading?: CustomShadingParameters;\n\n /**\n * @description Activates the linear AO filter mode to reduce AO anti-aliasing artifacts\n * @groups scene-settings\n */\n linearAoFilter?: boolean;\n\n /**\n * @description Customized shading properties for the overall appearance in MOC\n * @groups scene-settings\n */\n customShadingMoc?: CustomShadingParameters;\n\n /**\n * @description restrictionLevel defines visibility of parameters and possible children\n */\n restrictionLevel?: number;\n\n /**\n * @description Settings for Homag Intelligence\n * @internal\n */\n hi?: HomagIntelligenceInitData;\n\n /**\n * @description disable injection of default styles for measurements and component dimension labels\n * to enable easier customization of these styles (via the assigned classes)\n */\n disableDefaultLabelStyles?: boolean;\n}\n\nexport interface ConfiguratorInitData {\n /**\n * @description Sets the behavior of the highlighting of a hovered component.\n * usage: highlighting=smart\n */\n highlighting?: Enumify<typeof ROOMLE_HIGHLIGHTNG>;\n\n /**\n * @description Set the floor material which is used when loading the configurator\n * For different options see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}\n */\n initialFloorMaterial?: string;\n\n /**\n * @internal\n * @description Load a light setting using an URL.\n * Check lights in {@link @roomle/web-sdk/configurator-core/src/scene-settings-loader#SceneSettings} for an example.\n * value is a dynamic light setting url\n */\n dls?: string;\n\n /**\n * @description Load a predefined light setting, eg: ls=sofa\n * @groups scene-settings\n */\n ls?: string;\n\n /**\n * @description Set the distance to which the user can zoom (in centimeters).\n * default: object size divided by 10 or 10 cm\n * usage: zoomDistance=3\n * @groups scene-settings\n */\n zoomDistance?: number;\n\n /**\n * @description When set this param restricts the camera rotation to the given angle (e.g. 45 degree), this overrides minHorizontalCameraAngle and maxHorizontalCameraAngle\n * default: not set -> no camera restriction\n * usage: cameraRestriction=45\n * @groups scene-settings\n */\n cameraRestriction?: number;\n\n /**\n * @description Sets the default/initial vertical camera angle (pitch)\n * default: 10\n * usage: verticalCameraAngle=45\n * @groups scene-settings\n */\n verticalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the down/vertical camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: minVerticalCameraAngle=45\n * @groups scene-settings\n */\n minVerticalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the up/vertical camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: maxVerticalCameraAngle=45\n * @groups scene-settings\n */\n maxVerticalCameraAngle?: number;\n\n /**\n * @description Sets the default/initial horizontal camera angle (yaw)\n * default: -30\n * usage: horizontalCameraAngle=45\n * @groups scene-settings\n */\n horizontalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the left/horizontal camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: minHorizontalCameraAngle=45\n * @groups scene-settings\n */\n minHorizontalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the right/horizontal camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: maxHorizontalCameraAngle=45\n * @groups scene-settings\n */\n maxHorizontalCameraAngle?: number;\n\n /**\n * @description If set to false the camera will just jump to a new position\n * default: true\n * usage: animateCamera=false\n * @groups scene-settings\n */\n animateCamera?: boolean;\n\n /**\n * @internal\n * @description Easter Egg\n * */\n bananaForScale?: boolean;\n\n /**\n * @description If set to true, components which are between the camera and the selected component/preview will be rendered transparent\n * usage: transparentHighlighting=true\n * @groups scene-settings\n */\n transparentHighlighting?: boolean;\n\n /**\n * @description If set to true, the background is transparent and allows elements behind the configurator to be visible through the scene.\n * Not compatible with the WebGPU sky feature\n * usage: transparentBackground=true\n * @groups scene-settings\n */\n transparentBackground?: boolean;\n\n /**\n * @description If set to true it will try to apply all current global parameters to the loaded object\n */\n applyCurrentGlobalParameters?: boolean;\n\n /**\n * @description If set to true, component dimension labels stay visible even when the distance-based proximity check would normally hide them.\n * @default false\n */\n disableMeasurementCollisionDetection?: boolean;\n\n /**\n * @description Adds the given spacing (in centimeters) to the loaded object. This is then used to calculate the initial camera distance\n * default: 0\n * usage:\n * cameraSpacing=100, zoom out further by increasing camera spacing by 100 centimeters\n * cameraSpacing=-30, zoom in further by decreasing camera spacing by 30 centimeters\n * @groups scene-settings\n */\n cameraSpacing?: number;\n\n /**\n * @internal\n * @description If set to true, screen space reflections are enabled\n */\n ssr?: boolean;\n\n /**\n * @internal\n * @description features that can be enabled/disabled\n */\n featureFlags?: FeatureFlags;\n\n /**\n * @internal\n * @description If true, the scene will be rendered with WebGPU instead of WebGL\n * @default false\n * usage: webGpu=true\n */\n webGpu?: boolean;\n\n /**\n * @internal\n * @description Configuration for the WebGPU renderer (e.g. auto quality fps bounds).\n */\n webGpuConfig?: WebGpuConfigDefinition;\n\n /**\n * @description if true, the meshes of the component will be used, in addition to the bounding box, for raycasting (selecting)\n * Warning: this will decrease performance when hovering over components with complex meshes\n * @default false\n * usage: meshRaycasting=true\n */\n meshRaycasting?: boolean;\n}\n\nexport interface PlannerInitData {\n /**\n * @description Sets the default floor material when creating a new plan or drawing.\n * Can be a number (RGB color) or a string (material ID).\n */\n defaultFloorMaterial?: number | string;\n\n /**\n * @description Select with which camera mode to start initially.\n * usage: mode=2D\n * options: 2D, 3D, FP\n */\n mode?: Enumify<typeof CAMERA_TYPE>;\n\n /**\n * @internal\n * @description If set to true the plan can be edited.\n */\n edit?: boolean;\n\n /**\n * @description If set to true it will treat the planner as a multi object configurator (moc).\n * This means:\n * - do not merge geometries\n * - set configurator environment & lights in planner\n * - reduce initial spacing of camera (higher zoom)\n */\n moc?: boolean;\n\n /**\n * @description If set to true we will not hide other items while configuring in the planner\n */\n configureInRoom?: boolean;\n\n /**\n * @description If set to true docking of configurable objects in the planner is enabled.\n * The default value is true.\n */\n dockInRoom?: boolean;\n\n /**\n * @description If set to true the 3D planner camera zooms in as close to objects as the configurator does,\n * instead of stopping at the bounds of the plan. Objects which would be cut by the camera near plane are\n * hidden while they are cut.\n * @default false\n * usage: configuratorZoom=false\n */\n configuratorZoom?: boolean;\n}\n\nexport interface InitDataDefinition\n extends CommonInitData,\n ConfiguratorInitData,\n PlannerInitData {}\n","const FPS_LIST_SIZE = 10;\nconst FPS_MEASUREMENT_INTERVAL_MS = 20;\n\nexport default class FpsCounter {\n private _index: number = 0;\n private _fpsList: number[];\n private _prevTime: number = 0;\n private _frames: number = 0;\n private _fps: number = -1;\n\n constructor() {\n this._fpsList = Array(FPS_LIST_SIZE).fill(0);\n this._prevTime = (performance || Date).now();\n this.reset();\n }\n\n public update() {\n this._frames++;\n const time = (performance || Date).now();\n\n if (time >= this._prevTime + FPS_MEASUREMENT_INTERVAL_MS) {\n this._fpsList[this._index % FPS_LIST_SIZE] =\n (this._frames * 1000) / (time - this._prevTime);\n\n if (this._index >= FPS_LIST_SIZE) {\n this._fps =\n this._fpsList.reduce((pv, cv) => pv + cv) / this._fpsList.length;\n }\n\n this._prevTime = time;\n this._frames = 0;\n this._index++;\n }\n }\n\n public start() {\n this._prevTime = (performance || Date).now();\n this._frames = 0;\n }\n\n public reset() {\n this._fps = -1;\n this._fpsList = Array(FPS_LIST_SIZE).fill(0);\n this._index = 0;\n }\n\n public getFps() {\n return this._fps;\n }\n}\n","import type { Camera, Object3D, Scene, Vector2, WebGLRenderer } from 'three';\nimport { Box3 } from 'three';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { CAMERA_TYPE } from './cameracontrol/camera-type';\nimport type { WebGPURenderer } from 'three/webgpu';\nimport type { SceneShadingType } from './webgl/renderer/shading-settings';\nimport type { OutlineCustomParameters } from './webgl/renderer/scene-renderer';\n\nexport type GenericRoomleRenderer = RoomleRenderer<\n WebGLRenderer | WebGPURenderer\n>;\n\nexport enum PlannerRenderMode {\n Mode3D,\n Mode2D,\n}\n\nexport abstract class RoomleRenderer<\n RendererType extends WebGLRenderer | WebGPURenderer,\n> {\n public _creator_: string;\n public renderer: RendererType;\n protected isConfiguratorMode: boolean = true;\n protected isCameraMoving: boolean = false;\n protected cameraType: Enumify<typeof CAMERA_TYPE>;\n protected shadowNeedsUpdate: boolean = false;\n protected boundingBox: Box3 = new Box3();\n protected boundingBoxNeedsUpdate: boolean = false;\n\n protected constructor(creator: string, renderer: RendererType) {\n this._creator_ = creator;\n this.renderer = renderer;\n }\n\n public get isConfiguring(): boolean {\n return this.isConfiguratorMode;\n }\n\n public dispose(): void {\n this.renderer.dispose();\n }\n\n public setSize(width: number, height: number): void {\n this.renderer.setSize(width, height);\n }\n\n public getSize(target: Vector2): Vector2 {\n return this.renderer.getSize(target);\n }\n\n public setCameraType(cameraType: Enumify<typeof CAMERA_TYPE>) {\n this.cameraType = cameraType;\n }\n\n public movingCameraStarts(): void {\n this.isCameraMoving = true;\n }\n\n public movingCameraStops(): void {\n this.isCameraMoving = false;\n }\n\n public forceShadowUpdates(_updateBakedGroundShadow: boolean): void {\n this.shadowNeedsUpdate = true;\n }\n\n public clear() {\n this.renderer.clear();\n }\n\n public updateBounds(geometryBounds: Box3) {\n this.boundingBox.copy(geometryBounds);\n this.boundingBoxNeedsUpdate = true;\n }\n\n public switchToConfigurator(): void {\n this.isConfiguratorMode = true;\n }\n\n public switchToPlanner(_renderMode: PlannerRenderMode) {\n this.isConfiguratorMode = false;\n }\n\n public abstract setShadingType(shadingType: SceneShadingType): void;\n\n public abstract setCustomOutlineParameters(\n outlineCustomParameters: OutlineCustomParameters,\n ): void;\n\n public abstract render(scene: Scene, camera: Camera): void;\n\n public abstract showGUI(updateCallback: () => void): void;\n\n public abstract clearCache(): void;\n\n public abstract highlightObjects(selectedMeshes: Object3D[]): void;\n\n public abstract setGroundShadow(enabled: boolean, scene: Scene): void;\n\n public abstract enableUiInteractionMode(): void;\n\n public abstract disableUiInteractionMode(): void;\n}\n"],"mappings":";;AAkBA,IAAkB,IAAX,yBAAA,GAAA;QACL,EAAA,SAAA,UACA,EAAA,WAAA,WACA,EAAA,SAAA,SACA,EAAA,oBAAA;KACD,EAEY,IAAqB;CAChC,SAAS;CACT,QAAQ;CACT,EAEY,IAAuB;CAClC,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,aAAa;CACb,KAAK;CACL,SAAS;CACV,ECtCK,IAAgB,IAChB,IAA8B,IAEf,IAArB,MAAgC;CAO9B,cAAc;AAGZ,gBATuB,oBAEG,kBACF,eACH,IAGrB,KAAK,WAA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