@roomle/web-sdk 2.31.0-alpha.1 → 2.31.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 (233) hide show
  1. package/lib/banana-for-scale-95bb0a36.nomodule.js +2 -0
  2. package/lib/{banana-for-scale-8bd9d916.nomodule.js.map → banana-for-scale-95bb0a36.nomodule.js.map} +1 -1
  3. package/lib/banana-for-scale-c62bb269.js +2 -0
  4. package/lib/{banana-for-scale-4405de18.js.map → banana-for-scale-c62bb269.js.map} +1 -1
  5. package/lib/{component-dimensioning-c4aed0a4.nomodule.js → component-dimensioning-032b19a5.nomodule.js} +2 -2
  6. package/lib/component-dimensioning-032b19a5.nomodule.js.map +1 -0
  7. package/lib/{component-dimensioning-27d53ffd.js → component-dimensioning-231c9af2.js} +2 -2
  8. package/lib/component-dimensioning-231c9af2.js.map +1 -0
  9. package/lib/configurator-08e58911.nomodule.js +2 -0
  10. package/lib/configurator-08e58911.nomodule.js.map +1 -0
  11. package/lib/configurator-3570c605.js +2 -0
  12. package/lib/configurator-3570c605.js.map +1 -0
  13. package/lib/configurator-main-d4562587.js +2 -0
  14. package/lib/configurator-main-d4562587.js.map +1 -0
  15. package/lib/configurator-main.nomodule.js +1 -1
  16. package/lib/{configurator-mesh-generator-48dd85a4.nomodule.js → configurator-mesh-generator-a69ff1e4.nomodule.js} +2 -2
  17. package/lib/configurator-mesh-generator-a69ff1e4.nomodule.js.map +1 -0
  18. package/lib/{configurator-mesh-generator-a75b5156.js → configurator-mesh-generator-ed7f42a4.js} +2 -2
  19. package/lib/configurator-mesh-generator-ed7f42a4.js.map +1 -0
  20. package/lib/{default-light-setting-4a25d176.nomodule.js → default-light-setting-86b8760c.nomodule.js} +2 -2
  21. package/lib/default-light-setting-86b8760c.nomodule.js.map +1 -0
  22. package/lib/{default-light-setting-d2e449e7.js → default-light-setting-88521da5.js} +2 -2
  23. package/lib/default-light-setting-88521da5.js.map +1 -0
  24. package/lib/definitions/common-core/src/utils/init-data.d.ts +0 -2
  25. package/lib/definitions/common-core/src/utils/shims.d.ts +0 -11
  26. package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +1 -0
  27. package/lib/definitions/common-core/src/webgl/layer.d.ts +1 -2
  28. package/lib/definitions/common-core/src/webgl/roomle-component-factory.d.ts +1 -1
  29. package/lib/definitions/common-core/src/webgl/scene-manager.d.ts +19 -8
  30. package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +8 -8
  31. package/lib/definitions/configurator-core/src/static-files/geometries.d.ts +0 -3
  32. package/lib/definitions/configurator-core/src/webgl/configurator-scene-event-handler.d.ts +1 -3
  33. package/lib/definitions/configurator-core/src/webgl/{scene-helper.d.ts → configurator-scene-manager.d.ts} +18 -77
  34. package/lib/definitions/glb-viewer-core/src/webgl/glb-viewer-scene-manager.d.ts +1 -1
  35. package/lib/definitions/material-viewer/src/webgl/material-viewer-scene-manager.d.ts +1 -1
  36. package/lib/definitions/planner-core/src/roomle-planner.d.ts +2 -1
  37. package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +1 -1
  38. package/lib/dimensioning-helper-55aa9709.js +2 -0
  39. package/lib/dimensioning-helper-55aa9709.js.map +1 -0
  40. package/lib/dimensioning-helper-c69b5012.nomodule.js +2 -0
  41. package/lib/dimensioning-helper-c69b5012.nomodule.js.map +1 -0
  42. package/lib/glb-viewer-1482553f.nomodule.js +2 -0
  43. package/lib/{glb-viewer-aafdb02c.nomodule.js.map → glb-viewer-1482553f.nomodule.js.map} +1 -1
  44. package/lib/glb-viewer-75d1de15.js +2 -0
  45. package/lib/{glb-viewer-dc577f61.js.map → glb-viewer-75d1de15.js.map} +1 -1
  46. package/lib/glb-viewer-main-ee2c73a8.js +2 -0
  47. package/lib/glb-viewer-main-ee2c73a8.js.map +1 -0
  48. package/lib/glb-viewer-main.nomodule.js +1 -1
  49. package/lib/image-renderer-52bbd908.nomodule.js +2 -0
  50. package/lib/{image-renderer-70acb74b.nomodule.js.map → image-renderer-52bbd908.nomodule.js.map} +1 -1
  51. package/lib/image-renderer-757a6907.js +2 -0
  52. package/lib/{image-renderer-8df2f31f.js.map → image-renderer-757a6907.js.map} +1 -1
  53. package/lib/legacy/banana-for-scale-0854a7dc.legacy.js +2 -0
  54. package/lib/legacy/{banana-for-scale-65d969a1.legacy.js.map → banana-for-scale-0854a7dc.legacy.js.map} +1 -1
  55. package/lib/legacy/{component-dimensioning-f2993909.legacy.js → component-dimensioning-aaa05dd4.legacy.js} +2 -2
  56. package/lib/legacy/component-dimensioning-aaa05dd4.legacy.js.map +1 -0
  57. package/lib/legacy/configurator-21c32b82.legacy.js +2 -0
  58. package/lib/legacy/configurator-21c32b82.legacy.js.map +1 -0
  59. package/lib/legacy/configurator-main.legacy.js +1 -1
  60. package/lib/legacy/{configurator-mesh-generator-58490992.legacy.js → configurator-mesh-generator-62f318f2.legacy.js} +2 -2
  61. package/lib/legacy/configurator-mesh-generator-62f318f2.legacy.js.map +1 -0
  62. package/lib/legacy/{default-light-setting-b6840697.legacy.js → default-light-setting-d6e9de1f.legacy.js} +2 -2
  63. package/lib/legacy/default-light-setting-d6e9de1f.legacy.js.map +1 -0
  64. package/lib/legacy/dimensioning-helper-3878022f.legacy.js +2 -0
  65. package/lib/legacy/dimensioning-helper-3878022f.legacy.js.map +1 -0
  66. package/lib/legacy/glb-viewer-056c11ee.legacy.js +2 -0
  67. package/lib/legacy/{glb-viewer-46717172.legacy.js.map → glb-viewer-056c11ee.legacy.js.map} +1 -1
  68. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  69. package/lib/legacy/image-renderer-9a6a67fc.legacy.js +2 -0
  70. package/lib/legacy/{image-renderer-c1f09dc0.legacy.js.map → image-renderer-9a6a67fc.legacy.js.map} +1 -1
  71. package/lib/legacy/material-viewer-7a17728a.legacy.js +2 -0
  72. package/lib/legacy/material-viewer-7a17728a.legacy.js.map +1 -0
  73. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  74. package/lib/legacy/{mesh-generator-4a93e27d.legacy.js → mesh-generator-f2c8bb17.legacy.js} +2 -2
  75. package/lib/legacy/mesh-generator-f2c8bb17.legacy.js.map +1 -0
  76. package/lib/legacy/pixotron-b2477d2d.legacy.js +2 -0
  77. package/lib/legacy/pixotron-b2477d2d.legacy.js.map +1 -0
  78. package/lib/legacy/planner-7afba417.legacy.js +2 -0
  79. package/lib/legacy/{planner-42d951cf.legacy.js.map → planner-7afba417.legacy.js.map} +1 -1
  80. package/lib/legacy/planner-main.legacy.js +1 -1
  81. package/lib/legacy/rapi-access-990628ad.legacy.js +16 -0
  82. package/lib/legacy/{rapi-access-daec98c8.legacy.js.map → rapi-access-990628ad.legacy.js.map} +1 -1
  83. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  84. package/lib/legacy/static/ConfiguratorKernel-1814e60dbe690ae6.js +121 -0
  85. package/lib/legacy/static/ConfiguratorKernel-cbbc9ab4c6a45a73.wasm +0 -0
  86. package/lib/legacy/static/ConfiguratorKernelJs-4aa196fbd2db1290.js +143 -0
  87. package/lib/legacy/static/ConfiguratorKernelJs-83da6e4b5a0e6868.mem +0 -0
  88. package/lib/legacy/static/RoomleCore-1682cd0bfe5c84db.wasm +0 -0
  89. package/lib/legacy/static/RoomleCore-cf5eb8ac9b418bb8.js +130 -0
  90. package/lib/legacy/static/RoomleCoreJs-1a283c23fa3f057e.js +152 -0
  91. package/lib/legacy/static/RoomleCoreJs-c0e10f71d1afdef5.mem +0 -0
  92. package/lib/legacy/static/shaders-47c5850937e0536d.json +1 -0
  93. package/lib/legacy/{stats-helper-0c862b1b.legacy.js → stats-helper-12f49aa1.legacy.js} +2 -2
  94. package/lib/legacy/{stats-helper-0c862b1b.legacy.js.map → stats-helper-12f49aa1.legacy.js.map} +1 -1
  95. package/lib/material-viewer-37019048.js +2 -0
  96. package/lib/material-viewer-37019048.js.map +1 -0
  97. package/lib/material-viewer-b01a3995.nomodule.js +2 -0
  98. package/lib/material-viewer-b01a3995.nomodule.js.map +1 -0
  99. package/lib/material-viewer-main-9b09cbb2.js +2 -0
  100. package/lib/material-viewer-main-9b09cbb2.js.map +1 -0
  101. package/lib/material-viewer-main.nomodule.js +1 -1
  102. package/lib/{mesh-generator-1ab6446e.nomodule.js → mesh-generator-106a6ce1.nomodule.js} +2 -2
  103. package/lib/mesh-generator-106a6ce1.nomodule.js.map +1 -0
  104. package/lib/{mesh-generator-829100d1.js → mesh-generator-df801dc9.js} +2 -2
  105. package/lib/mesh-generator-df801dc9.js.map +1 -0
  106. package/lib/pixotron-76665c10.js +2 -0
  107. package/lib/pixotron-76665c10.js.map +1 -0
  108. package/lib/pixotron-c033394c.nomodule.js +2 -0
  109. package/lib/pixotron-c033394c.nomodule.js.map +1 -0
  110. package/lib/planner-59a8e189.nomodule.js +2 -0
  111. package/lib/{planner-4a060b05.nomodule.js.map → planner-59a8e189.nomodule.js.map} +1 -1
  112. package/lib/planner-5cbf6167.js +2 -0
  113. package/lib/{planner-a625e040.js.map → planner-5cbf6167.js.map} +1 -1
  114. package/lib/planner-main-8933f5be.js +2 -0
  115. package/lib/planner-main-8933f5be.js.map +1 -0
  116. package/lib/planner-main.nomodule.js +1 -1
  117. package/lib/rapi-access-21338f5f.js +16 -0
  118. package/lib/{rapi-access-5951f7d6.js.map → rapi-access-21338f5f.js.map} +1 -1
  119. package/lib/rapi-access-6a614458.nomodule.js +16 -0
  120. package/lib/{rapi-access-c0f4bbd9.nomodule.js.map → rapi-access-6a614458.nomodule.js.map} +1 -1
  121. package/lib/{roomle-sdk-8576bb12.js → roomle-sdk-6b970f8f.js} +2 -2
  122. package/lib/roomle-sdk-6b970f8f.js.map +1 -0
  123. package/lib/roomle-sdk.nomodule.js +1 -1
  124. package/lib/static/ConfiguratorKernel-1814e60dbe690ae6.js +1 -0
  125. package/lib/static/ConfiguratorKernel-1814e60dbe690ae6.js.map +1 -0
  126. package/lib/static/ConfiguratorKernel-cbbc9ab4c6a45a73.wasm +0 -0
  127. package/lib/static/ConfiguratorKernelJs-4aa196fbd2db1290.js +143 -0
  128. package/lib/static/ConfiguratorKernelJs-83da6e4b5a0e6868.mem +0 -0
  129. package/lib/static/RoomleCore-1682cd0bfe5c84db.wasm +0 -0
  130. package/lib/static/RoomleCore-cf5eb8ac9b418bb8.js +1 -0
  131. package/lib/static/RoomleCore-cf5eb8ac9b418bb8.js.map +1 -0
  132. package/lib/static/RoomleCoreJs-1a283c23fa3f057e.js +152 -0
  133. package/lib/static/RoomleCoreJs-c0e10f71d1afdef5.mem +0 -0
  134. package/lib/static/shaders-47c5850937e0536d.json +1 -0
  135. package/lib/{stats-helper-668db597.nomodule.js → stats-helper-37bc8127.nomodule.js} +2 -2
  136. package/lib/{stats-helper-668db597.nomodule.js.map → stats-helper-37bc8127.nomodule.js.map} +1 -1
  137. package/lib/{stats-helper-a723ffa2.js → stats-helper-50118506.js} +2 -2
  138. package/lib/{stats-helper-a723ffa2.js.map → stats-helper-50118506.js.map} +1 -1
  139. package/package.json +2 -2
  140. package/lib/banana-for-scale-4405de18.js +0 -2
  141. package/lib/banana-for-scale-8bd9d916.nomodule.js +0 -2
  142. package/lib/component-dimensioning-27d53ffd.js.map +0 -1
  143. package/lib/component-dimensioning-c4aed0a4.nomodule.js.map +0 -1
  144. package/lib/configurator-72fde8e8.js +0 -2
  145. package/lib/configurator-72fde8e8.js.map +0 -1
  146. package/lib/configurator-ecd46b23.nomodule.js +0 -2
  147. package/lib/configurator-ecd46b23.nomodule.js.map +0 -1
  148. package/lib/configurator-main-199a8f98.js +0 -2
  149. package/lib/configurator-main-199a8f98.js.map +0 -1
  150. package/lib/configurator-mesh-generator-48dd85a4.nomodule.js.map +0 -1
  151. package/lib/configurator-mesh-generator-a75b5156.js.map +0 -1
  152. package/lib/default-light-setting-4a25d176.nomodule.js.map +0 -1
  153. package/lib/default-light-setting-d2e449e7.js.map +0 -1
  154. package/lib/definitions/configurator-core/src/utils/addon-helper.d.ts +0 -39
  155. package/lib/definitions/configurator-core/src/webgl/environment/gltf-environment.d.ts +0 -18
  156. package/lib/dimensioning-helper-744f6bd1.js +0 -2
  157. package/lib/dimensioning-helper-744f6bd1.js.map +0 -1
  158. package/lib/dimensioning-helper-79c88f0b.nomodule.js +0 -2
  159. package/lib/dimensioning-helper-79c88f0b.nomodule.js.map +0 -1
  160. package/lib/glb-viewer-aafdb02c.nomodule.js +0 -2
  161. package/lib/glb-viewer-dc577f61.js +0 -2
  162. package/lib/glb-viewer-main-c020bd21.js +0 -2
  163. package/lib/glb-viewer-main-c020bd21.js.map +0 -1
  164. package/lib/image-renderer-70acb74b.nomodule.js +0 -2
  165. package/lib/image-renderer-8df2f31f.js +0 -2
  166. package/lib/legacy/banana-for-scale-65d969a1.legacy.js +0 -2
  167. package/lib/legacy/component-dimensioning-f2993909.legacy.js.map +0 -1
  168. package/lib/legacy/configurator-49ffd4d2.legacy.js +0 -2
  169. package/lib/legacy/configurator-49ffd4d2.legacy.js.map +0 -1
  170. package/lib/legacy/configurator-mesh-generator-58490992.legacy.js.map +0 -1
  171. package/lib/legacy/default-light-setting-b6840697.legacy.js.map +0 -1
  172. package/lib/legacy/dimensioning-helper-792a1d7a.legacy.js +0 -2
  173. package/lib/legacy/dimensioning-helper-792a1d7a.legacy.js.map +0 -1
  174. package/lib/legacy/glb-viewer-46717172.legacy.js +0 -2
  175. package/lib/legacy/image-renderer-c1f09dc0.legacy.js +0 -2
  176. package/lib/legacy/material-viewer-f97b6f16.legacy.js +0 -2
  177. package/lib/legacy/material-viewer-f97b6f16.legacy.js.map +0 -1
  178. package/lib/legacy/mesh-generator-4a93e27d.legacy.js.map +0 -1
  179. package/lib/legacy/pixotron-ec41bb9c.legacy.js +0 -2
  180. package/lib/legacy/pixotron-ec41bb9c.legacy.js.map +0 -1
  181. package/lib/legacy/planner-42d951cf.legacy.js +0 -2
  182. package/lib/legacy/rapi-access-daec98c8.legacy.js +0 -16
  183. package/lib/legacy/scene-manager-0842da82.legacy.js +0 -2
  184. package/lib/legacy/scene-manager-0842da82.legacy.js.map +0 -1
  185. package/lib/legacy/static/AddButtonRound-8004fa7dffdf7501.glb +0 -0
  186. package/lib/legacy/static/ConfiguratorKernel-4ca6a302619d4901.js +0 -121
  187. package/lib/legacy/static/ConfiguratorKernel-6713e1de96ef978c.wasm +0 -0
  188. package/lib/legacy/static/ConfiguratorKernelJs-48f878d7e377be5f.mem +0 -0
  189. package/lib/legacy/static/ConfiguratorKernelJs-df7e5e8c447ce141.js +0 -143
  190. package/lib/legacy/static/PhotoStudioRoom-5b94763849f82256.glb +0 -0
  191. package/lib/legacy/static/RoomleCore-0b27042fad1c1d39.js +0 -129
  192. package/lib/legacy/static/RoomleCore-e855c1668e7e1763.wasm +0 -0
  193. package/lib/legacy/static/RoomleCoreJs-582f2f94cdd9aadc.js +0 -151
  194. package/lib/legacy/static/RoomleCoreJs-fe17a5f3a30cab74.mem +0 -0
  195. package/lib/legacy/static/USM-config-gltf-ad488aada649b7a5.glb +0 -0
  196. package/lib/legacy/static/shaders-88ef4c916f20da62.json +0 -1
  197. package/lib/material-viewer-2f26bdee.js +0 -2
  198. package/lib/material-viewer-2f26bdee.js.map +0 -1
  199. package/lib/material-viewer-594bcf38.nomodule.js +0 -2
  200. package/lib/material-viewer-594bcf38.nomodule.js.map +0 -1
  201. package/lib/material-viewer-main-d78b0096.js +0 -2
  202. package/lib/material-viewer-main-d78b0096.js.map +0 -1
  203. package/lib/mesh-generator-1ab6446e.nomodule.js.map +0 -1
  204. package/lib/mesh-generator-829100d1.js.map +0 -1
  205. package/lib/pixotron-20d1e014.nomodule.js +0 -2
  206. package/lib/pixotron-20d1e014.nomodule.js.map +0 -1
  207. package/lib/pixotron-ce97d03b.js +0 -2
  208. package/lib/pixotron-ce97d03b.js.map +0 -1
  209. package/lib/planner-4a060b05.nomodule.js +0 -2
  210. package/lib/planner-a625e040.js +0 -2
  211. package/lib/planner-main-71b12706.js +0 -2
  212. package/lib/planner-main-71b12706.js.map +0 -1
  213. package/lib/rapi-access-5951f7d6.js +0 -16
  214. package/lib/rapi-access-c0f4bbd9.nomodule.js +0 -16
  215. package/lib/roomle-sdk-8576bb12.js.map +0 -1
  216. package/lib/scene-manager-4ea4e330.js +0 -2
  217. package/lib/scene-manager-4ea4e330.js.map +0 -1
  218. package/lib/scene-manager-804c99cd.nomodule.js +0 -2
  219. package/lib/scene-manager-804c99cd.nomodule.js.map +0 -1
  220. package/lib/static/AddButtonRound-8004fa7dffdf7501.glb +0 -0
  221. package/lib/static/ConfiguratorKernel-4ca6a302619d4901.js +0 -1
  222. package/lib/static/ConfiguratorKernel-4ca6a302619d4901.js.map +0 -1
  223. package/lib/static/ConfiguratorKernel-6713e1de96ef978c.wasm +0 -0
  224. package/lib/static/ConfiguratorKernelJs-48f878d7e377be5f.mem +0 -0
  225. package/lib/static/ConfiguratorKernelJs-df7e5e8c447ce141.js +0 -143
  226. package/lib/static/PhotoStudioRoom-5b94763849f82256.glb +0 -0
  227. package/lib/static/RoomleCore-0b27042fad1c1d39.js +0 -1
  228. package/lib/static/RoomleCore-0b27042fad1c1d39.js.map +0 -1
  229. package/lib/static/RoomleCore-e855c1668e7e1763.wasm +0 -0
  230. package/lib/static/RoomleCoreJs-582f2f94cdd9aadc.js +0 -151
  231. package/lib/static/RoomleCoreJs-fe17a5f3a30cab74.mem +0 -0
  232. package/lib/static/USM-config-gltf-ad488aada649b7a5.glb +0 -0
  233. package/lib/static/shaders-88ef4c916f20da62.json +0 -1
