@roomle/web-sdk 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/lib/{BufferGeometry-BzmfTBQt.mjs → BufferGeometry-ltw0XkYt.mjs} +7 -4
  2. package/lib/BufferGeometry-ltw0XkYt.mjs.map +1 -0
  3. package/lib/ConfiguratorKernel.js +6 -6
  4. package/lib/ConfiguratorKernel.wasm +0 -0
  5. package/lib/{GLTFExporter-CyhgWPq0.mjs → GLTFExporter-BqjC9LhS.mjs} +9 -14
  6. package/lib/GLTFExporter-BqjC9LhS.mjs.map +1 -0
  7. package/lib/{Object3D-C3wqWk6O.mjs → Object3D-BZaiqQIE.mjs} +24 -12
  8. package/lib/Object3D-BZaiqQIE.mjs.map +1 -0
  9. package/lib/{PointLightHelper-DwIXACyT.mjs → PointLightHelper-AxCe6I00.mjs} +4 -4
  10. package/lib/PointLightHelper-AxCe6I00.mjs.map +1 -0
  11. package/lib/RoomleCore.js +8 -8
  12. package/lib/RoomleCore.wasm +0 -0
  13. package/lib/RoomleToolsCore.wasm +0 -0
  14. package/lib/{SpotLightHelper-CfLHM7LU.mjs → SpotLightHelper-DpMerFPv.mjs} +3 -3
  15. package/lib/{SpotLightHelper-CfLHM7LU.mjs.map → SpotLightHelper-DpMerFPv.mjs.map} +1 -1
  16. package/lib/{USDZExporter-kmxcTvnQ.mjs → USDZExporter-qUD2VgwK.mjs} +2 -2
  17. package/lib/{USDZExporter-kmxcTvnQ.mjs.map → USDZExporter-qUD2VgwK.mjs.map} +1 -1
  18. package/lib/{Vector4-DUqY3Egg.mjs → Vector4-BfZH1ecw.mjs} +7 -4
  19. package/lib/Vector4-BfZH1ecw.mjs.map +1 -0
  20. package/lib/{api-X1dDTDvL.mjs → api-CbHAzwVm.mjs} +2 -2
  21. package/lib/{api-X1dDTDvL.mjs.map → api-CbHAzwVm.mjs.map} +1 -1
  22. package/lib/asset-loader.worker-A7nEeQB4.mjs.map +1 -1
  23. package/lib/{banana-for-scale-Bpf8RfLi.mjs → banana-for-scale-DiBCpVNM.mjs} +3 -3
  24. package/lib/{banana-for-scale-Bpf8RfLi.mjs.map → banana-for-scale-DiBCpVNM.mjs.map} +1 -1
  25. package/lib/budgeteer.sw-CQWYbQSc.mjs.map +1 -1
  26. package/lib/{common-utils-DMI8Yuhe.mjs → common-utils-AB4Lnet3.mjs} +2 -2
  27. package/lib/{common-utils-DMI8Yuhe.mjs.map → common-utils-AB4Lnet3.mjs.map} +1 -1
  28. package/lib/{component-dimensioning-MtS9xiY-.mjs → component-dimensioning-LUnZnpqG.mjs} +5 -5
  29. package/lib/{component-dimensioning-MtS9xiY-.mjs.map → component-dimensioning-LUnZnpqG.mjs.map} +1 -1
  30. package/lib/{component-raycast-helper-C1qWqpRH.mjs → component-raycast-helper-Bl0mWPcj.mjs} +4 -4
  31. package/lib/{component-raycast-helper-C1qWqpRH.mjs.map → component-raycast-helper-Bl0mWPcj.mjs.map} +1 -1
  32. package/lib/configurator-BmJX0gB5.mjs +2 -0
  33. package/lib/configurator-CP80d0HI.mjs +45 -0
  34. package/lib/{configurator-Cg1a9XSL.mjs.map → configurator-CP80d0HI.mjs.map} +1 -1
  35. package/lib/{continuous-drawing-helper-CQx5Sbns.mjs → continuous-drawing-helper-BlRy7u2t.mjs} +3 -3
  36. package/lib/{continuous-drawing-helper-CQx5Sbns.mjs.map → continuous-drawing-helper-BlRy7u2t.mjs.map} +1 -1
  37. package/lib/dimensioning-helper-5xsc6I7Y.mjs +2 -0
  38. package/lib/{dimensioning-helper-GPn7Z8GE.mjs → dimensioning-helper-vPhGfHd-.mjs} +3 -3
  39. package/lib/{dimensioning-helper-GPn7Z8GE.mjs.map → dimensioning-helper-vPhGfHd-.mjs.map} +1 -1
  40. package/lib/{glb-viewer-tgKOPCaI.mjs → glb-viewer-B7pA8K_w.mjs} +71 -54
  41. package/lib/glb-viewer-B7pA8K_w.mjs.map +1 -0
  42. package/lib/glb-viewer-XFEP993c.mjs +2 -0
  43. package/lib/{highlight-coordinator-DRHeEU-E.mjs → highlight-coordinator-DeB46jQq.mjs} +9 -3
  44. package/lib/highlight-coordinator-DeB46jQq.mjs.map +1 -0
  45. package/lib/{homag-intelligence-D5mCTWgG.mjs → homag-intelligence-f1JD0An1.mjs} +3 -3
  46. package/lib/homag-intelligence-f1JD0An1.mjs.map +1 -0
  47. package/lib/{imos-ix-poc-export-helper-BKFs_Yhm.mjs → imos-ix-poc-export-helper-Vyv-uuNs.mjs} +3 -3
  48. package/lib/{imos-ix-poc-export-helper-BKFs_Yhm.mjs.map → imos-ix-poc-export-helper-Vyv-uuNs.mjs.map} +1 -1
  49. package/lib/kernel-C7YDLxq8.mjs.map +1 -1
  50. package/lib/{kernel-utils-B80amC-l.mjs → kernel-utils-BG1uqfT_.mjs} +2 -2
  51. package/lib/{kernel-utils-B80amC-l.mjs.map → kernel-utils-BG1uqfT_.mjs.map} +1 -1
  52. package/lib/{main-CJ5TNhBt.mjs → main-CuqGqemT.mjs} +2916 -2605
  53. package/lib/main-CuqGqemT.mjs.map +1 -0
  54. package/lib/{material-viewer-DCqZzMZN.mjs → material-viewer-Cij9aWpI.mjs} +23 -23
  55. package/lib/{material-viewer-DCqZzMZN.mjs.map → material-viewer-Cij9aWpI.mjs.map} +1 -1
  56. package/lib/packages-DALvuVA_.mjs +4 -0
  57. package/lib/planner-CVn2Lls0.mjs +2 -0
  58. package/lib/planner-DKbmQVSf.mjs +44 -0
  59. package/lib/{planner-CSboZram.mjs.map → planner-DKbmQVSf.mjs.map} +1 -1
  60. package/lib/{plugin-system-DD0Z9Jvt.mjs → plugin-system-BEZnFUyT.mjs} +2 -2
  61. package/lib/{plugin-system-DD0Z9Jvt.mjs.map → plugin-system-BEZnFUyT.mjs.map} +1 -1
  62. package/lib/{roomle-headless-setup-nsoGENQV.mjs → roomle-headless-setup-CMK-quZI.mjs} +131 -77
  63. package/lib/roomle-headless-setup-CMK-quZI.mjs.map +1 -0
  64. package/lib/roomle-headless.d.ts +333 -44
  65. package/lib/roomle-headless.js +196 -80
  66. package/lib/roomle-headless.js.map +1 -1
  67. package/lib/{roomle-renderer-BEJNPCKx.mjs → roomle-renderer-BgT28pfp.mjs} +2 -2
  68. package/lib/{roomle-renderer-BEJNPCKx.mjs.map → roomle-renderer-BgT28pfp.mjs.map} +1 -1
  69. package/lib/roomle-sdk.d.ts +168 -37
  70. package/lib/roomle-sdk.js +7 -7
  71. package/lib/roomle-webgpu-renderer-BdCItfH1.mjs +2243 -0
  72. package/lib/roomle-webgpu-renderer-BdCItfH1.mjs.map +1 -0
  73. package/lib/{scene-renderer-Dm1kij1z.mjs → scene-renderer-Bdl7umAf.mjs} +6 -6
  74. package/lib/{scene-renderer-Dm1kij1z.mjs.map → scene-renderer-Bdl7umAf.mjs.map} +1 -1
  75. package/lib/{script-loader-DqaDm1FG.mjs → script-loader-BtWHegD-.mjs} +2 -2
  76. package/lib/{script-loader-DqaDm1FG.mjs.map → script-loader-BtWHegD-.mjs.map} +1 -1
  77. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  78. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts +2 -2
  79. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js +2 -2
  80. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map +1 -1
  81. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +12 -3
  82. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js +1 -0
  83. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +1 -1
  84. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +43 -2
  85. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js +20 -1
  86. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -1
  87. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.d.ts +1 -1
  88. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js +1 -1
  89. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js.map +1 -1
  90. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +6 -6
  91. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  92. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js +8 -8
  93. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  94. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  95. package/lib/{stats-helper-D7a7oxnj.mjs → stats-helper-BvDfWWfq.mjs} +2 -2
  96. package/lib/{stats-helper-D7a7oxnj.mjs.map → stats-helper-BvDfWWfq.mjs.map} +1 -1
  97. package/lib/{three.core-BmQnspOL.mjs → three.core-K1JzUaep.mjs} +748 -706
  98. package/lib/three.core-K1JzUaep.mjs.map +1 -0
  99. package/lib/{three.module-DkrZwaid.mjs → three.module-Q2K9uyhi.mjs} +1022 -965
  100. package/lib/three.module-Q2K9uyhi.mjs.map +1 -0
  101. package/lib/{three.webgpu-DLZjhIYv.mjs → three.webgpu-7v7o6Pxs.mjs} +3804 -3481
  102. package/lib/three.webgpu-7v7o6Pxs.mjs.map +1 -0
  103. package/lib/three.webgpu-ChguPx4k.mjs +3 -0
  104. package/lib/{threejs-utils-CrK_gp1x.mjs → threejs-utils-BzXU2M3w.mjs} +67 -47
  105. package/lib/threejs-utils-BzXU2M3w.mjs.map +1 -0
  106. package/lib/{tools-core-CZWgXTFV.mjs → tools-core-BoxckhTR.mjs} +6 -6
  107. package/lib/{tools-core-CZWgXTFV.mjs.map → tools-core-BoxckhTR.mjs.map} +1 -1
  108. package/package.json +4 -4
  109. package/lib/BufferGeometry-BzmfTBQt.mjs.map +0 -1
  110. package/lib/GLTFExporter-CyhgWPq0.mjs.map +0 -1
  111. package/lib/Object3D-C3wqWk6O.mjs.map +0 -1
  112. package/lib/PointLightHelper-DwIXACyT.mjs.map +0 -1
  113. package/lib/Vector4-DUqY3Egg.mjs.map +0 -1
  114. package/lib/configurator-C5t3clCx.mjs +0 -2
  115. package/lib/configurator-Cg1a9XSL.mjs +0 -45
  116. package/lib/dimensioning-helper-Bfe0fImX.mjs +0 -2
  117. package/lib/glb-viewer-DIEpkrvY.mjs +0 -2
  118. package/lib/glb-viewer-tgKOPCaI.mjs.map +0 -1
  119. package/lib/highlight-coordinator-DRHeEU-E.mjs.map +0 -1
  120. package/lib/homag-intelligence-D5mCTWgG.mjs.map +0 -1
  121. package/lib/main-CJ5TNhBt.mjs.map +0 -1
  122. package/lib/packages-DuOz6rk6.mjs +0 -4
  123. package/lib/planner-CSboZram.mjs +0 -44
  124. package/lib/planner-CWPqJktz.mjs +0 -2
  125. package/lib/roomle-headless-setup-nsoGENQV.mjs.map +0 -1
  126. package/lib/roomle-webgpu-renderer-D5flithq.mjs +0 -1502
  127. package/lib/roomle-webgpu-renderer-D5flithq.mjs.map +0 -1
  128. package/lib/three.core-BmQnspOL.mjs.map +0 -1
  129. package/lib/three.module-DkrZwaid.mjs.map +0 -1
  130. package/lib/three.webgpu-DLZjhIYv.mjs.map +0 -1
  131. package/lib/three.webgpu-RkQxSIwG.mjs +0 -3
  132. package/lib/threejs-utils-CrK_gp1x.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"PointLightHelper-DwIXACyT.mjs","names":[],"sources":["../../../../node_modules/three/src/math/Triangle.js","../../../../node_modules/three/src/materials/MeshBasicMaterial.js","../../../../node_modules/three/src/objects/Mesh.js","../../../../node_modules/three/src/geometries/SphereGeometry.js","../../../../node_modules/three/src/helpers/PointLightHelper.js"],"sourcesContent":["import { Vector3 } from './Vector3.js';\nimport { Vector4 } from './Vector4.js';\n\nconst _v0 = /*@__PURE__*/ new Vector3();\nconst _v1 = /*@__PURE__*/ new Vector3();\nconst _v2 = /*@__PURE__*/ new Vector3();\nconst _v3 = /*@__PURE__*/ new Vector3();\n\nconst _vab = /*@__PURE__*/ new Vector3();\nconst _vac = /*@__PURE__*/ new Vector3();\nconst _vbc = /*@__PURE__*/ new Vector3();\nconst _vap = /*@__PURE__*/ new Vector3();\nconst _vbp = /*@__PURE__*/ new Vector3();\nconst _vcp = /*@__PURE__*/ new Vector3();\n\nconst _v40 = /*@__PURE__*/ new Vector4();\nconst _v41 = /*@__PURE__*/ new Vector4();\nconst _v42 = /*@__PURE__*/ new Vector4();\n\n/**\n * A geometric triangle as defined by three vectors representing its three corners.\n */\nclass Triangle {\n\n\t/**\n\t * Constructs a new triangle.\n\t *\n\t * @param {Vector3} [a=(0,0,0)] - The first corner of the triangle.\n\t * @param {Vector3} [b=(0,0,0)] - The second corner of the triangle.\n\t * @param {Vector3} [c=(0,0,0)] - The third corner of the triangle.\n\t */\n\tconstructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {\n\n\t\t/**\n\t\t * The first corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.a = a;\n\n\t\t/**\n\t\t * The second corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.b = b;\n\n\t\t/**\n\t\t * The third corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.c = c;\n\n\t}\n\n\t/**\n\t * Computes the normal vector of a triangle.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's normal.\n\t */\n\tstatic getNormal( a, b, c, target ) {\n\n\t\ttarget.subVectors( c, b );\n\t\t_v0.subVectors( a, b );\n\t\ttarget.cross( _v0 );\n\n\t\tconst targetLengthSq = target.lengthSq();\n\t\tif ( targetLengthSq > 0 ) {\n\n\t\t\treturn target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) );\n\n\t\t}\n\n\t\treturn target.set( 0, 0, 0 );\n\n\t}\n\n\t/**\n\t * Computes a barycentric coordinates from the given vector.\n\t * Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The barycentric coordinates for the given point\n\t */\n\tstatic getBarycoord( point, a, b, c, target ) {\n\n\t\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\t\t_v0.subVectors( c, a );\n\t\t_v1.subVectors( b, a );\n\t\t_v2.subVectors( point, a );\n\n\t\tconst dot00 = _v0.dot( _v0 );\n\t\tconst dot01 = _v0.dot( _v1 );\n\t\tconst dot02 = _v0.dot( _v2 );\n\t\tconst dot11 = _v1.dot( _v1 );\n\t\tconst dot12 = _v1.dot( _v2 );\n\n\t\tconst denom = ( dot00 * dot11 - dot01 * dot01 );\n\n\t\t// collinear or singular triangle\n\t\tif ( denom === 0 ) {\n\n\t\t\ttarget.set( 0, 0, 0 );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom;\n\t\tconst v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom;\n\n\t\t// barycentric coordinates must always sum to 1\n\t\treturn target.set( 1 - u - v, v, u );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle.\n\t *\n\t * @param {Vector3} point - The point in 3D space to test.\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @return {boolean} Whether the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle or not.\n\t */\n\tstatic containsPoint( point, a, b, c ) {\n\n\t\t// if the triangle is degenerate then we can't contain a point\n\t\tif ( this.getBarycoord( point, a, b, c, _v3 ) === null ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn ( _v3.x >= 0 ) && ( _v3.y >= 0 ) && ( ( _v3.x + _v3.y ) <= 1 );\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given point on the\n\t * triangle. Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - Position of interpolated point.\n\t * @param {Vector3} p1 - The first corner of the triangle.\n\t * @param {Vector3} p2 - The second corner of the triangle.\n\t * @param {Vector3} p3 - The third corner of the triangle.\n\t * @param {Vector3} v1 - Value to interpolate of first vertex.\n\t * @param {Vector3} v2 - Value to interpolate of second vertex.\n\t * @param {Vector3} v3 - Value to interpolate of third vertex.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The interpolated value.\n\t */\n\tstatic getInterpolation( point, p1, p2, p3, v1, v2, v3, target ) {\n\n\t\tif ( this.getBarycoord( point, p1, p2, p3, _v3 ) === null ) {\n\n\t\t\ttarget.x = 0;\n\t\t\ttarget.y = 0;\n\t\t\tif ( 'z' in target ) target.z = 0;\n\t\t\tif ( 'w' in target ) target.w = 0;\n\t\t\treturn null;\n\n\t\t}\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( v1, _v3.x );\n\t\ttarget.addScaledVector( v2, _v3.y );\n\t\ttarget.addScaledVector( v3, _v3.z );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given attribute and indices.\n\t *\n\t * @param {BufferAttribute} attr - The attribute to interpolate.\n\t * @param {number} i1 - Index of first vertex.\n\t * @param {number} i2 - Index of second vertex.\n\t * @param {number} i3 - Index of third vertex.\n\t * @param {Vector3} barycoord - The barycoordinate value to use to interpolate.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The interpolated attribute value.\n\t */\n\tstatic getInterpolatedAttribute( attr, i1, i2, i3, barycoord, target ) {\n\n\t\t_v40.setScalar( 0 );\n\t\t_v41.setScalar( 0 );\n\t\t_v42.setScalar( 0 );\n\n\t\t_v40.fromBufferAttribute( attr, i1 );\n\t\t_v41.fromBufferAttribute( attr, i2 );\n\t\t_v42.fromBufferAttribute( attr, i3 );\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( _v40, barycoord.x );\n\t\ttarget.addScaledVector( _v41, barycoord.y );\n\t\ttarget.addScaledVector( _v42, barycoord.z );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns `true` if the triangle is oriented towards the given direction.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} direction - The (normalized) direction vector.\n\t * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n\t */\n\tstatic isFrontFacing( a, b, c, direction ) {\n\n\t\t_v0.subVectors( c, b );\n\t\t_v1.subVectors( a, b );\n\n\t\t// strictly front facing\n\t\treturn ( _v0.cross( _v1 ).dot( direction ) < 0 ) ? true : false;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given values.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tset( a, b, c ) {\n\n\t\tthis.a.copy( a );\n\t\tthis.b.copy( b );\n\t\tthis.c.copy( c );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given array values.\n\t *\n\t * @param {Array<Vector3>} points - An array with 3D points.\n\t * @param {number} i0 - The array index representing the first corner of the triangle.\n\t * @param {number} i1 - The array index representing the second corner of the triangle.\n\t * @param {number} i2 - The array index representing the third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tsetFromPointsAndIndices( points, i0, i1, i2 ) {\n\n\t\tthis.a.copy( points[ i0 ] );\n\t\tthis.b.copy( points[ i1 ] );\n\t\tthis.c.copy( points[ i2 ] );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given attribute values.\n\t *\n\t * @param {BufferAttribute} attribute - A buffer attribute with 3D points data.\n\t * @param {number} i0 - The attribute index representing the first corner of the triangle.\n\t * @param {number} i1 - The attribute index representing the second corner of the triangle.\n\t * @param {number} i2 - The attribute index representing the third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tsetFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\n\t\tthis.a.fromBufferAttribute( attribute, i0 );\n\t\tthis.b.fromBufferAttribute( attribute, i1 );\n\t\tthis.c.fromBufferAttribute( attribute, i2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new triangle with copied values from this instance.\n\t *\n\t * @return {Triangle} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given triangle to this instance.\n\t *\n\t * @param {Triangle} triangle - The triangle to copy.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tcopy( triangle ) {\n\n\t\tthis.a.copy( triangle.a );\n\t\tthis.b.copy( triangle.b );\n\t\tthis.c.copy( triangle.c );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the area of the triangle.\n\t *\n\t * @return {number} The triangle's area.\n\t */\n\tgetArea() {\n\n\t\t_v0.subVectors( this.c, this.b );\n\t\t_v1.subVectors( this.a, this.b );\n\n\t\treturn _v0.cross( _v1 ).length() * 0.5;\n\n\t}\n\n\t/**\n\t * Computes the midpoint of the triangle.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's midpoint.\n\t */\n\tgetMidpoint( target ) {\n\n\t\treturn target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );\n\n\t}\n\n\t/**\n\t * Computes the normal of the triangle.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's normal.\n\t */\n\tgetNormal( target ) {\n\n\t\treturn Triangle.getNormal( this.a, this.b, this.c, target );\n\n\t}\n\n\t/**\n\t * Computes a plane the triangle lies within.\n\t *\n\t * @param {Plane} target - The target vector that is used to store the method's result.\n\t * @return {Plane} The plane the triangle lies within.\n\t */\n\tgetPlane( target ) {\n\n\t\treturn target.setFromCoplanarPoints( this.a, this.b, this.c );\n\n\t}\n\n\t/**\n\t * Computes a barycentric coordinates from the given vector.\n\t * Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The barycentric coordinates for the given point\n\t */\n\tgetBarycoord( point, target ) {\n\n\t\treturn Triangle.getBarycoord( point, this.a, this.b, this.c, target );\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given point on the\n\t * triangle. Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - Position of interpolated point.\n\t * @param {Vector3} v1 - Value to interpolate of first vertex.\n\t * @param {Vector3} v2 - Value to interpolate of second vertex.\n\t * @param {Vector3} v3 - Value to interpolate of third vertex.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The interpolated value.\n\t */\n\tgetInterpolation( point, v1, v2, v3, target ) {\n\n\t\treturn Triangle.getInterpolation( point, this.a, this.b, this.c, v1, v2, v3, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle.\n\t *\n\t * @param {Vector3} point - The point in 3D space to test.\n\t * @return {boolean} Whether the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn Triangle.containsPoint( point, this.a, this.b, this.c );\n\n\t}\n\n\t/**\n\t * Returns `true` if the triangle is oriented towards the given direction.\n\t *\n\t * @param {Vector3} direction - The (normalized) direction vector.\n\t * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n\t */\n\tisFrontFacing( direction ) {\n\n\t\treturn Triangle.isFrontFacing( this.a, this.b, this.c, direction );\n\n\t}\n\n\t/**\n\t * Returns `true` if this triangle intersects with the given box.\n\t *\n\t * @param {Box3} box - The box to intersect.\n\t * @return {boolean} Whether this triangle intersects with the given box or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsTriangle( this );\n\n\t}\n\n\t/**\n\t * Returns the closest point on the triangle to the given point.\n\t *\n\t * @param {Vector3} p - The point to compute the closest point for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The closest point on the triangle.\n\t */\n\tclosestPointToPoint( p, target ) {\n\n\t\tconst a = this.a, b = this.b, c = this.c;\n\t\tlet v, w;\n\n\t\t// algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors( b, a );\n\t\t_vac.subVectors( c, a );\n\t\t_vap.subVectors( p, a );\n\t\tconst d1 = _vab.dot( _vap );\n\t\tconst d2 = _vac.dot( _vap );\n\t\tif ( d1 <= 0 && d2 <= 0 ) {\n\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy( a );\n\n\t\t}\n\n\t\t_vbp.subVectors( p, b );\n\t\tconst d3 = _vab.dot( _vbp );\n\t\tconst d4 = _vac.dot( _vbp );\n\t\tif ( d3 >= 0 && d4 <= d3 ) {\n\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy( b );\n\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\t\tif ( vc <= 0 && d1 >= 0 && d3 <= 0 ) {\n\n\t\t\tv = d1 / ( d1 - d3 );\n\t\t\t// edge region of AB; barycentric coords (1-v, v, 0)\n\t\t\treturn target.copy( a ).addScaledVector( _vab, v );\n\n\t\t}\n\n\t\t_vcp.subVectors( p, c );\n\t\tconst d5 = _vab.dot( _vcp );\n\t\tconst d6 = _vac.dot( _vcp );\n\t\tif ( d6 >= 0 && d5 <= d6 ) {\n\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy( c );\n\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\t\tif ( vb <= 0 && d2 >= 0 && d6 <= 0 ) {\n\n\t\t\tw = d2 / ( d2 - d6 );\n\t\t\t// edge region of AC; barycentric coords (1-w, 0, w)\n\t\t\treturn target.copy( a ).addScaledVector( _vac, w );\n\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\t\tif ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) {\n\n\t\t\t_vbc.subVectors( c, b );\n\t\t\tw = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) );\n\t\t\t// edge region of BC; barycentric coords (0, 1-w, w)\n\t\t\treturn target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC\n\n\t\t}\n\n\t\t// face region\n\t\tconst denom = 1 / ( va + vb + vc );\n\t\t// u = va * denom\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\n\t\treturn target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w );\n\n\t}\n\n\t/**\n\t * Returns `true` if this triangle is equal with the given one.\n\t *\n\t * @param {Triangle} triangle - The triangle to test for equality.\n\t * @return {boolean} Whether this triangle is equal with the given one.\n\t */\n\tequals( triangle ) {\n\n\t\treturn triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c );\n\n\t}\n\n}\n\nexport { Triangle };\n","import { Material } from './Material.js';\nimport { MultiplyOperation } from '../constants.js';\nimport { Color } from '../math/Color.js';\nimport { Euler } from '../math/Euler.js';\n\n/**\n * A material for drawing geometries in a simple shaded (flat or wireframe) way.\n *\n * This material is not affected by lights.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshBasicMaterial\n */\nclass MeshBasicMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh basic material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshBasicMaterial = true;\n\n\t\tthis.type = 'MeshBasicMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Specular map used by the material.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * How to combine the result of the surface's color with the environment map, if any.\n\t\t *\n\t\t * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to\n\t\t * blend between the two colors.\n\t\t *\n\t\t * @type {(MultiplyOperation|MixOperation|AddOperation)}\n\t\t * @default MultiplyOperation\n\t\t */\n\t\tthis.combine = MultiplyOperation;\n\n\t\t/**\n\t\t * How much the environment map affects the surface.\n\t\t * The valid range is between `0` (no reflections) and `1` (full reflections).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.reflectivity = 1;\n\n\t\t/**\n\t\t * The index of refraction (IOR) of air (approximately 1) divided by the\n\t\t * index of refraction of the material. It is used with environment mapping\n\t\t * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.\n\t\t * The refraction ratio should not exceed `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.98\n\t\t */\n\t\tthis.refractionRatio = 0.98;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nexport { MeshBasicMaterial };\n","import { Vector3 } from '../math/Vector3.js';\nimport { Vector2 } from '../math/Vector2.js';\nimport { Sphere } from '../math/Sphere.js';\nimport { Ray } from '../math/Ray.js';\nimport { Matrix4 } from '../math/Matrix4.js';\nimport { Object3D } from '../core/Object3D.js';\nimport { Triangle } from '../math/Triangle.js';\nimport { BackSide, FrontSide } from '../constants.js';\nimport { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js';\nimport { BufferGeometry } from '../core/BufferGeometry.js';\n\nconst _inverseMatrix = /*@__PURE__*/ new Matrix4();\nconst _ray = /*@__PURE__*/ new Ray();\nconst _sphere = /*@__PURE__*/ new Sphere();\nconst _sphereHitAt = /*@__PURE__*/ new Vector3();\n\nconst _vA = /*@__PURE__*/ new Vector3();\nconst _vB = /*@__PURE__*/ new Vector3();\nconst _vC = /*@__PURE__*/ new Vector3();\n\nconst _tempA = /*@__PURE__*/ new Vector3();\nconst _morphA = /*@__PURE__*/ new Vector3();\n\nconst _intersectionPoint = /*@__PURE__*/ new Vector3();\nconst _intersectionPointWorld = /*@__PURE__*/ new Vector3();\n\n/**\n * Class representing triangular polygon mesh based objects.\n *\n * ```js\n * const geometry = new THREE.BoxGeometry( 1, 1, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const mesh = new THREE.Mesh( geometry, material );\n * scene.add( mesh );\n * ```\n *\n * @augments Object3D\n */\nclass Mesh extends Object3D {\n\n\t/**\n\t * Constructs a new mesh.\n\t *\n\t * @param {BufferGeometry} [geometry] - The mesh geometry.\n\t * @param {Material|Array<Material>} [material] - The mesh material.\n\t */\n\tconstructor( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMesh = true;\n\n\t\tthis.type = 'Mesh';\n\n\t\t/**\n\t\t * The mesh geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = geometry;\n\n\t\t/**\n\t\t * The mesh material.\n\t\t *\n\t\t * @type {Material|Array<Material>}\n\t\t * @default MeshBasicMaterial\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * A dictionary representing the morph targets in the geometry. The key is the\n\t\t * morph targets name, the value its attribute index. This member is `undefined`\n\t\t * by default and only set when morph targets are detected in the geometry.\n\t\t *\n\t\t * @type {Object<string,number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetDictionary = undefined;\n\n\t\t/**\n\t\t * An array of weights typically in the range `[0,1]` that specify how much of the morph\n\t\t * is applied. This member is `undefined` by default and only set when morph targets are\n\t\t * detected in the geometry.\n\t\t *\n\t\t * @type {Array<number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetInfluences = undefined;\n\n\t\t/**\n\t\t * The number of instances of this mesh.\n\t\t * Can only be used with {@link WebGPURenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.count = 1;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.morphTargetInfluences !== undefined ) {\n\n\t\t\tthis.morphTargetInfluences = source.morphTargetInfluences.slice();\n\n\t\t}\n\n\t\tif ( source.morphTargetDictionary !== undefined ) {\n\n\t\t\tthis.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );\n\n\t\t}\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the values of {@link Mesh#morphTargetDictionary} and {@link Mesh#morphTargetInfluences}\n\t * to make sure existing morph targets can influence this 3D object.\n\t */\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns the local-space position of the vertex at the given index, taking into\n\t * account the current animation state of both morph targets and skinning.\n\t *\n\t * @param {number} index - The vertex index.\n\t * @param {Vector3} target - The target object that is used to store the method's result.\n\t * @return {Vector3} The vertex position in local space.\n\t */\n\tgetVertexPosition( index, target ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.attributes.position;\n\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\n\t\ttarget.fromBufferAttribute( position, index );\n\n\t\tconst morphInfluences = this.morphTargetInfluences;\n\n\t\tif ( morphPosition && morphInfluences ) {\n\n\t\t\t_morphA.set( 0, 0, 0 );\n\n\t\t\tfor ( let i = 0, il = morphPosition.length; i < il; i ++ ) {\n\n\t\t\t\tconst influence = morphInfluences[ i ];\n\t\t\t\tconst morphAttribute = morphPosition[ i ];\n\n\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t_tempA.fromBufferAttribute( morphAttribute, index );\n\n\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA.sub( target ), influence );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttarget.add( _morphA );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this line.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array<Object>} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere.copy( geometry.boundingSphere );\n\t\t_sphere.applyMatrix4( matrixWorld );\n\n\t\t// check distance from ray origin to bounding sphere\n\n\t\t_ray.copy( raycaster.ray ).recast( raycaster.near );\n\n\t\tif ( _sphere.containsPoint( _ray.origin ) === false ) {\n\n\t\t\tif ( _ray.intersectSphere( _sphere, _sphereHitAt ) === null ) return;\n\n\t\t\tif ( _ray.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;\n\n\t\t}\n\n\t\t// convert ray to local space of mesh\n\n\t\t_inverseMatrix.copy( matrixWorld ).invert();\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tif ( _ray.intersectsBox( geometry.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray );\n\n\t}\n\n\t_computeIntersections( raycaster, intersects, rayLocalSpace ) {\n\n\t\tlet intersection;\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\n\t\tconst index = geometry.index;\n\t\tconst position = geometry.attributes.position;\n\t\tconst uv = geometry.attributes.uv;\n\t\tconst uv1 = geometry.attributes.uv1;\n\t\tconst normal = geometry.attributes.normal;\n\t\tconst groups = geometry.groups;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\tif ( index !== null ) {\n\n\t\t\t// indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( index.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = index.getX( j );\n\t\t\t\t\t\tconst b = index.getX( j + 1 );\n\t\t\t\t\t\tconst c = index.getX( j + 2 );\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = index.getX( i );\n\t\t\t\t\tconst b = index.getX( i + 1 );\n\t\t\t\t\tconst c = index.getX( i + 2 );\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( position !== undefined ) {\n\n\t\t\t// non-indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( position.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = j;\n\t\t\t\t\t\tconst b = j + 1;\n\t\t\t\t\t\tconst c = j + 2;\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( position.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = i;\n\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\tconst c = i + 2;\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection( object, material, raycaster, ray, pA, pB, pC, point ) {\n\n\tlet intersect;\n\n\tif ( material.side === BackSide ) {\n\n\t\tintersect = ray.intersectTriangle( pC, pB, pA, true, point );\n\n\t} else {\n\n\t\tintersect = ray.intersectTriangle( pA, pB, pC, ( material.side === FrontSide ), point );\n\n\t}\n\n\tif ( intersect === null ) return null;\n\n\t_intersectionPointWorld.copy( point );\n\t_intersectionPointWorld.applyMatrix4( object.matrixWorld );\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return null;\n\n\treturn {\n\t\tdistance: distance,\n\t\tpoint: _intersectionPointWorld.clone(),\n\t\tobject: object\n\t};\n\n}\n\nfunction checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, normal, a, b, c ) {\n\n\tobject.getVertexPosition( a, _vA );\n\tobject.getVertexPosition( b, _vB );\n\tobject.getVertexPosition( c, _vC );\n\n\tconst intersection = checkIntersection( object, material, raycaster, ray, _vA, _vB, _vC, _intersectionPoint );\n\n\tif ( intersection ) {\n\n\t\tconst barycoord = new Vector3();\n\t\tTriangle.getBarycoord( _intersectionPoint, _vA, _vB, _vC, barycoord );\n\n\t\tif ( uv ) {\n\n\t\t\tintersection.uv = Triangle.getInterpolatedAttribute( uv, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( uv1 ) {\n\n\t\t\tintersection.uv1 = Triangle.getInterpolatedAttribute( uv1, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( normal ) {\n\n\t\t\tintersection.normal = Triangle.getInterpolatedAttribute( normal, a, b, c, barycoord, new Vector3() );\n\n\t\t\tif ( intersection.normal.dot( ray.direction ) > 0 ) {\n\n\t\t\t\tintersection.normal.multiplyScalar( - 1 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst face = {\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\tnormal: new Vector3(),\n\t\t\tmaterialIndex: 0\n\t\t};\n\n\t\tTriangle.getNormal( _vA, _vB, _vC, face.normal );\n\n\t\tintersection.face = face;\n\t\tintersection.barycoord = barycoord;\n\n\t}\n\n\treturn intersection;\n\n}\n\nexport { Mesh };\n","import { BufferGeometry } from '../core/BufferGeometry.js';\nimport { Float32BufferAttribute } from '../core/BufferAttribute.js';\nimport { Vector3 } from '../math/Vector3.js';\n\n/**\n * A class for generating a sphere geometry.\n *\n * ```js\n * const geometry = new THREE.SphereGeometry( 15, 32, 16 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const sphere = new THREE.Mesh( geometry, material );\n * scene.add( sphere );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#SphereGeometry\n */\nclass SphereGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new sphere geometry.\n\t *\n\t * @param {number} [radius=1] - The sphere radius.\n\t * @param {number} [widthSegments=32] - The number of horizontal segments. Minimum value is `3`.\n\t * @param {number} [heightSegments=16] - The number of vertical segments. Minimum value is `2`.\n\t * @param {number} [phiStart=0] - The horizontal starting angle in radians.\n\t * @param {number} [phiLength=Math.PI*2] - The horizontal sweep angle size.\n\t * @param {number} [thetaStart=0] - The vertical starting angle in radians.\n\t * @param {number} [thetaLength=Math.PI] - The vertical sweep angle size.\n\t */\n\tconstructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'SphereGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\twidthSegments = Math.max( 3, Math.floor( widthSegments ) );\n\t\theightSegments = Math.max( 2, Math.floor( heightSegments ) );\n\n\t\tconst thetaEnd = Math.min( thetaStart + thetaLength, Math.PI );\n\n\t\tlet index = 0;\n\t\tconst grid = [];\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let iy = 0; iy <= heightSegments; iy ++ ) {\n\n\t\t\tconst verticesRow = [];\n\n\t\t\tconst v = iy / heightSegments;\n\n\t\t\t// special case for the poles\n\n\t\t\tlet uOffset = 0;\n\n\t\t\tif ( iy === 0 && thetaStart === 0 ) {\n\n\t\t\t\tuOffset = 0.5 / widthSegments;\n\n\t\t\t} else if ( iy === heightSegments && thetaEnd === Math.PI ) {\n\n\t\t\t\tuOffset = - 0.5 / widthSegments;\n\n\t\t\t}\n\n\t\t\tfor ( let ix = 0; ix <= widthSegments; ix ++ ) {\n\n\t\t\t\tconst u = ix / widthSegments;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\t\t\t\tvertex.y = radius * Math.cos( thetaStart + v * thetaLength );\n\t\t\t\tvertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.copy( vertex ).normalize();\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( u + uOffset, 1 - v );\n\n\t\t\t\tverticesRow.push( index ++ );\n\n\t\t\t}\n\n\t\t\tgrid.push( verticesRow );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let iy = 0; iy < heightSegments; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < widthSegments; ix ++ ) {\n\n\t\t\t\tconst a = grid[ iy ][ ix + 1 ];\n\t\t\t\tconst b = grid[ iy ][ ix ];\n\t\t\t\tconst c = grid[ iy + 1 ][ ix ];\n\t\t\t\tconst d = grid[ iy + 1 ][ ix + 1 ];\n\n\t\t\t\tif ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d );\n\t\t\t\tif ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {SphereGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nexport { SphereGeometry };\n","import { Mesh } from '../objects/Mesh.js';\nimport { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js';\nimport { SphereGeometry } from '../geometries/SphereGeometry.js';\n\n/**\n * This displays a helper object consisting of a spherical mesh for\n * visualizing an instance of {@link PointLight}.\n *\n * ```js\n * const pointLight = new THREE.PointLight( 0xff0000, 1, 100 );\n * pointLight.position.set( 10, 10, 10 );\n * scene.add( pointLight );\n *\n * const sphereSize = 1;\n * const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );\n * scene.add( pointLightHelper );\n * ```\n *\n * @augments Mesh\n */\nclass PointLightHelper extends Mesh {\n\n\t/**\n\t * Constructs a new point light helper.\n\t *\n\t * @param {PointLight} light - The light to be visualized.\n\t * @param {number} [sphereSize=1] - The size of the sphere helper.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, sphereSize, color ) {\n\n\t\tconst geometry = new SphereGeometry( sphereSize, 4, 2 );\n\t\tconst material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {PointLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'PointLightHelper';\n\n\t\tthis.matrix = this.light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\t/*\n\t\tconst d = this.light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.visible = true;\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\t\t*/\n\n\t}\n\n}\n\n\nexport { PointLightHelper };\n"],"x_google_ignoreList":[0,1,2,3,4],"mappings":";;;;AAGA,IAAM,oBAAoB,IAAI,GAAS,EACjC,oBAAoB,IAAI,GAAS,EACjC,oBAAoB,IAAI,GAAS,EACjC,oBAAoB,IAAI,GAAS,EAEjC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAElC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAKlC,IAAN,MAAM,EAAS;CASd,YAAa,IAAI,IAAI,GAAS,EAAE,IAAI,IAAI,GAAS,EAAE,IAAI,IAAI,GAAS,EAAG;AAqBtE,EAdA,KAAK,IAAI,GAOT,KAAK,IAAI,GAOT,KAAK,IAAI;;CAaV,OAAO,UAAW,GAAG,GAAG,GAAG,GAAS;AAInC,EAFA,EAAO,WAAY,GAAG,EAAG,EACzB,EAAI,WAAY,GAAG,EAAG,EACtB,EAAO,MAAO,EAAK;EAEnB,IAAM,IAAiB,EAAO,UAAU;AAOxC,SANK,IAAiB,IAEd,EAAO,e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,SAAS,SAAS;;CAQxB,SAAS;AAIR,EAFA,KAAK,MAAM,kBAAmB,IAAM,GAAO,EAEtC,KAAK,UAAU,KAAA,IAMnB,KAAK,SAAS,MAAM,KAAM,KAAK,MAAM,MAAO,GAJ5C,KAAK,SAAS,MAAM,IAAK,KAAK,MAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Vector4-DUqY3Egg.mjs","names":[],"sources":["../../../../node_modules/three/src/math/Vector4.js"],"sourcesContent":["import { clamp } from './MathUtils.js';\n\n/**\n * Class representing a 4D vector. A 4D vector is an ordered quadruplet of numbers\n * (labeled x, y, z and w), which can be used to represent a number of things, such as:\n *\n * - A point in 4D space.\n * - A direction and length in 4D space. In three.js the length will\n * always be the Euclidean distance(straight-line distance) from `(0, 0, 0, 0)` to `(x, y, z, w)`\n * and the direction is also measured from `(0, 0, 0, 0)` towards `(x, y, z, w)`.\n * - Any arbitrary ordered quadruplet of numbers.\n *\n * There are other things a 4D vector can be used to represent, however these\n * are the most common uses in *three.js*.\n *\n * Iterating through a vector instance will yield its components `(x, y, z, w)` in\n * the corresponding order.\n * ```js\n * const a = new THREE.Vector4( 0, 1, 0, 0 );\n *\n * //no arguments; will be initialised to (0, 0, 0, 1)\n * const b = new THREE.Vector4( );\n *\n * const d = a.dot( b );\n * ```\n */\nclass Vector4 {\n\n\t/**\n\t * Constructs a new 4D vector.\n\t *\n\t * @param {number} [x=0] - The x value of this vector.\n\t * @param {number} [y=0] - The y value of this vector.\n\t * @param {number} [z=0] - The z value of this vector.\n\t * @param {number} [w=1] - The w value of this vector.\n\t */\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tVector4.prototype.isVector4 = true;\n\n\t\t/**\n\t\t * The x value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.x = x;\n\n\t\t/**\n\t\t * The y value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.y = y;\n\n\t\t/**\n\t\t * The z value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.z = z;\n\n\t\t/**\n\t\t * The w value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.w = w;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector4#z}.\n\t *\n\t * @type {number}\n\t */\n\tget width() {\n\n\t\treturn this.z;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.z = value;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector4#w}.\n\t *\n\t * @type {number}\n\t */\n\tget height() {\n\n\t\treturn this.w;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.w = value;\n\n\t}\n\n\t/**\n\t * Sets the vector components.\n\t *\n\t * @param {number} x - The value of the x component.\n\t * @param {number} y - The value of the y component.\n\t * @param {number} z - The value of the z component.\n\t * @param {number} w - The value of the w component.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tset( x, y, z, w ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the same value.\n\t *\n\t * @param {number} scalar - The value to set for all vector components.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's x component to the given value\n\t *\n\t * @param {number} x - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's y component to the given value\n\t *\n\t * @param {number} y - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's z component to the given value\n\t *\n\t * @param {number} z - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's w component to the given value\n\t *\n\t * @param {number} w - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetW( w ) {\n\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Allows to set a vector component with an index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n\t * `2` equals to z, `3` equals to w.\n\t * @param {number} value - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tcase 3: this.w = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the value of the vector component which matches the given index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n\t * `2` equals to z, `3` equals to w.\n\t * @return {number} A vector component value.\n\t */\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tcase 3: return this.w;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new vector with copied values from this instance.\n\t *\n\t * @return {Vector4} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z, this.w );\n\n\t}\n\n\t/**\n\t * Copies the values of the given vector to this instance.\n\t *\n\t * @param {Vector3|Vector4} v - The vector to copy.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = ( v.w !== undefined ) ? v.w : 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector to this instance.\n\t *\n\t * @param {Vector4} v - The vector to add.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to all components of this instance.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector4} a - The first vector.\n\t * @param {Vector4} b - The second vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector scaled by the given factor to this instance.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @param {number} s - The factor that scales `v`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vector from this instance.\n\t *\n\t * @param {Vector4} v - The vector to subtract.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given scalar value from all components of this instance.\n\t *\n\t * @param {number} s - The scalar to subtract.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector4} a - The first vector.\n\t * @param {Vector4} b - The second vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vector with this instance.\n\t *\n\t * @param {Vector4} v - The vector to multiply.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with all components of this instance.\n\t *\n\t * @param {number} scalar - The scalar to multiply.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies this vector with the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z, w = this.w;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;\n\t\tthis.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this instance by the given vector.\n\t *\n\t * @param {Vector4} v - The vector to divide.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\tthis.w /= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this vector by the given scalar.\n\t *\n\t * @param {number} scalar - The scalar to divide.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\t/**\n\t * Sets the x, y and z components of this\n\t * vector to the quaternion's axis and w to the angle.\n\t *\n\t * @param {Quaternion} q - The Quaternion to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetAxisAngleFromQuaternion( q ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\n\t\t// q is assumed to be normalized\n\n\t\tthis.w = 2 * Math.acos( q.w );\n\n\t\tconst s = Math.sqrt( 1 - q.w * q.w );\n\n\t\tif ( s < 0.0001 ) {\n\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\n\t\t} else {\n\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y and z components of this\n\t * vector to the axis of rotation and w to the angle.\n\t *\n\t * @param {Matrix4} m - A 4x4 matrix of which the upper left 3x3 matrix is a pure rotation matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetAxisAngleFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tlet angle, x, y, z; // variables for result\n\t\tconst epsilon = 0.01,\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\t\t// margin to distinguish between 0 and 180 degrees\n\n\t\t\tte = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tif ( ( Math.abs( m12 - m21 ) < epsilon ) &&\n\t\t ( Math.abs( m13 - m31 ) < epsilon ) &&\n\t\t ( Math.abs( m23 - m32 ) < epsilon ) ) {\n\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\n\t\t\tif ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m13 + m31 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m23 + m32 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {\n\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\n\t\t\t\tthis.set( 1, 0, 0, 0 );\n\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\n\t\t\t}\n\n\t\t\t// otherwise this singularity is angle = 180\n\n\t\t\tangle = Math.PI;\n\n\t\t\tconst xx = ( m11 + 1 ) / 2;\n\t\t\tconst yy = ( m22 + 1 ) / 2;\n\t\t\tconst zz = ( m33 + 1 ) / 2;\n\t\t\tconst xy = ( m12 + m21 ) / 4;\n\t\t\tconst xz = ( m13 + m31 ) / 4;\n\t\t\tconst yz = ( m23 + m32 ) / 4;\n\n\t\t\tif ( ( xx > yy ) && ( xx > zz ) ) {\n\n\t\t\t\t// m11 is the largest diagonal term\n\n\t\t\t\tif ( xx < epsilon ) {\n\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tx = Math.sqrt( xx );\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\n\t\t\t\t}\n\n\t\t\t} else if ( yy > zz ) {\n\n\t\t\t\t// m22 is the largest diagonal term\n\n\t\t\t\tif ( yy < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ty = Math.sqrt( yy );\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\n\t\t\t\tif ( zz < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tz = Math.sqrt( zz );\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.set( x, y, z, angle );\n\n\t\t\treturn this; // return 180 deg rotation\n\n\t\t}\n\n\t\t// as we have reached here there are no singularities so we can handle normally\n\n\t\tlet s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +\n\t\t\t( m13 - m31 ) * ( m13 - m31 ) +\n\t\t\t( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize\n\n\t\tif ( Math.abs( s ) < 0.001 ) s = 1;\n\n\t\t// prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = ( m32 - m23 ) / s;\n\t\tthis.y = ( m13 - m31 ) / s;\n\t\tthis.z = ( m21 - m12 ) / s;\n\t\tthis.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the position elements of the\n\t * given transformation matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\t\tthis.w = e[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is greater than the given vector's x, y, z or w\n\t * value, replace that value with the corresponding min value.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\t\tthis.w = Math.min( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is less than the given vector's x, y, z or w\n\t * value, replace that value with the corresponding max value.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\t\tthis.w = Math.max( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is greater than the max vector's x, y, z or w\n\t * value, it is replaced by the corresponding value.\n\t * If this vector's x, y, z or w value is less than the min vector's x, y, z or w value,\n\t * it is replaced by the corresponding value.\n\t *\n\t * @param {Vector4} min - The minimum x, y and z values.\n\t * @param {Vector4} max - The maximum x, y and z values in the desired range.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = clamp( this.x, min.x, max.x );\n\t\tthis.y = clamp( this.y, min.y, max.y );\n\t\tthis.z = clamp( this.z, min.z, max.z );\n\t\tthis.w = clamp( this.w, min.w, max.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w values are greater than the max value, they are\n\t * replaced by the max value.\n\t * If this vector's x, y, z or w values are less than the min value, they are\n\t * replaced by the min value.\n\t *\n\t * @param {number} minVal - The minimum value the components will be clamped to.\n\t * @param {number} maxVal - The maximum value the components will be clamped to.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = clamp( this.x, minVal, maxVal );\n\t\tthis.y = clamp( this.y, minVal, maxVal );\n\t\tthis.z = clamp( this.z, minVal, maxVal );\n\t\tthis.w = clamp( this.w, minVal, maxVal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's length is greater than the max value, it is replaced by\n\t * the max value.\n\t * If this vector's length is less than the min value, it is replaced by the\n\t * min value.\n\t *\n\t * @param {number} min - The minimum value the vector length will be clamped to.\n\t * @param {number} max - The maximum value the vector length will be clamped to.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( clamp( length, min, max ) );\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded down to the nearest integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\t\tthis.w = Math.floor( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded up to the nearest integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\t\tthis.w = Math.ceil( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded to the nearest integer value\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\t\tthis.w = Math.round( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded towards zero (up if negative,\n\t * down if positive) to an integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\t\tthis.w = Math.trunc( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this vector - i.e. sets x = -x, y = -y, z = -z, w = -w.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\t\tthis.w = - this.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of the given vector with this instance.\n\t *\n\t * @param {Vector4} v - The vector to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\n\t}\n\n\t/**\n\t * Computes the square of the Euclidean length (straight-line length) from\n\t * (0, 0, 0, 0) to (x, y, z, w). If you are comparing the lengths of vectors, you should\n\t * compare the length squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @return {number} The square length of this vector.\n\t */\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\n\t}\n\n\t/**\n\t * Computes the Euclidean length (straight-line length) from (0, 0, 0, 0) to (x, y, z, w).\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );\n\n\t}\n\n\t/**\n\t * Computes the Manhattan length of this vector.\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );\n\n\t}\n\n\t/**\n\t * Converts this vector to a unit vector - that is, sets it equal to a vector\n\t * with the same direction as this one, but with a vector length of `1`.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\t/**\n\t * Sets this vector to a vector with the same direction as this one, but\n\t * with the specified length.\n\t *\n\t * @param {number} length - The new length of this vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vector and this instance, where\n\t * alpha is the percent distance along the line - alpha = 0 will be this\n\t * vector, and alpha = 1 will be the given one.\n\t *\n\t * @param {Vector4} v - The vector to interpolate towards.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\t\tthis.w += ( v.w - this.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vectors, where alpha is the percent\n\t * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n\t * be the second one. The result is stored in this instance.\n\t *\n\t * @param {Vector4} v1 - The first vector.\n\t * @param {Vector4} v2 - The second vector.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\t\tthis.w = v1.w + ( v2.w - v1.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this vector is equal with the given one.\n\t *\n\t * @param {Vector4} v - The vector to test for equality.\n\t * @return {boolean} Whether this vector is equal with the given one.\n\t */\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) );\n\n\t}\n\n\t/**\n\t * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`,\n\t * z value to be `array[ offset + 2 ]`, w value to be `array[ offset + 3 ]`.\n\t *\n\t * @param {Array<number>} array - An array holding the vector component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\t\tthis.w = array[ offset + 3 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this vector to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array holding the vector components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number>} The vector components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\t\tarray[ offset + 3 ] = this.w;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this vector from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\t\tthis.w = attribute.getW( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets each component of this vector to a pseudo-random value between `0` and\n\t * `1`, excluding `1`.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\n\t}\n\n}\n\nexport { Vector4 };\n"],"x_google_ignoreList":[0],"mappings":";;AA0BA,IAAM,IAAN,MAAM,EAAQ;CAUb,YAAa,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAI;AAqCzC,EA5BA,EAAQ,UAAU,YAAY,IAO9B,KAAK,IAAI,GAOT,KAAK,IAAI,GAOT,KAAK,IAAI,GAOT,KAAK,IAAI;;CASV,IAAI,QAAQ;AAEX,SAAO,KAAK;;CAIb,IAAI,MAAO,GAAQ;AAElB,OAAK,IAAI;;CASV,IAAI,SAAS;AAEZ,SAAO,KAAK;;CAIb,IAAI,OAAQ,GAAQ;AAEnB,OAAK,IAAI;;CAaV,IAAK,GAAG,GAAG,GAAG,GAAI;AAOjB,SALA,KAAK,IAAI,GACT,KAAK,IAAI,GACT,KAAK,IAAI,GACT,KAAK,IAAI,GAEF;;CAUR,UAAW,GAAS;AAOnB,SALA,KAAK,IAAI,GACT,KAAK,IAAI,GACT,KAAK,IAAI,GACT,KAAK,IAAI,GAEF;;CAUR,KAAM,GAAI;AAIT,SAFA,KAAK,IAAI,GAEF;;CAUR,KAAM,GAAI;AAIT,SAFA,KAAK,IAAI,GAEF;;CAUR,KAAM,GAAI;AAIT,SAFA,KAAK,IAAI,GAEF;;CAUR,KAAM,GAAI;AAIT,SAFA,KAAK,IAAI,GA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"}
