@roomle/web-sdk 3.7.0-alpha.1 → 3.7.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/lib/{BufferGeometry-BLeRuMkh.mjs → BufferGeometry-C696z6r3.mjs} +2 -2
  2. package/lib/{BufferGeometry-BLeRuMkh.mjs.map → BufferGeometry-C696z6r3.mjs.map} +1 -1
  3. package/lib/ConfiguratorKernel.wasm +0 -0
  4. package/lib/{GLTFExporter-CFXCqoLa.mjs → GLTFExporter-AfQIvZAD.mjs} +1 -1
  5. package/lib/{GLTFExporter-CFXCqoLa.mjs.map → GLTFExporter-AfQIvZAD.mjs.map} +1 -1
  6. package/lib/{Object3D-DSjIOhON.mjs → Object3D-C3wqWk6O.mjs} +1 -1
  7. package/lib/{Object3D-DSjIOhON.mjs.map → Object3D-C3wqWk6O.mjs.map} +1 -1
  8. package/lib/{PointLightHelper-BEJEy6l_.mjs → PointLightHelper-wVSmrAnD.mjs} +4 -4
  9. package/lib/{PointLightHelper-BEJEy6l_.mjs.map → PointLightHelper-wVSmrAnD.mjs.map} +1 -1
  10. package/lib/RoomleCore.wasm +0 -0
  11. package/lib/RoomleToolsCore.wasm +0 -0
  12. package/lib/{SpotLightHelper-aXFW8qaJ.mjs → SpotLightHelper-C7J95t4f.mjs} +3 -3
  13. package/lib/{SpotLightHelper-aXFW8qaJ.mjs.map → SpotLightHelper-C7J95t4f.mjs.map} +1 -1
  14. package/lib/{USDZExporter-B4hsiwhd.mjs → USDZExporter-BBk0APeK.mjs} +2 -2
  15. package/lib/{USDZExporter-B4hsiwhd.mjs.map → USDZExporter-BBk0APeK.mjs.map} +1 -1
  16. package/lib/{Vector4-DGmBYfpK.mjs → Vector4-DUqY3Egg.mjs} +2 -2
  17. package/lib/{Vector4-DGmBYfpK.mjs.map → Vector4-DUqY3Egg.mjs.map} +1 -1
  18. package/lib/{api-C2-6Jm5W.mjs → api-oYzhcs_W.mjs} +2 -2
  19. package/lib/{api-C2-6Jm5W.mjs.map → api-oYzhcs_W.mjs.map} +1 -1
  20. package/lib/asset-loader.worker-A7nEeQB4.mjs +6 -0
  21. package/lib/asset-loader.worker-A7nEeQB4.mjs.map +1 -0
  22. package/lib/{banana-for-scale-BV_na-g3.mjs → banana-for-scale-D8t2dmc7.mjs} +3 -3
  23. package/lib/{banana-for-scale-BV_na-g3.mjs.map → banana-for-scale-D8t2dmc7.mjs.map} +1 -1
  24. package/lib/budgeteer.sw-CQWYbQSc.mjs +6 -0
  25. package/lib/budgeteer.sw-CQWYbQSc.mjs.map +1 -0
  26. package/lib/common-utils-qErzZAiR.mjs.map +1 -1
  27. package/lib/{component-dimensioning-DCQTqssC.mjs → component-dimensioning-DlB7-9Om.mjs} +5 -5
  28. package/lib/{component-dimensioning-DCQTqssC.mjs.map → component-dimensioning-DlB7-9Om.mjs.map} +1 -1
  29. package/lib/{component-raycast-helper-B3WXp3oq.mjs → component-raycast-helper-C6ptEb0K.mjs} +27 -28
  30. package/lib/{component-raycast-helper-B3WXp3oq.mjs.map → component-raycast-helper-C6ptEb0K.mjs.map} +1 -1
  31. package/lib/component-raycast-helper-LrhRpeDD.mjs +2 -0
  32. package/lib/configurator-CRMunIq7.mjs +45 -0
  33. package/lib/{configurator-Dx6kcXY_.mjs.map → configurator-CRMunIq7.mjs.map} +1 -1
  34. package/lib/configurator-DqiW717d.mjs +2 -0
  35. package/lib/{continuous-drawing-helper-DzULJ9d1.mjs → continuous-drawing-helper-BwulJHKj.mjs} +2 -2
  36. package/lib/{continuous-drawing-helper-DzULJ9d1.mjs.map → continuous-drawing-helper-BwulJHKj.mjs.map} +1 -1
  37. package/lib/dat.gui.module-CZHqOVGq.mjs +1500 -0
  38. package/lib/dat.gui.module-CZHqOVGq.mjs.map +1 -0
  39. package/lib/{decorate-BIflHDAa.mjs → decorate-BAtqSPNS.mjs} +3 -3
  40. package/lib/decorate-BAtqSPNS.mjs.map +1 -0
  41. package/lib/{dimensioning-helper-Cj20VTW0.mjs → dimensioning-helper--Y0Y-Wr1.mjs} +54 -63
  42. package/lib/{dimensioning-helper-Cj20VTW0.mjs.map → dimensioning-helper--Y0Y-Wr1.mjs.map} +1 -1
  43. package/lib/dimensioning-helper-BpUreWo2.mjs +2 -0
  44. package/lib/{fflate.module-dFNj5UPI.mjs → fflate.module-CBz7CLOg.mjs} +1 -1
  45. package/lib/{fflate.module-dFNj5UPI.mjs.map → fflate.module-CBz7CLOg.mjs.map} +1 -1
  46. package/lib/{glb-viewer-BqFcaUlb.mjs → glb-viewer-CXEoIw1b.mjs} +20 -20
  47. package/lib/glb-viewer-CXEoIw1b.mjs.map +1 -0
  48. package/lib/glb-viewer-IDXgmONx.mjs +2 -0
  49. package/lib/{homag-intelligence-Dkz0AhB4.mjs → homag-intelligence-gb9MqBrz.mjs} +6 -3
  50. package/lib/{homag-intelligence-Dkz0AhB4.mjs.map → homag-intelligence-gb9MqBrz.mjs.map} +1 -1
  51. package/lib/{imos-ix-poc-export-helper-BjIgAfUu.mjs → imos-ix-poc-export-helper-CW7QZhhn.mjs} +3 -3
  52. package/lib/{imos-ix-poc-export-helper-BjIgAfUu.mjs.map → imos-ix-poc-export-helper-CW7QZhhn.mjs.map} +1 -1
  53. package/lib/{kernel-BAQSG9r5.mjs → kernel-C7YDLxq8.mjs} +3 -2
  54. package/lib/kernel-C7YDLxq8.mjs.map +1 -0
  55. package/lib/{kernel-utils-CfGzR_WC.mjs → kernel-utils-DCnHzW4n.mjs} +2 -2
  56. package/lib/kernel-utils-DCnHzW4n.mjs.map +1 -0
  57. package/lib/{main-DMIVdAcT.mjs → main-BJZ9-cDk.mjs} +1772 -1660
  58. package/lib/main-BJZ9-cDk.mjs.map +1 -0
  59. package/lib/{material-viewer-BkwvhHbQ.mjs → material-viewer-D8Nmpwg0.mjs} +20 -20
  60. package/lib/material-viewer-D8Nmpwg0.mjs.map +1 -0
  61. package/lib/packages-Uv53SHfb.mjs +4 -0
  62. package/lib/planner-5VarJrpy.mjs +44 -0
  63. package/lib/{planner-BPlxsTRJ.mjs.map → planner-5VarJrpy.mjs.map} +1 -1
  64. package/lib/planner-DJcn-iih.mjs +2 -0
  65. package/lib/{plugin-system-XhOJU1MI.mjs → plugin-system-DInww4H_.mjs} +3 -3
  66. package/lib/{plugin-system-XhOJU1MI.mjs.map → plugin-system-DInww4H_.mjs.map} +1 -1
  67. package/lib/{chunk-C97zSiVS.mjs → rolldown-runtime-DgwB9i60.mjs} +3 -10
  68. package/lib/roomle-headless-setup-LoBO7UJe.mjs +1150 -0
  69. package/lib/roomle-headless-setup-LoBO7UJe.mjs.map +1 -0
  70. package/lib/roomle-headless.d.ts +9910 -0
  71. package/lib/roomle-headless.js +321 -0
  72. package/lib/roomle-headless.js.map +1 -0
  73. package/lib/{roomle-renderer-BwPvUqSW.mjs → roomle-renderer-DVlJsHYn.mjs} +1 -1
  74. package/lib/{roomle-renderer-BwPvUqSW.mjs.map → roomle-renderer-DVlJsHYn.mjs.map} +1 -1
  75. package/lib/roomle-sdk.d.ts +354 -15
  76. package/lib/roomle-sdk.js +8 -7
  77. package/lib/{roomle-webgpu-renderer-CSC5zFdC.mjs → roomle-webgpu-renderer-CVxBRv6o.mjs} +46 -46
  78. package/lib/{roomle-webgpu-renderer-CSC5zFdC.mjs.map → roomle-webgpu-renderer-CVxBRv6o.mjs.map} +1 -1
  79. package/lib/{scene-renderer-DWY_zPvU.mjs → scene-renderer-BHZrQYAH.mjs} +9 -9
  80. package/lib/scene-renderer-BHZrQYAH.mjs.map +1 -0
  81. package/lib/script-loader-gpkcl1h-.mjs +86 -0
  82. package/lib/script-loader-gpkcl1h-.mjs.map +1 -0
  83. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  84. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts +3 -3
  85. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js +3 -3
  86. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map +1 -1
  87. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +5 -2
  88. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js +1 -1
  89. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +1 -1
  90. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.d.ts +1 -0
  91. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js +3 -0
  92. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +1 -1
  93. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +1 -0
  94. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -1
  95. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.d.ts +3 -2
  96. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js +31 -9
  97. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js.map +1 -1
  98. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js +8 -1
  99. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js.map +1 -1
  100. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  101. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  102. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  103. package/lib/{stats-helper-C954Cfgh.mjs → stats-helper-Cv5SoEWT.mjs} +4 -4
  104. package/lib/{stats-helper-C954Cfgh.mjs.map → stats-helper-Cv5SoEWT.mjs.map} +1 -1
  105. package/lib/{three.webgpu-0l2TztLa.mjs → three.webgpu-BbVYfCDp.mjs} +2279 -2279
  106. package/lib/{three.webgpu-0l2TztLa.mjs.map → three.webgpu-BbVYfCDp.mjs.map} +1 -1
  107. package/lib/three.webgpu-Bnp8Whu8.mjs +3 -0
  108. package/lib/threejs-utils-Bq4pVWBA.mjs +753 -0
  109. package/lib/threejs-utils-Bq4pVWBA.mjs.map +1 -0
  110. package/lib/{tools-core-BzhFD2Wk.mjs → tools-core-DqnhFefF.mjs} +6 -6
  111. package/lib/{tools-core-BzhFD2Wk.mjs.map → tools-core-DqnhFefF.mjs.map} +1 -1
  112. package/lib/workers-BJYv3y38.mjs +6 -0
  113. package/lib/workers-BJYv3y38.mjs.map +1 -0
  114. package/package.json +20 -5
  115. package/lib/configurator-CrNkzBp9.mjs +0 -2
  116. package/lib/configurator-Dx6kcXY_.mjs +0 -45
  117. package/lib/decorate-BIflHDAa.mjs.map +0 -1
  118. package/lib/glb-viewer-BqFcaUlb.mjs.map +0 -1
  119. package/lib/glb-viewer-FYw7R-ya.mjs +0 -2
  120. package/lib/kernel-BAQSG9r5.mjs.map +0 -1
  121. package/lib/kernel-utils-CfGzR_WC.mjs.map +0 -1
  122. package/lib/main-DMIVdAcT.mjs.map +0 -1
  123. package/lib/material-viewer-BkwvhHbQ.mjs.map +0 -1
  124. package/lib/planner-BPlxsTRJ.mjs +0 -44
  125. package/lib/planner-oj08ktHE.mjs +0 -2
  126. package/lib/scene-renderer-DWY_zPvU.mjs.map +0 -1
  127. package/lib/script-loader-CA-XHFKN.mjs +0 -45
  128. package/lib/script-loader-CA-XHFKN.mjs.map +0 -1
  129. package/lib/threejs-utils-8zlxt158.mjs +0 -2232
  130. package/lib/threejs-utils-8zlxt158.mjs.map +0 -1