@@ -0,0 +1,2 @@
1
+ System.register(["./rapi-access-6a614458.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js"],(function(e){var n,t,a,s;return{setters:[function(e){n=e._,t=e.i,a=e.ai},function(e){s=e.g}],execute:function(){e("default",(()=>{class e extends a{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(s()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new THREE.Vector3),n=this._bounds.getCenter(new THREE.Vector3).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.03;this._banana.scale.copy(new THREE.Vector3(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}return n([t],e.prototype,"_staticItemLoader",void 0),e})())}}}));
2
+ //# sourceMappingURL=banana-for-scale-95bb0a36.nomodule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"banana-for-scale-8bd9d916.nomodule.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"0rBAAe"}
1
+ {"version":3,"file":"banana-for-scale-95bb0a36.nomodule.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"uTAAe"}
@@ -0,0 +1,2 @@
1
+ import{_ as __decorate,i as inject,ai as ScenePluginDefaultImplementation}from"./rapi-access-21338f5f.js";import{g as getAssetPath}from"./main-thread-to-worker-5447c1c5.js";let BananaForScale=(()=>{class e extends ScenePluginDefaultImplementation{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(getAssetPath()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new THREE.Vector3),a=this._bounds.getCenter(new THREE.Vector3).clone();a.x-=e.x/2+.18,a.z+=e.z/2+.05,a.y=0;let t=.03;this._banana.scale.copy(new THREE.Vector3(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(a)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,a){super.clearScene(e,a),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}return __decorate([inject],e.prototype,"_staticItemLoader",void 0),e})();export default BananaForScale;
2
+ //# sourceMappingURL=banana-for-scale-c62bb269.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"banana-for-scale-4405de18.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"ulBAAe"}
1
+ {"version":3,"file":"banana-for-scale-c62bb269.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"+TAAe"}
@@ -1,2 +1,2 @@
1
- System.register(["./rapi-access-c0f4bbd9.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js"],(function(e){var i,t;return{setters:[function(e){i=e._,t=e.i},function(){}],execute:function(){const n="component_dimensioning_line_material",s="component_dimensioning_plane_material",o="component_dimensioning_text_material";e("default",(()=>{class e extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(n)?this._lineMaterial=this._cacheHolder.materialCache.get(n):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(n,this._lineMaterial)),this._cacheHolder.materialCache.has(s)?this._planeMaterial=this._cacheHolder.materialCache.get(s):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(s,this._planeMaterial)),this._cacheHolder.materialCache.has(o)?this._textMaterial=this._cacheHolder.materialCache.get(o):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(o,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let d=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(d),this._addXEdgeSideLines(d)),1===this._dimensioning.type.value&&(i=this._getYEdge(d),this._addYEdgeSideLines(d)),2===this._dimensioning.type.value&&(i=this._getZEdge(d),this._addZEdgeSideLines(d)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}return i([t],e.prototype,"_cacheHolder",void 0),i([t],e.prototype,"_unitFormatter",void 0),e})())}}}));
2
- //# sourceMappingURL=component-dimensioning-c4aed0a4.nomodule.js.map
1
+ System.register(["./rapi-access-6a614458.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js"],(function(e){var i,t;return{setters:[function(e){i=e._,t=e.i},function(){}],execute:function(){const n="component_dimensioning_line_material",s="component_dimensioning_plane_material",o="component_dimensioning_text_material";e("default",(()=>{class e extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(n)?this._lineMaterial=this._cacheHolder.materialCache.get(n):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(n,this._lineMaterial)),this._cacheHolder.materialCache.has(s)?this._planeMaterial=this._cacheHolder.materialCache.get(s):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(s,this._planeMaterial)),this._cacheHolder.materialCache.has(o)?this._textMaterial=this._cacheHolder.materialCache.get(o):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(o,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let r=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(r),this._addXEdgeSideLines(r)),1===this._dimensioning.type.value&&(i=this._getYEdge(r),this._addYEdgeSideLines(r)),2===this._dimensioning.type.value&&(i=this._getZEdge(r),this._addZEdgeSideLines(r)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}return i([t],e.prototype,"_cacheHolder",void 0),i([t],e.prototype,"_unitFormatter",void 0),e})())}}}));
2
+ //# sourceMappingURL=component-dimensioning-032b19a5.nomodule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-dimensioning-032b19a5.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{_ as __decorate,i as inject}from"./rapi-access-5951f7d6.js";import"./main-thread-to-worker-5447c1c5.js";const LINE_MATERIAL="component_dimensioning_line_material",PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";let ComponentDimensioning=(()=>{class e extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(LINE_MATERIAL)?this._lineMaterial=this._cacheHolder.materialCache.get(LINE_MATERIAL):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(LINE_MATERIAL,this._lineMaterial)),this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let r=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(r),this._addXEdgeSideLines(r)),1===this._dimensioning.type.value&&(i=this._getYEdge(r),this._addYEdgeSideLines(r)),2===this._dimensioning.type.value&&(i=this._getZEdge(r),this._addZEdgeSideLines(r)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}return __decorate([inject],e.prototype,"_cacheHolder",void 0),__decorate([inject],e.prototype,"_unitFormatter",void 0),e})();export default ComponentDimensioning;
2
- //# sourceMappingURL=component-dimensioning-27d53ffd.js.map
1
+ import{_ as __decorate,i as inject}from"./rapi-access-21338f5f.js";import"./main-thread-to-worker-5447c1c5.js";const LINE_MATERIAL="component_dimensioning_line_material",PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";let ComponentDimensioning=(()=>{class e extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(LINE_MATERIAL)?this._lineMaterial=this._cacheHolder.materialCache.get(LINE_MATERIAL):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(LINE_MATERIAL,this._lineMaterial)),this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let r=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(r),this._addXEdgeSideLines(r)),1===this._dimensioning.type.value&&(i=this._getYEdge(r),this._addYEdgeSideLines(r)),2===this._dimensioning.type.value&&(i=this._getZEdge(r),this._addZEdgeSideLines(r)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}return __decorate([inject],e.prototype,"_cacheHolder",void 0),__decorate([inject],e.prototype,"_unitFormatter",void 0),e})();export default ComponentDimensioning;
2
+ //# sourceMappingURL=component-dimensioning-231c9af2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-dimensioning-231c9af2.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ System.register(["./rapi-access-6a614458.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js","./image-renderer-52bbd908.nomodule.js","./pixotron-c033394c.nomodule.js","./mesh-generator-106a6ce1.nomodule.js","./configurator-mesh-generator-a69ff1e4.nomodule.js","./default-light-setting-86b8760c.nomodule.js"],(function(e,t){var n,i,o,r,s,a,c,l,h,d,u,_,g,p,m,f,C,v,b,y,I,w,k,P,S,E,M,H,D,R,A,O,L,x,T,U,V,j,B,F,G,q,z,K,N,W,Q,J,X,$,Y,Z,ee,te,ne,ie,oe,re;return{setters:[function(e){n=e._,i=e.i,o=e.C,r=e.B,s=e.A,a=e.a,c=e.D,l=e.b,h=e.k,d=e.E,u=e.c,_=e.M,g=e.g,p=e.d,m=e.e,f=e.P,C=e.f,v=e.h,b=e.t,y=e.j,I=e.R,w=e.l,k=e.m,P=e.n,S=e.L,E=e.o,M=e.p,H=e.q,D=e.r,R=e.s},function(e){A=e.o,O=e.g,L=e.r,x=e.t},function(e){T=e.S,U=e.p,V=e.a,j=e.r,B=e.g,F=e.b,G=e.G,q=e.C},function(e){z=e.E,K=e.I,N=e.S,W=e.B,Q=e.a,J=e.F,X=e.C,$=e.b,Y=e.c,Z=e.P,ee=e.T,te=e.d,ne=e.M},function(e){ie=e.P},function(e){oe=e.C},function(e){re=e.D}],execute:function(){const se=function(e){return e.validRange&&"string"==typeof e.validRange.type},ae=function(e){return e.validValues&&e.validValues.length>0},ce=function(e){return"length"===e.unitType||"area"===e.unitType},le=function(e){return"Material"===e.type};let he={InchFeet:null,MM:null,CM:null},de={NoUnitString:null,LongUnitString:null,ShortUnitString:null},ue=(()=>{class e{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;he=e.Unit,de=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===he.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===he.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision),this._formatter=t}_initActualUnit(){const{unit:e}=this._initData;switch(e){case"cm":this._actualUnit=he.CM;break;case"mm":this._actualUnit=he.MM;break;case"inchfeet":this._actualUnit=he.InchFeet;break;default:this._actualUnit=he.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=de.NoUnitString;break;case"long":this._actualUnitStringType=de.LongUnitString;break;case"short":this._actualUnitStringType=de.ShortUnitString;break;default:this._actualUnitStringType=de.ShortUnitString}}_isFormatterReady(){return!!this._formatter||(console.warn("Formatter is not ready..."),!1)}formatAngleValueToUnitString(e,t){const n="Integer"===t.type?0:2;return e.toFixed(n)+"°"}parseAngleValueFromUnitString(e){return e.replace("°","").replace(/\s/g,"")}parseValue(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?e:"length"===t.unitType?this.parseMMValueFromUnitString(e,t.unitType):"angle"===t.unitType||"area"===t.unitType?this.parseAngleValueFromUnitString(e):e}formatValueToUnitString(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?"Integer"===t.type?e.toString():parseFloat(e.toString()).toFixed(2):"length"===t.unitType?this.formatMMValueToUnitString(e,t.unitType):"angle"===t.unitType?this.formatAngleValueToUnitString(e,t):"area"===t.unitType?this.formatSquareMMValueToUnitString(e):e}isParseableNumber(e){return this._isFormatterReady()?this._formatter.isParseableNumber(e):null}isParseableUnitString(e,t){return this._isFormatterReady()?"angle"===t.unitType?this._formatter.isParseableUnitString(this.parseAngleValueFromUnitString(e),this._actualUnit):this._formatter.isParseableUnitString(e,this._actualUnit):null}parseMMValueFromUnitString(e,t){return this._isFormatterReady()?"count"===t?parseFloat(e):this._formatter.parseMMValueFromUnitString(e,this._actualUnit):null}parseNumber(e){return this._isFormatterReady()?this._formatter.parseNumber(e):null}formatNumber(e,t=0){return this._isFormatterReady()?this._formatter.formatNumber(e,t):null}formatSquareMMValueToUnitString(e){return this._isFormatterReady()?this._formatter.formatSquareMMValueToUnitString(e,this._actualUnit):null}formatMMValueToUnitString(e,t){return this._isFormatterReady()?"count"===t?e.toString():this._formatter.formatMMValueToUnitString(e,this._actualUnit,this._actualUnitStringType):null}formatMMValueWithReqMaxLength(e,t){return this._isFormatterReady()?this._formatter.formatMMValueWithReqMaxLength(e,this._actualUnit,t):null}_formatParameterValue(e,t){return"length"===t?this.formatMMValueToUnitString(parseFloat(e)):"area"===t?this.formatSquareMMValueToUnitString(parseFloat(e)):e}formatPartListParameter(e){ce(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(ce(e)&&Array.isArray(e.validValues)&&e.validValues.forEach(({value:t},n)=>{e.validValues[n].label=this._formatParameterValue(t,e.unitType)}),e.valueLabel=this._formatParameterValue(e.value,e.unitType),le(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(se(e)){e.uiType="Range";const t=null!==e.validRange.valueFrom?e.validRange.valueFrom:Number.MIN_SAFE_INTEGER,n=null!==e.validRange.valueTo?e.validRange.valueTo:Number.MAX_SAFE_INTEGER;e.validRangeLabels={valueFrom:this._formatParameterValue(t.toString(),e.unitType),valueTo:this._formatParameterValue(n.toString(),e.unitType),type:e.validRange.type}}else ae(e)?(e.uiType="Options",function(e){return!!ae(e)&&Array.isArray(e.validValues)&&e.validValues.length>0&&"string"==typeof e.validValues[0].thumbnail}(e)&&(e.uiType="Thumbnails")):(console.error("Could not detect uiType of param"),e.uiType=null)}isInch(){return this._actualUnit===he.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}}return n([i],e.prototype,"_initData",void 0),e})();const _e=["material"];let ge=(()=>{class e extends o{constructor(e){super(e,1),this.externalMeshQueue=new ie,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{},r.addMeta("kernel_is_ready",{isWasm:this._useWASM}),s.kernelInstance?(this._kernelContainer=s.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){r.start("kernel_is_ready"),s.kernelInstance?setTimeout(()=>this.isReady(),0):(window.ConfiguratorKernel(this._kernelContainer),window.ConfiguratorKernel=null)}_loadError(){this._configuratorKernelAccessCallback.loadError()}selectedComponent(e){this._updateComponentDependencies(e)}uiRequestConfiguration(e){const t=this._kernelInstance.getSerializedConfiguration(e);a.finishOperation(1,t)}_updateComponentParameters(e){let t=this._kernelInstance.getComponentParameters(e);const n=this._kernelInstance.getComponent(e);this._configuratorKernelAccessCallback.updateParameters(t,n.parameterGroups,e,1)}selectionChange(e,t){let n=!1,i=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),i.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,i)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,i=!1,o=[];e&&e.forEach(e=>{let r=this._kernelInstance.getComponent(e);r.componentId=this._kernelInstance.getComponentId(e),r&&r.childIds&&r.childIds.length>0&&(n=!0),r.id===t&&(i=!0),o.push(r)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",i,n,o)}_updateCommonComponentDependencies(e){const{parameters:t,parameterGroups:n}=this._kernelInstance.getCommonPlanComponentParameters(this._utilityToLongArray(e));this._configuratorKernelAccessCallback.updateParameters(t,n,e,2)}_updateComponentChildren(e){const t=this._kernelInstance.getPlanComponentPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,1)}_updateComponentDependencies(e){this._updateComponentParameters(e),this._updateComponentChildren(e)}_updatePlanObjectParameters(e){let t,n=this._kernelInstance.getPlanObjectParameters(e);if(0===n.length){let i=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(i),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(i)}else this._configuratorContext.rootComponentParametersAsGlobal=!1,t=this._kernelInstance.getPlanObject(e);this._configuratorKernelAccessCallback.updateParameters(n,t.parameterGroups,e,0)}_enableRootComponentParametersAsGlobal(){this._configuratorContext.selectedRuntimeComponentId||(this._configuratorContext.rootComponentParametersAsGlobal=!0)}_updatePlanObjectChildren(e){const t=this._kernelInstance.getPlanObjectPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,0)}updatePlanObjectDependencies(e){this._updatePlanObjectParameters(e),this._updatePlanObjectChildren(e)}_updateConfigurationHasChildren(e,t=null){t||(t=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e)));const n=t.childIds.size?t.childIds.size():t.childIds.length;this._configuratorUiCallbacks.onConfigurationHasChildren(n>0)}dockComponent(e,t,n,i){const o=this._kernelInstance.getComponentId(n),r=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,i,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(o,i,r,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,i=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),o=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),a.finishOperation(3,[o,i])}webGlPreviewDockings(e,t){a.waitFor(4).then(({componentId:n})=>{t&&this.requestPlanComponentConstruction(n),this._kernelInstance.requestPreviewGeometry(n,e.planObjectId)}),e.lastPossibleChild&&e.lastPossibleChild.isComponent&&(this._kernelIo.setMeta({componentId:e.lastPossibleChild.id}),this._kernelInstance.loadPlainComponent(c,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(c,e.lastPossibleChild.configuration)}previewDockingsWithDrag(e,t){this._kernelInstance.requestPreviewGeometry(e,t)}loadConfiguration(e){this._initData.id?this._memoryManager.loadingConfiguration(this._initData.id):this._memoryManager.loadingConfigurationString(),this._memoryManager.shouldHardReset()?this._kernelInstance.clearAll():this._kernelInstance.clearScene(),this._kernelInstance.loadConfiguration(l,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,i,o,r){"string"==typeof i?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,o,r),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,i,o,r){"string"==typeof i?this._kernelInstance.setComponentParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,o,r),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,i,o,r){"string"==typeof i?this._kernelInstance.setPlanObjectParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,o,r)}_finishParameterChange(e,t,n){-1===_e.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}_calcPrice(){const e=new Map;if(this._initData.useRoomlePrice){let e=this._kernelInstance.getFullPartList();if(e&&e.fullList&&e.fullList.length){const t=e.fullList[0].currencySymbol,n=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0);this._configuratorUiCallbacks.onUpdatePrice(t,n)}}else if(this._initData.usePriceService){let t=this._kernelInstance.getFullPartList();if(t&&t.fullList&&t.fullList.length){const n=t.fullList.reduce((t,n)=>{const i=h(n);return i&&(e.set(i,n),t.push(i)),t},[]);return new Promise((i,o)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return o(new Error("prices are empty"));const r=A(n,"priceId");let s=0;return t.fullList.forEach(e=>{const t=h(e);if(!r.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:i}=r.get(t);e.price=n,e.currencySymbol=i,s+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,s),i({totalSum:s,partMap:e})},e=>{console.error(e),o(e)})})}}return Promise.resolve({totalSum:0,partMap:e})}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:i}=e,o=e.perMainComponent;let r;this.addUiDataToPartList(n,t);try{const e=await this._calcPrice();r=e.partMap}catch(e){console.error(e),r=new Map}const s=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{s||(e.price=null,e.currencySymbol=null);const t=h(e);if(!t)return;if(!r.has(t))return;const{price:n,currencySymbol:i}=r.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=i)};return n.forEach(a),o.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(a)}),{fullList:n,perMainComponent:o,originPart:i}}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),le(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let i=this._kernelInstance.getPlanObjectParameters,o=e;t&&(i=this._kernelInstance.getComponentParameters,o=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(i.apply(this._kernelInstance,[o]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),r.end("kernel_is_ready"),r.start("kernel_create_instance"),s.kernelInstance?this._kernelInstance=s.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,this._kernelContainer.registerConfiguratorCallback(this),r.end("kernel_create_instance");const{overrideCountry:e,locale:t}=this._globalInitData;e&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(e)),d.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:u}),this._kernelInstance.setEnvironmentVariable("language",t),this._unitFormatter.init(this._kernelContainer),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),s.planObjectId&&this.planObjectCreated(-1,s.planObjectId),this._kernelInstance.useEnvironmentGeometry(!0)}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,o){a.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:u(o)}),this._configuratorKernelCallbackListener.forEach(r=>r.configurationLoaded(e,t,n,i,o))}componentDefinitionLoaded(e,t){a.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),a.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=u(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}a.failOperation(4,new Error(n)),a.failOperation(2,new Error(n))}componentConfigurationUpdated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.componentConfigurationUpdated(e,t)),this._kernelInstance.requestDeltaPlanComponentConstruction(e)}setActiveGroupInView(e){this._kernelInstance.setActiveGroupInView(e)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n){this.updatePlanObjectDependencies(e);let i=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(i=>i.planObjectConfigurationUpdated(e,t,n));const o=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(o),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,i),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const i=new Promise((e,t)=>{n=e});let o;this.externalMeshQueue.push(i);try{o=await this._rapiAccess.getMesh(e,_,t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const i=await fetch(new Request(this._dataSyncer.requestAsset(o.url,!0))),r=await i.arrayBuffer();this._handleCortoMesh(r,e,t),n()}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),console.error(t),t}}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,i,!1)),i&&i>0&&this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentDocked(e,i,t,n))}Editor3dRootComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,i,!0))}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),r.end("ui_load_configuration"),this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}return n([i],e.prototype,"_unitFormatter",void 0),n([i],e.prototype,"_memoryManager",void 0),n([i],e.prototype,"_configuratorKernelAccessCallback",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_initData",void 0),n([i],e.prototype,"_globalInitData",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})();class pe{constructor(e){const{component:t,resetCamera:n,consecutive:i}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===i||i}}class me{constructor(e){const{component:t,preview:n,resetCamera:i,consecutive:o,type:r,forceRender:s}=e;this.component=t,this.preview=n,this.resetCamera=void 0===i||i,this.consecutive=void 0===o||o,this.type=r||0,this.forceRender=void 0!==s&&s}}let fe=(()=>{class e extends T{constructor(e,t,n,i){super(e,t,n,i),this._cameraMoving=!1,this._raycastHelper.addEventListener(3,()=>{this._clickOutside()},this),this._selectionHandler.addEventListener(0,({component:e,consecutive:t})=>{this.dispatchEvent(8,new me({component:e,consecutive:t})),this._inputManager.setDragEnabled(!0)},this),this._selectionHandler.addEventListener(1,({component:e,resetCamera:t})=>{this._selectionHandler.hasSelection()||this._inputManager.setDragEnabled(!1),this.dispatchEvent(9,new me({component:e,resetCamera:t}))},this),this._addInputListeners(this._inputManager)}_addInputListeners(e){e.addEventListener(7,e=>this._interaction(),this),e.addEventListener(8,e=>this._interaction(),this)}addComponentHandlers(e){this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.runtimeId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:2,roomleId:e.runtimeId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.runtimeId}),this._raycastHelper.enableDragIn(e.boundingBoxMesh))}_addComponentHandlers(e,t,n){t.userData.hasListener||(Object.assign(t.userData,n),t.addEventListener("select",()=>this.clickComponent(e)),t.addEventListener("hover_on",t=>this._hoverOn(e,t.attachment.type)),t.addEventListener("hover_off",t=>this._hoverOff(e,t.attachment.type)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)))}addPreviewHandlers(e){let t=e.boundingBoxMesh;t.userData.hasListener||(t.userData={hasListener:!0,priority:3,roomleId:e.runtimeId},t.addEventListener("select",()=>this._clickPreview(e)),t.addEventListener("hover_on",()=>this._hoverOnPreview(e)),t.addEventListener("hover_off",()=>this._hoverOffPreview(e)))}addPreviewLineHandlers(e){let t=e.boundingLineMesh;t.userData.hasListener||(t.userData={hasListener:!0,priority:4,roomleId:e.runtimeId},t.addEventListener("select",()=>this._clickPreviewLine(e)),t.addEventListener("hover_on",t=>this._hoverOnPreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_move",t=>this._hoverMovePreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_off",()=>this._hoverOffPreviewLine(e)))}_clickPreview(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new me({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new me({preview:e}))}clickComponent(e){this._debug&&e.runtimeId,this._selectionHandler.check(e)}_clickOutside(){this._selectionHandler.cancelSelection(),this.dispatchEvent(3),this._interaction()}_hoverOn(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOn(),this._interaction(),this.dispatchEvent(1,new me({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new me({component:e,type:t})),this._hoveredComponent=null)}_hoverOnPreview(e){e.hoverOn(),this._interaction(!0),this._hoveredPreview=e}_hoverOffPreview(e){e.hoverOff(),this._interaction(!0),this._hoveredPreview=null}_hoverOnPreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._draggedComponent||e.hoverOn(),this._interaction(),this._hoveredPreview=e}_hoverMovePreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._hoveredPreview=e,this._interaction(!0)}_updatePositionForPreviewLine(e,t){let n=t.object.parent.parent.worldToLocal(t.point);this._previewLineIntersection=n,e&&(this._draggedComponent?this._draggedComponent.visible=!0:e.updatePreviewPosition(n))}_hoverOffPreviewLine(e){this._draggedComponent||e.hoverOff(),this._interaction(),this._hoveredPreview=null,this._previewLineIntersection=null}_setDragComponentShadow(e){this._draggedComponent.traverse(t=>{if(t instanceof THREE.Mesh){const n=t;e&&void 0!==n.castShadowOld?(n.receiveShadow=n.receiveShadowOld,n.castShadow=n.castShadowOld):(n.receiveShadowOld=t.receiveShadow,n.castShadowOld=t.castShadow,n.receiveShadow=!1,n.castShadow=!1)}})}_dragStart(e){e&&(this._selectionHandler.isSelected(e)||this.isDragIn())&&(this._dragStartPosition=e.position.clone(),this._dragStartRotation=e.rotation.clone(),this._draggedComponent=e,this._setDragComponentShadow(!1),this.dispatchEvent(4,new me({component:e})),this._interaction())}_drag(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(e&&!this._draggedComponent&&(this._draggedComponent=e),this._previewLineIntersection){let e=this._hoveredPreview,t=e.getPositionForIntersectionPoint(this._previewLineIntersection),n=e.parent.localToWorld(t);this._draggedComponent.position.copy(this._draggedComponent.parent.worldToLocal(n)),this._draggedComponent.rotation.copy(e.docklineRotation),e.hideSelectionLine()}else e.parent?e.position.copy(e.parent.worldToLocal(t)):e.position.copy(t);this._hoveredPreview?e.visible=!1:e.visible=!0,this.dispatchEvent(5,new me({component:e})),this._interaction()}}_dragEnd(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(this._hoveredPreview)if(this._previewLineIntersection){let t=this._hoveredPreview,n=t.getPositionForIntersectionPoint(this._previewLineIntersection),i=t.parent.localToWorld(n);e.position.copy(e.parent.worldToLocal(i)),e.rotation.copy(t.docklineRotation)}else e.position.copy(t);else this._dragStartPosition&&this._dragStartRotation&&(e.position.copy(this._dragStartPosition),e.rotation.copy(this._dragStartRotation),this._dragStartPosition=null,this._dragStartRotation=null,this.addComponentHandlers(e));e.visible=!0,this._setDragComponentShadow(!0),this._draggedComponent=null,this._previewLineIntersection=null,this.dispatchEvent(6,new me({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new me({forceRender:e}))}hasSelection(){return this._selectionHandler.hasSelection()}update(e,t,n){this._raycastHelper.update(e,t,n)}isDragIn(){return this._dragIn}isDragging(){return null!=this._draggedComponent}setRootComponentId(e){this._raycastHelper.setRootComponentId(e)}cancelSelection(){this._selectionHandler.setSelectionMode("standard"),this._selectionHandler.cancelSelection()}setSelectionMode(e){this._selectionHandler.setSelectionMode(e)}getSelectionMode(){return this._selectionHandler.getSelectionMode()}getSelectedRuntimeComponentIds(){return this._selectionHandler.getSelectedRuntimeComponentIds()}setCameraMoving(e){e&&this._hoveredComponent&&this._hoverOff(this._hoveredComponent,0),this._cameraMoving=e}}return n([i],e.prototype,"_selectionHandler",void 0),e})();class Ce extends z{constructor(e){super(),this._uiIntersectionMask=0,this.floorEnvironment=!1,this._camera=e}updateToBounds(e,t,n){let i=new THREE.Vector3(-e.x/2,0,-e.z/2),o=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(i,o),this._clientWidth=t,this._clientHeight=n;let r=this._boundingBox.getSize(new THREE.Vector3);this._boxVertices=[],this._boxVertices.push(this._boundingBox.min),this._boxVertices.push(this._boundingBox.min.clone().add(new THREE.Vector3(r.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new THREE.Vector3(r.x,0,0)))}set canvasOffset(e){this._offset=e,this.calculateUIIntersection()}calculateUIIntersection(){let e=[];if(null==this._boundingBox||null==this._offset)return;let t=this._checkPaddings();t.bottom=this._clientHeight-t.bottom,t.right=this._clientWidth-t.right;let n=0;this.floorEnvironment?(e=["left","right","bottom"],n=11):(this._offset.left>0&&t.left<this._offset.left*this._clientWidth&&(e.push("left"),n|=8),this._offset.right<1&&t.right<(1-this._offset.right)*this._clientWidth&&(e.push("right"),n|=2),this._offset.bottom>0&&t.bottom<this._offset.bottom*this._clientHeight&&(e.push("bottom"),n|=1)),this._offset.top<1&&t.top<(1-this._offset.top)*this._clientHeight&&(e.push("top"),n|=4),n!==this._uiIntersectionMask&&(this.dispatchEvent(0,e),this._uiIntersectionMask=n)}_checkPaddings(){let e={left:this._clientWidth/2,top:this._clientHeight/2,right:this._clientWidth/2,bottom:this._clientHeight/2};return this._boxVertices.forEach(t=>{let n=g(t,this._camera,this._clientWidth,this._clientHeight);n.x<e.left&&(e.left=n.x),n.x>e.right&&(e.right=n.x),n.y<e.top&&(e.top=n.y),n.y>e.bottom&&(e.bottom=n.y)}),e}}let ve=(()=>{class e extends N{constructor(e,t){super(e,t,p.HSC,"3D"),this._configuratorViewModel.setListener(this),this._sceneEventHandler=new fe(this._creator_,this._scene,this._camera,this._configuratorInputManager),this._sceneEventHandler.addEventListener(0,({forceRender:e})=>{this._uiIntersectionHelper.calculateUIIntersection(),e&&this._renderEverything()},this),this._sceneEventHandler.addEventListener(1,({component:e,type:t})=>this._onHoverOn(e,t),this),this._sceneEventHandler.addEventListener(2,({component:e,type:t})=>this._onHoverOff(e,t),this),this._sceneEventHandler.addEventListener(3,()=>{this._configuratorUiCallbacks.onClickOutside(),this._cameraControl.unlock(),this._cancelDockings(!1,null,this._configuratorViewModel.hasPreviews(),!0,!1),this.cancelSelection(!0),this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentVisibility(this._sceneEventHandler,this._configuratorViewModel),this._requestRender()},this),this._sceneEventHandler.addEventListener(8,({component:e,consecutive:t})=>{this._configuratorViewModel.hasPreviews()&&this._cancelDockings(!1,null,this._configuratorViewModel.hasPreviews(),!0,!1),this._selectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(9,({component:e,resetCamera:t})=>{this._deselectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(4,({component:e})=>{"multiselect"===this._sceneEventHandler.getSelectionMode()&&this.cancelSelection(),this._requestDockingsPreviewWithDrag(e.runtimeId),this._cameraControl.lock(),this._requestRender()},this),this._sceneEventHandler.addEventListener(5,()=>{this._renderEverything()},this),this._sceneEventHandler.addEventListener(6,({component:e,preview:t})=>{if(t){let n=t;this._configuratorViewModel.isPreviewLine(n)?this._configuratorViewModel.dockComponentWithPosition(n,e):this._configuratorViewModel.isPreview(n)&&this._dockComponent(n),this._cancelDockings(!t,e,!0,!0)}else{let t=this._sceneEventHandler.isDragIn()?e:null;this._cancelDockings(this._sceneEventHandler.isDragIn(),t,!1,!0);const n=this._configuratorViewModel.getBoundingBox();this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))}this._cameraControl.unlock(),this._renderEverything()},this),this._sceneEventHandler.addEventListener(7,({preview:e})=>{this._configuratorViewModel.isPreview(e)&&(this._configuratorViewModel.isPreviewLine(e)?this._configuratorViewModel.dockComponentWithPosition(e):this._dockComponent(e),this._cancelDockings(!1,null,!this._configuratorViewModel.hasPreviews(),!1,!1),this.requestDockingsPreview(!1),this._requestRender())},this),this._cameraControl.addEventListener(0,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._sceneEventHandler.setCameraMoving(!0),this._pixotronUtil.movingCameraStarts(),this._requestRender()},this),this._cameraControl.addEventListener(1,()=>{this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentAndPreviewVisibility(this._sceneEventHandler,this._configuratorViewModel),this._requestRender()},this),this._cameraControl.addEventListener(2,()=>{this._sceneEventHandler.setCameraMoving(!1),this._pixotronUtil.movingCameraStops(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(5,({minZoom:e,maxZoom:t})=>{this._configuratorUiCallbacks.onZoomChange(e,t)},this),this._cameraControl.addEventListener(3,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(4,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(7,()=>{this._pluginSystem.moveCameraStart(this._camera.position)},this),this._cameraControl.addEventListener(8,()=>{this._pluginSystem.moveCameraEnd(this._camera.position)},this),d.isProduction||(window.__RML__DEBUG__.SceneHelper=this),this._initOptionalModules()}async _initOptionalModules(){const{transparentHighlighting:e}=this._initData;if(e){const{default:e}=await Promise.resolve().then((function(){return Pe}));this._componentRaycastHelper=new e,this._componentRaycastHelper.init(this._scene,this._camera)}}_showDockings(){}cancelDockings(){this._cancelDockings(!0,null,!0,!0,!1),this._renderEverything()}_cancelDockings(e,t,n,i,o=!0){e&&(this._sceneEventHandler.setDragIn(!1),this._configuratorViewModel.removeDockingComponent(),t&&this._scene.remove(t)),this._configuratorViewModel.removePreviews(),n&&o&&this._updateCameraToBounds(),i&&n&&this._configuratorUiCallbacks.onDockingsPreviewRemoved(),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}_onHoverOn(e,t){2!==t&&this._highlight(e),this._componentDimensioningHelper&&this._componentDimensioningHelper.add(e)&&this._renderEverything()}_onHoverOff(e,t){2!==t&&this._highlight(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&(this._componentDimensioningHelper.remove(e),this._renderEverything()),this._requestRender()}_highlight(e=null,t=[]){if(!this._shouldHighlight())return;this._pixotron&&((null==t?void 0:t.length)?this._pixotron.getHighLightPass().transparency=.8:this._pixotron.getHighLightPass().transparency=1,this._pixotron.getHighLightPass().needsUpdate=!0);const n=[],i=this._initData.meshSelection;e?i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh):t&&t.length||(t=this._sceneEventHandler.getSelectedRuntimeComponentIds()),this._configuratorViewModel.getComponentsForIds(t).forEach(e=>{e&&(i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh))}),this._pixotron&&this._pixotron.highlightObjects(n)}shouldClearShadowsAndAO(){return super.shouldClearShadowsAndAO()||!this._sceneEventHandler.isDragging()}resume(){super.resume(),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded()),this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._applySSR(),this._renderWithoutShadowsAndAO()})}_materialLoaded(){this._renderEverything(),this._applySSR(),this._environment instanceof W&&this._environment.update()}_applySSR(){this._initData.ssr&&this._pixotron&&this._configuratorViewModel.getComponent(this._configuratorContext.rootComponentId).traverse(e=>{e instanceof THREE.Mesh&&!e.material.ssrPass&&this._pixotron.fixMaterial(e)})}pause(){super.pause(),this._configuratorViewModel.materialQueue.unregisterCallback(),this._configuratorMeshGenerator.removeMaterialLoadedListener()}_setupScene(e){super._setupScene(e),this._uiIntersectionHelper=new Ce(this._camera),this._uiIntersectionHelper.canvasOffset=e,this._uiIntersectionHelper.addEventListener(0,e=>{this._configuratorUiCallbacks.onUiIntersectionChange(e)},this),this._configuratorMeshGenerator.maxAnisotropy=this._maxAnisotropy,this._configuratorMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()}),this._renderer.domElement.classList.add(p.HSC),this._domHelper.element.appendChild(this._renderer.domElement),this._configuratorInputManager.addEvents(this._renderer.domElement),this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(m.createDynamicLightSettingSource(null,f.CAMERA)):this._lightSetting=new re(this._scene),this._requestRender(),this._setEnvironment(new Q(this._scene,this._environment,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND))),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded())}sceneCleared(e){this._internalClearScene(e)}display(e){this._scene.add(e),this._sceneEventHandler.setRootComponentId(e.runtimeId),this._requestRender()}debugSceneGraph(e){this._configuratorViewModel.debugSceneGraph(e),this._printObjectGraph(this._scene,"")}debugScene(){return this._scene}_printObjectGraph(e,t){e.material&&e.material.opacity,e.type,e.id,e.runtimeId,e.children.length>0&&e.children.forEach(e=>{let n=t+" ";this._printObjectGraph(e,n)})}clearScene(){var e;this._getCameraControl().clear(),this._internalClearScene(!1),this._pixotronUtil&&this._pixotronUtil.lockAdapter(),null===(e=this._sceneEventHandler)||void 0===e||e.cancelSelection(),this._pluginSystem.clearScene(this._scene,this._uiScene)}planObjectConstructionDone(e){this._componentDimensioningHelper.reset(),this._componentDimensioningHelper.setCamera(this._camera)}_internalClearScene(e){this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type&&"Line"!==e.type||this._scene.remove(e)}),this._uiScene.children.forEach(e=>{this._uiScene.remove(e)}),this._configuratorViewModel.sceneCleared(),(e||this._memoryManager.shouldHardReset())&&(this._configuratorMeshGenerator.clear(),this._renderer.renderLists.dispose(),this._memoryManager.executedHardReset()),this._renderEverything()}async preparePerspectiveImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let n=this._camera.clone(),i=this._calculateBoundingBoxOfAllMeshes(0,t);this._lightSetting.removeFromScene();const o=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();o&&this._dimensionHelper.disableDimensions(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),U(n,i,-20,-30),this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(n.position),i=this._calculateBoundingBoxOfAllMeshes(0,t)),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const r=await V(this._scene,this._uiScene,n,i,e);return o?this._dimensionHelper.enableDimensions():t&&this._dimensionHelper.disableDimensions(),this._lightSetting.addToScene(),this._requestRender(),r}async renderImage(e){await this._externalMeshesAndMaterialsReady(),this._configuratorViewModel.getPreviews()&&this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let t=this._camera,n=null;e.useCurrentPerspective||(t=this._camera.clone(),n=this._calculateBoundingBoxOfAllMeshes());const i=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();i&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const o=await j(this._scene,t,n,this._pixotron,this._renderer);return i&&this._dimensionHelper.enableDimensions(),this._requestRender(),o}async preparePartImage(e,t){return new Promise((n,i)=>{this._configuratorViewModel.requestSubPartConstruction(e).then(async e=>{t.size||(t.size=256);let i=this._camera.clone(),o=B((new THREE.Box3).setFromObject(e));const r=new THREE.Scene;r.add(e);const s=await V(r,null,i,o,t);C(r),n(s)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._configuratorViewModel.getBoundingBox(),B(n,e)}async _externalMeshesAndMaterialsReady(){await this._kernelAccess.externalMeshQueue.finished(!0),await this._configuratorViewModel.materialQueue.finished(!0)}async prepareTopImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),this._dimensionHelper.enableTopDimensions()),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();let n=this._calculateBoundingBoxOfAllMeshes(.1,t);this._lightSetting.removeFromScene();let i=await F(this._scene,this._uiScene,n,e);return t&&this._dimensionHelper.disableTopDimensions(),this._lightSetting.addToScene(),this._requestRender(),i}enableDragIn(e){this._sceneEventHandler.setDragIn(!0,e),this._requestRender()}zoomToComponent(e){this._cameraControl.saveState(!1);let t=e.boundingBox.getSize(new THREE.Vector3),n=v(e),i=new THREE.Euler(0,n,0),o=e.getWorldPosition(new THREE.Vector3).clone().add(e.boundingBox.getCenter(new THREE.Vector3).applyEuler(i));const r=new THREE.Vector2;this._renderer.getSize(r),this._getCameraControl().zoomTo(t,r.width,r.height,i.y,b(15),o)}resetCamera(){this._cameraControl.hasSavedState()?this.resetCameraToState():this.resetCameraPositionToStart(!1)}resetCameraToState(){this._cameraControl.hasSavedState()&&this._cameraControl.resetToState()}resetCameraPositionToStart(e=!0){this._requestRender();const t=this._configuratorViewModel.getBoundingBox();t&&this._getCameraControl().reset(t,void 0,void 0,void 0,e)}_clearSelectionAndHovers(){this.cancelSelection(),this._configuratorViewModel.clearRootComponent()}resetPreviews(){this._configuratorViewModel.removePreviews(),this._requestRender()}changeOffset(e){this._camera.offset=e,this._uiIntersectionHelper&&(this._uiIntersectionHelper.canvasOffset=e)}updateCamera(e=!0){super.updateCamera(),this._updateCameraToBounds(null,e)}setCameraOffset(e){this._camera.offset&&(this._camera.offset=e,this._renderEverything())}getCameraOffset(){return JSON.parse(JSON.stringify(this._camera.offset))}_onKeyDown(e){super._onKeyDown(e),!e.key||"Escape"!==e.key&&"Esc"!==e.key||(this.cancelSelection(),e.preventDefault()),e.key&&e.key.includes("Shift")&&(this._getCameraControl().enablePanning(),e.preventDefault()),this._sceneEventHandler&&this._sceneEventHandler.hasSelection()&&e.key&&("Backspace"===e.key||"Delete"===e.key)&&(this.requestDeleteSelectedComponent(),e.preventDefault())}_onKeyUp(e){super._onKeyUp(e),e.key&&e.key.includes("Shift")&&(this._getCameraControl().disablePanning(),e.preventDefault())}cancelPreviousDockings(){this._cancelDockings(!0,null,!1,!1)}cancelSelection(e){(this._sceneEventHandler.hasSelection()||"standard"!==this._sceneEventHandler.getSelectionMode())&&this._cancelSelection(e)}_cancelSelection(e){this._sceneEventHandler.cancelSelection(),this._configuratorContext.selectionMode="standard",this._configuratorContext.selectedRuntimeComponentIds=[],this._configuratorViewModel.removePreviews(),e&&!this._initData.debug&&this.resetCameraToState(),this._kernelAccess.updatePlanObjectDependencies(this._configuratorContext.planObjectId),this._configuratorUiCallbacks.onSelectionCancel()}_selectComponent(e,t){this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds(),t||("standard"===this._sceneEventHandler.getSelectionMode()?this._onSelectedRuntimeComponentChange(e):this._onSelectedRuntimeComponentsChange(this._sceneEventHandler.getSelectedRuntimeComponentIds())),this._highlight(e),!this._initData.debug&&t&&this.zoomToComponent(e)}_deselectComponent(e,t){"standard"===this._sceneEventHandler.getSelectionMode()&&(this._cancelSelection(t),this._highlight()),"multiselect"===this._sceneEventHandler.getSelectionMode()&&(this._sceneEventHandler.hasSelection()?this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds():(this._cancelSelection(t),this._highlight())),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}getScreenXY(e){return g(e,this._camera,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight)}setSelectionMode(e){this._sceneEventHandler.setSelectionMode(e)}changeFloorMaterial(e){return this._environment&&this._environment instanceof J||(this._environment=new J(this._scene,this._environment,!0),this._uiIntersectionHelper.floorEnvironment=!0),this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),new Promise((t,n)=>{this._environment.changeFloorMaterial(e,this._maxAnisotropy).then(()=>{this._requestRender(),t()},n)})}exportGLB(){this._scriptLoader.fetch(G,{id:"gltf-exporter"}).then(()=>{let e=new THREE.GLTFExporter,t=[];this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type||t.push(e)}),e.parse(t,e=>{let t=document.createElement("a");const n=new Blob([e],{type:"model/gltf-binary"});t.href=URL.createObjectURL(n),t.download="scene.glb",t.style.display="none",document.body.appendChild(t),t.click()},{binary:!0,embedImages:!0,forceIndices:!0})})}zoomIn(e){this._getCameraControl().zoomIn(e),this._renderEverything()}zoomOut(e){this._getCameraControl().zoomOut(e),this._renderEverything()}async showDimensions(){await this._initDimensions(),this._dimensionHelper.enableDimensions(),this._dimensionHelper.onDimensionsVisibilityChanged(e=>{e&&this._renderEverything(),this._configuratorUiCallbacks.onDimensionsVisibilityChange(e)}),this._renderEverything()}async _initDimensions(){this._dimensionHelper||await t.import("./dimensioning-helper-c69b5012.nomodule.js").then(({default:e})=>{this._dimensionHelper=new e(this._creator_),this._pluginSystem.addPlugin(this._dimensionHelper)})}hideDimensions(){this._dimensionHelper&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._renderEverything()}async loadSceneSettings(e){await super.loadSceneSettings(e),this._uiIntersectionHelper.floorEnvironment=this._environment instanceof J}_updateCameraToBounds(e,t=!0){e||(e=this._configuratorViewModel.getBoundingBox()),e&&(this._getCameraControl().updateToBounds(e,!1,t),this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition())}requestDockingsPreview(e,t,n,i){i||(i=!1),e&&this.cancelPreviousDockings(),this.cancelSelection(),i&&this.enableDragIn(n),t&&(this._configuratorContext.lastPossibleChild=t),this._configuratorContext.requestPreviewsIsUserInitiated=e,this.resetPreviews(),this._kernelAccess.webGlPreviewDockings(this._configuratorContext,i),this._showDockings()}_requestDockingsPreviewWithDrag(e){this.cancelPreviousDockings(),this._configuratorContext.rootComponentId!==e&&(this.resetPreviews(),this._kernelAccess.previewDockingsWithDrag(e,this._configuratorContext.planObjectId),this._showDockings())}_dockComponent(e){const t=r.start("dock_component_"+e.childId);this._kernelAccess.dockComponent(e.parentId,e.parentDockId,e.childId,e.childDockId),this._configuratorContext.dockingRootComponentId=null,r.end(t)}_onSelectedRuntimeComponentsChange(e){this._kernelAccess.multiSelectionChange(e,this._configuratorContext.rootComponentId)}_onSelectedRuntimeComponentChange(e){let t=!1,n=null;e&&(t=e.runtimeId===this._configuratorContext.rootComponentId,n=e.runtimeId),this._kernelAccess.selectionChange(n,t),e&&this._kernelAccess.selectedComponent(e.runtimeId)}requestDeleteSelectedComponent(){const e=this._configuratorContext.selectedRuntimeComponentIds,t=this._configuratorContext.rootComponentId;if(Array.isArray(e)&&0!==e.length&&t&&-1===e.indexOf(t)){switch(this._configuratorContext.selectionMode){case"standard":this.resetCamera(),this._kernelAccess.requestDeleteComponent(this._configuratorContext.selectedRuntimeComponentId);break;case"multiselect":this.resetCamera(),this._kernelAccess.requestDeleteComponents(this._configuratorContext.selectedRuntimeComponentIds)}this._configuratorContext.selectedRuntimeComponentIds=[]}}componentUpdated(e,t){if(e.runtimeId===this._configuratorContext.rootComponentId){let t=new THREE.Vector3(e.position.x/1e3,e.position.z/1e3,e.position.y/-1e3);this._sceneEventHandler.update(null,t,null)}void 0===e.geometryChanged||e.geometryChanged?this._renderEverything():this._renderWithoutShadowsAndAO()}planObjectUpdated(e,t){const n=this._kernelAccess.kernelInstance.getSerializedConfiguration(this._configuratorContext.planObjectId);if(this._configuratorHistory.push(n),e.bounds){if(this._configuratorContext.planObjectId===e.id){const n=y(e.boxForMeasurement);this._updateBounds(n,t)}this._highlight(),this._requestRender()}}componentDeleted(e){-1===this._sceneEventHandler.getSelectedRuntimeComponentIds().indexOf(e.runtimeId)&&"multiselect"!==this._sceneEventHandler.getSelectionMode()||this.cancelSelection()}previewConstructionDone(e,t){const n=this._configuratorViewModel.getBoundingBoxWithPreviews();t||(this._cancelDockings(!0,null,!1,!1,!1),this._configuratorContext.requestPreviewsIsUserInitiated&&this._configuratorUiCallbacks.onNoDockingsAvailable());let i=!0;this._componentRaycastHelper&&(i=!this._componentRaycastHelper.areAllPreviewsVisible(this._configuratorViewModel)),this._configuratorContext.requestPreviewsIsUserInitiated&&i&&this._updateCameraToBounds(n),this._lightSetting&&this._lightSetting.needsBounds()&&(this._lightSetting.updateBounds(n),this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))),this._componentRaycastHelper&&this._componentRaycastHelper.checkPreviewVisibility(this._configuratorViewModel)}configurationLoaded(e,t){e&&t&&this._sceneEventHandler.isDragIn()?(e.position.copy(new THREE.Vector3(0,100,0)),this._scene.add(e),this._sceneEventHandler.addComponentDragInHandler(e),this._requestRender()):t||this._initData.debug||this.resetCamera(),this._pixotronUtil&&Promise.all([new Promise(e=>setTimeout(e,3e3)),this._configuratorViewModel.materialQueue.finished(!0)]).then(()=>{this._pixotronUtil.unLockAdapter()}),this._environment&&this._environment.reload()}addComponentHandlers(e){this._sceneEventHandler.addComponentHandlers(e)}addPreviewHandlers(e){this._sceneEventHandler.addPreviewHandlers(e)}addPreviewLineHandlers(e){this._sceneEventHandler.addPreviewLineHandlers(e)}_updateComponentPosition(){if(!this._configuratorUiCallbacks.onComponentPositionsUpdated)return;const e=[];this._configuratorViewModel.getComponents().forEach(t=>{if(!t.boundingBoxMesh)return;const n=(new THREE.Box3).setFromObject(t.boundingBoxMesh);let i=this._kernelAccess.kernelInstance.getComponent(t.runtimeId);const o=i.parameters||i.possibleChildren?["edit"]:[];e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"component",actions:o})}),this._configuratorViewModel.getPreviews().forEach(t=>{const n=(new THREE.Box3).setFromObject(t);e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"preview",actions:["add"]})}),this._configuratorUiCallbacks.onComponentPositionsUpdated(e)}_updateBounds(e,t=!1){super._updateBounds(e,t);let n=e.getSize(new THREE.Vector3);this._sceneEventHandler.hasSelection()||this._updateCameraToBounds(e,!1),this._sceneEventHandler.update(n,null,null),this._uiIntersectionHelper.updateToBounds(n,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._pixotron&&this._pixotron.getShadowPass().setShadowRecieverBBox(e),this._camera.updateProjectionMatrix()}async moveCamera(e){return this._getCameraControl().moveCamera(e)}selectComponent(e){if(!e)return;const t=this._configuratorViewModel.getComponents().find(t=>t.runtimeId===e);t?this._sceneEventHandler.clickComponent(t):console.warn('Can not select "'+e+'" because it was not found')}highlightParts(e){this._highlight(null,e),this._requestRender()}_shouldHighlight(){return this._kernelAccess.kernelInstance.getPlanComponentPossibleChildren(this._configuratorContext.rootComponentId).length>0}_getInputManager(){return this._configuratorInputManager}createCameraControl(e,t){this._componentFactory=I();const n=this._domHelper.getClientDimensions(),i=n.x,o=n.y;this._camera=this._componentFactory.createCamera(30,i/o,.1,20,t),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(5),this._camera.layers.enable(4),this._camera.position.copy(new THREE.Vector3(0,.5,5)),this._changeCameraControl(new X(this._creator_,this._configuratorInputManager,null,this._camera))}getBakedShadowParams(){return{enable:!0,shadowMapResolution:1024,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.8,darkness:.3,size:1.2,lightDirection:new THREE.Vector3(0,1,0),lightSolidAngle:40,yPosition:.006}}getBounds(){return this._configuratorViewModel.getBoundingBox()}getPixotronParams(){return{saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:100,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:1,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:50,side:THREE.FrontSide},outlineparams:{highlightColor:new THREE.Color(this._initData.colors.SELECTION),edgeStrength:1,transparency:1,edgeThickness:2}}}sceneChanged(){}_getCameraControl(){return this._cameraControl}}return n([i],e.prototype,"_configuratorInputManager",void 0),n([i],e.prototype,"_configuratorUiCallbacks",void 0),n([i],e.prototype,"_configuratorMeshGenerator",void 0),n([i],e.prototype,"_memoryManager",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_kernelAccess",void 0),n([i],e.prototype,"_componentDimensioningHelper",void 0),n([i],e.prototype,"_configuratorViewModel",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})();const be=new Map,ye=new Map;class Ie{static loadFont(e){if(ye.has(e))return new Promise(t=>{t(ye.get(e))});if(be.has(e))return new Promise((t,n)=>{be.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,i)=>{be.set(e,[{resolve:n,reject:i}]),t.load(O()+e,t=>{ye.set(e,t),Ie._resolveAll(e,t)})})}static _resolveAll(e,t){be.has(e)&&be.get(e).forEach(e=>e.resolve(t)),be.delete(e)}}e("A",Ie);let we=(()=>{class e{constructor(e){this._activeComponents=[],this._creator_=e}setCamera(e){this._camera=e}add(e){const n=this._kernelAccess.kernelInstance.getComponent(e.runtimeId);if(!n)return!1;const i=n.dimensionings;if(!i||0===i.length||this._camera.position.z<0)return!1;const o=y(n.boxForMeasurement),r={x:this._camera.position.x,y:this._camera.position.z};return t.import("./component-dimensioning-032b19a5.nomodule.js").then(t=>{Ie.loadFont("static/rubik_regular-75bd7bb699e9e39d.json").then(n=>{i.forEach(i=>{e.add(new t.default(w(i),o,n,r))})})}),this._activeComponents.push(e),!0}remove(e,n=!0){return new Promise(i=>{t.import("./component-dimensioning-032b19a5.nomodule.js").then(t=>{let o=[];e.children.forEach(e=>{e instanceof t.default&&o.push(e)}),o.forEach(t=>{e.remove(t),C(t)}),n&&L(this._activeComponents,e),i()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}clear(){}}return n([i],e.prototype,"_kernelAccess",void 0),e})();class ke{constructor(){this._nonTransparentComponent=null,this._raycaster=new THREE.Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=x(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=x(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,n=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,n))}_changeMaterialsOnSelect(e,t,n=!1){if(e.children.length>0&&e.children.forEach(i=>{const o=t&&e.id===t.id||n,r=!(i instanceof THREE.Mesh);this._changeMaterialsOnSelect(i,t,(!o||!r)&&o)}),t)e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),n||k(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial){const{opacity:t,transparent:n}=e.userData.oldMaterial;k(e,{opacity:t,transparent:n}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const n=(new THREE.Box3).setFromObject(e).getCenter(new THREE.Vector3),i=(new THREE.Vector3).subVectors(n,this._camera.position).normalize();this._raycaster.set(this._camera.position,i),this._raycaster.far=this._camera.position.distanceTo(n);const o=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||o.push(e))}),0===o.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const n=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(n.length>1)return;const i=n[0];this.isComponentVisible(i)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,i)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1})}}var Pe=Object.freeze({__proto__:null,default:ke});let Se=(()=>{class e{constructor(e){this._history=[],this._index=0,this._creator_=e}undo(){if(!this.canUndo())return null;this._index++;const[e]=this._history.slice(this._index);return this._index===this._history.length-1?this._configuratorUiCallbacks.onHistoryChange(!1,!0):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}redo(){if(!this.canRedo())return null;this._index--;const[e]=this._history.slice(this._index);return 0===this._index?this._configuratorUiCallbacks.onHistoryChange(!0,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}push(e){const[t]=this._history.slice(this._index);t!==e&&(this._history=this._history.slice(this._index),this._history.unshift(e),this._index=0,1===this._history.length?this._configuratorUiCallbacks.onHistoryChange(!1,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!1))}canUndo(){return this._index!==this._history.length-1}canRedo(){return 0!==this._index}getHistory(){return this._history}clearHistory(){this._history=[],this._index=0}}return n([i],e.prototype,"_configuratorUiCallbacks",void 0),e})();const Ee=[new P("kernel-access",ge),new P("logger",S),new P("rapi-access",E),new P("script-loader",$),new P("unit-formatter",ue),new P("camera-control-3d",X),new P("camera-control",Y),new P("configurator-input-manager",class extends K{},1),new P("data-syncer",M),new P("selection-handler",class extends z{constructor(){super(...arguments),this._selectionMode="standard",this._selectedComponents=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedComponents.size&&this._selectedComponents.forEach((e,t)=>{e.deselect(),this._selectedComponents.delete(t),this.dispatchEvent(1,new pe({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new pe({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new pe({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new pe({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new pe({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new pe({component:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedComponents.size>0}getSelectedRuntimeComponentIds(){let e=[];return this._selectedComponents.forEach(t=>e.push(t.runtimeId)),e}isSelected(e){return this._selectedComponents.has(e.runtimeId)}},1),new P("configurator-mesh-generator",oe),new P("configurator-ui-callbacks",q,1),new P("configurator-scene-manager",ve,1),new P("component-dimensioning-helper",we,1),new P("component-raycast-helper",ke,0),new P("configurator-history",Se,1)],Me=(e,t)=>e.sort||t.sort?e.sort?t.sort?e.sort-t.sort:-1:1:0,He=(e,t)=>e&&!t?1:!e&&t?-1:e&&t?e.localeCompare(t):0;let De=(()=>{class e{constructor(e){this._onInitDoneCollection=[],this._isKernelReady=!1,this._isWebGlReady=!1,this._isPreloadReady=!0,this._isLoadError=!1,this._isReloading=!1,this._needsSync=!1,this._creator_=e,this._configuratorKernelAccessCallback.addListener(this);const t=this._errorHandler;t.subscribe(0,e=>this._configuratorUiCallbacks.onErrorDueToOffline(e)),t.subscribe(1,e=>this._configuratorUiCallbacks.onError(e)),t.subscribe(2,(e,t)=>this._configuratorUiCallbacks.onContentProblem({rapiPath:e,ids:t,message:"Could not load the ids"}))}_isInitDone(){return this._isKernelReady&&this._isWebGlReady&&this._isPreloadReady}_checkInitDone(){this._isInitDone()&&(this._onInitDoneCollection.forEach(e=>e()),this._onInitDoneCollection=[])}_onInitDone(e){this._isInitDone()?e():this._onInitDoneCollection.push(e)}getScene(){return this._configuratorSceneManager.getScene()}updateScene(){this._configuratorSceneManager.updateScene()}_loadWebGlLib(e,t){this._threeLoader.fetch().then(()=>Promise.all(Z.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(this._loadingWebGlSuccess(e,t).bind(this),this.loadError.bind(this)),this.loadError.bind(this))}_loadingWebGlSuccess(e,t){return()=>{t&&this._configuratorSceneManager.changeOffset(t);const{initialFloorMaterial:e,dls:n,ls:i,stats:o}=this._initData,r=m.createDynamicLightSettingSource(n,i);o&&this.showStats(),this._enableHD(r),this._needsSync&&(this._needsSync=!1,this._kernelAccess.requestSync(l,this._configuratorContext.planObjectId));const s=[this._scriptLoader.fetch(ee,{id:"tween-js"})];e&&s.push(this._rapiAccess.getMaterial(e).then(e=>this._configuratorSceneManager.changeFloorMaterial(e))),Promise.all(s).then(this._webGlIsReady.bind(this),this.loadError.bind(this))}}_webGlIsReady(){this._isWebGlReady=!0,this._checkInitDone()}_initPromiseCallback(e,t){this._isInitDone()?e():this._isLoadError?t("_initPromiseCallback failed"):(this._onInitDone(()=>e()),this._rejectOnLoadError=t)}_notifyOnConfigurationReady(e){return async t=>{const n=await this._kernelAccess.addUiDataAndPriceToPartList(t.partList,t.hash);t.partList=n,e(t),this._configuratorUiCallbacks.onConfigurationReady(n,t.hash,t.rootComponentLabel)}}_notifyOnConfigurationLoadingError(e){return t=>{this._configuratorUiCallbacks.onConfigurationLoadError(),e(t)}}_loadItemOrConfigById(e,t){this._configuratorContext.lastLoadedRapiId=e,this._onLoadConfiguration(),this._preloadPackage(e),this._clearScene();const{offlineSync:n}=this._initData;if(n){const t=H(e);t&&this._dataSyncer.start(t)}return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(t=>{t&&t.configuration?this._loadConfiguration(t.configuration).then(e=>{const i=this._notifyOnConfigurationReady(n);t.label?this._notifyUiAboutNewItem(t,e.rootComponentLabel):this._notifyUiAboutNewConfiguration(t),i(e)},this._notifyOnConfigurationLoadingError(i).bind(this)):i(new Error("Could not load item or config with id "+e))},i)})}_shouldBroadcastToUi(e){return!(0===e&&this._configuratorContext.selectedRuntimeComponentId||1===e&&!this._configuratorContext.selectedRuntimeComponentId||2===e&&!this._configuratorContext.selectedRuntimeComponentIds.length)}_isCorrectResponse(e,t){if(0===e)return t===this._configuratorContext.planObjectId;if(1===e)return t===this._configuratorContext.selectedRuntimeComponentId;const n=t.length;if(n!==this._configuratorContext.selectedRuntimeComponentIds.length)return!1;for(let e=0;e<n;e++)if(t[e]!==this._configuratorContext.selectedRuntimeComponentIds[e])return!1;return!0}_onLoadConfiguration(){this._clearScene(),this._configuratorUiCallbacks.onLoadConfiguration()}_clearScene(){this._configuratorSceneManager&&this._configuratorSceneManager.clearScene()}_notifyUiAboutNewItem(e,t){this._rapiAccess.getCatalog(e.catalog).then(n=>this._configuratorUiCallbacks.onConfigurationLabelChange(n.name,e.label,t))}_notifyUiAboutNewConfiguration(e){Promise.all([this._rapiAccess.getCatalog(e.catalog),this._rapiAccess.getComponent(e.rootComponentId)]).then(([e,t])=>this._configuratorUiCallbacks.onConfigurationLabelChange(e.name,null,t.label))}_getMaterialGroups(e){const t=(e,t)=>{let n=Me(e,t);return 0!==n?n:(n=He(e.label,t.label),0!==n?n:He(e.id,t.id))},n=e=>(e.sort(t),e.forEach(e=>e.materials.sort(t)),e);if(e.validGroups.length>0)return new Promise((t,i)=>this._rapiAccess.getMaterialsByGroup(e.validGroups).then(e=>t(n(e)),i));const i=[];return e.validValues.forEach(e=>i.push(e.value)),new Promise((e,t)=>{this._rapiAccess.getMaterials(i).then(t=>{this._rapiAccess.combineMaterialsToGroups(t).then(t=>{e(n(t))})},t)})}_loadConfiguration(e){return this._kernelAccess.externalMeshQueue.clear(),new Promise((t,n)=>{const i=()=>{const{x:i,y:o}=this._domHelper.getClientDimensions();if(i<=0&&o<=0){let e="Size of canvas is 0/0! When using embedding set correct size or remove id to load in idle mode!";return console.error(e),n(e)}this.resumeKernelCallbacks(),r.start("ui_load_configuration");const s=[];if(this._initData.applyCurrentGlobalParameters){const e=this._configuratorContext.planObjectId,t=this._configuratorContext.rootComponentParametersAsGlobal;s.push(this._kernelAccess.getGlobalParameters(e,t))}Promise.all(s).then(([i])=>{const o=[a.waitFor(4),a.waitFor(2)];Promise.all(o).then(([e,[n,o,r,s]])=>{const a=[];i&&this._initData.applyCurrentGlobalParameters&&i.forEach(e=>a.push(this.setParameter(e,e.value,!0)));const c=this._rapiAccess.peekComponent(s);Promise.all(a).then(()=>{const n=[];a.length&&(n.push(this._kernelAccess.getPartList()),n.push(this._kernelAccess.getConfigurationHash(this._configuratorContext))),Promise.all(n).then(async n=>{const i=n&&n[0]?n[0]:o,s=n&&n[1]?n[1]:r,a=await this._kernelAccess.addUiDataAndPriceToPartList(i,s);let l=e.errors;const h=l?u(l):[];t({partList:a,hash:s,rootComponentLabel:c?c.label:"",errors:h})})})},n),this._kernelAccess.loadConfiguration(e)},n)};this._onInitDone(()=>i())})}_preLoadItemOrConfig(e,t){return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(n,i)})}_preloadPackage(e){this._isPreloadReady=!1;let t=null;t=D(e)?this._rapiAccess.getPreloadForItem.bind(this._rapiAccess):this._rapiAccess.getPreloadForConfiguration.bind(this._rapiAccess),r.start("rapi_preloads");const n=()=>{r.end("rapi_preloads");const t=r.getMeasure("rapi_preloads");if(Array.isArray(t)&&1===t.length){const n=t[0];this._configuratorUiCallbacks.onTrackTiming("Timing","RapiPreloads",Math.round(n.duration),{id:e})}};t(e).then(()=>{this._isPreloadReady=!0,this._checkInitDone(),n()},e=>{this._isPreloadReady=!0,this._checkInitDone(),console.error(e),n()})}_reloadConfiguration(e,t,n,i){return this._performLoadConfiguration(e).then(e=>{this._isReloading=!1,n(e)},e=>{this._isReloading=!1,i(e)})}_performLoadConfiguration(e){return this._onLoadConfiguration(),new Promise((t,n)=>{this._initData.preloadHint?this._preloadPackage(this._initData.preloadHint):console.warn("When loading a configuration string you have to supply a preloadHint to use fast loading!"),setTimeout(()=>{this._loadConfiguration(e).then(this._notifyOnConfigurationReady(t).bind(this),this._notifyOnConfigurationLoadingError(n).bind(this))},0)})}_changeHDGeometry(e){return new Promise((t,n)=>e===s.useHDGeometry?t():this._isReloading?n("Change of HD Geometry in progress"):(this._isReloading=!0,a.waitFor(3).then(([e,i])=>{this._reloadConfiguration(e,i,t,n)},n),s.useHDGeometry=e,void this._kernelAccess.changeUseOfHDGeometry(this._configuratorContext,s.useHDGeometry)))}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}init(e,t){this.setOverrides(t);const{preloadHint:n,offset:i,startTag:o}=this._initData;return this._domHelper.setDomElement(e),n?this._preloadPackage(n):console.warn("No preload hint! Therefore no preload during init!!"),o&&this.getTagById(o,{include:["items"]}).then(e=>this._configuratorUiCallbacks.onOpenTag(e),e=>console.error(e)),this._loadWebGlLib(e,i),new Promise(this._initPromiseCallback.bind(this))}cancelSelection(){this._configuratorSceneManager.cancelSelection()}enableHDGeometry(){return this._changeHDGeometry(!0)}disableHDGeometry(){return this._changeHDGeometry(!1)}changeOffset(e){this._configuratorSceneManager.changeOffset(e)}previewDockings(e,t,n){this._configuratorSceneManager.requestDockingsPreview(!0,e,t,n)}cancelDockings(){this._configuratorSceneManager.cancelDockings()}requestDeleteComponent(){this._configuratorSceneManager.requestDeleteSelectedComponent()}renderImage(e){return this._configuratorSceneManager.renderImage(e)}preparePerspectiveImage(e={}){return this._configuratorSceneManager.preparePerspectiveImage(e)}preparePartImage(e,t){let n={};return"number"==typeof t?n.size=t:(t||(t={}),"number"!=typeof t.size&&(t.size=256),n=t),this._configuratorSceneManager.preparePartImage(e,n)}saveCurrentConfiguration(){return new Promise((e,t)=>{this._kernelAccess.getConfigurationData(this._configuratorContext.planObjectId).then(n=>{this._rapiAccess.saveConfiguration(n).then(n=>{this._configuratorUiCallbacks.onConfigurationSaved(n.configurationHash),this._rapiAccess.getComponent(n.rootComponentId).then(i=>{let o=!0,r=!0,s=n.perspectiveImage,a=n.topImage;n.perspectiveImage||(o=!1,this._configuratorSceneManager.preparePerspectiveImage().then(c=>{this._rapiAccess.savePerspectiveImage(n,c).then(t=>{o=!0,s=t.perspectiveImage,r&&(t.label=i.label,t.topImage=a,e(t))},t)})),n.topImage||(r=!1,this._configuratorSceneManager.prepareTopImage().then(c=>{this._rapiAccess.saveTopImage(n,c).then(t=>{r=!0,a=t.topImage,o&&(t.label=i.label,t.perspectiveImage=s,e(t))},t)})),o&&r&&(n.label=i.label,e(n))},e=>{throw new Error(e)})},t)}).catch(t)})}generateImagesOfCurrentConfiguration(){return new Promise((e,t)=>this.saveCurrentConfiguration().then(t=>e({topImage:t.topImage,perspectiveImage:t.perspectiveImage,isLocally:t.isLocally}),t))}prepareTopImage(e){let t={};return"boolean"==typeof e?t.showDimensions=e:(e||(e={}),"boolean"!=typeof e.showDimensions&&(e.showDimensions=!1),t=e),this._configuratorSceneManager.prepareTopImage(t)}resetCameraPosition(){this._configuratorSceneManager.resetCameraPositionToStart()}showBenchmarks(e){r.showBenchmarks(e)}debugSceneGraph(e){this._configuratorSceneManager.debugSceneGraph(e)}async loadConfiguration(e,t){this.setOverrides(t),this._configuratorContext.lastLoadedRapiId=null,this._configuratorSceneManager&&this._configuratorSceneManager.clearScene();const n=await this._performLoadConfiguration(e);return this._rapiAccess.trackView("configuration string"),n}async loadConfigurationById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!0);return this._rapiAccess.trackView(e),n}syncPlanObjectToView(e,t){this.resumeKernelCallbacks(),this._kernelAccess.requestSync(e,t),this._kernelAccess.requestPlanObjectConstruction(t);const n=this._kernelAccess.getSerializedConfiguration(t),i=this._kernelAccess.getCurrentConfigurationHash(t);this._kernelAccess.planObjectConfigurationUpdated(t,n,i),this._configuratorSceneManager.resetCameraPositionToStart(!1)}async loadConfigurableItemById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!1);return this._rapiAccess.trackView(e),n}preLoadConfigurationById(e){return this._preLoadItemOrConfig(e,!0)}preLoadConfigurableItemById(e){return this._preLoadItemOrConfig(e,!1)}_getTag(e){return this._rapiAccess.getTag(e)}_dispatchSetParameter(e,t,n,i,o){const s=this._configuratorContext.selectedRuntimeComponentId?"local":"global",a=r.start("kernel_change_param_"+s+"_"+e);switch(this._configuratorContext.selectionMode){case"standard":if(this._configuratorContext.selectedRuntimeComponentId||this._configuratorContext.rootComponentParametersAsGlobal){let r=this._configuratorContext.selectedRuntimeComponentId?this._configuratorContext.selectedRuntimeComponentId:this._configuratorContext.rootComponentId;this._kernelAccess.changeComponentParameter(r,e,t,n,i,o)}else this._kernelAccess.changePlanObjectParameter(this._configuratorContext.planObjectId,e,t,n,i,o);break;case"multiselect":this._kernelAccess.changeCommonComponentParameter(this._configuratorContext.selectedRuntimeComponentIds,e,t,n,i,o)}r.end(a)}setParameter(e,t,n=!1){return new Promise((i,o)=>{const{key:r,type:s}=e;if(se(e)){if(!n&&!this._unitFormatter.isParseableUnitString(t,e))return o(new SyntaxError('Value "'+t+'" is not parseable'));const i=n?t:this._unitFormatter.parseValue(t,e),{valueFrom:r,valueTo:a}=e.validRange,c=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(r)&&i<r-c)return o(new RangeError('Value "'+t+'" is too small, min-val "'+r+'"'));if(!Number.isNaN(a)&&i>a+c)return o(new RangeError('Value "'+t+'" is too big, max-val "'+a+'"'));t="Integer"===s&&"number"==typeof i?i.toFixed():i.toString()}this._configuratorSceneManager.cancelDockings(),this._dispatchSetParameter(r,s,t,i,o)})}setParameterOfPlanObject(e,t){return new Promise((n,i)=>{const{planObjectId:o,rootComponentId:r,rootComponentParametersAsGlobal:s}=this._configuratorContext,{type:a,key:c}=e;s?this._kernelAccess.changeComponentParameter(r,c,a,t,n,i):this._kernelAccess.changePlanObjectParameter(o,c,a,t,n,i)})}getParametersOfPlanObject(){const{planObjectId:e,rootComponentParametersAsGlobal:t}=this._configuratorContext;return this._kernelAccess.getGlobalParameters(e,t)}setParameterOfRootComponent(e,t){return new Promise((n,i)=>{const{rootComponentId:o}=this._configuratorContext,{type:r,key:s}=e;this._kernelAccess.changeComponentParameter(o,s,r,t,n,i)})}getParametersOfRootComponent(){const{planObjectId:e}=this._configuratorContext;return this._kernelAccess.getGlobalParameters(e,!0)}enableMultiselect(){this._configuratorSceneManager.setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._configuratorSceneManager.setSelectionMode("standard"),this._configuratorContext.selectionMode="standard"}getCurrentConfiguration(){return a.waitFor(1,()=>this._kernelAccess.uiRequestConfiguration(this._configuratorContext.planObjectId))}loadComponentIntoKernel(e){return a.waitFor(0,()=>{let t=null;try{if(t=JSON.parse(e).id,!t)throw new Error("Component string has no ID")}catch(e){return this._configuratorUiCallbacks.onContentProblem({rapiPath:"components",ids:[t],message:"Component string is not a valid JSON or has no ID"}),void a.failOperation(0,e)}this._kernelIo.setMeta({componentId:t}),this._kernelAccess.loadComponentIntoKernel(e,t)})}getShortUrlOfCurrentConfiguration(){return new Promise((e,t)=>{this.saveCurrentConfiguration().then(n=>navigator.onLine?this._rapiAccess.getShortUrl(n.id,3).then(t=>{const n=t.shortId,i=d.APP.SHORTENER_URL+n;e(i)},t):t("Can not generate short url when offline"),t)})}formatValueToUnitString(e,t){return this._unitFormatter.formatValueToUnitString(e,t)}getTagById(e,t){return new Promise((n,i)=>{this._getTag(e).then(e=>{let o=Promise.resolve([]),r=Promise.resolve([]);t&&t.include&&t.include.forEach(t=>{"materials"===t&&(o=this._rapiAccess.getMaterialsOf(e)),"items"===t&&(r=this._rapiAccess.getItems(e.items))}),Promise.all([o,r]).then(([t,i])=>(i.sort(Me),t.sort(Me),n({...e,items:i,materials:t})),i)},i)})}requestAsset(e){return this._dataSyncer.requestAsset(e)}changeFloorMaterial(e){return this._configuratorSceneManager.changeFloorMaterial(e)}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._configuratorSceneManager.changeFloorMaterial(t)}openFloorMaterials(){this._configuratorUiCallbacks.onOpenFloorMaterials()}openPartList(){this._configuratorUiCallbacks.onOpenPartList()}getAdditionalContentsOf(e){return this._rapiAccess.getAdditionalContentsOfItems(e)}changeTypeChangeTag(e){navigator.onLine&&this._initData.offlineSync&&this._dataSyncer.syncTypeChangeTag(e),this._configuratorUiCallbacks.onChangeTypeChangeTag(e)}removeTypeChangeTag(e){this._configuratorUiCallbacks.onRemoveTypeChangeTag(e)}showGUI(){this._configuratorSceneManager.showGUI()}showStats(){this._configuratorSceneManager.showStats()}showDimensions(){this._configuratorSceneManager.showDimensions()}hideDimensions(){this._configuratorSceneManager.hideDimensions()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}syncFloorTag(e){return this._dataSyncer.syncFloorTag(e)}syncTypeChangeTag(e){return this._dataSyncer.syncTypeChangeTag(e)}loadDynamicLightSetting(e){return this._configuratorSceneManager.loadDynamicLightSetting(e)}setBackgroundColor(e){this._configuratorSceneManager.setBackgroundColor(e)}setBackgroundImage(e){this._configuratorSceneManager.setBackgroundImage(e)}setBakedShadow(e,t){this._configuratorSceneManager.setBakedShadow(e,t)}loadSceneSetting(e){return this._configuratorSceneManager.loadSceneSettings(e)}enableMeshSelection(e){this._initData.meshSelection=e}updateSize(){this._configuratorSceneManager.updateCamera()}setCameraOffset(e){this._configuratorSceneManager.setCameraOffset(e)}getCameraOffset(){return this._configuratorSceneManager.getCameraOffset()}getMain(){}cleanup(e={}){this._configuratorContext.selectedRuntimeComponentIds=[],this._kernelAccess.cleanUpCallbacks(),this._configuratorSceneManager.sceneCleared(!!e.resetMeshCache),e.resetCoreCache&&this._kernelAccess.kernelInstance.clearAll(),e.resetApiCache&&this._rapiAccess.cleanUp()}resumeTest(e){e&&this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}zoomIn(e){this._configuratorSceneManager.zoomIn(e)}zoomOut(e){this._configuratorSceneManager.zoomOut(e)}get callbacks(){return this._configuratorUiCallbacks}get globalCallbacks(){return this._globalCallback}getRuntimeComponentIdOfRootComponent(){const e=this._configuratorContext.planObjectId;return e?this._kernelAccess.getRuntimeComponentIdOfRootComponent(e):(console.warn("planObjectId not set"),0)}getCurrentConfigurationHash(){return this._kernelAccess.getConfigurationHash(this._configuratorContext)}getCurrentSelection(){let e=this._configuratorContext.selectedRuntimeComponentIds;return e&&e.length||(e=[this._configuratorContext.rootComponentId]),e.map(e=>this._kernelAccess.getRuntimeComponentId(e))}_enableHD(e){return new Promise((t,n)=>{this._scriptLoader.fetch(te,{id:"pi-js"}).then(()=>{this._configuratorSceneManager.enableHD(e),t()},n)})}isReady(){const e=r.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=r.getMeta("kernel_is_ready");this._configuratorUiCallbacks.onTrackTiming("Timing","KernelIsReady",Math.round(t.duration),Object.assign(n,{startTime:t.startTime}))}this._isKernelReady=!0,this._checkInitDone(),"function"==typeof this._configuratorUiCallbacks.onKernelIsReady&&this._configuratorUiCallbacks.onKernelIsReady()}updatePossibleChildren(e,t,n){const i=[],o=[];let r;const s=new Map,a=new Map;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n.possible)continue;let c=n.itemId;n.itemId?(o.push(n.itemId),a.set(n.itemId,n)):(i.push(n.componentId),s.set(n.componentId,n),c=n.componentId),n.isDefault&&!r&&(r=c)}Promise.all([this._rapiAccess.getComponents(i),this._rapiAccess.getItems(o)]).then(e=>{const t=[],n=e[0],i=e[1];let o;for(let e=0,i=n.length;e<i;e++){const i=n[e];i.isItem=!1,i.isComponent=!0;const a=s.get(i.id);a&&(i.group=a.group),i.id===r&&(i.isDefault=!0,o=i),t.push(i)}for(let e=0,n=i.length;e<n;e++){const n=i[e];n.isItem=!0,n.isComponent=!1;const s=a.get(n.id);s&&(n.group=s.group),n.id===r&&(n.isDefault=!0,o=n),t.push(n)}return t.sort(Me),{possibleChildren:t,defaultChild:o||null}}).then(({possibleChildren:e,defaultChild:t})=>{const n=[],i=new Map,o=[];for(let t=0,r=e.length;t<r;t++){const r=e[t],s=r.tags;if(r.tags&&Array.isArray(r.tags)&&r.tags.length)for(let e=0,t=r.tags.length;e<t;e++){const t=s[e];-1===n.indexOf(t)&&n.push(t);let o=i.get(t);if(!o){const e=[];i.set(t,e),o=i.get(t)}o.push(r)}else o.push(r)}return{tagIds:n,associations:i,defaultChild:t,noTagChilds:o}}).then(({tagIds:t,associations:i,defaultChild:o,noTagChilds:r})=>{this._rapiAccess.getTags(t).then(t=>{if(this._isCorrectResponse(n,e)&&this._shouldBroadcastToUi(n)){for(let e=0,n=t.length;e<n;e++){const n=t[e];n.possibleChildren=i.get(n.id)}t.sort(Me),r.length&&t.unshift({id:"",externalIdentifier:"",global:!1,created:(new Date).toISOString(),updated:(new Date).toISOString(),language:this._globalInitData.locale,catalog:null,tags:[],parents:[],materials:[],items:[],possibleChildren:r}),this._configuratorUiCallbacks.onUpdatePossibleChildren(t,o)}},e=>{console.error("Couldnt load tags of possible children"),console.error(e)})},e=>console.error(e))}updateParameters(e,t,n,i){const o={};t||(t=[],console.warn("Kernel returned no parameter groups! Check why!")),t.forEach(e=>{o[e.key]=e}),e.sort(Me),e.forEach(e=>{e.group?e.grouping=o[e.group]:e.grouping=null,this._unitFormatter.formatParameter(e),le(e)&&Object.defineProperty(e,"groups",{get:()=>new Promise((t,o)=>{this._getMaterialGroups(e).then(e=>{this._isCorrectResponse(i,n)&&this._shouldBroadcastToUi(i)?t(e):o("Response does not match to ids")},o)})})}),this._shouldBroadcastToUi(i)&&this._configuratorUiCallbacks.onUpdateParameters(e)}loadError(e){this._isLoadError=!0,this._rejectOnLoadError&&this._rejectOnLoadError(e)}resumeKernelCallbacks(){this._kernelAccess.muteKernelCallbacks=!1,this._kernelAccess.resume()}pauseKernelCallbacks(){this._kernelAccess.muteKernelCallbacks=!0,this._kernelAccess.pause()}setActiveGroupInView(e){this._kernelAccess.setActiveGroupInView(e)}getParameterGroups(){return this._kernelAccess.getParameterGroups()}async getConfiguratorSettings(e){return this._rapiAccess.getConfiguratorSettings(e)}async moveCamera(e){return this._configuratorSceneManager.moveCamera(e)}selectComponent(e){return this._configuratorContext.selectedRuntimeComponentId===e?Promise.resolve():Promise.resolve(this._configuratorSceneManager.selectComponent(e))}setComponentParameter(e,t,n){const{key:i,type:o}=t;return new Promise((t,r)=>this._kernelAccess.changeComponentParameter(e,i,o,n,t,r))}highlightParts(e){this._configuratorSceneManager.highlightParts(e)}undo(){const e=this._configuratorHistory.undo();e&&this._kernelAccess.loadConfiguration(e)}redo(){const e=this._configuratorHistory.redo();e&&this._kernelAccess.loadConfiguration(e)}clearHistory(){this._configuratorHistory.clearHistory()}getHashOfSerializedConfiguration(e){return this._kernelAccess.kernelInstance.getHashOfSerializedConfiguration(e)}}return n([i],e.prototype,"_rapiAccess",void 0),n([i],e.prototype,"_dataSyncer",void 0),n([i],e.prototype,"_errorHandler",void 0),n([i],e.prototype,"_unitFormatter",void 0),n([i],e.prototype,"_domHelper",void 0),n([i],e.prototype,"_configuratorUiCallbacks",void 0),n([i],e.prototype,"_configuratorKernelAccessCallback",void 0),n([i],e.prototype,"_lifeCycleManager",void 0),n([i],e.prototype,"_kernelAccess",void 0),n([i],e.prototype,"_threeLoader",void 0),n([i],e.prototype,"_scriptLoader",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_configuratorSceneManager",void 0),n([i],e.prototype,"_initData",void 0),n([i],e.prototype,"_globalInitData",void 0),n([i],e.prototype,"_globalCallback",void 0),n([i],e.prototype,"_kernelIo",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})();class Re extends ne{setupDependencies(){R.setup(Ee),this.lookup("kernel-access",this._context),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),t=this.lookup("rapi-access"),n=(this.lookup("dom-helper"),this.lookup("configurator-scene-manager"));e&&e.cleanUp(),t&&t.cleanUp(),n&&n.cleanUp()}setupGlobals(e){const{kernelInstance:t,kernelContainer:n,planObjectId:i}=e||{};s.init({kernelInstance:t,kernelContainer:n,planObjectId:i})}getApi(){return this._configurator}bootFinished(){this._configurator=new De(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}e("C",Re),e("c",Object.freeze({__proto__:null,Configurator:Re}))}}}));
2
+ //# sourceMappingURL=configurator-08e58911.nomodule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurator-08e58911.nomodule.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular.json"],"sourcesContent":["export default \"static/rubik_regular-75bd7bb699e9e39d.json\""],"names":[],"mappings":"k0uDAAe"}
@@ -0,0 +1,2 @@
1
+ import{_ as __decorate,i as inject,C as CommonKernelAccess,B as Benchmark,A as AppContext,a as AsyncHelper,D as DOCKING_CONVERSATION_ID,b as DEFAULT_CONVERSATION_ID,k as kernelPartToPriceId,E as Env,c as convertCObject,M as MESH_DEFAULT_FORMAT,g as getScreenXY,d as CANVAS_ID,e as DynamicLightSettingLoader,P as PREDEFINED_LIGHTSETTING,f as dispose,h as getYRotationOfObject,t as toRadiant,j as kernelBoxToThreeBox,R as RoomleComponentFactoryInitializer,l as kernelDimensioningToThree,m as transitionTransparencyOfMaterial,n as DependencyInjectionAssignment,L as Logger,o as RapiAccess,p as DataSyncer,q as getCatalogIdFromItemOrConfigurationId,r as isIdItemId,s as RoomleDependencyInjection}from"./rapi-access-21338f5f.js";import{o as objectArrayToMap,g as getAssetPath,r as removeItem,t as throttle}from"./main-thread-to-worker-5447c1c5.js";import{S as SceneEventHandler,p as placeCameraForPerspectiveImage,a as preparePerspectiveImage,r as renderPerspectiveImage,g as getCameraTargetForBBox,b as prepareTopImage,G as GLTF_EXPORTER_FILE_NAME,C as ConfiguratorUiCallbacks}from"./image-renderer-757a6907.js";import{E as EventDispatcher,I as InputManager,S as SceneManager,B as BakedShadowEnvironment,a as BackgroundEnvironment,F as FloorEnvironment,C as CameraControl3D,b as ScriptLoader,c as CameraControl,P as PIXOTRON_EFFETCS,T as TWEEN_FILE_NAME,d as PIXOTRON_FILE_NAME,M as Main}from"./pixotron-76665c10.js";import{P as PromiseQueue}from"./mesh-generator-df801dc9.js";import{C as ConfiguratorMeshGenerator}from"./configurator-mesh-generator-ed7f42a4.js";import{D as DefaultLightSetting}from"./default-light-setting-88521da5.js";const isRange=function(e){return e.validRange&&"string"==typeof e.validRange.type},isOptions=function(e){return e.validValues&&e.validValues.length>0},hasUnits=function(e){return"length"===e.unitType||"area"===e.unitType},isMaterial=function(e){return"Material"===e.type};let KERNEL_UNIT={InchFeet:null,MM:null,CM:null},KERNEL_UNIT_STRING_TYPE={NoUnitString:null,LongUnitString:null,ShortUnitString:null},UnitFormatter=(()=>{class e{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;KERNEL_UNIT=e.Unit,KERNEL_UNIT_STRING_TYPE=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===KERNEL_UNIT.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===KERNEL_UNIT.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=KERNEL_UNIT.CM;break;case"mm":this._actualUnit=KERNEL_UNIT.MM;break;case"inchfeet":this._actualUnit=KERNEL_UNIT.InchFeet;break;default:this._actualUnit=KERNEL_UNIT.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.NoUnitString;break;case"long":this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.LongUnitString;break;case"short":this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.ShortUnitString;break;default:this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.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){hasUnits(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(hasUnits(e)&&Array.isArray(e.validValues)&&e.validValues.forEach(({value:t},n)=>{e.validValues[n].label=this._formatParameterValue(t,e.unitType)}),e.valueLabel=this._formatParameterValue(e.value,e.unitType),isMaterial(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(isRange(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 isOptions(e)?(e.uiType="Options",function(e){return!!isOptions(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===KERNEL_UNIT.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}}return __decorate([inject],e.prototype,"_initData",void 0),e})();const ASYNC_PARAMTER_CHANGES=["material"];let KernelAccess=(()=>{class e extends CommonKernelAccess{constructor(e){super(e,1),this.externalMeshQueue=new PromiseQueue,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{},Benchmark.addMeta("kernel_is_ready",{isWasm:this._useWASM}),AppContext.kernelInstance?(this._kernelContainer=AppContext.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){Benchmark.start("kernel_is_ready"),AppContext.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);AsyncHelper.finishOperation(1,t)}_updateComponentParameters(e){let t=this._kernelInstance.getComponentParameters(e);const n=this._kernelInstance.getComponent(e);this._configuratorKernelAccessCallback.updateParameters(t,n.parameterGroups,e,1)}selectionChange(e,t){let n=!1,i=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),i.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,i)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,i=!1,o=[];e&&e.forEach(e=>{let r=this._kernelInstance.getComponent(e);r.componentId=this._kernelInstance.getComponentId(e),r&&r.childIds&&r.childIds.length>0&&(n=!0),r.id===t&&(i=!0),o.push(r)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",i,n,o)}_updateCommonComponentDependencies(e){const{parameters:t,parameterGroups:n}=this._kernelInstance.getCommonPlanComponentParameters(this._utilityToLongArray(e));this._configuratorKernelAccessCallback.updateParameters(t,n,e,2)}_updateComponentChildren(e){const t=this._kernelInstance.getPlanComponentPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,1)}_updateComponentDependencies(e){this._updateComponentParameters(e),this._updateComponentChildren(e)}_updatePlanObjectParameters(e){let t,n=this._kernelInstance.getPlanObjectParameters(e);if(0===n.length){let i=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(i),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(i)}else this._configuratorContext.rootComponentParametersAsGlobal=!1,t=this._kernelInstance.getPlanObject(e);this._configuratorKernelAccessCallback.updateParameters(n,t.parameterGroups,e,0)}_enableRootComponentParametersAsGlobal(){this._configuratorContext.selectedRuntimeComponentId||(this._configuratorContext.rootComponentParametersAsGlobal=!0)}_updatePlanObjectChildren(e){const t=this._kernelInstance.getPlanObjectPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,0)}updatePlanObjectDependencies(e){this._updatePlanObjectParameters(e),this._updatePlanObjectChildren(e)}_updateConfigurationHasChildren(e,t=null){t||(t=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e)));const n=t.childIds.size?t.childIds.size():t.childIds.length;this._configuratorUiCallbacks.onConfigurationHasChildren(n>0)}dockComponent(e,t,n,i){const o=this._kernelInstance.getComponentId(n),r=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,i,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(o,i,r,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,i=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),o=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),AsyncHelper.finishOperation(3,[o,i])}webGlPreviewDockings(e,t){AsyncHelper.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(DOCKING_CONVERSATION_ID,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(DOCKING_CONVERSATION_ID,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(DEFAULT_CONVERSATION_ID,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,i,o,r){"string"==typeof i?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,o,r),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,i,o,r){"string"==typeof i?this._kernelInstance.setComponentParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,o,r),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,i,o,r){"string"==typeof i?this._kernelInstance.setPlanObjectParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,o,r)}_finishParameterChange(e,t,n){-1===ASYNC_PARAMTER_CHANGES.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}_calcPrice(){const e=new Map;if(this._initData.useRoomlePrice){let e=this._kernelInstance.getFullPartList();if(e&&e.fullList&&e.fullList.length){const t=e.fullList[0].currencySymbol,n=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0);this._configuratorUiCallbacks.onUpdatePrice(t,n)}}else if(this._initData.usePriceService){let t=this._kernelInstance.getFullPartList();if(t&&t.fullList&&t.fullList.length){const n=t.fullList.reduce((t,n)=>{const i=kernelPartToPriceId(n);return i&&(e.set(i,n),t.push(i)),t},[]);return new Promise((i,o)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return o(new Error("prices are empty"));const r=objectArrayToMap(n,"priceId");let s=0;return t.fullList.forEach(e=>{const t=kernelPartToPriceId(e);if(!r.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:i}=r.get(t);e.price=n,e.currencySymbol=i,s+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,s),i({totalSum:s,partMap:e})},e=>{console.error(e),o(e)})})}}return Promise.resolve({totalSum:0,partMap:e})}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:i}=e,o=e.perMainComponent;let r;this.addUiDataToPartList(n,t);try{const e=await this._calcPrice();r=e.partMap}catch(e){console.error(e),r=new Map}const s=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{s||(e.price=null,e.currencySymbol=null);const t=kernelPartToPriceId(e);if(!t)return;if(!r.has(t))return;const{price:n,currencySymbol:i}=r.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=i)};return n.forEach(a),o.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(a)}),{fullList:n,perMainComponent:o,originPart:i}}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),isMaterial(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let i=this._kernelInstance.getPlanObjectParameters,o=e;t&&(i=this._kernelInstance.getComponentParameters,o=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(i.apply(this._kernelInstance,[o]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),Benchmark.end("kernel_is_ready"),Benchmark.start("kernel_create_instance"),AppContext.kernelInstance?this._kernelInstance=AppContext.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,this._kernelContainer.registerConfiguratorCallback(this),Benchmark.end("kernel_create_instance");const{overrideCountry:e,locale:t}=this._globalInitData;e&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(e)),Env.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject}),this._kernelInstance.setEnvironmentVariable("language",t),this._unitFormatter.init(this._kernelContainer),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),AppContext.planObjectId&&this.planObjectCreated(-1,AppContext.planObjectId),this._kernelInstance.useEnvironmentGeometry(!0)}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,o){AsyncHelper.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:convertCObject(o)}),this._configuratorKernelCallbackListener.forEach(r=>r.configurationLoaded(e,t,n,i,o))}componentDefinitionLoaded(e,t){AsyncHelper.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),AsyncHelper.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=convertCObject(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}AsyncHelper.failOperation(4,new Error(n)),AsyncHelper.failOperation(2,new Error(n))}componentConfigurationUpdated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.componentConfigurationUpdated(e,t)),this._kernelInstance.requestDeltaPlanComponentConstruction(e)}setActiveGroupInView(e){this._kernelInstance.setActiveGroupInView(e)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n){this.updatePlanObjectDependencies(e);let i=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(i=>i.planObjectConfigurationUpdated(e,t,n));const o=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(o),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,i),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const i=new Promise((e,t)=>{n=e});let o;this.externalMeshQueue.push(i);try{o=await this._rapiAccess.getMesh(e,MESH_DEFAULT_FORMAT,t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const i=await fetch(new Request(this._dataSyncer.requestAsset(o.url,!0))),r=await i.arrayBuffer();this._handleCortoMesh(r,e,t),n()}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),console.error(t),t}}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,i,!1)),i&&i>0&&this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentDocked(e,i,t,n))}Editor3dRootComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,i,!0))}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),Benchmark.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 __decorate([inject],e.prototype,"_unitFormatter",void 0),__decorate([inject],e.prototype,"_memoryManager",void 0),__decorate([inject],e.prototype,"_configuratorKernelAccessCallback",void 0),__decorate([inject],e.prototype,"_configuratorContext",void 0),__decorate([inject],e.prototype,"_initData",void 0),__decorate([inject],e.prototype,"_globalInitData",void 0),__decorate([inject],e.prototype,"_configuratorHistory",void 0),e})();class SelectionHandlerEvent{constructor(e){const{component:t,resetCamera:n,consecutive:i}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===i||i}}class SceneEventInfo{constructor(e){const{component:t,preview:n,resetCamera:i,consecutive:o,type:r,forceRender:s}=e;this.component=t,this.preview=n,this.resetCamera=void 0===i||i,this.consecutive=void 0===o||o,this.type=r||0,this.forceRender=void 0!==s&&s}}let ConfiguratorSceneEventHandler=(()=>{class e extends SceneEventHandler{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 SceneEventInfo({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 SceneEventInfo({component:e,resetCamera:t}))},this),this._addInputListeners(this._inputManager)}_addInputListeners(e){e.addEventListener(7,e=>this._interaction(),this),e.addEventListener(8,e=>this._interaction(),this)}addComponentHandlers(e){this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.runtimeId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:2,roomleId:e.runtimeId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.runtimeId}),this._raycastHelper.enableDragIn(e.boundingBoxMesh))}_addComponentHandlers(e,t,n){t.userData.hasListener||(Object.assign(t.userData,n),t.addEventListener("select",()=>this.clickComponent(e)),t.addEventListener("hover_on",t=>this._hoverOn(e,t.attachment.type)),t.addEventListener("hover_off",t=>this._hoverOff(e,t.attachment.type)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)))}addPreviewHandlers(e){let t=e.boundingBoxMesh;t.userData.hasListener||(t.userData={hasListener:!0,priority:3,roomleId:e.runtimeId},t.addEventListener("select",()=>this._clickPreview(e)),t.addEventListener("hover_on",()=>this._hoverOnPreview(e)),t.addEventListener("hover_off",()=>this._hoverOffPreview(e)))}addPreviewLineHandlers(e){let t=e.boundingLineMesh;t.userData.hasListener||(t.userData={hasListener:!0,priority:4,roomleId:e.runtimeId},t.addEventListener("select",()=>this._clickPreviewLine(e)),t.addEventListener("hover_on",t=>this._hoverOnPreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_move",t=>this._hoverMovePreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_off",()=>this._hoverOffPreviewLine(e)))}_clickPreview(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new SceneEventInfo({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new SceneEventInfo({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 SceneEventInfo({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new SceneEventInfo({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 SceneEventInfo({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 SceneEventInfo({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 SceneEventInfo({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new SceneEventInfo({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 __decorate([inject],e.prototype,"_selectionHandler",void 0),e})();class UiIntersectionHelper extends EventDispatcher{constructor(e){super(),this._uiIntersectionMask=0,this.floorEnvironment=!1,this._camera=e}updateToBounds(e,t,n){let i=new THREE.Vector3(-e.x/2,0,-e.z/2),o=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(i,o),this._clientWidth=t,this._clientHeight=n;let r=this._boundingBox.getSize(new THREE.Vector3);this._boxVertices=[],this._boxVertices.push(this._boundingBox.min),this._boxVertices.push(this._boundingBox.min.clone().add(new THREE.Vector3(r.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new THREE.Vector3(r.x,0,0)))}set canvasOffset(e){this._offset=e,this.calculateUIIntersection()}calculateUIIntersection(){let e=[];if(null==this._boundingBox||null==this._offset)return;let t=this._checkPaddings();t.bottom=this._clientHeight-t.bottom,t.right=this._clientWidth-t.right;let n=0;this.floorEnvironment?(e=["left","right","bottom"],n=11):(this._offset.left>0&&t.left<this._offset.left*this._clientWidth&&(e.push("left"),n|=8),this._offset.right<1&&t.right<(1-this._offset.right)*this._clientWidth&&(e.push("right"),n|=2),this._offset.bottom>0&&t.bottom<this._offset.bottom*this._clientHeight&&(e.push("bottom"),n|=1)),this._offset.top<1&&t.top<(1-this._offset.top)*this._clientHeight&&(e.push("top"),n|=4),n!==this._uiIntersectionMask&&(this.dispatchEvent(0,e),this._uiIntersectionMask=n)}_checkPaddings(){let e={left:this._clientWidth/2,top:this._clientHeight/2,right:this._clientWidth/2,bottom:this._clientHeight/2};return this._boxVertices.forEach(t=>{let n=getScreenXY(t,this._camera,this._clientWidth,this._clientHeight);n.x<e.left&&(e.left=n.x),n.x>e.right&&(e.right=n.x),n.y<e.top&&(e.top=n.y),n.y>e.bottom&&(e.bottom=n.y)}),e}}let ConfiguratorSceneManager=(()=>{class e extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.HSC,"3D"),this._configuratorViewModel.setListener(this),this._sceneEventHandler=new ConfiguratorSceneEventHandler(this._creator_,this._scene,this._camera,this._configuratorInputManager),this._sceneEventHandler.addEventListener(0,({forceRender:e})=>{this._uiIntersectionHelper.calculateUIIntersection(),e&&this._renderEverything()},this),this._sceneEventHandler.addEventListener(1,({component:e,type:t})=>this._onHoverOn(e,t),this),this._sceneEventHandler.addEventListener(2,({component:e,type:t})=>this._onHoverOff(e,t),this),this._sceneEventHandler.addEventListener(3,()=>{this._configuratorUiCallbacks.onClickOutside(),this._cameraControl.unlock(),this._cancelDockings(!1,null,this._configuratorViewModel.hasPreviews(),!0,!1),this.cancelSelection(!0),this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentVisibility(this._sceneEventHandler,this._configuratorViewModel),this._requestRender()},this),this._sceneEventHandler.addEventListener(8,({component:e,consecutive:t})=>{this._configuratorViewModel.hasPreviews()&&this._cancelDockings(!1,null,this._configuratorViewModel.hasPreviews(),!0,!1),this._selectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(9,({component:e,resetCamera:t})=>{this._deselectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(4,({component:e})=>{"multiselect"===this._sceneEventHandler.getSelectionMode()&&this.cancelSelection(),this._requestDockingsPreviewWithDrag(e.runtimeId),this._cameraControl.lock(),this._requestRender()},this),this._sceneEventHandler.addEventListener(5,()=>{this._renderEverything()},this),this._sceneEventHandler.addEventListener(6,({component:e,preview:t})=>{if(t){let n=t;this._configuratorViewModel.isPreviewLine(n)?this._configuratorViewModel.dockComponentWithPosition(n,e):this._configuratorViewModel.isPreview(n)&&this._dockComponent(n),this._cancelDockings(!t,e,!0,!0)}else{let t=this._sceneEventHandler.isDragIn()?e:null;this._cancelDockings(this._sceneEventHandler.isDragIn(),t,!1,!0);const n=this._configuratorViewModel.getBoundingBox();this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))}this._cameraControl.unlock(),this._renderEverything()},this),this._sceneEventHandler.addEventListener(7,({preview:e})=>{this._configuratorViewModel.isPreview(e)&&(this._configuratorViewModel.isPreviewLine(e)?this._configuratorViewModel.dockComponentWithPosition(e):this._dockComponent(e),this._cancelDockings(!1,null,!this._configuratorViewModel.hasPreviews(),!1,!1),this.requestDockingsPreview(!1),this._requestRender())},this),this._cameraControl.addEventListener(0,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._sceneEventHandler.setCameraMoving(!0),this._pixotronUtil.movingCameraStarts(),this._requestRender()},this),this._cameraControl.addEventListener(1,()=>{this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentAndPreviewVisibility(this._sceneEventHandler,this._configuratorViewModel),this._requestRender()},this),this._cameraControl.addEventListener(2,()=>{this._sceneEventHandler.setCameraMoving(!1),this._pixotronUtil.movingCameraStops(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(5,({minZoom:e,maxZoom:t})=>{this._configuratorUiCallbacks.onZoomChange(e,t)},this),this._cameraControl.addEventListener(3,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(4,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(7,()=>{this._pluginSystem.moveCameraStart(this._camera.position)},this),this._cameraControl.addEventListener(8,()=>{this._pluginSystem.moveCameraEnd(this._camera.position)},this),Env.isProduction||(window.__RML__DEBUG__.SceneHelper=this),this._initOptionalModules()}async _initOptionalModules(){const{transparentHighlighting:e}=this._initData;if(e){const{default:e}=await Promise.resolve().then((function(){return componentRaycastHelper}));this._componentRaycastHelper=new e,this._componentRaycastHelper.init(this._scene,this._camera)}}_showDockings(){}cancelDockings(){this._cancelDockings(!0,null,!0,!0,!1),this._renderEverything()}_cancelDockings(e,t,n,i,o=!0){e&&(this._sceneEventHandler.setDragIn(!1),this._configuratorViewModel.removeDockingComponent(),t&&this._scene.remove(t)),this._configuratorViewModel.removePreviews(),n&&o&&this._updateCameraToBounds(),i&&n&&this._configuratorUiCallbacks.onDockingsPreviewRemoved(),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}_onHoverOn(e,t){2!==t&&this._highlight(e),this._componentDimensioningHelper&&this._componentDimensioningHelper.add(e)&&this._renderEverything()}_onHoverOff(e,t){2!==t&&this._highlight(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&(this._componentDimensioningHelper.remove(e),this._renderEverything()),this._requestRender()}_highlight(e=null,t=[]){if(!this._shouldHighlight())return;this._pixotron&&((null==t?void 0:t.length)?this._pixotron.getHighLightPass().transparency=.8:this._pixotron.getHighLightPass().transparency=1,this._pixotron.getHighLightPass().needsUpdate=!0);const n=[],i=this._initData.meshSelection;e?i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh):t&&t.length||(t=this._sceneEventHandler.getSelectedRuntimeComponentIds()),this._configuratorViewModel.getComponentsForIds(t).forEach(e=>{e&&(i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh))}),this._pixotron&&this._pixotron.highlightObjects(n)}shouldClearShadowsAndAO(){return super.shouldClearShadowsAndAO()||!this._sceneEventHandler.isDragging()}resume(){super.resume(),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded()),this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._applySSR(),this._renderWithoutShadowsAndAO()})}_materialLoaded(){this._renderEverything(),this._applySSR(),this._environment instanceof BakedShadowEnvironment&&this._environment.update()}_applySSR(){this._initData.ssr&&this._pixotron&&this._configuratorViewModel.getComponent(this._configuratorContext.rootComponentId).traverse(e=>{e instanceof THREE.Mesh&&!e.material.ssrPass&&this._pixotron.fixMaterial(e)})}pause(){super.pause(),this._configuratorViewModel.materialQueue.unregisterCallback(),this._configuratorMeshGenerator.removeMaterialLoadedListener()}_setupScene(e){super._setupScene(e),this._uiIntersectionHelper=new UiIntersectionHelper(this._camera),this._uiIntersectionHelper.canvasOffset=e,this._uiIntersectionHelper.addEventListener(0,e=>{this._configuratorUiCallbacks.onUiIntersectionChange(e)},this),this._configuratorMeshGenerator.maxAnisotropy=this._maxAnisotropy,this._configuratorMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()}),this._renderer.domElement.classList.add(CANVAS_ID.HSC),this._domHelper.element.appendChild(this._renderer.domElement),this._configuratorInputManager.addEvents(this._renderer.domElement),this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):this._lightSetting=new DefaultLightSetting(this._scene),this._requestRender(),this._setEnvironment(new BackgroundEnvironment(this._scene,this._environment,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND))),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded())}sceneCleared(e){this._internalClearScene(e)}display(e){this._scene.add(e),this._sceneEventHandler.setRootComponentId(e.runtimeId),this._requestRender()}debugSceneGraph(e){this._configuratorViewModel.debugSceneGraph(e),this._printObjectGraph(this._scene,"")}debugScene(){return this._scene}_printObjectGraph(e,t){e.material&&e.material.opacity,e.type,e.id,e.runtimeId,e.children.length>0&&e.children.forEach(e=>{let n=t+" ";this._printObjectGraph(e,n)})}clearScene(){var e;this._getCameraControl().clear(),this._internalClearScene(!1),this._pixotronUtil&&this._pixotronUtil.lockAdapter(),null===(e=this._sceneEventHandler)||void 0===e||e.cancelSelection(),this._pluginSystem.clearScene(this._scene,this._uiScene)}planObjectConstructionDone(e){this._componentDimensioningHelper.reset(),this._componentDimensioningHelper.setCamera(this._camera)}_internalClearScene(e){this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type&&"Line"!==e.type||this._scene.remove(e)}),this._uiScene.children.forEach(e=>{this._uiScene.remove(e)}),this._configuratorViewModel.sceneCleared(),(e||this._memoryManager.shouldHardReset())&&(this._configuratorMeshGenerator.clear(),this._renderer.renderLists.dispose(),this._memoryManager.executedHardReset()),this._renderEverything()}async preparePerspectiveImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let n=this._camera.clone(),i=this._calculateBoundingBoxOfAllMeshes(0,t);this._lightSetting.removeFromScene();const o=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();o&&this._dimensionHelper.disableDimensions(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),placeCameraForPerspectiveImage(n,i,-20,-30),this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(n.position),i=this._calculateBoundingBoxOfAllMeshes(0,t)),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const r=await preparePerspectiveImage(this._scene,this._uiScene,n,i,e);return o?this._dimensionHelper.enableDimensions():t&&this._dimensionHelper.disableDimensions(),this._lightSetting.addToScene(),this._requestRender(),r}async renderImage(e){await this._externalMeshesAndMaterialsReady(),this._configuratorViewModel.getPreviews()&&this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let t=this._camera,n=null;e.useCurrentPerspective||(t=this._camera.clone(),n=this._calculateBoundingBoxOfAllMeshes());const i=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();i&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const o=await renderPerspectiveImage(this._scene,t,n,this._pixotron,this._renderer);return i&&this._dimensionHelper.enableDimensions(),this._requestRender(),o}async preparePartImage(e,t){return new Promise((n,i)=>{this._configuratorViewModel.requestSubPartConstruction(e).then(async e=>{t.size||(t.size=256);let i=this._camera.clone(),o=getCameraTargetForBBox((new THREE.Box3).setFromObject(e));const r=new THREE.Scene;r.add(e);const s=await preparePerspectiveImage(r,null,i,o,t);dispose(r),n(s)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._configuratorViewModel.getBoundingBox(),getCameraTargetForBBox(n,e)}async _externalMeshesAndMaterialsReady(){await this._kernelAccess.externalMeshQueue.finished(!0),await this._configuratorViewModel.materialQueue.finished(!0)}async prepareTopImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),this._dimensionHelper.enableTopDimensions()),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();let n=this._calculateBoundingBoxOfAllMeshes(.1,t);this._lightSetting.removeFromScene();let i=await prepareTopImage(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=getYRotationOfObject(e),i=new THREE.Euler(0,n,0),o=e.getWorldPosition(new THREE.Vector3).clone().add(e.boundingBox.getCenter(new THREE.Vector3).applyEuler(i));const r=new THREE.Vector2;this._renderer.getSize(r),this._getCameraControl().zoomTo(t,r.width,r.height,i.y,toRadiant(15),o)}resetCamera(){this._cameraControl.hasSavedState()?this.resetCameraToState():this.resetCameraPositionToStart(!1)}resetCameraToState(){this._cameraControl.hasSavedState()&&this._cameraControl.resetToState()}resetCameraPositionToStart(e=!0){this._requestRender();const t=this._configuratorViewModel.getBoundingBox();t&&this._getCameraControl().reset(t,void 0,void 0,void 0,e)}_clearSelectionAndHovers(){this.cancelSelection(),this._configuratorViewModel.clearRootComponent()}resetPreviews(){this._configuratorViewModel.removePreviews(),this._requestRender()}changeOffset(e){this._camera.offset=e,this._uiIntersectionHelper&&(this._uiIntersectionHelper.canvasOffset=e)}updateCamera(e=!0){super.updateCamera(),this._updateCameraToBounds(null,e)}setCameraOffset(e){this._camera.offset&&(this._camera.offset=e,this._renderEverything())}getCameraOffset(){return JSON.parse(JSON.stringify(this._camera.offset))}_onKeyDown(e){super._onKeyDown(e),!e.key||"Escape"!==e.key&&"Esc"!==e.key||(this.cancelSelection(),e.preventDefault()),e.key&&e.key.includes("Shift")&&(this._getCameraControl().enablePanning(),e.preventDefault()),this._sceneEventHandler&&this._sceneEventHandler.hasSelection()&&e.key&&("Backspace"===e.key||"Delete"===e.key)&&(this.requestDeleteSelectedComponent(),e.preventDefault())}_onKeyUp(e){super._onKeyUp(e),e.key&&e.key.includes("Shift")&&(this._getCameraControl().disablePanning(),e.preventDefault())}cancelPreviousDockings(){this._cancelDockings(!0,null,!1,!1)}cancelSelection(e){(this._sceneEventHandler.hasSelection()||"standard"!==this._sceneEventHandler.getSelectionMode())&&this._cancelSelection(e)}_cancelSelection(e){this._sceneEventHandler.cancelSelection(),this._configuratorContext.selectionMode="standard",this._configuratorContext.selectedRuntimeComponentIds=[],this._configuratorViewModel.removePreviews(),e&&!this._initData.debug&&this.resetCameraToState(),this._kernelAccess.updatePlanObjectDependencies(this._configuratorContext.planObjectId),this._configuratorUiCallbacks.onSelectionCancel()}_selectComponent(e,t){this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds(),t||("standard"===this._sceneEventHandler.getSelectionMode()?this._onSelectedRuntimeComponentChange(e):this._onSelectedRuntimeComponentsChange(this._sceneEventHandler.getSelectedRuntimeComponentIds())),this._highlight(e),!this._initData.debug&&t&&this.zoomToComponent(e)}_deselectComponent(e,t){"standard"===this._sceneEventHandler.getSelectionMode()&&(this._cancelSelection(t),this._highlight()),"multiselect"===this._sceneEventHandler.getSelectionMode()&&(this._sceneEventHandler.hasSelection()?this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds():(this._cancelSelection(t),this._highlight())),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}getScreenXY(e){return getScreenXY(e,this._camera,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight)}setSelectionMode(e){this._sceneEventHandler.setSelectionMode(e)}changeFloorMaterial(e){return this._environment&&this._environment instanceof FloorEnvironment||(this._environment=new FloorEnvironment(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(GLTF_EXPORTER_FILE_NAME,{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 import("./dimensioning-helper-55aa9709.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 FloorEnvironment}_updateCameraToBounds(e,t=!0){e||(e=this._configuratorViewModel.getBoundingBox()),e&&(this._getCameraControl().updateToBounds(e,!1,t),this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition())}requestDockingsPreview(e,t,n,i){i||(i=!1),e&&this.cancelPreviousDockings(),this.cancelSelection(),i&&this.enableDragIn(n),t&&(this._configuratorContext.lastPossibleChild=t),this._configuratorContext.requestPreviewsIsUserInitiated=e,this.resetPreviews(),this._kernelAccess.webGlPreviewDockings(this._configuratorContext,i),this._showDockings()}_requestDockingsPreviewWithDrag(e){this.cancelPreviousDockings(),this._configuratorContext.rootComponentId!==e&&(this.resetPreviews(),this._kernelAccess.previewDockingsWithDrag(e,this._configuratorContext.planObjectId),this._showDockings())}_dockComponent(e){const t=Benchmark.start("dock_component_"+e.childId);this._kernelAccess.dockComponent(e.parentId,e.parentDockId,e.childId,e.childDockId),this._configuratorContext.dockingRootComponentId=null,Benchmark.end(t)}_onSelectedRuntimeComponentsChange(e){this._kernelAccess.multiSelectionChange(e,this._configuratorContext.rootComponentId)}_onSelectedRuntimeComponentChange(e){let t=!1,n=null;e&&(t=e.runtimeId===this._configuratorContext.rootComponentId,n=e.runtimeId),this._kernelAccess.selectionChange(n,t),e&&this._kernelAccess.selectedComponent(e.runtimeId)}requestDeleteSelectedComponent(){const e=this._configuratorContext.selectedRuntimeComponentIds,t=this._configuratorContext.rootComponentId;if(Array.isArray(e)&&0!==e.length&&t&&-1===e.indexOf(t)){switch(this._configuratorContext.selectionMode){case"standard":this.resetCamera(),this._kernelAccess.requestDeleteComponent(this._configuratorContext.selectedRuntimeComponentId);break;case"multiselect":this.resetCamera(),this._kernelAccess.requestDeleteComponents(this._configuratorContext.selectedRuntimeComponentIds)}this._configuratorContext.selectedRuntimeComponentIds=[]}}componentUpdated(e,t){if(e.runtimeId===this._configuratorContext.rootComponentId){let t=new THREE.Vector3(e.position.x/1e3,e.position.z/1e3,e.position.y/-1e3);this._sceneEventHandler.update(null,t,null)}void 0===e.geometryChanged||e.geometryChanged?this._renderEverything():this._renderWithoutShadowsAndAO()}planObjectUpdated(e,t){const n=this._kernelAccess.kernelInstance.getSerializedConfiguration(this._configuratorContext.planObjectId);if(this._configuratorHistory.push(n),e.bounds){if(this._configuratorContext.planObjectId===e.id){const n=kernelBoxToThreeBox(e.boxForMeasurement);this._updateBounds(n,t)}this._highlight(),this._requestRender()}}componentDeleted(e){-1===this._sceneEventHandler.getSelectedRuntimeComponentIds().indexOf(e.runtimeId)&&"multiselect"!==this._sceneEventHandler.getSelectionMode()||this.cancelSelection()}previewConstructionDone(e,t){const n=this._configuratorViewModel.getBoundingBoxWithPreviews();t||(this._cancelDockings(!0,null,!1,!1,!1),this._configuratorContext.requestPreviewsIsUserInitiated&&this._configuratorUiCallbacks.onNoDockingsAvailable());let i=!0;this._componentRaycastHelper&&(i=!this._componentRaycastHelper.areAllPreviewsVisible(this._configuratorViewModel)),this._configuratorContext.requestPreviewsIsUserInitiated&&i&&this._updateCameraToBounds(n),this._lightSetting&&this._lightSetting.needsBounds()&&(this._lightSetting.updateBounds(n),this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))),this._componentRaycastHelper&&this._componentRaycastHelper.checkPreviewVisibility(this._configuratorViewModel)}configurationLoaded(e,t){e&&t&&this._sceneEventHandler.isDragIn()?(e.position.copy(new THREE.Vector3(0,100,0)),this._scene.add(e),this._sceneEventHandler.addComponentDragInHandler(e),this._requestRender()):t||this._initData.debug||this.resetCamera(),this._pixotronUtil&&Promise.all([new Promise(e=>setTimeout(e,3e3)),this._configuratorViewModel.materialQueue.finished(!0)]).then(()=>{this._pixotronUtil.unLockAdapter()}),this._environment&&this._environment.reload()}addComponentHandlers(e){this._sceneEventHandler.addComponentHandlers(e)}addPreviewHandlers(e){this._sceneEventHandler.addPreviewHandlers(e)}addPreviewLineHandlers(e){this._sceneEventHandler.addPreviewLineHandlers(e)}_updateComponentPosition(){if(!this._configuratorUiCallbacks.onComponentPositionsUpdated)return;const e=[];this._configuratorViewModel.getComponents().forEach(t=>{if(!t.boundingBoxMesh)return;const n=(new THREE.Box3).setFromObject(t.boundingBoxMesh);let i=this._kernelAccess.kernelInstance.getComponent(t.runtimeId);const o=i.parameters||i.possibleChildren?["edit"]:[];e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"component",actions:o})}),this._configuratorViewModel.getPreviews().forEach(t=>{const n=(new THREE.Box3).setFromObject(t);e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"preview",actions:["add"]})}),this._configuratorUiCallbacks.onComponentPositionsUpdated(e)}_updateBounds(e,t=!1){super._updateBounds(e,t);let n=e.getSize(new THREE.Vector3);this._sceneEventHandler.hasSelection()||this._updateCameraToBounds(e,!1),this._sceneEventHandler.update(n,null,null),this._uiIntersectionHelper.updateToBounds(n,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._pixotron&&this._pixotron.getShadowPass().setShadowRecieverBBox(e),this._camera.updateProjectionMatrix()}async moveCamera(e){return this._getCameraControl().moveCamera(e)}selectComponent(e){if(!e)return;const t=this._configuratorViewModel.getComponents().find(t=>t.runtimeId===e);t?this._sceneEventHandler.clickComponent(t):console.warn('Can not select "'+e+'" because it was not found')}highlightParts(e){this._highlight(null,e),this._requestRender()}_shouldHighlight(){return this._kernelAccess.kernelInstance.getPlanComponentPossibleChildren(this._configuratorContext.rootComponentId).length>0}_getInputManager(){return this._configuratorInputManager}createCameraControl(e,t){this._componentFactory=RoomleComponentFactoryInitializer();const n=this._domHelper.getClientDimensions(),i=n.x,o=n.y;this._camera=this._componentFactory.createCamera(30,i/o,.1,20,t),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(5),this._camera.layers.enable(4),this._camera.position.copy(new THREE.Vector3(0,.5,5)),this._changeCameraControl(new CameraControl3D(this._creator_,this._configuratorInputManager,null,this._camera))}getBakedShadowParams(){return{enable:!0,shadowMapResolution:1024,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.8,darkness:.3,size:1.2,lightDirection:new THREE.Vector3(0,1,0),lightSolidAngle:40,yPosition:.006}}getBounds(){return this._configuratorViewModel.getBoundingBox()}getPixotronParams(){return{saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:100,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:1,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:50,side:THREE.FrontSide},outlineparams:{highlightColor:new THREE.Color(this._initData.colors.SELECTION),edgeStrength:1,transparency:1,edgeThickness:2}}}sceneChanged(){}_getCameraControl(){return this._cameraControl}}return __decorate([inject],e.prototype,"_configuratorInputManager",void 0),__decorate([inject],e.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],e.prototype,"_configuratorMeshGenerator",void 0),__decorate([inject],e.prototype,"_memoryManager",void 0),__decorate([inject],e.prototype,"_configuratorContext",void 0),__decorate([inject],e.prototype,"_kernelAccess",void 0),__decorate([inject],e.prototype,"_componentDimensioningHelper",void 0),__decorate([inject],e.prototype,"_configuratorViewModel",void 0),__decorate([inject],e.prototype,"_configuratorHistory",void 0),e})();const PROMISE_CALLBACKS=new Map,RESOURCES=new Map;class AsyncDependencyLoader{static loadFont(e){if(RESOURCES.has(e))return new Promise(t=>{t(RESOURCES.get(e))});if(PROMISE_CALLBACKS.has(e))return new Promise((t,n)=>{PROMISE_CALLBACKS.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,i)=>{PROMISE_CALLBACKS.set(e,[{resolve:n,reject:i}]),t.load(getAssetPath()+e,t=>{RESOURCES.set(e,t),AsyncDependencyLoader._resolveAll(e,t)})})}static _resolveAll(e,t){PROMISE_CALLBACKS.has(e)&&PROMISE_CALLBACKS.get(e).forEach(e=>e.resolve(t)),PROMISE_CALLBACKS.delete(e)}}let ComponentDimensioningHelper=(()=>{class e{constructor(e){this._activeComponents=[],this._creator_=e}setCamera(e){this._camera=e}add(e){const t=this._kernelAccess.kernelInstance.getComponent(e.runtimeId);if(!t)return!1;const n=t.dimensionings;if(!n||0===n.length||this._camera.position.z<0)return!1;const i=kernelBoxToThreeBox(t.boxForMeasurement),o={x:this._camera.position.x,y:this._camera.position.z};return import("./component-dimensioning-231c9af2.js").then(t=>{AsyncDependencyLoader.loadFont("static/rubik_regular-75bd7bb699e9e39d.json").then(r=>{n.forEach(n=>{e.add(new t.default(kernelDimensioningToThree(n),i,r,o))})})}),this._activeComponents.push(e),!0}remove(e,t=!0){return new Promise(n=>{import("./component-dimensioning-231c9af2.js").then(i=>{let o=[];e.children.forEach(e=>{e instanceof i.default&&o.push(e)}),o.forEach(t=>{e.remove(t),dispose(t)}),t&&removeItem(this._activeComponents,e),n()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}clear(){}}return __decorate([inject],e.prototype,"_kernelAccess",void 0),e})();class ComponentRaycastHelper{constructor(){this._nonTransparentComponent=null,this._raycaster=new THREE.Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=throttle(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=throttle(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,n=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,n))}_changeMaterialsOnSelect(e,t,n=!1){if(e.children.length>0&&e.children.forEach(i=>{const o=t&&e.id===t.id||n,r=!(i instanceof THREE.Mesh);this._changeMaterialsOnSelect(i,t,(!o||!r)&&o)}),t)e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),n||transitionTransparencyOfMaterial(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial){const{opacity:t,transparent:n}=e.userData.oldMaterial;transitionTransparencyOfMaterial(e,{opacity:t,transparent:n}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const n=(new THREE.Box3).setFromObject(e).getCenter(new THREE.Vector3),i=(new THREE.Vector3).subVectors(n,this._camera.position).normalize();this._raycaster.set(this._camera.position,i),this._raycaster.far=this._camera.position.distanceTo(n);const o=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||o.push(e))}),0===o.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const n=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(n.length>1)return;const i=n[0];this.isComponentVisible(i)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,i)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1})}}var componentRaycastHelper=Object.freeze({__proto__:null,default:ComponentRaycastHelper});let ConfiguratorHistory=(()=>{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 __decorate([inject],e.prototype,"_configuratorUiCallbacks",void 0),e})();const INJECTABLES=[new DependencyInjectionAssignment("kernel-access",KernelAccess),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess),new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("unit-formatter",UnitFormatter),new DependencyInjectionAssignment("camera-control-3d",CameraControl3D),new DependencyInjectionAssignment("camera-control",CameraControl),new DependencyInjectionAssignment("configurator-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("data-syncer",DataSyncer),new DependencyInjectionAssignment("selection-handler",class extends EventDispatcher{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 SelectionHandlerEvent({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new SelectionHandlerEvent({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new SelectionHandlerEvent({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new SelectionHandlerEvent({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new SelectionHandlerEvent({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new SelectionHandlerEvent({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 DependencyInjectionAssignment("configurator-mesh-generator",ConfiguratorMeshGenerator),new DependencyInjectionAssignment("configurator-ui-callbacks",ConfiguratorUiCallbacks,1),new DependencyInjectionAssignment("configurator-scene-manager",ConfiguratorSceneManager,1),new DependencyInjectionAssignment("component-dimensioning-helper",ComponentDimensioningHelper,1),new DependencyInjectionAssignment("component-raycast-helper",ComponentRaycastHelper,0),new DependencyInjectionAssignment("configurator-history",ConfiguratorHistory,1)],sortBySort=(e,t)=>e.sort||t.sort?e.sort?t.sort?e.sort-t.sort:-1:1:0,sortByString=(e,t)=>e&&!t?1:!e&&t?-1:e&&t?e.localeCompare(t):0;let RoomleConfigurator=(()=>{class e{constructor(e){this._onInitDoneCollection=[],this._isKernelReady=!1,this._isWebGlReady=!1,this._isPreloadReady=!0,this._isLoadError=!1,this._isReloading=!1,this._needsSync=!1,this._creator_=e,this._configuratorKernelAccessCallback.addListener(this);const t=this._errorHandler;t.subscribe(0,e=>this._configuratorUiCallbacks.onErrorDueToOffline(e)),t.subscribe(1,e=>this._configuratorUiCallbacks.onError(e)),t.subscribe(2,(e,t)=>this._configuratorUiCallbacks.onContentProblem({rapiPath:e,ids:t,message:"Could not load the ids"}))}_isInitDone(){return this._isKernelReady&&this._isWebGlReady&&this._isPreloadReady}_checkInitDone(){this._isInitDone()&&(this._onInitDoneCollection.forEach(e=>e()),this._onInitDoneCollection=[])}_onInitDone(e){this._isInitDone()?e():this._onInitDoneCollection.push(e)}getScene(){return this._configuratorSceneManager.getScene()}updateScene(){this._configuratorSceneManager.updateScene()}_loadWebGlLib(e,t){this._threeLoader.fetch().then(()=>Promise.all(PIXOTRON_EFFETCS.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(this._loadingWebGlSuccess(e,t).bind(this),this.loadError.bind(this)),this.loadError.bind(this))}_loadingWebGlSuccess(e,t){return()=>{t&&this._configuratorSceneManager.changeOffset(t);const{initialFloorMaterial:e,dls:n,ls:i,stats:o}=this._initData,r=DynamicLightSettingLoader.createDynamicLightSettingSource(n,i);o&&this.showStats(),this._enableHD(r),this._needsSync&&(this._needsSync=!1,this._kernelAccess.requestSync(DEFAULT_CONVERSATION_ID,this._configuratorContext.planObjectId));const s=[this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})];e&&s.push(this._rapiAccess.getMaterial(e).then(e=>this._configuratorSceneManager.changeFloorMaterial(e))),Promise.all(s).then(this._webGlIsReady.bind(this),this.loadError.bind(this))}}_webGlIsReady(){this._isWebGlReady=!0,this._checkInitDone()}_initPromiseCallback(e,t){this._isInitDone()?e():this._isLoadError?t("_initPromiseCallback failed"):(this._onInitDone(()=>e()),this._rejectOnLoadError=t)}_notifyOnConfigurationReady(e){return async t=>{const n=await this._kernelAccess.addUiDataAndPriceToPartList(t.partList,t.hash);t.partList=n,e(t),this._configuratorUiCallbacks.onConfigurationReady(n,t.hash,t.rootComponentLabel)}}_notifyOnConfigurationLoadingError(e){return t=>{this._configuratorUiCallbacks.onConfigurationLoadError(),e(t)}}_loadItemOrConfigById(e,t){this._configuratorContext.lastLoadedRapiId=e,this._onLoadConfiguration(),this._preloadPackage(e),this._clearScene();const{offlineSync:n}=this._initData;if(n){const t=getCatalogIdFromItemOrConfigurationId(e);t&&this._dataSyncer.start(t)}return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(t=>{t&&t.configuration?this._loadConfiguration(t.configuration).then(e=>{const i=this._notifyOnConfigurationReady(n);t.label?this._notifyUiAboutNewItem(t,e.rootComponentLabel):this._notifyUiAboutNewConfiguration(t),i(e)},this._notifyOnConfigurationLoadingError(i).bind(this)):i(new Error("Could not load item or config with id "+e))},i)})}_shouldBroadcastToUi(e){return!(0===e&&this._configuratorContext.selectedRuntimeComponentId||1===e&&!this._configuratorContext.selectedRuntimeComponentId||2===e&&!this._configuratorContext.selectedRuntimeComponentIds.length)}_isCorrectResponse(e,t){if(0===e)return t===this._configuratorContext.planObjectId;if(1===e)return t===this._configuratorContext.selectedRuntimeComponentId;const n=t.length;if(n!==this._configuratorContext.selectedRuntimeComponentIds.length)return!1;for(let e=0;e<n;e++)if(t[e]!==this._configuratorContext.selectedRuntimeComponentIds[e])return!1;return!0}_onLoadConfiguration(){this._clearScene(),this._configuratorUiCallbacks.onLoadConfiguration()}_clearScene(){this._configuratorSceneManager&&this._configuratorSceneManager.clearScene()}_notifyUiAboutNewItem(e,t){this._rapiAccess.getCatalog(e.catalog).then(n=>this._configuratorUiCallbacks.onConfigurationLabelChange(n.name,e.label,t))}_notifyUiAboutNewConfiguration(e){Promise.all([this._rapiAccess.getCatalog(e.catalog),this._rapiAccess.getComponent(e.rootComponentId)]).then(([e,t])=>this._configuratorUiCallbacks.onConfigurationLabelChange(e.name,null,t.label))}_getMaterialGroups(e){const t=(e,t)=>{let n=sortBySort(e,t);return 0!==n?n:(n=sortByString(e.label,t.label),0!==n?n:sortByString(e.id,t.id))},n=e=>(e.sort(t),e.forEach(e=>e.materials.sort(t)),e);if(e.validGroups.length>0)return new Promise((t,i)=>this._rapiAccess.getMaterialsByGroup(e.validGroups).then(e=>t(n(e)),i));const i=[];return e.validValues.forEach(e=>i.push(e.value)),new Promise((e,t)=>{this._rapiAccess.getMaterials(i).then(t=>{this._rapiAccess.combineMaterialsToGroups(t).then(t=>{e(n(t))})},t)})}_loadConfiguration(e){return this._kernelAccess.externalMeshQueue.clear(),new Promise((t,n)=>{const i=()=>{const{x:i,y:o}=this._domHelper.getClientDimensions();if(i<=0&&o<=0){let e="Size of canvas is 0/0! When using embedding set correct size or remove id to load in idle mode!";return console.error(e),n(e)}this.resumeKernelCallbacks(),Benchmark.start("ui_load_configuration");const r=[];if(this._initData.applyCurrentGlobalParameters){const e=this._configuratorContext.planObjectId,t=this._configuratorContext.rootComponentParametersAsGlobal;r.push(this._kernelAccess.getGlobalParameters(e,t))}Promise.all(r).then(([i])=>{const o=[AsyncHelper.waitFor(4),AsyncHelper.waitFor(2)];Promise.all(o).then(([e,[n,o,r,s]])=>{const a=[];i&&this._initData.applyCurrentGlobalParameters&&i.forEach(e=>a.push(this.setParameter(e,e.value,!0)));const c=this._rapiAccess.peekComponent(s);Promise.all(a).then(()=>{const n=[];a.length&&(n.push(this._kernelAccess.getPartList()),n.push(this._kernelAccess.getConfigurationHash(this._configuratorContext))),Promise.all(n).then(async n=>{const i=n&&n[0]?n[0]:o,s=n&&n[1]?n[1]:r,a=await this._kernelAccess.addUiDataAndPriceToPartList(i,s);let l=e.errors;const h=l?convertCObject(l):[];t({partList:a,hash:s,rootComponentLabel:c?c.label:"",errors:h})})})},n),this._kernelAccess.loadConfiguration(e)},n)};this._onInitDone(()=>i())})}_preLoadItemOrConfig(e,t){return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(n,i)})}_preloadPackage(e){this._isPreloadReady=!1;let t=null;t=isIdItemId(e)?this._rapiAccess.getPreloadForItem.bind(this._rapiAccess):this._rapiAccess.getPreloadForConfiguration.bind(this._rapiAccess),Benchmark.start("rapi_preloads");const n=()=>{Benchmark.end("rapi_preloads");const t=Benchmark.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===AppContext.useHDGeometry?t():this._isReloading?n("Change of HD Geometry in progress"):(this._isReloading=!0,AsyncHelper.waitFor(3).then(([e,i])=>{this._reloadConfiguration(e,i,t,n)},n),AppContext.useHDGeometry=e,void this._kernelAccess.changeUseOfHDGeometry(this._configuratorContext,AppContext.useHDGeometry)))}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}init(e,t){this.setOverrides(t);const{preloadHint:n,offset:i,startTag:o}=this._initData;return this._domHelper.setDomElement(e),n?this._preloadPackage(n):console.warn("No preload hint! Therefore no preload during init!!"),o&&this.getTagById(o,{include:["items"]}).then(e=>this._configuratorUiCallbacks.onOpenTag(e),e=>console.error(e)),this._loadWebGlLib(e,i),new Promise(this._initPromiseCallback.bind(this))}cancelSelection(){this._configuratorSceneManager.cancelSelection()}enableHDGeometry(){return this._changeHDGeometry(!0)}disableHDGeometry(){return this._changeHDGeometry(!1)}changeOffset(e){this._configuratorSceneManager.changeOffset(e)}previewDockings(e,t,n){this._configuratorSceneManager.requestDockingsPreview(!0,e,t,n)}cancelDockings(){this._configuratorSceneManager.cancelDockings()}requestDeleteComponent(){this._configuratorSceneManager.requestDeleteSelectedComponent()}renderImage(e){return this._configuratorSceneManager.renderImage(e)}preparePerspectiveImage(e={}){return this._configuratorSceneManager.preparePerspectiveImage(e)}preparePartImage(e,t){let n={};return"number"==typeof t?n.size=t:(t||(t={}),"number"!=typeof t.size&&(t.size=256),n=t),this._configuratorSceneManager.preparePartImage(e,n)}saveCurrentConfiguration(){return new Promise((e,t)=>{this._kernelAccess.getConfigurationData(this._configuratorContext.planObjectId).then(n=>{this._rapiAccess.saveConfiguration(n).then(n=>{this._configuratorUiCallbacks.onConfigurationSaved(n.configurationHash),this._rapiAccess.getComponent(n.rootComponentId).then(i=>{let o=!0,r=!0,s=n.perspectiveImage,a=n.topImage;n.perspectiveImage||(o=!1,this._configuratorSceneManager.preparePerspectiveImage().then(c=>{this._rapiAccess.savePerspectiveImage(n,c).then(t=>{o=!0,s=t.perspectiveImage,r&&(t.label=i.label,t.topImage=a,e(t))},t)})),n.topImage||(r=!1,this._configuratorSceneManager.prepareTopImage().then(c=>{this._rapiAccess.saveTopImage(n,c).then(t=>{r=!0,a=t.topImage,o&&(t.label=i.label,t.perspectiveImage=s,e(t))},t)})),o&&r&&(n.label=i.label,e(n))},e=>{throw new Error(e)})},t)}).catch(t)})}generateImagesOfCurrentConfiguration(){return new Promise((e,t)=>this.saveCurrentConfiguration().then(t=>e({topImage:t.topImage,perspectiveImage:t.perspectiveImage,isLocally:t.isLocally}),t))}prepareTopImage(e){let t={};return"boolean"==typeof e?t.showDimensions=e:(e||(e={}),"boolean"!=typeof e.showDimensions&&(e.showDimensions=!1),t=e),this._configuratorSceneManager.prepareTopImage(t)}resetCameraPosition(){this._configuratorSceneManager.resetCameraPositionToStart()}showBenchmarks(e){Benchmark.showBenchmarks(e)}debugSceneGraph(e){this._configuratorSceneManager.debugSceneGraph(e)}async loadConfiguration(e,t){this.setOverrides(t),this._configuratorContext.lastLoadedRapiId=null,this._configuratorSceneManager&&this._configuratorSceneManager.clearScene();const n=await this._performLoadConfiguration(e);return this._rapiAccess.trackView("configuration string"),n}async loadConfigurationById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!0);return this._rapiAccess.trackView(e),n}syncPlanObjectToView(e,t){this.resumeKernelCallbacks(),this._kernelAccess.requestSync(e,t),this._kernelAccess.requestPlanObjectConstruction(t);const n=this._kernelAccess.getSerializedConfiguration(t),i=this._kernelAccess.getCurrentConfigurationHash(t);this._kernelAccess.planObjectConfigurationUpdated(t,n,i),this._configuratorSceneManager.resetCameraPositionToStart(!1)}async loadConfigurableItemById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!1);return this._rapiAccess.trackView(e),n}preLoadConfigurationById(e){return this._preLoadItemOrConfig(e,!0)}preLoadConfigurableItemById(e){return this._preLoadItemOrConfig(e,!1)}_getTag(e){return this._rapiAccess.getTag(e)}_dispatchSetParameter(e,t,n,i,o){const r=this._configuratorContext.selectedRuntimeComponentId?"local":"global",s=Benchmark.start("kernel_change_param_"+r+"_"+e);switch(this._configuratorContext.selectionMode){case"standard":if(this._configuratorContext.selectedRuntimeComponentId||this._configuratorContext.rootComponentParametersAsGlobal){let r=this._configuratorContext.selectedRuntimeComponentId?this._configuratorContext.selectedRuntimeComponentId:this._configuratorContext.rootComponentId;this._kernelAccess.changeComponentParameter(r,e,t,n,i,o)}else this._kernelAccess.changePlanObjectParameter(this._configuratorContext.planObjectId,e,t,n,i,o);break;case"multiselect":this._kernelAccess.changeCommonComponentParameter(this._configuratorContext.selectedRuntimeComponentIds,e,t,n,i,o)}Benchmark.end(s)}setParameter(e,t,n=!1){return new Promise((i,o)=>{const{key:r,type:s}=e;if(isRange(e)){if(!n&&!this._unitFormatter.isParseableUnitString(t,e))return o(new SyntaxError('Value "'+t+'" is not parseable'));const i=n?t:this._unitFormatter.parseValue(t,e),{valueFrom:r,valueTo:a}=e.validRange,c=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(r)&&i<r-c)return o(new RangeError('Value "'+t+'" is too small, min-val "'+r+'"'));if(!Number.isNaN(a)&&i>a+c)return o(new RangeError('Value "'+t+'" is too big, max-val "'+a+'"'));t="Integer"===s&&"number"==typeof i?i.toFixed():i.toString()}this._configuratorSceneManager.cancelDockings(),this._dispatchSetParameter(r,s,t,i,o)})}setParameterOfPlanObject(e,t){return new Promise((n,i)=>{const{planObjectId:o,rootComponentId:r,rootComponentParametersAsGlobal:s}=this._configuratorContext,{type:a,key:c}=e;s?this._kernelAccess.changeComponentParameter(r,c,a,t,n,i):this._kernelAccess.changePlanObjectParameter(o,c,a,t,n,i)})}getParametersOfPlanObject(){const{planObjectId:e,rootComponentParametersAsGlobal:t}=this._configuratorContext;return this._kernelAccess.getGlobalParameters(e,t)}setParameterOfRootComponent(e,t){return new Promise((n,i)=>{const{rootComponentId:o}=this._configuratorContext,{type:r,key:s}=e;this._kernelAccess.changeComponentParameter(o,s,r,t,n,i)})}getParametersOfRootComponent(){const{planObjectId:e}=this._configuratorContext;return this._kernelAccess.getGlobalParameters(e,!0)}enableMultiselect(){this._configuratorSceneManager.setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._configuratorSceneManager.setSelectionMode("standard"),this._configuratorContext.selectionMode="standard"}getCurrentConfiguration(){return AsyncHelper.waitFor(1,()=>this._kernelAccess.uiRequestConfiguration(this._configuratorContext.planObjectId))}loadComponentIntoKernel(e){return AsyncHelper.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 AsyncHelper.failOperation(0,e)}this._kernelIo.setMeta({componentId:t}),this._kernelAccess.loadComponentIntoKernel(e,t)})}getShortUrlOfCurrentConfiguration(){return new Promise((e,t)=>{this.saveCurrentConfiguration().then(n=>navigator.onLine?this._rapiAccess.getShortUrl(n.id,3).then(t=>{const n=t.shortId,i=Env.APP.SHORTENER_URL+n;e(i)},t):t("Can not generate short url when offline"),t)})}formatValueToUnitString(e,t){return this._unitFormatter.formatValueToUnitString(e,t)}getTagById(e,t){return new Promise((n,i)=>{this._getTag(e).then(e=>{let o=Promise.resolve([]),r=Promise.resolve([]);t&&t.include&&t.include.forEach(t=>{"materials"===t&&(o=this._rapiAccess.getMaterialsOf(e)),"items"===t&&(r=this._rapiAccess.getItems(e.items))}),Promise.all([o,r]).then(([t,i])=>(i.sort(sortBySort),t.sort(sortBySort),n({...e,items:i,materials:t})),i)},i)})}requestAsset(e){return this._dataSyncer.requestAsset(e)}changeFloorMaterial(e){return this._configuratorSceneManager.changeFloorMaterial(e)}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._configuratorSceneManager.changeFloorMaterial(t)}openFloorMaterials(){this._configuratorUiCallbacks.onOpenFloorMaterials()}openPartList(){this._configuratorUiCallbacks.onOpenPartList()}getAdditionalContentsOf(e){return this._rapiAccess.getAdditionalContentsOfItems(e)}changeTypeChangeTag(e){navigator.onLine&&this._initData.offlineSync&&this._dataSyncer.syncTypeChangeTag(e),this._configuratorUiCallbacks.onChangeTypeChangeTag(e)}removeTypeChangeTag(e){this._configuratorUiCallbacks.onRemoveTypeChangeTag(e)}showGUI(){this._configuratorSceneManager.showGUI()}showStats(){this._configuratorSceneManager.showStats()}showDimensions(){this._configuratorSceneManager.showDimensions()}hideDimensions(){this._configuratorSceneManager.hideDimensions()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}syncFloorTag(e){return this._dataSyncer.syncFloorTag(e)}syncTypeChangeTag(e){return this._dataSyncer.syncTypeChangeTag(e)}loadDynamicLightSetting(e){return this._configuratorSceneManager.loadDynamicLightSetting(e)}setBackgroundColor(e){this._configuratorSceneManager.setBackgroundColor(e)}setBackgroundImage(e){this._configuratorSceneManager.setBackgroundImage(e)}setBakedShadow(e,t){this._configuratorSceneManager.setBakedShadow(e,t)}loadSceneSetting(e){return this._configuratorSceneManager.loadSceneSettings(e)}enableMeshSelection(e){this._initData.meshSelection=e}updateSize(){this._configuratorSceneManager.updateCamera()}setCameraOffset(e){this._configuratorSceneManager.setCameraOffset(e)}getCameraOffset(){return this._configuratorSceneManager.getCameraOffset()}getMain(){}cleanup(e={}){this._configuratorContext.selectedRuntimeComponentIds=[],this._kernelAccess.cleanUpCallbacks(),this._configuratorSceneManager.sceneCleared(!!e.resetMeshCache),e.resetCoreCache&&this._kernelAccess.kernelInstance.clearAll(),e.resetApiCache&&this._rapiAccess.cleanUp()}resumeTest(e){e&&this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}zoomIn(e){this._configuratorSceneManager.zoomIn(e)}zoomOut(e){this._configuratorSceneManager.zoomOut(e)}get callbacks(){return this._configuratorUiCallbacks}get globalCallbacks(){return this._globalCallback}getRuntimeComponentIdOfRootComponent(){const e=this._configuratorContext.planObjectId;return e?this._kernelAccess.getRuntimeComponentIdOfRootComponent(e):(console.warn("planObjectId not set"),0)}getCurrentConfigurationHash(){return this._kernelAccess.getConfigurationHash(this._configuratorContext)}getCurrentSelection(){let e=this._configuratorContext.selectedRuntimeComponentIds;return e&&e.length||(e=[this._configuratorContext.rootComponentId]),e.map(e=>this._kernelAccess.getRuntimeComponentId(e))}_enableHD(e){return new Promise((t,n)=>{this._scriptLoader.fetch(PIXOTRON_FILE_NAME,{id:"pi-js"}).then(()=>{this._configuratorSceneManager.enableHD(e),t()},n)})}isReady(){const e=Benchmark.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=Benchmark.getMeta("kernel_is_ready");this._configuratorUiCallbacks.onTrackTiming("Timing","KernelIsReady",Math.round(t.duration),Object.assign(n,{startTime:t.startTime}))}this._isKernelReady=!0,this._checkInitDone(),"function"==typeof this._configuratorUiCallbacks.onKernelIsReady&&this._configuratorUiCallbacks.onKernelIsReady()}updatePossibleChildren(e,t,n){const i=[],o=[];let r;const s=new Map,a=new Map;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n.possible)continue;let c=n.itemId;n.itemId?(o.push(n.itemId),a.set(n.itemId,n)):(i.push(n.componentId),s.set(n.componentId,n),c=n.componentId),n.isDefault&&!r&&(r=c)}Promise.all([this._rapiAccess.getComponents(i),this._rapiAccess.getItems(o)]).then(e=>{const t=[],n=e[0],i=e[1];let o;for(let e=0,i=n.length;e<i;e++){const i=n[e];i.isItem=!1,i.isComponent=!0;const a=s.get(i.id);a&&(i.group=a.group),i.id===r&&(i.isDefault=!0,o=i),t.push(i)}for(let e=0,n=i.length;e<n;e++){const n=i[e];n.isItem=!0,n.isComponent=!1;const s=a.get(n.id);s&&(n.group=s.group),n.id===r&&(n.isDefault=!0,o=n),t.push(n)}return t.sort(sortBySort),{possibleChildren:t,defaultChild:o||null}}).then(({possibleChildren:e,defaultChild:t})=>{const n=[],i=new Map,o=[];for(let t=0,r=e.length;t<r;t++){const r=e[t],s=r.tags;if(r.tags&&Array.isArray(r.tags)&&r.tags.length)for(let e=0,t=r.tags.length;e<t;e++){const t=s[e];-1===n.indexOf(t)&&n.push(t);let o=i.get(t);if(!o){const e=[];i.set(t,e),o=i.get(t)}o.push(r)}else o.push(r)}return{tagIds:n,associations:i,defaultChild:t,noTagChilds:o}}).then(({tagIds:t,associations:i,defaultChild:o,noTagChilds:r})=>{this._rapiAccess.getTags(t).then(t=>{if(this._isCorrectResponse(n,e)&&this._shouldBroadcastToUi(n)){for(let e=0,n=t.length;e<n;e++){const n=t[e];n.possibleChildren=i.get(n.id)}t.sort(sortBySort),r.length&&t.unshift({id:"",externalIdentifier:"",global:!1,created:(new Date).toISOString(),updated:(new Date).toISOString(),language:this._globalInitData.locale,catalog:null,tags:[],parents:[],materials:[],items:[],possibleChildren:r}),this._configuratorUiCallbacks.onUpdatePossibleChildren(t,o)}},e=>{console.error("Couldnt load tags of possible children"),console.error(e)})},e=>console.error(e))}updateParameters(e,t,n,i){const o={};t||(t=[],console.warn("Kernel returned no parameter groups! Check why!")),t.forEach(e=>{o[e.key]=e}),e.sort(sortBySort),e.forEach(e=>{e.group?e.grouping=o[e.group]:e.grouping=null,this._unitFormatter.formatParameter(e),isMaterial(e)&&Object.defineProperty(e,"groups",{get:()=>new Promise((t,o)=>{this._getMaterialGroups(e).then(e=>{this._isCorrectResponse(i,n)&&this._shouldBroadcastToUi(i)?t(e):o("Response does not match to ids")},o)})})}),this._shouldBroadcastToUi(i)&&this._configuratorUiCallbacks.onUpdateParameters(e)}loadError(e){this._isLoadError=!0,this._rejectOnLoadError&&this._rejectOnLoadError(e)}resumeKernelCallbacks(){this._kernelAccess.muteKernelCallbacks=!1,this._kernelAccess.resume()}pauseKernelCallbacks(){this._kernelAccess.muteKernelCallbacks=!0,this._kernelAccess.pause()}setActiveGroupInView(e){this._kernelAccess.setActiveGroupInView(e)}getParameterGroups(){return this._kernelAccess.getParameterGroups()}async getConfiguratorSettings(e){return this._rapiAccess.getConfiguratorSettings(e)}async moveCamera(e){return this._configuratorSceneManager.moveCamera(e)}selectComponent(e){return this._configuratorContext.selectedRuntimeComponentId===e?Promise.resolve():Promise.resolve(this._configuratorSceneManager.selectComponent(e))}setComponentParameter(e,t,n){const{key:i,type:o}=t;return new Promise((t,r)=>this._kernelAccess.changeComponentParameter(e,i,o,n,t,r))}highlightParts(e){this._configuratorSceneManager.highlightParts(e)}undo(){const e=this._configuratorHistory.undo();e&&this._kernelAccess.loadConfiguration(e)}redo(){const e=this._configuratorHistory.redo();e&&this._kernelAccess.loadConfiguration(e)}clearHistory(){this._configuratorHistory.clearHistory()}getHashOfSerializedConfiguration(e){return this._kernelAccess.kernelInstance.getHashOfSerializedConfiguration(e)}}return __decorate([inject],e.prototype,"_rapiAccess",void 0),__decorate([inject],e.prototype,"_dataSyncer",void 0),__decorate([inject],e.prototype,"_errorHandler",void 0),__decorate([inject],e.prototype,"_unitFormatter",void 0),__decorate([inject],e.prototype,"_domHelper",void 0),__decorate([inject],e.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],e.prototype,"_configuratorKernelAccessCallback",void 0),__decorate([inject],e.prototype,"_lifeCycleManager",void 0),__decorate([inject],e.prototype,"_kernelAccess",void 0),__decorate([inject],e.prototype,"_threeLoader",void 0),__decorate([inject],e.prototype,"_scriptLoader",void 0),__decorate([inject],e.prototype,"_configuratorContext",void 0),__decorate([inject],e.prototype,"_configuratorSceneManager",void 0),__decorate([inject],e.prototype,"_initData",void 0),__decorate([inject],e.prototype,"_globalInitData",void 0),__decorate([inject],e.prototype,"_globalCallback",void 0),__decorate([inject],e.prototype,"_kernelIo",void 0),__decorate([inject],e.prototype,"_configuratorHistory",void 0),e})();class Configurator extends Main{setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("kernel-access",this._context),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),t=this.lookup("rapi-access"),n=(this.lookup("dom-helper"),this.lookup("configurator-scene-manager"));e&&e.cleanUp(),t&&t.cleanUp(),n&&n.cleanUp()}setupGlobals(e){const{kernelInstance:t,kernelContainer:n,planObjectId:i}=e||{};AppContext.init({kernelInstance:t,kernelContainer:n,planObjectId:i})}getApi(){return this._configurator}bootFinished(){this._configurator=new RoomleConfigurator(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}var configurator=Object.freeze({__proto__:null,Configurator});export{AsyncDependencyLoader as A,Configurator as C,configurator as c};
2
+ //# sourceMappingURL=configurator-3570c605.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurator-3570c605.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular.json"],"sourcesContent":["export default \"static/rubik_regular-75bd7bb699e9e39d.json\""],"names":[],"mappings":"u8zDAAe"}
@@ -0,0 +1,2 @@
1
+ import"./query-params-helper-a271f9dc.js";import"./rapi-access-21338f5f.js";import"./main-thread-to-worker-5447c1c5.js";import"./image-renderer-757a6907.js";import"./pixotron-76665c10.js";import{C as Configurator}from"./configurator-3570c605.js";import"./mesh-generator-df801dc9.js";import"./configurator-mesh-generator-ed7f42a4.js";import"./default-light-setting-88521da5.js";(new Configurator).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let a=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-a))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)});
2
+ //# sourceMappingURL=configurator-main-d4562587.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurator-main-d4562587.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-c0f4bbd9.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js","./image-renderer-70acb74b.nomodule.js","./pixotron-20d1e014.nomodule.js","./configurator-ecd46b23.nomodule.js","./mesh-generator-1ab6446e.nomodule.js","./configurator-mesh-generator-48dd85a4.nomodule.js","./default-light-setting-4a25d176.nomodule.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(n){e=n.C},function(){},function(){},function(){}],execute:function(){(new e).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let n=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-n))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})}}}));
1
+ System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-6a614458.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js","./image-renderer-52bbd908.nomodule.js","./pixotron-c033394c.nomodule.js","./configurator-08e58911.nomodule.js","./mesh-generator-106a6ce1.nomodule.js","./configurator-mesh-generator-a69ff1e4.nomodule.js","./default-light-setting-86b8760c.nomodule.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(n){e=n.C},function(){},function(){},function(){}],execute:function(){(new e).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let n=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-n))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})}}}));
2
2
  //# sourceMappingURL=configurator-main.nomodule.js.map
