@roomle/web-sdk 2.35.0 → 2.36.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/lib/{banana-for-scale-01a40f7a.nomodule.js → banana-for-scale-7d269b84.nomodule.js} +2 -2
  2. package/lib/{banana-for-scale-01a40f7a.nomodule.js.map → banana-for-scale-7d269b84.nomodule.js.map} +1 -1
  3. package/lib/{banana-for-scale-ae7acba1.js → banana-for-scale-fccf40b0.js} +2 -2
  4. package/lib/{banana-for-scale-ae7acba1.js.map → banana-for-scale-fccf40b0.js.map} +1 -1
  5. package/lib/{component-dimensioning-cbcaf431.nomodule.js → component-dimensioning-7f0b21cb.nomodule.js} +2 -2
  6. package/lib/component-dimensioning-7f0b21cb.nomodule.js.map +1 -0
  7. package/lib/{component-dimensioning-78625f46.js → component-dimensioning-85dba72d.js} +2 -2
  8. package/lib/component-dimensioning-85dba72d.js.map +1 -0
  9. package/lib/{component-raycast-helper-549c8ae1.js → component-raycast-helper-9b0a9001.js} +2 -2
  10. package/lib/component-raycast-helper-9b0a9001.js.map +1 -0
  11. package/lib/{component-raycast-helper-13b853d3.nomodule.js → component-raycast-helper-de345b4a.nomodule.js} +2 -2
  12. package/lib/component-raycast-helper-de345b4a.nomodule.js.map +1 -0
  13. package/lib/{configurator-ee75ff28.js → configurator-6549a336.js} +2 -2
  14. package/lib/configurator-6549a336.js.map +1 -0
  15. package/lib/{configurator-8bbf3a38.nomodule.js → configurator-c9710d21.nomodule.js} +2 -2
  16. package/lib/configurator-c9710d21.nomodule.js.map +1 -0
  17. package/lib/configurator-dummy-app.js +1 -1
  18. package/lib/configurator-dummy-app.js.map +1 -1
  19. package/lib/configurator-main-2345d721.js +2 -0
  20. package/lib/configurator-main-2345d721.js.map +1 -0
  21. package/lib/configurator-main.nomodule.js +1 -1
  22. package/lib/{default-light-setting-6dd9587a.nomodule.js → default-light-setting-84270b95.nomodule.js} +2 -2
  23. package/lib/default-light-setting-84270b95.nomodule.js.map +1 -0
  24. package/lib/{default-light-setting-702bc838.js → default-light-setting-9ed8c484.js} +2 -2
  25. package/lib/default-light-setting-9ed8c484.js.map +1 -0
  26. package/lib/definitions/common-core/src/services/environment-loader.d.ts +6 -0
  27. package/lib/definitions/common-core/src/utils/common-utils.d.ts +6 -0
  28. package/lib/definitions/common-core/src/view-model/configurator-view-model.d.ts +2 -0
  29. package/lib/definitions/common-core/src/view-model/plan-element-view-model.d.ts +1 -0
  30. package/lib/definitions/configurator-core/src/utils/component-dimensioning-helper.d.ts +2 -1
  31. package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +2 -1
  32. package/lib/{dimensioning-helper-d8ccc5a9.nomodule.js → dimensioning-helper-118608cf.nomodule.js} +2 -2
  33. package/lib/{dimensioning-helper-d8ccc5a9.nomodule.js.map → dimensioning-helper-118608cf.nomodule.js.map} +1 -1
  34. package/lib/{dimensioning-helper-98e00844.js → dimensioning-helper-27aa6b1c.js} +2 -2
  35. package/lib/{dimensioning-helper-98e00844.js.map → dimensioning-helper-27aa6b1c.js.map} +1 -1
  36. package/lib/{glb-viewer-17793f36.js → glb-viewer-90bdd054.js} +2 -2
  37. package/lib/{glb-viewer-17793f36.js.map → glb-viewer-90bdd054.js.map} +1 -1
  38. package/lib/{glb-viewer-963970fb.nomodule.js → glb-viewer-a63b0463.nomodule.js} +2 -2
  39. package/lib/{glb-viewer-963970fb.nomodule.js.map → glb-viewer-a63b0463.nomodule.js.map} +1 -1
  40. package/lib/glb-viewer-main-d705f227.js +2 -0
  41. package/lib/glb-viewer-main-d705f227.js.map +1 -0
  42. package/lib/glb-viewer-main.nomodule.js +1 -1
  43. package/lib/legacy/{banana-for-scale-1cad6906.legacy.js → banana-for-scale-f0f24a8a.legacy.js} +2 -2
  44. package/lib/legacy/{banana-for-scale-1cad6906.legacy.js.map → banana-for-scale-f0f24a8a.legacy.js.map} +1 -1
  45. package/lib/legacy/{component-dimensioning-77ba0d28.legacy.js → component-dimensioning-f6319d77.legacy.js} +2 -2
  46. package/lib/legacy/component-dimensioning-f6319d77.legacy.js.map +1 -0
  47. package/lib/legacy/{component-raycast-helper-feb21fd3.legacy.js → component-raycast-helper-f25362d3.legacy.js} +2 -2
  48. package/lib/legacy/component-raycast-helper-f25362d3.legacy.js.map +1 -0
  49. package/lib/legacy/{configurator-55749e3c.legacy.js → configurator-9516b676.legacy.js} +2 -2
  50. package/lib/legacy/configurator-9516b676.legacy.js.map +1 -0
  51. package/lib/legacy/configurator-main.legacy.js +1 -1
  52. package/lib/legacy/{default-light-setting-d15a9123.legacy.js → default-light-setting-57b4da0a.legacy.js} +2 -2
  53. package/lib/legacy/default-light-setting-57b4da0a.legacy.js.map +1 -0
  54. package/lib/legacy/{dimensioning-helper-54f30880.legacy.js → dimensioning-helper-68dc010f.legacy.js} +2 -2
  55. package/lib/legacy/{dimensioning-helper-54f30880.legacy.js.map → dimensioning-helper-68dc010f.legacy.js.map} +1 -1
  56. package/lib/legacy/{glb-viewer-a0468968.legacy.js → glb-viewer-8f0ba881.legacy.js} +2 -2
  57. package/lib/legacy/{glb-viewer-a0468968.legacy.js.map → glb-viewer-8f0ba881.legacy.js.map} +1 -1
  58. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  59. package/lib/legacy/{material-viewer-c1b64c49.legacy.js → material-viewer-80422a2f.legacy.js} +2 -2
  60. package/lib/legacy/material-viewer-80422a2f.legacy.js.map +1 -0
  61. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  62. package/lib/legacy/{pixotron-c3147237.legacy.js → pixotron-d723be5f.legacy.js} +2 -2
  63. package/lib/legacy/{pixotron-c3147237.legacy.js.map → pixotron-d723be5f.legacy.js.map} +1 -1
  64. package/lib/legacy/planner-a38d4453.legacy.js +2 -0
  65. package/lib/legacy/{planner-408cc0e1.legacy.js.map → planner-a38d4453.legacy.js.map} +1 -1
  66. package/lib/legacy/planner-main.legacy.js +1 -1
  67. package/lib/legacy/roomle-configurator-30b6b70d.legacy.js +2 -0
  68. package/lib/legacy/{roomle-configurator-60e1c49a.legacy.js.map → roomle-configurator-30b6b70d.legacy.js.map} +1 -1
  69. package/lib/legacy/roomle-dependency-injection-82abffba.legacy.js +16 -0
  70. package/lib/legacy/{roomle-dependency-injection-07d3dd01.legacy.js.map → roomle-dependency-injection-82abffba.legacy.js.map} +1 -1
  71. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  72. package/lib/legacy/static/{ConfiguratorKernel-648649775f904f5a.js → ConfiguratorKernel-65576c77dcbcf095.js} +73 -73
  73. package/lib/legacy/static/ConfiguratorKernel-9f67b7e88d0bd992.wasm +0 -0
  74. package/lib/legacy/static/ConfiguratorKernelJs-4dc085be87a3e6e0.mem +0 -0
  75. package/lib/legacy/static/ConfiguratorKernelJs-935c7588ff18e960.js +146 -0
  76. package/lib/legacy/static/RoomleCore-893a02359b06c69e.js +129 -0
  77. package/lib/legacy/static/RoomleCore-b631890cd6f7f9df.wasm +0 -0
  78. package/lib/legacy/static/RoomleCoreJs-0bb526365f5c3f91.mem +0 -0
  79. package/lib/legacy/static/RoomleCoreJs-f5fe1b6e08c282c6.js +154 -0
  80. package/lib/legacy/static/shaders-63802d07b3443bcb.json +1 -0
  81. package/lib/legacy/{stats-helper-a5b6d704.legacy.js → stats-helper-129e98f2.legacy.js} +2 -2
  82. package/lib/legacy/{stats-helper-a5b6d704.legacy.js.map → stats-helper-129e98f2.legacy.js.map} +1 -1
  83. package/lib/{material-viewer-9487c5d3.nomodule.js → material-viewer-6d67a7fe.nomodule.js} +2 -2
  84. package/lib/material-viewer-6d67a7fe.nomodule.js.map +1 -0
  85. package/lib/{material-viewer-03aa07c6.js → material-viewer-d4c555be.js} +2 -2
  86. package/lib/material-viewer-d4c555be.js.map +1 -0
  87. package/lib/material-viewer-main-470ce4f6.js +2 -0
  88. package/lib/material-viewer-main-470ce4f6.js.map +1 -0
  89. package/lib/material-viewer-main.nomodule.js +1 -1
  90. package/lib/{pixotron-00bf7542.nomodule.js → pixotron-067be719.nomodule.js} +2 -2
  91. package/lib/{pixotron-00bf7542.nomodule.js.map → pixotron-067be719.nomodule.js.map} +1 -1
  92. package/lib/{pixotron-891cc455.js → pixotron-28ef478c.js} +2 -2
  93. package/lib/{pixotron-891cc455.js.map → pixotron-28ef478c.js.map} +1 -1
  94. package/lib/planner-4ca8aa4e.nomodule.js +2 -0
  95. package/lib/{planner-d8fe36fa.nomodule.js.map → planner-4ca8aa4e.nomodule.js.map} +1 -1
  96. package/lib/planner-959a2f93.js +2 -0
  97. package/lib/{planner-420e2309.js.map → planner-959a2f93.js.map} +1 -1
  98. package/lib/planner-dummy-app.js +1 -1
  99. package/lib/planner-dummy-app.js.map +1 -1
  100. package/lib/planner-main-75a2b465.js +2 -0
  101. package/lib/planner-main-75a2b465.js.map +1 -0
  102. package/lib/planner-main.nomodule.js +1 -1
  103. package/lib/roomle-configurator-1799a79d.js +2 -0
  104. package/lib/{roomle-configurator-ee548bf9.js.map → roomle-configurator-1799a79d.js.map} +1 -1
  105. package/lib/roomle-configurator-a55bbbfe.nomodule.js +2 -0
  106. package/lib/{roomle-configurator-ac23719f.nomodule.js.map → roomle-configurator-a55bbbfe.nomodule.js.map} +1 -1
  107. package/lib/roomle-dependency-injection-c680c022.nomodule.js +16 -0
  108. package/lib/{roomle-dependency-injection-86b1fe1f.nomodule.js.map → roomle-dependency-injection-c680c022.nomodule.js.map} +1 -1
  109. package/lib/roomle-dependency-injection-dcf7fa2f.js +16 -0
  110. package/lib/{roomle-dependency-injection-b3b8e294.js.map → roomle-dependency-injection-dcf7fa2f.js.map} +1 -1
  111. package/lib/{roomle-sdk-b40ffe47.js → roomle-sdk-572b0df0.js} +2 -2
  112. package/lib/roomle-sdk-572b0df0.js.map +1 -0
  113. package/lib/roomle-sdk.nomodule.js +1 -1
  114. package/lib/static/ConfiguratorKernel-65576c77dcbcf095.js +1 -0
  115. package/lib/static/ConfiguratorKernel-65576c77dcbcf095.js.map +1 -0
  116. package/lib/static/ConfiguratorKernel-9f67b7e88d0bd992.wasm +0 -0
  117. package/lib/static/ConfiguratorKernelJs-4dc085be87a3e6e0.mem +0 -0
  118. package/lib/static/ConfiguratorKernelJs-935c7588ff18e960.js +146 -0
  119. package/lib/static/RoomleCore-893a02359b06c69e.js +1 -0
  120. package/lib/static/RoomleCore-893a02359b06c69e.js.map +1 -0
  121. package/lib/static/RoomleCore-b631890cd6f7f9df.wasm +0 -0
  122. package/lib/static/RoomleCoreJs-0bb526365f5c3f91.mem +0 -0
  123. package/lib/static/RoomleCoreJs-f5fe1b6e08c282c6.js +154 -0
  124. package/lib/static/shaders-63802d07b3443bcb.json +1 -0
  125. package/lib/{stats-helper-13e5c35b.js → stats-helper-2bc9b875.js} +2 -2
  126. package/lib/{stats-helper-13e5c35b.js.map → stats-helper-2bc9b875.js.map} +1 -1
  127. package/lib/{stats-helper-399776ca.nomodule.js → stats-helper-e9cb51e8.nomodule.js} +2 -2
  128. package/lib/{stats-helper-399776ca.nomodule.js.map → stats-helper-e9cb51e8.nomodule.js.map} +1 -1
  129. package/package.json +2 -2
  130. package/lib/component-dimensioning-78625f46.js.map +0 -1
  131. package/lib/component-dimensioning-cbcaf431.nomodule.js.map +0 -1
  132. package/lib/component-raycast-helper-13b853d3.nomodule.js.map +0 -1
  133. package/lib/component-raycast-helper-549c8ae1.js.map +0 -1
  134. package/lib/configurator-8bbf3a38.nomodule.js.map +0 -1
  135. package/lib/configurator-ee75ff28.js.map +0 -1
  136. package/lib/configurator-main-3b1ccf10.js +0 -2
  137. package/lib/configurator-main-3b1ccf10.js.map +0 -1
  138. package/lib/default-light-setting-6dd9587a.nomodule.js.map +0 -1
  139. package/lib/default-light-setting-702bc838.js.map +0 -1
  140. package/lib/glb-viewer-main-d6b02ed8.js +0 -2
  141. package/lib/glb-viewer-main-d6b02ed8.js.map +0 -1
  142. package/lib/legacy/component-dimensioning-77ba0d28.legacy.js.map +0 -1
  143. package/lib/legacy/component-raycast-helper-feb21fd3.legacy.js.map +0 -1
  144. package/lib/legacy/configurator-55749e3c.legacy.js.map +0 -1
  145. package/lib/legacy/default-light-setting-d15a9123.legacy.js.map +0 -1
  146. package/lib/legacy/material-viewer-c1b64c49.legacy.js.map +0 -1
  147. package/lib/legacy/planner-408cc0e1.legacy.js +0 -2
  148. package/lib/legacy/roomle-configurator-60e1c49a.legacy.js +0 -2
  149. package/lib/legacy/roomle-dependency-injection-07d3dd01.legacy.js +0 -16
  150. package/lib/legacy/static/ConfiguratorKernel-b4d2685e62f9e4b5.wasm +0 -0
  151. package/lib/legacy/static/ConfiguratorKernelJs-920679f2aabf7dbc.js +0 -143
  152. package/lib/legacy/static/ConfiguratorKernelJs-9ac93b7a4aacd6d1.mem +0 -0
  153. package/lib/legacy/static/RoomleCore-0b58c19a64d2b307.js +0 -129
  154. package/lib/legacy/static/RoomleCore-6293af9714e2dfbb.wasm +0 -0
  155. package/lib/legacy/static/RoomleCoreJs-3aae1893a351b096.mem +0 -0
  156. package/lib/legacy/static/RoomleCoreJs-e967877c65d6d8b8.js +0 -151
  157. package/lib/legacy/static/shaders-660cf55cf5a61a2d.json +0 -1
  158. package/lib/material-viewer-03aa07c6.js.map +0 -1
  159. package/lib/material-viewer-9487c5d3.nomodule.js.map +0 -1
  160. package/lib/material-viewer-main-d5d5b287.js +0 -2
  161. package/lib/material-viewer-main-d5d5b287.js.map +0 -1
  162. package/lib/planner-420e2309.js +0 -2
  163. package/lib/planner-d8fe36fa.nomodule.js +0 -2
  164. package/lib/planner-main-f766df76.js +0 -2
  165. package/lib/planner-main-f766df76.js.map +0 -1
  166. package/lib/roomle-configurator-ac23719f.nomodule.js +0 -2
  167. package/lib/roomle-configurator-ee548bf9.js +0 -2
  168. package/lib/roomle-dependency-injection-86b1fe1f.nomodule.js +0 -16
  169. package/lib/roomle-dependency-injection-b3b8e294.js +0 -16
  170. package/lib/roomle-sdk-b40ffe47.js.map +0 -1
  171. package/lib/static/ConfiguratorKernel-648649775f904f5a.js +0 -1
  172. package/lib/static/ConfiguratorKernel-648649775f904f5a.js.map +0 -1
  173. package/lib/static/ConfiguratorKernel-b4d2685e62f9e4b5.wasm +0 -0
  174. package/lib/static/ConfiguratorKernelJs-920679f2aabf7dbc.js +0 -143
  175. package/lib/static/ConfiguratorKernelJs-9ac93b7a4aacd6d1.mem +0 -0
  176. package/lib/static/RoomleCore-0b58c19a64d2b307.js +0 -1
  177. package/lib/static/RoomleCore-0b58c19a64d2b307.js.map +0 -1
  178. package/lib/static/RoomleCore-6293af9714e2dfbb.wasm +0 -0
  179. package/lib/static/RoomleCoreJs-3aae1893a351b096.mem +0 -0
  180. package/lib/static/RoomleCoreJs-e967877c65d6d8b8.js +0 -151
  181. package/lib/static/shaders-660cf55cf5a61a2d.json +0 -1
