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