@@ -1,2 +1,2 @@
1
- System.register(["./rapi-access-c0f4bbd9.nomodule.js","./mesh-generator-1ab6446e.nomodule.js"],(function(e){var t,r,a,n;return{setters:[function(e){t=e.O,r=e.Q,a=e.S},function(e){n=e.M}],execute:function(){e("C",class extends n{constructor(e){super(e),this._geometryComponentMaterialCache=new Map,this._configuratorPreviewMaterial=new THREE.MeshStandardMaterial({color:t,transparent:!0,opacity:r,roughness:a,envMap:null}),this._environmentLoader.setEnvMap(this._configuratorPreviewMaterial)}generateMesh(e=0,t=null,r,a,n,s,o,i=!1){let h;h=i?this._generateGeometry(t,a,n,s,o).clone():this._generateGeometry(t,a,n,s,o);const l=this._createMesh(e,t,h);return l.userData.materialId=r,l.layers.set(3),r&&this.materialQueue.push(this._assignMaterial(l,r).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),r)})),l}_createMesh(e,t,r){if(e&&t){const a=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(a)){const e=this._geometryComponentMaterialCache.get(a);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new THREE.Mesh(r,t)}}}return new THREE.Mesh(r,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}setMaterial(e,t,r){return this._assignMaterial(e,t)}loadMaterial(e,t,r){return super._loadMaterial(e,t,r)}loadTextures(e,t,r,a){return super._loadTextures(e,t,r,a)}})}}}));
2
- //# sourceMappingURL=configurator-mesh-generator-48dd85a4.nomodule.js.map
1
+ System.register(["./rapi-access-6a614458.nomodule.js","./mesh-generator-106a6ce1.nomodule.js"],(function(e){var t,r,a,n;return{setters:[function(e){t=e.S,r=e.T,a=e.U},function(e){n=e.M}],execute:function(){e("C",class extends n{constructor(e){super(e),this._geometryComponentMaterialCache=new Map,this._configuratorPreviewMaterial=new THREE.MeshStandardMaterial({color:t,transparent:!0,opacity:r,roughness:a,envMap:null}),this._environmentLoader.setEnvMap(this._configuratorPreviewMaterial)}generateMesh(e=0,t=null,r,a,n,s,o,i=!1){let h;h=i?this._generateGeometry(t,a,n,s,o).clone():this._generateGeometry(t,a,n,s,o);const l=this._createMesh(e,t,h);return l.userData.materialId=r,l.layers.set(3),r&&this.materialQueue.push(this._assignMaterial(l,r).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),r)})),l}_createMesh(e,t,r){if(e&&t){const a=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(a)){const e=this._geometryComponentMaterialCache.get(a);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new THREE.Mesh(r,t)}}}return new THREE.Mesh(r,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}setMaterial(e,t,r){return this._assignMaterial(e,t)}loadMaterial(e,t,r){return super._loadMaterial(e,t,r)}loadTextures(e,t,r,a){return super._loadTextures(e,t,r,a)}})}}}));
2
+ //# sourceMappingURL=configurator-mesh-generator-a69ff1e4.nomodule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurator-mesh-generator-a69ff1e4.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}