@roomle/web-sdk 2.33.0 → 2.34.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-1d3127e8.js → banana-for-scale-3442b519.js} +2 -2
- package/lib/{banana-for-scale-1d3127e8.js.map → banana-for-scale-3442b519.js.map} +1 -1
- package/lib/{banana-for-scale-a63fb2df.nomodule.js → banana-for-scale-939e4df7.nomodule.js} +2 -2
- package/lib/{banana-for-scale-a63fb2df.nomodule.js.map → banana-for-scale-939e4df7.nomodule.js.map} +1 -1
- package/lib/{component-dimensioning-cd3fa46e.js → component-dimensioning-707b0007.js} +2 -2
- package/lib/component-dimensioning-707b0007.js.map +1 -0
- package/lib/{component-dimensioning-6c0c9199.nomodule.js → component-dimensioning-a2828832.nomodule.js} +2 -2
- package/lib/component-dimensioning-a2828832.nomodule.js.map +1 -0
- package/lib/{configurator-3cf0afc7.js → configurator-92943a85.js} +2 -2
- package/lib/{configurator-3cf0afc7.js.map → configurator-92943a85.js.map} +1 -1
- package/lib/{configurator-9ec75ff2.nomodule.js → configurator-9f1bcb78.nomodule.js} +2 -2
- package/lib/{configurator-9ec75ff2.nomodule.js.map → configurator-9f1bcb78.nomodule.js.map} +1 -1
- package/lib/configurator-main-262ae1ac.js +2 -0
- package/lib/configurator-main-262ae1ac.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{configurator-mesh-generator-3497564c.nomodule.js → configurator-mesh-generator-ab964e61.nomodule.js} +2 -2
- package/lib/configurator-mesh-generator-ab964e61.nomodule.js.map +1 -0
- package/lib/{configurator-mesh-generator-3151246c.js → configurator-mesh-generator-fdbe8e27.js} +2 -2
- package/lib/configurator-mesh-generator-fdbe8e27.js.map +1 -0
- package/lib/{default-light-setting-6852d456.nomodule.js → default-light-setting-1980d70c.nomodule.js} +2 -2
- package/lib/default-light-setting-1980d70c.nomodule.js.map +1 -0
- package/lib/{default-light-setting-825bb619.js → default-light-setting-5690f3c6.js} +2 -2
- package/lib/default-light-setting-5690f3c6.js.map +1 -0
- package/lib/{dimensioning-helper-edfc5933.nomodule.js → dimensioning-helper-8f8c7de4.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-edfc5933.nomodule.js.map → dimensioning-helper-8f8c7de4.nomodule.js.map} +1 -1
- package/lib/{dimensioning-helper-46403799.js → dimensioning-helper-a2f701e1.js} +2 -2
- package/lib/{dimensioning-helper-46403799.js.map → dimensioning-helper-a2f701e1.js.map} +1 -1
- package/lib/{glb-viewer-67e22889.js → glb-viewer-44cb38e7.js} +2 -2
- package/lib/{glb-viewer-67e22889.js.map → glb-viewer-44cb38e7.js.map} +1 -1
- package/lib/{glb-viewer-564c48c8.nomodule.js → glb-viewer-eac461db.nomodule.js} +2 -2
- package/lib/{glb-viewer-564c48c8.nomodule.js.map → glb-viewer-eac461db.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-0ef0fd4e.js +2 -0
- package/lib/glb-viewer-main-0ef0fd4e.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/{image-renderer-d3652216.js → image-renderer-5777b9d7.js} +2 -2
- package/lib/{image-renderer-d3652216.js.map → image-renderer-5777b9d7.js.map} +1 -1
- package/lib/{image-renderer-5394fa5b.nomodule.js → image-renderer-bf04d0a9.nomodule.js} +2 -2
- package/lib/{image-renderer-5394fa5b.nomodule.js.map → image-renderer-bf04d0a9.nomodule.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-2ae53764.legacy.js → banana-for-scale-6af330cd.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-2ae53764.legacy.js.map → banana-for-scale-6af330cd.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-eeddfbe4.legacy.js → component-dimensioning-2c1ef0a0.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-2c1ef0a0.legacy.js.map +1 -0
- package/lib/legacy/{configurator-b980d570.legacy.js → configurator-aaf3a182.legacy.js} +2 -2
- package/lib/legacy/{configurator-b980d570.legacy.js.map → configurator-aaf3a182.legacy.js.map} +1 -1
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{configurator-mesh-generator-32a1a893.legacy.js → configurator-mesh-generator-929313c6.legacy.js} +2 -2
- package/lib/legacy/configurator-mesh-generator-929313c6.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-0c03b9e5.legacy.js → default-light-setting-135fb853.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-135fb853.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-82ad5e54.legacy.js → dimensioning-helper-d2d6f040.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-82ad5e54.legacy.js.map → dimensioning-helper-d2d6f040.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-cb5014ee.legacy.js → glb-viewer-efc13817.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-cb5014ee.legacy.js.map → glb-viewer-efc13817.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{image-renderer-5dc590d6.legacy.js → image-renderer-3059c670.legacy.js} +2 -2
- package/lib/legacy/{image-renderer-5dc590d6.legacy.js.map → image-renderer-3059c670.legacy.js.map} +1 -1
- package/lib/legacy/{material-viewer-d7122341.legacy.js → material-viewer-014c4b3c.legacy.js} +2 -2
- package/lib/legacy/material-viewer-014c4b3c.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{mesh-generator-bcc95cb6.legacy.js → mesh-generator-e4d5131c.legacy.js} +2 -2
- package/lib/legacy/mesh-generator-e4d5131c.legacy.js.map +1 -0
- package/lib/legacy/{pixotron-35cea8f8.legacy.js → pixotron-3225a8b2.legacy.js} +2 -2
- package/lib/legacy/{pixotron-35cea8f8.legacy.js.map → pixotron-3225a8b2.legacy.js.map} +1 -1
- package/lib/legacy/{planner-b9154820.legacy.js → planner-586ddb9d.legacy.js} +2 -2
- package/lib/legacy/{planner-b9154820.legacy.js.map → planner-586ddb9d.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{rapi-access-ab9c7de3.legacy.js → rapi-access-3bfec303.legacy.js} +2 -2
- package/lib/legacy/{rapi-access-ab9c7de3.legacy.js.map → rapi-access-3bfec303.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/static/ConfiguratorKernel-3c16a462912d4363.wasm +0 -0
- package/lib/legacy/static/{ConfiguratorKernel-e9bbd4998a056b0b.js → ConfiguratorKernel-805ef8c9e2946584.js} +72 -73
- package/lib/legacy/static/ConfiguratorKernelJs-46632e2744e151e6.js +143 -0
- package/lib/legacy/static/ConfiguratorKernelJs-a7b190fe9a79da9f.mem +0 -0
- package/lib/legacy/static/{RoomleCore-18f96bc7c4c9fe8e.js → RoomleCore-41a17c2814f0726e.js} +81 -82
- package/lib/legacy/static/RoomleCore-eefc95fcacfbbdb7.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-5e547e7bf5b9b475.js +151 -0
- package/lib/legacy/static/RoomleCoreJs-f7d9879c184a770d.mem +0 -0
- package/lib/legacy/static/shaders-783e0f3c8bfe6cc2.json +1 -0
- package/lib/legacy/{stats-helper-0331e2a2.legacy.js → stats-helper-40981b2e.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-0331e2a2.legacy.js.map → stats-helper-40981b2e.legacy.js.map} +1 -1
- package/lib/{material-viewer-840eebf7.js → material-viewer-68be1ea0.js} +2 -2
- package/lib/material-viewer-68be1ea0.js.map +1 -0
- package/lib/{material-viewer-9c55d420.nomodule.js → material-viewer-d450271d.nomodule.js} +2 -2
- package/lib/material-viewer-d450271d.nomodule.js.map +1 -0
- package/lib/material-viewer-main-df962eec.js +2 -0
- package/lib/material-viewer-main-df962eec.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/{mesh-generator-7b9048c1.js → mesh-generator-68230db7.js} +2 -2
- package/lib/mesh-generator-68230db7.js.map +1 -0
- package/lib/{mesh-generator-95709715.nomodule.js → mesh-generator-7425611d.nomodule.js} +2 -2
- package/lib/mesh-generator-7425611d.nomodule.js.map +1 -0
- package/lib/{pixotron-2bc1795a.nomodule.js → pixotron-9fb32201.nomodule.js} +2 -2
- package/lib/{pixotron-2bc1795a.nomodule.js.map → pixotron-9fb32201.nomodule.js.map} +1 -1
- package/lib/{pixotron-bb62a4ac.js → pixotron-e06b4406.js} +2 -2
- package/lib/{pixotron-bb62a4ac.js.map → pixotron-e06b4406.js.map} +1 -1
- package/lib/{planner-625e04ba.nomodule.js → planner-c8feb6cc.nomodule.js} +2 -2
- package/lib/{planner-625e04ba.nomodule.js.map → planner-c8feb6cc.nomodule.js.map} +1 -1
- package/lib/{planner-93dd1048.js → planner-cc924d07.js} +2 -2
- package/lib/{planner-93dd1048.js.map → planner-cc924d07.js.map} +1 -1
- package/lib/planner-main-0b4d1c48.js +2 -0
- package/lib/planner-main-0b4d1c48.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{rapi-access-693b87b1.js → rapi-access-9de4b8ee.js} +2 -2
- package/lib/{rapi-access-693b87b1.js.map → rapi-access-9de4b8ee.js.map} +1 -1
- package/lib/{rapi-access-ec9bc9d3.nomodule.js → rapi-access-c3754bb1.nomodule.js} +2 -2
- package/lib/{rapi-access-ec9bc9d3.nomodule.js.map → rapi-access-c3754bb1.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-a81664de.js → roomle-sdk-25237d27.js} +2 -2
- package/lib/roomle-sdk-25237d27.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/static/ConfiguratorKernel-3c16a462912d4363.wasm +0 -0
- package/lib/static/ConfiguratorKernel-805ef8c9e2946584.js +1 -0
- package/lib/static/ConfiguratorKernel-805ef8c9e2946584.js.map +1 -0
- package/lib/static/ConfiguratorKernelJs-46632e2744e151e6.js +143 -0
- package/lib/static/ConfiguratorKernelJs-a7b190fe9a79da9f.mem +0 -0
- package/lib/static/RoomleCore-41a17c2814f0726e.js +1 -0
- package/lib/static/RoomleCore-41a17c2814f0726e.js.map +1 -0
- package/lib/static/RoomleCore-eefc95fcacfbbdb7.wasm +0 -0
- package/lib/static/RoomleCoreJs-5e547e7bf5b9b475.js +151 -0
- package/lib/static/RoomleCoreJs-f7d9879c184a770d.mem +0 -0
- package/lib/static/shaders-783e0f3c8bfe6cc2.json +1 -0
- package/lib/{stats-helper-90311a20.nomodule.js → stats-helper-2ba40e23.nomodule.js} +2 -2
- package/lib/{stats-helper-90311a20.nomodule.js.map → stats-helper-2ba40e23.nomodule.js.map} +1 -1
- package/lib/{stats-helper-47b1c13e.js → stats-helper-f8ec7e6b.js} +2 -2
- package/lib/{stats-helper-47b1c13e.js.map → stats-helper-f8ec7e6b.js.map} +1 -1
- package/package.json +2 -2
- package/lib/component-dimensioning-6c0c9199.nomodule.js.map +0 -1
- package/lib/component-dimensioning-cd3fa46e.js.map +0 -1
- package/lib/configurator-main-2b41551f.js +0 -2
- package/lib/configurator-main-2b41551f.js.map +0 -1
- package/lib/configurator-mesh-generator-3151246c.js.map +0 -1
- package/lib/configurator-mesh-generator-3497564c.nomodule.js.map +0 -1
- package/lib/default-light-setting-6852d456.nomodule.js.map +0 -1
- package/lib/default-light-setting-825bb619.js.map +0 -1
- package/lib/glb-viewer-main-2dfab30f.js +0 -2
- package/lib/glb-viewer-main-2dfab30f.js.map +0 -1
- package/lib/legacy/component-dimensioning-eeddfbe4.legacy.js.map +0 -1
- package/lib/legacy/configurator-mesh-generator-32a1a893.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-0c03b9e5.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-d7122341.legacy.js.map +0 -1
- package/lib/legacy/mesh-generator-bcc95cb6.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-4153106c16b35980.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-02aa8157cf299656.js +0 -143
- package/lib/legacy/static/ConfiguratorKernelJs-795532b819912c59.mem +0 -0
- package/lib/legacy/static/RoomleCore-daed88a09e86faf7.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-10b4a8ee2a89da25.mem +0 -0
- package/lib/legacy/static/RoomleCoreJs-1e5e3331b2d12a5a.js +0 -151
- package/lib/legacy/static/shaders-34f19089b7cddbfe.json +0 -1
- package/lib/material-viewer-840eebf7.js.map +0 -1
- package/lib/material-viewer-9c55d420.nomodule.js.map +0 -1
- package/lib/material-viewer-main-27d70f5b.js +0 -2
- package/lib/material-viewer-main-27d70f5b.js.map +0 -1
- package/lib/mesh-generator-7b9048c1.js.map +0 -1
- package/lib/mesh-generator-95709715.nomodule.js.map +0 -1
- package/lib/planner-main-3e727a01.js +0 -2
- package/lib/planner-main-3e727a01.js.map +0 -1
- package/lib/roomle-sdk-a81664de.js.map +0 -1
- package/lib/static/ConfiguratorKernel-4153106c16b35980.wasm +0 -0
- package/lib/static/ConfiguratorKernel-e9bbd4998a056b0b.js +0 -1
- package/lib/static/ConfiguratorKernel-e9bbd4998a056b0b.js.map +0 -1
- package/lib/static/ConfiguratorKernelJs-02aa8157cf299656.js +0 -143
- package/lib/static/ConfiguratorKernelJs-795532b819912c59.mem +0 -0
- package/lib/static/RoomleCore-18f96bc7c4c9fe8e.js +0 -1
- package/lib/static/RoomleCore-18f96bc7c4c9fe8e.js.map +0 -1
- package/lib/static/RoomleCore-daed88a09e86faf7.wasm +0 -0
- package/lib/static/RoomleCoreJs-10b4a8ee2a89da25.mem +0 -0
- package/lib/static/RoomleCoreJs-1e5e3331b2d12a5a.js +0 -151
- package/lib/static/shaders-34f19089b7cddbfe.json +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./rapi-access-ab9c7de3.legacy.js","./main-thread-to-worker-fb98950d.legacy.js","./pixotron-35cea8f8.legacy.js","./mesh-generator-bcc95cb6.legacy.js","./default-light-setting-0c03b9e5.legacy.js"],(function(e){var t,n,r,o,i,a,s,l,c,d,h,u,_,p,g,m,C,b,f,E,P,y,I,k,j,w,R,O,M,L,v,H,T,x,D;return{setters:[function(e){t=e._,n=e.i,r=e.O,o=e.B,i=e.A,a=e.n,s=e.Q,l=e.j,c=e.E,d=e.q,h=e.S,u=e.U,_=e.T,p=e.F,g=e.V,m=e.d,C=e.W,b=e.X,f=e.Y,E=e.Z,P=e.$,y=e.a0,I=e.a1,k=e.a2,j=e.r,w=e.k,R=e.a3,O=e.a4,M=e.t,L=e.J},function(e){v=e.f},function(e){H=e.E,T=e.L},function(e){x=e.P},function(e){D=e.D}],execute:function(){e("G","static/GLTFExporter-86edae059df3a219.js");const S=["material"],A=(e,t)=>{const{overrideCountry:n,locale:r}=t;n&&(e.resetPriceListIds(),e.addPriceList(n)),e.setEnvironmentVariable("language",r)};e("K",(()=>{class e extends r{constructor(e){super(e,1),this.externalMeshQueue=new x,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{},o.addMeta("kernel_is_ready",{isWasm:this._useWASM}),i.kernelInstance?(this._kernelContainer=i.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){o.start("kernel_is_ready"),i.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,r=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),r.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,r)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,r=!1,o=[];e&&e.forEach(e=>{let i=this._kernelInstance.getComponent(e);i.componentId=this._kernelInstance.getComponentId(e),i&&i.childIds&&i.childIds.length>0&&(n=!0),i.id===t&&(r=!0),o.push(i)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",r,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 r=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(r),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(r)}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,r){const o=this._kernelInstance.getComponentId(n),i=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,r,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(o,r,i,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,r=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),o=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),a.finishOperation(3,[o,r])}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(s,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(s,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,r,o,i){"string"==typeof r?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,o,i),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,r,o,i){"string"==typeof r?this._kernelInstance.setComponentParameter(e,t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,o,i),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,r,o,i){"string"==typeof r?this._kernelInstance.setPlanObjectParameter(e,t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,o,i)}_finishParameterChange(e,t,n){-1===S.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const r=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(r,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let r=this._kernelInstance.getPlanObjectParameters,o=e;t&&(r=this._kernelInstance.getComponentParameters,o=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(r.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(),o.end("kernel_is_ready"),o.start("kernel_create_instance"),i.kernelInstance?this._kernelInstance=i.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,this._kernelContainer.registerConfiguratorCallback(this),o.end("kernel_create_instance"),A(this._kernelInstance,this._globalInitData),c.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:d}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),i.planObjectId&&this.planObjectCreated(-1,i.planObjectId),this._kernelInstance.useEnvironmentGeometry(!0)}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,r,o){a.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:r,errors:d(o)}),this._configuratorKernelCallbackListener.forEach(i=>i.configurationLoaded(e,t,n,r,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=d(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 r=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(r=>r.planObjectConfigurationUpdated(e,t,n));const o=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(o),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,r),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 r=new Promise((e,t)=>{n=e});let o;this.externalMeshQueue.push(r);try{o=await this._rapiAccess.getMesh(e,h,t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(o.url,!0))),i=await r.arrayBuffer();this._handleCortoMesh(i,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,r){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,r,!1)),r&&r>0&&this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentDocked(e,r,t,n))}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),o.end("ui_load_configuration"),this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}return t([n],e.prototype,"_memoryManager",void 0),t([n],e.prototype,"_configuratorKernelAccessCallback",void 0),t([n],e.prototype,"_configuratorHistory",void 0),e})()),e("C",class extends u{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,o)=>{},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 U{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 B 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 U;const t=_(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(this.getSize(),e.customColor),p(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(_(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=g(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){m(this._container),this._selectionMesh&&m(this._selectionMesh)}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=C())}_generateBoundingBox(e,t){e.addScalar(.01);let n=new THREE.BoxGeometry(e.x,e.y,e.z),r=new THREE.Color(b);t>0&&(r=f(t));let o=new THREE.MeshStandardMaterial({color:r,opacity:E,transparent:!0}),i=new THREE.Mesh(n,o);return i.name="bounding box",i.position.y=e.y/2,i.castShadow=!1,i.receiveShadow=!1,i.layers.set(5),i}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:E,transparent:!0});const t=_(this.getPlanElement().getCenter());this._selectionMesh=new THREE.Mesh(P(t,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class G extends B{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return y(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class V extends G{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",V);let K=e("c",(()=>{class e extends G{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=v(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?y(t.size):void 0,r=new THREE.Vector3(1,1,1);return t.flipX&&(r.x*=-1),t.flipY&&(r.z*=-1),new Promise(o=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,r,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),I(t,this._glbUrl),p(t),this._container.add(this.getObject()),this.hidePreviewBox(),o()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return t([n],e.prototype,"_staticItemLoader",void 0),e})());class F extends B{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}_generateBoundingBox(e,t){const n=super._generateBoundingBox(e,t);return n.layers.set(8),n}}class z extends B{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 q extends B{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)}}class W extends B{constructor(e){super(e),this._container.name="Node Plan Element"}addMesh(e){super.addMesh(e)}}let N=e("P",(()=>{class e extends r{constructor(e){super(e,0),this._plannerKernelCallbackListener=new Set,o.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,A(this._kernelInstance,this._globalInitData),this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),c.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,o){}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,h,t)}catch(e){throw console.error(e),e}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(n.url,!0))),o=await r.arrayBuffer();this._handleCortoMesh(o,e,t)}catch(e){throw console.error(e),e}}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(o=>o.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 Q(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 V(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);else{n=new K(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);const o=t.getCatalogItemId();o&&this._rapiAccess.getItem(o).then(e=>{n.setRapiItem(e)})}this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{const n=t;let r,o=!0;if(t.getType()===this._kernelContainer.PlanElementType.WALL?r=new F(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?r=new z(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?r=new q(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(r=new W(n),o=!1),!r)return;this._coupleReferences(r,n),e.extRef.jsObject.addPlanElementViewModel(r),o&&(r.setPrimaryColor(this._initData.colors.PRIMARY),this.planModelViewHelper.requestMesh3d(t)),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(null))}}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,o,i){this._plannerKernelCallbackListener.forEach(a=>a.addMesh(e,t,n,r,o,i))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,o,i,a){this._plannerKernelCallbackListener.forEach(s=>s.addPlanMesh(e,t,n,r,o,i,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 t([n],e.prototype,"_kernelAccessCallback",void 0),t([n],e.prototype,"_roomlePlannerUiCallback",void 0),e})()),Q=(()=>{class e extends k{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionGroup=new THREE.Group,this._constructionGroup.name="Construction",this._ceilingGroup=new THREE.Group,this._ceilingGroup.name="Ceiling",this._floorGroup=new THREE.Group,this._ceilingGroup.name="Ceiling",this._getKernelAccess().addPlannerListener(this)}planBoundsChanged(){}_getKernelAccess(){return j.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 V?this._configurablePlanObjectViewModels.push(e):e instanceof K?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof F?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):e instanceof z?this._floorGroup.add(e.getContainer()):e instanceof q&&this._ceilingGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof V&&(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}getFloorGroup(){return this._floorGroup}getBoundingBox(){const e=this.getCorePlan();return e?w(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,o,i,a,s,l){return this._plannerMeshGenerator.generateMesh(t,n,r,o,i,a,s,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,r,o){super.Editor3dComponentCreated(e,t,n,r,o),this._getKernelAccess()instanceof N&&this.dockComponent(e,r,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e){this._constructionGroup.clear(),this._ceilingGroup.clear(),this._floorGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,r,o,i,a){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,r,o,i){const a=e.extRef.jsObject;let s=a.getMesh(t);s?s.geometry=this._plannerMeshGenerator.generateGeometry(null,n,r,o,i):(s=this._generateMesh(0,null,t,n,r,o,i,e.getType()),a.addMesh(s))}removePlanObjectFromScene(e){const t=e.getPlanElement().getType();this._isConstructionType(t)?this._constructionGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.FLOOR?this._floorGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.CEILING&&this._ceilingGroup.remove(e.getContainer()),e.clear()}_isConstructionType(e){return e===this._getKernelAccess().kernelContainer.PlanElementType.WALL||e===this._getKernelAccess().kernelContainer.PlanElementType.NODE}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 t([n],e.prototype,"_plannerMeshGenerator",void 0),e})();const Y=M(30);class $ extends H{constructor(e,t,n,r){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===r?1:r,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.enableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new THREE.Plane(new THREE.Vector3(0,1,0)),this._planeFront=new THREE.Plane(new THREE.Vector3(0,0,1)),this._planeSide=new THREE.Plane(new THREE.Vector3(1,0,0))}setLayers(e){this._raycaster.layers=e}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(6,e=>{this._findHover(e.positionRelative,e.type)},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){this._intersection(e)&&this._inputManager.onElementHit()}_findSelection(e){let t=this._intersection(e);t?t&&t.object.dispatchEvent({type:"select"}):this.dispatchEvent(3)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(e,this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(e,this._camera);let t,n=new THREE.Vector3(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,r=new THREE.Vector3(0,0,0),o=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,r),this._raycaster.ray.intersectPlane(this._planeSide,o);let i,a=this._getDistanceToCamera(o),s=this._getDistanceToCamera(r);return n>=-Y&&n<=Y?i=t<s?e.clone():r.clone():t<s&&t<a?i=e.clone():s<t&&s<a?i=r.clone():a<t&&a<s&&(i=o.clone()),i}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return R(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&&O(this._currentDrag),this._currentHover&&O(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}e("S",class extends H{constructor(e,t,n,r){super(),this._debug=!1,this._dragIn=!1,this._inputManager=r,this._raycastHelper=new $(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 X extends T{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=L();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 J=()=>(Z||(Z=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),Z.outputEncoding=THREE.sRGBEncoding),Z.autoClear=!0,Z),ee=(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,o={})=>new Promise(i=>{const{size:a=1024,showDimensions:s}=o,l=J();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 D(e);n.layers.disable(2),n.layers.disable(5),s?n.layers.enable(7):n.layers.disable(7),ee(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(),i({image:u,width:a,height:a,blob:null})})),e("r",(e,t,n,r,o,i)=>new Promise(r=>{i||(i=1024);const o=J();o.setSize(i,i);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?ee(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),o.render(e,t);const l=o.domElement.toDataURL();t.layers.enable(2),e.background=s,e.fog=a,r({image:l,width:i,height:i,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(M(r)),e.rotateX(M(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()}));e("b",(e,t,n,r={})=>{const{showDimensions:o=!1}=r;return new Promise(r=>{const i=J();i.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(M(-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}i.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=o?new X(e):new D(e);a.layers.disable(2),a.layers.disable(5),o?a.layers.enable(7):a.layers.disable(7),i.render(e,a),t&&(i.clearDepth(),i.render(t,a));let u=i.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-
|
|
1
|
+
System.register(["./rapi-access-3bfec303.legacy.js","./main-thread-to-worker-fb98950d.legacy.js","./pixotron-3225a8b2.legacy.js","./mesh-generator-e4d5131c.legacy.js","./default-light-setting-135fb853.legacy.js"],(function(e){var t,n,r,o,i,a,s,l,c,d,h,u,_,p,g,m,C,b,f,E,P,y,I,k,j,w,R,O,M,L,v,H,T,x,D;return{setters:[function(e){t=e._,n=e.i,r=e.O,o=e.B,i=e.A,a=e.n,s=e.Q,l=e.j,c=e.E,d=e.q,h=e.S,u=e.U,_=e.T,p=e.F,g=e.V,m=e.d,C=e.W,b=e.X,f=e.Y,E=e.Z,P=e.$,y=e.a0,I=e.a1,k=e.a2,j=e.r,w=e.k,R=e.a3,O=e.a4,M=e.t,L=e.J},function(e){v=e.f},function(e){H=e.E,T=e.L},function(e){x=e.P},function(e){D=e.D}],execute:function(){e("G","static/GLTFExporter-86edae059df3a219.js");const S=["material"],A=(e,t)=>{const{overrideCountry:n,locale:r}=t;n&&(e.resetPriceListIds(),e.addPriceList(n)),e.setEnvironmentVariable("language",r)};e("K",(()=>{class e extends r{constructor(e){super(e,1),this.externalMeshQueue=new x,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{},o.addMeta("kernel_is_ready",{isWasm:this._useWASM}),i.kernelInstance?(this._kernelContainer=i.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){o.start("kernel_is_ready"),i.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,r=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),r.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,r)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,r=!1,o=[];e&&e.forEach(e=>{let i=this._kernelInstance.getComponent(e);i.componentId=this._kernelInstance.getComponentId(e),i&&i.childIds&&i.childIds.length>0&&(n=!0),i.id===t&&(r=!0),o.push(i)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",r,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 r=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(r),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(r)}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,r){const o=this._kernelInstance.getComponentId(n),i=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,r,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(o,r,i,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,r=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),o=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),a.finishOperation(3,[o,r])}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(s,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(s,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,r,o,i){"string"==typeof r?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,o,i),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,r,o,i){"string"==typeof r?this._kernelInstance.setComponentParameter(e,t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,o,i),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,r,o,i){"string"==typeof r?this._kernelInstance.setPlanObjectParameter(e,t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,o,i)}_finishParameterChange(e,t,n){-1===S.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const r=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(r,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let r=this._kernelInstance.getPlanObjectParameters,o=e;t&&(r=this._kernelInstance.getComponentParameters,o=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(r.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(),o.end("kernel_is_ready"),o.start("kernel_create_instance"),i.kernelInstance?this._kernelInstance=i.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,this._kernelContainer.registerConfiguratorCallback(this),o.end("kernel_create_instance"),A(this._kernelInstance,this._globalInitData),c.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:d}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),i.planObjectId&&this.planObjectCreated(-1,i.planObjectId),this._kernelInstance.useEnvironmentGeometry(!0)}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,r,o){a.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:r,errors:d(o)}),this._configuratorKernelCallbackListener.forEach(i=>i.configurationLoaded(e,t,n,r,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=d(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 r=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(r=>r.planObjectConfigurationUpdated(e,t,n));const o=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(o),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,r),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 r=new Promise((e,t)=>{n=e});let o;this.externalMeshQueue.push(r);try{o=await this._rapiAccess.getMesh(e,h,t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(o.url,!0))),i=await r.arrayBuffer();this._handleCortoMesh(i,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,r){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,r,!1)),r&&r>0&&this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentDocked(e,r,t,n))}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),o.end("ui_load_configuration"),this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}return t([n],e.prototype,"_memoryManager",void 0),t([n],e.prototype,"_configuratorKernelAccessCallback",void 0),t([n],e.prototype,"_configuratorHistory",void 0),e})()),e("C",class extends u{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,o)=>{},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 U{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 B 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 U;const t=_(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(this.getSize(),e.customColor),p(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(_(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=g(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){m(this._container),this._selectionMesh&&m(this._selectionMesh)}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=C())}_generateBoundingBox(e,t){e.addScalar(.01);let n=new THREE.BoxGeometry(e.x,e.y,e.z),r=new THREE.Color(b);t>0&&(r=f(t));let o=new THREE.MeshStandardMaterial({color:r,opacity:E,transparent:!0}),i=new THREE.Mesh(n,o);return i.name="bounding box",i.position.y=e.y/2,i.castShadow=!1,i.receiveShadow=!1,i.layers.set(5),i}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:E,transparent:!0});const t=_(this.getPlanElement().getCenter());this._selectionMesh=new THREE.Mesh(P(t,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class G extends B{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return y(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class V extends G{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",V);let K=e("c",(()=>{class e extends G{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=v(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?y(t.size):void 0,r=new THREE.Vector3(1,1,1);return t.flipX&&(r.x*=-1),t.flipY&&(r.z*=-1),new Promise(o=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,r,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),I(t,this._glbUrl),p(t),this._container.add(this.getObject()),this.hidePreviewBox(),o()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return t([n],e.prototype,"_staticItemLoader",void 0),e})());class F extends B{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}_generateBoundingBox(e,t){const n=super._generateBoundingBox(e,t);return n.layers.set(8),n}}class z extends B{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 q extends B{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)}}class W extends B{constructor(e){super(e),this._container.name="Node Plan Element"}addMesh(e){super.addMesh(e)}}let N=e("P",(()=>{class e extends r{constructor(e){super(e,0),this._plannerKernelCallbackListener=new Set,o.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,A(this._kernelInstance,this._globalInitData),this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),c.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,o){}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,h,t)}catch(e){throw console.error(e),e}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(n.url,!0))),o=await r.arrayBuffer();this._handleCortoMesh(o,e,t)}catch(e){throw console.error(e),e}}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(o=>o.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 Q(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 V(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);else{n=new K(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);const o=t.getCatalogItemId();o&&this._rapiAccess.getItem(o).then(e=>{n.setRapiItem(e)})}this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{const n=t;let r,o=!0;if(t.getType()===this._kernelContainer.PlanElementType.WALL?r=new F(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?r=new z(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?r=new q(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(r=new W(n),o=!1),!r)return;this._coupleReferences(r,n),e.extRef.jsObject.addPlanElementViewModel(r),o&&(r.setPrimaryColor(this._initData.colors.PRIMARY),this.planModelViewHelper.requestMesh3d(t)),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(null))}}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,o,i){this._plannerKernelCallbackListener.forEach(a=>a.addMesh(e,t,n,r,o,i))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,o,i,a){this._plannerKernelCallbackListener.forEach(s=>s.addPlanMesh(e,t,n,r,o,i,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 t([n],e.prototype,"_kernelAccessCallback",void 0),t([n],e.prototype,"_roomlePlannerUiCallback",void 0),e})()),Q=(()=>{class e extends k{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionGroup=new THREE.Group,this._constructionGroup.name="Construction",this._ceilingGroup=new THREE.Group,this._ceilingGroup.name="Ceiling",this._floorGroup=new THREE.Group,this._ceilingGroup.name="Ceiling",this._getKernelAccess().addPlannerListener(this)}planBoundsChanged(){}_getKernelAccess(){return j.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 V?this._configurablePlanObjectViewModels.push(e):e instanceof K?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof F?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):e instanceof z?this._floorGroup.add(e.getContainer()):e instanceof q&&this._ceilingGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof V&&(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}getFloorGroup(){return this._floorGroup}getBoundingBox(){const e=this.getCorePlan();return e?w(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,o,i,a,s,l){return this._plannerMeshGenerator.generateMesh(t,n,r,o,i,a,s,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,r,o){super.Editor3dComponentCreated(e,t,n,r,o),this._getKernelAccess()instanceof N&&this.dockComponent(e,r,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e){this._constructionGroup.clear(),this._ceilingGroup.clear(),this._floorGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,r,o,i,a){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,r,o,i){const a=e.extRef.jsObject;let s=a.getMesh(t);s?s.geometry=this._plannerMeshGenerator.generateGeometry(null,n,r,o,i):(s=this._generateMesh(0,null,t,n,r,o,i,e.getType()),a.addMesh(s))}removePlanObjectFromScene(e){const t=e.getPlanElement().getType();this._isConstructionType(t)?this._constructionGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.FLOOR?this._floorGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.CEILING&&this._ceilingGroup.remove(e.getContainer()),e.clear()}_isConstructionType(e){return e===this._getKernelAccess().kernelContainer.PlanElementType.WALL||e===this._getKernelAccess().kernelContainer.PlanElementType.NODE}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 t([n],e.prototype,"_plannerMeshGenerator",void 0),e})();const Y=M(30);class $ extends H{constructor(e,t,n,r){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===r?1:r,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.enableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new THREE.Plane(new THREE.Vector3(0,1,0)),this._planeFront=new THREE.Plane(new THREE.Vector3(0,0,1)),this._planeSide=new THREE.Plane(new THREE.Vector3(1,0,0))}setLayers(e){this._raycaster.layers=e}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(6,e=>{this._findHover(e.positionRelative,e.type)},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){this._intersection(e)&&this._inputManager.onElementHit()}_findSelection(e){let t=this._intersection(e);t?t&&t.object.dispatchEvent({type:"select"}):this.dispatchEvent(3)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(e,this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(e,this._camera);let t,n=new THREE.Vector3(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,r=new THREE.Vector3(0,0,0),o=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,r),this._raycaster.ray.intersectPlane(this._planeSide,o);let i,a=this._getDistanceToCamera(o),s=this._getDistanceToCamera(r);return n>=-Y&&n<=Y?i=t<s?e.clone():r.clone():t<s&&t<a?i=e.clone():s<t&&s<a?i=r.clone():a<t&&a<s&&(i=o.clone()),i}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return R(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&&O(this._currentDrag),this._currentHover&&O(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}e("S",class extends H{constructor(e,t,n,r){super(),this._debug=!1,this._dragIn=!1,this._inputManager=r,this._raycastHelper=new $(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 X extends T{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=L();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 J=()=>(Z||(Z=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),Z.outputEncoding=THREE.sRGBEncoding),Z.autoClear=!0,Z),ee=(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,o={})=>new Promise(i=>{const{size:a=1024,showDimensions:s}=o,l=J();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 D(e);n.layers.disable(2),n.layers.disable(5),s?n.layers.enable(7):n.layers.disable(7),ee(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(),i({image:u,width:a,height:a,blob:null})})),e("r",(e,t,n,r,o,i)=>new Promise(r=>{i||(i=1024);const o=J();o.setSize(i,i);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?ee(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),o.render(e,t);const l=o.domElement.toDataURL();t.layers.enable(2),e.background=s,e.fog=a,r({image:l,width:i,height:i,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(M(r)),e.rotateX(M(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()}));e("b",(e,t,n,r={})=>{const{showDimensions:o=!1}=r;return new Promise(r=>{const i=J();i.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(M(-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}i.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=o?new X(e):new D(e);a.layers.disable(2),a.layers.disable(5),o?a.layers.enable(7):a.layers.disable(7),i.render(e,a),t&&(i.clearDepth(),i.render(t,a));let u=i.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-3059c670.legacy.js.map
|
package/lib/legacy/{image-renderer-5dc590d6.legacy.js.map → image-renderer-3059c670.legacy.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-renderer-
|
|
1
|
+
{"version":3,"file":"image-renderer-3059c670.legacy.js","sources":["../../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"8mBAAe"}
|
package/lib/legacy/{material-viewer-d7122341.legacy.js → material-viewer-014c4b3c.legacy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-ab9c7de3.legacy.js","./main-thread-to-worker-fb98950d.legacy.js","./pixotron-35cea8f8.legacy.js","./mesh-generator-bcc95cb6.legacy.js","./configurator-mesh-generator-32a1a893.legacy.js"],(function(e){var t,a,i,r,s,n,o,h,l,m,_,d,c,p,g,u,M,w,y,C,f,P,E,S,v,b,x,T,R;return{setters:[function(){},function(e){t=e._,a=e.i,i=e.C,r=e.D,s=e.P,n=e.G,o=e.ac,h=e.ad,l=e.J,m=e.ae,_=e.H,d=e.aa,c=e.U,p=e.e,g=e.L,u=e.af,M=e.f,w=e.r},function(){},function(e){y=e.S,C=e.a,f=e.C,P=e.F,E=e.T,S=e.P,v=e.d,b=e.b,x=e.I,T=e.M},function(){},function(e){R=e.C}],execute:function(){let G=(()=>{class e extends y{constructor(e,t){super(e,t,i.RMV,"3D",!1),this._sceneParams={type:"cube"},this._materialParams={color:"#ffffff",metallic:.5,alpha:0,alphaCutoff:0,doubleSided:!1},this._renderer.capabilities.maxTextures>8&&this.loadDynamicLightSetting(r.createDynamicLightSettingSource(null,s.CAMERA)),this._initScene()}_initScene(){const e=new THREE.BoxGeometry(1,1,1,100,100,100),t=new THREE.MeshPhysicalMaterial({color:this._initData.colors.PRIMARY});this._environmentLoader.setEnvMap(t),this._setMaterial(t),this._mesh=new THREE.Mesh(e,this._material),this._mesh.castShadow=!0,this._mesh.position.setY(.5),this._scene.add(this._mesh);const{initialFloorMaterial:a}=this._initData;if(a?this.changeFloorMaterialById(a):this._environment=new C(this._scene,null,new THREE.Color(16777215)),this._cameraControl instanceof f){const e=new THREE.Box3;e.setFromObject(this._mesh),this._cameraControl.updateAndReset(e.getSize(new THREE.Vector3),e.getCenter(new THREE.Vector3))}this.showGUI()}loadMaterialId(e){return new Promise(t=>{this._configuratorMeshGenerator.loadMaterial(e,1e3,1e3).then(e=>{this._setMaterial(e),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})})}loadMaterial(e){return new Promise(t=>{e.__rapi_path__||(e.__rapi_path__="materials"),this._setMaterial(n(e,this._environmentLoader)),this._mesh.material=this._material,this._configuratorMeshGenerator.loadTextures(e,this._material,100,100).then(()=>{this._updateGUI(),this._requestRender()}),t()})}loadMaterialShading(e){return new Promise(t=>{let a={shading:e};this._setMaterial(o(this._material,a,this._environmentLoader)),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})}_setMaterial(e){this._material=e,this._materialParams.alpha=e.opacity,this._materialParams.alphaCutoff=e.alphaTest,this._materialParams.color="#"+e.color.getHexString(),this._materialParams.doubleSided=e.side===THREE.DoubleSide,this._materialParams.metallic=1===e.metalness?1:e.reflectivity}getMaterialShading(){return h(this._material)}createCameraControl(e,t){this._cameraControl=new f(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._inputManager}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:200,accumulative:!0},shadowparams:{shadowMapResolution:1024,shadowRadius:1,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:50,side:THREE.FrontSide}}}getBakedShadowParams(){return{enable:!1,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4}}getBounds(){return this._mesh?(new THREE.Box3).setFromObject(this._mesh):null}_guiLoaded(){this._updateGUI()}_updateGUI(){let e=l();e&&(this._guiGeometryFolder||(this._guiGeometryFolder=e.addFolder("Geometry"),this._guiGeometryFolder.add(this._sceneParams,"type",{Cube:"cube",Sphere:"sphere",PlaneVertical:"plane_vertical",PlaneHorizontal:"plane_horizontal"}).onChange(e=>{this._setGeometry()})),this._material&&(this._guiMaterialFolder&&e.removeFolder(this._guiMaterialFolder),this._guiMaterialFolder=e.addFolder("Material"),this._guiMaterialFolder.addColor(this._materialParams,"color").onChange(e=>{this._material.color=new THREE.Color(e),this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"metallic").min(0).max(1).step(.01).onChange(e=>{this._material.metalness=1===e?1:.5,this._material.reflectivity=e||.5,this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"roughness").min(0).max(1).step(.01).onChange(e=>{this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"transmission").min(0).max(1).step(.01).onChange(e=>{this._material.transmission=e,e>0&&(this._material.opacity=1,this._material.alphaTest=.5,this._material.depthWrite=!1,this._material.transparent=!0,this._material.metalness=0),this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alpha").min(0).max(1).step(.01).onChange(e=>{this._material.transparent=e<1,this._material.opacity=e,this._material.depthWrite=e>=1,this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alphaCutoff").min(0).max(1).step(.01).onChange(e=>{this._material.alphaTest=e||0,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"doubleSided").onChange(e=>{this._material.side=e?THREE.DoubleSide:THREE.FrontSide,this._shadingChanged()})),this._addGUIListener(e))}_shadingChanged(){this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(h(this._material))}setGeometry(e){this._sceneParams.type=e,this._setGeometry()}_setGeometry(){let e;"cube"===this._sceneParams.type&&(e=new THREE.BoxGeometry(1,1,1,100,100,100)),"sphere"===this._sceneParams.type&&(e=new THREE.SphereGeometry(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new THREE.PlaneGeometry(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new THREE.PlaneGeometry(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof P||(this._environment=new P(this._scene,this._environment,!0)),this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),new Promise((e,a)=>{this._environment.changeFloorMaterial(t,this._maxAnisotropy).then(()=>{this._requestRender(),e()},a)})}async addTexture(e,t){const a=100/(0===e.mmWidth?1:e.mmWidth),i=100/(0===e.mmHeight?1:e.mmHeight);if(t){const r=new Image;r.src=t;const s=new THREE.Texture;s.image=r,r.onload=function(){s.needsUpdate=!0},m(s,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures)}else await _(e.image,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures);this._requestRender()}removeTexture(e){"ORM"===e.mapping&&(this._material.aoMap=null,this._material.roughnessMap=null,this._material.metalnessMap=null),"RGB"!==e.mapping&&"RGBA"!==e.mapping||(this._material.map=null),"XYZ"===e.mapping&&(this._material.normalMap=null),this._material.needsUpdate=!0,this._requestRender()}clearCache(){this._configuratorMeshGenerator.clear()}}return t([a],e.prototype,"_inputManager",void 0),t([a],e.prototype,"_configuratorMeshGenerator",void 0),t([a],e.prototype,"_roomleMaterialViewerUiCallback",void 0),t([a],e.prototype,"_rapiAccess",void 0),e})(),F=(()=>{class e{constructor(e){this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e){return this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(d,{id:"gltf-loader"}),a=this._scriptLoader.fetch(E,{id:"tween-js"});Promise.all([t,a]).then(()=>{this._sceneManager=new G(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const a=()=>{this._sceneManager.enableHD(),e()};Promise.all(S.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(v,{id:"pi-js"}).then(a,t)},t)})}get callbacks(){return this._roomleMaterialViewerUiCallback}set callbacks(e){this._roomleMaterialViewerUiCallback=e}loadMaterialShading(e){return this._sceneManager.loadMaterialShading(e)}loadMaterial(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterial(e)}loadMaterialId(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterialId(e)}getMaterialShading(){return this._sceneManager.getMaterialShading()}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}setOverrides(e){e&&this._initData.setOverrides(e)}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}async changeFloorMaterialById(e){return this._sceneManager.changeFloorMaterialById(e)}setGeometry(e){this._sceneManager.setGeometry(e)}async addTexture(e,t){return this._sceneManager.addTexture(e,t)}removeTexture(e){return this._sceneManager.removeTexture(e)}_clearCaches(){this._rapiAccess.cleanUp(),this._sceneManager.clearCache()}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}}return t([a],e.prototype,"_domHelper",void 0),t([a],e.prototype,"_scriptLoader",void 0),t([a],e.prototype,"_lifeCycleManager",void 0),t([a],e.prototype,"_threeLoader",void 0),t([a],e.prototype,"_roomleMaterialViewerUiCallback",void 0),t([a],e.prototype,"_initData",void 0),t([a],e.prototype,"_rapiAccess",void 0),e})();const H=[new p("script-loader",b),new p("logger",g),new p("input-manager",x,1),new p("environment-loader",u),new p("configurator-mesh-generator",R),new p("rapi-access",M),new p("roomle-material-viewer-ui-callback",class extends c{constructor(e){super(e),this.onMaterialShadingChanged=e=>{}}},1)];e("MaterialViewer",class extends T{setupGlobals(){}setupDependencies(){w.setup(H),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new F(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}})}}}));
|
|
2
|
-
//# sourceMappingURL=material-viewer-
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-3bfec303.legacy.js","./main-thread-to-worker-fb98950d.legacy.js","./pixotron-3225a8b2.legacy.js","./mesh-generator-e4d5131c.legacy.js","./configurator-mesh-generator-929313c6.legacy.js"],(function(e){var t,a,i,r,s,n,o,h,l,m,_,d,c,p,g,u,M,w,y,C,f,P,E,S,v,b,x,T,R;return{setters:[function(){},function(e){t=e._,a=e.i,i=e.C,r=e.D,s=e.P,n=e.G,o=e.ac,h=e.ad,l=e.J,m=e.ae,_=e.H,d=e.aa,c=e.U,p=e.e,g=e.L,u=e.af,M=e.f,w=e.r},function(){},function(e){y=e.S,C=e.a,f=e.C,P=e.F,E=e.T,S=e.P,v=e.d,b=e.b,x=e.I,T=e.M},function(){},function(e){R=e.C}],execute:function(){let G=(()=>{class e extends y{constructor(e,t){super(e,t,i.RMV,"3D",!1),this._sceneParams={type:"cube"},this._materialParams={color:"#ffffff",metallic:.5,alpha:0,alphaCutoff:0,doubleSided:!1},this._renderer.capabilities.maxTextures>8&&this.loadDynamicLightSetting(r.createDynamicLightSettingSource(null,s.CAMERA)),this._initScene()}_initScene(){const e=new THREE.BoxGeometry(1,1,1,100,100,100),t=new THREE.MeshPhysicalMaterial({color:this._initData.colors.PRIMARY});this._environmentLoader.setEnvMap(t),this._setMaterial(t),this._mesh=new THREE.Mesh(e,this._material),this._mesh.castShadow=!0,this._mesh.position.setY(.5),this._scene.add(this._mesh);const{initialFloorMaterial:a}=this._initData;if(a?this.changeFloorMaterialById(a):this._environment=new C(this._scene,null,new THREE.Color(16777215)),this._cameraControl instanceof f){const e=new THREE.Box3;e.setFromObject(this._mesh),this._cameraControl.updateAndReset(e.getSize(new THREE.Vector3),e.getCenter(new THREE.Vector3))}this.showGUI()}loadMaterialId(e){return new Promise(t=>{this._configuratorMeshGenerator.loadMaterial(e,1e3,1e3).then(e=>{this._setMaterial(e),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})})}loadMaterial(e){return new Promise(t=>{e.__rapi_path__||(e.__rapi_path__="materials"),this._setMaterial(n(e,this._environmentLoader)),this._mesh.material=this._material,this._configuratorMeshGenerator.loadTextures(e,this._material,100,100).then(()=>{this._updateGUI(),this._requestRender()}),t()})}loadMaterialShading(e){return new Promise(t=>{let a={shading:e};this._setMaterial(o(this._material,a,this._environmentLoader)),this._mesh.material=this._material,this._updateGUI(),this._requestRender(),t()})}_setMaterial(e){this._material=e,this._materialParams.alpha=e.opacity,this._materialParams.alphaCutoff=e.alphaTest,this._materialParams.color="#"+e.color.getHexString(),this._materialParams.doubleSided=e.side===THREE.DoubleSide,this._materialParams.metallic=1===e.metalness?1:e.reflectivity}getMaterialShading(){return h(this._material)}createCameraControl(e,t){this._cameraControl=new f(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._inputManager}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:200,accumulative:!0},shadowparams:{shadowMapResolution:1024,shadowRadius:1,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:50,side:THREE.FrontSide}}}getBakedShadowParams(){return{enable:!1,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4}}getBounds(){return this._mesh?(new THREE.Box3).setFromObject(this._mesh):null}_guiLoaded(){this._updateGUI()}_updateGUI(){let e=l();e&&(this._guiGeometryFolder||(this._guiGeometryFolder=e.addFolder("Geometry"),this._guiGeometryFolder.add(this._sceneParams,"type",{Cube:"cube",Sphere:"sphere",PlaneVertical:"plane_vertical",PlaneHorizontal:"plane_horizontal"}).onChange(e=>{this._setGeometry()})),this._material&&(this._guiMaterialFolder&&e.removeFolder(this._guiMaterialFolder),this._guiMaterialFolder=e.addFolder("Material"),this._guiMaterialFolder.addColor(this._materialParams,"color").onChange(e=>{this._material.color=new THREE.Color(e),this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"metallic").min(0).max(1).step(.01).onChange(e=>{this._material.metalness=1===e?1:.5,this._material.reflectivity=e||.5,this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"roughness").min(0).max(1).step(.01).onChange(e=>{this._shadingChanged()}),this._guiMaterialFolder.add(this._material,"transmission").min(0).max(1).step(.01).onChange(e=>{this._material.transmission=e,e>0&&(this._material.opacity=1,this._material.alphaTest=.5,this._material.depthWrite=!1,this._material.transparent=!0,this._material.metalness=0),this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alpha").min(0).max(1).step(.01).onChange(e=>{this._material.transparent=e<1,this._material.opacity=e,this._material.depthWrite=e>=1,this._mesh.castShadow=!this._material.transparent,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"alphaCutoff").min(0).max(1).step(.01).onChange(e=>{this._material.alphaTest=e||0,this._shadingChanged()}),this._guiMaterialFolder.add(this._materialParams,"doubleSided").onChange(e=>{this._material.side=e?THREE.DoubleSide:THREE.FrontSide,this._shadingChanged()})),this._addGUIListener(e))}_shadingChanged(){this._roomleMaterialViewerUiCallback.onMaterialShadingChanged(h(this._material))}setGeometry(e){this._sceneParams.type=e,this._setGeometry()}_setGeometry(){let e;"cube"===this._sceneParams.type&&(e=new THREE.BoxGeometry(1,1,1,100,100,100)),"sphere"===this._sceneParams.type&&(e=new THREE.SphereGeometry(.5,100,100)),"plane_horizontal"===this._sceneParams.type&&(e=new THREE.PlaneGeometry(1,1),e.rotateX(-Math.PI/2)),"plane_vertical"===this._sceneParams.type&&(e=new THREE.PlaneGeometry(1,1)),this._mesh.geometry=e,this._renderEverything()}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._environment&&this._environment instanceof P||(this._environment=new P(this._scene,this._environment,!0)),this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),new Promise((e,a)=>{this._environment.changeFloorMaterial(t,this._maxAnisotropy).then(()=>{this._requestRender(),e()},a)})}async addTexture(e,t){const a=100/(0===e.mmWidth?1:e.mmWidth),i=100/(0===e.mmHeight?1:e.mmHeight);if(t){const r=new Image;r.src=t;const s=new THREE.Texture;s.image=r,r.onload=function(){s.needsUpdate=!0},m(s,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures)}else await _(e.image,e,this._material,this._maxAnisotropy,a,i,this._renderer.capabilities.maxTextures);this._requestRender()}removeTexture(e){"ORM"===e.mapping&&(this._material.aoMap=null,this._material.roughnessMap=null,this._material.metalnessMap=null),"RGB"!==e.mapping&&"RGBA"!==e.mapping||(this._material.map=null),"XYZ"===e.mapping&&(this._material.normalMap=null),this._material.needsUpdate=!0,this._requestRender()}clearCache(){this._configuratorMeshGenerator.clear()}}return t([a],e.prototype,"_inputManager",void 0),t([a],e.prototype,"_configuratorMeshGenerator",void 0),t([a],e.prototype,"_roomleMaterialViewerUiCallback",void 0),t([a],e.prototype,"_rapiAccess",void 0),e})(),F=(()=>{class e{constructor(e){this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e){return this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(d,{id:"gltf-loader"}),a=this._scriptLoader.fetch(E,{id:"tween-js"});Promise.all([t,a]).then(()=>{this._sceneManager=new G(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const a=()=>{this._sceneManager.enableHD(),e()};Promise.all(S.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(v,{id:"pi-js"}).then(a,t)},t)})}get callbacks(){return this._roomleMaterialViewerUiCallback}set callbacks(e){this._roomleMaterialViewerUiCallback=e}loadMaterialShading(e){return this._sceneManager.loadMaterialShading(e)}loadMaterial(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterial(e)}loadMaterialId(e,t={}){return t.flushCache&&this._clearCaches(),this._sceneManager.loadMaterialId(e)}getMaterialShading(){return this._sceneManager.getMaterialShading()}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}setOverrides(e){e&&this._initData.setOverrides(e)}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}async changeFloorMaterialById(e){return this._sceneManager.changeFloorMaterialById(e)}setGeometry(e){this._sceneManager.setGeometry(e)}async addTexture(e,t){return this._sceneManager.addTexture(e,t)}removeTexture(e){return this._sceneManager.removeTexture(e)}_clearCaches(){this._rapiAccess.cleanUp(),this._sceneManager.clearCache()}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}}return t([a],e.prototype,"_domHelper",void 0),t([a],e.prototype,"_scriptLoader",void 0),t([a],e.prototype,"_lifeCycleManager",void 0),t([a],e.prototype,"_threeLoader",void 0),t([a],e.prototype,"_roomleMaterialViewerUiCallback",void 0),t([a],e.prototype,"_initData",void 0),t([a],e.prototype,"_rapiAccess",void 0),e})();const H=[new p("script-loader",b),new p("logger",g),new p("input-manager",x,1),new p("environment-loader",u),new p("configurator-mesh-generator",R),new p("rapi-access",M),new p("roomle-material-viewer-ui-callback",class extends c{constructor(e){super(e),this.onMaterialShadingChanged=e=>{}}},1)];e("MaterialViewer",class extends T{setupGlobals(){}setupDependencies(){w.setup(H),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new F(this._context),window.RoomleMaterialViewer||(window.RoomleMaterialViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"material-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=material-viewer-014c4b3c.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-viewer-014c4b3c.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-
|
|
1
|
+
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-3bfec303.legacy.js","./main-thread-to-worker-fb98950d.legacy.js","./pixotron-3225a8b2.legacy.js","./mesh-generator-e4d5131c.legacy.js","./configurator-mesh-generator-929313c6.legacy.js","./material-viewer-014c4b3c.legacy.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(){},function(c){e=c.MaterialViewer}],execute:function(){(new e).boot()}}}));
|
|
2
2
|
//# sourceMappingURL=material-viewer-main.legacy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./rapi-access-
|
|
2
|
-
//# sourceMappingURL=mesh-generator-
|
|
1
|
+
System.register(["./rapi-access-3bfec303.legacy.js","./main-thread-to-worker-fb98950d.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.X,s=e.a5,i=e.a6,o=e.G,h=e.H},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-e4d5131c.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-generator-e4d5131c.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|