@roomle/web-sdk 2.31.0-alpha.2 → 2.31.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-95bb0a36.nomodule.js → banana-for-scale-c6030e54.nomodule.js} +2 -2
- package/lib/{banana-for-scale-95bb0a36.nomodule.js.map → banana-for-scale-c6030e54.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-c62bb269.js → banana-for-scale-ecc6400f.js} +2 -2
- package/lib/{banana-for-scale-c62bb269.js.map → banana-for-scale-ecc6400f.js.map} +1 -1
- package/lib/{budgeteer-measure-8cfea554.js → budgeteer-measure-700b4d27.js} +2 -2
- package/lib/{budgeteer-measure-8cfea554.js.map → budgeteer-measure-700b4d27.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/{component-dimensioning-032b19a5.nomodule.js → component-dimensioning-22c684c5.nomodule.js} +2 -2
- package/lib/component-dimensioning-22c684c5.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-231c9af2.js → component-dimensioning-c3e374eb.js} +2 -2
- package/lib/component-dimensioning-c3e374eb.js.map +1 -0
- package/lib/configurator-0c2db2a8.nomodule.js +2 -0
- package/lib/{configurator-08e58911.nomodule.js.map → configurator-0c2db2a8.nomodule.js.map} +1 -1
- package/lib/configurator-88bbf86b.js +2 -0
- package/lib/{configurator-3570c605.js.map → configurator-88bbf86b.js.map} +1 -1
- package/lib/configurator-main-61040002.js +2 -0
- package/lib/configurator-main-61040002.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/configurator-mesh-generator-5b153bdd.nomodule.js +2 -0
- package/lib/configurator-mesh-generator-5b153bdd.nomodule.js.map +1 -0
- package/lib/configurator-mesh-generator-d945c432.js +2 -0
- package/lib/configurator-mesh-generator-d945c432.js.map +1 -0
- package/lib/{default-light-setting-86b8760c.nomodule.js → default-light-setting-0d73db9a.nomodule.js} +2 -2
- package/lib/default-light-setting-0d73db9a.nomodule.js.map +1 -0
- package/lib/{default-light-setting-88521da5.js → default-light-setting-68f26594.js} +2 -2
- package/lib/default-light-setting-68f26594.js.map +1 -0
- package/lib/definitions/common-core/mock/kernel-instances.d.ts +4 -1
- package/lib/definitions/common-core/src/kernel-access.d.ts +4 -10
- package/lib/definitions/common-core/src/services/common-kernel-access.d.ts +18 -2
- package/lib/definitions/common-core/src/webgl/layer.d.ts +2 -1
- package/lib/definitions/configurator-core/mock/configurator-mock-data.d.ts +1 -0
- package/lib/definitions/planner-core/src/roomle-planner.d.ts +30 -2
- package/lib/definitions/planner-core/src/services/planner-kernel-access.d.ts +0 -1
- package/lib/definitions/planner-core/src/view-model/node-plan-element-view-model.d.ts +6 -0
- package/lib/definitions/planner-core/src/view-model/plan-view-model.d.ts +6 -1
- package/lib/definitions/planner-core/src/view-model/wall-plan-element-view-model.d.ts +1 -0
- package/lib/definitions/typings/kernel.d.ts +4 -1
- package/lib/definitions/typings/planner.d.ts +16 -0
- package/lib/{dimensioning-helper-55aa9709.js → dimensioning-helper-45d0d956.js} +2 -2
- package/lib/{dimensioning-helper-55aa9709.js.map → dimensioning-helper-45d0d956.js.map} +1 -1
- package/lib/{dimensioning-helper-c69b5012.nomodule.js → dimensioning-helper-5169193f.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-c69b5012.nomodule.js.map → dimensioning-helper-5169193f.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-75d1de15.js → glb-viewer-c70beada.js} +2 -2
- package/lib/{glb-viewer-75d1de15.js.map → glb-viewer-c70beada.js.map} +1 -1
- package/lib/{glb-viewer-1482553f.nomodule.js → glb-viewer-f7fd754c.nomodule.js} +2 -2
- package/lib/{glb-viewer-1482553f.nomodule.js.map → glb-viewer-f7fd754c.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-803f6c67.js +2 -0
- package/lib/glb-viewer-main-803f6c67.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/image-renderer-90ccc20e.nomodule.js +2 -0
- package/lib/{image-renderer-52bbd908.nomodule.js.map → image-renderer-90ccc20e.nomodule.js.map} +1 -1
- package/lib/image-renderer-f1b6a0cf.js +2 -0
- package/lib/{image-renderer-757a6907.js.map → image-renderer-f1b6a0cf.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-0854a7dc.legacy.js → banana-for-scale-2c7e61df.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-0854a7dc.legacy.js.map → banana-for-scale-2c7e61df.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/{component-dimensioning-aaa05dd4.legacy.js → component-dimensioning-30d883f2.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-30d883f2.legacy.js.map +1 -0
- package/lib/legacy/configurator-3c9aa61c.legacy.js +2 -0
- package/lib/legacy/{configurator-21c32b82.legacy.js.map → configurator-3c9aa61c.legacy.js.map} +1 -1
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/configurator-mesh-generator-1062fffa.legacy.js +2 -0
- package/lib/legacy/configurator-mesh-generator-1062fffa.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-d6e9de1f.legacy.js → default-light-setting-684f437b.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-684f437b.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-3878022f.legacy.js → dimensioning-helper-d3639e7d.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-3878022f.legacy.js.map → dimensioning-helper-d3639e7d.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-056c11ee.legacy.js → glb-viewer-84c78e6f.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-056c11ee.legacy.js.map → glb-viewer-84c78e6f.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/image-renderer-526f1625.legacy.js +2 -0
- package/lib/legacy/{image-renderer-9a6a67fc.legacy.js.map → image-renderer-526f1625.legacy.js.map} +1 -1
- package/lib/legacy/{main-thread-to-worker-4c02f179.legacy.js → main-thread-to-worker-fb98950d.legacy.js} +2 -2
- package/lib/legacy/main-thread-to-worker-fb98950d.legacy.js.map +1 -0
- package/lib/legacy/{material-viewer-7a17728a.legacy.js → material-viewer-004b210b.legacy.js} +2 -2
- package/lib/legacy/material-viewer-004b210b.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/mesh-generator-b8345f3e.legacy.js +2 -0
- package/lib/legacy/mesh-generator-b8345f3e.legacy.js.map +1 -0
- package/lib/legacy/{pixotron-b2477d2d.legacy.js → pixotron-b7f25843.legacy.js} +2 -2
- package/lib/legacy/{pixotron-b2477d2d.legacy.js.map → pixotron-b7f25843.legacy.js.map} +1 -1
- package/lib/legacy/planner-7cf4e52a.legacy.js +2 -0
- package/lib/legacy/{planner-7afba417.legacy.js.map → planner-7cf4e52a.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/rapi-access-34b1ce17.legacy.js +16 -0
- package/lib/legacy/{rapi-access-990628ad.legacy.js.map → rapi-access-34b1ce17.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/static/ConfiguratorKernel-7756e36b06f7bf28.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernel-b3f9bde09ca9cb82.js +121 -0
- package/lib/legacy/static/ConfiguratorKernelJs-79cc0493453b6298.mem +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-f63bcabaeb5c2d42.js +143 -0
- package/lib/legacy/static/RoomleCore-5f8e907bc2dc0222.wasm +0 -0
- package/lib/legacy/static/RoomleCore-c036b1e6afc8afc5.js +129 -0
- package/lib/legacy/static/RoomleCoreJs-06aa24e348172ab6.mem +0 -0
- package/lib/legacy/static/RoomleCoreJs-c5865e6e3207c3f1.js +151 -0
- package/lib/legacy/static/shaders-fae3c3c610b4a3d8.json +1 -0
- package/lib/legacy/{stats-helper-12f49aa1.legacy.js → stats-helper-c509b532.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-12f49aa1.legacy.js.map → stats-helper-c509b532.legacy.js.map} +1 -1
- package/lib/{main-thread-to-worker-4fc95d50.nomodule.js → main-thread-to-worker-97315397.nomodule.js} +2 -2
- package/lib/main-thread-to-worker-97315397.nomodule.js.map +1 -0
- package/lib/{main-thread-to-worker-5447c1c5.js → main-thread-to-worker-9d399850.js} +2 -2
- package/lib/main-thread-to-worker-9d399850.js.map +1 -0
- package/lib/{material-viewer-37019048.js → material-viewer-48033bdf.js} +2 -2
- package/lib/material-viewer-48033bdf.js.map +1 -0
- package/lib/{material-viewer-b01a3995.nomodule.js → material-viewer-543e6a18.nomodule.js} +2 -2
- package/lib/material-viewer-543e6a18.nomodule.js.map +1 -0
- package/lib/material-viewer-main-fff0bfb8.js +2 -0
- package/lib/material-viewer-main-fff0bfb8.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/mesh-generator-0840e6a4.nomodule.js +2 -0
- package/lib/mesh-generator-0840e6a4.nomodule.js.map +1 -0
- package/lib/mesh-generator-9fe4238a.js +2 -0
- package/lib/mesh-generator-9fe4238a.js.map +1 -0
- package/lib/{pixotron-76665c10.js → pixotron-42da5ecd.js} +2 -2
- package/lib/{pixotron-76665c10.js.map → pixotron-42da5ecd.js.map} +1 -1
- package/lib/{pixotron-c033394c.nomodule.js → pixotron-a91b119f.nomodule.js} +2 -2
- package/lib/{pixotron-c033394c.nomodule.js.map → pixotron-a91b119f.nomodule.js.map} +1 -1
- package/lib/planner-77d66f6f.js +2 -0
- package/lib/{planner-5cbf6167.js.map → planner-77d66f6f.js.map} +1 -1
- package/lib/planner-9ebb0e5a.nomodule.js +2 -0
- package/lib/{planner-59a8e189.nomodule.js.map → planner-9ebb0e5a.nomodule.js.map} +1 -1
- package/lib/planner-main-25450000.js +2 -0
- package/lib/planner-main-25450000.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/rapi-access-47da54bc.nomodule.js +16 -0
- package/lib/{rapi-access-6a614458.nomodule.js.map → rapi-access-47da54bc.nomodule.js.map} +1 -1
- package/lib/rapi-access-e495e6e8.js +16 -0
- package/lib/{rapi-access-21338f5f.js.map → rapi-access-e495e6e8.js.map} +1 -1
- package/lib/{roomle-sdk-6b970f8f.js → roomle-sdk-05d11281.js} +2 -2
- package/lib/roomle-sdk-05d11281.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/static/ConfiguratorKernel-7756e36b06f7bf28.wasm +0 -0
- package/lib/static/ConfiguratorKernel-b3f9bde09ca9cb82.js +1 -0
- package/lib/static/ConfiguratorKernel-b3f9bde09ca9cb82.js.map +1 -0
- package/lib/static/ConfiguratorKernelJs-79cc0493453b6298.mem +0 -0
- package/lib/static/ConfiguratorKernelJs-f63bcabaeb5c2d42.js +143 -0
- package/lib/static/RoomleCore-5f8e907bc2dc0222.wasm +0 -0
- package/lib/static/RoomleCore-c036b1e6afc8afc5.js +1 -0
- package/lib/static/RoomleCore-c036b1e6afc8afc5.js.map +1 -0
- package/lib/static/RoomleCoreJs-06aa24e348172ab6.mem +0 -0
- package/lib/static/RoomleCoreJs-c5865e6e3207c3f1.js +151 -0
- package/lib/static/shaders-fae3c3c610b4a3d8.json +1 -0
- package/lib/{stats-helper-37bc8127.nomodule.js → stats-helper-8524efea.nomodule.js} +2 -2
- package/lib/{stats-helper-37bc8127.nomodule.js.map → stats-helper-8524efea.nomodule.js.map} +1 -1
- package/lib/{stats-helper-50118506.js → stats-helper-ffd1bff9.js} +2 -2
- package/lib/{stats-helper-50118506.js.map → stats-helper-ffd1bff9.js.map} +1 -1
- package/package.json +2 -2
- package/lib/component-dimensioning-032b19a5.nomodule.js.map +0 -1
- package/lib/component-dimensioning-231c9af2.js.map +0 -1
- package/lib/configurator-08e58911.nomodule.js +0 -2
- package/lib/configurator-3570c605.js +0 -2
- package/lib/configurator-main-d4562587.js +0 -2
- package/lib/configurator-main-d4562587.js.map +0 -1
- package/lib/configurator-mesh-generator-a69ff1e4.nomodule.js +0 -2
- package/lib/configurator-mesh-generator-a69ff1e4.nomodule.js.map +0 -1
- package/lib/configurator-mesh-generator-ed7f42a4.js +0 -2
- package/lib/configurator-mesh-generator-ed7f42a4.js.map +0 -1
- package/lib/default-light-setting-86b8760c.nomodule.js.map +0 -1
- package/lib/default-light-setting-88521da5.js.map +0 -1
- package/lib/glb-viewer-main-ee2c73a8.js +0 -2
- package/lib/glb-viewer-main-ee2c73a8.js.map +0 -1
- package/lib/image-renderer-52bbd908.nomodule.js +0 -2
- package/lib/image-renderer-757a6907.js +0 -2
- package/lib/legacy/component-dimensioning-aaa05dd4.legacy.js.map +0 -1
- package/lib/legacy/configurator-21c32b82.legacy.js +0 -2
- package/lib/legacy/configurator-mesh-generator-62f318f2.legacy.js +0 -2
- package/lib/legacy/configurator-mesh-generator-62f318f2.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-d6e9de1f.legacy.js.map +0 -1
- package/lib/legacy/image-renderer-9a6a67fc.legacy.js +0 -2
- package/lib/legacy/main-thread-to-worker-4c02f179.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-7a17728a.legacy.js.map +0 -1
- package/lib/legacy/mesh-generator-f2c8bb17.legacy.js +0 -2
- package/lib/legacy/mesh-generator-f2c8bb17.legacy.js.map +0 -1
- package/lib/legacy/planner-7afba417.legacy.js +0 -2
- package/lib/legacy/rapi-access-990628ad.legacy.js +0 -16
- package/lib/legacy/static/ConfiguratorKernel-1814e60dbe690ae6.js +0 -121
- package/lib/legacy/static/ConfiguratorKernel-cbbc9ab4c6a45a73.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-4aa196fbd2db1290.js +0 -143
- package/lib/legacy/static/ConfiguratorKernelJs-83da6e4b5a0e6868.mem +0 -0
- package/lib/legacy/static/RoomleCore-1682cd0bfe5c84db.wasm +0 -0
- package/lib/legacy/static/RoomleCore-cf5eb8ac9b418bb8.js +0 -130
- package/lib/legacy/static/RoomleCoreJs-1a283c23fa3f057e.js +0 -152
- package/lib/legacy/static/RoomleCoreJs-c0e10f71d1afdef5.mem +0 -0
- package/lib/legacy/static/shaders-47c5850937e0536d.json +0 -1
- package/lib/main-thread-to-worker-4fc95d50.nomodule.js.map +0 -1
- package/lib/main-thread-to-worker-5447c1c5.js.map +0 -1
- package/lib/material-viewer-37019048.js.map +0 -1
- package/lib/material-viewer-b01a3995.nomodule.js.map +0 -1
- package/lib/material-viewer-main-9b09cbb2.js +0 -2
- package/lib/material-viewer-main-9b09cbb2.js.map +0 -1
- package/lib/mesh-generator-106a6ce1.nomodule.js +0 -2
- package/lib/mesh-generator-106a6ce1.nomodule.js.map +0 -1
- package/lib/mesh-generator-df801dc9.js +0 -2
- package/lib/mesh-generator-df801dc9.js.map +0 -1
- package/lib/planner-59a8e189.nomodule.js +0 -2
- package/lib/planner-5cbf6167.js +0 -2
- package/lib/planner-main-8933f5be.js +0 -2
- package/lib/planner-main-8933f5be.js.map +0 -1
- package/lib/rapi-access-21338f5f.js +0 -16
- package/lib/rapi-access-6a614458.nomodule.js +0 -16
- package/lib/roomle-sdk-6b970f8f.js.map +0 -1
- package/lib/static/ConfiguratorKernel-1814e60dbe690ae6.js +0 -1
- package/lib/static/ConfiguratorKernel-1814e60dbe690ae6.js.map +0 -1
- package/lib/static/ConfiguratorKernel-cbbc9ab4c6a45a73.wasm +0 -0
- package/lib/static/ConfiguratorKernelJs-4aa196fbd2db1290.js +0 -143
- package/lib/static/ConfiguratorKernelJs-83da6e4b5a0e6868.mem +0 -0
- package/lib/static/RoomleCore-1682cd0bfe5c84db.wasm +0 -0
- package/lib/static/RoomleCore-cf5eb8ac9b418bb8.js +0 -1
- package/lib/static/RoomleCore-cf5eb8ac9b418bb8.js.map +0 -1
- package/lib/static/RoomleCoreJs-1a283c23fa3f057e.js +0 -152
- package/lib/static/RoomleCoreJs-c0e10f71d1afdef5.mem +0 -0
- package/lib/static/shaders-47c5850937e0536d.json +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./rapi-access-990628ad.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./image-renderer-9a6a67fc.legacy.js","./pixotron-b2477d2d.legacy.js","./mesh-generator-f2c8bb17.legacy.js","./configurator-mesh-generator-62f318f2.legacy.js","./default-light-setting-d6e9de1f.legacy.js"],(function(e,t){var n,i,o,r,s,a,c,l,h,d,u,_,g,p,m,f,C,v,y,b,I,w,k,P,S,E,M,H,D,R,A,O,L,x,T,U,V,j,B,F,G,q,z,K,N,W,Q,J,X,$,Y,Z,ee,te,ne,ie,oe,re;return{setters:[function(e){n=e._,i=e.i,o=e.C,r=e.B,s=e.A,a=e.a,c=e.D,l=e.b,h=e.k,d=e.E,u=e.c,_=e.M,g=e.g,p=e.d,m=e.e,f=e.P,C=e.f,v=e.h,y=e.t,b=e.j,I=e.R,w=e.l,k=e.m,P=e.n,S=e.L,E=e.o,M=e.p,H=e.q,D=e.r,R=e.s},function(e){A=e.o,O=e.g,L=e.r,x=e.t},function(e){T=e.S,U=e.p,V=e.a,j=e.r,B=e.g,F=e.b,G=e.G,q=e.C},function(e){z=e.E,K=e.I,N=e.S,W=e.B,Q=e.a,J=e.F,X=e.C,$=e.b,Y=e.c,Z=e.P,ee=e.T,te=e.d,ne=e.M},function(e){ie=e.P},function(e){oe=e.C},function(e){re=e.D}],execute:function(){const se=function(e){return e.validRange&&"string"==typeof e.validRange.type},ae=function(e){return e.validValues&&e.validValues.length>0},ce=function(e){return"length"===e.unitType||"area"===e.unitType},le=function(e){return"Material"===e.type};let he={InchFeet:null,MM:null,CM:null},de={NoUnitString:null,LongUnitString:null,ShortUnitString:null},ue=(()=>{class e{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;he=e.Unit,de=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===he.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===he.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=he.CM;break;case"mm":this._actualUnit=he.MM;break;case"inchfeet":this._actualUnit=he.InchFeet;break;default:this._actualUnit=he.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=de.NoUnitString;break;case"long":this._actualUnitStringType=de.LongUnitString;break;case"short":this._actualUnitStringType=de.ShortUnitString;break;default:this._actualUnitStringType=de.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){ce(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(ce(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),le(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(se(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 ae(e)?(e.uiType="Options",function(e){return!!ae(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===he.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 _e=["material"];let ge=(()=>{class e extends o{constructor(e){super(e,1),this.externalMeshQueue=new ie,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{},r.addMeta("kernel_is_ready",{isWasm:this._useWASM}),s.kernelInstance?(this._kernelContainer=s.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){r.start("kernel_is_ready"),s.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,o=[];e&&e.forEach(e=>{let r=this._kernelInstance.getComponent(e);r.componentId=this._kernelInstance.getComponentId(e),r&&r.childIds&&r.childIds.length>0&&(n=!0),r.id===t&&(i=!0),o.push(r)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",i,n,o)}_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 o=this._kernelInstance.getComponentId(n),r=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,i,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(o,i,r,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,i=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),o=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),a.finishOperation(3,[o,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(c,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(c,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(l,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,i,o,r){"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,o,r),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,i,o,r){"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,o,r),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,i,o,r){"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,o,r)}_finishParameterChange(e,t,n){-1===_e.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=h(n);return i&&(e.set(i,n),t.push(i)),t},[]);return new Promise((i,o)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return o(new Error("prices are empty"));const r=A(n,"priceId");let s=0;return t.fullList.forEach(e=>{const t=h(e);if(!r.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:i}=r.get(t);e.price=n,e.currencySymbol=i,s+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,s),i({totalSum:s,partMap:e})},e=>{console.error(e),o(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,o=e.perMainComponent;let r;this.addUiDataToPartList(n,t);try{const e=await this._calcPrice();r=e.partMap}catch(e){console.error(e),r=new Map}const s=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{s||(e.price=null,e.currencySymbol=null);const t=h(e);if(!t)return;if(!r.has(t))return;const{price:n,currencySymbol:i}=r.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=i)};return n.forEach(a),o.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:o,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),le(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,o=e;t&&(i=this._kernelInstance.getComponentParameters,o=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(i.apply(this._kernelInstance,[o]))})}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(),r.end("kernel_is_ready"),r.start("kernel_create_instance"),s.kernelInstance?this._kernelInstance=s.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,this._kernelContainer.registerConfiguratorCallback(this),r.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:u}),this._kernelInstance.setEnvironmentVariable("language",t),this._unitFormatter.init(this._kernelContainer),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),s.planObjectId&&this.planObjectCreated(-1,s.planObjectId),this._kernelInstance.useEnvironmentGeometry(!0)}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,o){a.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:u(o)}),this._configuratorKernelCallbackListener.forEach(r=>r.configurationLoaded(e,t,n,i,o))}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=u(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 o=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(o),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 o;this.externalMeshQueue.push(i);try{o=await this._rapiAccess.getMesh(e,_,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(o.url,!0))),r=await i.arrayBuffer();this._handleCortoMesh(r,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(o=>o.Editor3dComponentCreated(e,t,n,i,!1)),i&&i>0&&this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentDocked(e,i,t,n))}Editor3dRootComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(o=>o.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),r.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 pe{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}}class me{constructor(e){const{component:t,preview:n,resetCamera:i,consecutive:o,type:r,forceRender:s}=e;this.component=t,this.preview=n,this.resetCamera=void 0===i||i,this.consecutive=void 0===o||o,this.type=r||0,this.forceRender=void 0!==s&&s}}let fe=(()=>{class e extends T{constructor(e,t,n,i){super(e,t,n,i),this._cameraMoving=!1,this._raycastHelper.addEventListener(3,()=>{this._clickOutside()},this),this._selectionHandler.addEventListener(0,({component:e,consecutive:t})=>{this.dispatchEvent(8,new me({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 me({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.runtimeId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:2,roomleId:e.runtimeId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.runtimeId}),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.runtimeId},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.runtimeId},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 me({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new me({preview:e}))}clickComponent(e){this._debug&&e.runtimeId,this._selectionHandler.check(e)}_clickOutside(){this._selectionHandler.cancelSelection(),this.dispatchEvent(3),this._interaction()}_hoverOn(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOn(),this._interaction(),this.dispatchEvent(1,new me({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new me({component:e,type:t})),this._hoveredComponent=null)}_hoverOnPreview(e){e.hoverOn(),this._interaction(!0),this._hoveredPreview=e}_hoverOffPreview(e){e.hoverOff(),this._interaction(!0),this._hoveredPreview=null}_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 me({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 me({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 me({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new me({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 Ce extends z{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),o=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(i,o),this._clientWidth=t,this._clientHeight=n;let r=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(r.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new THREE.Vector3(r.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 ve=(()=>{class e extends N{constructor(e,t){super(e,t,p.HSC,"3D"),this._configuratorViewModel.setListener(this),this._sceneEventHandler=new fe(this._creator_,this._scene,this._camera,this._configuratorInputManager),this._sceneEventHandler.addEventListener(0,({forceRender:e})=>{this._uiIntersectionHelper.calculateUIIntersection(),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.runtimeId),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._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._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 Pe}));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,o=!0){e&&(this._sceneEventHandler.setDragIn(!1),this._configuratorViewModel.removeDockingComponent(),t&&this._scene.remove(t)),this._configuratorViewModel.removePreviews(),n&&o&&this._updateCameraToBounds(),i&&n&&this._configuratorUiCallbacks.onDockingsPreviewRemoved(),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}_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)}shouldClearShadowsAndAO(){return super.shouldClearShadowsAndAO()||!this._sceneEventHandler.isDragging()}resume(){super.resume(),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded()),this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._applySSR(),this._renderWithoutShadowsAndAO()})}_materialLoaded(){this._renderEverything(),this._applySSR(),this._environment instanceof W&&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(){super.pause(),this._configuratorViewModel.materialQueue.unregisterCallback(),this._configuratorMeshGenerator.removeMaterialLoadedListener()}_setupScene(e){super._setupScene(e),this._uiIntersectionHelper=new Ce(this._camera),this._uiIntersectionHelper.canvasOffset=e,this._uiIntersectionHelper.addEventListener(0,e=>{this._configuratorUiCallbacks.onUiIntersectionChange(e)},this),this._configuratorMeshGenerator.maxAnisotropy=this._maxAnisotropy,this._configuratorMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()}),this._renderer.domElement.classList.add(p.HSC),this._domHelper.element.appendChild(this._renderer.domElement),this._configuratorInputManager.addEvents(this._renderer.domElement),this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(m.createDynamicLightSettingSource(null,f.CAMERA)):this._lightSetting=new re(this._scene),this._requestRender(),this._setEnvironment(new Q(this._scene,this._environment,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND))),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded())}sceneCleared(e){this._internalClearScene(e)}display(e){this._scene.add(e),this._sceneEventHandler.setRootComponentId(e.runtimeId),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.runtimeId,e.children.length>0&&e.children.forEach(e=>{let n=t+" ";this._printObjectGraph(e,n)})}clearScene(){var e;this._getCameraControl().clear(),this._internalClearScene(!1),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(e){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(),(e||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 o=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();o&&this._dimensionHelper.disableDimensions(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),U(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 r=await V(this._scene,this._uiScene,n,i,e);return o?this._dimensionHelper.enableDimensions():t&&this._dimensionHelper.disableDimensions(),this._lightSetting.addToScene(),this._requestRender(),r}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 o=await j(this._scene,t,n,this._pixotron,this._renderer);return i&&this._dimensionHelper.enableDimensions(),this._requestRender(),o}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(),o=B((new THREE.Box3).setFromObject(e));const r=new THREE.Scene;r.add(e);const s=await V(r,null,i,o,t);C(r),n(s)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._configuratorViewModel.getBoundingBox(),B(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 F(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()}zoomToComponent(e){this._cameraControl.saveState(!1);let t=e.boundingBox.getSize(new THREE.Vector3),n=v(e),i=new THREE.Euler(0,n,0),o=e.getWorldPosition(new THREE.Vector3).clone().add(e.boundingBox.getCenter(new THREE.Vector3).applyEuler(i));const r=new THREE.Vector2;this._renderer.getSize(r),this._getCameraControl().zoomTo(t,r.width,r.height,i.y,y(15),o)}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._getCameraControl().reset(t,void 0,void 0,void 0,e)}_clearSelectionAndHovers(){this.cancelSelection(),this._configuratorViewModel.clearRootComponent()}resetPreviews(){this._configuratorViewModel.removePreviews(),this._requestRender()}changeOffset(e){this._camera.offset=e,this._uiIntersectionHelper&&(this._uiIntersectionHelper.canvasOffset=e)}updateCamera(e=!0){super.updateCamera(),this._updateCameraToBounds(null,e)}setCameraOffset(e){this._camera.offset&&(this._camera.offset=e,this._renderEverything())}getCameraOffset(){return JSON.parse(JSON.stringify(this._camera.offset))}_onKeyDown(e){super._onKeyDown(e),!e.key||"Escape"!==e.key&&"Esc"!==e.key||(this.cancelSelection(),e.preventDefault()),e.key&&e.key.includes("Shift")&&(this._getCameraControl().enablePanning(),e.preventDefault()),this._sceneEventHandler&&this._sceneEventHandler.hasSelection()&&e.key&&("Backspace"===e.key||"Delete"===e.key)&&(this.requestDeleteSelectedComponent(),e.preventDefault())}_onKeyUp(e){super._onKeyUp(e),e.key&&e.key.includes("Shift")&&(this._getCameraControl().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)}setSelectionMode(e){this._sceneEventHandler.setSelectionMode(e)}changeFloorMaterial(e){return this._environment&&this._environment instanceof J||(this._environment=new J(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)})}exportGLB(){this._scriptLoader.fetch(G,{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})})}zoomIn(e){this._getCameraControl().zoomIn(e),this._renderEverything()}zoomOut(e){this._getCameraControl().zoomOut(e),this._renderEverything()}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-3878022f.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()}async loadSceneSettings(e){await super.loadSceneSettings(e),this._uiIntersectionHelper.floorEnvironment=this._environment instanceof J}_updateCameraToBounds(e,t=!0){e||(e=this._configuratorViewModel.getBoundingBox()),e&&(this._getCameraControl().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=r.start("dock_component_"+e.childId);this._kernelAccess.dockComponent(e.parentId,e.parentDockId,e.childId,e.childDockId),this._configuratorContext.dockingRootComponentId=null,r.end(t)}_onSelectedRuntimeComponentsChange(e){this._kernelAccess.multiSelectionChange(e,this._configuratorContext.rootComponentId)}_onSelectedRuntimeComponentChange(e){let t=!1,n=null;e&&(t=e.runtimeId===this._configuratorContext.rootComponentId,n=e.runtimeId),this._kernelAccess.selectionChange(n,t),e&&this._kernelAccess.selectedComponent(e.runtimeId)}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.runtimeId===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)}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=b(e.boxForMeasurement);this._updateBounds(n,t)}this._highlight(),this._requestRender()}}componentDeleted(e){-1===this._sceneEventHandler.getSelectedRuntimeComponentIds().indexOf(e.runtimeId)&&"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&&Promise.all([new Promise(e=>setTimeout(e,3e3)),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.runtimeId);const o=i.parameters||i.possibleChildren?["edit"]:[];e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"component",actions:o})}),this._configuratorViewModel.getPreviews().forEach(t=>{const n=(new THREE.Box3).setFromObject(t);e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"preview",actions:["add"]})}),this._configuratorUiCallbacks.onComponentPositionsUpdated(e)}_updateBounds(e,t=!1){super._updateBounds(e,t);let n=e.getSize(new THREE.Vector3);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._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._pixotron&&this._pixotron.getShadowPass().setShadowRecieverBBox(e),this._camera.updateProjectionMatrix()}async moveCamera(e){return this._getCameraControl().moveCamera(e)}selectComponent(e){if(!e)return;const t=this._configuratorViewModel.getComponents().find(t=>t.runtimeId===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}_getInputManager(){return this._configuratorInputManager}createCameraControl(e,t){this._componentFactory=I();const n=this._domHelper.getClientDimensions(),i=n.x,o=n.y;this._camera=this._componentFactory.createCamera(30,i/o,.1,20,t),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),this._camera.position.copy(new THREE.Vector3(0,.5,5)),this._changeCameraControl(new X(this._creator_,this._configuratorInputManager,null,this._camera))}getBakedShadowParams(){return{enable:!0,shadowMapResolution:1024,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.8,darkness:.3,size:1.2,lightDirection:new THREE.Vector3(0,1,0),lightSolidAngle:40,yPosition:.006}}getBounds(){return this._configuratorViewModel.getBoundingBox()}getPixotronParams(){return{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}}}sceneChanged(){}_getCameraControl(){return this._cameraControl}}return 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,"_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,"_configuratorHistory",void 0),e})();const ye=new Map,be=new Map;class Ie{static loadFont(e){if(be.has(e))return new Promise(t=>{t(be.get(e))});if(ye.has(e))return new Promise((t,n)=>{ye.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,i)=>{ye.set(e,[{resolve:n,reject:i}]),t.load(O()+e,t=>{be.set(e,t),Ie._resolveAll(e,t)})})}static _resolveAll(e,t){ye.has(e)&&ye.get(e).forEach(e=>e.resolve(t)),ye.delete(e)}}e("A",Ie);let we=(()=>{class e{constructor(e){this._activeComponents=[],this._creator_=e}setCamera(e){this._camera=e}add(e){const n=this._kernelAccess.kernelInstance.getComponent(e.runtimeId);if(!n)return!1;const i=n.dimensionings;if(!i||0===i.length||this._camera.position.z<0)return!1;const o=b(n.boxForMeasurement),r={x:this._camera.position.x,y:this._camera.position.z};return t.import("./component-dimensioning-aaa05dd4.legacy.js").then(t=>{Ie.loadFont("static/rubik_regular-75bd7bb699e9e39d.json").then(n=>{i.forEach(i=>{e.add(new t.default(w(i),o,n,r))})})}),this._activeComponents.push(e),!0}remove(e,n=!0){return new Promise(i=>{t.import("./component-dimensioning-aaa05dd4.legacy.js").then(t=>{let o=[];e.children.forEach(e=>{e instanceof t.default&&o.push(e)}),o.forEach(t=>{e.remove(t),C(t)}),n&&L(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})();class ke{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=x(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=x(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 o=t&&e.id===t.id||n,r=!(i instanceof THREE.Mesh);this._changeMaterialsOnSelect(i,t,(!o||!r)&&o)}),t)e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),n||k(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;k(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 o=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||o.push(e))}),0===o.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 Pe=Object.freeze({__proto__:null,default:ke});let Se=(()=>{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}clearHistory(){this._history=[],this._index=0}}return n([i],e.prototype,"_configuratorUiCallbacks",void 0),e})();const Ee=[new P("kernel-access",ge),new P("logger",S),new P("rapi-access",E),new P("script-loader",$),new P("unit-formatter",ue),new P("camera-control-3d",X),new P("camera-control",Y),new P("configurator-input-manager",class extends K{},1),new P("data-syncer",M),new P("selection-handler",class extends z{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 pe({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new pe({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new pe({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new pe({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new pe({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new pe({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.runtimeId)),e}isSelected(e){return this._selectedComponents.has(e.runtimeId)}},1),new P("configurator-mesh-generator",oe),new P("configurator-ui-callbacks",q,1),new P("configurator-scene-manager",ve,1),new P("component-dimensioning-helper",we,1),new P("component-raycast-helper",ke,0),new P("configurator-history",Se,1)],Me=(e,t)=>e.sort||t.sort?e.sort?t.sort?e.sort-t.sort:-1:1:0,He=(e,t)=>e&&!t?1:!e&&t?-1:e&&t?e.localeCompare(t):0;let De=(()=>{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._configuratorSceneManager.getScene()}updateScene(){this._configuratorSceneManager.updateScene()}_loadWebGlLib(e,t){this._threeLoader.fetch().then(()=>Promise.all(Z.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._configuratorSceneManager.changeOffset(t);const{initialFloorMaterial:e,dls:n,ls:i,stats:o}=this._initData,r=m.createDynamicLightSettingSource(n,i);o&&this.showStats(),this._enableHD(r),this._needsSync&&(this._needsSync=!1,this._kernelAccess.requestSync(l,this._configuratorContext.planObjectId));const s=[this._scriptLoader.fetch(ee,{id:"tween-js"})];e&&s.push(this._rapiAccess.getMaterial(e).then(e=>this._configuratorSceneManager.changeFloorMaterial(e))),Promise.all(s).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=H(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._configuratorSceneManager&&this._configuratorSceneManager.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=Me(e,t);return 0!==n?n:(n=He(e.label,t.label),0!==n?n:He(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:o}=this._domHelper.getClientDimensions();if(i<=0&&o<=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(),r.start("ui_load_configuration");const s=[];if(this._initData.applyCurrentGlobalParameters){const e=this._configuratorContext.planObjectId,t=this._configuratorContext.rootComponentParametersAsGlobal;s.push(this._kernelAccess.getGlobalParameters(e,t))}Promise.all(s).then(([i])=>{const o=[a.waitFor(4),a.waitFor(2)];Promise.all(o).then(([e,[n,o,r,s]])=>{const a=[];i&&this._initData.applyCurrentGlobalParameters&&i.forEach(e=>a.push(this.setParameter(e,e.value,!0)));const c=this._rapiAccess.peekComponent(s);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]:o,s=n&&n[1]?n[1]:r,a=await this._kernelAccess.addUiDataAndPriceToPartList(i,s);let l=e.errors;const h=l?u(l):[];t({partList:a,hash:s,rootComponentLabel:c?c.label:"",errors:h})})})},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),r.start("rapi_preloads");const n=()=>{r.end("rapi_preloads");const t=r.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===s.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),s.useHDGeometry=e,void this._kernelAccess.changeUseOfHDGeometry(this._configuratorContext,s.useHDGeometry)))}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}init(e,t){this.setOverrides(t);const{preloadHint:n,offset:i,startTag:o}=this._initData;return this._domHelper.setDomElement(e),n?this._preloadPackage(n):console.warn("No preload hint! Therefore no preload during init!!"),o&&this.getTagById(o,{include:["items"]}).then(e=>this._configuratorUiCallbacks.onOpenTag(e),e=>console.error(e)),this._loadWebGlLib(e,i),new Promise(this._initPromiseCallback.bind(this))}cancelSelection(){this._configuratorSceneManager.cancelSelection()}enableHDGeometry(){return this._changeHDGeometry(!0)}disableHDGeometry(){return this._changeHDGeometry(!1)}changeOffset(e){this._configuratorSceneManager.changeOffset(e)}previewDockings(e,t,n){this._configuratorSceneManager.requestDockingsPreview(!0,e,t,n)}cancelDockings(){this._configuratorSceneManager.cancelDockings()}requestDeleteComponent(){this._configuratorSceneManager.requestDeleteSelectedComponent()}renderImage(e){return this._configuratorSceneManager.renderImage(e)}preparePerspectiveImage(e={}){return this._configuratorSceneManager.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._configuratorSceneManager.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 o=!0,r=!0,s=n.perspectiveImage,a=n.topImage;n.perspectiveImage||(o=!1,this._configuratorSceneManager.preparePerspectiveImage().then(c=>{this._rapiAccess.savePerspectiveImage(n,c).then(t=>{o=!0,s=t.perspectiveImage,r&&(t.label=i.label,t.topImage=a,e(t))},t)})),n.topImage||(r=!1,this._configuratorSceneManager.prepareTopImage().then(c=>{this._rapiAccess.saveTopImage(n,c).then(t=>{r=!0,a=t.topImage,o&&(t.label=i.label,t.perspectiveImage=s,e(t))},t)})),o&&r&&(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._configuratorSceneManager.prepareTopImage(t)}resetCameraPosition(){this._configuratorSceneManager.resetCameraPositionToStart()}showBenchmarks(e){r.showBenchmarks(e)}debugSceneGraph(e){this._configuratorSceneManager.debugSceneGraph(e)}async loadConfiguration(e,t){this.setOverrides(t),this._configuratorContext.lastLoadedRapiId=null,this._configuratorSceneManager&&this._configuratorSceneManager.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._configuratorSceneManager.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,o){const s=this._configuratorContext.selectedRuntimeComponentId?"local":"global",a=r.start("kernel_change_param_"+s+"_"+e);switch(this._configuratorContext.selectionMode){case"standard":if(this._configuratorContext.selectedRuntimeComponentId||this._configuratorContext.rootComponentParametersAsGlobal){let r=this._configuratorContext.selectedRuntimeComponentId?this._configuratorContext.selectedRuntimeComponentId:this._configuratorContext.rootComponentId;this._kernelAccess.changeComponentParameter(r,e,t,n,i,o)}else this._kernelAccess.changePlanObjectParameter(this._configuratorContext.planObjectId,e,t,n,i,o);break;case"multiselect":this._kernelAccess.changeCommonComponentParameter(this._configuratorContext.selectedRuntimeComponentIds,e,t,n,i,o)}r.end(a)}setParameter(e,t,n=!1){return new Promise((i,o)=>{const{key:r,type:s}=e;if(se(e)){if(!n&&!this._unitFormatter.isParseableUnitString(t,e))return o(new SyntaxError('Value "'+t+'" is not parseable'));const i=n?t:this._unitFormatter.parseValue(t,e),{valueFrom:r,valueTo:a}=e.validRange,c=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(r)&&i<r-c)return o(new RangeError('Value "'+t+'" is too small, min-val "'+r+'"'));if(!Number.isNaN(a)&&i>a+c)return o(new RangeError('Value "'+t+'" is too big, max-val "'+a+'"'));t="Integer"===s&&"number"==typeof i?i.toFixed():i.toString()}this._configuratorSceneManager.cancelDockings(),this._dispatchSetParameter(r,s,t,i,o)})}setParameterOfPlanObject(e,t){return new Promise((n,i)=>{const{planObjectId:o,rootComponentId:r,rootComponentParametersAsGlobal:s}=this._configuratorContext,{type:a,key:c}=e;s?this._kernelAccess.changeComponentParameter(r,c,a,t,n,i):this._kernelAccess.changePlanObjectParameter(o,c,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:o}=this._configuratorContext,{type:r,key:s}=e;this._kernelAccess.changeComponentParameter(o,s,r,t,n,i)})}getParametersOfRootComponent(){const{planObjectId:e}=this._configuratorContext;return this._kernelAccess.getGlobalParameters(e,!0)}enableMultiselect(){this._configuratorSceneManager.setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._configuratorSceneManager.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 o=Promise.resolve([]),r=Promise.resolve([]);t&&t.include&&t.include.forEach(t=>{"materials"===t&&(o=this._rapiAccess.getMaterialsOf(e)),"items"===t&&(r=this._rapiAccess.getItems(e.items))}),Promise.all([o,r]).then(([t,i])=>(i.sort(Me),t.sort(Me),n({...e,items:i,materials:t})),i)},i)})}requestAsset(e){return this._dataSyncer.requestAsset(e)}changeFloorMaterial(e){return this._configuratorSceneManager.changeFloorMaterial(e)}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._configuratorSceneManager.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(){this._configuratorSceneManager.showGUI()}showStats(){this._configuratorSceneManager.showStats()}showDimensions(){this._configuratorSceneManager.showDimensions()}hideDimensions(){this._configuratorSceneManager.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._configuratorSceneManager.loadDynamicLightSetting(e)}setBackgroundColor(e){this._configuratorSceneManager.setBackgroundColor(e)}setBackgroundImage(e){this._configuratorSceneManager.setBackgroundImage(e)}setBakedShadow(e,t){this._configuratorSceneManager.setBakedShadow(e,t)}loadSceneSetting(e){return this._configuratorSceneManager.loadSceneSettings(e)}enableMeshSelection(e){this._initData.meshSelection=e}updateSize(){this._configuratorSceneManager.updateCamera()}setCameraOffset(e){this._configuratorSceneManager.setCameraOffset(e)}getCameraOffset(){return this._configuratorSceneManager.getCameraOffset()}getMain(){}cleanup(e={}){this._configuratorContext.selectedRuntimeComponentIds=[],this._kernelAccess.cleanUpCallbacks(),this._configuratorSceneManager.sceneCleared(!!e.resetMeshCache),e.resetCoreCache&&this._kernelAccess.kernelInstance.clearAll(),e.resetApiCache&&this._rapiAccess.cleanUp()}resumeTest(e){e&&this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}zoomIn(e){this._configuratorSceneManager.zoomIn(e)}zoomOut(e){this._configuratorSceneManager.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(te,{id:"pi-js"}).then(()=>{this._configuratorSceneManager.enableHD(e),t()},n)})}isReady(){const e=r.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=r.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=[],o=[];let r;const s=new Map,a=new Map;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n.possible)continue;let c=n.itemId;n.itemId?(o.push(n.itemId),a.set(n.itemId,n)):(i.push(n.componentId),s.set(n.componentId,n),c=n.componentId),n.isDefault&&!r&&(r=c)}Promise.all([this._rapiAccess.getComponents(i),this._rapiAccess.getItems(o)]).then(e=>{const t=[],n=e[0],i=e[1];let o;for(let e=0,i=n.length;e<i;e++){const i=n[e];i.isItem=!1,i.isComponent=!0;const a=s.get(i.id);a&&(i.group=a.group),i.id===r&&(i.isDefault=!0,o=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 s=a.get(n.id);s&&(n.group=s.group),n.id===r&&(n.isDefault=!0,o=n),t.push(n)}return t.sort(Me),{possibleChildren:t,defaultChild:o||null}}).then(({possibleChildren:e,defaultChild:t})=>{const n=[],i=new Map,o=[];for(let t=0,r=e.length;t<r;t++){const r=e[t],s=r.tags;if(r.tags&&Array.isArray(r.tags)&&r.tags.length)for(let e=0,t=r.tags.length;e<t;e++){const t=s[e];-1===n.indexOf(t)&&n.push(t);let o=i.get(t);if(!o){const e=[];i.set(t,e),o=i.get(t)}o.push(r)}else o.push(r)}return{tagIds:n,associations:i,defaultChild:t,noTagChilds:o}}).then(({tagIds:t,associations:i,defaultChild:o,noTagChilds:r})=>{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(Me),r.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:r}),this._configuratorUiCallbacks.onUpdatePossibleChildren(t,o)}},e=>{console.error("Couldnt load tags of possible children"),console.error(e)})},e=>console.error(e))}updateParameters(e,t,n,i){const o={};t||(t=[],console.warn("Kernel returned no parameter groups! Check why!")),t.forEach(e=>{o[e.key]=e}),e.sort(Me),e.forEach(e=>{e.group?e.grouping=o[e.group]:e.grouping=null,this._unitFormatter.formatParameter(e),le(e)&&Object.defineProperty(e,"groups",{get:()=>new Promise((t,o)=>{this._getMaterialGroups(e).then(e=>{this._isCorrectResponse(i,n)&&this._shouldBroadcastToUi(i)?t(e):o("Response does not match to ids")},o)})})}),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._configuratorSceneManager.moveCamera(e)}selectComponent(e){return this._configuratorContext.selectedRuntimeComponentId===e?Promise.resolve():Promise.resolve(this._configuratorSceneManager.selectComponent(e))}setComponentParameter(e,t,n){const{key:i,type:o}=t;return new Promise((t,r)=>this._kernelAccess.changeComponentParameter(e,i,o,n,t,r))}highlightParts(e){this._configuratorSceneManager.highlightParts(e)}undo(){const e=this._configuratorHistory.undo();e&&this._kernelAccess.loadConfiguration(e)}redo(){const e=this._configuratorHistory.redo();e&&this._kernelAccess.loadConfiguration(e)}clearHistory(){this._configuratorHistory.clearHistory()}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,"_configuratorSceneManager",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 Re extends ne{setupDependencies(){R.setup(Ee),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("configurator-scene-manager"));e&&e.cleanUp(),t&&t.cleanUp(),n&&n.cleanUp()}setupGlobals(e){const{kernelInstance:t,kernelContainer:n,planObjectId:i}=e||{};s.init({kernelInstance:t,kernelContainer:n,planObjectId:i})}getApi(){return this._configurator}bootFinished(){this._configurator=new De(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}e("C",Re),e("c",Object.freeze({__proto__:null,Configurator:Re}))}}}));
|
|
2
|
-
//# sourceMappingURL=configurator-21c32b82.legacy.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./rapi-access-990628ad.legacy.js","./mesh-generator-f2c8bb17.legacy.js"],(function(e){var t,a,r,s;return{setters:[function(e){t=e.S,a=e.T,r=e.U},function(e){s=e.M}],execute:function(){e("C",class extends s{constructor(e){super(e),this._geometryComponentMaterialCache=new Map,this._configuratorPreviewMaterial=new THREE.MeshStandardMaterial({color:t,transparent:!0,opacity:a,roughness:r,envMap:null}),this._environmentLoader.setEnvMap(this._configuratorPreviewMaterial)}generateMesh(e=0,t=null,a,r,s,n,i,o=!1){let h;h=o?this._generateGeometry(t,r,s,n,i).clone():this._generateGeometry(t,r,s,n,i);const c=this._createMesh(e,t,h);return c.userData.materialId=a,c.layers.set(3),a&&this.materialQueue.push(this._assignMaterial(c,a).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),a)})),c}_createMesh(e,t,a){if(e&&t){const r=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(r)){const e=this._geometryComponentMaterialCache.get(r);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new THREE.Mesh(a,t)}}}return new THREE.Mesh(a,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}setMaterial(e,t,a){return this._assignMaterial(e,t)}loadMaterial(e,t,a){return super._loadMaterial(e,t,a)}loadTextures(e,t,a,r){return super._loadTextures(e,t,a,r)}})}}}));
|
|
2
|
-
//# sourceMappingURL=configurator-mesh-generator-62f318f2.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurator-mesh-generator-62f318f2.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-light-setting-d6e9de1f.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./rapi-access-990628ad.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./pixotron-b2477d2d.legacy.js","./default-light-setting-d6e9de1f.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,H,O,M,v;return{setters:[function(e){t=e.V,n=e.W,r=e.G,i=e.X,o=e.f,a=e.Y,s=e.S,l=e.Z,c=e.T,d=e.$,h=e.a0,u=e._,_=e.i,p=e.a1,g=e.C,b=e.B,m=e.E,E=e.M,f=e.a2,C=e.s,y=e.j,P=e.a3,R=e.a4,j=e.t,w=e.K},function(e){H=e.f},function(e){O=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();if(this._glbUrl=H(e),!this._glbUrl)return Promise.reject("No glb url found");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();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 O{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 O{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-9a6a67fc.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main-thread-to-worker-4c02f179.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-viewer-7a17728a.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./rapi-access-990628ad.legacy.js","./main-thread-to-worker-4c02f179.legacy.js"],(function(e){var t,a,r,s,i,o,h,l,n;return{setters:[function(e){t=e._,a=e.i,r=e.S,s=e.U,i=e.a5,o=e.H,h=e.J},function(e){l=e.j,n=e.k}],execute:function(){class c{constructor(e,t){this._waitingPromises=[],this._finishPromiseExecutor=[],this._errorCallback=()=>{},Promise.allSettled=Promise.allSettled||(e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))),e&&this.registerCallback(e),t&&(this._errorCallback=t)}push(e){this._waitingPromises.push(e),Promise.all(this._waitingPromises).then(e=>{e.length===this._waitingPromises.length&&(this._callback&&this._callback(e),this._waitingPromises=[])},this._errorCallback)}finished(e=!1){return new Promise((t,a)=>{this._finishPromiseExecutor.push({resolve:t,reject:a});const r=e?"allSettled":"all";Promise[r](this._waitingPromises).then(e=>{if("allSettled"===r){const t=[];e.forEach(({value:e,status:a})=>{"fulfilled"===a&&t.push(e)}),this._resolveAllExecutors(t)}else this._resolveAllExecutors(e)},e=>{this._rejectAllExecutors(e)})})}registerCallback(e){this._callback=e}unregisterCallback(){this._callback=null}_resolveAllExecutors(e){this._finishPromiseExecutor.forEach(({resolve:t})=>t(e)),this._finishPromiseExecutor=[]}_rejectAllExecutors(e){this._finishPromiseExecutor.forEach(({reject:t})=>t(e)),this._finishPromiseExecutor=[]}clear(){const e=this._waitingPromises.length>0;this._waitingPromises=[],e?this._rejectAllExecutors(new Error("Promise queue has been cleared")):this._resolveAllExecutors([])}get length(){return this._waitingPromises.length}}e("P",c),e("M",(()=>{class e{constructor(e){this.materialQueue=new c,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:r,roughness:s,metalness:i}),this._environmentLoader.setEnvMap(this._previewMaterial)}_generateGeometry(e,t,a,r,s){let i;return e&&this._cacheHolder.geometryCache.has(e)?i=this._cacheHolder.geometryCache.get(e):(i=new THREE.BufferGeometry,i.setIndex(new THREE.Uint32BufferAttribute(a,1)),i.setAttribute("position",new THREE.Float32BufferAttribute(t,3)),i.setAttribute("normal",new THREE.Float32BufferAttribute(s,3)),i.setAttribute("uv",new THREE.Float32BufferAttribute(r,2)),i.scale(.001,.001,.001),i.rotateX(-Math.PI/2),e&&this._cacheHolder.geometryCache.set(e,i)),i}changeMaterialOfMesh(e,t){e&&t?(e.material=t,e.material.transparent||0===e.material.opacity||e.material.transmission>0?(e.castShadow=!1,e.receiveShadow=!1):(e.castShadow=!0,e.receiveShadow=!0),e.material.needsUpdate=!0,this._materialLoaded&&this._materialLoaded(t)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_createMaterial(e,t,a,r,s){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let i=l(e),h=o(i,this._environmentLoader);this._loadBenchmarkTextures(i,h,r,s).then(t,a)}else this._rapiAccess.getMaterial(e).then(e=>{let i=o(e,this._environmentLoader);this._loadTextures(e,i,r,s).then(t,a)},a)}_loadBenchmarkTextures(e,t,a=1,r=1){return new Promise((s,i)=>{const o=n(e.id);h(this._dataSyncer.requestAsset(o.image,!0),o,t,this._maxAnisotropy,a/(0===o.mmWidth?1:o.mmWidth),r/(0===o.mmHeight?1:o.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},i)})}_loadTextures(e,t,a=1,r=1){return new Promise((s,i)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),s();this._rapiAccess.getTexturesOf(e).then(o=>{let l=[];o.forEach(e=>{l.push(h(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,a/(0===e.mmWidth?1:e.mmWidth),r/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(l).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},i)})})}_loadMaterial(e,t,a){return new Promise((r,s)=>{this._singlePromiseFactory.create(6,e,(r,s)=>this._createMaterial(e,r,s,t,a)).then(()=>{setTimeout(()=>r(this._cacheHolder.materialCache.get(e)),0)},s)})}_assignMaterial(e,t){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),Promise.resolve()):new Promise((a,r)=>{this._loadMaterial(t).then(r=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,r),a()},r)})}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy=e}get maxTextures(){return this._maxTextures}set maxTextures(e){this._maxTextures=e}clear(){this._cacheHolder.clear()}_assignRGB(e,t){return new Promise(a=>{let r,s="rbg"+JSON.stringify(t);this._cacheHolder.materialCache.has(s)?r=this._cacheHolder.materialCache.get(s):(r=new THREE.MeshStandardMaterial({color:t}),this._environmentLoader.setEnvMap(r),this._cacheHolder.materialCache.set(s,r)),this.changeMaterialOfMesh(e,r),setTimeout(()=>a(),0)})}_assignItem(e,t){return new Promise((a,r)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void a();this._rapiAccess.getItem(t).then(s=>{if(s.topImage)this._textureLoader.load(s.topImage,r=>{r.anisotropy=this._maxAnisotropy,r.wrapS=THREE.RepeatWrapping,r.wrapT=THREE.RepeatWrapping;let i=new THREE.Vector2(1,1);s.width>0&&(i.x=1/s.width),s.depth>0&&(i.y=1/s.depth),r.repeat.set(i.x,i.y);const o=new THREE.MeshPhysicalMaterial({map:r,roughness:.5,metalness:.1});this._environmentLoader.setEnvMap(o),this._cacheHolder.materialCache.set(t,o),this.changeMaterialOfMesh(e,o),setTimeout(()=>a(),0)});else{const e="can not set material, catalog item top image is not set";console.warn(e),r(e)}},r)})}setMaterialLoadedListener(e){this._materialLoaded=e}removeMaterialLoadedListener(){this._materialLoaded=void 0}}return t([a],e.prototype,"_rapiAccess",void 0),t([a],e.prototype,"_environmentLoader",void 0),t([a],e.prototype,"_dataSyncer",void 0),t([a],e.prototype,"_singlePromiseFactory",void 0),t([a],e.prototype,"_cacheHolder",void 0),t([a],e.prototype,"_plannerMeshGenerator",void 0),e})())}}}));
|
|
2
|
-
//# sourceMappingURL=mesh-generator-f2c8bb17.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-generator-f2c8bb17.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-990628ad.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./image-renderer-9a6a67fc.legacy.js","./pixotron-b2477d2d.legacy.js","./mesh-generator-f2c8bb17.legacy.js","./default-light-setting-d6e9de1f.legacy.js"],(function(e,t){var n,a,i,s,r,o,l,h,c,d,_,g,p,m,u,S,w,C,E,v,f,M,b,I,y,k,P,L,H,D,T,R,V,O,A,B,j,x,G,F,K,z,U,q,X,W,N,Q,J,Y,Z,$;return{setters:[function(){},function(e){n=e.K,a=e._,i=e.i,s=e.a6,r=e.d,o=e.z,l=e.a7,h=e.j,c=e.B,d=e.G,_=e.a8,g=e.r,p=e.a9,m=e.aa,u=e.e,S=e.c,w=e.X,C=e.a4,E=e.V,v=e.n,f=e.L,M=e.o,b=e.s},function(e){I=e.s,y=e.l,k=e.m},function(e){P=e.S,L=e.c,H=e.d,D=e.G,T=e.b,R=e.a,V=e.g,O=e.P,A=e.C},function(e){B=e.L,j=e.S,x=e.B,G=e.a,F=e.C,K=e.e,z=e.f,U=e.g,q=e.T,X=e.P,W=e.d,N=e.I,Q=e.E,J=e.b,Y=e.M},function(e){Z=e.M},function(e){$=e.D}],execute:function(){class ee extends B{constructor(e,t){super(e,t),this._center=new THREE.Vector3(0,0,0),this._params={ambientLight:{color:"#ffffff"},hemiLight:{color:"#ffffff"},mainDirLight:{direction:{x:.03,y:1,z:.03},color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.3),this._ambientLight.layers.set(1),this._mainDirLight=new THREE.DirectionalLight(new THREE.Color(this._params.mainDirLight.color),.5),this._mainDirLight.castShadow=!0,this._mainDirLight.shadow.camera.near=.5,this._mainDirLight.shadow.camera.far=100,this._mainDirLight.shadow.mapSize=new THREE.Vector2(1024,1024),this._mainDirLight.visible=!0,this.addToScene()}updateSunPosition(e,t){}addToScene(){this._scene.add(this._mainDirLight),this._scene.add(this._ambientLight),this._scene.add(this._mainDirLight.target)}removeFromScene(){this._scene.remove(this._mainDirLight),this._scene.remove(this._ambientLight),this._scene.remove(this._mainDirLight.target)}reload(){this.removeFromScene(),this.addToScene()}needsBounds(){return!0}updateBounds(e){this._center.copy(e.getCenter(new THREE.Vector3));const t=new THREE.Sphere;e.getBoundingSphere(t);const n=t.radius,a=new THREE.Vector3(this._params.mainDirLight.direction.x,this._params.mainDirLight.direction.y,this._params.mainDirLight.direction.z);a.normalize(),a.multiplyScalar(n),this._mainDirLight.position.copy(this._center),this._mainDirLight.position.add(a),this._mainDirLight.target.position.copy(this._center),this._mainDirLight.target.updateMatrixWorld(!0),this._mainDirLight.shadow.camera.top=n,this._mainDirLight.shadow.camera.bottom=-n,this._mainDirLight.shadow.camera.left=-n,this._mainDirLight.shadow.camera.right=n,this._mainDirLight.shadow.camera.near=.01,this._mainDirLight.shadow.camera.far=2*n,this._mainDirLight.shadow.camera.updateProjectionMatrix()}showGUI(){let e=n();if(e){if(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))}if(this._hemiLight){let t=e.addFolder("Hemi Light");t.add(this._hemiLight,"visible"),t.add(this._hemiLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.hemiLight,"color").onChange(e=>this._hemiLight.color=new THREE.Color(e))}if(this._mainDirLight){let t=e.addFolder("Main Directional Light");t.add(this._mainDirLight,"visible"),t.add(this._mainDirLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(e=>this._mainDirLight.color=new THREE.Color(e)),t.add(this._mainDirLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center)),t.add(this._mainDirLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center)),t.add(this._mainDirLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center))}}}}class te{constructor(e){const{planElementViewModel:t,resetCamera:n,state:a,oldState:i}=e;this.planElementViewModel=t,this.resetCamera=void 0===n||n,this.state=void 0===a?0:a,this.oldState=void 0===i?0:i}}let ne=(()=>{class e extends P{constructor(e,t,n,a){super(e,t,n,a),this._state=0,this._inputManager.addEventListener(4,()=>this._position=null,this),this._raycastHelper.setMode(0);const i=new THREE.Layers;i.enable(3),i.enable(6),this._raycastHelper.setLayers(i),this._raycastHelper.addEventListener(3,()=>{this._plannerSelectionHandler.cancelSelection()},this),this._plannerSelectionHandler.addEventListener(0,({planElementViewModel:e})=>{this.dispatchEvent(0,new te({planElementViewModel:e}))},this),this._plannerSelectionHandler.addEventListener(1,({planElementViewModel:e})=>{this.setState(0),this.dispatchEvent(1,new te({planElementViewModel:e}))},this),this._inputManager.addEventListener(6,e=>this._move(e),this)}getSelectionMode(){return this._plannerSelectionHandler.getSelectionMode()}async addPlanObjectHandlers(e,t){t||(t=await e.getObjectAsync());const n={hasListener:!0,priority:1,roomleId:e.getId()};this._addPlanObjectHandlers(e,t,n)}addWallHandlers(e){this._addPlanElementHandlers(e,e.getBoundingBox(),{hasListener:!0,priority:1,roomleId:e.getId()})}_addPlanObjectHandlers(e,t,n){t.userData.hasListener||(t.userData=n,t.addEventListener("select",()=>this._clickElement(e)),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)),t.addEventListener("hover_on",()=>this._hoverOn(e)),t.addEventListener("hover_off",()=>this._hoverOff(e)),t.addEventListener("rotate",t=>this._rotate(e,t.attachment.rotation)))}_addPlanElementHandlers(e,t,n){t.userData.hasListener||(t.userData=n,t.addEventListener("select",()=>this._clickElement(e)),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)),t.addEventListener("hover_on",()=>this._hoverOn(e)),t.addEventListener("hover_off",()=>this._hoverOff(e)))}_clickElement(e){this._debug&&e.getId(),this._plannerSelectionHandler.check(e),this._setCursor()}_hoverOn(e){this._hoveredObject=e,this._setCursor()}_hoverOff(e){this._hoveredObject=null,this._setCursor()}_setCursor(){2===this._state&&this._hasSelection()?I("ew-resize"):1===this._state?I("grabbing"):this._hoveredObject&&this._plannerSelectionHandler.isSelected(this._hoveredObject.getId())?I("move"):this._hoveredObject?I("pointer"):I("default")}setCamera(e){this._raycastHelper.setCamera(e)}setScene(e){this._raycastHelper.setScene(e)}getSelectedIds(){return this._plannerSelectionHandler.getSelectedIds()}setSelectionMode(e){this._plannerSelectionHandler.setSelectionMode(e)}setPlanViewModel(e){this._planViewModel=e}cancelSelection(){this._plannerSelectionHandler.cancelSelection()}_dragStart(e){this._plannerSelectionHandler.isSelected(e.getId())&&0===this._state&&(this._draggedObject=e,this.setState(1),this.dispatchEvent(4,new te({planElementViewModel:e})),this._setCursor())}_drag(e,t){if(!this._draggedObject||1!==this._state)return;const n=this._plannerKernelAccess.planInteractionHandler;if(this._plannerSelectionHandler.getSelectedIds().length>1){const e=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList;let a=t.sub(this._draggedObject.getPosition());this._plannerSelectionHandler.getSelectedIds().forEach(t=>e.push_back(this._planViewModel.getPlanObjectForId(t).getPlanObject())),n.moveObjectsBy(e,s(a))}else n.moveElementTo(e.getPlanElement(),s(t));this.dispatchEvent(5,new te({planElementViewModel:e}))}_dragEnd(e,t){this._draggedObject&&(this._draggedObject=null,this.setState(0),this.dispatchEvent(6,new te({planElementViewModel:e})),this._dragIn&&(this.cancelSelection(),this.setDragIn(!1)),this._setCursor())}_rotate(e,t){if(this._plannerSelectionHandler.isSelected(e.getId())){const n=this._plannerKernelAccess.planInteractionHandler,a=e.getPlanObject();n.setObjectRotation(e.getPlanElement(),a.rotation-t)}}setState(e){const t=this._state;this._state=e,this._setCursor(),this.dispatchEvent(2,new te({state:this._state,oldState:t})),this._position=null,2===this._state&&this._plannerKernelAccess.planInteractionHandler.deactivateAllSnappingActivity()}resetState(){this.setState(0)}_move(e){if(2===this._state&&this._hasSelection()){this._setCursor();let t=Math.PI/180;const{x:n,y:a}=e.positionRelative;this._position?t=1.4*e.positionRelative.x*Math.PI-1.4*this._position.x*Math.PI:this._position=new THREE.Vector3(e.positionRelative.x,e.positionRelative.y,0);const i=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList,r=new THREE.Box3;this.getSelectedIds().forEach(e=>{var t;const n=null===(t=this._planViewModel)||void 0===t?void 0:t.getPlanObjectForId(e);n&&n.getObject()&&(i.push_back(n.getPlanObject()),r.expandByObject(n.getContainer()))});const o=r.getCenter(new THREE.Vector3);this._plannerKernelAccess.planInteractionHandler.rotateObjectsBy(i,t,s(o)),this._position.copy(new THREE.Vector3(n,a,0))}}_hasSelection(){return this._plannerSelectionHandler.getSelectedIds().length>0}selectPlanElement(e){this._plannerSelectionHandler.check(e)}_interaction(e){this.dispatchEvent(0,new te({}))}addComponentDragInHandler(e){if(!this._dragIn)return;const t=e.getBoundingBox();this._addPlanElementHandlers(e,t,{hasListener:!0,priority:1,roomleId:e.getId()}),this._raycastHelper.enableDragIn(t),this._dragStart(e)}}return a([i],e.prototype,"_plannerSelectionHandler",void 0),a([i],e.prototype,"_plannerKernelAccess",void 0),e})(),ae=(()=>{class e extends j{constructor(e,t,n,a){super(e,t,r.HSP,a),this._staticItemGuard=new o,this._configurableItemGuard=new o,this._roomlePlannerCallback=n,this._plannerMeshGenerator.maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._plannerMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._plannerSceneEventHandler=new ne(e,this._scene,this._cameraControl.getCamera(),this._getInputManager()),this._plannerSceneEventHandler.addEventListener(2,({state:e,oldState:t})=>{2===t&&e!==t&&this._roomlePlannerUiCallback.onRotationCancel(),2===e||1===e?this._cameraControl.lock():this._cameraControl.unlock()},this),this._plannerSceneEventHandler.addEventListener(0,({planElementViewModel:e})=>{e instanceof L&&this._initData.debug&&e.getGLBUrl(),this._highlight(e),this._onSelectionChange(e)},this),this._plannerSceneEventHandler.addEventListener(1,()=>{this._highlight(null),this._roomlePlannerUiCallback.onSelectionCancel()},this),this._plannerSceneEventHandler.addEventListener(4,()=>{this._plannerKernelAccess.planInteractionHandler.startInteraction(),this._cameraControl.lock(),this._environment instanceof x&&this._environment.removeFromScene(),this._requestRender(),this._dragStartBounds=this.getBounds()},this),this._plannerSceneEventHandler.addEventListener(5,({planElementViewModel:e})=>{this._cameraControl.checkNearFarDistance(e.getPosition()),this._requestRender()},this),this._plannerSceneEventHandler.addEventListener(6,({planElementViewModel:e})=>{const t=this._plannerKernelAccess.planInteractionHandler;t.endInteraction(),this._cameraControl.unlock(),this._environment instanceof x&&this._environment.addToScene();const n=this._getDragPosition(e.getPosition());n&&t.moveElementTo(e.getPlanElement(),s(n)),this.updateEnvironment(this.getBounds(),!0),this._zoomToBounds(),this._renderEverything()},this),this._plannerKernelAccess.addPlannerListener(this),this._plannerMeshGenerator.setMaterialLoadedListener(()=>{this._configurableItemGuard.resolve(),this._requestRender()}),window.onbeforeunload=this.clearScene.bind(this),this._renderListener=()=>{this._requestRender()},this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this)}_getDragPosition(e){if(!this._plannerSceneEventHandler.isDragIn())return null;const t=this._dragStartBounds?this._dragStartBounds:this.getBounds(),n=t.getCenter(new THREE.Vector3),a=e.distanceTo(n),i=t.getSize(new THREE.Vector3),s=Math.max(i.x,i.z)+3;if(a>s){const t=(new THREE.Vector3).subVectors(e,n).normalize();return n.clone().add(t.multiplyScalar(s))}return null}_onSelectionChange(e){let t;e instanceof L&&(t="static"),e instanceof H&&(t="configuration");const n={};if(e instanceof L&&(n.item=e.getRapiItem()),e instanceof H){const t=e.getConfigurationRuntimeId();n.configurationRuntimeId=t}const a=(async()=>{const n={};if(e instanceof L&&(n.item=e.getRapiItem()),e instanceof H){const a=e.getConfigurationRuntimeId(),i=e.getPlanObject().getCatalogItemId(),s=this._plannerKernelAccess.kernelInstance.getHashOfConfiguration(a);let r;if(i&&g(i)){const e=await this._rapiAccess.getItem(i);n.item=e,r=e.rootComponentId?e.rootComponentId:null}else try{const e=await this._rapiAccess.getConfiguration(s);n.configuration=e,r=e.rootComponentId?e.rootComponentId:null}catch(e){console.warn("Could not get RAPI configuration for kernel hash "+s+", saving configuration...");const t=await this._plannerKernelAccess.getConfigurationData(a),i=await this._rapiAccess.saveConfiguration(t);n.configuration=i,r=i.rootComponentId?i.rootComponentId:null}if(r){const e=await this._rapiAccess.getComponent(r);n.component=e}n.configurationRuntimeId=a,t="configuration"}return y(n)})();this._roomlePlannerUiCallback.onSelectionChange(y(this._plannerSceneEventHandler.getSelectionMode()),y(t),y(n),a)}_setupScene(e,t){super._setupScene(e,t),this._initData.moc?(this._lightSetting=new $(this._scene),this._setEnvironment(new G(this._scene,this._environment,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND)))):(this._lightSetting=new ee(this._scene),this._addSky(),this._setEnvironment(new x(this._scene,this._environment)))}onBeforeRender(){this._cameraControl instanceof F&&this._plannerMeshGenerator.wallMeshes.forEach(e=>l(this._cameraControl.getCamera(),e.material))}_getInputManager(){return this._plannerInputManager}createCameraControl(e,t){this.setMode(e)}resetCamera(){this._cameraControl.hasSavedState()?this.resetCameraToState():this.resetCameraPositionToStart()}resetCameraToState(){this._cameraControl.resetToState()}resetCameraPositionToStart(){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}loadStaticPlanObjects(){let e=new Map;this._planViewModel.getStaticPlanObjectViewModels().forEach(t=>{let n=t.getPlanObject();e.has(n.getCatalogItemId())?e.get(n.getCatalogItemId()).push(t):e.set(n.getCatalogItemId(),[t])}),this._rapiAccess.getItems(Array.from(e.keys())).then(t=>{let n=[];t.forEach(t=>{this._plannerKernelAccess.catalogItemLoaded(t),e.get(t.id).forEach(e=>{n.push(new Promise((n,a)=>{e.setRapiItem(t).then(()=>{this._requestRender(),n()},a)}))})}),Promise.all(n).then(()=>this._staticItemsLoaded())})}_staticItemsLoaded(){this._requestRender(),this._staticItemGuard.resolve(),this._roomlePlannerUiCallback.onItemsLoaded()}preload(e){this._planId=e;let t=this._localStorageHelper.getItem(this._planId,"rml_plans");t&&this._loadGLTF(t).then(e=>{this._preloadScene=e,this._preloadScene&&this._scene.add(this._preloadScene),this._requestRender()})}planXMLLoaded(e){this.endPlanConstruction(e);const t=e.getBounds(),n=h(t);this._updateBounds(n),this.loadStaticPlanObjects()}planCompletelyLoaded(e){this._renderEverything()}handlerSwitchedPlans(e){if(this._planViewModel=e,this._planViewModel.setPlannerSceneEventHandler(this._plannerSceneEventHandler),this._planViewModel.setGeometriesMergedListener(()=>{this._renderEverything()}),this._plannerSceneEventHandler.setPlanViewModel(this._planViewModel),this.clearScene(),!this._initData.moc){this._addSky();let e=new THREE.PlaneGeometry(1e3,1e3);e.rotateX(-Math.PI/2);let t=new THREE.MeshStandardMaterial({color:"#f0f0f0",roughness:1,metalness:0}),n=new THREE.Mesh(e,t);n.name="Ground",n.position.y=-.01,n.receiveShadow=!0,this._scene.add(n)}this.resetCamera(),this._setCeiling(),this._staticItemGuard.reset(),this._configurableItemGuard.reset(),Promise.all([this._staticItemGuard.wait(),this._configurableItemGuard.wait()]).then(this._itemsLoaded.bind(this))}_itemsLoaded(){const e=this._planViewModel.getCorePlan();if(this._pixotron){const t=h(e.getBounds());this._pixotron.getShadowPass().setShadowRecieverBBox(t)}this._roomlePlannerUiCallback.onCompletelyLoaded(),this._pixotronUtil&&this._planViewModel.materialQueue.finished(!0).then(()=>{this._pixotronUtil.unLockAdapter()}),this.updateEnvironment(this.getBounds(),!0),this._renderEverything(),c.end("loadingTime")}beginPlanConstruction(e){}addPlanMesh(e,t,n,a,i,s,r){}endPlanConstruction(e){this._renderLoopFunction=()=>{this._scene.add(this._planViewModel.getConstructionGroup()),this._scene.add(this._planViewModel.getCeilingGroup()),this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(this._planViewModel.getBoundingBox()),this._scene.remove(this._preloadScene)}}addPlanObjectToScene(e){const t=e.getContainer();d(t),this._scene.add(t),this._plannerSceneEventHandler.isDragIn()&&(this._plannerSceneEventHandler.selectPlanElement(e),this._plannerSceneEventHandler.addComponentDragInHandler(e),this._requestRender()),setTimeout(()=>{this._zoomToBounds()},0),this._renderEverything()}removePlanObjectFromScene(e){this._scene.remove(e.getContainer()),this.updateEnvironment(this.getBounds()),this._zoomToBounds(),this._renderEverything()}planElementChanged(e,t){this.updateEnvironment(this.getBounds(),!0),this._renderEverything(),this._onPlanChanged()}exportGLB(e,t){this._scriptLoader.fetch(D,{id:"gltf-exporter"}).then(()=>{let n=new THREE.GLTFExporter;e||(e=[],this._scene.children.forEach(t=>{this._isPartOfScene(t)&&e.push(t)})),n.parse(e,e=>{let n=t||"test";this._localStorageHelper.addItem(n,JSON.stringify(e),"rml_plans")},{binary:!1,embedImages:!0,forceIndices:!0})})}importGLB(e){this._loadGLB(e).then(e=>this._scene.add(e))}clearScene(){this._plannerMeshGenerator.clear(),this._planViewModel.sceneCleared(),super.clearScene()}_addSky(){this._sky=new THREE.Sky,this._sky.name="Sky",this._sky.scale.setScalar(45e4),this._scene.add(this._sky),this._sky.material.uniforms.turbidity.value=10,this._sky.material.uniforms.rayleigh.value=2,this._sky.material.uniforms.luminance.value=1,this._sky.material.uniforms.mieCoefficient.value=.005,this._sky.material.uniforms.mieDirectionalG.value=.8;let e=new THREE.Mesh(new THREE.SphereBufferGeometry(2e4,16,8),new THREE.MeshBasicMaterial({color:16777215}));e.name="Sunsphere",e.position.y=-7e5,e.visible=!1,this._scene.add(e);let t=-.2*Math.PI,n=2*Math.PI*-.25;e.position.x=4e5*Math.cos(n),e.position.y=4e5*Math.sin(n)*Math.sin(t),e.position.z=4e5*Math.sin(n)*Math.cos(t),e.visible=!0,this._sky.material.uniforms.sunPosition.value.copy(e.position),this._lightSetting instanceof ee&&this._lightSetting.updateSunPosition(.3,.25)}switchTo2D(){this._cameraControl instanceof K||(this._plannerMeshGenerator.wallMeshes.forEach(e=>_(e.material,!1,!1)),this._renderEverything(),this._changeCameraControl(new K(this._creator_,this._getInputManager())),this._updateCamera(),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged("2D"))}switchTo3D(){this._cameraControl instanceof F||(this._renderEverything(),this._changeCameraControl(new F(this._creator_,this._getInputManager(),new THREE.Vector3(0,10,0),this.getPerspectiveOffsetCamera())),this._updateCamera(),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged("3D"))}_setCeiling(){this._planViewModel&&(this._cameraControl instanceof z?this._planViewModel.getCeilingGroup().visible=!0:this._planViewModel.getCeilingGroup().visible=!1)}cameraControlChanged(){super.cameraControlChanged(),this._plannerSceneEventHandler&&this._plannerSceneEventHandler.setCamera(this._cameraControl.getCamera())}sceneChanged(){this._plannerSceneEventHandler&&this._plannerSceneEventHandler.setScene(this._scene)}closeHSC(){this._requestRender(),this._cameraControl instanceof F&&this._cameraControl.resetToState()}switchToFirstPerson(){if(this._cameraControl instanceof z)return;this._plannerMeshGenerator.wallMeshes.forEach(e=>_(e.material,!1,!1)),this._renderEverything();let e=new THREE.Vector3(0,0,0);this._planViewModel&&(e=this._planViewModel.getBoundingBox().getCenter(new THREE.Vector3)),this._cameraControl&&this._cameraControl.cleanUp(),this._changeCameraControl(new z(this._creator_,this._getInputManager(),e,this.getPerspectiveOffsetCamera())),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged("FP")}_onKeyDown(e){super._onKeyDown(e),this._initData.debug&&this._checkNumKey(e),!e.key||"Meta"!==e.key&&"Control"!==e.key||(this._plannerSceneEventHandler.setSelectionMode("multiselect"),e.preventDefault()),e.key&&e.key.includes("Shift")&&this._cameraControl instanceof F&&(this._cameraControl.enablePanning(),e.preventDefault())}_checkNumKey(e){e.key&&"1"===e.key&&(this.switchTo2D(),e.preventDefault()),e.key&&"2"===e.key&&(this.switchTo3D(),e.preventDefault()),e.key&&"3"===e.key&&(this.switchToFirstPerson(),e.preventDefault())}_onKeyUp(e){super._onKeyDown(e),!e.key||"Meta"!==e.key&&"Control"!==e.key||(this._plannerSceneEventHandler.setSelectionMode("standard"),e.preventDefault()),e.key&&e.key.includes("Shift")&&this._cameraControl instanceof F&&(this._cameraControl.disablePanning(),e.preventDefault())}setMode(e){switch(e){case"2D":this.switchTo2D();break;case"3D":this.switchTo3D();break;case"FP":this.switchToFirstPerson()}}_highlight(e){let t=new Set;e&&e.getObject()&&e.getObject().children&&e.getObject().children.forEach(e=>t.add(e)),this._plannerSceneEventHandler.getSelectedIds().forEach(e=>{const n=this._planViewModel.getPlanObjectForId(e);n&&n.getObject()&&n.getObject().children&&n.getObject().children.forEach(e=>t.add(e))}),this._pixotron&&this._pixotron.highlightObjects(Array.from(t))}destroy(){super.destroy(),this._plannerMeshGenerator.removeMaterialLoadedListener(),this._planViewModel.removeGeometriesMergedListener()}getPixotronParams(){return{saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:100,accumulative:!1,falloff:2},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100},outlineparams:{highlightColor:new THREE.Color(this._initData.colors.SELECTION),edgeStrength:1,transparency:.9,edgeThickness:2}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:1024,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.8,darkness:.3,size:1.2,lightDirection:new THREE.Vector3(0,1,0),lightSolidAngle:40,yPosition:.006}}planObjectConfigurationLoaded(e,t,n){if(e&&e.extRef&&t&&t.extRef){let e=t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId();e>0&&this._planViewModel.constructComponents(e)}}addMesh(e,t,n,a,i,s){}_updateBounds(e){e&&(this._updateCamera(e),super._updateBounds(e))}_updateCamera(e){if(e||(e=this.getBounds()),e){if(this._cameraControl instanceof F){const t=e.getSize(new THREE.Vector3),n=Math.max(t.x,t.z),a=this._initData.moc?.5*n*-1:5,i=this._initData.moc?U:70;this._cameraControl.updateAndReset(t,e.getCenter(new THREE.Vector3),-15,i,a,!1)}this._cameraControl instanceof K&&this._cameraControl.updateToBounds(e.getSize(new THREE.Vector3),e.getCenter(new THREE.Vector3))}}_zoomToBounds(){const e=this.getBounds();this._cameraControl instanceof F&&this._cameraControl.zoomToFitBounds(e)}getBounds(){return this._planViewModel?this._planViewModel.getBoundingBox():null}cancelSelection(){this._plannerSceneEventHandler.cancelSelection(),this._highlight(null),this._requestRender()}deleteSelection(){const e=this._plannerSceneEventHandler.getSelectedIds();this.cancelSelection(),e.forEach(e=>{const t=this._planViewModel.getPlanObjectForId(e);t&&t.getObject()&&this._plannerKernelAccess.planInteractionHandler.removeElement(t.getKernelObject())})}rotateSelection(e){const t=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList,n=new THREE.Box3;this._plannerSceneEventHandler.getSelectedIds().forEach(e=>{const a=this._planViewModel.getPlanObjectForId(e);a&&a.getObject()&&(t.push_back(a.getPlanObject()),n.expandByObject(a.getContainer()))});const a=n.getCenter(new THREE.Vector3),i=this._plannerKernelAccess.planInteractionHandler.groupObjects(t);this._plannerKernelAccess.planInteractionHandler.rotateGroupBy(i,e,s(a))}planBoundsChanged(){this.updateEnvironment(this.getBounds()),this._requestRender()}planElementRemoved(e){this._onPlanChanged(),this._renderEverything()}_onPlanChanged(){this._roomlePlannerUiCallback.onPlanChanged()}prepareTopImage(e={}){return new Promise(t=>{this._planViewModel.materialQueue.finished(!0).then(async()=>{let n=this._calculateBoundingBoxOfAllMeshes(.1);this._lightSetting.removeFromScene();let a=await T(this._scene,null,n,e);this._lightSetting.addToScene(),this._requestRender(),t(a)})})}preparePerspectiveImage(e={}){return new Promise((t,n)=>{this._planViewModel.materialQueue.finished(!0).then(async()=>{let n;n=this._cameraControl instanceof F?this._cameraControl.getCamera().clone():this.getPerspectiveOffsetCamera();let a=this._calculateBoundingBoxOfAllMeshes();this._lightSetting.removeFromScene();const i=await R(this._scene,null,n,a,e);this._lightSetting.addToScene(),this._requestRender(),t(i)},n)})}_calculateBoundingBoxOfAllMeshes(e=0){const t=this.getBounds();return V(t,e)}enableRotation(){this._plannerSceneEventHandler.setState(2)}disableRotation(){this._plannerSceneEventHandler.resetState()}dragIn(e){this._plannerSceneEventHandler.setDragIn(!0,e)}getPlannerSceneEventHandler(){return this._plannerSceneEventHandler}}return a([i],e.prototype,"_plannerKernelAccess",void 0),a([i],e.prototype,"_rapiAccess",void 0),a([i],e.prototype,"_plannerMeshGenerator",void 0),a([i],e.prototype,"_plannerInputManager",void 0),a([i],e.prototype,"_roomlePlannerUiCallback",void 0),a([i],e.prototype,"_localStorageHelper",void 0),e})();const ie={left:0,top:1,right:1,bottom:0};let se=(()=>{class e{constructor(e){this._hscInstance=null,this._glbInstance=null,this._creator_=e,this._kernelAccessCallback.addListener(this),this._backstack.init([r.HSP],this)}deleteSelection(){this._sceneManager.deleteSelection()}rotateSelection(e){this._sceneManager.rotateSelection(e)}cancelSelection(){this._sceneManager.cancelSelection()}init(e,t,n){return c.start("loadingTime"),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):(this._preloadPlanId=t,this.setOverrides(n),new Promise(this._initPromiseCallback.bind(this)))}loadPlanXml(e,t){return this.setOverrides(t),new Promise(n=>{this._plan=this._planInteractionHandler.loadPlanXML(e),this._sceneManager.planXMLLoaded(this._plan),this._roomlePlannerUiCallback.onTotalFloorAreaChanged(this._planInteractionHandler.getPlan().getTotalFloorArea()),this._backstack.bringIntoForeground(r.HSP),this._initData.moc&&(t.id?this._rapiAccess.trackView(t.id):this._rapiAccess.trackView("planXML")),n()})}loadPlan(e,t){return this.setOverrides(t),new Promise((t,n)=>{this._rapiAccess.getPlan(e).then(n=>{this._plan=this._planInteractionHandler.loadPlanXML(n.planObjects),this._sceneManager.planXMLLoaded(this._plan),this._roomlePlannerUiCallback.onTotalFloorAreaChanged(this._planInteractionHandler.getPlan().getTotalFloorArea()),this._backstack.bringIntoForeground(r.HSP),this._initData.moc&&this._rapiAccess.trackView(e),t()},n)})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}switch2D(){this._sceneManager.switchTo2D()}switch3D(){this._sceneManager.switchTo3D()}switchToFirstPerson(){this._sceneManager.switchToFirstPerson()}exportGLB(){this._sceneManager.exportGLB()}importGLB(e){this._sceneManager.importGLB(e)}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(p,{id:"gltf-loader"}),n=this._scriptLoader.fetch(m,{id:"draco-loader"}),a=this._scriptLoader.fetch(q,{id:"tween-js"}),i=this._scriptLoader.fetch("static/Sky-6621935ea8a523af.js",{id:"sky-js"});Promise.all([t,n,a,i]).then(()=>{this._kernelReadyCallback=e;const{dls:t,ls:n,mode:a,stats:i}=this._initData;this._sceneManager||(this._sceneManager=new ae(this._creator_,ie,this,a)),this._preloadPlanId&&this._sceneManager.preload(this._preloadPlanId);const s=u.createDynamicLightSettingSource(t,n);i&&this.showStats(),this.enableHD(s),this._planInteractionHandler&&this._kernelReadyCallback()})})}enableHD(e){return new Promise((t,n)=>{const a=()=>{this._sceneManager.enableHD(e),t()};this._threeLoader.fetch().then(()=>Promise.all(X.map(e=>this._scriptLoader.fetch(e,{id:e})))).then(()=>{this._scriptLoader.fetch(W,{id:"pi-js"}).then(a,n)},n)})}isReady(){this._planInteractionHandler=this._plannerKernelAccess.planInteractionHandler,this._kernelReadyCallback&&this._kernelReadyCallback()}showBenchmarks(){c.showBenchmarks()}async switchToConfigurator(){const e=await this._singlePromiseFactory.create(3,"startHSC",e=>{if(this._hscInstance)return e(this._hscInstance);t.import("./configurator-21c32b82.legacy.js").then((function(e){return e.c})).then(({Configurator:t})=>{const n=new t(this._creator_);n.boot({kernelInstance:this._planInteractionHandler.getConfiguratorKernel(),kernelContainer:this._plannerKernelAccess.kernelContainer}),n.getApi().setOverrides(this._initData),n.getApi().init(this._domHelper.element).then(()=>{this._hscInstance=n,e(this._hscInstance)})})});return this._backstack.bringIntoForeground(r.HSC),this.cancelSelection(),e}async switchToViewer(){const e=await this._singlePromiseFactory.create(4,"startGLB",e=>{if(this._glbInstance)return e(this._glbInstance);t.import("./glb-viewer-056c11ee.legacy.js").then(t=>{const n=new t.GlbViewer(this._creator_);n.boot(),n.getApi().setOverrides(this._initData),n.getApi().init(this._domHelper.element).then(()=>{this._glbInstance=n,e(this._glbInstance)})})});return this._backstack.bringIntoForeground(r.GLB),this.cancelSelection(),e}switchToPlanner(e){e&&this.loadPlan(e),this._backstack.bringIntoForeground(r.HSP)}updateSize(){this._sceneManager.updateCamera()}getMain(){}update(){this.updateSize(),this._glbInstance&&this._glbInstance.getApi().updateSize(),this._hscInstance&&this._hscInstance.getApi().updateSize()}get callbacks(){return this._roomlePlannerUiCallback}set callbacks(e){this._roomlePlannerUiCallback=e}showStats(){this._sceneManager.showStats()}onBackStackChanged(e){this._roomlePlannerUiCallback.onBackStackChanged(e)}onCloseHSC(){this._sceneManager.closeHSC(),this._hscInstance&&this._hscInstance.getApi().pauseKernelCallbacks()}back(){if(this._backstack.current()===r.GLB&&this._glbInstance&&this._glbInstance.getApi().clearScene(),this._backstack.current()===r.HSC&&this._hscInstance){const e=this._hscInstance.getApi();e.cancelSelection(),e.cancelDockings(),e.hideDimensions(),e.disableMultiselect(),this._sceneManager.updateScene()}this._backstack.back()}backTo(e){this._backstack.backTo(e)}getConfigurator(){return this._hscInstance}getCurrentSkin(){return this._rapiAccess.getCurrentSkin()}getRuntimeComponentIdOfRootComponent(e){return e?this._plannerKernelAccess.planInteractionHandler?this._plannerKernelAccess.planInteractionHandler.getConfiguratorKernel().getRootPlanComponentIdFromObjectId(e):(console.warn("Can not retrieve runtime id without planInteractionHandler"),0):(console.warn("Can not retrieve runtime id without planObjectId"),0)}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}loadError(e){}getPlanInteractionHandler(){return Promise.resolve(this._planInteractionHandler)}getPlanModelViewHelper(){return Promise.resolve(this._plannerKernelAccess.planModelViewHelper)}async insertObject(e,t,n){if(!this._planInteractionHandler)throw new Error("no plan interaction handler");t&&(t=s(new THREE.Vector3(t.x,t.y,t.z)));const a=await(g(e)?this._rapiAccess.getItem(e):this._rapiAccess.getConfiguration(e)),i=await this._plannerKernelAccess.addPlanObjectFromItem(a,t,n);return this._sceneManager.updateScene(),i}async insertItemList(e){const t=e.map(e=>g(e)?this._rapiAccess.getItem(e):this._rapiAccess.getConfiguration(e)),n=await Promise.all(t);await this._plannerKernelAccess.insertItems(n)}async insertItems(e){await this._plannerKernelAccess.insertItems(e)}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getCameraOffset(){return this._sceneManager.getCameraOffset()}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}async getObjects(){const e=(await this.getPlanModelViewHelper()).getPlanOverview(this._plan);let t=[];for(let n=0;n<e.objects.size();n++)t.push(S(e.objects.get(n)));return t}async getPlanOverview(){const e=(await this.getPlanModelViewHelper()).getPlanOverview(this._plan);return S(e)}prepareTopImage(e={}){return this._sceneManager.prepareTopImage(e)}preparePerspectiveImage(e={}){return this._sceneManager.preparePerspectiveImage(e)}enableRotation(){this._sceneManager.enableRotation()}disableRotation(){this._sceneManager.disableRotation()}async dragInObject(e,t){this._sceneManager.dragIn(t);const n=await this._rapiAccess.getItem(e);this.insertItems([n])}enableSnapping(){this._planInteractionHandler.reactivateAllSnappingActivity()}disableSnapping(){this._planInteractionHandler.deactivateAllSnappingActivity()}}return a([i],e.prototype,"_domHelper",void 0),a([i],e.prototype,"_scriptLoader",void 0),a([i],e.prototype,"_kernelAccessCallback",void 0),a([i],e.prototype,"_plannerKernelAccess",void 0),a([i],e.prototype,"_rapiAccess",void 0),a([i],e.prototype,"_singlePromiseFactory",void 0),a([i],e.prototype,"_roomlePlannerUiCallback",void 0),a([i],e.prototype,"_lifeCycleManager",void 0),a([i],e.prototype,"_backstack",void 0),a([i],e.prototype,"_threeLoader",void 0),a([i],e.prototype,"_dataSyncer",void 0),a([i],e.prototype,"_initData",void 0),a([i],e.prototype,"_globalInitData",void 0),e})(),re=(()=>{class e{constructor(e){this._initialStack=[],this._creator_=e,this._lifeCycleManager.addEventListener(this)}_setInitialStack(e){this._initialStack=[...e]}_setCallbacks(e){this._callbacks=e}_resetCanvasStack(){this._canvasStack=[...this._initialStack]}init(e,t){this._setInitialStack(e),this._resetCanvasStack(),this._setCallbacks(t)}bringIntoForeground(e){const t=this._domHelper.element.querySelectorAll("canvas");let n=!1;t.forEach(t=>{if(t.classList.contains(e)){if(!t.classList.contains("foreground")){const t=this.current();t&&e!==t&&(this._canvasStack.push(e),n=!0),t||(n=!0)}t.classList.remove("background"),t.classList.add("foreground")}else t.classList.remove("foreground"),t.classList.add("background")}),n&&this._callbacks.onBackStackChanged(this._canvasStack)}current(){return this._canvasStack[this._canvasStack.length-1]}back(){if(1===this._canvasStack.length)return;let e=this._canvasStack.pop();this.bringIntoForeground(this.current()),e===r.HSC&&this._callbacks.onCloseHSC(),this._callbacks.onBackStackChanged(this._canvasStack)}backTo(e){if(1!==this._canvasStack.length&&this.current()!==e)for(;this._canvasStack.length>0;){let t=this.current();if(t===e){this.bringIntoForeground(t);break}t===r.HSC&&this._callbacks.onCloseHSC(),this._canvasStack.pop(),this._callbacks.onBackStackChanged(this._canvasStack)}}pause(){this._resetCanvasStack()}resume(){}destroy(){}}return a([i],e.prototype,"_domHelper",void 0),a([i],e.prototype,"_lifeCycleManager",void 0),e})();class oe{constructor(e){const{planElementViewModel:t}=e;this.planElementViewModel=t}}const le=[new v("script-loader",J),new v("planner-input-manager",class extends N{_canDrag(e){return!0}},1),new v("planner-kernel-access",O),new v("logger",f),new v("planner-mesh-generator",class extends Z{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=new THREE.MeshStandardMaterial({color:"#ffffff",roughness:1,metalness:0,opacity:1,envMap:null}),this._environmentLoader.setEnvMap(this._defaultMaterial)}generateGeometry(e=null,t,n,a,i,s=!1){let r;return r=s?this._generateGeometry(e,t,n,a,i).clone():this._generateGeometry(e,t,n,a,i),r}generateMesh(e=null,t,n,a,i,s,r,o=!1){const l=this.generateGeometry(e,n,a,i,s,o),h=new THREE.Mesh(l,this._previewMaterial);return h.layers.set(3),!t&&r&&7!==r.value?(console.warn("material is undefined"),h):(this.setMaterial(h,t,r).then(()=>{const e=r&&3===r.value;h.castShadow=!e}),this._checkWallMaterial(h,r),h)}async setMaterial(e,t,n){if(e.userData.material=w(t,n),e.userData.materialId=t,k(t))t?await this._assignMaterial(e,t):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._defaultMaterial));else{if(!t)return void this.changeMaterialOfMesh(e,this._defaultMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._defaultMaterial):(this.changeMaterialOfMesh(e,this._defaultMaterial),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{C(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}),new v("rapi-access",M),new v("roomle-planner-ui-callback",class extends E{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onBackStackChanged=e=>{},this.onCameraChanged=e=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,a)=>{},this.onSelectionCancel=()=>{},this.onPlanChanged=()=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{}}}),new v("configurator-ui-callbacks",A,1),new v("backstack",re),new v("planner-selection-handler",class extends Q{constructor(){super(...arguments),this._selectionMode="standard",this._selectedPlanElementViewModels=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedPlanElementViewModels.size&&this._selectedPlanElementViewModels.forEach((e,t)=>{this._selectedPlanElementViewModels.delete(t),this.dispatchEvent(1,new oe({planElementViewModel:e}))})}_checkStandard(e){if(this._selectedPlanElementViewModels.has(e.getId()))return this._selectedPlanElementViewModels.delete(e.getId()),void this.dispatchEvent(1,new oe({planElementViewModel:e}));this._selectedPlanElementViewModels.size>0&&this._selectedPlanElementViewModels.forEach((e,t)=>{this._selectedPlanElementViewModels.delete(t),this.dispatchEvent(1,new oe({planElementViewModel:e}))}),this._selectedPlanElementViewModels.set(e.getId(),e),this.dispatchEvent(0,new oe({planElementViewModel:e}))}_checkMulti(e){if(this._selectedPlanElementViewModels.has(e.getId()))return this._selectedPlanElementViewModels.delete(e.getId()),void this.dispatchEvent(1,new oe({planElementViewModel:e}));this._selectedPlanElementViewModels.set(e.getId(),e),this.dispatchEvent(0,new oe({planElementViewModel:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedPlanElementViewModels.size>0}getSelectedIds(){let e=[];return this._selectedPlanElementViewModels.forEach(t=>e.push(t.getId())),e}isSelected(e){return!!this._selectedPlanElementViewModels.get(e)}})];e("Planner",class extends Y{setupGlobals(){}setupDependencies(){b.setup(le),this.lookup("logger",this._context),this.lookup("planner-kernel-access",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._planner=new se(this._context),this._planner.getMain=()=>this,window.RoomlePlanner||(window.RoomlePlanner=this._planner)}getApi(){return this._planner}getContextName(){return"planner"}})}}}));
|
|
2
|
-
//# sourceMappingURL=planner-7afba417.legacy.js.map
|