modern-canvas 0.24.13 → 0.25.1
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/dist/core/index.d.ts +1 -0
- package/dist/core/reactivity.d.ts +1 -0
- package/dist/index.js +500 -498
- package/dist/render.d.ts +3 -0
- package/dist/scene/2d/element/Element2DFill.d.ts +4 -4
- package/dist/scene/2d/element/imagePipeline.d.ts +5 -6
- package/dist/scene/main/SceneTree.d.ts +7 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -546,7 +546,7 @@ var dt = class e {
|
|
|
546
546
|
destroy() {
|
|
547
547
|
this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
|
|
548
548
|
}
|
|
549
|
-
}, vt = class extends T {},
|
|
549
|
+
}, vt = class extends T {}, E = class extends vt {}, yt = class e {
|
|
550
550
|
get x() {
|
|
551
551
|
return this.min.x;
|
|
552
552
|
}
|
|
@@ -680,7 +680,7 @@ var dt = class e {
|
|
|
680
680
|
//#endregion
|
|
681
681
|
//#region src/core/math/Color.ts
|
|
682
682
|
pe([me]);
|
|
683
|
-
var
|
|
683
|
+
var D = class {
|
|
684
684
|
get value() {
|
|
685
685
|
return this._value;
|
|
686
686
|
}
|
|
@@ -763,16 +763,16 @@ var xt = class {
|
|
|
763
763
|
this.a
|
|
764
764
|
];
|
|
765
765
|
}
|
|
766
|
-
},
|
|
767
|
-
function
|
|
766
|
+
}, bt = xe / 180, xt = 180 / xe;
|
|
767
|
+
function O(e, t, n) {
|
|
768
768
|
return Math.max(t, Math.min(e, n));
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function k(e, t, n) {
|
|
771
771
|
return (1 - n) * e + n * t;
|
|
772
772
|
}
|
|
773
773
|
//#endregion
|
|
774
774
|
//#region src/core/math/ColorMatrix.ts
|
|
775
|
-
var
|
|
775
|
+
var St = class {
|
|
776
776
|
_array = /* @__PURE__ */ new Float32Array(20);
|
|
777
777
|
constructor() {
|
|
778
778
|
this.identity();
|
|
@@ -902,7 +902,7 @@ var wt = class {
|
|
|
902
902
|
]);
|
|
903
903
|
}
|
|
904
904
|
invert(e = 1) {
|
|
905
|
-
let t =
|
|
905
|
+
let t = k(1, -1, e), n = k(0, 255, e);
|
|
906
906
|
return this.multiply([
|
|
907
907
|
t,
|
|
908
908
|
0,
|
|
@@ -927,21 +927,21 @@ var wt = class {
|
|
|
927
927
|
]);
|
|
928
928
|
}
|
|
929
929
|
sepia(e = 1) {
|
|
930
|
-
let t =
|
|
930
|
+
let t = O(e, 0, 1);
|
|
931
931
|
return this.multiply([
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
932
|
+
k(1, .393, t),
|
|
933
|
+
k(0, .7689999, t),
|
|
934
|
+
k(0, .18899999, t),
|
|
935
935
|
0,
|
|
936
936
|
0,
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
937
|
+
k(0, .349, t),
|
|
938
|
+
k(1, .6859999, t),
|
|
939
|
+
k(0, .16799999, t),
|
|
940
940
|
0,
|
|
941
941
|
0,
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
942
|
+
k(0, .272, t),
|
|
943
|
+
k(0, .5339999, t),
|
|
944
|
+
k(1, .13099999, t),
|
|
945
945
|
0,
|
|
946
946
|
0,
|
|
947
947
|
0,
|
|
@@ -976,7 +976,7 @@ var wt = class {
|
|
|
976
976
|
]);
|
|
977
977
|
}
|
|
978
978
|
grayscale(e = 1) {
|
|
979
|
-
let t =
|
|
979
|
+
let t = O(e, 0, 1), n = k(1, .3, t), r = k(0, .3, t), i = k(1, .59, t), a = k(0, .59, t), o = k(1, .11, t), s = k(0, .11, t);
|
|
980
980
|
return this.multiply([
|
|
981
981
|
n,
|
|
982
982
|
a,
|
|
@@ -1028,10 +1028,10 @@ var wt = class {
|
|
|
1028
1028
|
toArray() {
|
|
1029
1029
|
return this._array;
|
|
1030
1030
|
}
|
|
1031
|
-
},
|
|
1031
|
+
}, Ct = class e extends yt {
|
|
1032
1032
|
rotation;
|
|
1033
1033
|
get rotationDegrees() {
|
|
1034
|
-
return this.rotation /
|
|
1034
|
+
return this.rotation / bt;
|
|
1035
1035
|
}
|
|
1036
1036
|
constructor(...e) {
|
|
1037
1037
|
let t, n;
|
|
@@ -1041,7 +1041,7 @@ var wt = class {
|
|
|
1041
1041
|
if (!this.rotation && (!("rotation" in e) || !e.rotation)) return super.overlap(e, t);
|
|
1042
1042
|
{
|
|
1043
1043
|
let t = (e, t) => Math.abs(e.x * t.x + e.y * t.y), n = (e) => {
|
|
1044
|
-
let { width: n, height: r, rotation: i = 0 } = e, a = i /
|
|
1044
|
+
let { width: n, height: r, rotation: i = 0 } = e, a = i / bt;
|
|
1045
1045
|
a = -a % 180;
|
|
1046
1046
|
let o = a / 180 * Math.PI, s = {
|
|
1047
1047
|
x: Math.cos(o),
|
|
@@ -1083,7 +1083,7 @@ var wt = class {
|
|
|
1083
1083
|
clone() {
|
|
1084
1084
|
return new e(this.toJSON());
|
|
1085
1085
|
}
|
|
1086
|
-
},
|
|
1086
|
+
}, wt = class {
|
|
1087
1087
|
_array;
|
|
1088
1088
|
x = 0;
|
|
1089
1089
|
y = 0;
|
|
@@ -1107,12 +1107,12 @@ var wt = class {
|
|
|
1107
1107
|
};
|
|
1108
1108
|
//#endregion
|
|
1109
1109
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateMetadata.js
|
|
1110
|
-
function
|
|
1110
|
+
function A(e, t) {
|
|
1111
1111
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
1112
1112
|
}
|
|
1113
1113
|
//#endregion
|
|
1114
1114
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
|
|
1115
|
-
function
|
|
1115
|
+
function j(e, t, n, r) {
|
|
1116
1116
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
1117
1117
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
1118
1118
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -1120,7 +1120,7 @@ function k(e, t, n, r) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
//#endregion
|
|
1122
1122
|
//#region src/core/os/MainLoop.ts
|
|
1123
|
-
var
|
|
1123
|
+
var Tt = class extends T {
|
|
1124
1124
|
_starting = !1;
|
|
1125
1125
|
_nextDeltaTime = 0;
|
|
1126
1126
|
_startedProcess;
|
|
@@ -1150,7 +1150,17 @@ var Dt = class extends T {
|
|
|
1150
1150
|
super._destroy(), this.stop();
|
|
1151
1151
|
}
|
|
1152
1152
|
};
|
|
1153
|
-
|
|
1153
|
+
j([_({ fallback: 60 }), A("design:type", Number)], Tt.prototype, "fps", void 0), j([_({ fallback: 1 }), A("design:type", Number)], Tt.prototype, "speed", void 0);
|
|
1154
|
+
//#endregion
|
|
1155
|
+
//#region src/core/reactivity.ts
|
|
1156
|
+
var Et = "__v_skip";
|
|
1157
|
+
function Dt(e) {
|
|
1158
|
+
return !Object.prototype.hasOwnProperty.call(e, Et) && Object.isExtensible(e) && Object.defineProperty(e, Et, {
|
|
1159
|
+
configurable: !0,
|
|
1160
|
+
enumerable: !1,
|
|
1161
|
+
value: !0
|
|
1162
|
+
}), e;
|
|
1163
|
+
}
|
|
1154
1164
|
//#endregion
|
|
1155
1165
|
//#region src/core/renderers/gl/buffer/const.ts
|
|
1156
1166
|
var Ot = /* @__PURE__ */ function(e) {
|
|
@@ -1163,7 +1173,7 @@ var Ot = /* @__PURE__ */ function(e) {
|
|
|
1163
1173
|
constructor(e) {
|
|
1164
1174
|
this.native = e;
|
|
1165
1175
|
}
|
|
1166
|
-
},
|
|
1176
|
+
}, M = /* @__PURE__ */ function(e) {
|
|
1167
1177
|
return e[e.mapRead = 1] = "mapRead", e[e.mapWrite = 2] = "mapWrite", e[e.copySrc = 4] = "copySrc", e[e.copyDst = 8] = "copyDst", e[e.index = 16] = "index", e[e.vertex = 32] = "vertex", e[e.uniform = 64] = "uniform", e[e.storage = 128] = "storage", e[e.indirect = 256] = "indirect", e[e.queryResolve = 512] = "queryResolve", e[e.static = 1024] = "static", e;
|
|
1168
1178
|
}({}), At = class extends n {
|
|
1169
1179
|
screen = {
|
|
@@ -1184,7 +1194,7 @@ var Ot = /* @__PURE__ */ function(e) {
|
|
|
1184
1194
|
this.view && (this.view.width = Math.floor(e * this.pixelRatio), this.view.height = Math.floor(t * this.pixelRatio)), this.screen.width = e, this.screen.height = t, n && this.view && (this.view.style.width = `${e}px`, this.view.style.height = `${t}px`);
|
|
1185
1195
|
}
|
|
1186
1196
|
};
|
|
1187
|
-
|
|
1197
|
+
j([_({ fallback: Ye }), A("design:type", Number)], At.prototype, "pixelRatio", void 0), j([_({ internal: !0 }), A("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], At.prototype, "view", void 0);
|
|
1188
1198
|
//#endregion
|
|
1189
1199
|
//#region src/core/renderers/shared/shader/UniformGroup.ts
|
|
1190
1200
|
var jt = 0, Mt = class {
|
|
@@ -1207,7 +1217,7 @@ function Ft(e, t) {
|
|
|
1207
1217
|
}
|
|
1208
1218
|
//#endregion
|
|
1209
1219
|
//#region src/core/renderers/gl/system/GlSystem.ts
|
|
1210
|
-
var
|
|
1220
|
+
var N = class extends e {
|
|
1211
1221
|
get _gl() {
|
|
1212
1222
|
return this._renderer.gl;
|
|
1213
1223
|
}
|
|
@@ -1221,7 +1231,7 @@ var j = class extends e {
|
|
|
1221
1231
|
_setup() {}
|
|
1222
1232
|
flush() {}
|
|
1223
1233
|
reset() {}
|
|
1224
|
-
}, It = class extends
|
|
1234
|
+
}, It = class extends N {
|
|
1225
1235
|
install(e) {
|
|
1226
1236
|
super.install(e), e.buffer = this;
|
|
1227
1237
|
}
|
|
@@ -1232,7 +1242,7 @@ var j = class extends e {
|
|
|
1232
1242
|
}
|
|
1233
1243
|
_createGlBuffer(e) {
|
|
1234
1244
|
let t = this._gl, n = new kt(t.createBuffer()), r = Ot.arrayBuffer;
|
|
1235
|
-
return e.usage &
|
|
1245
|
+
return e.usage & M.index ? r = Ot.elementArrayBuffer : e.usage & M.uniform && (r = Ot.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
|
|
1236
1246
|
switch (e) {
|
|
1237
1247
|
case "usage":
|
|
1238
1248
|
case "data":
|
|
@@ -1255,7 +1265,7 @@ var j = class extends e {
|
|
|
1255
1265
|
n.dirty = !1;
|
|
1256
1266
|
let { _gl: r } = this, { usage: i, data: a } = e;
|
|
1257
1267
|
r.bindBuffer(n.target, n.native);
|
|
1258
|
-
let o = i &
|
|
1268
|
+
let o = i & M.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
|
|
1259
1269
|
if (a) if (n.byteLength >= a.byteLength) {
|
|
1260
1270
|
let e = a.length * a.BYTES_PER_ELEMENT;
|
|
1261
1271
|
r.bufferSubData(n.target, 0, a, 0, e / a.BYTES_PER_ELEMENT);
|
|
@@ -1592,7 +1602,7 @@ function nn(e, t) {
|
|
|
1592
1602
|
}
|
|
1593
1603
|
//#endregion
|
|
1594
1604
|
//#region src/core/renderers/gl/shader/GlShaderSystem.ts
|
|
1595
|
-
var rn = class extends
|
|
1605
|
+
var rn = class extends N {
|
|
1596
1606
|
install(e) {
|
|
1597
1607
|
super.install(e), e.shader = this;
|
|
1598
1608
|
}
|
|
@@ -1917,7 +1927,7 @@ var ln = class e {
|
|
|
1917
1927
|
}
|
|
1918
1928
|
};
|
|
1919
1929
|
ln._init();
|
|
1920
|
-
var un = class extends
|
|
1930
|
+
var un = class extends N {
|
|
1921
1931
|
install(e) {
|
|
1922
1932
|
super.install(e), e.state = this;
|
|
1923
1933
|
}
|
|
@@ -1974,7 +1984,7 @@ var un = class extends j {
|
|
|
1974
1984
|
let e = (1 << ln._properties.length) - 1;
|
|
1975
1985
|
this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
|
|
1976
1986
|
}
|
|
1977
|
-
}, dn = class extends
|
|
1987
|
+
}, dn = class extends N {
|
|
1978
1988
|
install(e) {
|
|
1979
1989
|
super.install(e), e.batch2D = this;
|
|
1980
1990
|
}
|
|
@@ -2030,11 +2040,11 @@ void main(void) {
|
|
|
2030
2040
|
})
|
|
2031
2041
|
}, r = {
|
|
2032
2042
|
instanceId: ut(),
|
|
2033
|
-
usage:
|
|
2043
|
+
usage: M.vertex,
|
|
2034
2044
|
data: /* @__PURE__ */ new Float32Array()
|
|
2035
2045
|
}, i = {
|
|
2036
2046
|
instanceId: ut(),
|
|
2037
|
-
usage:
|
|
2047
|
+
usage: M.index,
|
|
2038
2048
|
data: /* @__PURE__ */ new Uint32Array()
|
|
2039
2049
|
}, a = {
|
|
2040
2050
|
instanceId: ut(),
|
|
@@ -2130,11 +2140,11 @@ function pn(e) {
|
|
|
2130
2140
|
}
|
|
2131
2141
|
//#endregion
|
|
2132
2142
|
//#region src/core/renderers/gl/const.ts
|
|
2133
|
-
var
|
|
2143
|
+
var P = /* @__PURE__ */ function(e) {
|
|
2134
2144
|
return e[e.disabled = 0] = "disabled", e[e.renderingMaskAdd = 1] = "renderingMaskAdd", e[e.maskActive = 2] = "maskActive", e[e.inverseMaskActive = 3] = "inverseMaskActive", e[e.renderingMaskRemove = 4] = "renderingMaskRemove", e[e.none = 5] = "none", e;
|
|
2135
2145
|
}({}), mn = /* @__PURE__ */ function(e) {
|
|
2136
2146
|
return e[e.none = 0] = "none", e[e.color = 16384] = "color", e[e.stencil = 1024] = "stencil", e[e.depth = 256] = "depth", e[e.colorDepth = 16640] = "colorDepth", e[e.colorStencil = 17408] = "colorStencil", e[e.depthStencil = 1280] = "depthStencil", e[e.all = 17664] = "all", e;
|
|
2137
|
-
}({}), hn = class extends
|
|
2147
|
+
}({}), hn = class extends N {
|
|
2138
2148
|
install(e) {
|
|
2139
2149
|
super.install(e), e.mask = this;
|
|
2140
2150
|
}
|
|
@@ -2153,16 +2163,16 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
2153
2163
|
};
|
|
2154
2164
|
this.stack.push(n);
|
|
2155
2165
|
let r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2156
|
-
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(
|
|
2166
|
+
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(P.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(P.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2157
2167
|
}
|
|
2158
2168
|
pop(e) {
|
|
2159
2169
|
let t = this.stack.pop();
|
|
2160
2170
|
if (!t || t.source !== e) return;
|
|
2161
2171
|
let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2162
|
-
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(mn.stencil), this._renderer.stencil.bind(
|
|
2172
|
+
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(mn.stencil), this._renderer.stencil.bind(P.disabled, i)) : this._renderer.stencil.bind(P.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(P.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2163
2173
|
}
|
|
2164
2174
|
}, gn = [];
|
|
2165
|
-
gn[
|
|
2175
|
+
gn[P.none] = {}, gn[P.disabled] = {}, gn[P.renderingMaskAdd] = {
|
|
2166
2176
|
stencilFront: {
|
|
2167
2177
|
compare: "equal",
|
|
2168
2178
|
passOp: "increment-clamp"
|
|
@@ -2171,7 +2181,7 @@ gn[M.none] = {}, gn[M.disabled] = {}, gn[M.renderingMaskAdd] = {
|
|
|
2171
2181
|
compare: "equal",
|
|
2172
2182
|
passOp: "increment-clamp"
|
|
2173
2183
|
}
|
|
2174
|
-
}, gn[
|
|
2184
|
+
}, gn[P.renderingMaskRemove] = {
|
|
2175
2185
|
stencilFront: {
|
|
2176
2186
|
compare: "equal",
|
|
2177
2187
|
passOp: "decrement-clamp"
|
|
@@ -2180,7 +2190,7 @@ gn[M.none] = {}, gn[M.disabled] = {}, gn[M.renderingMaskAdd] = {
|
|
|
2180
2190
|
compare: "equal",
|
|
2181
2191
|
passOp: "decrement-clamp"
|
|
2182
2192
|
}
|
|
2183
|
-
}, gn[
|
|
2193
|
+
}, gn[P.maskActive] = {
|
|
2184
2194
|
stencilFront: {
|
|
2185
2195
|
compare: "equal",
|
|
2186
2196
|
passOp: "keep"
|
|
@@ -2189,7 +2199,7 @@ gn[M.none] = {}, gn[M.disabled] = {}, gn[M.renderingMaskAdd] = {
|
|
|
2189
2199
|
compare: "equal",
|
|
2190
2200
|
passOp: "keep"
|
|
2191
2201
|
}
|
|
2192
|
-
}, gn[
|
|
2202
|
+
}, gn[P.inverseMaskActive] = {
|
|
2193
2203
|
stencilFront: {
|
|
2194
2204
|
compare: "not-equal",
|
|
2195
2205
|
passOp: "keep"
|
|
@@ -2199,17 +2209,17 @@ gn[M.none] = {}, gn[M.disabled] = {}, gn[M.renderingMaskAdd] = {
|
|
|
2199
2209
|
passOp: "keep"
|
|
2200
2210
|
}
|
|
2201
2211
|
};
|
|
2202
|
-
var _n = class extends
|
|
2212
|
+
var _n = class extends N {
|
|
2203
2213
|
install(e) {
|
|
2204
2214
|
super.install(e), e.stencil = this;
|
|
2205
2215
|
}
|
|
2206
2216
|
_cache = {
|
|
2207
2217
|
enabled: !1,
|
|
2208
|
-
stencilMode:
|
|
2218
|
+
stencilMode: P.none,
|
|
2209
2219
|
refCount: 0
|
|
2210
2220
|
};
|
|
2211
2221
|
current = { [-1]: {
|
|
2212
|
-
stencilMode:
|
|
2222
|
+
stencilMode: P.disabled,
|
|
2213
2223
|
refCount: 0
|
|
2214
2224
|
} };
|
|
2215
2225
|
_passOpMap;
|
|
@@ -2239,20 +2249,20 @@ var _n = class extends j {
|
|
|
2239
2249
|
super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
|
|
2240
2250
|
}
|
|
2241
2251
|
reset() {
|
|
2242
|
-
this._cache.enabled = !1, this._cache.stencilMode =
|
|
2252
|
+
this._cache.enabled = !1, this._cache.stencilMode = P.none, this._cache.refCount = 0;
|
|
2243
2253
|
}
|
|
2244
2254
|
_updateRenderTarget = (e) => {
|
|
2245
2255
|
if (e) {
|
|
2246
2256
|
let t = this.current[e.instanceId];
|
|
2247
2257
|
t ||= this.current[e.instanceId] = {
|
|
2248
|
-
stencilMode:
|
|
2258
|
+
stencilMode: P.disabled,
|
|
2249
2259
|
refCount: 0
|
|
2250
2260
|
}, this.bind(t.stencilMode, t.refCount);
|
|
2251
2261
|
}
|
|
2252
2262
|
};
|
|
2253
2263
|
bind(e, t) {
|
|
2254
2264
|
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = gn[e], a = this._cache;
|
|
2255
|
-
if (n.stencilMode = e, n.refCount = t, e ===
|
|
2265
|
+
if (n.stencilMode = e, n.refCount = t, e === P.disabled) {
|
|
2256
2266
|
this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
|
|
2257
2267
|
return;
|
|
2258
2268
|
}
|
|
@@ -2261,8 +2271,8 @@ var _n = class extends j {
|
|
|
2261
2271
|
destroy() {
|
|
2262
2272
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
2263
2273
|
}
|
|
2264
|
-
}, vn = class extends
|
|
2265
|
-
current = new
|
|
2274
|
+
}, vn = class extends N {
|
|
2275
|
+
current = new yt(0, 0, 0, 0);
|
|
2266
2276
|
install(e) {
|
|
2267
2277
|
super.install(e), e.viewport = this;
|
|
2268
2278
|
}
|
|
@@ -2281,7 +2291,7 @@ var _n = class extends j {
|
|
|
2281
2291
|
constructor(e) {
|
|
2282
2292
|
this.framebuffer = e;
|
|
2283
2293
|
}
|
|
2284
|
-
}, bn = class extends
|
|
2294
|
+
}, bn = class extends N {
|
|
2285
2295
|
install(e) {
|
|
2286
2296
|
super.install(e), e.renderTarget = this;
|
|
2287
2297
|
}
|
|
@@ -2291,7 +2301,7 @@ var _n = class extends j {
|
|
|
2291
2301
|
_msaaSamples = [];
|
|
2292
2302
|
_hasMRT = !0;
|
|
2293
2303
|
_writeDepthTexture = !0;
|
|
2294
|
-
projection = new
|
|
2304
|
+
projection = new wt();
|
|
2295
2305
|
_updateContext(e) {
|
|
2296
2306
|
if (super._updateContext(e), this._hasMRT = !0, this._writeDepthTexture = !0, this._renderer.version === 1) {
|
|
2297
2307
|
let t = this._renderer.extensions.drawBuffers, n = this._renderer.extensions.depthTexture;
|
|
@@ -2408,7 +2418,7 @@ var _n = class extends j {
|
|
|
2408
2418
|
return e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e;
|
|
2409
2419
|
}({}), Sn = /* @__PURE__ */ function(e) {
|
|
2410
2420
|
return e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e;
|
|
2411
|
-
}({}),
|
|
2421
|
+
}({}), F = /* @__PURE__ */ function(e) {
|
|
2412
2422
|
return e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e;
|
|
2413
2423
|
}({}), Cn = class {
|
|
2414
2424
|
native;
|
|
@@ -2416,7 +2426,7 @@ var _n = class extends j {
|
|
|
2416
2426
|
width = -1;
|
|
2417
2427
|
height = -1;
|
|
2418
2428
|
mipmap = !1;
|
|
2419
|
-
type =
|
|
2429
|
+
type = F.UNSIGNED_BYTE;
|
|
2420
2430
|
internalFormat = xn.RGBA;
|
|
2421
2431
|
format = xn.RGBA;
|
|
2422
2432
|
constructor(e) {
|
|
@@ -2697,7 +2707,7 @@ var Mn = {
|
|
|
2697
2707
|
c < o || l < s ? ((i !== o || a !== s) && n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, null), r === 2 ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, c, l, t.format, t.type, e.source) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source)) : i === o && a === s ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source) : r === 2 ? n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, e.source) : n.texImage2D(t.target, 0, t.internalFormat, t.format, t.type, e.source), t.width = o, t.height = s;
|
|
2698
2708
|
}
|
|
2699
2709
|
}
|
|
2700
|
-
}, Nn = class extends
|
|
2710
|
+
}, Nn = class extends N {
|
|
2701
2711
|
uploaders = { ...Mn };
|
|
2702
2712
|
textures = /* @__PURE__ */ new Map();
|
|
2703
2713
|
glTextures = /* @__PURE__ */ new Map();
|
|
@@ -2796,36 +2806,36 @@ var Mn = {
|
|
|
2796
2806
|
this._renderer.contextLost || this.glTextures.forEach((t) => e.deleteTexture(t.native)), this.textures.clear(), this.glTextures.clear(), this._location = 0, this.current.length = 0, this._premultiplyAlpha = !1, this._renderer.contextLost || e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
|
|
2797
2807
|
}
|
|
2798
2808
|
}, Pn = {
|
|
2799
|
-
uint8x2:
|
|
2800
|
-
uint8x4:
|
|
2801
|
-
sint8x2:
|
|
2802
|
-
sint8x4:
|
|
2803
|
-
unorm8x2:
|
|
2804
|
-
unorm8x4:
|
|
2805
|
-
snorm8x2:
|
|
2806
|
-
snorm8x4:
|
|
2807
|
-
uint16x2:
|
|
2808
|
-
uint16x4:
|
|
2809
|
-
sint16x2:
|
|
2810
|
-
sint16x4:
|
|
2811
|
-
unorm16x2:
|
|
2812
|
-
unorm16x4:
|
|
2813
|
-
snorm16x2:
|
|
2814
|
-
snorm16x4:
|
|
2815
|
-
float16x2:
|
|
2816
|
-
float16x4:
|
|
2817
|
-
float32:
|
|
2818
|
-
float32x2:
|
|
2819
|
-
float32x3:
|
|
2820
|
-
float32x4:
|
|
2821
|
-
uint32:
|
|
2822
|
-
uint32x2:
|
|
2823
|
-
uint32x3:
|
|
2824
|
-
uint32x4:
|
|
2825
|
-
sint32:
|
|
2826
|
-
sint32x2:
|
|
2827
|
-
sint32x3:
|
|
2828
|
-
sint32x4:
|
|
2809
|
+
uint8x2: F.UNSIGNED_BYTE,
|
|
2810
|
+
uint8x4: F.UNSIGNED_BYTE,
|
|
2811
|
+
sint8x2: F.BYTE,
|
|
2812
|
+
sint8x4: F.BYTE,
|
|
2813
|
+
unorm8x2: F.UNSIGNED_BYTE,
|
|
2814
|
+
unorm8x4: F.UNSIGNED_BYTE,
|
|
2815
|
+
snorm8x2: F.BYTE,
|
|
2816
|
+
snorm8x4: F.BYTE,
|
|
2817
|
+
uint16x2: F.UNSIGNED_SHORT,
|
|
2818
|
+
uint16x4: F.UNSIGNED_SHORT,
|
|
2819
|
+
sint16x2: F.SHORT,
|
|
2820
|
+
sint16x4: F.SHORT,
|
|
2821
|
+
unorm16x2: F.UNSIGNED_SHORT,
|
|
2822
|
+
unorm16x4: F.UNSIGNED_SHORT,
|
|
2823
|
+
snorm16x2: F.SHORT,
|
|
2824
|
+
snorm16x4: F.SHORT,
|
|
2825
|
+
float16x2: F.HALF_FLOAT,
|
|
2826
|
+
float16x4: F.HALF_FLOAT,
|
|
2827
|
+
float32: F.FLOAT,
|
|
2828
|
+
float32x2: F.FLOAT,
|
|
2829
|
+
float32x3: F.FLOAT,
|
|
2830
|
+
float32x4: F.FLOAT,
|
|
2831
|
+
uint32: F.UNSIGNED_INT,
|
|
2832
|
+
uint32x2: F.UNSIGNED_INT,
|
|
2833
|
+
uint32x3: F.UNSIGNED_INT,
|
|
2834
|
+
uint32x4: F.UNSIGNED_INT,
|
|
2835
|
+
sint32: F.INT,
|
|
2836
|
+
sint32x2: F.INT,
|
|
2837
|
+
sint32x3: F.INT,
|
|
2838
|
+
sint32x4: F.INT
|
|
2829
2839
|
};
|
|
2830
2840
|
function Fn(e) {
|
|
2831
2841
|
return Pn[e] ?? Pn.float32;
|
|
@@ -2838,7 +2848,7 @@ var In = {
|
|
|
2838
2848
|
"line-strip": 3,
|
|
2839
2849
|
"triangle-list": 4,
|
|
2840
2850
|
"triangle-strip": 5
|
|
2841
|
-
}, Ln = class extends
|
|
2851
|
+
}, Ln = class extends N {
|
|
2842
2852
|
_geometryVaoHash = {};
|
|
2843
2853
|
hasInstance = !1;
|
|
2844
2854
|
current = null;
|
|
@@ -2970,7 +2980,7 @@ var In = {
|
|
|
2970
2980
|
}
|
|
2971
2981
|
this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
|
|
2972
2982
|
}
|
|
2973
|
-
}, Rn = class extends
|
|
2983
|
+
}, Rn = class extends N {
|
|
2974
2984
|
install(e) {
|
|
2975
2985
|
super.install(e), e.colorMask = this;
|
|
2976
2986
|
}
|
|
@@ -3011,7 +3021,7 @@ function Vn(e, t) {
|
|
|
3011
3021
|
height: Math.max(0, a - r)
|
|
3012
3022
|
};
|
|
3013
3023
|
}
|
|
3014
|
-
var Hn = class extends
|
|
3024
|
+
var Hn = class extends N {
|
|
3015
3025
|
install(e) {
|
|
3016
3026
|
super.install(e), e.scissor = this;
|
|
3017
3027
|
}
|
|
@@ -3193,15 +3203,15 @@ var Hn = class extends j {
|
|
|
3193
3203
|
e.register(n, t);
|
|
3194
3204
|
}), e.font = this, this;
|
|
3195
3205
|
}
|
|
3196
|
-
}, Kn = class extends
|
|
3206
|
+
}, Kn = class extends E {
|
|
3197
3207
|
constructor(e) {
|
|
3198
3208
|
super(), this.setProperties(e);
|
|
3199
3209
|
}
|
|
3200
3210
|
};
|
|
3201
|
-
|
|
3211
|
+
j([_({ fallback: M.index }), A("design:type", M === void 0 ? Object : M)], Kn.prototype, "usage", void 0), j([_({ default: () => /* @__PURE__ */ new Uint32Array() }), A("design:type", Object)], Kn.prototype, "data", void 0);
|
|
3202
3212
|
//#endregion
|
|
3203
3213
|
//#region src/scene/resources/geometries/Geometry.ts
|
|
3204
|
-
var qn = class extends
|
|
3214
|
+
var qn = class extends E {
|
|
3205
3215
|
constructor(e = {}) {
|
|
3206
3216
|
super(), this.setProperties(e);
|
|
3207
3217
|
}
|
|
@@ -3209,32 +3219,32 @@ var qn = class extends yt {
|
|
|
3209
3219
|
e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
|
|
3210
3220
|
}
|
|
3211
3221
|
};
|
|
3212
|
-
|
|
3222
|
+
j([_({ fallback: "triangle-list" }), A("design:type", Object)], qn.prototype, "topology", void 0), j([_({ default: () => ({}) }), A("design:type", typeof Record > "u" ? Object : Record)], qn.prototype, "attributes", void 0), j([_({ default: () => new Kn() }), A("design:type", Kn === void 0 ? Object : Kn)], qn.prototype, "indexBuffer", void 0), j([_({ fallback: 1 }), A("design:type", Number)], qn.prototype, "instanceCount", void 0);
|
|
3213
3223
|
//#endregion
|
|
3214
3224
|
//#region src/scene/resources/geometries/VertexBuffer.ts
|
|
3215
|
-
var
|
|
3225
|
+
var I = class extends E {
|
|
3216
3226
|
constructor(e) {
|
|
3217
3227
|
super(), this.setProperties(e);
|
|
3218
3228
|
}
|
|
3219
3229
|
};
|
|
3220
|
-
|
|
3230
|
+
j([_({ fallback: M.vertex }), A("design:type", M === void 0 ? Object : M)], I.prototype, "usage", void 0), j([_({ default: () => /* @__PURE__ */ new Float32Array() }), A("design:type", Object)], I.prototype, "data", void 0);
|
|
3221
3231
|
//#endregion
|
|
3222
3232
|
//#region src/scene/resources/geometries/VertexAttribute.ts
|
|
3223
|
-
var
|
|
3233
|
+
var L = class extends E {
|
|
3224
3234
|
constructor(e) {
|
|
3225
3235
|
super(), this.setProperties(e);
|
|
3226
3236
|
}
|
|
3227
3237
|
};
|
|
3228
|
-
|
|
3238
|
+
j([_({ default: () => new I() }), A("design:type", I === void 0 ? Object : I)], L.prototype, "buffer", void 0), j([_({ fallback: "float32" }), A("design:type", Object)], L.prototype, "format", void 0), j([_(), A("design:type", Boolean)], L.prototype, "instance", void 0), j([_(), A("design:type", Number)], L.prototype, "stride", void 0), j([_(), A("design:type", Number)], L.prototype, "offset", void 0), j([_(), A("design:type", Number)], L.prototype, "start", void 0), j([_(), A("design:type", Number)], L.prototype, "divisor", void 0);
|
|
3229
3239
|
//#endregion
|
|
3230
3240
|
//#region src/scene/resources/geometries/QuadGeometry.ts
|
|
3231
3241
|
var Jn = class extends qn {
|
|
3232
3242
|
constructor() {
|
|
3233
3243
|
super({
|
|
3234
3244
|
topology: "triangle-strip",
|
|
3235
|
-
attributes: { position: new
|
|
3245
|
+
attributes: { position: new L({
|
|
3236
3246
|
format: "float32x2",
|
|
3237
|
-
buffer: new
|
|
3247
|
+
buffer: new I({ data: new Float32Array([
|
|
3238
3248
|
0,
|
|
3239
3249
|
0,
|
|
3240
3250
|
1,
|
|
@@ -3288,7 +3298,7 @@ function Yn() {
|
|
|
3288
3298
|
])
|
|
3289
3299
|
};
|
|
3290
3300
|
}
|
|
3291
|
-
var
|
|
3301
|
+
var R = class extends E {
|
|
3292
3302
|
static instance = new this();
|
|
3293
3303
|
glProgram;
|
|
3294
3304
|
constructor(e = {}) {
|
|
@@ -3307,7 +3317,7 @@ var I = class extends yt {
|
|
|
3307
3317
|
}, e.shader.updateUniforms(this);
|
|
3308
3318
|
}
|
|
3309
3319
|
};
|
|
3310
|
-
|
|
3320
|
+
j([_({ default: Yn }), A("design:type", typeof Record > "u" ? Object : Record)], R.prototype, "uniforms", void 0);
|
|
3311
3321
|
//#endregion
|
|
3312
3322
|
//#region src/scene/resources/materials/EffectMaterial.ts
|
|
3313
3323
|
var Xn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Zn = /vec(\d)\((.*)\)/;
|
|
@@ -3322,7 +3332,7 @@ function Qn(e) {
|
|
|
3322
3332
|
}
|
|
3323
3333
|
return Number(e);
|
|
3324
3334
|
}
|
|
3325
|
-
var $n = class e extends
|
|
3335
|
+
var $n = class e extends R {
|
|
3326
3336
|
static RE = {
|
|
3327
3337
|
getColor: /\sgetColor\s*\(/,
|
|
3328
3338
|
getFromColor: /\sgetFromColor\s*\(/,
|
|
@@ -3363,7 +3373,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3363
3373
|
this.uniforms[t.trim()] = Qn(e[2]);
|
|
3364
3374
|
});
|
|
3365
3375
|
}
|
|
3366
|
-
}, er = class extends
|
|
3376
|
+
}, er = class extends R {
|
|
3367
3377
|
static _instance;
|
|
3368
3378
|
static get instance() {
|
|
3369
3379
|
return this._instance ??= new this();
|
|
@@ -3407,7 +3417,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3407
3417
|
}
|
|
3408
3418
|
});
|
|
3409
3419
|
}
|
|
3410
|
-
},
|
|
3420
|
+
}, z = class extends qn {
|
|
3411
3421
|
static _instance;
|
|
3412
3422
|
static get instance() {
|
|
3413
3423
|
return this._instance ??= new this();
|
|
@@ -3418,9 +3428,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3418
3428
|
constructor() {
|
|
3419
3429
|
super({
|
|
3420
3430
|
attributes: {
|
|
3421
|
-
position: new
|
|
3431
|
+
position: new L({
|
|
3422
3432
|
format: "float32x2",
|
|
3423
|
-
buffer: new
|
|
3433
|
+
buffer: new I({ data: new Float32Array([
|
|
3424
3434
|
-1,
|
|
3425
3435
|
-1,
|
|
3426
3436
|
1,
|
|
@@ -3431,9 +3441,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3431
3441
|
1
|
|
3432
3442
|
]) })
|
|
3433
3443
|
}),
|
|
3434
|
-
uv: new
|
|
3444
|
+
uv: new L({
|
|
3435
3445
|
format: "float32x2",
|
|
3436
|
-
buffer: new
|
|
3446
|
+
buffer: new I({ data: new Float32Array([
|
|
3437
3447
|
0,
|
|
3438
3448
|
0,
|
|
3439
3449
|
1,
|
|
@@ -3459,15 +3469,15 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3459
3469
|
positionBuffer;
|
|
3460
3470
|
uvBuffer;
|
|
3461
3471
|
constructor(e) {
|
|
3462
|
-
let t = new
|
|
3472
|
+
let t = new I({ data: /* @__PURE__ */ new Float32Array() }), n = new I({ data: /* @__PURE__ */ new Float32Array() });
|
|
3463
3473
|
super({
|
|
3464
3474
|
...e,
|
|
3465
3475
|
attributes: {
|
|
3466
|
-
position: new
|
|
3476
|
+
position: new L({
|
|
3467
3477
|
format: "float32x2",
|
|
3468
3478
|
buffer: t
|
|
3469
3479
|
}),
|
|
3470
|
-
uv: new
|
|
3480
|
+
uv: new L({
|
|
3471
3481
|
format: "float32x2",
|
|
3472
3482
|
buffer: n
|
|
3473
3483
|
})
|
|
@@ -3475,7 +3485,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3475
3485
|
indexBuffer: new Kn({ data: /* @__PURE__ */ new Uint32Array() })
|
|
3476
3486
|
}), this.positionBuffer = t, this.uvBuffer = n;
|
|
3477
3487
|
}
|
|
3478
|
-
},
|
|
3488
|
+
}, B = class extends E {
|
|
3479
3489
|
get valid() {
|
|
3480
3490
|
return !!(this.width && this.height);
|
|
3481
3491
|
}
|
|
@@ -3489,10 +3499,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3489
3499
|
super._destroy(), this.colorTextures.forEach((e) => e.destroy());
|
|
3490
3500
|
}
|
|
3491
3501
|
};
|
|
3492
|
-
|
|
3502
|
+
j([_({ fallback: !1 }), A("design:type", Boolean)], B.prototype, "isRoot", void 0), j([_({ fallback: 0 }), A("design:type", Number)], B.prototype, "x", void 0), j([_({ fallback: 0 }), A("design:type", Number)], B.prototype, "y", void 0), j([_({ fallback: 0 }), A("design:type", Number)], B.prototype, "width", void 0), j([_({ fallback: 0 }), A("design:type", Number)], B.prototype, "height", void 0), j([_({ fallback: 0 }), A("design:type", Number)], B.prototype, "mipLevel", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], B.prototype, "msaa", void 0), j([_({ default: () => [new V()] }), A("design:type", Array)], B.prototype, "colorTextures", void 0);
|
|
3493
3503
|
//#endregion
|
|
3494
3504
|
//#region src/scene/resources/textures/Texture2D.ts
|
|
3495
|
-
var
|
|
3505
|
+
var V = class extends E {
|
|
3496
3506
|
static get EMPTY() {
|
|
3497
3507
|
return new this({
|
|
3498
3508
|
width: 1,
|
|
@@ -3603,10 +3613,10 @@ var z = class extends yt {
|
|
|
3603
3613
|
super._destroy(), Pe && this.source instanceof ImageBitmap && this.source.close();
|
|
3604
3614
|
}
|
|
3605
3615
|
};
|
|
3606
|
-
|
|
3616
|
+
j([_({ fallback: "unknown" }), A("design:type", String)], V.prototype, "uploadMethodId", void 0), j([_({ internal: !0 }), A("design:type", Object)], V.prototype, "source", void 0), j([_({ fallback: 0 }), A("design:type", Number)], V.prototype, "width", void 0), j([_({ fallback: 0 }), A("design:type", Number)], V.prototype, "height", void 0), j([_({ fallback: 1 }), A("design:type", Number)], V.prototype, "pixelRatio", void 0), j([_({ fallback: "bgra8unorm" }), A("design:type", Object)], V.prototype, "format", void 0), j([_({ fallback: "premultiply-alpha-on-upload" }), A("design:type", Object)], V.prototype, "alphaMode", void 0), j([_({ fallback: 1 }), A("design:type", Number)], V.prototype, "mipLevelCount", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], V.prototype, "mipmap", void 0), j([_({ fallback: "clamp-to-edge" }), A("design:type", Object)], V.prototype, "addressModeU", void 0), j([_({ fallback: "clamp-to-edge" }), A("design:type", Object)], V.prototype, "addressModeV", void 0), j([_({ fallback: "clamp-to-edge" }), A("design:type", Object)], V.prototype, "addressModeW", void 0), j([_({ fallback: "linear" }), A("design:type", Object)], V.prototype, "magFilter", void 0), j([_({ fallback: "linear" }), A("design:type", Object)], V.prototype, "minFilter", void 0), j([_({ fallback: "linear" }), A("design:type", Object)], V.prototype, "mipmapFilter", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], V.prototype, "isPowerOfTwo", void 0);
|
|
3607
3617
|
//#endregion
|
|
3608
3618
|
//#region src/scene/resources/textures/AnimatedTexture.ts
|
|
3609
|
-
var nr = class extends
|
|
3619
|
+
var nr = class extends E {
|
|
3610
3620
|
frames;
|
|
3611
3621
|
frameIndex = 0;
|
|
3612
3622
|
get currentFrame() {
|
|
@@ -3616,7 +3626,7 @@ var nr = class extends yt {
|
|
|
3616
3626
|
super();
|
|
3617
3627
|
let t;
|
|
3618
3628
|
if (Array.isArray(e)) t = e;
|
|
3619
|
-
else if (e instanceof
|
|
3629
|
+
else if (e instanceof V) t = [{
|
|
3620
3630
|
texture: e,
|
|
3621
3631
|
duration: 0
|
|
3622
3632
|
}];
|
|
@@ -3631,7 +3641,7 @@ var nr = class extends yt {
|
|
|
3631
3641
|
e.texture.destroy();
|
|
3632
3642
|
});
|
|
3633
3643
|
}
|
|
3634
|
-
}, rr = class extends
|
|
3644
|
+
}, rr = class extends V {
|
|
3635
3645
|
constructor(e = {}) {
|
|
3636
3646
|
super({
|
|
3637
3647
|
pixelRatio: 2,
|
|
@@ -3651,14 +3661,14 @@ var nr = class extends yt {
|
|
|
3651
3661
|
}
|
|
3652
3662
|
super._updateProperty(e, t, n);
|
|
3653
3663
|
}
|
|
3654
|
-
}, ir = class e extends
|
|
3664
|
+
}, ir = class e extends V {
|
|
3655
3665
|
static _cached = /* @__PURE__ */ new Map();
|
|
3656
3666
|
static get(t) {
|
|
3657
|
-
let n = new
|
|
3667
|
+
let n = new D(t), r = n.toHex(), i = this._cached.get(r);
|
|
3658
3668
|
return i || (i = new e(n), this._cached.set(r, i)), i;
|
|
3659
3669
|
}
|
|
3660
3670
|
constructor(e) {
|
|
3661
|
-
let t = e instanceof
|
|
3671
|
+
let t = e instanceof D ? e : new D(e);
|
|
3662
3672
|
super({
|
|
3663
3673
|
width: 1,
|
|
3664
3674
|
height: 1,
|
|
@@ -3672,7 +3682,7 @@ var nr = class extends yt {
|
|
|
3672
3682
|
mipmap: !0
|
|
3673
3683
|
});
|
|
3674
3684
|
}
|
|
3675
|
-
}, ar = class e extends
|
|
3685
|
+
}, ar = class e extends V {
|
|
3676
3686
|
static test(e) {
|
|
3677
3687
|
return u(e);
|
|
3678
3688
|
}
|
|
@@ -3706,7 +3716,7 @@ var nr = class extends yt {
|
|
|
3706
3716
|
constructor(t, n, r) {
|
|
3707
3717
|
super(e.linearGradient(t, n, r));
|
|
3708
3718
|
}
|
|
3709
|
-
}, or = class extends
|
|
3719
|
+
}, or = class extends V {
|
|
3710
3720
|
constructor(e = {}) {
|
|
3711
3721
|
super({
|
|
3712
3722
|
...e,
|
|
@@ -3727,7 +3737,7 @@ function sr(e) {
|
|
|
3727
3737
|
playsinline: !!(e?.playsinline ?? !0)
|
|
3728
3738
|
};
|
|
3729
3739
|
}
|
|
3730
|
-
var cr = class e extends
|
|
3740
|
+
var cr = class e extends V {
|
|
3731
3741
|
static mimeTypes = new Map(Object.entries({
|
|
3732
3742
|
ogv: "video/ogg",
|
|
3733
3743
|
mov: "video/quicktime",
|
|
@@ -3882,16 +3892,16 @@ var cr = class e extends z {
|
|
|
3882
3892
|
e && (e.removeEventListener("play", this._onPlayStart), e.removeEventListener("pause", this._onPlayStop), e.removeEventListener("seeked", this._onSeeked), e.removeEventListener("canplay", this._onCanPlay), e.removeEventListener("canplaythrough", this._onCanPlay), e.removeEventListener("error", this._onError, !0), e.pause(), e.src = "", e.load());
|
|
3883
3893
|
}
|
|
3884
3894
|
};
|
|
3885
|
-
|
|
3895
|
+
j([_({
|
|
3886
3896
|
internal: !0,
|
|
3887
3897
|
fallback: !0
|
|
3888
|
-
}),
|
|
3898
|
+
}), A("design:type", Boolean)], cr.prototype, "autoUpdate", void 0), j([_({
|
|
3889
3899
|
internal: !0,
|
|
3890
3900
|
fallback: 0
|
|
3891
|
-
}),
|
|
3901
|
+
}), A("design:type", Number)], cr.prototype, "fps", void 0);
|
|
3892
3902
|
//#endregion
|
|
3893
3903
|
//#region src/scene/resources/textures/ViewportTexture.ts
|
|
3894
|
-
var lr = class extends
|
|
3904
|
+
var lr = class extends V {}, ur = class extends v {
|
|
3895
3905
|
fillStyle;
|
|
3896
3906
|
fillRule;
|
|
3897
3907
|
strokeStyle;
|
|
@@ -3905,7 +3915,7 @@ var lr = class extends z {}, ur = class extends v {
|
|
|
3905
3915
|
_draws = [];
|
|
3906
3916
|
_triCache = [];
|
|
3907
3917
|
_parseDrawStyle(e) {
|
|
3908
|
-
return e ? e instanceof
|
|
3918
|
+
return e ? e instanceof V ? { texture: e } : { texture: ir.get(e) } : {};
|
|
3909
3919
|
}
|
|
3910
3920
|
stroke(e) {
|
|
3911
3921
|
if (!this.curves.length) return;
|
|
@@ -4089,7 +4099,7 @@ function hr(e) {
|
|
|
4089
4099
|
let t = mr[e] ?? 0;
|
|
4090
4100
|
return t++, mr[e] = t, t;
|
|
4091
4101
|
}
|
|
4092
|
-
var
|
|
4102
|
+
var H = pr = class extends T {
|
|
4093
4103
|
static parse(e, t = "Node") {
|
|
4094
4104
|
if (Array.isArray(e)) return e.map((e) => this.parse(e));
|
|
4095
4105
|
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ve.get(n ?? r.inCanvasIs ?? t)) ?? pr)({
|
|
@@ -4452,13 +4462,13 @@ var B = pr = class extends T {
|
|
|
4452
4462
|
});
|
|
4453
4463
|
}
|
|
4454
4464
|
};
|
|
4455
|
-
|
|
4465
|
+
j([_({ default: () => c() }), A("design:type", String)], H.prototype, "id", void 0), j([_({ default: () => c() }), A("design:type", String)], H.prototype, "name", void 0), j([_({ fallback: "inherit" }), A("design:type", Object)], H.prototype, "processMode", void 0), j([_({ fallback: "default" }), A("design:type", Object)], H.prototype, "processSortMode", void 0), j([_({ fallback: "inherit" }), A("design:type", Object)], H.prototype, "renderMode", void 0), j([_({ fallback: "inherit" }), A("design:type", Object)], H.prototype, "inputMode", void 0), j([_({ fallback: "default" }), A("design:type", Object)], H.prototype, "internalMode", void 0), j([_({
|
|
4456
4466
|
internal: !0,
|
|
4457
4467
|
default: !0
|
|
4458
|
-
}),
|
|
4468
|
+
}), A("design:type", Boolean)], H.prototype, "needsRender", void 0), H = pr = j([S("Node"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], H);
|
|
4459
4469
|
//#endregion
|
|
4460
4470
|
//#region src/scene/main/TimelineNode.ts
|
|
4461
|
-
var
|
|
4471
|
+
var U = class extends H {
|
|
4462
4472
|
insideTimeRange = !1;
|
|
4463
4473
|
get _timeline() {
|
|
4464
4474
|
return this._tree?.timeline;
|
|
@@ -4494,7 +4504,7 @@ var V = class extends B {
|
|
|
4494
4504
|
return this._globalStartTime + this._globalDuration;
|
|
4495
4505
|
}
|
|
4496
4506
|
get currentTimeProgress() {
|
|
4497
|
-
return this._duration ?
|
|
4507
|
+
return this._duration ? O(this._currentTime / this._duration, 0, 1) : 0;
|
|
4498
4508
|
}
|
|
4499
4509
|
isInsideTimeRange() {
|
|
4500
4510
|
let e = this._currentTime;
|
|
@@ -4540,7 +4550,7 @@ var V = class extends B {
|
|
|
4540
4550
|
super._process(e), this._updateCurrentTime();
|
|
4541
4551
|
}
|
|
4542
4552
|
};
|
|
4543
|
-
|
|
4553
|
+
j([_({ fallback: !1 }), A("design:type", Boolean)], U.prototype, "loop", void 0), j([_({ fallback: 0 }), A("design:type", Number)], U.prototype, "delay", void 0), j([_({ fallback: 0 }), A("design:type", Number)], U.prototype, "duration", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], U.prototype, "paused", void 0), U = j([S("TimelineNode"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], U);
|
|
4544
4554
|
//#endregion
|
|
4545
4555
|
//#region src/scene/main/CanvasItem.ts
|
|
4546
4556
|
var gr = [], _r = 0;
|
|
@@ -4551,7 +4561,7 @@ function yr(e, t, n, r) {
|
|
|
4551
4561
|
let i = gr[_r];
|
|
4552
4562
|
return i || (i = {}, gr[_r] = i), _r++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i;
|
|
4553
4563
|
}
|
|
4554
|
-
var br = class extends
|
|
4564
|
+
var br = class extends U {
|
|
4555
4565
|
_blendMode;
|
|
4556
4566
|
_parentGlobalVisible;
|
|
4557
4567
|
_globalVisible;
|
|
@@ -4631,7 +4641,7 @@ var br = class extends V {
|
|
|
4631
4641
|
}
|
|
4632
4642
|
_updateGlobalOpacity() {
|
|
4633
4643
|
this._parentGlobalOpacity = this.getParent()?.opacity;
|
|
4634
|
-
let e =
|
|
4644
|
+
let e = O(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
|
|
4635
4645
|
this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
|
|
4636
4646
|
}
|
|
4637
4647
|
_draw() {
|
|
@@ -4710,19 +4720,19 @@ var br = class extends V {
|
|
|
4710
4720
|
super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
|
|
4711
4721
|
}
|
|
4712
4722
|
};
|
|
4713
|
-
|
|
4723
|
+
j([_(), A("design:type", Object)], br.prototype, "blendMode", void 0), j([_({
|
|
4714
4724
|
internal: !0,
|
|
4715
4725
|
fallback: !0
|
|
4716
|
-
}),
|
|
4726
|
+
}), A("design:type", Boolean)], br.prototype, "visible", void 0), j([_({
|
|
4717
4727
|
internal: !0,
|
|
4718
4728
|
fallback: 1
|
|
4719
|
-
}),
|
|
4729
|
+
}), A("design:type", Number)], br.prototype, "opacity", void 0), br = j([S("CanvasItem"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], br);
|
|
4720
4730
|
//#endregion
|
|
4721
4731
|
//#region src/scene/main/Viewport.ts
|
|
4722
|
-
var
|
|
4732
|
+
var W = class extends H {
|
|
4723
4733
|
canvasTransform = new b();
|
|
4724
4734
|
renderTargetIndex = 0;
|
|
4725
|
-
renderTargets = [new
|
|
4735
|
+
renderTargets = [new B(), new B()];
|
|
4726
4736
|
get valid() {
|
|
4727
4737
|
return !!(this.width && this.height);
|
|
4728
4738
|
}
|
|
@@ -4769,7 +4779,7 @@ var H = class extends B {
|
|
|
4769
4779
|
return !1;
|
|
4770
4780
|
}
|
|
4771
4781
|
activateWithCopy(e, t) {
|
|
4772
|
-
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0),
|
|
4782
|
+
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), z.draw(e, er.instance, { sampler: 0 }));
|
|
4773
4783
|
}
|
|
4774
4784
|
renderStart(e, t) {
|
|
4775
4785
|
this.activate(e, t) && e.clear();
|
|
@@ -4782,7 +4792,7 @@ var H = class extends B {
|
|
|
4782
4792
|
this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
|
|
4783
4793
|
}
|
|
4784
4794
|
getRect() {
|
|
4785
|
-
return new
|
|
4795
|
+
return new yt(this.x, this.y, this.width, this.height);
|
|
4786
4796
|
}
|
|
4787
4797
|
toCanvasGlobal(e, t) {
|
|
4788
4798
|
return this.canvasTransform.applyAffineInverse(e, t);
|
|
@@ -4794,16 +4804,16 @@ var H = class extends B {
|
|
|
4794
4804
|
super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
|
|
4795
4805
|
}
|
|
4796
4806
|
};
|
|
4797
|
-
|
|
4807
|
+
j([_({ fallback: 0 }), A("design:type", Number)], W.prototype, "x", void 0), j([_({ fallback: 0 }), A("design:type", Number)], W.prototype, "y", void 0), j([_({ fallback: 0 }), A("design:type", Number)], W.prototype, "width", void 0), j([_({ fallback: 0 }), A("design:type", Number)], W.prototype, "height", void 0), j([_({ fallback: 0 }), A("design:type", Number)], W.prototype, "mipLevel", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], W.prototype, "msaa", void 0), W = j([S("Viewport")], W);
|
|
4798
4808
|
//#endregion
|
|
4799
4809
|
//#region src/scene/main/Effect.ts
|
|
4800
|
-
var
|
|
4810
|
+
var G = class extends U {
|
|
4801
4811
|
material;
|
|
4802
4812
|
get _effectMode() {
|
|
4803
4813
|
return this.effectMode ?? "parent";
|
|
4804
4814
|
}
|
|
4805
|
-
viewport1 = new
|
|
4806
|
-
viewport2 = new
|
|
4815
|
+
viewport1 = new W();
|
|
4816
|
+
viewport2 = new W();
|
|
4807
4817
|
_renderId = 0;
|
|
4808
4818
|
_renderViewport;
|
|
4809
4819
|
_previousSibling;
|
|
@@ -4855,7 +4865,7 @@ var U = class extends V {
|
|
|
4855
4865
|
}
|
|
4856
4866
|
}
|
|
4857
4867
|
getRect() {
|
|
4858
|
-
return new
|
|
4868
|
+
return new yt(this._rect);
|
|
4859
4869
|
}
|
|
4860
4870
|
_processParent() {
|
|
4861
4871
|
let e = this._tree?.renderStack;
|
|
@@ -5008,13 +5018,13 @@ var U = class extends V {
|
|
|
5008
5018
|
}
|
|
5009
5019
|
apply(e, t, n) {
|
|
5010
5020
|
this.material && (n?.redraw ? t.redraw(e, () => {
|
|
5011
|
-
|
|
5021
|
+
z.draw(e, this.material, {
|
|
5012
5022
|
from: 0,
|
|
5013
5023
|
to: 1,
|
|
5014
5024
|
progress: this.currentTimeProgress,
|
|
5015
5025
|
ratio: t.width / t.height
|
|
5016
5026
|
});
|
|
5017
|
-
}) :
|
|
5027
|
+
}) : z.draw(e, this.material, {
|
|
5018
5028
|
from: 0,
|
|
5019
5029
|
to: 1,
|
|
5020
5030
|
progress: this.currentTimeProgress,
|
|
@@ -5025,7 +5035,7 @@ var U = class extends V {
|
|
|
5025
5035
|
super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
|
|
5026
5036
|
}
|
|
5027
5037
|
};
|
|
5028
|
-
|
|
5038
|
+
j([_({ internal: !0 }), A("design:type", Object)], G.prototype, "material", void 0), j([_(), A("design:type", Object)], G.prototype, "effectMode", void 0), j([_(), A("design:type", String)], G.prototype, "glsl", void 0), j([_(), A("design:type", String)], G.prototype, "glslSrc", void 0), G = j([S("Effect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
|
|
5029
5039
|
//#endregion
|
|
5030
5040
|
//#region src/scene/main/RenderStack.ts
|
|
5031
5041
|
var xr = class {
|
|
@@ -5053,7 +5063,7 @@ var xr = class {
|
|
|
5053
5063
|
});
|
|
5054
5064
|
}), this.reset();
|
|
5055
5065
|
}
|
|
5056
|
-
}, Sr, Cr = Sr = class extends
|
|
5066
|
+
}, Sr, Cr = Sr = class extends H {
|
|
5057
5067
|
currentTime = 0;
|
|
5058
5068
|
playing = !1;
|
|
5059
5069
|
playbackRate = 1;
|
|
@@ -5092,7 +5102,7 @@ var xr = class {
|
|
|
5092
5102
|
}
|
|
5093
5103
|
addTime(e) {
|
|
5094
5104
|
let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = t - n, i = this.currentTime + e;
|
|
5095
|
-
return this.loop && r > 0 && i > t && (i = n + (i - n) % r), i =
|
|
5105
|
+
return this.loop && r > 0 && i > t && (i = n + (i - n) % r), i = O(i, n, t), this.currentTime = i, this.emit("updateCurrentTime", i, e), this;
|
|
5096
5106
|
}
|
|
5097
5107
|
play(e) {
|
|
5098
5108
|
return e?.rate !== void 0 && (this._rate = e.rate), e?.loopMode !== void 0 && (this.loopMode = e.loopMode), this._direction = 1, (!Number.isFinite(this.currentTime) || this.currentTime >= this.endTime) && (this.currentTime = Math.min(this.startTime, this.endTime)), this.playing = !0, this.playbackRate = this._rate * this._direction, this;
|
|
@@ -5120,10 +5130,10 @@ var xr = class {
|
|
|
5120
5130
|
super._process(e), this.paused || this.addTime(e);
|
|
5121
5131
|
}
|
|
5122
5132
|
};
|
|
5123
|
-
|
|
5133
|
+
j([_({ fallback: 0 }), A("design:type", Number)], Cr.prototype, "startTime", void 0), j([_({ fallback: 2 ** 53 - 1 }), A("design:type", Number)], Cr.prototype, "endTime", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], Cr.prototype, "loop", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], Cr.prototype, "paused", void 0), Cr = Sr = j([S("Timeline"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Cr);
|
|
5124
5134
|
//#endregion
|
|
5125
5135
|
//#region src/scene/main/Window.ts
|
|
5126
|
-
var wr = class extends
|
|
5136
|
+
var wr = class extends W {
|
|
5127
5137
|
constructor() {
|
|
5128
5138
|
super(), this.renderTargets.forEach((e) => e.isRoot = !0);
|
|
5129
5139
|
}
|
|
@@ -5134,22 +5144,23 @@ var wr = class extends H {
|
|
|
5134
5144
|
super.flush(e), this.finish(e);
|
|
5135
5145
|
}
|
|
5136
5146
|
};
|
|
5137
|
-
wr =
|
|
5147
|
+
wr = j([S("Window", {
|
|
5138
5148
|
processMode: "always",
|
|
5139
5149
|
renderMode: "always"
|
|
5140
|
-
}),
|
|
5150
|
+
}), A("design:paramtypes", [])], wr);
|
|
5141
5151
|
//#endregion
|
|
5142
5152
|
//#region src/scene/main/SceneTree.ts
|
|
5143
|
-
var Tr = class extends
|
|
5153
|
+
var Tr = class extends Tt {
|
|
5144
5154
|
input = new _t();
|
|
5145
5155
|
renderStack = new xr();
|
|
5146
5156
|
root = new wr().setTree(this);
|
|
5147
5157
|
timeline = new Cr().setTree(this);
|
|
5158
|
+
imagePipelineResolver;
|
|
5148
5159
|
nodeMap = /* @__PURE__ */ new Map();
|
|
5149
5160
|
_boundFonts;
|
|
5150
5161
|
_textRemeasureScheduled = !1;
|
|
5151
5162
|
_onFontLoad = () => this._scheduleTextRemeasure();
|
|
5152
|
-
_backgroundColor = new
|
|
5163
|
+
_backgroundColor = new D();
|
|
5153
5164
|
_previousViewport;
|
|
5154
5165
|
_currentViewport;
|
|
5155
5166
|
getPreviousViewport() {
|
|
@@ -5207,33 +5218,33 @@ var Tr = class extends Dt {
|
|
|
5207
5218
|
_renderScreen(e) {
|
|
5208
5219
|
this.root.finish(e), e.state.reset(), e.renderTarget.unbind(), this.backgroundColor && e.gl.clearColor(...this._backgroundColor.toArray()), e.clear(), this.backgroundColor && e.gl.clearColor(0, 0, 0, 0);
|
|
5209
5220
|
let t = this.root.texture;
|
|
5210
|
-
t.activate(e, 0),
|
|
5221
|
+
t.activate(e, 0), z.draw(e), t.inactivate(e);
|
|
5211
5222
|
}
|
|
5212
5223
|
_destroy() {
|
|
5213
5224
|
super._destroy(), this._bindFonts(void 0), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
|
|
5214
5225
|
}
|
|
5215
5226
|
};
|
|
5216
|
-
|
|
5227
|
+
j([_({ alias: "root.msaa" }), A("design:type", Boolean)], Tr.prototype, "msaa", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], Tr.prototype, "pixelate", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], Tr.prototype, "roundPixels", void 0), j([_(), A("design:type", Object)], Tr.prototype, "backgroundColor", void 0), j([_({
|
|
5217
5228
|
internal: !0,
|
|
5218
5229
|
fallback: !1
|
|
5219
|
-
}),
|
|
5230
|
+
}), A("design:type", Boolean)], Tr.prototype, "debug", void 0), j([_({
|
|
5220
5231
|
internal: !0,
|
|
5221
5232
|
fallback: !1
|
|
5222
|
-
}),
|
|
5233
|
+
}), A("design:type", Boolean)], Tr.prototype, "processPaused", void 0), j([_({
|
|
5223
5234
|
internal: !0,
|
|
5224
5235
|
default: () => he
|
|
5225
|
-
}),
|
|
5236
|
+
}), A("design:type", Object)], Tr.prototype, "fonts", void 0);
|
|
5226
5237
|
//#endregion
|
|
5227
5238
|
//#region src/scene/main/Transition.ts
|
|
5228
|
-
var Er = class extends
|
|
5239
|
+
var Er = class extends G {
|
|
5229
5240
|
constructor(e, t = []) {
|
|
5230
5241
|
super(), this.setProperties(e).append(t);
|
|
5231
5242
|
}
|
|
5232
5243
|
};
|
|
5233
|
-
Er =
|
|
5244
|
+
Er = j([S("Transition", {
|
|
5234
5245
|
effectMode: "transition",
|
|
5235
5246
|
duration: 2e3
|
|
5236
|
-
}),
|
|
5247
|
+
}), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Er);
|
|
5237
5248
|
//#endregion
|
|
5238
5249
|
//#region src/scene/2d/Node2D.ts
|
|
5239
5250
|
var Dr = class extends br {
|
|
@@ -5288,7 +5299,7 @@ var Dr = class extends br {
|
|
|
5288
5299
|
super._destroy(), this.position.destroy(), this.scale.destroy(), this.skew.destroy(), this.pivot.destroy(), this.extraTransform.destroy(), this.transform.destroy(), this.globalPosition.destroy(), this.globalScale.destroy(), this.globalSkew.destroy(), this.globalTransform.destroy();
|
|
5289
5300
|
}
|
|
5290
5301
|
};
|
|
5291
|
-
Dr =
|
|
5302
|
+
Dr = j([S("Node2D"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Dr);
|
|
5292
5303
|
//#endregion
|
|
5293
5304
|
//#region src/scene/2d/Camera2D.ts
|
|
5294
5305
|
var Or = class extends Dr {
|
|
@@ -5332,7 +5343,7 @@ var Or = class extends Dr {
|
|
|
5332
5343
|
return this.setZoom(this._zoom.x + e, this._zoom.y + t);
|
|
5333
5344
|
}
|
|
5334
5345
|
setZoom(e, t = e) {
|
|
5335
|
-
return this._zoom.set(
|
|
5346
|
+
return this._zoom.set(O(e, this._minZoom.x, this._maxZoom.x), O(t, this._minZoom.y, this._maxZoom.y)), this;
|
|
5336
5347
|
}
|
|
5337
5348
|
setZoomAtOrigin(e, t, n) {
|
|
5338
5349
|
let r;
|
|
@@ -5435,16 +5446,16 @@ var Or = class extends Dr {
|
|
|
5435
5446
|
};
|
|
5436
5447
|
}
|
|
5437
5448
|
};
|
|
5438
|
-
|
|
5449
|
+
j([_({
|
|
5439
5450
|
internal: !0,
|
|
5440
5451
|
fallback: !1
|
|
5441
|
-
}),
|
|
5452
|
+
}), A("design:type", Boolean)], Or.prototype, "spaceKey", void 0), j([_({
|
|
5442
5453
|
internal: !0,
|
|
5443
5454
|
fallback: !1
|
|
5444
|
-
}),
|
|
5455
|
+
}), A("design:type", Boolean)], Or.prototype, "grabbing", void 0), Or = j([S("Camera2D", {
|
|
5445
5456
|
processMode: "disabled",
|
|
5446
5457
|
renderMode: "disabled"
|
|
5447
|
-
}),
|
|
5458
|
+
}), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Or);
|
|
5448
5459
|
//#endregion
|
|
5449
5460
|
//#region src/scene/2d/element/connectionRouter.ts
|
|
5450
5461
|
function kr(e, t) {
|
|
@@ -5592,7 +5603,7 @@ var Ir = {
|
|
|
5592
5603
|
sepia: 0
|
|
5593
5604
|
};
|
|
5594
5605
|
function Lr(e) {
|
|
5595
|
-
let t = new
|
|
5606
|
+
let t = new St();
|
|
5596
5607
|
if (e === "none") return t;
|
|
5597
5608
|
let n = Ae(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5598
5609
|
Object.keys(Ir).forEach((e) => {
|
|
@@ -5646,11 +5657,11 @@ function Rr(e) {
|
|
|
5646
5657
|
}
|
|
5647
5658
|
//#endregion
|
|
5648
5659
|
//#region src/scene/effects/ColorAdjustEffect.ts
|
|
5649
|
-
var zr,
|
|
5660
|
+
var zr, K = class extends G {
|
|
5650
5661
|
static {
|
|
5651
5662
|
zr = this;
|
|
5652
5663
|
}
|
|
5653
|
-
static material = new
|
|
5664
|
+
static material = new R({ gl: {
|
|
5654
5665
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5655
5666
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n c.rgb *= c.a;\n }\n gl_FragColor = c * alpha;\n}"
|
|
5656
5667
|
} });
|
|
@@ -5659,7 +5670,7 @@ var zr, W = class extends U {
|
|
|
5659
5670
|
}
|
|
5660
5671
|
apply(e, t) {
|
|
5661
5672
|
t.redraw(e, () => {
|
|
5662
|
-
|
|
5673
|
+
z.draw(e, zr.material, {
|
|
5663
5674
|
sampler: 0,
|
|
5664
5675
|
saturation: this.saturation,
|
|
5665
5676
|
contrast: this.contrast,
|
|
@@ -5673,18 +5684,18 @@ var zr, W = class extends U {
|
|
|
5673
5684
|
});
|
|
5674
5685
|
}
|
|
5675
5686
|
};
|
|
5676
|
-
|
|
5687
|
+
j([_({ fallback: 1 }), A("design:type", Number)], K.prototype, "saturation", void 0), j([_({ fallback: 1 }), A("design:type", Number)], K.prototype, "contrast", void 0), j([_({ fallback: 1 }), A("design:type", Number)], K.prototype, "brightness", void 0), j([_({ fallback: 1 }), A("design:type", Number)], K.prototype, "red", void 0), j([_({ fallback: 1 }), A("design:type", Number)], K.prototype, "green", void 0), j([_({ fallback: 1 }), A("design:type", Number)], K.prototype, "blue", void 0), j([_({ fallback: 1 }), A("design:type", Number)], K.prototype, "alpha", void 0), j([_({ fallback: 1 }), A("design:type", Number)], K.prototype, "gamma", void 0), K = zr = j([S("ColorAdjustEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
|
|
5677
5688
|
//#endregion
|
|
5678
5689
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5679
|
-
var Br, Vr = class extends
|
|
5690
|
+
var Br, Vr = class extends G {
|
|
5680
5691
|
static {
|
|
5681
5692
|
Br = this;
|
|
5682
5693
|
}
|
|
5683
|
-
static material = new
|
|
5694
|
+
static material = new R({ gl: {
|
|
5684
5695
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5685
5696
|
fragment: "in vec2 vUv;\nuniform sampler2D sampler;\nuniform float m[20];\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n gl_FragColor = vec4(\n m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4] / 255.0,\n m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9] / 255.0,\n m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,\n m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0\n );\n}"
|
|
5686
5697
|
} });
|
|
5687
|
-
_colorMatrix = new
|
|
5698
|
+
_colorMatrix = new St();
|
|
5688
5699
|
constructor(e, t = []) {
|
|
5689
5700
|
super(), this.setProperties(e).append(t);
|
|
5690
5701
|
}
|
|
@@ -5728,21 +5739,21 @@ var Br, Vr = class extends U {
|
|
|
5728
5739
|
break;
|
|
5729
5740
|
}
|
|
5730
5741
|
}), t.redraw(e, () => {
|
|
5731
|
-
|
|
5742
|
+
z.draw(e, Br.material, {
|
|
5732
5743
|
sampler: 0,
|
|
5733
5744
|
m: r.toArray()
|
|
5734
5745
|
});
|
|
5735
5746
|
});
|
|
5736
5747
|
}
|
|
5737
5748
|
};
|
|
5738
|
-
|
|
5749
|
+
j([_(), A("design:type", String)], Vr.prototype, "filter", void 0), Vr = Br = j([S("ColorFilterEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Vr);
|
|
5739
5750
|
//#endregion
|
|
5740
5751
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
5741
|
-
var Hr, Ur = 50, Wr = class extends
|
|
5752
|
+
var Hr, Ur = 50, Wr = class extends G {
|
|
5742
5753
|
static {
|
|
5743
5754
|
Hr = this;
|
|
5744
5755
|
}
|
|
5745
|
-
static material = new
|
|
5756
|
+
static material = new R({ gl: {
|
|
5746
5757
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5747
5758
|
fragment: `precision mediump float;
|
|
5748
5759
|
uniform sampler2D sampler;
|
|
@@ -5782,7 +5793,7 @@ void main(void) {
|
|
|
5782
5793
|
gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
|
|
5783
5794
|
}`
|
|
5784
5795
|
} });
|
|
5785
|
-
_color = new
|
|
5796
|
+
_color = new D();
|
|
5786
5797
|
constructor(e, t = []) {
|
|
5787
5798
|
super(), this.setProperties(e).append(t);
|
|
5788
5799
|
}
|
|
@@ -5799,25 +5810,25 @@ void main(void) {
|
|
|
5799
5810
|
0,
|
|
5800
5811
|
0
|
|
5801
5812
|
]);
|
|
5802
|
-
|
|
5813
|
+
z.draw(e, Hr.material, {
|
|
5803
5814
|
sampler: 0,
|
|
5804
5815
|
colors: t.slice(0, Ur).flatMap((e) => e)
|
|
5805
5816
|
});
|
|
5806
5817
|
});
|
|
5807
5818
|
}
|
|
5808
5819
|
};
|
|
5809
|
-
|
|
5820
|
+
j([_({ default: () => [] }), A("design:type", Array)], Wr.prototype, "colors", void 0), j([_({ fallback: .5 }), A("design:type", Number)], Wr.prototype, "alpha", void 0), Wr = Hr = j([S("ColorOverlayEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Wr);
|
|
5810
5821
|
//#endregion
|
|
5811
5822
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
5812
|
-
var Gr, Kr = class extends
|
|
5823
|
+
var Gr, Kr = class extends G {
|
|
5813
5824
|
static {
|
|
5814
5825
|
Gr = this;
|
|
5815
5826
|
}
|
|
5816
|
-
static material = new
|
|
5827
|
+
static material = new R({ gl: {
|
|
5817
5828
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5818
5829
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float epsilon;\nconst int MAX_COLORS = 50;\nuniform vec3 originalColors[MAX_COLORS];\n\nvoid main(void) {\n vec4 color = texture2D(sampler, vUv);\n\n for (int i = 0; i < MAX_COLORS; i++) {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0) {\n break;\n }\n vec3 colorDiff = origColor - color.rgb;\n if (length(colorDiff) < epsilon) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n }\n\n gl_FragColor = color;\n}"
|
|
5819
5830
|
} });
|
|
5820
|
-
_color = new
|
|
5831
|
+
_color = new D();
|
|
5821
5832
|
constructor(e, t = []) {
|
|
5822
5833
|
super(), this.setProperties(e).append(t);
|
|
5823
5834
|
}
|
|
@@ -5831,7 +5842,7 @@ var Gr, Kr = class extends U {
|
|
|
5831
5842
|
r.slice(0, 50).forEach((e, t) => {
|
|
5832
5843
|
n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
|
|
5833
5844
|
}), t.redraw(e, () => {
|
|
5834
|
-
|
|
5845
|
+
z.draw(e, Gr.material, {
|
|
5835
5846
|
sampler: 0,
|
|
5836
5847
|
epsilon: this.epsilon,
|
|
5837
5848
|
originalColors: n
|
|
@@ -5839,14 +5850,14 @@ var Gr, Kr = class extends U {
|
|
|
5839
5850
|
});
|
|
5840
5851
|
}
|
|
5841
5852
|
};
|
|
5842
|
-
|
|
5853
|
+
j([_({ default: () => [] }), A("design:type", Array)], Kr.prototype, "colors", void 0), j([_({ fallback: .5 }), A("design:type", Number)], Kr.prototype, "epsilon", void 0), Kr = Gr = j([S("ColorRemoveEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Kr);
|
|
5843
5854
|
//#endregion
|
|
5844
5855
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
5845
|
-
var qr, Jr = 50, Yr = class extends
|
|
5856
|
+
var qr, Jr = 50, Yr = class extends G {
|
|
5846
5857
|
static {
|
|
5847
5858
|
qr = this;
|
|
5848
5859
|
}
|
|
5849
|
-
static material = new
|
|
5860
|
+
static material = new R({ gl: {
|
|
5850
5861
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5851
5862
|
fragment: `varying vec2 vUv;
|
|
5852
5863
|
uniform sampler2D sampler;
|
|
@@ -5879,7 +5890,7 @@ void main(void) {
|
|
|
5879
5890
|
}
|
|
5880
5891
|
}`
|
|
5881
5892
|
} });
|
|
5882
|
-
_color = new
|
|
5893
|
+
_color = new D();
|
|
5883
5894
|
constructor(e, t = []) {
|
|
5884
5895
|
super(), this.setProperties(e).append(t);
|
|
5885
5896
|
}
|
|
@@ -5902,7 +5913,7 @@ void main(void) {
|
|
|
5902
5913
|
n.slice(0, Jr).forEach(([e, t], n) => {
|
|
5903
5914
|
i[n * 3] = e[0], i[n * 3 + 1] = e[1], i[n * 3 + 2] = e[2], a[n * 3] = t[0], a[n * 3 + 1] = t[1], a[n * 3 + 2] = t[2];
|
|
5904
5915
|
}), t.redraw(e, () => {
|
|
5905
|
-
|
|
5916
|
+
z.draw(e, qr.material, {
|
|
5906
5917
|
sampler: 0,
|
|
5907
5918
|
epsilon: r,
|
|
5908
5919
|
originalColors: i,
|
|
@@ -5911,15 +5922,15 @@ void main(void) {
|
|
|
5911
5922
|
});
|
|
5912
5923
|
}
|
|
5913
5924
|
};
|
|
5914
|
-
|
|
5925
|
+
j([_({ default: () => [] }), A("design:type", Array)], Yr.prototype, "colors", void 0), j([_({ fallback: .05 }), A("design:type", Number)], Yr.prototype, "epsilon", void 0), Yr = qr = j([S("ColorReplaceEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Yr);
|
|
5915
5926
|
//#endregion
|
|
5916
5927
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
5917
|
-
var Xr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Zr,
|
|
5928
|
+
var Xr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Zr, q = class extends G {
|
|
5918
5929
|
static {
|
|
5919
5930
|
Zr = this;
|
|
5920
5931
|
}
|
|
5921
5932
|
_watermark;
|
|
5922
|
-
static material = new
|
|
5933
|
+
static material = new R({ gl: {
|
|
5923
5934
|
vertex: "attribute vec2 position;\nin vec2 uv;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5924
5935
|
fragment: Xr
|
|
5925
5936
|
} });
|
|
@@ -5970,7 +5981,7 @@ var Xr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5970
5981
|
zoomedOut: this.dotColor ?? a.zoomedOut,
|
|
5971
5982
|
diff: this.dotZoomDiff ?? a.diff
|
|
5972
5983
|
};
|
|
5973
|
-
|
|
5984
|
+
z.draw(e, Zr.material, {
|
|
5974
5985
|
uTexture: 0,
|
|
5975
5986
|
inputSize: [t.width, t.height],
|
|
5976
5987
|
zoom: [n[0], n[4]],
|
|
@@ -5994,18 +6005,18 @@ var Xr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5994
6005
|
});
|
|
5995
6006
|
}
|
|
5996
6007
|
};
|
|
5997
|
-
|
|
6008
|
+
j([_({ fallback: !1 }), A("design:type", Boolean)], q.prototype, "checkerboard", void 0), j([_({ fallback: "grid" }), A("design:type", Object)], q.prototype, "checkerboardStyle", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], q.prototype, "pixelGrid", void 0), j([_(), A("design:type", Number)], q.prototype, "dotBaseColor", void 0), j([_(), A("design:type", Number)], q.prototype, "dotColor", void 0), j([_(), A("design:type", Number)], q.prototype, "dotZoomDiff", void 0), j([_(), A("design:type", String)], q.prototype, "watermark", void 0), j([_({ fallback: 100 }), A("design:type", Number)], q.prototype, "watermarkWidth", void 0), j([_({ fallback: .05 }), A("design:type", Number)], q.prototype, "watermarkAlpha", void 0), j([_({ fallback: .5236 }), A("design:type", Number)], q.prototype, "watermarkRotation", void 0), q = Zr = j([S("DrawboardEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
|
|
5998
6009
|
//#endregion
|
|
5999
6010
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
6000
|
-
var Qr, $r = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", ei = class extends
|
|
6011
|
+
var Qr, $r = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", ei = class extends G {
|
|
6001
6012
|
static {
|
|
6002
6013
|
Qr = this;
|
|
6003
6014
|
}
|
|
6004
|
-
static materialX = new
|
|
6015
|
+
static materialX = new R({ gl: {
|
|
6005
6016
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);\n vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);\n vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);\n vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);\n vUv[4] = uv + vec2(0.0 * uStrength, 0.0);\n vUv[5] = uv + vec2(1.0 * uStrength, 0.0);\n vUv[6] = uv + vec2(2.0 * uStrength, 0.0);\n vUv[7] = uv + vec2(3.0 * uStrength, 0.0);\n vUv[8] = uv + vec2(4.0 * uStrength, 0.0);\n}",
|
|
6006
6017
|
fragment: $r
|
|
6007
6018
|
} });
|
|
6008
|
-
static materialY = new
|
|
6019
|
+
static materialY = new R({ gl: {
|
|
6009
6020
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(0.0, -4.0 * uStrength);\n vUv[1] = uv + vec2(0.0, -3.0 * uStrength);\n vUv[2] = uv + vec2(0.0, -2.0 * uStrength);\n vUv[3] = uv + vec2(0.0, -1.0 * uStrength);\n vUv[4] = uv + vec2(0.0, 0.0 * uStrength);\n vUv[5] = uv + vec2(0.0, 1.0 * uStrength);\n vUv[6] = uv + vec2(0.0, 2.0 * uStrength);\n vUv[7] = uv + vec2(0.0, 3.0 * uStrength);\n vUv[8] = uv + vec2(0.0, 4.0 * uStrength);\n}",
|
|
6010
6021
|
fragment: $r
|
|
6011
6022
|
} });
|
|
@@ -6015,39 +6026,39 @@ var Qr, $r = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
|
|
|
6015
6026
|
apply(e, t) {
|
|
6016
6027
|
let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
|
|
6017
6028
|
for (let r = 0; r < i; r++) t.redraw(e, () => {
|
|
6018
|
-
|
|
6029
|
+
z.draw(e, Qr.materialX, {
|
|
6019
6030
|
sampler: 0,
|
|
6020
6031
|
uStrength: n * (this.strength / i)
|
|
6021
6032
|
});
|
|
6022
6033
|
});
|
|
6023
6034
|
for (let n = 0; n < i; n++) t.redraw(e, () => {
|
|
6024
|
-
|
|
6035
|
+
z.draw(e, Qr.materialY, {
|
|
6025
6036
|
sampler: 0,
|
|
6026
6037
|
uStrength: r * (this.strength / i)
|
|
6027
6038
|
});
|
|
6028
6039
|
});
|
|
6029
6040
|
}
|
|
6030
6041
|
};
|
|
6031
|
-
|
|
6042
|
+
j([_({ fallback: 4 }), A("design:type", Number)], ei.prototype, "strength", void 0), j([_({ fallback: 3 }), A("design:type", Number)], ei.prototype, "quality", void 0), ei = Qr = j([S("GaussianBlurEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ei);
|
|
6032
6043
|
//#endregion
|
|
6033
6044
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
6034
|
-
var ti, ni = class extends
|
|
6045
|
+
var ti, ni = class extends G {
|
|
6035
6046
|
static {
|
|
6036
6047
|
ti = this;
|
|
6037
6048
|
}
|
|
6038
|
-
static material = new
|
|
6049
|
+
static material = new R({ gl: {
|
|
6039
6050
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6040
6051
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float uAlpha;\nuniform vec3 uColor;\nuniform vec2 uOffset;\nuniform vec4 uInputSize;\n\nvoid main(void) {\n vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);\n sample.rgb = uColor.rgb * sample.a;\n sample *= uAlpha;\n gl_FragColor = sample;\n}"
|
|
6041
6052
|
} });
|
|
6042
6053
|
blurEffect = new ei();
|
|
6043
|
-
viewport3 = new
|
|
6044
|
-
_color = new
|
|
6054
|
+
viewport3 = new W();
|
|
6055
|
+
_color = new D();
|
|
6045
6056
|
constructor(e, t = []) {
|
|
6046
6057
|
super(), this.setProperties(e).append(t);
|
|
6047
6058
|
}
|
|
6048
6059
|
apply(e, t) {
|
|
6049
6060
|
this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
|
|
6050
|
-
this._color.value = this.color,
|
|
6061
|
+
this._color.value = this.color, z.draw(e, ti.material, {
|
|
6051
6062
|
sampler: 0,
|
|
6052
6063
|
uAlpha: this._color.a,
|
|
6053
6064
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -6060,18 +6071,18 @@ var ti, ni = class extends U {
|
|
|
6060
6071
|
]
|
|
6061
6072
|
});
|
|
6062
6073
|
}), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
|
|
6063
|
-
this.viewport3.texture.activate(e, 1),
|
|
6074
|
+
this.viewport3.texture.activate(e, 1), z.draw(e, er.instance, { sampler: 1 }), this.shadowOnly || z.draw(e, er.instance, { sampler: 0 }), e.texture.unbind(1);
|
|
6064
6075
|
});
|
|
6065
6076
|
}
|
|
6066
6077
|
};
|
|
6067
|
-
|
|
6078
|
+
j([_({ fallback: "#000000FF" }), A("design:type", Object)], ni.prototype, "color", void 0), j([_({ fallback: 4 }), A("design:type", Number)], ni.prototype, "blur", void 0), j([_({ fallback: 4 }), A("design:type", Number)], ni.prototype, "offsetX", void 0), j([_({ fallback: 4 }), A("design:type", Number)], ni.prototype, "offsetY", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], ni.prototype, "shadowOnly", void 0), ni = ti = j([S("DropShadowEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ni);
|
|
6068
6079
|
//#endregion
|
|
6069
6080
|
//#region src/scene/effects/EmbossEffect.ts
|
|
6070
|
-
var ri, ii = class extends
|
|
6081
|
+
var ri, ii = class extends G {
|
|
6071
6082
|
static {
|
|
6072
6083
|
ri = this;
|
|
6073
6084
|
}
|
|
6074
|
-
static material = new
|
|
6085
|
+
static material = new R({ gl: {
|
|
6075
6086
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6076
6087
|
fragment: "precision mediump float;\nuniform sampler2D sampler;\nuniform vec4 inputSize;\nuniform float strength;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 onePixel = inputSize.zw;\n vec4 color;\n color.rgb = vec3(0.5);\n color -= texture2D(sampler, vUv - onePixel) * strength;\n color += texture2D(sampler, vUv + onePixel) * strength;\n color.rgb = vec3((color.r + color.g + color.b) / 3.0);\n float alpha = texture2D(sampler, vUv).a;\n gl_FragColor = vec4(color.rgb * alpha, alpha);\n}"
|
|
6077
6088
|
} });
|
|
@@ -6080,7 +6091,7 @@ var ri, ii = class extends U {
|
|
|
6080
6091
|
}
|
|
6081
6092
|
apply(e, t) {
|
|
6082
6093
|
t.redraw(e, () => {
|
|
6083
|
-
|
|
6094
|
+
z.draw(e, ri.material, {
|
|
6084
6095
|
sampler: 0,
|
|
6085
6096
|
strength: this.strength,
|
|
6086
6097
|
inputSize: [
|
|
@@ -6093,14 +6104,14 @@ var ri, ii = class extends U {
|
|
|
6093
6104
|
});
|
|
6094
6105
|
}
|
|
6095
6106
|
};
|
|
6096
|
-
|
|
6107
|
+
j([_({ fallback: 5 }), A("design:type", Number)], ii.prototype, "strength", void 0), ii = ri = j([S("EmbossEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ii);
|
|
6097
6108
|
//#endregion
|
|
6098
6109
|
//#region src/scene/effects/GlitchEffect.ts
|
|
6099
|
-
var ai,
|
|
6110
|
+
var ai, J = class extends G {
|
|
6100
6111
|
static {
|
|
6101
6112
|
ai = this;
|
|
6102
6113
|
}
|
|
6103
|
-
static material = new
|
|
6114
|
+
static material = new R({ gl: {
|
|
6104
6115
|
vertex: "in vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6105
6116
|
fragment: "\nin vec2 vUv;\nuniform sampler2D sampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void) {\n vec2 coord = (vUv * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if (coord.x > filterClamp.z) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if (coord.x < filterClamp.x) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if (coord.y > filterClamp.w) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if (coord.y < filterClamp.y) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture(sampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture(sampler, coord).a;\n}"
|
|
6106
6117
|
} });
|
|
@@ -6113,7 +6124,7 @@ var ai, K = class extends U {
|
|
|
6113
6124
|
super(), this.setProperties(e).append(t);
|
|
6114
6125
|
let n = w(4, this.sampleSize);
|
|
6115
6126
|
if (!n) throw Error("GlitchEffect requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
6116
|
-
this._canvas = n, this._texture = new
|
|
6127
|
+
this._canvas = n, this._texture = new V(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
|
|
6117
6128
|
}
|
|
6118
6129
|
redraw() {
|
|
6119
6130
|
let e = this.sampleSize, t = this._texture, n = this._canvas.getContext("2d");
|
|
@@ -6130,7 +6141,7 @@ var ai, K = class extends U {
|
|
|
6130
6141
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
6131
6142
|
let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
|
|
6132
6143
|
t.redraw(e, () => {
|
|
6133
|
-
this._texture.activate(e, 1),
|
|
6144
|
+
this._texture.activate(e, 1), z.draw(e, ai.material, {
|
|
6134
6145
|
sampler: 0,
|
|
6135
6146
|
filterClamp: [
|
|
6136
6147
|
0,
|
|
@@ -6159,14 +6170,14 @@ var ai, K = class extends U {
|
|
|
6159
6170
|
});
|
|
6160
6171
|
}
|
|
6161
6172
|
};
|
|
6162
|
-
|
|
6173
|
+
j([_({ fallback: 10 }), A("design:type", Number)], J.prototype, "slices", void 0), j([_({ fallback: 512 }), A("design:type", Number)], J.prototype, "sampleSize", void 0), j([_({ fallback: 100 }), A("design:type", Number)], J.prototype, "offset", void 0), j([_({ fallback: 0 }), A("design:type", Number)], J.prototype, "direction", void 0), j([_({ fallback: 2 }), A("design:type", Number)], J.prototype, "fillMode", void 0), j([_({ fallback: 0 }), A("design:type", Number)], J.prototype, "seed", void 0), j([_({ default: () => [2, 2] }), A("design:type", Array)], J.prototype, "red", void 0), j([_({ default: () => [-10, 4] }), A("design:type", Array)], J.prototype, "green", void 0), j([_({ default: () => [10, -4] }), A("design:type", Array)], J.prototype, "blue", void 0), J = ai = j([S("GlitchEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
|
|
6163
6174
|
//#endregion
|
|
6164
6175
|
//#region src/scene/effects/GodrayEffect.ts
|
|
6165
|
-
var oi, si = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}",
|
|
6176
|
+
var oi, si = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", ci = class extends G {
|
|
6166
6177
|
static {
|
|
6167
6178
|
oi = this;
|
|
6168
6179
|
}
|
|
6169
|
-
static material = new
|
|
6180
|
+
static material = new R({ gl: {
|
|
6170
6181
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6171
6182
|
fragment: `precision highp float;
|
|
6172
6183
|
varying vec2 vUv;
|
|
@@ -6218,7 +6229,7 @@ void main(void) {
|
|
|
6218
6229
|
apply(e, t) {
|
|
6219
6230
|
let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
|
|
6220
6231
|
t.redraw(e, () => {
|
|
6221
|
-
|
|
6232
|
+
z.draw(e, oi.material, {
|
|
6222
6233
|
sampler: 0,
|
|
6223
6234
|
uDimensions: [t.width, t.height],
|
|
6224
6235
|
uParallel: +!!this.parallel,
|
|
@@ -6240,15 +6251,15 @@ void main(void) {
|
|
|
6240
6251
|
});
|
|
6241
6252
|
}
|
|
6242
6253
|
};
|
|
6243
|
-
|
|
6254
|
+
j([_({ fallback: 0 }), A("design:type", Number)], ci.prototype, "time", void 0), j([_({ fallback: 30 }), A("design:type", Number)], ci.prototype, "angle", void 0), j([_({ fallback: .5 }), A("design:type", Number)], ci.prototype, "gain", void 0), j([_({ fallback: 2.5 }), A("design:type", Number)], ci.prototype, "lacunarity", void 0), j([_({ fallback: !0 }), A("design:type", Boolean)], ci.prototype, "parallel", void 0), j([_({ default: () => [0, 0] }), A("design:type", Array)], ci.prototype, "center", void 0), j([_({ fallback: 1 }), A("design:type", Number)], ci.prototype, "alpha", void 0), ci = oi = j([S("GodrayEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ci);
|
|
6244
6255
|
//#endregion
|
|
6245
6256
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
6246
|
-
var
|
|
6257
|
+
var li = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", ui = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", di = class extends G {
|
|
6247
6258
|
_kernels = [0];
|
|
6248
6259
|
constructor(e, t = []) {
|
|
6249
|
-
super(), this.material = new
|
|
6260
|
+
super(), this.material = new R({ gl: {
|
|
6250
6261
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6251
|
-
fragment: e?.clamp ?
|
|
6262
|
+
fragment: e?.clamp ? ui : li
|
|
6252
6263
|
} }), this.setProperties(e).append(t), this._generateKernels();
|
|
6253
6264
|
}
|
|
6254
6265
|
_updateProperty(e, t, n) {
|
|
@@ -6272,7 +6283,7 @@ var ci = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6272
6283
|
this._kernels.forEach((i) => {
|
|
6273
6284
|
let a = i + .5;
|
|
6274
6285
|
t.redraw(e, () => {
|
|
6275
|
-
|
|
6286
|
+
z.draw(e, this.material, {
|
|
6276
6287
|
sampler: 0,
|
|
6277
6288
|
uOffset: [a * n, a * r],
|
|
6278
6289
|
uInputClamp: [
|
|
@@ -6286,14 +6297,14 @@ var ci = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6286
6297
|
});
|
|
6287
6298
|
}
|
|
6288
6299
|
};
|
|
6289
|
-
|
|
6300
|
+
j([_({ fallback: 4 }), A("design:type", Number)], di.prototype, "strength", void 0), j([_({ fallback: 3 }), A("design:type", Number)], di.prototype, "quality", void 0), j([_({ default: () => [1, 1] }), A("design:type", Array)], di.prototype, "pixelSize", void 0), di = j([S("KawaseBlurEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], di);
|
|
6290
6301
|
//#endregion
|
|
6291
6302
|
//#region src/scene/effects/MaskEffect.ts
|
|
6292
|
-
var
|
|
6303
|
+
var fi, pi = class extends G {
|
|
6293
6304
|
static {
|
|
6294
|
-
|
|
6305
|
+
fi = this;
|
|
6295
6306
|
}
|
|
6296
|
-
static material = new
|
|
6307
|
+
static material = new R({ gl: {
|
|
6297
6308
|
vertex: "attribute vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6298
6309
|
fragment: "in vec2 vUv;\n\nuniform sampler2D sampler;\nuniform sampler2D mask;\nuniform float rotation;\n\nvec2 rotateUV(vec2 uv, float angle) {\n uv -= 0.5;\n float cosAngle = cos(angle);\n float sinAngle = sin(angle);\n mat2 rotationMatrix = mat2(\n cosAngle, -sinAngle,\n sinAngle, cosAngle\n );\n uv = rotationMatrix * uv;\n uv += 0.5;\n return uv;\n}\n\nvoid main(void) {\n vec4 color = texture(sampler, vUv);\n vec4 maskColor = texture(mask, rotateUV(vUv, rotation));\n gl_FragColor = mix(vec4(0.), color, maskColor.a);\n}"
|
|
6299
6310
|
} });
|
|
@@ -6313,7 +6324,7 @@ var di, fi = class extends U {
|
|
|
6313
6324
|
}
|
|
6314
6325
|
apply(e, t, n) {
|
|
6315
6326
|
this.texture && t.redraw(e, () => {
|
|
6316
|
-
this.texture.activate(e, 1),
|
|
6327
|
+
this.texture.activate(e, 1), z.draw(e, fi.material, {
|
|
6317
6328
|
sampler: 0,
|
|
6318
6329
|
mask: 1,
|
|
6319
6330
|
rotation: n.target?.globalRotation ?? 0
|
|
@@ -6321,33 +6332,33 @@ var di, fi = class extends U {
|
|
|
6321
6332
|
});
|
|
6322
6333
|
}
|
|
6323
6334
|
};
|
|
6324
|
-
|
|
6335
|
+
j([_({ fallback: "" }), A("design:type", String)], pi.prototype, "image", void 0), pi = fi = j([S("MaskEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], pi);
|
|
6325
6336
|
//#endregion
|
|
6326
6337
|
//#region src/scene/effects/OutlineEffect.ts
|
|
6327
|
-
var
|
|
6338
|
+
var mi, hi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", gi = class extends G {
|
|
6328
6339
|
static {
|
|
6329
|
-
|
|
6340
|
+
mi = this;
|
|
6330
6341
|
}
|
|
6331
6342
|
static MIN_SAMPLES = 1;
|
|
6332
6343
|
static MAX_SAMPLES = 100;
|
|
6333
6344
|
static getAngleStep(e) {
|
|
6334
|
-
return Number.parseFloat((Math.PI * 2 / Math.max(e *
|
|
6345
|
+
return Number.parseFloat((Math.PI * 2 / Math.max(e * mi.MAX_SAMPLES, mi.MIN_SAMPLES)).toFixed(7));
|
|
6335
6346
|
}
|
|
6336
|
-
_color = new
|
|
6347
|
+
_color = new D();
|
|
6337
6348
|
constructor(e, t = []) {
|
|
6338
|
-
super(), this.setProperties(e).append(t), this.material = new
|
|
6349
|
+
super(), this.setProperties(e).append(t), this.material = new R({ gl: {
|
|
6339
6350
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6340
|
-
fragment:
|
|
6351
|
+
fragment: hi.replace(/\{ANGLE_STEP\}/, mi.getAngleStep(this.quality).toFixed(7))
|
|
6341
6352
|
} });
|
|
6342
6353
|
}
|
|
6343
6354
|
apply(e, t) {
|
|
6344
6355
|
t.redraw(e, () => {
|
|
6345
|
-
this._color.value = this.color,
|
|
6356
|
+
this._color.value = this.color, z.draw(e, this.material, {
|
|
6346
6357
|
sampler: 0,
|
|
6347
6358
|
uThickness: [this.width / t.width, this.width / t.height],
|
|
6348
6359
|
uColor: this._color.toArray().slice(0, 3),
|
|
6349
6360
|
uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
|
|
6350
|
-
uAngleStep:
|
|
6361
|
+
uAngleStep: mi.getAngleStep(this.quality),
|
|
6351
6362
|
uKnockout: +!!this.knockout,
|
|
6352
6363
|
uInputClamp: [
|
|
6353
6364
|
0,
|
|
@@ -6359,14 +6370,14 @@ var pi, mi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6359
6370
|
});
|
|
6360
6371
|
}
|
|
6361
6372
|
};
|
|
6362
|
-
|
|
6373
|
+
j([_({ fallback: "#000000ff" }), A("design:type", Object)], gi.prototype, "color", void 0), j([_({ fallback: 1 }), A("design:type", Number)], gi.prototype, "width", void 0), j([_({ fallback: "solid" }), A("design:type", String)], gi.prototype, "style", void 0), j([_(), A("design:type", Object)], gi.prototype, "image", void 0), j([_({ fallback: 1 }), A("design:type", Number)], gi.prototype, "opacity", void 0), j([_({ fallback: .1 }), A("design:type", Number)], gi.prototype, "quality", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], gi.prototype, "knockout", void 0), gi = mi = j([S("OutlineEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], gi);
|
|
6363
6374
|
//#endregion
|
|
6364
6375
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6365
|
-
var
|
|
6376
|
+
var _i, vi = class extends G {
|
|
6366
6377
|
static {
|
|
6367
|
-
|
|
6378
|
+
_i = this;
|
|
6368
6379
|
}
|
|
6369
|
-
static material = new
|
|
6380
|
+
static material = new R({ gl: {
|
|
6370
6381
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6371
6382
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform vec2 step;\n\nvoid main(void) {\n vec2 uv = vUv;\n uv = floor((uv - offset) / step) * step + offset + step / 2.0;\n gl_FragColor = texture2D(sampler, uv);\n}"
|
|
6372
6383
|
} });
|
|
@@ -6380,18 +6391,18 @@ var hi, gi = class extends U {
|
|
|
6380
6391
|
offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
|
|
6381
6392
|
step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
|
|
6382
6393
|
};
|
|
6383
|
-
|
|
6394
|
+
z.draw(e, _i.material, a);
|
|
6384
6395
|
});
|
|
6385
6396
|
}
|
|
6386
6397
|
};
|
|
6387
|
-
|
|
6398
|
+
j([_({ fallback: 10 }), A("design:type", Number)], vi.prototype, "strength", void 0), vi = _i = j([S("PixelateEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], vi);
|
|
6388
6399
|
//#endregion
|
|
6389
6400
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6390
|
-
var
|
|
6401
|
+
var yi, bi = class extends G {
|
|
6391
6402
|
static {
|
|
6392
|
-
|
|
6403
|
+
yi = this;
|
|
6393
6404
|
}
|
|
6394
|
-
static material = new
|
|
6405
|
+
static material = new R({ gl: {
|
|
6395
6406
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6396
6407
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec4 uInputSize;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n float minGradient = uInnerRadius * 0.3;\n float innerRadius1 = (uInnerRadius + minGradient * 0.5) / uInputSize.x;\n\n float gradient = uRadius * 0.3;\n float radius1 = (uRadius - gradient * 0.5) / uInputSize.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / uInputSize.xy - vUv);\n float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x));\n\n float strength1 = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius1) {\n delta = innerRadius1 - dist;\n gap = minGradient;\n } else if (radius1 >= 0.0 && dist > radius1) { // radius1 < 0 means it's infinity\n delta = dist - radius1;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / uInputSize.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength1 *= delta;\n if (countLimit < 1.0) {\n gl_FragColor = texture2D(sampler, vUv);\n return;\n }\n }\n\n float offset = rand(vUv, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength1;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vUv + dir * percent;\n color += texture2D(sampler, p) * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n\n gl_FragColor = color;\n}"
|
|
6397
6408
|
} });
|
|
@@ -6400,7 +6411,7 @@ var _i, vi = class extends U {
|
|
|
6400
6411
|
}
|
|
6401
6412
|
apply(e, t) {
|
|
6402
6413
|
t.redraw(e, () => {
|
|
6403
|
-
|
|
6414
|
+
z.draw(e, yi.material, {
|
|
6404
6415
|
sampler: 0,
|
|
6405
6416
|
uCenter: [t.width / 2, t.height / 2],
|
|
6406
6417
|
uInnerRadius: this.innerRadius,
|
|
@@ -6416,19 +6427,10 @@ var _i, vi = class extends U {
|
|
|
6416
6427
|
});
|
|
6417
6428
|
}
|
|
6418
6429
|
};
|
|
6419
|
-
|
|
6420
|
-
//#endregion
|
|
6421
|
-
//#region src/scene/2d/element/imagePipeline.ts
|
|
6422
|
-
var yi;
|
|
6423
|
-
function bi(e) {
|
|
6424
|
-
yi = e;
|
|
6425
|
-
}
|
|
6426
|
-
function xi() {
|
|
6427
|
-
return yi;
|
|
6428
|
-
}
|
|
6430
|
+
j([_(), A("design:type", Array)], bi.prototype, "center", void 0), j([_({ fallback: 20 }), A("design:type", Number)], bi.prototype, "innerRadius", void 0), j([_({ fallback: -1 }), A("design:type", Number)], bi.prototype, "radius", void 0), j([_({ fallback: .1 }), A("design:type", Number)], bi.prototype, "strength", void 0), bi = yi = j([S("ZoomBlurEffect"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], bi);
|
|
6429
6431
|
//#endregion
|
|
6430
6432
|
//#region src/scene/2d/element/utils.ts
|
|
6431
|
-
function
|
|
6433
|
+
function xi(e, t) {
|
|
6432
6434
|
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new b().translate(-n, -r).scale(1 / i, 1 / a);
|
|
6433
6435
|
if (e.cropRect) {
|
|
6434
6436
|
let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
|
|
@@ -6478,7 +6480,7 @@ var Y = class extends T {
|
|
|
6478
6480
|
case "image":
|
|
6479
6481
|
case "linearGradient":
|
|
6480
6482
|
case "radialGradient":
|
|
6481
|
-
case "
|
|
6483
|
+
case "imagePipelines":
|
|
6482
6484
|
this._updateTexture();
|
|
6483
6485
|
break;
|
|
6484
6486
|
}
|
|
@@ -6491,26 +6493,26 @@ var Y = class extends T {
|
|
|
6491
6493
|
let n = await $.fetch(t).then((e) => e.blob());
|
|
6492
6494
|
return e ||= n.type.startsWith("image/gif") ?? !1, e ? await $.gif.load(n) : await $.texture.load(n);
|
|
6493
6495
|
});
|
|
6494
|
-
e ? this.animatedTexture = n : (this.texture
|
|
6496
|
+
e ? this.animatedTexture = n : this.imagePipelines?.length && this._parent.tree?.imagePipelineResolver ? (this.texture ||= n, await this._applyImagePipelines(t)) : this.texture = n;
|
|
6495
6497
|
}
|
|
6496
6498
|
}
|
|
6497
|
-
async
|
|
6498
|
-
let t = this.
|
|
6499
|
+
async _applyImagePipelines(e) {
|
|
6500
|
+
let t = this.imagePipelines, n = this._parent.tree?.imagePipelineResolver;
|
|
6499
6501
|
if (!t?.length || !n) return;
|
|
6500
|
-
let r = await $.loadBy(`${e}#mc-pipeline:${this.
|
|
6502
|
+
let r = await $.loadBy(`${e}#mc-image-pipeline:${this._imagePipelineKey(t)}`, async () => {
|
|
6501
6503
|
let r = await this._decodePipelineSource(e);
|
|
6502
6504
|
if (!r) return;
|
|
6503
6505
|
let i = await n(t, r);
|
|
6504
6506
|
if (i) return this._pipelineImageToCanvas(i);
|
|
6505
6507
|
});
|
|
6506
|
-
r && (this.texture = new
|
|
6508
|
+
r && (this.texture = new V({
|
|
6507
6509
|
source: r,
|
|
6508
6510
|
width: r.width,
|
|
6509
6511
|
height: r.height,
|
|
6510
6512
|
uploadMethodId: "image"
|
|
6511
6513
|
}));
|
|
6512
6514
|
}
|
|
6513
|
-
|
|
6515
|
+
_imagePipelineKey(e) {
|
|
6514
6516
|
return e.map((e) => `${e.name}:${e.params ? JSON.stringify(e.params) : ""}`).join("|");
|
|
6515
6517
|
}
|
|
6516
6518
|
async _decodePipelineSource(e) {
|
|
@@ -6543,7 +6545,7 @@ var Y = class extends T {
|
|
|
6543
6545
|
let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
|
|
6544
6546
|
r = {
|
|
6545
6547
|
...r,
|
|
6546
|
-
...
|
|
6548
|
+
...xi(this, this.tile && i ? {
|
|
6547
6549
|
x: 0,
|
|
6548
6550
|
y: 0,
|
|
6549
6551
|
width: i.sourceWidth,
|
|
@@ -6579,10 +6581,10 @@ var Y = class extends T {
|
|
|
6579
6581
|
this.updateFrameIndex();
|
|
6580
6582
|
}
|
|
6581
6583
|
};
|
|
6582
|
-
|
|
6584
|
+
j([_({ fallback: !0 }), A("design:type", Boolean)], Y.prototype, "enabled", void 0), j([_(), A("design:type", Object)], Y.prototype, "color", void 0), j([_(), A("design:type", Object)], Y.prototype, "image", void 0), j([_(), A("design:type", Object)], Y.prototype, "linearGradient", void 0), j([_(), A("design:type", Object)], Y.prototype, "radialGradient", void 0), j([_(), A("design:type", Object)], Y.prototype, "cropRect", void 0), j([_(), A("design:type", Object)], Y.prototype, "stretchRect", void 0), j([_(), A("design:type", Object)], Y.prototype, "dpi", void 0), j([_(), A("design:type", Object)], Y.prototype, "rotateWithShape", void 0), j([_(), A("design:type", Object)], Y.prototype, "tile", void 0), j([_(), A("design:type", Object)], Y.prototype, "opacity", void 0), j([_(), A("design:type", Object)], Y.prototype, "imagePipelines", void 0);
|
|
6583
6585
|
//#endregion
|
|
6584
6586
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6585
|
-
var
|
|
6587
|
+
var Si = class extends Y {
|
|
6586
6588
|
setProperties(e) {
|
|
6587
6589
|
return super._setProperties(d(e) ? void 0 : f(e));
|
|
6588
6590
|
}
|
|
@@ -6594,14 +6596,14 @@ var Ci = class extends Y {
|
|
|
6594
6596
|
}
|
|
6595
6597
|
}
|
|
6596
6598
|
};
|
|
6597
|
-
|
|
6599
|
+
j([_(), A("design:type", Object)], Si.prototype, "fillWithShape", void 0);
|
|
6598
6600
|
//#endregion
|
|
6599
6601
|
//#region src/scene/2d/element/Element2DChart.ts
|
|
6600
|
-
var
|
|
6601
|
-
function
|
|
6602
|
-
return
|
|
6602
|
+
var Ci;
|
|
6603
|
+
function wi() {
|
|
6604
|
+
return Ci ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), Ci;
|
|
6603
6605
|
}
|
|
6604
|
-
function
|
|
6606
|
+
function Ti(e) {
|
|
6605
6607
|
if (!e) return { show: !1 };
|
|
6606
6608
|
switch (e) {
|
|
6607
6609
|
case "bottom": return {
|
|
@@ -6667,7 +6669,7 @@ var X = class extends T {
|
|
|
6667
6669
|
this._teardown(), this._parent.requestDraw();
|
|
6668
6670
|
return;
|
|
6669
6671
|
}
|
|
6670
|
-
let n = await
|
|
6672
|
+
let n = await wi();
|
|
6671
6673
|
if (!n) {
|
|
6672
6674
|
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)"), this._renderPlaceholder(e, t);
|
|
6673
6675
|
return;
|
|
@@ -6726,7 +6728,7 @@ var X = class extends T {
|
|
|
6726
6728
|
text: this.title,
|
|
6727
6729
|
left: "center"
|
|
6728
6730
|
} : void 0,
|
|
6729
|
-
legend:
|
|
6731
|
+
legend: Ti(this.legend),
|
|
6730
6732
|
tooltip: {}
|
|
6731
6733
|
};
|
|
6732
6734
|
if (n) {
|
|
@@ -6770,10 +6772,10 @@ var X = class extends T {
|
|
|
6770
6772
|
this._teardown();
|
|
6771
6773
|
}
|
|
6772
6774
|
};
|
|
6773
|
-
|
|
6775
|
+
j([_({ fallback: !0 }), A("design:type", Boolean)], X.prototype, "enabled", void 0), j([_({ fallback: "column" }), A("design:type", Object)], X.prototype, "type", void 0), j([_(), A("design:type", Object)], X.prototype, "grouping", void 0), j([_({ fallback: () => [] }), A("design:type", Object)], X.prototype, "categories", void 0), j([_({ fallback: () => [] }), A("design:type", Object)], X.prototype, "series", void 0), j([_(), A("design:type", Object)], X.prototype, "title", void 0), j([_(), A("design:type", Object)], X.prototype, "legend", void 0), j([_(), A("design:type", Object)], X.prototype, "categoryAxis", void 0), j([_(), A("design:type", Object)], X.prototype, "valueAxis", void 0);
|
|
6774
6776
|
//#endregion
|
|
6775
6777
|
//#region src/scene/2d/element/Element2DComments.ts
|
|
6776
|
-
var
|
|
6778
|
+
var Ei = class extends T {
|
|
6777
6779
|
parent;
|
|
6778
6780
|
constructor(e) {
|
|
6779
6781
|
super(), this.parent = e;
|
|
@@ -6807,7 +6809,7 @@ var Di = class extends T {
|
|
|
6807
6809
|
isValid() {
|
|
6808
6810
|
return Object.values(this._properties).some(Boolean);
|
|
6809
6811
|
}
|
|
6810
|
-
},
|
|
6812
|
+
}, Di = class extends T {
|
|
6811
6813
|
_parent;
|
|
6812
6814
|
_routeSig;
|
|
6813
6815
|
_routePath;
|
|
@@ -6855,7 +6857,7 @@ var Di = class extends T {
|
|
|
6855
6857
|
y: Math.sin(n.ang)
|
|
6856
6858
|
}, {
|
|
6857
6859
|
point: e,
|
|
6858
|
-
dir:
|
|
6860
|
+
dir: Oi(i, t.globalRotation),
|
|
6859
6861
|
bbox: r
|
|
6860
6862
|
};
|
|
6861
6863
|
}
|
|
@@ -6881,8 +6883,8 @@ var Di = class extends T {
|
|
|
6881
6883
|
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Ar(this.mode, e ?? t, t ?? e)), this._routePath;
|
|
6882
6884
|
}
|
|
6883
6885
|
};
|
|
6884
|
-
|
|
6885
|
-
function
|
|
6886
|
+
j([_(), A("design:type", Object)], Di.prototype, "start", void 0), j([_(), A("design:type", Object)], Di.prototype, "end", void 0), j([_({ fallback: "straight" }), A("design:type", Object)], Di.prototype, "mode", void 0), j([_({ fallback: .5 }), A("design:type", Number)], Di.prototype, "labelPosition", void 0);
|
|
6887
|
+
function Oi(e, t) {
|
|
6886
6888
|
if (!t) return e;
|
|
6887
6889
|
let n = Math.cos(t), r = Math.sin(t);
|
|
6888
6890
|
return {
|
|
@@ -6892,7 +6894,7 @@ function ki(e, t) {
|
|
|
6892
6894
|
}
|
|
6893
6895
|
//#endregion
|
|
6894
6896
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6895
|
-
var
|
|
6897
|
+
var ki = class extends Y {
|
|
6896
6898
|
setProperties(e) {
|
|
6897
6899
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
6898
6900
|
}
|
|
@@ -6900,14 +6902,14 @@ var Ai = class extends Y {
|
|
|
6900
6902
|
super._updateProperty(e, t, n), e === "fillWithShape" && this._parent.requestDraw();
|
|
6901
6903
|
}
|
|
6902
6904
|
};
|
|
6903
|
-
|
|
6905
|
+
j([_(), A("design:type", Object)], ki.prototype, "fillWithShape", void 0);
|
|
6904
6906
|
//#endregion
|
|
6905
6907
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6906
|
-
var
|
|
6908
|
+
var Ai = {
|
|
6907
6909
|
sm: 4,
|
|
6908
6910
|
md: 6,
|
|
6909
6911
|
lg: 8
|
|
6910
|
-
},
|
|
6912
|
+
}, ji = class extends Y {
|
|
6911
6913
|
setProperties(e) {
|
|
6912
6914
|
return super._setProperties(d(e) ? void 0 : te(e));
|
|
6913
6915
|
}
|
|
@@ -6929,7 +6931,7 @@ var ji = {
|
|
|
6929
6931
|
}
|
|
6930
6932
|
draw() {
|
|
6931
6933
|
let { width: e, height: t } = this._parent.size, n = this._parent.context;
|
|
6932
|
-
this.image === "viewport" ? n.strokeStyle = new lr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...
|
|
6934
|
+
this.image === "viewport" ? n.strokeStyle = new lr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...xi(this, {
|
|
6933
6935
|
x: 0,
|
|
6934
6936
|
y: 0,
|
|
6935
6937
|
width: e,
|
|
@@ -6952,14 +6954,14 @@ var ji = {
|
|
|
6952
6954
|
_fillEnd(e, t, n, r, i) {
|
|
6953
6955
|
let a = e.x - t.x, o = e.y - t.y, s = Math.hypot(a, o);
|
|
6954
6956
|
if (s < .001) return;
|
|
6955
|
-
let c =
|
|
6957
|
+
let c = Ai[String(n.width ?? n.height ?? "md")] ?? 6, l = r * c, u = r * c * .5, d = a / s, f = o / s, p = e.x - d * l, m = e.y - f * l, h = -f * u, g = d * u, ee = this._parent.context;
|
|
6956
6958
|
ee.fillStyle = i, ee.moveTo(e.x, e.y).lineTo(p + h, m + g).lineTo(p - h, m - g).closePath().fill();
|
|
6957
6959
|
}
|
|
6958
6960
|
};
|
|
6959
|
-
|
|
6961
|
+
j([_(), A("design:type", Object)], ji.prototype, "color", void 0), j([_(), A("design:type", Object)], ji.prototype, "width", void 0), j([_({ fallback: "solid" }), A("design:type", Object)], ji.prototype, "style", void 0), j([_({ fallback: "butt" }), A("design:type", Object)], ji.prototype, "lineCap", void 0), j([_({ fallback: "miter" }), A("design:type", Object)], ji.prototype, "lineJoin", void 0), j([_(), A("design:type", Object)], ji.prototype, "headEnd", void 0), j([_(), A("design:type", Object)], ji.prototype, "tailEnd", void 0);
|
|
6960
6962
|
//#endregion
|
|
6961
6963
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
6962
|
-
var
|
|
6964
|
+
var Mi = class extends T {
|
|
6963
6965
|
_parent;
|
|
6964
6966
|
constructor(e) {
|
|
6965
6967
|
super(), this._parent = e;
|
|
@@ -6983,10 +6985,10 @@ var Ni = class extends T {
|
|
|
6983
6985
|
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new ni({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
6984
6986
|
}
|
|
6985
6987
|
};
|
|
6986
|
-
|
|
6988
|
+
j([_({ fallback: !0 }), A("design:type", Boolean)], Mi.prototype, "enabled", void 0), j([_({ fallback: "#000000FF" }), A("design:type", Object)], Mi.prototype, "color", void 0), j([_({ fallback: 0 }), A("design:type", Object)], Mi.prototype, "blur", void 0), j([_({ fallback: 0 }), A("design:type", Object)], Mi.prototype, "offsetY", void 0), j([_({ fallback: 0 }), A("design:type", Object)], Mi.prototype, "offsetX", void 0);
|
|
6987
6989
|
//#endregion
|
|
6988
6990
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
6989
|
-
var
|
|
6991
|
+
var Ni = class extends T {
|
|
6990
6992
|
_parent;
|
|
6991
6993
|
_path2DSet = new ue();
|
|
6992
6994
|
_localPath;
|
|
@@ -7084,24 +7086,24 @@ var Pi = class extends T {
|
|
|
7084
7086
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
7085
7087
|
}
|
|
7086
7088
|
};
|
|
7087
|
-
|
|
7089
|
+
j([_({ fallback: !0 }), A("design:type", Boolean)], Ni.prototype, "enabled", void 0), j([_(), A("design:type", Object)], Ni.prototype, "preset", void 0), j([_(), A("design:type", Object)], Ni.prototype, "svg", void 0), j([_(), A("design:type", Object)], Ni.prototype, "viewBox", void 0), j([_(), A("design:type", Object)], Ni.prototype, "paths", void 0), j([_(), A("design:type", Object)], Ni.prototype, "connectionPoints", void 0);
|
|
7088
7090
|
//#endregion
|
|
7089
7091
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
7090
|
-
var
|
|
7092
|
+
var Pi = class extends E {
|
|
7091
7093
|
constructor(e) {
|
|
7092
7094
|
super(), this.setProperties(e);
|
|
7093
7095
|
}
|
|
7094
|
-
},
|
|
7096
|
+
}, Fi = {
|
|
7095
7097
|
...o(),
|
|
7096
7098
|
left: 0,
|
|
7097
7099
|
top: 0,
|
|
7098
7100
|
width: 0,
|
|
7099
7101
|
height: 0
|
|
7100
7102
|
};
|
|
7101
|
-
for (let e in
|
|
7103
|
+
for (let e in Fi) i(Pi, e, { fallback: Fi[e] });
|
|
7102
7104
|
//#endregion
|
|
7103
7105
|
//#region src/scene/2d/element/Element2DTable.ts
|
|
7104
|
-
var
|
|
7106
|
+
var Ii = 100, Li = 40, Ri = class extends T {
|
|
7105
7107
|
_parent;
|
|
7106
7108
|
_cellNodes = /* @__PURE__ */ new Map();
|
|
7107
7109
|
_cellSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -7132,10 +7134,10 @@ var Li = 100, Ri = 40, zi = class extends T {
|
|
|
7132
7134
|
return !!(this.enabled && this.cells.length);
|
|
7133
7135
|
}
|
|
7134
7136
|
get gridWidth() {
|
|
7135
|
-
return this.columns.reduce((e, t) => e + (t.width ||
|
|
7137
|
+
return this.columns.reduce((e, t) => e + (t.width || Ii), 0);
|
|
7136
7138
|
}
|
|
7137
7139
|
get gridHeight() {
|
|
7138
|
-
return this.rows.reduce((e, t) => e + (t.height ||
|
|
7140
|
+
return this.rows.reduce((e, t) => e + (t.height || Li), 0);
|
|
7139
7141
|
}
|
|
7140
7142
|
update() {
|
|
7141
7143
|
if (this._dirty = !1, !this.isValid()) {
|
|
@@ -7145,9 +7147,9 @@ var Li = 100, Ri = 40, zi = class extends T {
|
|
|
7145
7147
|
let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
|
|
7146
7148
|
for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
|
|
7147
7149
|
let a = [0];
|
|
7148
|
-
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width ||
|
|
7150
|
+
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || Ii));
|
|
7149
7151
|
let o = [0];
|
|
7150
|
-
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height ||
|
|
7152
|
+
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || Li));
|
|
7151
7153
|
this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
|
|
7152
7154
|
let s = /* @__PURE__ */ new Set();
|
|
7153
7155
|
for (let e of n) {
|
|
@@ -7161,7 +7163,7 @@ var Li = 100, Ri = 40, zi = class extends T {
|
|
|
7161
7163
|
}, r = `${JSON.stringify(e)}|${n.left},${n.top},${n.width},${n.height}`;
|
|
7162
7164
|
if (this._cellNodes.has(t) && this._cellSnapshots.get(t) === r) continue;
|
|
7163
7165
|
let i = this._cellNodes.get(t);
|
|
7164
|
-
i || (i =
|
|
7166
|
+
i || (i = H.parse({ is: "Element2D" }, "Element2D"), this._parent.appendChild(i, "back"), this._cellNodes.set(t, i)), this._applyCell(i, e, n), this._cellSnapshots.set(t, r);
|
|
7165
7167
|
}
|
|
7166
7168
|
for (let [e, t] of this._cellNodes) s.has(e) || (this._parent.removeChild(t), t.destroy(), this._cellNodes.delete(e), this._cellSnapshots.delete(e));
|
|
7167
7169
|
this._parent.requestDraw();
|
|
@@ -7173,7 +7175,7 @@ var Li = 100, Ri = 40, zi = class extends T {
|
|
|
7173
7175
|
}, e.background = t.background;
|
|
7174
7176
|
for (let t of [...e.getChildren(!0)]) e.removeChild(t), t.destroy();
|
|
7175
7177
|
t.children?.forEach((t) => {
|
|
7176
|
-
e.appendChild(
|
|
7178
|
+
e.appendChild(H.parse(t, "Element2D"));
|
|
7177
7179
|
});
|
|
7178
7180
|
}
|
|
7179
7181
|
_clearCells() {
|
|
@@ -7184,7 +7186,7 @@ var Li = 100, Ri = 40, zi = class extends T {
|
|
|
7184
7186
|
this._clearCells();
|
|
7185
7187
|
}
|
|
7186
7188
|
};
|
|
7187
|
-
|
|
7189
|
+
j([_({ fallback: !0 }), A("design:type", Boolean)], Ri.prototype, "enabled", void 0), j([_({ fallback: () => [] }), A("design:type", Object)], Ri.prototype, "columns", void 0), j([_({ fallback: () => [] }), A("design:type", Object)], Ri.prototype, "rows", void 0), j([_({ fallback: () => [] }), A("design:type", Object)], Ri.prototype, "cells", void 0);
|
|
7188
7190
|
//#endregion
|
|
7189
7191
|
//#region src/scene/2d/element/Element2DText.ts
|
|
7190
7192
|
var Z = class extends T {
|
|
@@ -7201,7 +7203,7 @@ var Z = class extends T {
|
|
|
7201
7203
|
_texture = new rr({ mipmap: !0 });
|
|
7202
7204
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7203
7205
|
constructor(e) {
|
|
7204
|
-
super(), this._parent = e, this.base = new _e(), this.base.setPropertyAccessor(this);
|
|
7206
|
+
super(), this._parent = e, this.base = Dt(new _e()), this.base.setPropertyAccessor(this);
|
|
7205
7207
|
}
|
|
7206
7208
|
setProperties(e) {
|
|
7207
7209
|
return super.setProperties(d(e) ? void 0 : ae(e));
|
|
@@ -7299,7 +7301,7 @@ var Z = class extends T {
|
|
|
7299
7301
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
7300
7302
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
7301
7303
|
r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? r.color, e.fill({
|
|
7302
|
-
...
|
|
7304
|
+
...xi(r, o?.box ?? {
|
|
7303
7305
|
x: 0,
|
|
7304
7306
|
y: 0,
|
|
7305
7307
|
width: this._parent.size.width,
|
|
@@ -7311,7 +7313,7 @@ var Z = class extends T {
|
|
|
7311
7313
|
if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
|
|
7312
7314
|
let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
|
|
7313
7315
|
r.enabled !== !1 && (o || r.color) && (r.width === void 0 || r.width) && (e.addPath(n), e.style = { ...n.style }, e.lineWidth = r.width || 1, e.strokeStyle = o?.texture ?? r.color, e.lineCap = r.lineCap, e.lineJoin = r.lineJoin, e.stroke({
|
|
7314
|
-
...
|
|
7316
|
+
...xi(r, o?.box ?? {
|
|
7315
7317
|
x: 0,
|
|
7316
7318
|
y: 0,
|
|
7317
7319
|
width: this._parent.size.width,
|
|
@@ -7341,7 +7343,7 @@ var Z = class extends T {
|
|
|
7341
7343
|
}
|
|
7342
7344
|
process(e) {}
|
|
7343
7345
|
};
|
|
7344
|
-
|
|
7346
|
+
j([_({ fallback: !0 }), A("design:type", Object)], Z.prototype, "enabled", void 0), j([_({ fallback: () => [] }), A("design:type", Object)], Z.prototype, "content", void 0), j([_({ alias: "_parent.style.json" }), A("design:type", Object)], Z.prototype, "style", void 0), j([_(), A("design:type", Object)], Z.prototype, "effects", void 0), j([_(), A("design:type", Object)], Z.prototype, "fill", void 0), j([_(), A("design:type", Object)], Z.prototype, "outline", void 0), j([_(), A("design:type", Object)], Z.prototype, "deformation", void 0), j([_({ alias: "base.measureDom" }), A("design:type", typeof HTMLElement > "u" ? Object : HTMLElement)], Z.prototype, "measureDom", void 0), j([_({ alias: "base.fonts" }), A("design:type", Object)], Z.prototype, "fonts", void 0), j([_({ fallback: "auto" }), A("design:type", Object)], Z.prototype, "drawMode", void 0);
|
|
7345
7347
|
//#endregion
|
|
7346
7348
|
//#region src/scene/2d/element/Flexbox.ts
|
|
7347
7349
|
var Q = {
|
|
@@ -7354,11 +7356,11 @@ var Q = {
|
|
|
7354
7356
|
horizontal: 6,
|
|
7355
7357
|
vertical: 7,
|
|
7356
7358
|
all: 8
|
|
7357
|
-
},
|
|
7359
|
+
}, zi = {
|
|
7358
7360
|
column: 0,
|
|
7359
7361
|
row: 1,
|
|
7360
7362
|
all: 2
|
|
7361
|
-
},
|
|
7363
|
+
}, Bi = {
|
|
7362
7364
|
auto: 0,
|
|
7363
7365
|
"flex-start": 1,
|
|
7364
7366
|
center: 2,
|
|
@@ -7368,74 +7370,74 @@ var Q = {
|
|
|
7368
7370
|
"space-between": 6,
|
|
7369
7371
|
"space-around": 7,
|
|
7370
7372
|
"space-evenly": 8
|
|
7371
|
-
},
|
|
7373
|
+
}, Vi = {
|
|
7372
7374
|
flex: 0,
|
|
7373
7375
|
none: 1,
|
|
7374
7376
|
contents: 2
|
|
7375
|
-
},
|
|
7377
|
+
}, Hi = {
|
|
7376
7378
|
inherit: 0,
|
|
7377
7379
|
ltr: 1,
|
|
7378
7380
|
rtl: 2
|
|
7379
|
-
},
|
|
7381
|
+
}, Ui = {
|
|
7380
7382
|
column: 0,
|
|
7381
7383
|
"column-reverse": 1,
|
|
7382
7384
|
row: 2,
|
|
7383
7385
|
"row-reverse": 3
|
|
7384
|
-
},
|
|
7386
|
+
}, Wi = {
|
|
7385
7387
|
"no-wrap": 0,
|
|
7386
7388
|
wrap: 1,
|
|
7387
7389
|
"Wrap-reverse": 2
|
|
7388
|
-
},
|
|
7390
|
+
}, Gi = {
|
|
7389
7391
|
"flex-start": 0,
|
|
7390
7392
|
center: 1,
|
|
7391
7393
|
"flex-end": 2,
|
|
7392
7394
|
"space-between": 3,
|
|
7393
7395
|
"space-around": 4,
|
|
7394
7396
|
"space-evenly": 5
|
|
7395
|
-
},
|
|
7397
|
+
}, Ki = {
|
|
7396
7398
|
visible: 0,
|
|
7397
7399
|
hidden: 1,
|
|
7398
7400
|
scroll: 2
|
|
7399
|
-
},
|
|
7401
|
+
}, qi = {
|
|
7400
7402
|
static: 0,
|
|
7401
7403
|
relative: 1,
|
|
7402
7404
|
absolute: 2
|
|
7403
|
-
},
|
|
7405
|
+
}, Ji = {
|
|
7404
7406
|
"border-box": 0,
|
|
7405
7407
|
"content-box": 1
|
|
7406
|
-
},
|
|
7408
|
+
}, Yi = class e {
|
|
7407
7409
|
_parent;
|
|
7408
7410
|
static _yoga;
|
|
7409
7411
|
static async load() {
|
|
7410
7412
|
let { loadYoga: e } = await import("yoga-layout/load");
|
|
7411
7413
|
this._yoga = await e();
|
|
7412
7414
|
}
|
|
7413
|
-
node = e._yoga
|
|
7415
|
+
node = e._yoga ? Dt(e._yoga.Node.create()) : void 0;
|
|
7414
7416
|
constructor(e) {
|
|
7415
7417
|
this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
|
|
7416
7418
|
}
|
|
7417
7419
|
_addChild(e, t) {
|
|
7418
|
-
if (e instanceof
|
|
7420
|
+
if (e instanceof ea && e.flexbox.node && this.node) {
|
|
7419
7421
|
this.node.insertChild(e.flexbox.node, t);
|
|
7420
7422
|
let n = e.style.getProperties();
|
|
7421
7423
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7422
7424
|
}
|
|
7423
7425
|
}
|
|
7424
7426
|
_removeChild(e, t) {
|
|
7425
|
-
e instanceof
|
|
7427
|
+
e instanceof ea && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7426
7428
|
}
|
|
7427
7429
|
updateStyleProperty(e, t) {
|
|
7428
7430
|
let n = this.node;
|
|
7429
7431
|
if (n) {
|
|
7430
7432
|
switch (e) {
|
|
7431
7433
|
case "alignContent":
|
|
7432
|
-
n.setAlignContent(t ?
|
|
7434
|
+
n.setAlignContent(t ? Bi[t] ?? Bi["flex-start"] : Bi["flex-start"]);
|
|
7433
7435
|
break;
|
|
7434
7436
|
case "alignItems":
|
|
7435
|
-
n.setAlignItems(t ?
|
|
7437
|
+
n.setAlignItems(t ? Bi[t] ?? Bi["flex-start"] : Bi["flex-start"]);
|
|
7436
7438
|
break;
|
|
7437
7439
|
case "alignSelf":
|
|
7438
|
-
n.setAlignSelf(t ?
|
|
7440
|
+
n.setAlignSelf(t ? Bi[t] ?? Bi["flex-start"] : Bi["flex-start"]);
|
|
7439
7441
|
break;
|
|
7440
7442
|
case "aspectRatio":
|
|
7441
7443
|
n.setAspectRatio(t);
|
|
@@ -7456,10 +7458,10 @@ var Q = {
|
|
|
7456
7458
|
n.setBorder(Q.all, this._parent.style.borderWidth);
|
|
7457
7459
|
break;
|
|
7458
7460
|
case "direction":
|
|
7459
|
-
n.setDirection(t ?
|
|
7461
|
+
n.setDirection(t ? Hi[t] ?? Hi.inherit : Hi.inherit);
|
|
7460
7462
|
break;
|
|
7461
7463
|
case "display":
|
|
7462
|
-
n.setDisplay(t ?
|
|
7464
|
+
n.setDisplay(t ? Vi[t] ?? Vi.flex : Vi.flex);
|
|
7463
7465
|
break;
|
|
7464
7466
|
case "flex":
|
|
7465
7467
|
n.setFlex(t);
|
|
@@ -7468,7 +7470,7 @@ var Q = {
|
|
|
7468
7470
|
n.setFlexBasis(t);
|
|
7469
7471
|
break;
|
|
7470
7472
|
case "flexDirection":
|
|
7471
|
-
n.setFlexDirection(t ?
|
|
7473
|
+
n.setFlexDirection(t ? Ui[t] ?? Ui.row : Ui.row);
|
|
7472
7474
|
break;
|
|
7473
7475
|
case "flexGrow":
|
|
7474
7476
|
n.setFlexGrow(t);
|
|
@@ -7477,16 +7479,16 @@ var Q = {
|
|
|
7477
7479
|
n.setFlexShrink(t);
|
|
7478
7480
|
break;
|
|
7479
7481
|
case "flexWrap":
|
|
7480
|
-
n.setFlexWrap(t ?
|
|
7482
|
+
n.setFlexWrap(t ? Wi[t] ?? Wi.wrap : Wi.wrap);
|
|
7481
7483
|
break;
|
|
7482
7484
|
case "height":
|
|
7483
7485
|
n.setHeight(t);
|
|
7484
7486
|
break;
|
|
7485
7487
|
case "justifyContent":
|
|
7486
|
-
n.setJustifyContent(t ?
|
|
7488
|
+
n.setJustifyContent(t ? Gi[t] ?? Gi["flex-start"] : Gi["flex-start"]);
|
|
7487
7489
|
break;
|
|
7488
7490
|
case "gap":
|
|
7489
|
-
t !== void 0 && n.setGap(
|
|
7491
|
+
t !== void 0 && n.setGap(zi.all, t);
|
|
7490
7492
|
break;
|
|
7491
7493
|
case "marginTop":
|
|
7492
7494
|
n.setMargin(Q.top, t);
|
|
@@ -7516,7 +7518,7 @@ var Q = {
|
|
|
7516
7518
|
n.setMinWidth(t);
|
|
7517
7519
|
break;
|
|
7518
7520
|
case "overflow":
|
|
7519
|
-
n.setOverflow(t ?
|
|
7521
|
+
n.setOverflow(t ? Ki[t] ?? Ki.visible : Ki.visible);
|
|
7520
7522
|
break;
|
|
7521
7523
|
case "paddingTop":
|
|
7522
7524
|
n.setPadding(Q.top, t);
|
|
@@ -7546,10 +7548,10 @@ var Q = {
|
|
|
7546
7548
|
n.setPosition(Q.right, t);
|
|
7547
7549
|
break;
|
|
7548
7550
|
case "position":
|
|
7549
|
-
n.setPositionType(t ?
|
|
7551
|
+
n.setPositionType(t ? qi[t] ?? qi.relative : qi.relative);
|
|
7550
7552
|
break;
|
|
7551
7553
|
case "boxSizing":
|
|
7552
|
-
n.setBoxSizing(t ?
|
|
7554
|
+
n.setBoxSizing(t ? Ji[t] ?? Ji["content-box"] : Ji["content-box"]);
|
|
7553
7555
|
break;
|
|
7554
7556
|
case "width":
|
|
7555
7557
|
n.setWidth(t);
|
|
@@ -7560,7 +7562,7 @@ var Q = {
|
|
|
7560
7562
|
}
|
|
7561
7563
|
update() {
|
|
7562
7564
|
let e = this._parent, t = this.node;
|
|
7563
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
7565
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Hi.ltr), t.hasNewLayout())) {
|
|
7564
7566
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
7565
7567
|
(!Number.isNaN(n) && n !== e.position.x || !Number.isNaN(r) && r !== e.position.y) && e.position.set(n, r), (!Number.isNaN(i) && i !== e.size.x || !Number.isNaN(a) && a !== e.size.y) && e.size.set(i, a), t.markLayoutSeen();
|
|
7566
7568
|
}
|
|
@@ -7568,15 +7570,15 @@ var Q = {
|
|
|
7568
7570
|
destroy() {
|
|
7569
7571
|
this.node?.free(), this.node = void 0;
|
|
7570
7572
|
}
|
|
7571
|
-
},
|
|
7573
|
+
}, Xi = new Set(Object.keys(a())), Zi = new Set(Object.keys(s())), Qi = new x(), $i = [
|
|
7572
7574
|
[0, 0],
|
|
7573
7575
|
[1, 0],
|
|
7574
7576
|
[1, 1],
|
|
7575
7577
|
[0, 1]
|
|
7576
|
-
],
|
|
7577
|
-
flexbox = new
|
|
7578
|
-
aabb = new
|
|
7579
|
-
globalAabb = new
|
|
7578
|
+
], ea = class extends Dr {
|
|
7579
|
+
flexbox = new Yi(this);
|
|
7580
|
+
aabb = new yt();
|
|
7581
|
+
globalAabb = new yt();
|
|
7580
7582
|
_parentGlobalDisplay;
|
|
7581
7583
|
_globalDisplay;
|
|
7582
7584
|
get globalDisplay() {
|
|
@@ -7587,7 +7589,7 @@ var Q = {
|
|
|
7587
7589
|
});
|
|
7588
7590
|
_allowPointerEvents = !0;
|
|
7589
7591
|
_overflowHidden = !1;
|
|
7590
|
-
_style = new
|
|
7592
|
+
_style = new Pi().on("updateProperty", (...e) => {
|
|
7591
7593
|
this.onUpdateStyleProperty(e[0], e[1], e[2]);
|
|
7592
7594
|
});
|
|
7593
7595
|
get style() {
|
|
@@ -7601,14 +7603,14 @@ var Q = {
|
|
|
7601
7603
|
this._endBatch();
|
|
7602
7604
|
}
|
|
7603
7605
|
}
|
|
7604
|
-
_background = new
|
|
7606
|
+
_background = new Si(this);
|
|
7605
7607
|
get background() {
|
|
7606
7608
|
return this._background;
|
|
7607
7609
|
}
|
|
7608
7610
|
set background(e) {
|
|
7609
7611
|
this._background.resetProperties().setProperties(e);
|
|
7610
7612
|
}
|
|
7611
|
-
_shape = new
|
|
7613
|
+
_shape = new Ni(this);
|
|
7612
7614
|
get shape() {
|
|
7613
7615
|
return this._shape;
|
|
7614
7616
|
}
|
|
@@ -7622,14 +7624,14 @@ var Q = {
|
|
|
7622
7624
|
set fill(e) {
|
|
7623
7625
|
this._fill.resetProperties().setProperties(e);
|
|
7624
7626
|
}
|
|
7625
|
-
_outline = new
|
|
7627
|
+
_outline = new ji(this);
|
|
7626
7628
|
get outline() {
|
|
7627
7629
|
return this._outline;
|
|
7628
7630
|
}
|
|
7629
7631
|
set outline(e) {
|
|
7630
7632
|
this._outline.resetProperties().setProperties(e);
|
|
7631
7633
|
}
|
|
7632
|
-
_foreground = new
|
|
7634
|
+
_foreground = new ki(this);
|
|
7633
7635
|
get foreground() {
|
|
7634
7636
|
return this._foreground;
|
|
7635
7637
|
}
|
|
@@ -7643,21 +7645,21 @@ var Q = {
|
|
|
7643
7645
|
set text(e) {
|
|
7644
7646
|
this._text.resetProperties().setProperties(e);
|
|
7645
7647
|
}
|
|
7646
|
-
_shadow = new
|
|
7648
|
+
_shadow = new Mi(this);
|
|
7647
7649
|
get shadow() {
|
|
7648
7650
|
return this._shadow;
|
|
7649
7651
|
}
|
|
7650
7652
|
set shadow(e) {
|
|
7651
7653
|
this._shadow.resetProperties().setProperties(e);
|
|
7652
7654
|
}
|
|
7653
|
-
_connection = new
|
|
7655
|
+
_connection = new Di(this);
|
|
7654
7656
|
get connection() {
|
|
7655
7657
|
return this._connection;
|
|
7656
7658
|
}
|
|
7657
7659
|
set connection(e) {
|
|
7658
7660
|
this._connection.resetProperties().setProperties(e);
|
|
7659
7661
|
}
|
|
7660
|
-
_table = new
|
|
7662
|
+
_table = new Ri(this);
|
|
7661
7663
|
get table() {
|
|
7662
7664
|
return this._table;
|
|
7663
7665
|
}
|
|
@@ -7671,7 +7673,7 @@ var Q = {
|
|
|
7671
7673
|
set chart(e) {
|
|
7672
7674
|
this._chart.resetProperties().setProperties(e);
|
|
7673
7675
|
}
|
|
7674
|
-
_comments = new
|
|
7676
|
+
_comments = new Ei(this);
|
|
7675
7677
|
get comments() {
|
|
7676
7678
|
return this._comments;
|
|
7677
7679
|
}
|
|
@@ -7756,7 +7758,7 @@ var Q = {
|
|
|
7756
7758
|
this._updateGlobalDisplay();
|
|
7757
7759
|
break;
|
|
7758
7760
|
case "rotate":
|
|
7759
|
-
this.rotation = (t || 0) *
|
|
7761
|
+
this.rotation = (t || 0) * bt, this.updateGlobalTransform();
|
|
7760
7762
|
break;
|
|
7761
7763
|
case "scaleX":
|
|
7762
7764
|
this.scale.x = t, this.text.isValid() && (t ^ n) < 0 && this.requestDraw();
|
|
@@ -7821,7 +7823,7 @@ var Q = {
|
|
|
7821
7823
|
this.requestDraw();
|
|
7822
7824
|
break;
|
|
7823
7825
|
}
|
|
7824
|
-
if ((
|
|
7826
|
+
if ((Zi.has(e) || Xi.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
7825
7827
|
else switch (e) {
|
|
7826
7828
|
case "left":
|
|
7827
7829
|
this.position.x = Number(t);
|
|
@@ -7865,10 +7867,10 @@ var Q = {
|
|
|
7865
7867
|
}
|
|
7866
7868
|
_intersectsViewport(e) {
|
|
7867
7869
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
7868
|
-
for (let [e, c] of
|
|
7870
|
+
for (let [e, c] of $i) t.applyAffineInverse({
|
|
7869
7871
|
x: e * n,
|
|
7870
7872
|
y: c * r
|
|
7871
|
-
},
|
|
7873
|
+
}, Qi), i = Math.min(i, Qi.x), a = Math.max(a, Qi.x), o = Math.min(o, Qi.y), s = Math.max(s, Qi.y);
|
|
7872
7874
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
7873
7875
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
7874
7876
|
}
|
|
@@ -7889,7 +7891,7 @@ var Q = {
|
|
|
7889
7891
|
}), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e) : (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender());
|
|
7890
7892
|
}
|
|
7891
7893
|
_updateStyleMaskImage(e) {
|
|
7892
|
-
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new
|
|
7894
|
+
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new pi({
|
|
7893
7895
|
name: "styleMaskImage",
|
|
7894
7896
|
internalMode: "back"
|
|
7895
7897
|
}), this.append(this._maskEffect)), this._maskEffect.image = e);
|
|
@@ -7920,11 +7922,11 @@ var Q = {
|
|
|
7920
7922
|
}
|
|
7921
7923
|
getObb() {
|
|
7922
7924
|
let e = this.pivot, t = this.transform.apply(e).sub(e);
|
|
7923
|
-
return new
|
|
7925
|
+
return new Ct(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
|
|
7924
7926
|
}
|
|
7925
7927
|
getGlobalObb() {
|
|
7926
7928
|
let e = this.pivot, t = this.globalTransform.apply(e).sub(e);
|
|
7927
|
-
return new
|
|
7929
|
+
return new Ct(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
|
|
7928
7930
|
}
|
|
7929
7931
|
_draw() {
|
|
7930
7932
|
super._draw(), this._background.isValid() && (this._shape.draw(!this._background.fillWithShape), this._background.draw()), this._fill.isValid() && (this._shape.draw(), this._fill.draw()), this._outline.isValid() && (this._shape.draw(), this._outline.draw()), this._foreground.isValid() && (this._shape.draw(!this._foreground.fillWithShape), this._foreground.draw()), this._text.isValid() && this._text.draw(), this._chart.isValid() && this._chart.draw(), this._drawContent();
|
|
@@ -7979,10 +7981,10 @@ var Q = {
|
|
|
7979
7981
|
super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this.comments.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
7980
7982
|
}
|
|
7981
7983
|
};
|
|
7982
|
-
|
|
7984
|
+
ea = j([S("Element2D"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ea);
|
|
7983
7985
|
//#endregion
|
|
7984
7986
|
//#region src/scene/2d/TextureRect2D.ts
|
|
7985
|
-
var
|
|
7987
|
+
var ta = class extends ea {
|
|
7986
7988
|
texture;
|
|
7987
7989
|
region;
|
|
7988
7990
|
constructor(e, t = []) {
|
|
@@ -8005,7 +8007,7 @@ var na = class extends ta {
|
|
|
8005
8007
|
} });
|
|
8006
8008
|
}
|
|
8007
8009
|
}
|
|
8008
|
-
},
|
|
8010
|
+
}, na = class extends ta {
|
|
8009
8011
|
texture = new rr();
|
|
8010
8012
|
animation;
|
|
8011
8013
|
_lastTime = NaN;
|
|
@@ -8036,10 +8038,10 @@ var na = class extends ta {
|
|
|
8036
8038
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
8037
8039
|
}
|
|
8038
8040
|
};
|
|
8039
|
-
|
|
8041
|
+
j([_({ fallback: "" }), A("design:type", String)], na.prototype, "src", void 0), na = j([S("Lottie2D"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], na);
|
|
8040
8042
|
//#endregion
|
|
8041
8043
|
//#region src/scene/2d/Mesh2D.ts
|
|
8042
|
-
var
|
|
8044
|
+
var ra = class extends ea {
|
|
8043
8045
|
texture;
|
|
8044
8046
|
_vertices = /* @__PURE__ */ new Float32Array();
|
|
8045
8047
|
_uvs = /* @__PURE__ */ new Float32Array();
|
|
@@ -8070,7 +8072,7 @@ var ia = class extends ta {
|
|
|
8070
8072
|
_drawContent() {
|
|
8071
8073
|
this.texture?.isValid() && this._indices.length && this._vertices.length && (this.context.fillStyle = this.texture, this.context.drawMesh(this._vertices, this._uvs, this._indices));
|
|
8072
8074
|
}
|
|
8073
|
-
},
|
|
8075
|
+
}, ia = class extends ea {
|
|
8074
8076
|
constructor(e, t = []) {
|
|
8075
8077
|
super(), this.setProperties(e).append(t);
|
|
8076
8078
|
}
|
|
@@ -8083,20 +8085,20 @@ var ia = class extends ta {
|
|
|
8083
8085
|
}
|
|
8084
8086
|
}
|
|
8085
8087
|
_drawCircle(e, t) {
|
|
8086
|
-
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle =
|
|
8088
|
+
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = V.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
8087
8089
|
}
|
|
8088
8090
|
_drawEllipse(e, t) {
|
|
8089
|
-
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle =
|
|
8091
|
+
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = V.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
8090
8092
|
}
|
|
8091
8093
|
_draw() {
|
|
8092
8094
|
let { width: e, height: t } = this.getRect();
|
|
8093
8095
|
this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
|
|
8094
8096
|
}
|
|
8095
8097
|
};
|
|
8096
|
-
|
|
8098
|
+
j([_({ fallback: 6 }), A("design:type", Number)], ia.prototype, "handleSize", void 0);
|
|
8097
8099
|
//#endregion
|
|
8098
8100
|
//#region src/scene/2d/Video2D.ts
|
|
8099
|
-
var
|
|
8101
|
+
var aa = class extends ta {
|
|
8100
8102
|
get videoDuration() {
|
|
8101
8103
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
8102
8104
|
}
|
|
@@ -8136,24 +8138,24 @@ var oa = class extends na {
|
|
|
8136
8138
|
}
|
|
8137
8139
|
let n = Math.max(0, this.currentTime % t) / 1e3, r = this._timeline, i = r?.playbackRate ?? 1;
|
|
8138
8140
|
if (r?.playing && i > 0) {
|
|
8139
|
-
e.muted = !0, e.loop = this.loop, e.playbackRate =
|
|
8141
|
+
e.muted = !0, e.loop = this.loop, e.playbackRate = O(i, .0625, 16), e.paused && e.isReady && e.play();
|
|
8140
8142
|
let t = Math.abs(e.currentTime - n);
|
|
8141
|
-
!e.seeking && t > Math.max(.3,
|
|
8143
|
+
!e.seeking && t > Math.max(.3, O(i, 1, 16) * .2) && (e.currentTime = n);
|
|
8142
8144
|
} else e.paused || e.pause(), !e.isPlaying && !e.seeking && e.currentTime !== n && (e.currentTime = n, $.awaitBy(() => e.waitSeek(this._loadAbort?.signal)));
|
|
8143
8145
|
}
|
|
8144
8146
|
_process(e) {
|
|
8145
8147
|
super._process(e), this._updateVideoCurrentTime();
|
|
8146
8148
|
}
|
|
8147
8149
|
};
|
|
8148
|
-
|
|
8150
|
+
j([_({ fallback: "" }), A("design:type", String)], aa.prototype, "src", void 0), aa = j([S("Video2D"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], aa);
|
|
8149
8151
|
//#endregion
|
|
8150
8152
|
//#region src/scene/animation/Animation.ts
|
|
8151
|
-
function
|
|
8153
|
+
function oa(e) {
|
|
8152
8154
|
if (e == null) return 0;
|
|
8153
8155
|
let t = String(e).trim(), n = Number.parseFloat(t);
|
|
8154
8156
|
return Number.isNaN(n) ? 0 : n / 100;
|
|
8155
8157
|
}
|
|
8156
|
-
function
|
|
8158
|
+
function sa(e, t) {
|
|
8157
8159
|
let n = t * 180 / Math.PI;
|
|
8158
8160
|
if (e == null || e === "auto") return n;
|
|
8159
8161
|
let r = String(e).trim();
|
|
@@ -8162,11 +8164,11 @@ function ca(e, t) {
|
|
|
8162
8164
|
let i = Number.parseFloat(r);
|
|
8163
8165
|
return Number.isNaN(i) ? n : i;
|
|
8164
8166
|
}
|
|
8165
|
-
function
|
|
8167
|
+
function ca(e) {
|
|
8166
8168
|
let t = e.trim(), n = /^path\((.*)\)$/s.exec(t);
|
|
8167
8169
|
return n && (t = n[1].trim()), t.length >= 2 && (t[0] === "\"" || t[0] === "'") && t[t.length - 1] === t[0] && (t = t.slice(1, -1)), t.trim();
|
|
8168
8170
|
}
|
|
8169
|
-
function
|
|
8171
|
+
function la(e, t, n, r) {
|
|
8170
8172
|
let i = 1e-6, a = 3 * e - 3 * n + 1, o = 3 * n - 6 * e, s = 3 * e, c = 3 * t - 3 * r + 1, l = 3 * r - 6 * t, u = 3 * t, d = (e) => (3 * a * e + 2 * o) * e + s, f = (e) => ((a * e + o) * e + s) * e, p = (e) => ((c * e + l) * e + u) * e;
|
|
8171
8173
|
function m(e) {
|
|
8172
8174
|
let t = e, n, r;
|
|
@@ -8186,7 +8188,7 @@ function ua(e, t, n, r) {
|
|
|
8186
8188
|
}
|
|
8187
8189
|
return (e) => p(m(e));
|
|
8188
8190
|
}
|
|
8189
|
-
var
|
|
8191
|
+
var ua = {
|
|
8190
8192
|
linear: [
|
|
8191
8193
|
0,
|
|
8192
8194
|
0,
|
|
@@ -8253,7 +8255,7 @@ var da = {
|
|
|
8253
8255
|
.355,
|
|
8254
8256
|
1
|
|
8255
8257
|
]
|
|
8256
|
-
},
|
|
8258
|
+
}, da = Object.fromEntries(Object.entries(ua).map(([e, [t, n, r, i]]) => [e, la(t, n, r, i)])), fa = class extends U {
|
|
8257
8259
|
_keyframes = [];
|
|
8258
8260
|
_isFirstUpdatePosition = !1;
|
|
8259
8261
|
_cachedProps = new t();
|
|
@@ -8289,7 +8291,7 @@ var da = {
|
|
|
8289
8291
|
e = [this.getParent()].filter(Boolean);
|
|
8290
8292
|
break;
|
|
8291
8293
|
}
|
|
8292
|
-
return e.filter((e) => e instanceof
|
|
8294
|
+
return e.filter((e) => e instanceof ea);
|
|
8293
8295
|
}
|
|
8294
8296
|
_updateKeyframes() {
|
|
8295
8297
|
this._pathMeasures.clear();
|
|
@@ -8322,7 +8324,7 @@ var da = {
|
|
|
8322
8324
|
}
|
|
8323
8325
|
let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
|
|
8324
8326
|
e.forEach((e, r) => {
|
|
8325
|
-
let i = t === 1 ? n :
|
|
8327
|
+
let i = t === 1 ? n : O(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
|
|
8326
8328
|
if (!a) return;
|
|
8327
8329
|
let o = this._parseKeyframes(i, a);
|
|
8328
8330
|
o?.length && this._commitStyle(i, e, a, o[0], o[1]);
|
|
@@ -8340,14 +8342,14 @@ var da = {
|
|
|
8340
8342
|
});
|
|
8341
8343
|
}
|
|
8342
8344
|
_parseEasing(e) {
|
|
8343
|
-
if (!e) return
|
|
8344
|
-
if (e in
|
|
8345
|
+
if (!e) return da.linear;
|
|
8346
|
+
if (e in da) return da[e];
|
|
8345
8347
|
let t = /cubic-bezier\((.+)\)/.exec(e);
|
|
8346
8348
|
if (t) {
|
|
8347
8349
|
let e = t[1].split(",").map((e) => Number(e));
|
|
8348
|
-
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return
|
|
8350
|
+
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return la(e[0], e[1], e[2], e[3]);
|
|
8349
8351
|
}
|
|
8350
|
-
return
|
|
8352
|
+
return da.linear;
|
|
8351
8353
|
}
|
|
8352
8354
|
_parseKeyframes(e, t) {
|
|
8353
8355
|
let n, r = this._keyframes;
|
|
@@ -8382,7 +8384,7 @@ var da = {
|
|
|
8382
8384
|
});
|
|
8383
8385
|
}
|
|
8384
8386
|
_commitOffsetPath(e, t, n, r, i, a) {
|
|
8385
|
-
let o =
|
|
8387
|
+
let o = ca(t);
|
|
8386
8388
|
if (!o) return;
|
|
8387
8389
|
let s = this._pathMeasures.get(o);
|
|
8388
8390
|
if (!s) {
|
|
@@ -8393,7 +8395,7 @@ var da = {
|
|
|
8393
8395
|
startY: t.y
|
|
8394
8396
|
}, this._pathMeasures.set(o, s);
|
|
8395
8397
|
}
|
|
8396
|
-
let c =
|
|
8398
|
+
let c = O(k(oa(r.offsetDistance ?? i.offsetDistance), oa(i.offsetDistance ?? r.offsetDistance), a), 0, 1), { position: l, angle: u } = s.measure.getPosTanAtProgress(c), d = l.x - s.startX, f = l.y - s.startY, p = sa(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
|
|
8397
8399
|
e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
|
|
8398
8400
|
}
|
|
8399
8401
|
_getDiffValue(e, t, n, r, i) {
|
|
@@ -8414,10 +8416,10 @@ var da = {
|
|
|
8414
8416
|
let a = Math.max(t[e]?.length ?? 0, n[e]?.length ?? 0), o = t[e], s = n[e];
|
|
8415
8417
|
i += `${e}(${Array.from({ length: a }, (e, t) => {
|
|
8416
8418
|
let n = o?.[t], i = s?.[t], a = n?.normalizedIntValue ?? 0, c = i?.normalizedIntValue ?? 0;
|
|
8417
|
-
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 :
|
|
8419
|
+
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : k(a, c, r);
|
|
8418
8420
|
}).join(", ")}) `;
|
|
8419
8421
|
}), i;
|
|
8420
|
-
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value :
|
|
8422
|
+
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : k(a.normalizedIntValue, o.normalizedIntValue, r);
|
|
8421
8423
|
}
|
|
8422
8424
|
isPlaying() {
|
|
8423
8425
|
return !this.paused && this.isInsideTimeRange();
|
|
@@ -8440,14 +8442,14 @@ var da = {
|
|
|
8440
8442
|
});
|
|
8441
8443
|
}
|
|
8442
8444
|
};
|
|
8443
|
-
|
|
8445
|
+
j([_({ fallback: "parent" }), A("design:type", Object)], fa.prototype, "effectMode", void 0), j([_({ default: () => [] }), A("design:type", Array)], fa.prototype, "keyframes", void 0), j([_(), A("design:type", Object)], fa.prototype, "easing", void 0), fa = j([S("Animation", {
|
|
8444
8446
|
renderMode: "disabled",
|
|
8445
8447
|
processSortMode: "parent-before",
|
|
8446
8448
|
duration: 2e3
|
|
8447
|
-
}),
|
|
8449
|
+
}), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], fa);
|
|
8448
8450
|
//#endregion
|
|
8449
8451
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
8450
|
-
var
|
|
8452
|
+
var pa = class t extends e {
|
|
8451
8453
|
static _instance;
|
|
8452
8454
|
static get instance() {
|
|
8453
8455
|
return this._instance ||= new t(), this._instance;
|
|
@@ -8477,7 +8479,7 @@ var ma = class t extends e {
|
|
|
8477
8479
|
togglePause() {
|
|
8478
8480
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
8479
8481
|
}
|
|
8480
|
-
},
|
|
8482
|
+
}, ma = class t extends e {
|
|
8481
8483
|
static PADDING = .1;
|
|
8482
8484
|
_source = null;
|
|
8483
8485
|
_audio = null;
|
|
@@ -8604,7 +8606,7 @@ var ma = class t extends e {
|
|
|
8604
8606
|
let e = this._source;
|
|
8605
8607
|
e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio &&= (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), null);
|
|
8606
8608
|
}
|
|
8607
|
-
},
|
|
8609
|
+
}, ha = class {
|
|
8608
8610
|
parent;
|
|
8609
8611
|
source = new globalThis.Audio();
|
|
8610
8612
|
_src = "";
|
|
@@ -8621,7 +8623,7 @@ var ma = class t extends e {
|
|
|
8621
8623
|
return !!this.source && this.source.readyState === 4;
|
|
8622
8624
|
}
|
|
8623
8625
|
get context() {
|
|
8624
|
-
return
|
|
8626
|
+
return pa.instance;
|
|
8625
8627
|
}
|
|
8626
8628
|
constructor(e) {
|
|
8627
8629
|
this.parent = e;
|
|
@@ -8632,9 +8634,9 @@ var ma = class t extends e {
|
|
|
8632
8634
|
});
|
|
8633
8635
|
}
|
|
8634
8636
|
createSound() {
|
|
8635
|
-
return new
|
|
8637
|
+
return new ma();
|
|
8636
8638
|
}
|
|
8637
|
-
},
|
|
8639
|
+
}, ga = class extends e {
|
|
8638
8640
|
_input;
|
|
8639
8641
|
_output;
|
|
8640
8642
|
_processers = [];
|
|
@@ -8656,7 +8658,7 @@ var ma = class t extends e {
|
|
|
8656
8658
|
get destination() {
|
|
8657
8659
|
return this._input;
|
|
8658
8660
|
}
|
|
8659
|
-
},
|
|
8661
|
+
}, _a = class {
|
|
8660
8662
|
destination;
|
|
8661
8663
|
source;
|
|
8662
8664
|
constructor(e, t = null) {
|
|
@@ -8671,21 +8673,21 @@ var ma = class t extends e {
|
|
|
8671
8673
|
};
|
|
8672
8674
|
//#endregion
|
|
8673
8675
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
8674
|
-
function
|
|
8676
|
+
function va() {
|
|
8675
8677
|
if (He) return new AudioContext();
|
|
8676
8678
|
if (Ue) {
|
|
8677
8679
|
let e = globalThis.webkitAudioContext;
|
|
8678
8680
|
return new e();
|
|
8679
8681
|
} else throw Error("Failed to createAudioContext");
|
|
8680
8682
|
}
|
|
8681
|
-
function
|
|
8683
|
+
function ya(e, t, n) {
|
|
8682
8684
|
if (We) return new OfflineAudioContext(e, t, n);
|
|
8683
8685
|
if (Ge) {
|
|
8684
8686
|
let r = globalThis.webkitOfflineAudioContext;
|
|
8685
8687
|
return new r(e, t, n);
|
|
8686
8688
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
8687
8689
|
}
|
|
8688
|
-
var
|
|
8690
|
+
var ba = class e extends ga {
|
|
8689
8691
|
static _instance;
|
|
8690
8692
|
static get instance() {
|
|
8691
8693
|
return this._instance ||= new e(), this._instance;
|
|
@@ -8726,7 +8728,7 @@ var xa = class e extends _a {
|
|
|
8726
8728
|
_compressor;
|
|
8727
8729
|
_analyser;
|
|
8728
8730
|
constructor() {
|
|
8729
|
-
let e =
|
|
8731
|
+
let e = va(), t = ya(1, 2, We ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
8730
8732
|
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (ze || Be), qe && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
|
|
8731
8733
|
}
|
|
8732
8734
|
_onFocus() {
|
|
@@ -8767,7 +8769,7 @@ var xa = class e extends _a {
|
|
|
8767
8769
|
setParamValue(e, t) {
|
|
8768
8770
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
8769
8771
|
}
|
|
8770
|
-
},
|
|
8772
|
+
}, xa = class extends e {
|
|
8771
8773
|
_audio = null;
|
|
8772
8774
|
_sourceNode = null;
|
|
8773
8775
|
_gain = null;
|
|
@@ -8900,7 +8902,7 @@ var xa = class e extends _a {
|
|
|
8900
8902
|
destroy() {
|
|
8901
8903
|
super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
|
|
8902
8904
|
}
|
|
8903
|
-
},
|
|
8905
|
+
}, Sa = class extends ga {
|
|
8904
8906
|
parent;
|
|
8905
8907
|
_sourceBuffer;
|
|
8906
8908
|
_sourceNode;
|
|
@@ -8908,7 +8910,7 @@ var xa = class e extends _a {
|
|
|
8908
8910
|
gain;
|
|
8909
8911
|
analyser;
|
|
8910
8912
|
get context() {
|
|
8911
|
-
return
|
|
8913
|
+
return ba.instance;
|
|
8912
8914
|
}
|
|
8913
8915
|
get isPlayable() {
|
|
8914
8916
|
return !!this._sourceNode.buffer;
|
|
@@ -8923,8 +8925,8 @@ var xa = class e extends _a {
|
|
|
8923
8925
|
this._sourceNode.buffer = e;
|
|
8924
8926
|
}
|
|
8925
8927
|
constructor(e) {
|
|
8926
|
-
let t =
|
|
8927
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8928
|
+
let t = ba.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8929
|
+
n.connect(i), i.connect(r), r.connect(ba.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
8928
8930
|
}
|
|
8929
8931
|
async load() {
|
|
8930
8932
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -8937,7 +8939,7 @@ var xa = class e extends _a {
|
|
|
8937
8939
|
});
|
|
8938
8940
|
}
|
|
8939
8941
|
_decode(e) {
|
|
8940
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8942
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : ba.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
8941
8943
|
}
|
|
8942
8944
|
cloneSource() {
|
|
8943
8945
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -8947,15 +8949,15 @@ var xa = class e extends _a {
|
|
|
8947
8949
|
};
|
|
8948
8950
|
}
|
|
8949
8951
|
createSound() {
|
|
8950
|
-
return new
|
|
8952
|
+
return new xa();
|
|
8951
8953
|
}
|
|
8952
|
-
},
|
|
8954
|
+
}, Ca, wa = class extends U {
|
|
8953
8955
|
static {
|
|
8954
|
-
|
|
8956
|
+
Ca = this;
|
|
8955
8957
|
}
|
|
8956
8958
|
static _soundPool = [];
|
|
8957
8959
|
_sounds = [];
|
|
8958
|
-
_platformAudio = Ke ? new
|
|
8960
|
+
_platformAudio = Ke ? new Sa(this) : new ha(this);
|
|
8959
8961
|
get platformAudio() {
|
|
8960
8962
|
return this._platformAudio;
|
|
8961
8963
|
}
|
|
@@ -9048,7 +9050,7 @@ var xa = class e extends _a {
|
|
|
9048
9050
|
this._sounds.length = 0;
|
|
9049
9051
|
}
|
|
9050
9052
|
_createSound() {
|
|
9051
|
-
return
|
|
9053
|
+
return Ca._soundPool.length > 0 ? Ca._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
9052
9054
|
}
|
|
9053
9055
|
refresh() {
|
|
9054
9056
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -9064,7 +9066,7 @@ var xa = class e extends _a {
|
|
|
9064
9066
|
this._recycleSound(e);
|
|
9065
9067
|
};
|
|
9066
9068
|
_recycleSound(e) {
|
|
9067
|
-
e.destroy(),
|
|
9069
|
+
e.destroy(), Ca._soundPool.includes(e) || Ca._soundPool.push(e);
|
|
9068
9070
|
}
|
|
9069
9071
|
_prevTime = 0;
|
|
9070
9072
|
_timer = 0;
|
|
@@ -9080,14 +9082,14 @@ var xa = class e extends _a {
|
|
|
9080
9082
|
}, 100);
|
|
9081
9083
|
}
|
|
9082
9084
|
};
|
|
9083
|
-
|
|
9085
|
+
wa = Ca = j([S("Audio"), A("design:paramtypes", [Object])], wa);
|
|
9084
9086
|
//#endregion
|
|
9085
9087
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
9086
|
-
var
|
|
9088
|
+
var Ta = class extends Dr {}, Ea = class extends ea {
|
|
9087
9089
|
_audioBuffer;
|
|
9088
9090
|
_src = (() => {
|
|
9089
9091
|
let e = w();
|
|
9090
|
-
return e ? new
|
|
9092
|
+
return e ? new V({ source: e }) : void 0;
|
|
9091
9093
|
})();
|
|
9092
9094
|
_needsUpdateTexture = !1;
|
|
9093
9095
|
constructor(e = {}) {
|
|
@@ -9107,7 +9109,7 @@ var Ea = class extends Dr {}, Da = class extends ta {
|
|
|
9107
9109
|
}
|
|
9108
9110
|
}
|
|
9109
9111
|
async _loadSrc(e) {
|
|
9110
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
9112
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => ba.decode(e)).then((e) => {
|
|
9111
9113
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
9112
9114
|
});
|
|
9113
9115
|
}
|
|
@@ -9142,16 +9144,16 @@ var Ea = class extends Dr {}, Da = class extends ta {
|
|
|
9142
9144
|
this.syncTexture(), super._process(e);
|
|
9143
9145
|
}
|
|
9144
9146
|
};
|
|
9145
|
-
|
|
9147
|
+
j([_(), A("design:type", Object)], Ea.prototype, "src", void 0), j([_({ fallback: 0 }), A("design:type", Number)], Ea.prototype, "gap", void 0), j([_({ fallback: "#000000" }), A("design:type", String)], Ea.prototype, "color", void 0), Ea = j([S("AudioWaveform"), A("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Ea);
|
|
9146
9148
|
//#endregion
|
|
9147
9149
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
9148
|
-
var
|
|
9150
|
+
var Da, Oa = class extends Er {
|
|
9149
9151
|
static {
|
|
9150
|
-
|
|
9152
|
+
Da = this;
|
|
9151
9153
|
}
|
|
9152
9154
|
blur = 10;
|
|
9153
9155
|
quality = 10;
|
|
9154
|
-
static material = new
|
|
9156
|
+
static material = new R({ gl: {
|
|
9155
9157
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9156
9158
|
fragment: "precision highp float;\nin vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform float progress;\n\nvoid main(void) {\n vec2 offset1 = vec2(offset.x - progress * offset.x, offset.y - progress * offset.y);\n vec4 color = vec4(0.0);\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y - offset1.y));\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));\n color *= 0.25;\n gl_FragColor = color;\n}"
|
|
9157
9159
|
} });
|
|
@@ -9166,7 +9168,7 @@ var Oa, ka = class extends Er {
|
|
|
9166
9168
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
9167
9169
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
9168
9170
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
9169
|
-
|
|
9171
|
+
z.draw(e, Da.material, {
|
|
9170
9172
|
sampler: r,
|
|
9171
9173
|
progress: i,
|
|
9172
9174
|
...t
|
|
@@ -9174,35 +9176,35 @@ var Oa, ka = class extends Er {
|
|
|
9174
9176
|
});
|
|
9175
9177
|
}
|
|
9176
9178
|
};
|
|
9177
|
-
|
|
9179
|
+
Oa = Da = j([S("KawaseTransition")], Oa);
|
|
9178
9180
|
//#endregion
|
|
9179
9181
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
9180
|
-
var
|
|
9182
|
+
var ka, Aa = class extends Er {
|
|
9181
9183
|
static {
|
|
9182
|
-
|
|
9184
|
+
ka = this;
|
|
9183
9185
|
}
|
|
9184
|
-
static material = new
|
|
9186
|
+
static material = new R({ gl: {
|
|
9185
9187
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9186
9188
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
|
|
9187
9189
|
} });
|
|
9188
9190
|
apply(e) {
|
|
9189
|
-
|
|
9191
|
+
z.draw(e, ka.material, {
|
|
9190
9192
|
previous: 0,
|
|
9191
9193
|
next: 1,
|
|
9192
9194
|
progress: this.currentTimeProgress
|
|
9193
9195
|
});
|
|
9194
9196
|
}
|
|
9195
9197
|
};
|
|
9196
|
-
|
|
9198
|
+
Aa = ka = j([S("LeftEraseTransition")], Aa);
|
|
9197
9199
|
//#endregion
|
|
9198
9200
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
9199
|
-
var
|
|
9201
|
+
var ja, Ma = class extends Er {
|
|
9200
9202
|
static {
|
|
9201
|
-
|
|
9203
|
+
ja = this;
|
|
9202
9204
|
}
|
|
9203
9205
|
blur = 100;
|
|
9204
9206
|
gradientBlur = 600;
|
|
9205
|
-
static material = new
|
|
9207
|
+
static material = new R({ gl: {
|
|
9206
9208
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9207
9209
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\nuniform float progress;\n\nfloat random(vec3 scale, float seed) {\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void) {\n float blur1 = blur - progress * blur;\n float gradientBlur1 = progress * gradientBlur;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientBlur1) * blur1;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample1 = texture2D(sampler, vUv + delta / texSize * percent * radius);\n sample1.rgb *= sample1.a;\n color += sample1 * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}"
|
|
9208
9210
|
} });
|
|
@@ -9210,7 +9212,7 @@ var Ma, Na = class extends Er {
|
|
|
9210
9212
|
let n = this.currentTimeProgress, r, i;
|
|
9211
9213
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9212
9214
|
let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
|
|
9213
|
-
|
|
9215
|
+
z.draw(e, ja.material, {
|
|
9214
9216
|
sampler: r,
|
|
9215
9217
|
progress: i,
|
|
9216
9218
|
blur: this.blur,
|
|
@@ -9219,7 +9221,7 @@ var Ma, Na = class extends Er {
|
|
|
9219
9221
|
end: c,
|
|
9220
9222
|
delta: [u / f, d / f],
|
|
9221
9223
|
texSize: l
|
|
9222
|
-
}),
|
|
9224
|
+
}), z.draw(e, ja.material, {
|
|
9223
9225
|
sampler: r,
|
|
9224
9226
|
progress: i,
|
|
9225
9227
|
blur: this.blur,
|
|
@@ -9231,18 +9233,18 @@ var Ma, Na = class extends Er {
|
|
|
9231
9233
|
});
|
|
9232
9234
|
}
|
|
9233
9235
|
};
|
|
9234
|
-
|
|
9236
|
+
Ma = ja = j([S("TiltShiftTransition")], Ma);
|
|
9235
9237
|
//#endregion
|
|
9236
9238
|
//#region src/scene/transitions/TwistTransition.ts
|
|
9237
|
-
var
|
|
9239
|
+
var Na, Pa = class extends Er {
|
|
9238
9240
|
static {
|
|
9239
|
-
|
|
9241
|
+
Na = this;
|
|
9240
9242
|
}
|
|
9241
9243
|
radius;
|
|
9242
9244
|
angle = 4;
|
|
9243
9245
|
padding = 20;
|
|
9244
9246
|
offset;
|
|
9245
|
-
static material = new
|
|
9247
|
+
static material = new R({ gl: {
|
|
9246
9248
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9247
9249
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\nuniform float progress;\n\nvec2 mapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord *= filterArea.xy;\n return coord;\n}\n\nvec2 unmapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n return coord;\n}\n\nvec2 twist(vec2 coord, float radius) {\n coord -= offset;\n float dist = length(coord);\n if (dist < radius) {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n coord += offset;\n return coord;\n}\n\nvoid main(void) {\n vec2 coord = mapCoord(vUv);\n coord = twist(coord, radius - (progress * radius));\n coord = unmapCoord(coord);\n gl_FragColor = texture2D(sampler, coord);\n}"
|
|
9248
9250
|
} });
|
|
@@ -9250,7 +9252,7 @@ var Pa, Fa = class extends Er {
|
|
|
9250
9252
|
let n = this.currentTimeProgress, r, i;
|
|
9251
9253
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9252
9254
|
let a = t.width, o = t.height;
|
|
9253
|
-
|
|
9255
|
+
z.draw(e, Na.material, {
|
|
9254
9256
|
sampler: r,
|
|
9255
9257
|
progress: i,
|
|
9256
9258
|
filterArea: [
|
|
@@ -9266,10 +9268,10 @@ var Pa, Fa = class extends Er {
|
|
|
9266
9268
|
});
|
|
9267
9269
|
}
|
|
9268
9270
|
};
|
|
9269
|
-
|
|
9271
|
+
Pa = Na = j([S("TwistTransition")], Pa);
|
|
9270
9272
|
//#endregion
|
|
9271
9273
|
//#region src/asset/loaders/GifLoader.ts
|
|
9272
|
-
var
|
|
9274
|
+
var Fa = class extends Wn {
|
|
9273
9275
|
install(e) {
|
|
9274
9276
|
let t = async (t) => {
|
|
9275
9277
|
let { decodeFrames: n } = await import("modern-gif");
|
|
@@ -9286,14 +9288,14 @@ var Ia = class extends Wn {
|
|
|
9286
9288
|
e.register(n, t);
|
|
9287
9289
|
}), e.gif = this, this;
|
|
9288
9290
|
}
|
|
9289
|
-
},
|
|
9291
|
+
}, Ia = class extends Wn {
|
|
9290
9292
|
install(e) {
|
|
9291
9293
|
let t = async (e) => JSON.parse(await e.text());
|
|
9292
9294
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
9293
9295
|
e.register(n, t);
|
|
9294
9296
|
}), e.json = this, this;
|
|
9295
9297
|
}
|
|
9296
|
-
},
|
|
9298
|
+
}, La = class extends Wn {
|
|
9297
9299
|
install(e) {
|
|
9298
9300
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
9299
9301
|
container: null,
|
|
@@ -9304,14 +9306,14 @@ var Ia = class extends Wn {
|
|
|
9304
9306
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
9305
9307
|
}), e.lottie = this, this;
|
|
9306
9308
|
}
|
|
9307
|
-
},
|
|
9309
|
+
}, Ra = class extends Wn {
|
|
9308
9310
|
install(e) {
|
|
9309
9311
|
let t = async (e) => e.text();
|
|
9310
9312
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
9311
9313
|
}
|
|
9312
|
-
},
|
|
9314
|
+
}, za = class extends Wn {
|
|
9313
9315
|
install(e) {
|
|
9314
|
-
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new
|
|
9316
|
+
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new V({
|
|
9315
9317
|
source: e,
|
|
9316
9318
|
uploadMethodId: "image",
|
|
9317
9319
|
mipmap: !0,
|
|
@@ -9333,11 +9335,11 @@ var Ia = class extends Wn {
|
|
|
9333
9335
|
e.register(n, t);
|
|
9334
9336
|
}), e.texture = this, this;
|
|
9335
9337
|
}
|
|
9336
|
-
},
|
|
9338
|
+
}, Ba = class extends Wn {
|
|
9337
9339
|
install(e) {
|
|
9338
9340
|
return this.load = (t) => e.awaitBy(() => new cr(t).load()), e.video = this, this;
|
|
9339
9341
|
}
|
|
9340
|
-
},
|
|
9342
|
+
}, Va = Object.entries({
|
|
9341
9343
|
"font/woff": ["woff"],
|
|
9342
9344
|
"font/ttf": ["ttf"],
|
|
9343
9345
|
"font/otf": ["otf"],
|
|
@@ -9353,31 +9355,31 @@ var Ia = class extends Wn {
|
|
|
9353
9355
|
"image/webp": ["webp"],
|
|
9354
9356
|
"application/json": ["json"]
|
|
9355
9357
|
});
|
|
9356
|
-
function
|
|
9357
|
-
for (let [t, n] of
|
|
9358
|
+
function Ha(e) {
|
|
9359
|
+
for (let [t, n] of Va) if (n.includes(e)) return t;
|
|
9358
9360
|
}
|
|
9359
|
-
function
|
|
9361
|
+
function Ua(e) {
|
|
9360
9362
|
let t;
|
|
9361
9363
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
9362
9364
|
else if (e.startsWith("http")) {
|
|
9363
9365
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
9364
|
-
n && (t =
|
|
9366
|
+
n && (t = Ha(n));
|
|
9365
9367
|
}
|
|
9366
9368
|
return t;
|
|
9367
9369
|
}
|
|
9368
9370
|
//#endregion
|
|
9369
9371
|
//#region src/asset/Assets.ts
|
|
9370
|
-
var
|
|
9372
|
+
var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
9371
9373
|
defaultHandler = (e) => e;
|
|
9372
9374
|
_handlers = /* @__PURE__ */ new Map();
|
|
9373
9375
|
_handleing = /* @__PURE__ */ new Map();
|
|
9374
9376
|
_handled = /* @__PURE__ */ new Map();
|
|
9375
|
-
_gc =
|
|
9377
|
+
_gc = Wa ? new FinalizationRegistry((e) => {
|
|
9376
9378
|
let t = this.get(e);
|
|
9377
9379
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
9378
9380
|
}) : void 0;
|
|
9379
9381
|
constructor() {
|
|
9380
|
-
super(),
|
|
9382
|
+
super(), Wa || C.on(this.gc.bind(this), { sort: 2 });
|
|
9381
9383
|
}
|
|
9382
9384
|
use(e) {
|
|
9383
9385
|
return e.install(this), this;
|
|
@@ -9426,11 +9428,11 @@ var Ga = "WeakRef" in globalThis, Ka = class extends e {
|
|
|
9426
9428
|
}
|
|
9427
9429
|
get(e) {
|
|
9428
9430
|
let t = this._handled.get(e);
|
|
9429
|
-
return
|
|
9431
|
+
return Wa && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
9430
9432
|
}
|
|
9431
9433
|
set(e, t) {
|
|
9432
9434
|
let n = t;
|
|
9433
|
-
|
|
9435
|
+
Wa && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
9434
9436
|
}
|
|
9435
9437
|
async awaitBy(e) {
|
|
9436
9438
|
let t = e(), n = c();
|
|
@@ -9445,7 +9447,7 @@ var Ga = "WeakRef" in globalThis, Ka = class extends e {
|
|
|
9445
9447
|
return this._handleing.set(e, r), r;
|
|
9446
9448
|
}
|
|
9447
9449
|
async load(e, t) {
|
|
9448
|
-
let n = await this.loadBy(e), r =
|
|
9450
|
+
let n = await this.loadBy(e), r = Ua(e);
|
|
9449
9451
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
9450
9452
|
}
|
|
9451
9453
|
async waitUntilLoad() {
|
|
@@ -9459,14 +9461,14 @@ var Ga = "WeakRef" in globalThis, Ka = class extends e {
|
|
|
9459
9461
|
n && "destroy" in n && n.destroy();
|
|
9460
9462
|
}), this._handled.clear();
|
|
9461
9463
|
}
|
|
9462
|
-
}, $ = new
|
|
9464
|
+
}, $ = new Ga().use(new Gn()).use(new Fa()).use(new Ia()).use(new La()).use(new Ra()).use(new za()).use(new Ba()), Ka = {
|
|
9463
9465
|
alpha: !0,
|
|
9464
9466
|
stencil: !0,
|
|
9465
9467
|
antialias: !1,
|
|
9466
9468
|
premultipliedAlpha: !0,
|
|
9467
9469
|
preserveDrawingBuffer: !1,
|
|
9468
9470
|
powerPreference: "default"
|
|
9469
|
-
},
|
|
9471
|
+
}, qa = class extends Tr {
|
|
9470
9472
|
renderer;
|
|
9471
9473
|
get view() {
|
|
9472
9474
|
return this.renderer.view;
|
|
@@ -9499,12 +9501,12 @@ var Ga = "WeakRef" in globalThis, Ka = class extends e {
|
|
|
9499
9501
|
constructor(e = {}) {
|
|
9500
9502
|
let { view: t, width: n, height: r, pixelRatio: i = Ye, autoResize: a, data: o } = e;
|
|
9501
9503
|
super(), this.renderer = new Un(t, {
|
|
9502
|
-
alpha:
|
|
9503
|
-
stencil:
|
|
9504
|
-
antialias:
|
|
9505
|
-
premultipliedAlpha:
|
|
9506
|
-
preserveDrawingBuffer:
|
|
9507
|
-
powerPreference:
|
|
9504
|
+
alpha: Ka.alpha ?? e.alpha,
|
|
9505
|
+
stencil: Ka.stencil ?? e.stencil,
|
|
9506
|
+
antialias: Ka.antialias ?? e.antialias,
|
|
9507
|
+
premultipliedAlpha: Ka.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
9508
|
+
preserveDrawingBuffer: Ka.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
9509
|
+
powerPreference: Ka.powerPreference ?? e.powerPreference
|
|
9508
9510
|
}), this._setupInput(), this.pixelRatio = i, a ? !t && this.renderer.view && (this.renderer.view.style.width = "100%", this.renderer.view.style.height = "100%") : this.resize(n || this.gl.drawingBufferWidth || this.view?.clientWidth || 200, r || this.gl.drawingBufferHeight || this.view?.clientHeight || 200, !t), this.setProperties(e), o && this.root.append(o);
|
|
9509
9511
|
}
|
|
9510
9512
|
_updateProperty(e, t, n) {
|
|
@@ -9623,22 +9625,22 @@ var Ga = "WeakRef" in globalThis, Ka = class extends e {
|
|
|
9623
9625
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
9624
9626
|
}
|
|
9625
9627
|
};
|
|
9626
|
-
|
|
9628
|
+
j([_({ fallback: !1 }), A("design:type", Boolean)], qa.prototype, "autoResize", void 0), j([_({ fallback: !1 }), A("design:type", Boolean)], qa.prototype, "autoStart", void 0);
|
|
9627
9629
|
//#endregion
|
|
9628
9630
|
//#region src/render.ts
|
|
9629
|
-
var
|
|
9630
|
-
function
|
|
9631
|
-
return
|
|
9631
|
+
var Ja, Ya = [], Xa = !1;
|
|
9632
|
+
function Za() {
|
|
9633
|
+
return Ja ??= new qa({
|
|
9632
9634
|
pixelRatio: 1,
|
|
9633
9635
|
width: 1,
|
|
9634
9636
|
height: 1,
|
|
9635
9637
|
preserveDrawingBuffer: !0
|
|
9636
9638
|
});
|
|
9637
9639
|
}
|
|
9638
|
-
async function
|
|
9639
|
-
if (!
|
|
9640
|
-
for (
|
|
9641
|
-
let t =
|
|
9640
|
+
async function Qa(e = 100) {
|
|
9641
|
+
if (!Xa) {
|
|
9642
|
+
for (Xa = !0; Ya.length;) {
|
|
9643
|
+
let t = Ya.shift();
|
|
9642
9644
|
if (t) try {
|
|
9643
9645
|
await t();
|
|
9644
9646
|
} catch (e) {
|
|
@@ -9646,49 +9648,49 @@ async function $a(e = 100) {
|
|
|
9646
9648
|
}
|
|
9647
9649
|
else await new Promise((t) => setTimeout(t, e));
|
|
9648
9650
|
}
|
|
9649
|
-
|
|
9651
|
+
Xa = !1;
|
|
9650
9652
|
}
|
|
9651
9653
|
}
|
|
9652
|
-
async function
|
|
9653
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [],
|
|
9654
|
-
if (
|
|
9654
|
+
async function $a(e) {
|
|
9655
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], imagePipelineResolver: s, onBefore: c, onKeyframe: l, ...u } = e, d = Math.max(1, Math.floor(r)), f = Math.max(1, Math.floor(i)), p = Za();
|
|
9656
|
+
if (p.resetProperties(), p.setProperties(u), p.debug = t, p.fonts = n, p.timeline.currentTime = 0, p.resizeForExport(d, f), p.imagePipelineResolver = s, p.root.removeChildren(!0), p.root.append(a), await c?.(p), await p.waitUntilProcessed(), o.length) {
|
|
9655
9657
|
let e = o.length, t = o[e - 1];
|
|
9656
9658
|
for (let n = 0; n < e; n++) {
|
|
9657
9659
|
let e = o[n], r = (o[n + 1] || e) - e;
|
|
9658
|
-
|
|
9660
|
+
p.timeline.currentTime = e, await p.waitUntilProcessed(), await l?.(p.toPixels(), {
|
|
9659
9661
|
currentTime: e,
|
|
9660
9662
|
duration: r,
|
|
9661
9663
|
progress: t === 0 ? 1 : e / t
|
|
9662
9664
|
});
|
|
9663
9665
|
}
|
|
9664
9666
|
}
|
|
9665
|
-
let
|
|
9667
|
+
let m = p.toPixels();
|
|
9666
9668
|
return {
|
|
9667
|
-
pixels:
|
|
9668
|
-
toCanvas2D: () =>
|
|
9669
|
+
pixels: m,
|
|
9670
|
+
toCanvas2D: () => p.toCanvas2D(new ImageData(m, d, f))
|
|
9669
9671
|
};
|
|
9670
9672
|
}
|
|
9671
|
-
async function
|
|
9673
|
+
async function eo(e) {
|
|
9672
9674
|
return new Promise((t, n) => {
|
|
9673
|
-
|
|
9675
|
+
Ya.push(async () => {
|
|
9674
9676
|
try {
|
|
9675
|
-
t(await
|
|
9677
|
+
t(await $a(e).then((e) => e.toCanvas2D()));
|
|
9676
9678
|
} catch (e) {
|
|
9677
9679
|
n(e);
|
|
9678
9680
|
}
|
|
9679
|
-
}),
|
|
9681
|
+
}), Qa();
|
|
9680
9682
|
});
|
|
9681
9683
|
}
|
|
9682
|
-
async function
|
|
9684
|
+
async function to(e) {
|
|
9683
9685
|
return new Promise((t, n) => {
|
|
9684
|
-
|
|
9686
|
+
Ya.push(async () => {
|
|
9685
9687
|
try {
|
|
9686
|
-
t(await
|
|
9688
|
+
t(await $a(e).then((e) => e.pixels));
|
|
9687
9689
|
} catch (e) {
|
|
9688
9690
|
n(e);
|
|
9689
9691
|
}
|
|
9690
|
-
}),
|
|
9692
|
+
}), Qa();
|
|
9691
9693
|
});
|
|
9692
9694
|
}
|
|
9693
9695
|
//#endregion
|
|
9694
|
-
export {
|
|
9696
|
+
export { yt as Aabb2D, nr as AnimatedTexture, fa as Animation, Ga as Assets, wa as Audio, ga as AudioPipeline, _a as AudioProcessor, Ta as AudioSpectrum, Ea as AudioWaveform, M as BufferUsage, Or as Camera2D, ur as CanvasContext, br as CanvasItem, rr as CanvasTexture, D as Color, K as ColorAdjustEffect, Vr as ColorFilterEffect, St as ColorMatrix, Wr as ColorOverlayEffect, Kr as ColorRemoveEffect, Yr as ColorReplaceEffect, ir as ColorTexture, T as CoreObject, bt as DEG_TO_RAD, Ye as DEVICE_PIXEL_RATIO, q as DrawboardEffect, ni as DropShadowEffect, G as Effect, $n as EffectMaterial, ea as Element2D, Si as Element2DBackground, X as Element2DChart, Ei as Element2DComments, Di as Element2DConnection, Y as Element2DFill, ki as Element2DForeground, ji as Element2DOutline, Mi as Element2DShadow, Ni as Element2DShape, Pi as Element2DStyle, Ri as Element2DTable, Z as Element2DText, ii as EmbossEffect, qa as Engine, Yi as Flexbox, Gn as FontLoader, ei as GaussianBlurEffect, qn as Geometry, Fa as GifLoader, dn as GlBatch2DSystem, sn as GlBlendMode, kt as GlBuffer, It as GlBufferSystem, Ot as GlBufferTarget, hn as GlMaskSystem, Jt as GlProgram, yn as GlRenderTarget, bn as GlRenderTargetSystem, rn as GlShaderSystem, ln as GlState, un as GlStateSystem, _n as GlStencilSystem, N as GlSystem, vn as GlViewportSystem, J as GlitchEffect, ci as GodrayEffect, ar as GradientTexture, ha as HTMLAudio, pa as HTMLAudioContext, ma as HTMLSound, qe as IN_BROWSER, Je as IN_MAC_OS, Kn as IndexBuffer, _t as Input, dt as InputEvent, Ia as JsonLoader, di as KawaseBlurEffect, Oa as KawaseTransition, ft as KeyboardInputEvent, Aa as LeftEraseTransition, Wn as Loader, na as Lottie2D, La as LottieLoader, Tt as MainLoop, pi as MaskEffect, R as Material, ra as Mesh2D, fr as Meta, pt as MouseInputEvent, H as Node, Dr as Node2D, Ct as Obb2D, gi as OutlineEffect, xe as PI, Se as PI_2, vi as PixelateEffect, or as PixelsTexture, mt as PointerInputEvent, wt as Projection2D, Jn as QuadGeometry, z as QuadUvGeometry, xt as RAD_TO_DEG, vt as RefCounted, B as RenderTarget, At as Renderer, E as Resource, He as SUPPORTS_AUDIO_CONTEXT, Be as SUPPORTS_CLICK_EVENTS, Ve as SUPPORTS_CREATE_IMAGE_BITMAP, Pe as SUPPORTS_IMAGE_BITMAP, Re as SUPPORTS_MOUSE_EVENTS, We as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Ie as SUPPORTS_POINTER_EVENTS, Fe as SUPPORTS_RESIZE_OBSERVER, ze as SUPPORTS_TOUCH_EVENTS, Ne as SUPPORTS_WEBGL2, Ue as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Ge as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ke as SUPPORTS_WEB_AUDIO, Le as SUPPORTS_WHEEL_EVENTS, Tr as SceneTree, Ra as TextLoader, V as Texture2D, za as TextureLoader, ta as TextureRect2D, C as Ticker, Ma as TiltShiftTransition, Cr as Timeline, U as TimelineNode, ia as TransformRect2D, Er as Transition, Pa as TwistTransition, Mt as UniformGroup, tr as UvGeometry, er as UvMaterial, L as VertexAttribute, I as VertexBuffer, aa as Video2D, Ba as VideoLoader, cr as VideoTexture, W as Viewport, lr as ViewportTexture, Sa as WebAudio, ba as WebAudioContext, Un as WebGLRenderer, xa as WebSound, ht as WheelInputEvent, wr as Window, bi as ZoomBlurEffect, Bi as alignMap, $ as assets, kr as axisDir, Ji as boxSizingMap, O as clamp, ui as clampFrag, w as createHTMLCanvas, Ft as createIdFromString, ye as createNode, ct as crossOrigin, ua as cssEasingPresets, la as cubicBezier, S as customNode, ve as customNodes, Ka as defaultOptions, st as determineCrossOrigin, Hi as directionMap, Vi as displayMap, Q as edgeMap, Ui as flexDirectionMap, Wi as flexWrapMap, li as frag, rt as getCanvasFactory, Oe as getDefaultCssPropertyValue, ot as getGlContextProvider, Za as getRenderEngine, zi as gutterMap, ut as instanceId, $e as isCanvasElement, Xe as isElementNode, Qe as isImageElement, Ce as isPow2, Ze as isVideoElement, et as isWebgl2, Gi as justifyMap, k as lerp, pn as log2, cn as mapGlBlendModes, Dt as markRaw, fn as nextPow2, be as nextTick, Ki as overflowMap, Lr as parseCssFilter, Ae as parseCssFunctions, ke as parseCssProperty, Rr as parseCssTransformOrigin, we as planExportTiles, qi as positionTypeMap, eo as render, to as renderPixels, vr as resetBatchPool, Ar as routeConnection, nt as setCanvasFactory, at as setGlContextProvider, gn as stencilModeMap };
|