@@ -1,2232 +0,0 @@
1
- import { B as e, C as t, In as n, Vr as r, Wn as i, cn as a, d as o, gn as s, hn as c, jr as l, oi as u, on as d, sn as f, ut as p, xi as m, zr as h } from "./three.core-mM-jZdgg.mjs";
2
- import { r as g } from "./three.module-Bmy3sVQ-.mjs";
3
- import { V as _, b as v } from "./common-utils-qErzZAiR.mjs";
4
- import { a as ee } from "./kernel-utils-CfGzR_WC.mjs";
5
- //#region packages/common-core/src/utils/math-helper.ts
6
- var te = function(e) {
7
- return Math.PI / 180 * e;
8
- }, ne = function(e) {
9
- return 180 / Math.PI * e;
10
- }, re = function(e) {
11
- return e >= 0 ? -180 + (e + 180) % 360 : 180 - (-e + 180) % 360;
12
- }, ie = function(e, t, n, r, i, a) {
13
- e = Math.sqrt(e * e + n * n);
14
- let o = i / a || 1, s = 2 * Math.atan(Math.tan(r * Math.PI / 180 / 2) * o) * 180 / Math.PI, c = te(r), l = t / 2 / Math.tan(c / 2), u = e / (2 * Math.atan(Math.PI * s / 360));
15
- return Math.max(l, u);
16
- }, y = function(e) {
17
- return Math.round(e * 1e3) / 1e3;
18
- }, ae = function(e, t) {
19
- return Math.abs(e.y - t.y) + Math.abs(e.x - t.x);
20
- }, oe = function(e, t) {
21
- return Math.atan2(t.y - e.y, t.x - e.x);
22
- }, se = function(e) {
23
- let t = ne(e);
24
- return t < 0 && (t = 180 + (180 + t)), t;
25
- }, ce = /* @__PURE__ */ function(e) {
26
- return e[e.NODE = 0] = "NODE", e[e.WALL = 1] = "WALL", e[e.OBJECT = 2] = "OBJECT", e[e.FLOOR = 3] = "FLOOR", e[e.TEXT = 4] = "TEXT", e[e.MEASURE = 5] = "MEASURE", e[e.IMAGE = 6] = "IMAGE", e[e.CEILING = 7] = "CEILING", e;
27
- }({}), le = {
28
- LEFT: 0,
29
- RIGHT: 1,
30
- MIDDLE: 2
31
- }, ue = /* @__PURE__ */ function(e) {
32
- return e[e.None = 0] = "None", e[e.CatalogItem = 1] = "CatalogItem", e[e.Material = 2] = "Material", e[e.RgbValue = 3] = "RgbValue", e;
33
- }({}), de = /* @__PURE__ */ function(e) {
34
- return e[e.CONTINOUS = 0] = "CONTINOUS", e[e.CLICK_PER_CLICK = 1] = "CLICK_PER_CLICK", e;
35
- }({}), fe = {
36
- CONFIGURATOR: 0,
37
- PLANNER: 1
38
- }, pe = {
39
- NONE: 0,
40
- WALL_SNAP_LEVEL: 1,
41
- WALL_SNAP_LEVEL_SNAPPED: 2,
42
- WALL_EDGE: 3,
43
- DOCKING_VECTOR: 4,
44
- OBJECT_CONTOUR: 5
45
- }, me = /* @__PURE__ */ function(e) {
46
- return e[e.StandAloneWall = 0] = "StandAloneWall", e[e.OuterWallLeft = 1] = "OuterWallLeft", e[e.OuterWallRight = 2] = "OuterWallRight", e[e.InnerWall = 3] = "InnerWall", e;
47
- }({});
48
- //#endregion
49
- //#region ../../node_modules/dat.gui/build/dat.gui.module.js
50
- function he(e) {
51
- if (e && !(typeof window > "u")) {
52
- var t = document.createElement("style");
53
- return t.setAttribute("type", "text/css"), t.innerHTML = e, document.head.appendChild(t), e;
54
- }
55
- }
56
- function b(e, t) {
57
- var n = e.__state.conversionName.toString(), r = Math.round(e.r), i = Math.round(e.g), a = Math.round(e.b), o = e.a, s = Math.round(e.h), c = e.s.toFixed(1), l = e.v.toFixed(1);
58
- if (t || n === "THREE_CHAR_HEX" || n === "SIX_CHAR_HEX") {
59
- for (var u = e.hex.toString(16); u.length < 6;) u = "0" + u;
60
- return "#" + u;
61
- } else if (n === "CSS_RGB") return "rgb(" + r + "," + i + "," + a + ")";
62
- else if (n === "CSS_RGBA") return "rgba(" + r + "," + i + "," + a + "," + o + ")";
63
- else if (n === "HEX") return "0x" + e.hex.toString(16);
64
- else if (n === "RGB_ARRAY") return "[" + r + "," + i + "," + a + "]";
65
- else if (n === "RGBA_ARRAY") return "[" + r + "," + i + "," + a + "," + o + "]";
66
- else if (n === "RGB_OBJ") return "{r:" + r + ",g:" + i + ",b:" + a + "}";
67
- else if (n === "RGBA_OBJ") return "{r:" + r + ",g:" + i + ",b:" + a + ",a:" + o + "}";
68
- else if (n === "HSV_OBJ") return "{h:" + s + ",s:" + c + ",v:" + l + "}";
69
- else if (n === "HSVA_OBJ") return "{h:" + s + ",s:" + c + ",v:" + l + ",a:" + o + "}";
70
- return "unknown format";
71
- }
72
- var ge = Array.prototype.forEach, x = Array.prototype.slice, S = {
73
- BREAK: {},
74
- extend: function(e) {
75
- return this.each(x.call(arguments, 1), function(t) {
76
- (this.isObject(t) ? Object.keys(t) : []).forEach(function(n) {
77
- this.isUndefined(t[n]) || (e[n] = t[n]);
78
- }.bind(this));
79
- }, this), e;
80
- },
81
- defaults: function(e) {
82
- return this.each(x.call(arguments, 1), function(t) {
83
- (this.isObject(t) ? Object.keys(t) : []).forEach(function(n) {
84
- this.isUndefined(e[n]) && (e[n] = t[n]);
85
- }.bind(this));
86
- }, this), e;
87
- },
88
- compose: function() {
89
- var e = x.call(arguments);
90
- return function() {
91
- for (var t = x.call(arguments), n = e.length - 1; n >= 0; n--) t = [e[n].apply(this, t)];
92
- return t[0];
93
- };
94
- },
95
- each: function(e, t, n) {
96
- if (e) {
97
- if (ge && e.forEach && e.forEach === ge) e.forEach(t, n);
98
- else if (e.length === e.length + 0) {
99
- var r = void 0, i = void 0;
100
- for (r = 0, i = e.length; r < i; r++) if (r in e && t.call(n, e[r], r) === this.BREAK) return;
101
- } else for (var a in e) if (t.call(n, e[a], a) === this.BREAK) return;
102
- }
103
- },
104
- defer: function(e) {
105
- setTimeout(e, 0);
106
- },
107
- debounce: function(e, t, n) {
108
- var r = void 0;
109
- return function() {
110
- var i = this, a = arguments;
111
- function o() {
112
- r = null, n || e.apply(i, a);
113
- }
114
- var s = n || !r;
115
- clearTimeout(r), r = setTimeout(o, t), s && e.apply(i, a);
116
- };
117
- },
118
- toArray: function(e) {
119
- return e.toArray ? e.toArray() : x.call(e);
120
- },
121
- isUndefined: function(e) {
122
- return e === void 0;
123
- },
124
- isNull: function(e) {
125
- return e === null;
126
- },
127
- isNaN: function(e) {
128
- function t(t) {
129
- return e.apply(this, arguments);
130
- }
131
- return t.toString = function() {
132
- return e.toString();
133
- }, t;
134
- }(function(e) {
135
- return isNaN(e);
136
- }),
137
- isArray: Array.isArray || function(e) {
138
- return e.constructor === Array;
139
- },
140
- isObject: function(e) {
141
- return e === Object(e);
142
- },
143
- isNumber: function(e) {
144
- return e === e + 0;
145
- },
146
- isString: function(e) {
147
- return e === e + "";
148
- },
149
- isBoolean: function(e) {
150
- return e === !1 || e === !0;
151
- },
152
- isFunction: function(e) {
153
- return e instanceof Function;
154
- }
155
- }, _e = [
156
- {
157
- litmus: S.isString,
158
- conversions: {
159
- THREE_CHAR_HEX: {
160
- read: function(e) {
161
- var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
162
- return t === null ? !1 : {
163
- space: "HEX",
164
- hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString(), 0)
165
- };
166
- },
167
- write: b
168
- },
169
- SIX_CHAR_HEX: {
170
- read: function(e) {
171
- var t = e.match(/^#([A-F0-9]{6})$/i);
172
- return t === null ? !1 : {
173
- space: "HEX",
174
- hex: parseInt("0x" + t[1].toString(), 0)
175
- };
176
- },
177
- write: b
178
- },
179
- CSS_RGB: {
180
- read: function(e) {
181
- var t = e.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);
182
- return t === null ? !1 : {
183
- space: "RGB",
184
- r: parseFloat(t[1]),
185
- g: parseFloat(t[2]),
186
- b: parseFloat(t[3])
187
- };
188
- },
189
- write: b
190
- },
191
- CSS_RGBA: {
192
- read: function(e) {
193
- var t = e.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);
194
- return t === null ? !1 : {
195
- space: "RGB",
196
- r: parseFloat(t[1]),
197
- g: parseFloat(t[2]),
198
- b: parseFloat(t[3]),
199
- a: parseFloat(t[4])
200
- };
201
- },
202
- write: b
203
- }
204
- }
205
- },
206
- {
207
- litmus: S.isNumber,
208
- conversions: { HEX: {
209
- read: function(e) {
210
- return {
211
- space: "HEX",
212
- hex: e,
213
- conversionName: "HEX"
214
- };
215
- },
216
- write: function(e) {
217
- return e.hex;
218
- }
219
- } }
220
- },
221
- {
222
- litmus: S.isArray,
223
- conversions: {
224
- RGB_ARRAY: {
225
- read: function(e) {
226
- return e.length === 3 ? {
227
- space: "RGB",
228
- r: e[0],
229
- g: e[1],
230
- b: e[2]
231
- } : !1;
232
- },
233
- write: function(e) {
234
- return [
235
- e.r,
236
- e.g,
237
- e.b
238
- ];
239
- }
240
- },
241
- RGBA_ARRAY: {
242
- read: function(e) {
243
- return e.length === 4 ? {
244
- space: "RGB",
245
- r: e[0],
246
- g: e[1],
247
- b: e[2],
248
- a: e[3]
249
- } : !1;
250
- },
251
- write: function(e) {
252
- return [
253
- e.r,
254
- e.g,
255
- e.b,
256
- e.a
257
- ];
258
- }
259
- }
260
- }
261
- },
262
- {
263
- litmus: S.isObject,
264
- conversions: {
265
- RGBA_OBJ: {
266
- read: function(e) {
267
- return S.isNumber(e.r) && S.isNumber(e.g) && S.isNumber(e.b) && S.isNumber(e.a) ? {
268
- space: "RGB",
269
- r: e.r,
270
- g: e.g,
271
- b: e.b,
272
- a: e.a
273
- } : !1;
274
- },
275
- write: function(e) {
276
- return {
277
- r: e.r,
278
- g: e.g,
279
- b: e.b,
280
- a: e.a
281
- };
282
- }
283
- },
284
- RGB_OBJ: {
285
- read: function(e) {
286
- return S.isNumber(e.r) && S.isNumber(e.g) && S.isNumber(e.b) ? {
287
- space: "RGB",
288
- r: e.r,
289
- g: e.g,
290
- b: e.b
291
- } : !1;
292
- },
293
- write: function(e) {
294
- return {
295
- r: e.r,
296
- g: e.g,
297
- b: e.b
298
- };
299
- }
300
- },
301
- HSVA_OBJ: {
302
- read: function(e) {
303
- return S.isNumber(e.h) && S.isNumber(e.s) && S.isNumber(e.v) && S.isNumber(e.a) ? {
304
- space: "HSV",
305
- h: e.h,
306
- s: e.s,
307
- v: e.v,
308
- a: e.a
309
- } : !1;
310
- },
311
- write: function(e) {
312
- return {
313
- h: e.h,
314
- s: e.s,
315
- v: e.v,
316
- a: e.a
317
- };
318
- }
319
- },
320
- HSV_OBJ: {
321
- read: function(e) {
322
- return S.isNumber(e.h) && S.isNumber(e.s) && S.isNumber(e.v) ? {
323
- space: "HSV",
324
- h: e.h,
325
- s: e.s,
326
- v: e.v
327
- } : !1;
328
- },
329
- write: function(e) {
330
- return {
331
- h: e.h,
332
- s: e.s,
333
- v: e.v
334
- };
335
- }
336
- }
337
- }
338
- }
339
- ], C = void 0, w = void 0, ve = function() {
340
- w = !1;
341
- var e = arguments.length > 1 ? S.toArray(arguments) : arguments[0];
342
- return S.each(_e, function(t) {
343
- if (t.litmus(e)) return S.each(t.conversions, function(t, n) {
344
- if (C = t.read(e), w === !1 && C !== !1) return w = C, C.conversionName = n, C.conversion = t, S.BREAK;
345
- }), S.BREAK;
346
- }), w;
347
- }, ye = void 0, T = {
348
- hsv_to_rgb: function(e, t, n) {
349
- var r = Math.floor(e / 60) % 6, i = e / 60 - Math.floor(e / 60), a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = [
350
- [
351
- n,
352
- s,
353
- a
354
- ],
355
- [
356
- o,
357
- n,
358
- a
359
- ],
360
- [
361
- a,
362
- n,
363
- s
364
- ],
365
- [
366
- a,
367
- o,
368
- n
369
- ],
370
- [
371
- s,
372
- a,
373
- n
374
- ],
375
- [
376
- n,
377
- a,
378
- o
379
- ]
380
- ][r];
381
- return {
382
- r: c[0] * 255,
383
- g: c[1] * 255,
384
- b: c[2] * 255
385
- };
386
- },
387
- rgb_to_hsv: function(e, t, n) {
388
- var r = Math.min(e, t, n), i = Math.max(e, t, n), a = i - r, o = void 0, s = void 0;
389
- if (i !== 0) s = a / i;
390
- else return {
391
- h: NaN,
392
- s: 0,
393
- v: 0
394
- };
395
- return o = e === i ? (t - n) / a : t === i ? 2 + (n - e) / a : 4 + (e - t) / a, o /= 6, o < 0 && (o += 1), {
396
- h: o * 360,
397
- s,
398
- v: i / 255
399
- };
400
- },
401
- rgb_to_hex: function(e, t, n) {
402
- var r = this.hex_with_component(0, 2, e);
403
- return r = this.hex_with_component(r, 1, t), r = this.hex_with_component(r, 0, n), r;
404
- },
405
- component_from_hex: function(e, t) {
406
- return e >> t * 8 & 255;
407
- },
408
- hex_with_component: function(e, t, n) {
409
- return n << (ye = t * 8) | e & ~(255 << ye);
410
- }
411
- }, be = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
412
- return typeof e;
413
- } : function(e) {
414
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
415
- }, E = function(e, t) {
416
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
417
- }, D = function() {
418
- function e(e, t) {
419
- for (var n = 0; n < t.length; n++) {
420
- var r = t[n];
421
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
422
- }
423
- }
424
- return function(t, n, r) {
425
- return n && e(t.prototype, n), r && e(t, r), t;
426
- };
427
- }(), O = function e(t, n, r) {
428
- t === null && (t = Function.prototype);
429
- var i = Object.getOwnPropertyDescriptor(t, n);
430
- if (i === void 0) {
431
- var a = Object.getPrototypeOf(t);
432
- return a === null ? void 0 : e(a, n, r);
433
- } else if ("value" in i) return i.value;
434
- else {
435
- var o = i.get;
436
- return o === void 0 ? void 0 : o.call(r);
437
- }
438
- }, k = function(e, t) {
439
- if (typeof t != "function" && t !== null) throw TypeError("Super expression must either be null or a function, not " + typeof t);
440
- e.prototype = Object.create(t && t.prototype, { constructor: {
441
- value: e,
442
- enumerable: !1,
443
- writable: !0,
444
- configurable: !0
445
- } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
446
- }, A = function(e, t) {
447
- if (!e) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
448
- return t && (typeof t == "object" || typeof t == "function") ? t : e;
449
- }, j = function() {
450
- function e() {
451
- if (E(this, e), this.__state = ve.apply(this, arguments), this.__state === !1) throw Error("Failed to interpret color arguments");
452
- this.__state.a = this.__state.a || 1;
453
- }
454
- return D(e, [
455
- {
456
- key: "toString",
457
- value: function() {
458
- return b(this);
459
- }
460
- },
461
- {
462
- key: "toHexString",
463
- value: function() {
464
- return b(this, !0);
465
- }
466
- },
467
- {
468
- key: "toOriginal",
469
- value: function() {
470
- return this.__state.conversion.write(this);
471
- }
472
- }
473
- ]), e;
474
- }();
475
- function xe(e, t, n) {
476
- Object.defineProperty(e, t, {
477
- get: function() {
478
- return this.__state.space === "RGB" || j.recalculateRGB(this, t, n), this.__state[t];
479
- },
480
- set: function(e) {
481
- this.__state.space !== "RGB" && (j.recalculateRGB(this, t, n), this.__state.space = "RGB"), this.__state[t] = e;
482
- }
483
- });
484
- }
485
- function Se(e, t) {
486
- Object.defineProperty(e, t, {
487
- get: function() {
488
- return this.__state.space === "HSV" || j.recalculateHSV(this), this.__state[t];
489
- },
490
- set: function(e) {
491
- this.__state.space !== "HSV" && (j.recalculateHSV(this), this.__state.space = "HSV"), this.__state[t] = e;
492
- }
493
- });
494
- }
495
- j.recalculateRGB = function(e, t, n) {
496
- if (e.__state.space === "HEX") e.__state[t] = T.component_from_hex(e.__state.hex, n);
497
- else if (e.__state.space === "HSV") S.extend(e.__state, T.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v));
498
- else throw Error("Corrupted color state");
499
- }, j.recalculateHSV = function(e) {
500
- var t = T.rgb_to_hsv(e.r, e.g, e.b);
501
- S.extend(e.__state, {
502
- s: t.s,
503
- v: t.v
504
- }), S.isNaN(t.h) ? S.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h;
505
- }, j.COMPONENTS = [
506
- "r",
507
- "g",
508
- "b",
509
- "h",
510
- "s",
511
- "v",
512
- "hex",
513
- "a"
514
- ], xe(j.prototype, "r", 2), xe(j.prototype, "g", 1), xe(j.prototype, "b", 0), Se(j.prototype, "h"), Se(j.prototype, "s"), Se(j.prototype, "v"), Object.defineProperty(j.prototype, "a", {
515
- get: function() {
516
- return this.__state.a;
517
- },
518
- set: function(e) {
519
- this.__state.a = e;
520
- }
521
- }), Object.defineProperty(j.prototype, "hex", {
522
- get: function() {
523
- return this.__state.space !== "HEX" && (this.__state.hex = T.rgb_to_hex(this.r, this.g, this.b), this.__state.space = "HEX"), this.__state.hex;
524
- },
525
- set: function(e) {
526
- this.__state.space = "HEX", this.__state.hex = e;
527
- }
528
- });
529
- var M = function() {
530
- function e(t, n) {
531
- E(this, e), this.initialValue = t[n], this.domElement = document.createElement("div"), this.object = t, this.property = n, this.__onChange = void 0, this.__onFinishChange = void 0;
532
- }
533
- return D(e, [
534
- {
535
- key: "onChange",
536
- value: function(e) {
537
- return this.__onChange = e, this;
538
- }
539
- },
540
- {
541
- key: "onFinishChange",
542
- value: function(e) {
543
- return this.__onFinishChange = e, this;
544
- }
545
- },
546
- {
547
- key: "setValue",
548
- value: function(e) {
549
- return this.object[this.property] = e, this.__onChange && this.__onChange.call(this, e), this.updateDisplay(), this;
550
- }
551
- },
552
- {
553
- key: "getValue",
554
- value: function() {
555
- return this.object[this.property];
556
- }
557
- },
558
- {
559
- key: "updateDisplay",
560
- value: function() {
561
- return this;
562
- }
563
- },
564
- {
565
- key: "isModified",
566
- value: function() {
567
- return this.initialValue !== this.getValue();
568
- }
569
- }
570
- ]), e;
571
- }(), Ce = {
572
- HTMLEvents: ["change"],
573
- MouseEvents: [
574
- "click",
575
- "mousemove",
576
- "mousedown",
577
- "mouseup",
578
- "mouseover"
579
- ],
580
- KeyboardEvents: ["keydown"]
581
- }, we = {};
582
- S.each(Ce, function(e, t) {
583
- S.each(e, function(e) {
584
- we[e] = t;
585
- });
586
- });
587
- var Te = /(\d+(\.\d+)?)px/;
588
- function N(e) {
589
- if (e === "0" || S.isUndefined(e)) return 0;
590
- var t = e.match(Te);
591
- return S.isNull(t) ? 0 : parseFloat(t[1]);
592
- }
593
- var P = {
594
- makeSelectable: function(e, t) {
595
- e === void 0 || e.style === void 0 || (e.onselectstart = t ? function() {
596
- return !1;
597
- } : function() {}, e.style.MozUserSelect = t ? "auto" : "none", e.style.KhtmlUserSelect = t ? "auto" : "none", e.unselectable = t ? "on" : "off");
598
- },
599
- makeFullscreen: function(e, t, n) {
600
- var r = n, i = t;
601
- S.isUndefined(i) && (i = !0), S.isUndefined(r) && (r = !0), e.style.position = "absolute", i && (e.style.left = 0, e.style.right = 0), r && (e.style.top = 0, e.style.bottom = 0);
602
- },
603
- fakeEvent: function(e, t, n, r) {
604
- var i = n || {}, a = we[t];
605
- if (!a) throw Error("Event type " + t + " not supported.");
606
- var o = document.createEvent(a);
607
- switch (a) {
608
- case "MouseEvents":
609
- var s = i.x || i.clientX || 0, c = i.y || i.clientY || 0;
610
- o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, s, c, !1, !1, !1, !1, 0, null);
611
- break;
612
- case "KeyboardEvents":
613
- var l = o.initKeyboardEvent || o.initKeyEvent;
614
- S.defaults(i, {
615
- cancelable: !0,
616
- ctrlKey: !1,
617
- altKey: !1,
618
- shiftKey: !1,
619
- metaKey: !1,
620
- keyCode: void 0,
621
- charCode: void 0
622
- }), l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
623
- break;
624
- default:
625
- o.initEvent(t, i.bubbles || !1, i.cancelable || !0);
626
- break;
627
- }
628
- S.defaults(o, r), e.dispatchEvent(o);
629
- },
630
- bind: function(e, t, n, r) {
631
- var i = r || !1;
632
- return e.addEventListener ? e.addEventListener(t, n, i) : e.attachEvent && e.attachEvent("on" + t, n), P;
633
- },
634
- unbind: function(e, t, n, r) {
635
- var i = r || !1;
636
- return e.removeEventListener ? e.removeEventListener(t, n, i) : e.detachEvent && e.detachEvent("on" + t, n), P;
637
- },
638
- addClass: function(e, t) {
639
- if (e.className === void 0) e.className = t;
640
- else if (e.className !== t) {
641
- var n = e.className.split(/ +/);
642
- n.indexOf(t) === -1 && (n.push(t), e.className = n.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""));
643
- }
644
- return P;
645
- },
646
- removeClass: function(e, t) {
647
- if (t) if (e.className === t) e.removeAttribute("class");
648
- else {
649
- var n = e.className.split(/ +/), r = n.indexOf(t);
650
- r !== -1 && (n.splice(r, 1), e.className = n.join(" "));
651
- }
652
- else e.className = void 0;
653
- return P;
654
- },
655
- hasClass: function(e, t) {
656
- return RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1;
657
- },
658
- getWidth: function(e) {
659
- var t = getComputedStyle(e);
660
- return N(t["border-left-width"]) + N(t["border-right-width"]) + N(t["padding-left"]) + N(t["padding-right"]) + N(t.width);
661
- },
662
- getHeight: function(e) {
663
- var t = getComputedStyle(e);
664
- return N(t["border-top-width"]) + N(t["border-bottom-width"]) + N(t["padding-top"]) + N(t["padding-bottom"]) + N(t.height);
665
- },
666
- getOffset: function(e) {
667
- var t = e, n = {
668
- left: 0,
669
- top: 0
670
- };
671
- if (t.offsetParent) do
672
- n.left += t.offsetLeft, n.top += t.offsetTop, t = t.offsetParent;
673
- while (t);
674
- return n;
675
- },
676
- isActive: function(e) {
677
- return e === document.activeElement && (e.type || e.href);
678
- }
679
- }, Ee = function(e) {
680
- k(t, e);
681
- function t(e, n) {
682
- E(this, t);
683
- var r = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n)), i = r;
684
- r.__prev = r.getValue(), r.__checkbox = document.createElement("input"), r.__checkbox.setAttribute("type", "checkbox");
685
- function a() {
686
- i.setValue(!i.__prev);
687
- }
688
- return P.bind(r.__checkbox, "change", a, !1), r.domElement.appendChild(r.__checkbox), r.updateDisplay(), r;
689
- }
690
- return D(t, [{
691
- key: "setValue",
692
- value: function(e) {
693
- var n = O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "setValue", this).call(this, e);
694
- return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.__prev = this.getValue(), n;
695
- }
696
- }, {
697
- key: "updateDisplay",
698
- value: function() {
699
- return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = !0, this.__prev = !0) : (this.__checkbox.checked = !1, this.__prev = !1), O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "updateDisplay", this).call(this);
700
- }
701
- }]), t;
702
- }(M), De = function(e) {
703
- k(t, e);
704
- function t(e, n, r) {
705
- E(this, t);
706
- var i = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n)), a = r, o = i;
707
- if (i.__select = document.createElement("select"), S.isArray(a)) {
708
- var s = {};
709
- S.each(a, function(e) {
710
- s[e] = e;
711
- }), a = s;
712
- }
713
- return S.each(a, function(e, t) {
714
- var n = document.createElement("option");
715
- n.innerHTML = t, n.setAttribute("value", e), o.__select.appendChild(n);
716
- }), i.updateDisplay(), P.bind(i.__select, "change", function() {
717
- var e = this.options[this.selectedIndex].value;
718
- o.setValue(e);
719
- }), i.domElement.appendChild(i.__select), i;
720
- }
721
- return D(t, [{
722
- key: "setValue",
723
- value: function(e) {
724
- var n = O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "setValue", this).call(this, e);
725
- return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), n;
726
- }
727
- }, {
728
- key: "updateDisplay",
729
- value: function() {
730
- return P.isActive(this.__select) ? this : (this.__select.value = this.getValue(), O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "updateDisplay", this).call(this));
731
- }
732
- }]), t;
733
- }(M), Oe = function(e) {
734
- k(t, e);
735
- function t(e, n) {
736
- E(this, t);
737
- var r = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n)), i = r;
738
- function a() {
739
- i.setValue(i.__input.value);
740
- }
741
- function o() {
742
- i.__onFinishChange && i.__onFinishChange.call(i, i.getValue());
743
- }
744
- return r.__input = document.createElement("input"), r.__input.setAttribute("type", "text"), P.bind(r.__input, "keyup", a), P.bind(r.__input, "change", a), P.bind(r.__input, "blur", o), P.bind(r.__input, "keydown", function(e) {
745
- e.keyCode === 13 && this.blur();
746
- }), r.updateDisplay(), r.domElement.appendChild(r.__input), r;
747
- }
748
- return D(t, [{
749
- key: "updateDisplay",
750
- value: function() {
751
- return P.isActive(this.__input) || (this.__input.value = this.getValue()), O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "updateDisplay", this).call(this);
752
- }
753
- }]), t;
754
- }(M);
755
- function ke(e) {
756
- var t = e.toString();
757
- return t.indexOf(".") > -1 ? t.length - t.indexOf(".") - 1 : 0;
758
- }
759
- var Ae = function(e) {
760
- k(t, e);
761
- function t(e, n, r) {
762
- E(this, t);
763
- var i = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n)), a = r || {};
764
- return i.__min = a.min, i.__max = a.max, i.__step = a.step, S.isUndefined(i.__step) ? i.initialValue === 0 ? i.__impliedStep = 1 : i.__impliedStep = 10 ** Math.floor(Math.log(Math.abs(i.initialValue)) / Math.LN10) / 10 : i.__impliedStep = i.__step, i.__precision = ke(i.__impliedStep), i;
765
- }
766
- return D(t, [
767
- {
768
- key: "setValue",
769
- value: function(e) {
770
- var n = e;
771
- return this.__min !== void 0 && n < this.__min ? n = this.__min : this.__max !== void 0 && n > this.__max && (n = this.__max), this.__step !== void 0 && n % this.__step !== 0 && (n = Math.round(n / this.__step) * this.__step), O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "setValue", this).call(this, n);
772
- }
773
- },
774
- {
775
- key: "min",
776
- value: function(e) {
777
- return this.__min = e, this;
778
- }
779
- },
780
- {
781
- key: "max",
782
- value: function(e) {
783
- return this.__max = e, this;
784
- }
785
- },
786
- {
787
- key: "step",
788
- value: function(e) {
789
- return this.__step = e, this.__impliedStep = e, this.__precision = ke(e), this;
790
- }
791
- }
792
- ]), t;
793
- }(M);
794
- function je(e, t) {
795
- var n = 10 ** t;
796
- return Math.round(e * n) / n;
797
- }
798
- var F = function(e) {
799
- k(t, e);
800
- function t(e, n, r) {
801
- E(this, t);
802
- var i = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r));
803
- i.__truncationSuspended = !1;
804
- var a = i, o = void 0;
805
- function s() {
806
- var e = parseFloat(a.__input.value);
807
- S.isNaN(e) || a.setValue(e);
808
- }
809
- function c() {
810
- a.__onFinishChange && a.__onFinishChange.call(a, a.getValue());
811
- }
812
- function l() {
813
- c();
814
- }
815
- function u(e) {
816
- var t = o - e.clientY;
817
- a.setValue(a.getValue() + t * a.__impliedStep), o = e.clientY;
818
- }
819
- function d() {
820
- P.unbind(window, "mousemove", u), P.unbind(window, "mouseup", d), c();
821
- }
822
- function f(e) {
823
- P.bind(window, "mousemove", u), P.bind(window, "mouseup", d), o = e.clientY;
824
- }
825
- return i.__input = document.createElement("input"), i.__input.setAttribute("type", "text"), P.bind(i.__input, "change", s), P.bind(i.__input, "blur", l), P.bind(i.__input, "mousedown", f), P.bind(i.__input, "keydown", function(e) {
826
- e.keyCode === 13 && (a.__truncationSuspended = !0, this.blur(), a.__truncationSuspended = !1, c());
827
- }), i.updateDisplay(), i.domElement.appendChild(i.__input), i;
828
- }
829
- return D(t, [{
830
- key: "updateDisplay",
831
- value: function() {
832
- return this.__input.value = this.__truncationSuspended ? this.getValue() : je(this.getValue(), this.__precision), O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "updateDisplay", this).call(this);
833
- }
834
- }]), t;
835
- }(Ae);
836
- function Me(e, t, n, r, i) {
837
- return r + (i - r) * ((e - t) / (n - t));
838
- }
839
- var Ne = function(e) {
840
- k(t, e);
841
- function t(e, n, r, i, a) {
842
- E(this, t);
843
- var o = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, {
844
- min: r,
845
- max: i,
846
- step: a
847
- })), s = o;
848
- o.__background = document.createElement("div"), o.__foreground = document.createElement("div"), P.bind(o.__background, "mousedown", c), P.bind(o.__background, "touchstart", d), P.addClass(o.__background, "slider"), P.addClass(o.__foreground, "slider-fg");
849
- function c(e) {
850
- document.activeElement.blur(), P.bind(window, "mousemove", l), P.bind(window, "mouseup", u), l(e);
851
- }
852
- function l(e) {
853
- e.preventDefault();
854
- var t = s.__background.getBoundingClientRect();
855
- return s.setValue(Me(e.clientX, t.left, t.right, s.__min, s.__max)), !1;
856
- }
857
- function u() {
858
- P.unbind(window, "mousemove", l), P.unbind(window, "mouseup", u), s.__onFinishChange && s.__onFinishChange.call(s, s.getValue());
859
- }
860
- function d(e) {
861
- e.touches.length === 1 && (P.bind(window, "touchmove", f), P.bind(window, "touchend", p), f(e));
862
- }
863
- function f(e) {
864
- var t = e.touches[0].clientX, n = s.__background.getBoundingClientRect();
865
- s.setValue(Me(t, n.left, n.right, s.__min, s.__max));
866
- }
867
- function p() {
868
- P.unbind(window, "touchmove", f), P.unbind(window, "touchend", p), s.__onFinishChange && s.__onFinishChange.call(s, s.getValue());
869
- }
870
- return o.updateDisplay(), o.__background.appendChild(o.__foreground), o.domElement.appendChild(o.__background), o;
871
- }
872
- return D(t, [{
873
- key: "updateDisplay",
874
- value: function() {
875
- var e = (this.getValue() - this.__min) / (this.__max - this.__min);
876
- return this.__foreground.style.width = e * 100 + "%", O(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "updateDisplay", this).call(this);
877
- }
878
- }]), t;
879
- }(Ae), Pe = function(e) {
880
- k(t, e);
881
- function t(e, n, r) {
882
- E(this, t);
883
- var i = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n)), a = i;
884
- return i.__button = document.createElement("div"), i.__button.innerHTML = r === void 0 ? "Fire" : r, P.bind(i.__button, "click", function(e) {
885
- return e.preventDefault(), a.fire(), !1;
886
- }), P.addClass(i.__button, "button"), i.domElement.appendChild(i.__button), i;
887
- }
888
- return D(t, [{
889
- key: "fire",
890
- value: function() {
891
- this.__onChange && this.__onChange.call(this), this.getValue().call(this.object), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue());
892
- }
893
- }]), t;
894
- }(M), Fe = function(e) {
895
- k(t, e);
896
- function t(e, n) {
897
- E(this, t);
898
- var r = A(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n));
899
- r.__color = new j(r.getValue()), r.__temp = new j(0);
900
- var i = r;
901
- r.domElement = document.createElement("div"), P.makeSelectable(r.domElement, !1), r.__selector = document.createElement("div"), r.__selector.className = "selector", r.__saturation_field = document.createElement("div"), r.__saturation_field.className = "saturation-field", r.__field_knob = document.createElement("div"), r.__field_knob.className = "field-knob", r.__field_knob_border = "2px solid ", r.__hue_knob = document.createElement("div"), r.__hue_knob.className = "hue-knob", r.__hue_field = document.createElement("div"), r.__hue_field.className = "hue-field", r.__input = document.createElement("input"), r.__input.type = "text", r.__input_textShadow = "0 1px 1px ", P.bind(r.__input, "keydown", function(e) {
902
- e.keyCode === 13 && u.call(this);
903
- }), P.bind(r.__input, "blur", u), P.bind(r.__selector, "mousedown", function() {
904
- P.addClass(this, "drag").bind(window, "mouseup", function() {
905
- P.removeClass(i.__selector, "drag");
906
- });
907
- }), P.bind(r.__selector, "touchstart", function() {
908
- P.addClass(this, "drag").bind(window, "touchend", function() {
909
- P.removeClass(i.__selector, "drag");
910
- });
911
- });
912
- var a = document.createElement("div");
913
- S.extend(r.__selector.style, {
914
- width: "122px",
915
- height: "102px",
916
- padding: "3px",
917
- backgroundColor: "#222",
918
- boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
919
- }), S.extend(r.__field_knob.style, {
920
- position: "absolute",
921
- width: "12px",
922
- height: "12px",
923
- border: r.__field_knob_border + (r.__color.v < .5 ? "#fff" : "#000"),
924
- boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
925
- borderRadius: "12px",
926
- zIndex: 1
927
- }), S.extend(r.__hue_knob.style, {
928
- position: "absolute",
929
- width: "15px",
930
- height: "2px",
931
- borderRight: "4px solid #fff",
932
- zIndex: 1
933
- }), S.extend(r.__saturation_field.style, {
934
- width: "100px",
935
- height: "100px",
936
- border: "1px solid #555",
937
- marginRight: "3px",
938
- display: "inline-block",
939
- cursor: "pointer"
940
- }), S.extend(a.style, {
941
- width: "100%",
942
- height: "100%",
943
- background: "none"
944
- }), Le(a, "top", "rgba(0,0,0,0)", "#000"), S.extend(r.__hue_field.style, {
945
- width: "15px",
946
- height: "100px",
947
- border: "1px solid #555",
948
- cursor: "ns-resize",
949
- position: "absolute",
950
- top: "3px",
951
- right: "3px"
952
- }), Re(r.__hue_field), S.extend(r.__input.style, {
953
- outline: "none",
954
- textAlign: "center",
955
- color: "#fff",
956
- border: 0,
957
- fontWeight: "bold",
958
- textShadow: r.__input_textShadow + "rgba(0,0,0,0.7)"
959
- }), P.bind(r.__saturation_field, "mousedown", o), P.bind(r.__saturation_field, "touchstart", o), P.bind(r.__field_knob, "mousedown", o), P.bind(r.__field_knob, "touchstart", o), P.bind(r.__hue_field, "mousedown", s), P.bind(r.__hue_field, "touchstart", s);
960
- function o(e) {
961
- f(e), P.bind(window, "mousemove", f), P.bind(window, "touchmove", f), P.bind(window, "mouseup", c), P.bind(window, "touchend", c);
962
- }
963
- function s(e) {
964
- p(e), P.bind(window, "mousemove", p), P.bind(window, "touchmove", p), P.bind(window, "mouseup", l), P.bind(window, "touchend", l);
965
- }
966
- function c() {
967
- P.unbind(window, "mousemove", f), P.unbind(window, "touchmove", f), P.unbind(window, "mouseup", c), P.unbind(window, "touchend", c), d();
968
- }
969
- function l() {
970
- P.unbind(window, "mousemove", p), P.unbind(window, "touchmove", p), P.unbind(window, "mouseup", l), P.unbind(window, "touchend", l), d();
971
- }
972
- function u() {
973
- var e = ve(this.value);
974
- e === !1 ? this.value = i.__color.toString() : (i.__color.__state = e, i.setValue(i.__color.toOriginal()));
975
- }
976
- function d() {
977
- i.__onFinishChange && i.__onFinishChange.call(i, i.__color.toOriginal());
978
- }
979
- r.__saturation_field.appendChild(a), r.__selector.appendChild(r.__field_knob), r.__selector.appendChild(r.__saturation_field), r.__selector.appendChild(r.__hue_field), r.__hue_field.appendChild(r.__hue_knob), r.domElement.appendChild(r.__input), r.domElement.appendChild(r.__selector), r.updateDisplay();
980
- function f(e) {
981
- e.type.indexOf("touch") === -1 && e.preventDefault();
982
- var t = i.__saturation_field.getBoundingClientRect(), n = e.touches && e.touches[0] || e, r = n.clientX, a = n.clientY, o = (r - t.left) / (t.right - t.left), s = 1 - (a - t.top) / (t.bottom - t.top);
983
- return s > 1 ? s = 1 : s < 0 && (s = 0), o > 1 ? o = 1 : o < 0 && (o = 0), i.__color.v = s, i.__color.s = o, i.setValue(i.__color.toOriginal()), !1;
984
- }
985
- function p(e) {
986
- e.type.indexOf("touch") === -1 && e.preventDefault();
987
- var t = i.__hue_field.getBoundingClientRect(), n = 1 - ((e.touches && e.touches[0] || e).clientY - t.top) / (t.bottom - t.top);
988
- return n > 1 ? n = 1 : n < 0 && (n = 0), i.__color.h = n * 360, i.setValue(i.__color.toOriginal()), !1;
989
- }
990
- return r;
991
- }
992
- return D(t, [{
993
- key: "updateDisplay",
994
- value: function() {
995
- var e = ve(this.getValue());
996
- if (e !== !1) {
997
- var t = !1;
998
- S.each(j.COMPONENTS, function(n) {
999
- if (!S.isUndefined(e[n]) && !S.isUndefined(this.__color.__state[n]) && e[n] !== this.__color.__state[n]) return t = !0, {};
1000
- }, this), t && S.extend(this.__color.__state, e);
1001
- }
1002
- S.extend(this.__temp.__state, this.__color.__state), this.__temp.a = 1;
1003
- var n = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0, r = 255 - n;
1004
- S.extend(this.__field_knob.style, {
1005
- marginLeft: 100 * this.__color.s - 7 + "px",
1006
- marginTop: 100 * (1 - this.__color.v) - 7 + "px",
1007
- backgroundColor: this.__temp.toHexString(),
1008
- border: this.__field_knob_border + "rgb(" + n + "," + n + "," + n + ")"
1009
- }), this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + "px", this.__temp.s = 1, this.__temp.v = 1, Le(this.__saturation_field, "left", "#fff", this.__temp.toHexString()), this.__input.value = this.__color.toString(), S.extend(this.__input.style, {
1010
- backgroundColor: this.__color.toHexString(),
1011
- color: "rgb(" + n + "," + n + "," + n + ")",
1012
- textShadow: this.__input_textShadow + "rgba(" + r + "," + r + "," + r + ",.7)"
1013
- });
1014
- }
1015
- }]), t;
1016
- }(M), Ie = [
1017
- "-moz-",
1018
- "-o-",
1019
- "-webkit-",
1020
- "-ms-",
1021
- ""
1022
- ];
1023
- function Le(e, t, n, r) {
1024
- e.style.background = "", S.each(Ie, function(i) {
1025
- e.style.cssText += "background: " + i + "linear-gradient(" + t + ", " + n + " 0%, " + r + " 100%); ";
1026
- });
1027
- }
1028
- function Re(e) {
1029
- e.style.background = "", e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);", e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";
1030
- }
1031
- var ze = {
1032
- load: function(e, t) {
1033
- var n = t || document, r = n.createElement("link");
1034
- r.type = "text/css", r.rel = "stylesheet", r.href = e, n.getElementsByTagName("head")[0].appendChild(r);
1035
- },
1036
- inject: function(e, t) {
1037
- var n = t || document, r = document.createElement("style");
1038
- r.type = "text/css", r.innerHTML = e;
1039
- var i = n.getElementsByTagName("head")[0];
1040
- try {
1041
- i.appendChild(r);
1042
- } catch {}
1043
- }
1044
- }, Be = "<div id=\"dg-save\" class=\"dg dialogue\">\n\n Here's the new load parameter for your <code>GUI</code>'s constructor:\n\n <textarea id=\"dg-new-constructor\"></textarea>\n\n <div id=\"dg-save-locally\">\n\n <input id=\"dg-local-storage\" type=\"checkbox\"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id=\"dg-local-explain\">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>", Ve = function(e, t) {
1045
- var n = e[t];
1046
- return S.isArray(arguments[2]) || S.isObject(arguments[2]) ? new De(e, t, arguments[2]) : S.isNumber(n) ? S.isNumber(arguments[2]) && S.isNumber(arguments[3]) ? S.isNumber(arguments[4]) ? new Ne(e, t, arguments[2], arguments[3], arguments[4]) : new Ne(e, t, arguments[2], arguments[3]) : S.isNumber(arguments[4]) ? new F(e, t, {
1047
- min: arguments[2],
1048
- max: arguments[3],
1049
- step: arguments[4]
1050
- }) : new F(e, t, {
1051
- min: arguments[2],
1052
- max: arguments[3]
1053
- }) : S.isString(n) ? new Oe(e, t) : S.isFunction(n) ? new Pe(e, t, "") : S.isBoolean(n) ? new Ee(e, t) : null;
1054
- };
1055
- function He(e) {
1056
- setTimeout(e, 1e3 / 60);
1057
- }
1058
- var Ue = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || He, We = function() {
1059
- function e() {
1060
- E(this, e), this.backgroundElement = document.createElement("div"), S.extend(this.backgroundElement.style, {
1061
- backgroundColor: "rgba(0,0,0,0.8)",
1062
- top: 0,
1063
- left: 0,
1064
- display: "none",
1065
- zIndex: "1000",
1066
- opacity: 0,
1067
- WebkitTransition: "opacity 0.2s linear",
1068
- transition: "opacity 0.2s linear"
1069
- }), P.makeFullscreen(this.backgroundElement), this.backgroundElement.style.position = "fixed", this.domElement = document.createElement("div"), S.extend(this.domElement.style, {
1070
- position: "fixed",
1071
- display: "none",
1072
- zIndex: "1001",
1073
- opacity: 0,
1074
- WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear",
1075
- transition: "transform 0.2s ease-out, opacity 0.2s linear"
1076
- }), document.body.appendChild(this.backgroundElement), document.body.appendChild(this.domElement);
1077
- var t = this;
1078
- P.bind(this.backgroundElement, "click", function() {
1079
- t.hide();
1080
- });
1081
- }
1082
- return D(e, [
1083
- {
1084
- key: "show",
1085
- value: function() {
1086
- var e = this;
1087
- this.backgroundElement.style.display = "block", this.domElement.style.display = "block", this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)", this.layout(), S.defer(function() {
1088
- e.backgroundElement.style.opacity = 1, e.domElement.style.opacity = 1, e.domElement.style.webkitTransform = "scale(1)";
1089
- });
1090
- }
1091
- },
1092
- {
1093
- key: "hide",
1094
- value: function() {
1095
- var e = this, t = function t() {
1096
- e.domElement.style.display = "none", e.backgroundElement.style.display = "none", P.unbind(e.domElement, "webkitTransitionEnd", t), P.unbind(e.domElement, "transitionend", t), P.unbind(e.domElement, "oTransitionEnd", t);
1097
- };
1098
- P.bind(this.domElement, "webkitTransitionEnd", t), P.bind(this.domElement, "transitionend", t), P.bind(this.domElement, "oTransitionEnd", t), this.backgroundElement.style.opacity = 0, this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)";
1099
- }
1100
- },
1101
- {
1102
- key: "layout",
1103
- value: function() {
1104
- this.domElement.style.left = window.innerWidth / 2 - P.getWidth(this.domElement) / 2 + "px", this.domElement.style.top = window.innerHeight / 2 - P.getHeight(this.domElement) / 2 + "px";
1105
- }
1106
- }
1107
- ]), e;
1108
- }(), Ge = he(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n");
1109
- ze.inject(Ge);
1110
- var Ke = "dg", qe = 72, Je = 20, I = "Default", L = function() {
1111
- try {
1112
- return !!window.localStorage;
1113
- } catch {
1114
- return !1;
1115
- }
1116
- }(), R = void 0, Ye = !0, z = void 0, Xe = !1, Ze = [], B = function e(t) {
1117
- var n = this, r = t || {};
1118
- this.domElement = document.createElement("div"), this.__ul = document.createElement("ul"), this.domElement.appendChild(this.__ul), P.addClass(this.domElement, Ke), this.__folders = {}, this.__controllers = [], this.__rememberedObjects = [], this.__rememberedObjectIndecesToControllers = [], this.__listening = [], r = S.defaults(r, {
1119
- closeOnTop: !1,
1120
- autoPlace: !0,
1121
- width: e.DEFAULT_WIDTH
1122
- }), r = S.defaults(r, {
1123
- resizable: r.autoPlace,
1124
- hideable: r.autoPlace
1125
- }), S.isUndefined(r.load) ? r.load = { preset: I } : r.preset && (r.load.preset = r.preset), S.isUndefined(r.parent) && r.hideable && Ze.push(this), r.resizable = S.isUndefined(r.parent) && r.resizable, r.autoPlace && S.isUndefined(r.scrollable) && (r.scrollable = !0);
1126
- var i = L && localStorage.getItem(H(this, "isLocal")) === "true", a = void 0, o = void 0;
1127
- if (Object.defineProperties(this, {
1128
- parent: { get: function() {
1129
- return r.parent;
1130
- } },
1131
- scrollable: { get: function() {
1132
- return r.scrollable;
1133
- } },
1134
- autoPlace: { get: function() {
1135
- return r.autoPlace;
1136
- } },
1137
- closeOnTop: { get: function() {
1138
- return r.closeOnTop;
1139
- } },
1140
- preset: {
1141
- get: function() {
1142
- return n.parent ? n.getRoot().preset : r.load.preset;
1143
- },
1144
- set: function(e) {
1145
- n.parent ? n.getRoot().preset = e : r.load.preset = e, ct(this), n.revert();
1146
- }
1147
- },
1148
- width: {
1149
- get: function() {
1150
- return r.width;
1151
- },
1152
- set: function(e) {
1153
- r.width = e, st(n, e);
1154
- }
1155
- },
1156
- name: {
1157
- get: function() {
1158
- return r.name;
1159
- },
1160
- set: function(e) {
1161
- r.name = e, o && (o.innerHTML = r.name);
1162
- }
1163
- },
1164
- closed: {
1165
- get: function() {
1166
- return r.closed;
1167
- },
1168
- set: function(t) {
1169
- r.closed = t, r.closed ? P.addClass(n.__ul, e.CLASS_CLOSED) : P.removeClass(n.__ul, e.CLASS_CLOSED), this.onResize(), n.__closeButton && (n.__closeButton.innerHTML = t ? e.TEXT_OPEN : e.TEXT_CLOSED);
1170
- }
1171
- },
1172
- load: { get: function() {
1173
- return r.load;
1174
- } },
1175
- useLocalStorage: {
1176
- get: function() {
1177
- return i;
1178
- },
1179
- set: function(e) {
1180
- L && (i = e, e ? P.bind(window, "unload", a) : P.unbind(window, "unload", a), localStorage.setItem(H(n, "isLocal"), e));
1181
- }
1182
- }
1183
- }), S.isUndefined(r.parent)) {
1184
- if (this.closed = r.closed || !1, P.addClass(this.domElement, e.CLASS_MAIN), P.makeSelectable(this.domElement, !1), L && i) {
1185
- n.useLocalStorage = !0;
1186
- var s = localStorage.getItem(H(this, "gui"));
1187
- s && (r.load = JSON.parse(s));
1188
- }
1189
- this.__closeButton = document.createElement("div"), this.__closeButton.innerHTML = e.TEXT_CLOSED, P.addClass(this.__closeButton, e.CLASS_CLOSE_BUTTON), r.closeOnTop ? (P.addClass(this.__closeButton, e.CLASS_CLOSE_TOP), this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0])) : (P.addClass(this.__closeButton, e.CLASS_CLOSE_BOTTOM), this.domElement.appendChild(this.__closeButton)), P.bind(this.__closeButton, "click", function() {
1190
- n.closed = !n.closed;
1191
- });
1192
- } else {
1193
- r.closed === void 0 && (r.closed = !0);
1194
- var c = document.createTextNode(r.name);
1195
- P.addClass(c, "controller-name"), o = Qe(n, c), P.addClass(this.__ul, e.CLASS_CLOSED), P.addClass(o, "title"), P.bind(o, "click", function(e) {
1196
- return e.preventDefault(), n.closed = !n.closed, !1;
1197
- }), r.closed || (this.closed = !1);
1198
- }
1199
- r.autoPlace && (S.isUndefined(r.parent) && (Ye &&= (z = document.createElement("div"), P.addClass(z, Ke), P.addClass(z, e.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(z), !1), z.appendChild(this.domElement), P.addClass(this.domElement, e.CLASS_AUTO_PLACE)), this.parent || st(n, r.width)), this.__resizeHandler = function() {
1200
- n.onResizeDebounced();
1201
- }, P.bind(window, "resize", this.__resizeHandler), P.bind(this.__ul, "webkitTransitionEnd", this.__resizeHandler), P.bind(this.__ul, "transitionend", this.__resizeHandler), P.bind(this.__ul, "oTransitionEnd", this.__resizeHandler), this.onResize(), r.resizable && ot(this), a = function() {
1202
- L && localStorage.getItem(H(n, "isLocal")) === "true" && localStorage.setItem(H(n, "gui"), JSON.stringify(n.getSaveObject()));
1203
- }, this.saveToLocalStorageIfPossible = a;
1204
- function l() {
1205
- var e = n.getRoot();
1206
- e.width += 1, S.defer(function() {
1207
- --e.width;
1208
- });
1209
- }
1210
- r.parent || l();
1211
- };
1212
- B.toggleHide = function() {
1213
- Xe = !Xe, S.each(Ze, function(e) {
1214
- e.domElement.style.display = Xe ? "none" : "";
1215
- });
1216
- }, B.CLASS_AUTO_PLACE = "a", B.CLASS_AUTO_PLACE_CONTAINER = "ac", B.CLASS_MAIN = "main", B.CLASS_CONTROLLER_ROW = "cr", B.CLASS_TOO_TALL = "taller-than-window", B.CLASS_CLOSED = "closed", B.CLASS_CLOSE_BUTTON = "close-button", B.CLASS_CLOSE_TOP = "close-top", B.CLASS_CLOSE_BOTTOM = "close-bottom", B.CLASS_DRAG = "drag", B.DEFAULT_WIDTH = 245, B.TEXT_CLOSED = "Close Controls", B.TEXT_OPEN = "Open Controls", B._keydownHandler = function(e) {
1217
- document.activeElement.type !== "text" && (e.which === qe || e.keyCode === qe) && B.toggleHide();
1218
- }, P.bind(window, "keydown", B._keydownHandler, !1), S.extend(B.prototype, {
1219
- add: function(e, t) {
1220
- return V(this, e, t, { factoryArgs: Array.prototype.slice.call(arguments, 2) });
1221
- },
1222
- addColor: function(e, t) {
1223
- return V(this, e, t, { color: !0 });
1224
- },
1225
- remove: function(e) {
1226
- this.__ul.removeChild(e.__li), this.__controllers.splice(this.__controllers.indexOf(e), 1);
1227
- var t = this;
1228
- S.defer(function() {
1229
- t.onResize();
1230
- });
1231
- },
1232
- destroy: function() {
1233
- if (this.parent) throw Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");
1234
- this.autoPlace && z.removeChild(this.domElement);
1235
- var e = this;
1236
- S.each(this.__folders, function(t) {
1237
- e.removeFolder(t);
1238
- }), P.unbind(window, "keydown", B._keydownHandler, !1), $e(this);
1239
- },
1240
- addFolder: function(e) {
1241
- if (this.__folders[e] !== void 0) throw Error("You already have a folder in this GUI by the name \"" + e + "\"");
1242
- var t = {
1243
- name: e,
1244
- parent: this
1245
- };
1246
- t.autoPlace = this.autoPlace, this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed, t.load = this.load.folders[e]);
1247
- var n = new B(t);
1248
- this.__folders[e] = n;
1249
- var r = Qe(this, n.domElement);
1250
- return P.addClass(r, "folder"), n;
1251
- },
1252
- removeFolder: function(e) {
1253
- this.__ul.removeChild(e.domElement.parentElement), delete this.__folders[e.name], this.load && this.load.folders && this.load.folders[e.name] && delete this.load.folders[e.name], $e(e);
1254
- var t = this;
1255
- S.each(e.__folders, function(t) {
1256
- e.removeFolder(t);
1257
- }), S.defer(function() {
1258
- t.onResize();
1259
- });
1260
- },
1261
- open: function() {
1262
- this.closed = !1;
1263
- },
1264
- close: function() {
1265
- this.closed = !0;
1266
- },
1267
- hide: function() {
1268
- this.domElement.style.display = "none";
1269
- },
1270
- show: function() {
1271
- this.domElement.style.display = "";
1272
- },
1273
- onResize: function() {
1274
- var e = this.getRoot();
1275
- if (e.scrollable) {
1276
- var t = P.getOffset(e.__ul).top, n = 0;
1277
- S.each(e.__ul.childNodes, function(t) {
1278
- e.autoPlace && t === e.__save_row || (n += P.getHeight(t));
1279
- }), window.innerHeight - t - Je < n ? (P.addClass(e.domElement, B.CLASS_TOO_TALL), e.__ul.style.height = window.innerHeight - t - Je + "px") : (P.removeClass(e.domElement, B.CLASS_TOO_TALL), e.__ul.style.height = "auto");
1280
- }
1281
- e.__resize_handle && S.defer(function() {
1282
- e.__resize_handle.style.height = e.__ul.offsetHeight + "px";
1283
- }), e.__closeButton && (e.__closeButton.style.width = e.width + "px");
1284
- },
1285
- onResizeDebounced: S.debounce(function() {
1286
- this.onResize();
1287
- }, 50),
1288
- remember: function() {
1289
- if (S.isUndefined(R) && (R = new We(), R.domElement.innerHTML = Be), this.parent) throw Error("You can only call remember on a top level GUI.");
1290
- var e = this;
1291
- S.each(Array.prototype.slice.call(arguments), function(t) {
1292
- e.__rememberedObjects.length === 0 && at(e), e.__rememberedObjects.indexOf(t) === -1 && e.__rememberedObjects.push(t);
1293
- }), this.autoPlace && st(this, this.width);
1294
- },
1295
- getRoot: function() {
1296
- for (var e = this; e.parent;) e = e.parent;
1297
- return e;
1298
- },
1299
- getSaveObject: function() {
1300
- var e = this.load;
1301
- return e.closed = this.closed, this.__rememberedObjects.length > 0 && (e.preset = this.preset, e.remembered ||= {}, e.remembered[this.preset] = U(this)), e.folders = {}, S.each(this.__folders, function(t, n) {
1302
- e.folders[n] = t.getSaveObject();
1303
- }), e;
1304
- },
1305
- save: function() {
1306
- this.load.remembered || (this.load.remembered = {}), this.load.remembered[this.preset] = U(this), et(this, !1), this.saveToLocalStorageIfPossible();
1307
- },
1308
- saveAs: function(e) {
1309
- this.load.remembered || (this.load.remembered = {}, this.load.remembered[I] = U(this, !0)), this.load.remembered[e] = U(this), this.preset = e, rt(this, e, !0), this.saveToLocalStorageIfPossible();
1310
- },
1311
- revert: function(e) {
1312
- S.each(this.__controllers, function(t) {
1313
- this.getRoot().load.remembered ? nt(e || this.getRoot(), t) : t.setValue(t.initialValue), t.__onFinishChange && t.__onFinishChange.call(t, t.getValue());
1314
- }, this), S.each(this.__folders, function(e) {
1315
- e.revert(e);
1316
- }), e || et(this.getRoot(), !1);
1317
- },
1318
- listen: function(e) {
1319
- var t = this.__listening.length === 0;
1320
- this.__listening.push(e), t && lt(this.__listening);
1321
- },
1322
- updateDisplay: function() {
1323
- S.each(this.__controllers, function(e) {
1324
- e.updateDisplay();
1325
- }), S.each(this.__folders, function(e) {
1326
- e.updateDisplay();
1327
- });
1328
- }
1329
- });
1330
- function Qe(e, t, n) {
1331
- var r = document.createElement("li");
1332
- return t && r.appendChild(t), n ? e.__ul.insertBefore(r, n) : e.__ul.appendChild(r), e.onResize(), r;
1333
- }
1334
- function $e(e) {
1335
- P.unbind(window, "resize", e.__resizeHandler), e.saveToLocalStorageIfPossible && P.unbind(window, "unload", e.saveToLocalStorageIfPossible);
1336
- }
1337
- function et(e, t) {
1338
- var n = e.__preset_select[e.__preset_select.selectedIndex];
1339
- t ? n.innerHTML = n.value + "*" : n.innerHTML = n.value;
1340
- }
1341
- function tt(e, t, n) {
1342
- if (n.__li = t, n.__gui = e, S.extend(n, {
1343
- options: function(t) {
1344
- if (arguments.length > 1) {
1345
- var r = n.__li.nextElementSibling;
1346
- return n.remove(), V(e, n.object, n.property, {
1347
- before: r,
1348
- factoryArgs: [S.toArray(arguments)]
1349
- });
1350
- }
1351
- if (S.isArray(t) || S.isObject(t)) {
1352
- var i = n.__li.nextElementSibling;
1353
- return n.remove(), V(e, n.object, n.property, {
1354
- before: i,
1355
- factoryArgs: [t]
1356
- });
1357
- }
1358
- },
1359
- name: function(e) {
1360
- return n.__li.firstElementChild.firstElementChild.innerHTML = e, n;
1361
- },
1362
- listen: function() {
1363
- return n.__gui.listen(n), n;
1364
- },
1365
- remove: function() {
1366
- return n.__gui.remove(n), n;
1367
- }
1368
- }), n instanceof Ne) {
1369
- var r = new F(n.object, n.property, {
1370
- min: n.__min,
1371
- max: n.__max,
1372
- step: n.__step
1373
- });
1374
- S.each([
1375
- "updateDisplay",
1376
- "onChange",
1377
- "onFinishChange",
1378
- "step",
1379
- "min",
1380
- "max"
1381
- ], function(e) {
1382
- var t = n[e], i = r[e];
1383
- n[e] = r[e] = function() {
1384
- var e = Array.prototype.slice.call(arguments);
1385
- return i.apply(r, e), t.apply(n, e);
1386
- };
1387
- }), P.addClass(t, "has-slider"), n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild);
1388
- } else if (n instanceof F) {
1389
- var i = function(t) {
1390
- if (S.isNumber(n.__min) && S.isNumber(n.__max)) {
1391
- var r = n.__li.firstElementChild.firstElementChild.innerHTML, i = n.__gui.__listening.indexOf(n) > -1;
1392
- n.remove();
1393
- var a = V(e, n.object, n.property, {
1394
- before: n.__li.nextElementSibling,
1395
- factoryArgs: [
1396
- n.__min,
1397
- n.__max,
1398
- n.__step
1399
- ]
1400
- });
1401
- return a.name(r), i && a.listen(), a;
1402
- }
1403
- return t;
1404
- };
1405
- n.min = S.compose(i, n.min), n.max = S.compose(i, n.max);
1406
- } else n instanceof Ee ? (P.bind(t, "click", function() {
1407
- P.fakeEvent(n.__checkbox, "click");
1408
- }), P.bind(n.__checkbox, "click", function(e) {
1409
- e.stopPropagation();
1410
- })) : n instanceof Pe ? (P.bind(t, "click", function() {
1411
- P.fakeEvent(n.__button, "click");
1412
- }), P.bind(t, "mouseover", function() {
1413
- P.addClass(n.__button, "hover");
1414
- }), P.bind(t, "mouseout", function() {
1415
- P.removeClass(n.__button, "hover");
1416
- })) : n instanceof Fe && (P.addClass(t, "color"), n.updateDisplay = S.compose(function(e) {
1417
- return t.style.borderLeftColor = n.__color.toString(), e;
1418
- }, n.updateDisplay), n.updateDisplay());
1419
- n.setValue = S.compose(function(t) {
1420
- return e.getRoot().__preset_select && n.isModified() && et(e.getRoot(), !0), t;
1421
- }, n.setValue);
1422
- }
1423
- function nt(e, t) {
1424
- var n = e.getRoot(), r = n.__rememberedObjects.indexOf(t.object);
1425
- if (r !== -1) {
1426
- var i = n.__rememberedObjectIndecesToControllers[r];
1427
- if (i === void 0 && (i = {}, n.__rememberedObjectIndecesToControllers[r] = i), i[t.property] = t, n.load && n.load.remembered) {
1428
- var a = n.load.remembered, o = void 0;
1429
- if (a[e.preset]) o = a[e.preset];
1430
- else if (a[I]) o = a[I];
1431
- else return;
1432
- if (o[r] && o[r][t.property] !== void 0) {
1433
- var s = o[r][t.property];
1434
- t.initialValue = s, t.setValue(s);
1435
- }
1436
- }
1437
- }
1438
- }
1439
- function V(e, t, n, r) {
1440
- if (t[n] === void 0) throw Error("Object \"" + t + "\" has no property \"" + n + "\"");
1441
- var i = void 0;
1442
- if (r.color) i = new Fe(t, n);
1443
- else {
1444
- var a = [t, n].concat(r.factoryArgs);
1445
- i = Ve.apply(e, a);
1446
- }
1447
- r.before instanceof M && (r.before = r.before.__li), nt(e, i), P.addClass(i.domElement, "c");
1448
- var o = document.createElement("span");
1449
- P.addClass(o, "property-name"), o.innerHTML = i.property;
1450
- var s = document.createElement("div");
1451
- s.appendChild(o), s.appendChild(i.domElement);
1452
- var c = Qe(e, s, r.before);
1453
- return P.addClass(c, B.CLASS_CONTROLLER_ROW), i instanceof Fe ? P.addClass(c, "color") : P.addClass(c, be(i.getValue())), tt(e, c, i), e.__controllers.push(i), i;
1454
- }
1455
- function H(e, t) {
1456
- return document.location.href + "." + t;
1457
- }
1458
- function rt(e, t, n) {
1459
- var r = document.createElement("option");
1460
- r.innerHTML = t, r.value = t, e.__preset_select.appendChild(r), n && (e.__preset_select.selectedIndex = e.__preset_select.length - 1);
1461
- }
1462
- function it(e, t) {
1463
- t.style.display = e.useLocalStorage ? "block" : "none";
1464
- }
1465
- function at(e) {
1466
- var t = e.__save_row = document.createElement("li");
1467
- P.addClass(e.domElement, "has-save"), e.__ul.insertBefore(t, e.__ul.firstChild), P.addClass(t, "save-row");
1468
- var n = document.createElement("span");
1469
- n.innerHTML = "&nbsp;", P.addClass(n, "button gears");
1470
- var r = document.createElement("span");
1471
- r.innerHTML = "Save", P.addClass(r, "button"), P.addClass(r, "save");
1472
- var i = document.createElement("span");
1473
- i.innerHTML = "New", P.addClass(i, "button"), P.addClass(i, "save-as");
1474
- var a = document.createElement("span");
1475
- a.innerHTML = "Revert", P.addClass(a, "button"), P.addClass(a, "revert");
1476
- var o = e.__preset_select = document.createElement("select");
1477
- if (e.load && e.load.remembered ? S.each(e.load.remembered, function(t, n) {
1478
- rt(e, n, n === e.preset);
1479
- }) : rt(e, I, !1), P.bind(o, "change", function() {
1480
- for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].innerHTML = e.__preset_select[t].value;
1481
- e.preset = this.value;
1482
- }), t.appendChild(o), t.appendChild(n), t.appendChild(r), t.appendChild(i), t.appendChild(a), L) {
1483
- var s = document.getElementById("dg-local-explain"), c = document.getElementById("dg-local-storage"), l = document.getElementById("dg-save-locally");
1484
- l.style.display = "block", localStorage.getItem(H(e, "isLocal")) === "true" && c.setAttribute("checked", "checked"), it(e, s), P.bind(c, "change", function() {
1485
- e.useLocalStorage = !e.useLocalStorage, it(e, s);
1486
- });
1487
- }
1488
- var u = document.getElementById("dg-new-constructor");
1489
- P.bind(u, "keydown", function(e) {
1490
- e.metaKey && (e.which === 67 || e.keyCode === 67) && R.hide();
1491
- }), P.bind(n, "click", function() {
1492
- u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2), R.show(), u.focus(), u.select();
1493
- }), P.bind(r, "click", function() {
1494
- e.save();
1495
- }), P.bind(i, "click", function() {
1496
- var t = prompt("Enter a new preset name.");
1497
- t && e.saveAs(t);
1498
- }), P.bind(a, "click", function() {
1499
- e.revert();
1500
- });
1501
- }
1502
- function ot(e) {
1503
- var t = void 0;
1504
- e.__resize_handle = document.createElement("div"), S.extend(e.__resize_handle.style, {
1505
- width: "6px",
1506
- marginLeft: "-3px",
1507
- height: "200px",
1508
- cursor: "ew-resize",
1509
- position: "absolute"
1510
- });
1511
- function n(n) {
1512
- return n.preventDefault(), e.width += t - n.clientX, e.onResize(), t = n.clientX, !1;
1513
- }
1514
- function r() {
1515
- P.removeClass(e.__closeButton, B.CLASS_DRAG), P.unbind(window, "mousemove", n), P.unbind(window, "mouseup", r);
1516
- }
1517
- function i(i) {
1518
- return i.preventDefault(), t = i.clientX, P.addClass(e.__closeButton, B.CLASS_DRAG), P.bind(window, "mousemove", n), P.bind(window, "mouseup", r), !1;
1519
- }
1520
- P.bind(e.__resize_handle, "mousedown", i), P.bind(e.__closeButton, "mousedown", i), e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild);
1521
- }
1522
- function st(e, t) {
1523
- e.domElement.style.width = t + "px", e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"), e.__closeButton && (e.__closeButton.style.width = t + "px");
1524
- }
1525
- function U(e, t) {
1526
- var n = {};
1527
- return S.each(e.__rememberedObjects, function(r, i) {
1528
- var a = {}, o = e.__rememberedObjectIndecesToControllers[i];
1529
- S.each(o, function(e, n) {
1530
- a[n] = t ? e.initialValue : e.getValue();
1531
- }), n[i] = a;
1532
- }), n;
1533
- }
1534
- function ct(e) {
1535
- for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].value === e.preset && (e.__preset_select.selectedIndex = t);
1536
- }
1537
- function lt(e) {
1538
- e.length !== 0 && Ue.call(window, function() {
1539
- lt(e);
1540
- }), S.each(e, function(e) {
1541
- e.updateDisplay();
1542
- });
1543
- }
1544
- var ut = B, dt = class {
1545
- static createMeshPhysicalMaterial(e) {
1546
- return new c(e);
1547
- }
1548
- static createMeshStandardMaterial(e) {
1549
- return new s(e);
1550
- }
1551
- }, W = Object.freeze({
1552
- Linear: Object.freeze({
1553
- None: function(e) {
1554
- return e;
1555
- },
1556
- In: function(e) {
1557
- return e;
1558
- },
1559
- Out: function(e) {
1560
- return e;
1561
- },
1562
- InOut: function(e) {
1563
- return e;
1564
- }
1565
- }),
1566
- Quadratic: Object.freeze({
1567
- In: function(e) {
1568
- return e * e;
1569
- },
1570
- Out: function(e) {
1571
- return e * (2 - e);
1572
- },
1573
- InOut: function(e) {
1574
- return (e *= 2) < 1 ? .5 * e * e : -.5 * (--e * (e - 2) - 1);
1575
- }
1576
- }),
1577
- Cubic: Object.freeze({
1578
- In: function(e) {
1579
- return e * e * e;
1580
- },
1581
- Out: function(e) {
1582
- return --e * e * e + 1;
1583
- },
1584
- InOut: function(e) {
1585
- return (e *= 2) < 1 ? .5 * e * e * e : .5 * ((e -= 2) * e * e + 2);
1586
- }
1587
- }),
1588
- Quartic: Object.freeze({
1589
- In: function(e) {
1590
- return e * e * e * e;
1591
- },
1592
- Out: function(e) {
1593
- return 1 - --e * e * e * e;
1594
- },
1595
- InOut: function(e) {
1596
- return (e *= 2) < 1 ? .5 * e * e * e * e : -.5 * ((e -= 2) * e * e * e - 2);
1597
- }
1598
- }),
1599
- Quintic: Object.freeze({
1600
- In: function(e) {
1601
- return e * e * e * e * e;
1602
- },
1603
- Out: function(e) {
1604
- return --e * e * e * e * e + 1;
1605
- },
1606
- InOut: function(e) {
1607
- return (e *= 2) < 1 ? .5 * e * e * e * e * e : .5 * ((e -= 2) * e * e * e * e + 2);
1608
- }
1609
- }),
1610
- Sinusoidal: Object.freeze({
1611
- In: function(e) {
1612
- return 1 - Math.sin((1 - e) * Math.PI / 2);
1613
- },
1614
- Out: function(e) {
1615
- return Math.sin(e * Math.PI / 2);
1616
- },
1617
- InOut: function(e) {
1618
- return .5 * (1 - Math.sin(Math.PI * (.5 - e)));
1619
- }
1620
- }),
1621
- Exponential: Object.freeze({
1622
- In: function(e) {
1623
- return e === 0 ? 0 : 1024 ** (e - 1);
1624
- },
1625
- Out: function(e) {
1626
- return e === 1 ? 1 : 1 - 2 ** (-10 * e);
1627
- },
1628
- InOut: function(e) {
1629
- return e === 0 ? 0 : e === 1 ? 1 : (e *= 2) < 1 ? .5 * 1024 ** (e - 1) : .5 * (-(2 ** (-10 * (e - 1))) + 2);
1630
- }
1631
- }),
1632
- Circular: Object.freeze({
1633
- In: function(e) {
1634
- return 1 - Math.sqrt(1 - e * e);
1635
- },
1636
- Out: function(e) {
1637
- return Math.sqrt(1 - --e * e);
1638
- },
1639
- InOut: function(e) {
1640
- return (e *= 2) < 1 ? -.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1);
1641
- }
1642
- }),
1643
- Elastic: Object.freeze({
1644
- In: function(e) {
1645
- return e === 0 ? 0 : e === 1 ? 1 : -(2 ** (10 * (e - 1))) * Math.sin((e - 1.1) * 5 * Math.PI);
1646
- },
1647
- Out: function(e) {
1648
- return e === 0 ? 0 : e === 1 ? 1 : 2 ** (-10 * e) * Math.sin((e - .1) * 5 * Math.PI) + 1;
1649
- },
1650
- InOut: function(e) {
1651
- return e === 0 ? 0 : e === 1 ? 1 : (e *= 2, e < 1 ? -.5 * 2 ** (10 * (e - 1)) * Math.sin((e - 1.1) * 5 * Math.PI) : .5 * 2 ** (-10 * (e - 1)) * Math.sin((e - 1.1) * 5 * Math.PI) + 1);
1652
- }
1653
- }),
1654
- Back: Object.freeze({
1655
- In: function(e) {
1656
- var t = 1.70158;
1657
- return e === 1 ? 1 : e * e * ((t + 1) * e - t);
1658
- },
1659
- Out: function(e) {
1660
- var t = 1.70158;
1661
- return e === 0 ? 0 : --e * e * ((t + 1) * e + t) + 1;
1662
- },
1663
- InOut: function(e) {
1664
- var t = 1.70158 * 1.525;
1665
- return (e *= 2) < 1 ? .5 * (e * e * ((t + 1) * e - t)) : .5 * ((e -= 2) * e * ((t + 1) * e + t) + 2);
1666
- }
1667
- }),
1668
- Bounce: Object.freeze({
1669
- In: function(e) {
1670
- return 1 - W.Bounce.Out(1 - e);
1671
- },
1672
- Out: function(e) {
1673
- return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375;
1674
- },
1675
- InOut: function(e) {
1676
- return e < .5 ? W.Bounce.In(e * 2) * .5 : W.Bounce.Out(e * 2 - 1) * .5 + .5;
1677
- }
1678
- }),
1679
- generatePow: function(e) {
1680
- return e === void 0 && (e = 4), e = e < 2 ** -52 ? 2 ** -52 : e, e = e > 1e4 ? 1e4 : e, {
1681
- In: function(t) {
1682
- return t ** +e;
1683
- },
1684
- Out: function(t) {
1685
- return 1 - (1 - t) ** e;
1686
- },
1687
- InOut: function(t) {
1688
- return t < .5 ? (t * 2) ** e / 2 : (1 - (2 - t * 2) ** e) / 2 + .5;
1689
- }
1690
- };
1691
- }
1692
- }), G = function() {
1693
- return performance.now();
1694
- }, ft = function() {
1695
- function e() {
1696
- var e = [...arguments];
1697
- this._tweens = {}, this._tweensAddedDuringUpdate = {}, this.add.apply(this, e);
1698
- }
1699
- return e.prototype.getAll = function() {
1700
- var e = this;
1701
- return Object.keys(this._tweens).map(function(t) {
1702
- return e._tweens[t];
1703
- });
1704
- }, e.prototype.removeAll = function() {
1705
- this._tweens = {};
1706
- }, e.prototype.add = function() {
1707
- for (var e, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
1708
- for (var r = 0, i = t; r < i.length; r++) {
1709
- var a = i[r];
1710
- (e = a._group) == null || e.remove(a), a._group = this, this._tweens[a.getId()] = a, this._tweensAddedDuringUpdate[a.getId()] = a;
1711
- }
1712
- }, e.prototype.remove = function() {
1713
- for (var e = [...arguments], t = 0, n = e; t < n.length; t++) {
1714
- var r = n[t];
1715
- r._group = void 0, delete this._tweens[r.getId()], delete this._tweensAddedDuringUpdate[r.getId()];
1716
- }
1717
- }, e.prototype.allStopped = function() {
1718
- return this.getAll().every(function(e) {
1719
- return !e.isPlaying();
1720
- });
1721
- }, e.prototype.update = function(e, t) {
1722
- e === void 0 && (e = G()), t === void 0 && (t = !0);
1723
- var n = Object.keys(this._tweens);
1724
- if (n.length !== 0) for (; n.length > 0;) {
1725
- this._tweensAddedDuringUpdate = {};
1726
- for (var r = 0; r < n.length; r++) {
1727
- var i = this._tweens[n[r]], a = !t;
1728
- i && i.update(e, a) === !1 && !t && this.remove(i);
1729
- }
1730
- n = Object.keys(this._tweensAddedDuringUpdate);
1731
- }
1732
- }, e;
1733
- }(), K = {
1734
- Linear: function(e, t) {
1735
- var n = e.length - 1, r = n * t, i = Math.floor(r), a = K.Utils.Linear;
1736
- return t < 0 ? a(e[0], e[1], r) : t > 1 ? a(e[n], e[n - 1], n - r) : a(e[i], e[i + 1 > n ? n : i + 1], r - i);
1737
- },
1738
- Bezier: function(e, t) {
1739
- for (var n = 0, r = e.length - 1, i = Math.pow, a = K.Utils.Bernstein, o = 0; o <= r; o++) n += i(1 - t, r - o) * i(t, o) * e[o] * a(r, o);
1740
- return n;
1741
- },
1742
- CatmullRom: function(e, t) {
1743
- var n = e.length - 1, r = n * t, i = Math.floor(r), a = K.Utils.CatmullRom;
1744
- return e[0] === e[n] ? (t < 0 && (i = Math.floor(r = n * (1 + t))), a(e[(i - 1 + n) % n], e[i], e[(i + 1) % n], e[(i + 2) % n], r - i)) : t < 0 ? e[0] - (a(e[0], e[0], e[1], e[1], -r) - e[0]) : t > 1 ? e[n] - (a(e[n], e[n], e[n - 1], e[n - 1], r - n) - e[n]) : a(e[i ? i - 1 : 0], e[i], e[n < i + 1 ? n : i + 1], e[n < i + 2 ? n : i + 2], r - i);
1745
- },
1746
- Utils: {
1747
- Linear: function(e, t, n) {
1748
- return (t - e) * n + e;
1749
- },
1750
- Bernstein: function(e, t) {
1751
- var n = K.Utils.Factorial;
1752
- return n(e) / n(t) / n(e - t);
1753
- },
1754
- Factorial: (function() {
1755
- var e = [1];
1756
- return function(t) {
1757
- var n = 1;
1758
- if (e[t]) return e[t];
1759
- for (var r = t; r > 1; r--) n *= r;
1760
- return e[t] = n, n;
1761
- };
1762
- })(),
1763
- CatmullRom: function(e, t, n, r, i) {
1764
- var a = (n - e) * .5, o = (r - t) * .5, s = i * i, c = i * s;
1765
- return (2 * t - 2 * n + a + o) * c + (-3 * t + 3 * n - 2 * a - o) * s + a * i + t;
1766
- }
1767
- }
1768
- }, pt = function() {
1769
- function e() {}
1770
- return e.nextId = function() {
1771
- return e._nextId++;
1772
- }, e._nextId = 0, e;
1773
- }(), mt = new ft(), q = function() {
1774
- function e(e, t) {
1775
- this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = W.Linear.None, this._interpolationFunction = K.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = pt.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1, this._object = e, typeof t == "object" ? (this._group = t, t.add(this)) : t === !0 && (this._group = mt, mt.add(this));
1776
- }
1777
- return e.prototype.getId = function() {
1778
- return this._id;
1779
- }, e.prototype.isPlaying = function() {
1780
- return this._isPlaying;
1781
- }, e.prototype.isPaused = function() {
1782
- return this._isPaused;
1783
- }, e.prototype.getDuration = function() {
1784
- return this._duration;
1785
- }, e.prototype.to = function(e, t) {
1786
- if (t === void 0 && (t = 1e3), this._isPlaying) throw Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");
1787
- return this._valuesEnd = e, this._propertiesAreSetUp = !1, this._duration = t < 0 ? 0 : t, this;
1788
- }, e.prototype.duration = function(e) {
1789
- return e === void 0 && (e = 1e3), this._duration = e < 0 ? 0 : e, this;
1790
- }, e.prototype.dynamic = function(e) {
1791
- return e === void 0 && (e = !1), this._isDynamic = e, this;
1792
- }, e.prototype.start = function(e, t) {
1793
- if (e === void 0 && (e = G()), t === void 0 && (t = !1), this._isPlaying) return this;
1794
- if (this._repeat = this._initialRepeat, this._reversed) for (var n in this._reversed = !1, this._valuesStartRepeat) this._swapEndStartRepeatValues(n), this._valuesStart[n] = this._valuesStartRepeat[n];
1795
- if (this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e, this._startTime += this._delayTime, !this._propertiesAreSetUp || t) {
1796
- if (this._propertiesAreSetUp = !0, !this._isDynamic) {
1797
- var r = {};
1798
- for (var i in this._valuesEnd) r[i] = this._valuesEnd[i];
1799
- this._valuesEnd = r;
1800
- }
1801
- this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, t);
1802
- }
1803
- return this;
1804
- }, e.prototype.startFromCurrentValues = function(e) {
1805
- return this.start(e, !0);
1806
- }, e.prototype._setupProperties = function(e, t, n, r, i) {
1807
- for (var a in n) {
1808
- var o = e[a], s = Array.isArray(o), c = s ? "array" : typeof o, l = !s && Array.isArray(n[a]);
1809
- if (!(c === "undefined" || c === "function")) {
1810
- if (l) {
1811
- var u = n[a];
1812
- if (u.length === 0) continue;
1813
- for (var d = [o], f = 0, p = u.length; f < p; f += 1) {
1814
- var m = this._handleRelativeValue(o, u[f]);
1815
- if (isNaN(m)) {
1816
- l = !1, console.warn("Found invalid interpolation list. Skipping.");
1817
- break;
1818
- }
1819
- d.push(m);
1820
- }
1821
- l && (n[a] = d);
1822
- }
1823
- if ((c === "object" || s) && o && !l) {
1824
- t[a] = s ? [] : {};
1825
- var h = o;
1826
- for (var g in h) t[a][g] = h[g];
1827
- r[a] = s ? [] : {};
1828
- var u = n[a];
1829
- if (!this._isDynamic) {
1830
- var _ = {};
1831
- for (var g in u) _[g] = u[g];
1832
- n[a] = u = _;
1833
- }
1834
- this._setupProperties(h, t[a], u, r[a], i);
1835
- } else (t[a] === void 0 || i) && (t[a] = o), s || (t[a] *= 1), l ? r[a] = n[a].slice().reverse() : r[a] = t[a] || 0;
1836
- }
1837
- }
1838
- }, e.prototype.stop = function() {
1839
- return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this;
1840
- }, e.prototype.end = function() {
1841
- return this._goToEnd = !0, this.update(this._startTime + this._duration), this;
1842
- }, e.prototype.pause = function(e) {
1843
- return e === void 0 && (e = G()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this);
1844
- }, e.prototype.resume = function(e) {
1845
- return e === void 0 && (e = G()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this);
1846
- }, e.prototype.stopChainedTweens = function() {
1847
- for (var e = 0, t = this._chainedTweens.length; e < t; e++) this._chainedTweens[e].stop();
1848
- return this;
1849
- }, e.prototype.group = function(e) {
1850
- return e ? (e.add(this), this) : (console.warn("tween.group() without args has been removed, use group.add(tween) instead."), this);
1851
- }, e.prototype.remove = function() {
1852
- var e;
1853
- return (e = this._group) == null || e.remove(this), this;
1854
- }, e.prototype.delay = function(e) {
1855
- return e === void 0 && (e = 0), this._delayTime = e, this;
1856
- }, e.prototype.repeat = function(e) {
1857
- return e === void 0 && (e = 0), this._initialRepeat = e, this._repeat = e, this;
1858
- }, e.prototype.repeatDelay = function(e) {
1859
- return this._repeatDelayTime = e, this;
1860
- }, e.prototype.yoyo = function(e) {
1861
- return e === void 0 && (e = !1), this._yoyo = e, this;
1862
- }, e.prototype.easing = function(e) {
1863
- return e === void 0 && (e = W.Linear.None), this._easingFunction = e, this;
1864
- }, e.prototype.interpolation = function(e) {
1865
- return e === void 0 && (e = K.Linear), this._interpolationFunction = e, this;
1866
- }, e.prototype.chain = function() {
1867
- return this._chainedTweens = [...arguments], this;
1868
- }, e.prototype.onStart = function(e) {
1869
- return this._onStartCallback = e, this;
1870
- }, e.prototype.onEveryStart = function(e) {
1871
- return this._onEveryStartCallback = e, this;
1872
- }, e.prototype.onUpdate = function(e) {
1873
- return this._onUpdateCallback = e, this;
1874
- }, e.prototype.onRepeat = function(e) {
1875
- return this._onRepeatCallback = e, this;
1876
- }, e.prototype.onComplete = function(e) {
1877
- return this._onCompleteCallback = e, this;
1878
- }, e.prototype.onStop = function(e) {
1879
- return this._onStopCallback = e, this;
1880
- }, e.prototype.update = function(t, n) {
1881
- var r = this;
1882
- if (t === void 0 && (t = G()), n === void 0 && (n = e.autoStartOnUpdate), this._isPaused) return !0;
1883
- var i;
1884
- if (!this._goToEnd && !this._isPlaying) if (n) this.start(t, !0);
1885
- else return !1;
1886
- if (this._goToEnd = !1, t < this._startTime) return !0;
1887
- this._onStartCallbackFired === !1 && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), this._onEveryStartCallbackFired === !1 && (this._onEveryStartCallback && this._onEveryStartCallback(this._object), this._onEveryStartCallbackFired = !0);
1888
- var a = t - this._startTime, o = this._duration + (this._repeatDelayTime ?? this._delayTime), s = this._duration + this._repeat * o, c = function() {
1889
- if (r._duration === 0 || a > s) return 1;
1890
- var e = a - Math.trunc(a / o) * o, t = Math.min(e / r._duration, 1);
1891
- return t === 0 && a === r._duration ? 1 : t;
1892
- }(), l = this._easingFunction(c);
1893
- if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, l), this._onUpdateCallback && this._onUpdateCallback(this._object, c), this._duration === 0 || a >= this._duration) if (this._repeat > 0) {
1894
- var u = Math.min(Math.trunc((a - this._duration) / o) + 1, this._repeat);
1895
- for (i in isFinite(this._repeat) && (this._repeat -= u), this._valuesStartRepeat) !this._yoyo && typeof this._valuesEnd[i] == "string" && (this._valuesStartRepeat[i] = this._valuesStartRepeat[i] + parseFloat(this._valuesEnd[i])), this._yoyo && this._swapEndStartRepeatValues(i), this._valuesStart[i] = this._valuesStartRepeat[i];
1896
- return this._yoyo && (this._reversed = !this._reversed), this._startTime += o * u, this._onRepeatCallback && this._onRepeatCallback(this._object), this._onEveryStartCallbackFired = !1, !0;
1897
- } else {
1898
- this._onCompleteCallback && this._onCompleteCallback(this._object);
1899
- for (var d = 0, f = this._chainedTweens.length; d < f; d++) this._chainedTweens[d].start(this._startTime + this._duration, !1);
1900
- return this._isPlaying = !1, !1;
1901
- }
1902
- return !0;
1903
- }, e.prototype._updateProperties = function(e, t, n, r) {
1904
- for (var i in n) if (t[i] !== void 0) {
1905
- var a = t[i] || 0, o = n[i];
1906
- !Array.isArray(e[i]) && Array.isArray(o) ? e[i] = this._interpolationFunction(o, r) : typeof o == "object" && o ? this._updateProperties(e[i], a, o, r) : (o = this._handleRelativeValue(a, o), typeof o == "number" && (e[i] = a + (o - a) * r));
1907
- }
1908
- }, e.prototype._handleRelativeValue = function(e, t) {
1909
- return typeof t == "string" ? t.charAt(0) === "+" || t.charAt(0) === "-" ? e + parseFloat(t) : parseFloat(t) : t;
1910
- }, e.prototype._swapEndStartRepeatValues = function(e) {
1911
- var t = this._valuesStartRepeat[e], n = this._valuesEnd[e];
1912
- typeof n == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(n) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = t;
1913
- }, e.autoStartOnUpdate = !1, e;
1914
- }();
1915
- pt.nextId;
1916
- var J = mt;
1917
- J.getAll.bind(J), J.removeAll.bind(J), J.add.bind(J), J.remove.bind(J), J.update.bind(J);
1918
- var ht = .4, gt = "#DDDDDD", _t = .4, vt = "#7B7B7B", yt = "#B1B1B1", bt = .8, xt = .9, St = (e) => e instanceof g ? e.capabilities.maxSamples : 16, Ct = (e) => e instanceof g ? e.capabilities.maxTextures : 16, wt = (e) => e instanceof g ? e.capabilities.getMaxAnisotropy() : 16, Tt = (e, t, n, r) => {
1919
- if (!e || !t || n === 0 || r === 0) return new m();
1920
- let i = e.clone(), a = n / 2, o = r / 2;
1921
- return i.project(t), i.x = Math.floor(i.x * a + a), i.y = Math.floor(-(i.y * o) + o), i.z = e.distanceTo(t.position), i;
1922
- }, Et = (e, t) => {
1923
- t ||= new m(0, 0, 0);
1924
- let n = new m(e.size.x / 1e3, e.size.z / 1e3, e.size.y / 1e3), r = new m(e.origin.x / 1e3, e.origin.z / 1e3, e.origin.y / -1e3);
1925
- return new o(new m(0, 0, -n.z).add(r).sub(t), new m(n.x, n.y, 0).add(r).add(t));
1926
- }, Dt = (e) => (e.from /= 1e3, e.to /= 1e3, e), Ot = (e, t) => {
1927
- let n = y(e.x), r = y(e.y), i = y(e.z), a = y(t.x), o = y(t.y), s = y(t.z);
1928
- return n === a && r === o && i === s;
1929
- }, kt = (e, t) => {
1930
- let n = y(e.w), r = y(e.x), i = y(e.y), a = y(e.z), o = y(t.w), s = y(t.x), c = y(t.y), l = y(t.z);
1931
- return n === o && r === s && i === c && a === l;
1932
- }, At = (e, t) => {
1933
- let n = y(e.x), r = y(e.y), i = y(t.x), a = y(t.y);
1934
- return n === i && r === a;
1935
- }, Y = null, jt = () => {
1936
- if (Y) return Y;
1937
- let t = new Uint8Array(4);
1938
- for (let e = 0; e < 1; e++) {
1939
- let n = e * 4;
1940
- t[n] = 255, t[n + 1] = 255, t[n + 2] = 255, t[n + 3] = 255;
1941
- }
1942
- let n = new e(t, 1, 1, i);
1943
- return n.needsUpdate = !0, n;
1944
- }, Mt = (e) => Nt(null, e), Nt = (e, t) => {
1945
- e ||= It(), e.name = t.id ? t.id.toString() : "";
1946
- let n = t.shading.version === "2" || t.shading.version?.startsWith("2.");
1947
- return e = n ? Ft(e, t) : Pt(e, t), e.userData.materialVersion = n ? 2 : 1, e.map || (Y ||= jt(), e.map = Y), e;
1948
- }, Pt = (e, t) => {
1949
- t.shading.metallic !== void 0 && (e.metalness = t.shading.metallic === 1 ? 1 : .5, e.reflectivity = v(t.shading.metallic, .5));
1950
- let n = !1;
1951
- return t.shading.transmission && t.shading.transmission > 0 ? (e.opacity = 1 - t.shading.transmission, e.transparent = !0, e.depthWrite = !1, e.metalness = 0, n = !0) : t.shading.alpha !== void 0 && t.shading.alpha < 1 && (e.transparent = t.shading.alpha < 1, e.opacity = t.shading.alpha, e.depthWrite = t.shading.alpha >= 1, e.metalness = .5 * Math.max(0, t.shading.alpha), n = !0), e.aoMapIntensity = v(t.shading.occlusion, 1), e.roughness = v(t.shading.roughness, .5), e.alphaTest = v(t.shading.alphaCutoff, 0), X(e.color, t.shading.basecolor), n || t.shading.doubleSided ? e.side = 2 : e.side = 0, e;
1952
- }, Ft = (e, t) => {
1953
- let n = !1;
1954
- return t.shading.alpha !== void 0 && t.shading.alpha < 1 ? (e.transparent = !0, e.opacity = t.shading.alpha, e.depthWrite = !1, n = !0) : (e.transparent = !1, e.opacity = 1, e.depthWrite = !0), e.alphaTest = t.shading.alphaCutoff ?? 0, X(e.color, t.shading.basecolor), e.transmission = t.shading.transmission ?? 0, e.ior = Math.max(1, Math.min(2.33, t.shading.transmissionIOR ?? 1.5)), e.metalness = t.shading.metallic ?? 0, X(e.specularColor, t.shading.specularColor), e.specularIntensity = t.shading.specularity ?? 1, e.roughness = t.shading.roughness ?? 0, e.aoMapIntensity = t.shading.occlusion ?? 1, X(e.emissive, t.shading.emissiveColor), e.emissiveIntensity = t.shading.emissiveIntensity ?? 1, e.clearcoat = t.shading.clearcoatIntensity ?? 0, e.clearcoatRoughness = t.shading.clearcoatRoughness ?? 0, e.clearcoatNormalScale.setScalar(t.shading.clearcoatNormalScale ?? 1), X(e.sheenColor, t.shading.sheenColor), e.sheen = t.shading.sheenIntensity ?? 1, e.sheenRoughness = t.shading.sheenRoughness ?? 1, e.thickness = t.shading.thicknessFactor ?? 0, X(e.attenuationColor, t.shading.attenuationColor), t.shading.attenuationDistance && (e.attenuationDistance = t.shading.attenuationDistance), e.side = n || t.shading.doubleSided ? 2 : 0, e;
1955
- }, It = () => dt.createMeshPhysicalMaterial({}), Lt = (e, t = 1) => t === 2 ? zt(e) : Rt(e), Rt = (e) => {
1956
- let t = {
1957
- alpha: e.opacity,
1958
- metallic: e.reflectivity,
1959
- basecolor: Z(e.color),
1960
- roughness: e.roughness,
1961
- doubleSided: e.side === 2,
1962
- alphaCutoff: e.alphaTest,
1963
- transmission: e.transmission
1964
- };
1965
- return e.metalness === 1 ? t.metallic = 1 : t.metallic = e.reflectivity, t;
1966
- }, zt = (e) => ({
1967
- version: "2.0.0",
1968
- alpha: e.opacity,
1969
- alphaCutoff: e.alphaTest,
1970
- basecolor: Z(e.color),
1971
- transmission: e.transmission,
1972
- transmissionIOR: e.ior,
1973
- metallic: e.metalness,
1974
- doubleSided: e.side === 2,
1975
- specularColor: Z(e.specularColor),
1976
- specularity: e.specularIntensity,
1977
- roughness: e.roughness,
1978
- occlusion: e.aoMapIntensity,
1979
- emissiveColor: Z(e.emissive),
1980
- emissiveIntensity: e.emissiveIntensity,
1981
- clearcoatIntensity: e.clearcoat,
1982
- clearcoatRoughness: e.clearcoatRoughness,
1983
- clearcoatNormalScale: e.clearcoatNormalScale.x,
1984
- sheenColor: Z(e.sheenColor),
1985
- sheenIntensity: e.sheen,
1986
- sheenRoughness: e.sheenRoughness,
1987
- thicknessFactor: e.thickness,
1988
- attenuationColor: Z(e.attenuationColor),
1989
- attenuationDistance: e.attenuationDistance
1990
- }), X = (e, n) => {
1991
- if (n !== void 0) {
1992
- let r = new t(n.r, n.g, n.b);
1993
- e.copy(r.convertSRGBToLinear());
1994
- }
1995
- }, Z = (e) => {
1996
- let t = e.clone().convertLinearToSRGB();
1997
- return {
1998
- r: t.r,
1999
- g: t.g,
2000
- b: t.b
2001
- };
2002
- }, Q = null, Bt = (e, t, n, r, i, a, o = 16) => {
2003
- Q || (Q = new u(), Q.crossOrigin = "");
2004
- let s = Q;
2005
- return new Promise((c, l) => {
2006
- if (!e) {
2007
- console.warn("trying to add a texture without image", t), c();
2008
- return;
2009
- }
2010
- s.load(e, (e) => {
2011
- Vt(e, t, n, r, i, a, o), c();
2012
- }, l);
2013
- });
2014
- }, Vt = (e, n, r, i, a, o, s = 16) => {
2015
- if (e.anisotropy = i, e.wrapS = l, e.wrapT = l, s <= 8 && [
2016
- _.ORM,
2017
- _.EMRGB,
2018
- _.CCRG,
2019
- _.CCXYZ,
2020
- _.SHRGBA,
2021
- _.SPRGBA,
2022
- _.TTRG
2023
- ].includes(n.mapping)) {
2024
- console.warn("ORM maps are not supported on devices with only " + s + " texture units");
2025
- return;
2026
- }
2027
- e.repeat.set(a, o), Ht(e, n, r), n.mapping === _.RGBA && (r.transparent = !0, r.userData.materialVersion === 1 && r.name.includes("glow") && (r.emissiveIntensity = .5, r.emissive = new t(16777215), r.emissiveMap = r.map)), r.needsUpdate = !0;
2028
- }, Ht = (e, t, n) => {
2029
- t.mapping === _.XYZ ? (n.normalMap = e, n.map === jt() && (n.map = null)) : t.mapping === _.ORM ? (n.aoMap = e, n.roughnessMap = e, n.metalnessMap = e) : t.mapping === _.EMRGB ? n.emissiveMap = e : t.mapping === _.CCRG ? (n.clearcoatMap = e, n.clearcoatRoughnessMap = e) : t.mapping === _.CCXYZ ? n.clearcoatNormalMap = e : t.mapping === _.SHRGBA ? (n.sheenColorMap = e, n.sheenRoughnessMap = e) : t.mapping === _.SPRGBA ? (n.specularColorMap = e, n.specularIntensityMap = e) : t.mapping === _.TTRG ? (n.transmissionMap = e, n.thicknessMap = e) : (e.colorSpace = h, n.map = e);
2030
- }, Ut = (e = !0) => (window.__RML_GUI__ || (window.__RML_GUI__ = new ut({ autoPlace: e })), window.__RML_GUI__), Wt = (e, t) => {
2031
- let n = !1;
2032
- for (let r of t) {
2033
- let t = r.getKernelObject(), i;
2034
- t.wallType.value === me.OuterWallRight && (i = ee(t.rightNormal)), t.wallType.value === me.OuterWallLeft && (i = ee(t.leftNormal));
2035
- let a = !0;
2036
- if (i) {
2037
- let t = ee(r.getPlanElement().getCenter());
2038
- t = t.applyMatrix4(e.matrixWorldInverse), i = i.transformDirection(e.matrixWorldInverse), a = t.dot(i) >= 0;
2039
- }
2040
- a !== r.getContainer().visible && (n = !0), a ? r.setContainerVisibility(!0) : r.isSelected || r.setContainerVisibility(!1);
2041
- }
2042
- return n;
2043
- }, Gt = (e, t, n = !0) => {
2044
- if (!e.userData.tween) if (t) if (e.transparent = !0, !n) e.opacity = .2;
2045
- else {
2046
- let t = { opacity: 1 };
2047
- e.userData.tween = !0;
2048
- let n = new q(t).to({ opacity: .2 }, 400).easing(W.Sinusoidal.In).onUpdate(() => {
2049
- e.opacity = t.opacity;
2050
- }).onComplete(() => {
2051
- e.userData.tween = !1, window.TWEEN?.remove(n);
2052
- }).start();
2053
- window.TWEEN?.add(n);
2054
- }
2055
- else if (!n) e.opacity = 1, e.transparent = !1;
2056
- else {
2057
- let t = { opacity: .2 };
2058
- e.userData.tween = !0;
2059
- let n = new q(t).to({ opacity: 1 }, 400).easing(W.Sinusoidal.In).onUpdate(() => {
2060
- e.opacity = t.opacity;
2061
- }).onComplete(() => {
2062
- e.transparent = !1, e.userData.tween = !1, window.TWEEN?.remove(n);
2063
- }).start();
2064
- window.TWEEN?.add(n);
2065
- }
2066
- }, Kt = (e, t, n, r, i, a) => {
2067
- let o = qt(n, r), s = i.clone().multiply(r).multiply(t), c = o.clone().invert(), l = c.clone().multiply(n), u = c.clone().multiply(r), d = { t: 0 }, f = new q(d).to({ t: 1 }, 400).easing(W.Quadratic.InOut).onUpdate(() => {
2068
- let n = Xt(l, u, d.t);
2069
- Yt(e, i.clone().multiply(o).multiply(n).multiply(t)), a && a();
2070
- }).onComplete(() => {
2071
- Yt(e, s), a && a(), window.TWEEN?.remove(f);
2072
- }).onStop(() => {
2073
- window.TWEEN?.remove(f);
2074
- }).start();
2075
- return window.TWEEN?.add(f), f;
2076
- }, qt = (e, t) => {
2077
- let r = e.clone().invert().clone().multiply(t), i = new m(), a = new n();
2078
- r.decompose(i, a, new m());
2079
- let o = Jt(a), s = o.axis;
2080
- if (i.length() < .001 || Math.abs(o.angleRad) < .001 || s.length() < .001) return new d().identity();
2081
- let c = new m().setFromMatrixPosition(e), l = new m().setFromMatrixPosition(t), u = c.clone().sub(l), f = u.length(), p = new m().crossVectors(s, u).normalize();
2082
- u = new m().crossVectors(p, s).normalize();
2083
- let h = c.clone().add(l).multiplyScalar(.5);
2084
- return h = h.sub(p.clone().multiplyScalar(f * .5 / Math.tan(o.angleRad * .5))), new d().makeBasis(p, s, u).setPosition(h);
2085
- }, Jt = (e) => {
2086
- let t = Math.sqrt(1 - e.w * e.w);
2087
- return {
2088
- axis: new m(e.x, e.y, e.z).multiplyScalar(t === 0 ? 1 : 1 / t),
2089
- angleRad: 2 * Math.acos(e.w)
2090
- };
2091
- }, Yt = (e, t) => {
2092
- e.updateMatrix(), t.multiply(e.matrix.clone().invert()), e.applyMatrix4(t), e.updateMatrix();
2093
- }, Xt = (e, t, r) => {
2094
- let i = new m(), a = new n(), o = new m();
2095
- e.decompose(i, a, o);
2096
- let s = new m(), c = new n(), l = new m();
2097
- t.decompose(s, c, l);
2098
- let u = new m().lerpVectors(i, s, r), f = new n().slerpQuaternions(a, c, r), p = Jt(a.clone().conjugate().multiply(c));
2099
- if (p.angleRad > Math.PI && (p.angleRad -= 2 * Math.PI), Math.abs(p.angleRad) > te(1) && i.length() > .001 && s.length() > .001) {
2100
- let e = i.clone().normalize().dot(s.clone().normalize());
2101
- if (Math.abs(e) < .999) {
2102
- let t = new m().crossVectors(i, s), a = new n().setFromAxisAngle(t.normalize(), Math.acos(e) * r), o = i.length() * r + s.length() * (1 - r);
2103
- u = i.applyQuaternion(a).normalize().multiplyScalar(o);
2104
- }
2105
- }
2106
- let h = new m().lerpVectors(o, l, r), g = new d();
2107
- return g.compose(u, f, h), g;
2108
- }, Zt = (e) => {
2109
- let n = new t();
2110
- return n.setRGB((e >> 16) / 255, (e >> 8 & 255) / 255, (e >> 0 & 255) / 255), n;
2111
- }, Qt = (e, t) => {
2112
- t.transparent || (e.transparent = t.transparent, delete e.userData.postProcessingMaterialPlugin), e.opacity = t.opacity, e.needsUpdate = !0;
2113
- }, $t = (e, t) => new Promise((n) => {
2114
- e.traverse((e) => {
2115
- if (e instanceof f) {
2116
- let r = e.material;
2117
- e.userData.tween && e.userData.tween.stop();
2118
- let i = { opacity: r.opacity };
2119
- t.transparent && (r.transparent = t.transparent);
2120
- let a = new q(i);
2121
- a.toJSON = () => void 0, e.userData.tween = a, window.TWEEN?.add(a.to(t, 250).easing(W.Linear.None).onUpdate(() => {
2122
- r.opacity = i.opacity;
2123
- }).onStop(() => {
2124
- Qt(r, t), e.userData.tween = void 0;
2125
- }).onComplete(() => {
2126
- Qt(r, t), e.userData.tween = void 0, window.TWEEN?.remove(a), n();
2127
- }).start());
2128
- }
2129
- });
2130
- }), en = (e) => {
2131
- e.traverse((e) => {
2132
- if (e instanceof f) {
2133
- let t = e.material;
2134
- if (t.opacity === 0) return;
2135
- let n = {
2136
- opacity: 0,
2137
- transparent: !0
2138
- }, r = {
2139
- opacity: t.opacity,
2140
- transparent: t.transparent
2141
- };
2142
- t.transparent = n.transparent, t.opacity = n.opacity;
2143
- let i = new q(n).to(r, 500).easing(W.Linear.None).onUpdate(() => {
2144
- t.opacity = n.opacity;
2145
- }).onComplete(() => {
2146
- t.transparent = r.transparent, window.TWEEN?.remove(i);
2147
- }).start();
2148
- window.TWEEN?.add(i);
2149
- }
2150
- });
2151
- }, tn = (e, t) => {
2152
- let n = new o().setFromObject(e), r = n.getSize(new m()), i = Math.min(r.x, r.y, r.z), a = !0;
2153
- return i > 5 && (console.warn("GLB seems to be too big (" + i + ")", t), a = !1), n.min.y < -.01 && (console.warn("GLB seems to be under the floor (" + n.min.y + "): ", t), a = !1), a;
2154
- }, nn = (e) => {
2155
- e.type === "Mesh" ? an(e) : rn(e);
2156
- }, rn = (e) => {
2157
- !e || !e.children || e.children.length === 0 || e.children.forEach((e) => {
2158
- an(e);
2159
- });
2160
- }, an = (e) => {
2161
- e && (e.material && sn(e.material), e.geometry && on(e.geometry), e.children && e.children.length > 0 && rn(e));
2162
- }, on = (e) => {
2163
- e && e.dispose();
2164
- }, sn = (e) => {
2165
- e && (e.map && e.map.dispose(), e.normalMap && e.normalMap.dispose(), e.dispose());
2166
- }, $, cn = () => ($ || ($ = new a(), $.visible = !1), $), ln, un = (e) => (ln ||= dt.createMeshStandardMaterial({
2167
- color: e || "#FF0000",
2168
- transparent: !0,
2169
- opacity: .5,
2170
- visible: !0,
2171
- polygonOffset: !0,
2172
- polygonOffsetFactor: -1
2173
- }), ln), dn = (e) => e.x === 0 && e.y === 0 && e.z === 0, fn = (e, t) => {
2174
- let n = "";
2175
- return !e && e !== "" ? null : (e.materialId && e.materialId !== "" ? n = e.materialId : e.catalogItemId && e.catalogItemId !== "" ? n = e.catalogItemId : e.rgbValue > 0 ? n = "rgb" + JSON.stringify(e.rgbValue) : e.length > 0 ? n = e : t && t.value === ce.WALL ? n = "default_wall_material_" + e.getSourceType().value : t && t.value === ce.CEILING && (n = "default_ceiling_material_" + e.getSourceType().value), n);
2176
- }, pn = (e) => {
2177
- let t = e.getWorldDirection(new m()).clone();
2178
- t.y = 0, t.lengthSq() < .01 && (t = new m(0, 1, 0), t.applyQuaternion(e.quaternion), t.y = 0), t.normalize();
2179
- let n = Math.asin(t.x);
2180
- return t.z < 0 && (n = Math.PI - n), n < 0 && (n += Math.PI * 2), n;
2181
- }, mn = (e, t) => {
2182
- if (!e || !t) return 0;
2183
- let n = e.clone().expandByScalar(.001).containsBox(t), r = t.clone().expandByScalar(.001).containsBox(e);
2184
- return r && n || !r && !n ? 0 : n === !0 ? 1 : -1;
2185
- }, hn = (e, t) => {
2186
- if (!e || !t) return 0;
2187
- let n = e.clone().expandByScalar(.001).containsBox(t), r = t.clone().expandByScalar(.001).containsBox(e);
2188
- if (r && n) return 0;
2189
- if (!r && !n) {
2190
- let n = gn(e, t);
2191
- return n === .5 ? 0 : n > .5 ? -1 : 1;
2192
- }
2193
- return n === !0 ? 1 : -1;
2194
- }, gn = (e, t) => {
2195
- let n = new o();
2196
- if (n.copy(e).intersect(t), n.isEmpty()) return 0;
2197
- let r = (e) => {
2198
- let t = new m();
2199
- return e.getSize(t), t.x * t.y * t.z;
2200
- }, i = r(e), a = r(n);
2201
- return i === 0 ? 0 : a / i;
2202
- }, _n = (e) => e[0] === 1 && e[1] === 0 && e[2] === 0 && e[3] === 1 && e[4] === 0 && e[5] === 0, vn = (e, t, n, r = 1) => {
2203
- let i = t > n, a = i ? 15 : 0, s = i ? 0 : 10, c = e.getSize(new m()), l = e.getCenter(new m()), u = c.x > 2 * a ? c.x / 2 : a, d = c.z > 2 * s ? c.z / 2 : s;
2204
- return u *= r, d *= r, new o(new m(l.x - u, l.y, l.z - d), new m(l.x + u, l.y, l.z + d));
2205
- }, yn = (e) => {
2206
- let { x: t, y: n } = e;
2207
- return {
2208
- x: t,
2209
- y: n
2210
- };
2211
- }, bn = (e) => {
2212
- let { x: t, y: n, z: r } = e;
2213
- return {
2214
- x: t,
2215
- y: n,
2216
- z: r
2217
- };
2218
- }, xn = (e, t, n) => new m().setFromSphericalCoords(e, Math.PI * (1 - n), Math.PI * 2 * (1 - t)), Sn = (e) => {
2219
- let t = new r();
2220
- return e.environment && (t.environment = e.environment.clone()), e.userData.environmentDefinition && (t.userData.environmentDefinition = e.userData.environmentDefinition.clone()), t.userData.shadowFromEnvironment = e.userData.shadowFromEnvironment, t;
2221
- }, Cn = (e, t) => {
2222
- let n = new p(), r = new d().multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse);
2223
- n.setFromProjectionMatrix(r);
2224
- let i = t.getCenter(new m());
2225
- return n.containsPoint(i);
2226
- }, wn = (e) => {
2227
- e.lights_fragment_begin = "\n vec3 geometryPosition = - vViewPosition;\n vec3 geometryNormal = normal;\n vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n vec3 geometryClearcoatNormal = vec3( 0.0 );\n #ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n #endif\n\n // OPTIMIZATION: Early exit for transparent/invisible materials\n #ifdef USE_ALPHATEST\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n\n // OPTIMIZATION: Cache expensive calculations\n float NdotV = saturate( dot( geometryNormal, geometryViewDir ) );\n\n #ifdef USE_IRIDESCENCE\n float dotNVi = NdotV; // Reuse calculated value\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n // OPTIMIZATION: Skip iridescence calculations if effect is minimal\n if ( material.iridescence > 0.01 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n #endif\n\n IncidentLight directLight;\n\n // OPTIMIZATION: Early exit if material has no metalness or roughness variation\n #ifdef USE_ROUGHNESSMAP\n bool hasRoughnessVariation = true;\n #else\n bool hasRoughnessVariation = false;\n #endif\n\n #ifdef USE_METALNESSMAP\n bool hasMetalnessVariation = true;\n #else\n bool hasMetalnessVariation = false;\n #endif\n\n #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n\n // OPTIMIZATION: Enhanced visibility and distance checks\n #if defined( RE_Direct )\n if ( directLight.visible ) {\n // OPTIMIZATION: Skip lights with negligible contribution based on color intensity\n float lightIntensity = dot( directLight.color, vec3( 0.299, 0.587, 0.114 ) );\n if ( lightIntensity > 0.001 ) {\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n }\n #endif\n }\n #pragma unroll_loop_end\n #endif\n\n #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n\n // OPTIMIZATION: Enhanced visibility checks for spot lights\n #if defined( RE_Direct )\n if ( directLight.visible ) {\n // OPTIMIZATION: Skip spot light map calculation if light contribution is minimal\n float lightIntensity = dot( directLight.color, vec3( 0.299, 0.587, 0.114 ) );\n if ( lightIntensity > 0.001 ) {\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n if ( inSpotLightMap ) {\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = directLight.color * spotColor.rgb;\n }\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n }\n #endif\n }\n #pragma unroll_loop_end\n #endif\n\n #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n\n // OPTIMIZATION: Skip very dim directional lights\n #if defined( RE_Direct )\n float lightIntensity = dot( directLight.color, vec3( 0.299, 0.587, 0.114 ) );\n if ( directLight.visible && lightIntensity > 0.001 ) {\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #endif\n }\n #pragma unroll_loop_end\n #endif\n\n #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n // OPTIMIZATION: Simple rect area light processing - Three.js handles distance internally\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n #endif\n\n // OPTIMIZATION: Streamlined indirect lighting with early exits\n #if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n // OPTIMIZATION: Skip light probe calculation if ambient is sufficient\n float ambientIntensity = dot( irradiance, vec3( 0.299, 0.587, 0.114 ) );\n\n #if defined( USE_LIGHT_PROBES )\n if ( ambientIntensity < 0.9 ) {\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n }\n #endif\n\n #if ( NUM_HEMI_LIGHTS > 0 )\n if ( ambientIntensity < 0.9 ) {\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n vec3 hemiContribution = getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n // OPTIMIZATION: Skip negligible hemisphere light contributions\n if ( dot( hemiContribution, vec3( 0.299, 0.587, 0.114 ) ) > 0.001 ) {\n irradiance += hemiContribution;\n }\n }\n #pragma unroll_loop_end\n }\n #endif\n #endif\n\n #if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n #endif", e.lights_pars_begin = e.lights_pars_begin.replace("light.color = pointLight.color;", "\n light.color = pointLight.color * step( lightDistance, pointLight.distance );\n ");
2228
- };
2229
- //#endregion
2230
- export { q as $, St as A, At as B, Zt as C, fn as D, Ut as E, Cn as F, Gt as G, kt as H, _n as I, $t as J, yn as K, Et as L, Tt as M, pn as N, Lt as O, Wt as P, ft as Q, Dt as R, hn as S, vn as T, Nt as U, Ot as V, Yt as W, xn as X, dn as Y, W as Z, sn as _, yt as a, ce as at, en as b, Vt as c, ae as ct, tn as d, se as dt, dt as et, mn as f, ne as ft, on as g, nn as h, vt as i, ue as it, Ct as j, wt as k, Bt as l, ie as lt, Mt as m, xt as n, fe as nt, ht as o, le as ot, Sn as p, te as pt, bn as q, _t as r, de as rt, gt as s, oe as st, bt as t, pe as tt, Kt as u, re as ut, an as v, un as w, cn as x, rn as y, wn as z };
2231
-
2232
- //# sourceMappingURL=threejs-utils-8zlxt158.mjs.map