@@ -1,2 +0,0 @@
1
- import { t as e } from "./configurator-Cg1a9XSL.mjs";
2
- export { e as Configurator };
@@ -1,45 +0,0 @@
1
- import { E as e, J as t, O as n, S as r, Y as i, b as a, et as o, it as s, n as c, q as l, r as u, rt as d, t as f, tt as p, u as m, w as h } from "./main-CJ5TNhBt.mjs";
2
- import { t as g } from "./script-loader-DqaDm1FG.mjs";
3
- import { t as _ } from "./component-raycast-helper-C1qWqpRH.mjs";
4
- //#region packages/configurator-core/src/utils/injectables.ts
5
- var v = [
6
- new p("logger", i),
7
- new p("rapi-access", d),
8
- new p("script-loader", g),
9
- new p("camera-control-3d", r),
10
- new p("camera-control", h),
11
- new p("global-init-data", l),
12
- new p("data-syncer", t),
13
- new p("configurator-scene-manager", m, o.CONTEXT),
14
- new p("configurator-view-model", a, o.CONTEXT),
15
- new p("component-raycast-helper", _, o.GLOBAL)
16
- ], y = class extends c {
17
- setupDependencies() {
18
- u.setup(v), this.lookup("planner-kernel-access", this._context).init(n.CONFIGURATOR), this.lookup("rapi-access", this._context), this.lookup("script-loader", this._context), this.lookup("logger", this._context);
19
- }
20
- cleanUpGlobals() {
21
- delete window.RoomleConfigurator;
22
- }
23
- cleanUpDependencies() {
24
- let e = this.lookup("script-loader"), t = this.lookup("rapi-access");
25
- this.lookup("dom-helper");
26
- let n = this.lookup("configurator-scene-manager");
27
- e && e.cleanUp(), t && t.cleanUp(), n && n.cleanUp();
28
- }
29
- setupGlobals(e) {
30
- s.init(e ?? {});
31
- }
32
- getApi() {
33
- return this._configurator;
34
- }
35
- async bootFinished() {
36
- this._configurator = new e(this._context), this._configurator.getMain = () => this, window.RoomleConfigurator || (window.RoomleConfigurator = this._configurator);
37
- }
38
- getContextName() {
39
- return f.CONFIGURATOR;
40
- }
41
- };
42
- //#endregion
43
- export { y as t };
44
-
45
- //# sourceMappingURL=configurator-Cg1a9XSL.mjs.map
@@ -1,2 +0,0 @@
1
- import { o as e } from "./dimensioning-helper-GPn7Z8GE.mjs";
2
- export { e as createDimensioningHelper };
@@ -1,2 +0,0 @@
1
- import { t as e } from "./glb-viewer-tgKOPCaI.mjs";
2
- export { e as GlbViewer };
@@ -1 +0,0 @@
1
- {"version":3,"file":"glb-viewer-tgKOPCaI.mjs","names":[],"sources":["../../packages/glb-viewer-core/src/camera-control/adjustable-camera-control-3d.ts","../../packages/glb-viewer-core/src/webgl/glb-viewer-light-setting.ts","../../packages/glb-viewer-core/src/webgl/glb-viewer-scene-manager.ts","../../packages/glb-viewer-core/src/services/glb-render-worker.ts","../../../../node_modules/jszip/dist/jszip.min.js?no-inline?url","../../packages/glb-viewer-core/src/roomle-glb-viewer.ts","../../packages/glb-viewer-core/src/input/glb-input-manager.ts","../../packages/glb-viewer-core/src/utils/injectables.ts","../../packages/glb-viewer-core/src/glb-viewer.ts"],"sourcesContent":["import CameraControl3D from '../../../common-core/src/cameracontrol/camera-control-3d';\nimport { Box3, Euler, Quaternion, Vector3 } from 'three';\n\nexport default class AdjustableCameraControl3D extends CameraControl3D {\n public shouldIgnoreStandardBehavior = false;\n\n public adjust(\n bounds: Vector3,\n position: Vector3,\n\n yaw: number,\n pitch: number,\n _fov: number,\n ) {\n let minVector: Vector3 = new Vector3(-bounds.x / 2, 0, -bounds.z / 2);\n let maxVector: Vector3 = new Vector3(bounds.x / 2, bounds.y, bounds.z / 2);\n this._boundingBox = new Box3(minVector, maxVector);\n\n // before applying attis pitch value with have to rotate down, because we assume that attis rotation is upwards\n let euler = new Euler(-Math.PI / 2 + pitch, yaw, 0, 'ZYX');\n let quaternion = new Quaternion().setFromEuler(euler);\n\n this._camera.updateProjectionMatrix();\n\n this._camera.quaternion.copy(quaternion);\n this._camera.position.copy(position);\n }\n\n protected _update(overrideTarget?: Vector3) {\n if (!this.shouldIgnoreStandardBehavior) {\n super._update(overrideTarget);\n } else {\n this._saveYawAndPitch();\n }\n }\n\n public animateCamera(delta: number): boolean {\n if (!this.shouldIgnoreStandardBehavior) {\n return super.animateCamera(delta);\n } else {\n return true;\n }\n }\n}\n","import LightSetting from '../../../common-core/src/lightsetting/light-setting';\nimport type { ColorRepresentation, Scene } from 'three';\nimport { AmbientLight, Color } from 'three';\nimport type { GenericGUIParamFolder } from '../../../common-core/src/webgl/gui-types';\n\nexport default class GLBViewerLightSetting extends LightSetting {\n private _ambientLight: AmbientLight;\n\n private _params = {\n ambientLight: {\n color: '#ffffff',\n },\n };\n\n constructor(scene: Scene, oldLightSetting?: LightSetting) {\n super(scene, oldLightSetting);\n\n this._ambientLight = new AmbientLight(\n new Color(this._params.ambientLight.color as ColorRepresentation),\n 0.5,\n );\n\n this.addToScene();\n }\n\n public addToScene(): void {\n this._scene.add(this._ambientLight);\n }\n\n public removeFromScene(): void {\n this._scene.remove(this._ambientLight);\n }\n\n public reload(): void {\n this.removeFromScene();\n this.addToScene();\n }\n\n public showGUI(sceneParameters: GenericGUIParamFolder): void {\n if (this._ambientLight) {\n const ambientLightFolder = sceneParameters.addFolder('Ambient Light');\n ambientLightFolder.add(this._ambientLight, 'visible');\n ambientLightFolder\n .add(this._ambientLight, 'intensity')\n .min(0)\n .max(5)\n .step(0.1);\n ambientLightFolder\n .addColor(this._params.ambientLight, 'color')\n .onChange((color: string) => {\n this._ambientLight.color = new Color(color as ColorRepresentation);\n });\n }\n }\n}\n","import SceneManager from '../../../common-core/src/webgl/scene-manager';\nimport type {\n Base64Image,\n CanvasOffset,\n} from '../../../common-core/src/common-interfaces';\nimport AdjustableCameraControl3D from '../camera-control/adjustable-camera-control-3d';\nimport type { GLBRenderWorkerListener } from '../services/glb-render-worker';\nimport type InputManager from '../../../common-core/src/input/input-manager';\nimport inject from '../../../common-core/src/di/inject';\nimport type GlbInputManager from '../input/glb-input-manager';\n\nimport DefaultLightSetting from '../../../configurator-core/src/webgl/lightsetting/default-light-setting';\nimport { CAMERA_TYPE } from '../../../common-core/src/cameracontrol/camera-type';\nimport { dispose } from '../../../common-core/src/utils/threejs-utils';\nimport { type RapiAccess } from '../../../common-core/src/rapi-access';\nimport { getGlbUrl } from '../../../common-core/src/utils/common-utils';\nimport { CANVAS_ID } from '../../../common-core/src/utils/dom-helper';\nimport type { Enumify } from '#/common/src/utils/types';\nimport {\n BasicShadowMap,\n Box3,\n type Color,\n type Object3D,\n PerspectiveCamera,\n SRGBColorSpace,\n Vector3,\n WebGLRenderer,\n} from 'three';\nimport DynamicLightSettingLoader, {\n PREDEFINED_LIGHTSETTING,\n} from '../../../common-core/src/lightsetting/dynamic-light-setting-loader';\nimport GLBViewerLightSetting from './glb-viewer-light-setting';\nimport GlbViewerCameraBehaviour from '../../../common-core/src/cameracontrol/glb-viewer-camera-behaviour';\nimport {\n CAMERA_EVENT,\n type CameraParameter,\n} from '../../../common-core/src/cameracontrol/camera-control';\n\nexport default class GLBViewerSceneManager\n extends SceneManager\n implements GLBRenderWorkerListener\n{\n @inject\n private _glbInputManager: GlbInputManager;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n private _currentGLB: Object3D | null;\n private _standardSceneBackgroundColor: Color;\n\n private _itemsCount = 0;\n\n constructor(creator: string, offset: CanvasOffset) {\n super(creator, offset, CANVAS_ID.GLB, CAMERA_TYPE.CAMERA_3D);\n this._standardSceneBackgroundColor = this._scene.background as Color;\n if (this._initData.legacyLight && this._renderer instanceof WebGLRenderer) {\n if (this._renderer.capabilities.maxTextures > 8) {\n const lightSource =\n DynamicLightSettingLoader.createDynamicLightSettingSource(\n null,\n PREDEFINED_LIGHTSETTING.CAMERA,\n );\n if (lightSource) {\n this.loadDynamicLightSetting(lightSource);\n }\n } else {\n console.warn(\n 'this device has a maximum of 8 texture units thus we are using a simpler light setting',\n );\n this._lightSetting = new GLBViewerLightSetting(this._scene);\n }\n }\n }\n\n protected createCameraControl(\n _mode: Enumify<typeof CAMERA_TYPE>,\n _offset: CanvasOffset,\n ) {\n this._changeCameraBehaviour(\n new GlbViewerCameraBehaviour(\n new AdjustableCameraControl3D(\n this._creator_,\n this._getInputManager(),\n undefined,\n ),\n this._cameraBehaviourState,\n ),\n );\n }\n\n protected _getInputManager(): InputManager {\n return this._glbInputManager;\n }\n\n public async loadStaticItem(\n id: string,\n callback?: (percent: number) => void,\n ): Promise<void> {\n const rapiItem = await this._rapiAccess.getItem(id);\n if (rapiItem.configuration) {\n return Promise.reject();\n }\n const glbUrl = getGlbUrl(rapiItem);\n if (!glbUrl) {\n return Promise.reject(new Error('GLB Url not detected'));\n }\n return this.loadGLB(glbUrl, true, undefined, callback);\n }\n\n public loadGLB(\n url: string,\n automaticallyAdjustCamera: boolean = true,\n scaling: Vector3 = new Vector3(1, 1, 1),\n callback?: (percent: number) => void,\n ): Promise<void> {\n this.clearScene();\n return new Promise<void>((resolve, reject) => {\n this._loadGLB(\n url,\n new Vector3(0, 0, 0),\n 0,\n undefined,\n scaling,\n undefined,\n undefined,\n callback,\n ).then((glb) => {\n this._currentGLB = glb;\n this._scene.add(this._currentGLB);\n\n let boundingBox = new Box3().setFromObject(this._currentGLB);\n if (automaticallyAdjustCamera) {\n if (\n this.cameraBehaviour.cameraControl instanceof\n AdjustableCameraControl3D\n ) {\n this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(boundingBox);\n }\n }\n this._updateBounds(boundingBox, undefined, true);\n this._readyForRender();\n resolve();\n }, reject);\n });\n }\n\n public preparePerspectiveImage(\n renderer?: WebGLRenderer,\n width: number = 1000,\n height: number = 1000,\n ): Promise<Base64Image> {\n return new Promise<Base64Image>((resolve, reject) => {\n if (!renderer) {\n renderer = new WebGLRenderer({ antialias: true });\n renderer.setSize(width, height);\n renderer.outputColorSpace = SRGBColorSpace;\n renderer.autoClear = false;\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.type = BasicShadowMap;\n }\n\n let camera = this.cameraBehaviour.cameraControl.getCamera().clone();\n if (camera instanceof PerspectiveCamera) {\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n }\n\n this._lightSetting?.removeFromScene();\n let defaultLightSetting = new DefaultLightSetting(this._scene);\n\n renderer.render(this._scene, camera);\n let image = renderer.domElement.toDataURL();\n renderer.domElement.toBlob((blob) => {\n if (blob === null) {\n reject(new Error('Failed to create blob from canvas'));\n return;\n }\n resolve({ image, width, height, blob });\n }, 'image/png');\n\n defaultLightSetting.removeFromScene();\n this._lightSetting?.addToScene();\n });\n }\n\n public adjustCamera(\n position: Vector3,\n yaw: number,\n pitch: number,\n fov: number,\n ) {\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n let boundingBox = new Box3().setFromObject(this._scene);\n let bounds = boundingBox.getSize(new Vector3());\n (this.cameraBehaviour.cameraControl as AdjustableCameraControl3D).adjust(\n bounds,\n position,\n yaw,\n pitch,\n fov,\n );\n this._requestRender();\n }\n }\n\n public onStart(count: number) {\n this._itemsCount = count;\n this._scene.background = null;\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n (\n this.cameraBehaviour.cameraControl as AdjustableCameraControl3D\n ).shouldIgnoreStandardBehavior = true;\n }\n console.log('start processing ' + count + ' items');\n }\n\n public onElementFinished(itemsFinished: number) {\n console.log(\n 'processed ' +\n itemsFinished +\n ' of ' +\n this._itemsCount +\n ' items (' +\n Math.round((100 / this._itemsCount) * itemsFinished) +\n '%)',\n );\n }\n\n public onFinished(_zip: any) {\n this._scene.background = this._standardSceneBackgroundColor;\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n (\n this.cameraBehaviour.cameraControl as AdjustableCameraControl3D\n ).shouldIgnoreStandardBehavior = false;\n }\n }\n\n public clearScene() {\n if (this._currentGLB) {\n this._scene.remove(this._currentGLB);\n dispose(this._currentGLB);\n this._currentGLB = null;\n }\n super.clearScene();\n }\n\n public enableHD() {\n super.enableHD();\n }\n\n public sceneChanged(): void {\n //override when needed\n }\n\n getBounds(): Box3 | null {\n if (!this._currentGLB) {\n return null;\n }\n return new Box3().setFromObject(this._currentGLB);\n }\n\n protected get glbViewerCameraBehaviour(): GlbViewerCameraBehaviour {\n return this.cameraBehaviour as GlbViewerCameraBehaviour;\n }\n\n getGeometryBounds(): Box3 | null {\n return null;\n }\n\n cameraBehaviourChanged(updateDistance: boolean = true) {\n super.cameraBehaviourChanged(updateDistance);\n\n this.cameraBehaviour.cameraControl.addEventListener(\n CAMERA_EVENT.ZOOM_IN,\n () => {\n this._requestRender();\n },\n this,\n );\n this.cameraBehaviour.cameraControl.addEventListener(\n CAMERA_EVENT.ZOOM_OUT,\n () => {\n this._requestRender();\n },\n this,\n );\n }\n\n public async moveCamera(cameraParameter: CameraParameter): Promise<void> {\n return this.glbViewerCameraBehaviour.externalApiMoveCamera(cameraParameter);\n }\n\n // info when scene is ready to render, used for testing\n protected _readyForRender() {\n console.log('ready_for_render');\n this._globalCallback.onReadyForRender();\n }\n}\n","import type { Base64Image } from '../../../common-core/src/common-interfaces';\nimport type GLBViewerSceneManager from '../webgl/glb-viewer-scene-manager';\nimport type { RenderEntry } from '../roomle-glb-viewer';\nimport { SRGBColorSpace, Vector3, WebGLRenderer } from 'three';\n\ninterface GLBRenderEntry {\n name: string;\n url: string;\n position: Vector3;\n fov: number;\n yaw: number;\n pitch: number;\n}\n\nexport interface GLBRenderWorkerListener {\n onStart(count: number): void;\n\n onElementFinished(finishedElements: number): void;\n\n onFinished(zip: any): void;\n}\n\nexport default class GLBRenderWorker {\n private _sceneManager: GLBViewerSceneManager;\n private _entries: GLBRenderEntry[];\n\n private _resolve: (zip: any) => void;\n\n private _prefix = 'https://furniture.roomle.com/3d/glb/';\n\n private _renderer: WebGLRenderer;\n private _width: number;\n private _height: number;\n\n private _listeners: Set<GLBRenderWorkerListener> =\n new Set<GLBRenderWorkerListener>();\n private _finishedItems: number = 0;\n\n private _zip: any;\n\n constructor(\n sceneManager: GLBViewerSceneManager,\n width: number,\n height: number,\n ) {\n this._sceneManager = sceneManager;\n\n this._renderer = new WebGLRenderer({ antialias: true, alpha: true });\n this._width = width;\n this._height = height;\n this._renderer.setSize(width, height);\n this._renderer.setClearColor(0xffffff, 0);\n this._renderer.outputColorSpace = SRGBColorSpace;\n }\n\n public addListener(listener: GLBRenderWorkerListener) {\n this._listeners.add(listener);\n }\n\n public removeListener(listener: GLBRenderWorkerListener) {\n this._listeners.delete(listener);\n }\n\n public start(entries: RenderEntry[]): Promise<any> {\n this._entries = [];\n entries.forEach((entry) => {\n this._entries.push(this._transform(entry)); // {name: url.replace('.glb', '.png'), url: this._prefix + url}\n });\n this._finishedItems = 0;\n this._listeners.forEach((listener) =>\n listener.onStart(this._entries.length),\n );\n this._zip = new (window as any).JSZip();\n this._doNextEntry();\n return new Promise<any>((resolve) => {\n this._resolve = resolve;\n });\n }\n\n private _transform(entry: RenderEntry): GLBRenderEntry {\n return {\n name: entry.path.replace('.glb', '.png'),\n url: this._prefix + entry.path,\n position: new Vector3(\n entry.camera.position.x,\n entry.camera.position.z,\n -entry.camera.position.y,\n ),\n fov: entry.camera.fieldOfView * 2, // * 2 because Atti suggested it after all images were cut on all sides\n yaw: entry.camera.rotation.z,\n pitch: entry.camera.rotation.x,\n };\n }\n\n private _doNextEntry() {\n if (this._entries.length === 0) {\n this._listeners.forEach((listener) => listener.onFinished(this._zip));\n this._resolve(this._zip);\n } else {\n this._processEntry(this._entries[0]);\n }\n }\n\n private _processEntry(entry: GLBRenderEntry) {\n this._sceneManager.loadGLB(entry.url, false, undefined).then(() => {\n this._sceneManager.adjustCamera(\n entry.position,\n entry.yaw,\n entry.pitch,\n entry.fov,\n );\n this._sceneManager\n .preparePerspectiveImage(this._renderer, this._width, this._height)\n .then((base64Image) => {\n this._entryFinished(entry, base64Image);\n });\n });\n }\n\n private _entryFinished(entry: GLBRenderEntry, base64Image: Base64Image) {\n let index = this._entries.indexOf(entry);\n if (index > -1) {\n this._entries.splice(index, 1);\n }\n this._finishedItems++;\n this._listeners.forEach((listener) =>\n listener.onElementFinished(this._finishedItems),\n );\n this._zip.file(entry.name, base64Image.blob);\n this._doNextEntry();\n }\n}\n","export default \"__VITE_ASSET__WPGYjwIlzWVNM1bYhOc83w__\"","import type ScriptLoader from '../../common-core/src/script-loader';\nimport type DomHelper from '../../common-core/src/utils/dom-helper';\nimport inject from '../../common-core/src/di/inject';\nimport GLBViewerSceneManager from './webgl/glb-viewer-scene-manager';\nimport type {\n Base64Image,\n CanvasOffset,\n Position3,\n} from '../../common-core/src/common-interfaces';\nimport GLBRenderWorker from './services/glb-render-worker';\nimport type { ExternalEmbeddable, GlobalAPI } from '../../common-core/src/main';\nimport type { Main } from '../../common-core/src/main';\nimport type { Context } from '../../common-core/src/di/context';\nimport type { LifeCycleManager } from '../../common-core/src/life-cycle-manager';\nimport type { SceneSettings } from '../../common-core/src/scene-settings-loader';\nimport { JS_ZIP_FILE_NAME } from '../../common-core/src/static-files/libs';\nimport type InitData from '../../common-core/src/utils/init-data';\nimport type {\n GlobalInitDataDefinition,\n InitDataDefinition,\n} from '../../common-core/src/utils/shims';\nimport type GlobalInitData from '../../common-core/src/utils/global-init-data';\nimport { type RapiAccess } from '../../common-core/src/rapi-access';\nimport type UnitFormatter from '../../configurator-core/src/services/unit-formatter';\nimport { download } from '../../common-core/src/utils/common-utils';\nimport type { Scene } from 'three';\nimport { Vector3 } from 'three';\nimport { type IdbManager } from '../../common-core/src/services/idb-manager';\nimport type { CameraParameter } from '../../common-core/src/cameracontrol/camera-control';\nimport type { GlobalCallback } from '../../common-core/src/services/global-callback';\n\ninterface RenderCameraInformation {\n fieldOfView: number;\n rotation: Position3;\n position: Position3;\n}\n\nexport declare interface RenderEntry {\n path: string;\n camera: RenderCameraInformation;\n}\n\nexport class GlbViewerUiCallbacks {}\n\nexport class RoomleGLBViewer\n implements GlobalAPI, Context, ExternalEmbeddable<GlbViewerUiCallbacks>\n{\n public _creator_: string;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n @inject\n private _domHelper: DomHelper;\n\n @inject\n private _scriptLoader: ScriptLoader;\n\n @inject\n private _lifeCycleManager: LifeCycleManager;\n\n @inject\n private _initData: InitData;\n\n @inject\n private _globalInitData: GlobalInitData;\n\n @inject\n private _globalCallback: GlobalCallback;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n @inject\n protected _idbManager: IdbManager;\n\n private _sceneManager: GLBViewerSceneManager;\n\n private _currentIdOrUrl: string | null = null;\n\n constructor(creator: string) {\n this._creator_ = creator;\n }\n\n public setCameraOffset(offset: CanvasOffset): void {\n this._sceneManager.setCameraOffset(offset);\n }\n\n public getCameraOffset(): CanvasOffset {\n return this._sceneManager.getCameraOffset();\n }\n\n public init(\n element: HTMLElement,\n initData?: InitDataDefinition,\n ): Promise<void> {\n this.setOverrides(initData);\n this._domHelper.setDomElement(element);\n\n if (this._sceneManager) {\n this._lifeCycleManager.resume();\n return Promise.resolve();\n }\n\n return new Promise<void>(this._initPromiseCallback.bind(this));\n }\n\n private _initPromiseCallback(resolve: () => void, _reject: () => void) {\n this._sceneManager = new GLBViewerSceneManager(this._creator_, {\n left: 0,\n top: 1,\n right: 1,\n bottom: 0,\n });\n // this.loadGLB('https://furniture.roomle.com/3d/glb/furniture/vitra/41206600/41206600.glb');\n this._sceneManager.enableHD();\n resolve();\n }\n\n /**\n * Remove the current glb from the scene if it exists\n */\n public clearScene() {\n this._sceneManager.clearScene();\n }\n\n /**\n * Loads the GLB from the given URL Param\n * @param url\n * @param scaling defaults to 1\n * @param callback loading percent between 0 and 1\n */\n public loadGLB(\n url: string,\n scaling = 1,\n callback?: (percent: number) => void,\n ): Promise<void> {\n this._currentIdOrUrl = url;\n this._rapiAccess.trackView(url);\n return this._sceneManager.loadGLB(\n url,\n true,\n new Vector3(scaling, scaling, scaling),\n callback,\n );\n }\n\n /**\n * Loads the glb asset from the static item\n * @param staticItemId\n * @param callback loading percent between 0 and 1\n */\n public loadStaticItem(\n staticItemId: string,\n callback?: (percent: number) => void,\n ): Promise<void> {\n this._currentIdOrUrl = staticItemId;\n this._rapiAccess.trackView(staticItemId);\n return this._sceneManager.loadStaticItem(staticItemId, callback);\n }\n\n /**\n * Returns the current item id or url of the loaded object\n */\n public getCurrentId(): string | null {\n return this._currentIdOrUrl;\n }\n\n /**\n * Loads a SceneSettings object, currently it can can contain a light setting definition\n * (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loaderEnvironmentSetting}).\n * @param sceneSettings\n */\n public loadSceneSetting(sceneSettings: SceneSettings): Promise<void> {\n return this._sceneManager.loadSceneSettings(sceneSettings);\n }\n\n public preparePerspectiveImage(): Promise<Base64Image> {\n return this._sceneManager.preparePerspectiveImage();\n }\n\n public processRenderList(\n jsonString: string,\n width: number = 320,\n height: number = 320,\n ) {\n const object = JSON.parse(jsonString);\n this._scriptLoader.fetch(JS_ZIP_FILE_NAME, { id: 'jszip-js' }).then(() => {\n const worker = new GLBRenderWorker(this._sceneManager, width, height);\n worker.addListener(this._sceneManager);\n worker.start(object.items).then((zip: any) => {\n zip.generateAsync({ type: 'blob' }).then((content: File) => {\n download('content.zip', URL.createObjectURL(content));\n worker.removeListener(this._sceneManager);\n });\n });\n });\n }\n\n public setOverrides(\n initData:\n | Partial<InitDataDefinition & GlobalInitDataDefinition>\n | InitData\n | undefined,\n ): void {\n if (!initData) {\n return;\n }\n this._initData.setOverrides(initData);\n this._globalInitData.setOverrides(initData);\n }\n\n public updateSize(): void {\n this._sceneManager.updateCamera();\n }\n\n /**\n * Return the main class which has access to lifecycle events and RapiAccess.\n * Hidden because it's only useful for embedding API.\n * Has to be overridden by main class.\n * @hidden\n */\n public getMain(): Main | undefined {\n return undefined;\n }\n\n public resumeTest(element: HTMLElement) {\n this._domHelper.setDomElement(element);\n this._lifeCycleManager.resume();\n }\n\n public pauseTest() {\n this._lifeCycleManager.pause();\n }\n\n public showGUI() {\n this._sceneManager.showGUI();\n }\n\n public get callbacks() {\n return {};\n }\n\n public getScene(): Scene {\n return this._sceneManager.getScene();\n }\n\n public updateScene(): void {\n this._sceneManager.updateScene();\n }\n\n /**\n * returns unit formatter for formatting input und output values in scene\n */\n public getUnitFormatter(): UnitFormatter {\n return this._unitFormatter;\n }\n\n /**\n * returns manager class to interface with indexedDB storage\n */\n public getStorage(): IdbManager {\n return this._idbManager;\n }\n\n public setEnvironmentMap(params: {\n url?: string;\n intensity?: number;\n rotation?: number;\n maxLightSources?: number;\n }): void {\n const { url, intensity, rotation, maxLightSources } = params;\n this._sceneManager.setEnvironmentMap(\n url,\n intensity,\n rotation,\n maxLightSources,\n );\n }\n\n public exportCanvasScreenshot(quality?: number): Promise<string> {\n return this._sceneManager.exportCanvasScreenshot(quality);\n }\n\n public async moveCamera(cameraParameter: CameraParameter): Promise<void> {\n return this._sceneManager.moveCamera(cameraParameter);\n }\n\n /**\n * @internal\n * Use this callbacks to hook in your functionality\n */\n public get globalCallbacks(): GlobalCallback {\n return this._globalCallback;\n }\n}\n","import InputManager from '../../../common-core/src/input/input-manager';\n\nexport default class GlbInputManager extends InputManager {\n //move on, nothing to see here\n}\n","import Logger from '../../../common-core/src/logger';\nimport ScriptLoader from '../../../common-core/src/script-loader';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport GlbInputManager from '../input/glb-input-manager';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment(\n 'glb-input-manager',\n GlbInputManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport type Logger from '../../common-core/src/logger';\nimport { INJECTABLES } from './utils/injectables';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport { RoomleGLBViewer } from './roomle-glb-viewer';\n\nexport class GlbViewer extends Main {\n private _viewer: RoomleGLBViewer;\n\n protected setupGlobals(): void {\n //globals are initialized in bootFinished()\n }\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n this.lookup<Logger>('logger', this._context);\n }\n\n protected cleanUpGlobals(): void {\n throw new Error('Method not implemented.');\n }\n\n protected cleanUpDependencies(): void {\n throw new Error('Method not implemented.');\n }\n\n protected async bootFinished(): Promise<void> {\n this._viewer = new RoomleGLBViewer(this._context);\n\n if (!window.RoomleGLBViewer) {\n window.RoomleGLBViewer = this._viewer;\n }\n }\n\n public getApi(): RoomleGLBViewer {\n return this._viewer;\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.GLB_VIEWER;\n }\n}\n"],"x_google_ignoreList":[4],"mappings":";;;;;;;;AAGA,IAAqB,IAArB,cAAuD,EAAgB;;mDAC/B;;CAEtC,OACE,GACA,GAEA,GACA,GACA,GACA;AAGA,OAAK,eAAe,IAAI,EAFC,IAAI,EAAQ,CAAC,EAAO,IAAI,GAAG,GAAG,CAAC,EAAO,IAAI,EAAE,EAC5C,IAAI,EAAQ,EAAO,IAAI,GAAG,EAAO,GAAG,EAAO,IAAI,EAAE,CACxB;EAGlD,IAAI,IAAQ,IAAI,EAAM,CAAC,KAAK,KAAK,IAAI,GAAO,GAAK,GAAG,MAAM,EACtD,IAAa,IAAI,GAAY,CAAC,aAAa,EAAM;AAKrD,EAHA,KAAK,QAAQ,wBAAwB,EAErC,KAAK,QAAQ,WAAW,KAAK,EAAW,EACxC,KAAK,QAAQ,SAAS,KAAK,EAAS;;CAGtC,QAAkB,GAA0B;AAC1C,EAAK,KAAK,+BAGR,KAAK,kBAAkB,GAFvB,MAAM,QAAQ,EAAe;;CAMjC,cAAqB,GAAwB;AAEzC,SADG,KAAK,+BAGD,KAFA,MAAM,cAAc,EAAM;;GCjClB,IAArB,cAAmD,EAAa;CAS9D,YAAY,GAAc,GAAgC;AAQxD,EAPA,MAAM,GAAO,EAAgB,iBAPb,EAChB,cAAc,EACZ,OAAO,WACR,EACF,EAKC,KAAK,gBAAgB,IAAI,EACvB,IAAI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,aAAA,KAAA,EAAA,KAGA,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA,KAGA,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA,KAGA,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA,KAGA,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA;;;ACvEH,IAAqB,IAArB,cAA6C,EAAa,ICO7C,IAA+C;CAC1D,IAAI,EAA8B,iBAAiB,EAAa;CAChE,IAAI,EACF,qBACA,GACA,EAAQ,QACT;CACD,IAAI,EAA8B,UAAU,EAAO;CACnD,IAAI,EAA8B,eAAe,EAAA;CAClD,ECXY,IAAb,cAA+B,EAAK;CAGlC,eAA+B;CAI/B,oBAAoC;AAElC,EADA,EAA0B,MAAM,EAAY,EAC5C,KAAK,OAAe,UAAU,KAAK,SAAS;;CAG9C,iBAAiC;AAC/B,QAAU,MAAM,0BAA0B;;CAG5C,sBAAsC;AACpC,QAAU,MAAM,0BAA0B;;CAG5C,MAAgB,eAA8B;AAG5C,EAFA,KAAK,UAAU,IAAI,EAAgB,KAAK,SAAS,EAE5C,OAAO,oBACV,OAAO,kBAAkB,KAAK;;CAIlC,SAAiC;AAC/B,SAAO,KAAK;;CAGd,iBAAmC;AACjC,SAAO,EAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"highlight-coordinator-DRHeEU-E.mjs","names":[],"sources":["../../packages/configurator-core/src/utils/external-object-highlighting.ts","../../packages/configurator-core/src/utils/highlight-coordinator.ts"],"sourcesContent":["import { type RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';\nimport type ConfiguratorSceneEventHandler from '../webgl/configurator-scene-event-handler';\nimport type ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\nimport type {\n Object3D,\n PerspectiveCamera,\n MeshStandardMaterial,\n Material,\n} from 'three';\nimport { Mesh, MeshBasicMaterial, MeshPhysicalMaterial } from 'three';\nimport { CORE_PLAN_COMPONENT_TYPE } from '../../../typings/kernel';\nimport type { HighlightHelper } from './highlight-helper';\n\nexport default class ExternalObjectHighlighting implements HighlightHelper {\n private _needsUpdate: boolean = true;\n private _sceneHasPreviews: boolean = false;\n private _componentIds: number[] = [];\n private _object: Object3D | null = null;\n private _transparentMaterials = new Map<string, Material>();\n private _originalMaterials = new Map<string, MeshStandardMaterial>();\n\n public init(_object: Object3D, _camera: PerspectiveCamera) {\n this._needsUpdate = true;\n this._sceneHasPreviews = false;\n this._componentIds = [];\n this._object = _object;\n this._restoreAllMaterials();\n }\n\n public setCamera(_camera: PerspectiveCamera) {\n // no-op: external highlighting does not use camera\n }\n\n public setObject(_object: Object3D | null) {\n this._object = _object;\n this._needsUpdate = true;\n }\n\n public cancelDocking(_object: Object3D, _callback?: () => void) {\n this._needsUpdate = true;\n }\n\n public checkComponentAndPreviewVisibility(\n _sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n this._evaluatePreviewsAndUpdateTransparency(configuratorViewModel);\n }\n\n public checkComponentVisibility(\n _sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n this._evaluatePreviewsAndUpdateTransparency(configuratorViewModel);\n }\n\n public checkPreviewVisibility(configuratorViewModel: ConfiguratorViewModel) {\n this._evaluatePreviewsAndUpdateTransparency(configuratorViewModel);\n }\n\n private _evaluatePreviewsAndUpdateTransparency(\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n const sceneHasPreviews = configuratorViewModel.getPreviews().length > 0;\n if (this._sceneHasPreviews !== sceneHasPreviews) {\n this._sceneHasPreviews = sceneHasPreviews;\n this._needsUpdate = true;\n }\n this._updateMaterials();\n }\n\n public areAllComponentsInFrustum(_previews: RoomleComponent[]): boolean {\n // no-op: external object highlighting reacts to selection not camera movement\n return true;\n }\n\n public onSelectionChanged(\n _object: Object3D,\n componentIds: number[],\n callback?: () => void,\n ) {\n if (\n this._componentIds.length !== componentIds.length ||\n !this._componentIds.every((v, i) => v === componentIds[i])\n ) {\n this._needsUpdate = true;\n }\n this._componentIds = componentIds ?? [];\n this._updateMaterials();\n callback?.();\n }\n\n private _updateMaterials() {\n if (!this._needsUpdate) {\n return;\n }\n this._needsUpdate = false;\n if (!this._object) {\n return;\n }\n if (this._sceneHasPreviews || this._componentIds.length > 0) {\n this._makeNonComponentMeshesTransparent();\n } else {\n this._restoreAllMaterials();\n }\n }\n\n private _makeNonComponentMeshesTransparent() {\n if (!this._object || !this._object.hasOwnProperty('componentType')) {\n return;\n }\n const rootComponent = this._object as RoomleComponent;\n const transparent =\n this._componentIds.findIndex((id) => id === rootComponent.runtimeId) ===\n -1;\n this._recursivelySetTransparent(rootComponent, transparent);\n }\n\n private _recursivelySetTransparent(\n component: RoomleComponent,\n transparent: boolean,\n ) {\n component.children.forEach((child) => {\n this._setTransparency(child, transparent);\n });\n component.childComponents.forEach((childComponent) => {\n let childIsTransparent = transparent;\n if (this._sceneHasPreviews) {\n childIsTransparent = true;\n }\n if (\n this._componentIds.findIndex(\n (id) => id === childComponent.runtimeId,\n ) !== -1\n ) {\n childIsTransparent = false;\n } else if (\n childComponent.componentType.value ===\n CORE_PLAN_COMPONENT_TYPE.ROOT_MODULE\n ) {\n childIsTransparent = true;\n }\n this._recursivelySetTransparent(childComponent, childIsTransparent);\n });\n }\n\n private _setTransparency(child: Object3D, transparent: boolean) {\n if (\n !(child instanceof Mesh) ||\n !(child.material instanceof MeshPhysicalMaterial)\n ) {\n return;\n }\n if (transparent) {\n const originalMaterial =\n this._originalMaterials.get(child.uuid) ?? child.material;\n if (!this._originalMaterials.has(child.uuid)) {\n this._originalMaterials.set(child.uuid, child.material);\n }\n let transparentMaterial = this._transparentMaterials.get(\n originalMaterial.uuid,\n );\n if (!transparentMaterial) {\n //transparentMaterial = new MeshPhysicalMaterial();\n //transparentMaterial.copy(originalMaterial);\n transparentMaterial = new MeshBasicMaterial({ color: 0x808080 });\n transparentMaterial.opacity = 0.2;\n transparentMaterial.transparent = true;\n transparentMaterial.depthWrite = false;\n transparentMaterial.polygonOffset = true;\n transparentMaterial.polygonOffsetFactor = -1;\n transparentMaterial.polygonOffsetUnits = 1;\n this._transparentMaterials.set(\n originalMaterial.uuid,\n transparentMaterial,\n );\n }\n if (child.material !== transparentMaterial) {\n child.material = transparentMaterial;\n }\n } else {\n const originalMaterial = this._originalMaterials.get(child.uuid);\n if (originalMaterial) {\n child.material = originalMaterial;\n this._originalMaterials.delete(child.uuid);\n }\n }\n }\n\n private _restoreAllMaterials() {\n this._object?.traverse((child) => {\n if (child instanceof Mesh) {\n const originalMaterial = this._originalMaterials.get(child.uuid);\n if (originalMaterial) {\n child.material = originalMaterial;\n }\n }\n });\n this._originalMaterials.clear();\n for (const material of this._transparentMaterials.values()) {\n material.dispose();\n }\n this._transparentMaterials.clear();\n }\n}\n","import { type RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';\nimport type ConfiguratorSceneEventHandler from '../webgl/configurator-scene-event-handler';\nimport type ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\nimport type { Object3D, PerspectiveCamera } from 'three';\nimport type { HighlightHelper } from './highlight-helper';\nimport ComponentRaycastHelper from './component-raycast-helper';\nimport ExternalObjectHighlighting from './external-object-highlighting';\nimport { CORE_PLAN_COMPONENT_TYPE } from '../../../typings/kernel';\n\nexport interface HighlightCoordinatorOptions {\n transparentHighlighting?: boolean;\n externalTransparentHighlighting?: boolean;\n}\n\nexport default class HighlightCoordinator implements HighlightHelper {\n private _componentRaycastHelper: HighlightHelper | null = null;\n private _externalObjectHighlighting: HighlightHelper | null = null;\n private _isExternalObjectSelected: boolean = false;\n\n constructor(options: HighlightCoordinatorOptions) {\n if (options.transparentHighlighting) {\n this._componentRaycastHelper = new ComponentRaycastHelper();\n }\n if (options.externalTransparentHighlighting) {\n this._externalObjectHighlighting = new ExternalObjectHighlighting();\n }\n }\n\n private _isExternalObject(object: Object3D): boolean {\n return (\n object.hasOwnProperty('componentType') &&\n ((object as RoomleComponent).componentType.value ===\n CORE_PLAN_COMPONENT_TYPE.ROOT_MODULE ||\n (object as RoomleComponent).componentType.value ===\n CORE_PLAN_COMPONENT_TYPE.SUB_MODULE)\n );\n }\n\n private _getHighlightHelper(): HighlightHelper | null {\n return this._externalObjectHighlighting !== null &&\n this._isExternalObjectSelected\n ? this._externalObjectHighlighting\n : this._componentRaycastHelper;\n }\n\n public init(object: Object3D, camera: PerspectiveCamera) {\n this._isExternalObjectSelected = this._isExternalObject(object);\n this._componentRaycastHelper?.init(object, camera);\n this._externalObjectHighlighting?.init(object, camera);\n }\n\n public setCamera(camera: PerspectiveCamera) {\n this._componentRaycastHelper?.setCamera(camera);\n this._externalObjectHighlighting?.setCamera(camera);\n }\n\n public setObject(object: Object3D | null) {\n this._isExternalObjectSelected =\n object !== null && this._isExternalObject(object);\n this._componentRaycastHelper?.setObject(object);\n this._externalObjectHighlighting?.setObject(object);\n }\n\n public cancelDocking(object: Object3D, callback?: () => void) {\n this._getHighlightHelper()?.cancelDocking(object, callback);\n }\n\n public checkComponentAndPreviewVisibility(\n sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n this._getHighlightHelper()?.checkComponentAndPreviewVisibility(\n sceneEventHandler,\n configuratorViewModel,\n );\n }\n\n public checkComponentVisibility(\n sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n this._getHighlightHelper()?.checkComponentVisibility(\n sceneEventHandler,\n configuratorViewModel,\n );\n }\n\n public checkPreviewVisibility(configuratorViewModel: ConfiguratorViewModel) {\n this._getHighlightHelper()?.checkPreviewVisibility(configuratorViewModel);\n }\n\n public areAllComponentsInFrustum(previews: RoomleComponent[]): boolean {\n return (\n this._componentRaycastHelper?.areAllComponentsInFrustum(previews) ?? false\n );\n }\n\n public onSelectionChanged(\n object: Object3D,\n componentIds: number[],\n callback?: () => void,\n ) {\n this._getHighlightHelper()?.onSelectionChanged(\n object,\n componentIds,\n callback,\n );\n }\n}\n"],"mappings":";;;;AAaA,IAAqB,IAArB,MAA2E;;sBACzC,6BACK,yBACH,EAAE,iBACD,mDACH,IAAI,KAAuB,4CAC9B,IAAI,KAAmC;;CAEpE,KAAY,GAAmB,GAA4B;AAKzD,EAJA,KAAK,eAAe,IACpB,KAAK,oBAAoB,IACzB,KAAK,gBAAgB,EAAE,EACvB,KAAK,UAAU,GACf,KAAK,sBAAsB;;CAG7B,UAAiB,GAA4B;CAI7C,UAAiB,GAA0B;AAEzC,EADA,KAAK,UAAU,GACf,KAAK,eAAe;;CAGtB,cAAqB,GAAmB,GAAwB;AAC9D,OAAK,eAAe;;CAGtB,mCACE,GACA,GACA;AACA,OAAK,uCAAuC,EAAsB;;CAGpE,yBACE,GACA,GACA;AACA,OAAK,uCAAuC,EAAsB;;CAGpE,uBAA8B,GAA8C;AAC1E,OAAK,uCAAuC,EAAsB;;CAGpE,uCACE,GACA;EACA,IAAM,IAAmB,EAAsB,aAAa,CAAC,SAAS;AAKtE,EAJI,KAAK,sBAAsB,MAC7B,KAAK,oBAAoB,GACzB,KAAK,eAAe,KAEtB,KAAK,kBAAkB;;CAGzB,0BAAiC,GAAuC;AAEtE,SAAO;;CAGT,mBACE,GACA,GACA,GACA;AASA,GAPE,KAAK,cAAc,WAAW,EAAa,UAC3C,CAAC,KAAK,cAAc,OAAO,GAAG,MAAM,MAAM,EAAa,GAAG,MAE1D,KAAK,eAAe,KAEtB,KAAK,gBAAgB,KAAgB,EAAE,EACvC,KAAK,kBAAkB,EACvB,KAAY;;CAGd,mBAA2B;AACpB,OAAK,iBAGV,KAAK,eAAe,IACf,KAAK,YAGN,KAAK,qBAAqB,KAAK,cAAc,SAAS,IACxD,KAAK,oCAAoC,GAEzC,KAAK,sBAAsB;;CAI/B,qCAA6C;AAC3C,MAAI,CAA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yBAC1B,GACA,EACD;;CAGH,uBAA8B,GAA8C;AAC1E,OAAK,qBAAqB,EAAE,uBAAuB,EAAsB;;CAG3E,0BAAiC,GAAsC;AACrE,SACE,KAAK,yBAAyB,0BAA0B,EAAS,IAAI;;CAIzE,mBACE,GACA,GACA,GACA;AACA,OAAK,qBAAqB,EAAE,mBAC1B,GACA,GACA,EACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"homag-intelligence-D5mCTWgG.mjs","names":["native"],"sources":["../../../../node_modules/uuid/dist/esm-browser/stringify.js","../../../../node_modules/uuid/dist/esm-browser/rng.js","../../../../node_modules/uuid/dist/esm-browser/native.js","../../../../node_modules/uuid/dist/esm-browser/v4.js","../../packages/homag-intelligence/src/callbacks.ts","../../packages/homag-intelligence/src/orders.ts","../../packages/homag-intelligence/src/debug-logging.ts","../../packages/homag-intelligence/src/homag-intelligence.ts"],"sourcesContent":["import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n//# sourceMappingURL=data:application/json;base64,eyJ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==","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm5nLWJyb3dzZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcm5nLWJyb3dzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsSUFBSSxlQUEwRCxDQUFDO0FBRS9ELE1BQU0sS0FBSyxHQUFHLElBQUksVUFBVSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBRWpDLE1BQU0sQ0FBQyxPQUFPLFVBQVUsR0FBRztJQUV6QixJQUFJLENBQUMsZUFBZSxFQUFFLENBQUM7UUFDckIsSUFBSSxPQUFPLE1BQU0sS0FBSyxXQUFXLElBQUksQ0FBQyxNQUFNLENBQUMsZUFBZSxFQUFFLENBQUM7WUFDN0QsTUFBTSxJQUFJLEtBQUssQ0FDYiwwR0FBMEcsQ0FDM0csQ0FBQztRQUNKLENBQUM7UUFFRCxlQUFlLEdBQUcsTUFBTSxDQUFDLGVBQWUsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDeEQsQ0FBQztJQUVELE9BQU8sZUFBZSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ2hDLENBQUMifQ==","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF0aXZlLWJyb3dzZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbmF0aXZlLWJyb3dzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxVQUFVLEdBQ2QsT0FBTyxNQUFNLEtBQUssV0FBVyxJQUFJLE1BQU0sQ0FBQyxVQUFVLElBQUksTUFBTSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7QUFFdkYsZUFBZSxFQUFFLFVBQVUsRUFBRSxDQUFDIn0=","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random || (options.rng || rng)();\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidjQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdjQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxNQUFNLE1BQU0sYUFBYSxDQUFDO0FBQ2pDLE9BQU8sR0FBRyxNQUFNLFVBQVUsQ0FBQztBQUMzQixPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFJakQsU0FBUyxFQUFFLENBQUMsT0FBeUIsRUFBRSxHQUFnQixFQUFFLE1BQWU7SUFDdEUsSUFBSSxNQUFNLENBQUMsVUFBVSxJQUFJLENBQUMsR0FBRyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7UUFDMUMsT0FBTyxNQUFNLENBQUMsVUFBVSxFQUFFLENBQUM7SUFDN0IsQ0FBQztJQUVELE9BQU8sR0FBRyxPQUFPLElBQUksRUFBRSxDQUFDO0lBRXhCLE1BQU0sSUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLElBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxJQUFJLEdBQUcsQ0FBQyxFQUFFLENBQUM7SUFHdEQsSUFBSSxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxHQUFHLElBQUksQ0FBQyxHQUFHLElBQUksQ0FBQztJQUNsQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEdBQUcsSUFBSSxDQUFDLEdBQUcsSUFBSSxDQUFDO0lBR2xDLElBQUksR0FBRyxFQUFFLENBQUM7UUFDUixNQUFNLEdBQUcsTUFBTSxJQUFJLENBQUMsQ0FBQztRQUVyQixLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsRUFBRSxFQUFFLEVBQUUsQ0FBQyxFQUFFLENBQUM7WUFDNUIsR0FBRyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsR0FBRyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDNUIsQ0FBQztRQUVELE9BQU8sR0FBRyxDQUFDO0lBQ2IsQ0FBQztJQUVELE9BQU8sZUFBZSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQy9CLENBQUM7QUFFRCxlQUFlLEVBQUUsQ0FBQyJ9","import type { GlueLogic } from './glue-logic';\nimport { type RoomlePlanner } from '../../planner-core/src/roomle-planner';\nimport type { BASE_CONTEXT } from '../../common-core/src/main';\nimport type { SELECTION_MODE } from '../../configurator-core/src/utils/selection-handler';\nimport type { CallbackObjectType } from '../../planner-core/src/utils/planner-scene-utils';\nimport type { SelectionPayload } from '../../planner-core/src/roomle-planner-ui-callback';\nimport { type PlanElementViewModel } from '../../common-core/src/view-model/plan-element-view-model';\nimport type { CancelSelectionReasons } from '../../typings/planner';\n\nexport const initCallbacks = (\n roomlePlanner: RoomlePlanner,\n gluLogic: GlueLogic,\n) => {\n roomlePlanner.callbacks.onCompletelyLoaded = () => {\n gluLogic.groupsCompletelyLoaded();\n };\n\n roomlePlanner.callbacks.onExternalObjectModuleSelected = (\n groupId: string,\n rootModuleId: string | null,\n subModuleId: string | null,\n ) => {\n gluLogic.hiObjectSelection.groupOrModuleSelected(\n groupId,\n rootModuleId,\n subModuleId,\n );\n };\n\n roomlePlanner.callbacks.onContextChanged = (context: BASE_CONTEXT): void => {\n gluLogic.hiObjectSelection.contextChanged(context);\n };\n\n roomlePlanner.callbacks.onSelectionChange = (\n selectionMode: SELECTION_MODE,\n objectType: CallbackObjectType,\n payload: SelectionPayload,\n payloadPromise: Promise<SelectionPayload>,\n planElementViewModel: PlanElementViewModel,\n ): void => {\n gluLogic.hiObjectSelection.selectionChanged(\n selectionMode,\n objectType,\n payload,\n payloadPromise,\n planElementViewModel,\n );\n };\n\n roomlePlanner.callbacks.onSelectionCancel = (\n reason: CancelSelectionReasons,\n ): void => {\n gluLogic.hiObjectSelection.selectionCancel(reason);\n };\n};\n","import { type RoomlePlanner } from '../../planner-core/src/roomle-planner';\nimport type { GlueLogic } from './glue-logic';\nimport type { KernelPlanObject } from '../../typings/kernel';\nimport type { ExternalObjectSnapshotSaveResult } from './external-object-api';\nimport type {\n HiOrder,\n HiOrderData,\n HiOrderHeader,\n} from '#/common/src/hi/hi-types';\n\nconst getISO8601Date = (date = new Date()) => {\n // Get the ISO string (in UTC)\n let isoString = date.toISOString();\n\n // Remove the 'Z' at the end which indicates UTC\n isoString = isoString.slice(0, -1);\n\n // Find the position of milliseconds\n const msPosition = isoString.lastIndexOf('.');\n\n // Get the base timestamp with 3 digits of milliseconds and extend with zeros\n let baseTimestamp = isoString;\n\n if (msPosition !== -1) {\n // Add 4 zeros to extend from 3 to 7 digits of precision\n baseTimestamp = isoString.substring(0, msPosition + 4) + '0000';\n }\n\n // Get timezone offset in minutes and convert to hours and minutes\n const offsetMinutes = date.getTimezoneOffset();\n const offsetHours = Math.abs(Math.floor(offsetMinutes / 60));\n const offsetMins = Math.abs(offsetMinutes % 60);\n\n // Format the offset as +HH:MM or -HH:MM\n const offsetSign = offsetMinutes <= 0 ? '+' : '-';\n const offsetString = `${offsetSign}${String(offsetHours).padStart(\n 2,\n '0',\n )}:${String(offsetMins).padStart(2, '0')}`;\n\n return baseTimestamp + offsetString;\n};\n\nexport const createEmptyOrder = (): HiOrder => {\n return {\n id: (window as any).uuidv4\n ? (window as any).uuidv4()\n : '00000000-0000-0000-0000-000000000000',\n state: 'New',\n orderNumber: '736362',\n orderName: 'Bedroom & bathroom 01',\n orderDescription: 'Lorem ipsum dolor sit amet...',\n project: 'Single family house Müller John',\n personInCharge: 'Joe',\n orderDate: getISO8601Date(),\n deliveryDatePlanned: getISO8601Date(\n new Date(Date.now() + 14 * 24 * 60 * 60 * 1000),\n ),\n addresses: [\n {\n type: 'Delivery, Billing',\n street: 'Musterstraße',\n houseNumber: '1',\n postalCode: '12345',\n city: 'Musterstadt',\n country: 'Deutschland',\n },\n ],\n customerName: 'Müller & Co.',\n customerNumber: '462642',\n createdAt: getISO8601Date(),\n changedAt: getISO8601Date(),\n changedBy: 'Selfish',\n items: [] as any[],\n };\n};\n\nconst _addMerchantPositions = async (\n roomlePlanner: RoomlePlanner,\n groupData: any,\n) => {\n const planOverview = await roomlePlanner.getPlanOverview();\n const count: Record<string, number> = {}; // key is id and value is count\n const itemIds = (\n planOverview.objects as unknown as KernelPlanObject[]\n ).reduce((acc: string[], item: any) => {\n if (item.catalogItemId) {\n if (!count[item.catalogItemId]) {\n count[item.catalogItemId] = 0;\n acc.push(item.catalogItemId);\n }\n count[item.catalogItemId]++;\n }\n return acc;\n }, []);\n const items =\n Array.isArray(itemIds) && itemIds.length > 0\n ? await roomlePlanner.getRapiAccess().getItems(itemIds)\n : [];\n const merchantItems = items.filter((item: any) => {\n if (item.manufacturerSKU !== undefined) {\n item.count = count[item.id];\n return true;\n }\n return false;\n });\n if (Array.isArray(merchantItems) && merchantItems.length > 0) {\n if (!groupData.items) {\n groupData.items = [];\n }\n let posNo = groupData.items.reduce((acc: number, item: any) => {\n if (item.items?.length) {\n return acc + item.items.length;\n }\n return acc;\n }, 0);\n merchantItems.forEach((item) => {\n const pos = {} as any;\n pos.type = 'Position';\n pos.name = (++posNo).toString();\n pos.articleNumber = item.manufacturerSKU;\n pos.articleName = item.label;\n pos.catalog = item.catalog;\n pos.quantity = item.count;\n pos.height = item.displayedHeight;\n pos.width = item.displayedWidth;\n pos.depth = item.displayedDepth;\n pos.color = item.basecolor;\n pos.procurementType = 'PTO';\n pos.additionalData = [];\n if (item.perspectiveImage) {\n pos.additionalData.push({\n category: 'ArticleImage',\n downloadUri: item.perspectiveImage,\n type: 'Image',\n });\n }\n groupData.items.push(pos);\n });\n }\n};\n\nexport default class Orders {\n private _roomlePlanner: RoomlePlanner;\n private _glueLogic: GlueLogic;\n\n constructor(roomlePlanner: RoomlePlanner, glueLogic: GlueLogic) {\n this._roomlePlanner = roomlePlanner;\n this._glueLogic = glueLogic;\n }\n\n public async fetchPrice(planId?: string, orderHeader?: HiOrderHeader) {\n let orderData = await this._glueLogic.getGroupDataForOrder(planId);\n if (!orderData) {\n return null;\n }\n return await this._fetchOrderDataWithPrice(orderData, orderHeader);\n }\n\n public async placeOrder(\n withPrice: boolean = true,\n orderHeader?: HiOrderHeader,\n ) {\n const planData = await this._roomlePlanner.saveExternalObjectSnapshot();\n if (!planData) {\n console.error('Could not save plan snapshot before placing order');\n return;\n }\n\n let priceData = withPrice\n ? await this._fetchOrderDataWithPrice(planData.orderData, orderHeader)\n : null;\n\n let order;\n if (priceData) {\n order = priceData.orderData;\n } else {\n order = this._createOrder(orderHeader);\n order.items.push(planData.orderData as never);\n await _addMerchantPositions(this._roomlePlanner, planData.orderData);\n }\n\n // The first item in the order is the one created from the HI objects in the plan\n this._addAdditionalDataToOrder(order.items[0], planData);\n\n await this._glueLogic.hiCallbacks?.onPlaceOrder?.(order);\n }\n\n private _addAdditionalDataToOrder(\n orderData: HiOrderData,\n planData: ExternalObjectSnapshotSaveResult,\n ) {\n if (!Array.isArray(orderData.additionalData)) {\n orderData.additionalData = [];\n }\n if (planData.perspectiveImageLink) {\n orderData.additionalData.push({\n type: 'Image',\n category: 'OverviewImage',\n downloadUri: planData.perspectiveImageLink,\n });\n }\n if (planData.topImageLink) {\n orderData.additionalData.push({\n type: 'Image',\n category: 'AboveImage',\n downloadUri: planData.topImageLink,\n });\n }\n if (planData.objectGlbLink) {\n orderData.additionalData.push({\n type: 'ThreeD',\n category: 'ThreeDModel',\n downloadUri: planData.objectGlbLink,\n });\n }\n }\n\n private async _fetchOrderDataWithPrice(\n orderData: HiOrderData,\n orderHeader?: HiOrderHeader,\n ): Promise<any> {\n let order = this._createOrder(orderHeader);\n order.items.push(orderData as never);\n return this._glueLogic.hiCallbacks?.onFetchPrice?.(order) ?? null;\n }\n\n private _createOrder(orderHeader?: HiOrderHeader): HiOrder {\n return orderHeader\n ? {\n ...orderHeader,\n items: [],\n }\n : createEmptyOrder();\n }\n}\n","import type { HiCallbacks, HiOrderData } from '#/common/src/hi/hi-types';\nimport type {\n GlueLogic,\n LibraryData,\n RoomDesignerRequests,\n} from './glue-logic';\nimport type { ExternalObjectGroup } from 'roomle-core-hsc/src/embind/plannerCoreInterface';\nimport type { ExternalModuleInformation } from '../../typings/kernel';\nimport type {\n CheckDropDownResult,\n PosArticle,\n PosGroup,\n PosSaveData,\n} from './model/oc-scripts-domain.model';\nimport type { HiObjectSelectionApi } from './hi-object-selection';\nimport type {\n ExternalObjectSnapshotSaveResult,\n ExternalRoomInformation,\n LoadExternalObjectOptions,\n} from './external-object-api';\nimport type { ExternalObjectValidContainerModules } from './external-object-api-callbacks';\n\nexport class GlueLayerRequestDebugLogging implements GlueLogic {\n private _glueLogic: GlueLogic;\n private _hiCallbacks: HiCallbacks;\n\n constructor(glueLogic: GlueLogic, hiCallbacks: HiCallbacks) {\n this._glueLogic = glueLogic;\n this._hiCallbacks = hiCallbacks;\n }\n\n public get hiCallbacks(): HiCallbacks | null {\n return this._hiCallbacks;\n }\n\n public get hiObjectSelection(): HiObjectSelectionApi {\n return this._glueLogic.hiObjectSelection;\n }\n\n private _logRequest(\n message: string,\n ...args: Array<string | null | undefined>\n ) {\n let messageAndArgs = message;\n if (args) {\n args.forEach((item) => {\n messageAndArgs += ' ' + item;\n });\n }\n this._hiCallbacks.onLogMessage?.('HI REQUEST', messageAndArgs);\n }\n\n public isLibraryLoaded(libraryId: string): boolean {\n return this._glueLogic.isLibraryLoaded(libraryId);\n }\n\n public getLibraryData(libraryId: string): LibraryData | null {\n return this._glueLogic.getLibraryData(libraryId);\n }\n\n public addLibrary(libraryData: LibraryData): Promise<void> {\n this._logRequest('addLibrary', libraryData.libraryId);\n return this._glueLogic.addLibrary(libraryData);\n }\n\n public setPosDataForLoading(posData: PosSaveData | null): Promise<void> {\n this._logRequest('setPosDataForLoading', posData ? 'set' : 'null');\n return this._glueLogic.setPosDataForLoading(posData);\n }\n\n public loadPosData(articleCatalogJson: any, libraryId: string): void {\n this._logRequest('loadPosData', libraryId);\n this._glueLogic.loadPosData(articleCatalogJson, libraryId);\n }\n\n public async mergeGroups(\n targetGroup: ExternalObjectGroup,\n idsOfGroupsMerged: string | string[],\n idOfTargetRootModule: string,\n mergedWithDragging: boolean,\n ): Promise<void> {\n this._logRequest(\n 'mergeGroups',\n targetGroup.groupId,\n JSON.stringify(idsOfGroupsMerged),\n idOfTargetRootModule,\n );\n return this._glueLogic.mergeGroups(\n targetGroup,\n idsOfGroupsMerged,\n idOfTargetRootModule,\n mergedWithDragging,\n );\n }\n\n public deleteRootModule(\n remainingGroup: ExternalObjectGroup,\n rootModuleIdToDelete: string,\n splitOffGroups: ExternalObjectGroup[],\n ): Promise<void> {\n this._logRequest(\n 'deleteRootModule',\n JSON.stringify(remainingGroup),\n rootModuleIdToDelete,\n JSON.stringify(splitOffGroups),\n );\n return this._glueLogic.deleteRootModule(\n remainingGroup,\n rootModuleIdToDelete,\n splitOffGroups,\n );\n }\n\n public splitRootModuleFromGroup(\n splitGroup: ExternalObjectGroup,\n newGroupedRootModules: ExternalObjectGroup[],\n ): Promise<void> {\n this._logRequest(\n 'splitRootModuleFromGroup',\n JSON.stringify(splitGroup),\n JSON.stringify(newGroupedRootModules),\n );\n return this._glueLogic.splitRootModuleFromGroup(\n splitGroup,\n newGroupedRootModules,\n );\n }\n\n public async duplicateGroup(\n duplicatedGroup: ExternalObjectGroup,\n ): Promise<void> {\n this._logRequest('duplicateGroup', duplicatedGroup.groupId);\n return this._glueLogic.duplicateGroup(duplicatedGroup);\n }\n\n public modifyAttribute(\n groupId: string,\n moduleIdObjects: ExternalModuleInformation[],\n attributeName: string,\n value: string,\n ): Promise<void> {\n this._logRequest(\n 'modifyAttribute',\n groupId,\n JSON.stringify(moduleIdObjects),\n attributeName,\n value,\n );\n return this._glueLogic.modifyAttribute(\n groupId,\n moduleIdObjects,\n attributeName,\n value,\n );\n }\n\n public updateAttribute(\n rootModuleId: string,\n moduleId: string | null,\n attributeId: string,\n attributeValue: string | boolean,\n ): Promise<void> {\n this._logRequest(\n 'updateAttribute',\n rootModuleId,\n moduleId,\n attributeId,\n attributeValue.toString(),\n );\n return this._glueLogic.updateAttribute(\n rootModuleId,\n moduleId,\n attributeId,\n attributeValue,\n );\n }\n\n public getVerifiedAttributeOptions(\n moduleId: string,\n attributeIds?: string | string[],\n ): Promise<Record<string, CheckDropDownResult> | undefined> {\n this._logRequest(\n 'getVerifiedAttributeOptions',\n moduleId,\n attributeIds ? JSON.stringify(attributeIds) : '[]',\n );\n return this._glueLogic.getVerifiedAttributeOptions(moduleId, attributeIds);\n }\n\n public getVerifiedGroupAttributeOptions(\n groupId: string,\n attributeIds?: string | string[],\n ): Promise<Record<string, CheckDropDownResult> | undefined> {\n this._logRequest(\n 'getVerifiedGroupAttributeOptions',\n groupId,\n attributeIds ? JSON.stringify(attributeIds) : '[]',\n );\n return this._glueLogic.getVerifiedGroupAttributeOptions(\n groupId,\n attributeIds,\n );\n }\n\n public updateProperty(\n rootModuleId?: string,\n propertyName?: string,\n propertyValue?: string | number | boolean,\n ): void {\n this._logRequest(\n 'updateProperty',\n rootModuleId ?? 'undefined',\n propertyName ?? 'undefined',\n propertyValue?.toString() ?? 'undefined',\n );\n this._glueLogic.updateProperty(rootModuleId, propertyName, propertyValue);\n }\n\n public findValidSubArticles(posGroupIds: string[] | string): PosArticle[] {\n this._logRequest(\n 'findValidSubArticles',\n Array.isArray(posGroupIds) ? JSON.stringify(posGroupIds) : posGroupIds,\n );\n return this._glueLogic.findValidSubArticles(posGroupIds);\n }\n\n public getValidContainerModulesForSubArticle(\n posGroupIds: string[] | string,\n subArticleId: string,\n ): ExternalObjectValidContainerModules[] {\n this._logRequest(\n 'getValidContainerModulesForSubArticle',\n Array.isArray(posGroupIds) ? JSON.stringify(posGroupIds) : posGroupIds,\n subArticleId,\n );\n return this._glueLogic.getValidContainerModulesForSubArticle(\n posGroupIds,\n subArticleId,\n );\n }\n\n public addSubArticle(\n articleId: string,\n rootModuleId: string,\n parentModuleId: string,\n insertPosition?: number[],\n ): void {\n this._logRequest(\n 'addSubArticle',\n articleId,\n rootModuleId,\n parentModuleId,\n insertPosition ? JSON.stringify(insertPosition) : 'undefined',\n );\n return this._glueLogic.addSubArticle(\n articleId,\n rootModuleId,\n parentModuleId,\n insertPosition,\n );\n }\n\n public deleteSubArticles(\n groupId: string,\n subModuleIds: string[] | string,\n ): Promise<void> {\n this._logRequest(\n 'deleteSubArticles',\n groupId,\n Array.isArray(subModuleIds) ? JSON.stringify(subModuleIds) : subModuleIds,\n );\n return this._glueLogic.deleteSubArticles(groupId, subModuleIds);\n }\n\n public swapRootModule(\n groupId: string,\n rootModuleId: string,\n articleId: string,\n ): Promise<void> {\n this._logRequest('swapRootModule', groupId, rootModuleId, articleId);\n return this._glueLogic.swapRootModule(groupId, rootModuleId, articleId);\n }\n\n public arrangeRootModulesOfGroup(\n changedGroup: ExternalObjectGroup,\n ): Promise<void> {\n this._logRequest('arrangeRootModulesOfGroup', JSON.stringify(changedGroup));\n return this._glueLogic.arrangeRootModulesOfGroup(changedGroup);\n }\n\n public changedGroupPlanningSituation(\n changedGroup: ExternalObjectGroup,\n objectPositionChanged: boolean,\n ): Promise<void> {\n this._logRequest(\n 'changedGroupPlanningSituation',\n changedGroup.groupId,\n objectPositionChanged.toString(),\n );\n return this._glueLogic.changedGroupPlanningSituation(\n changedGroup,\n objectPositionChanged,\n );\n }\n\n public changedGroupFromHistory(\n posDataJson: PosGroup,\n reloadGroup: boolean,\n ): void {\n this._logRequest(\n 'changedGroupFromHistory',\n posDataJson.id,\n reloadGroup.toString(),\n );\n this._glueLogic.changedGroupFromHistory(posDataJson, reloadGroup);\n }\n\n public loadedGroup(posDataJson: PosGroup): Promise<void> {\n this._logRequest('loadedGroup', posDataJson.id);\n return this._glueLogic.loadedGroup(posDataJson);\n }\n\n public groupsCompletelyLoaded(): void {\n this._logRequest('groupsCompletelyLoaded');\n this._glueLogic.groupsCompletelyLoaded();\n }\n\n public removedGroup(groupId: string): void {\n this._logRequest('removedGroup', groupId);\n this._glueLogic.removedGroup(groupId);\n }\n\n public openCloseGroup(groupId: string): void {\n this._logRequest('openCloseGroup', groupId);\n this._glueLogic.openCloseGroup(groupId);\n }\n\n public getSaveDataGroups(): Promise<PosGroup[] | null> {\n this._logRequest('getSaveDataGroups');\n return this._glueLogic.getSaveDataGroups();\n }\n\n public getSubArticleId(id: string): string | undefined {\n this._logRequest('getSubArticleId', id);\n return this._glueLogic.getSubArticleId(id);\n }\n\n public async newPosDataFromId(id: string): Promise<PosGroup | undefined> {\n this._logRequest('newPosDataFromId', id);\n return this._glueLogic.newPosDataFromId(id);\n }\n\n public async newPosDataFromGroup(posDataJson: PosGroup): Promise<PosGroup> {\n this._logRequest('newPosDataFromId', JSON.stringify(posDataJson));\n return this._glueLogic.newPosDataFromGroup(posDataJson);\n }\n\n public getGroupDataForOrder(\n roomlePlannerId?: string,\n ): Promise<HiOrderData | null> {\n this._logRequest('getGroupDataForOrder', roomlePlannerId);\n return this._glueLogic.getGroupDataForOrder(roomlePlannerId);\n }\n\n public getMaterialUrl(\n materialId: string,\n groupOrModuleId?: string,\n ): string | null {\n this._logRequest('getMaterialUrl', materialId, groupOrModuleId);\n return this._glueLogic.getMaterialUrl(materialId, groupOrModuleId);\n }\n}\n\nexport class GlueLayerResponseDebugLogging implements RoomDesignerRequests {\n private _roomDesignerRequests: RoomDesignerRequests;\n private _hiCallbacks: HiCallbacks;\n\n constructor(\n roomDesignerRequests: RoomDesignerRequests,\n hiCallbacks: HiCallbacks,\n ) {\n this._roomDesignerRequests = roomDesignerRequests;\n this._hiCallbacks = hiCallbacks;\n }\n\n private _logResponse(message: string, ...args: Array<string | null>) {\n let messageAndArgs = message;\n if (args) {\n args.forEach((item) => {\n messageAndArgs += ' ' + item;\n });\n }\n this._hiCallbacks.onLogMessage?.('HI RESPONSE', messageAndArgs);\n }\n\n public loadMasterData(masterData: any): void {\n this._logResponse('loadMasterData');\n this._roomDesignerRequests.loadMasterData(masterData);\n }\n\n public async loadPosGroups(\n posDataJson: PosGroup | PosGroup[],\n options: LoadExternalObjectOptions,\n ): Promise<void> {\n const groupIds = Array.isArray(posDataJson)\n ? posDataJson.map((group) => group.id).join(',')\n : posDataJson.id;\n this._logResponse(\n 'loadPosGroups',\n groupIds,\n options.reason ?? 'undefined',\n options.findFreeSpaceInPlan?.toString() ?? 'false',\n options.moduleIdMap ? JSON.stringify(options.moduleIdMap) : '[]',\n options.mergedGroups ? JSON.stringify(options.mergedGroups) : '[]',\n );\n return this._roomDesignerRequests.loadPosGroups(posDataJson, options);\n }\n\n public completelyLoaded(): void {\n this._logResponse('completelyLoaded');\n this._roomDesignerRequests.completelyLoaded();\n }\n\n public async selectGroup(groupId: string): Promise<void> {\n this._logResponse('selectGroup', groupId);\n return this._roomDesignerRequests.selectGroup(groupId);\n }\n\n public async selectRoot(rootModuleId: string): Promise<void> {\n this._logResponse('selectRoot', rootModuleId);\n return this._roomDesignerRequests.selectRoot(rootModuleId);\n }\n\n public async selectModule(\n rootModuleId: string,\n subModuleId: string,\n ): Promise<void> {\n this._logResponse('selectModule', rootModuleId, subModuleId);\n return this._roomDesignerRequests.selectModule(rootModuleId, subModuleId);\n }\n\n public openCloseGroup(\n groupOrRootModuleId: string,\n subModuleId: string | null,\n open: boolean,\n animate: boolean,\n ) {\n this._logResponse(\n 'openCloseGroup',\n groupOrRootModuleId,\n subModuleId,\n open.toString(),\n animate.toString(),\n );\n this._roomDesignerRequests.openCloseGroup(\n groupOrRootModuleId,\n subModuleId,\n open,\n animate,\n );\n return Promise.resolve();\n }\n\n public deleteGroup(groupId: string): void {\n this._logResponse('deleteGroup', groupId);\n return this._roomDesignerRequests.deleteGroup(groupId);\n }\n\n public deleteRootModule(rootModuleId: string): void {\n this._logResponse('deleteRootModule', rootModuleId);\n return this._roomDesignerRequests.deleteRootModule(rootModuleId);\n }\n\n public getPosDataOfAllGroups(): Promise<PosGroup[]> {\n this._logResponse('getPosDataOfAllGroups');\n return this._roomDesignerRequests.getPosDataOfAllGroups();\n }\n\n public getRoomInformation(): Promise<ExternalRoomInformation> {\n this._logResponse('getRoomInformation');\n return this._roomDesignerRequests.getRoomInformation();\n }\n\n public saveExternalObjectSnapshot(): Promise<ExternalObjectSnapshotSaveResult | null> {\n this._logResponse('saveExternalObjectSnapshot');\n return this._roomDesignerRequests.saveExternalObjectSnapshot();\n }\n}\n","import { RoomDesignerApi } from './api';\nimport type { GlueLogic, HiAttributeOptionsResult } from './glue-logic';\nimport { GlueLogicImplementation, type LibraryData } from './glue-logic';\nimport { type HomagIntelligenceInitData } from './hi-api-types';\nimport { v4 as uuidv4 } from 'uuid';\nimport type {\n MasterData,\n PosArticle,\n PosContour,\n PosGroup,\n PosModuleAttribute,\n PosModuleData,\n} from './model/oc-scripts-domain.model';\nimport { initCallbacks } from './callbacks';\nimport { type RoomlePlanner } from '../../planner-core/src/roomle-planner';\nimport Orders from './orders';\nimport type {\n ExternalConfiguration,\n ExternalItem,\n} from '../../typings/external-objects';\nimport type { HiTagCatalogCallbacks } from './hi-tag-catalog-callbacks';\nimport type { HiCallbacks, HiOrderHeader } from '#/common/src/hi/hi-types';\nimport {\n GlueLayerRequestDebugLogging,\n GlueLayerResponseDebugLogging,\n} from './debug-logging';\nimport type { ExternalObjectValidContainerModules } from './external-object-api-callbacks';\n\ndeclare global {\n interface Window {\n uuidv4: () => string;\n }\n}\n\nconsole.warn('Homag Intelligence plugin is loaded.');\n\n// export const HOMAG_INTELLIGENCE_ENDPOINT = 'http://localhost:8080/proxy_request?url=';\n// export const HOMAG_INTELLIGENCE_ENDPOINT =\n// 'https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=';\n\nexport type ExternalObjects = Map<\n string,\n { id: string; label: string; items: any[] }\n>;\nexport type ExternalItems = Map<string, ExternalItem>;\nexport type ExternalConfigurations = Map<string, ExternalConfiguration>;\n\n/**\n * Serialization lock for _initCalcScript.\n * Concurrent calls share `window.exports`, so they must run one at a time.\n */\nlet calcScriptLock: Promise<void> = Promise.resolve();\n\nconst acquireCalcScriptLock = (): Promise<() => void> => {\n let release: () => void = () => {};\n const next = new Promise<void>((resolve) => {\n release = resolve;\n });\n const prev = calcScriptLock;\n calcScriptLock = next;\n return prev.then(() => release);\n};\n\nexport class HomagIntelligence {\n private _roomlePlanner: RoomlePlanner;\n private _api: RoomDesignerApi;\n private _glueLogic: GlueLogic;\n private _orders: Orders;\n private _hiCallbacks: HiCallbacks;\n\n constructor(\n roomlePlanner: RoomlePlanner,\n hiOptions: HomagIntelligenceInitData,\n hiCallbacks: HiCallbacks,\n ) {\n if (!window.uuidv4) {\n window.uuidv4 = uuidv4; // Ensure uuidv4 is available globally\n }\n\n this._roomlePlanner = roomlePlanner;\n this._roomlePlanner.setHomagIntelligence(this);\n this._hiCallbacks = hiCallbacks;\n this._api = new RoomDesignerApi(this._roomlePlanner);\n\n if (hiOptions?.debugLogging) {\n const api = new GlueLayerResponseDebugLogging(this._api, hiCallbacks);\n const glueLogic = new GlueLogicImplementation(api, hiCallbacks);\n this._glueLogic = new GlueLayerRequestDebugLogging(\n glueLogic,\n hiCallbacks,\n );\n } else {\n this._glueLogic = new GlueLogicImplementation(this._api, hiCallbacks);\n }\n initCallbacks(this._roomlePlanner, this._glueLogic);\n this._orders = new Orders(roomlePlanner, this._glueLogic);\n }\n\n /**\n * Loads previously saved PosGroup data via hiCallbacks.\n * Must be called after construction to restore saved state.\n */\n public async loadSavedPosData(): Promise<void> {\n const savedPosGroupData =\n (await this._hiCallbacks.onGetSavedPosGroupData?.()) ?? null;\n await this._glueLogic.setPosDataForLoading(savedPosGroupData);\n }\n\n public async loadLibrary(libraryId: string) {\n const libraryData = await this._loadLibraryData(libraryId);\n await this._glueLogic.addLibrary(libraryData);\n }\n\n public async loadCatalog(\n libraryId: string,\n articles: any,\n catalogCallbacks: HiTagCatalogCallbacks,\n ) {\n catalogCallbacks?.setEmulator(this._glueLogic);\n this._glueLogic.loadPosData(await articles, libraryId);\n }\n\n private async _loadLibraryData(libraryId: string): Promise<LibraryData> {\n if (this._glueLogic.isLibraryLoaded(libraryId)) {\n const data = this._glueLogic.getLibraryData(libraryId);\n if (data !== null) {\n return data;\n }\n }\n const hiCallbacks = this._glueLogic.hiCallbacks;\n if (hiCallbacks === null) {\n throw new Error('HiCallbacks not initialized');\n }\n const { masterData, libraryExports } = await this._requestHiLibrary(\n libraryId,\n hiCallbacks,\n );\n this._loadMasterData(masterData);\n const libraryData: LibraryData = {\n libraryId,\n masterData,\n posGroupVersion: 1,\n calculateGroup: (groupData: PosGroup): PosGroup => {\n return libraryExports.calc(groupData);\n },\n getOrderData: (\n groupData: PosGroup[],\n roomlePlannerId?: string,\n rooms?: PosContour[],\n ): any => {\n return libraryExports.getOrderData(groupData, roomlePlannerId, rooms);\n },\n getAttributesDropDownValues: async (\n module: PosModuleData,\n attributeIds?: string | string[],\n ): Promise<Record<string, HiAttributeOptionsResult>> => {\n const ids = attributeIds\n ? Array.isArray(attributeIds)\n ? attributeIds\n : [attributeIds]\n : (module.attributes ?? []).map((attribute) => attribute.id);\n const attributeOptions: Record<string, any[]> = {};\n for (const attributeId of ids) {\n try {\n const attributeDropDownApi =\n libraryExports.getAttributesDropDownValuesV2 ??\n libraryExports.getAttributesDropDownValues;\n const options = await attributeDropDownApi(module, attributeId);\n attributeOptions[attributeId] = options;\n } catch (error) {\n console.error(error);\n attributeOptions[attributeId] = [];\n }\n }\n return attributeOptions;\n },\n solveModuleAttributeConflict: (\n module: PosModuleData,\n attributeName: string,\n value: string | number | boolean,\n ): PosModuleAttribute[] | undefined => {\n if (!libraryExports.solveModuleAttributeConflict) {\n return undefined;\n }\n const results = libraryExports.solveModuleAttributeConflict(\n module,\n attributeName,\n value,\n );\n return results;\n },\n getValidSubArticles(\n calculatedPosGroup: PosGroup,\n articles: PosArticle[],\n masterData: MasterData,\n ): PosArticle[] {\n if (!libraryExports.getValidSubArticles) {\n return [];\n }\n const results = libraryExports.getValidSubArticles(\n calculatedPosGroup,\n articles,\n masterData,\n );\n return results;\n },\n getValidContainerModulesForSubArticle(\n calculatedPosGroup: PosGroup,\n subArticle: PosArticle,\n masterData: MasterData,\n ): ExternalObjectValidContainerModules[] {\n if (!libraryExports.getValidContainerModulesForSubArticle) {\n return [];\n }\n const results = libraryExports.getValidContainerModulesForSubArticle(\n calculatedPosGroup,\n subArticle,\n masterData,\n );\n return results;\n },\n addSubArticle(\n targetPosGroup: PosGroup,\n article: PosArticle,\n rootId: string,\n parentModuleId: string,\n insertPosition?: number[],\n ): PosGroup {\n if (!libraryExports.addSubArticle) {\n return targetPosGroup;\n }\n const results = libraryExports.addSubArticle(\n targetPosGroup,\n article,\n rootId,\n parentModuleId,\n insertPosition,\n );\n return results;\n },\n deleteSubArticle(\n targetPosGroup: PosGroup,\n rootId: string,\n articleModuleId: string,\n ): PosGroup {\n if (!libraryExports.deleteSubArticle) {\n return targetPosGroup;\n }\n const results = libraryExports.deleteSubArticle(\n targetPosGroup,\n rootId,\n articleModuleId,\n );\n return results;\n },\n };\n return libraryData;\n }\n\n public async _requestHiLibrary(\n libraryId: string,\n hiCallbacks: HiCallbacks,\n ): Promise<{\n masterData: MasterData;\n libraryExports: any;\n }> {\n const [masterData, calcScriptString] = await Promise.all([\n hiCallbacks.onLoadMasterData(libraryId),\n hiCallbacks.onLoadJavascript(libraryId),\n ]);\n const libraryExports = await this._initCalcScript(calcScriptString);\n return {\n masterData,\n libraryExports,\n };\n }\n\n private _loadMasterData(masterData: MasterData): void {\n return this._api.loadMasterData(masterData);\n }\n\n private async _initCalcScript(scriptText: string): Promise<any> {\n // Acquire the lock so concurrent _initCalcScript calls don't corrupt\n // each other's window.exports (which is a shared global).\n const release = await acquireCalcScriptLock();\n let blobUrl: string | undefined;\n try {\n window.exports = {};\n const blob = new Blob([scriptText], { type: 'text/javascript' });\n blobUrl = URL.createObjectURL(blob);\n await import(blobUrl);\n return window.exports;\n } catch (e) {\n console.error(e);\n throw new Error('Failed to load calc.js!');\n } finally {\n if (blobUrl) {\n URL.revokeObjectURL(blobUrl);\n }\n release();\n }\n }\n\n public getGlueLogic(): GlueLogic {\n return this._glueLogic;\n }\n\n public async placeOrder(\n withPrice: boolean = true,\n orderHeader?: HiOrderHeader,\n ) {\n await this._orders.placeOrder(withPrice, orderHeader);\n }\n\n public async fetchPrice(planId?: string, orderHeader?: HiOrderHeader) {\n return this._orders.fetchPrice(planId, orderHeader);\n }\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;AACA,IAAM,IAAY,EAAE;AACpB,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,EAAE,EACvB,GAAU,MAAM,IAAI,KAAO,SAAS,GAAG,CAAC,MAAM,EAAE,CAAC;AAErD,SAAgB,EAAgB,GAAK,IAAS,GAAG;AAC7C,SAAQ,EAAU,EAAI,IAAS,MAC3B,EAAU,EAAI,IAAS,MACvB,EAAU,EAA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