@roomle/web-sdk 2.28.0 → 2.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{banana-for-scale-dd4c5739.js → banana-for-scale-656cea8a.js} +2 -2
- package/lib/{banana-for-scale-dd4c5739.js.map → banana-for-scale-656cea8a.js.map} +1 -1
- package/lib/{banana-for-scale-2239eff7.nomodule.js → banana-for-scale-89f70127.nomodule.js} +2 -2
- package/lib/{banana-for-scale-2239eff7.nomodule.js.map → banana-for-scale-89f70127.nomodule.js.map} +1 -1
- package/lib/{budgeteer-measure-05dc445d.js → budgeteer-measure-8cfea554.js} +2 -2
- package/lib/{budgeteer-measure-05dc445d.js.map → budgeteer-measure-8cfea554.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/{component-dimensioning-07857a7e.js → component-dimensioning-1b5f64dd.js} +2 -2
- package/lib/component-dimensioning-1b5f64dd.js.map +1 -0
- package/lib/{component-dimensioning-e121b044.nomodule.js → component-dimensioning-7bdd1b3b.nomodule.js} +2 -2
- package/lib/component-dimensioning-7bdd1b3b.nomodule.js.map +1 -0
- package/lib/configurator-6e7f5ef0.js +2 -0
- package/lib/{configurator-366b9a69.js.map → configurator-6e7f5ef0.js.map} +1 -1
- package/lib/configurator-eddf59f1.nomodule.js +2 -0
- package/lib/{configurator-b498456a.nomodule.js.map → configurator-eddf59f1.nomodule.js.map} +1 -1
- package/lib/configurator-main-7acfa92f.js +2 -0
- package/lib/configurator-main-7acfa92f.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/configurator-mesh-generator-05375458.nomodule.js +2 -0
- package/lib/configurator-mesh-generator-05375458.nomodule.js.map +1 -0
- package/lib/{configurator-mesh-generator-e827c528.js → configurator-mesh-generator-f210ee04.js} +2 -2
- package/lib/configurator-mesh-generator-f210ee04.js.map +1 -0
- package/lib/{default-light-setting-7eb7961c.js → default-light-setting-7de63c9a.js} +2 -2
- package/lib/default-light-setting-7de63c9a.js.map +1 -0
- package/lib/{default-light-setting-f21a820b.nomodule.js → default-light-setting-e4720308.nomodule.js} +2 -2
- package/lib/default-light-setting-e4720308.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/services/global-callback.d.ts +1 -0
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +7 -1
- package/lib/definitions/configurator-core/src/webgl/scene-helper.d.ts +1 -1
- package/lib/{dimensioning-helper-73700224.nomodule.js → dimensioning-helper-844fc69d.nomodule.js} +2 -2
- package/lib/dimensioning-helper-844fc69d.nomodule.js.map +1 -0
- package/lib/{dimensioning-helper-2f129aab.js → dimensioning-helper-e77fbedb.js} +2 -2
- package/lib/dimensioning-helper-e77fbedb.js.map +1 -0
- package/lib/glb-viewer-0331f919.js +2 -0
- package/lib/{glb-viewer-10243e50.js.map → glb-viewer-0331f919.js.map} +1 -1
- package/lib/glb-viewer-6e5482c7.nomodule.js +2 -0
- package/lib/{glb-viewer-d6e080e4.nomodule.js.map → glb-viewer-6e5482c7.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-17601c40.js +2 -0
- package/lib/glb-viewer-main-17601c40.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/image-renderer-880c414d.nomodule.js +2 -0
- package/lib/{image-renderer-9478b17b.nomodule.js.map → image-renderer-880c414d.nomodule.js.map} +1 -1
- package/lib/image-renderer-ad267c8b.js +2 -0
- package/lib/{image-renderer-9e47bc3a.js.map → image-renderer-ad267c8b.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-1dc75d47.legacy.js → banana-for-scale-bd7d6dfd.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-1dc75d47.legacy.js.map → banana-for-scale-bd7d6dfd.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/{component-dimensioning-d657350b.legacy.js → component-dimensioning-59fd1367.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-59fd1367.legacy.js.map +1 -0
- package/lib/legacy/configurator-82b7967e.legacy.js +2 -0
- package/lib/legacy/{configurator-3250dfc2.legacy.js.map → configurator-82b7967e.legacy.js.map} +1 -1
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{configurator-mesh-generator-d604f05c.legacy.js → configurator-mesh-generator-6266fa75.legacy.js} +2 -2
- package/lib/legacy/configurator-mesh-generator-6266fa75.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-14b03f67.legacy.js → default-light-setting-97f711dc.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-97f711dc.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-bed08d96.legacy.js → dimensioning-helper-99057da2.legacy.js} +2 -2
- package/lib/legacy/dimensioning-helper-99057da2.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-be2c067a.legacy.js +2 -0
- package/lib/legacy/{glb-viewer-5dcdda0a.legacy.js.map → glb-viewer-be2c067a.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/image-renderer-6df9eca6.legacy.js +2 -0
- package/lib/legacy/{image-renderer-0f532f9c.legacy.js.map → image-renderer-6df9eca6.legacy.js.map} +1 -1
- package/lib/legacy/{main-thread-to-worker-880d5b78.legacy.js → main-thread-to-worker-4c02f179.legacy.js} +2 -2
- package/lib/legacy/main-thread-to-worker-4c02f179.legacy.js.map +1 -0
- package/lib/legacy/{material-viewer-41e5c677.legacy.js → material-viewer-e83460de.legacy.js} +2 -2
- package/lib/legacy/material-viewer-e83460de.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{mesh-generator-4f2f2ec7.legacy.js → mesh-generator-084a73cd.legacy.js} +2 -2
- package/lib/legacy/mesh-generator-084a73cd.legacy.js.map +1 -0
- package/lib/legacy/{pixotron-cd4cd438.legacy.js → pixotron-6195d494.legacy.js} +2 -2
- package/lib/legacy/{pixotron-cd4cd438.legacy.js.map → pixotron-6195d494.legacy.js.map} +1 -1
- package/lib/legacy/{planner-03b11101.legacy.js → planner-5b7cc8fa.legacy.js} +2 -2
- package/lib/legacy/{planner-03b11101.legacy.js.map → planner-5b7cc8fa.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{rapi-access-ef758fca.legacy.js → rapi-access-7d0f02e7.legacy.js} +3 -3
- package/lib/legacy/{rapi-access-ef758fca.legacy.js.map → rapi-access-7d0f02e7.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{scene-manager-afd27798.legacy.js → scene-manager-65a4c302.legacy.js} +2 -2
- package/lib/legacy/scene-manager-65a4c302.legacy.js.map +1 -0
- package/lib/legacy/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
- package/lib/legacy/static/{ConfiguratorKernel-c416f21e546a33f4.js → ConfiguratorKernel-7379813e2cd03c0d.js} +74 -74
- package/lib/legacy/static/ConfiguratorKernelJs-3789a15227520de1.js +143 -0
- package/lib/legacy/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
- package/lib/legacy/static/RoomleCore-43a1c9de57277471.wasm +0 -0
- package/lib/legacy/static/{RoomleCore-30311f70b9e1675b.js → RoomleCore-4da5951bbc66db16.js} +83 -83
- package/lib/legacy/static/RoomleCoreJs-86806817a5b958c9.js +151 -0
- package/lib/legacy/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
- package/lib/legacy/static/shaders-df453330fdd84fa7.json +1 -0
- package/lib/legacy/{stats-helper-0acbc658.legacy.js → stats-helper-e832d5a9.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-0acbc658.legacy.js.map → stats-helper-e832d5a9.legacy.js.map} +1 -1
- package/lib/{main-thread-to-worker-bb844d54.nomodule.js → main-thread-to-worker-4fc95d50.nomodule.js} +2 -2
- package/lib/main-thread-to-worker-4fc95d50.nomodule.js.map +1 -0
- package/lib/{main-thread-to-worker-91bf9f5e.js → main-thread-to-worker-5447c1c5.js} +2 -2
- package/lib/main-thread-to-worker-5447c1c5.js.map +1 -0
- package/lib/{material-viewer-1b0d838c.nomodule.js → material-viewer-8183024b.nomodule.js} +2 -2
- package/lib/material-viewer-8183024b.nomodule.js.map +1 -0
- package/lib/{material-viewer-90b397b7.js → material-viewer-9ee1ebf0.js} +2 -2
- package/lib/material-viewer-9ee1ebf0.js.map +1 -0
- package/lib/material-viewer-main-6c084313.js +2 -0
- package/lib/material-viewer-main-6c084313.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/{mesh-generator-948c7db4.nomodule.js → mesh-generator-7dea7a1b.nomodule.js} +2 -2
- package/lib/mesh-generator-7dea7a1b.nomodule.js.map +1 -0
- package/lib/{mesh-generator-ff0dbfc8.js → mesh-generator-a980f1b0.js} +2 -2
- package/lib/mesh-generator-a980f1b0.js.map +1 -0
- package/lib/{pixotron-ec9a72e0.nomodule.js → pixotron-4065f090.nomodule.js} +2 -2
- package/lib/{pixotron-ec9a72e0.nomodule.js.map → pixotron-4065f090.nomodule.js.map} +1 -1
- package/lib/{pixotron-5167229f.js → pixotron-9baf521b.js} +2 -2
- package/lib/{pixotron-5167229f.js.map → pixotron-9baf521b.js.map} +1 -1
- package/lib/{planner-f1b53f57.nomodule.js → planner-2040e9ab.nomodule.js} +2 -2
- package/lib/{planner-f1b53f57.nomodule.js.map → planner-2040e9ab.nomodule.js.map} +1 -1
- package/lib/{planner-c3c34e74.js → planner-79b62302.js} +2 -2
- package/lib/{planner-c3c34e74.js.map → planner-79b62302.js.map} +1 -1
- package/lib/planner-main-74807374.js +2 -0
- package/lib/planner-main-74807374.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{rapi-access-cf61a750.nomodule.js → rapi-access-65dbda00.nomodule.js} +3 -3
- package/lib/{rapi-access-cf61a750.nomodule.js.map → rapi-access-65dbda00.nomodule.js.map} +1 -1
- package/lib/{rapi-access-cc4f78e4.js → rapi-access-d209c65c.js} +3 -3
- package/lib/{rapi-access-cc4f78e4.js.map → rapi-access-d209c65c.js.map} +1 -1
- package/lib/{roomle-sdk-da4e3ccc.js → roomle-sdk-85d54446.js} +2 -2
- package/lib/roomle-sdk-85d54446.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{scene-manager-aa8b9035.nomodule.js → scene-manager-0ac7eb06.nomodule.js} +2 -2
- package/lib/scene-manager-0ac7eb06.nomodule.js.map +1 -0
- package/lib/{scene-manager-8c308533.js → scene-manager-424afdbc.js} +2 -2
- package/lib/scene-manager-424afdbc.js.map +1 -0
- package/lib/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
- package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js +1 -0
- package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js.map +1 -0
- package/lib/static/ConfiguratorKernelJs-3789a15227520de1.js +143 -0
- package/lib/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
- package/lib/static/RoomleCore-43a1c9de57277471.wasm +0 -0
- package/lib/static/RoomleCore-4da5951bbc66db16.js +1 -0
- package/lib/static/RoomleCore-4da5951bbc66db16.js.map +1 -0
- package/lib/static/RoomleCoreJs-86806817a5b958c9.js +151 -0
- package/lib/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
- package/lib/static/shaders-df453330fdd84fa7.json +1 -0
- package/lib/{stats-helper-f53f8b2f.js → stats-helper-3ffe1651.js} +2 -2
- package/lib/{stats-helper-f53f8b2f.js.map → stats-helper-3ffe1651.js.map} +1 -1
- package/lib/{stats-helper-7dc63459.nomodule.js → stats-helper-9b173f93.nomodule.js} +2 -2
- package/lib/{stats-helper-7dc63459.nomodule.js.map → stats-helper-9b173f93.nomodule.js.map} +1 -1
- package/package.json +2 -2
- package/lib/component-dimensioning-07857a7e.js.map +0 -1
- package/lib/component-dimensioning-e121b044.nomodule.js.map +0 -1
- package/lib/configurator-366b9a69.js +0 -2
- package/lib/configurator-b498456a.nomodule.js +0 -2
- package/lib/configurator-main-1ba50225.js +0 -2
- package/lib/configurator-main-1ba50225.js.map +0 -1
- package/lib/configurator-mesh-generator-bedfe9a1.nomodule.js +0 -2
- package/lib/configurator-mesh-generator-bedfe9a1.nomodule.js.map +0 -1
- package/lib/configurator-mesh-generator-e827c528.js.map +0 -1
- package/lib/default-light-setting-7eb7961c.js.map +0 -1
- package/lib/default-light-setting-f21a820b.nomodule.js.map +0 -1
- package/lib/dimensioning-helper-2f129aab.js.map +0 -1
- package/lib/dimensioning-helper-73700224.nomodule.js.map +0 -1
- package/lib/glb-viewer-10243e50.js +0 -2
- package/lib/glb-viewer-d6e080e4.nomodule.js +0 -2
- package/lib/glb-viewer-main-39535b70.js +0 -2
- package/lib/glb-viewer-main-39535b70.js.map +0 -1
- package/lib/image-renderer-9478b17b.nomodule.js +0 -2
- package/lib/image-renderer-9e47bc3a.js +0 -2
- package/lib/legacy/component-dimensioning-d657350b.legacy.js.map +0 -1
- package/lib/legacy/configurator-3250dfc2.legacy.js +0 -2
- package/lib/legacy/configurator-mesh-generator-d604f05c.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-14b03f67.legacy.js.map +0 -1
- package/lib/legacy/dimensioning-helper-bed08d96.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-5dcdda0a.legacy.js +0 -2
- package/lib/legacy/image-renderer-0f532f9c.legacy.js +0 -2
- package/lib/legacy/main-thread-to-worker-880d5b78.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-41e5c677.legacy.js.map +0 -1
- package/lib/legacy/mesh-generator-4f2f2ec7.legacy.js.map +0 -1
- package/lib/legacy/scene-manager-afd27798.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-a1daecbcb66a7ea2.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-2a6eb4d239731162.mem +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-fdb5588c5f9ad271.js +0 -143
- package/lib/legacy/static/RoomleCore-423543e6e81ce65d.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-3ca6b11e7db6ad5c.js +0 -151
- package/lib/legacy/static/RoomleCoreJs-88d140ccbd2a0401.mem +0 -0
- package/lib/legacy/static/shaders-300ca3b7af102119.json +0 -1
- package/lib/main-thread-to-worker-91bf9f5e.js.map +0 -1
- package/lib/main-thread-to-worker-bb844d54.nomodule.js.map +0 -1
- package/lib/material-viewer-1b0d838c.nomodule.js.map +0 -1
- package/lib/material-viewer-90b397b7.js.map +0 -1
- package/lib/material-viewer-main-39b78443.js +0 -2
- package/lib/material-viewer-main-39b78443.js.map +0 -1
- package/lib/mesh-generator-948c7db4.nomodule.js.map +0 -1
- package/lib/mesh-generator-ff0dbfc8.js.map +0 -1
- package/lib/planner-main-f87ff090.js +0 -2
- package/lib/planner-main-f87ff090.js.map +0 -1
- package/lib/roomle-sdk-da4e3ccc.js.map +0 -1
- package/lib/scene-manager-8c308533.js.map +0 -1
- package/lib/scene-manager-aa8b9035.nomodule.js.map +0 -1
- package/lib/static/ConfiguratorKernel-a1daecbcb66a7ea2.wasm +0 -0
- package/lib/static/ConfiguratorKernel-c416f21e546a33f4.js +0 -1
- package/lib/static/ConfiguratorKernel-c416f21e546a33f4.js.map +0 -1
- package/lib/static/ConfiguratorKernelJs-2a6eb4d239731162.mem +0 -0
- package/lib/static/ConfiguratorKernelJs-fdb5588c5f9ad271.js +0 -143
- package/lib/static/RoomleCore-30311f70b9e1675b.js +0 -1
- package/lib/static/RoomleCore-30311f70b9e1675b.js.map +0 -1
- package/lib/static/RoomleCore-423543e6e81ce65d.wasm +0 -0
- package/lib/static/RoomleCoreJs-3ca6b11e7db6ad5c.js +0 -151
- package/lib/static/RoomleCoreJs-88d140ccbd2a0401.mem +0 -0
- package/lib/static/shaders-300ca3b7af102119.json +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-cf61a750.nomodule.js","./main-thread-to-worker-bb844d54.nomodule.js","./pixotron-ec9a72e0.nomodule.js","./default-light-setting-f21a820b.nomodule.js","./scene-manager-aa8b9035.nomodule.js"],(function(e){var t,i,s,r,n,a,o,h,c,l,d,_,m,u,p,g,w,f,E,b,S,v,L,C,M;return{setters:[function(){},function(e){t=e.n,i=e.L,s=e.o,r=e.h,n=e._,a=e.i,o=e.d,h=e.f,c=e.P,l=e.e,d=e.G,_=e.a7,m=e.s},function(e){u=e.f},function(e){p=e.I,g=e.S,w=e.C,f=e.L,E=e.B,b=e.T,S=e.e,v=e.g,L=e.M},function(e){C=e.D},function(e){M=e.S}],execute:function(){const y=[new t("script-loader",g),new t("glb-input-manager",class extends p{},1),new t("logger",i),new t("rapi-access",s)];class R extends w{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,i,s,r){let n=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(n,a);let o=new THREE.Euler(-Math.PI/2+s,i,0,"ZYX"),h=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class B extends f{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=r();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}let T=(()=>{class e extends M{constructor(e,t){super(e,t,o.GLB,"3D"),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(h.createDynamicLightSettingSource(null,c.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new B(this._scene)),this._setEnvironment(new E(this._scene,this._environment))}createCameraControl(e){this._cameraControl=new R(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const i=await this._rapiAccess.getItem(e);return i.configuration?Promise.reject():this.loadGLB(u(i),!0,void 0,t)}loadGLB(e,t=!0,i=new THREE.Vector3(1,1,1),s){return this.clearScene(),new Promise((r,n)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,i,void 0,void 0,s).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let i=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=i.getCenter(new THREE.Vector3);this._cameraControl instanceof R&&(this._cameraControl.updateToBounds(i,!1,!0,e),this._cameraControl.reset(i,e,-15,0))}this._updateBounds(i),r()},n)})}preparePerspectiveImage(e,t,i){return new Promise(s=>{t||(t=1e3),i||(i=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,i),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let r=this._cameraControl.getCamera().clone();r instanceof THREE.PerspectiveCamera&&(r.aspect=t/i,r.updateProjectionMatrix()),this._lightSetting.removeFromScene();let n=new C(this._scene);e.render(this._scene,r);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{s({image:a,width:t,height:i,blob:e})},"image/png"),n.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,i,s){if(this._cameraControl instanceof R){let r=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(r,e,t,i,s),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),l(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}return n([a],e.prototype,"_glbInputManager",void 0),n([a],e.prototype,"_rapiAccess",void 0),e})();class x{constructor(e,t,i){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=i,this._renderer.setSize(t,i),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let i=this._entries.indexOf(e);i>-1&&this._entries.splice(i,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}let H=(()=>{class e{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(d,{id:"gltf-loader"}),i=this._scriptLoader.fetch(_,{id:"draco-loader"}),s=this._scriptLoader.fetch(b,{id:"tween-js"});Promise.all([t,i,s]).then(()=>{this._sceneManager=new T(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const i=()=>{this._sceneManager.enableHD(),e()};Promise.all(S.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(v,{id:"pi-js"}).then(i,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,i){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),i)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,i=320){let s=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new x(this._sceneManager,t,i);e.addListener(this._sceneManager),e.start(s.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let i=document.createElement("a");i.href=URL.createObjectURL(t),i.download="content.zip",i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}}return n([a],e.prototype,"_rapiAccess",void 0),n([a],e.prototype,"_domHelper",void 0),n([a],e.prototype,"_scriptLoader",void 0),n([a],e.prototype,"_lifeCycleManager",void 0),n([a],e.prototype,"_threeLoader",void 0),n([a],e.prototype,"_initData",void 0),n([a],e.prototype,"_globalInitData",void 0),e})();e("GlbViewer",class extends L{setupGlobals(){}setupDependencies(){m.setup(y),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new H(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
-
//# sourceMappingURL=glb-viewer-d6e080e4.nomodule.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./query-params-helper-a271f9dc.js";import"./rapi-access-cc4f78e4.js";import"./main-thread-to-worker-91bf9f5e.js";import"./pixotron-5167229f.js";import"./default-light-setting-7eb7961c.js";import"./scene-manager-8c308533.js";import{GlbViewer}from"./glb-viewer-10243e50.js";(new GlbViewer).boot();
|
|
2
|
-
//# sourceMappingURL=glb-viewer-main-39535b70.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-main-39535b70.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./rapi-access-cf61a750.nomodule.js","./main-thread-to-worker-bb844d54.nomodule.js","./pixotron-ec9a72e0.nomodule.js","./default-light-setting-f21a820b.nomodule.js"],(function(e){var t,n,r,i,o,a,s,l,c,d,h,u,_,p,g,b,m,E,f,C,y,P,R,j,w,O,H,M,v;return{setters:[function(e){t=e.U,n=e.T,r=e.J,i=e.V,o=e.e,a=e.W,s=e.O,l=e.X,c=e.Q,d=e.Y,h=e.Z,u=e._,_=e.i,p=e.$,g=e.C,b=e.B,m=e.E,E=e.M,f=e.a0,C=e.s,y=e.j,P=e.a1,R=e.a2,j=e.t,w=e.h},function(e){O=e.f},function(e){H=e.E,M=e.L},function(e){v=e.D}],execute:function(){e("G","static/GLTFExporter-86edae059df3a219.js"),e("C",class extends t{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,r)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,r)=>{},this.onUserInitiatedDockDone=(e,t,n,r,i)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{}}});class x{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class I extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new x;const t=n(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(this.getSize(),e.customColor),r(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){this._container.position.copy(n(this.getPlanElement().getCenter()))}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e=new THREE.Box3;return e.setFromObject(this._container),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=i(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){o(this._container),this._selectionMesh&&o(this._selectionMesh)}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=a())}_generateBoundingBox(e,t){e.addScalar(.01);let n=new THREE.BoxGeometry(e.x,e.y,e.z),r=new THREE.Color(s);t>0&&(r=l(t));let i=new THREE.MeshStandardMaterial({color:r,opacity:c,transparent:!0}),o=new THREE.Mesh(n,i);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(5),o}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:c,transparent:!0});const t=n(this.getPlanElement().getCenter());this._selectionMesh=new THREE.Mesh(d(t,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class T extends I{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return h(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class k extends T{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}}e("d",k);let L=e("c",(()=>{class e extends T{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}_addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();this._glbUrl=O(e);let n=e.scaleable?h(t.size):void 0,i=new THREE.Vector3(1,1,1);return t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1),new Promise(o=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),p(t,this._glbUrl),r(t),this._container.add(this.getObject()),this.hidePreviewBox(),o()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return u([_],e.prototype,"_staticItemLoader",void 0),e})());class D extends I{constructor(e){super(e),this._container.name="Wall Plan Element"}addMesh(e){super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}}class S extends I{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}class B extends I{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}let V=e("P",(()=>{class e extends g{constructor(e){super(e,0),this._plannerKernelCallbackListener=new Set,b.addMeta("kernel_is_ready",{isWasm:this._useWASM}),this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}get kernelContainer(){return this._kernelContainer}_loadSuccess(){window.RoomleCore(this._kernelContainer)}_loadError(){console.error("kernel load error")}_createPlanInteractionHandler(){const e=this._kernelContainer;this._planInteractionHandler=new e.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,100,!0,!0,e.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._createPlanInteractionHandler();const e=this._planInteractionHandler.getConfiguratorKernel();this._kernelInstance=e,this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),m.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady(),this._kernelInstance.useEnvironmentGeometry(!1)}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let r=0;r<n;r++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))}),this._planInteractionHandler.addPlanObjects(t);const n=this._planInteractionHandler.getPlan().extRef.jsObject;await Promise.all(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}}))}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}onLoadComponentError(e,t){}configurationLoaded(e,t,n,r,i){}componentDefinitionLoaded(e,t){}componentDefinitionLoadingError(e,t){}configurationLoadingError(){}componentConfigurationUpdated(e){}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){}planObjectUpdated(e){}planObjectConfigurationUpdated(e,t,n){}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){super.cleanUpCallbacks(),this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){super.registerCallbacks(),this._kernelContainer.registerPlannerCallback(this)}async requestExternalMesh(e,t){let n;try{n=await this._rapiAccess.getMesh(e,E,t)}catch(e){throw console.error(e),e}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(n.url,!0))),i=await r.arrayBuffer();await this._handleCortoMesh(i,e,t)}catch(e){throw console.error(e),e}}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dPlanObjectConstructionDone(e){}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){}Editor3dSetPreviewPointAssociations(e,t){}Editor3dSetPreviewLineAssociations(e,t){}Editor3dPreviewConstructionDone(e,t){}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){if(this._decoupleReferences(e),t){let e=new U(this._creator_);e.setReference(t),this._coupleReferences(e,t),this._plannerKernelCallbackListener.forEach(t=>t.handlerSwitchedPlans(e))}}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT){let n,r=t;if(r.hasConfiguration())n=new k(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);else{n=new L(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);const i=t.getCatalogItemId();i&&this._rapiAccess.getItem(i).then(e=>{n.setRapiItem(e)})}this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{let n,r=t;if(t.getType()===this._kernelContainer.PlanElementType.WALL?n=new D(r):t.getType()===this._kernelContainer.PlanElementType.FLOOR?n=new S(r):t.getType()===this._kernelContainer.PlanElementType.CEILING&&(n=new B(r)),!n)return;n.setPrimaryColor(this._initData.colors.PRIMARY),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n),this.planModelViewHelper.requestMesh3d(t)}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible())}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(r=>r.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){}stoppedDrawing(){}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,r,i,o){this._plannerKernelCallbackListener.forEach(a=>a.addMesh(e,t,n,r,i,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,i,o,a){this._plannerKernelCallbackListener.forEach(s=>s.addPlanMesh(e,t,n,r,i,o,a))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}addPlanObjectFromItem(e,t,n){if(!t&&!n)return this.insertItems([e]);n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const r=this._rapiItemToKernelItem(e);return this._planInteractionHandler.addPlanObjectFromItem(r,t,n)}_coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}}return u([_],e.prototype,"_kernelAccessCallback",void 0),u([_],e.prototype,"_roomlePlannerUiCallback",void 0),u([_],e.prototype,"_initData",void 0),e})()),U=(()=>{class e extends f{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionGroup=new THREE.Group,this._constructionGroup.name="Construction",this._ceilingGroup=new THREE.Group,this._getKernelAccess().addPlannerListener(this)}planBoundsChanged(){}_getKernelAccess(){return C.lookup("planner-kernel-access",this._creator_)}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null,super.clearReference()}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){e instanceof k?this._configurablePlanObjectViewModels.push(e):e instanceof L?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof D?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):(e instanceof S||e instanceof B)&&this._constructionGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof k&&(t.addRootComponent(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(t),t.hidePreviewBox())}_getPlanObjectViewModelForRuntimeId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getConfigurationRuntimeId()&&(t=n)}),t}getPlanObjectForId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),this._staticPlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),t}getConstructionGroup(){return this._constructionGroup}getCeilingGroup(){return this._ceilingGroup}getBoundingBox(){const e=this.getCorePlan();return e?y(e.getBounds()):(new THREE.Box3).setFromObject(this._constructionGroup)}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}sceneCleared(){this._configurablePlanObjectViewModels.forEach(e=>{e.clear()}),this._staticPlanObjectViewModels.forEach(e=>{e.clear()}),super.sceneCleared()}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getComponent(e){return this._components.get(e)}_generateMesh(e=0,t=null,n,r,i,o,a,s,l){return this._plannerMeshGenerator.generateMesh(t,n,r,i,o,a,s,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,r,i){super.Editor3dComponentCreated(e,t,n,r,i),this._getKernelAccess()instanceof V&&this.dockComponent(e,r,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e){this._constructionGroup.clear(),this._ceilingGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,r,i,o,a){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,r,i,o){const a=e.extRef.jsObject;let s=a.getMesh(t);s?s.geometry=this._plannerMeshGenerator.generateGeometry(null,n,r,i,o):(s=this._generateMesh(0,null,t,n,r,i,o,e.getType()),a.addMesh(s))}removePlanObjectFromScene(e){}planElementRemoved(e){if(e.getType()===this._getKernelAccess().kernelContainer.PlanElementType.OBJECT){let t=e;if(t.hasConfiguration()){const e=t.extRef.jsObject,n=this._configurablePlanObjectViewModels.indexOf(e);n>-1&&this._configurablePlanObjectViewModels.splice(n,1)}else{const e=t.extRef.jsObject,n=this._staticPlanObjectViewModels.indexOf(e);n>-1&&this._staticPlanObjectViewModels.splice(n,1)}}}getMeshGenerator(){return this._plannerMeshGenerator}}return u([_],e.prototype,"_plannerMeshGenerator",void 0),e})();const A=j(30);class G extends H{constructor(e,t,n,r){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===r?1:r,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.enableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new THREE.Plane(new THREE.Vector3(0,1,0)),this._planeFront=new THREE.Plane(new THREE.Vector3(0,0,1)),this._planeSide=new THREE.Plane(new THREE.Vector3(1,0,0))}setLayers(e){this._raycaster.layers=e}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(6,e=>{this._findHover(e.positionRelative,e.type)},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){this._intersection(e)&&this._inputManager.onElementHit()}_findSelection(e){let t=this._intersection(e);t?t&&t.object.dispatchEvent({type:"select"}):this.dispatchEvent(3)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(e,this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(e,this._camera);let t,n=new THREE.Vector3(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,r=new THREE.Vector3(0,0,0),i=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,r),this._raycaster.ray.intersectPlane(this._planeSide,i);let o,a=this._getDistanceToCamera(i),s=this._getDistanceToCamera(r);return n>=-A&&n<=A?o=t<s?e.clone():r.clone():t<s&&t<a?o=e.clone():s<t&&s<a?o=r.clone():a<t&&a<s&&(o=i.clone()),o}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return P(e)&&(t=Number.POSITIVE_INFINITY),t}_onDragEnd(e){this._currentDrag&&(this._currentDrag.dispatchEvent({type:"drag_end",attachment:{position:e}}),this._currentDrag=null)}_onRotate(e,t){if(!this._currentRotate){let t=this._intersection(e);if(!t)return;this._currentRotate=t.object}this._currentRotate.dispatchEvent({type:"rotate",attachment:{rotation:t}})}_positionPlanes(e){0===this._mode?(this._planeBottom.constant=0,this._camera.userData&&this._camera.userData.pitch&&this._camera.userData.pitch<0&&(this._planeBottom.constant=-3)):e&&e.boundingBox&&this._rootComponentPosition&&(this._planeBottom.constant=-e.boundingBox.getCenter(new THREE.Vector3).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new THREE.Vector3).x+e.boundingBox.getCenter(new THREE.Vector3).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new THREE.Vector3).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new THREE.Vector3)),this._offset.applyQuaternion(e.getWorldQuaternion(new THREE.Quaternion)))}update(e,t,n){if(e&&(this._bounds=e),t&&(this._rootComponentPosition=t),n){this._backgroundScene=n;let e=this._backgroundScene.children[0];e instanceof THREE.Mesh&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&R(this._currentDrag),this._currentHover&&R(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}e("S",class extends H{constructor(e,t,n,r){super(),this._debug=!1,this._dragIn=!1,this._inputManager=r,this._raycastHelper=new G(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}});class K extends M{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),1.2),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!1}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=w();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new THREE.Color(e))}}}let z=null;const F=()=>(z||(z=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),z.outputEncoding=THREE.sRGBEncoding),z.autoClear=!0,z),W=(e("g",(e,t=0)=>{if(!e){const e=new THREE.Vector3;return{center:e,bounds:e,diagonal:0}}const n=e.getSize(new THREE.Vector3);return n.addScalar(t),{center:e.getCenter(new THREE.Vector3),bounds:n,diagonal:Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)+Math.pow(n.z,2))}}),e("a",(e,t,n,r,i={})=>new Promise(o=>{const{size:a=1024,showDimensions:s}=i,l=F();l.setSize(a,a);const c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=new v(e);n.layers.disable(2),n.layers.disable(5),s?n.layers.enable(7):n.layers.disable(7),W(n,r,-20,-30),l.render(e,n),t&&(l.autoClear=!1,l.clearDepth(),l.render(t,n));const u=l.domElement.toDataURL();n.layers.enable(2),e.background=d,e.fog=c,h.removeFromScene(),o({image:u,width:a,height:a,blob:null})})),e("r",(e,t,n,r,i,o)=>new Promise(r=>{o||(o=1024);const i=F();i.setSize(o,o);const a=e.fog?e.fog.clone():null,s=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(5),n?W(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),i.render(e,t);const l=i.domElement.toDataURL();t.layers.enable(2),e.background=s,e.fog=a,r({image:l,width:o,height:o,blob:null})})),e("p",(e,t,n,r)=>{e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(j(r)),e.rotateX(j(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()}));e("b",(e,t,n,r={})=>{const{showDimensions:i=!1}=r;return new Promise(r=>{const o=F();o.autoClear=!1;let a=new THREE.OrthographicCamera(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);a.position.copy(n.center),a.rotateX(j(-90)),a.translateZ(n.bounds.y+1),a.far=a.position.y+.5,a.layers.mask=65535;let s=200*n.bounds.x,l=200*n.bounds.z;if(s>4096||l>4096){let e=0;s>4096?e=s/4096:l>4096&&(e=l/4096),s/=e,l/=e}o.setSize(s,l);let c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=i?new K(e):new v(e);a.layers.disable(2),a.layers.disable(5),i?a.layers.enable(7):a.layers.disable(7),o.render(e,a),t&&(o.clearDepth(),o.render(t,a));let u=o.domElement.toDataURL();a.layers.enable(2),a.layers.enable(5),e.background=d,e.fog=c,h.removeFromScene(),r({image:u,width:s,height:l,blob:null})})})}}}));
|
|
2
|
-
//# sourceMappingURL=image-renderer-9478b17b.nomodule.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{U as UiCallback,T as convertToTHREE,J as fadeIn,V as getMaterialId,e as dispose,W as getBoundingBoxMaterial,O as PREVIEW_MATERIAL_COLOR,X as getColorFromInt,Q as PREVIEW_MATERIAL_OPACITY,Y as getSelectionGeometry,Z as convertToThreeDimensions,_ as __decorate,i as inject,$ as checkGLB,C as CommonKernelAccess,B as Benchmark,E as Env,M as MESH_DEFAULT_FORMAT,a0 as ConfiguratorViewModel,s as RoomleDependencyInjection,j as kernelBoxToThreeBox,a1 as vectorIsZero,a2 as disposeMesh,t as toRadiant,h as getGUI}from"./rapi-access-cc4f78e4.js";import{f as getGlbUrl}from"./main-thread-to-worker-91bf9f5e.js";import{E as EventDispatcher,L as LightSetting}from"./pixotron-5167229f.js";import{D as DefaultLightSetting}from"./default-light-setting-7eb7961c.js";var GLTF_EXPORTER_FILE_NAME="static/GLTFExporter-86edae059df3a219.js";class ConfiguratorUiCallbacks extends UiCallback{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,r)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,r)=>{},this.onUserInitiatedDockDone=(e,t,n,r,i)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{}}}class Waiter{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class PlanElementViewModel extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new Waiter;const t=convertToTHREE(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(this.getSize(),e.customColor),fadeIn(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){this._container.position.copy(convertToTHREE(this.getPlanElement().getCenter()))}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e=new THREE.Box3;return e.setFromObject(this._container),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=getMaterialId(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){dispose(this._container),this._selectionMesh&&dispose(this._selectionMesh)}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=getBoundingBoxMaterial())}_generateBoundingBox(e,t){e.addScalar(.01);let n=new THREE.BoxGeometry(e.x,e.y,e.z),r=new THREE.Color(PREVIEW_MATERIAL_COLOR);t>0&&(r=getColorFromInt(t));let i=new THREE.MeshStandardMaterial({color:r,opacity:PREVIEW_MATERIAL_OPACITY,transparent:!0}),o=new THREE.Mesh(n,i);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(5),o}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:PREVIEW_MATERIAL_OPACITY,transparent:!0});const t=convertToTHREE(this.getPlanElement().getCenter());this._selectionMesh=new THREE.Mesh(getSelectionGeometry(t,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class PlanObjectViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return convertToThreeDimensions(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class ConfiguratorPlanObjectViewModel extends PlanObjectViewModel{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}}let StaticPlanObjectViewModel=(()=>{class e extends PlanObjectViewModel{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}_addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();this._glbUrl=getGlbUrl(e);let n=e.scaleable?convertToThreeDimensions(t.size):void 0,r=new THREE.Vector3(1,1,1);return t.flipX&&(r.x*=-1),t.flipY&&(r.z*=-1),new Promise(i=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,r,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),checkGLB(t,this._glbUrl),fadeIn(t),this._container.add(this.getObject()),this.hidePreviewBox(),i()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return __decorate([inject],e.prototype,"_staticItemLoader",void 0),e})();class WallPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Wall Plan Element"}addMesh(e){super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}}class FloorPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}class CeilingPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}let PlannerKernelAccess=(()=>{class e extends CommonKernelAccess{constructor(e){super(e,0),this._plannerKernelCallbackListener=new Set,Benchmark.addMeta("kernel_is_ready",{isWasm:this._useWASM}),this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}get kernelContainer(){return this._kernelContainer}_loadSuccess(){window.RoomleCore(this._kernelContainer)}_loadError(){console.error("kernel load error")}_createPlanInteractionHandler(){const e=this._kernelContainer;this._planInteractionHandler=new e.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,100,!0,!0,e.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._createPlanInteractionHandler();const e=this._planInteractionHandler.getConfiguratorKernel();this._kernelInstance=e,this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),Env.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady(),this._kernelInstance.useEnvironmentGeometry(!1)}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let r=0;r<n;r++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))}),this._planInteractionHandler.addPlanObjects(t);const n=this._planInteractionHandler.getPlan().extRef.jsObject;await Promise.all(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}}))}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}onLoadComponentError(e,t){}configurationLoaded(e,t,n,r,i){}componentDefinitionLoaded(e,t){}componentDefinitionLoadingError(e,t){}configurationLoadingError(){}componentConfigurationUpdated(e){}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){}planObjectUpdated(e){}planObjectConfigurationUpdated(e,t,n){}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){super.cleanUpCallbacks(),this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){super.registerCallbacks(),this._kernelContainer.registerPlannerCallback(this)}async requestExternalMesh(e,t){let n;try{n=await this._rapiAccess.getMesh(e,MESH_DEFAULT_FORMAT,t)}catch(e){throw console.error(e),e}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(n.url,!0))),i=await r.arrayBuffer();await this._handleCortoMesh(i,e,t)}catch(e){throw console.error(e),e}}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dPlanObjectConstructionDone(e){}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){}Editor3dSetPreviewPointAssociations(e,t){}Editor3dSetPreviewLineAssociations(e,t){}Editor3dPreviewConstructionDone(e,t){}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){if(this._decoupleReferences(e),t){let e=new PlanViewModel(this._creator_);e.setReference(t),this._coupleReferences(e,t),this._plannerKernelCallbackListener.forEach(t=>t.handlerSwitchedPlans(e))}}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT){let n,r=t;if(r.hasConfiguration())n=new ConfiguratorPlanObjectViewModel(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);else{n=new StaticPlanObjectViewModel(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);const i=t.getCatalogItemId();i&&this._rapiAccess.getItem(i).then(e=>{n.setRapiItem(e)})}this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{let n,r=t;if(t.getType()===this._kernelContainer.PlanElementType.WALL?n=new WallPlanElementViewModel(r):t.getType()===this._kernelContainer.PlanElementType.FLOOR?n=new FloorPlanElementViewModel(r):t.getType()===this._kernelContainer.PlanElementType.CEILING&&(n=new CeilingPlanElementViewModel(r)),!n)return;n.setPrimaryColor(this._initData.colors.PRIMARY),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n),this.planModelViewHelper.requestMesh3d(t)}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible())}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(r=>r.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){}stoppedDrawing(){}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,r,i,o){this._plannerKernelCallbackListener.forEach(a=>a.addMesh(e,t,n,r,i,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,i,o,a){this._plannerKernelCallbackListener.forEach(s=>s.addPlanMesh(e,t,n,r,i,o,a))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}addPlanObjectFromItem(e,t,n){if(!t&&!n)return this.insertItems([e]);n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const r=this._rapiItemToKernelItem(e);return this._planInteractionHandler.addPlanObjectFromItem(r,t,n)}_coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}}return __decorate([inject],e.prototype,"_kernelAccessCallback",void 0),__decorate([inject],e.prototype,"_roomlePlannerUiCallback",void 0),__decorate([inject],e.prototype,"_initData",void 0),e})(),PlanViewModel=(()=>{class e extends ConfiguratorViewModel{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionGroup=new THREE.Group,this._constructionGroup.name="Construction",this._ceilingGroup=new THREE.Group,this._getKernelAccess().addPlannerListener(this)}planBoundsChanged(){}_getKernelAccess(){return RoomleDependencyInjection.lookup("planner-kernel-access",this._creator_)}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null,super.clearReference()}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){e instanceof ConfiguratorPlanObjectViewModel?this._configurablePlanObjectViewModels.push(e):e instanceof StaticPlanObjectViewModel?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof WallPlanElementViewModel?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):(e instanceof FloorPlanElementViewModel||e instanceof CeilingPlanElementViewModel)&&this._constructionGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof ConfiguratorPlanObjectViewModel&&(t.addRootComponent(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(t),t.hidePreviewBox())}_getPlanObjectViewModelForRuntimeId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getConfigurationRuntimeId()&&(t=n)}),t}getPlanObjectForId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),this._staticPlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),t}getConstructionGroup(){return this._constructionGroup}getCeilingGroup(){return this._ceilingGroup}getBoundingBox(){const e=this.getCorePlan();return e?kernelBoxToThreeBox(e.getBounds()):(new THREE.Box3).setFromObject(this._constructionGroup)}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}sceneCleared(){this._configurablePlanObjectViewModels.forEach(e=>{e.clear()}),this._staticPlanObjectViewModels.forEach(e=>{e.clear()}),super.sceneCleared()}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getComponent(e){return this._components.get(e)}_generateMesh(e=0,t=null,n,r,i,o,a,s,l){return this._plannerMeshGenerator.generateMesh(t,n,r,i,o,a,s,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,r,i){super.Editor3dComponentCreated(e,t,n,r,i),this._getKernelAccess()instanceof PlannerKernelAccess&&this.dockComponent(e,r,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e){this._constructionGroup.clear(),this._ceilingGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,r,i,o,a){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,r,i,o){const a=e.extRef.jsObject;let s=a.getMesh(t);s?s.geometry=this._plannerMeshGenerator.generateGeometry(null,n,r,i,o):(s=this._generateMesh(0,null,t,n,r,i,o,e.getType()),a.addMesh(s))}removePlanObjectFromScene(e){}planElementRemoved(e){if(e.getType()===this._getKernelAccess().kernelContainer.PlanElementType.OBJECT){let t=e;if(t.hasConfiguration()){const e=t.extRef.jsObject,n=this._configurablePlanObjectViewModels.indexOf(e);n>-1&&this._configurablePlanObjectViewModels.splice(n,1)}else{const e=t.extRef.jsObject,n=this._staticPlanObjectViewModels.indexOf(e);n>-1&&this._staticPlanObjectViewModels.splice(n,1)}}}getMeshGenerator(){return this._plannerMeshGenerator}}return __decorate([inject],e.prototype,"_plannerMeshGenerator",void 0),e})();const ROTATION_TO_DETECT_SIDE=toRadiant(30);class RaycastHelper extends EventDispatcher{constructor(e,t,n,r){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===r?1:r,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.enableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new THREE.Plane(new THREE.Vector3(0,1,0)),this._planeFront=new THREE.Plane(new THREE.Vector3(0,0,1)),this._planeSide=new THREE.Plane(new THREE.Vector3(1,0,0))}setLayers(e){this._raycaster.layers=e}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(6,e=>{this._findHover(e.positionRelative,e.type)},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){this._intersection(e)&&this._inputManager.onElementHit()}_findSelection(e){let t=this._intersection(e);t?t&&t.object.dispatchEvent({type:"select"}):this.dispatchEvent(3)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(e,this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(e,this._camera);let t,n=new THREE.Vector3(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,r=new THREE.Vector3(0,0,0),i=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,r),this._raycaster.ray.intersectPlane(this._planeSide,i);let o,a=this._getDistanceToCamera(i),s=this._getDistanceToCamera(r);return n>=-ROTATION_TO_DETECT_SIDE&&n<=ROTATION_TO_DETECT_SIDE?o=t<s?e.clone():r.clone():t<s&&t<a?o=e.clone():s<t&&s<a?o=r.clone():a<t&&a<s&&(o=i.clone()),o}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return vectorIsZero(e)&&(t=Number.POSITIVE_INFINITY),t}_onDragEnd(e){this._currentDrag&&(this._currentDrag.dispatchEvent({type:"drag_end",attachment:{position:e}}),this._currentDrag=null)}_onRotate(e,t){if(!this._currentRotate){let t=this._intersection(e);if(!t)return;this._currentRotate=t.object}this._currentRotate.dispatchEvent({type:"rotate",attachment:{rotation:t}})}_positionPlanes(e){0===this._mode?(this._planeBottom.constant=0,this._camera.userData&&this._camera.userData.pitch&&this._camera.userData.pitch<0&&(this._planeBottom.constant=-3)):e&&e.boundingBox&&this._rootComponentPosition&&(this._planeBottom.constant=-e.boundingBox.getCenter(new THREE.Vector3).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new THREE.Vector3).x+e.boundingBox.getCenter(new THREE.Vector3).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new THREE.Vector3).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new THREE.Vector3)),this._offset.applyQuaternion(e.getWorldQuaternion(new THREE.Quaternion)))}update(e,t,n){if(e&&(this._bounds=e),t&&(this._rootComponentPosition=t),n){this._backgroundScene=n;let e=this._backgroundScene.children[0];e instanceof THREE.Mesh&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&disposeMesh(this._currentDrag),this._currentHover&&disposeMesh(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}class SceneEventHandler extends EventDispatcher{constructor(e,t,n,r){super(),this._debug=!1,this._dragIn=!1,this._inputManager=r,this._raycastHelper=new RaycastHelper(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}}class TopImageLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),1.2),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!1}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new THREE.Color(e))}}}let imageRenderer=null;const getImageRenderer=()=>(imageRenderer||(imageRenderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),imageRenderer.outputEncoding=THREE.sRGBEncoding),imageRenderer.autoClear=!0,imageRenderer),getCameraTargetForBBox=(e,t=0)=>{if(!e){const e=new THREE.Vector3;return{center:e,bounds:e,diagonal:0}}const n=e.getSize(new THREE.Vector3);return n.addScalar(t),{center:e.getCenter(new THREE.Vector3),bounds:n,diagonal:Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)+Math.pow(n.z,2))}},preparePerspectiveImage=(e,t,n,r,i={})=>new Promise(o=>{const{size:a=1024,showDimensions:s}=i,l=getImageRenderer();l.setSize(a,a);const c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=new DefaultLightSetting(e);n.layers.disable(2),n.layers.disable(5),s?n.layers.enable(7):n.layers.disable(7),placeCameraForPerspectiveImage(n,r,-20,-30),l.render(e,n),t&&(l.autoClear=!1,l.clearDepth(),l.render(t,n));const _=l.domElement.toDataURL();n.layers.enable(2),e.background=d,e.fog=c,h.removeFromScene(),o({image:_,width:a,height:a,blob:null})}),renderPerspectiveImage=(e,t,n,r,i,o)=>new Promise(r=>{o||(o=1024);const i=getImageRenderer();i.setSize(o,o);const a=e.fog?e.fog.clone():null,s=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(5),n?placeCameraForPerspectiveImage(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),i.render(e,t);const l=i.domElement.toDataURL();t.layers.enable(2),e.background=s,e.fog=a,r({image:l,width:o,height:o,blob:null})}),placeCameraForPerspectiveImage=(e,t,n,r)=>{e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(toRadiant(r)),e.rotateX(toRadiant(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()},prepareTopImage=(e,t,n,r={})=>{const{showDimensions:i=!1}=r;return new Promise(r=>{const o=getImageRenderer();o.autoClear=!1;let a=new THREE.OrthographicCamera(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);a.position.copy(n.center),a.rotateX(toRadiant(-90)),a.translateZ(n.bounds.y+1),a.far=a.position.y+.5,a.layers.mask=65535;let s=200*n.bounds.x,l=200*n.bounds.z;if(s>4096||l>4096){let e=0;s>4096?e=s/4096:l>4096&&(e=l/4096),s/=e,l/=e}o.setSize(s,l);let c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=i?new TopImageLightSetting(e):new DefaultLightSetting(e);a.layers.disable(2),a.layers.disable(5),i?a.layers.enable(7):a.layers.disable(7),o.render(e,a),t&&(o.clearDepth(),o.render(t,a));let _=o.domElement.toDataURL();a.layers.enable(2),a.layers.enable(5),e.background=d,e.fog=c,h.removeFromScene(),r({image:_,width:s,height:l,blob:null})})};export{ConfiguratorUiCallbacks as C,GLTF_EXPORTER_FILE_NAME as G,PlannerKernelAccess as P,SceneEventHandler as S,preparePerspectiveImage as a,prepareTopImage as b,StaticPlanObjectViewModel as c,ConfiguratorPlanObjectViewModel as d,getCameraTargetForBBox as g,placeCameraForPerspectiveImage as p,renderPerspectiveImage as r};
|
|
2
|
-
//# sourceMappingURL=image-renderer-9e47bc3a.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-dimensioning-d657350b.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./rapi-access-ef758fca.legacy.js","./main-thread-to-worker-880d5b78.legacy.js","./image-renderer-0f532f9c.legacy.js","./pixotron-cd4cd438.legacy.js","./mesh-generator-4f2f2ec7.legacy.js","./configurator-mesh-generator-d604f05c.legacy.js","./default-light-setting-14b03f67.legacy.js"],(function(e,t){var n,i,s,o,r,a,l,h,c,d,_,u,p,g,m,f,C,v,y,b,w,E,S,P,I,k,H,R,M,D,x,O,A,T,L,U,V,B,F,j,G,z,q,K,W,N,Q,J,X,Y,$,Z,ee,te,ne,ie,se,oe,re,ae,le,he,ce,de,_e,ue;return{setters:[function(e){n=e._,i=e.i,s=e.C,o=e.B,r=e.A,a=e.a,l=e.D,h=e.b,c=e.k,d=e.E,_=e.c,u=e.M,p=e.G,g=e.g,m=e.d,f=e.R,C=e.e,v=e.t,y=e.f,b=e.P,w=e.h,E=e.j,S=e.l,P=e.m,I=e.n,k=e.L,H=e.o,R=e.p,M=e.q,D=e.r,x=e.s},function(e){O=e.o,A=e.g,T=e.s,L=e.i,U=e.r,V=e.t},function(e){B=e.S,F=e.p,j=e.a,G=e.r,z=e.g,q=e.b,K=e.G,W=e.C},function(e){N=e.E,Q=e.I,J=e.C,X=e.D,Y=e.B,$=e.a,Z=e.F,ee=e.G,te=e.P,ne=e.b,ie=e.c,se=e.S,oe=e.d,re=e.e,ae=e.T,le=e.f,he=e.g,ce=e.M},function(e){de=e.P},function(e){_e=e.C},function(e){ue=e.D}],execute:function(){const pe=function(e){return e.validRange&&"string"==typeof e.validRange.type},ge=function(e){return e.validValues&&e.validValues.length>0},me=function(e){return"length"===e.unitType||"area"===e.unitType},fe=function(e){return"Material"===e.type};let Ce={InchFeet:null,MM:null,CM:null},ve={NoUnitString:null,LongUnitString:null,ShortUnitString:null},ye=(()=>{class e{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;Ce=e.Unit,ve=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===Ce.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===Ce.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision),this._formatter=t}_initActualUnit(){const{unit:e}=this._initData;switch(e){case"cm":this._actualUnit=Ce.CM;break;case"mm":this._actualUnit=Ce.MM;break;case"inchfeet":this._actualUnit=Ce.InchFeet;break;default:this._actualUnit=Ce.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=ve.NoUnitString;break;case"long":this._actualUnitStringType=ve.LongUnitString;break;case"short":this._actualUnitStringType=ve.ShortUnitString;break;default:this._actualUnitStringType=ve.ShortUnitString}}_isFormatterReady(){return!!this._formatter||(console.warn("Formatter is not ready..."),!1)}formatAngleValueToUnitString(e,t){const n="Integer"===t.type?0:2;return e.toFixed(n)+"°"}parseAngleValueFromUnitString(e){return e.replace("°","").replace(/\s/g,"")}parseValue(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?e:"length"===t.unitType?this.parseMMValueFromUnitString(e,t.unitType):"angle"===t.unitType||"area"===t.unitType?this.parseAngleValueFromUnitString(e):e}formatValueToUnitString(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?"Integer"===t.type?e.toString():parseFloat(e.toString()).toFixed(2):"length"===t.unitType?this.formatMMValueToUnitString(e,t.unitType):"angle"===t.unitType?this.formatAngleValueToUnitString(e,t):"area"===t.unitType?this.formatSquareMMValueToUnitString(e):e}isParseableNumber(e){return this._isFormatterReady()?this._formatter.isParseableNumber(e):null}isParseableUnitString(e,t){return this._isFormatterReady()?"angle"===t.unitType?this._formatter.isParseableUnitString(this.parseAngleValueFromUnitString(e),this._actualUnit):this._formatter.isParseableUnitString(e,this._actualUnit):null}parseMMValueFromUnitString(e,t){return this._isFormatterReady()?"count"===t?parseFloat(e):this._formatter.parseMMValueFromUnitString(e,this._actualUnit):null}parseNumber(e){return this._isFormatterReady()?this._formatter.parseNumber(e):null}formatNumber(e,t=0){return this._isFormatterReady()?this._formatter.formatNumber(e,t):null}formatSquareMMValueToUnitString(e){return this._isFormatterReady()?this._formatter.formatSquareMMValueToUnitString(e,this._actualUnit):null}formatMMValueToUnitString(e,t){return this._isFormatterReady()?"count"===t?e.toString():this._formatter.formatMMValueToUnitString(e,this._actualUnit,this._actualUnitStringType):null}formatMMValueWithReqMaxLength(e,t){return this._isFormatterReady()?this._formatter.formatMMValueWithReqMaxLength(e,this._actualUnit,t):null}_formatParameterValue(e,t){return"length"===t?this.formatMMValueToUnitString(parseFloat(e)):"area"===t?this.formatSquareMMValueToUnitString(parseFloat(e)):e}formatPartListParameter(e){me(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(me(e)&&Array.isArray(e.validValues)&&e.validValues.forEach(({value:t},n)=>{e.validValues[n].label=this._formatParameterValue(t,e.unitType)}),e.valueLabel=this._formatParameterValue(e.value,e.unitType),fe(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(pe(e)){e.uiType="Range";const t=null!==e.validRange.valueFrom?e.validRange.valueFrom:Number.MIN_SAFE_INTEGER,n=null!==e.validRange.valueTo?e.validRange.valueTo:Number.MAX_SAFE_INTEGER;e.validRangeLabels={valueFrom:this._formatParameterValue(t.toString(),e.unitType),valueTo:this._formatParameterValue(n.toString(),e.unitType),type:e.validRange.type}}else ge(e)?(e.uiType="Options",function(e){return!!ge(e)&&Array.isArray(e.validValues)&&e.validValues.length>0&&"string"==typeof e.validValues[0].thumbnail}(e)&&(e.uiType="Thumbnails")):(console.error("Could not detect uiType of param"),e.uiType=null)}isInch(){return this._actualUnit===Ce.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}}return n([i],e.prototype,"_initData",void 0),e})();const be=["material"];let we=(()=>{class e extends s{constructor(e){super(e,1),this.externalMeshQueue=new de,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{},o.addMeta("kernel_is_ready",{isWasm:this._useWASM}),r.kernelInstance?(this._kernelContainer=r.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){o.start("kernel_is_ready"),r.kernelInstance?setTimeout(()=>this.isReady(),0):(window.ConfiguratorKernel(this._kernelContainer),window.ConfiguratorKernel=null)}_loadError(){this._configuratorKernelAccessCallback.loadError()}selectedComponent(e){this._updateComponentDependencies(e)}uiRequestConfiguration(e){const t=this._kernelInstance.getSerializedConfiguration(e);a.finishOperation(1,t)}_updateComponentParameters(e){let t=this._kernelInstance.getComponentParameters(e);const n=this._kernelInstance.getComponent(e);this._configuratorKernelAccessCallback.updateParameters(t,n.parameterGroups,e,1)}selectionChange(e,t){let n=!1,i=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),i.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,i)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,i=!1,s=[];e&&e.forEach(e=>{let o=this._kernelInstance.getComponent(e);o.componentId=this._kernelInstance.getComponentId(e),o&&o.childIds&&o.childIds.length>0&&(n=!0),o.id===t&&(i=!0),s.push(o)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",i,n,s)}_updateCommonComponentDependencies(e){const{parameters:t,parameterGroups:n}=this._kernelInstance.getCommonPlanComponentParameters(this._utilityToLongArray(e));this._configuratorKernelAccessCallback.updateParameters(t,n,e,2)}_updateComponentChildren(e){const t=this._kernelInstance.getPlanComponentPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,1)}_updateComponentDependencies(e){this._updateComponentParameters(e),this._updateComponentChildren(e)}_updatePlanObjectParameters(e){let t,n=this._kernelInstance.getPlanObjectParameters(e);if(0===n.length){let i=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(i),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(i)}else this._configuratorContext.rootComponentParametersAsGlobal=!1,t=this._kernelInstance.getPlanObject(e);this._configuratorKernelAccessCallback.updateParameters(n,t.parameterGroups,e,0)}_enableRootComponentParametersAsGlobal(){this._configuratorContext.selectedRuntimeComponentId||(this._configuratorContext.rootComponentParametersAsGlobal=!0)}_updatePlanObjectChildren(e){const t=this._kernelInstance.getPlanObjectPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,0)}updatePlanObjectDependencies(e){this._updatePlanObjectParameters(e),this._updatePlanObjectChildren(e)}_updateConfigurationHasChildren(e,t=null){t||(t=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e)));const n=t.childIds.size?t.childIds.size():t.childIds.length;this._configuratorUiCallbacks.onConfigurationHasChildren(n>0)}dockComponent(e,t,n,i){const s=this._kernelInstance.getComponentId(n),o=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,i,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(s,i,o,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,i=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),s=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),a.finishOperation(3,[s,i])}webGlPreviewDockings(e,t){a.waitFor(4).then(({componentId:n})=>{t&&this.requestPlanComponentConstruction(n),this._kernelInstance.requestPreviewGeometry(n,e.planObjectId)}),e.lastPossibleChild&&e.lastPossibleChild.isComponent&&(this._kernelIo.setMeta({componentId:e.lastPossibleChild.id}),this._kernelInstance.loadPlainComponent(l,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(l,e.lastPossibleChild.configuration)}previewDockingsWithDrag(e,t){this._kernelInstance.requestPreviewGeometry(e,t)}loadConfiguration(e){this._initData.id?this._memoryManager.loadingConfiguration(this._initData.id):this._memoryManager.loadingConfigurationString(),this._memoryManager.shouldHardReset()?this._kernelInstance.clearAll():this._kernelInstance.clearScene(),this._kernelInstance.loadConfiguration(h,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setComponentParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanObjectParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o)}_finishParameterChange(e,t,n){-1===be.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}_calcPrice(){const e=new Map;if(this._initData.useRoomlePrice){let e=this._kernelInstance.getFullPartList();if(e&&e.fullList&&e.fullList.length){const t=e.fullList[0].currencySymbol,n=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0);this._configuratorUiCallbacks.onUpdatePrice(t,n)}}else if(this._initData.usePriceService){let t=this._kernelInstance.getFullPartList();if(t&&t.fullList&&t.fullList.length){const n=t.fullList.reduce((t,n)=>{const i=c(n);return i&&(e.set(i,n),t.push(i)),t},[]);return new Promise((i,s)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return s(new Error("prices are empty"));const o=O(n,"priceId");let r=0;return t.fullList.forEach(e=>{const t=c(e);if(!o.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:i}=o.get(t);e.price=n,e.currencySymbol=i,r+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,r),i({totalSum:r,partMap:e})},e=>{console.error(e),s(e)})})}}return Promise.resolve({totalSum:0,partMap:e})}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:i}=e,s=e.perMainComponent;let o;this.addUiDataToPartList(n,t);try{const e=await this._calcPrice();o=e.partMap}catch(e){console.error(e),o=new Map}const r=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{r||(e.price=null,e.currencySymbol=null);const t=c(e);if(!t)return;if(!o.has(t))return;const{price:n,currencySymbol:i}=o.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=i)};return n.forEach(a),s.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(a)}),{fullList:n,perMainComponent:s,originPart:i}}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),fe(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let i=this._kernelInstance.getPlanObjectParameters,s=e;t&&(i=this._kernelInstance.getComponentParameters,s=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(i.apply(this._kernelInstance,[s]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),o.end("kernel_is_ready"),o.start("kernel_create_instance"),r.kernelInstance?this._kernelInstance=r.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,this._kernelContainer.registerConfiguratorCallback(this),o.end("kernel_create_instance");const{overrideCountry:e,locale:t}=this._globalInitData;e&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(e)),d.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:_}),this._kernelInstance.setEnvironmentVariable("language",t),this._unitFormatter.init(this._kernelContainer),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),r.planObjectId&&this.planObjectCreated(-1,r.planObjectId),this._kernelInstance.useEnvironmentGeometry(!0)}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,s){a.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:_(s)}),this._configuratorKernelCallbackListener.forEach(o=>o.configurationLoaded(e,t,n,i,s))}componentDefinitionLoaded(e,t){a.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),a.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=_(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}a.failOperation(4,new Error(n)),a.failOperation(2,new Error(n))}componentConfigurationUpdated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.componentConfigurationUpdated(e,t)),this._kernelInstance.requestDeltaPlanComponentConstruction(e)}setActiveGroupInView(e){this._kernelInstance.setActiveGroupInView(e)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n){this.updatePlanObjectDependencies(e);let i=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(i=>i.planObjectConfigurationUpdated(e,t,n));const s=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(s),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,i),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const i=new Promise((e,t)=>{n=e});let s;this.externalMeshQueue.push(i);try{s=await this._rapiAccess.getMesh(e,u,t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const i=await fetch(new Request(this._dataSyncer.requestAsset(s.url,!0))),o=await i.arrayBuffer();await this._handleCortoMesh(o,e,t),n()}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),console.error(t),t}}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1)),i&&i>0&&this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,i,t,n))}Editor3dRootComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!0))}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),o.end("ui_load_configuration"),this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}return n([i],e.prototype,"_unitFormatter",void 0),n([i],e.prototype,"_memoryManager",void 0),n([i],e.prototype,"_configuratorKernelAccessCallback",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_initData",void 0),n([i],e.prototype,"_globalInitData",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})();class Ee{constructor(e){const{component:t,resetCamera:n,consecutive:i}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===i||i}}const Se=new Map,Pe=new Map;class Ie{static loadFont(e){if(Pe.has(e))return new Promise(t=>{t(Pe.get(e))});if(Se.has(e))return new Promise((t,n)=>{Se.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,i)=>{Se.set(e,[{resolve:n,reject:i}]),t.load(A()+e,t=>{Pe.set(e,t),Ie._resolveAll(e,t)})})}static _resolveAll(e,t){Se.has(e)&&Se.get(e).forEach(e=>e.resolve(t)),Se.delete(e)}}e("A",Ie);var ke=e("R","static/rubik_regular_sub-eb3f3b61078695cc.json");let He=(()=>{class e{constructor(e,t){this._addOnSpotIcons=new Map,this.previewGhostEnabled=!1,this.addOnSpotsEnabled=!1,this._state=3,this._camera=e,this._textMaterial=new THREE.MeshStandardMaterial({color:8947848});let n=new THREE.Geometry;this._plusText=new THREE.Mesh(n,this._textMaterial),this._plusText.layers.set(4),Ie.loadFont(ke).then(e=>{this._font=e;let t={font:this._font,size:.05,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001};this._plusTextGeometry=new THREE.TextGeometry("+",t),this._plusTextGeometry.computeBoundingBox(),this._plusText.geometry=this._plusTextGeometry}),this._plusButtonPromise=new Promise((e,n)=>{t.fetch(p,{id:"gltf-loader-js"}).then(()=>{(new THREE.GLTFLoader).load(A()+"static/AddButtonRound-8004fa7dffdf7501.glb",t=>{t&&t.scene&&t.scene.children&&t.scene.children.length>0?(this._onPlusButtonLoaded(t.scene.children[0]),e()):n("loaded scene has no childrens")},e=>{},e=>{console.error(e),n(e)})})})}_onPlusButtonLoaded(e){e&&(this._plusButton=e,this._plusButton.material=this._textMaterial,this._plusButton.layers.set(4),this._plusButton.scale.copy(new THREE.Vector3(.08,.08,.08)))}_performUpdate(e){if(this.addOnSpotsEnabled)for(let e of this._addOnSpotIcons.values())e.forEach(e=>{e.geometry.center();let t=new THREE.Vector3(0,1,0);t.applyQuaternion(this._camera.quaternion),e.up.copy(t),e.lookAt(this._camera.position)})}addAddOnSpots(e,t){Promise.all([this._plusButtonPromise]).then(()=>{this.addOnSpotsEnabled&&this._plusButton&&(this.deleteAddonPointsForComponent(e.roomleId),t.forEach(t=>{const n=this._plusButton.clone();n.name="addOnSpot "+e.roomleId,n.layers.set(8),n.position.copy(this.getPositionForAddOnPosition(new THREE.Vector3(t.position.x,t.position.y,t.position.z))),this._addOnSpotIcons.has(e.roomleId)?this._addOnSpotIcons.get(e.roomleId).push(n):this._addOnSpotIcons.set(e.roomleId,[n]),n.geometry.computeBoundingBox();const i=n.geometry.boundingBox,s=i.getSize(new THREE.Vector3),o=new THREE.BoxGeometry(s.x,s.y,s.z),r=new THREE.Mesh(o,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1}));r.layers.set(4),r.translateOnAxis(i.getCenter(new THREE.Vector3),1),r.renderOrder=3,r.visible=!0,n.add(r),r.userData={hasListener:!0,priority:3,roomleId:e.roomleId},r.addEventListener("select",()=>{this._onAddonClick&&this._onAddonClick()}),r.addEventListener("hover_on",()=>{T("pointer"),this._configuratorUiCallbacks.onAddonPlusHover()}),r.addEventListener("hover_off",()=>{T("default"),this._configuratorUiCallbacks.onAddonPlusHoverOff()}),e.add(n)}))})}deleteAddonPointsForComponent(e){this.addOnSpotsEnabled&&this._addOnSpotIcons.has(e)&&(this._addOnSpotIcons.get(e).forEach(e=>{e.parent.remove(e)}),this._addOnSpotIcons.delete(e))}getPositionForAddOnPosition(e){let t=new THREE.Vector3;return t.set(e.x/1e3,e.z/1e3,e.y/-1e3),t}update(e=!1){this._performUpdate(e)}changePreviewGhostVisibility(e,t){this.previewGhostEnabled&&(t?(e.add(this._plusText),this._plusText.position.copy((new THREE.Vector3).add(e.boundingBox.getCenter(new THREE.Vector3))),this._plusText.geometry.center()):e.remove(this._plusText))}_changeAddOnSpotVisibility(e){this.addOnSpotsEnabled&&this._addOnSpotsVisible!==e&&(this._addOnSpotsVisible=e)}isAddOnSpotVisible(){return this._addOnSpotsVisible&&this.addOnSpotsEnabled}onAddonClick(e){this._onAddonClick=e}setState(e){1===this._state&&2!==e||1===e&&5===this._state||3!==e&&5===this._state||(4!==e&&1!==e&&5!==e||this._changeAddOnSpotVisibility(!1),3!==e&&2!==e&&0!==e||this._changeAddOnSpotVisibility(!0),this._state=e)}}return n([i],e.prototype,"_configuratorUiCallbacks",void 0),e})();class Re{constructor(e){const{component:t,preview:n,resetCamera:i,consecutive:s,type:o,forceRender:r}=e;this.component=t,this.preview=n,this.resetCamera=void 0===i||i,this.consecutive=void 0===s||s,this.type=o||0,this.forceRender=void 0!==r&&r}}let Me=(()=>{class e extends B{constructor(e,t,n,i,s){super(e,t,n,i),this._cameraMoving=!1,this._addonHelper=s,this._raycastHelper.addEventListener(3,()=>{this._clickOutside()},this),this._selectionHandler.addEventListener(0,({component:e,consecutive:t})=>{this.dispatchEvent(8,new Re({component:e,consecutive:t})),this._inputManager.setDragEnabled(!0)},this),this._selectionHandler.addEventListener(1,({component:e,resetCamera:t})=>{this._selectionHandler.hasSelection()||this._inputManager.setDragEnabled(!1),this.dispatchEvent(9,new Re({component:e,resetCamera:t}))},this),this._addInputListeners(this._inputManager)}_addInputListeners(e){e.addEventListener(7,e=>this._interaction(),this),e.addEventListener(8,e=>this._interaction(),this)}addComponentHandlers(e){this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.roomleId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:2,roomleId:e.roomleId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.roomleId}),this._raycastHelper.enableDragIn(e.boundingBoxMesh))}_addComponentHandlers(e,t,n){t.userData.hasListener||(Object.assign(t.userData,n),t.addEventListener("select",()=>this.clickComponent(e)),t.addEventListener("hover_on",t=>this._hoverOn(e,t.attachment.type)),t.addEventListener("hover_off",t=>this._hoverOff(e,t.attachment.type)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)))}addPreviewHandlers(e){let t=e.boundingBoxMesh;t.userData.hasListener||(t.userData={hasListener:!0,priority:3,roomleId:e.roomleId},t.addEventListener("select",()=>this._clickPreview(e)),t.addEventListener("hover_on",()=>this._hoverOnPreview(e)),t.addEventListener("hover_off",()=>this._hoverOffPreview(e)))}addPreviewLineHandlers(e){let t=e.boundingLineMesh;t.userData.hasListener||(t.userData={hasListener:!0,priority:4,roomleId:e.roomleId},t.addEventListener("select",()=>this._clickPreviewLine(e)),t.addEventListener("hover_on",t=>this._hoverOnPreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_move",t=>this._hoverMovePreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_off",()=>this._hoverOffPreviewLine(e)))}_clickPreview(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Re({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Re({preview:e}))}clickComponent(e){this._debug&&e.roomleId,this._selectionHandler.check(e)}_clickOutside(){this._selectionHandler.cancelSelection(),this.dispatchEvent(3),this._interaction()}_hoverOn(e,t){this._cameraMoving||(this._debug&&e.roomleId,e.hoverOn(),this._interaction(),this.dispatchEvent(1,new Re({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.roomleId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new Re({component:e,type:t})),this._hoveredComponent=null)}_hoverOnPreview(e){e.hoverOn(),this._interaction(!0),this._hoveredPreview=e,this._addonHelper&&this._addonHelper.changePreviewGhostVisibility(e,!0)}_hoverOffPreview(e){e.hoverOff(),this._interaction(!0),this._hoveredPreview=null,this._addonHelper&&this._addonHelper.changePreviewGhostVisibility(e,!1)}_hoverOnPreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._draggedComponent||e.hoverOn(),this._interaction(),this._hoveredPreview=e}_hoverMovePreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._hoveredPreview=e,this._interaction(!0)}_updatePositionForPreviewLine(e,t){let n=t.object.parent.parent.worldToLocal(t.point);this._previewLineIntersection=n,e&&(this._draggedComponent?this._draggedComponent.visible=!0:e.updatePreviewPosition(n))}_hoverOffPreviewLine(e){this._draggedComponent||e.hoverOff(),this._interaction(),this._hoveredPreview=null,this._previewLineIntersection=null}_setDragComponentShadow(e){this._draggedComponent.traverse(t=>{if(t instanceof THREE.Mesh){const n=t;e&&void 0!==n.castShadowOld?(n.receiveShadow=n.receiveShadowOld,n.castShadow=n.castShadowOld):(n.receiveShadowOld=t.receiveShadow,n.castShadowOld=t.castShadow,n.receiveShadow=!1,n.castShadow=!1)}})}_dragStart(e){e&&(this._selectionHandler.isSelected(e)||this.isDragIn())&&(this._dragStartPosition=e.position.clone(),this._dragStartRotation=e.rotation.clone(),this._draggedComponent=e,this._setDragComponentShadow(!1),this.dispatchEvent(4,new Re({component:e})),this._interaction())}_drag(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(e&&!this._draggedComponent&&(this._draggedComponent=e),this._previewLineIntersection){let e=this._hoveredPreview,t=e.getPositionForIntersectionPoint(this._previewLineIntersection),n=e.parent.localToWorld(t);this._draggedComponent.position.copy(this._draggedComponent.parent.worldToLocal(n)),this._draggedComponent.rotation.copy(e.docklineRotation),e.hideSelectionLine()}else e.parent?e.position.copy(e.parent.worldToLocal(t)):e.position.copy(t);this._hoveredPreview?e.visible=!1:e.visible=!0,this.dispatchEvent(5,new Re({component:e})),this._interaction()}}_dragEnd(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(this._hoveredPreview)if(this._previewLineIntersection){let t=this._hoveredPreview,n=t.getPositionForIntersectionPoint(this._previewLineIntersection),i=t.parent.localToWorld(n);e.position.copy(e.parent.worldToLocal(i)),e.rotation.copy(t.docklineRotation)}else e.position.copy(t);else this._dragStartPosition&&this._dragStartRotation&&(e.position.copy(this._dragStartPosition),e.rotation.copy(this._dragStartRotation),this._dragStartPosition=null,this._dragStartRotation=null,this.addComponentHandlers(e));e.visible=!0,this._setDragComponentShadow(!0),this._draggedComponent=null,this._previewLineIntersection=null,this.dispatchEvent(6,new Re({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new Re({forceRender:e}))}hasSelection(){return this._selectionHandler.hasSelection()}update(e,t,n){this._raycastHelper.update(e,t,n)}isDragIn(){return this._dragIn}isDragging(){return null!=this._draggedComponent}setRootComponentId(e){this._raycastHelper.setRootComponentId(e)}cancelSelection(){this._selectionHandler.setSelectionMode("standard"),this._selectionHandler.cancelSelection()}setSelectionMode(e){this._selectionHandler.setSelectionMode(e)}getSelectionMode(){return this._selectionHandler.getSelectionMode()}getSelectedRuntimeComponentIds(){return this._selectionHandler.getSelectedRuntimeComponentIds()}setCameraMoving(e){e&&this._hoveredComponent&&this._hoverOff(this._hoveredComponent,0),this._cameraMoving=e}}return n([i],e.prototype,"_selectionHandler",void 0),e})();class De extends N{constructor(e){super(),this._uiIntersectionMask=0,this.floorEnvironment=!1,this._camera=e}updateToBounds(e,t,n){let i=new THREE.Vector3(-e.x/2,0,-e.z/2),s=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(i,s),this._clientWidth=t,this._clientHeight=n;let o=this._boundingBox.getSize(new THREE.Vector3);this._boxVertices=[],this._boxVertices.push(this._boundingBox.min),this._boxVertices.push(this._boundingBox.min.clone().add(new THREE.Vector3(o.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new THREE.Vector3(o.x,0,0)))}set canvasOffset(e){this._offset=e,this.calculateUIIntersection()}calculateUIIntersection(){let e=[];if(null==this._boundingBox||null==this._offset)return;let t=this._checkPaddings();t.bottom=this._clientHeight-t.bottom,t.right=this._clientWidth-t.right;let n=0;this.floorEnvironment?(e=["left","right","bottom"],n=11):(this._offset.left>0&&t.left<this._offset.left*this._clientWidth&&(e.push("left"),n|=8),this._offset.right<1&&t.right<(1-this._offset.right)*this._clientWidth&&(e.push("right"),n|=2),this._offset.bottom>0&&t.bottom<this._offset.bottom*this._clientHeight&&(e.push("bottom"),n|=1)),this._offset.top<1&&t.top<(1-this._offset.top)*this._clientHeight&&(e.push("top"),n|=4),n!==this._uiIntersectionMask&&(this.dispatchEvent(0,e),this._uiIntersectionMask=n)}_checkPaddings(){let e={left:this._clientWidth/2,top:this._clientHeight/2,right:this._clientWidth/2,bottom:this._clientHeight/2};return this._boxVertices.forEach(t=>{let n=g(t,this._camera,this._clientWidth,this._clientHeight);n.x<e.left&&(e.left=n.x),n.x>e.right&&(e.right=n.x),n.y<e.top&&(e.top=n.y),n.y>e.bottom&&(e.bottom=n.y)}),e}}let xe=(()=>{class e{constructor(e,t){this._forceRender=!1,this._updateShadowsAndAO=!0,this._maxAnisotropy=1,this._clock=new THREE.Clock,this._delta=0,this._depthWriteMaterial=new THREE.MeshBasicMaterial({colorWrite:!1}),this._lastChange=Date.now(),this._running=!1,this._onAfterRender=()=>{},this._creator_=e,this._setupScene(t),this._configuratorViewModel.setListener(this),this._lifeCycleManager.addEventListener(this);const{plusInPreview:n,addOnSpots:i}=this._initData;(n||i)&&(this._addonHelper=new He(this._camera,this._scriptLoader),i&&(this._addonHelper.onAddonClick(()=>{this._configuratorUiCallbacks.onOpenAddOns()}),this._addonHelper.addOnSpotsEnabled=i),this._addonHelper.previewGhostEnabled=n),this._cameraControl=new J(this._creator_,this._configuratorInputManager,null,this._camera),this._sceneEventHandler=new Me(this._creator_,this._scene,this._camera,this._configuratorInputManager,this._addonHelper),this._sceneEventHandler.addEventListener(0,({forceRender:e})=>{this._uiIntersectionHelper.calculateUIIntersection(),this._addonHelper&&this._addonHelper.setState(0),e&&this._renderEverything()},this),this._sceneEventHandler.addEventListener(1,({component:e,type:t})=>this._onHoverOn(e,t),this),this._sceneEventHandler.addEventListener(2,({component:e,type:t})=>this._onHoverOff(e,t),this),this._sceneEventHandler.addEventListener(3,()=>{this._configuratorUiCallbacks.onClickOutside(),this._cameraControl.unlock(),this._cancelDockings(!1,null,this._configuratorViewModel.hasPreviews(),!0,!1),this.cancelSelection(!0),this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentVisibility(this._sceneEventHandler,this._configuratorViewModel),this._requestRender()},this),this._sceneEventHandler.addEventListener(8,({component:e,consecutive:t})=>{this._configuratorViewModel.hasPreviews()&&this._cancelDockings(!1,null,this._configuratorViewModel.hasPreviews(),!0,!1),this._selectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(9,({component:e,resetCamera:t})=>{this._deselectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(4,({component:e})=>{"multiselect"===this._sceneEventHandler.getSelectionMode()&&this.cancelSelection(),this._requestDockingsPreviewWithDrag(e.roomleId),this._cameraControl.lock(),this._requestRender()},this),this._sceneEventHandler.addEventListener(5,()=>{this._renderEverything()},this),this._sceneEventHandler.addEventListener(6,({component:e,preview:t})=>{if(t){let n=t;this._configuratorViewModel.isPreviewLine(n)?this._configuratorViewModel.dockComponentWithPosition(n,e):this._configuratorViewModel.isPreview(n)&&this._dockComponent(n),this._cancelDockings(!t,e,!0,!0)}else{let t=this._sceneEventHandler.isDragIn()?e:null;this._cancelDockings(this._sceneEventHandler.isDragIn(),t,!1,!0);const n=this._configuratorViewModel.getBoundingBox();this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))}this._cameraControl.unlock(),this._renderEverything()},this),this._sceneEventHandler.addEventListener(7,({preview:e})=>{this._configuratorViewModel.isPreview(e)&&(this._configuratorViewModel.isPreviewLine(e)?this._configuratorViewModel.dockComponentWithPosition(e):this._dockComponent(e),this._cancelDockings(!1,null,!this._configuratorViewModel.hasPreviews(),!1,!1),this.requestDockingsPreview(!1),this._requestRender())},this),this._cameraControl.addEventListener(0,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._sceneEventHandler.setCameraMoving(!0),this._addonHelper&&this._addonHelper.setState(1),this._pixotronUtil.movingCameraStarts(),this._requestRender()},this),this._cameraControl.addEventListener(1,()=>{this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentAndPreviewVisibility(this._sceneEventHandler,this._configuratorViewModel),this._requestRender()},this),this._cameraControl.addEventListener(2,()=>{this._sceneEventHandler.setCameraMoving(!1),this._addonHelper&&this._addonHelper.setState(2),this._pixotronUtil.movingCameraStops(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(5,({minZoom:e,maxZoom:t})=>{this._configuratorUiCallbacks.onZoomChange(e,t)},this),this._cameraControl.addEventListener(3,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(4,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(7,()=>{this._pluginSystem.moveCameraStart(this._camera.position)},this),this._cameraControl.addEventListener(8,()=>{this._pluginSystem.moveCameraEnd(this._camera.position)},this),d.isProduction||(window.__RML__DEBUG__.SceneHelper=this),this._initOptionalModules()}async _initOptionalModules(){const{transparentHighlighting:e}=this._initData;if(e){const{default:e}=await Promise.resolve().then((function(){return Le}));this._componentRaycastHelper=new e,this._componentRaycastHelper.init(this._scene,this._camera)}}_showDockings(){}cancelDockings(){this._cancelDockings(!0,null,!0,!0,!1),this._renderEverything()}_cancelDockings(e,t,n,i,s=!0){e&&(this._sceneEventHandler.setDragIn(!1),this._configuratorViewModel.removeDockingComponent(),t&&this._scene.remove(t)),this._configuratorViewModel.removePreviews(),n&&s&&this._updateCameraToBounds(),i&&n&&this._configuratorUiCallbacks.onDockingsPreviewRemoved(),this._addonHelper&&this._addonHelper.setState(3),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}stopRenderLoop(){this._running=!1}_onHoverOn(e,t){2!==t&&this._highlight(e),this._componentDimensioningHelper&&this._componentDimensioningHelper.add(e)&&this._renderEverything()}_onHoverOff(e,t){2!==t&&this._highlight(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&(this._componentDimensioningHelper.remove(e),this._renderEverything()),this._requestRender()}_highlight(e=null,t=[]){if(!this._shouldHighlight())return;this._pixotron&&((null==t?void 0:t.length)?this._pixotron.getHighLightPass().transparency=.8:this._pixotron.getHighLightPass().transparency=1,this._pixotron.getHighLightPass().needsUpdate=!0);const n=[],i=this._initData.meshSelection;e?i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh):t&&t.length||(t=this._sceneEventHandler.getSelectedRuntimeComponentIds()),this._configuratorViewModel.getComponentsForIds(t).forEach(e=>{e&&(i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh))}),this._pixotron?this._pixotron.highlightObjects(n):this._outlinePass.selectedObjects=n}_shouldRenderUi(){return this._pluginSystem&&this._pluginSystem.needsUiScene()}_renderUi(){const e=this._scene.background?this._scene.background.clone():null;this._scene.overrideMaterial=this._depthWriteMaterial,this._scene.background=null,this._renderer.render(this._scene,this._camera),this._scene.overrideMaterial=null;const t=this._renderer.autoClear;this._renderer.autoClear=!1,this._renderer.clearDepth(),this._renderer.render(this._uiScene,this._camera),this._renderer.autoClear=t,this._scene.background=e}_renderEverything(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!0),this._requestRender()}_renderWithoutShadowsAndAO(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!1),this._requestRender()}_requestRender(){const e=()=>{this._delta=this._clock.getDelta(),this._animateCamera(),this._camera.layers.mask=65535,this._statsHelper&&this._statsHelper.updateRenderInfo(this._renderer.info),this._pixotron?(this._pixotron.autoShadowsClear=this._updateShadowsAndAO,this._pixotron.autoSAOClear=this._updateShadowsAndAO,this._forceRender&&(this._pixotron.needsUpdate=!0),this._checkLayers(),this._pixotron.render(this._renderer,this._scene,this._camera,this._renderTarget),this._forceRender=!1,this._updateShadowsAndAO=!0,this._pixotron.blit(),this._shouldRenderUi()&&this._renderUi()):(this._renderer.clear(),this._checkLayers(),this._composer.render(),this._renderer.clearDepth(),this._renderer.render(this._uiScene,this._camera),this._renderer.clearDepth()),this._onAfterRender(),this._addonHelper&&this._addonHelper.update(),window.TWEEN&&TWEEN.update(),this._addonHelper&&this._lastChange+1500<Date.now()&&this._addonHelper.isAddOnSpotVisible()&&this._addonHelper.setState(4),this._lastChange+3e3<Date.now()?this._running=!1:(this._running=!0,requestAnimationFrame(e))};if(this._lastChange=Date.now(),!this._running){if(this._running=!0,this._addonHelper&&!this._addonHelper.isAddOnSpotVisible()){let e=this._configuratorViewModel.hasPreviews()?5:3;this._addonHelper.setState(e)}requestAnimationFrame(e)}}_checkLayers(){this._addonHelper&&this._addonHelper.isAddOnSpotVisible()?(this._camera.layers.enable(8),this._configuratorUiCallbacks.onAddonPlusShown()):(this._camera.layers.disable(8),this._configuratorUiCallbacks.onAddonPlusHidden())}_animateCamera(){this._cameraControl&&(this._cameraControl.animateCamera(this._delta)?(this._lightSetting instanceof X&&this._lightSetting.update(this._camera,this._cameraControl.getTargetPosition()),this._pixotron&&(this._pixotron.needsUpdate=!0)):!this._pixotron||this._sceneEventHandler.isDragging()||this._forceRender||(this._pixotron.autoShadowsClear=!1,this._pixotron.autoSAOClear=!1)),this._environment.needsCamera()&&this._environment.updateCamera(this._camera)}resume(){let e=this._domHelper.getClientDimensions(),t=e.x,n=e.y;if(this._renderTarget){const e=Math.floor(t*window.devicePixelRatio),i=Math.floor(n*window.devicePixelRatio);this._renderTarget.setSize(e,i)}this._renderer.domElement.classList.add(m.HSC),this._domHelper.element.appendChild(this._renderer.domElement),this._configuratorInputManager.addEvents(this._renderer.domElement),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this._renderEverything(),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded()),this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._applySSR(),this._renderWithoutShadowsAndAO()})}_materialLoaded(){this._renderEverything(),this._applySSR(),this._environment instanceof Y&&this._environment.update()}_applySSR(){this._initData.ssr&&this._pixotron&&this._configuratorViewModel.getComponent(this._configuratorContext.rootComponentId).traverse(e=>{e instanceof THREE.Mesh&&!e.material.ssrPass&&this._pixotron.fixMaterial(e)})}pause(){this._configuratorInputManager.removeEvents(this._renderer.domElement),window.removeEventListener("resize",this,!1),window.removeEventListener("keydown",this,!1),window.removeEventListener("keyup",this,!1),document.removeEventListener("visibilitychange",this),this._configuratorViewModel.materialQueue.unregisterCallback(),this._configuratorMeshGenerator.removeMaterialLoadedListener()}destroy(){this.pause(),this.cleanUp()}_setupScene(e){const t=this._domHelper.getClientDimensions(),n=t.x,i=t.y;this._scene=new THREE.Scene,this._scene.background=new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND),this._uiScene=new THREE.Scene,this._componentFactory=f(),this._camera=this._componentFactory.createCamera(30,n/i,.1,20,e),this._camera.position.copy(new THREE.Vector3(0,.5,5)),this._uiIntersectionHelper=new De(this._camera),this._uiIntersectionHelper.canvasOffset=e,this._uiIntersectionHelper.addEventListener(0,e=>{this._configuratorUiCallbacks.onUiIntersectionChange(e)},this),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(5),this._camera.layers.enable(4);const s={format:THREE.RGBAFormat,minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter},o=THREE.sRGBEncoding,r=Math.floor(n*window.devicePixelRatio),a=Math.floor(i*window.devicePixelRatio);L()?this._renderTarget=new THREE.WebGLMultisampleRenderTarget(r,a,s):this._renderTarget=new THREE.WebGLRenderTarget(r,a,s),this._renderTarget.texture.encoding=o,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(n,i),this._renderer.outputEncoding=o,this._renderer.toneMapping=THREE.LinearToneMapping,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=THREE.PCFSoftShadowMap,this._environmentLoader.setRendererAndScene(this._renderer,this._scene),this._environmentLoader.registerEnvironmentChangedCallback(()=>this._renderEverything()),this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._configuratorMeshGenerator.maxAnisotropy=this._maxAnisotropy,this._configuratorMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()}),this._renderer.domElement.classList.add(m.HSC),this._domHelper.element.appendChild(this._renderer.domElement),this._configuratorInputManager.addEvents(this._renderer.domElement),this._lightSetting=new ue(this._scene),this._composer=new THREE.EffectComposer(this._renderer);let l=new THREE.RenderPass(this._scene,this._camera,null,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND),0);this._composer.addPass(l),this._outlinePass=new THREE.OutlinePass(new THREE.Vector2(n,i),this._scene,this._camera),this._outlinePass.renderToScreen=!0,this._outlinePass.visibleEdgeColor=new THREE.Color(this._initData.colors.SELECTION),this._outlinePass.hiddenEdgeColor=new THREE.Color(this._initData.colors.SELECTION),this._outlinePass.edgeStrength=3,this._outlinePass.edgeThickness=1,this._outlinePass.edgeGlow=0,this._composer.addPass(this._outlinePass),this._composer.setSize(n,i),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this._setEnvironment(new $(this._scene,this._environment,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND))),this._pluginSystem.init(this._scene,this._uiScene,this._camera.position),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded())}_tabVisible(){this.updateSize(!1)}sceneCleared(){this._internalClearScene()}display(e){this._scene.add(e),this._sceneEventHandler.setRootComponentId(e.roomleId),this._requestRender()}debugSceneGraph(e){this._configuratorViewModel.debugSceneGraph(e),this._printObjectGraph(this._scene,"")}debugScene(){return this._scene}_printObjectGraph(e,t){e.material&&e.material.opacity,e.type,e.id,e.roomleId,e.children.length>0&&e.children.forEach(e=>{let n=t+" ";this._printObjectGraph(e,n)})}clearScene(){var e;this._cameraControl.clear(),this._internalClearScene(),this._pixotronUtil&&this._pixotronUtil.lockAdapter(),null===(e=this._sceneEventHandler)||void 0===e||e.cancelSelection(),this._pluginSystem.clearScene(this._scene,this._uiScene)}planObjectConstructionDone(e){this._componentDimensioningHelper.reset(),this._componentDimensioningHelper.setCamera(this._camera)}_internalClearScene(){this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type&&"Line"!==e.type||this._scene.remove(e)}),this._uiScene.children.forEach(e=>{this._uiScene.remove(e)}),this._configuratorViewModel.sceneCleared(),this._memoryManager.shouldHardReset()&&(this._configuratorMeshGenerator.clear(),this._renderer.renderLists.dispose(),this._memoryManager.executedHardReset()),this._renderEverything()}async preparePerspectiveImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let n=this._camera.clone(),i=this._calculateBoundingBoxOfAllMeshes(0,t);this._lightSetting.removeFromScene();const s=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();s&&this._dimensionHelper.disableDimensions(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),F(n,i,-20,-30),this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(n.position),i=this._calculateBoundingBoxOfAllMeshes(0,t)),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const o=await j(this._scene,this._uiScene,n,i,e);return s?this._dimensionHelper.enableDimensions():t&&this._dimensionHelper.disableDimensions(),this._lightSetting.addToScene(),this._requestRender(),o}async renderImage(e){await this._externalMeshesAndMaterialsReady(),this._configuratorViewModel.getPreviews()&&this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let t=this._camera,n=null;e.useCurrentPerspective||(t=this._camera.clone(),n=this._calculateBoundingBoxOfAllMeshes());const i=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();i&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const s=await G(this._scene,t,n,this._pixotron,this._renderer);return i&&this._dimensionHelper.enableDimensions(),this._requestRender(),s}async preparePartImage(e,t){return new Promise((n,i)=>{this._configuratorViewModel.requestSubPartConstruction(e).then(async e=>{t.size||(t.size=256);let i=this._camera.clone(),s=z((new THREE.Box3).setFromObject(e));const o=new THREE.Scene;o.add(e);const r=await j(o,null,i,s,t);C(o),n(r)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._configuratorViewModel.getBoundingBox(),z(n,e)}async _externalMeshesAndMaterialsReady(){await this._kernelAccess.externalMeshQueue.finished(!0),await this._configuratorViewModel.materialQueue.finished(!0)}async prepareTopImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),this._dimensionHelper.enableTopDimensions()),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();let n=this._calculateBoundingBoxOfAllMeshes(.1,t);this._lightSetting.removeFromScene();let i=await q(this._scene,this._uiScene,n,e);return t&&this._dimensionHelper.disableTopDimensions(),this._lightSetting.addToScene(),this._requestRender(),i}enableDragIn(e){this._sceneEventHandler.setDragIn(!0,e),this._requestRender()}_getYRotationOfObject(e){let t=e.getWorldDirection(new THREE.Vector3).clone();t.y=0,t.lengthSq()<.01&&(t=new THREE.Vector3(0,1,0),t.applyQuaternion(e.quaternion),t.y=0),t.normalize();let n=Math.asin(t.x);return t.z<0&&(n=Math.PI-n),n<0&&(n+=2*Math.PI),n}zoomToComponent(e){this._cameraControl.saveState(!1);let t=e.boundingBox.getSize(new THREE.Vector3),n=this._getYRotationOfObject(e),i=new THREE.Euler(0,n,0),s=e.getWorldPosition(new THREE.Vector3).clone().add(e.boundingBox.getCenter(new THREE.Vector3).applyEuler(i));const o=new THREE.Vector2;this._renderer.getSize(o),this._cameraControl.zoomTo(t,o.width,o.height,i.y,v(15),s)}resetCamera(){this._cameraControl.hasSavedState()?this.resetCameraToState():this.resetCameraPositionToStart(!1)}resetCameraToState(){this._cameraControl.hasSavedState()&&this._cameraControl.resetToState()}resetCameraPositionToStart(e=!0){this._requestRender();const t=this._configuratorViewModel.getBoundingBox();t&&this._cameraControl.reset(t,void 0,void 0,void 0,e)}_clearSelectionAndHovers(){this.cancelSelection(),this._configuratorViewModel.clearRootComponent()}resetPreviews(){this._configuratorViewModel.removePreviews(),this._addonHelper&&this._addonHelper.setState(5),this._requestRender()}changeOffset(e){this._camera.offset=e,this._uiIntersectionHelper&&(this._uiIntersectionHelper.canvasOffset=e)}_onWindowResize(){this._configuratorInputManager&&this._configuratorInputManager.updateSize(),this.updateSize()}updateSize(e=!0){const{x:t,y:n}=this._domHelper.getClientDimensions();this._renderer.setSize(t,n),this._camera.aspect=t/n,this._camera.updateProjectionMatrix(),this._updateCameraToBounds(null,e);const i=this._renderer.getPixelRatio();if(this._renderTarget){const e=Math.floor(t*i),s=Math.floor(n*i);this._renderTarget.setSize(e,s)}if(this._pixotron)try{this._pixotron.setSize(t,n)}catch(e){console.warn(e)}this._renderEverything()}setCameraOffset(e){this._camera.offset&&(this._camera.offset=e,this._renderEverything())}getCameraOffset(){return JSON.parse(JSON.stringify(this._camera.offset))}_onKeyDown(e){!e.key||"Escape"!==e.key&&"Esc"!==e.key||(this.cancelSelection(),e.preventDefault()),e.key&&e.key.includes("Shift")&&(this._cameraControl.enablePanning(),e.preventDefault()),this._sceneEventHandler&&this._sceneEventHandler.hasSelection()&&e.key&&("Backspace"===e.key||"Delete"===e.key)&&(this.requestDeleteSelectedComponent(),e.preventDefault())}_onKeyUp(e){e.key&&e.key.includes("Shift")&&(this._cameraControl.disablePanning(),e.preventDefault())}cancelPreviousDockings(){this._cancelDockings(!0,null,!1,!1)}cancelSelection(e){(this._sceneEventHandler.hasSelection()||"standard"!==this._sceneEventHandler.getSelectionMode())&&this._cancelSelection(e)}_cancelSelection(e){this._sceneEventHandler.cancelSelection(),this._configuratorContext.selectionMode="standard",this._configuratorContext.selectedRuntimeComponentIds=[],this._configuratorViewModel.removePreviews(),e&&!this._initData.debug&&this.resetCameraToState(),this._kernelAccess.updatePlanObjectDependencies(this._configuratorContext.planObjectId),this._configuratorUiCallbacks.onSelectionCancel()}_selectComponent(e,t){this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds(),t||("standard"===this._sceneEventHandler.getSelectionMode()?this._onSelectedRuntimeComponentChange(e):this._onSelectedRuntimeComponentsChange(this._sceneEventHandler.getSelectedRuntimeComponentIds())),this._highlight(e),!this._initData.debug&&t&&this.zoomToComponent(e)}_deselectComponent(e,t){"standard"===this._sceneEventHandler.getSelectionMode()&&(this._cancelSelection(t),this._highlight()),"multiselect"===this._sceneEventHandler.getSelectionMode()&&(this._sceneEventHandler.hasSelection()?this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds():(this._cancelSelection(t),this._highlight())),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}getScreenXY(e){return g(e,this._camera,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight)}cleanUp(){this.stopRenderLoop()}setSelectionMode(e){this._sceneEventHandler.setSelectionMode(e)}changeFloorMaterial(e){return this._environment&&this._environment instanceof Z||(this._environment=new Z(this._scene,this._environment,!0),this._uiIntersectionHelper.floorEnvironment=!0),this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),new Promise((t,n)=>{this._environment.changeFloorMaterial(e,this._maxAnisotropy).then(()=>{this._requestRender(),t()},n)})}enableHD(e){this._renderer.capabilities.maxTextures>8&&(e?e&&this.loadDynamicLightSetting(e):this.loadDynamicLightSetting(y.createDynamicLightSettingSource(null,b.CAMERA))),this._environment instanceof ee&&(this._environment.removeFromScene(),this._environment.loadBackground(A()+te,new THREE.MeshStandardMaterial)),this.reEnableHD()}reEnableHD(){let e={saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:100,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:1,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:50,side:THREE.FrontSide},outlineparams:{highlightColor:new THREE.Color(this._initData.colors.SELECTION),edgeStrength:1,transparency:1,edgeThickness:2}};this._pixotron=new window.PIXOTRON.Pixotron(e),this._pixotron.enableAA=!1,this._pixotronUtil=new ne(this._pixotron),this._initData.autoQuality&&this._enableAutoQuality(),this._environment instanceof Y&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),this._requestRender()}_enableAutoQuality(){this._pixotronUtil.enablePixotronAutoQuality();const e=this._pixotronUtil.getAutoAdapter();this._pixotronUtil.onAutoQualityChange((t,n)=>{this._statsHelper&&this._statsHelper.updateQualityInfo(t);const i=this._pixotronUtil.getLowestQualitySetting();if(this._enableSSR(t.ssr),n&&t.getQuality()<n.getQuality()&&e.getAverageFps()<5&&e.setQualitySetting(i),this._renderer.getPixelRatio()>1&&!t.useDevicePixelRatio){this._renderer.setPixelRatio(1);const{x:e,y:t}=this._domHelper.getClientDimensions();try{this._pixotron.setSize(e,t)}catch(e){console.warn(e)}this._renderTarget&&this._renderTarget.setSize(e,t)}}),this._pixotronUtil.onManualQualityChange((e,t)=>{this._statsHelper&&this._statsHelper.updateQualityInfo(e),this._enableSSR(e.ssr)})}_enableSSR(e=!1){const t=void 0!==this._initData.ssr&&this._initData.ssr;this._pixotron.getSSRPass().enabled=!!t&&e}async loadDynamicLightSetting(e){this._lightSetting=new X(this._scene,this._lightSetting);let t=!1;if(e.url)await this._lightSetting.loadFromURL(e.url),t=!0;else if(e.json)await this._lightSetting.loadFromJSON(e.json),t=!0;else if(e.object)await this._lightSetting.loadFromObject(e.object),t=!0;else if(e.ls){const n=y.createDynamicLightSettingSource(null,e.ls);await this._lightSetting.loadFromURL(n.url),t=!0}if(!t)throw new Error("No dynamic light setting source set");this._renderEverything()}exportGLB(){this._scriptLoader.fetch(K,{id:"gltf-exporter"}).then(()=>{let e=new THREE.GLTFExporter,t=[];this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type||t.push(e)}),e.parse(t,e=>{let t=document.createElement("a");const n=new Blob([e],{type:"model/gltf-binary"});t.href=URL.createObjectURL(n),t.download="scene.glb",t.style.display="none",document.body.appendChild(t),t.click()},{binary:!0,embedImages:!0,forceIndices:!0})})}showGUI(){let e=w();e&&(this._lightSetting&&this._lightSetting.showGUI(),this._pixotron&&this._pixotronUtil.showGUI(),this._environment&&this._environment.showGUI(),this._addGUIListener(e))}_addGUIListener(e){let t=e.__folders;Object.keys(t).forEach(e=>{let n=t[e];n.__folders&&Object.keys(n.__folders).forEach(e=>{let n=t[e];this._addGUIListener(n)}),n.__controllers&&n.__controllers.forEach(e=>{e.onFinishChange(()=>{this._requestRender()})})})}zoomIn(e){this._cameraControl.zoomIn(e),this._renderEverything()}zoomOut(e){this._cameraControl.zoomOut(e),this._renderEverything()}showStats(){t.import("./stats-helper-0acbc658.legacy.js").then(({default:e})=>this._statsHelper=new e)}async showDimensions(){await this._initDimensions(),this._dimensionHelper.enableDimensions(),this._dimensionHelper.onDimensionsVisibilityChanged(e=>{e&&this._renderEverything(),this._configuratorUiCallbacks.onDimensionsVisibilityChange(e)}),this._renderEverything()}async _initDimensions(){this._dimensionHelper||await t.import("./dimensioning-helper-bed08d96.legacy.js").then(({default:e})=>{this._dimensionHelper=new e(this._creator_),this._pluginSystem.addPlugin(this._dimensionHelper)})}hideDimensions(){this._dimensionHelper&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._renderEverything()}loadSceneSettings(e){let t=new Promise(t=>{(new ie).load(this._scene,this._renderer.domElement,this._environment,e).then(e=>{e&&this._setEnvironment(e),t()})});this._lightSetting=new X(this._scene,this._lightSetting);let n=this._lightSetting.loadFromObject(e);return new Promise((e,i)=>{Promise.all([t,n]).then(()=>{this._renderEverything(),this._uiIntersectionHelper.floorEnvironment=this._environment instanceof Z,e()},i)})}setBackgroundColor(e){this._setEnvironment(new $(this._scene,this._environment,new THREE.Color(e)))}setBackgroundImage(e){this._setEnvironment(new $(this._scene,this._environment,null,this._renderer.domElement,e))}setBakedShadow(e,t){this._setEnvironment(new $(this._scene,this._environment,new THREE.Color(e),this._renderer.domElement,t))}_setEnvironment(e){this._environment=e,this._environment instanceof Y&&(this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._renderEverything(),500))),this._renderEverything()}handleEvent(e){switch(e.type){case"resize":this._onWindowResize();break;case"keydown":if(e.target&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement))break;this._onKeyDown(e);break;case"keyup":if(e.target&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement))break;this._onKeyUp(e);break;case"visibilitychange":this._tabVisible()}}_updateCameraToBounds(e,t=!0){e||(e=this._configuratorViewModel.getBoundingBox()),e&&(this._cameraControl.updateToBounds(e,!1,t),this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition())}requestDockingsPreview(e,t,n,i){i||(i=!1),e&&this.cancelPreviousDockings(),this.cancelSelection(),i&&this.enableDragIn(n),t&&(this._configuratorContext.lastPossibleChild=t),this._configuratorContext.requestPreviewsIsUserInitiated=e,this.resetPreviews(),this._kernelAccess.webGlPreviewDockings(this._configuratorContext,i),this._showDockings()}_requestDockingsPreviewWithDrag(e){this.cancelPreviousDockings(),this._configuratorContext.rootComponentId!==e&&(this.resetPreviews(),this._kernelAccess.previewDockingsWithDrag(e,this._configuratorContext.planObjectId),this._showDockings())}_dockComponent(e){const t=o.start("dock_component_"+e.childId);this._kernelAccess.dockComponent(e.parentId,e.parentDockId,e.childId,e.childDockId),this._configuratorContext.dockingRootComponentId=null,o.end(t)}_onSelectedRuntimeComponentsChange(e){this._kernelAccess.multiSelectionChange(e,this._configuratorContext.rootComponentId)}_onSelectedRuntimeComponentChange(e){let t=!1,n=null;e&&(t=e.roomleId===this._configuratorContext.rootComponentId,n=e.roomleId),this._kernelAccess.selectionChange(n,t),e&&this._kernelAccess.selectedComponent(e.roomleId)}requestDeleteSelectedComponent(){const e=this._configuratorContext.selectedRuntimeComponentIds,t=this._configuratorContext.rootComponentId;if(Array.isArray(e)&&0!==e.length&&t&&-1===e.indexOf(t)){switch(this._configuratorContext.selectionMode){case"standard":this.resetCamera(),this._kernelAccess.requestDeleteComponent(this._configuratorContext.selectedRuntimeComponentId);break;case"multiselect":this.resetCamera(),this._kernelAccess.requestDeleteComponents(this._configuratorContext.selectedRuntimeComponentIds)}this._configuratorContext.selectedRuntimeComponentIds=[]}}componentUpdated(e,t){if(e.roomleId===this._configuratorContext.rootComponentId){let t=new THREE.Vector3(e.position.x/1e3,e.position.z/1e3,e.position.y/-1e3);this._sceneEventHandler.update(null,t,null)}this._addonHelper&&e&&t.addOnSpots&&this._addonHelper.addAddOnSpots(e,t.addOnSpots),void 0===e.geometryChanged||e.geometryChanged?this._renderEverything():this._renderWithoutShadowsAndAO()}planObjectUpdated(e,t){const n=this._kernelAccess.kernelInstance.getSerializedConfiguration(this._configuratorContext.planObjectId);if(this._configuratorHistory.push(n),e.bounds){if(this._configuratorContext.planObjectId===e.id){const n=E(e.boxForMeasurement);this._updateBounds(n,t)}this._highlight(),this._requestRender()}}componentDeleted(e){this._addonHelper&&this._addonHelper.deleteAddonPointsForComponent(e.roomleId),-1===this._sceneEventHandler.getSelectedRuntimeComponentIds().indexOf(e.roomleId)&&"multiselect"!==this._sceneEventHandler.getSelectionMode()||this.cancelSelection()}previewConstructionDone(e,t){const n=this._configuratorViewModel.getBoundingBoxWithPreviews();t||(this._cancelDockings(!0,null,!1,!1,!1),this._configuratorContext.requestPreviewsIsUserInitiated&&this._configuratorUiCallbacks.onNoDockingsAvailable());let i=!0;this._componentRaycastHelper&&(i=!this._componentRaycastHelper.areAllPreviewsVisible(this._configuratorViewModel)),this._configuratorContext.requestPreviewsIsUserInitiated&&i&&this._updateCameraToBounds(n),this._lightSetting&&this._lightSetting.needsBounds()&&(this._lightSetting.updateBounds(n),this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))),this._componentRaycastHelper&&this._componentRaycastHelper.checkPreviewVisibility(this._configuratorViewModel)}configurationLoaded(e,t){e&&t&&this._sceneEventHandler.isDragIn()?(e.position.copy(new THREE.Vector3(0,100,0)),this._scene.add(e),this._sceneEventHandler.addComponentDragInHandler(e),this._requestRender()):t||this._initData.debug||this.resetCamera(),this._pixotronUtil&&this._configuratorViewModel.materialQueue.finished(!0).then(()=>{this._pixotronUtil.unLockAdapter()}),this._environment&&this._environment.reload()}addComponentHandlers(e){this._sceneEventHandler.addComponentHandlers(e)}addPreviewHandlers(e){this._sceneEventHandler.addPreviewHandlers(e)}addPreviewLineHandlers(e){this._sceneEventHandler.addPreviewLineHandlers(e)}_updateComponentPosition(){if(!this._configuratorUiCallbacks.onComponentPositionsUpdated)return;const e=[];this._configuratorViewModel.getComponents().forEach(t=>{if(!t.boundingBoxMesh)return;const n=(new THREE.Box3).setFromObject(t.boundingBoxMesh);let i=this._kernelAccess.kernelInstance.getComponent(t.roomleId);const s=i.parameters||i.possibleChildren?["edit"]:[];e.push({id:t.roomleId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"component",actions:s})}),this._configuratorViewModel.getPreviews().forEach(t=>{const n=(new THREE.Box3).setFromObject(t);e.push({id:t.roomleId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"preview",actions:["add"]})}),this._configuratorUiCallbacks.onComponentPositionsUpdated(e)}getScene(){return this._scene}_updateBounds(e,t=!1){let n=e.getSize(new THREE.Vector3);if(this._sceneEventHandler.hasSelection()||this._updateCameraToBounds(e,!1),this._sceneEventHandler.update(n,null,null),this._uiIntersectionHelper.updateToBounds(n,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight),this._environment.needsBounds()&&this._environment.updateBounds(n,t),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(e),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._pixotron&&this._pixotron.getShadowPass().setShadowRecieverBBox(e),this._pixotronUtil){const t=new THREE.Sphere;e.getBoundingSphere(t),this._pixotronUtil.updateBounds(t)}this._camera.updateProjectionMatrix(),this._pluginSystem.updateBounds(e)}updateScene(){const e=this._configuratorViewModel.getBoundingBox();this._updateBounds(e),this._renderEverything()}async moveCamera(e){return this._cameraControl.moveCamera(e)}selectComponent(e){if(!e)return;const t=this._configuratorViewModel.getComponents().find(({roomleId:t})=>t===e);t?this._sceneEventHandler.clickComponent(t):console.warn('Can not select "'+e+'" because it was not found')}highlightParts(e){this._highlight(null,e),this._requestRender()}_shouldHighlight(){return this._kernelAccess.kernelInstance.getPlanComponentPossibleChildren(this._configuratorContext.rootComponentId).length>0}}return n([i],e.prototype,"_domHelper",void 0),n([i],e.prototype,"_scriptLoader",void 0),n([i],e.prototype,"_configuratorInputManager",void 0),n([i],e.prototype,"_configuratorUiCallbacks",void 0),n([i],e.prototype,"_configuratorMeshGenerator",void 0),n([i],e.prototype,"_memoryManager",void 0),n([i],e.prototype,"_lifeCycleManager",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_kernelAccess",void 0),n([i],e.prototype,"_componentDimensioningHelper",void 0),n([i],e.prototype,"_configuratorViewModel",void 0),n([i],e.prototype,"_environmentLoader",void 0),n([i],e.prototype,"_pluginSystem",void 0),n([i],e.prototype,"_initData",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})(),Oe=(()=>{class e{constructor(e){this._activeComponents=[],this._creator_=e}setCamera(e){this._camera=e}add(e){const n=this._kernelAccess.kernelInstance.getComponent(e.roomleId);if(!n)return!1;const i=n.dimensionings;if(!i||0===i.length||this._camera.position.z<0)return!1;const s=E(n.boxForMeasurement),o={x:this._camera.position.x,y:this._camera.position.z};return t.import("./component-dimensioning-d657350b.legacy.js").then(t=>{Ie.loadFont("static/rubik_regular-75bd7bb699e9e39d.json").then(n=>{i.forEach(i=>{e.add(new t.default(S(i),s,n,o))})})}),this._activeComponents.push(e),!0}remove(e,n=!0){return new Promise(i=>{t.import("./component-dimensioning-d657350b.legacy.js").then(t=>{let s=[];e.children.forEach(e=>{e instanceof t.default&&s.push(e)}),s.forEach(t=>{e.remove(t),C(t)}),n&&U(this._activeComponents,e),i()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}clear(){}}return n([i],e.prototype,"_kernelAccess",void 0),e})();e("S",class{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}});let Ae=(()=>{class e{constructor(e){this._plugins=[],this._creator_=e}async init(e,n,i){this._scene=e,this._uiScene=n,this._cameraPosition=i;const{bananaForScale:s}=this._initData;s&&await t.import("./banana-for-scale-1dc75d47.legacy.js").then(({default:e})=>this._plugins.push(new e(this._creator_))),this._plugins.forEach(e=>e.setScene(this._scene)),this._plugins.forEach(e=>e.setUiScene(this._uiScene)),this._plugins.forEach(e=>e.updateBounds(this._bounds)),this._plugins.forEach(e=>e.moveCameraEnd(this._cameraPosition))}addPlugin(e){this._plugins.push(e),e.setScene(this._scene),e.setUiScene(this._uiScene),e.updateBounds(this._bounds),e.moveCameraEnd(this._cameraPosition)}updateBounds(e){this._bounds=e,this._plugins.forEach(t=>t.updateBounds(e))}clearScene(e,t){this._plugins.forEach(n=>n.clearScene(e,t))}getActivePlugins(){return this._plugins}getPlugin(e){for(let t of this._plugins)if(t instanceof e)return t;return null}moveCameraEnd(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraEnd(e))}moveCameraStart(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraStart(e))}needsUiScene(){return this._plugins.map(e=>e.needsUiScene()).reduce((e,t)=>e||t,!1)}}return n([i],e.prototype,"_initData",void 0),e})();class Te{constructor(){this._nonTransparentComponent=null,this._raycaster=new THREE.Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=V(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=V(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,n=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,n))}_changeMaterialsOnSelect(e,t,n=!1){if(e.children.length>0&&e.children.forEach(i=>{const s=t&&e.id===t.id||n,o=!(i instanceof THREE.Mesh);this._changeMaterialsOnSelect(i,t,(!s||!o)&&s)}),t)e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),n||P(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial){const{opacity:t,transparent:n}=e.userData.oldMaterial;P(e,{opacity:t,transparent:n}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const n=(new THREE.Box3).setFromObject(e).getCenter(new THREE.Vector3),i=(new THREE.Vector3).subVectors(n,this._camera.position).normalize();this._raycaster.set(this._camera.position,i),this._raycaster.far=this._camera.position.distanceTo(n);const s=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const n=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(n.length>1)return;const i=n[0];this.isComponentVisible(i)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,i)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1})}}var Le=Object.freeze({__proto__:null,default:Te});let Ue=(()=>{class e{constructor(e){this._history=[],this._index=0,this._creator_=e}undo(){if(!this.canUndo())return null;this._index++;const[e]=this._history.slice(this._index);return this._index===this._history.length-1?this._configuratorUiCallbacks.onHistoryChange(!1,!0):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}redo(){if(!this.canRedo())return null;this._index--;const[e]=this._history.slice(this._index);return 0===this._index?this._configuratorUiCallbacks.onHistoryChange(!0,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}push(e){const[t]=this._history.slice(this._index);t!==e&&(this._history=this._history.slice(this._index),this._history.unshift(e),this._index=0,1===this._history.length?this._configuratorUiCallbacks.onHistoryChange(!1,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!1))}canUndo(){return this._index!==this._history.length-1}canRedo(){return 0!==this._index}getHistory(){return this._history}}return n([i],e.prototype,"_configuratorUiCallbacks",void 0),e})();const Ve=[new I("kernel-access",we),new I("logger",k),new I("rapi-access",H),new I("script-loader",se),new I("unit-formatter",ye),new I("camera-control-3d",J),new I("camera-control",oe),new I("configurator-input-manager",class extends Q{},1),new I("data-syncer",R),new I("selection-handler",class extends N{constructor(){super(...arguments),this._selectionMode="standard",this._selectedComponents=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedComponents.size&&this._selectedComponents.forEach((e,t)=>{e.deselect(),this._selectedComponents.delete(t),this.dispatchEvent(1,new Ee({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.roomleId)?this.dispatchEvent(0,new Ee({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new Ee({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.roomleId,e),this.dispatchEvent(0,new Ee({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.roomleId))return this._selectedComponents.delete(e.roomleId),void this.dispatchEvent(1,new Ee({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.roomleId,e),this.dispatchEvent(0,new Ee({component:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedComponents.size>0}getSelectedRuntimeComponentIds(){let e=[];return this._selectedComponents.forEach(t=>e.push(t.roomleId)),e}isSelected(e){return this._selectedComponents.has(e.roomleId)}},1),new I("configurator-mesh-generator",_e),new I("configurator-ui-callbacks",W,1),new I("scene-helper",xe,1),new I("component-dimensioning-helper",Oe,1),new I("plugin-system",Ae,1),new I("component-raycast-helper",Te,0),new I("configurator-history",Ue,1)],Be=(e,t)=>e.sort||t.sort?e.sort?t.sort?e.sort-t.sort:-1:1:0,Fe=(e,t)=>e&&!t?1:!e&&t?-1:e&&t?e.localeCompare(t):0;let je=(()=>{class e{constructor(e){this._onInitDoneCollection=[],this._isKernelReady=!1,this._isWebGlReady=!1,this._isPreloadReady=!0,this._isLoadError=!1,this._isReloading=!1,this._needsSync=!1,this._creator_=e,this._configuratorKernelAccessCallback.addListener(this);const t=this._errorHandler;t.subscribe(0,e=>this._configuratorUiCallbacks.onErrorDueToOffline(e)),t.subscribe(1,e=>this._configuratorUiCallbacks.onError(e)),t.subscribe(2,(e,t)=>this._configuratorUiCallbacks.onContentProblem({rapiPath:e,ids:t,message:"Could not load the ids"}))}_isInitDone(){return this._isKernelReady&&this._isWebGlReady&&this._isPreloadReady}_checkInitDone(){this._isInitDone()&&(this._onInitDoneCollection.forEach(e=>e()),this._onInitDoneCollection=[])}_onInitDone(e){this._isInitDone()?e():this._onInitDoneCollection.push(e)}getScene(){return this._sceneHelper.getScene()}updateScene(){this._sceneHelper.updateScene()}_loadWebGlLib(e,t){this._threeLoader.fetch().then(()=>Promise.all(re.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(this._loadingWebGlSuccess(e,t).bind(this),this.loadError.bind(this)),this.loadError.bind(this))}_loadingWebGlSuccess(e,t){return()=>{t&&this._sceneHelper.changeOffset(t);const{initialFloorMaterial:e,dls:n,ls:i,stats:s}=this._initData;let o=y.createDynamicLightSettingSource(n,i);this._enableHD(o),s&&this.showStats(),this._needsSync&&(this._needsSync=!1,this._kernelAccess.requestSync(h,this._configuratorContext.planObjectId));const r=[this._scriptLoader.fetch(ae,{id:"tween-js"})];e&&r.push(this._rapiAccess.getMaterial(e).then(e=>this._sceneHelper.changeFloorMaterial(e))),Promise.all(r).then(this._webGlIsReady.bind(this),this.loadError.bind(this))}}_webGlIsReady(){this._isWebGlReady=!0,this._checkInitDone()}_initPromiseCallback(e,t){this._isInitDone()?e():this._isLoadError?t("_initPromiseCallback failed"):(this._onInitDone(()=>e()),this._rejectOnLoadError=t)}_notifyOnConfigurationReady(e){return async t=>{const n=await this._kernelAccess.addUiDataAndPriceToPartList(t.partList,t.hash);t.partList=n,e(t),this._configuratorUiCallbacks.onConfigurationReady(n,t.hash,t.rootComponentLabel)}}_notifyOnConfigurationLoadingError(e){return t=>{this._configuratorUiCallbacks.onConfigurationLoadError(),e(t)}}_loadItemOrConfigById(e,t){this._configuratorContext.lastLoadedRapiId=e,this._onLoadConfiguration(),this._preloadPackage(e),this._clearScene();const{offlineSync:n}=this._initData;if(n){const t=M(e);t&&this._dataSyncer.start(t)}return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(t=>{t&&t.configuration?this._loadConfiguration(t.configuration).then(e=>{const i=this._notifyOnConfigurationReady(n);t.label?this._notifyUiAboutNewItem(t,e.rootComponentLabel):this._notifyUiAboutNewConfiguration(t),i(e)},this._notifyOnConfigurationLoadingError(i).bind(this)):i(new Error("Could not load item or config with id "+e))},i)})}_shouldBroadcastToUi(e){return!(0===e&&this._configuratorContext.selectedRuntimeComponentId||1===e&&!this._configuratorContext.selectedRuntimeComponentId||2===e&&!this._configuratorContext.selectedRuntimeComponentIds.length)}_isCorrectResponse(e,t){if(0===e)return t===this._configuratorContext.planObjectId;if(1===e)return t===this._configuratorContext.selectedRuntimeComponentId;const n=t.length;if(n!==this._configuratorContext.selectedRuntimeComponentIds.length)return!1;for(let e=0;e<n;e++)if(t[e]!==this._configuratorContext.selectedRuntimeComponentIds[e])return!1;return!0}_onLoadConfiguration(){this._clearScene(),this._configuratorUiCallbacks.onLoadConfiguration()}_clearScene(){this._sceneHelper&&this._sceneHelper.clearScene()}_notifyUiAboutNewItem(e,t){this._rapiAccess.getCatalog(e.catalog).then(n=>this._configuratorUiCallbacks.onConfigurationLabelChange(n.name,e.label,t))}_notifyUiAboutNewConfiguration(e){Promise.all([this._rapiAccess.getCatalog(e.catalog),this._rapiAccess.getComponent(e.rootComponentId)]).then(([e,t])=>this._configuratorUiCallbacks.onConfigurationLabelChange(e.name,null,t.label))}_getMaterialGroups(e){const t=(e,t)=>{let n=Be(e,t);return 0!==n?n:(n=Fe(e.label,t.label),0!==n?n:Fe(e.id,t.id))},n=e=>(e.sort(t),e.forEach(e=>e.materials.sort(t)),e);if(e.validGroups.length>0)return new Promise((t,i)=>this._rapiAccess.getMaterialsByGroup(e.validGroups).then(e=>t(n(e)),i));const i=[];return e.validValues.forEach(e=>i.push(e.value)),new Promise((e,t)=>{this._rapiAccess.getMaterials(i).then(t=>{this._rapiAccess.combineMaterialsToGroups(t).then(t=>{e(n(t))})},t)})}_loadConfiguration(e){return this._kernelAccess.externalMeshQueue.clear(),new Promise((t,n)=>{const i=()=>{const{x:i,y:s}=this._domHelper.getClientDimensions();if(i<=0&&s<=0){let e="Size of canvas is 0/0! When using embedding set correct size or remove id to load in idle mode!";return console.error(e),n(e)}this.resumeKernelCallbacks(),o.start("ui_load_configuration");const r=[];if(this._initData.applyCurrentGlobalParameters){const e=this._configuratorContext.planObjectId,t=this._configuratorContext.rootComponentParametersAsGlobal;r.push(this._kernelAccess.getGlobalParameters(e,t))}Promise.all(r).then(([i])=>{const s=[a.waitFor(4),a.waitFor(2)];Promise.all(s).then(([e,[n,s,o,r]])=>{const a=[];i&&this._initData.applyCurrentGlobalParameters&&i.forEach(e=>a.push(this.setParameter(e,e.value,!0)));const l=this._rapiAccess.peekComponent(r);Promise.all(a).then(()=>{const n=[];a.length&&(n.push(this._kernelAccess.getPartList()),n.push(this._kernelAccess.getConfigurationHash(this._configuratorContext))),Promise.all(n).then(async n=>{const i=n&&n[0]?n[0]:s,r=n&&n[1]?n[1]:o,a=await this._kernelAccess.addUiDataAndPriceToPartList(i,r);let h=e.errors;const c=h?_(h):[];t({partList:a,hash:r,rootComponentLabel:l?l.label:"",errors:c})})})},n),this._kernelAccess.loadConfiguration(e)},n)};this._onInitDone(()=>i())})}_preLoadItemOrConfig(e,t){return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(n,i)})}_preloadPackage(e){this._isPreloadReady=!1;let t=null;t=D(e)?this._rapiAccess.getPreloadForItem.bind(this._rapiAccess):this._rapiAccess.getPreloadForConfiguration.bind(this._rapiAccess),o.start("rapi_preloads");const n=()=>{o.end("rapi_preloads");const t=o.getMeasure("rapi_preloads");if(Array.isArray(t)&&1===t.length){const n=t[0];this._configuratorUiCallbacks.onTrackTiming("Timing","RapiPreloads",Math.round(n.duration),{id:e})}};t(e).then(()=>{this._isPreloadReady=!0,this._checkInitDone(),n()},e=>{this._isPreloadReady=!0,this._checkInitDone(),console.error(e),n()})}_reloadConfiguration(e,t,n,i){return this._performLoadConfiguration(e).then(e=>{this._isReloading=!1,n(e)},e=>{this._isReloading=!1,i(e)})}_performLoadConfiguration(e){return this._onLoadConfiguration(),new Promise((t,n)=>{this._initData.preloadHint?this._preloadPackage(this._initData.preloadHint):console.warn("When loading a configuration string you have to supply a preloadHint to use fast loading!"),setTimeout(()=>{this._loadConfiguration(e).then(this._notifyOnConfigurationReady(t).bind(this),this._notifyOnConfigurationLoadingError(n).bind(this))},0)})}_changeHDGeometry(e){return new Promise((t,n)=>e===r.useHDGeometry?t():this._isReloading?n("Change of HD Geometry in progress"):(this._isReloading=!0,a.waitFor(3).then(([e,i])=>{this._reloadConfiguration(e,i,t,n)},n),r.useHDGeometry=e,void this._kernelAccess.changeUseOfHDGeometry(this._configuratorContext,r.useHDGeometry)))}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}init(e,t){this.setOverrides(t);const{preloadHint:n,offset:i,startTag:s}=this._initData;return this._domHelper.setDomElement(e),n?this._preloadPackage(n):console.warn("No preload hint! Therefore no preload during init!!"),s&&this.getTagById(s,{include:["items"]}).then(e=>this._configuratorUiCallbacks.onOpenTag(e),e=>console.error(e)),this._loadWebGlLib(e,i),new Promise(this._initPromiseCallback.bind(this))}cancelSelection(){this._sceneHelper.cancelSelection()}enableHDGeometry(){return this._changeHDGeometry(!0)}disableHDGeometry(){return this._changeHDGeometry(!1)}changeOffset(e){this._sceneHelper.changeOffset(e)}previewDockings(e,t,n){this._sceneHelper.requestDockingsPreview(!0,e,t,n)}cancelDockings(){this._sceneHelper.cancelDockings()}requestDeleteComponent(){this._sceneHelper.requestDeleteSelectedComponent()}renderImage(e){return this._sceneHelper.renderImage(e)}preparePerspectiveImage(e={}){return this._sceneHelper.preparePerspectiveImage(e)}preparePartImage(e,t){let n={};return"number"==typeof t?n.size=t:(t||(t={}),"number"!=typeof t.size&&(t.size=256),n=t),this._sceneHelper.preparePartImage(e,n)}saveCurrentConfiguration(){return new Promise((e,t)=>{this._kernelAccess.getConfigurationData(this._configuratorContext.planObjectId).then(n=>{this._rapiAccess.saveConfiguration(n).then(n=>{this._configuratorUiCallbacks.onConfigurationSaved(n.configurationHash),this._rapiAccess.getComponent(n.rootComponentId).then(i=>{let s=!0,o=!0,r=n.perspectiveImage,a=n.topImage;n.perspectiveImage||(s=!1,this._sceneHelper.preparePerspectiveImage().then(l=>{this._rapiAccess.savePerspectiveImage(n,l).then(t=>{s=!0,r=t.perspectiveImage,o&&(t.label=i.label,t.topImage=a,e(t))},t)})),n.topImage||(o=!1,this._sceneHelper.prepareTopImage().then(l=>{this._rapiAccess.saveTopImage(n,l).then(t=>{o=!0,a=t.topImage,s&&(t.label=i.label,t.perspectiveImage=r,e(t))},t)})),s&&o&&(n.label=i.label,e(n))},e=>{throw new Error(e)})},t)}).catch(t)})}generateImagesOfCurrentConfiguration(){return new Promise((e,t)=>this.saveCurrentConfiguration().then(t=>e({topImage:t.topImage,perspectiveImage:t.perspectiveImage,isLocally:t.isLocally}),t))}prepareTopImage(e){let t={};return"boolean"==typeof e?t.showDimensions=e:(e||(e={}),"boolean"!=typeof e.showDimensions&&(e.showDimensions=!1),t=e),this._sceneHelper.prepareTopImage(t)}resetCameraPosition(){this._sceneHelper.resetCameraPositionToStart()}showBenchmarks(e){o.showBenchmarks(e)}debugSceneGraph(e){this._sceneHelper.debugSceneGraph(e)}async loadConfiguration(e,t){this.setOverrides(t),this._configuratorContext.lastLoadedRapiId=null,this._sceneHelper&&this._sceneHelper.clearScene();const n=await this._performLoadConfiguration(e);return this._rapiAccess.trackView("configuration string"),n}async loadConfigurationById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!0);return this._rapiAccess.trackView(e),n}syncPlanObjectToView(e,t){this.resumeKernelCallbacks(),this._kernelAccess.requestSync(e,t),this._kernelAccess.requestPlanObjectConstruction(t);const n=this._kernelAccess.getSerializedConfiguration(t),i=this._kernelAccess.getCurrentConfigurationHash(t);this._kernelAccess.planObjectConfigurationUpdated(t,n,i),this._sceneHelper.resetCameraPositionToStart(!1)}async loadConfigurableItemById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!1);return this._rapiAccess.trackView(e),n}preLoadConfigurationById(e){return this._preLoadItemOrConfig(e,!0)}preLoadConfigurableItemById(e){return this._preLoadItemOrConfig(e,!1)}_getTag(e){return this._rapiAccess.getTag(e)}_dispatchSetParameter(e,t,n,i,s){const r=this._configuratorContext.selectedRuntimeComponentId?"local":"global",a=o.start("kernel_change_param_"+r+"_"+e);switch(this._configuratorContext.selectionMode){case"standard":if(this._configuratorContext.selectedRuntimeComponentId||this._configuratorContext.rootComponentParametersAsGlobal){let o=this._configuratorContext.selectedRuntimeComponentId?this._configuratorContext.selectedRuntimeComponentId:this._configuratorContext.rootComponentId;this._kernelAccess.changeComponentParameter(o,e,t,n,i,s)}else this._kernelAccess.changePlanObjectParameter(this._configuratorContext.planObjectId,e,t,n,i,s);break;case"multiselect":this._kernelAccess.changeCommonComponentParameter(this._configuratorContext.selectedRuntimeComponentIds,e,t,n,i,s)}o.end(a)}setParameter(e,t,n=!1){return new Promise((i,s)=>{const{key:o,type:r}=e;if(pe(e)){if(!n&&!this._unitFormatter.isParseableUnitString(t,e))return s(new SyntaxError('Value "'+t+'" is not parseable'));const i=n?t:this._unitFormatter.parseValue(t,e),{valueFrom:o,valueTo:a}=e.validRange,l=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(o)&&i<o-l)return s(new RangeError('Value "'+t+'" is too small, min-val "'+o+'"'));if(!Number.isNaN(a)&&i>a+l)return s(new RangeError('Value "'+t+'" is too big, max-val "'+a+'"'));t="Integer"===r&&"number"==typeof i?i.toFixed():i.toString()}this._sceneHelper.cancelDockings(),this._dispatchSetParameter(o,r,t,i,s)})}setParameterOfPlanObject(e,t){return new Promise((n,i)=>{const{planObjectId:s,rootComponentId:o,rootComponentParametersAsGlobal:r}=this._configuratorContext,{type:a,key:l}=e;r?this._kernelAccess.changeComponentParameter(o,l,a,t,n,i):this._kernelAccess.changePlanObjectParameter(s,l,a,t,n,i)})}getParametersOfPlanObject(){const{planObjectId:e,rootComponentParametersAsGlobal:t}=this._configuratorContext;return this._kernelAccess.getGlobalParameters(e,t)}setParameterOfRootComponent(e,t){return new Promise((n,i)=>{const{rootComponentId:s}=this._configuratorContext,{type:o,key:r}=e;this._kernelAccess.changeComponentParameter(s,r,o,t,n,i)})}getParametersOfRootComponent(){const{planObjectId:e}=this._configuratorContext;return this._kernelAccess.getGlobalParameters(e,!0)}enableMultiselect(){this._sceneHelper.setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._sceneHelper.setSelectionMode("standard"),this._configuratorContext.selectionMode="standard"}getCurrentConfiguration(){return a.waitFor(1,()=>this._kernelAccess.uiRequestConfiguration(this._configuratorContext.planObjectId))}loadComponentIntoKernel(e){return a.waitFor(0,()=>{let t=null;try{if(t=JSON.parse(e).id,!t)throw new Error("Component string has no ID")}catch(e){return this._configuratorUiCallbacks.onContentProblem({rapiPath:"components",ids:[t],message:"Component string is not a valid JSON or has no ID"}),void a.failOperation(0,e)}this._kernelIo.setMeta({componentId:t}),this._kernelAccess.loadComponentIntoKernel(e,t)})}getShortUrlOfCurrentConfiguration(){return new Promise((e,t)=>{this.saveCurrentConfiguration().then(n=>navigator.onLine?this._rapiAccess.getShortUrl(n.id,3).then(t=>{const n=t.shortId,i=d.APP.SHORTENER_URL+n;e(i)},t):t("Can not generate short url when offline"),t)})}formatValueToUnitString(e,t){return this._unitFormatter.formatValueToUnitString(e,t)}getTagById(e,t){return new Promise((n,i)=>{this._getTag(e).then(e=>{let s=Promise.resolve([]),o=Promise.resolve([]);t&&t.include&&t.include.forEach(t=>{"materials"===t&&(s=this._rapiAccess.getMaterialsOf(e)),"items"===t&&(o=this._rapiAccess.getItems(e.items))}),Promise.all([s,o]).then(([t,i])=>(i.sort(Be),t.sort(Be),n({...e,items:i,materials:t})),i)},i)})}requestAsset(e){return this._dataSyncer.requestAsset(e)}changeFloorMaterial(e){return this._sceneHelper.changeFloorMaterial(e)}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._sceneHelper.changeFloorMaterial(t)}openFloorMaterials(){this._configuratorUiCallbacks.onOpenFloorMaterials()}openPartList(){this._configuratorUiCallbacks.onOpenPartList()}getAdditionalContentsOf(e){return this._rapiAccess.getAdditionalContentsOfItems(e)}changeTypeChangeTag(e){navigator.onLine&&this._initData.offlineSync&&this._dataSyncer.syncTypeChangeTag(e),this._configuratorUiCallbacks.onChangeTypeChangeTag(e)}removeTypeChangeTag(e){this._configuratorUiCallbacks.onRemoveTypeChangeTag(e)}showGUI(){const e=document.createElement("style");e.innerText=".dg.ac {right:auto!important}",document.head.appendChild(e),this._scriptLoader.fetch(le,{id:"dat-gui-js"}).then(()=>this._sceneHelper.showGUI(),e=>console.error(e))}showStats(){this._sceneHelper.showStats()}showDimensions(){this._sceneHelper.showDimensions()}hideDimensions(){this._sceneHelper.hideDimensions()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}syncFloorTag(e){return this._dataSyncer.syncFloorTag(e)}syncTypeChangeTag(e){return this._dataSyncer.syncTypeChangeTag(e)}loadDynamicLightSetting(e){return this._sceneHelper.loadDynamicLightSetting(e)}setBackgroundColor(e){this._sceneHelper.setBackgroundColor(e)}setBackgroundImage(e){this._sceneHelper.setBackgroundImage(e)}setBakedShadow(e,t){this._sceneHelper.setBakedShadow(e,t)}loadSceneSetting(e){return this._sceneHelper.loadSceneSettings(e)}enableMeshSelection(e){this._initData.meshSelection=e}updateSize(){this._sceneHelper.updateSize()}setCameraOffset(e){this._sceneHelper.setCameraOffset(e)}getCameraOffset(){return this._sceneHelper.getCameraOffset()}getMain(){}cleanup(){this._configuratorContext.selectedRuntimeComponentIds=[],this._sceneHelper.sceneCleared(),this._kernelAccess.cleanUpCallbacks()}resumeTest(e){e&&this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}zoomIn(e){this._sceneHelper.zoomIn(e)}zoomOut(e){this._sceneHelper.zoomOut(e)}get callbacks(){return this._configuratorUiCallbacks}get globalCallbacks(){return this._globalCallback}getRuntimeComponentIdOfRootComponent(){const e=this._configuratorContext.planObjectId;return e?this._kernelAccess.getRuntimeComponentIdOfRootComponent(e):(console.warn("planObjectId not set"),0)}getCurrentConfigurationHash(){return this._kernelAccess.getConfigurationHash(this._configuratorContext)}getCurrentSelection(){let e=this._configuratorContext.selectedRuntimeComponentIds;return e&&e.length||(e=[this._configuratorContext.rootComponentId]),e.map(e=>this._kernelAccess.getRuntimeComponentId(e))}_enableHD(e){return new Promise((t,n)=>{this._scriptLoader.fetch(he,{id:"pi-js"}).then(()=>{this._sceneHelper.enableHD(e),t()},n)})}isReady(){const e=o.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=o.getMeta("kernel_is_ready");this._configuratorUiCallbacks.onTrackTiming("Timing","KernelIsReady",Math.round(t.duration),Object.assign(n,{startTime:t.startTime}))}this._isKernelReady=!0,this._checkInitDone(),"function"==typeof this._configuratorUiCallbacks.onKernelIsReady&&this._configuratorUiCallbacks.onKernelIsReady()}updatePossibleChildren(e,t,n){const i=[],s=[];let o;const r=new Map,a=new Map;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n.possible)continue;let l=n.itemId;n.itemId?(s.push(n.itemId),a.set(n.itemId,n)):(i.push(n.componentId),r.set(n.componentId,n),l=n.componentId),n.isDefault&&!o&&(o=l)}Promise.all([this._rapiAccess.getComponents(i),this._rapiAccess.getItems(s)]).then(e=>{const t=[],n=e[0],i=e[1];let s;for(let e=0,i=n.length;e<i;e++){const i=n[e];i.isItem=!1,i.isComponent=!0;const a=r.get(i.id);a&&(i.group=a.group),i.id===o&&(i.isDefault=!0,s=i),t.push(i)}for(let e=0,n=i.length;e<n;e++){const n=i[e];n.isItem=!0,n.isComponent=!1;const r=a.get(n.id);r&&(n.group=r.group),n.id===o&&(n.isDefault=!0,s=n),t.push(n)}return t.sort(Be),{possibleChildren:t,defaultChild:s||null}}).then(({possibleChildren:e,defaultChild:t})=>{const n=[],i=new Map,s=[];for(let t=0,o=e.length;t<o;t++){const o=e[t],r=o.tags;if(o.tags&&Array.isArray(o.tags)&&o.tags.length)for(let e=0,t=o.tags.length;e<t;e++){const t=r[e];-1===n.indexOf(t)&&n.push(t);let s=i.get(t);if(!s){const e=[];i.set(t,e),s=i.get(t)}s.push(o)}else s.push(o)}return{tagIds:n,associations:i,defaultChild:t,noTagChilds:s}}).then(({tagIds:t,associations:i,defaultChild:s,noTagChilds:o})=>{this._rapiAccess.getTags(t).then(t=>{if(this._isCorrectResponse(n,e)&&this._shouldBroadcastToUi(n)){for(let e=0,n=t.length;e<n;e++){const n=t[e];n.possibleChildren=i.get(n.id)}t.sort(Be),o.length&&t.unshift({id:"",externalIdentifier:"",global:!1,created:(new Date).toISOString(),updated:(new Date).toISOString(),language:this._globalInitData.locale,catalog:null,tags:[],parents:[],materials:[],items:[],possibleChildren:o}),this._configuratorUiCallbacks.onUpdatePossibleChildren(t,s)}},e=>{console.error("Couldnt load tags of possible children"),console.error(e)})},e=>console.error(e))}updateParameters(e,t,n,i){const s={};t||(t=[],console.warn("Kernel returned no parameter groups! Check why!")),t.forEach(e=>{s[e.key]=e}),e.sort(Be),e.forEach(e=>{e.group?e.grouping=s[e.group]:e.grouping=null,this._unitFormatter.formatParameter(e),fe(e)&&Object.defineProperty(e,"groups",{get:()=>new Promise((t,s)=>{this._getMaterialGroups(e).then(e=>{this._isCorrectResponse(i,n)&&this._shouldBroadcastToUi(i)?t(e):s("Response does not match to ids")},s)})})}),this._shouldBroadcastToUi(i)&&this._configuratorUiCallbacks.onUpdateParameters(e)}loadError(e){this._isLoadError=!0,this._rejectOnLoadError&&this._rejectOnLoadError(e)}resumeKernelCallbacks(){this._kernelAccess.muteKernelCallbacks=!1,this._kernelAccess.resume()}pauseKernelCallbacks(){this._kernelAccess.muteKernelCallbacks=!0,this._kernelAccess.pause()}setActiveGroupInView(e){this._kernelAccess.setActiveGroupInView(e)}getParameterGroups(){return this._kernelAccess.getParameterGroups()}async getConfiguratorSettings(e){return this._rapiAccess.getConfiguratorSettings(e)}async moveCamera(e){return this._sceneHelper.moveCamera(e)}selectComponent(e){return this._configuratorContext.selectedRuntimeComponentId===e?Promise.resolve():Promise.resolve(this._sceneHelper.selectComponent(e))}setComponentParameter(e,t,n){const{key:i,type:s}=t;return new Promise((t,o)=>this._kernelAccess.changeComponentParameter(e,i,s,n,t,o))}highlightParts(e){this._sceneHelper.highlightParts(e)}undo(){const e=this._configuratorHistory.undo();e&&this._kernelAccess.loadConfiguration(e)}redo(){const e=this._configuratorHistory.redo();e&&this._kernelAccess.loadConfiguration(e)}getHashOfSerializedConfiguration(e){return this._kernelAccess.kernelInstance.getHashOfSerializedConfiguration(e)}}return n([i],e.prototype,"_rapiAccess",void 0),n([i],e.prototype,"_dataSyncer",void 0),n([i],e.prototype,"_errorHandler",void 0),n([i],e.prototype,"_unitFormatter",void 0),n([i],e.prototype,"_domHelper",void 0),n([i],e.prototype,"_configuratorUiCallbacks",void 0),n([i],e.prototype,"_configuratorKernelAccessCallback",void 0),n([i],e.prototype,"_lifeCycleManager",void 0),n([i],e.prototype,"_kernelAccess",void 0),n([i],e.prototype,"_threeLoader",void 0),n([i],e.prototype,"_scriptLoader",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_sceneHelper",void 0),n([i],e.prototype,"_initData",void 0),n([i],e.prototype,"_globalInitData",void 0),n([i],e.prototype,"_globalCallback",void 0),n([i],e.prototype,"_kernelIo",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})();class Ge extends ce{setupDependencies(){x.setup(Ve),this.lookup("kernel-access",this._context),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),t=this.lookup("rapi-access"),n=(this.lookup("dom-helper"),this.lookup("scene-helper"));e&&e.cleanUp(),t&&t.cleanUp(),n&&n.cleanUp()}setupGlobals(e){const{kernelInstance:t,kernelContainer:n,planObjectId:i}=e||{};r.init({kernelInstance:t,kernelContainer:n,planObjectId:i})}getApi(){return this._configurator}bootFinished(){this._configurator=new je(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}e("C",Ge),e("c",Object.freeze({__proto__:null,Configurator:Ge}))}}}));
|
|
2
|
-
//# sourceMappingURL=configurator-3250dfc2.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurator-mesh-generator-d604f05c.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-light-setting-14b03f67.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-bed08d96.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-ef758fca.legacy.js","./main-thread-to-worker-880d5b78.legacy.js","./pixotron-cd4cd438.legacy.js","./default-light-setting-14b03f67.legacy.js","./scene-manager-afd27798.legacy.js"],(function(e){var t,i,s,r,n,a,o,h,c,l,d,_,m,u,p,g,w,f,E,b,S,v,L,C,y;return{setters:[function(){},function(e){t=e.n,i=e.L,s=e.o,r=e.h,n=e._,a=e.i,o=e.d,h=e.f,c=e.P,l=e.e,d=e.G,_=e.a7,m=e.s},function(e){u=e.f},function(e){p=e.I,g=e.S,w=e.C,f=e.L,E=e.B,b=e.T,S=e.e,v=e.g,L=e.M},function(e){C=e.D},function(e){y=e.S}],execute:function(){const M=[new t("script-loader",g),new t("glb-input-manager",class extends p{},1),new t("logger",i),new t("rapi-access",s)];class R extends w{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,i,s,r){let n=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(n,a);let o=new THREE.Euler(-Math.PI/2+s,i,0,"ZYX"),h=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class B extends f{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=r();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}let T=(()=>{class e extends y{constructor(e,t){super(e,t,o.GLB,"3D"),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(h.createDynamicLightSettingSource(null,c.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new B(this._scene)),this._setEnvironment(new E(this._scene,this._environment))}createCameraControl(e){this._cameraControl=new R(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const i=await this._rapiAccess.getItem(e);return i.configuration?Promise.reject():this.loadGLB(u(i),!0,void 0,t)}loadGLB(e,t=!0,i=new THREE.Vector3(1,1,1),s){return this.clearScene(),new Promise((r,n)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,i,void 0,void 0,s).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let i=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=i.getCenter(new THREE.Vector3);this._cameraControl instanceof R&&(this._cameraControl.updateToBounds(i,!1,!0,e),this._cameraControl.reset(i,e,-15,0))}this._updateBounds(i),r()},n)})}preparePerspectiveImage(e,t,i){return new Promise(s=>{t||(t=1e3),i||(i=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,i),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let r=this._cameraControl.getCamera().clone();r instanceof THREE.PerspectiveCamera&&(r.aspect=t/i,r.updateProjectionMatrix()),this._lightSetting.removeFromScene();let n=new C(this._scene);e.render(this._scene,r);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{s({image:a,width:t,height:i,blob:e})},"image/png"),n.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,i,s){if(this._cameraControl instanceof R){let r=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(r,e,t,i,s),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),l(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}return n([a],e.prototype,"_glbInputManager",void 0),n([a],e.prototype,"_rapiAccess",void 0),e})();class x{constructor(e,t,i){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=i,this._renderer.setSize(t,i),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let i=this._entries.indexOf(e);i>-1&&this._entries.splice(i,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}let H=(()=>{class e{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(d,{id:"gltf-loader"}),i=this._scriptLoader.fetch(_,{id:"draco-loader"}),s=this._scriptLoader.fetch(b,{id:"tween-js"});Promise.all([t,i,s]).then(()=>{this._sceneManager=new T(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const i=()=>{this._sceneManager.enableHD(),e()};Promise.all(S.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(v,{id:"pi-js"}).then(i,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,i){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),i)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,i=320){let s=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new x(this._sceneManager,t,i);e.addListener(this._sceneManager),e.start(s.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let i=document.createElement("a");i.href=URL.createObjectURL(t),i.download="content.zip",i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}}return n([a],e.prototype,"_rapiAccess",void 0),n([a],e.prototype,"_domHelper",void 0),n([a],e.prototype,"_scriptLoader",void 0),n([a],e.prototype,"_lifeCycleManager",void 0),n([a],e.prototype,"_threeLoader",void 0),n([a],e.prototype,"_initData",void 0),n([a],e.prototype,"_globalInitData",void 0),e})();e("GlbViewer",class extends L{setupGlobals(){}setupDependencies(){m.setup(M),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new H(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
-
//# sourceMappingURL=glb-viewer-5dcdda0a.legacy.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./rapi-access-ef758fca.legacy.js","./main-thread-to-worker-880d5b78.legacy.js","./pixotron-cd4cd438.legacy.js","./default-light-setting-14b03f67.legacy.js"],(function(e){var t,n,r,i,o,a,s,l,c,d,h,u,_,p,g,b,m,E,f,C,y,P,R,j,w,O,H,M,v;return{setters:[function(e){t=e.U,n=e.T,r=e.J,i=e.V,o=e.e,a=e.W,s=e.O,l=e.X,c=e.Q,d=e.Y,h=e.Z,u=e._,_=e.i,p=e.$,g=e.C,b=e.B,m=e.E,E=e.M,f=e.a0,C=e.s,y=e.j,P=e.a1,R=e.a2,j=e.t,w=e.h},function(e){O=e.f},function(e){H=e.E,M=e.L},function(e){v=e.D}],execute:function(){e("G","static/GLTFExporter-86edae059df3a219.js"),e("C",class extends t{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,r)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,r)=>{},this.onUserInitiatedDockDone=(e,t,n,r,i)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{}}});class x{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class I extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new x;const t=n(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(this.getSize(),e.customColor),r(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){this._container.position.copy(n(this.getPlanElement().getCenter()))}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e=new THREE.Box3;return e.setFromObject(this._container),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=i(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){o(this._container),this._selectionMesh&&o(this._selectionMesh)}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=a())}_generateBoundingBox(e,t){e.addScalar(.01);let n=new THREE.BoxGeometry(e.x,e.y,e.z),r=new THREE.Color(s);t>0&&(r=l(t));let i=new THREE.MeshStandardMaterial({color:r,opacity:c,transparent:!0}),o=new THREE.Mesh(n,i);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(5),o}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:c,transparent:!0});const t=n(this.getPlanElement().getCenter());this._selectionMesh=new THREE.Mesh(d(t,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class T extends I{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return h(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class k extends T{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}}e("d",k);let L=e("c",(()=>{class e extends T{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}_addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();this._glbUrl=O(e);let n=e.scaleable?h(t.size):void 0,i=new THREE.Vector3(1,1,1);return t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1),new Promise(o=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),p(t,this._glbUrl),r(t),this._container.add(this.getObject()),this.hidePreviewBox(),o()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return u([_],e.prototype,"_staticItemLoader",void 0),e})());class D extends I{constructor(e){super(e),this._container.name="Wall Plan Element"}addMesh(e){super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}}class S extends I{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}class B extends I{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}let V=e("P",(()=>{class e extends g{constructor(e){super(e,0),this._plannerKernelCallbackListener=new Set,b.addMeta("kernel_is_ready",{isWasm:this._useWASM}),this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}get kernelContainer(){return this._kernelContainer}_loadSuccess(){window.RoomleCore(this._kernelContainer)}_loadError(){console.error("kernel load error")}_createPlanInteractionHandler(){const e=this._kernelContainer;this._planInteractionHandler=new e.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,100,!0,!0,e.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._createPlanInteractionHandler();const e=this._planInteractionHandler.getConfiguratorKernel();this._kernelInstance=e,this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),m.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady(),this._kernelInstance.useEnvironmentGeometry(!1)}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let r=0;r<n;r++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))}),this._planInteractionHandler.addPlanObjects(t);const n=this._planInteractionHandler.getPlan().extRef.jsObject;await Promise.all(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}}))}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}onLoadComponentError(e,t){}configurationLoaded(e,t,n,r,i){}componentDefinitionLoaded(e,t){}componentDefinitionLoadingError(e,t){}configurationLoadingError(){}componentConfigurationUpdated(e){}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){}planObjectUpdated(e){}planObjectConfigurationUpdated(e,t,n){}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){super.cleanUpCallbacks(),this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){super.registerCallbacks(),this._kernelContainer.registerPlannerCallback(this)}async requestExternalMesh(e,t){let n;try{n=await this._rapiAccess.getMesh(e,E,t)}catch(e){throw console.error(e),e}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(n.url,!0))),i=await r.arrayBuffer();await this._handleCortoMesh(i,e,t)}catch(e){throw console.error(e),e}}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dPlanObjectConstructionDone(e){}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){}Editor3dSetPreviewPointAssociations(e,t){}Editor3dSetPreviewLineAssociations(e,t){}Editor3dPreviewConstructionDone(e,t){}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){if(this._decoupleReferences(e),t){let e=new U(this._creator_);e.setReference(t),this._coupleReferences(e,t),this._plannerKernelCallbackListener.forEach(t=>t.handlerSwitchedPlans(e))}}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT){let n,r=t;if(r.hasConfiguration())n=new k(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);else{n=new L(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);const i=t.getCatalogItemId();i&&this._rapiAccess.getItem(i).then(e=>{n.setRapiItem(e)})}this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{let n,r=t;if(t.getType()===this._kernelContainer.PlanElementType.WALL?n=new D(r):t.getType()===this._kernelContainer.PlanElementType.FLOOR?n=new S(r):t.getType()===this._kernelContainer.PlanElementType.CEILING&&(n=new B(r)),!n)return;n.setPrimaryColor(this._initData.colors.PRIMARY),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n),this.planModelViewHelper.requestMesh3d(t)}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible())}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(r=>r.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){}stoppedDrawing(){}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,r,i,o){this._plannerKernelCallbackListener.forEach(a=>a.addMesh(e,t,n,r,i,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,i,o,a){this._plannerKernelCallbackListener.forEach(s=>s.addPlanMesh(e,t,n,r,i,o,a))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}addPlanObjectFromItem(e,t,n){if(!t&&!n)return this.insertItems([e]);n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const r=this._rapiItemToKernelItem(e);return this._planInteractionHandler.addPlanObjectFromItem(r,t,n)}_coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}}return u([_],e.prototype,"_kernelAccessCallback",void 0),u([_],e.prototype,"_roomlePlannerUiCallback",void 0),u([_],e.prototype,"_initData",void 0),e})()),U=(()=>{class e extends f{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionGroup=new THREE.Group,this._constructionGroup.name="Construction",this._ceilingGroup=new THREE.Group,this._getKernelAccess().addPlannerListener(this)}planBoundsChanged(){}_getKernelAccess(){return C.lookup("planner-kernel-access",this._creator_)}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null,super.clearReference()}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){e instanceof k?this._configurablePlanObjectViewModels.push(e):e instanceof L?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof D?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):(e instanceof S||e instanceof B)&&this._constructionGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof k&&(t.addRootComponent(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(t),t.hidePreviewBox())}_getPlanObjectViewModelForRuntimeId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getConfigurationRuntimeId()&&(t=n)}),t}getPlanObjectForId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),this._staticPlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),t}getConstructionGroup(){return this._constructionGroup}getCeilingGroup(){return this._ceilingGroup}getBoundingBox(){const e=this.getCorePlan();return e?y(e.getBounds()):(new THREE.Box3).setFromObject(this._constructionGroup)}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}sceneCleared(){this._configurablePlanObjectViewModels.forEach(e=>{e.clear()}),this._staticPlanObjectViewModels.forEach(e=>{e.clear()}),super.sceneCleared()}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getComponent(e){return this._components.get(e)}_generateMesh(e=0,t=null,n,r,i,o,a,s,l){return this._plannerMeshGenerator.generateMesh(t,n,r,i,o,a,s,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,r,i){super.Editor3dComponentCreated(e,t,n,r,i),this._getKernelAccess()instanceof V&&this.dockComponent(e,r,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e){this._constructionGroup.clear(),this._ceilingGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,r,i,o,a){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,r,i,o){const a=e.extRef.jsObject;let s=a.getMesh(t);s?s.geometry=this._plannerMeshGenerator.generateGeometry(null,n,r,i,o):(s=this._generateMesh(0,null,t,n,r,i,o,e.getType()),a.addMesh(s))}removePlanObjectFromScene(e){}planElementRemoved(e){if(e.getType()===this._getKernelAccess().kernelContainer.PlanElementType.OBJECT){let t=e;if(t.hasConfiguration()){const e=t.extRef.jsObject,n=this._configurablePlanObjectViewModels.indexOf(e);n>-1&&this._configurablePlanObjectViewModels.splice(n,1)}else{const e=t.extRef.jsObject,n=this._staticPlanObjectViewModels.indexOf(e);n>-1&&this._staticPlanObjectViewModels.splice(n,1)}}}getMeshGenerator(){return this._plannerMeshGenerator}}return u([_],e.prototype,"_plannerMeshGenerator",void 0),e})();const A=j(30);class G extends H{constructor(e,t,n,r){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===r?1:r,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.enableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new THREE.Plane(new THREE.Vector3(0,1,0)),this._planeFront=new THREE.Plane(new THREE.Vector3(0,0,1)),this._planeSide=new THREE.Plane(new THREE.Vector3(1,0,0))}setLayers(e){this._raycaster.layers=e}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(6,e=>{this._findHover(e.positionRelative,e.type)},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){this._intersection(e)&&this._inputManager.onElementHit()}_findSelection(e){let t=this._intersection(e);t?t&&t.object.dispatchEvent({type:"select"}):this.dispatchEvent(3)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(e,this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(e,this._camera);let t,n=new THREE.Vector3(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,r=new THREE.Vector3(0,0,0),i=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,r),this._raycaster.ray.intersectPlane(this._planeSide,i);let o,a=this._getDistanceToCamera(i),s=this._getDistanceToCamera(r);return n>=-A&&n<=A?o=t<s?e.clone():r.clone():t<s&&t<a?o=e.clone():s<t&&s<a?o=r.clone():a<t&&a<s&&(o=i.clone()),o}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return P(e)&&(t=Number.POSITIVE_INFINITY),t}_onDragEnd(e){this._currentDrag&&(this._currentDrag.dispatchEvent({type:"drag_end",attachment:{position:e}}),this._currentDrag=null)}_onRotate(e,t){if(!this._currentRotate){let t=this._intersection(e);if(!t)return;this._currentRotate=t.object}this._currentRotate.dispatchEvent({type:"rotate",attachment:{rotation:t}})}_positionPlanes(e){0===this._mode?(this._planeBottom.constant=0,this._camera.userData&&this._camera.userData.pitch&&this._camera.userData.pitch<0&&(this._planeBottom.constant=-3)):e&&e.boundingBox&&this._rootComponentPosition&&(this._planeBottom.constant=-e.boundingBox.getCenter(new THREE.Vector3).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new THREE.Vector3).x+e.boundingBox.getCenter(new THREE.Vector3).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new THREE.Vector3).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new THREE.Vector3)),this._offset.applyQuaternion(e.getWorldQuaternion(new THREE.Quaternion)))}update(e,t,n){if(e&&(this._bounds=e),t&&(this._rootComponentPosition=t),n){this._backgroundScene=n;let e=this._backgroundScene.children[0];e instanceof THREE.Mesh&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&R(this._currentDrag),this._currentHover&&R(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}e("S",class extends H{constructor(e,t,n,r){super(),this._debug=!1,this._dragIn=!1,this._inputManager=r,this._raycastHelper=new G(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}});class K extends M{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),1.2),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!1}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=w();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new THREE.Color(e))}}}let z=null;const F=()=>(z||(z=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),z.outputEncoding=THREE.sRGBEncoding),z.autoClear=!0,z),W=(e("g",(e,t=0)=>{if(!e){const e=new THREE.Vector3;return{center:e,bounds:e,diagonal:0}}const n=e.getSize(new THREE.Vector3);return n.addScalar(t),{center:e.getCenter(new THREE.Vector3),bounds:n,diagonal:Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)+Math.pow(n.z,2))}}),e("a",(e,t,n,r,i={})=>new Promise(o=>{const{size:a=1024,showDimensions:s}=i,l=F();l.setSize(a,a);const c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=new v(e);n.layers.disable(2),n.layers.disable(5),s?n.layers.enable(7):n.layers.disable(7),W(n,r,-20,-30),l.render(e,n),t&&(l.autoClear=!1,l.clearDepth(),l.render(t,n));const u=l.domElement.toDataURL();n.layers.enable(2),e.background=d,e.fog=c,h.removeFromScene(),o({image:u,width:a,height:a,blob:null})})),e("r",(e,t,n,r,i,o)=>new Promise(r=>{o||(o=1024);const i=F();i.setSize(o,o);const a=e.fog?e.fog.clone():null,s=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(5),n?W(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),i.render(e,t);const l=i.domElement.toDataURL();t.layers.enable(2),e.background=s,e.fog=a,r({image:l,width:o,height:o,blob:null})})),e("p",(e,t,n,r)=>{e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(j(r)),e.rotateX(j(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()}));e("b",(e,t,n,r={})=>{const{showDimensions:i=!1}=r;return new Promise(r=>{const o=F();o.autoClear=!1;let a=new THREE.OrthographicCamera(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);a.position.copy(n.center),a.rotateX(j(-90)),a.translateZ(n.bounds.y+1),a.far=a.position.y+.5,a.layers.mask=65535;let s=200*n.bounds.x,l=200*n.bounds.z;if(s>4096||l>4096){let e=0;s>4096?e=s/4096:l>4096&&(e=l/4096),s/=e,l/=e}o.setSize(s,l);let c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=i?new K(e):new v(e);a.layers.disable(2),a.layers.disable(5),i?a.layers.enable(7):a.layers.disable(7),o.render(e,a),t&&(o.clearDepth(),o.render(t,a));let u=o.domElement.toDataURL();a.layers.enable(2),a.layers.enable(5),e.background=d,e.fog=c,h.removeFromScene(),r({image:u,width:s,height:l,blob:null})})})}}}));
|
|
2
|
-
//# sourceMappingURL=image-renderer-0f532f9c.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main-thread-to-worker-880d5b78.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-viewer-41e5c677.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-generator-4f2f2ec7.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scene-manager-afd27798.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
Binary file
|
|
Binary file
|