@@ -0,0 +1,2 @@
1
+ System.register(["./roomle-dependency-injection-82abffba.legacy.js","./main-thread-to-worker-6f382b43.legacy.js","./pixotron-d723be5f.legacy.js","./default-light-setting-57b4da0a.legacy.js"],(function(e,t){var n,i,o,s,r,a,l,c,h,d,_,g,p,u,m,C,f,v,b,y,w,E,H,P,I,S,D,M,R,x,k,O,L,T,A,B,V,j,G,U,K,F,z,q,W;return{setters:[function(e){n=e._,i=e.i,o=e.C,s=e.s,r=e.S,a=e.W,l=e.F,c=e.u,h=e.w,d=e.P,_=e.E,g=e.x,p=e.y,u=e.t,m=e.z,C=e.k,f=e.d,v=e.G,b=e.H,y=e.b,w=e.n,E=e.J,H=e.m,P=e.K,I=e.B,S=e.o,D=e.N,M=e.O,R=e.Q,x=e.A,k=e.T,O=e.U,L=e.V,T=e.X},function(e){A=e.b},function(e){B=e.L,V=e.b,j=e.B,G=e.c,U=e.F,K=e.C,F=e.P,z=e.T,q=e.d},function(e){W=e.D}],execute:function(){var N=e("G","static/GLTFExporter-86edae059df3a219.js");e("P",(()=>{class e extends o{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(){}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null,super.clearReference()}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){e instanceof s?this._configurablePlanObjectViewModels.push(e):e instanceof r?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof a?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):e instanceof l?this._floorGroup.add(e.getContainer()):e instanceof c&&this._ceilingGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof s&&(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(){if("configurator"===this._configuratorContext.baseContext){const e=this.getPlanObjectForId(this._configuratorContext.planElementId);if(e)return e.getBounds()}if("glb-viewer"===this._configuratorContext.baseContext){const e=this._plannerSceneEventHandler.getSelectedIds();if(e&&1===e.length){const t=this.getPlanObjectForId(e[0]);if(t)return t.getBounds()}}const e=this.getCorePlan();if(e)try{return h(e.getBounds())}catch(e){console.error(e)}return(new THREE.Box3).setFromObject(this._constructionGroup)}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}sceneCleared(){this._configurablePlanObjectViewModels.forEach(e=>{e.remove()}),this._staticPlanObjectViewModels.forEach(e=>{e.remove()}),super.sceneCleared()}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}_generateMesh(e=0,t=null,n,i,o,s,r,a,l){return this._plannerMeshGenerator.generateMesh(e,t,n,i,o,s,r,a,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,i,o){super.Editor3dComponentCreated(e,t,n,i,o),this._getKernelAccess()instanceof d&&this.dockComponent(e,i,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e,t){this._constructionGroup.clear(),this._ceilingGroup.clear(),this._floorGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,i,o,s,r){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,i,o,s){const r=e.extRef.jsObject;let a=r.getMesh(t);a?a.geometry=this._plannerMeshGenerator.generateGeometry(null,n,i,o,s):(a=this._generateMesh(0,null,t,n,i,o,s,e.getType()),r.addMesh(a))}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}componentConfigurationUpdated(e,t){super.componentConfigurationUpdated(e,t),this._roomlePlannerUiCallback.onPlanElementChanged()}hideAllExcept(e){this._ceilingGroup.visible=!1,this._floorGroup.visible=!1,this._constructionGroup.visible=!1,this._staticPlanObjectViewModels.forEach(t=>{t.getId()!==e&&(t.getContainer().visible=!1)}),this._configurablePlanObjectViewModels.forEach(t=>{t.getId()!==e&&(t.getContainer().visible=!1)})}showAll(){this._ceilingGroup.visible=!0,this._floorGroup.visible=!0,this._constructionGroup.visible=!0,this._staticPlanObjectViewModels.forEach(e=>e.getContainer().visible=!0),this._configurablePlanObjectViewModels.forEach(e=>e.getContainer().visible=!0)}}return n([i],e.prototype,"_plannerMeshGenerator",void 0),n([i],e.prototype,"_roomlePlannerUiCallback",void 0),e})());const Q=u(30);class J extends _{constructor(e,t,n,i){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===i?1:i,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.disableAll(),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,i=new THREE.Vector3(0,0,0),o=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,i),this._raycaster.ray.intersectPlane(this._planeSide,o);let s,r=this._getDistanceToCamera(o),a=this._getDistanceToCamera(i);return n>=-Q&&n<=Q?s=t<a?e.clone():i.clone():t<a&&t<r?s=e.clone():a<t&&a<r?s=i.clone():r<t&&r<a&&(s=o.clone()),s}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return g(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&&p(this._currentDrag),this._currentHover&&p(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}class X extends _{constructor(e,t,n,i){super(),this._debug=!1,this._dragIn=!1,this._inputManager=i,this._raycastHelper=new J(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()}}e("S",X);class Y{constructor(e){const{component:t,preview:n,resetCamera:i,consecutive:o,type:s,forceRender:r}=e;this.component=t,this.preview=n,this.resetCamera=void 0===i||i,this.consecutive=void 0===o||o,this.type=s||0,this.forceRender=void 0!==r&&r}}let Z=(()=>{class e extends X{constructor(e,t,n,i){super(e,t,n,i),this._cameraMoving=!1,this._raycastHelper.addEventListener(3,()=>{this._clickOutside()},this),this._selectionHandler.addEventListener(0,({component:e,consecutive:t})=>{this.dispatchEvent(8,new Y({component:e,consecutive:t})),this._inputManager.setDragEnabled(!0)},this),this._selectionHandler.addEventListener(1,({component:e,resetCamera:t})=>{this._selectionHandler.hasSelection()||this._inputManager.setDragEnabled(!1),this.dispatchEvent(9,new Y({component:e,resetCamera:t}))},this),this._addInputListeners(this._inputManager)}disable(){const e=new THREE.Layers;e.disableAll(),this._raycastHelper.setLayers(e),this._raycastHelper.disableEvents()}enable(){const e=new THREE.Layers;e.enable(4),e.enable(5),e.enable(7),e.enable(8),this._raycastHelper.setLayers(e),this._raycastHelper.enableEvents()}_addInputListeners(e){e.addEventListener(7,e=>this._interaction(),this),e.addEventListener(8,e=>this._interaction(),this)}addComponentHandlers(e){this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.runtimeId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:2,roomleId:e.runtimeId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.runtimeId}),this._raycastHelper.enableDragIn(e.boundingBoxMesh))}_addComponentHandlers(e,t,n){t.userData.hasListener||(Object.assign(t.userData,n),t.addEventListener("select",()=>this.clickComponent(e)),t.addEventListener("hover_on",t=>this._hoverOn(e,t.attachment.type)),t.addEventListener("hover_off",t=>this._hoverOff(e,t.attachment.type)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)))}addPreviewHandlers(e){let t=e.boundingBoxMesh;t.userData.hasListener||(t.userData=A(t.userData,{hasListener:!0,priority:3,roomleId:e.runtimeId}),t.addEventListener("select",()=>this._clickPreview(e)),t.addEventListener("hover_on",()=>this._hoverOnPreview(e)),t.addEventListener("hover_off",()=>this._hoverOffPreview(e)))}addPreviewLineHandlers(e){let t=e.boundingLineMesh;t.userData.hasListener||(t.userData=A(t.userData,{hasListener:!0,priority:4,roomleId:e.runtimeId}),t.addEventListener("select",()=>this._clickPreviewLine(e)),t.addEventListener("hover_on",t=>this._hoverOnPreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_move",t=>this._hoverMovePreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_off",()=>this._hoverOffPreviewLine(e)))}_clickPreview(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Y({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Y({preview:e}))}clickComponent(e){this._debug&&e.runtimeId,this._selectionHandler.check(e)}_clickOutside(){this._selectionHandler.cancelSelection(),this.dispatchEvent(3),this._interaction()}_hoverOn(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOn(),this._interaction(),this.dispatchEvent(1,new Y({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new Y({component:e,type:t})),this._hoveredComponent=null)}_hoverOnPreview(e){e.hoverOn(),this._interaction(!0),this._hoveredPreview=e}_hoverOffPreview(e){e.hoverOff(),this._interaction(!0),this._hoveredPreview=null}_hoverOnPreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._draggedComponent||e.hoverOn(),this._interaction(),this._hoveredPreview=e}_hoverMovePreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._hoveredPreview=e,this._interaction(!0)}_updatePositionForPreviewLine(e,t){let n=t.object.parent.parent.worldToLocal(t.point);this._previewLineIntersection=n,e&&(this._draggedComponent?this._draggedComponent.visible=!0:e.updatePreviewPosition(n))}_hoverOffPreviewLine(e){this._draggedComponent||e.hoverOff(),this._interaction(),this._hoveredPreview=null,this._previewLineIntersection=null}_setDragComponentShadow(e){this._draggedComponent.traverse(t=>{if(t instanceof THREE.Mesh){const n=t;e&&void 0!==n.castShadowOld?(n.receiveShadow=n.receiveShadowOld,n.castShadow=n.castShadowOld):(n.receiveShadowOld=t.receiveShadow,n.castShadowOld=t.castShadow,n.receiveShadow=!1,n.castShadow=!1)}})}_dragStart(e){e&&(this._selectionHandler.isSelected(e)||this.isDragIn())&&(this._dragStartPosition=e.position.clone(),this._dragStartRotation=e.rotation.clone(),this._draggedComponent=e,this._setDragComponentShadow(!1),this.dispatchEvent(4,new Y({component:e})),this._interaction())}_drag(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(e&&!this._draggedComponent&&(this._draggedComponent=e),this._previewLineIntersection){let e=this._hoveredPreview,t=e.getPositionForIntersectionPoint(this._previewLineIntersection),n=e.parent.localToWorld(t);this._draggedComponent.position.copy(this._draggedComponent.parent.worldToLocal(n)),this._draggedComponent.rotation.copy(e.docklineRotation),e.hideSelectionLine()}else e.parent?e.position.copy(e.parent.worldToLocal(t)):e.position.copy(t);this._hoveredPreview?e.visible=!1:e.visible=!0,this.dispatchEvent(5,new Y({component:e})),this._interaction()}}_dragEnd(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(this._hoveredPreview)if(this._previewLineIntersection){let t=this._hoveredPreview,n=t.getPositionForIntersectionPoint(this._previewLineIntersection),i=t.parent.localToWorld(n);e.position.copy(e.parent.worldToLocal(i)),e.rotation.copy(t.docklineRotation)}else e.position.copy(t);else this._dragStartPosition&&this._dragStartRotation&&(e.position.copy(this._dragStartPosition),e.rotation.copy(this._dragStartRotation),this._dragStartPosition=null,this._dragStartRotation=null,this.addComponentHandlers(e));e.visible=!0,this._setDragComponentShadow(!0),this._draggedComponent=null,this._previewLineIntersection=null,this.dispatchEvent(6,new Y({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new Y({forceRender:e}))}hasSelection(){return this._selectionHandler.hasSelection()}update(e,t,n){this._raycastHelper.update(e,t,n)}isDragIn(){return this._dragIn}isDragging(){return null!=this._draggedComponent}setRootComponentId(e){this._raycastHelper.setRootComponentId(e)}cancelSelection(){this._selectionHandler.setSelectionMode("standard"),this._selectionHandler.cancelSelection()}setSelectionMode(e){this._selectionHandler.setSelectionMode(e)}getSelectionMode(){return this._selectionHandler.getSelectionMode()}getSelectedRuntimeComponentIds(){return this._selectionHandler.getSelectedRuntimeComponentIds()}setCameraMoving(e){e&&this._hoveredComponent&&this._hoverOff(this._hoveredComponent,0),this._cameraMoving=e}}return n([i],e.prototype,"_selectionHandler",void 0),e})();class $ extends _{constructor(e){super(),this._uiIntersectionMask=0,this.floorEnvironment=!1,this._camera=e}updateToBounds(e,t,n){let i=new THREE.Vector3(-e.x/2,0,-e.z/2),o=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(i,o),this._clientWidth=t,this._clientHeight=n;let s=this._boundingBox.getSize(new THREE.Vector3);this._boxVertices=[],this._boxVertices.push(this._boundingBox.min),this._boxVertices.push(this._boundingBox.min.clone().add(new THREE.Vector3(s.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new THREE.Vector3(s.x,0,0)))}set canvasOffset(e){this._offset=e,this.calculateUIIntersection()}calculateUIIntersection(){let e=[];if(null==this._boundingBox||null==this._offset)return;let t=this._checkPaddings();t.bottom=this._clientHeight-t.bottom,t.right=this._clientWidth-t.right;let n=0;this.floorEnvironment?(e=["left","right","bottom"],n=11):(this._offset.left>0&&t.left<this._offset.left*this._clientWidth&&(e.push("left"),n|=8),this._offset.right<1&&t.right<(1-this._offset.right)*this._clientWidth&&(e.push("right"),n|=2),this._offset.bottom>0&&t.bottom<this._offset.bottom*this._clientHeight&&(e.push("bottom"),n|=1)),this._offset.top<1&&t.top<(1-this._offset.top)*this._clientHeight&&(e.push("top"),n|=4),n!==this._uiIntersectionMask&&(this.dispatchEvent(0,e),this._uiIntersectionMask=n)}_checkPaddings(){let e={left:this._clientWidth/2,top:this._clientHeight/2,right:this._clientWidth/2,bottom:this._clientHeight/2};return this._boxVertices.forEach(t=>{let n=m(t,this._camera,this._clientWidth,this._clientHeight);n.x<e.left&&(e.left=n.x),n.x>e.right&&(e.right=n.x),n.y<e.top&&(e.top=n.y),n.y>e.bottom&&(e.bottom=n.y)}),e}}class ee extends B{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=C();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 te=null;const ne=()=>(te||(te=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),te.outputEncoding=THREE.sRGBEncoding),te.autoClear=!0,te),ie=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))}}),oe=e("a",(e,t,n,i,o={},s=0)=>new Promise(r=>{const{size:a=1024,showDimensions:l}=o,c=ne();c.setSize(a,a);const h=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let _=new W(e);n.layers.disable(2),n.layers.disable(6),n.layers.disable(5),l?n.layers.enable(8):n.layers.disable(8);const g=-30+f(s);se(n,i,-20,g),c.render(e,n),t&&(c.autoClear=!1,c.clearDepth(),c.render(t,n));const p=c.domElement.toDataURL();n.layers.enable(2),n.layers.enable(6),n.layers.enable(5),e.background=d,e.fog=h,_.removeFromScene(),r({image:p,width:a,height:a,blob:null})})),se=(e,t,n,i)=>{e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(u(i)),e.rotateX(u(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()},re=e("p",(e,t,n,i={})=>{const{showDimensions:o=!1}=i;return new Promise(i=>{const s=ne();s.autoClear=!1;let r=new THREE.OrthographicCamera(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);r.position.copy(n.center),r.rotateX(u(-90)),r.translateZ(n.bounds.y+1),r.far=r.position.y+.5,r.layers.mask=65535;let a=200*n.bounds.x,l=200*n.bounds.z;if(a>4096||l>4096){let e=0;a>4096?e=a/4096:l>4096&&(e=l/4096),a/=e,l/=e}s.setSize(a,l);let c=e.fog?e.fog.clone():null,h=e.background?e.background.clone():null;e.background=null,e.fog=null;let d=o?new ee(e):new W(e);r.layers.disable(2),r.layers.disable(6),r.layers.disable(5),o?r.layers.enable(8):r.layers.disable(8),s.render(e,r),t&&(s.clearDepth(),s.render(t,r));let _=s.domElement.toDataURL();r.layers.enable(2),r.layers.enable(6),r.layers.enable(5),e.background=h,e.fog=c,d.removeFromScene(),i({image:_,width:a,height:l,blob:null})})});e("C",(()=>{class e extends V{constructor(e,t,n="3D"){super(e,t,v.HSC,n),this._getViewModel().setListener(this),this._sceneEventHandler=new Z(this._creator_,this._scene,this._getCameraControl().getCamera(),this._getInputManager()),this._sceneEventHandler.addEventListener(0,({forceRender:e})=>{this._uiIntersectionHelper.calculateUIIntersection(),e&&this._renderEverything()},this),this._sceneEventHandler.addEventListener(1,({component:e,type:t})=>this._onHoverOn(e,t),this),this._sceneEventHandler.addEventListener(2,({component:e,type:t})=>this._onHoverOff(e,t),this),this._sceneEventHandler.addEventListener(3,()=>{this._configuratorUiCallbacks.onClickOutside(),this._cameraControl.unlock(),this._cancelDockings(!1,null,this._getViewModel().hasPreviews(),!0,!1),this.cancelComponentSelection(!0),this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentVisibility(this._sceneEventHandler,this._getViewModel()),this._requestRender()},this),this._sceneEventHandler.addEventListener(8,({component:e,consecutive:t})=>{this._getViewModel().hasPreviews()&&this._cancelDockings(!1,null,this._getViewModel().hasPreviews(),!0,!1),this._selectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(9,({component:e,resetCamera:t})=>{this._deselectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(4,({component:e})=>{"multiselect"===this._sceneEventHandler.getSelectionMode()&&this.cancelComponentSelection(),this._requestDockingsPreviewWithDrag(e.runtimeId),this._cameraControl.lock(),this._requestRender()},this),this._sceneEventHandler.addEventListener(5,()=>{this._renderEverything()},this),this._sceneEventHandler.addEventListener(6,({component:e,preview:t})=>{if(t){let n=t;this._getViewModel().isPreviewLine(n)?this._getViewModel().dockComponentWithPosition(n,e):this._getViewModel().isPreview(n)&&this._dockComponent(n),this._cancelDockings(!t,e,!0,!0)}else{let t=this._sceneEventHandler.isDragIn()?e:null;this._cancelDockings(this._sceneEventHandler.isDragIn(),t,!1,!0);const n=this._getViewModel().getBoundingBox();this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))}this._cameraControl.unlock(),this._renderEverything()},this),this._sceneEventHandler.addEventListener(7,({preview:e})=>{this._getViewModel().isPreview(e)&&(this._getViewModel().isPreviewLine(e)?this._getViewModel().dockComponentWithPosition(e):this._dockComponent(e),this._cancelDockings(!1,null,!this._getViewModel().hasPreviews(),!1,!1),this.requestDockingsPreview(!1),this._requestRender())},this),this._cameraControl.addEventListener(0,()=>{var e;this._configuratorUiCallbacks.onCameraPositionChanges(),this._sceneEventHandler.setCameraMoving(!0),null===(e=this._pixotronUtil)||void 0===e||e.movingCameraStarts(),this._requestRender()},this),this._cameraControl.addEventListener(1,()=>{this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentAndPreviewVisibility(this._sceneEventHandler,this._getViewModel()),this._requestRender()},this),this._cameraControl.addEventListener(2,()=>{var e;this._sceneEventHandler.setCameraMoving(!1),null===(e=this._pixotronUtil)||void 0===e||e.movingCameraStops(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(5,({minZoom:e,maxZoom:t})=>{this._configuratorUiCallbacks.onZoomChange(e,t)},this),this._cameraControl.addEventListener(3,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(4,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(7,()=>{this._pluginSystem.moveCameraStart(this._getCameraControl().getCamera().position)},this),this._cameraControl.addEventListener(8,()=>{this._pluginSystem.moveCameraEnd(this._getCameraControl().getCamera().position)},this),b.isProduction||(window.__RML__DEBUG__.SceneHelper=this),this.enableConfiguratorEvents(),this._initOptionalModules()}async _initOptionalModules(){const{transparentHighlighting:e}=this._initData;if(e){const{default:e}=await t.import("./component-raycast-helper-f25362d3.legacy.js");this._componentRaycastHelper=new e,this._componentRaycastHelper.init(this._scene,this._getCameraControl().getCamera())}}enableConfiguratorEvents(){this._sceneEventHandler.enable()}disableConfiguratorEvents(){this._sceneEventHandler.disable()}_getViewModel(){return this._viewModel||(this._viewModel=y.lookup("configurator-view-model",this._creator_)),this._viewModel}_getKernelAccess(){return this._plannerKernelAccess}_showDockings(){}cancelDockings(){this._cancelDockings(!0,null,!0,!0,!1),this._renderEverything()}_cancelDockings(e,t,n,i,o=!0){e&&(this._sceneEventHandler.setDragIn(!1),this._getViewModel().removeDockingComponent(),t&&this._scene.remove(t)),this._getViewModel().removePreviews(),n&&o&&this._updateCameraToBounds(),i&&n&&this._configuratorUiCallbacks.onDockingsPreviewRemoved(),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}_onHoverOn(e,t){2!==t&&this._highlightComponent(e),this._componentDimensioningHelper&&this._componentDimensioningHelper.add(e)&&this._renderEverything()}_onHoverOff(e,t){2!==t&&this._highlightComponent(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&(this._componentDimensioningHelper.remove(e),this._renderEverything()),this._requestRender()}_highlightComponent(e=null,t=[]){if(!this._shouldHighlight())return;this._pixotron&&((null==t?void 0:t.length)?this._pixotron.getHighLightPass().transparency=.8:this._pixotron.getHighLightPass().transparency=1,this._pixotron.getHighLightPass().needsUpdate=!0);const n=[],i=this._initData.meshSelection;e?i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh):t&&t.length||(t=this._sceneEventHandler.getSelectedRuntimeComponentIds()),this._getViewModel().getComponentsForIds(t).forEach(e=>{e&&(i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh))}),this._pixotron&&this._pixotron.highlightObjects(n)}shouldClearShadowsAndAO(){return super.shouldClearShadowsAndAO()||!this._sceneEventHandler.isDragging()}resume(){super.resume(),this._getViewModel().materialQueue.registerCallback(()=>this._materialLoaded()),this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._applySSR(),this._renderWithoutShadowsAndAO()})}_materialLoaded(){this._renderEverything(),this._applySSR(),this._environment instanceof j&&this._environment.update()}_applySSR(){this._initData.ssr&&this._pixotron&&this._getViewModel().getComponent(this._configuratorContext.rootComponentId).traverse(e=>{e instanceof THREE.Mesh&&!e.material.ssrPass&&this._pixotron.fixMaterial(e)})}pause(){super.pause(),this._getViewModel().materialQueue.unregisterCallback(),this._configuratorMeshGenerator.removeMaterialLoadedListener()}_setupScene(e,t,n){super._setupScene(e,t),this._uiIntersectionHelper=new $(this._getCameraControl().getCamera()),this._uiIntersectionHelper.canvasOffset=e,this._uiIntersectionHelper.addEventListener(0,e=>{this._configuratorUiCallbacks.onUiIntersectionChange(e)},this),this._configuratorMeshGenerator.maxAnisotropy=this._maxAnisotropy,this._configuratorMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()}),this._domHelper.element.appendChild(this._renderer.domElement),n||(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(w.createDynamicLightSettingSource(null,E.CAMERA)):this._lightSetting=new W(this._scene,this._lightSetting)),this._requestRender(),this._setEnvironment(new G(this._scene,this._environment,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND))),this._getViewModel().materialQueue.registerCallback(()=>this._materialLoaded())}sceneCleared(e){this._internalClearScene(e)}display(e){this._scene.add(e),this._sceneEventHandler.setRootComponentId(e.runtimeId),this._requestRender()}debugSceneGraph(e){this._getViewModel().debugSceneGraph(e),this._printObjectGraph(this._scene,"")}debugScene(){return this._scene}_printObjectGraph(e,t){e.material&&e.material.opacity,e.type,e.id,e.runtimeId,e.children.length>0&&e.children.forEach(e=>{let n=t+" ";this._printObjectGraph(e,n)})}clearScene(){var e;this._getCameraControl().clear(),this._internalClearScene(!1),this._pixotronUtil&&this._pixotronUtil.lockAdapter(),null===(e=this._sceneEventHandler)||void 0===e||e.cancelSelection(),this._pluginSystem.clearScene(this._scene,this._uiScene)}planObjectConstructionDone(e){this._componentDimensioningHelper.reset(),this._componentDimensioningHelper.setCamera(this._getCameraControl().getCamera())}_internalClearScene(e){var t;this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type&&"Line"!==e.type||this._scene.remove(e)}),this._uiScene.children.forEach(e=>{this._uiScene.remove(e)}),this._getViewModel().sceneCleared(),null===(t=this._componentDimensioningHelper)||void 0===t||t.invalidateDimensioningsCache(),(e||this._memoryManager.shouldHardReset())&&(this._configuratorMeshGenerator.clear(),this._renderer.renderLists.dispose(),this._memoryManager.executedHardReset()),this._renderEverything()}async preparePerspectiveImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let n=this._getCameraControl().getCamera().clone(),i=this._calculateBoundingBoxOfAllMeshes(0,t);this._lightSetting.removeFromScene();const o=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();o&&this._dimensionHelper.disableDimensions();const s=this._getCameraControl().getObjectRotation();if(t){await this._initDimensions(),await this._dimensionHelper.isInitialized();const e=-30+f(s);se(n,i,-20,e),this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(n.position),i=this._calculateBoundingBoxOfAllMeshes(0,t)}this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const r=await oe(this._scene,this._uiScene,n,i,e,s);return o?this._dimensionHelper.enableDimensions():t&&this._dimensionHelper.disableDimensions(),this._lightSetting.addToScene(),this._requestRender(),r}async renderImage(e){await this._externalMeshesAndMaterialsReady(),this._getViewModel().getPreviews()&&this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let t=this._getCameraControl().getCamera(),n=null;e.useCurrentPerspective||(t=this._getCameraControl().getCamera().clone(),n=this._calculateBoundingBoxOfAllMeshes());const i=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();i&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const o=await((e,t,n,i,o,s)=>new Promise(i=>{s||(s=1024);const o=ne();o.setSize(s,s);const r=e.fog?e.fog.clone():null,a=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(6),t.layers.disable(5),n?se(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),o.render(e,t);const l=o.domElement.toDataURL();t.layers.enable(2),t.layers.enable(6),t.layers.enable(5),e.background=a,e.fog=r,i({image:l,width:s,height:s,blob:null})}))(this._scene,t,n,this._pixotron,this._renderer);return i&&this._dimensionHelper.enableDimensions(),this._requestRender(),o}async preparePartImage(e,t){return new Promise((n,i)=>{this._getViewModel().requestSubPartConstruction(e).then(async e=>{t.size||(t.size=256);let i=this._getCameraControl().getCamera().clone(),o=ie((new THREE.Box3).setFromObject(e));const s=new THREE.Scene;s.add(e);const r=await oe(s,null,i,o,t);H(s),n(r)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._getViewModel().getBoundingBox(),ie(n,e)}async _externalMeshesAndMaterialsReady(){await this._getKernelAccess().externalMeshQueue.finished(!0),await this._getViewModel().materialQueue.finished(!0)}async prepareTopImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),this._dimensionHelper.enableTopDimensions()),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();let n=this._calculateBoundingBoxOfAllMeshes(.1,t);this._lightSetting.removeFromScene();let i=await re(this._scene,this._uiScene,n,e);return t&&this._dimensionHelper.disableTopDimensions(),this._lightSetting.addToScene(),this._requestRender(),i}enableDragIn(e){this._sceneEventHandler.setDragIn(!0,e),this._requestRender()}zoomToComponent(e){this._cameraControl.saveState(!1);let t=e.boundingBox.getSize(new THREE.Vector3),n=P(e),i=new THREE.Euler(0,n,0),o=e.getWorldPosition(new THREE.Vector3).clone().add(e.boundingBox.getCenter(new THREE.Vector3).applyEuler(i));const s=new THREE.Vector2;this._renderer.getSize(s),this._getCameraControl().zoomTo(t,s.width,s.height,i.y,u(15),o)}resetCamera(){this._cameraControl.hasSavedState()?this.resetCameraToState():this.resetCameraPositionToStart(!1)}resetCameraToState(){this._cameraControl.hasSavedState()&&this._cameraControl.resetToState()}resetCameraPositionToStart(e=!0){this._requestRender();const t=this._getViewModel().getBoundingBox();t&&this._getCameraControl().reset(t,void 0,void 0,void 0,e)}_clearSelectionAndHovers(){this.cancelComponentSelection(),this._getViewModel().clearRootComponent()}resetPreviews(){this._getViewModel().removePreviews(),this._requestRender()}changeOffset(e){this._getCameraControl().getCamera().offset=e,this._uiIntersectionHelper&&(this._uiIntersectionHelper.canvasOffset=e)}updateCamera(e=!0){super.updateCamera(),this._updateCameraToBounds(null,e)}setCameraOffset(e){this._getCameraControl().getCamera().offset&&(this._getCameraControl().getCamera().offset=e,this._renderEverything())}getCameraOffset(){return JSON.parse(JSON.stringify(this._getCameraControl().getCamera().offset))}_onKeyDown(e){super._onKeyDown(e),!e.key||"Escape"!==e.key&&"Esc"!==e.key||(this.cancelComponentSelection(),e.preventDefault()),e.key&&e.key.includes("Shift")&&(this._getCameraControl().enablePanning(),e.preventDefault()),this._sceneEventHandler&&this._sceneEventHandler.hasSelection()&&e.key&&("Backspace"===e.key||"Delete"===e.key)&&(this.requestDeleteSelectedComponent(),e.preventDefault())}_onKeyUp(e){super._onKeyUp(e),e.key&&e.key.includes("Shift")&&(this._getCameraControl().disablePanning(),e.preventDefault())}cancelPreviousDockings(){this._cancelDockings(!0,null,!1,!1)}cancelComponentSelection(e){(this._sceneEventHandler.hasSelection()||"standard"!==this._sceneEventHandler.getSelectionMode())&&this._cancelSelection(e)}_cancelSelection(e){this._sceneEventHandler.cancelSelection(),this._configuratorContext.selectionMode="standard",this._configuratorContext.selectedRuntimeComponentIds=[],this._getViewModel().removePreviews(),e&&!this._initData.debug&&this.resetCameraToState(),this._getKernelAccess().updatePlanObjectDependencies(this._configuratorContext.planObjectId),this._configuratorUiCallbacks.onSelectionCancel()}_selectComponent(e,t){this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds(),t||("standard"===this._sceneEventHandler.getSelectionMode()?this._onSelectedRuntimeComponentChange(e):this._onSelectedRuntimeComponentsChange(this._sceneEventHandler.getSelectedRuntimeComponentIds())),this._highlightComponent(e),!this._initData.debug&&t&&this.zoomToComponent(e)}_deselectComponent(e,t){"standard"===this._sceneEventHandler.getSelectionMode()&&(this._cancelSelection(t),this._highlightComponent()),"multiselect"===this._sceneEventHandler.getSelectionMode()&&(this._sceneEventHandler.hasSelection()?this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds():(this._cancelSelection(t),this._highlightComponent())),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}getScreenXY(e){return m(e,this._getCameraControl().getCamera(),this._domHelper.element.clientWidth,this._domHelper.element.clientHeight)}setSelectionMode(e){this._sceneEventHandler.setSelectionMode(e)}changeFloorMaterial(e){return this._environment&&this._environment instanceof U||(this._environment=new U(this._scene,this._environment,!0),this._uiIntersectionHelper.floorEnvironment=!0),this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),new Promise((t,n)=>{this._environment.changeFloorMaterial(e,this._maxAnisotropy).then(()=>{this._requestRender(),t()},n)})}exportGLB(){this._scriptLoader.fetch(N,{id:"gltf-exporter"}).then(()=>{let e=new THREE.GLTFExporter,t=[];this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type||t.push(e)}),e.parse(t,e=>{let t=document.createElement("a");const n=new Blob([e],{type:"model/gltf-binary"});t.href=URL.createObjectURL(n),t.download="scene.glb",t.style.display="none",document.body.appendChild(t),t.click()},{binary:!0,embedImages:!0,forceIndices:!0})})}zoomIn(e){this._getCameraControl().zoomIn(e),this._renderEverything()}zoomOut(e){this._getCameraControl().zoomOut(e),this._renderEverything()}async showDimensions(){await this._initDimensions(),this._dimensionHelper.enableDimensions(),this._dimensionHelper.onDimensionsVisibilityChanged(e=>{e&&this._renderEverything(),this._configuratorUiCallbacks.onDimensionsVisibilityChange(e)}),this._renderEverything()}async _initDimensions(){this._dimensionHelper||await t.import("./dimensioning-helper-68dc010f.legacy.js").then(({default:e})=>{this._dimensionHelper=new e(this._creator_),this._pluginSystem.addPlugin(this._dimensionHelper)})}hideDimensions(){this._dimensionHelper&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._renderEverything()}async loadSceneSettings(e){await super.loadSceneSettings(e),this._uiIntersectionHelper.floorEnvironment=this._environment instanceof U}_updateCameraToBounds(e,t=!0){e||(e=this._getViewModel().getBoundingBox()),e&&(this._getCameraControl().updateToBounds(e,!1,t),this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition())}requestDockingsPreview(e,t,n,i){i||(i=!1),e&&this.cancelPreviousDockings(),this.cancelComponentSelection(),i&&this.enableDragIn(n),t&&(this._configuratorContext.lastPossibleChild=t),this._configuratorContext.requestPreviewsIsUserInitiated=e,this.resetPreviews(),this._getKernelAccess().webGlPreviewDockings(this._configuratorContext,i),this._showDockings()}_requestDockingsPreviewWithDrag(e){this.cancelPreviousDockings(),this._configuratorContext.rootComponentId!==e&&(this.resetPreviews(),this._getKernelAccess().previewDockingsWithDrag(e,this._configuratorContext.planObjectId),this._showDockings())}_dockComponent(e){const t=I.start("dock_component_"+e.childId);this._getKernelAccess().dockComponent(e.parentId,e.parentDockId,e.childId,e.childDockId),this._configuratorContext.dockingRootComponentId=null,I.end(t)}_onSelectedRuntimeComponentsChange(e){this._getKernelAccess().multiSelectionChange(e,this._configuratorContext.rootComponentId)}_onSelectedRuntimeComponentChange(e){let t=!1,n=null;e&&(t=e.runtimeId===this._configuratorContext.rootComponentId,n=e.runtimeId),this._getKernelAccess().selectionChange(n,t),e&&this._getKernelAccess().selectedComponent(e.runtimeId)}requestDeleteSelectedComponent(){const e=this._configuratorContext.selectedRuntimeComponentIds,t=this._configuratorContext.rootComponentId;if(Array.isArray(e)&&0!==e.length&&t&&-1===e.indexOf(t)){switch(this._configuratorContext.selectionMode){case"standard":this.resetCamera(),this._getKernelAccess().requestDeleteComponent(this._configuratorContext.selectedRuntimeComponentId);break;case"multiselect":this.resetCamera(),this._getKernelAccess().requestDeleteComponents(this._configuratorContext.selectedRuntimeComponentIds)}this._configuratorContext.selectedRuntimeComponentIds=[]}}componentUpdated(e,t){var n;if(e.runtimeId===this._configuratorContext.rootComponentId){let t=new THREE.Vector3(e.position.x/1e3,e.position.z/1e3,e.position.y/-1e3);this._sceneEventHandler.update(null,t,null)}void 0===e.geometryChanged||e.geometryChanged?this._renderEverything():this._renderWithoutShadowsAndAO(),null===(n=this._componentDimensioningHelper)||void 0===n||n.invalidateDimensioningsCache(e.runtimeId)}planObjectUpdated(e,t){const n=this._getKernelAccess().kernelInstance.getSerializedConfiguration(this._configuratorContext.planObjectId);if(this._configuratorHistory.push(n),e.bounds){if(this._configuratorContext.planObjectId===e.id){const e=this._getViewModel().getBoundingBox();this._updateBounds(e,t)}this._highlightComponent(),this._requestRender()}}componentDeleted(e){-1===this._sceneEventHandler.getSelectedRuntimeComponentIds().indexOf(e.runtimeId)&&"multiselect"!==this._sceneEventHandler.getSelectionMode()||this.cancelComponentSelection()}previewConstructionDone(e,t){const n=this._getViewModel().getBoundingBoxWithPreviews();t||(this._cancelDockings(!0,null,!1,!1,!1),this._configuratorContext.requestPreviewsIsUserInitiated&&this._configuratorUiCallbacks.onNoDockingsAvailable());let i=!0;this._componentRaycastHelper&&(i=!this._componentRaycastHelper.areAllPreviewsVisible(this._getViewModel())),this._configuratorContext.requestPreviewsIsUserInitiated&&i&&this._updateCameraToBounds(n),this._lightSetting&&this._lightSetting.needsBounds()&&(this._lightSetting.updateBounds(n),this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))),this._componentRaycastHelper&&this._componentRaycastHelper.checkPreviewVisibility(this._getViewModel())}configurationLoaded(e,t){e&&t&&this._sceneEventHandler.isDragIn()?(e.position.copy(new THREE.Vector3(0,100,0)),this._scene.add(e),this._sceneEventHandler.addComponentDragInHandler(e),this._requestRender()):t||this._initData.debug||this.resetCamera(),this._pixotronUtil&&Promise.all([new Promise(e=>setTimeout(e,3e3)),this._getViewModel().materialQueue.finished(!0)]).then(()=>{this._pixotronUtil.unLockAdapter()}),this._environment&&this._environment.reload()}addComponentHandlers(e){this._sceneEventHandler.addComponentHandlers(e)}addPreviewHandlers(e){this._sceneEventHandler.addPreviewHandlers(e)}addPreviewLineHandlers(e){this._sceneEventHandler.addPreviewLineHandlers(e)}_updateComponentPosition(){if(!this._configuratorUiCallbacks.onComponentPositionsUpdated)return;const e=[];this._getViewModel().getComponents().forEach(t=>{if(!t.boundingBoxMesh)return;const n=(new THREE.Box3).setFromObject(t.boundingBoxMesh);let i=this._getKernelAccess().kernelInstance.getComponent(t.runtimeId);const o=i.parameters||i.possibleChildren?["edit"]:[];e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"component",actions:o})}),this._getViewModel().getPreviews().forEach(t=>{const n=(new THREE.Box3).setFromObject(t);e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"preview",actions:["add"]})}),this._configuratorUiCallbacks.onComponentPositionsUpdated(e)}_updateBounds(e,t=!1){if(super._updateBounds(e,t),!e)return;let n=e.getSize(new THREE.Vector3);this._sceneEventHandler.hasSelection()||this._updateCameraToBounds(e,!1),this._sceneEventHandler.update(n,null,null),this._uiIntersectionHelper.updateToBounds(n,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._pixotron&&this._pixotron.getShadowPass().setShadowRecieverBBox(e),this._getCameraControl().getCamera().updateProjectionMatrix()}async moveCamera(e){return this._getCameraControl().moveCamera(e)}selectComponent(e){if(!e)return;const t=this._getViewModel().getComponents().find(t=>t.runtimeId===e);t?this._sceneEventHandler.clickComponent(t):console.warn('Can not select "'+e+'" because it was not found')}highlightParts(e){this._highlightComponent(null,e),this._requestRender()}_shouldHighlight(){return this._getViewModel().getNumberOfPossibleChildrenForComponent(this._configuratorContext.rootComponentId)>0}_getInputManager(){return this._configuratorInputManager}createCameraControl(e,t){this._componentFactory=S();const n=this._domHelper.getClientDimensions(),i=n.x,o=n.y,s=this._componentFactory.createCamera(30,i/o,.1,20,t);s.layers.set(3),s.layers.enable(1),s.layers.enable(2),s.layers.enable(6),s.layers.enable(5),s.position.copy(new THREE.Vector3(0,.5,5)),this._changeCameraControl(new K(this._creator_,this._getInputManager(),null,s))}getBakedShadowParams(){return{enable:!0,shadowMapResolution:1024,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.8,darkness:.3,size:1.2,lightDirection:new THREE.Vector3(0,1,0),lightSolidAngle:40,yPosition:.006}}getBounds(){return this._getViewModel().getBoundingBox()}getPixotronParams(){return{saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:100,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:1,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:50,side:THREE.FrontSide},outlineparams:{highlightColor:new THREE.Color(this._initData.colors.SELECTION),edgeStrength:1,transparency:1,edgeThickness:2}}}sceneChanged(){}_getCameraControl(){return this._cameraControl}}return n([i],e.prototype,"_configuratorInputManager",void 0),n([i],e.prototype,"_configuratorUiCallbacks",void 0),n([i],e.prototype,"_configuratorMeshGenerator",void 0),n([i],e.prototype,"_memoryManager",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_componentDimensioningHelper",void 0),n([i],e.prototype,"_configuratorViewModel",void 0),n([i],e.prototype,"_configuratorHistory",void 0),n([i],e.prototype,"_plannerKernelAccess",void 0),e})());const ae=(e,t)=>e.sort||t.sort?e.sort?t.sort?e.sort-t.sort:-1:1:0,le=(e,t)=>e&&!t?1:!e&&t?-1:e&&t?e.localeCompare(t):0;e("R",(()=>{class e{constructor(e){this._onInitDoneCollection=[],this._isKernelReady=!1,this._isWebGlReady=!1,this._isPreloadReady=!0,this._isLoadError=!1,this._isReloading=!1,this._needsSync=!1,this._creator_=e,this._configuratorKernelAccessCallback.addListener(this);const t=this._errorHandler;t.subscribe(0,e=>this._configuratorUiCallbacks.onErrorDueToOffline(e)),t.subscribe(1,e=>this._configuratorUiCallbacks.onError(e)),t.subscribe(2,(e,t)=>this._configuratorUiCallbacks.onContentProblem({rapiPath:e,ids:t,message:"Could not load the ids"}))}_isInitDone(){return this._isKernelReady&&this._isWebGlReady&&this._isPreloadReady}_checkInitDone(){this._isInitDone()&&(this._onInitDoneCollection.forEach(e=>e()),this._onInitDoneCollection=[])}_onInitDone(e){this._isInitDone()?e():this._onInitDoneCollection.push(e)}initSceneManager(e){this._sceneManager=e||y.lookup("configurator-scene-manager",this._creator_)}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}_loadWebGlLib(e,t){this._threeLoader.fetch().then(()=>Promise.all(F.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(this._loadingWebGlSuccess(e,t).bind(this),this.loadError.bind(this)),this.loadError.bind(this))}_loadingWebGlSuccess(e,t){return()=>{this.initSceneManager(),t&&this._sceneManager.changeOffset(t);const{initialFloorMaterial:e,dls:n,ls:i,stats:o}=this._initData,s=w.createDynamicLightSettingSource(n,i);o&&this.showStats(),this._enableHD(s),this._needsSync&&(this._needsSync=!1,this._plannerKernelAccess.requestSync(D,this._configuratorContext.planObjectId));const r=[this._scriptLoader.fetch(z,{id:"tween-js"})];e&&r.push(this._rapiAccess.getMaterial(e).then(e=>this._sceneManager.changeFloorMaterial(e))),Promise.all(r).then(this._webGlIsReady.bind(this),this.loadError.bind(this))}}_webGlIsReady(){this._isWebGlReady=!0,this._checkInitDone()}_initPromiseCallback(e,t){this._isInitDone()?e():this._isLoadError?t("_initPromiseCallback failed"):(this._onInitDone(()=>e()),this._rejectOnLoadError=t)}_notifyOnConfigurationReady(e){return async t=>{const n=await this._plannerKernelAccess.addUiDataAndPriceToPartList(t.partList,t.hash);t.partList=n,e(t),this._configuratorUiCallbacks.onConfigurationReady(n,t.hash,t.rootComponentLabel)}}_notifyOnConfigurationLoadingError(e){return t=>{this._configuratorUiCallbacks.onConfigurationLoadError(),e(t)}}_loadItemOrConfigById(e,t){this._configuratorContext.lastLoadedRapiId=e,this._onLoadConfiguration(),this._preloadPackage(e),this._clearScene();const{offlineSync:n}=this._initData;if(n){const t=M(e);t&&this._dataSyncer.start(t)}return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(t=>{t&&t.configuration?this._loadConfiguration(t.configuration).then(e=>{const i=this._notifyOnConfigurationReady(n);t.label?this._notifyUiAboutNewItem(t,e.rootComponentLabel):this._notifyUiAboutNewConfiguration(t),i(e)},this._notifyOnConfigurationLoadingError(i).bind(this)):i(new Error("Could not load item or config with id "+e))},i)})}_shouldBroadcastToUi(e){return!(0===e&&this._configuratorContext.selectedRuntimeComponentId||1===e&&!this._configuratorContext.selectedRuntimeComponentId||2===e&&!this._configuratorContext.selectedRuntimeComponentIds.length)}_isCorrectResponse(e,t){if(0===e)return t===this._configuratorContext.planObjectId;if(1===e)return t===this._configuratorContext.selectedRuntimeComponentId;const n=t.length;if(n!==this._configuratorContext.selectedRuntimeComponentIds.length)return!1;for(let e=0;e<n;e++)if(t[e]!==this._configuratorContext.selectedRuntimeComponentIds[e])return!1;return!0}_onLoadConfiguration(){this._clearScene(),this._configuratorUiCallbacks.onLoadConfiguration()}_clearScene(){this._sceneManager&&this._sceneManager.clearScene()}_notifyUiAboutNewItem(e,t){this._rapiAccess.getCatalog(e.catalog).then(n=>this._configuratorUiCallbacks.onConfigurationLabelChange(n.name,e.label,t))}_notifyUiAboutNewConfiguration(e){Promise.all([this._rapiAccess.getCatalog(e.catalog),this._rapiAccess.getComponent(e.rootComponentId)]).then(([e,t])=>this._configuratorUiCallbacks.onConfigurationLabelChange(e.name,null,t.label))}notifyUiAboutNewLabel(e){if(R(e)){const t=this._rapiAccess.peekItem(e),n=this._rapiAccess.peekComponent(t.rootComponentId);this._notifyUiAboutNewItem(t,n.label)}else this._notifyUiAboutNewConfiguration(this._rapiAccess.peekConfiguration(e))}_getMaterialGroups(e){const t=(e,t)=>{let n=ae(e,t);return 0!==n?n:(n=le(e.label,t.label),0!==n?n:le(e.id,t.id))},n=e=>(e.sort(t),e.forEach(e=>e.materials.sort(t)),e);if(e.validGroups.length>0)return new Promise((t,i)=>this._rapiAccess.getMaterialsByGroup(e.validGroups).then(e=>t(n(e)),i));const i=[];return e.validValues.forEach(e=>i.push(e.value)),new Promise((e,t)=>{this._rapiAccess.getMaterials(i).then(t=>{this._rapiAccess.combineMaterialsToGroups(t).then(t=>{e(n(t))})},t)})}_loadConfiguration(e){return this._plannerKernelAccess.externalMeshQueue.clear(),new Promise((t,n)=>{const i=()=>{const{x:i,y:o}=this._domHelper.getClientDimensions();if(i<=0&&o<=0){let e="Size of canvas is 0/0! When using embedding set correct size or remove id to load in idle mode!";return console.error(e),n(e)}this.resumeKernelCallbacks(),I.start("ui_load_configuration");const s=[];if(this._initData.applyCurrentGlobalParameters){const e=this._configuratorContext.planObjectId,t=this._configuratorContext.rootComponentParametersAsGlobal;s.push(this._plannerKernelAccess.getGlobalParameters(e,t))}Promise.all(s).then(([i])=>{const o=[k.waitFor(4),k.waitFor(2)];Promise.all(o).then(([e,[n,o,s,r]])=>{const a=[];i&&this._initData.applyCurrentGlobalParameters&&i.forEach(e=>a.push(this.setParameter(e,e.value,!0)));const l=this._rapiAccess.peekComponent(r);Promise.all(a).then(()=>{const n=[];a.length&&(n.push(this._plannerKernelAccess.getPartList()),n.push(this._plannerKernelAccess.getConfigurationHash(this._configuratorContext))),Promise.all(n).then(async n=>{const i=n&&n[0]?n[0]:o,r=n&&n[1]?n[1]:s,a=await this._plannerKernelAccess.addUiDataAndPriceToPartList(i,r);let c=e.errors;const h=c?T(c):[];t({partList:a,hash:r,rootComponentLabel:l?l.label:"",errors:h})})})},n),this._plannerKernelAccess.loadConfiguration(e)},n)};this._onInitDone(()=>i())})}_preLoadItemOrConfig(e,t){return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(n,i)})}_preloadPackage(e){this._isPreloadReady=!1;let t=null;t=R(e)?this._rapiAccess.getPreloadForItem.bind(this._rapiAccess):this._rapiAccess.getPreloadForConfiguration.bind(this._rapiAccess),I.start("rapi_preloads");const n=()=>{I.end("rapi_preloads");const t=I.getMeasure("rapi_preloads");if(Array.isArray(t)&&1===t.length){const n=t[0];this._configuratorUiCallbacks.onTrackTiming("Timing","RapiPreloads",Math.round(n.duration),{id:e})}};t(e).then(()=>{this._isPreloadReady=!0,this._checkInitDone(),n()},e=>{this._isPreloadReady=!0,this._checkInitDone(),console.error(e),n()})}_reloadConfiguration(e,t,n,i){return this._performLoadConfiguration(e).then(e=>{this._isReloading=!1,n(e)},e=>{this._isReloading=!1,i(e)})}_performLoadConfiguration(e){return this._onLoadConfiguration(),new Promise((t,n)=>{this._initData.preloadHint?this._preloadPackage(this._initData.preloadHint):console.warn("When loading a configuration string you have to supply a preloadHint to use fast loading!"),setTimeout(()=>{this._loadConfiguration(e).then(this._notifyOnConfigurationReady(t).bind(this),this._notifyOnConfigurationLoadingError(n).bind(this))},0)})}_changeHDGeometry(e){return new Promise((t,n)=>e===x.useHDGeometry?t():this._isReloading?n("Change of HD Geometry in progress"):(this._isReloading=!0,k.waitFor(3).then(([e,i])=>{this._reloadConfiguration(e,i,t,n)},n),x.useHDGeometry=e,void this._plannerKernelAccess.changeUseOfHDGeometry(this._configuratorContext,x.useHDGeometry)))}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}init(e,t){this.setOverrides(t);const{preloadHint:n,offset:i,startTag:o}=this._initData;return this._domHelper.setDomElement(e),n?this._preloadPackage(n):console.warn("No preload hint! Therefore no preload during init!!"),o&&this.getTagById(o,{include:["items"]}).then(e=>this._configuratorUiCallbacks.onOpenTag(e),e=>console.error(e)),this._loadWebGlLib(e,i),new Promise(this._initPromiseCallback.bind(this))}cancelSelection(){this._sceneManager.cancelComponentSelection()}enableHDGeometry(){return this._changeHDGeometry(!0)}disableHDGeometry(){return this._changeHDGeometry(!1)}changeOffset(e){this._sceneManager.changeOffset(e)}previewDockings(e,t,n){this._sceneManager.requestDockingsPreview(!0,e,t,n)}cancelDockings(){this._sceneManager.cancelDockings()}requestDeleteComponent(){this._sceneManager.requestDeleteSelectedComponent()}renderImage(e){return this._sceneManager.renderImage(e)}preparePerspectiveImage(e={}){return this._sceneManager.preparePerspectiveImage(e)}preparePartImage(e,t){let n={};return"number"==typeof t?n.size=t:(t||(t={}),"number"!=typeof t.size&&(t.size=256),n=t),this._sceneManager.preparePartImage(e,n)}saveCurrentConfiguration(){return new Promise((e,t)=>{this._plannerKernelAccess.getConfigurationData(this._configuratorContext.planObjectId).then(n=>{this._rapiAccess.saveConfiguration(n).then(n=>{this._configuratorUiCallbacks.onConfigurationSaved(n.configurationHash),this._rapiAccess.getComponent(n.rootComponentId).then(i=>{let o=!0,s=!0,r=n.perspectiveImage,a=n.topImage;n.perspectiveImage||(o=!1,this._sceneManager.preparePerspectiveImage().then(l=>{this._rapiAccess.savePerspectiveImage(n,l).then(t=>{o=!0,r=t.perspectiveImage,s&&(t.label=i.label,t.topImage=a,e(t))},t)})),n.topImage||(s=!1,this._sceneManager.prepareTopImage().then(l=>{this._rapiAccess.saveTopImage(n,l).then(t=>{s=!0,a=t.topImage,o&&(t.label=i.label,t.perspectiveImage=r,e(t))},t)})),o&&s&&(n.label=i.label,e(n))},e=>{throw new Error(e)})},t)}).catch(t)})}generateImagesOfCurrentConfiguration(){return new Promise((e,t)=>this.saveCurrentConfiguration().then(t=>e({topImage:t.topImage,perspectiveImage:t.perspectiveImage,isLocally:t.isLocally}),t))}prepareTopImage(e){let t={};return"boolean"==typeof e?t.showDimensions=e:(e||(e={}),"boolean"!=typeof e.showDimensions&&(e.showDimensions=!1),t=e),this._sceneManager.prepareTopImage(t)}resetCameraPosition(){this._sceneManager.resetCameraPositionToStart()}showBenchmarks(e){I.showBenchmarks(e)}debugSceneGraph(e){this._sceneManager.debugSceneGraph(e)}async loadConfiguration(e,t){this.setOverrides(t),this._configuratorContext.lastLoadedRapiId=null,this._sceneManager&&this._sceneManager.clearScene();const n=await this._performLoadConfiguration(e);return this._rapiAccess.trackView("configuration string"),n}async loadConfigurationById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!0);return this._rapiAccess.trackView(e),n}syncPlanObjectToView(e,t){this.resumeKernelCallbacks(),this._plannerKernelAccess.requestSync(e,t),this._plannerKernelAccess.requestPlanObjectConstruction(t);const n=this._plannerKernelAccess.getSerializedConfiguration(t),i=this._plannerKernelAccess.getCurrentConfigurationHash(t);this._plannerKernelAccess.planObjectConfigurationUpdated(t,n,i),this._sceneManager.resetCameraPositionToStart(!1)}async loadConfigurableItemById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!1);return this._rapiAccess.trackView(e),n}preLoadConfigurationById(e){return this._preLoadItemOrConfig(e,!0)}preLoadConfigurableItemById(e){return this._preLoadItemOrConfig(e,!1)}_getTag(e){return this._rapiAccess.getTag(e)}_dispatchSetParameter(e,t,n,i,o){const s=this._configuratorContext.selectedRuntimeComponentId?"local":"global",r=I.start("kernel_change_param_"+s+"_"+e);switch(this._configuratorContext.selectionMode){case"standard":if(this._configuratorContext.selectedRuntimeComponentId||this._configuratorContext.rootComponentParametersAsGlobal){let s=this._configuratorContext.selectedRuntimeComponentId?this._configuratorContext.selectedRuntimeComponentId:this._configuratorContext.rootComponentId;this._plannerKernelAccess.changeComponentParameter(s,e,t,n,i,o)}else this._plannerKernelAccess.changePlanObjectParameter(this._configuratorContext.planObjectId,e,t,n,i,o);break;case"multiselect":this._plannerKernelAccess.changeCommonComponentParameter(this._configuratorContext.selectedRuntimeComponentIds,e,t,n,i,o)}I.end(r)}setParameter(e,t,n=!1){return new Promise((i,o)=>{const{key:s,type:r}=e;if(O(e)){if(!n&&!this._unitFormatter.isParseableUnitString(t,e))return o(new SyntaxError('Value "'+t+'" is not parseable'));const i=n?t:this._unitFormatter.parseValue(t,e),{valueFrom:s,valueTo:a}=e.validRange,l=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(s)&&i<s-l)return o(new RangeError('Value "'+t+'" is too small, min-val "'+s+'"'));if(!Number.isNaN(a)&&i>a+l)return o(new RangeError('Value "'+t+'" is too big, max-val "'+a+'"'));t="Integer"===r&&"number"==typeof i?i.toFixed():i.toString()}this._sceneManager.cancelDockings(),this._dispatchSetParameter(s,r,t,i,o)})}setParameterOfPlanObject(e,t){return new Promise((n,i)=>{const{planObjectId:o,rootComponentId:s,rootComponentParametersAsGlobal:r}=this._configuratorContext,{type:a,key:l}=e;r?this._plannerKernelAccess.changeComponentParameter(s,l,a,t,n,i):this._plannerKernelAccess.changePlanObjectParameter(o,l,a,t,n,i)})}getParametersOfPlanObject(){const{planObjectId:e,rootComponentParametersAsGlobal:t}=this._configuratorContext;return this._plannerKernelAccess.getGlobalParameters(e,t)}setParameterOfRootComponent(e,t){return new Promise((n,i)=>{const{rootComponentId:o}=this._configuratorContext,{type:s,key:r}=e;this._plannerKernelAccess.changeComponentParameter(o,r,s,t,n,i)})}getParametersOfRootComponent(){const{planObjectId:e}=this._configuratorContext;return this._plannerKernelAccess.getGlobalParameters(e,!0)}enableMultiselect(){this._sceneManager.setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._sceneManager.setSelectionMode("standard"),this._configuratorContext.selectionMode="standard"}getCurrentConfiguration(){return k.waitFor(1,()=>this._plannerKernelAccess.uiRequestConfiguration(this._configuratorContext.planObjectId))}loadComponentIntoKernel(e){return k.waitFor(0,()=>{let t=null;try{if(t=JSON.parse(e).id,!t)throw new Error("Component string has no ID")}catch(e){return this._configuratorUiCallbacks.onContentProblem({rapiPath:"components",ids:[t],message:"Component string is not a valid JSON or has no ID"}),void k.failOperation(0,e)}this._kernelIo.setMeta({componentId:t}),this._plannerKernelAccess.loadComponentIntoKernel(e,t)})}getShortUrlOfCurrentConfiguration(){return new Promise((e,t)=>{this.saveCurrentConfiguration().then(n=>navigator.onLine?this._rapiAccess.getShortUrl(n.id,3).then(t=>{const n=t.shortId,i=b.APP.SHORTENER_URL+n;e(i)},t):t("Can not generate short url when offline"),t)})}formatValueToUnitString(e,t){return this._unitFormatter.formatValueToUnitString(e,t)}getTagById(e,t){return new Promise((n,i)=>{this._getTag(e).then(e=>{let o=Promise.resolve([]),s=Promise.resolve([]);t&&t.include&&t.include.forEach(t=>{"materials"===t&&(o=this._rapiAccess.getMaterialsOf(e)),"items"===t&&(s=this._rapiAccess.getItems(e.items))}),Promise.all([o,s]).then(([t,i])=>(i.sort(ae),t.sort(ae),n({...e,items:i,materials:t})),i)},i)})}requestAsset(e){return this._dataSyncer.requestAsset(e)}changeFloorMaterial(e){return this._sceneManager.changeFloorMaterial(e)}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._sceneManager.changeFloorMaterial(t)}openFloorMaterials(){this._configuratorUiCallbacks.onOpenFloorMaterials()}openPartList(){this._configuratorUiCallbacks.onOpenPartList()}getAdditionalContentsOf(e){return this._rapiAccess.getAdditionalContentsOfItems(e)}changeTypeChangeTag(e){navigator.onLine&&this._initData.offlineSync&&this._dataSyncer.syncTypeChangeTag(e),this._configuratorUiCallbacks.onChangeTypeChangeTag(e)}removeTypeChangeTag(e){this._configuratorUiCallbacks.onRemoveTypeChangeTag(e)}showGUI(){this._sceneManager.showGUI()}showStats(){this._sceneManager.showStats()}showDimensions(){this._sceneManager.showDimensions()}hideDimensions(){this._sceneManager.hideDimensions()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}syncFloorTag(e){return this._dataSyncer.syncFloorTag(e)}syncTypeChangeTag(e){return this._dataSyncer.syncTypeChangeTag(e)}loadDynamicLightSetting(e){return this._sceneManager.loadDynamicLightSetting(e)}setBackgroundColor(e){this._sceneManager.setBackgroundColor(e)}setBackgroundImage(e){this._sceneManager.setBackgroundImage(e)}setBakedShadow(e,t){this._sceneManager.setBakedShadow(e,t)}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}enableMeshSelection(e){this._initData.meshSelection=e}updateSize(){this._sceneManager.updateCamera()}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}getMain(){}cleanup(e={}){this._configuratorContext.selectedRuntimeComponentIds=[],this._plannerKernelAccess.cleanUpCallbacks(),this._sceneManager.sceneCleared(!!e.resetMeshCache),e.resetCoreCache&&this._plannerKernelAccess.kernelInstance.clearAll(),e.resetApiCache&&this._rapiAccess.cleanUp()}resumeTest(e){e&&this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}zoomIn(e){this._sceneManager.zoomIn(e)}zoomOut(e){this._sceneManager.zoomOut(e)}get callbacks(){return this._configuratorUiCallbacks}get globalCallbacks(){return this._globalCallback}getRuntimeComponentIdOfRootComponent(){const e=this._configuratorContext.planObjectId;return e?this._plannerKernelAccess.getRuntimeComponentIdOfRootComponent(e):(console.warn("planObjectId not set"),0)}getCurrentConfigurationHash(){return this._plannerKernelAccess.getConfigurationHash(this._configuratorContext)}getCurrentSelection(){let e=this._configuratorContext.selectedRuntimeComponentIds;return e&&e.length||(e=[this._configuratorContext.rootComponentId]),e.map(e=>this._plannerKernelAccess.getRuntimeComponentId(e))}_enableHD(e){return new Promise((t,n)=>{this._scriptLoader.fetch(q,{id:"pi-js"}).then(()=>{this._sceneManager.enableHD(e),t()},n)})}isReady(){const e=I.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=I.getMeta("kernel_is_ready");this._configuratorUiCallbacks.onTrackTiming("Timing","KernelIsReady",Math.round(t.duration),Object.assign(n,{startTime:t.startTime}))}this._isKernelReady=!0,this._checkInitDone(),"function"==typeof this._configuratorUiCallbacks.onKernelIsReady&&this._configuratorUiCallbacks.onKernelIsReady()}updatePossibleChildren(e,t,n){const i=[],o=[];let s;const r=new Map,a=new Map;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n.possible)continue;let l=n.itemId;n.itemId?(o.push(n.itemId),a.set(n.itemId,n)):(i.push(n.componentId),r.set(n.componentId,n),l=n.componentId),n.isDefault&&!s&&(s=l)}Promise.all([this._rapiAccess.getComponents(i),this._rapiAccess.getItems(o)]).then(e=>{const t=[],n=e[0],i=e[1];let o;for(let e=0,i=n.length;e<i;e++){const i=n[e];i.isItem=!1,i.isComponent=!0;const a=r.get(i.id);a&&(i.group=a.group),i.id===s&&(i.isDefault=!0,o=i),t.push(i)}for(let e=0,n=i.length;e<n;e++){const n=i[e];n.isItem=!0,n.isComponent=!1;const r=a.get(n.id);r&&(n.group=r.group),n.id===s&&(n.isDefault=!0,o=n),t.push(n)}return t.sort(ae),{possibleChildren:t,defaultChild:o||null}}).then(({possibleChildren:e,defaultChild:t})=>{const n=[],i=new Map,o=[];for(let t=0,s=e.length;t<s;t++){const s=e[t],r=s.tags;if(s.tags&&Array.isArray(s.tags)&&s.tags.length)for(let e=0,t=s.tags.length;e<t;e++){const t=r[e];-1===n.indexOf(t)&&n.push(t);let o=i.get(t);if(!o){const e=[];i.set(t,e),o=i.get(t)}o.push(s)}else o.push(s)}return{tagIds:n,associations:i,defaultChild:t,noTagChilds:o}}).then(({tagIds:t,associations:i,defaultChild:o,noTagChilds:s})=>{this._rapiAccess.getTags(t).then(t=>{if(this._isCorrectResponse(n,e)&&this._shouldBroadcastToUi(n)){for(let e=0,n=t.length;e<n;e++){const n=t[e];n.possibleChildren=i.get(n.id)}t.sort(ae),s.length&&t.unshift({id:"",externalIdentifier:"",global:!1,created:(new Date).toISOString(),updated:(new Date).toISOString(),language:this._globalInitData.locale,catalog:null,tags:[],parents:[],materials:[],items:[],possibleChildren:s}),this._configuratorUiCallbacks.onUpdatePossibleChildren(t,o)}},e=>{console.error("Couldnt load tags of possible children"),console.error(e)})},e=>console.error(e))}updateParameters(e,t,n,i){const o={};t||(t=[],console.warn("Kernel returned no parameter groups! Check why!")),t.forEach(e=>{o[e.key]=e}),e.sort(ae),e.forEach(e=>{e.group?e.grouping=o[e.group]:e.grouping=null,this._unitFormatter.formatParameter(e),L(e)&&Object.defineProperty(e,"groups",{get:()=>new Promise((t,o)=>{this._getMaterialGroups(e).then(e=>{this._isCorrectResponse(i,n)&&this._shouldBroadcastToUi(i)?t(e):o("Response does not match to ids")},o)})})}),this._shouldBroadcastToUi(i)&&this._configuratorUiCallbacks.onUpdateParameters(e)}loadError(e){this._isLoadError=!0,this._rejectOnLoadError&&this._rejectOnLoadError(e)}resumeKernelCallbacks(){this._plannerKernelAccess.muteKernelCallbacks=!1,this._plannerKernelAccess.resume()}pauseKernelCallbacks(){this._plannerKernelAccess.muteKernelCallbacks=!0,this._plannerKernelAccess.pause()}setActiveGroupInView(e){this._plannerKernelAccess.setActiveGroupInView(e)}getParameterGroups(){return this._plannerKernelAccess.getParameterGroups()}async getConfiguratorSettings(e){return this._rapiAccess.getConfiguratorSettings(e)}async moveCamera(e){return this._sceneManager.moveCamera(e)}selectComponent(e){return this._configuratorContext.selectedRuntimeComponentId===e?Promise.resolve():Promise.resolve(this._sceneManager.selectComponent(e))}setComponentParameter(e,t,n){const{key:i,type:o}=t;return new Promise((t,s)=>this._plannerKernelAccess.changeComponentParameter(e,i,o,n,t,s))}highlightParts(e){this._sceneManager.highlightParts(e)}undo(){const e=this._configuratorHistory.undo();e&&this._plannerKernelAccess.loadConfiguration(e)}redo(){const e=this._configuratorHistory.redo();e&&this._plannerKernelAccess.loadConfiguration(e)}clearHistory(){this._configuratorHistory.clearHistory()}getHashOfSerializedConfiguration(e){return this._plannerKernelAccess.kernelInstance.getHashOfSerializedConfiguration(e)}}return n([i],e.prototype,"_rapiAccess",void 0),n([i],e.prototype,"_dataSyncer",void 0),n([i],e.prototype,"_errorHandler",void 0),n([i],e.prototype,"_unitFormatter",void 0),n([i],e.prototype,"_domHelper",void 0),n([i],e.prototype,"_configuratorUiCallbacks",void 0),n([i],e.prototype,"_configuratorKernelAccessCallback",void 0),n([i],e.prototype,"_lifeCycleManager",void 0),n([i],e.prototype,"_plannerKernelAccess",void 0),n([i],e.prototype,"_threeLoader",void 0),n([i],e.prototype,"_scriptLoader",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_initData",void 0),n([i],e.prototype,"_globalInitData",void 0),n([i],e.prototype,"_globalCallback",void 0),n([i],e.prototype,"_kernelIo",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})())}}}));
2
+ //# sourceMappingURL=roomle-configurator-30b6b70d.legacy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"roomle-configurator-60e1c49a.legacy.js","sources":["../../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"8pBAAe"}
1
+ {"version":3,"file":"roomle-configurator-30b6b70d.legacy.js","sources":["../../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"8pBAAe"}
@@ -0,0 +1,16 @@
1
+ System.register(["./main-thread-to-worker-6f382b43.legacy.js"],(function(e,t){var n,s,i,o,r,a,l,h,c,d,u,_,p,m,g,f,E;return{setters:[function(e){n=e.a,s=e.g,i=e.M,o=e.h,r=e.R,a=e.b,l=e.s,h=e.c,c=e.e,d=e.f,u=e.r,_=e.j,p=e.w,m=e.o,g=e.u,f=e.k,E=e.l}],execute:function(){e({_:M,i:J,o:jt});class C{constructor(){this._context=new Map,this._lookups=new Map,this._singletons=new Map}getContext(e){if(this._context.has(e)){const t=this._context.get(e);return this._context.set(e,t+1),e+t}return this._context.set(e,1),e+0}addDependencyInjectionAssignments(e){e.forEach(e=>{this._lookups.set(e.className,e)})}lookup(e,t){if(!this._lookups.has(e))return null;const n=this._lookups.get(e);if(1===n.type&&void 0===t){const t="Dependency "+e+" has definition context but no context was defined!";return console.trace(t),console.error(t),null}let s=t&&1===n.type?t:"global";if(s+="_"+e,2===n.type)return new n.classDefinition;if(this._singletons.has(s))return this._singletons.get(s);const i=new n.classDefinition(t);return this._singletons.set(s,i),i}cleanUp(e){if(e){let t=[];this._singletons.forEach((n,s)=>{s.startsWith(e)&&t.push(s)}),t.forEach(e=>{this._singletons.delete(e)})}else this._singletons.clear(),this._singletons=new Map}}class w{constructor(e,t,n){this.className=e,this.classDefinition=t,this.type=void 0===n?0:n}}e("D",w);const y={JPG:".jpg",JPEG:".jpeg",PNG:".png",GIF:".gif"};class b{_base64toBlob(e,t){t=t||"";const n=atob(e),s=n.length,i=Math.ceil(s/1024),o=new Array(i);for(let e=0;e<i;++e){let t=1024*e,i=Math.min(t+1024,s);const r=new Array(i-t);for(let e=t,s=0;e<i;++s,++e)r[s]=n[e].charCodeAt(0);o[e]=new Uint8Array(r)}return new Blob(o,{type:t})}_createFormData(e,t,n,s){const i=new FormData;-1!==e.indexOf(",")&&(e=e.substr(e.indexOf(",")+1));const o=-1===Object.keys(y).map(e=>y[e]).indexOf(n)?"application":"image",r=this._base64toBlob(e,o+"/"+n.substr(1));return i.append(s,r,t+n),i}create(e,t,n,s){return this._createFormData(e,t,n,s)}}
2
+ /*! *****************************************************************************
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
15
+ ***************************************************************************** */function M(e,t,n,s){var i,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(r=(o<3?i(r):o>3?i(t,n,r):i(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}class v{constructor(){this._size=256,this._maxLod=0,this._encoding=THREE.LinearEncoding,this._type=THREE.UnsignedByteType,this._format=THREE.RGBAFormat,this._cubeTextures=[],this._lightDirection=new THREE.Vector3,this._path=""}setPath(e){this._path=e}load(e){return new Promise(t=>{(new THREE.FileLoader).setResponseType("arraybuffer").load(this._path+e,e=>{this.parseData_(e),t(this._cubeTexture)})})}parseHeader_(e){let t=new DataView(e,0,30);this._size=t.getUint16(0),this._maxLod=t.getUint8(2),this._encoding=t.getUint16(3),this._type=t.getUint16(5),this._format=t.getUint16(7),this._lightDirection.x=t.getFloat32(9),this._lightDirection.y=t.getFloat32(13),this._lightDirection.z=t.getFloat32(17)}parseBufferData_(e,t){let n=this._size;const s=Math.log2(this._size)+1;this._cubeTextures=[];for(let i=0;i<s;i++){let s=new THREE.CubeTexture;this._cubeTextures.push(s),s.format=THREE.RGBAFormat,s.encoding=this._encoding,s.type=this._type,s.minFilter=THREE.LinearMipMapLinearFilter,s.magFilter=THREE.LinearFilter,s.generateMipmaps=!1;for(let i=0;i<6;i++){let o=new Uint8Array(e,t,4*n*n),r=new THREE.DataTexture(o,n,n);r.format=s.format,r.encoding=s.encoding,r.type=s.type,r.generateMipmaps=!1,t+=4*n*n,s.images[i]=r,r.needsUpdate=!0}s.needsUpdate=!0,n/=2}this._cubeTexture=new THREE.CubeTexture,this._cubeTexture.format=THREE.RGBAFormat,this._cubeTexture.encoding=this._encoding,this._cubeTexture.type=this._type,this._cubeTexture.minFilter=THREE.LinearMipMapLinearFilter,this._cubeTexture.magFilter=THREE.LinearFilter,this._cubeTexture.generateMipmaps=!1;for(let e=0;e<6;e++){this._cubeTexture.image[e]=this._cubeTextures[0].images[e];for(let e=1;e<s;e++)this._cubeTexture.mipmaps[e-1]=this._cubeTextures[e],this._cubeTextures[e].needsUpdate=!0}this._cubeTexture.needsUpdate=!0,this._cubeTexture.maxLod=this._maxLod-1}convertToRGBABuffer(e){let t=new Uint8Array(e,30,e.byteLength-30),n=4;this._format===THREE.RGBFormat&&(n=3);const s=4*t.length/n;let i=new ArrayBuffer(s),o=new DataView(i),r=0,a=t.length/n;if(3===n)for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,255);else for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,t[e+3*a]);return i}parseData_(e){this.parseHeader_(e);let t=30;t=0;let n=this.convertToRGBABuffer(e);this.parseBufferData_(n,0)}}const P=e("t",(function(e){return e*(Math.PI/180)})),T=e("d",(function(e){return e*(180/Math.PI)})),I=(e("g",(function(e,t,n,s,i,o){e=Math.sqrt(e*e+n*n);const r=i/o,a=2*Math.atan(Math.tan(s*Math.PI/180/2)*r)*180/Math.PI,l=P(s),h=t/2/Math.tan(l/2),c=e/(2*Math.atan(Math.PI*a/360));return Math.max(h,c)})),function(e){return Math.round(1e3*e)/1e3}),k=(e("l",(function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)})),e("z",(e,t,n,s)=>{if(!e||!t||0===n||0===s)return new THREE.Vector3;let i=e.clone(),o=n/2,r=s/2;return i.project(t),i.x=Math.floor(i.x*o+o),i.y=Math.floor(-i.y*r+r),i.z=e.distanceTo(t.position),i}),e("w",(e,t)=>{t||(t=new THREE.Vector3(0,0,0));let n=new THREE.Vector3(e.size.x/1e3,e.size.z/1e3,e.size.y/1e3),s=new THREE.Vector3(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),i=new THREE.Vector3(0,0,-n.z).add(s).sub(t),o=new THREE.Vector3(n.x,n.y,0).add(s).add(t);return new THREE.Box3(i,o)}));e("p",(e,t)=>{let n=I(e.x),s=I(e.y),i=I(e.z),o=I(t.x),r=I(t.y),a=I(t.z);return n===o&&s===r&&i===a}),e("r",(e,t)=>{let n=I(e.w),s=I(e.x),i=I(e.y),o=I(e.z),r=I(t.w),a=I(t.x),l=I(t.y),h=I(t.z);return n===r&&s===a&&i===l&&o===h}),e("c",(e,t)=>{let n=I(e.x),s=I(e.y),i=I(t.x),o=I(t.y);return n===i&&s===o});let R=null;const x=()=>{if(R)return R;const e=new Uint8Array(4);for(let t=0;t<1;t++){const n=4*t;e[n]=255,e[n+1]=255,e[n+2]=255,e[n+3]=255}const t=new THREE.DataTexture(e,1,1,THREE.RGBAFormat);return t.needsUpdate=!0,t},S=(e,t,n,s)=>{const i=new Uint8Array(4),o=Math.floor(255*e),r=Math.floor(255*t),a=Math.floor(255*n),l=Math.floor(255*s);for(let e=0;e<4;e++){const t=4*e;i[t]=o,i[t+1]=r,i[t+2]=a,i[t+3]=l}const h=new THREE.DataTexture(i,1,1,THREE.RGBAFormat);return h.needsUpdate=!0,h},L=e("h",(e,t)=>D(null,e,t)),D=e("a5",(e,t,s)=>{if(e||(e=A()),e.name=t.id?t.id.toString():"",void 0!==t.shading.metallic&&(e.metalness=1===t.shading.metallic?1:.5,e.reflectivity=n(t.shading.metallic,.5)),t.shading.transmission&&t.shading.transmission>0?(e.transmission=t.shading.transmission,e.opacity=1,e.transparent=!0,e.depthWrite=!1,e.metalness=0):void 0!==t.shading.alpha&&t.shading.alpha<1&&(e.transparent=t.shading.alpha<1,e.opacity=t.shading.alpha,e.depthWrite=t.shading.alpha>=1),e.aoMapIntensity=n(t.shading.occlusion,1),e.roughness=n(t.shading.roughness,.5),e.alphaTest=n(t.shading.alphaCutoff,0),void 0!==t.shading.basecolor){const n=new THREE.Color(t.shading.basecolor.r,t.shading.basecolor.g,t.shading.basecolor.b);e.color.copy(n.convertSRGBToLinear())}return null==s||s.setEnvMap(e),t.shading.doubleSided?e.side=THREE.DoubleSide:e.side=THREE.FrontSide,e.map||(R||(R=x()),e.map=R),e}),A=()=>new THREE.MeshPhysicalMaterial({});e("a6",e=>{let t=e.color.clone().convertLinearToSRGB(),n={alpha:e.opacity,metallic:e.reflectivity,basecolor:{r:t.r,g:t.g,b:t.b},roughness:e.roughness,doubleSided:e.side===THREE.DoubleSide,alphaCutoff:e.alphaTest,transmission:e.transmission};return 1===e.metalness?n.metallic=1:n.metallic=e.reflectivity,n});let O=null;const H=e("j",(e,t,n,s,i,o,r=16)=>(O||(O=new THREE.TextureLoader,O.crossOrigin=""),new Promise((a,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void a();O.load(e,e=>{U(e,t,n,s,i,o,r),a()},l)}))),U=e("a7",(e,t,n,s,i,o,r=16)=>{e.anisotropy=s,e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,"ORM"===t.mapping&&r<=8?console.warn("ORM maps are not supported on devices with only "+r+" texture units"):(e.repeat.set(i,o),"XYZ"===t.mapping?(n.normalMap=e,n.map===x()&&(n.map=null)):"ORM"===t.mapping?(n.aoMap=e,n.roughnessMap=e,n.metalnessMap=e):(e.encoding=THREE.sRGBEncoding,n.map=e),"RGBA"===t.mapping&&(n.transparent=!0),n.needsUpdate=!0)}),j=(e("k",(e=!0)=>window.dat&&window.dat.GUI?(window.__RML_GUI__||(window.__RML_GUI__=new dat.GUI({autoPlace:e})),window.__RML_GUI__):null),e("$",(e,t,n=!0)=>{let s=e.getWorldDirection(new THREE.Vector3),i=Math.abs(s.y);i<.5&&!t.transparent&&j(t,!0,n),i>.5&&t.transparent&&j(t,!1,n)}),e("a0",(e,t,n=!0)=>{if(!e.userData.tween)if(t)if(e.transparent=!0,n){let t={opacity:1};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:.2},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.userData.tween=!1}).start()}else e.opacity=.2;else if(n){let t={opacity:.2};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:1},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.transparent=!1,e.userData.tween=!1}).start()}else e.opacity=1,e.transparent=!1})),F=(e("Y",(e,t)=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const s={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(s).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=s.opacity}).onStop(()=>{t.transparent||(n.transparent=t.transparent),n.opacity=t.opacity,n.needsUpdate=!0,e.userData.tween=void 0}).onComplete(()=>{t.transparent||(n.transparent=t.transparent),n.needsUpdate=!0,e.userData.tween=void 0}).start()}})}),e("f",e=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){let t=e.material;if(0===t.opacity)return;let n={opacity:0,transparent:!0},s={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(s,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=s.transparent}).start()}})})),B=e("m",e=>{"Mesh"===e.type?G(e):V(e)}),V=e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{G(e)})},G=e("y",e=>{e&&(e.material&&z(e.material),e.geometry&&K(e.geometry),e.children&&e.children.length>0&&V(e))}),K=e=>{e&&e.dispose()},z=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let N;e("x",e=>0===e.x&&0===e.y&&0===e.z);const W=(e,t)=>{let n="";return e||""===e?(e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rbg"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n):null};e("v",(e,t,n=.01)=>!(!e||!t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n),e("K",e=>{let t=e.getWorldDirection(new THREE.Vector3).clone();t.y=0,t.lengthSq()<.01&&(t=new THREE.Vector3(0,1,0),t.applyQuaternion(e.quaternion),t.y=0),t.normalize();let n=Math.asin(t.x);return t.z<0&&(n=Math.PI-n),n<0&&(n+=2*Math.PI),n});const q=function(e){return e.startsWith("_")&&(e=e.substr(1)),e.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(function(e,t){return(t>0?"-":"")+e.toLowerCase()}))};function J(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(q(t),this._creator_);e?this[n]=e:console.error("Dependency "+q(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}let X=e("a9",(()=>{class e{constructor(e){this._hdrCubeUrl="static/roomle-91862a5e7f3f46e5.envmap",this._hdrCubeUrlLowres="static/roomle64-adb0f447a54b5143.envmap",this._envMapReader=new v,this._onEnvMapUpdate=[],this._creator_=e;const t=new THREE.Color("#DDDDDD");this._environmentMap=((e,t,n,s)=>{const i=new THREE.CubeTexture;i.format=THREE.RGBAFormat,i.generateMipmaps=!1;for(let s=0;s<6;++s){const o=S(e,t,n,1);o.format=i.format,o.type=i.type,o.minFilter=i.minFilter,o.magFilter=i.magFilter,o.generateMipmaps=i.generateMipmaps,o.needsUpdate=!0,i.images[s]=o}return i.needsUpdate=!0,i})(t.r,t.g,t.b),this._envMapReader.setPath(s()),this._loadHDREnvMap(this._hdrCubeUrlLowres)}static setEnvironmentMap(e,t){e&&t&&(e.envMap=t,e.envMapIntensity=1,e.needsUpdate=!0)}getEnvironmentMap(){return this._environmentMap}_processPMREM(e){const t=new THREE.PMREMGenerator(this._renderer);let n=t.fromCubemap(e);return e.magFilter=THREE.LinearFilter,e.needsUpdate=!0,t.dispose(),n.texture}_loadHDREnvMap(e){return this._initData.disableEnvMap?Promise.resolve():new Promise(t=>{this._envMapReader.load(e).then(n=>{n.encoding=THREE.sRGBEncoding;const s=this._renderer.extensions.get("EXT_shader_texture_lod");this._environmentMap=s?this._processPMREM(n):n,e!==this._hdrCubeUrl&&(this._environmentMap.encoding=THREE.sRGBEncoding,window.requestIdleCallback(this._loadHDREnvMap.bind(this,this._hdrCubeUrl))),this._updateEnvironmentMap(),t(),this._envChangedCallback&&this._envChangedCallback()})})}setRendererAndScene(e,t){this._renderer=e,this._scene=t}registerEnvironmentChangedCallback(e){this._envChangedCallback=e}_updateEnvironmentMap(){this._initData.disableEnvMap||(this._scene.traverse(t=>{t instanceof THREE.Mesh&&(t.material instanceof THREE.MeshStandardMaterial||"MeshPhysicalMaterial"===t.material.type)&&e.setEnvironmentMap(t.material,this._environmentMap)}),this._onEnvMapUpdate.forEach(e=>e()),this._onEnvMapUpdate=[])}onEnvMapUpdate(e){this._onEnvMapUpdate.push(e)}setEnvMap(t){this._initData.disableEnvMap||e.setEnvironmentMap(t,this.getEnvironmentMap())}}return M([J],e.prototype,"_initData",void 0),e})());const Y=e("J",{SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"});class Q{static createDynamicLightSettingSource(e,t){let n={};if(e)n.url=e;else if(t)switch(t){case Y.SHELF:n.url=s()+"static/shelf-2975dd3f2fa9c763.json";break;case Y.SHELF_FRONT:n.url=s()+"static/shelf_front-8c9566a4512f0de8.json";break;case Y.SOFA:n.url=s()+"static/sofa-997b116bc5f2e92e.json";break;case Y.BAKED:n.url=s()+"static/baked-6485a2b1daeb69e8.json";break;case Y.CAMERA:n.url=s()+"static/camera-f4cef679615485dc.json";break;case Y.EQUAL:n.url=s()+"static/equal-319f6b83c827913f.json";break;default:n.url=s()+"static/camera-f4cef679615485dc.json"}else n=null;return n}parse(e){let t=JSON.parse(e);return t.lights?this.load(t):[]}load(e){let t=[];return e.lights?(e.lights.forEach(e=>{let n;switch(e.type){case"ambient":n=this._parseAmbientLight(e);break;case"rectarea":n=this._parseRectAreaLight(e);break;case"spot":n=this._parseSpotLight(e);break;case"directional":n=this._parseDirectionalLight(e)}n&&t.push(n)}),t):[]}_parseAmbientLight(e){let t=new THREE.AmbientLight;return this._parseCommon(t,e),t}_parseRectAreaLight(e){let t=new THREE.RectAreaLight;this._parseCommon(t,e);let{intensity:n,castShadow:s,target:i,width:o,height:r}=e;return t.width=o||.8,t.height=r||.8,t.castShadow=s||!1,t.matrixAutoUpdate=!0,t.intensity=(n||240)/((o||.8)*(r||.8)),t.lookAt(i?new THREE.Vector3(i.x,i.y,i.z):new THREE.Vector3(0,0,0)),t}_parseSpotLight(e){let t=new THREE.SpotLight;this._parseCommon(t,e);let{angle:n,penumbra:s,target:i,castShadow:o}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=s||.5,t.lookAt(i?new THREE.Vector3(i.x,i.y,i.z):new THREE.Vector3(0,0,0)),t.shadow.camera.near=.1,t.shadow.camera.far=10,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.castShadow=o||!1,t}_parseDirectionalLight(e){let t=new THREE.DirectionalLight;this._parseCommon(t,e);let{target:n,castShadow:s}=e;return t.castShadow=s||!1,t.shadow.camera.near=.1,t.shadow.camera.far=100,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.shadow.bias=-5e-5,t.lookAt(n?new THREE.Vector3(n.x,n.y,n.z):new THREE.Vector3(0,0,0)),t}_parseCommon(e,t){let{name:n,intensity:s,color:i,position:o,movesWithCamera:r}=t;e.name=n||"",e.intensity=s||1,e.color=new THREE.Color(i||"#ffffff"),e.position.copy(o?new THREE.Vector3(o.x,o.y,o.z):new THREE.Vector3(0,0,0)),e.visible=!0,e.layers.set(1),e.userData.movesWithCamera=r}}e("n",Q);const $=["127.0.0.1","localhost","0.0.0.0"],Z=(e("Q",(function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)})),e("O",e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]})),ee=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,te=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class ne{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={}){return this._pendingRequests+=1,new Promise((n,s)=>{self.fetch(e,t).then(function(e){if(this._nextSlot(),te(e.ok,e.status))n(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";s(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),s(e)})})}fetch(e,t={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t)}}class se{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}e("L",se);let ie=(()=>{class e extends se{constructor(e){super(),this._creator_=e}setMeta(e){this._meta=e}get meta(){return this._meta?this._meta:{}}throw(e){const t="[Kernel Exception]: "+e;this._globalCallback.onKernelMsg("exception",e,this.meta),this.error(t)}error(e){this._globalCallback.onKernelMsg("error",e,this.meta),super.error(e)}warn(e){this._globalCallback.onKernelMsg("warning",e,this.meta),super.warn(e)}}return M([J],e.prototype,"_globalCallback",void 0),e})();const oe=new Map,re=new Map,ae=new Map,le=new Map;let he=e("a",(()=>{class e{constructor(e){this._bootCallbacks=[],this._isStarted=!1,this._isStarting=!1,this._alwaysUseCache=!1,this._creator_=e}start(e){return this._configuratorUiCallbacks.onSyncStarted(),this._startWorker().then(()=>this._handleCatalog(e)).then(()=>{const{typeChangeTag:e,floorMaterialsTag:t}=this._initData;Promise.all([this._syncFloorTag(t),this._syncTypeChangeTag(e)]).then(()=>{le.set(e,!0),this._configuratorUiCallbacks.onSyncDone()})})}syncCatalog(e){return this._startWorker().then(()=>this._handleCatalog(e))}syncFloorTag(e){return this._startWorker().then(()=>this._syncFloorTag(e))}syncTypeChangeTag(e){return this._startWorker().then(()=>this._syncTypeChangeTag(e))}_syncFloorTag(e){const t=[];return e&&!ae.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{t.push(this._handleMaterialsAndTextures(e))}),this._singlePromiseFactory.create(1,e,n=>{Promise.all(t).then(()=>{ae.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!le.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{this._rapiAccess.getItems(e.items).then(e=>{e.forEach(e=>{this.getIsCatalogSynced(e.catalog)&&t.push(this._handleCatalog(e.catalog))})})}),this._singlePromiseFactory.create(2,e,n=>{Promise.all(t).then(()=>{ae.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!re.get(e)}_startWorker(){return new Promise((e,t)=>{if(this._isStarted)return e();this._bootCallbacks.push({resolve:e,reject:t}),this._isStarting||(this._worker=new Worker(s()+"static/asset-loader.worker-796c70f59b977071.js"),this._mainThreadToWorker=new i(this,this._worker),this._isStarting=!0,this._mainThreadToWorker.sendToWorker(1))})}onCommand(e,t,n){switch(e){case 4:this._isStarted=!0,this._bootCallbacks.forEach(({resolve:e})=>e());break;case 3:this._mainThreadToWorker.resolvePromises(t,n)}}_handleCatalog(e){return this._singlePromiseFactory.create(0,e,t=>this.getIsCatalogSynced(e)?t():this._rapiAccess.getCatalog(e).then(e=>Promise.all([this._handleContentWithAssets(this._rapiAccess.getComponentsOf(e),["perspectiveImage"]),this._handleItemsAndAdditionalContents(e),this._handleMaterialsAndTextures(e),this._handleExternalMeshes(e),this._handleTags(e.tags)])).then(()=>{re.set(e,!0),t()},e=>this._softReject(t,'Catalog sync error: "'+e+'"')))}_handleTags(e){return this._handleContentWithAssets(this._rapiAccess.getTags(e),["pngIcon","svgIcon"])}_handleExternalMeshes(e){return new Promise(t=>{this._rapiAccess.getMeshesOfCatalog(e.id).then(e=>{const n=[];e.forEach(e=>{n.push(this._handleContentWithAssets(Promise.all([this._rapiAccess.getMesh(e.id)]),["url"]))}),Promise.all(n).then(t,e=>this._softReject(t,'Sync crt files error: "'+e+'"'))},e=>this._softReject(t,'getMeshesOfCatalog error: "'+e+'"'))})}_handleItemsAndAdditionalContents(e){return new Promise(t=>{this._rapiAccess.getItemsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["perspectiveImage"])),this._rapiAccess.getAdditionalContentsOfItems(e).then(e=>{const t=e.filter(e=>-1!==[5,6,4].indexOf(e.type));n.push(this._handleContentWithAssets(Promise.resolve(t),["content"]))},e=>this._softReject(t,'getAdditionalContentsOfItems error: "'+e+'"')),Promise.all(n).then(t,e=>this._softReject(t,'AdditionalContent image sync error:"'+e+'"'))})})}_handleMaterialsAndTextures(e){return new Promise(t=>{this._rapiAccess.getMaterialsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["thumbnail"])),e.forEach(e=>{n.push(this._handleContentWithAssets(this._rapiAccess.getTexturesOf(e),["image"]))}),Promise.all(n).then(t,e=>this._softReject(t,'getTexturesOf error: "'+e+'"'))},e=>this._softReject(t,'getMaterialsOf error: "'+e+'"'))})}_handleContentWithAssets(e,t){return new Promise(n=>e.then(e=>this._fetchAssets(e,t).then(n,e=>this._softReject(n,'_handleContentWithAssets error: "'+e+'"')),e=>this._softReject(n,'_handleContentWithAssets promise error: "'+e+'"')))}_fetchAssets(e,t){const n=[];e||(e=[]);for(let s=0,i=e.length;s<i;s++){const i=e[s];t.forEach(e=>{const t=i[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(oe.get(e))return t();this._assetUrlToBase64(e).then(n=>{oe.set(e,n),t()},e=>this._softReject(t,'_preCacheAsset error: "'+e+'"'))})}_assetUrlToBase64(e){return new Promise(t=>{this._mainThreadToWorker.sendToWorker(5,e,t,e=>this._softReject(t,'_assetUrlToBase64 error: "'+e+'"'))})}_softReject(e,t){this._errorHandler.softReject(e,t,2)}requestAsset(e,t=!1){return navigator.onLine&&!this._alwaysUseCache?e:oe.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){oe.set(e,t)}}return M([J],e.prototype,"_rapiAccess",void 0),M([J],e.prototype,"_singlePromiseFactory",void 0),M([J],e.prototype,"_errorHandler",void 0),M([J],e.prototype,"_configuratorUiCallbacks",void 0),M([J],e.prototype,"_initData",void 0),e})());class ce{constructor(e){this.info=e,this._init()}_init(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){e&&this._resolve(e),this._resolve()}reject(e){this._reject(e)}wait(){return this._promise}reset(){this._init()}}e("e",ce);var de=e("a1","static/GLTFLoader-5b296b5fb14cfe1a.js"),ue=e("a2","static/DRACOLoader-5edeeab4a8dbc0bd.js");const _e={"draco_wasm_wrapper.js":"static/draco_wasm_wrapper-d775f9f135cb30ff.js","draco_decoder.wasm":"static/draco_decoder-979e668167e37c95.wasm","draco_decoder.js":"static/draco_decoder-3866672a1fa2f980.js"};let pe=(()=>{class e{constructor(e){if(this._gltfLoaderGuard=new ce,this._creator_=e,THREE.GLTFLoader&&THREE.DRACOLoader)this._initLoaders();else{let e=this._scriptLoader.fetch(de,{id:"gltf-loader"}),t=this._scriptLoader.fetch(ue,{id:"draco-loader"});Promise.all([e,t]).then(()=>this._initLoaders())}}_initLoaders(){this._gltfLoader=new THREE.GLTFLoader;const e=new THREE.DRACOLoader;if("function"!=typeof e._loadLibrary)throw new Error("Can not patch draco loader! Did three.js update the DracoLoader example?");const t=e._loadLibrary.bind(e._loadLibrary);e._loadLibrary=(e,n)=>{const i=_e[e];if(!i)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(_e));return t(s()+i,n)},this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,s,i,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,s,i,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{h(e)})})}async loadGLTF(e,t,n,s,i,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,s,i,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{h(e)})})}_handleGLTFScene(e,t,n,s,i,o,r,a){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;if(n&&t.scene.position.copy(n),s&&(t.scene.rotation.y=s),i){const e=new THREE.Box3;e.setFromObject(t.scene);const{x:n,y:s,z:o}=e.getSize(new THREE.Vector3);let r=new THREE.Vector3(i.x/n,i.y/s,i.z/o);t.scene.scale.copy(r)}return o&&t.scene.scale.multiply(o),t.scene.type=e,t.scene.traverse(e=>{if(e instanceof THREE.Mesh){if(e.layers.set(3),e.material instanceof THREE.MeshStandardMaterial){const t=e.material;if(this._environmentLoader.setEnvMap(t),a&&r&&r>0){let e=new THREE.Color(r);t.color=e.copyGammaToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),t.scene}}return M([J],e.prototype,"_environmentLoader",void 0),M([J],e.prototype,"_scriptLoader",void 0),e})(),me=(()=>{class e{constructor(e){this._jsonLoaded=!1,this._creator_=e}_loadShaders(){return new Promise((e,t)=>{if(this._jsonLoaded)return e();this._networkLayer.fetch(s()+"static/shaders-63802d07b3443bcb.json",{credentials:"same-origin"}).then(o,t).then(t=>{window._rsl=t,this._jsonLoaded=!0,e()},t)})}fetch(){return window._rsl||(window._rsl={}),new Promise((e,t)=>this._loadShaders().then(()=>{this._scriptLoader.fetch("static/rthree-508a6ceb9a1516ce.js",{id:"three-lib"}).then(e,t)},t))}}return M([J],e.prototype,"_scriptLoader",void 0),M([J],e.prototype,"_networkLayer",void 0),e})(),ge=(()=>{class e{constructor(e){this._context_=e}getStore(e="rml_default"){return this._localStorage.getItem(e)||{entries:[]}}saveStore(e,t){this._localStorage.setItem(e,t)}addItem(e,t,n="rml_default",s=5){const i=this.getStore(n),o=i.entries.find(t=>t.id===e);if(o?(o.payload=t,o.date=Date.now()):i.entries.push({id:e,date:Date.now(),payload:t}),i.entries.length>s)for(i.entries.sort((e,t)=>t.date-e.date);i.entries.length>s;)i.entries.pop();this.saveStore(n,i)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}return M([J],e.prototype,"_localStorage",void 0),e})();class fe{set(e,t){t&&(void 0!==t.enableAA&&(e.enableAA=t.enableAA),this._setSAOPass(e,t),this._setShadowPass(e,t),this._setGroundShadow(e,t))}_setSAOPass(e,t){if(t.SAOPass){const n=t.SAOPass;void 0!==n.enabled&&(e.getSAOPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getSAOPass().smoothTransition=n.smoothTransition),n.occlusionWorldRadius&&(e.getSAOPass().occlusionWorldRadius=n.occlusionWorldRadius),n.intensity&&(e.getSAOPass().intensity=n.intensity),n.bias&&(e.getSAOPass().bias=n.bias),n.numSamples&&(e.getSAOPass().numSamples=n.numSamples)}}_setShadowPass(e,t){if(t.shadowPass){const n=t.shadowPass;void 0!==n.enabled&&(e.getShadowPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getShadowPass().smoothTransition=n.smoothTransition),void 0!==n.enableAccumulation&&(e.getShadowPass().enableAccumulation=n.enableAccumulation),n.shadowRadius&&(e.getShadowPass().shadowRadius=n.shadowRadius),n.shadowBiasMultiplier&&(e.getShadowPass().shadowBiasMultiplier=n.shadowBiasMultiplier),n.numSamples&&(e.getShadowPass().numSamples=n.numSamples)}}_setGroundShadow(e,t){if(t.groundShadow){const n=t.groundShadow;void 0!==n.enable&&(e.getShadowPlanePass().enable=n.enable),void 0!==n.smoothTransition&&(e.getShadowPlanePass().smoothTransition=n.smoothTransition),n.numSamples&&(e.getShadowPlanePass().numSamples=n.numSamples),n.numSamplesPerFrame&&(e.getShadowPlanePass().numSamplesPerFrame=n.numSamplesPerFrame)}}}e("q",fe);class Ee{constructor(e){this.autoQuality=!0,this.colors=r,this.unit=null,this.unitStringType=null,this.meshSelection=!0,this.stats=!1,this._measureTraffic=!1,this.gammaOutput=!0,this.disableDebugGUI=!1,this.disableEnvMap=!1,this.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.mode="3D",this.edit=!1,this.moc=!1,this._creator_=e}setOverrides(e){a(this,e)}}e("ad",Ee);const Ce=["language","browserLanguage","userLanguage","systemLanguage"];class we{constructor(e){this.locale=((e=null)=>{const t=window.navigator;if(e)return e.substr(0,2);if(Array.isArray(t.languages)&&t.languages.length>0)return t.languages[0].substr(0,2);for(let e=0,n=Ce.length;e<n;e++){const n=t[Ce[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){a(this,e)}}e("ac",we);class ye{constructor(e){return this._isMute=!1,this._creator_=e,l(this,"_isMute",{enumerable:!1,writable:!1}),l(ye.prototype,"_setMute",{enumerable:!1,writable:!1}),l(ye.prototype,"mute",{enumerable:!1,writable:!1}),l(ye.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}_setMute(e){h(this,"_isMute",!0),this._isMute=e,h(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}e("a8",ye);class be extends ye{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null)}}e("ab",be),e("G",{HSC:"rml-configurator",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"});let Me=(()=>{class e{constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}get element(){return this._container}setDomElement(e){if(!this._container){this._container=document.createElement("div"),this._container.classList.add("rml-threejs-canvas-container"),this._container.setAttribute("ondragover","return false"),this._container.style.position="relative",this._container.style.width="100%",this._container.style.height="100%";const t=document.createElement("style");t.innerText=".rml-threejs-canvas-container canvas{position:absolute;top:0;left:0;right:0;bottom:0;z-index:100; opacity:1;}",this._container.appendChild(t),e.appendChild(this._container)}this._element=e}getClientDimensions(){return new THREE.Vector2(this._element.clientWidth,this._element.clientHeight)}_removeDomElement(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}reset(){this._element=null,this._removeDomElement(this._container),this._container=null}pause(){this.reset()}resume(){}destroy(){}}return M([J],e.prototype,"_lifeCycleManager",void 0),e})();e("af",class{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}});let ve=(()=>{class e{constructor(e){this._plugins=[],this._creator_=e}async init(e,n,s){this._scene=e,this._uiScene=n,this._cameraPosition=s;const{bananaForScale:i}=this._initData;i&&await t.import("./banana-for-scale-f0f24a8a.legacy.js").then(({default:e})=>this._plugins.push(new e(this._creator_))),this._plugins.forEach(e=>e.setScene(this._scene)),this._plugins.forEach(e=>e.setUiScene(this._uiScene)),this._plugins.forEach(e=>e.updateBounds(this._bounds)),this._plugins.forEach(e=>e.moveCameraEnd(this._cameraPosition))}addPlugin(e){this._plugins.push(e),e.setScene(this._scene),e.setUiScene(this._uiScene),e.updateBounds(this._bounds),e.moveCameraEnd(this._cameraPosition)}updateBounds(e){this._bounds=e,this._plugins.forEach(t=>t.updateBounds(e))}clearScene(e,t){this._plugins.forEach(n=>n.clearScene(e,t))}getActivePlugins(){return this._plugins}getPlugin(e){for(let t of this._plugins)if(t instanceof e)return t;return null}moveCameraEnd(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraEnd(e))}moveCameraStart(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraStart(e))}needsUiScene(){return this._plugins.map(e=>e.needsUiScene()).reduce((e,t)=>e||t,!1)}}return M([J],e.prototype,"_initData",void 0),e})();class Pe{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,n)=>{this._finishPromiseExecutor.push({resolve:t,reject:n});const s=e?"allSettled":"all";Promise[s](this._waitingPromises).then(e=>{if("allSettled"===s){const t=[];e.forEach(({value:e,status:n})=>{"fulfilled"===n&&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}}let Te=(()=>{class e{constructor(e){this.materialQueue=new Pe,this._geometryComponentMaterialCache=new Map,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._configuratorPreviewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:1,roughness:1,envMap:null}),this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",roughness:1,metalness:0}),this._environmentLoader.setEnvMap(this._previewMaterial)}_generateGeometry(e,t,n,s,i){let o;return e&&this._cacheHolder.geometryCache.has(e)?o=this._cacheHolder.geometryCache.get(e):(o=new THREE.BufferGeometry,o.setIndex(new THREE.Uint32BufferAttribute(n,1)),o.setAttribute("position",new THREE.Float32BufferAttribute(t,3)),o.setAttribute("normal",new THREE.Float32BufferAttribute(i,3)),o.setAttribute("uv",new THREE.Float32BufferAttribute(s,2)),o.scale(.001,.001,.001),o.rotateX(-Math.PI/2),e&&this._cacheHolder.geometryCache.set(e,o)),o}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,n,s,i){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let o=c(e),r=L(o,this._environmentLoader);this._loadBenchmarkTextures(o,r,s,i).then(t,n)}else this._rapiAccess.getMaterial(e).then(e=>{let o=L(e,this._environmentLoader);this._loadTextures(e,o,s,i).then(t,n)},n)}_loadBenchmarkTextures(e,t,n=1,s=1){return new Promise((i,o)=>{const r=d(e.id);H(this._dataSyncer.requestAsset(r.image,!0),r,t,this._maxAnisotropy,n/(0===r.mmWidth?1:r.mmWidth),s/(0===r.mmHeight?1:r.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),i()},o)})}_loadTextures(e,t,n=1,s=1){return new Promise((i,o)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),i();this._rapiAccess.getTexturesOf(e).then(r=>{let a=[];r.forEach(e=>{a.push(H(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,n/(0===e.mmWidth?1:e.mmWidth),s/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(a).then(()=>{this._cacheHolder.materialCache.set(e.id,t),i()},o)})})}_loadMaterial(e,t,n){return new Promise((s,i)=>{this._singlePromiseFactory.create(6,e,(s,i)=>this._createMaterial(e,s,i,t,n)).then(()=>{setTimeout(()=>s(this._cacheHolder.materialCache.get(e)),0)},i)})}_assignMaterial(e,t){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),Promise.resolve()):new Promise((n,s)=>{this._loadMaterial(t).then(s=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,s),n()},s)})}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(n=>{let s,i="rbg"+JSON.stringify(t);this._cacheHolder.materialCache.has(i)?s=this._cacheHolder.materialCache.get(i):(s=new THREE.MeshStandardMaterial({color:t}),this._environmentLoader.setEnvMap(s),this._cacheHolder.materialCache.set(i,s)),this.changeMaterialOfMesh(e,s),setTimeout(()=>n(),0)})}_assignItem(e,t){return new Promise((n,s)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void n();this._rapiAccess.getItem(t).then(i=>{if(i.topImage)this._textureLoader.load(i.topImage,s=>{s.anisotropy=this._maxAnisotropy,s.wrapS=THREE.RepeatWrapping,s.wrapT=THREE.RepeatWrapping;let o=new THREE.Vector2(1,1);i.width>0&&(o.x=1/i.width),i.depth>0&&(o.y=1/i.depth),s.repeat.set(o.x,o.y);const r=new THREE.MeshPhysicalMaterial({map:s,roughness:.5,metalness:.1});this._environmentLoader.setEnvMap(r),this._cacheHolder.materialCache.set(t,r),this.changeMaterialOfMesh(e,r),setTimeout(()=>n(),0)});else{const e="can not set material, catalog item top image is not set";console.warn(e),s(e)}},s)})}setMaterialLoadedListener(e){this._materialLoaded=e}removeMaterialLoadedListener(){this._materialLoaded=void 0}_createMesh(e,t,n){if(e&&t){const s=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(s)){const e=this._geometryComponentMaterialCache.get(s);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new THREE.Mesh(n,t)}}}return new THREE.Mesh(n,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}}return M([J],e.prototype,"_rapiAccess",void 0),M([J],e.prototype,"_environmentLoader",void 0),M([J],e.prototype,"_dataSyncer",void 0),M([J],e.prototype,"_singlePromiseFactory",void 0),M([J],e.prototype,"_cacheHolder",void 0),M([J],e.prototype,"_plannerMeshGenerator",void 0),e})();class Ie extends Te{constructor(e){super(e),this._environmentLoader.setEnvMap(this._configuratorPreviewMaterial)}generateMesh(e=0,t=null,n,s,i,o,r,a=!1){let l;l=a?this._generateGeometry(t,s,i,o,r).clone():this._generateGeometry(t,s,i,o,r);const h=this._createMesh(e,t,l);return h.userData.materialId=n,n&&this.materialQueue.push(this._assignMaterial(h,n).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n)})),h}setMaterial(e,t,n){return this._assignMaterial(e,t)}loadMaterial(e,t,n){return super._loadMaterial(e,t,n)}loadTextures(e,t,n,s){return super._loadTextures(e,t,n,s)}}e("aa",Ie);class ke{constructor(){this._listeners={},this._disabled=!1}_addEventListener(e,t,n){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push({callback:t,scope:n})}addEventListener(e,t,n){this._addEventListener(e,t,n)}dispatchEvent(e,t){if(!this._listeners[e]||this._disabled)return;const n=this._listeners[e];let s=n.length;for(let e=0;e<s;e++){const s=n[e];t?s.callback.apply(s.scope,[t]):s.callback.call(s.scope)}}removeEventListener(e,t){const n=this._listeners[e];if(n)for(let e=0,s=n.length;e<s;e++)if(n[e].callback===t)return void n.splice(e,1)}enableEvents(){this._disabled=!1}disableEvents(){this._disabled=!0}}e("E",ke);const Re={MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu"};class xe{constructor(e,t,n,s,i){this.position=e,this.positionRelative=t,this.type=n,this.rotation=s,this.event=i}}const Se=e("M",5*window.devicePixelRatio),Le=3*window.devicePixelRatio;let De=e("a3",(()=>{class e extends ke{constructor(e){super(),this._debug=!1,this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(Re).map(e=>Re[e]),this._creator_=e,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}enableDragIn(e){this._setState(1),this._dragEnabled=!0,e&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=e.currentTarget||e.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&e instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):e.dataTransfer&&e.dataTransfer.setData&&e.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=e=>{e=e||window.event,this._firefoxDragPosition.x=e.pageX,this._firefoxDragPosition.y=e.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(e){let t=e,n=null,s=null;window.TouchEvent&&e instanceof TouchEvent?(n=this._getTouchPosition(t),s=this._getTouchPositionRelative(t)):(n=this._getMousePosition(t),s=this._getMousePositionRelative(t)),n.x>0&&n.y>0&&this._move(n,s)}_dragE(e){let t=e;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&e instanceof TouchEvent?this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2):this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}addEvents(e){this._events.forEach(t=>e.addEventListener(t,this,!1))}removeEvents(e){this._events.forEach(t=>e.removeEventListener(t,this,!1))}_move2(e){if(this._lastTouchEvent&&e.timeStamp-this._lastTouchEvent.timeStamp<16)return;const t=e.touches[0],n=e.touches[1],s=t.pageX-n.pageX,i=t.pageY-n.pageY,o=Math.abs(s)+Math.abs(i);this._pinchDistance>-1&&(o>this._pinchDistance+Le?(this._setState(3),this.dispatchEvent(7,new xe(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<this._pinchDistance-Le?(this._setState(3),this.dispatchEvent(8,new xe(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<=this._pinchDistance+Le&&o>=this._pinchDistance-Le&&(this._setState(5),this.dispatchEvent(11,new xe(this._getTouchPosition(e),this._getTouchPositionRelative(e))))),this._pinchDistance=o,this._lastTouchEvent=e}_setState(e){this._state=e}_move(e,t,n,s){void 0===n&&(n=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(n)&&(this._delta=this._getDelta(e),this._delta>Se&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new xe(e,t)))),2===this._state&&this.dispatchEvent(1,new xe(e,t)),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(6,new xe(e,t,n,null,s))}_longClick(){this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new xe(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new xe(this._downPosition,this._downPositionRelative))}_onUp(e,t,n){this.dispatchEvent(4,new xe(e,t,n)),this._getDelta(e)<=Se&&this.dispatchEvent(5,new xe(e,t)),2===this._state&&this.dispatchEvent(2,new xe(e,t)),4===this._state&&(this.dispatchEvent(10,new xe(e,t)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(e){if(e.touches.length){let{clientX:t,clientY:n}=e.touches[0];if(e.touches.length>1){const s=e.touches[1],i=s.clientX,o=s.clientY;t=(t+i)/2,n=(n+o)/2}return{x:t,y:n}}const t=e.changedTouches[0];return{x:t.clientX,y:t.clientY}}_getTouchPositionRelative(e){const t=this._boundingClientRect,{clientWidth:n,clientHeight:s}=this._domHelper.element;if(e.touches.length){const{clientX:i,clientY:o}=e.touches[0];return{x:(i-t.left)/n*2-1,y:-(o-t.top)/s*2+1}}const i=e.changedTouches[0];return{x:(i.clientX-t.left)/n*2-1,y:-(i.clientY-t.top)/s*2+1}}_getMousePosition(e){if(0!==e.clientX&&0!==e.clientY)return{x:e.clientX,y:e.clientY};{let{x:t,y:n}=this._getFireFoxMousePosition(e);return{x:t,y:n}}}_getFireFoxMousePosition(e){let{x:t,y:n}=this._domHelper.getClientDimensions();return{x:t-(t+e.offsetX),y:n-(n+e.offsetY)}}_getMousePositionRelative(e){const t=this._boundingClientRect;return 0!==e.clientX&&0!==e.clientY?{x:(e.clientX-t.left)/this._domHelper.element.clientWidth*2-1,y:-(e.clientY-t.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-t.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-t.top)/this._domHelper.element.clientHeight*2+1}:{x:0,y:0}}_getDelta(e){return Math.abs(this._downPosition.y-e.y)+Math.abs(this._downPosition.x-e.x)}setDragEnabled(e){this._dragEnabled=e}handleEvent(e){switch(this._debug&&e.type,e.type){case Re.MOUSE_MOVE:this._onMouseMove(e);break;case Re.MOUSE_DOWN:this._onMouseDown(e);break;case Re.MOUSE_UP:this._onMouseUp(e);break;case Re.MOUSE_LEAVE:this._onMouseLeave(e);break;case Re.MOUSE_ENTER:this._onMouseEnter(e);break;case Re.MOUSE_WHEEL:this._onMouseWheel(e);break;case Re.TOUCH_MOVE:this._onTouchMove(e);break;case Re.TOUCH_START:this._onTouchStart(e);break;case Re.TOUCH_END:this._onTouchEnd(e);break;case Re.CONTEXT_MENU:this._onContextMenu(e)}}_onMouseDown(e){e.preventDefault();let{x:t,y:n}=this._getMousePosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getMousePositionRelative(e),this.dispatchEvent(3,new xe({x:t,y:n},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(e){e.preventDefault(),this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}_onMouseMove(e){e.preventDefault(),this._move(this._getMousePosition(e),this._getMousePositionRelative(e),1,e)}_onMouseLeave(e){this._delta=-1,this._onMouseUp(e)}_onMouseEnter(e){e.preventDefault()}_onMouseWheel(e){if(this._lastMouseWheelEvent&&e.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return e.preventDefault(),void e.stopPropagation();e.deltaY<0?this.dispatchEvent(7,new xe(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)):this.dispatchEvent(8,new xe(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)),this._lastMouseWheelEvent=e}_onTouchMove(e){if(e.preventDefault(),!this._dragTarget)if(1===e.touches.length)this._move(this._getTouchPosition(e),this._getTouchPositionRelative(e),2);else if(2===e.touches.length)if(this._elementHit||4===this._state){const s=e.touches[0],i=e.touches[1],o=function(e){let t=T(e);return t<0&&(t=180+(180+t)),t}((t={x:s.pageX,y:s.pageY},n={x:i.pageX,y:i.pageY},Math.atan2(n.y-t.y,n.x-t.x)));this._rotationAngle<0&&(this._rotationAngle=o);const r=o-this._rotationAngle;this._rotationAngle=o,this.dispatchEvent(9,new xe(this._getTouchPosition(e),this._getTouchPositionRelative(e),2,P(r))),this._setState(4)}else this._move2(e);var t,n}_onTouchStart(e){if(e.preventDefault(),1===e.touches.length){let{x:t,y:n}=this._getTouchPosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getTouchPositionRelative(e),this.dispatchEvent(3,new xe({x:t,y:n},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this),350)}else 2===e.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2),this._setState(3))}_onTouchEnd(e){e.preventDefault(),e.touches.length>1&&5===this._state||3===this._state||this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2)}_onContextMenu(e){e.preventDefault()}_canDrag(e){return this._dragEnabled}onElementHit(){this._elementHit=!0}updateSize(){this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}}return M([J],e.prototype,"_domHelper",void 0),e})());class Ae{constructor(e){const{component:t,resetCamera:n,consecutive:s}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===s||s}}const Oe=new Map,He=new Map;class Ue{static loadFont(e){if(He.has(e))return new Promise(t=>{t(He.get(e))});if(Oe.has(e))return new Promise((t,n)=>{Oe.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,i)=>{Oe.set(e,[{resolve:n,reject:i}]),t.load(s()+e,t=>{He.set(e,t),Ue._resolveAll(e,t)})})}static _resolveAll(e,t){Oe.has(e)&&Oe.get(e).forEach(e=>e.resolve(t)),Oe.delete(e)}}e("ae",Ue);let je=(()=>{class e{constructor(e){this._activeComponents=[],this._componentDimensioningsExist=new Map,this._creator_=e}setCamera(e){this._camera=e}add(e){if(this._componentDimensioningsExist.has(e.runtimeId)&&!this._componentDimensioningsExist.get(e.runtimeId))return!1;const n=this._plannerKernelAccess.kernelInstance.getComponent(e.runtimeId),s=n.dimensionings;if(this._componentDimensioningsExist.set(e.runtimeId,s.length>0),!s||0===s.length||this._camera.position.z<0)return!1;const i=k(n.boxForMeasurement),o={x:this._camera.position.x,y:this._camera.position.z};return t.import("./component-dimensioning-f6319d77.legacy.js").then(t=>{Ue.loadFont("static/rubik_regular-75bd7bb699e9e39d.json").then(n=>{s.forEach(s=>{var r;e.add(new t.default(((r=s).from=r.from/1e3,r.to=r.to/1e3,1===r.type.value?(r.type={value:2},r.from*=-1,r.to*=-1):2===r.type.value&&(r.type={value:1}),r),i,n,o))})})}),this._activeComponents.push(e),!0}remove(e,n=!0){return new Promise(s=>{t.import("./component-dimensioning-f6319d77.legacy.js").then(t=>{let i=[];e.children.forEach(e=>{e instanceof t.default&&i.push(e)}),i.forEach(t=>{e.remove(t),B(t)}),n&&u(this._activeComponents,e),s()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}invalidateDimensioningsCache(e){e?this._componentDimensioningsExist.delete(e):this._componentDimensioningsExist.clear()}}return M([J],e.prototype,"_plannerKernelAccess",void 0),e})();const Fe=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/-1e3),Be=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/1e3),Ve=e("Z",e=>({x:1e3*e.x,y:-1e3*e.z,z:1e3*e.y})),Ge=e=>decodeURIComponent(encodeURIComponent(e)),Ke=e("X",e=>{if(!e){const t=typeof e;return"number"===t||"boolean"===t?e:null}if(!e.hasOwnProperty("size")&&e.size&&"function"==typeof e.size){let t=ze(e);for(let e=0;e<t.length;e++)t[e]=Ke(t[e]);return"string"==typeof t?Ge(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=Ke(e[t]));return"string"==typeof e?Ge(e):e}),ze=e=>{let t=[];if(e){let n=e.size();for(let s=0;s<n;s++)t.push(e.get(s))}return t},Ne=e=>{let t=new THREE.Matrix4,n=Ke(e);return t.fromArray(n),t.transpose(),(e=>{let t=new THREE.Matrix4;t.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),t.scale(new THREE.Vector3(.001,.001,.001));let n=new THREE.Matrix4;return n.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1),n.scale(new THREE.Vector3(1e3,1e3,1e3)),t.multiply(e).multiply(n)})(t)};class We{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 qe 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 We;const t=Fe(e.getCenter());let n;this._container=new THREE.Object3D,this._container.position.copy(t),n=this.getPlanElement().boxForMeasurement?k(this.getPlanElement().boxForMeasurement).getSize(new THREE.Vector3):this.getSize(),this._boundingBox=this._generateBoundingBox(n,e.customColor),F(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(Fe(this.getPlanElement().getCenter()))}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e;return this.getPlanElement().boxForMeasurement?(e=k(this.getPlanElement().boxForMeasurement),e.applyMatrix4(this.getContainer().matrix)):(e=new THREE.Box3,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=W(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){B(this._container),this._selectionMesh&&B(this._selectionMesh)}remove(){var e;null===(e=this._container.parent)||void 0===e||e.remove(this._container),this.clear()}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=(N||(N=new THREE.MeshBasicMaterial,N.visible=!1),N))}_generateBoundingBox(e,t){let n=new THREE.BoxGeometry(e.x,e.y,e.z),s=new THREE.Color("#DDDDDD");t>0&&(s=(e=>{let t=new THREE.Color;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t})(t));let i=new THREE.MeshStandardMaterial({color:s,opacity:1,transparent:!0}),o=new THREE.Mesh(n,i);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(6),o}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:1,transparent:!0});Fe(this.getPlanElement().getCenter()),this._selectionMesh=new THREE.Mesh(((e,t)=>{let n=t.x/2,s=t.z/2,i=new THREE.Vector3(-n,.01,s),o=[i,new THREE.Vector3(i.x,i.y,i.z+.2),new THREE.Vector3(i.x-.2,i.y,i.z+.2),new THREE.Vector3(i.x-.2,i.y,i.z)],r=[new THREE.Face3(3,2,0),new THREE.Face3(2,1,0)],a=new THREE.Geometry;return a.vertices.push(...o),a.faces.push(...r),a.computeFaceNormals(),a.computeVertexNormals(),a})(0,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class Je extends qe{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return Be(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class Xe extends Je{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._rootComponentId=e.id,this._rootComponentRuntimeId=e.runtimeId,this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}getRootComponentId(){return this._rootComponentId}getRootComponentRuntimeId(){return this._rootComponentRuntimeId}}e("s",Xe);var Ye={isProduction:!0,isUnitTesting:!1,environment:"production",detailEnvironment:"development",features:{},APP:{RAPI:{server:"/api/v2",localReverseProxy:"https://www.roomle.com/api/v2",liveServer:"https://www.roomle.com/api/v2",testServer:"https://www.test.roomle.com/api/v2",headers:{apiKey:"roomle_portal_v2",currentTenant:9,locale:"en",language:"en",device:1,token:"anonymous",platform:"web"},itemHeaders:{assetRevision:"glb",assetFileFormat:"glb"}},SHORTENER_URL:"http://rml.co/"},environments:{PRODUCTION:"production",DEVELOPMENT:"development",TEST:"test",TEST_SERVER:"test_server",ALPHA:"alpha"}};void 0!==t&&t.exports||(window.IS_DEBUG=!0),function(e=!1){if(e){let e=JSON.parse(JSON.stringify(Ye));e.APP,e.features}}();const Qe=JSON.parse(JSON.stringify(Ye));var $e=e("H",Qe);let Ze=e("S",(()=>{class e extends Je{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=_(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?Be(t.size):void 0,s=new THREE.Vector3(1,1,1);return t.flipX&&(s.x*=-1),t.flipY&&(s.z*=-1),new Promise(i=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,s,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),((e,t)=>{let n=(new THREE.Box3).setFromObject(e),s=n.getSize(new THREE.Vector3),i=Math.min(s.x,s.y,s.z),o=!0;i>5&&(console.warn("GLB seems to be too big ("+i+")",t),o=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),o=!1)})(t,this._glbUrl),F(t),this._container.add(this.getObject()),this.hidePreviewBox(),i()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return M([J],e.prototype,"_staticItemLoader",void 0),e})());class et extends qe{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(9),n}}e("W",et);class tt extends qe{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)}}e("F",tt);class nt extends qe{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)}}e("u",nt);const st=new Map;class it{static start(e){if(!window.performance||!window.performance.getEntriesByName)return"";let t=window.performance.getEntriesByName(e).length++,n="";t<100&&(n="0"),t<10&&(n="0"+n);const s=t>0?e+"_"+n+t:e,i=s+"_start";return window.performance.mark(i),s}static addMeta(e,t){const n=it.getMeta(e);st.set(e,Object.assign(n,t))}static getMeta(e){return st.get(e)||{}}static end(e){}static getMeasure(e){return[]}static showBenchmarks(e){const t=window.performance.getEntriesByType("measure");t.sort((function(e,t){return e.startTime-t.startTime}));const n=[];for(let s=0,i=t.length;s<i;s++){const i=t[s];e&&-1===i.name.indexOf(e)||n.push({Start:parseFloat(i.startTime.toFixed(2)),Name:i.name,Duration:parseFloat(i.duration.toFixed(2))})}console.table(n)}}e("B",it);let ot=e("A",(()=>{class e{static init(t={}){const{kernelInstance:n,kernelContainer:s,planObjectId:i}=t;e.kernelInstance=n,e.kernelContainer=s,e.planObjectId=i}static cleanUp(){e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null}}return e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null,e})());const rt=new Map,at=function(e,t,n){let s=rt.get(e);if(s){const i=n?[n]:void 0;s.forEach(({resolve:e,reject:n})=>t?e.apply(e,i):n.apply(n,i)),rt.delete(e)}};class lt{static finishOperation(e,t){at(e,!0,t)}static failOperation(e,t){at(e,!1,t)}static waitFor(e,t){return new Promise((n,s)=>{let i=rt.get(e);i||(rt.set(e,[]),i=rt.get(e)),i.push({resolve:n,reject:s}),"function"==typeof t&&t.apply(t)})}}e("T",lt);const ht=e("U",(function(e){return e.validRange&&"string"==typeof e.validRange.type})),ct=function(e){return e.validValues&&e.validValues.length>0},dt=e("V",(function(e){return"Material"===e.type}));let ut,_t,pt,mt,gt;const ft={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-9f67b7e88d0bd992.wasm",LOADER:"static/ConfiguratorKernel-65576c77dcbcf095.js"},PLANNER:{URL:"static/RoomleCore-b631890cd6f7f9df.wasm",LOADER:"static/RoomleCore-893a02359b06c69e.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-4dc085be87a3e6e0.mem",LOADER:"static/ConfiguratorKernelJs-935c7588ff18e960.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-0bb526365f5c3f91.mem",LOADER:"static/RoomleCoreJs-f5fe1b6e08c282c6.js"}}},Et=!!window.WebAssembly;let Ct=(()=>{class e{constructor(e){this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}init(e){this._kernelType=e,this._setupKernelPaths(e),this._setupEmsModule(e),this._useWASM=Et,this._kernelPath=Et?pt:mt}_initKernel(){const{unit:e,unitStringType:t}=this._initData;this._kernelInstance.setEnvironmentVariable("unit",e||"cm"),this._kernelInstance.setEnvironmentVariable("unitString",t||"short"),this._kernelInstance.useEnvironmentGeometry(1===this._kernelType);const{overrideCountry:n,locale:s}=this._globalInitData;n&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(n)),this._kernelInstance.setEnvironmentVariable("language",s)}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";ut=ft.ASM[t].MEM_URL,_t=ft.WASM[t].URL,pt=ft.WASM[t].LOADER,mt=ft.ASM[t].LOADER,gt=!0}_setupEmsModule(e){const t=this;this._kernelContainer={locateFile(t){const n=0===e?/RoomleCoreJs[\-a-z0-9]*\.js\.mem/:/ConfiguratorKernelJs[\-a-z0-9]*\.js\.mem/;return t.match(n)?s()+ut:t},wasmBinaryFile:s()+_t,preRun:[],postRun:[],setStatus:null,print(e){t._kernelIo.log(e)},printErr(e){t._kernelIo.error(e)},quit(e){0!==e&&t._kernelIo.throw(e&&e.toString?e.toString():"Unknown error while C/C++ main executes")}},gt&&Et&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,n)=>{const i="function"==typeof WebAssembly.instantiateStreaming;it.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let o=null;i?(it.start("kernel_stream_compile"),o=WebAssembly.instantiateStreaming(fetch(s()+e),t),it.end("kernel_stream_compile")):(it.start("kernel_legacy_compile"),o=fetch(s()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),it.addMeta("kernel_is_ready",{instantiateStreaming:i}),o.then(e=>{it.end(i?"kernel_stream_compile":"kernel_legacy_compile"),n(e.instance)},e=>console.error(e))})(_t,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,s=t.get(n);if(s)for(let t=0,i=s.length;t<i;t++){const{parentId:i,partId:o}=s[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(i,o,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,s=t.length;n<s;n++)this._passSubComponentsToKernel(t[n],e);this._flushSubComponentsWaiters()})}_flushSubComponentsWaiters(){this._fetchSubComponents(this._subComponentsWaiters),this._subComponentsWaiters=new Map,this._shouldWait=!1}isReady(){this._kernelContainer.setExternalHelpers(this._kernelIo,{convertCObject:Ke}),$e.isProduction||$e.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback),this._unitFormatter.init(this._kernelContainer)}addDebugInfo(){const e=function(t,n=[]){const s=Object.getPrototypeOf(t),i=s?Object.getOwnPropertyNames(s):[],o=t?Object.getOwnPropertyNames(t):[];return s?e(s,[...n,...o,...i]):[...o,...i,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const s=this.kernelInstance.getPlanObject(e),i=(new Date).toISOString(),o=this.kernelInstance.getComponentId(e),r=Z(o),a=(null===(n=s.boxForMeasurement)||void 0===n?void 0:n.size)||s.bounds;t({created:i,lastAccess:i,configuration:this.kernelInstance.getSerializedConfiguration(e),configurationHash:this.kernelInstance.getHashOfConfiguration(e),parts:JSON.stringify(this.kernelInstance.getPartList(e)),rootComponentId:o,width:a.x,height:a.z,depth:a.y,catalog:r,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(s=>{var i;let o=s.configuration;o||(o="error",null===(i=this._configuratorUiCallbacks)||void 0===i||i.onContentProblem({rapiPath:"components",ids:[t.componentId],message:t.componentId+" has no configuration"})),this._kernelIo.setMeta({componentId:t.componentId}),this._kernelInstance.loadComponent(e,o,t,n),this._flushSubComponentsWaiters()},s=>{var i;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(s,t.componentId),null===(i=this._configuratorUiCallbacks)||void 0===i||i.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${s}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let s=this._subComponentsWaiters.get(n);s||this._subComponentsWaiters.set(n,[]),s=this._subComponentsWaiters.get(n),s.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,s)}else this._rapiAccess.getComponent(n).then(s=>{var i;let o=s.configuration;o||(o="error",null===(i=this._configuratorUiCallbacks)||void 0===i||i.onContentProblem({rapiPath:"components",ids:[n],message:"SubComponent "+n+" has no configuration"})),this._kernelIo.setMeta({componentId:n,parentId:e}),this._kernelInstance.loadedSubComponent(e,t,n,o)})}requestDeleteComponent(e){e&&this._kernelInstance.deleteComponent(e)}dockComponentWithPosition(e,t,n,s,i){var o;this._kernelInstance.dockComponentWithPosition(n,s,e,t,i);const r=this._kernelInstance.getComponentId(n),a=this._kernelInstance.getComponentId(e);null===(o=this._configuratorUiCallbacks)||void 0===o||o.onUserInitiatedDockDone(r,s,a,t,i)}Editor3dAddBakedMesh(e,t,n,s,i,o,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dAddBakedMesh(e,t,n,s,i,o,r))}Editor3dAddNamedMesh(e,t,n,s,i,o,r,a,l,h){this._configuratorKernelCallbackListener.forEach(c=>c.Editor3dAddNamedMesh(e,t,n,s,i,o,r,a,l,h))}Editor3ChangedNamedMesh(e,t,n,s,i){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3ChangedNamedMesh(e,t,n,s,i))}Editor3dRemoveNamedMesh(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dRemoveNamedMesh(e,t))}Editor3dBeginConstruction(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dBeginConstruction(e,t))}Editor3dEndConstruction(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dEndConstruction(e))}Editor3dComponentCreated(e,t,n,s){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentCreated(e,t,n,s,!1))}Editor3dComponentDocked(e,t,n,s){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentDocked(e,t,n,s))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,lt.waitFor(4).then(()=>{this._rapiAccess.getMaterialsByGroup(this._cachedGroupIds).then(e=>{let t=[];e.forEach(e=>{const n=[];e.materials.forEach(e=>n.push(e.id));const s=e.legacyId||e.id;e.legacyId||console.warn("Material group has no legacy id, please check content why this is the case"),t.push({group:s,materials:n})}),t.length&&this._kernelInstance.setMaterialsInGroup(t),this._cachedGroupIds=[]},e=>{var t;console.error(e),null===(t=this._configuratorUiCallbacks)||void 0===t||t.onError(new Error(`Material group with ids "${this._cachedGroupIds.join(",")}" can not be loaded. "${e}"`)),this._cachedGroupIds=[]})}))}requestPlanComponentConstruction(e){this._kernelInstance.requestDeltaPlanComponentConstruction(e)}addConfiguratorListener(e){this._configuratorKernelCallbackListener.add(e)}removeConfiguratorListener(e){this._configuratorKernelCallbackListener.delete(e)}cleanUpCallbacks(){"function"==typeof this._kernelContainer.unregisterConfiguratorCallback&&this._kernelContainer.unregisterConfiguratorCallback(this)}async requestMaterialProperties(e){let t=Array.isArray(e)?e:[e];if(this._requestedMaterialIds.push(...t),await p(0),!this._requestedMaterialIds.length)return;const n=[...this._requestedMaterialIds];this._requestedMaterialIds=[];const s=await this._rapiAccess.getMaterials(n);let i=[];s.forEach(e=>{const t=new this._kernelContainer.StringStringMap,n=e.properties||{};for(let e in n)n.hasOwnProperty(e)&&t.set(e,n[e]);t.size()&&i.push({id:e.id,properties:t})}),i.length&&this._kernelInstance.setMaterialProperties(i)}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var s;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(s=this._configuratorUiCallbacks)||void 0===s||s.onMemoryCorruption()}}_calcPrice(){const e=new Map;if(this._initData.useRoomlePrice){let e=this._kernelInstance.getFullPartList();if(e&&e.fullList&&e.fullList.length){const t=e.fullList[0].currencySymbol,n=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0);this._configuratorUiCallbacks.onUpdatePrice(t,n)}}else if(this._initData.usePriceService){let t=this._kernelInstance.getFullPartList();if(t&&t.fullList&&t.fullList.length){const n=t.fullList.reduce((t,n)=>{const s=ee(n);return s&&(e.set(s,n),t.push(s)),t},[]);return new Promise((s,i)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return i(new Error("prices are empty"));const o=m(n,"priceId");let r=0;return t.fullList.forEach(e=>{const t=ee(e);if(!o.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:s}=o.get(t);e.price=n,e.currencySymbol=s,r+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,r),s({totalSum:r,partMap:e})},e=>{console.error(e),i(e)})})}}return Promise.resolve({totalSum:0,partMap:e})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:s}=e,i=e.perMainComponent;let o;this.addUiDataToPartList(n,t);try{const e=await this._calcPrice();o=e.partMap}catch(e){console.error(e),o=new Map}const r=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{r||(e.price=null,e.currencySymbol=null);const t=ee(e);if(!t)return;if(!o.has(t))return;const{price:n,currencySymbol:s}=o.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=s)};return n.forEach(a),i.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(a)}),{fullList:n,perMainComponent:i,originPart:s}}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),dt(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const s=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(s,btoa(e))}}return M([J],e.prototype,"_rapiAccess",void 0),M([J],e.prototype,"_scriptLoader",void 0),M([J],e.prototype,"_kernelIo",void 0),M([J],e.prototype,"_dataSyncer",void 0),M([J],e.prototype,"_lifeCycleManager",void 0),M([J],e.prototype,"_configuratorUiCallbacks",void 0),M([J],e.prototype,"_globalCallback",void 0),M([J],e.prototype,"_initData",void 0),M([J],e.prototype,"_unitFormatter",void 0),M([J],e.prototype,"_configuratorContext",void 0),M([J],e.prototype,"_globalInitData",void 0),e})();const{APP:wt}=$e,{RAPI:yt}=wt,bt=yt.headers,Mt=yt.itemHeaders,vt=bt.token,Pt=g();let Tt=new Map,It=new Map,kt=new Map,Rt=new Map,xt=new Map,St=new Map,Lt=new Map,Dt=new Map,At=new Map;const Ot=e=>Tt.get(e)||Tt.get(Pt+e),Ht=e=>e&&e.tags&&e.tags.length,Ut=e=>!Ht(e)&&e.group;function jt(){class e extends THREE.Object3D{constructor(e,t,n,s){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,s)}static _generateOutline(e,t){let n=new THREE.LineSegments(new THREE.EdgesGeometry(e),new THREE.LineDashedMaterial({color:"#000000",dashSize:.03,gapSize:.01,linewidth:1}));return n.translateOnAxis(t,1),n.userData.ignoreComponentRaycast=!0,n}static cloneDockLine(e,t){let n=new THREE.LineSegments(e.geometry,e.material);return n.translateOnAxis(t.getCenter(new THREE.Vector3),1),n.name="dockline",n.layers.set(5),n.userData.ignoreComponentRaycast=!0,n}_setValues(e,t,n,s){e&&(this.runtimeId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),s&&(this.parentObjectId=s)}get loadingMesh(){return this._loadingMesh}get boundingBoxMesh(){return this._boundingBoxMesh}get boundingBox(){return this._boundingBox}set roomlePosition(e){this._roomlePosition=e,e&&this.position.set(e.x/1e3,e.z/1e3,e.y/-1e3)}get roomlePosition(){return this._roomlePosition}set roomleRotation(e){this._roomleRotation=e,e&&this.rotation.set(e.x,e.z,-e.y)}get roomleRotation(){return this._roomleRotation}replaceMeshes(e){this.removeAllMeshes(),e.forEach(e=>{this.addMesh(new THREE.Mesh(e.geometry,e.material))})}addMesh(e,t){e.renderOrder=2,e.userData.meshType=0,t&&e.applyMatrix4(Ne(t)),this.add(e),this.meshes.push(e)}getMeshById(e){return this.meshes.find(t=>t.userData.meshId===e)}removeMeshById(e){const t=this.getMeshById(e);t?this.removeMesh(t):console.warn("Could not remove mesh with id "+e,this.runtimeId,this.meshes)}removeMesh(e){const t=this.meshes.indexOf(e);this.remove(e),G(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&G(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),G(this._boundingBoxMesh),this._boundingBoxMesh=null}_hideAllMeshes(){this.meshes.forEach(e=>e.visible=!1)}_showAllMeshes(){this.meshes.forEach(e=>e.visible=!0)}select(){this._selected=!0}loading(){if(!this._kernelBoundingBox)return void console.warn("Bounding box (box for measurements) for component "+this.runtimeId+" not set, can not show external mesh loading box!");this._removeLoadingMesh(),this._hideAllMeshes();const{x:e,y:t,z:n}=this._kernelBoundingBox.getSize(new THREE.Vector3);let s=new THREE.BoxGeometry(e,t,n);this._loadingMesh=new THREE.Mesh(s,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:new THREE.Color("#DDDDDD")})),this._loadingMesh.name="loading mesh",this._loadingMesh.receiveShadow=!1,this._loadingMesh.castShadow=!1,this._loadingMesh.layers.set(5),this._loadingMesh.translateOnAxis(this._kernelBoundingBox.getCenter(new THREE.Vector3),1),this._loadingMesh.renderOrder=3,this.add(this._loadingMesh)}_removeLoadingMesh(){this._loadingMesh&&(this.remove(this._loadingMesh),G(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){f("pointer")}hoverOff(){f("default")}removeFromParent(){this.parent&&(this.parent.remove(this),this.removeAllMeshes())}computeBoundingBox(t,n=!1){if(this._boundingBoxMesh&&this.remove(this._boundingBoxMesh),!n&&t&&0===t.size.x&&0===t.size.y&&0===t.size.z)return;let s;if(!t||n){this._boundingBox=new THREE.Box3;let e=new THREE.Vector3;this.meshes.forEach(t=>{if(t.geometry instanceof THREE.Geometry){let n=t.geometry.vertices;for(let s=0,i=n.length;s<i;s++)e.copy(n[s]),e.applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}else if(t.geometry instanceof THREE.BufferGeometry){let n=t.geometry.attributes.position;if(void 0!==n)for(let s=0,i=n.count;s<i;s++)e.fromBufferAttribute(n,s).applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}}),this._kernelBoundingBox=this._boundingBox.clone();let t=this._boundingBox.max.x-this._boundingBox.min.x,n=this._boundingBox.max.y-this._boundingBox.min.y,i=this._boundingBox.max.z-this._boundingBox.min.z;s=new THREE.BoxGeometry(t,n,i)}else{this._kernelBoundingBox=k(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:i}=this._boundingBox.getSize(new THREE.Vector3);s=new THREE.BoxGeometry(e,n,i)}this._boundingBoxMesh=new THREE.Mesh(s,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let i=this._boundingBox.getCenter(new THREE.Vector3);this._boundingBoxMesh.position.add(i),this._boundingBoxMesh.layers.set(5),this._boundingBoxMesh.renderOrder=3,this._boundingBoxMesh.castShadow=!1,this._boundingBoxMesh.receiveShadow=!1,this.add(this._boundingBoxMesh),this._dockline=e._generateOutline(s,i),this._dockline.name="bounding box outline",this._dockline.layers.set(5),this._selected&&this.add(this._dockline)}recursiveMeshes(){let t=this.meshes.slice();return this.children.forEach(n=>{n instanceof e&&t.push(...n.recursiveMeshes())}),t}isChild(t){let n=!1;return this.children.forEach(s=>{s instanceof e&&!n&&(n=s.runtimeId===t||s.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return Ve(e.worldToLocal(t))}}class t extends e{constructor(e,t){super(e,null,null,null),this.glbUrl=t}}class n extends e{constructor(e,t,n,s){super(e,t,n,s),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof THREE.MeshStandardMaterial&&(e.material.opacity=.6,e.material.roughness=1,e.material.metalness=0,e.material.color=new THREE.Color("#DDDDDD")),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),f("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.6,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),f("default")}clonePreview(t){const s=new n(this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return s._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&s.meshes.push(e.clone(!0))}),s.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),s.add(e)}),this._dockline&&(s._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(s._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(s._boundingBox=this._boundingBox.clone()),s}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}class s extends n{constructor(e,t,n,s,i){super(e,t,n,s),i&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=Fe(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=Fe(e);t.equals(this.lineFrom)&&(console.warn("lineFrom and lineTo are equal!"),t.add(new THREE.Vector3(0,.01,0))),this.lineTo=t}get roomleLineTo(){return this._roomleLineTo}set roomlePositionFrom(e){this._roomlePositionFrom=e,this.positionFrom=Fe(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=Fe(e);t.equals(this.positionFrom)&&(console.warn("positionFrom and positionTo are equal!"),t.add(new THREE.Vector3(0,.01,0))),this.positionTo=t}get roomlePositionTo(){return this._roomlePositionTo}addMesh(e,t){super.addMesh(e,t),e.visible=!1,e.renderOrder=3}hoverOn(){this._dockline.visible=!0,f("pointer")}hoverOff(){this._dockline.visible=!1,f("default")}preparePreview(){super.preparePreview(),this._dockline.visible=!1;let e=this.lineTo.clone(),t=this.lineFrom.clone();const n=(new THREE.Vector3).subVectors(e,t);let s=n.length(),i=n.normalize(),o=new THREE.ArrowHelper(i,t),r=new THREE.CylinderGeometry(.01,.01,s,16,1);this.lineMesh=new THREE.Mesh(r,new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:.4})),this.lineMesh.name="line mesh";const a=(new THREE.Quaternion).setFromEuler(o.rotation);this.lineMesh.quaternion.multiply(a),this.lineMesh.renderOrder=1;let l=(new THREE.Vector3).addVectors(e,t).multiplyScalar(.5);this.lineMesh.position.copy((new THREE.Vector3).subVectors(l,this.position.clone())),this.add(this.lineMesh);let h=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),c=null,d=0,u=Math.abs(i.x),_=Math.abs(i.y),p=Math.abs(i.z);u>=_&&u>=p?(c=new THREE.Vector3(h.x,0,0),d=Math.sqrt(h.y*h.y+h.z*h.z)):_>=u&&_>=p?(c=new THREE.Vector3(0,h.y,0),d=Math.sqrt(h.x*h.x+h.z*h.z)):p>=_&&p>=u&&(c=new THREE.Vector3(0,0,h.z),d=Math.sqrt(h.y*h.y+h.x*h.x)),d=d>0?d:.01;let m=(new THREE.Vector3).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+c.length(),g=new THREE.CylinderGeometry(1.1*d,1.1*d,m,32,1);this.boundingLineMesh=new THREE.Mesh(g,new THREE.MeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:0})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0;let f=this.positionTo.clone(),E=this.positionFrom.clone(),C=(new THREE.Vector3).subVectors(f,E).normalize(),w=new THREE.ArrowHelper(C,E);const y=(new THREE.Quaternion).setFromEuler(w.rotation);this.boundingLineMesh.quaternion.multiply(y),this.boundingLineMesh.renderOrder=3;let b=(new THREE.Vector3).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(h);this.boundingLineMesh.position.copy((new THREE.Vector3).subVectors(b,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new s(this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId,this.receivedPointAssociation);return n._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&n.meshes.push(e.clone(!0))}),n.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),n.add(e)}),this._dockline&&(n._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(n._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(n._boundingBox=this._boundingBox.clone()),n}getPositionForIntersectionPoint(e){let t=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),n=this.positionTo.clone().add(t),s=this.positionFrom.clone().add(t),i=new THREE.Line3(s,n).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(i.x)||isNaN(i.y)||isNaN(i.z))&&i.copy(e),i.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let s=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation);this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,s)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return Ve(e.worldToLocal(t))}return super.getKernelPosition(e)}}class i extends THREE.PerspectiveCamera{constructor(e,t,n,s,i){super(e,t,n,s),i||(i={left:0,top:1,right:1,bottom:0}),this.offset=i}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}_calculateProjectionMatrix(){let e,t,n,s,i=this.fov*(2*Math.PI/360)/2;n=Math.tan(i),s=-n;let o=Math.atan(this.aspect*Math.tan(i));t=Math.tan(o),e=-t;let r=this._offset.left,a=this._offset.right,l=this._offset.top,h=this._offset.bottom,c=new THREE.Vector2(a-r,l-h),d=new THREE.Vector2(r+c.x/2,h+c.y/2);if(c.x<c.y){let i=(1-d.x)/(c.x/2),o=d.x/(c.x/2);t*=i,e*=o;let r=(i+o)/2;n*=r,s*=r}else{let i=(1-d.y)/(c.y/2),o=d.y/(c.y/2);n*=i,s*=o;let r=(o+i)/2;e*=r,t*=r}e*=this.near,t*=this.near,n*=this.near,s*=this.near;let u=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,_=this.aspect*u;return this.view&&this.view.enabled&&(e+=this.view.offsetX*_/this.view.fullWidth,n-=this.view.offsetY*u/this.view.fullHeight,t+=this.view.offsetX*_/this.view.fullWidth,s-=this.view.offsetY*u/this.view.fullHeight),(new THREE.Matrix4).makePerspective(e,t,n,s,this.near,this.far)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}}return{create:function(t,n,s,i){return new e(t,n,s,i)},createPreview:function(e,t){return new n(e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e){let t=new s(e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let n=e.clone();n.material=e.material.clone(),n.geometry=e.geometry.clone(),t.addMesh(n)}),t.computeBoundingBox(),t},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof s},createCamera:function(e,t,n,s,o){return new i(e,t,n,s,o)}}}e("R",(()=>{class e{constructor(e){this._itemLoaded=!1,this._currentToken=null,this._creator_=e,window.addEventListener("online",this._flushOfflineQueue.bind(this))}getPreloadForItem(e){return this._getPreload(e,!0)}getPreloadForConfiguration(e){return this._getPreload(e,!1)}_getPreload(e,t){return new Promise((n,s)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(Z(e)))return n();if(Lt.get(e))return n();const i=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+i+e,"preloads/components").then(t=>{if(Lt.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),Lt.set(e,!0),n()},s)})}changeUseOfHDGeometry(){const e=Rt.get("components");Lt.clear(),St.clear(),e&&Rt.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(St.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(St.get(e))return t(n);n.components.forEach(e=>{this._prepareData(e,"components")}),n.materials.forEach(e=>{this._prepareData(e,"materials"),this._prepareGroups(e)}),n.textures.forEach(e=>{this._prepareData(e,"textures")}),St.set(e,!0),t(n)},n)})}getComponent(e){return this._getById(e,"components")}getConfiguration(e){return this._getById(e,"configurations")}getConfigurations(e){return this._getByIds(e,"configurations")}getItem(e){return this._getById(e,"items",{additionalHeaders:Mt})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:Mt})}getTag(e){return this._getById(e,"tags")}getTags(e){return this._getByIds(e,"tags")}getTexture(e){return this._getById(e,"textures")}getCatalog(e){return this._getById(e,"catalogs")}getMesh(e,t="crt",n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const s=xt.get(e);s?t(s):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{xt.set(e,n),t(n)},n)})}getTexturesOf(e){return this._getRelationData(e,{rapiPath:"textures"})}getItemsOf(e){return this._getRelationData(e,{rapiPath:"items"})}async getMaterialsOf(e){return(await this._getRelationData(e,{rapiPath:"materials"},{embed:["textures"]})).filter(e=>e.active)}getComponentsOf(e){return this._getRelationData(e,{rapiPath:"components"})}getAdditionalContentsOfItems(e){const t=[],n=[];return e.forEach(e=>{const s=It.get(e.id.toString());s?n.push(...s):t.push(e.id.toString())}),new Promise((e,s)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=It.get(e.itemId);t||(t=[]);for(let n=0,s=t.length;n<s;n++)if(t[n].id===e.id)return;t.push(e),It.set(e.itemId,t)}),e([...t,...n])},s):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}peekItem(e){return this._peekData(e,"items")}peekConfiguration(e){return this._peekData(e,"configurations")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}static clearCaches(){Tt=new Map,kt=new Map,Rt=new Map,St=new Map,Lt=new Map,Dt=new Map,It=new Map}cleanUp(){e.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let s=t.length;for(let e=0;e<s;e++){const i=Ot(t[e]);if(i){const o=i.length;for(let e=0;e<o;e++){const t=this._getCache("materials").get(i[e]);n.push(t)}t.splice(e,1),s--,e--}}return new Promise((e,s)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},s):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),s=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];s.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(s=>{const i=[];t.perspectiveImage&&!s.perspectiveImage&&i.push(this.savePerspectiveImage(s,t.perspectiveImage)),t.topImage&&!s.topImage&&i.push(this.savePerspectiveImage(s,t.topImage)),Promise.all(i).then(e,n)},n)}))}Promise.all(s).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:s,topImage:i}=t;let o=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},r=o[n]||{};r.data=e,r.perspectiveImage=s,r.topImage=i,o[n]=r,this._localStorage.setItem("hsc_configurations_offline_queue_v1",o)}async saveConfiguration(e){return navigator.onLine?await this._save("/configurations",{configuration:e},"configurations",{accept:"application/json",contentType:"application/json; charset=UTF-8"}):(e.perspectiveImage=null,e.topImage=null,this._setQueuedConfiguration(e),this._markConfigurationAsLocally(e),Promise.resolve(e))}saveTopImage(e,t){return this._saveConfigurationImage(e,t,"topImage")}savePerspectiveImage(e,t){return this._saveConfigurationImage(e,t,"perspectiveImage")}getShortUrl(e,t){return new Promise((n,s)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:s,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=Rt.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const s={};return s[n]=t,this._setQueuedConfiguration(e,s),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const s=this._formDataUtil.create(t.image,e.configurationHash,y.PNG,n);return this._save("/configurations/"+e.id+"/"+n,s,"configurations",{accept:"application/json"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,s={}){const i=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,o)=>{const r={method:s.method||"POST",data:i,resolve:t,reject:o};s.contentType&&(r.contentType=s.contentType),s.accept&&(r.accept=s.accept),this._fetchJson(e,n,r)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const s=new Map,i={id:null,label:null,materials:[]},o=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&r.push({isTag:!1,id:Pt+n.group,legacyId:n.group}),r.length||r.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===o.indexOf(e)?o.push(e):null),r.forEach(({isTag:e,id:t,legacyId:o})=>{const r=n.id;let a=t?Ot(t):[];a||(Tt.set(t,[]),a=Ot(t)),-1===a.indexOf(r.toString())&&a.push(r.toString());const l=Ht(n),h=l&&e,c=Ut(n);if(h||c&&!e||!l&&!c&&!t){let e=t?s.get(t):i;e||(s.set(t,{id:t,label:n.groupLabel,legacyId:o,materials:[]}),e=s.get(t)),e.materials.push(n)}})}const r=i.materials.length?[i]:[];this.getTags(o).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return s.forEach((e,t)=>{r.push({id:t,label:n[t]?n[t].label:e.label,materials:e.materials,legacyId:e.legacyId,sort:n[t]?n[t].sort:void 0})}),t(r)},n)})}_getByIds(e,t,n={}){const s=this._getCache(t),i=this._getErrorCache(t),o=[],r=[...new Set(e)];let a=r.length;if(s&&s.size){const e=(new Date).getTime();for(let t=0;t<a;t++){const n=r[t],l=s.get(n),h=i.get(n);let c=!1;null!=l?(o.push(l),c=!0):c=void 0!==h&&(e-h.timestamp<6e4||!1===navigator.onLine),c&&(r.splice(t,1),a--,t--)}}return new Promise((e,s)=>{0!==r.length&&navigator.onLine?this._getByIdsPackets(r,t,n).then(t=>{e([...t,...o])},s):e(o)})}_getByIdsPackets(e,t,n={}){const s=n.filterKey||"ids";let i,o="/"+t+"/",r="?",a=[];const l=e.length;if(!l)return new Promise(e=>e([]));let h=!0,c=[];for(i=0;i<l;i++){h=!1;const n=e[i],l=r+s+"[]="+n,d=l.length+o.length;c.push(n),r="&",d<=1500?o+=l:(d>1500&&(c.pop(),i--),a.push({url:o,ids:c}),h=!0,o="/"+t+"/",r="?",c=[])}h||a.push({url:o,ids:c});const d=[];return a.forEach(e=>d.push(this._getByIdsSingle(e.ids,e.url,t,n))),new Promise((e,t)=>{Promise.all(d).then(t=>{const n=[];t.length&&t.forEach(e=>n.push(...e)),e(n)},t)})}_getByIdsSingle(e,t,n,s={}){return new Promise((i,o)=>{this._get(t,n,s).then(t=>{for(let n=0,i=t.length;n<i;n++){const i=s&&s.cacheKey?t[n][s.cacheKey]:t[n].id,o=e.indexOf(i.toString());-1!==o&&e.splice(o,1)}const o=e.length;if(o){const t=this._getCache(n),s=this._getErrorCache(n),i=(new Date).getTime();for(let n=0;n<o;n++)s.set(e[n],{code:0,timestamp:i}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}i(t)},o)})}_getById(e,t,n={}){if(!e||""===e||"string"!=typeof e)return console.error("no id passed to _getById"),Promise.reject(new Error("no id passed to _getById"));const s=this._getCache(t).get(e);if(s)return new Promise(e=>e(s));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const i={...n,id:e},o=n.pathSuffix||"";return this._get("/"+t+"/"+e+o,t,i)}_get(e,t,n={}){const s=ot.useHDGeometry?"includeGeometryHD=true":"";let i=-1===e.indexOf("?")?"?":"&";return""!==s&&(e+=i+s),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=i+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",i="&"}),new Promise((s,i)=>{const o=Dt.get(e);Array.isArray(o)&&o.length>0?o.push({resolve:s,reject:i}):(Dt.set(e,[{resolve:s,reject:i}]),this._fetchJson(e,t,n))})}_fetchJson(e,t,n={}){this._fetch(e,n).then(o.bind(this)).then(this._handleJson(e,t,n).bind(this)).catch(this._handleError(e,n).bind(this))}async _fetch(e,t){const n={method:t.method?t.method:"GET",headers:this._createHeaders(t),mode:"cors",cache:"default"};t.data&&(n.body=t.data);let s=yt.server;const i=this._globalInitData.overrideRapi;i&&(s="live"===i?yt.liveServer:yt.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(s=this._globalInitData.customApiUrl);const o=new Request(s+e,n);this._globalCallback.onNetworkRequest(e,n,t);const r=await this._globalCallback.onCheckExternalCache(e,n);return r?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(r)}:this._networkLayer.fetch(o)}_createHeaders(e={}){const t={...bt};this._globalInitData.overrideTenant&&(t.currentTenant=this._globalInitData.overrideTenant),this._globalInitData.overrideCountry&&(t.country=this._globalInitData.overrideCountry);const n=this._globalInitData.locale||"en";t.language=n,t.locale=n;const{contentType:s,accept:i,additionalHeaders:o,data:r}=e;if(s&&(t["content-type"]=e.contentType),i&&(t.accept=e.accept),o)for(let e in o)o.hasOwnProperty(e)&&(t[e]=o[e]);this._globalInitData.configuratorId&&(t.configurator=this._globalInitData.configuratorId);const a=this._currentToken||vt;t.token="03-"+window.btoa((new Date).toISOString()+";"+a+";"+bt.apiKey);const l=new Headers(t);return r instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return s=>{let i=null,o=null;"number"==typeof s&&(i=s);for(let e in s)"meta"!==e&&s.hasOwnProperty(e)&&(i=s[e],o=e);if("error"===o)return this._handleError(e,n)(new Error(JSON.stringify(i)));if(!i)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(i))for(let e=0,s=i.length;e<s;e++)this._prepareData(i[e],t,n),this._prepareEmbeddedData(i[e],t,n);else this._prepareData(i,t,n),this._prepareEmbeddedData(i,t,n);n.resolve?n.resolve(i):this._notifyWaiters(e,null,i)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(s=>{const i=e[s.slice(0,-1)+"Objects"];if(Array.isArray(i)){for(let e=0,t=i.length;e<t;e++)this._prepareData(i[e],s,n);this._prepareRelationalData(t,s,e.id,i)}else i&&(this._prepareData(i,s,n),this._prepareRelationalData(t,s,e.id,[i]))})}_getCache(e){return this._getCacheFrom(e,Rt)}_getErrorCache(e){return this._getCacheFrom(e,At)}_getCacheFrom(e,t){let n=t.get(e);return n||(t.set(e,new Map),n=t.get(e)),n}_setCache(e,t,n){n.set(e.toString(),t)}_prepareData(e,t,n=null){let s=this._getCache(t);const i=n&&n.cacheKey?e[n.cacheKey]:e.id;if(i||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=i||n.id;this._setCache(t,e,s)}e.__rapi_path__=t}else this._setCache("0",e,s);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let s=kt.get(t);if(!s){const i=new Map,o=new Map;o.set(n,void 0),i.set(e,o),kt.set(t,i),s=kt.get(t)}let i=s.get(e);if(!i){const t=new Map;t.set(n,void 0),s.set(e,t),i=s.get(e)}return i.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let s=Ot(t);s||(Tt.set(t,[]),s=Ot(t)),-1===s.indexOf(n.toString())&&s.push(n.toString())}_handleError(e,t={}){return n=>{navigator.onLine?(n.rmlErrorCode=1,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(1,[n])):(n.rmlErrorCode=0,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(0,[n])),t.reject?t.reject(n):this._notifyWaiters(e,n,null)}}_getRelationData(e,t,n={}){const s=e.id;if(!s)return Promise.resolve([]);const i=e.__rapi_path__,o=t.rapiPath;let r=this._getCache(o),a=this._getRelationsCacheFor(s.toString(),i,o),l=[];return a?(a.forEach(e=>l.push(r.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+i+"/"+s+"/"+o,o,n).then(t=>{this._prepareRelationalData(i,o,s,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,s){kt.has(e)||kt.set(e,new Map);let i=kt.get(e);const o=n.toString();i.has(o)||i.set(o,new Map);let r=i.get(o),a=this._getCache(t),l=[];for(let e=0,t=s.length;e<t;e++){const t=s[e],n=t.id.toString();l.push(n),a.set(n,t)}r.set(t,l)}_notifyWaiters(e,t,n){const s=Dt.get(e);if(s&&s.length){for(let e=0,i=s.length;e<i;e++)t?s[e].reject(t):s[e].resolve(n);Dt.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),s=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(s)return e(s);this._fetchJson("/tenants/me","tenants/me",{resolve:t=>e(t),reject:t})})}async getTenant(e){return e||(e=await this._tenantMe()),this._getById(e.toString(),"tenants")}getCurrentSkin(){return this._tenantMe().then(e=>this._getById(e.toString(),"tenants").then(e=>this._getById(e.skin.toString(),"skins")))}getPrices(e){return this._getByIds(e,"prices",{filterKey:"priceIds",cacheKey:"priceId"})}async getConfiguratorSettings(e){const t=await this._getById(e,"configurators");return t.allowedHosts||(t.allowedHosts=[]),t.allowedHosts&&!Array.isArray(t.allowedHosts)&&(t.allowedHosts=t.allowedHosts.split(" ")),t}sendUserAction(e){return this._save("/userActions",{userAction:e},"userActions",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}shareConfiguration(e,t,n){const s="/configurations/"+e+"/shares",i=new FormData;return i.append("email",t),i.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:i,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(s,n).then(n.resolve,n.reject)})}export3D(e,t,n,s={}){const i="/configurations/"+e+"/3d-exports",o={formats:[{file_format:n,pack_external_data:!0,...s}]},r=JSON.stringify(o),a=new FormData;return a.append("email",t),a.append("settings",r),new Promise((e,t)=>{const n={method:"POST",data:a,resolve:e,reject:t};this._fetch(i,n).then(n.resolve,n.reject)})}async trackView(e){if(this._itemLoaded||(t=(()=>{var e;const t=(()=>{if(window.__RML__ENV__&&window.__RML__ENV__.skipIframeCheck)return!1;try{return window.self!==window.top}catch(e){return!0}})();let n=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href;if(!n)return null;if(t){if(!document.referrer)return null;n=document.referrer}const{hostname:s}=new URL(n);return s})())&&($.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,s={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(s),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,s)=>{const i={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:s};this._fetchJson("/auth/signin","auth",i)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}setCurrentToken(e){this._currentToken=e}removeCurrentToken(){this._currentToken=null}createNewPlan(){return{name:"",description:"",changeDate:(new Date).toISOString(),created:(new Date).toISOString(),draftId:null,thumbnail:"data:image/png;base64,missing",planObjects:null,active:!0,open:0,planDirectory:0,changed:0,version:2,floorLevel:0,visibility:9,user:null,tenant:null,assets:[],parent:null,setting:null}}}return M([J],e.prototype,"_formDataUtil",void 0),M([J],e.prototype,"_errorHandler",void 0),M([J],e.prototype,"_dataSyncer",void 0),M([J],e.prototype,"_networkLayer",void 0),M([J],e.prototype,"_localStorage",void 0),M([J],e.prototype,"_globalInitData",void 0),M([J],e.prototype,"_globalCallback",void 0),e})());const Ft=e("N",9);e("C",(()=>{class e{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new Bt,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=jt()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return Qt.lookup("planner-kernel-access",this._creator_)}clearReference(){this._getKernelAccess().removeConfiguratorListener(this)}_addMeshToSubPart(e,t,n,s,i,o,r,a){let l=this._generateMesh(e,t,n,i,o,r,a);s&&l.applyMatrix4(Ne(s)),this._subPartObject.add(l)}_addMeshToComponent(e,t,n,s,i,o,r,a,l,h){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,s,null,o,r,a,l);const c=this.getComponent(e);if(!c)return;const d=this._componentFactory.isPreview(c),u=this._generateMesh(e,n,d?null:s,o,r,a,l);u.userData.meshId=t,u.userData.geometryId=n,u.userData.materialId=s,i&&(u.userData.transform=Ne(i),u.applyMatrix4(u.userData.transform)),d&&u.layers.set(5),c&&c.addMesh(u),c.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,c.meshes.length)}_changeMeshOfComponent(e,t,n,s,i){const o=this.getComponent(e);if(!o)return;const r=o.getMeshById(t);r&&(r.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),r.userData.materialId=s,this._configuratorMeshGenerator.setMaterial(r,s),i&&(r.userData.transform=Ne(i),r.position.set(0,0,0),r.scale.set(1,1,1),r.rotation.set(0,0,0),r.applyMatrix4(r.userData.transform)))}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}getNumberOfPossibleChildrenForComponent(e){if(this._componentNumberOfPossibleChildren.has(e))return this._componentNumberOfPossibleChildren.get(e);const t=this._getKernelAccess().kernelInstance.getPlanComponentPossibleChildren(e).length;return this._componentNumberOfPossibleChildren.set(e,t),t}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],s=[];t.meshes.forEach(t=>{const i=t.userData.material;if(!i)return void console.warn("mesh has no material id set");if(!e.has(i)){const s=new THREE.Mesh(new THREE.Geometry,t.material);s.userData.material=i,s.receiveShadow=!0,s.castShadow=!0,s.layers.set(3),this._setMaterial(s,i),n.push(s),e.set(i,s)}const o=e.get(i).geometry;t.userData.transform?o.merge(t.geometry,t.userData.transform):o.merge(t.geometry),s.push(t)}),n.forEach(e=>t.addMesh(e)),s.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,s){let i=this._components.get(t),o=this._components.get(e);o&&(o.roomlePosition=n,o.roomleRotation=s,i&&i.add(o))}dockComponentWithPosition(e,t){let n,s=this._components.get(e.parentId);n=t?t.getKernelPosition(s):e.getKernelPosition(s);const i=it.start("dock_component_with_position_"+e.childId);this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null,it.end(i)}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,s,i,o,r){this._addMeshToComponent(e,null,null,t,null,n,s,i,o,r)}Editor3dAddDockPreview(e,t){const n=this._componentFactory.createPreview(t,e);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,s,i,o,r,a,l,h){this._addMeshToComponent(e,t,n,s,i,o,r,a,l,h)}Editor3ChangedNamedMesh(e,t,n,s,i){this._changeMeshOfComponent(e,t,n,s,i)}Editor3dRemoveNamedMesh(e,t){this._removeMeshFromComponent(e,t)}Editor3dBeginConstruction(e,t){if(!t){const t=this._components.get(e);t&&t.removeAllMeshes()}this._subPartGuard&&e===this._subPartGuard.info&&(this._subPartObject=new THREE.Object3D)}Editor3dComponentCreated(e,t,n,s,i){i&&(this._configuratorContext.rootComponentId=e);let o=null;this._components.has(e)?(o=this._components.get(e),o.removeAllMeshes()):(o=this._componentFactory.create(e,t,n,s),o.layers.set(3)),this._components.set(e,o),i&&this._addRootComponent(o)}Editor3dComponentDocked(e,t,n,s){this.dockComponent(e,t,n,s)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let s=this._previews.get(e.toString());s&&s.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];lt.finishOperation(2,n),this._updatePlanObject(t),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let s=this._componentFactory.createPreviewLine(n),i=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?s:s.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=(o=e[t].rotation,new THREE.Euler(o.x,o.z,-o.y)),n.roomlePosition=e[t].position,e[t].lineFrom.x>e[t].lineTo.x||e[t].lineFrom.y>e[t].lineTo.y||e[t].lineFrom.z>e[t].lineTo.z?(n.roomleLineFrom=e[t].lineTo,n.roomleLineTo=e[t].lineFrom):(n.roomleLineFrom=e[t].lineFrom,n.roomleLineTo=e[t].lineTo),e[t].positionFrom.x>e[t].positionTo.x||e[t].positionFrom.y>e[t].positionTo.y||e[t].positionFrom.z>e[t].positionTo.z?(n.roomlePositionFrom=e[t].positionTo,n.roomlePositionTo=e[t].positionFrom):(n.roomlePositionFrom=e[t].positionFrom,n.roomlePositionTo=e[t].positionTo),i.add(n),n.preparePreview(),this._previews.set(n.stringId,n)}var o}Editor3dSetPreviewPointAssociations(e,t){let n=this._previews.get(t.toString());if(!n)return;let s=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let i;0===t?i=n:(i=n.clonePreview(t),this._previews.set(i.stringId,i)),i.name="Preview Point",i.parentDockId=e[t].parentDockId,i.parentId=e[t].parentId,i.childDockId=e[t].childDockId,i.childId=e[t].childId,i.preparePreview(),i.receivedPointAssociation=!0,i.userData.ignoreComponentRaycast=!0,s.add(i),i.roomlePosition=e[t].position,i.roomleRotation=e[t].rotation}}componentDeleted(e){const t=this._components.get(e);t&&(this._listener&&this._listener.componentDeleted(t),t.removeFromParent(),t.removeAllMeshes(),this._components.delete(e))}componentMetaUpdated(e){const t=this._getRuntimeComponent(e.id);t&&(t.hash=e.hash,t.roomlePosition=e.position,t.roomleRotation=e.rotation,e.boxForMeasurement&&t.computeBoundingBox(e.boxForMeasurement),this._listener&&this._listener.componentUpdated(t,e))}componentConfigurationUpdated(e,t){const n=this._getRuntimeComponent(e);n&&(n.geometryChanged=t)}_getRuntimeComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}configurationLoaded(e,t,n,s,i){10===e&&(this._configuratorContext.dockingRootComponentId=n);let o=0===t;o?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let r=this._getKernelAccess().kernelInstance.getComponent(n),a=this._components.get(n);a&&(a.computeBoundingBox(r.boxForMeasurement),a.hash=r.hash),this._listener&&this._listener.configurationLoaded(a,o&&void 0!==a.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let s=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(s)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e){this._updatePlanObject(e)}sceneCleared(){this._components.forEach((function(e){e.removeFromParent(),e.removeAllMeshes()})),this._components.clear(),this._componentNumberOfPossibleChildren.clear(),this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear()}setListener(e){this._listener=e}getBoundingBox(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxForMeasurement)return k(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new THREE.Box3).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new THREE.Box3).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,s,i,o,r,a,l){return this._configuratorMeshGenerator.generateMesh(e,t,n,s,i,o,r)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new ce(e),this._getKernelAccess().requestPlanComponentConstruction(e),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}}return M([J],e.prototype,"_configuratorMeshGenerator",void 0),M([J],e.prototype,"_configuratorContext",void 0),M([J],e.prototype,"_cacheHolder",void 0),M([J],e.prototype,"_initData",void 0),e})());class Bt extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,s)=>{n>t&&(e=s,t=n)}),e}}const Vt=["material"];let Gt=(()=>{class e extends Ct{constructor(e){super(e),this.externalMeshQueue=new Pe,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{}}init(e){super.init(e),it.addMeta("kernel_is_ready",{isWasm:this._useWASM}),ot.kernelInstance?(this._kernelContainer=ot.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){it.start("kernel_is_ready"),window.ConfiguratorKernel&&(ot.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);lt.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,s=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),s.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,s)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,s=!1,i=[];e&&e.forEach(e=>{let o=this._kernelInstance.getComponent(e);o.componentId=this._kernelInstance.getComponentId(e),o&&o.childIds&&o.childIds.length>0&&(n=!0),o.id===t&&(s=!0),i.push(o)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",s,n,i)}_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 s=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(s),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(s)}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,s){const i=this._kernelInstance.getComponentId(n),o=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,s,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(i,s,o,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,s=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),i=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),lt.finishOperation(3,[i,s])}webGlPreviewDockings(e,t){lt.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(10,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(10,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(Ft,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,s,i,o){"string"==typeof s?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,s):console.warn("tried to set a parameter to a none string value!",s,t,n),this._finishParameterChange(n,i,o),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,s,i,o){"string"==typeof s?this._kernelInstance.setComponentParameter(e,t,s):console.warn("tried to set a parameter to a none string value!",s,t,n),this._finishParameterChange(n,i,o),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,s,i,o){"string"==typeof s?this._kernelInstance.setPlanObjectParameter(e,t,s):console.warn("tried to set a parameter to a none string value!",s,t,n),this._finishParameterChange(n,i,o)}_finishParameterChange(e,t,n){-1===Vt.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 s=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(s,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let s=this._kernelInstance.getPlanObjectParameters,i=e;t&&(s=this._kernelInstance.getComponentParameters,i=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(s.apply(this._kernelInstance,[i]))})}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(),it.end("kernel_is_ready"),it.start("kernel_create_instance"),ot.kernelInstance?this._kernelInstance=ot.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,this._initKernel(),it.end("kernel_create_instance"),$e.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:Ke}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),ot.planObjectId&&this.planObjectCreated(-1,ot.planObjectId)}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,s,i){lt.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:s,errors:Ke(i)}),this._configuratorKernelCallbackListener.forEach(o=>o.configurationLoaded(e,t,n,s,i))}componentDefinitionLoaded(e,t){lt.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),lt.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=Ke(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}lt.failOperation(4,new Error(n)),lt.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 s=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(s=>s.planObjectConfigurationUpdated(e,t,n));const i=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(i),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,s),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 s=new Promise((e,t)=>{n=e});let i;this.externalMeshQueue.push(s);try{i=await this._rapiAccess.getMesh(e,"crt",t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const s=await fetch(new Request(this._dataSyncer.requestAsset(i.url,!0))),o=await s.arrayBuffer();this._handleCortoMesh(o,e,t),n()}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),console.error(t),t}}Editor3dComponentCreated(e,t,n,s){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentCreated(e,t,n,s,!1)),s&&s>0&&this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentDocked(e,s,t,n))}Editor3dRootComponentCreated(e,t,n,s){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentCreated(e,t,n,s,!0))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),it.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 M([J],e.prototype,"_memoryManager",void 0),M([J],e.prototype,"_configuratorKernelAccessCallback",void 0),M([J],e.prototype,"_initData",void 0),M([J],e.prototype,"_configuratorHistory",void 0),e})();class Kt extends qe{constructor(e){super(e),this._container.name="Node Plan Element"}addMesh(e){super.addMesh(e)}}let zt=e("P",(()=>{class e extends Gt{constructor(e){super(e),this._plannerKernelCallbackListener=new Set}get kernelContainer(){return this._kernelContainer}_loadSuccess(){super._loadSuccess(),window.RoomleCore&&window.RoomleCore(this._kernelContainer)}_loadError(){super._loadError(),console.error("kernel load error")}_createPlanInteractionHandler(){const e=this._kernelContainer;this._planInteractionHandler=new e.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,100,!0,!0,e.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._createPlanInteractionHandler();const e=this._planInteractionHandler.getConfiguratorKernel();this._kernelInstance=e,this._initKernel(),this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),$e.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady()}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 s=0;s<n;s++)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}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){var e;super.cleanUpCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.unregisterPlannerCallback)&&this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){var e;super.registerCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.registerPlannerCallback)&&this._kernelContainer.registerPlannerCallback(this)}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){this._decoupleReferences(e),t&&this._plannerKernelCallbackListener.forEach(n=>n.handlerSwitchedPlans(e,t))}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,s=t;if(s.hasConfiguration())n=new Xe(s),this.coupleReferences(n,s),e.extRef.jsObject.addPlanElementViewModel(n);else{n=new Ze(s),this.coupleReferences(n,s),e.extRef.jsObject.addPlanElementViewModel(n);const i=t.getCatalogItemId();i&&this._rapiAccess.getItem(i).then(e=>{n.setRapiItem(e)})}this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{const n=t;let s,i=!0;if(t.getType()===this._kernelContainer.PlanElementType.WALL?s=new et(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?s=new tt(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?s=new nt(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(s=new Kt(n),i=!1),!s)return;this.coupleReferences(s,n),e.extRef.jsObject.addPlanElementViewModel(s),i&&(s.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(s=>s.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){}stoppedDrawing(){}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,s,i,o){this._plannerKernelCallbackListener.forEach(r=>r.addMesh(e,t,n,s,i,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,s,i,o,r){this._plannerKernelCallbackListener.forEach(a=>a.addPlanMesh(e,t,n,s,i,o,r))}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 s=this._rapiItemToKernelItem(e);return this._planInteractionHandler.addPlanObjectFromItem(s,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 M([J],e.prototype,"_kernelAccessCallback",void 0),M([J],e.prototype,"_roomlePlannerUiCallback",void 0),e})());class Nt extends Te{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=new THREE.MeshPhysicalMaterial({color:"#ffffff"}),this._environmentLoader.setEnvMap(this._defaultMaterial),this._environmentLoader.onEnvMapUpdate(()=>{this._environmentLoader.setEnvMap(this._defaultMaterial)})}generateGeometry(e=null,t,n,s,i,o=!1){let r;return r=o?this._generateGeometry(e,t,n,s,i).clone():this._generateGeometry(e,t,n,s,i),r}generateMesh(e=0,t=null,n,s,i,o,r,a,l=!1){let h;h=l?this._generateGeometry(t,s,i,o,r).clone():this._generateGeometry(t,s,i,o,r);const c=this._createMesh(e,t,h);return c.userData.materialId=n,c.layers.set(4),n&&this.setMaterial(c,n,a).then(()=>{e&&t&&n&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n);const s=a&&3===a.value;c.castShadow=!s}),this._checkWallMaterial(c,a),c}async setMaterial(e,t,n){if(e.userData.material=W(t,n),e.userData.materialId=t,E(t))t?await this._assignMaterial(e,t):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._defaultMaterial));else{if(!t)return void this.changeMaterialOfMesh(e,this._configuratorPreviewMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._defaultMaterial):(this.changeMaterialOfMesh(e,this._defaultMaterial),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{G(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}e("a4",Nt);let Wt={InchFeet:null,MM:null,CM:null},qt={NoUnitString:null,LongUnitString:null,ShortUnitString:null},Jt=(()=>{class e{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;Wt=e.Unit,qt=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:s}=this._initData;this._actualUnit===Wt.InchFeet?this._precision=void 0!==s?parseInt(s,10):2:this._actualUnit===Wt.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision),this._formatter=t}_initActualUnit(){const{unit:e}=this._initData;switch(e){case"cm":this._actualUnit=Wt.CM;break;case"mm":this._actualUnit=Wt.MM;break;case"inchfeet":this._actualUnit=Wt.InchFeet;break;default:this._actualUnit=Wt.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=qt.NoUnitString;break;case"long":this._actualUnitStringType=qt.LongUnitString;break;case"short":this._actualUnitStringType=qt.ShortUnitString;break;default:this._actualUnitStringType=qt.ShortUnitString}}_isFormatterReady(){return!!this._formatter||(console.warn("Formatter is not ready..."),!1)}formatAngleValueToUnitString(e,t){const n="Integer"===t.type?0:2;return e.toFixed(n)+"°"}parseAngleValueFromUnitString(e){return e.replace("°","").replace(/\s/g,"")}parseValue(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?e:"length"===t.unitType?this.parseMMValueFromUnitString(e,t.unitType):"angle"===t.unitType||"area"===t.unitType?this.parseAngleValueFromUnitString(e):e}formatValueToUnitString(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?"Integer"===t.type?e.toString():parseFloat(e.toString()).toFixed(2):"length"===t.unitType?this.formatMMValueToUnitString(e,t.unitType):"angle"===t.unitType?this.formatAngleValueToUnitString(e,t):"area"===t.unitType?this.formatSquareMMValueToUnitString(e):e}isParseableNumber(e){return this._isFormatterReady()?this._formatter.isParseableNumber(e):null}isParseableUnitString(e,t){return this._isFormatterReady()?"angle"===t.unitType?this._formatter.isParseableUnitString(this.parseAngleValueFromUnitString(e),this._actualUnit):this._formatter.isParseableUnitString(e,this._actualUnit):null}parseMMValueFromUnitString(e,t){return this._isFormatterReady()?"count"===t?parseFloat(e):this._formatter.parseMMValueFromUnitString(e,this._actualUnit):null}parseNumber(e){return this._isFormatterReady()?this._formatter.parseNumber(e):null}formatNumber(e,t=0){return this._isFormatterReady()?this._formatter.formatNumber(e,t):null}formatSquareMMValueToUnitString(e){return this._isFormatterReady()?this._formatter.formatSquareMMValueToUnitString(e,this._actualUnit):null}formatMMValueToUnitString(e,t){return this._isFormatterReady()?"count"===t?e.toString():this._formatter.formatMMValueToUnitString(e,this._actualUnit,this._actualUnitStringType):null}formatMMValueWithReqMaxLength(e,t){return this._isFormatterReady()?this._formatter.formatMMValueWithReqMaxLength(e,this._actualUnit,t):null}_formatParameterValue(e,t){return"length"===t?this.formatMMValueToUnitString(parseFloat(e)):"area"===t?this.formatSquareMMValueToUnitString(parseFloat(e)):e}formatPartListParameter(e){(function(e){return"length"===e.unitType||"area"===e.unitType})(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(e.valueLabel=this._formatParameterValue(e.value,e.unitType),dt(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(ht(e)){e.uiType="Range";const t=null!==e.validRange.valueFrom?e.validRange.valueFrom:Number.MIN_SAFE_INTEGER,n=null!==e.validRange.valueTo?e.validRange.valueTo:Number.MAX_SAFE_INTEGER;e.validRangeLabels={valueFrom:this._formatParameterValue(t.toString(),e.unitType),valueTo:this._formatParameterValue(n.toString(),e.unitType),type:e.validRange.type}}else ct(e)?(e.uiType="Options",function(e){return!!ct(e)&&Array.isArray(e.validValues)&&e.validValues.length>0&&"string"==typeof e.validValues[0].thumbnail}(e)&&(e.uiType="Thumbnails")):(console.error("Could not detect uiType of param"),e.uiType=null)}isInch(){return this._actualUnit===Wt.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}}return M([J],e.prototype,"_initData",void 0),e})(),Xt=(()=>{class e{constructor(e){this._history=[],this._index=0,this._creator_=e}undo(){if(!this.canUndo())return null;this._index++;const[e]=this._history.slice(this._index);return this._index===this._history.length-1?this._configuratorUiCallbacks.onHistoryChange(!1,!0):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}redo(){if(!this.canRedo())return null;this._index--;const[e]=this._history.slice(this._index);return 0===this._index?this._configuratorUiCallbacks.onHistoryChange(!0,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}push(e){const[t]=this._history.slice(this._index);t!==e&&(this._history=this._history.slice(this._index),this._history.unshift(e),this._index=0,1===this._history.length?this._configuratorUiCallbacks.onHistoryChange(!1,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!1))}canUndo(){return this._index!==this._history.length-1}canRedo(){return 0!==this._index}getHistory(){return this._history}clearHistory(){this._history=[],this._index=0}}return M([J],e.prototype,"_configuratorUiCallbacks",void 0),e})();const Yt=e("I",[new w("error-handler",class{constructor(){this._listeners={}}_subscribe(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}subscribe(e,t){this._subscribe(e,t)}dispatch(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let s=n.length;for(let e=0;e<s;e++){const s=n[e];s.apply(s,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let s=n.length;for(let e=0;e<s;e++)if(n[e]===t)return n.splice(e,1),s--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new w("form-data-util",b),new w("environment-loader",X),new w("static-item-loader",pe,0),new w("form-data-util",b),new w("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((s,i)=>{let o=this._promises.get(e),r=!0;if(!o){const t=new Map;this._promises.set(e,t),o=this._promises.get(e),r=!1}o.get(t)||(o.set(t,[]),r=!1);const a=o.get(t);a.push({resolve:s,reject:i}),o.set(t,a);const l=()=>{o.delete(t),0===o.size&&this._promises.delete(e)};r||new Promise(n).then(e=>{o.get(t).forEach(({resolve:t})=>t(e)),l()},e=>{o.get(t).forEach(({reject:t})=>t(e)),l()})})}},1),new w("dynamic-light-setting-loader",Q),new w("dynamic-quality-setting-loader",fe),new w("network-layer",ne),new w("local-storage",class{constructor(e){this._context_=e}get _localStorage(){let e=null;try{e=window.localStorage}catch(e){console.error(e)}return e}getItem(e){if(!this._localStorage)return null;const t=this._localStorage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}setItem(e,t){if(this._localStorage)try{const n=JSON.stringify(t);this._localStorage.setItem(e,n)}catch(e){console.error(e)}}}),new w("network-layer",ne),new w("kernel-io",ie,0),new w("data-syncer",he),new w("memory-manager",class{constructor(){this._configurationStringSet=new Set,this._singleLoadCounter=0}loadingConfigurationString(){this._singleLoadCounter+=1}loadingConfiguration(e){this._configurationStringSet.add(e),this._singleLoadCounter+=1}shouldHardReset(){return this._configurationStringSet.size>=15||this._singleLoadCounter>=30}executedHardReset(){this._configurationStringSet.clear(),this._singleLoadCounter=0}}),new w("life-cycle-manager",class{constructor(){this._listeners=[]}addEventListener(e){this._listeners.push(e)}removeEventListener(e){const t=this._listeners;let n=t.length;if(n)for(let s=0;s<n;s++)t[s]===e&&(t.splice(s,1),s--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new w("three-loader",me),new w("local-storage-helper",ge),new w("cache-holder",class{constructor(){this._componentCache=new Map,this._geometryCache=new Map,this._materialCache=new Map}get componentCache(){return this._componentCache}get geometryCache(){return this._geometryCache}get materialCache(){return this._materialCache}clear(){for(const e of this._componentCache.values())V(e);for(const e of this._materialCache.values())z(e);for(const e of this._geometryCache.values())K(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new w("kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new w("configurator-kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}updatePossibleChildren(e,t,n){this._callbackListener.forEach(s=>s.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,s){this._callbackListener.forEach(i=>i.updateParameters(e,t,n,s))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new w("configurator-context",class{constructor(){this.planObjectId=0,this.planElementId=0,this.rootComponentId=0,this.dockingRootComponentId=0,this.baseContext=null,this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new w("init-data",Ee,1),new w("global-init-data",we,0),new w("global-callback",be,0),new w("dom-helper",Me,1),new w("unit-formatter",Jt,0),new w("plugin-system",ve,1),new w("configurator-mesh-generator",Ie),new w("configurator-input-manager",class extends De{},1),new w("selection-handler",class extends ke{constructor(){super(...arguments),this._selectionMode="standard",this._selectedComponents=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedComponents.size&&this._selectedComponents.forEach((e,t)=>{e.deselect(),this._selectedComponents.delete(t),this.dispatchEvent(1,new Ae({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new Ae({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new Ae({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new Ae({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new Ae({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new Ae({component:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedComponents.size>0}getSelectedRuntimeComponentIds(){let e=[];return this._selectedComponents.forEach(t=>e.push(t.runtimeId)),e}isSelected(e){return this._selectedComponents.has(e.runtimeId)}},1),new w("component-dimensioning-helper",je,1),new w("component-dimensioning-helper",je,1),new w("planner-kernel-access",zt),new w("planner-mesh-generator",Nt,1),new w("unit-formatter",Jt),new w("configurator-history",Xt,1),new w("roomle-planner-ui-callback",class extends ye{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onCameraChanged=e=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,s)=>{},this.onSelectionCancel=()=>{},this.onPlanChanged=()=>{},this.onPlanElementChanged=()=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{}}}),new w("configurator-ui-callbacks",class extends ye{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,s)=>{},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,s)=>{},this.onUserInitiatedDockDone=(e,t,n,s,i)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{}}},1)]);class Qt{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new C,window.__RML__DI__.addDependencyInjectionAssignments(Yt))}static setup(e){Qt.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return Qt._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){Qt._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}e("b",Qt)}}}));
16
+ //# sourceMappingURL=roomle-dependency-injection-82abffba.legacy.js.map