modern-canvas 0.23.13 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Observable as e, RawWeakMap as t, Reactivable as n, clearUndef as r, defineProperty as i, getDefaultLayoutStyle as a, getDefaultStyle as o, getDefaultTextStyle as s, idGenerator as c, isColorFillObject as l, isGradient as u, isNone as d, normalizeBackground as f, normalizeChart as p,
|
|
2
|
-
import { BoundingBox as
|
|
3
|
-
import { extend as
|
|
4
|
-
import
|
|
5
|
-
import { fonts as
|
|
6
|
-
import { Character as
|
|
1
|
+
import { Observable as e, RawWeakMap as t, Reactivable as n, clearUndef as r, defineProperty as i, getDefaultLayoutStyle as a, getDefaultStyle as o, getDefaultTextStyle as s, idGenerator as c, isColorFillObject as l, isGradient as u, isNone as d, normalizeBackground as f, normalizeChart as p, normalizeComments as m, normalizeConnection as h, normalizeFill as g, normalizeForeground as ee, normalizeOutline as te, normalizeShadow as ne, normalizeShape as re, normalizeTable as ie, normalizeText as ae, normalizeTextContent as oe, parseColor as se, property as _, stringifyFilter as ce } from "modern-idoc";
|
|
2
|
+
import { BoundingBox as le, Path2D as v, Path2DSet as ue, PathMeasure as y, Transform2D as b, Vector2 as x, svgToDom as de, svgToPath2DSet as fe } from "modern-path2d";
|
|
3
|
+
import { extend as pe } from "colord";
|
|
4
|
+
import me from "colord/plugins/names";
|
|
5
|
+
import { fonts as he } from "modern-font";
|
|
6
|
+
import { Character as ge, Text as _e } from "modern-text";
|
|
7
7
|
//#region src/core/decorators/customNode.ts
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var ve = /* @__PURE__ */ new Map();
|
|
9
|
+
function S(e, t) {
|
|
10
10
|
return function(n) {
|
|
11
11
|
Object.defineProperty(n.prototype, "is", {
|
|
12
12
|
value: e,
|
|
@@ -14,19 +14,19 @@ function b(e, t) {
|
|
|
14
14
|
configurable: !0
|
|
15
15
|
}), t && Object.keys(t).forEach((e) => {
|
|
16
16
|
i(n, e, { fallback: t[e] });
|
|
17
|
-
}),
|
|
17
|
+
}), ve.set(e, n);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/core/global/createNode.ts
|
|
22
|
-
function
|
|
23
|
-
let n =
|
|
22
|
+
function ye(e = "node", t = {}) {
|
|
23
|
+
let n = ve.get(e);
|
|
24
24
|
if (!n) throw Error(`Failed to createNode, tag: ${e}`);
|
|
25
25
|
return new n().setProperties(t);
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/core/global/Ticker.ts
|
|
29
|
-
var
|
|
29
|
+
var C = class {
|
|
30
30
|
static _queue = [];
|
|
31
31
|
static _currentTime = 0;
|
|
32
32
|
static _elapsed = 0;
|
|
@@ -83,12 +83,12 @@ var x = class {
|
|
|
83
83
|
this._queue = t;
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
|
|
86
|
+
C.start();
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/core/global/nextTick.ts
|
|
89
|
-
async function
|
|
89
|
+
async function be(e) {
|
|
90
90
|
return new Promise((t) => {
|
|
91
|
-
|
|
91
|
+
C.on(() => {
|
|
92
92
|
e?.(), t();
|
|
93
93
|
}, {
|
|
94
94
|
sort: 1,
|
|
@@ -98,14 +98,14 @@ async function xe(e) {
|
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/core/shared/utils.ts
|
|
101
|
-
var
|
|
102
|
-
function
|
|
101
|
+
var xe = Math.PI, Se = xe * 2;
|
|
102
|
+
function Ce(e) {
|
|
103
103
|
return !(e & e - 1) && !!e;
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/core/shared/css.ts
|
|
107
|
-
var
|
|
108
|
-
function
|
|
107
|
+
var we = /([\w-]+)\((.+?)\)/g, Te = /[^,]+/g, Ee = /([-e.\d]+)(.*)/;
|
|
108
|
+
function De(e) {
|
|
109
109
|
return Array.isArray(e) ? e.map((e) => ({
|
|
110
110
|
name: e.name,
|
|
111
111
|
args: e.args.map((e) => ({
|
|
@@ -117,31 +117,31 @@ function Oe(e) {
|
|
|
117
117
|
normalizedIntValue: e.normalizedDefaultIntValue
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
let r =
|
|
122
|
-
return r.length ? r :
|
|
120
|
+
function Oe(e, t, n = {}) {
|
|
121
|
+
let r = ke(t, n);
|
|
122
|
+
return r.length ? r : je(e, t, n);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function ke(e, t = {}) {
|
|
125
125
|
let n = [], r;
|
|
126
|
-
for (; (r =
|
|
126
|
+
for (; (r = we.exec(e)) !== null;) {
|
|
127
127
|
let [, e, i] = r;
|
|
128
128
|
e && n.push({
|
|
129
129
|
name: e,
|
|
130
|
-
args:
|
|
130
|
+
args: Ae(e, i, t)
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
return n;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Ae(e, t, n = {}) {
|
|
136
136
|
let r = [], i, a = 0;
|
|
137
|
-
for (; (i =
|
|
137
|
+
for (; (i = Te.exec(t)) !== null;) r.push(je(e, i[0], {
|
|
138
138
|
...n,
|
|
139
139
|
index: a++
|
|
140
140
|
}));
|
|
141
141
|
return r;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(
|
|
143
|
+
function je(e, t, n = {}) {
|
|
144
|
+
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(Ee), s = {
|
|
145
145
|
unit: o?.[2] ?? null,
|
|
146
146
|
value: t,
|
|
147
147
|
intValue: Number(o?.[1]),
|
|
@@ -161,7 +161,7 @@ function Me(e, t, n = {}) {
|
|
|
161
161
|
s.normalizedIntValue = s.intValue / 100;
|
|
162
162
|
break;
|
|
163
163
|
case "rad":
|
|
164
|
-
s.normalizedIntValue = s.intValue /
|
|
164
|
+
s.normalizedIntValue = s.intValue / Se;
|
|
165
165
|
break;
|
|
166
166
|
case "deg":
|
|
167
167
|
s.normalizedIntValue = s.intValue / 360;
|
|
@@ -184,48 +184,48 @@ function Me(e, t, n = {}) {
|
|
|
184
184
|
}
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region src/core/shared/dom.ts
|
|
187
|
-
var
|
|
188
|
-
function
|
|
187
|
+
var Me = "WebGL2RenderingContext" in globalThis, Ne = "ImageBitmap" in globalThis, Pe = "ResizeObserver" in globalThis, Fe = "PointerEvent" in globalThis, Ie = "WheelEvent" in globalThis, Le = "MouseEvent" in globalThis, Re = "ontouchstart" in globalThis, ze = "onclick" in globalThis, Be = "createImageBitmap" in globalThis, Ve = "AudioContext" in globalThis, He = "webkitAudioContext" in globalThis, Ue = "OfflineAudioContext" in globalThis, We = "webkitOfflineAudioContext" in globalThis, Ge = Ve || He, Ke = typeof window < "u", qe = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, Je = globalThis.devicePixelRatio || 1, Ye = (e) => typeof e == "object" && !!e && e.nodeType === 1, Xe = (e) => Ye(e) && e.tagName === "VIDEO", Ze = (e) => Ye(e) && e.tagName === "IMG";
|
|
188
|
+
function Qe(e) {
|
|
189
189
|
return typeof e == "object" && !!e && e.nodeType === 1 && e.tagName === "CANVAS";
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
return
|
|
191
|
+
function $e(e) {
|
|
192
|
+
return Me && e instanceof globalThis.WebGL2RenderingContext;
|
|
193
193
|
}
|
|
194
|
-
var
|
|
195
|
-
function
|
|
196
|
-
|
|
194
|
+
var et;
|
|
195
|
+
function tt(e) {
|
|
196
|
+
et = e;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
198
|
+
function nt() {
|
|
199
|
+
return et;
|
|
200
200
|
}
|
|
201
|
-
var
|
|
202
|
-
function
|
|
203
|
-
|
|
201
|
+
var rt;
|
|
202
|
+
function it(e) {
|
|
203
|
+
rt = e;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
205
|
+
function at() {
|
|
206
|
+
return rt;
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function w(e, t) {
|
|
209
209
|
let n;
|
|
210
|
-
return
|
|
210
|
+
return et ? n = et(e, t) : Ke && (n = globalThis.document.createElement("canvas")), n && (e !== void 0 && (n.width = e), t !== void 0 && (n.height = t)), n;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function ot(e, t = globalThis.location) {
|
|
213
213
|
if (e.startsWith("data:") || !t || typeof document > "u") return "";
|
|
214
214
|
let n = new URL(e, document.baseURI);
|
|
215
215
|
return n.hostname !== t.hostname || n.port !== t.port || n.protocol !== t.protocol ? "anonymous" : "";
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
n === null && !t.startsWith("data:") ? e.crossOrigin =
|
|
217
|
+
function st(e, t, n) {
|
|
218
|
+
n === null && !t.startsWith("data:") ? e.crossOrigin = ot(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
|
|
219
219
|
}
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region src/core/shared/id.ts
|
|
222
|
-
var
|
|
223
|
-
function
|
|
224
|
-
return ++
|
|
222
|
+
var ct = 0;
|
|
223
|
+
function lt() {
|
|
224
|
+
return ++ct;
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region src/core/input/InputEvent.ts
|
|
228
|
-
var
|
|
228
|
+
var ut = class e {
|
|
229
229
|
cursor;
|
|
230
230
|
bubbles = !1;
|
|
231
231
|
cancelBubble = !1;
|
|
@@ -260,14 +260,14 @@ var dt = class e {
|
|
|
260
260
|
initUIEvent(...e) {
|
|
261
261
|
throw Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
262
262
|
}
|
|
263
|
-
},
|
|
263
|
+
}, dt = class extends ut {
|
|
264
264
|
getModifierState(...e) {
|
|
265
265
|
throw Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
266
266
|
}
|
|
267
267
|
initKeyboardEvent(...e) {
|
|
268
268
|
throw Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
269
269
|
}
|
|
270
|
-
},
|
|
270
|
+
}, ft = class extends ut {
|
|
271
271
|
client = {
|
|
272
272
|
x: 0,
|
|
273
273
|
y: 0
|
|
@@ -350,7 +350,7 @@ var dt = class e {
|
|
|
350
350
|
get globalY() {
|
|
351
351
|
return this.global.y;
|
|
352
352
|
}
|
|
353
|
-
},
|
|
353
|
+
}, pt = class extends ft {
|
|
354
354
|
width = 0;
|
|
355
355
|
height = 0;
|
|
356
356
|
isPrimary = !1;
|
|
@@ -360,20 +360,20 @@ var dt = class e {
|
|
|
360
360
|
getPredictedEvents() {
|
|
361
361
|
throw Error("getPredictedEvents is not supported!");
|
|
362
362
|
}
|
|
363
|
-
},
|
|
363
|
+
}, mt = class extends ft {
|
|
364
364
|
static DOM_DELTA_PIXEL = 0;
|
|
365
365
|
DOM_DELTA_PIXEL = 0;
|
|
366
366
|
static DOM_DELTA_LINE = 1;
|
|
367
367
|
DOM_DELTA_LINE = 1;
|
|
368
368
|
static DOM_DELTA_PAGE = 2;
|
|
369
369
|
DOM_DELTA_PAGE = 2;
|
|
370
|
-
},
|
|
370
|
+
}, ht = {
|
|
371
371
|
touchstart: "pointerdown",
|
|
372
372
|
touchend: "pointerup",
|
|
373
373
|
touchendoutside: "pointerupoutside",
|
|
374
374
|
touchmove: "pointermove",
|
|
375
375
|
touchcancel: "pointercancel"
|
|
376
|
-
},
|
|
376
|
+
}, gt = class extends e {
|
|
377
377
|
event;
|
|
378
378
|
target;
|
|
379
379
|
cursor = "default";
|
|
@@ -391,21 +391,21 @@ var dt = class e {
|
|
|
391
391
|
removeEventListeners() {
|
|
392
392
|
if (!this.setuped || !this.target) return;
|
|
393
393
|
let e = this.target.style;
|
|
394
|
-
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") :
|
|
394
|
+
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : Fe && (e.touchAction = ""), Fe ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)), Re && (this.target.removeEventListener("touchstart", this._onPointerDown), this.target.removeEventListener("touchmove", this._onPointerMove), this.target.removeEventListener("touchend", this._onPointerUp)), this.target.removeEventListener("wheel", this._onWheel), typeof document < "u" && (document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("keypress", this._onKeyPress), document.removeEventListener("keyup", this._onKeyUp)), this.target = void 0, this.setuped = !1;
|
|
395
395
|
}
|
|
396
396
|
addEventListeners() {
|
|
397
397
|
if (this.setuped || !this.target) return;
|
|
398
398
|
let e = this.target.style;
|
|
399
|
-
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") :
|
|
399
|
+
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : Fe && (e.touchAction = "none")), Fe ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)), Re && (this.target.addEventListener("touchstart", this._onPointerDown), this.target.addEventListener("touchmove", this._onPointerMove), this.target.addEventListener("touchend", this._onPointerUp)), this.target.addEventListener("wheel", this._onWheel), typeof document < "u" && (document.addEventListener("keydown", this._onKeyDown), document.addEventListener("keypress", this._onKeyPress), document.addEventListener("keyup", this._onKeyUp)), this.setuped = !0;
|
|
400
400
|
}
|
|
401
401
|
normalize(e) {
|
|
402
402
|
let t = [];
|
|
403
|
-
if (
|
|
403
|
+
if (Re && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
|
|
404
404
|
let r = e.changedTouches[n];
|
|
405
405
|
r.button === void 0 && (r.button = 0), r.buttons === void 0 && (r.buttons = 1), r.isPrimary === void 0 && (r.isPrimary = e.touches.length === 1 && e.type === "touchstart"), r.width === void 0 && (r.width = r.radiusX || 1), r.height === void 0 && (r.height = r.radiusY || 1), r.tiltX === void 0 && (r.tiltX = 0), r.tiltY === void 0 && (r.tiltY = 0), r.pointerType === void 0 && (r.pointerType = "touch"), r.pointerId === void 0 && (r.pointerId = r.identifier || 0), r.pressure === void 0 && (r.pressure = r.force || .5), r.twist === void 0 && (r.twist = 0), r.tangentialPressure === void 0 && (r.tangentialPressure = 0), r.layerX === void 0 && (r.layerX = r.offsetX = r.clientX), r.layerY === void 0 && (r.layerY = r.offsetY = r.clientY), r.type = e.type, t.push(r);
|
|
406
406
|
}
|
|
407
|
-
else if (
|
|
408
|
-
else if (
|
|
407
|
+
else if (Ie && e instanceof globalThis.WheelEvent) t.push(e);
|
|
408
|
+
else if (Fe && e instanceof globalThis.PointerEvent) t.push(e);
|
|
409
409
|
else {
|
|
410
410
|
let n = e;
|
|
411
411
|
n.isPrimary === void 0 && (n.isPrimary = !0), n.width === void 0 && (n.width = 1), n.height === void 0 && (n.height = 1), n.tiltX === void 0 && (n.tiltX = 0), n.tiltY === void 0 && (n.tiltY = 0), n.pointerType === void 0 && (n.pointerType = "mouse"), n.pointerId === void 0 && (n.pointerId = 1), n.pressure === void 0 && (n.pressure = .5), n.twist === void 0 && (n.twist = 0), n.tangentialPressure === void 0 && (n.tangentialPressure = 0), t.push(n);
|
|
@@ -413,8 +413,8 @@ var dt = class e {
|
|
|
413
413
|
return t;
|
|
414
414
|
}
|
|
415
415
|
_clonePointerEvent(e) {
|
|
416
|
-
let t = new
|
|
417
|
-
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type =
|
|
416
|
+
let t = new pt();
|
|
417
|
+
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type = ht[t.type] || t.type), t;
|
|
418
418
|
}
|
|
419
419
|
_copyInputEvent(e, t) {
|
|
420
420
|
e.nativeEvent = t, e.bubbles = t.bubbles, e.cancelBubble = t.cancelBubble, e.cancelable = t.cancelable, e.composed = t.composed, e.currentTarget = t.currentTarget, e.defaultPrevented = t.defaultPrevented, e.eventPhase = t.eventPhase, e.isTrusted = t.isTrusted, e.returnValue = t.returnValue, e.srcElement = t.srcElement, e.timeStamp = t.timeStamp, e.type = t.type;
|
|
@@ -423,11 +423,11 @@ var dt = class e {
|
|
|
423
423
|
this._copyInputEvent(e, t), e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
|
|
424
424
|
}
|
|
425
425
|
_cloneWheelEvent(e) {
|
|
426
|
-
let t = new
|
|
426
|
+
let t = new mt();
|
|
427
427
|
return this._copyMouseEvent(t, e), t.wheelDeltaY = e.wheelDeltaY, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t;
|
|
428
428
|
}
|
|
429
429
|
_cloneKeyboardEvent(e) {
|
|
430
|
-
let t = new
|
|
430
|
+
let t = new dt();
|
|
431
431
|
return this._copyInputEvent(t, e), t.altKey = e.altKey, t.charCode = e.charCode, t.code = e.code, t.ctrlKey = e.ctrlKey, t.isComposing = e.isComposing, t.key = e.key, t.keyCode = e.keyCode, t.location = e.location, t.metaKey = e.metaKey, t.repeat = e.repeat, t.shiftKey = e.shiftKey, t;
|
|
432
432
|
}
|
|
433
433
|
setCursor(e = "default") {
|
|
@@ -475,25 +475,25 @@ var dt = class e {
|
|
|
475
475
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
476
476
|
};
|
|
477
477
|
_onPointerDown = (e) => {
|
|
478
|
-
if (
|
|
478
|
+
if (Re && e.pointerType === "touch") return;
|
|
479
479
|
let t = this.normalize(e);
|
|
480
480
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerdown", this.event = this._clonePointerEvent(t[e]));
|
|
481
481
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
482
482
|
};
|
|
483
483
|
_onPointerOver = (e) => {
|
|
484
|
-
if (!this.enableClickEvent ||
|
|
484
|
+
if (!this.enableClickEvent || Re && e.pointerType === "touch") return;
|
|
485
485
|
let t = this.normalize(e);
|
|
486
486
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerover", this.event = this._clonePointerEvent(t[e]));
|
|
487
487
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
488
488
|
};
|
|
489
489
|
_onPointerMove = (e) => {
|
|
490
|
-
if (!this.enableMoveEvent ||
|
|
490
|
+
if (!this.enableMoveEvent || Re && e.pointerType === "touch") return;
|
|
491
491
|
let t = this.normalize(e);
|
|
492
492
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointermove", this.event = this._clonePointerEvent(t[e]));
|
|
493
493
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
494
494
|
};
|
|
495
495
|
_onPointerUp = (e) => {
|
|
496
|
-
if (!this.enableClickEvent ||
|
|
496
|
+
if (!this.enableClickEvent || Re && e.pointerType === "touch") return;
|
|
497
497
|
let t = e.target;
|
|
498
498
|
e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
|
|
499
499
|
let n = t === this.target ? "" : "outside", r = this.normalize(e);
|
|
@@ -512,8 +512,8 @@ var dt = class e {
|
|
|
512
512
|
destroy() {
|
|
513
513
|
this.removeEventListeners(), super.destroy();
|
|
514
514
|
}
|
|
515
|
-
},
|
|
516
|
-
instanceId =
|
|
515
|
+
}, T = class extends n {
|
|
516
|
+
instanceId = lt();
|
|
517
517
|
destroyed = !1;
|
|
518
518
|
get json() {
|
|
519
519
|
return this.toJSON();
|
|
@@ -522,7 +522,7 @@ var dt = class e {
|
|
|
522
522
|
this.setProperties(e);
|
|
523
523
|
}
|
|
524
524
|
_nextTick() {
|
|
525
|
-
return
|
|
525
|
+
return be();
|
|
526
526
|
}
|
|
527
527
|
equal(e) {
|
|
528
528
|
return !!(e && this.instanceId === e.instanceId);
|
|
@@ -531,7 +531,7 @@ var dt = class e {
|
|
|
531
531
|
destroy() {
|
|
532
532
|
this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
|
|
533
533
|
}
|
|
534
|
-
},
|
|
534
|
+
}, _t = class extends T {}, E = class extends _t {}, vt = class e {
|
|
535
535
|
get x() {
|
|
536
536
|
return this.min.x;
|
|
537
537
|
}
|
|
@@ -584,7 +584,7 @@ var dt = class e {
|
|
|
584
584
|
size;
|
|
585
585
|
max;
|
|
586
586
|
constructor(...e) {
|
|
587
|
-
let t = new
|
|
587
|
+
let t = new x(), n = new x();
|
|
588
588
|
switch (e.length) {
|
|
589
589
|
case 0: break;
|
|
590
590
|
case 1: {
|
|
@@ -602,7 +602,7 @@ var dt = class e {
|
|
|
602
602
|
t.set(e[0], e[1]), n.set(Math.max(0, e[2]), Math.max(0, e[3]));
|
|
603
603
|
break;
|
|
604
604
|
}
|
|
605
|
-
this._updateMax = this._updateMax.bind(this), this._updateSize = this._updateSize.bind(this), this.min = new
|
|
605
|
+
this._updateMax = this._updateMax.bind(this), this._updateSize = this._updateSize.bind(this), this.min = new x(t.x, t.y, this._updateMax), this.size = new x(n.x, n.y, this._updateMax), this.max = new x(t.x + n.x, t.y + n.y, this._updateSize);
|
|
606
606
|
}
|
|
607
607
|
_updateSize() {
|
|
608
608
|
return this.size.set(this.max.x - this.min.x, this.max.y - this.min.y), this;
|
|
@@ -629,7 +629,7 @@ var dt = class e {
|
|
|
629
629
|
return this.width * this.height;
|
|
630
630
|
}
|
|
631
631
|
getCenter() {
|
|
632
|
-
return new
|
|
632
|
+
return new x(this.min.x + this.size.x / 2, this.min.y + this.size.y / 2);
|
|
633
633
|
}
|
|
634
634
|
toCssStyle() {
|
|
635
635
|
return {
|
|
@@ -664,13 +664,13 @@ var dt = class e {
|
|
|
664
664
|
};
|
|
665
665
|
//#endregion
|
|
666
666
|
//#region src/core/math/Color.ts
|
|
667
|
-
|
|
668
|
-
var
|
|
667
|
+
pe([me]);
|
|
668
|
+
var yt = class {
|
|
669
669
|
get value() {
|
|
670
670
|
return this._value;
|
|
671
671
|
}
|
|
672
672
|
set value(e) {
|
|
673
|
-
this._value = e, this._colord =
|
|
673
|
+
this._value = e, this._colord = se(e ?? "none");
|
|
674
674
|
}
|
|
675
675
|
get r8() {
|
|
676
676
|
return this._colord.rgba.r;
|
|
@@ -748,8 +748,8 @@ var T = class {
|
|
|
748
748
|
this.a
|
|
749
749
|
];
|
|
750
750
|
}
|
|
751
|
-
}, bt =
|
|
752
|
-
function
|
|
751
|
+
}, bt = xe / 180, xt = 180 / xe;
|
|
752
|
+
function St(e, t, n) {
|
|
753
753
|
return Math.max(t, Math.min(e, n));
|
|
754
754
|
}
|
|
755
755
|
function D(e, t, n) {
|
|
@@ -757,7 +757,7 @@ function D(e, t, n) {
|
|
|
757
757
|
}
|
|
758
758
|
//#endregion
|
|
759
759
|
//#region src/core/math/ColorMatrix.ts
|
|
760
|
-
var
|
|
760
|
+
var Ct = class {
|
|
761
761
|
_array = new Float32Array(20);
|
|
762
762
|
constructor() {
|
|
763
763
|
this.identity();
|
|
@@ -912,7 +912,7 @@ var St = class {
|
|
|
912
912
|
]);
|
|
913
913
|
}
|
|
914
914
|
sepia(e = 1) {
|
|
915
|
-
let t =
|
|
915
|
+
let t = St(e, 0, 1);
|
|
916
916
|
return this.multiply([
|
|
917
917
|
D(1, .393, t),
|
|
918
918
|
D(0, .7689999, t),
|
|
@@ -961,7 +961,7 @@ var St = class {
|
|
|
961
961
|
]);
|
|
962
962
|
}
|
|
963
963
|
grayscale(e = 1) {
|
|
964
|
-
let t =
|
|
964
|
+
let t = St(e, 0, 1), n = D(1, .3, t), r = D(0, .3, t), i = D(1, .59, t), a = D(0, .59, t), o = D(1, .11, t), s = D(0, .11, t);
|
|
965
965
|
return this.multiply([
|
|
966
966
|
n,
|
|
967
967
|
a,
|
|
@@ -1013,7 +1013,7 @@ var St = class {
|
|
|
1013
1013
|
toArray() {
|
|
1014
1014
|
return this._array;
|
|
1015
1015
|
}
|
|
1016
|
-
},
|
|
1016
|
+
}, wt = class e extends vt {
|
|
1017
1017
|
rotation;
|
|
1018
1018
|
get rotationDegrees() {
|
|
1019
1019
|
return this.rotation / bt;
|
|
@@ -1068,7 +1068,7 @@ var St = class {
|
|
|
1068
1068
|
clone() {
|
|
1069
1069
|
return new e(this.toJSON());
|
|
1070
1070
|
}
|
|
1071
|
-
},
|
|
1071
|
+
}, Tt = class {
|
|
1072
1072
|
_array;
|
|
1073
1073
|
x = 0;
|
|
1074
1074
|
y = 0;
|
|
@@ -1105,7 +1105,7 @@ function k(e, t, n, r) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
//#endregion
|
|
1107
1107
|
//#region src/core/os/MainLoop.ts
|
|
1108
|
-
var
|
|
1108
|
+
var Et = class extends T {
|
|
1109
1109
|
_starting = !1;
|
|
1110
1110
|
_nextDeltaTime = 0;
|
|
1111
1111
|
_startedProcess;
|
|
@@ -1119,13 +1119,13 @@ var Tt = class extends C {
|
|
|
1119
1119
|
super(), this._onTicker = this._onTicker.bind(this), this.setProperties(e);
|
|
1120
1120
|
}
|
|
1121
1121
|
start(e) {
|
|
1122
|
-
this._starting || (this._starting = !0, this._startedProcess && this.off("process", this._startedProcess), this._startedProcess = e, this.on("process", e),
|
|
1122
|
+
this._starting || (this._starting = !0, this._startedProcess && this.off("process", this._startedProcess), this._startedProcess = e, this.on("process", e), C.on(this._onTicker, { sort: 0 }));
|
|
1123
1123
|
}
|
|
1124
1124
|
stop() {
|
|
1125
|
-
this._starting && (this._starting = !1,
|
|
1125
|
+
this._starting && (this._starting = !1, C.off(this._onTicker, { sort: 0 }));
|
|
1126
1126
|
}
|
|
1127
1127
|
_onTicker() {
|
|
1128
|
-
let e =
|
|
1128
|
+
let e = C.elapsed * this.speed;
|
|
1129
1129
|
if ((this._nextDeltaTime -= e) <= 0) {
|
|
1130
1130
|
let t = (this._nextDeltaTime = this.spf) || e;
|
|
1131
1131
|
this.emit("process", t);
|
|
@@ -1135,14 +1135,14 @@ var Tt = class extends C {
|
|
|
1135
1135
|
super._destroy(), this.stop();
|
|
1136
1136
|
}
|
|
1137
1137
|
};
|
|
1138
|
-
k([_({ fallback: 60 }), O("design:type", Number)],
|
|
1138
|
+
k([_({ fallback: 60 }), O("design:type", Number)], Et.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Et.prototype, "speed", void 0);
|
|
1139
1139
|
//#endregion
|
|
1140
1140
|
//#region src/core/renderers/gl/buffer/const.ts
|
|
1141
|
-
var
|
|
1141
|
+
var Dt = /* @__PURE__ */ function(e) {
|
|
1142
1142
|
return e[e.elementArrayBuffer = 34963] = "elementArrayBuffer", e[e.arrayBuffer = 34962] = "arrayBuffer", e[e.uniformBuffer = 35345] = "uniformBuffer", e;
|
|
1143
|
-
}({}),
|
|
1143
|
+
}({}), Ot = class {
|
|
1144
1144
|
native;
|
|
1145
|
-
target =
|
|
1145
|
+
target = Dt.arrayBuffer;
|
|
1146
1146
|
byteLength = 0;
|
|
1147
1147
|
dirty = !0;
|
|
1148
1148
|
constructor(e) {
|
|
@@ -1150,7 +1150,7 @@ var Et = /* @__PURE__ */ function(e) {
|
|
|
1150
1150
|
}
|
|
1151
1151
|
}, A = /* @__PURE__ */ function(e) {
|
|
1152
1152
|
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;
|
|
1153
|
-
}({}),
|
|
1153
|
+
}({}), kt = class extends n {
|
|
1154
1154
|
screen = {
|
|
1155
1155
|
x: 0,
|
|
1156
1156
|
y: 0,
|
|
@@ -1169,12 +1169,12 @@ var Et = /* @__PURE__ */ function(e) {
|
|
|
1169
1169
|
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`);
|
|
1170
1170
|
}
|
|
1171
1171
|
};
|
|
1172
|
-
k([_({ fallback:
|
|
1172
|
+
k([_({ fallback: Je }), O("design:type", Number)], kt.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], kt.prototype, "view", void 0);
|
|
1173
1173
|
//#endregion
|
|
1174
1174
|
//#region src/core/renderers/shared/shader/UniformGroup.ts
|
|
1175
|
-
var
|
|
1175
|
+
var At = 0, jt = class {
|
|
1176
1176
|
isUniformGroup = !0;
|
|
1177
|
-
uid = ++
|
|
1177
|
+
uid = ++At;
|
|
1178
1178
|
uniforms;
|
|
1179
1179
|
ubo;
|
|
1180
1180
|
isStatic;
|
|
@@ -1185,10 +1185,10 @@ var kt = 0, At = class {
|
|
|
1185
1185
|
update() {
|
|
1186
1186
|
this._dirtyId++;
|
|
1187
1187
|
}
|
|
1188
|
-
},
|
|
1189
|
-
function
|
|
1190
|
-
let n =
|
|
1191
|
-
return n === void 0 && (
|
|
1188
|
+
}, Mt = Object.create(null), Nt = Object.create(null);
|
|
1189
|
+
function Pt(e, t) {
|
|
1190
|
+
let n = Nt[e];
|
|
1191
|
+
return n === void 0 && (Mt[t] === void 0 && (Mt[t] = 1), Nt[e] = n = Mt[t]++), n;
|
|
1192
1192
|
}
|
|
1193
1193
|
//#endregion
|
|
1194
1194
|
//#region src/core/renderers/gl/system/GlSystem.ts
|
|
@@ -1206,7 +1206,7 @@ var j = class extends e {
|
|
|
1206
1206
|
_setup() {}
|
|
1207
1207
|
flush() {}
|
|
1208
1208
|
reset() {}
|
|
1209
|
-
},
|
|
1209
|
+
}, Ft = class extends j {
|
|
1210
1210
|
install(e) {
|
|
1211
1211
|
super.install(e), e.buffer = this;
|
|
1212
1212
|
}
|
|
@@ -1216,8 +1216,8 @@ var j = class extends e {
|
|
|
1216
1216
|
return this.glBuffers.get(e.instanceId) || this._createGlBuffer(e);
|
|
1217
1217
|
}
|
|
1218
1218
|
_createGlBuffer(e) {
|
|
1219
|
-
let t = this._gl, n = new
|
|
1220
|
-
return e.usage & A.index ? r =
|
|
1219
|
+
let t = this._gl, n = new Ot(t.createBuffer()), r = Dt.arrayBuffer;
|
|
1220
|
+
return e.usage & A.index ? r = Dt.elementArrayBuffer : e.usage & A.uniform && (r = Dt.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
|
|
1221
1221
|
switch (e) {
|
|
1222
1222
|
case "usage":
|
|
1223
1223
|
case "data":
|
|
@@ -1255,13 +1255,13 @@ var j = class extends e {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
this.buffers.clear(), this.glBuffers.clear();
|
|
1257
1257
|
}
|
|
1258
|
-
},
|
|
1259
|
-
function
|
|
1260
|
-
return
|
|
1258
|
+
}, It;
|
|
1259
|
+
function Lt() {
|
|
1260
|
+
return It ||= "mediump", It;
|
|
1261
1261
|
}
|
|
1262
1262
|
//#endregion
|
|
1263
1263
|
//#region src/core/renderers/gl/shader/preprocessors/addProgramDefines.ts
|
|
1264
|
-
function
|
|
1264
|
+
function Rt(e, t, n) {
|
|
1265
1265
|
return t ? e : n ? (e = e.replace("out vec4 finalColor;", ""), `#ifdef GL_ES
|
|
1266
1266
|
#define in varying
|
|
1267
1267
|
#define finalColor gl_FragColor
|
|
@@ -1275,7 +1275,7 @@ ${e}`;
|
|
|
1275
1275
|
}
|
|
1276
1276
|
//#endregion
|
|
1277
1277
|
//#region src/core/renderers/gl/shader/preprocessors/ensurePrecision.ts
|
|
1278
|
-
function
|
|
1278
|
+
function zt(e, t, n) {
|
|
1279
1279
|
let r = n ? t.maxSupportedFragmentPrecision : t.maxSupportedVertexPrecision;
|
|
1280
1280
|
if (e.substring(0, 9) !== "precision") {
|
|
1281
1281
|
let i = n ? t.requestedFragmentPrecision : t.requestedVertexPrecision;
|
|
@@ -1285,31 +1285,31 @@ function Rt(e, t, n) {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
//#endregion
|
|
1287
1287
|
//#region src/core/renderers/gl/shader/preprocessors/insertVersion.ts
|
|
1288
|
-
function
|
|
1288
|
+
function Bt(e, t) {
|
|
1289
1289
|
return t ? `#version 300 es\n${e}` : e;
|
|
1290
1290
|
}
|
|
1291
1291
|
//#endregion
|
|
1292
1292
|
//#region src/core/renderers/gl/shader/preprocessors/setProgramName.ts
|
|
1293
|
-
var
|
|
1294
|
-
function
|
|
1293
|
+
var Vt = {}, Ht = {};
|
|
1294
|
+
function Ut(e, { name: t = "program" }, n = !0) {
|
|
1295
1295
|
t = t.replace(/\s+/g, "-"), t += n ? "-fragment" : "-vertex";
|
|
1296
|
-
let r = n ?
|
|
1296
|
+
let r = n ? Vt : Ht;
|
|
1297
1297
|
return r[t] ? (r[t]++, t += `-${r[t]}`) : r[t] = 1, e.includes("#define SHADER_NAME") ? e : `${`#define SHADER_NAME ${t}`}\n${e}`;
|
|
1298
1298
|
}
|
|
1299
1299
|
//#endregion
|
|
1300
1300
|
//#region src/core/renderers/gl/shader/preprocessors/stripVersion.ts
|
|
1301
|
-
function
|
|
1301
|
+
function Wt(e, t) {
|
|
1302
1302
|
return t ? e.replace("#version 300 es", "") : e;
|
|
1303
1303
|
}
|
|
1304
1304
|
//#endregion
|
|
1305
1305
|
//#region src/core/renderers/gl/shader/GlProgram.ts
|
|
1306
|
-
var
|
|
1307
|
-
stripVersion:
|
|
1308
|
-
ensurePrecision:
|
|
1309
|
-
addProgramDefines:
|
|
1310
|
-
setProgramName:
|
|
1311
|
-
insertVersion:
|
|
1312
|
-
},
|
|
1306
|
+
var Gt = Object.create(null), Kt = {
|
|
1307
|
+
stripVersion: Wt,
|
|
1308
|
+
ensurePrecision: zt,
|
|
1309
|
+
addProgramDefines: Rt,
|
|
1310
|
+
setProgramName: Ut,
|
|
1311
|
+
insertVersion: Bt
|
|
1312
|
+
}, qt = class e {
|
|
1313
1313
|
static defaultOptions = {
|
|
1314
1314
|
preferredVertexPrecision: "highp",
|
|
1315
1315
|
preferredFragmentPrecision: "mediump"
|
|
@@ -1332,25 +1332,25 @@ var Wt = Object.create(null), Gt = {
|
|
|
1332
1332
|
requestedFragmentPrecision: t.preferredFragmentPrecision,
|
|
1333
1333
|
requestedVertexPrecision: t.preferredVertexPrecision,
|
|
1334
1334
|
maxSupportedVertexPrecision: "highp",
|
|
1335
|
-
maxSupportedFragmentPrecision:
|
|
1335
|
+
maxSupportedFragmentPrecision: Lt()
|
|
1336
1336
|
},
|
|
1337
1337
|
setProgramName: { name: t.name },
|
|
1338
1338
|
addProgramDefines: i,
|
|
1339
1339
|
insertVersion: i
|
|
1340
1340
|
};
|
|
1341
|
-
Object.keys(
|
|
1341
|
+
Object.keys(Kt).forEach((e) => {
|
|
1342
1342
|
let t = a[e];
|
|
1343
|
-
n =
|
|
1344
|
-
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id =
|
|
1343
|
+
n = Kt[e](n, t, !0), r = Kt[e](r, t, !1);
|
|
1344
|
+
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Pt(`${r}:${n}`, "GlProgram");
|
|
1345
1345
|
}
|
|
1346
1346
|
destroy() {
|
|
1347
|
-
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete
|
|
1347
|
+
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete Gt[this._cacheKey];
|
|
1348
1348
|
}
|
|
1349
1349
|
static from(t) {
|
|
1350
1350
|
let n = `${t.vertex}:${t.fragment}`;
|
|
1351
|
-
return
|
|
1351
|
+
return Gt[n] || (Gt[n] = new e(t), Gt[n]._cacheKey = n), Gt[n];
|
|
1352
1352
|
}
|
|
1353
|
-
},
|
|
1353
|
+
}, Jt = {
|
|
1354
1354
|
uint8x2: {
|
|
1355
1355
|
size: 2,
|
|
1356
1356
|
stride: 2,
|
|
@@ -1502,18 +1502,18 @@ var Wt = Object.create(null), Gt = {
|
|
|
1502
1502
|
normalized: !1
|
|
1503
1503
|
}
|
|
1504
1504
|
};
|
|
1505
|
-
function
|
|
1506
|
-
return
|
|
1505
|
+
function Yt(e) {
|
|
1506
|
+
return Jt[e] ?? Jt.float32;
|
|
1507
1507
|
}
|
|
1508
1508
|
//#endregion
|
|
1509
1509
|
//#region src/core/renderers/gl/shader/GlProgramData.ts
|
|
1510
|
-
var
|
|
1510
|
+
var Xt = class {
|
|
1511
1511
|
native;
|
|
1512
1512
|
uniformDirtyGroups = Object.create(null);
|
|
1513
1513
|
constructor(e) {
|
|
1514
1514
|
this.native = e;
|
|
1515
1515
|
}
|
|
1516
|
-
},
|
|
1516
|
+
}, Zt, Qt = {
|
|
1517
1517
|
FLOAT: "float",
|
|
1518
1518
|
FLOAT_VEC2: "vec2",
|
|
1519
1519
|
FLOAT_VEC3: "vec3",
|
|
@@ -1542,7 +1542,7 @@ var Yt = class {
|
|
|
1542
1542
|
SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1543
1543
|
INT_SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1544
1544
|
UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
|
|
1545
|
-
},
|
|
1545
|
+
}, $t = {
|
|
1546
1546
|
float: "float32",
|
|
1547
1547
|
vec2: "float32x2",
|
|
1548
1548
|
vec3: "float32x3",
|
|
@@ -1560,29 +1560,29 @@ var Yt = class {
|
|
|
1560
1560
|
bvec3: "uint32x3",
|
|
1561
1561
|
bvec4: "uint32x4"
|
|
1562
1562
|
};
|
|
1563
|
-
function
|
|
1564
|
-
if (!
|
|
1565
|
-
let t = Object.keys(
|
|
1566
|
-
|
|
1563
|
+
function en(e, t) {
|
|
1564
|
+
if (!Zt) {
|
|
1565
|
+
let t = Object.keys(Qt);
|
|
1566
|
+
Zt = {};
|
|
1567
1567
|
for (let n = 0; n < t.length; ++n) {
|
|
1568
1568
|
let r = t[n];
|
|
1569
|
-
|
|
1569
|
+
Zt[e[r]] = Qt[r];
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
return
|
|
1572
|
+
return Zt[t];
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1575
|
-
return
|
|
1574
|
+
function tn(e, t) {
|
|
1575
|
+
return $t[en(e, t)] || "float32";
|
|
1576
1576
|
}
|
|
1577
1577
|
//#endregion
|
|
1578
1578
|
//#region src/core/renderers/gl/shader/GlShaderSystem.ts
|
|
1579
|
-
var
|
|
1579
|
+
var nn = class extends j {
|
|
1580
1580
|
install(e) {
|
|
1581
1581
|
super.install(e), e.shader = this;
|
|
1582
1582
|
}
|
|
1583
1583
|
glProgramDatas = /* @__PURE__ */ new Map();
|
|
1584
1584
|
currentProgram = null;
|
|
1585
|
-
globalUniforms = new
|
|
1585
|
+
globalUniforms = new jt({
|
|
1586
1586
|
projectionMatrix: new Float32Array([
|
|
1587
1587
|
1,
|
|
1588
1588
|
0,
|
|
@@ -1623,7 +1623,7 @@ var tn = class extends j {
|
|
|
1623
1623
|
return this.glProgramDatas.get(e.id) || this._createGlProgramData(e);
|
|
1624
1624
|
}
|
|
1625
1625
|
_createGlProgramData(e) {
|
|
1626
|
-
let t = this._gl, n = new
|
|
1626
|
+
let t = this._gl, n = new Xt(t.createProgram());
|
|
1627
1627
|
this.glProgramDatas.set(e.id, n), this.useProgram(e);
|
|
1628
1628
|
let r = this._createGlShader(e.vertex, t.VERTEX_SHADER), i = this._createGlShader(e.fragment, t.FRAGMENT_SHADER);
|
|
1629
1629
|
if (t.attachShader(n.native, r), t.attachShader(n.native, i), t.linkProgram(n.native), !t.getProgramParameter(n.native, t.LINK_STATUS)) throw Error(`Failed to link program: ${t.getProgramInfoLog(n.native)}`);
|
|
@@ -1631,11 +1631,11 @@ var tn = class extends j {
|
|
|
1631
1631
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_ATTRIBUTES), r = 0; r < e; r++) {
|
|
1632
1632
|
let e = t.getActiveAttrib(n.native, r);
|
|
1633
1633
|
if (!e || e.name.startsWith("gl_")) continue;
|
|
1634
|
-
let i =
|
|
1634
|
+
let i = tn(t, e.type);
|
|
1635
1635
|
a[e.name] = {
|
|
1636
1636
|
location: 0,
|
|
1637
1637
|
format: i,
|
|
1638
|
-
stride:
|
|
1638
|
+
stride: Yt(i).stride,
|
|
1639
1639
|
offset: 0,
|
|
1640
1640
|
instance: !1,
|
|
1641
1641
|
start: 0
|
|
@@ -1652,7 +1652,7 @@ var tn = class extends j {
|
|
|
1652
1652
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_UNIFORMS), r = 0; r < e; r++) {
|
|
1653
1653
|
let e = t.getActiveUniform(n.native, r);
|
|
1654
1654
|
if (!e) continue;
|
|
1655
|
-
let i = e.name.replace(/\[.*?\]$/, ""), a =
|
|
1655
|
+
let i = e.name.replace(/\[.*?\]$/, ""), a = en(t, e.type), o = e.size;
|
|
1656
1656
|
c[i] = {
|
|
1657
1657
|
name: i,
|
|
1658
1658
|
index: r,
|
|
@@ -1687,7 +1687,7 @@ var tn = class extends j {
|
|
|
1687
1687
|
let { type: s, isArray: c, name: l } = o;
|
|
1688
1688
|
o.location === void 0 && (o.location = r.getUniformLocation(t.native, l));
|
|
1689
1689
|
let u = o.location;
|
|
1690
|
-
if (
|
|
1690
|
+
if (rn(o.value, a)) switch (o.value = an(o.value, a), s) {
|
|
1691
1691
|
case "float":
|
|
1692
1692
|
c ? r.uniform1fv(u, a) : r.uniform1f(u, a);
|
|
1693
1693
|
break;
|
|
@@ -1774,7 +1774,7 @@ var tn = class extends j {
|
|
|
1774
1774
|
super.destroy(), this.bind(null);
|
|
1775
1775
|
}
|
|
1776
1776
|
};
|
|
1777
|
-
function
|
|
1777
|
+
function rn(e, t) {
|
|
1778
1778
|
if (typeof t == "object" && t) {
|
|
1779
1779
|
let n = t.length;
|
|
1780
1780
|
if (typeof e != "object" || !e || e.length !== n) return !0;
|
|
@@ -1783,7 +1783,7 @@ function nn(e, t) {
|
|
|
1783
1783
|
}
|
|
1784
1784
|
return e !== t;
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1786
|
+
function an(e, t) {
|
|
1787
1787
|
if (typeof t == "object" && t) {
|
|
1788
1788
|
let n = t.length;
|
|
1789
1789
|
if (typeof e == "object" && e && e.length === n) {
|
|
@@ -1796,10 +1796,10 @@ function rn(e, t) {
|
|
|
1796
1796
|
}
|
|
1797
1797
|
//#endregion
|
|
1798
1798
|
//#region src/core/renderers/gl/state/GlBlendMode.ts
|
|
1799
|
-
var
|
|
1799
|
+
var on = /* @__PURE__ */ function(e) {
|
|
1800
1800
|
return e.normal = "normal", e.add = "add", e.multiply = "multiply", e.screen = "screen", e.none = "none", e.normalNpm = "normalNpm", e.addNpm = "add_npm", e.screenNpm = "screenNpm", e.srcIn = "srcIn", e.srcOut = "srcOut", e.srcAtop = "srcAtop", e.dstOver = "dstOver", e.dstIn = "dstIn", e.dstOut = "dstOut", e.dstAtop = "dstAtop", e.xor = "xor", e.subtract = "subtract", e;
|
|
1801
1801
|
}({});
|
|
1802
|
-
function
|
|
1802
|
+
function sn(e) {
|
|
1803
1803
|
return {
|
|
1804
1804
|
normal: [e.ONE, e.ONE_MINUS_SRC_ALPHA],
|
|
1805
1805
|
add: [e.ONE, e.ONE],
|
|
@@ -1854,7 +1854,7 @@ function on(e) {
|
|
|
1854
1854
|
}
|
|
1855
1855
|
//#endregion
|
|
1856
1856
|
//#region src/core/renderers/gl/state/GlStateSystem.ts
|
|
1857
|
-
var
|
|
1857
|
+
var cn = class e {
|
|
1858
1858
|
static _properties = [
|
|
1859
1859
|
"blend",
|
|
1860
1860
|
"offsets",
|
|
@@ -1881,14 +1881,14 @@ var sn = class e {
|
|
|
1881
1881
|
let t = new e();
|
|
1882
1882
|
return t.depthTest = !1, t.blend = !0, t;
|
|
1883
1883
|
}
|
|
1884
|
-
_blendMode =
|
|
1884
|
+
_blendMode = on.normal;
|
|
1885
1885
|
_polygonOffset = 0;
|
|
1886
1886
|
bitmap = 0;
|
|
1887
1887
|
get blendMode() {
|
|
1888
1888
|
return this._blendMode;
|
|
1889
1889
|
}
|
|
1890
1890
|
set blendMode(e) {
|
|
1891
|
-
this.blend = e !==
|
|
1891
|
+
this.blend = e !== on.none, this._blendMode = e;
|
|
1892
1892
|
}
|
|
1893
1893
|
get polygonOffset() {
|
|
1894
1894
|
return this._polygonOffset;
|
|
@@ -1900,19 +1900,19 @@ var sn = class e {
|
|
|
1900
1900
|
if (e) for (let t in e) this[t] = e[t];
|
|
1901
1901
|
}
|
|
1902
1902
|
};
|
|
1903
|
-
|
|
1904
|
-
var
|
|
1903
|
+
cn._init();
|
|
1904
|
+
var ln = class extends j {
|
|
1905
1905
|
install(e) {
|
|
1906
1906
|
super.install(e), e.state = this;
|
|
1907
1907
|
}
|
|
1908
1908
|
_blendEq = !1;
|
|
1909
|
-
_setters =
|
|
1909
|
+
_setters = cn._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
|
|
1910
1910
|
boundStateBitmap = 0;
|
|
1911
1911
|
boundBlendMode;
|
|
1912
1912
|
blendModes;
|
|
1913
|
-
defaultState = new
|
|
1913
|
+
defaultState = new cn({ blend: !0 });
|
|
1914
1914
|
_updateContext(e) {
|
|
1915
|
-
super._updateContext(e), this.blendModes =
|
|
1915
|
+
super._updateContext(e), this.blendModes = sn(e);
|
|
1916
1916
|
}
|
|
1917
1917
|
toggle(e, t) {
|
|
1918
1918
|
this._renderer.gl[t ? "enable" : "disable"](e);
|
|
@@ -1955,14 +1955,14 @@ var cn = class extends j {
|
|
|
1955
1955
|
}
|
|
1956
1956
|
reset() {
|
|
1957
1957
|
super.reset();
|
|
1958
|
-
let e = (1 <<
|
|
1958
|
+
let e = (1 << cn._properties.length) - 1;
|
|
1959
1959
|
this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
|
|
1960
1960
|
}
|
|
1961
|
-
},
|
|
1961
|
+
}, un = class extends j {
|
|
1962
1962
|
install(e) {
|
|
1963
1963
|
super.install(e), e.batch2D = this;
|
|
1964
1964
|
}
|
|
1965
|
-
_state =
|
|
1965
|
+
_state = cn.for2D();
|
|
1966
1966
|
_batchSize = 4096 * 4;
|
|
1967
1967
|
_batchables = [];
|
|
1968
1968
|
_vertexCount = 0;
|
|
@@ -1983,8 +1983,8 @@ var cn = class extends j {
|
|
|
1983
1983
|
}
|
|
1984
1984
|
_createShader(e) {
|
|
1985
1985
|
let t = this._renderer, n = {
|
|
1986
|
-
instanceId:
|
|
1987
|
-
glProgram: new
|
|
1986
|
+
instanceId: lt(),
|
|
1987
|
+
glProgram: new qt({
|
|
1988
1988
|
vertex: "precision highp float;\nin vec2 aPosition;\nin vec2 aUv;\nin vec4 aTextureParams;\nin vec4 aModulate;\n\nuniform vec2 size;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\n\nout float vTextureId;\nout float vClipOutsideUv;\nout vec2 vUv;\nout vec4 vModulate;\n\nvec2 roundPixels(vec2 position, vec2 targetSize) {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void) {\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n mat3 modelViewProjectionMatrix = projectionMatrix * viewMatrix * modelMatrix;\n gl_Position = vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vTextureId = aTextureParams.x;\n vClipOutsideUv = aTextureParams.y;\n if (aTextureParams.z == 1.) {\n gl_Position.xy = roundPixels(gl_Position.xy, size);\n }\n vUv = aUv;\n vModulate = aModulate;\n}",
|
|
1989
1989
|
fragment: `precision highp float;
|
|
1990
1990
|
in float vTextureId;
|
|
@@ -2013,15 +2013,15 @@ void main(void) {
|
|
|
2013
2013
|
}`
|
|
2014
2014
|
})
|
|
2015
2015
|
}, r = {
|
|
2016
|
-
instanceId:
|
|
2016
|
+
instanceId: lt(),
|
|
2017
2017
|
usage: A.vertex,
|
|
2018
2018
|
data: new Float32Array()
|
|
2019
2019
|
}, i = {
|
|
2020
|
-
instanceId:
|
|
2020
|
+
instanceId: lt(),
|
|
2021
2021
|
usage: A.index,
|
|
2022
2022
|
data: new Uint32Array()
|
|
2023
2023
|
}, a = {
|
|
2024
|
-
instanceId:
|
|
2024
|
+
instanceId: lt(),
|
|
2025
2025
|
topology: "triangle-list",
|
|
2026
2026
|
attributes: Object.fromEntries(Object.entries(this._attributes).map(([e, t]) => [e, {
|
|
2027
2027
|
...t,
|
|
@@ -2061,16 +2061,16 @@ void main(void) {
|
|
|
2061
2061
|
let { indices: r, vertices: p, uvs: h = new Float32Array(), size: g = {
|
|
2062
2062
|
width: 0,
|
|
2063
2063
|
height: 0
|
|
2064
|
-
}, texture: ee, blendMode: te =
|
|
2064
|
+
}, texture: ee, blendMode: te = on.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
|
|
2065
2065
|
255,
|
|
2066
2066
|
255,
|
|
2067
2067
|
255,
|
|
2068
2068
|
255
|
|
2069
2069
|
] } = n[e];
|
|
2070
2070
|
m < e && t.blendMode !== te && (t.size = l - t.start, u.push(t), m = e, t = { id: ++d }, t.textures = i, t.textureLocationMap = f, t.start = l);
|
|
2071
|
-
let { width: ae, height: oe } = g,
|
|
2072
|
-
for (let e = p.length, t = 0; t < e; t += 2)
|
|
2073
|
-
for (let e = r.length, t = 0; t < e; t++) s[l++] =
|
|
2071
|
+
let { width: ae, height: oe } = g, se = c / this._vertexSize, _ = (ee ? f.get(ee) : 255) ?? 255, ce = +!!re, le = +!!ne, v, ue, y;
|
|
2072
|
+
for (let e = p.length, t = 0; t < e; t += 2) v = h[t], ue = h[t + 1], ae > 0 && oe > 0 && (v = Math.ceil(v * ae) / ae, ue = Math.ceil(ue * oe) / oe), a[c++] = p[t], a[c++] = p[t + 1], a[c++] = v, a[c++] = ue, y = c * 4, o[y] = _, o[y + 1] = le, o[y + 2] = ce, o[y + 3] = 0, c++, y = c * 4, o[y] = ie[0], o[y + 1] = ie[1], o[y + 2] = ie[2], o[y + 3] = ie[3], c++;
|
|
2073
|
+
for (let e = r.length, t = 0; t < e; t++) s[l++] = se + r[t];
|
|
2074
2074
|
t.blendMode = te;
|
|
2075
2075
|
}
|
|
2076
2076
|
m = h + 1, t.size = l - t.start, u.push(t), t = { id: ++d }, i = [], f = /* @__PURE__ */ new Map();
|
|
@@ -2091,22 +2091,22 @@ void main(void) {
|
|
|
2091
2091
|
}
|
|
2092
2092
|
}
|
|
2093
2093
|
_getBufferData(e) {
|
|
2094
|
-
let t =
|
|
2094
|
+
let t = dn(Math.ceil(e / 8)), n = fn(t), r = t * 8;
|
|
2095
2095
|
this._attributeBuffer.length <= n && (this._attributeBuffer.length = n + 1);
|
|
2096
2096
|
let i = this._attributeBuffer[n];
|
|
2097
2097
|
return i || (this._attributeBuffer[n] = i = /* @__PURE__ */ new ArrayBuffer(r * this._vertexSize * 4)), i;
|
|
2098
2098
|
}
|
|
2099
2099
|
_getIndexBufferData(e) {
|
|
2100
|
-
let t =
|
|
2100
|
+
let t = dn(Math.ceil(e / 12)), n = fn(t), r = t * 12;
|
|
2101
2101
|
this._indexBuffers.length <= n && (this._indexBuffers.length = n + 1);
|
|
2102
2102
|
let i = this._indexBuffers[n];
|
|
2103
2103
|
return i || (this._indexBuffers[n] = i = new Uint32Array(r)), i;
|
|
2104
2104
|
}
|
|
2105
2105
|
};
|
|
2106
|
-
function
|
|
2106
|
+
function dn(e) {
|
|
2107
2107
|
return e += +(e === 0), --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e + 1;
|
|
2108
2108
|
}
|
|
2109
|
-
function
|
|
2109
|
+
function fn(e) {
|
|
2110
2110
|
let t = (e > 65535) << 4;
|
|
2111
2111
|
e >>>= t;
|
|
2112
2112
|
let n = (e > 255) << 3;
|
|
@@ -2116,9 +2116,9 @@ function dn(e) {
|
|
|
2116
2116
|
//#region src/core/renderers/gl/const.ts
|
|
2117
2117
|
var M = /* @__PURE__ */ function(e) {
|
|
2118
2118
|
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;
|
|
2119
|
-
}({}),
|
|
2119
|
+
}({}), pn = /* @__PURE__ */ function(e) {
|
|
2120
2120
|
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;
|
|
2121
|
-
}({}),
|
|
2121
|
+
}({}), mn = class extends j {
|
|
2122
2122
|
install(e) {
|
|
2123
2123
|
super.install(e), e.mask = this;
|
|
2124
2124
|
}
|
|
@@ -2143,10 +2143,10 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
2143
2143
|
let t = this.stack.pop();
|
|
2144
2144
|
if (!t || t.source !== e) return;
|
|
2145
2145
|
let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2146
|
-
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(
|
|
2146
|
+
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(pn.stencil), this._renderer.stencil.bind(M.disabled, i)) : this._renderer.stencil.bind(M.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2147
2147
|
}
|
|
2148
|
-
},
|
|
2149
|
-
|
|
2148
|
+
}, hn = [];
|
|
2149
|
+
hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
|
|
2150
2150
|
stencilFront: {
|
|
2151
2151
|
compare: "equal",
|
|
2152
2152
|
passOp: "increment-clamp"
|
|
@@ -2155,7 +2155,7 @@ mn[M.none] = {}, mn[M.disabled] = {}, mn[M.renderingMaskAdd] = {
|
|
|
2155
2155
|
compare: "equal",
|
|
2156
2156
|
passOp: "increment-clamp"
|
|
2157
2157
|
}
|
|
2158
|
-
},
|
|
2158
|
+
}, hn[M.renderingMaskRemove] = {
|
|
2159
2159
|
stencilFront: {
|
|
2160
2160
|
compare: "equal",
|
|
2161
2161
|
passOp: "decrement-clamp"
|
|
@@ -2164,7 +2164,7 @@ mn[M.none] = {}, mn[M.disabled] = {}, mn[M.renderingMaskAdd] = {
|
|
|
2164
2164
|
compare: "equal",
|
|
2165
2165
|
passOp: "decrement-clamp"
|
|
2166
2166
|
}
|
|
2167
|
-
},
|
|
2167
|
+
}, hn[M.maskActive] = {
|
|
2168
2168
|
stencilFront: {
|
|
2169
2169
|
compare: "equal",
|
|
2170
2170
|
passOp: "keep"
|
|
@@ -2173,7 +2173,7 @@ mn[M.none] = {}, mn[M.disabled] = {}, mn[M.renderingMaskAdd] = {
|
|
|
2173
2173
|
compare: "equal",
|
|
2174
2174
|
passOp: "keep"
|
|
2175
2175
|
}
|
|
2176
|
-
},
|
|
2176
|
+
}, hn[M.inverseMaskActive] = {
|
|
2177
2177
|
stencilFront: {
|
|
2178
2178
|
compare: "not-equal",
|
|
2179
2179
|
passOp: "keep"
|
|
@@ -2183,7 +2183,7 @@ mn[M.none] = {}, mn[M.disabled] = {}, mn[M.renderingMaskAdd] = {
|
|
|
2183
2183
|
passOp: "keep"
|
|
2184
2184
|
}
|
|
2185
2185
|
};
|
|
2186
|
-
var
|
|
2186
|
+
var gn = class extends j {
|
|
2187
2187
|
install(e) {
|
|
2188
2188
|
super.install(e), e.stencil = this;
|
|
2189
2189
|
}
|
|
@@ -2235,7 +2235,7 @@ var hn = class extends j {
|
|
|
2235
2235
|
}
|
|
2236
2236
|
};
|
|
2237
2237
|
bind(e, t) {
|
|
2238
|
-
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i =
|
|
2238
|
+
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = hn[e], a = this._cache;
|
|
2239
2239
|
if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
|
|
2240
2240
|
this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
|
|
2241
2241
|
return;
|
|
@@ -2245,8 +2245,8 @@ var hn = class extends j {
|
|
|
2245
2245
|
destroy() {
|
|
2246
2246
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
2247
2247
|
}
|
|
2248
|
-
},
|
|
2249
|
-
current = new
|
|
2248
|
+
}, _n = class extends j {
|
|
2249
|
+
current = new vt(0, 0, 0, 0);
|
|
2250
2250
|
install(e) {
|
|
2251
2251
|
super.install(e), e.viewport = this;
|
|
2252
2252
|
}
|
|
@@ -2254,7 +2254,7 @@ var hn = class extends j {
|
|
|
2254
2254
|
let t = this.current, n = Math.floor(e.x), r = Math.floor(e.y), i = Math.floor(e.width), a = Math.floor(e.height);
|
|
2255
2255
|
t.x === n && t.y === r && t.width === i && t.height === a || (this._gl.viewport(n, r, i, a), t.x = n, t.y = r, t.width = i, t.height = a);
|
|
2256
2256
|
}
|
|
2257
|
-
},
|
|
2257
|
+
}, vn = class {
|
|
2258
2258
|
framebuffer;
|
|
2259
2259
|
width = -1;
|
|
2260
2260
|
height = -1;
|
|
@@ -2265,7 +2265,7 @@ var hn = class extends j {
|
|
|
2265
2265
|
constructor(e) {
|
|
2266
2266
|
this.framebuffer = e;
|
|
2267
2267
|
}
|
|
2268
|
-
},
|
|
2268
|
+
}, yn = class extends j {
|
|
2269
2269
|
install(e) {
|
|
2270
2270
|
super.install(e), e.renderTarget = this;
|
|
2271
2271
|
}
|
|
@@ -2275,7 +2275,7 @@ var hn = class extends j {
|
|
|
2275
2275
|
_msaaSamples = [];
|
|
2276
2276
|
_hasMRT = !0;
|
|
2277
2277
|
_writeDepthTexture = !0;
|
|
2278
|
-
projection = new
|
|
2278
|
+
projection = new Tt();
|
|
2279
2279
|
_updateContext(e) {
|
|
2280
2280
|
if (super._updateContext(e), this._hasMRT = !0, this._writeDepthTexture = !0, this._renderer.version === 1) {
|
|
2281
2281
|
let t = this._renderer.extensions.drawBuffers, n = this._renderer.extensions.depthTexture;
|
|
@@ -2311,7 +2311,7 @@ var hn = class extends j {
|
|
|
2311
2311
|
return this.glRenderTargets.get(e.instanceId) || this._createGlRenderTarget(e);
|
|
2312
2312
|
}
|
|
2313
2313
|
_createGlRenderTarget(e) {
|
|
2314
|
-
let t = this._gl, n = new
|
|
2314
|
+
let t = this._gl, n = new vn(t.createFramebuffer());
|
|
2315
2315
|
return this.glRenderTargets.set(e.instanceId, n), this.renderTargets.get(e.instanceId) || (this.renderTargets.set(e.instanceId, e), this._update(e, n), "on" in e && (e.on("updateProperty", (t) => {
|
|
2316
2316
|
switch (t) {
|
|
2317
2317
|
case "width":
|
|
@@ -2388,28 +2388,28 @@ var hn = class extends j {
|
|
|
2388
2388
|
reset() {
|
|
2389
2389
|
super.reset(), this._renderer.contextLost || this.glRenderTargets.forEach((e) => this.destroyGpuRenderTarget(e)), this.renderTargets.clear(), this.glRenderTargets.clear(), this.current = null, this._msaaSamples.length = 0;
|
|
2390
2390
|
}
|
|
2391
|
-
},
|
|
2391
|
+
}, bn = /* @__PURE__ */ function(e) {
|
|
2392
2392
|
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;
|
|
2393
|
-
}({}),
|
|
2393
|
+
}({}), xn = /* @__PURE__ */ function(e) {
|
|
2394
2394
|
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;
|
|
2395
2395
|
}({}), N = /* @__PURE__ */ function(e) {
|
|
2396
2396
|
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;
|
|
2397
|
-
}({}),
|
|
2397
|
+
}({}), Sn = class {
|
|
2398
2398
|
native;
|
|
2399
|
-
target =
|
|
2399
|
+
target = xn.TEXTURE_2D;
|
|
2400
2400
|
width = -1;
|
|
2401
2401
|
height = -1;
|
|
2402
2402
|
mipmap = !1;
|
|
2403
2403
|
type = N.UNSIGNED_BYTE;
|
|
2404
|
-
internalFormat =
|
|
2405
|
-
format =
|
|
2404
|
+
internalFormat = bn.RGBA;
|
|
2405
|
+
format = bn.RGBA;
|
|
2406
2406
|
constructor(e) {
|
|
2407
2407
|
this.native = e;
|
|
2408
2408
|
}
|
|
2409
2409
|
};
|
|
2410
2410
|
//#endregion
|
|
2411
2411
|
//#region src/core/renderers/gl/texture/mapFormatToGlFormat.ts
|
|
2412
|
-
function
|
|
2412
|
+
function Cn(e) {
|
|
2413
2413
|
return {
|
|
2414
2414
|
r8unorm: e.RED,
|
|
2415
2415
|
r8snorm: e.RED,
|
|
@@ -2457,7 +2457,7 @@ function Sn(e) {
|
|
|
2457
2457
|
}
|
|
2458
2458
|
//#endregion
|
|
2459
2459
|
//#region src/core/renderers/gl/texture/mapFormatToGlInternalFormat.ts
|
|
2460
|
-
function
|
|
2460
|
+
function wn(e, t) {
|
|
2461
2461
|
let n = {}, r = e.RGBA;
|
|
2462
2462
|
return e instanceof WebGLRenderingContext ? t.srgb && (n = {
|
|
2463
2463
|
"rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
|
|
@@ -2573,7 +2573,7 @@ function Cn(e, t) {
|
|
|
2573
2573
|
}
|
|
2574
2574
|
//#endregion
|
|
2575
2575
|
//#region src/core/renderers/gl/texture/mapFormatToGlType.ts
|
|
2576
|
-
function
|
|
2576
|
+
function Tn(e) {
|
|
2577
2577
|
return {
|
|
2578
2578
|
r8unorm: e.UNSIGNED_BYTE,
|
|
2579
2579
|
r8snorm: e.BYTE,
|
|
@@ -2621,7 +2621,7 @@ function wn(e) {
|
|
|
2621
2621
|
}
|
|
2622
2622
|
//#endregion
|
|
2623
2623
|
//#region src/core/renderers/gl/texture/updateTextureStyle.ts
|
|
2624
|
-
var
|
|
2624
|
+
var En = {
|
|
2625
2625
|
linear: {
|
|
2626
2626
|
linear: 9987,
|
|
2627
2627
|
nearest: 9985
|
|
@@ -2630,10 +2630,10 @@ var Tn = {
|
|
|
2630
2630
|
linear: 9986,
|
|
2631
2631
|
nearest: 9984
|
|
2632
2632
|
}
|
|
2633
|
-
},
|
|
2633
|
+
}, Dn = {
|
|
2634
2634
|
linear: 9729,
|
|
2635
2635
|
nearest: 9728
|
|
2636
|
-
},
|
|
2636
|
+
}, On = {
|
|
2637
2637
|
never: 512,
|
|
2638
2638
|
less: 513,
|
|
2639
2639
|
equal: 514,
|
|
@@ -2642,32 +2642,32 @@ var Tn = {
|
|
|
2642
2642
|
"not-equal": 517,
|
|
2643
2643
|
"greater-equal": 518,
|
|
2644
2644
|
always: 519
|
|
2645
|
-
},
|
|
2645
|
+
}, kn = {
|
|
2646
2646
|
"clamp-to-edge": 33071,
|
|
2647
2647
|
repeat: 10497,
|
|
2648
2648
|
"mirror-repeat": 33648
|
|
2649
2649
|
};
|
|
2650
|
-
function
|
|
2650
|
+
function An(e, t, n, r, i, a, o, s) {
|
|
2651
2651
|
let { addressModeU: c = "repeat", addressModeV: l = "repeat", addressModeW: u = "repeat", magFilter: d = "linear", minFilter: f = "linear", mipmapFilter: p = "linear", maxAnisotropy: m = 0, compare: h } = e, g = a;
|
|
2652
2652
|
if (!s || c !== "repeat" || l !== "repeat" || u !== "repeat") {
|
|
2653
|
-
let e =
|
|
2653
|
+
let e = kn[o ? "clamp-to-edge" : c], n = kn[o ? "clamp-to-edge" : l], r = kn[o ? "clamp-to-edge" : u];
|
|
2654
2654
|
t[i](g, t.TEXTURE_WRAP_S, e), t[i](g, t.TEXTURE_WRAP_T, n), t.TEXTURE_WRAP_R && t[i](g, t.TEXTURE_WRAP_R, r);
|
|
2655
2655
|
}
|
|
2656
|
-
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER,
|
|
2656
|
+
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, Dn[d]), n) {
|
|
2657
2657
|
if (!s || p !== "linear") {
|
|
2658
|
-
let e =
|
|
2658
|
+
let e = En[f][p];
|
|
2659
2659
|
t[i](g, t.TEXTURE_MIN_FILTER, e);
|
|
2660
2660
|
}
|
|
2661
|
-
} else t[i](g, t.TEXTURE_MIN_FILTER,
|
|
2661
|
+
} else t[i](g, t.TEXTURE_MIN_FILTER, Dn[f]);
|
|
2662
2662
|
if (r && m > 1) {
|
|
2663
2663
|
let e = Math.min(m, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
|
|
2664
2664
|
t[i](g, r.TEXTURE_MAX_ANISOTROPY_EXT, e);
|
|
2665
2665
|
}
|
|
2666
|
-
h && t[i](g, t.TEXTURE_COMPARE_FUNC,
|
|
2666
|
+
h && t[i](g, t.TEXTURE_COMPARE_FUNC, On[h]);
|
|
2667
2667
|
}
|
|
2668
2668
|
//#endregion
|
|
2669
2669
|
//#region src/core/renderers/gl/texture/uploaders/index.ts
|
|
2670
|
-
var
|
|
2670
|
+
var jn = {
|
|
2671
2671
|
buffer: {
|
|
2672
2672
|
id: "buffer",
|
|
2673
2673
|
upload: (e, t, n) => {
|
|
@@ -2681,8 +2681,8 @@ var An = {
|
|
|
2681
2681
|
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;
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
|
-
},
|
|
2685
|
-
uploaders = { ...
|
|
2684
|
+
}, Mn = class extends j {
|
|
2685
|
+
uploaders = { ...jn };
|
|
2686
2686
|
textures = /* @__PURE__ */ new Map();
|
|
2687
2687
|
glTextures = /* @__PURE__ */ new Map();
|
|
2688
2688
|
_mapFormatToInternalFormat = Object.create(null);
|
|
@@ -2697,14 +2697,14 @@ var An = {
|
|
|
2697
2697
|
super.install(e), e.texture = this;
|
|
2698
2698
|
}
|
|
2699
2699
|
_updateContext(e) {
|
|
2700
|
-
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat =
|
|
2700
|
+
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = wn(e, this._renderer.extensions), this._mapFormatToType = Tn(e), this._mapFormatToFormat = Cn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
|
|
2701
2701
|
for (let e = 0; e < this.maxTextureImageUnits; e++) this.unbind(e);
|
|
2702
2702
|
}
|
|
2703
2703
|
getGlTexture(e) {
|
|
2704
2704
|
return this.glTextures.get(e.instanceId) || this._createGlTexture(e);
|
|
2705
2705
|
}
|
|
2706
2706
|
_createGlTexture(e) {
|
|
2707
|
-
let t = this._gl, n = new
|
|
2707
|
+
let t = this._gl, n = new Sn(t.createTexture());
|
|
2708
2708
|
if (t.bindTexture(n.target, n.native), n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], this.glTextures.set(e.instanceId, n), e.mipmap && (this._renderer.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
|
|
2709
2709
|
let t = Math.max(e.width, e.height);
|
|
2710
2710
|
e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
|
|
@@ -2764,7 +2764,7 @@ var An = {
|
|
|
2764
2764
|
}
|
|
2765
2765
|
updateStyle(e, t = !1) {
|
|
2766
2766
|
let n = this._gl;
|
|
2767
|
-
|
|
2767
|
+
An(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
|
|
2768
2768
|
}
|
|
2769
2769
|
updateGpuTexture(e) {
|
|
2770
2770
|
this.bind(e);
|
|
@@ -2779,7 +2779,7 @@ var An = {
|
|
|
2779
2779
|
let e = this._gl;
|
|
2780
2780
|
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);
|
|
2781
2781
|
}
|
|
2782
|
-
},
|
|
2782
|
+
}, Nn = {
|
|
2783
2783
|
uint8x2: N.UNSIGNED_BYTE,
|
|
2784
2784
|
uint8x4: N.UNSIGNED_BYTE,
|
|
2785
2785
|
sint8x2: N.BYTE,
|
|
@@ -2811,18 +2811,18 @@ var An = {
|
|
|
2811
2811
|
sint32x3: N.INT,
|
|
2812
2812
|
sint32x4: N.INT
|
|
2813
2813
|
};
|
|
2814
|
-
function
|
|
2815
|
-
return
|
|
2814
|
+
function Pn(e) {
|
|
2815
|
+
return Nn[e] ?? Nn.float32;
|
|
2816
2816
|
}
|
|
2817
2817
|
//#endregion
|
|
2818
2818
|
//#region src/core/renderers/gl/geometry/GlGeometrySystem.ts
|
|
2819
|
-
var
|
|
2819
|
+
var Fn = {
|
|
2820
2820
|
"point-list": 0,
|
|
2821
2821
|
"line-list": 1,
|
|
2822
2822
|
"line-strip": 3,
|
|
2823
2823
|
"triangle-list": 4,
|
|
2824
2824
|
"triangle-strip": 5
|
|
2825
|
-
},
|
|
2825
|
+
}, In = class extends j {
|
|
2826
2826
|
_geometryVaoHash = {};
|
|
2827
2827
|
hasInstance = !1;
|
|
2828
2828
|
current = null;
|
|
@@ -2861,11 +2861,11 @@ var Pn = {
|
|
|
2861
2861
|
}
|
|
2862
2862
|
for (let e in r) {
|
|
2863
2863
|
let t = r[e];
|
|
2864
|
-
i[t.buffer.instanceId] +=
|
|
2864
|
+
i[t.buffer.instanceId] += Yt(t.format).stride;
|
|
2865
2865
|
}
|
|
2866
2866
|
for (let e in r) {
|
|
2867
2867
|
let t = r[e];
|
|
2868
|
-
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] +=
|
|
2868
|
+
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += Yt(t.format).stride;
|
|
2869
2869
|
}
|
|
2870
2870
|
}
|
|
2871
2871
|
_createVao(e, t) {
|
|
@@ -2900,7 +2900,7 @@ var Pn = {
|
|
|
2900
2900
|
a !== c && (r.bind(s), a = c);
|
|
2901
2901
|
let e = l.location;
|
|
2902
2902
|
n.enableVertexAttribArray(e);
|
|
2903
|
-
let t =
|
|
2903
|
+
let t = Yt(o.format), i = Pn(o.format);
|
|
2904
2904
|
if (l.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride ?? 0, o.start ?? 0) : n.vertexAttribPointer(e, t.size, i, t.normalized, o.stride ?? 0, o.start ?? 0), o.instance) if (this.hasInstance) {
|
|
2905
2905
|
let t = o.divisor ?? 1;
|
|
2906
2906
|
n.vertexAttribDivisor(e, t);
|
|
@@ -2933,7 +2933,7 @@ var Pn = {
|
|
|
2933
2933
|
let { topology: t, size: n, start: r = 0, instanceCount: i } = e, { gl: a } = this._renderer, o = this.current;
|
|
2934
2934
|
if (!o) return this;
|
|
2935
2935
|
t = t || o.topology || "triangle-list";
|
|
2936
|
-
let s =
|
|
2936
|
+
let s = Fn[t];
|
|
2937
2937
|
if (i = i || o.instanceCount || 1, o.indexBuffer) {
|
|
2938
2938
|
n ||= o.indexBuffer.data.length;
|
|
2939
2939
|
let e = o.indexBuffer.data.BYTES_PER_ELEMENT, t = e === 2 ? a.UNSIGNED_SHORT : a.UNSIGNED_INT;
|
|
@@ -2954,7 +2954,7 @@ var Pn = {
|
|
|
2954
2954
|
}
|
|
2955
2955
|
this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
|
|
2956
2956
|
}
|
|
2957
|
-
},
|
|
2957
|
+
}, Ln = class extends j {
|
|
2958
2958
|
install(e) {
|
|
2959
2959
|
super.install(e), e.colorMask = this;
|
|
2960
2960
|
}
|
|
@@ -2965,19 +2965,19 @@ var Pn = {
|
|
|
2965
2965
|
};
|
|
2966
2966
|
//#endregion
|
|
2967
2967
|
//#region src/core/renderers/gl/GlScissorSystem.ts
|
|
2968
|
-
function
|
|
2968
|
+
function Rn(e, t, n) {
|
|
2969
2969
|
let [r, i, a, o, s, c, l, u, d] = e, f = r * t + o * n + l, p = i * t + s * n + u, m = a * t + c * n + d;
|
|
2970
2970
|
return {
|
|
2971
2971
|
x: f / m,
|
|
2972
2972
|
y: p / m
|
|
2973
2973
|
};
|
|
2974
2974
|
}
|
|
2975
|
-
function
|
|
2975
|
+
function zn(e, t) {
|
|
2976
2976
|
let { x: n, y: r, width: i, height: a } = t, o = [
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2977
|
+
Rn(e, n, r),
|
|
2978
|
+
Rn(e, n + i, r),
|
|
2979
|
+
Rn(e, n + i, r + a),
|
|
2980
|
+
Rn(e, n, r + a)
|
|
2981
2981
|
], s = o.map((e) => e.x), c = o.map((e) => e.y), l = Math.min(...s), u = Math.max(...s), d = Math.min(...c), f = Math.max(...c);
|
|
2982
2982
|
return {
|
|
2983
2983
|
x: l,
|
|
@@ -2986,7 +2986,7 @@ function Rn(e, t) {
|
|
|
2986
2986
|
height: f - d
|
|
2987
2987
|
};
|
|
2988
2988
|
}
|
|
2989
|
-
var
|
|
2989
|
+
var Bn = class extends j {
|
|
2990
2990
|
install(e) {
|
|
2991
2991
|
super.install(e), e.scissor = this;
|
|
2992
2992
|
}
|
|
@@ -3013,28 +3013,28 @@ var zn = class extends j {
|
|
|
3013
3013
|
bind(e) {
|
|
3014
3014
|
let t = this._gl;
|
|
3015
3015
|
if (e) {
|
|
3016
|
-
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } =
|
|
3016
|
+
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = zn(i, e), l = r.current.height / n - (o + c);
|
|
3017
3017
|
t.scissor(a * n, l * n, s * n, c * n);
|
|
3018
3018
|
} else t.disable(t.SCISSOR_TEST);
|
|
3019
3019
|
}
|
|
3020
3020
|
destroy() {
|
|
3021
3021
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
3022
3022
|
}
|
|
3023
|
-
},
|
|
3023
|
+
}, Vn = class extends kt {
|
|
3024
3024
|
contextLost = !1;
|
|
3025
3025
|
_systems = [
|
|
3026
|
-
new
|
|
3027
|
-
new
|
|
3028
|
-
new
|
|
3029
|
-
new Fn(),
|
|
3030
|
-
new vn(),
|
|
3031
|
-
new cn(),
|
|
3032
|
-
new pn(),
|
|
3026
|
+
new Mn(),
|
|
3027
|
+
new Ft(),
|
|
3028
|
+
new nn(),
|
|
3033
3029
|
new In(),
|
|
3034
|
-
new
|
|
3035
|
-
new zn(),
|
|
3030
|
+
new yn(),
|
|
3036
3031
|
new ln(),
|
|
3037
|
-
new
|
|
3032
|
+
new mn(),
|
|
3033
|
+
new Ln(),
|
|
3034
|
+
new gn(),
|
|
3035
|
+
new Bn(),
|
|
3036
|
+
new un(),
|
|
3037
|
+
new _n()
|
|
3038
3038
|
];
|
|
3039
3039
|
bindPoints = /* @__PURE__ */ new Map();
|
|
3040
3040
|
supports = {
|
|
@@ -3046,13 +3046,13 @@ var zn = class extends j {
|
|
|
3046
3046
|
msaa: !0,
|
|
3047
3047
|
nonPowOf2mipmaps: !0
|
|
3048
3048
|
};
|
|
3049
|
-
constructor(e =
|
|
3049
|
+
constructor(e = w(), t) {
|
|
3050
3050
|
if (super(), !e) throw Error("Failed to createHTMLCanvas");
|
|
3051
|
-
|
|
3051
|
+
Qe(e) ? this._setupContext(e, t) : (this.gl = e, this.version = $e(this.gl) ? 2 : 1), this._setupBindPoints()._setupExtensions()._setupPolyfill()._setupSupports(), this._systems.forEach((e) => e.install(this)), this._systems.forEach((e) => e.emit("updateContext", this.gl)), this._systems.forEach((e) => e.emit("setup"));
|
|
3052
3052
|
}
|
|
3053
3053
|
_setupContext(e, t) {
|
|
3054
3054
|
this.view = e;
|
|
3055
|
-
let n =
|
|
3055
|
+
let n = at()?.(e, t), r = n && $e(n) ? 2 : 1;
|
|
3056
3056
|
if (n || (n = e.getContext("webgl2", t) || e.getContext("experimental-webgl2", t), r = 2), n || (n = e.getContext("webgl", t) || e.getContext("experimental-webgl", t), r = 1), !n) throw Error("Unable to getContext");
|
|
3057
3057
|
return this.gl = n, this.version = r, this._contextLost = this._contextLost.bind(this), this._contextRestored = this._contextRestored.bind(this), typeof e.addEventListener == "function" && (e.addEventListener("webglcontextlost", this._contextLost, !1), e.addEventListener("webglcontextrestored", this._contextRestored, !1)), this;
|
|
3058
3058
|
}
|
|
@@ -3128,8 +3128,8 @@ var zn = class extends j {
|
|
|
3128
3128
|
height: this.screen.height * this.pixelRatio
|
|
3129
3129
|
});
|
|
3130
3130
|
}
|
|
3131
|
-
clear(e =
|
|
3132
|
-
typeof e == "boolean" && (e = e ?
|
|
3131
|
+
clear(e = pn.all) {
|
|
3132
|
+
typeof e == "boolean" && (e = e ? pn.all : pn.none), e && this.gl.clear(e);
|
|
3133
3133
|
}
|
|
3134
3134
|
reset() {
|
|
3135
3135
|
this._systems.forEach((e) => e.reset());
|
|
@@ -3146,7 +3146,7 @@ var zn = class extends j {
|
|
|
3146
3146
|
for (let e = 0; e < i; e += a) c.set(s.subarray(e, e + a), o - e);
|
|
3147
3147
|
return c;
|
|
3148
3148
|
}
|
|
3149
|
-
},
|
|
3149
|
+
}, Hn = class {}, Un = class extends Hn {
|
|
3150
3150
|
install(e) {
|
|
3151
3151
|
let t = async (e) => {
|
|
3152
3152
|
let { parseFont: t } = await import("modern-font");
|
|
@@ -3160,15 +3160,15 @@ var zn = class extends j {
|
|
|
3160
3160
|
e.register(n, t);
|
|
3161
3161
|
}), e.font = this, this;
|
|
3162
3162
|
}
|
|
3163
|
-
},
|
|
3163
|
+
}, Wn = class extends E {
|
|
3164
3164
|
constructor(e) {
|
|
3165
3165
|
super(), this.setProperties(e);
|
|
3166
3166
|
}
|
|
3167
3167
|
};
|
|
3168
|
-
k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)],
|
|
3168
|
+
k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)], Wn.prototype, "usage", void 0), k([_({ default: () => new Uint32Array() }), O("design:type", Object)], Wn.prototype, "data", void 0);
|
|
3169
3169
|
//#endregion
|
|
3170
3170
|
//#region src/scene/resources/geometries/Geometry.ts
|
|
3171
|
-
var
|
|
3171
|
+
var Gn = class extends E {
|
|
3172
3172
|
constructor(e = {}) {
|
|
3173
3173
|
super(), this.setProperties(e);
|
|
3174
3174
|
}
|
|
@@ -3176,10 +3176,10 @@ var Wn = class extends w {
|
|
|
3176
3176
|
e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
|
|
3177
3177
|
}
|
|
3178
3178
|
};
|
|
3179
|
-
k([_({ fallback: "triangle-list" }), O("design:type", Object)],
|
|
3179
|
+
k([_({ fallback: "triangle-list" }), O("design:type", Object)], Gn.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof Record > "u" ? Object : Record)], Gn.prototype, "attributes", void 0), k([_({ default: () => new Wn() }), O("design:type", Wn === void 0 ? Object : Wn)], Gn.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Gn.prototype, "instanceCount", void 0);
|
|
3180
3180
|
//#endregion
|
|
3181
3181
|
//#region src/scene/resources/geometries/VertexBuffer.ts
|
|
3182
|
-
var P = class extends
|
|
3182
|
+
var P = class extends E {
|
|
3183
3183
|
constructor(e) {
|
|
3184
3184
|
super(), this.setProperties(e);
|
|
3185
3185
|
}
|
|
@@ -3187,7 +3187,7 @@ var P = class extends w {
|
|
|
3187
3187
|
k([_({ fallback: A.vertex }), O("design:type", A === void 0 ? Object : A)], P.prototype, "usage", void 0), k([_({ default: () => new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
|
|
3188
3188
|
//#endregion
|
|
3189
3189
|
//#region src/scene/resources/geometries/VertexAttribute.ts
|
|
3190
|
-
var F = class extends
|
|
3190
|
+
var F = class extends E {
|
|
3191
3191
|
constructor(e) {
|
|
3192
3192
|
super(), this.setProperties(e);
|
|
3193
3193
|
}
|
|
@@ -3195,7 +3195,7 @@ var F = class extends w {
|
|
|
3195
3195
|
k([_({ default: () => new P() }), O("design:type", P === void 0 ? Object : P)], F.prototype, "buffer", void 0), k([_({ fallback: "float32" }), O("design:type", Object)], F.prototype, "format", void 0), k([_(), O("design:type", Boolean)], F.prototype, "instance", void 0), k([_(), O("design:type", Number)], F.prototype, "stride", void 0), k([_(), O("design:type", Number)], F.prototype, "offset", void 0), k([_(), O("design:type", Number)], F.prototype, "start", void 0), k([_(), O("design:type", Number)], F.prototype, "divisor", void 0);
|
|
3196
3196
|
//#endregion
|
|
3197
3197
|
//#region src/scene/resources/geometries/QuadGeometry.ts
|
|
3198
|
-
var
|
|
3198
|
+
var Kn = class extends Gn {
|
|
3199
3199
|
constructor() {
|
|
3200
3200
|
super({
|
|
3201
3201
|
topology: "triangle-strip",
|
|
@@ -3212,7 +3212,7 @@ var Gn = class extends Wn {
|
|
|
3212
3212
|
1
|
|
3213
3213
|
]) })
|
|
3214
3214
|
}) },
|
|
3215
|
-
indexBuffer: new
|
|
3215
|
+
indexBuffer: new Wn({ data: new Uint32Array([
|
|
3216
3216
|
0,
|
|
3217
3217
|
1,
|
|
3218
3218
|
3,
|
|
@@ -3223,7 +3223,7 @@ var Gn = class extends Wn {
|
|
|
3223
3223
|
};
|
|
3224
3224
|
//#endregion
|
|
3225
3225
|
//#region src/scene/resources/materials/Material.ts
|
|
3226
|
-
function
|
|
3226
|
+
function qn() {
|
|
3227
3227
|
return {
|
|
3228
3228
|
projectionMatrix: new Float32Array([
|
|
3229
3229
|
1,
|
|
@@ -3255,13 +3255,13 @@ function Kn() {
|
|
|
3255
3255
|
])
|
|
3256
3256
|
};
|
|
3257
3257
|
}
|
|
3258
|
-
var I = class extends
|
|
3258
|
+
var I = class extends E {
|
|
3259
3259
|
static instance = new this();
|
|
3260
3260
|
glProgram;
|
|
3261
3261
|
constructor(e = {}) {
|
|
3262
3262
|
super();
|
|
3263
3263
|
let { uniforms: t, gl: n } = e;
|
|
3264
|
-
t && (this.uniforms = t), this.glProgram = new
|
|
3264
|
+
t && (this.uniforms = t), this.glProgram = new qt({
|
|
3265
3265
|
vertex: "in vec2 position;\nuniform mat3 projectionMatrix;\nuniform mat3 modelViewMatrix;\nvoid main(void) {\n gl_Position = vec4((projectionMatrix * modelViewMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}",
|
|
3266
3266
|
fragment: "uniform vec4 tint;\nvoid main(void) {\n gl_FragColor = tint;\n}",
|
|
3267
3267
|
...n
|
|
@@ -3274,13 +3274,13 @@ var I = class extends w {
|
|
|
3274
3274
|
}, e.shader.updateUniforms(this);
|
|
3275
3275
|
}
|
|
3276
3276
|
};
|
|
3277
|
-
k([_({ default:
|
|
3277
|
+
k([_({ default: qn }), O("design:type", typeof Record > "u" ? Object : Record)], I.prototype, "uniforms", void 0);
|
|
3278
3278
|
//#endregion
|
|
3279
3279
|
//#region src/scene/resources/materials/EffectMaterial.ts
|
|
3280
|
-
var
|
|
3281
|
-
function
|
|
3280
|
+
var Jn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Yn = /vec(\d)\((.*)\)/;
|
|
3281
|
+
function Xn(e) {
|
|
3282
3282
|
e = e.trim();
|
|
3283
|
-
let t = e.match(
|
|
3283
|
+
let t = e.match(Yn);
|
|
3284
3284
|
if (t) {
|
|
3285
3285
|
let e = Array.from({ length: Number(t[1]) }, () => 0);
|
|
3286
3286
|
return t[2].split(",").forEach((t, n) => {
|
|
@@ -3289,7 +3289,7 @@ function Yn(e) {
|
|
|
3289
3289
|
}
|
|
3290
3290
|
return Number(e);
|
|
3291
3291
|
}
|
|
3292
|
-
var
|
|
3292
|
+
var Zn = class e extends I {
|
|
3293
3293
|
static RE = {
|
|
3294
3294
|
getColor: /\sgetColor\s*\(/,
|
|
3295
3295
|
getFromColor: /\sgetFromColor\s*\(/,
|
|
@@ -3325,12 +3325,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3325
3325
|
progress: 0
|
|
3326
3326
|
}
|
|
3327
3327
|
}), this.has = n;
|
|
3328
|
-
let r = t.matchAll(
|
|
3328
|
+
let r = t.matchAll(Jn);
|
|
3329
3329
|
for (let e of r) e[1] && e[2] && e[1].split(",").forEach((t) => {
|
|
3330
|
-
this.uniforms[t.trim()] =
|
|
3330
|
+
this.uniforms[t.trim()] = Xn(e[2]);
|
|
3331
3331
|
});
|
|
3332
3332
|
}
|
|
3333
|
-
},
|
|
3333
|
+
}, Qn = class extends I {
|
|
3334
3334
|
static _instance;
|
|
3335
3335
|
static get instance() {
|
|
3336
3336
|
return this._instance ??= new this();
|
|
@@ -3374,12 +3374,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3374
3374
|
}
|
|
3375
3375
|
});
|
|
3376
3376
|
}
|
|
3377
|
-
}, L = class extends
|
|
3377
|
+
}, L = class extends Gn {
|
|
3378
3378
|
static _instance;
|
|
3379
3379
|
static get instance() {
|
|
3380
3380
|
return this._instance ??= new this();
|
|
3381
3381
|
}
|
|
3382
|
-
static draw(e, t =
|
|
3382
|
+
static draw(e, t = Qn.instance, n) {
|
|
3383
3383
|
this.instance.draw(e, t, n);
|
|
3384
3384
|
}
|
|
3385
3385
|
constructor() {
|
|
@@ -3412,7 +3412,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3412
3412
|
]) })
|
|
3413
3413
|
})
|
|
3414
3414
|
},
|
|
3415
|
-
indexBuffer: new
|
|
3415
|
+
indexBuffer: new Wn({ data: new Uint32Array([
|
|
3416
3416
|
0,
|
|
3417
3417
|
1,
|
|
3418
3418
|
2,
|
|
@@ -3422,7 +3422,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3422
3422
|
]) })
|
|
3423
3423
|
});
|
|
3424
3424
|
}
|
|
3425
|
-
},
|
|
3425
|
+
}, $n = class extends Gn {
|
|
3426
3426
|
positionBuffer;
|
|
3427
3427
|
uvBuffer;
|
|
3428
3428
|
constructor(e) {
|
|
@@ -3439,10 +3439,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3439
3439
|
buffer: n
|
|
3440
3440
|
})
|
|
3441
3441
|
},
|
|
3442
|
-
indexBuffer: new
|
|
3442
|
+
indexBuffer: new Wn({ data: new Uint32Array() })
|
|
3443
3443
|
}), this.positionBuffer = t, this.uvBuffer = n;
|
|
3444
3444
|
}
|
|
3445
|
-
}, R = class extends
|
|
3445
|
+
}, R = class extends E {
|
|
3446
3446
|
get valid() {
|
|
3447
3447
|
return !!(this.width && this.height);
|
|
3448
3448
|
}
|
|
@@ -3459,7 +3459,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3459
3459
|
k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "isRoot", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "msaa", void 0), k([_({ default: () => [new z()] }), O("design:type", Array)], R.prototype, "colorTextures", void 0);
|
|
3460
3460
|
//#endregion
|
|
3461
3461
|
//#region src/scene/resources/textures/Texture2D.ts
|
|
3462
|
-
var z = class extends
|
|
3462
|
+
var z = class extends E {
|
|
3463
3463
|
static get EMPTY() {
|
|
3464
3464
|
return new this({
|
|
3465
3465
|
width: 1,
|
|
@@ -3550,7 +3550,7 @@ var z = class extends w {
|
|
|
3550
3550
|
switch (super._updateProperty(e, t, n), e) {
|
|
3551
3551
|
case "width":
|
|
3552
3552
|
case "height":
|
|
3553
|
-
this.isPowerOfTwo =
|
|
3553
|
+
this.isPowerOfTwo = Ce(this.pixelWidth) && Ce(this.pixelHeight);
|
|
3554
3554
|
break;
|
|
3555
3555
|
case "source":
|
|
3556
3556
|
this.updateSize();
|
|
@@ -3567,13 +3567,13 @@ var z = class extends w {
|
|
|
3567
3567
|
e.texture.unbind(this);
|
|
3568
3568
|
}
|
|
3569
3569
|
_destroy() {
|
|
3570
|
-
super._destroy(),
|
|
3570
|
+
super._destroy(), Ne && this.source instanceof ImageBitmap && this.source.close();
|
|
3571
3571
|
}
|
|
3572
3572
|
};
|
|
3573
3573
|
k([_({ fallback: "unknown" }), O("design:type", String)], z.prototype, "uploadMethodId", void 0), k([_({ internal: !0 }), O("design:type", Object)], z.prototype, "source", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "height", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "pixelRatio", void 0), k([_({ fallback: "bgra8unorm" }), O("design:type", Object)], z.prototype, "format", void 0), k([_({ fallback: "premultiply-alpha-on-upload" }), O("design:type", Object)], z.prototype, "alphaMode", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "mipLevelCount", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "mipmap", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeU", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeV", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeW", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "magFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "minFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "mipmapFilter", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "isPowerOfTwo", void 0);
|
|
3574
3574
|
//#endregion
|
|
3575
3575
|
//#region src/scene/resources/textures/AnimatedTexture.ts
|
|
3576
|
-
var
|
|
3576
|
+
var er = class extends E {
|
|
3577
3577
|
frames;
|
|
3578
3578
|
frameIndex = 0;
|
|
3579
3579
|
get currentFrame() {
|
|
@@ -3598,12 +3598,12 @@ var $n = class extends w {
|
|
|
3598
3598
|
e.texture.destroy();
|
|
3599
3599
|
});
|
|
3600
3600
|
}
|
|
3601
|
-
},
|
|
3601
|
+
}, tr = class extends z {
|
|
3602
3602
|
constructor(e = {}) {
|
|
3603
3603
|
super({
|
|
3604
3604
|
pixelRatio: 2,
|
|
3605
3605
|
...e,
|
|
3606
|
-
source: e.source ??
|
|
3606
|
+
source: e.source ?? w(),
|
|
3607
3607
|
uploadMethodId: "image"
|
|
3608
3608
|
});
|
|
3609
3609
|
}
|
|
@@ -3618,14 +3618,14 @@ var $n = class extends w {
|
|
|
3618
3618
|
}
|
|
3619
3619
|
super._updateProperty(e, t, n);
|
|
3620
3620
|
}
|
|
3621
|
-
},
|
|
3621
|
+
}, nr = class e extends z {
|
|
3622
3622
|
static _cached = /* @__PURE__ */ new Map();
|
|
3623
3623
|
static get(t) {
|
|
3624
|
-
let n = new
|
|
3624
|
+
let n = new yt(t), r = n.toHex(), i = this._cached.get(r);
|
|
3625
3625
|
return i || (i = new e(n), this._cached.set(r, i)), i;
|
|
3626
3626
|
}
|
|
3627
3627
|
constructor(e) {
|
|
3628
|
-
let t = e instanceof
|
|
3628
|
+
let t = e instanceof yt ? e : new yt(e);
|
|
3629
3629
|
super({
|
|
3630
3630
|
width: 1,
|
|
3631
3631
|
height: 1,
|
|
@@ -3639,14 +3639,14 @@ var $n = class extends w {
|
|
|
3639
3639
|
mipmap: !0
|
|
3640
3640
|
});
|
|
3641
3641
|
}
|
|
3642
|
-
},
|
|
3642
|
+
}, rr = class e extends z {
|
|
3643
3643
|
static test(e) {
|
|
3644
3644
|
return u(e);
|
|
3645
3645
|
}
|
|
3646
3646
|
static linearGradient(e, t, n) {
|
|
3647
3647
|
let r = Number.isFinite(t) && t > 0, i = Number.isFinite(n) && n > 0, a = Number.isFinite(e.angle);
|
|
3648
3648
|
t = r ? t : 1, n = i ? n : 1;
|
|
3649
|
-
let o =
|
|
3649
|
+
let o = w(t, n);
|
|
3650
3650
|
if (!o) throw Error("GradientTexture requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
3651
3651
|
let s = o.getContext("2d");
|
|
3652
3652
|
if (!s) throw Error("Failed to parse linear gradient, get canvas context is null.");
|
|
@@ -3673,7 +3673,7 @@ var $n = class extends w {
|
|
|
3673
3673
|
constructor(t, n, r) {
|
|
3674
3674
|
super(e.linearGradient(t, n, r));
|
|
3675
3675
|
}
|
|
3676
|
-
},
|
|
3676
|
+
}, ir = class extends z {
|
|
3677
3677
|
constructor(e = {}) {
|
|
3678
3678
|
super({
|
|
3679
3679
|
...e,
|
|
@@ -3683,7 +3683,7 @@ var $n = class extends w {
|
|
|
3683
3683
|
};
|
|
3684
3684
|
//#endregion
|
|
3685
3685
|
//#region src/scene/resources/textures/VideoTexture.ts
|
|
3686
|
-
function
|
|
3686
|
+
function ar(e) {
|
|
3687
3687
|
return {
|
|
3688
3688
|
autoLoad: !!(e?.autoLoad ?? !0),
|
|
3689
3689
|
autoPlay: !!(e?.autoPlay ?? !1),
|
|
@@ -3694,7 +3694,7 @@ function ir(e) {
|
|
|
3694
3694
|
playsinline: !!(e?.playsinline ?? !0)
|
|
3695
3695
|
};
|
|
3696
3696
|
}
|
|
3697
|
-
var
|
|
3697
|
+
var or = class e extends z {
|
|
3698
3698
|
static mimeTypes = new Map(Object.entries({
|
|
3699
3699
|
ogv: "video/ogg",
|
|
3700
3700
|
mov: "video/quicktime",
|
|
@@ -3728,13 +3728,13 @@ var ar = class e extends z {
|
|
|
3728
3728
|
_reject;
|
|
3729
3729
|
_seekResolves = [];
|
|
3730
3730
|
constructor(t, n) {
|
|
3731
|
-
let r =
|
|
3732
|
-
if (!
|
|
3731
|
+
let r = ar(n);
|
|
3732
|
+
if (!Xe(t)) {
|
|
3733
3733
|
typeof t == "string" && (t = [t]);
|
|
3734
3734
|
let n = t[0].src || t[0];
|
|
3735
3735
|
if (typeof document > "u") throw TypeError("VideoTexture requires a DOM <video> element and is not supported in non-browser environments.");
|
|
3736
3736
|
let i = document.createElement("video");
|
|
3737
|
-
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""),
|
|
3737
|
+
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""), st(i, n, r.crossorigin);
|
|
3738
3738
|
for (let n = 0; n < t.length; ++n) {
|
|
3739
3739
|
let { src: r, mime: a } = t[n];
|
|
3740
3740
|
if (r ||= t[n], r.startsWith("data:")) a = r.slice(5, r.indexOf(";"));
|
|
@@ -3797,13 +3797,13 @@ var ar = class e extends z {
|
|
|
3797
3797
|
});
|
|
3798
3798
|
}
|
|
3799
3799
|
_setupAutoUpdate() {
|
|
3800
|
-
this.autoUpdate && this.isPlaying ? !this.fps && this.source.requestVideoFrameCallback ? (this._connected && (
|
|
3800
|
+
this.autoUpdate && this.isPlaying ? !this.fps && this.source.requestVideoFrameCallback ? (this._connected && (C.off(this.requestUpload), this._connected = !1, this._nextTime = 0), this._requestId === void 0 && (this._requestId = this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected || (C.on(this.requestUpload), this._connected = !0, this._nextTime = 0)) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected && (C.off(this.requestUpload), this._connected = !1, this._nextTime = 0));
|
|
3801
3801
|
}
|
|
3802
3802
|
_videoFrameRequestCallback = () => {
|
|
3803
3803
|
this.requestUpload(), this._requestId = this.source.requestVideoFrameCallback(this._videoFrameRequestCallback);
|
|
3804
3804
|
};
|
|
3805
3805
|
requestUpload = () => {
|
|
3806
|
-
let e = Math.floor(
|
|
3806
|
+
let e = Math.floor(C.elapsed * this.source.playbackRate);
|
|
3807
3807
|
this._nextTime -= e, (!this._spf || this._nextTime <= 0) && (this.requestUpdate("source"), this._nextTime = this._spf || 0);
|
|
3808
3808
|
};
|
|
3809
3809
|
async load() {
|
|
@@ -3824,13 +3824,13 @@ var ar = class e extends z {
|
|
|
3824
3824
|
k([_({
|
|
3825
3825
|
internal: !0,
|
|
3826
3826
|
fallback: !0
|
|
3827
|
-
}), O("design:type", Boolean)],
|
|
3827
|
+
}), O("design:type", Boolean)], or.prototype, "autoUpdate", void 0), k([_({
|
|
3828
3828
|
internal: !0,
|
|
3829
3829
|
fallback: 0
|
|
3830
|
-
}), O("design:type", Number)],
|
|
3830
|
+
}), O("design:type", Number)], or.prototype, "fps", void 0);
|
|
3831
3831
|
//#endregion
|
|
3832
3832
|
//#region src/scene/resources/textures/ViewportTexture.ts
|
|
3833
|
-
var
|
|
3833
|
+
var sr = class extends z {}, cr = class extends v {
|
|
3834
3834
|
fillStyle;
|
|
3835
3835
|
fillRule;
|
|
3836
3836
|
strokeStyle;
|
|
@@ -3844,7 +3844,7 @@ var or = class extends z {}, sr = class extends le {
|
|
|
3844
3844
|
_draws = [];
|
|
3845
3845
|
_triCache = [];
|
|
3846
3846
|
_parseDrawStyle(e) {
|
|
3847
|
-
return e ? e instanceof z ? { texture: e } : { texture:
|
|
3847
|
+
return e ? e instanceof z ? { texture: e } : { texture: nr.get(e) } : {};
|
|
3848
3848
|
}
|
|
3849
3849
|
stroke(e) {
|
|
3850
3850
|
if (!this.curves.length) return;
|
|
@@ -3861,7 +3861,7 @@ var or = class extends z {}, sr = class extends le {
|
|
|
3861
3861
|
...e,
|
|
3862
3862
|
...this._parseDrawStyle(n),
|
|
3863
3863
|
type: "stroke",
|
|
3864
|
-
path: new
|
|
3864
|
+
path: new v(this),
|
|
3865
3865
|
transformUv: this.transformUv,
|
|
3866
3866
|
transformVertex: this.transformVertex,
|
|
3867
3867
|
lineStyle: {
|
|
@@ -3900,7 +3900,7 @@ var or = class extends z {}, sr = class extends le {
|
|
|
3900
3900
|
l(this.style.fill) && (t = this.style.fill.color);
|
|
3901
3901
|
break;
|
|
3902
3902
|
}
|
|
3903
|
-
let n = new
|
|
3903
|
+
let n = new v(this), r = this.fillRule ?? this.style.fillRule;
|
|
3904
3904
|
r && (n.style.fillRule = r), this._draws.push({
|
|
3905
3905
|
transformUv: this.transformUv,
|
|
3906
3906
|
transformVertex: this.transformVertex,
|
|
@@ -3961,7 +3961,7 @@ var or = class extends z {}, sr = class extends le {
|
|
|
3961
3961
|
destroy() {
|
|
3962
3962
|
this.reset(), this._triCache.length = 0;
|
|
3963
3963
|
}
|
|
3964
|
-
},
|
|
3964
|
+
}, lr = class {
|
|
3965
3965
|
front = [];
|
|
3966
3966
|
default = [];
|
|
3967
3967
|
back = [];
|
|
@@ -4004,7 +4004,7 @@ var or = class extends z {}, sr = class extends le {
|
|
|
4004
4004
|
toJSON() {
|
|
4005
4005
|
return [...this.default];
|
|
4006
4006
|
}
|
|
4007
|
-
},
|
|
4007
|
+
}, ur = class extends T {
|
|
4008
4008
|
parent;
|
|
4009
4009
|
getPropertyDeclarations() {
|
|
4010
4010
|
super.getPropertyDeclarations();
|
|
@@ -4023,22 +4023,22 @@ var or = class extends z {}, sr = class extends le {
|
|
|
4023
4023
|
deleteProperty: (e, t) => Reflect.has(e, t) || String(t).startsWith("_") ? Reflect.deleteProperty(e, t) : (e.setProperty(String(t), void 0), !0)
|
|
4024
4024
|
});
|
|
4025
4025
|
}
|
|
4026
|
-
},
|
|
4027
|
-
function
|
|
4028
|
-
let t =
|
|
4029
|
-
return t++,
|
|
4026
|
+
}, dr, fr = {};
|
|
4027
|
+
function pr(e) {
|
|
4028
|
+
let t = fr[e] ?? 0;
|
|
4029
|
+
return t++, fr[e] = t, t;
|
|
4030
4030
|
}
|
|
4031
|
-
var B =
|
|
4031
|
+
var B = dr = class extends T {
|
|
4032
4032
|
static parse(e, t = "Node") {
|
|
4033
4033
|
if (Array.isArray(e)) return e.map((e) => this.parse(e));
|
|
4034
|
-
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((
|
|
4034
|
+
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ve.get(n ?? r.inCanvasIs ?? t)) ?? dr)({
|
|
4035
4035
|
...a,
|
|
4036
4036
|
meta: r
|
|
4037
4037
|
});
|
|
4038
4038
|
return i?.forEach((e) => o.appendChild(this.parse(e))), o;
|
|
4039
4039
|
}
|
|
4040
4040
|
_mask;
|
|
4041
|
-
_meta = new
|
|
4041
|
+
_meta = new ur(this);
|
|
4042
4042
|
get meta() {
|
|
4043
4043
|
return this._meta;
|
|
4044
4044
|
}
|
|
@@ -4061,7 +4061,7 @@ var B = ur = class extends C {
|
|
|
4061
4061
|
}).append(t), this.on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess), this.updateProcessable(), this.updateRenderable();
|
|
4062
4062
|
}
|
|
4063
4063
|
_defaultName() {
|
|
4064
|
-
return `@${this.is}@${
|
|
4064
|
+
return `@${this.is}@${pr(this.is)}`;
|
|
4065
4065
|
}
|
|
4066
4066
|
setProperties(e) {
|
|
4067
4067
|
if (e) {
|
|
@@ -4128,7 +4128,7 @@ var B = ur = class extends C {
|
|
|
4128
4128
|
}
|
|
4129
4129
|
return this;
|
|
4130
4130
|
}
|
|
4131
|
-
_children = new
|
|
4131
|
+
_children = new lr();
|
|
4132
4132
|
get children() {
|
|
4133
4133
|
return this._children.default;
|
|
4134
4134
|
}
|
|
@@ -4288,7 +4288,7 @@ var B = ur = class extends C {
|
|
|
4288
4288
|
append(...e) {
|
|
4289
4289
|
let t;
|
|
4290
4290
|
t = Array.isArray(e[0]) ? e[0] : e, t.forEach((e) => {
|
|
4291
|
-
e instanceof
|
|
4291
|
+
e instanceof dr ? this.appendChild(e) : this.appendChild(dr.parse(e));
|
|
4292
4292
|
});
|
|
4293
4293
|
}
|
|
4294
4294
|
before(...e) {
|
|
@@ -4394,7 +4394,7 @@ var B = ur = class extends C {
|
|
|
4394
4394
|
k([_({ default: () => c() }), O("design:type", String)], B.prototype, "id", void 0), k([_({ default: () => c() }), O("design:type", String)], B.prototype, "name", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "processMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "processSortMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "renderMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "inputMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "internalMode", void 0), k([_({
|
|
4395
4395
|
internal: !0,
|
|
4396
4396
|
default: !0
|
|
4397
|
-
}), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B =
|
|
4397
|
+
}), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B = dr = k([S("Node"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], B);
|
|
4398
4398
|
//#endregion
|
|
4399
4399
|
//#region src/scene/main/TimelineNode.ts
|
|
4400
4400
|
var V = class extends B {
|
|
@@ -4412,6 +4412,11 @@ var V = class extends B {
|
|
|
4412
4412
|
_currentTime = 0;
|
|
4413
4413
|
_globalStartTime = 0;
|
|
4414
4414
|
_globalDuration = 0;
|
|
4415
|
+
_standalone = !1;
|
|
4416
|
+
_localCurrentTime = 0;
|
|
4417
|
+
get standalone() {
|
|
4418
|
+
return this._standalone;
|
|
4419
|
+
}
|
|
4415
4420
|
get parentGlobalStartTime() {
|
|
4416
4421
|
return this._parent?.globalStartTime ?? 0;
|
|
4417
4422
|
}
|
|
@@ -4428,7 +4433,7 @@ var V = class extends B {
|
|
|
4428
4433
|
return this._globalStartTime + this._globalDuration;
|
|
4429
4434
|
}
|
|
4430
4435
|
get currentTimeProgress() {
|
|
4431
|
-
return this._duration ?
|
|
4436
|
+
return this._duration ? St(this._currentTime / this._duration, 0, 1) : 0;
|
|
4432
4437
|
}
|
|
4433
4438
|
isInsideTimeRange() {
|
|
4434
4439
|
let e = this._currentTime;
|
|
@@ -4456,30 +4461,36 @@ var V = class extends B {
|
|
|
4456
4461
|
_updateInsideTimeRange() {
|
|
4457
4462
|
this.insideTimeRange = this.isInsideTimeRange();
|
|
4458
4463
|
}
|
|
4464
|
+
setStandalone(e) {
|
|
4465
|
+
return this._standalone !== e && (this._standalone = e, this._updateCurrentTime(!0)), this;
|
|
4466
|
+
}
|
|
4467
|
+
setLocalTime(e) {
|
|
4468
|
+
return this._localCurrentTime = e, this._updateCurrentTime(!0), this;
|
|
4469
|
+
}
|
|
4459
4470
|
_updateCurrentTime(e = !1) {
|
|
4460
4471
|
if (e || !this._paused) {
|
|
4461
4472
|
let e = this._parent, t = this.parentGlobalStartTime + this._delay, n = e?.globalDuration ? Math.min(t + this._duration, e.globalEndTime) - t : this._duration;
|
|
4462
4473
|
this._globalStartTime = t, this._globalDuration = n;
|
|
4463
|
-
let r = this._globalCurrentTime - this.globalStartTime;
|
|
4464
|
-
this._loop && (r %= this.globalDuration), this._currentTime = r, this.emit("updateCurrentTime", this._currentTime), this._updateInsideTimeRange();
|
|
4474
|
+
let r = this._standalone ? this._localCurrentTime : this._globalCurrentTime - this.globalStartTime;
|
|
4475
|
+
this._loop && this.globalDuration && (r %= this.globalDuration), this._currentTime = r, this.emit("updateCurrentTime", this._currentTime), this._updateInsideTimeRange();
|
|
4465
4476
|
}
|
|
4466
4477
|
}
|
|
4467
4478
|
_process(e) {
|
|
4468
4479
|
super._process(e), this._updateCurrentTime();
|
|
4469
4480
|
}
|
|
4470
4481
|
};
|
|
4471
|
-
k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "loop", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "delay", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "duration", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "paused", void 0), V = k([
|
|
4482
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "loop", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "delay", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "duration", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "paused", void 0), V = k([S("TimelineNode"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
|
|
4472
4483
|
//#endregion
|
|
4473
4484
|
//#region src/scene/main/CanvasItem.ts
|
|
4474
|
-
var
|
|
4475
|
-
function
|
|
4476
|
-
|
|
4485
|
+
var mr = [], hr = 0;
|
|
4486
|
+
function gr() {
|
|
4487
|
+
hr = 0;
|
|
4477
4488
|
}
|
|
4478
|
-
function
|
|
4479
|
-
let i =
|
|
4480
|
-
return i || (i = {},
|
|
4489
|
+
function _r(e, t, n, r) {
|
|
4490
|
+
let i = mr[hr];
|
|
4491
|
+
return i || (i = {}, mr[hr] = i), hr++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i;
|
|
4481
4492
|
}
|
|
4482
|
-
var
|
|
4493
|
+
var vr = class extends V {
|
|
4483
4494
|
_blendMode;
|
|
4484
4495
|
_parentGlobalVisible;
|
|
4485
4496
|
_globalVisible;
|
|
@@ -4497,7 +4508,7 @@ var _r = class extends V {
|
|
|
4497
4508
|
255,
|
|
4498
4509
|
255
|
|
4499
4510
|
];
|
|
4500
|
-
context = new
|
|
4511
|
+
context = new cr();
|
|
4501
4512
|
_resetContext = !0;
|
|
4502
4513
|
needsDraw = !0;
|
|
4503
4514
|
needsLayout = !1;
|
|
@@ -4559,7 +4570,7 @@ var _r = class extends V {
|
|
|
4559
4570
|
}
|
|
4560
4571
|
_updateGlobalOpacity() {
|
|
4561
4572
|
this._parentGlobalOpacity = this.getParent()?.opacity;
|
|
4562
|
-
let e =
|
|
4573
|
+
let e = St(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
|
|
4563
4574
|
this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
|
|
4564
4575
|
}
|
|
4565
4576
|
_draw() {
|
|
@@ -4611,7 +4622,7 @@ var _r = class extends V {
|
|
|
4611
4622
|
_handleViewportTexture(e) {
|
|
4612
4623
|
let t = this.tree?.getPreviousViewport();
|
|
4613
4624
|
if (t && "getRect" in this) {
|
|
4614
|
-
let { a: n, d: r, tx: i, ty: a } = t.canvasTransform, { vertices: o } = e, s = new
|
|
4625
|
+
let { a: n, d: r, tx: i, ty: a } = t.canvasTransform, { vertices: o } = e, s = new b().scale(1 / t.width * n, -1 / t.height * r).translate(- -i / t.width, 1 + -a / t.height), c = new Float32Array(o.length);
|
|
4615
4626
|
for (let e = o.length, t = 0; t < e; t += 2) {
|
|
4616
4627
|
let { x: e, y: n } = s.apply({
|
|
4617
4628
|
x: o[t],
|
|
@@ -4628,7 +4639,7 @@ var _r = class extends V {
|
|
|
4628
4639
|
return;
|
|
4629
4640
|
}
|
|
4630
4641
|
let t = this._tree?.pixelate, n = this._tree?.roundPixels, r = this._batchables;
|
|
4631
|
-
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof
|
|
4642
|
+
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof sr && (a = this._handleViewportTexture(i)), e.batch2D.render(_r(i, n, t ? i.size : void 0, a));
|
|
4632
4643
|
super._render(e);
|
|
4633
4644
|
}
|
|
4634
4645
|
_cullsRender() {
|
|
@@ -4638,17 +4649,17 @@ var _r = class extends V {
|
|
|
4638
4649
|
super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
|
|
4639
4650
|
}
|
|
4640
4651
|
};
|
|
4641
|
-
k([_(), O("design:type", Object)],
|
|
4652
|
+
k([_(), O("design:type", Object)], vr.prototype, "blendMode", void 0), k([_({
|
|
4642
4653
|
internal: !0,
|
|
4643
4654
|
fallback: !0
|
|
4644
|
-
}), O("design:type", Boolean)],
|
|
4655
|
+
}), O("design:type", Boolean)], vr.prototype, "visible", void 0), k([_({
|
|
4645
4656
|
internal: !0,
|
|
4646
4657
|
fallback: 1
|
|
4647
|
-
}), O("design:type", Number)],
|
|
4658
|
+
}), O("design:type", Number)], vr.prototype, "opacity", void 0), vr = k([S("CanvasItem"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], vr);
|
|
4648
4659
|
//#endregion
|
|
4649
4660
|
//#region src/scene/main/Viewport.ts
|
|
4650
4661
|
var H = class extends B {
|
|
4651
|
-
canvasTransform = new
|
|
4662
|
+
canvasTransform = new b();
|
|
4652
4663
|
renderTargetIndex = 0;
|
|
4653
4664
|
renderTargets = [new R(), new R()];
|
|
4654
4665
|
get valid() {
|
|
@@ -4697,7 +4708,7 @@ var H = class extends B {
|
|
|
4697
4708
|
return !1;
|
|
4698
4709
|
}
|
|
4699
4710
|
activateWithCopy(e, t) {
|
|
4700
|
-
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e,
|
|
4711
|
+
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, Qn.instance, { sampler: 0 }));
|
|
4701
4712
|
}
|
|
4702
4713
|
renderStart(e, t) {
|
|
4703
4714
|
this.activate(e, t) && e.clear();
|
|
@@ -4710,7 +4721,7 @@ var H = class extends B {
|
|
|
4710
4721
|
this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
|
|
4711
4722
|
}
|
|
4712
4723
|
getRect() {
|
|
4713
|
-
return new
|
|
4724
|
+
return new vt(this.x, this.y, this.width, this.height);
|
|
4714
4725
|
}
|
|
4715
4726
|
toCanvasGlobal(e, t) {
|
|
4716
4727
|
return this.canvasTransform.applyAffineInverse(e, t);
|
|
@@ -4722,7 +4733,7 @@ var H = class extends B {
|
|
|
4722
4733
|
super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
|
|
4723
4734
|
}
|
|
4724
4735
|
};
|
|
4725
|
-
k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "msaa", void 0), H = k([
|
|
4736
|
+
k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "msaa", void 0), H = k([S("Viewport")], H);
|
|
4726
4737
|
//#endregion
|
|
4727
4738
|
//#region src/scene/main/Effect.ts
|
|
4728
4739
|
var U = class extends V {
|
|
@@ -4748,7 +4759,7 @@ var U = class extends V {
|
|
|
4748
4759
|
_updateProperty(e, t, n) {
|
|
4749
4760
|
switch (super._updateProperty(e, t, n), e) {
|
|
4750
4761
|
case "glsl": {
|
|
4751
|
-
let e = new
|
|
4762
|
+
let e = new Zn(t);
|
|
4752
4763
|
!this.effectMode && e.has.transition && (this.effectMode = "transition"), this.material = e;
|
|
4753
4764
|
break;
|
|
4754
4765
|
}
|
|
@@ -4783,7 +4794,7 @@ var U = class extends V {
|
|
|
4783
4794
|
}
|
|
4784
4795
|
}
|
|
4785
4796
|
getRect() {
|
|
4786
|
-
return new
|
|
4797
|
+
return new vt(this._rect);
|
|
4787
4798
|
}
|
|
4788
4799
|
_processParent() {
|
|
4789
4800
|
let e = this._tree?.renderStack;
|
|
@@ -4953,10 +4964,10 @@ var U = class extends V {
|
|
|
4953
4964
|
super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
|
|
4954
4965
|
}
|
|
4955
4966
|
};
|
|
4956
|
-
k([_({ internal: !0 }), O("design:type", Object)], U.prototype, "material", void 0), k([_(), O("design:type", Object)], U.prototype, "effectMode", void 0), k([_(), O("design:type", String)], U.prototype, "glsl", void 0), k([_(), O("design:type", String)], U.prototype, "glslSrc", void 0), U = k([
|
|
4967
|
+
k([_({ internal: !0 }), O("design:type", Object)], U.prototype, "material", void 0), k([_(), O("design:type", Object)], U.prototype, "effectMode", void 0), k([_(), O("design:type", String)], U.prototype, "glsl", void 0), k([_(), O("design:type", String)], U.prototype, "glslSrc", void 0), U = k([S("Effect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], U);
|
|
4957
4968
|
//#endregion
|
|
4958
4969
|
//#region src/scene/main/RenderStack.ts
|
|
4959
|
-
var
|
|
4970
|
+
var yr = class {
|
|
4960
4971
|
currentCall;
|
|
4961
4972
|
calls = [];
|
|
4962
4973
|
createCall(e) {
|
|
@@ -4978,11 +4989,11 @@ var vr = class {
|
|
|
4978
4989
|
});
|
|
4979
4990
|
}), this.calls = [];
|
|
4980
4991
|
}
|
|
4981
|
-
},
|
|
4992
|
+
}, br, xr = br = class extends B {
|
|
4982
4993
|
currentTime = 0;
|
|
4983
4994
|
static from(e, t = !1) {
|
|
4984
4995
|
let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
|
|
4985
|
-
return new
|
|
4996
|
+
return new br({
|
|
4986
4997
|
startTime: n,
|
|
4987
4998
|
endTime: r,
|
|
4988
4999
|
loop: t
|
|
@@ -5000,16 +5011,16 @@ var vr = class {
|
|
|
5000
5011
|
}
|
|
5001
5012
|
addTime(e) {
|
|
5002
5013
|
let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = this.currentTime;
|
|
5003
|
-
return r += e, this.loop && r > t && (r = n + r % t), r =
|
|
5014
|
+
return r += e, this.loop && r > t && (r = n + r % t), r = St(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
|
|
5004
5015
|
}
|
|
5005
5016
|
_process(e) {
|
|
5006
5017
|
super._process(e), this.paused || this.addTime(e);
|
|
5007
5018
|
}
|
|
5008
5019
|
};
|
|
5009
|
-
k([_({ fallback: 0 }), O("design:type", Number)],
|
|
5020
|
+
k([_({ fallback: 0 }), O("design:type", Number)], xr.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], xr.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], xr.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], xr.prototype, "paused", void 0), xr = br = k([S("Timeline"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], xr);
|
|
5010
5021
|
//#endregion
|
|
5011
5022
|
//#region src/scene/main/Window.ts
|
|
5012
|
-
var
|
|
5023
|
+
var Sr = class extends H {
|
|
5013
5024
|
constructor() {
|
|
5014
5025
|
super(), this.renderTargets.forEach((e) => e.isRoot = !0);
|
|
5015
5026
|
}
|
|
@@ -5020,22 +5031,22 @@ var xr = class extends H {
|
|
|
5020
5031
|
super.flush(e), this.finish(e);
|
|
5021
5032
|
}
|
|
5022
5033
|
};
|
|
5023
|
-
|
|
5034
|
+
Sr = k([S("Window", {
|
|
5024
5035
|
processMode: "always",
|
|
5025
5036
|
renderMode: "always"
|
|
5026
|
-
}), O("design:paramtypes", [])],
|
|
5037
|
+
}), O("design:paramtypes", [])], Sr);
|
|
5027
5038
|
//#endregion
|
|
5028
5039
|
//#region src/scene/main/SceneTree.ts
|
|
5029
|
-
var
|
|
5030
|
-
input = new
|
|
5031
|
-
renderStack = new
|
|
5032
|
-
root = new
|
|
5033
|
-
timeline = new
|
|
5040
|
+
var Cr = class extends Et {
|
|
5041
|
+
input = new gt();
|
|
5042
|
+
renderStack = new yr();
|
|
5043
|
+
root = new Sr().setTree(this);
|
|
5044
|
+
timeline = new xr().setTree(this);
|
|
5034
5045
|
nodeMap = /* @__PURE__ */ new Map();
|
|
5035
5046
|
_boundFonts;
|
|
5036
5047
|
_textRemeasureScheduled = !1;
|
|
5037
5048
|
_onFontLoad = () => this._scheduleTextRemeasure();
|
|
5038
|
-
_backgroundColor = new
|
|
5049
|
+
_backgroundColor = new yt();
|
|
5039
5050
|
_previousViewport;
|
|
5040
5051
|
_currentViewport;
|
|
5041
5052
|
getPreviousViewport() {
|
|
@@ -5088,7 +5099,7 @@ var Sr = class extends Tt {
|
|
|
5088
5099
|
this.timeline.emit("process", e), this.emit("processing"), this.root.emit("process", e), this.emit("processed");
|
|
5089
5100
|
}
|
|
5090
5101
|
_render(e) {
|
|
5091
|
-
this.emit("rendering"),
|
|
5102
|
+
this.emit("rendering"), gr(), this.renderStack.render(e), this._renderScreen(e), this.emit("rendered");
|
|
5092
5103
|
}
|
|
5093
5104
|
_renderScreen(e) {
|
|
5094
5105
|
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);
|
|
@@ -5099,42 +5110,42 @@ var Sr = class extends Tt {
|
|
|
5099
5110
|
super._destroy(), this._bindFonts(void 0), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
|
|
5100
5111
|
}
|
|
5101
5112
|
};
|
|
5102
|
-
k([_({ alias: "root.msaa" }), O("design:type", Boolean)],
|
|
5113
|
+
k([_({ alias: "root.msaa" }), O("design:type", Boolean)], Cr.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Cr.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Cr.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], Cr.prototype, "backgroundColor", void 0), k([_({
|
|
5103
5114
|
internal: !0,
|
|
5104
5115
|
fallback: !1
|
|
5105
|
-
}), O("design:type", Boolean)],
|
|
5116
|
+
}), O("design:type", Boolean)], Cr.prototype, "debug", void 0), k([_({
|
|
5106
5117
|
internal: !0,
|
|
5107
5118
|
fallback: !1
|
|
5108
|
-
}), O("design:type", Boolean)],
|
|
5119
|
+
}), O("design:type", Boolean)], Cr.prototype, "processPaused", void 0), k([_({
|
|
5109
5120
|
internal: !0,
|
|
5110
|
-
default: () =>
|
|
5111
|
-
}), O("design:type", Object)],
|
|
5121
|
+
default: () => he
|
|
5122
|
+
}), O("design:type", Object)], Cr.prototype, "fonts", void 0);
|
|
5112
5123
|
//#endregion
|
|
5113
5124
|
//#region src/scene/main/Transition.ts
|
|
5114
|
-
var
|
|
5125
|
+
var wr = class extends U {
|
|
5115
5126
|
constructor(e, t = []) {
|
|
5116
5127
|
super(), this.setProperties(e).append(t);
|
|
5117
5128
|
}
|
|
5118
5129
|
};
|
|
5119
|
-
|
|
5130
|
+
wr = k([S("Transition", {
|
|
5120
5131
|
effectMode: "transition",
|
|
5121
5132
|
duration: 2e3
|
|
5122
|
-
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])],
|
|
5133
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], wr);
|
|
5123
5134
|
//#endregion
|
|
5124
5135
|
//#region src/scene/2d/Node2D.ts
|
|
5125
|
-
var
|
|
5136
|
+
var Tr = class extends vr {
|
|
5126
5137
|
rotation = 0;
|
|
5127
|
-
position = new
|
|
5128
|
-
scale = new
|
|
5129
|
-
skew = new
|
|
5130
|
-
pivot = new
|
|
5131
|
-
extraTransform = new
|
|
5132
|
-
transform = new
|
|
5133
|
-
globalPosition = new
|
|
5138
|
+
position = new x(0, 0, () => this.updateGlobalTransform());
|
|
5139
|
+
scale = new x(1, 1, () => this.updateGlobalTransform());
|
|
5140
|
+
skew = new x(0, 0, () => this.updateGlobalTransform());
|
|
5141
|
+
pivot = new x(0, 0, () => this.updateGlobalTransform());
|
|
5142
|
+
extraTransform = new b();
|
|
5143
|
+
transform = new b();
|
|
5144
|
+
globalPosition = new x();
|
|
5134
5145
|
globalRotation = 0;
|
|
5135
|
-
globalScale = new
|
|
5136
|
-
globalSkew = new
|
|
5137
|
-
globalTransform = new
|
|
5146
|
+
globalScale = new x();
|
|
5147
|
+
globalSkew = new x();
|
|
5148
|
+
globalTransform = new b();
|
|
5138
5149
|
parentTransformDirtyId;
|
|
5139
5150
|
transformDirtyId = 0;
|
|
5140
5151
|
constructor(e, t = []) {
|
|
@@ -5174,30 +5185,30 @@ var wr = class extends _r {
|
|
|
5174
5185
|
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();
|
|
5175
5186
|
}
|
|
5176
5187
|
};
|
|
5177
|
-
|
|
5188
|
+
Tr = k([S("Node2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Tr);
|
|
5178
5189
|
//#endregion
|
|
5179
5190
|
//#region src/scene/2d/Camera2D.ts
|
|
5180
|
-
var
|
|
5181
|
-
canvasTransform = new
|
|
5191
|
+
var Er = class extends Tr {
|
|
5192
|
+
canvasTransform = new b();
|
|
5182
5193
|
_screenOffset = {
|
|
5183
5194
|
x: 0,
|
|
5184
5195
|
y: 0
|
|
5185
5196
|
};
|
|
5186
|
-
_zoom = new
|
|
5197
|
+
_zoom = new x(1, 1, () => this._updateTransform());
|
|
5187
5198
|
get zoom() {
|
|
5188
5199
|
return this._zoom;
|
|
5189
5200
|
}
|
|
5190
5201
|
set zoom(e) {
|
|
5191
5202
|
this._zoom.set(e.x, e.y);
|
|
5192
5203
|
}
|
|
5193
|
-
_minZoom = new
|
|
5204
|
+
_minZoom = new x(.02, .02);
|
|
5194
5205
|
get minZoom() {
|
|
5195
5206
|
return this._minZoom;
|
|
5196
5207
|
}
|
|
5197
5208
|
set minZoom(e) {
|
|
5198
5209
|
this._minZoom.set(e.x, e.y);
|
|
5199
5210
|
}
|
|
5200
|
-
_maxZoom = new
|
|
5211
|
+
_maxZoom = new x(256, 256);
|
|
5201
5212
|
get maxZoom() {
|
|
5202
5213
|
return this._maxZoom;
|
|
5203
5214
|
}
|
|
@@ -5218,7 +5229,7 @@ var Tr = class extends wr {
|
|
|
5218
5229
|
return this.setZoom(this._zoom.x + e, this._zoom.y + t);
|
|
5219
5230
|
}
|
|
5220
5231
|
setZoom(e, t = e) {
|
|
5221
|
-
return this._zoom.set(
|
|
5232
|
+
return this._zoom.set(St(e, this._minZoom.x, this._maxZoom.x), St(t, this._minZoom.y, this._maxZoom.y)), this;
|
|
5222
5233
|
}
|
|
5223
5234
|
setZoomAtOrigin(e, t, n) {
|
|
5224
5235
|
let r;
|
|
@@ -5291,7 +5302,7 @@ var Tr = class extends wr {
|
|
|
5291
5302
|
});
|
|
5292
5303
|
}
|
|
5293
5304
|
_getZoomByWheel(e, t) {
|
|
5294
|
-
let n = e.ctrlKey &&
|
|
5305
|
+
let n = e.ctrlKey && qe ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
|
|
5295
5306
|
return Math.round(Math.exp(i) * 1e4) / 1e4;
|
|
5296
5307
|
}
|
|
5297
5308
|
_updateTransform() {
|
|
@@ -5324,16 +5335,16 @@ var Tr = class extends wr {
|
|
|
5324
5335
|
k([_({
|
|
5325
5336
|
internal: !0,
|
|
5326
5337
|
fallback: !1
|
|
5327
|
-
}), O("design:type", Boolean)],
|
|
5338
|
+
}), O("design:type", Boolean)], Er.prototype, "spaceKey", void 0), k([_({
|
|
5328
5339
|
internal: !0,
|
|
5329
5340
|
fallback: !1
|
|
5330
|
-
}), O("design:type", Boolean)],
|
|
5341
|
+
}), O("design:type", Boolean)], Er.prototype, "grabbing", void 0), Er = k([S("Camera2D", {
|
|
5331
5342
|
processMode: "disabled",
|
|
5332
5343
|
renderMode: "disabled"
|
|
5333
|
-
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])],
|
|
5344
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Er);
|
|
5334
5345
|
//#endregion
|
|
5335
5346
|
//#region src/scene/2d/element/connectionRouter.ts
|
|
5336
|
-
function
|
|
5347
|
+
function Dr(e, t) {
|
|
5337
5348
|
return Math.abs(e) >= Math.abs(t) ? {
|
|
5338
5349
|
x: Math.sign(e) || 1,
|
|
5339
5350
|
y: 0
|
|
@@ -5342,11 +5353,11 @@ function Er(e, t) {
|
|
|
5342
5353
|
y: Math.sign(t) || 1
|
|
5343
5354
|
};
|
|
5344
5355
|
}
|
|
5345
|
-
function
|
|
5346
|
-
let i = t.point, a = n.point, o = new
|
|
5356
|
+
function Or(e, t, n, r = {}) {
|
|
5357
|
+
let i = t.point, a = n.point, o = new v();
|
|
5347
5358
|
switch (e) {
|
|
5348
5359
|
case "curved": {
|
|
5349
|
-
let e = t.dir ??
|
|
5360
|
+
let e = t.dir ?? Dr(a.x - i.x, a.y - i.y), s = n.dir ?? Dr(i.x - a.x, i.y - a.y), c = a.x - i.x, l = a.y - i.y, u = Math.hypot(c, l) || 1, d = c / u, f = l / u, p = Math.max((r.stub ?? 16) * 2, u * .4), m = (e, t, n, r) => Math.max(.1, (1 + e * n + t * r) / 2), h = p * m(e.x, e.y, d, f), g = p * m(s.x, s.y, -d, -f), ee = i.x + e.x * h, te = i.y + e.y * h, ne = a.x + s.x * g, re = a.y + s.y * g;
|
|
5350
5361
|
for (let e = 0; e <= 32; e++) {
|
|
5351
5362
|
let t = e / 32, n = 1 - t, r = n * n * n, s = 3 * n * n * t, c = 3 * n * t * t, l = t * t * t, u = r * i.x + s * ee + c * ne + l * a.x, d = r * i.y + s * te + c * re + l * a.y;
|
|
5352
5363
|
e === 0 ? o.moveTo(u, d) : o.lineTo(u, d);
|
|
@@ -5354,7 +5365,7 @@ function Dr(e, t, n, r = {}) {
|
|
|
5354
5365
|
break;
|
|
5355
5366
|
}
|
|
5356
5367
|
case "orthogonal": {
|
|
5357
|
-
let e =
|
|
5368
|
+
let e = Ar(t, n, r);
|
|
5358
5369
|
for (let t = 0; t < e.length; t++) t === 0 ? o.moveTo(e[t].x, e[t].y) : o.lineTo(e[t].x, e[t].y);
|
|
5359
5370
|
break;
|
|
5360
5371
|
}
|
|
@@ -5364,11 +5375,11 @@ function Dr(e, t, n, r = {}) {
|
|
|
5364
5375
|
}
|
|
5365
5376
|
return o;
|
|
5366
5377
|
}
|
|
5367
|
-
function
|
|
5368
|
-
return
|
|
5378
|
+
function kr(e) {
|
|
5379
|
+
return Dr(e.x, e.y);
|
|
5369
5380
|
}
|
|
5370
|
-
function
|
|
5371
|
-
let r = e.point, i = t.point, a = n.stub ?? 16, o =
|
|
5381
|
+
function Ar(e, t, n) {
|
|
5382
|
+
let r = e.point, i = t.point, a = n.stub ?? 16, o = kr(e.dir ?? Dr(i.x - r.x, i.y - r.y)), s = kr(t.dir ?? Dr(r.x - i.x, r.y - i.y)), c = {
|
|
5372
5383
|
x: r.x + o.x * a,
|
|
5373
5384
|
y: r.y + o.y * a
|
|
5374
5385
|
}, l = {
|
|
@@ -5380,12 +5391,12 @@ function kr(e, t, n) {
|
|
|
5380
5391
|
x: r.x,
|
|
5381
5392
|
y: r.y
|
|
5382
5393
|
}, c];
|
|
5383
|
-
return d.push(...
|
|
5394
|
+
return d.push(...Mr(c, o, l, s, a, u)), d.push(l, {
|
|
5384
5395
|
x: i.x,
|
|
5385
5396
|
y: i.y
|
|
5386
|
-
}),
|
|
5397
|
+
}), Nr(d);
|
|
5387
5398
|
}
|
|
5388
|
-
function
|
|
5399
|
+
function jr(e, t, n, r, i) {
|
|
5389
5400
|
let a = Infinity, o = -Infinity, s = t === "y" ? "x" : "y";
|
|
5390
5401
|
for (let e of r) {
|
|
5391
5402
|
let r = e.min[s], i = r + e.size[s];
|
|
@@ -5396,7 +5407,7 @@ function Ar(e, t, n, r, i) {
|
|
|
5396
5407
|
}
|
|
5397
5408
|
return e > a && e < o ? a - i : e;
|
|
5398
5409
|
}
|
|
5399
|
-
function
|
|
5410
|
+
function Mr(e, t, n, r, i, a = []) {
|
|
5400
5411
|
let o = t.y === 0;
|
|
5401
5412
|
if (o === (r.y === 0)) {
|
|
5402
5413
|
if (o) {
|
|
@@ -5411,7 +5422,7 @@ function jr(e, t, n, r, i, a = []) {
|
|
|
5411
5422
|
}];
|
|
5412
5423
|
}
|
|
5413
5424
|
let o = Math.abs(e.y - n.y) < .001 ? e.y + i : (e.y + n.y) / 2;
|
|
5414
|
-
return o =
|
|
5425
|
+
return o = jr(o, "y", [Math.min(e.x, n.x), Math.max(e.x, n.x)], a, i), [{
|
|
5415
5426
|
x: e.x,
|
|
5416
5427
|
y: o
|
|
5417
5428
|
}, {
|
|
@@ -5430,7 +5441,7 @@ function jr(e, t, n, r, i, a = []) {
|
|
|
5430
5441
|
}];
|
|
5431
5442
|
}
|
|
5432
5443
|
let s = Math.abs(e.x - n.x) < .001 ? e.x + i : (e.x + n.x) / 2;
|
|
5433
|
-
return s =
|
|
5444
|
+
return s = jr(s, "x", [Math.min(e.y, n.y), Math.max(e.y, n.y)], a, i), [{
|
|
5434
5445
|
x: s,
|
|
5435
5446
|
y: e.y
|
|
5436
5447
|
}, {
|
|
@@ -5457,7 +5468,7 @@ function jr(e, t, n, r, i, a = []) {
|
|
|
5457
5468
|
y: l.y
|
|
5458
5469
|
}];
|
|
5459
5470
|
}
|
|
5460
|
-
function
|
|
5471
|
+
function Nr(e) {
|
|
5461
5472
|
let t = [];
|
|
5462
5473
|
for (let n = 0; n < e.length; n++) {
|
|
5463
5474
|
let r = e[n], i = t[t.length - 1];
|
|
@@ -5467,7 +5478,7 @@ function Mr(e) {
|
|
|
5467
5478
|
}
|
|
5468
5479
|
//#endregion
|
|
5469
5480
|
//#region src/css/parseCssFilter.ts
|
|
5470
|
-
var
|
|
5481
|
+
var Pr = {
|
|
5471
5482
|
brightness: 1,
|
|
5472
5483
|
contrast: 1,
|
|
5473
5484
|
grayscale: 0,
|
|
@@ -5477,18 +5488,18 @@ var Nr = {
|
|
|
5477
5488
|
saturate: 1,
|
|
5478
5489
|
sepia: 0
|
|
5479
5490
|
};
|
|
5480
|
-
function
|
|
5481
|
-
let t = new
|
|
5491
|
+
function Fr(e) {
|
|
5492
|
+
let t = new Ct();
|
|
5482
5493
|
if (e === "none") return t;
|
|
5483
|
-
let n =
|
|
5484
|
-
Object.keys(
|
|
5485
|
-
n[e] = n[e] ??
|
|
5494
|
+
let n = ke(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5495
|
+
Object.keys(Pr).forEach((e) => {
|
|
5496
|
+
n[e] = n[e] ?? Pr[e];
|
|
5486
5497
|
});
|
|
5487
5498
|
for (let e in n) {
|
|
5488
5499
|
let r = n[e];
|
|
5489
5500
|
switch (e) {
|
|
5490
5501
|
case "hue-rotate":
|
|
5491
|
-
t.hueRotate(r *
|
|
5502
|
+
t.hueRotate(r * Se);
|
|
5492
5503
|
break;
|
|
5493
5504
|
case "saturate":
|
|
5494
5505
|
t.saturate(r);
|
|
@@ -5517,7 +5528,7 @@ function Pr(e) {
|
|
|
5517
5528
|
}
|
|
5518
5529
|
//#endregion
|
|
5519
5530
|
//#region src/css/parseCssTransformOrigin.ts
|
|
5520
|
-
function
|
|
5531
|
+
function Ir(e) {
|
|
5521
5532
|
let [t, n = t] = e.split(" ");
|
|
5522
5533
|
return [t, n].map((e) => {
|
|
5523
5534
|
switch (e = e.trim(), e) {
|
|
@@ -5532,9 +5543,9 @@ function Fr(e) {
|
|
|
5532
5543
|
}
|
|
5533
5544
|
//#endregion
|
|
5534
5545
|
//#region src/scene/effects/ColorAdjustEffect.ts
|
|
5535
|
-
var
|
|
5546
|
+
var Lr, W = class extends U {
|
|
5536
5547
|
static {
|
|
5537
|
-
|
|
5548
|
+
Lr = this;
|
|
5538
5549
|
}
|
|
5539
5550
|
static material = new I({ gl: {
|
|
5540
5551
|
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}",
|
|
@@ -5545,7 +5556,7 @@ var Ir, W = class extends U {
|
|
|
5545
5556
|
}
|
|
5546
5557
|
apply(e, t) {
|
|
5547
5558
|
t.redraw(e, () => {
|
|
5548
|
-
L.draw(e,
|
|
5559
|
+
L.draw(e, Lr.material, {
|
|
5549
5560
|
sampler: 0,
|
|
5550
5561
|
saturation: this.saturation,
|
|
5551
5562
|
contrast: this.contrast,
|
|
@@ -5559,18 +5570,18 @@ var Ir, W = class extends U {
|
|
|
5559
5570
|
});
|
|
5560
5571
|
}
|
|
5561
5572
|
};
|
|
5562
|
-
k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "gamma", void 0), W =
|
|
5573
|
+
k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "gamma", void 0), W = Lr = k([S("ColorAdjustEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
|
|
5563
5574
|
//#endregion
|
|
5564
5575
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5565
|
-
var
|
|
5576
|
+
var Rr, zr = class extends U {
|
|
5566
5577
|
static {
|
|
5567
|
-
|
|
5578
|
+
Rr = this;
|
|
5568
5579
|
}
|
|
5569
5580
|
static material = new I({ gl: {
|
|
5570
5581
|
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}",
|
|
5571
5582
|
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}"
|
|
5572
5583
|
} });
|
|
5573
|
-
_colorMatrix = new
|
|
5584
|
+
_colorMatrix = new Ct();
|
|
5574
5585
|
constructor(e, t = []) {
|
|
5575
5586
|
super(), this.setProperties(e).append(t);
|
|
5576
5587
|
}
|
|
@@ -5583,13 +5594,13 @@ var Lr, Rr = class extends U {
|
|
|
5583
5594
|
}
|
|
5584
5595
|
apply(e, t) {
|
|
5585
5596
|
if (!this.filter) return;
|
|
5586
|
-
let n =
|
|
5597
|
+
let n = ke(this.filter), r = this._colorMatrix.identity();
|
|
5587
5598
|
n.forEach(({ name: e, args: t }) => {
|
|
5588
5599
|
let n = t.map((e) => e.normalizedIntValue);
|
|
5589
5600
|
switch (e) {
|
|
5590
5601
|
case "hue-rotate":
|
|
5591
5602
|
case "hueRotate":
|
|
5592
|
-
r.hueRotate(n[0] *
|
|
5603
|
+
r.hueRotate(n[0] * Se);
|
|
5593
5604
|
break;
|
|
5594
5605
|
case "saturate":
|
|
5595
5606
|
r.saturate(n[0]);
|
|
@@ -5614,25 +5625,25 @@ var Lr, Rr = class extends U {
|
|
|
5614
5625
|
break;
|
|
5615
5626
|
}
|
|
5616
5627
|
}), t.redraw(e, () => {
|
|
5617
|
-
L.draw(e,
|
|
5628
|
+
L.draw(e, Rr.material, {
|
|
5618
5629
|
sampler: 0,
|
|
5619
5630
|
m: r.toArray()
|
|
5620
5631
|
});
|
|
5621
5632
|
});
|
|
5622
5633
|
}
|
|
5623
5634
|
};
|
|
5624
|
-
k([_(), O("design:type", String)],
|
|
5635
|
+
k([_(), O("design:type", String)], zr.prototype, "filter", void 0), zr = Rr = k([S("ColorFilterEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], zr);
|
|
5625
5636
|
//#endregion
|
|
5626
5637
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
5627
|
-
var
|
|
5638
|
+
var Br, Vr = 50, Hr = class extends U {
|
|
5628
5639
|
static {
|
|
5629
|
-
|
|
5640
|
+
Br = this;
|
|
5630
5641
|
}
|
|
5631
5642
|
static material = new I({ gl: {
|
|
5632
5643
|
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}",
|
|
5633
5644
|
fragment: `precision mediump float;
|
|
5634
5645
|
uniform sampler2D sampler;
|
|
5635
|
-
uniform vec4 colors[${
|
|
5646
|
+
uniform vec4 colors[${Vr}];
|
|
5636
5647
|
varying vec2 vUv;
|
|
5637
5648
|
|
|
5638
5649
|
float calcWidth() {
|
|
@@ -5641,7 +5652,7 @@ float calcWidth() {
|
|
|
5641
5652
|
|
|
5642
5653
|
int calcCount() {
|
|
5643
5654
|
int count = 0;
|
|
5644
|
-
for (int i = 0; i < ${
|
|
5655
|
+
for (int i = 0; i < ${Vr}; i++) {
|
|
5645
5656
|
if (colors[i] != vec4(0,0,0,0)){
|
|
5646
5657
|
count++;
|
|
5647
5658
|
}
|
|
@@ -5653,7 +5664,7 @@ vec4 calcColor(float x) {
|
|
|
5653
5664
|
float perUnit = calcWidth() / float(calcCount());
|
|
5654
5665
|
int index = int(x / perUnit);
|
|
5655
5666
|
|
|
5656
|
-
for(int i=0; i<${
|
|
5667
|
+
for(int i=0; i<${Vr}; i++){
|
|
5657
5668
|
if(i==index){
|
|
5658
5669
|
return colors[i];
|
|
5659
5670
|
}
|
|
@@ -5668,7 +5679,7 @@ void main(void) {
|
|
|
5668
5679
|
gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
|
|
5669
5680
|
}`
|
|
5670
5681
|
} });
|
|
5671
|
-
_color = new
|
|
5682
|
+
_color = new yt();
|
|
5672
5683
|
constructor(e, t = []) {
|
|
5673
5684
|
super(), this.setProperties(e).append(t);
|
|
5674
5685
|
}
|
|
@@ -5679,31 +5690,31 @@ void main(void) {
|
|
|
5679
5690
|
let t = this._color.toArray();
|
|
5680
5691
|
return t[3] = this.alpha, t;
|
|
5681
5692
|
});
|
|
5682
|
-
for (; t.length <
|
|
5693
|
+
for (; t.length < Vr;) t.push([
|
|
5683
5694
|
0,
|
|
5684
5695
|
0,
|
|
5685
5696
|
0,
|
|
5686
5697
|
0
|
|
5687
5698
|
]);
|
|
5688
|
-
L.draw(e,
|
|
5699
|
+
L.draw(e, Br.material, {
|
|
5689
5700
|
sampler: 0,
|
|
5690
|
-
colors: t.slice(0,
|
|
5701
|
+
colors: t.slice(0, Vr).flatMap((e) => e)
|
|
5691
5702
|
});
|
|
5692
5703
|
});
|
|
5693
5704
|
}
|
|
5694
5705
|
};
|
|
5695
|
-
k([_({ default: () => [] }), O("design:type", Array)],
|
|
5706
|
+
k([_({ default: () => [] }), O("design:type", Array)], Hr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Hr.prototype, "alpha", void 0), Hr = Br = k([S("ColorOverlayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Hr);
|
|
5696
5707
|
//#endregion
|
|
5697
5708
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
5698
|
-
var
|
|
5709
|
+
var Ur, Wr = class extends U {
|
|
5699
5710
|
static {
|
|
5700
|
-
|
|
5711
|
+
Ur = this;
|
|
5701
5712
|
}
|
|
5702
5713
|
static material = new I({ gl: {
|
|
5703
5714
|
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}",
|
|
5704
5715
|
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}"
|
|
5705
5716
|
} });
|
|
5706
|
-
_color = new
|
|
5717
|
+
_color = new yt();
|
|
5707
5718
|
constructor(e, t = []) {
|
|
5708
5719
|
super(), this.setProperties(e).append(t);
|
|
5709
5720
|
}
|
|
@@ -5717,7 +5728,7 @@ var Hr, Ur = class extends U {
|
|
|
5717
5728
|
r.slice(0, 50).forEach((e, t) => {
|
|
5718
5729
|
n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
|
|
5719
5730
|
}), t.redraw(e, () => {
|
|
5720
|
-
L.draw(e,
|
|
5731
|
+
L.draw(e, Ur.material, {
|
|
5721
5732
|
sampler: 0,
|
|
5722
5733
|
epsilon: this.epsilon,
|
|
5723
5734
|
originalColors: n
|
|
@@ -5725,19 +5736,19 @@ var Hr, Ur = class extends U {
|
|
|
5725
5736
|
});
|
|
5726
5737
|
}
|
|
5727
5738
|
};
|
|
5728
|
-
k([_({ default: () => [] }), O("design:type", Array)],
|
|
5739
|
+
k([_({ default: () => [] }), O("design:type", Array)], Wr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Wr.prototype, "epsilon", void 0), Wr = Ur = k([S("ColorRemoveEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Wr);
|
|
5729
5740
|
//#endregion
|
|
5730
5741
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
5731
|
-
var
|
|
5742
|
+
var Gr, Kr = 50, qr = class extends U {
|
|
5732
5743
|
static {
|
|
5733
|
-
|
|
5744
|
+
Gr = this;
|
|
5734
5745
|
}
|
|
5735
5746
|
static material = new I({ gl: {
|
|
5736
5747
|
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}",
|
|
5737
5748
|
fragment: `varying vec2 vUv;
|
|
5738
5749
|
uniform sampler2D sampler;
|
|
5739
5750
|
uniform float epsilon;
|
|
5740
|
-
const int MAX_COLORS = ${
|
|
5751
|
+
const int MAX_COLORS = ${Kr};
|
|
5741
5752
|
uniform vec3 originalColors[MAX_COLORS];
|
|
5742
5753
|
uniform vec3 targetColors[MAX_COLORS];
|
|
5743
5754
|
|
|
@@ -5765,7 +5776,7 @@ void main(void) {
|
|
|
5765
5776
|
}
|
|
5766
5777
|
}`
|
|
5767
5778
|
} });
|
|
5768
|
-
_color = new
|
|
5779
|
+
_color = new yt();
|
|
5769
5780
|
constructor(e, t = []) {
|
|
5770
5781
|
super(), this.setProperties(e).append(t);
|
|
5771
5782
|
}
|
|
@@ -5774,8 +5785,8 @@ void main(void) {
|
|
|
5774
5785
|
this._color.value = e[0];
|
|
5775
5786
|
let t = this._color.toArray().slice(0, 3);
|
|
5776
5787
|
return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
|
|
5777
|
-
}), r = this.epsilon, i = new Float32Array(
|
|
5778
|
-
for (; n.length <
|
|
5788
|
+
}), r = this.epsilon, i = new Float32Array(Kr * 3), a = new Float32Array(Kr * 3);
|
|
5789
|
+
for (; n.length < Kr;) n.push([[
|
|
5779
5790
|
-1,
|
|
5780
5791
|
0,
|
|
5781
5792
|
0
|
|
@@ -5785,10 +5796,10 @@ void main(void) {
|
|
|
5785
5796
|
0,
|
|
5786
5797
|
1
|
|
5787
5798
|
]]);
|
|
5788
|
-
n.slice(0,
|
|
5799
|
+
n.slice(0, Kr).forEach(([e, t], n) => {
|
|
5789
5800
|
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];
|
|
5790
5801
|
}), t.redraw(e, () => {
|
|
5791
|
-
L.draw(e,
|
|
5802
|
+
L.draw(e, Gr.material, {
|
|
5792
5803
|
sampler: 0,
|
|
5793
5804
|
epsilon: r,
|
|
5794
5805
|
originalColors: i,
|
|
@@ -5797,17 +5808,17 @@ void main(void) {
|
|
|
5797
5808
|
});
|
|
5798
5809
|
}
|
|
5799
5810
|
};
|
|
5800
|
-
k([_({ default: () => [] }), O("design:type", Array)],
|
|
5811
|
+
k([_({ default: () => [] }), O("design:type", Array)], qr.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], qr.prototype, "epsilon", void 0), qr = Gr = k([S("ColorReplaceEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], qr);
|
|
5801
5812
|
//#endregion
|
|
5802
5813
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
5803
|
-
var
|
|
5814
|
+
var Jr = "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", Yr, G = class extends U {
|
|
5804
5815
|
static {
|
|
5805
|
-
|
|
5816
|
+
Yr = this;
|
|
5806
5817
|
}
|
|
5807
5818
|
_watermark;
|
|
5808
5819
|
static material = new I({ gl: {
|
|
5809
5820
|
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}",
|
|
5810
|
-
fragment:
|
|
5821
|
+
fragment: Jr
|
|
5811
5822
|
} });
|
|
5812
5823
|
constructor(e, t = []) {
|
|
5813
5824
|
super(), this.setProperties(e).append(t);
|
|
@@ -5856,7 +5867,7 @@ var qr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5856
5867
|
zoomedOut: this.dotColor ?? a.zoomedOut,
|
|
5857
5868
|
diff: this.dotZoomDiff ?? a.diff
|
|
5858
5869
|
};
|
|
5859
|
-
L.draw(e,
|
|
5870
|
+
L.draw(e, Yr.material, {
|
|
5860
5871
|
uTexture: 0,
|
|
5861
5872
|
inputSize: [t.width, t.height],
|
|
5862
5873
|
zoom: [n[0], n[4]],
|
|
@@ -5880,20 +5891,20 @@ var qr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5880
5891
|
});
|
|
5881
5892
|
}
|
|
5882
5893
|
};
|
|
5883
|
-
k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], G.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "pixelGrid", void 0), k([_(), O("design:type", Number)], G.prototype, "dotBaseColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotZoomDiff", void 0), k([_(), O("design:type", String)], G.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], G.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], G.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], G.prototype, "watermarkRotation", void 0), G =
|
|
5894
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], G.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "pixelGrid", void 0), k([_(), O("design:type", Number)], G.prototype, "dotBaseColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotZoomDiff", void 0), k([_(), O("design:type", String)], G.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], G.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], G.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], G.prototype, "watermarkRotation", void 0), G = Yr = k([S("DrawboardEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
|
|
5884
5895
|
//#endregion
|
|
5885
5896
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
5886
|
-
var
|
|
5897
|
+
var Xr, Zr = "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}", Qr = class extends U {
|
|
5887
5898
|
static {
|
|
5888
|
-
|
|
5899
|
+
Xr = this;
|
|
5889
5900
|
}
|
|
5890
5901
|
static materialX = new I({ gl: {
|
|
5891
5902
|
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}",
|
|
5892
|
-
fragment:
|
|
5903
|
+
fragment: Zr
|
|
5893
5904
|
} });
|
|
5894
5905
|
static materialY = new I({ gl: {
|
|
5895
5906
|
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}",
|
|
5896
|
-
fragment:
|
|
5907
|
+
fragment: Zr
|
|
5897
5908
|
} });
|
|
5898
5909
|
constructor(e, t = []) {
|
|
5899
5910
|
super(), this.setProperties(e).append(t);
|
|
@@ -5901,39 +5912,39 @@ var Yr, Xr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
|
|
|
5901
5912
|
apply(e, t) {
|
|
5902
5913
|
let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
|
|
5903
5914
|
for (let r = 0; r < i; r++) t.redraw(e, () => {
|
|
5904
|
-
L.draw(e,
|
|
5915
|
+
L.draw(e, Xr.materialX, {
|
|
5905
5916
|
sampler: 0,
|
|
5906
5917
|
uStrength: n * (this.strength / i)
|
|
5907
5918
|
});
|
|
5908
5919
|
});
|
|
5909
5920
|
for (let n = 0; n < i; n++) t.redraw(e, () => {
|
|
5910
|
-
L.draw(e,
|
|
5921
|
+
L.draw(e, Xr.materialY, {
|
|
5911
5922
|
sampler: 0,
|
|
5912
5923
|
uStrength: r * (this.strength / i)
|
|
5913
5924
|
});
|
|
5914
5925
|
});
|
|
5915
5926
|
}
|
|
5916
5927
|
};
|
|
5917
|
-
k([_({ fallback: 4 }), O("design:type", Number)],
|
|
5928
|
+
k([_({ fallback: 4 }), O("design:type", Number)], Qr.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Qr.prototype, "quality", void 0), Qr = Xr = k([S("GaussianBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Qr);
|
|
5918
5929
|
//#endregion
|
|
5919
5930
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
5920
|
-
var
|
|
5931
|
+
var $r, ei = class extends U {
|
|
5921
5932
|
static {
|
|
5922
|
-
|
|
5933
|
+
$r = this;
|
|
5923
5934
|
}
|
|
5924
5935
|
static material = new I({ gl: {
|
|
5925
5936
|
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}",
|
|
5926
5937
|
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}"
|
|
5927
5938
|
} });
|
|
5928
|
-
blurEffect = new
|
|
5939
|
+
blurEffect = new Qr();
|
|
5929
5940
|
viewport3 = new H();
|
|
5930
|
-
_color = new
|
|
5941
|
+
_color = new yt();
|
|
5931
5942
|
constructor(e, t = []) {
|
|
5932
5943
|
super(), this.setProperties(e).append(t);
|
|
5933
5944
|
}
|
|
5934
5945
|
apply(e, t) {
|
|
5935
5946
|
this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
|
|
5936
|
-
this._color.value = this.color, L.draw(e,
|
|
5947
|
+
this._color.value = this.color, L.draw(e, $r.material, {
|
|
5937
5948
|
sampler: 0,
|
|
5938
5949
|
uAlpha: this._color.a,
|
|
5939
5950
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -5946,16 +5957,16 @@ var Qr, $r = class extends U {
|
|
|
5946
5957
|
]
|
|
5947
5958
|
});
|
|
5948
5959
|
}), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
|
|
5949
|
-
this.viewport3.texture.activate(e, 1), L.draw(e,
|
|
5960
|
+
this.viewport3.texture.activate(e, 1), L.draw(e, Qn.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, Qn.instance, { sampler: 0 }), e.texture.unbind(1);
|
|
5950
5961
|
});
|
|
5951
5962
|
}
|
|
5952
5963
|
};
|
|
5953
|
-
k([_({ fallback: "#000000FF" }), O("design:type", Object)],
|
|
5964
|
+
k([_({ fallback: "#000000FF" }), O("design:type", Object)], ei.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], ei.prototype, "shadowOnly", void 0), ei = $r = k([S("DropShadowEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ei);
|
|
5954
5965
|
//#endregion
|
|
5955
5966
|
//#region src/scene/effects/EmbossEffect.ts
|
|
5956
|
-
var
|
|
5967
|
+
var ti, ni = class extends U {
|
|
5957
5968
|
static {
|
|
5958
|
-
|
|
5969
|
+
ti = this;
|
|
5959
5970
|
}
|
|
5960
5971
|
static material = new I({ gl: {
|
|
5961
5972
|
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}",
|
|
@@ -5966,7 +5977,7 @@ var ei, ti = class extends U {
|
|
|
5966
5977
|
}
|
|
5967
5978
|
apply(e, t) {
|
|
5968
5979
|
t.redraw(e, () => {
|
|
5969
|
-
L.draw(e,
|
|
5980
|
+
L.draw(e, ti.material, {
|
|
5970
5981
|
sampler: 0,
|
|
5971
5982
|
strength: this.strength,
|
|
5972
5983
|
inputSize: [
|
|
@@ -5979,12 +5990,12 @@ var ei, ti = class extends U {
|
|
|
5979
5990
|
});
|
|
5980
5991
|
}
|
|
5981
5992
|
};
|
|
5982
|
-
k([_({ fallback: 5 }), O("design:type", Number)],
|
|
5993
|
+
k([_({ fallback: 5 }), O("design:type", Number)], ni.prototype, "strength", void 0), ni = ti = k([S("EmbossEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ni);
|
|
5983
5994
|
//#endregion
|
|
5984
5995
|
//#region src/scene/effects/GlitchEffect.ts
|
|
5985
|
-
var
|
|
5996
|
+
var ri, K = class extends U {
|
|
5986
5997
|
static {
|
|
5987
|
-
|
|
5998
|
+
ri = this;
|
|
5988
5999
|
}
|
|
5989
6000
|
static material = new I({ gl: {
|
|
5990
6001
|
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}",
|
|
@@ -5997,7 +6008,7 @@ var ni, K = class extends U {
|
|
|
5997
6008
|
_needsRedraw = !1;
|
|
5998
6009
|
constructor(e, t = []) {
|
|
5999
6010
|
super(), this.setProperties(e).append(t);
|
|
6000
|
-
let n =
|
|
6011
|
+
let n = w(4, this.sampleSize);
|
|
6001
6012
|
if (!n) throw Error("GlitchEffect requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
6002
6013
|
this._canvas = n, this._texture = new z(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
|
|
6003
6014
|
}
|
|
@@ -6016,7 +6027,7 @@ var ni, K = class extends U {
|
|
|
6016
6027
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
6017
6028
|
let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
|
|
6018
6029
|
t.redraw(e, () => {
|
|
6019
|
-
this._texture.activate(e, 1), L.draw(e,
|
|
6030
|
+
this._texture.activate(e, 1), L.draw(e, ri.material, {
|
|
6020
6031
|
sampler: 0,
|
|
6021
6032
|
filterClamp: [
|
|
6022
6033
|
0,
|
|
@@ -6045,12 +6056,12 @@ var ni, K = class extends U {
|
|
|
6045
6056
|
});
|
|
6046
6057
|
}
|
|
6047
6058
|
};
|
|
6048
|
-
k([_({ fallback: 10 }), O("design:type", Number)], K.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], K.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], K.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], K.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], K.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], K.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], K.prototype, "blue", void 0), K =
|
|
6059
|
+
k([_({ fallback: 10 }), O("design:type", Number)], K.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], K.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], K.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], K.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], K.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], K.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], K.prototype, "blue", void 0), K = ri = k([S("GlitchEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
|
|
6049
6060
|
//#endregion
|
|
6050
6061
|
//#region src/scene/effects/GodrayEffect.ts
|
|
6051
|
-
var
|
|
6062
|
+
var ii, ai = "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}", q = class extends U {
|
|
6052
6063
|
static {
|
|
6053
|
-
|
|
6064
|
+
ii = this;
|
|
6054
6065
|
}
|
|
6055
6066
|
static material = new I({ gl: {
|
|
6056
6067
|
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}",
|
|
@@ -6065,7 +6076,7 @@ uniform float uTime;
|
|
|
6065
6076
|
uniform vec3 uRay;
|
|
6066
6077
|
uniform vec4 uInputSize;
|
|
6067
6078
|
|
|
6068
|
-
${
|
|
6079
|
+
${ai}
|
|
6069
6080
|
|
|
6070
6081
|
void main(void) {
|
|
6071
6082
|
bool uParallel = uParallel > 0.5;
|
|
@@ -6104,7 +6115,7 @@ void main(void) {
|
|
|
6104
6115
|
apply(e, t) {
|
|
6105
6116
|
let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
|
|
6106
6117
|
t.redraw(e, () => {
|
|
6107
|
-
L.draw(e,
|
|
6118
|
+
L.draw(e, ii.material, {
|
|
6108
6119
|
sampler: 0,
|
|
6109
6120
|
uDimensions: [t.width, t.height],
|
|
6110
6121
|
uParallel: +!!this.parallel,
|
|
@@ -6126,15 +6137,15 @@ void main(void) {
|
|
|
6126
6137
|
});
|
|
6127
6138
|
}
|
|
6128
6139
|
};
|
|
6129
|
-
k([_({ fallback: 0 }), O("design:type", Number)], q.prototype, "time", void 0), k([_({ fallback: 30 }), O("design:type", Number)], q.prototype, "angle", void 0), k([_({ fallback: .5 }), O("design:type", Number)], q.prototype, "gain", void 0), k([_({ fallback: 2.5 }), O("design:type", Number)], q.prototype, "lacunarity", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], q.prototype, "parallel", void 0), k([_({ default: () => [0, 0] }), O("design:type", Array)], q.prototype, "center", void 0), k([_({ fallback: 1 }), O("design:type", Number)], q.prototype, "alpha", void 0), q =
|
|
6140
|
+
k([_({ fallback: 0 }), O("design:type", Number)], q.prototype, "time", void 0), k([_({ fallback: 30 }), O("design:type", Number)], q.prototype, "angle", void 0), k([_({ fallback: .5 }), O("design:type", Number)], q.prototype, "gain", void 0), k([_({ fallback: 2.5 }), O("design:type", Number)], q.prototype, "lacunarity", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], q.prototype, "parallel", void 0), k([_({ default: () => [0, 0] }), O("design:type", Array)], q.prototype, "center", void 0), k([_({ fallback: 1 }), O("design:type", Number)], q.prototype, "alpha", void 0), q = ii = k([S("GodrayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
|
|
6130
6141
|
//#endregion
|
|
6131
6142
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
6132
|
-
var
|
|
6143
|
+
var oi = "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}", si = "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}", ci = class extends U {
|
|
6133
6144
|
_kernels = [0];
|
|
6134
6145
|
constructor(e, t = []) {
|
|
6135
6146
|
super(), this.material = new I({ gl: {
|
|
6136
6147
|
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}",
|
|
6137
|
-
fragment: e?.clamp ?
|
|
6148
|
+
fragment: e?.clamp ? si : oi
|
|
6138
6149
|
} }), this.setProperties(e).append(t), this._generateKernels();
|
|
6139
6150
|
}
|
|
6140
6151
|
_updateProperty(e, t, n) {
|
|
@@ -6172,12 +6183,12 @@ var ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6172
6183
|
});
|
|
6173
6184
|
}
|
|
6174
6185
|
};
|
|
6175
|
-
k([_({ fallback: 4 }), O("design:type", Number)],
|
|
6186
|
+
k([_({ fallback: 4 }), O("design:type", Number)], ci.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], ci.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], ci.prototype, "pixelSize", void 0), ci = k([S("KawaseBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ci);
|
|
6176
6187
|
//#endregion
|
|
6177
6188
|
//#region src/scene/effects/MaskEffect.ts
|
|
6178
|
-
var
|
|
6189
|
+
var li, ui = class extends U {
|
|
6179
6190
|
static {
|
|
6180
|
-
|
|
6191
|
+
li = this;
|
|
6181
6192
|
}
|
|
6182
6193
|
static material = new I({ gl: {
|
|
6183
6194
|
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}",
|
|
@@ -6199,7 +6210,7 @@ var ci, li = class extends U {
|
|
|
6199
6210
|
}
|
|
6200
6211
|
apply(e, t, n) {
|
|
6201
6212
|
this.texture && t.redraw(e, () => {
|
|
6202
|
-
this.texture.activate(e, 1), L.draw(e,
|
|
6213
|
+
this.texture.activate(e, 1), L.draw(e, li.material, {
|
|
6203
6214
|
sampler: 0,
|
|
6204
6215
|
mask: 1,
|
|
6205
6216
|
rotation: n.target?.globalRotation ?? 0
|
|
@@ -6207,23 +6218,23 @@ var ci, li = class extends U {
|
|
|
6207
6218
|
});
|
|
6208
6219
|
}
|
|
6209
6220
|
};
|
|
6210
|
-
k([_({ fallback: "" }), O("design:type", String)],
|
|
6221
|
+
k([_({ fallback: "" }), O("design:type", String)], ui.prototype, "image", void 0), ui = li = k([S("MaskEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ui);
|
|
6211
6222
|
//#endregion
|
|
6212
6223
|
//#region src/scene/effects/OutlineEffect.ts
|
|
6213
|
-
var
|
|
6224
|
+
var di, fi = "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}", J = class extends U {
|
|
6214
6225
|
static {
|
|
6215
|
-
|
|
6226
|
+
di = this;
|
|
6216
6227
|
}
|
|
6217
6228
|
static MIN_SAMPLES = 1;
|
|
6218
6229
|
static MAX_SAMPLES = 100;
|
|
6219
6230
|
static getAngleStep(e) {
|
|
6220
|
-
return Number.parseFloat((Math.PI * 2 / Math.max(e *
|
|
6231
|
+
return Number.parseFloat((Math.PI * 2 / Math.max(e * di.MAX_SAMPLES, di.MIN_SAMPLES)).toFixed(7));
|
|
6221
6232
|
}
|
|
6222
|
-
_color = new
|
|
6233
|
+
_color = new yt();
|
|
6223
6234
|
constructor(e, t = []) {
|
|
6224
6235
|
super(), this.setProperties(e).append(t), this.material = new I({ gl: {
|
|
6225
6236
|
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}",
|
|
6226
|
-
fragment:
|
|
6237
|
+
fragment: fi.replace(/\{ANGLE_STEP\}/, di.getAngleStep(this.quality).toFixed(7))
|
|
6227
6238
|
} });
|
|
6228
6239
|
}
|
|
6229
6240
|
apply(e, t) {
|
|
@@ -6233,7 +6244,7 @@ var ui, di = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6233
6244
|
uThickness: [this.width / t.width, this.width / t.height],
|
|
6234
6245
|
uColor: this._color.toArray().slice(0, 3),
|
|
6235
6246
|
uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
|
|
6236
|
-
uAngleStep:
|
|
6247
|
+
uAngleStep: di.getAngleStep(this.quality),
|
|
6237
6248
|
uKnockout: +!!this.knockout,
|
|
6238
6249
|
uInputClamp: [
|
|
6239
6250
|
0,
|
|
@@ -6245,12 +6256,12 @@ var ui, di = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6245
6256
|
});
|
|
6246
6257
|
}
|
|
6247
6258
|
};
|
|
6248
|
-
k([_({ fallback: "#000000ff" }), O("design:type", Object)], J.prototype, "color", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", String)], J.prototype, "style", void 0), k([_(), O("design:type", Object)], J.prototype, "image", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "opacity", void 0), k([_({ fallback: .1 }), O("design:type", Number)], J.prototype, "quality", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], J.prototype, "knockout", void 0), J =
|
|
6259
|
+
k([_({ fallback: "#000000ff" }), O("design:type", Object)], J.prototype, "color", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", String)], J.prototype, "style", void 0), k([_(), O("design:type", Object)], J.prototype, "image", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "opacity", void 0), k([_({ fallback: .1 }), O("design:type", Number)], J.prototype, "quality", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], J.prototype, "knockout", void 0), J = di = k([S("OutlineEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
|
|
6249
6260
|
//#endregion
|
|
6250
6261
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6251
|
-
var
|
|
6262
|
+
var pi, mi = class extends U {
|
|
6252
6263
|
static {
|
|
6253
|
-
|
|
6264
|
+
pi = this;
|
|
6254
6265
|
}
|
|
6255
6266
|
static material = new I({ gl: {
|
|
6256
6267
|
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}",
|
|
@@ -6266,16 +6277,16 @@ var fi, pi = class extends U {
|
|
|
6266
6277
|
offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
|
|
6267
6278
|
step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
|
|
6268
6279
|
};
|
|
6269
|
-
L.draw(e,
|
|
6280
|
+
L.draw(e, pi.material, a);
|
|
6270
6281
|
});
|
|
6271
6282
|
}
|
|
6272
6283
|
};
|
|
6273
|
-
k([_({ fallback: 10 }), O("design:type", Number)],
|
|
6284
|
+
k([_({ fallback: 10 }), O("design:type", Number)], mi.prototype, "strength", void 0), mi = pi = k([S("PixelateEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], mi);
|
|
6274
6285
|
//#endregion
|
|
6275
6286
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6276
|
-
var
|
|
6287
|
+
var hi, gi = class extends U {
|
|
6277
6288
|
static {
|
|
6278
|
-
|
|
6289
|
+
hi = this;
|
|
6279
6290
|
}
|
|
6280
6291
|
static material = new I({ gl: {
|
|
6281
6292
|
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}",
|
|
@@ -6286,7 +6297,7 @@ var mi, hi = class extends U {
|
|
|
6286
6297
|
}
|
|
6287
6298
|
apply(e, t) {
|
|
6288
6299
|
t.redraw(e, () => {
|
|
6289
|
-
L.draw(e,
|
|
6300
|
+
L.draw(e, hi.material, {
|
|
6290
6301
|
sampler: 0,
|
|
6291
6302
|
uCenter: [t.width / 2, t.height / 2],
|
|
6292
6303
|
uInnerRadius: this.innerRadius,
|
|
@@ -6302,11 +6313,11 @@ var mi, hi = class extends U {
|
|
|
6302
6313
|
});
|
|
6303
6314
|
}
|
|
6304
6315
|
};
|
|
6305
|
-
k([_(), O("design:type", Array)],
|
|
6316
|
+
k([_(), O("design:type", Array)], gi.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], gi.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], gi.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], gi.prototype, "strength", void 0), gi = hi = k([S("ZoomBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], gi);
|
|
6306
6317
|
//#endregion
|
|
6307
6318
|
//#region src/scene/2d/element/utils.ts
|
|
6308
|
-
function
|
|
6309
|
-
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new
|
|
6319
|
+
function _i(e, t) {
|
|
6320
|
+
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new b().translate(-n, -r).scale(1 / i, 1 / a);
|
|
6310
6321
|
if (e.cropRect) {
|
|
6311
6322
|
let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
|
|
6312
6323
|
s.scale(1 - (t + r), 1 - (n + i)).translate(t, n), o = !0;
|
|
@@ -6327,7 +6338,7 @@ function gi(e, t) {
|
|
|
6327
6338
|
}
|
|
6328
6339
|
//#endregion
|
|
6329
6340
|
//#region src/scene/2d/element/Element2DFill.ts
|
|
6330
|
-
var Y = class extends
|
|
6341
|
+
var Y = class extends T {
|
|
6331
6342
|
_parent;
|
|
6332
6343
|
texture;
|
|
6333
6344
|
animatedTexture;
|
|
@@ -6338,7 +6349,7 @@ var Y = class extends C {
|
|
|
6338
6349
|
return super.setProperties(e);
|
|
6339
6350
|
}
|
|
6340
6351
|
setProperties(e) {
|
|
6341
|
-
return this._setProperties(d(e) ? void 0 :
|
|
6352
|
+
return this._setProperties(d(e) ? void 0 : g(e));
|
|
6342
6353
|
}
|
|
6343
6354
|
_updateProperty(e, t, n) {
|
|
6344
6355
|
switch (super._updateProperty(e, t, n), e) {
|
|
@@ -6360,7 +6371,7 @@ var Y = class extends C {
|
|
|
6360
6371
|
}
|
|
6361
6372
|
}
|
|
6362
6373
|
async loadTexture() {
|
|
6363
|
-
if (this.linearGradient || this.radialGradient) this.texture = new
|
|
6374
|
+
if (this.linearGradient || this.radialGradient) this.texture = new rr(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
|
|
6364
6375
|
else if (d(this.image)) this.animatedTexture = void 0, this.texture = void 0;
|
|
6365
6376
|
else if (this._parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
|
|
6366
6377
|
let e = this.image.split("?")[0].endsWith(".gif"), t = this.image, n = await $.loadBy(t, async () => {
|
|
@@ -6381,12 +6392,12 @@ var Y = class extends C {
|
|
|
6381
6392
|
width: e,
|
|
6382
6393
|
height: t
|
|
6383
6394
|
} };
|
|
6384
|
-
if (this.image === "viewport") n.fillStyle = new
|
|
6395
|
+
if (this.image === "viewport") n.fillStyle = new sr();
|
|
6385
6396
|
else {
|
|
6386
6397
|
let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
|
|
6387
6398
|
r = {
|
|
6388
6399
|
...r,
|
|
6389
|
-
...
|
|
6400
|
+
..._i(this, this.tile && i ? {
|
|
6390
6401
|
x: 0,
|
|
6391
6402
|
y: 0,
|
|
6392
6403
|
width: i.sourceWidth,
|
|
@@ -6425,7 +6436,7 @@ var Y = class extends C {
|
|
|
6425
6436
|
k([_({ fallback: !0 }), O("design:type", Boolean)], Y.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Y.prototype, "color", void 0), k([_(), O("design:type", Object)], Y.prototype, "image", void 0), k([_(), O("design:type", Object)], Y.prototype, "linearGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "radialGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "cropRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "stretchRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "dpi", void 0), k([_(), O("design:type", Object)], Y.prototype, "rotateWithShape", void 0), k([_(), O("design:type", Object)], Y.prototype, "tile", void 0), k([_(), O("design:type", Object)], Y.prototype, "opacity", void 0);
|
|
6426
6437
|
//#endregion
|
|
6427
6438
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6428
|
-
var
|
|
6439
|
+
var vi = class extends Y {
|
|
6429
6440
|
setProperties(e) {
|
|
6430
6441
|
return super._setProperties(d(e) ? void 0 : f(e));
|
|
6431
6442
|
}
|
|
@@ -6437,14 +6448,14 @@ var _i = class extends Y {
|
|
|
6437
6448
|
}
|
|
6438
6449
|
}
|
|
6439
6450
|
};
|
|
6440
|
-
k([_(), O("design:type", Object)],
|
|
6451
|
+
k([_(), O("design:type", Object)], vi.prototype, "fillWithShape", void 0);
|
|
6441
6452
|
//#endregion
|
|
6442
6453
|
//#region src/scene/2d/element/Element2DChart.ts
|
|
6443
|
-
var
|
|
6444
|
-
function
|
|
6445
|
-
return
|
|
6454
|
+
var yi;
|
|
6455
|
+
function bi() {
|
|
6456
|
+
return yi ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), yi;
|
|
6446
6457
|
}
|
|
6447
|
-
function
|
|
6458
|
+
function xi(e) {
|
|
6448
6459
|
if (!e) return { show: !1 };
|
|
6449
6460
|
switch (e) {
|
|
6450
6461
|
case "bottom": return {
|
|
@@ -6467,7 +6478,7 @@ function bi(e) {
|
|
|
6467
6478
|
};
|
|
6468
6479
|
}
|
|
6469
6480
|
}
|
|
6470
|
-
var X = class extends
|
|
6481
|
+
var X = class extends T {
|
|
6471
6482
|
_parent;
|
|
6472
6483
|
_instance;
|
|
6473
6484
|
_container;
|
|
@@ -6510,7 +6521,7 @@ var X = class extends C {
|
|
|
6510
6521
|
this._teardown(), this._parent.requestDraw();
|
|
6511
6522
|
return;
|
|
6512
6523
|
}
|
|
6513
|
-
let n = await
|
|
6524
|
+
let n = await bi();
|
|
6514
6525
|
if (!n) {
|
|
6515
6526
|
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)"), this._renderPlaceholder(e, t);
|
|
6516
6527
|
return;
|
|
@@ -6535,7 +6546,7 @@ var X = class extends C {
|
|
|
6535
6546
|
}), this._instance.setOption(this._toOption(), !0), !this._texture) {
|
|
6536
6547
|
let e = this._container.querySelector("canvas");
|
|
6537
6548
|
if (!e) return;
|
|
6538
|
-
this._texture = new
|
|
6549
|
+
this._texture = new tr({
|
|
6539
6550
|
source: e,
|
|
6540
6551
|
pixelRatio: 1
|
|
6541
6552
|
});
|
|
@@ -6548,7 +6559,7 @@ var X = class extends C {
|
|
|
6548
6559
|
let n = document.createElement("canvas");
|
|
6549
6560
|
n.width = Math.ceil(e), n.height = Math.ceil(t);
|
|
6550
6561
|
let r = n.getContext("2d");
|
|
6551
|
-
r && (r.fillStyle = "#f3f4f6", r.fillRect(0, 0, e, t), r.strokeStyle = "#d1d5db", r.setLineDash([6, 4]), r.strokeRect(1, 1, e - 2, t - 2), r.fillStyle = "#9ca3af", r.font = "14px sans-serif", r.textAlign = "center", r.textBaseline = "middle", r.fillText("图表需安装 echarts", e / 2, t / 2), this._texture ? this._texture.source = n : this._texture = new
|
|
6562
|
+
r && (r.fillStyle = "#f3f4f6", r.fillRect(0, 0, e, t), r.strokeStyle = "#d1d5db", r.setLineDash([6, 4]), r.strokeRect(1, 1, e - 2, t - 2), r.fillStyle = "#9ca3af", r.font = "14px sans-serif", r.textAlign = "center", r.textBaseline = "middle", r.fillText("图表需安装 echarts", e / 2, t / 2), this._texture ? this._texture.source = n : this._texture = new tr({
|
|
6552
6563
|
source: n,
|
|
6553
6564
|
pixelRatio: 1
|
|
6554
6565
|
}), this._texture.requestUpdate("source"), this._parent.requestDraw());
|
|
@@ -6558,7 +6569,7 @@ var X = class extends C {
|
|
|
6558
6569
|
if (!e?.isValid()) return;
|
|
6559
6570
|
let { width: t, height: n } = this._parent.size, r = this._parent.context;
|
|
6560
6571
|
this._parent.shape.draw(!0), r.fillStyle = e;
|
|
6561
|
-
let { a: i, c: a, tx: o, b: s, d: c, ty: l } = new
|
|
6572
|
+
let { a: i, c: a, tx: o, b: s, d: c, ty: l } = new b().scale(1 / t, 1 / n), u, d;
|
|
6562
6573
|
r.fill({ transformUv: (e, t) => {
|
|
6563
6574
|
u = e[t], d = e[t + 1], e[t] = i * u + a * d + o, e[t + 1] = s * u + c * d + l;
|
|
6564
6575
|
} });
|
|
@@ -6569,7 +6580,7 @@ var X = class extends C {
|
|
|
6569
6580
|
text: this.title,
|
|
6570
6581
|
left: "center"
|
|
6571
6582
|
} : void 0,
|
|
6572
|
-
legend:
|
|
6583
|
+
legend: xi(this.legend),
|
|
6573
6584
|
tooltip: {}
|
|
6574
6585
|
};
|
|
6575
6586
|
if (n) {
|
|
@@ -6615,8 +6626,42 @@ var X = class extends C {
|
|
|
6615
6626
|
};
|
|
6616
6627
|
k([_({ fallback: !0 }), O("design:type", Boolean)], X.prototype, "enabled", void 0), k([_({ fallback: "column" }), O("design:type", Object)], X.prototype, "type", void 0), k([_(), O("design:type", Object)], X.prototype, "grouping", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "categories", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "series", void 0), k([_(), O("design:type", Object)], X.prototype, "title", void 0), k([_(), O("design:type", Object)], X.prototype, "legend", void 0), k([_(), O("design:type", Object)], X.prototype, "categoryAxis", void 0), k([_(), O("design:type", Object)], X.prototype, "valueAxis", void 0);
|
|
6617
6628
|
//#endregion
|
|
6618
|
-
//#region src/scene/2d/element/
|
|
6619
|
-
var
|
|
6629
|
+
//#region src/scene/2d/element/Element2DComments.ts
|
|
6630
|
+
var Si = class extends T {
|
|
6631
|
+
parent;
|
|
6632
|
+
constructor(e) {
|
|
6633
|
+
super(), this.parent = e;
|
|
6634
|
+
}
|
|
6635
|
+
getPropertyDeclarations() {
|
|
6636
|
+
super.getPropertyDeclarations();
|
|
6637
|
+
let e = {};
|
|
6638
|
+
return Object.keys(this._properties).forEach((t) => {
|
|
6639
|
+
e[t] = { internalKey: `____${t}` };
|
|
6640
|
+
}), e;
|
|
6641
|
+
}
|
|
6642
|
+
getPropertyDeclaration(e) {
|
|
6643
|
+
return { internalKey: `____${e}` };
|
|
6644
|
+
}
|
|
6645
|
+
setProperties(e) {
|
|
6646
|
+
if (Array.isArray(e)) {
|
|
6647
|
+
let t = {};
|
|
6648
|
+
return e.forEach((e) => {
|
|
6649
|
+
let n = e.id ?? c();
|
|
6650
|
+
t[n] = {
|
|
6651
|
+
...e,
|
|
6652
|
+
id: n
|
|
6653
|
+
};
|
|
6654
|
+
}), super.setProperties(t);
|
|
6655
|
+
}
|
|
6656
|
+
return super.setProperties(e);
|
|
6657
|
+
}
|
|
6658
|
+
toJSON() {
|
|
6659
|
+
return m(Object.values(this._properties)) ?? [];
|
|
6660
|
+
}
|
|
6661
|
+
isValid() {
|
|
6662
|
+
return Object.keys(this._properties).length > 0;
|
|
6663
|
+
}
|
|
6664
|
+
}, Ci = class extends T {
|
|
6620
6665
|
_parent;
|
|
6621
6666
|
_routeSig;
|
|
6622
6667
|
_routePath;
|
|
@@ -6624,7 +6669,7 @@ var xi = class extends C {
|
|
|
6624
6669
|
super(), this._parent = e;
|
|
6625
6670
|
}
|
|
6626
6671
|
setProperties(e) {
|
|
6627
|
-
return super.setProperties(d(e) ? void 0 :
|
|
6672
|
+
return super.setProperties(d(e) ? void 0 : h(e));
|
|
6628
6673
|
}
|
|
6629
6674
|
isValid() {
|
|
6630
6675
|
return !!(this.start?.id || this.end?.id);
|
|
@@ -6658,19 +6703,19 @@ var xi = class extends C {
|
|
|
6658
6703
|
if (e.idx !== void 0) {
|
|
6659
6704
|
let n = t.shape.connectionPoints?.find((t) => t.idx === e.idx);
|
|
6660
6705
|
if (n) {
|
|
6661
|
-
let e = t.globalTransform.apply(new
|
|
6662
|
-
return i = n.ang === void 0 ?
|
|
6706
|
+
let e = t.globalTransform.apply(new x(n.x * t.size.x, n.y * t.size.y)), i;
|
|
6707
|
+
return i = n.ang === void 0 ? Dr(n.x - .5, n.y - .5) : {
|
|
6663
6708
|
x: Math.cos(n.ang),
|
|
6664
6709
|
y: Math.sin(n.ang)
|
|
6665
6710
|
}, {
|
|
6666
6711
|
point: e,
|
|
6667
|
-
dir:
|
|
6712
|
+
dir: wi(i, t.globalRotation),
|
|
6668
6713
|
bbox: r
|
|
6669
6714
|
};
|
|
6670
6715
|
}
|
|
6671
6716
|
}
|
|
6672
6717
|
return {
|
|
6673
|
-
point: new
|
|
6718
|
+
point: new x(n.min.x + n.size.x / 2, n.min.y + n.size.y / 2),
|
|
6674
6719
|
bbox: r
|
|
6675
6720
|
};
|
|
6676
6721
|
}
|
|
@@ -6687,11 +6732,11 @@ var xi = class extends C {
|
|
|
6687
6732
|
return;
|
|
6688
6733
|
}
|
|
6689
6734
|
let n = (e) => e ? `${e.point.x},${e.point.y},${e.dir?.x ?? ""},${e.dir?.y ?? ""}` : "-", r = `${this.mode}|${n(e)}|${n(t)}`;
|
|
6690
|
-
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath =
|
|
6735
|
+
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Or(this.mode, e ?? t, t ?? e)), this._routePath;
|
|
6691
6736
|
}
|
|
6692
6737
|
};
|
|
6693
|
-
k([_(), O("design:type", Object)],
|
|
6694
|
-
function
|
|
6738
|
+
k([_(), O("design:type", Object)], Ci.prototype, "start", void 0), k([_(), O("design:type", Object)], Ci.prototype, "end", void 0), k([_({ fallback: "straight" }), O("design:type", Object)], Ci.prototype, "mode", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Ci.prototype, "labelPosition", void 0);
|
|
6739
|
+
function wi(e, t) {
|
|
6695
6740
|
if (!t) return e;
|
|
6696
6741
|
let n = Math.cos(t), r = Math.sin(t);
|
|
6697
6742
|
return {
|
|
@@ -6701,29 +6746,29 @@ function Si(e, t) {
|
|
|
6701
6746
|
}
|
|
6702
6747
|
//#endregion
|
|
6703
6748
|
//#region src/scene/2d/element/bakeImageEffects.ts
|
|
6704
|
-
function
|
|
6749
|
+
function Ti(e) {
|
|
6705
6750
|
return e.getContext("2d");
|
|
6706
6751
|
}
|
|
6707
|
-
function
|
|
6752
|
+
function Ei(e, t, n, r) {
|
|
6708
6753
|
let i = (t?.angle ?? 0) * Math.PI / 180, a = n / 2, o = r / 2, s = (Math.abs(Math.cos(i)) * n + Math.abs(Math.sin(i)) * r) / 2, c = Math.cos(i) * s, l = Math.sin(i) * s, u = e.createLinearGradient(a - c, o - l, a + c, o + l);
|
|
6709
6754
|
for (let e of t?.stops ?? []) u.addColorStop(Math.min(1, Math.max(0, e.offset)), e.color);
|
|
6710
6755
|
return u;
|
|
6711
6756
|
}
|
|
6712
|
-
function
|
|
6713
|
-
let a =
|
|
6714
|
-
return o.drawImage(e, 0, 0, t, n), o.globalCompositeOperation = "source-in", r.linearGradient ? (o.fillStyle =
|
|
6757
|
+
function Di(e, t, n, r, i) {
|
|
6758
|
+
let a = w(t, n), o = Ti(a);
|
|
6759
|
+
return o.drawImage(e, 0, 0, t, n), o.globalCompositeOperation = "source-in", r.linearGradient ? (o.fillStyle = Ei(o, r.linearGradient, t, n), o.fillRect(0, 0, t, n)) : r.image && i[r.image] ? o.drawImage(i[r.image], 0, 0, t, n) : r.color && (o.fillStyle = r.color, o.fillRect(0, 0, t, n)), a;
|
|
6715
6760
|
}
|
|
6716
|
-
function
|
|
6717
|
-
let a =
|
|
6761
|
+
function Oi(e, t, n, r, i) {
|
|
6762
|
+
let a = w(t, n), o = Ti(a), s = Math.max(8, Math.ceil(r) * 2);
|
|
6718
6763
|
for (let i = 0; i < s; i++) {
|
|
6719
6764
|
let a = i / s * Math.PI * 2;
|
|
6720
6765
|
o.drawImage(e, Math.cos(a) * r, Math.sin(a) * r, t, n);
|
|
6721
6766
|
}
|
|
6722
6767
|
o.globalCompositeOperation = "source-in", o.fillStyle = i, o.fillRect(0, 0, t, n);
|
|
6723
|
-
let c =
|
|
6768
|
+
let c = w(t, n), l = Ti(c);
|
|
6724
6769
|
return l.drawImage(a, 0, 0), l.drawImage(e, 0, 0, t, n), c;
|
|
6725
6770
|
}
|
|
6726
|
-
function
|
|
6771
|
+
function ki(e) {
|
|
6727
6772
|
let t = 0, n = 0;
|
|
6728
6773
|
if (!e) return {
|
|
6729
6774
|
x: t,
|
|
@@ -6739,35 +6784,35 @@ function Di(e) {
|
|
|
6739
6784
|
y: n
|
|
6740
6785
|
};
|
|
6741
6786
|
}
|
|
6742
|
-
function
|
|
6787
|
+
function Ai(e, t, n, r, i = {}) {
|
|
6743
6788
|
let a = Math.max(1, Math.round(n)), o = Math.max(1, Math.round(r)), s = 0;
|
|
6744
6789
|
for (let e of t) {
|
|
6745
6790
|
e.outline?.width && e.outline.color && (s = Math.max(s, e.outline.width));
|
|
6746
|
-
let t =
|
|
6791
|
+
let t = ki(e.transform);
|
|
6747
6792
|
s = Math.max(s, Math.abs(t.x), Math.abs(t.y));
|
|
6748
6793
|
}
|
|
6749
6794
|
s = Math.min(Math.ceil(s), Math.floor(Math.min(a, o) * .2));
|
|
6750
6795
|
let c = e;
|
|
6751
6796
|
if (s > 0) {
|
|
6752
|
-
let t =
|
|
6753
|
-
|
|
6797
|
+
let t = w(a, o);
|
|
6798
|
+
Ti(t).drawImage(e, s, s, Math.max(1, a - s * 2), Math.max(1, o - s * 2)), c = t;
|
|
6754
6799
|
}
|
|
6755
|
-
let l =
|
|
6800
|
+
let l = w(a, o), u = Ti(l);
|
|
6756
6801
|
for (let e of t) {
|
|
6757
6802
|
let t = c;
|
|
6758
|
-
e.fill && (e.fill.color || e.fill.linearGradient || e.fill.image) && (t =
|
|
6759
|
-
let { x: n, y: r } =
|
|
6803
|
+
e.fill && (e.fill.color || e.fill.linearGradient || e.fill.image) && (t = Di(t, a, o, e.fill, i)), e.outline?.width && e.outline.color && (t = Oi(t, a, o, e.outline.width, e.outline.color));
|
|
6804
|
+
let { x: n, y: r } = ki(e.transform);
|
|
6760
6805
|
u.save(), u.globalCompositeOperation = "destination-over", e.shadow && (u.shadowColor = e.shadow.color, u.shadowBlur = e.shadow.blur ?? 0, u.shadowOffsetX = e.shadow.offsetX ?? 0, u.shadowOffsetY = e.shadow.offsetY ?? 0), u.drawImage(t, n, r, a, o), u.restore();
|
|
6761
6806
|
}
|
|
6762
6807
|
return l;
|
|
6763
6808
|
}
|
|
6764
6809
|
//#endregion
|
|
6765
6810
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6766
|
-
var
|
|
6811
|
+
var ji = class extends Y {
|
|
6767
6812
|
_sourceCanvas;
|
|
6768
6813
|
_sourceImage;
|
|
6769
6814
|
setProperties(e) {
|
|
6770
|
-
return super._setProperties(d(e) ? void 0 :
|
|
6815
|
+
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
6771
6816
|
}
|
|
6772
6817
|
_updateProperty(e, t, n) {
|
|
6773
6818
|
switch (super._updateProperty(e, t, n), e) {
|
|
@@ -6789,7 +6834,7 @@ var ki = class extends Y {
|
|
|
6789
6834
|
}
|
|
6790
6835
|
let e = await this._resolveSourceCanvas();
|
|
6791
6836
|
if (!e) return;
|
|
6792
|
-
let t = e.width, n = e.height, r = await this._resolvePatterns(), i =
|
|
6837
|
+
let t = e.width, n = e.height, r = await this._resolvePatterns(), i = Ai(e, this.effects, t, n, r);
|
|
6793
6838
|
this.texture = new z({
|
|
6794
6839
|
source: i,
|
|
6795
6840
|
width: t,
|
|
@@ -6804,7 +6849,7 @@ var ki = class extends Y {
|
|
|
6804
6849
|
if (!n || d(n) || e[n]) continue;
|
|
6805
6850
|
let r = await $.loadBy(`${n}#mc-foreground-pattern`, async () => {
|
|
6806
6851
|
let e = await $.fetchImageBitmap(n), t = this._snapshot(e);
|
|
6807
|
-
return
|
|
6852
|
+
return Ne && e instanceof ImageBitmap && e.close(), t;
|
|
6808
6853
|
});
|
|
6809
6854
|
r && (e[n] = r);
|
|
6810
6855
|
}
|
|
@@ -6815,25 +6860,25 @@ var ki = class extends Y {
|
|
|
6815
6860
|
if (d(this.image) || this.image === "viewport") return;
|
|
6816
6861
|
let e = this.image, t = await $.loadBy(`${e}#mc-foreground-source`, async () => {
|
|
6817
6862
|
let t = await $.fetchImageBitmap(e), n = this._snapshot(t);
|
|
6818
|
-
return
|
|
6863
|
+
return Ne && t instanceof ImageBitmap && t.close(), n;
|
|
6819
6864
|
});
|
|
6820
6865
|
return this._sourceImage === e && t && (this._sourceCanvas = t), t;
|
|
6821
6866
|
}
|
|
6822
6867
|
_snapshot(e) {
|
|
6823
|
-
let t = Math.max(1, Math.round(e.width)), n = Math.max(1, Math.round(e.height)), r =
|
|
6868
|
+
let t = Math.max(1, Math.round(e.width)), n = Math.max(1, Math.round(e.height)), r = w(t, n), i = r?.getContext("2d");
|
|
6824
6869
|
if (!(!r || !i)) return i.drawImage(e, 0, 0, t, n), r;
|
|
6825
6870
|
}
|
|
6826
6871
|
};
|
|
6827
|
-
k([_(), O("design:type", Object)],
|
|
6872
|
+
k([_(), O("design:type", Object)], ji.prototype, "fillWithShape", void 0), k([_(), O("design:type", Array)], ji.prototype, "effects", void 0);
|
|
6828
6873
|
//#endregion
|
|
6829
6874
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6830
|
-
var
|
|
6875
|
+
var Mi = {
|
|
6831
6876
|
sm: 4,
|
|
6832
6877
|
md: 6,
|
|
6833
6878
|
lg: 8
|
|
6834
|
-
},
|
|
6879
|
+
}, Ni = class extends Y {
|
|
6835
6880
|
setProperties(e) {
|
|
6836
|
-
return super._setProperties(d(e) ? void 0 :
|
|
6881
|
+
return super._setProperties(d(e) ? void 0 : te(e));
|
|
6837
6882
|
}
|
|
6838
6883
|
_updateProperty(e, t, n) {
|
|
6839
6884
|
switch (super._updateProperty(e, t, n), e) {
|
|
@@ -6853,7 +6898,7 @@ var Ai = {
|
|
|
6853
6898
|
}
|
|
6854
6899
|
draw() {
|
|
6855
6900
|
let { width: e, height: t } = this._parent.size, n = this._parent.context;
|
|
6856
|
-
this.image === "viewport" ? n.strokeStyle = new
|
|
6901
|
+
this.image === "viewport" ? n.strokeStyle = new sr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ..._i(this, {
|
|
6857
6902
|
x: 0,
|
|
6858
6903
|
y: 0,
|
|
6859
6904
|
width: e,
|
|
@@ -6876,20 +6921,20 @@ var Ai = {
|
|
|
6876
6921
|
_fillEnd(e, t, n, r, i) {
|
|
6877
6922
|
let a = e.x - t.x, o = e.y - t.y, s = Math.hypot(a, o);
|
|
6878
6923
|
if (s < .001) return;
|
|
6879
|
-
let c =
|
|
6924
|
+
let c = Mi[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;
|
|
6880
6925
|
ee.fillStyle = i, ee.moveTo(e.x, e.y).lineTo(p + h, m + g).lineTo(p - h, m - g).closePath().fill();
|
|
6881
6926
|
}
|
|
6882
6927
|
};
|
|
6883
|
-
k([_(), O("design:type", Object)],
|
|
6928
|
+
k([_(), O("design:type", Object)], Ni.prototype, "color", void 0), k([_(), O("design:type", Object)], Ni.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], Ni.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], Ni.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], Ni.prototype, "lineJoin", void 0), k([_(), O("design:type", Object)], Ni.prototype, "headEnd", void 0), k([_(), O("design:type", Object)], Ni.prototype, "tailEnd", void 0);
|
|
6884
6929
|
//#endregion
|
|
6885
6930
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
6886
|
-
var
|
|
6931
|
+
var Pi = class extends T {
|
|
6887
6932
|
_parent;
|
|
6888
6933
|
constructor(e) {
|
|
6889
6934
|
super(), this._parent = e;
|
|
6890
6935
|
}
|
|
6891
6936
|
setProperties(e) {
|
|
6892
|
-
return super.setProperties(d(e) ? void 0 :
|
|
6937
|
+
return super.setProperties(d(e) ? void 0 : ne(e));
|
|
6893
6938
|
}
|
|
6894
6939
|
_updateProperty(e, t, n) {
|
|
6895
6940
|
switch (super._updateProperty(e, t, n), e) {
|
|
@@ -6904,13 +6949,13 @@ var Mi = class extends C {
|
|
|
6904
6949
|
}
|
|
6905
6950
|
updateEffect() {
|
|
6906
6951
|
let e = "__$shadow", t = this._parent.getNode(e);
|
|
6907
|
-
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new
|
|
6952
|
+
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new ei({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
6908
6953
|
}
|
|
6909
6954
|
};
|
|
6910
|
-
k([_({ fallback: !0 }), O("design:type", Boolean)],
|
|
6955
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Pi.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], Pi.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Pi.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Pi.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Pi.prototype, "offsetX", void 0);
|
|
6911
6956
|
//#endregion
|
|
6912
6957
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
6913
|
-
var
|
|
6958
|
+
var Fi = class extends T {
|
|
6914
6959
|
_parent;
|
|
6915
6960
|
_path2DSet = new ue();
|
|
6916
6961
|
_localPath;
|
|
@@ -6927,7 +6972,7 @@ var Ni = class extends C {
|
|
|
6927
6972
|
return this._localPath;
|
|
6928
6973
|
}
|
|
6929
6974
|
setProperties(e) {
|
|
6930
|
-
return super.setProperties(d(e) ? void 0 :
|
|
6975
|
+
return super.setProperties(d(e) ? void 0 : re(e));
|
|
6931
6976
|
}
|
|
6932
6977
|
_updateProperty(e, t, n) {
|
|
6933
6978
|
switch (super._updateProperty(e, t, n), e) {
|
|
@@ -6960,7 +7005,7 @@ var Ni = class extends C {
|
|
|
6960
7005
|
let { width: e, height: t } = this._parent.size;
|
|
6961
7006
|
if (!(!e || !t)) {
|
|
6962
7007
|
if (!this._hitPath2DSet || this._hitWidth !== e || this._hitHeight !== t) {
|
|
6963
|
-
let n = new
|
|
7008
|
+
let n = new b().scale(e, t);
|
|
6964
7009
|
this._hitPath2DSet = new ue(this._path2DSet.paths.map((e) => e.clone().applyTransform(n))), this._hitWidth = e, this._hitHeight = t;
|
|
6965
7010
|
}
|
|
6966
7011
|
return this._hitPath2DSet;
|
|
@@ -6969,10 +7014,10 @@ var Ni = class extends C {
|
|
|
6969
7014
|
_updatePath2DSet() {
|
|
6970
7015
|
let e;
|
|
6971
7016
|
if (this.svg) {
|
|
6972
|
-
let t =
|
|
6973
|
-
this._path2DSet =
|
|
7017
|
+
let t = de(this.svg);
|
|
7018
|
+
this._path2DSet = fe(t), e = this._path2DSet.viewBox;
|
|
6974
7019
|
} else this._path2DSet.paths.length = 0, this.paths?.forEach((e, t) => {
|
|
6975
|
-
let { data: n, ...r } = e, i = new
|
|
7020
|
+
let { data: n, ...r } = e, i = new v();
|
|
6976
7021
|
i.style = r, i.addData(n), this._path2DSet.paths[t] = i;
|
|
6977
7022
|
});
|
|
6978
7023
|
if (!e) {
|
|
@@ -6991,7 +7036,7 @@ var Ni = class extends C {
|
|
|
6991
7036
|
}
|
|
6992
7037
|
let [t, n, r, i] = e;
|
|
6993
7038
|
this._path2DSet.paths.forEach((e) => {
|
|
6994
|
-
e.applyTransform(new
|
|
7039
|
+
e.applyTransform(new b().translate(-t, -n).scale(1 / r, 1 / i));
|
|
6995
7040
|
}), this._hitPath2DSet = void 0;
|
|
6996
7041
|
}
|
|
6997
7042
|
draw(e = !1) {
|
|
@@ -6999,7 +7044,7 @@ var Ni = class extends C {
|
|
|
6999
7044
|
else if (!e && this.isValid()) {
|
|
7000
7045
|
let e = this._parent.context, { width: t, height: n } = this._parent.size;
|
|
7001
7046
|
this._path2DSet.paths.forEach((r) => {
|
|
7002
|
-
r.style?.fillRule && (e.fillRule = r.style.fillRule), e.addPath(r.clone().applyTransform(new
|
|
7047
|
+
r.style?.fillRule && (e.fillRule = r.style.fillRule), e.addPath(r.clone().applyTransform(new b().scale(t, n)));
|
|
7003
7048
|
});
|
|
7004
7049
|
} else this._drawRect();
|
|
7005
7050
|
}
|
|
@@ -7008,24 +7053,24 @@ var Ni = class extends C {
|
|
|
7008
7053
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
7009
7054
|
}
|
|
7010
7055
|
};
|
|
7011
|
-
k([_({ fallback: !0 }), O("design:type", Boolean)],
|
|
7056
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Fi.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Fi.prototype, "preset", void 0), k([_(), O("design:type", Object)], Fi.prototype, "svg", void 0), k([_(), O("design:type", Object)], Fi.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Fi.prototype, "paths", void 0), k([_(), O("design:type", Object)], Fi.prototype, "connectionPoints", void 0);
|
|
7012
7057
|
//#endregion
|
|
7013
7058
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
7014
|
-
var
|
|
7059
|
+
var Ii = class extends E {
|
|
7015
7060
|
constructor(e) {
|
|
7016
7061
|
super(), this.setProperties(e);
|
|
7017
7062
|
}
|
|
7018
|
-
},
|
|
7063
|
+
}, Li = {
|
|
7019
7064
|
...o(),
|
|
7020
7065
|
left: 0,
|
|
7021
7066
|
top: 0,
|
|
7022
7067
|
width: 0,
|
|
7023
7068
|
height: 0
|
|
7024
7069
|
};
|
|
7025
|
-
for (let e in
|
|
7070
|
+
for (let e in Li) i(Ii, e, { fallback: Li[e] });
|
|
7026
7071
|
//#endregion
|
|
7027
7072
|
//#region src/scene/2d/element/Element2DTable.ts
|
|
7028
|
-
var
|
|
7073
|
+
var Ri = 100, zi = 40, Bi = class extends T {
|
|
7029
7074
|
_parent;
|
|
7030
7075
|
_cellNodes = /* @__PURE__ */ new Map();
|
|
7031
7076
|
_cellSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -7035,7 +7080,7 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7035
7080
|
super(), this._parent = e;
|
|
7036
7081
|
}
|
|
7037
7082
|
setProperties(e) {
|
|
7038
|
-
return super.setProperties(d(e) ? void 0 :
|
|
7083
|
+
return super.setProperties(d(e) ? void 0 : ie(e));
|
|
7039
7084
|
}
|
|
7040
7085
|
_updateProperty(e, t, n) {
|
|
7041
7086
|
switch (super._updateProperty(e, t, n), e) {
|
|
@@ -7056,10 +7101,10 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7056
7101
|
return !!(this.enabled && this.cells.length);
|
|
7057
7102
|
}
|
|
7058
7103
|
get gridWidth() {
|
|
7059
|
-
return this.columns.reduce((e, t) => e + (t.width ||
|
|
7104
|
+
return this.columns.reduce((e, t) => e + (t.width || Ri), 0);
|
|
7060
7105
|
}
|
|
7061
7106
|
get gridHeight() {
|
|
7062
|
-
return this.rows.reduce((e, t) => e + (t.height ||
|
|
7107
|
+
return this.rows.reduce((e, t) => e + (t.height || zi), 0);
|
|
7063
7108
|
}
|
|
7064
7109
|
update() {
|
|
7065
7110
|
if (this._dirty = !1, !this.isValid()) {
|
|
@@ -7069,9 +7114,9 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7069
7114
|
let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
|
|
7070
7115
|
for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
|
|
7071
7116
|
let a = [0];
|
|
7072
|
-
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width ||
|
|
7117
|
+
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || Ri));
|
|
7073
7118
|
let o = [0];
|
|
7074
|
-
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height ||
|
|
7119
|
+
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || zi));
|
|
7075
7120
|
this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
|
|
7076
7121
|
let s = /* @__PURE__ */ new Set();
|
|
7077
7122
|
for (let e of n) {
|
|
@@ -7108,10 +7153,10 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7108
7153
|
this._clearCells();
|
|
7109
7154
|
}
|
|
7110
7155
|
};
|
|
7111
|
-
k([_({ fallback: !0 }), O("design:type", Boolean)],
|
|
7156
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Bi.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Bi.prototype, "columns", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Bi.prototype, "rows", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Bi.prototype, "cells", void 0);
|
|
7112
7157
|
//#endregion
|
|
7113
7158
|
//#region src/scene/2d/element/Element2DText.ts
|
|
7114
|
-
var Z = class extends
|
|
7159
|
+
var Z = class extends T {
|
|
7115
7160
|
_parent;
|
|
7116
7161
|
base;
|
|
7117
7162
|
get textContent() {
|
|
@@ -7122,13 +7167,13 @@ var Z = class extends C {
|
|
|
7122
7167
|
}
|
|
7123
7168
|
_textContent = "";
|
|
7124
7169
|
_autoDrawMode;
|
|
7125
|
-
_texture = new
|
|
7170
|
+
_texture = new tr({ mipmap: !0 });
|
|
7126
7171
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7127
7172
|
constructor(e) {
|
|
7128
|
-
super(), this._parent = e, this.base = new
|
|
7173
|
+
super(), this._parent = e, this.base = new _e(), this.base.setPropertyAccessor(this);
|
|
7129
7174
|
}
|
|
7130
7175
|
setProperties(e) {
|
|
7131
|
-
return super.setProperties(d(e) ? void 0 :
|
|
7176
|
+
return super.setProperties(d(e) ? void 0 : ae(e));
|
|
7132
7177
|
}
|
|
7133
7178
|
_updateProperty(e, t, n) {
|
|
7134
7179
|
switch (super._updateProperty(e, t, n), e) {
|
|
@@ -7175,29 +7220,29 @@ var Z = class extends C {
|
|
|
7175
7220
|
let r = [];
|
|
7176
7221
|
if (t.fragments.forEach((e, t) => {
|
|
7177
7222
|
if (e.characters.length) {
|
|
7178
|
-
let i =
|
|
7223
|
+
let i = le.from(...e.characters.map((e) => e.compatibleGlyphBox));
|
|
7179
7224
|
this._updateTexture(`${n}.${t}.fill`, e.fill, i), this._updateTexture(`${n}.${t}.outline`, e.outline, i), r.push(i);
|
|
7180
7225
|
}
|
|
7181
7226
|
}), r.length) {
|
|
7182
|
-
let i =
|
|
7227
|
+
let i = le.from(...r);
|
|
7183
7228
|
this._updateTexture(`${n}.fill`, t.fill, i), this._updateTexture(`${n}.outline`, t.outline, i), e.push(i);
|
|
7184
7229
|
}
|
|
7185
7230
|
}), e.length) {
|
|
7186
|
-
let t =
|
|
7231
|
+
let t = le.from(...e);
|
|
7187
7232
|
this._updateTexture("fill", this.fill, t), this._updateTexture("outline", this.outline, t);
|
|
7188
7233
|
}
|
|
7189
7234
|
}
|
|
7190
7235
|
async _updateTexture(e, t, n) {
|
|
7191
7236
|
t && Object.keys(t).length > 0 && (this._textureMap.set(e, {
|
|
7192
|
-
texture: await this._loadTexture(
|
|
7237
|
+
texture: await this._loadTexture(g(t), n),
|
|
7193
7238
|
box: n
|
|
7194
7239
|
}), this._parent.requestDraw());
|
|
7195
7240
|
}
|
|
7196
7241
|
async _loadTexture(e, t) {
|
|
7197
|
-
return e.linearGradient || e.radialGradient ? new
|
|
7242
|
+
return e.linearGradient || e.radialGradient ? new rr(e.linearGradient ?? e.radialGradient, t.width, t.height) : d(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await $.texture.load(e.image));
|
|
7198
7243
|
}
|
|
7199
7244
|
setContent(e) {
|
|
7200
|
-
this.content =
|
|
7245
|
+
this.content = oe(e);
|
|
7201
7246
|
}
|
|
7202
7247
|
getStringContent() {
|
|
7203
7248
|
return this.base.toString();
|
|
@@ -7218,12 +7263,12 @@ var Z = class extends C {
|
|
|
7218
7263
|
this.base.pathSets.forEach((n) => {
|
|
7219
7264
|
n.paths.forEach((n) => {
|
|
7220
7265
|
let r = n.getMeta();
|
|
7221
|
-
if (r instanceof
|
|
7266
|
+
if (r instanceof ge) {
|
|
7222
7267
|
let i = r.parent.index, a = r.parent.parent.index;
|
|
7223
7268
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
7224
7269
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
7225
7270
|
r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? r.color, e.fill({
|
|
7226
|
-
...
|
|
7271
|
+
..._i(r, o?.box ?? {
|
|
7227
7272
|
x: 0,
|
|
7228
7273
|
y: 0,
|
|
7229
7274
|
width: this._parent.size.width,
|
|
@@ -7235,7 +7280,7 @@ var Z = class extends C {
|
|
|
7235
7280
|
if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
|
|
7236
7281
|
let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
|
|
7237
7282
|
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({
|
|
7238
|
-
...
|
|
7283
|
+
..._i(r, o?.box ?? {
|
|
7239
7284
|
x: 0,
|
|
7240
7285
|
y: 0,
|
|
7241
7286
|
width: this._parent.size.width,
|
|
@@ -7251,7 +7296,7 @@ var Z = class extends C {
|
|
|
7251
7296
|
_textureDraw(e) {
|
|
7252
7297
|
let { left: t = 0, top: n = 0, width: r, height: i } = this.base.boundingBox;
|
|
7253
7298
|
e.fillStyle = this._texture, e.rect(t, n, r, i);
|
|
7254
|
-
let { a, c: o, tx: s, b: c, d: l, ty: u } = new
|
|
7299
|
+
let { a, c: o, tx: s, b: c, d: l, ty: u } = new b().translate(-t, -n).scale(1 / r, 1 / i), d, f;
|
|
7255
7300
|
e.fill({
|
|
7256
7301
|
transformUv: (e, t) => {
|
|
7257
7302
|
d = e[t], f = e[t + 1], e[t] = a * d + o * f + s, e[t + 1] = c * d + l * f + u;
|
|
@@ -7278,11 +7323,11 @@ var Q = {
|
|
|
7278
7323
|
horizontal: 6,
|
|
7279
7324
|
vertical: 7,
|
|
7280
7325
|
all: 8
|
|
7281
|
-
},
|
|
7326
|
+
}, Vi = {
|
|
7282
7327
|
column: 0,
|
|
7283
7328
|
row: 1,
|
|
7284
7329
|
all: 2
|
|
7285
|
-
},
|
|
7330
|
+
}, Hi = {
|
|
7286
7331
|
auto: 0,
|
|
7287
7332
|
"flex-start": 1,
|
|
7288
7333
|
center: 2,
|
|
@@ -7292,42 +7337,42 @@ var Q = {
|
|
|
7292
7337
|
"space-between": 6,
|
|
7293
7338
|
"space-around": 7,
|
|
7294
7339
|
"space-evenly": 8
|
|
7295
|
-
},
|
|
7340
|
+
}, Ui = {
|
|
7296
7341
|
flex: 0,
|
|
7297
7342
|
none: 1,
|
|
7298
7343
|
contents: 2
|
|
7299
|
-
},
|
|
7344
|
+
}, Wi = {
|
|
7300
7345
|
inherit: 0,
|
|
7301
7346
|
ltr: 1,
|
|
7302
7347
|
rtl: 2
|
|
7303
|
-
},
|
|
7348
|
+
}, Gi = {
|
|
7304
7349
|
column: 0,
|
|
7305
7350
|
"column-reverse": 1,
|
|
7306
7351
|
row: 2,
|
|
7307
7352
|
"row-reverse": 3
|
|
7308
|
-
},
|
|
7353
|
+
}, Ki = {
|
|
7309
7354
|
"no-wrap": 0,
|
|
7310
7355
|
wrap: 1,
|
|
7311
7356
|
"Wrap-reverse": 2
|
|
7312
|
-
},
|
|
7357
|
+
}, qi = {
|
|
7313
7358
|
"flex-start": 0,
|
|
7314
7359
|
center: 1,
|
|
7315
7360
|
"flex-end": 2,
|
|
7316
7361
|
"space-between": 3,
|
|
7317
7362
|
"space-around": 4,
|
|
7318
7363
|
"space-evenly": 5
|
|
7319
|
-
},
|
|
7364
|
+
}, Ji = {
|
|
7320
7365
|
visible: 0,
|
|
7321
7366
|
hidden: 1,
|
|
7322
7367
|
scroll: 2
|
|
7323
|
-
},
|
|
7368
|
+
}, Yi = {
|
|
7324
7369
|
static: 0,
|
|
7325
7370
|
relative: 1,
|
|
7326
7371
|
absolute: 2
|
|
7327
|
-
},
|
|
7372
|
+
}, Xi = {
|
|
7328
7373
|
"border-box": 0,
|
|
7329
7374
|
"content-box": 1
|
|
7330
|
-
},
|
|
7375
|
+
}, Zi = class e {
|
|
7331
7376
|
_parent;
|
|
7332
7377
|
static _yoga;
|
|
7333
7378
|
static async load() {
|
|
@@ -7339,27 +7384,27 @@ var Q = {
|
|
|
7339
7384
|
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);
|
|
7340
7385
|
}
|
|
7341
7386
|
_addChild(e, t) {
|
|
7342
|
-
if (e instanceof
|
|
7387
|
+
if (e instanceof na && e.flexbox.node && this.node) {
|
|
7343
7388
|
this.node.insertChild(e.flexbox.node, t);
|
|
7344
7389
|
let n = e.style.getProperties();
|
|
7345
7390
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7346
7391
|
}
|
|
7347
7392
|
}
|
|
7348
7393
|
_removeChild(e, t) {
|
|
7349
|
-
e instanceof
|
|
7394
|
+
e instanceof na && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7350
7395
|
}
|
|
7351
7396
|
updateStyleProperty(e, t) {
|
|
7352
7397
|
let n = this.node;
|
|
7353
7398
|
if (n) {
|
|
7354
7399
|
switch (e) {
|
|
7355
7400
|
case "alignContent":
|
|
7356
|
-
n.setAlignContent(t ?
|
|
7401
|
+
n.setAlignContent(t ? Hi[t] ?? Hi["flex-start"] : Hi["flex-start"]);
|
|
7357
7402
|
break;
|
|
7358
7403
|
case "alignItems":
|
|
7359
|
-
n.setAlignItems(t ?
|
|
7404
|
+
n.setAlignItems(t ? Hi[t] ?? Hi["flex-start"] : Hi["flex-start"]);
|
|
7360
7405
|
break;
|
|
7361
7406
|
case "alignSelf":
|
|
7362
|
-
n.setAlignSelf(t ?
|
|
7407
|
+
n.setAlignSelf(t ? Hi[t] ?? Hi["flex-start"] : Hi["flex-start"]);
|
|
7363
7408
|
break;
|
|
7364
7409
|
case "aspectRatio":
|
|
7365
7410
|
n.setAspectRatio(t);
|
|
@@ -7380,10 +7425,10 @@ var Q = {
|
|
|
7380
7425
|
n.setBorder(Q.all, this._parent.style.borderWidth);
|
|
7381
7426
|
break;
|
|
7382
7427
|
case "direction":
|
|
7383
|
-
n.setDirection(t ?
|
|
7428
|
+
n.setDirection(t ? Wi[t] ?? Wi.inherit : Wi.inherit);
|
|
7384
7429
|
break;
|
|
7385
7430
|
case "display":
|
|
7386
|
-
n.setDisplay(t ?
|
|
7431
|
+
n.setDisplay(t ? Ui[t] ?? Ui.flex : Ui.flex);
|
|
7387
7432
|
break;
|
|
7388
7433
|
case "flex":
|
|
7389
7434
|
n.setFlex(t);
|
|
@@ -7392,7 +7437,7 @@ var Q = {
|
|
|
7392
7437
|
n.setFlexBasis(t);
|
|
7393
7438
|
break;
|
|
7394
7439
|
case "flexDirection":
|
|
7395
|
-
n.setFlexDirection(t ?
|
|
7440
|
+
n.setFlexDirection(t ? Gi[t] ?? Gi.row : Gi.row);
|
|
7396
7441
|
break;
|
|
7397
7442
|
case "flexGrow":
|
|
7398
7443
|
n.setFlexGrow(t);
|
|
@@ -7401,16 +7446,16 @@ var Q = {
|
|
|
7401
7446
|
n.setFlexShrink(t);
|
|
7402
7447
|
break;
|
|
7403
7448
|
case "flexWrap":
|
|
7404
|
-
n.setFlexWrap(t ?
|
|
7449
|
+
n.setFlexWrap(t ? Ki[t] ?? Ki.wrap : Ki.wrap);
|
|
7405
7450
|
break;
|
|
7406
7451
|
case "height":
|
|
7407
7452
|
n.setHeight(t);
|
|
7408
7453
|
break;
|
|
7409
7454
|
case "justifyContent":
|
|
7410
|
-
n.setJustifyContent(t ?
|
|
7455
|
+
n.setJustifyContent(t ? qi[t] ?? qi["flex-start"] : qi["flex-start"]);
|
|
7411
7456
|
break;
|
|
7412
7457
|
case "gap":
|
|
7413
|
-
t !== void 0 && n.setGap(
|
|
7458
|
+
t !== void 0 && n.setGap(Vi.all, t);
|
|
7414
7459
|
break;
|
|
7415
7460
|
case "marginTop":
|
|
7416
7461
|
n.setMargin(Q.top, t);
|
|
@@ -7440,7 +7485,7 @@ var Q = {
|
|
|
7440
7485
|
n.setMinWidth(t);
|
|
7441
7486
|
break;
|
|
7442
7487
|
case "overflow":
|
|
7443
|
-
n.setOverflow(t ?
|
|
7488
|
+
n.setOverflow(t ? Ji[t] ?? Ji.visible : Ji.visible);
|
|
7444
7489
|
break;
|
|
7445
7490
|
case "paddingTop":
|
|
7446
7491
|
n.setPadding(Q.top, t);
|
|
@@ -7470,10 +7515,10 @@ var Q = {
|
|
|
7470
7515
|
n.setPosition(Q.right, t);
|
|
7471
7516
|
break;
|
|
7472
7517
|
case "position":
|
|
7473
|
-
n.setPositionType(t ?
|
|
7518
|
+
n.setPositionType(t ? Yi[t] ?? Yi.relative : Yi.relative);
|
|
7474
7519
|
break;
|
|
7475
7520
|
case "boxSizing":
|
|
7476
|
-
n.setBoxSizing(t ?
|
|
7521
|
+
n.setBoxSizing(t ? Xi[t] ?? Xi["content-box"] : Xi["content-box"]);
|
|
7477
7522
|
break;
|
|
7478
7523
|
case "width":
|
|
7479
7524
|
n.setWidth(t);
|
|
@@ -7484,7 +7529,7 @@ var Q = {
|
|
|
7484
7529
|
}
|
|
7485
7530
|
update() {
|
|
7486
7531
|
let e = this._parent, t = this.node;
|
|
7487
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
7532
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Wi.ltr), t.hasNewLayout())) {
|
|
7488
7533
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
7489
7534
|
(!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();
|
|
7490
7535
|
}
|
|
@@ -7492,26 +7537,26 @@ var Q = {
|
|
|
7492
7537
|
destroy() {
|
|
7493
7538
|
this.node?.free(), this.node = void 0;
|
|
7494
7539
|
}
|
|
7495
|
-
},
|
|
7540
|
+
}, Qi = new Set(Object.keys(a())), $i = new Set(Object.keys(s())), ea = new x(), ta = [
|
|
7496
7541
|
[0, 0],
|
|
7497
7542
|
[1, 0],
|
|
7498
7543
|
[1, 1],
|
|
7499
7544
|
[0, 1]
|
|
7500
|
-
],
|
|
7501
|
-
flexbox = new
|
|
7502
|
-
aabb = new
|
|
7503
|
-
globalAabb = new
|
|
7545
|
+
], na = class extends Tr {
|
|
7546
|
+
flexbox = new Zi(this);
|
|
7547
|
+
aabb = new vt();
|
|
7548
|
+
globalAabb = new vt();
|
|
7504
7549
|
_parentGlobalDisplay;
|
|
7505
7550
|
_globalDisplay;
|
|
7506
7551
|
get globalDisplay() {
|
|
7507
7552
|
return this._globalDisplay;
|
|
7508
7553
|
}
|
|
7509
|
-
size = new
|
|
7554
|
+
size = new x(0, 0, () => {
|
|
7510
7555
|
this.onUpdateStyleProperty("transformOrigin", this.style.transformOrigin, void 0), this.onUpdateStyleProperty("transform", this.style.transform, void 0), this.updateGlobalTransform(), this.requestDraw();
|
|
7511
7556
|
});
|
|
7512
7557
|
_allowPointerEvents = !0;
|
|
7513
7558
|
_overflowHidden = !1;
|
|
7514
|
-
_style = new
|
|
7559
|
+
_style = new Ii().on("updateProperty", (...e) => {
|
|
7515
7560
|
this.onUpdateStyleProperty(e[0], e[1], e[2]);
|
|
7516
7561
|
});
|
|
7517
7562
|
get style() {
|
|
@@ -7525,14 +7570,14 @@ var Q = {
|
|
|
7525
7570
|
this._endBatch();
|
|
7526
7571
|
}
|
|
7527
7572
|
}
|
|
7528
|
-
_background = new
|
|
7573
|
+
_background = new vi(this);
|
|
7529
7574
|
get background() {
|
|
7530
7575
|
return this._background;
|
|
7531
7576
|
}
|
|
7532
7577
|
set background(e) {
|
|
7533
7578
|
this._background.resetProperties().setProperties(e);
|
|
7534
7579
|
}
|
|
7535
|
-
_shape = new
|
|
7580
|
+
_shape = new Fi(this);
|
|
7536
7581
|
get shape() {
|
|
7537
7582
|
return this._shape;
|
|
7538
7583
|
}
|
|
@@ -7546,14 +7591,14 @@ var Q = {
|
|
|
7546
7591
|
set fill(e) {
|
|
7547
7592
|
this._fill.resetProperties().setProperties(e);
|
|
7548
7593
|
}
|
|
7549
|
-
_outline = new
|
|
7594
|
+
_outline = new Ni(this);
|
|
7550
7595
|
get outline() {
|
|
7551
7596
|
return this._outline;
|
|
7552
7597
|
}
|
|
7553
7598
|
set outline(e) {
|
|
7554
7599
|
this._outline.resetProperties().setProperties(e);
|
|
7555
7600
|
}
|
|
7556
|
-
_foreground = new
|
|
7601
|
+
_foreground = new ji(this);
|
|
7557
7602
|
get foreground() {
|
|
7558
7603
|
return this._foreground;
|
|
7559
7604
|
}
|
|
@@ -7567,21 +7612,21 @@ var Q = {
|
|
|
7567
7612
|
set text(e) {
|
|
7568
7613
|
this._text.resetProperties().setProperties(e);
|
|
7569
7614
|
}
|
|
7570
|
-
_shadow = new
|
|
7615
|
+
_shadow = new Pi(this);
|
|
7571
7616
|
get shadow() {
|
|
7572
7617
|
return this._shadow;
|
|
7573
7618
|
}
|
|
7574
7619
|
set shadow(e) {
|
|
7575
7620
|
this._shadow.resetProperties().setProperties(e);
|
|
7576
7621
|
}
|
|
7577
|
-
_connection = new
|
|
7622
|
+
_connection = new Ci(this);
|
|
7578
7623
|
get connection() {
|
|
7579
7624
|
return this._connection;
|
|
7580
7625
|
}
|
|
7581
7626
|
set connection(e) {
|
|
7582
7627
|
this._connection.resetProperties().setProperties(e);
|
|
7583
7628
|
}
|
|
7584
|
-
_table = new
|
|
7629
|
+
_table = new Bi(this);
|
|
7585
7630
|
get table() {
|
|
7586
7631
|
return this._table;
|
|
7587
7632
|
}
|
|
@@ -7595,6 +7640,13 @@ var Q = {
|
|
|
7595
7640
|
set chart(e) {
|
|
7596
7641
|
this._chart.resetProperties().setProperties(e);
|
|
7597
7642
|
}
|
|
7643
|
+
_comments = new Si(this);
|
|
7644
|
+
get comments() {
|
|
7645
|
+
return this._comments;
|
|
7646
|
+
}
|
|
7647
|
+
set comments(e) {
|
|
7648
|
+
this._comments.resetProperties().setProperties(e);
|
|
7649
|
+
}
|
|
7598
7650
|
_lastRoutePath;
|
|
7599
7651
|
_batchDepth = 0;
|
|
7600
7652
|
_pendingTextUpdate = !1;
|
|
@@ -7610,8 +7662,8 @@ var Q = {
|
|
|
7610
7662
|
if (e) {
|
|
7611
7663
|
this._beginBatch();
|
|
7612
7664
|
try {
|
|
7613
|
-
let { style: t, text: n, shape: r, background: i, fill: a, outline: o, foreground: s, shadow: c, connection: l, table: u, chart: d,
|
|
7614
|
-
t && this.style.setProperties(t), i && this.background.setProperties(i), r && this.shape.setProperties(r), a && this.fill.setProperties(a), o && this.outline.setProperties(o), n && this.text.setProperties(n), s && this.foreground.setProperties(s), c && this.shadow.setProperties(c), l && this.connection.setProperties(l), u && this.table.setProperties(u), d && this.chart.setProperties(d), this.
|
|
7665
|
+
let { style: t, text: n, shape: r, background: i, fill: a, outline: o, foreground: s, shadow: c, connection: l, table: u, chart: d, comments: f, filter: p, ...m } = e;
|
|
7666
|
+
t && this.style.setProperties(t), i && this.background.setProperties(i), r && this.shape.setProperties(r), a && this.fill.setProperties(a), o && this.outline.setProperties(o), n && this.text.setProperties(n), s && this.foreground.setProperties(s), c && this.shadow.setProperties(c), l && this.connection.setProperties(l), u && this.table.setProperties(u), d && this.chart.setProperties(d), f && this.comments.setProperties(f), this._updateElementFilter(p), super.setProperties(m);
|
|
7615
7667
|
} finally {
|
|
7616
7668
|
this._endBatch();
|
|
7617
7669
|
}
|
|
@@ -7694,7 +7746,7 @@ var Q = {
|
|
|
7694
7746
|
}), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
|
|
7695
7747
|
break;
|
|
7696
7748
|
case "transformOrigin": {
|
|
7697
|
-
let e =
|
|
7749
|
+
let e = Ir(t ?? "");
|
|
7698
7750
|
this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
|
|
7699
7751
|
break;
|
|
7700
7752
|
}
|
|
@@ -7738,7 +7790,7 @@ var Q = {
|
|
|
7738
7790
|
this.requestDraw();
|
|
7739
7791
|
break;
|
|
7740
7792
|
}
|
|
7741
|
-
if ((
|
|
7793
|
+
if (($i.has(e) || Qi.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
7742
7794
|
else switch (e) {
|
|
7743
7795
|
case "left":
|
|
7744
7796
|
this.position.x = Number(t);
|
|
@@ -7768,7 +7820,7 @@ var Q = {
|
|
|
7768
7820
|
this._lastRoutePath = e;
|
|
7769
7821
|
let t = e.getBoundingBox(), n = Math.max(t.width, 1), r = Math.max(t.height, 1);
|
|
7770
7822
|
this.position.x = t.x, this.position.y = t.y, this.size.width = n, this.size.height = r, this.updateGlobalTransform();
|
|
7771
|
-
let i = e.clone().applyTransform(new
|
|
7823
|
+
let i = e.clone().applyTransform(new b().translate(-t.x, -t.y));
|
|
7772
7824
|
this._shape.setLocalPath(i);
|
|
7773
7825
|
}
|
|
7774
7826
|
_cullsRender() {
|
|
@@ -7778,10 +7830,10 @@ var Q = {
|
|
|
7778
7830
|
}
|
|
7779
7831
|
_intersectsViewport(e) {
|
|
7780
7832
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
7781
|
-
for (let [e, c] of
|
|
7833
|
+
for (let [e, c] of ta) t.applyAffineInverse({
|
|
7782
7834
|
x: e * n,
|
|
7783
7835
|
y: c * r
|
|
7784
|
-
},
|
|
7836
|
+
}, ea), i = Math.min(i, ea.x), a = Math.max(a, ea.x), o = Math.min(o, ea.y), s = Math.max(s, ea.y);
|
|
7785
7837
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
7786
7838
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
7787
7839
|
}
|
|
@@ -7791,18 +7843,18 @@ var Q = {
|
|
|
7791
7843
|
this._styleFilter = d(e) ? void 0 : e, this._applyColorFilter();
|
|
7792
7844
|
}
|
|
7793
7845
|
_updateElementFilter(e) {
|
|
7794
|
-
let t = e ?
|
|
7846
|
+
let t = e ? ce(e) : "";
|
|
7795
7847
|
this._elementFilter = t || void 0, this._applyColorFilter();
|
|
7796
7848
|
}
|
|
7797
7849
|
_applyColorFilter() {
|
|
7798
7850
|
let e = [this._styleFilter, this._elementFilter].filter(Boolean).join(" ").trim();
|
|
7799
|
-
e ? (this._colorFilterEffect || (this._colorFilterEffect = new
|
|
7851
|
+
e ? (this._colorFilterEffect || (this._colorFilterEffect = new zr({
|
|
7800
7852
|
name: "styleFilter",
|
|
7801
7853
|
internalMode: "front"
|
|
7802
7854
|
}), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e) : (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender());
|
|
7803
7855
|
}
|
|
7804
7856
|
_updateStyleMaskImage(e) {
|
|
7805
|
-
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new
|
|
7857
|
+
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new ui({
|
|
7806
7858
|
name: "styleMaskImage",
|
|
7807
7859
|
internalMode: "back"
|
|
7808
7860
|
}), this.append(this._maskEffect)), this._maskEffect.image = e);
|
|
@@ -7833,11 +7885,11 @@ var Q = {
|
|
|
7833
7885
|
}
|
|
7834
7886
|
getObb() {
|
|
7835
7887
|
let e = this.pivot, t = this.transform.apply(e).sub(e);
|
|
7836
|
-
return new
|
|
7888
|
+
return new wt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
|
|
7837
7889
|
}
|
|
7838
7890
|
getGlobalObb() {
|
|
7839
7891
|
let e = this.pivot, t = this.globalTransform.apply(e).sub(e);
|
|
7840
|
-
return new
|
|
7892
|
+
return new wt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
|
|
7841
7893
|
}
|
|
7842
7894
|
_draw() {
|
|
7843
7895
|
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();
|
|
@@ -7884,17 +7936,18 @@ var Q = {
|
|
|
7884
7936
|
shadow: e(this.shadow.toJSON()),
|
|
7885
7937
|
connection: e(this.connection.toJSON()),
|
|
7886
7938
|
table: e(this.table.toJSON()),
|
|
7887
|
-
chart: e(this.chart.toJSON())
|
|
7939
|
+
chart: e(this.chart.toJSON()),
|
|
7940
|
+
comments: this.comments.isValid() ? this.comments.toJSON() : void 0
|
|
7888
7941
|
});
|
|
7889
7942
|
}
|
|
7890
7943
|
_destroy() {
|
|
7891
|
-
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._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
7944
|
+
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;
|
|
7892
7945
|
}
|
|
7893
7946
|
};
|
|
7894
|
-
|
|
7947
|
+
na = k([S("Element2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], na);
|
|
7895
7948
|
//#endregion
|
|
7896
7949
|
//#region src/scene/2d/TextureRect2D.ts
|
|
7897
|
-
var
|
|
7950
|
+
var ra = class extends na {
|
|
7898
7951
|
texture;
|
|
7899
7952
|
region;
|
|
7900
7953
|
constructor(e, t = []) {
|
|
@@ -7904,9 +7957,9 @@ var ta = class extends ea {
|
|
|
7904
7957
|
let e = this.region;
|
|
7905
7958
|
if (e && this.texture) {
|
|
7906
7959
|
let t = this.texture.width || 1, n = this.texture.height || 1;
|
|
7907
|
-
return new
|
|
7960
|
+
return new b(e.width / (this.size.x * t), 0, 0, e.height / (this.size.y * n), e.x / t, e.y / n);
|
|
7908
7961
|
}
|
|
7909
|
-
return new
|
|
7962
|
+
return new b().scale(1 / this.size.x, 1 / this.size.y);
|
|
7910
7963
|
}
|
|
7911
7964
|
_drawContent() {
|
|
7912
7965
|
if (this.texture?.isValid()) {
|
|
@@ -7917,8 +7970,8 @@ var ta = class extends ea {
|
|
|
7917
7970
|
} });
|
|
7918
7971
|
}
|
|
7919
7972
|
}
|
|
7920
|
-
},
|
|
7921
|
-
texture = new
|
|
7973
|
+
}, ia = class extends ra {
|
|
7974
|
+
texture = new tr();
|
|
7922
7975
|
animation;
|
|
7923
7976
|
_lastTime = NaN;
|
|
7924
7977
|
constructor(e, t = []) {
|
|
@@ -7948,10 +8001,10 @@ var ta = class extends ea {
|
|
|
7948
8001
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
7949
8002
|
}
|
|
7950
8003
|
};
|
|
7951
|
-
k([_({ fallback: "" }), O("design:type", String)],
|
|
8004
|
+
k([_({ fallback: "" }), O("design:type", String)], ia.prototype, "src", void 0), ia = k([S("Lottie2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ia);
|
|
7952
8005
|
//#endregion
|
|
7953
8006
|
//#region src/scene/2d/Mesh2D.ts
|
|
7954
|
-
var
|
|
8007
|
+
var aa = class extends na {
|
|
7955
8008
|
texture;
|
|
7956
8009
|
_vertices = new Float32Array();
|
|
7957
8010
|
_uvs = new Float32Array();
|
|
@@ -7982,7 +8035,7 @@ var ra = class extends ea {
|
|
|
7982
8035
|
_drawContent() {
|
|
7983
8036
|
this.texture?.isValid() && this._indices.length && this._vertices.length && (this.context.fillStyle = this.texture, this.context.drawMesh(this._vertices, this._uvs, this._indices));
|
|
7984
8037
|
}
|
|
7985
|
-
},
|
|
8038
|
+
}, oa = class extends na {
|
|
7986
8039
|
constructor(e, t = []) {
|
|
7987
8040
|
super(), this.setProperties(e).append(t);
|
|
7988
8041
|
}
|
|
@@ -8005,10 +8058,10 @@ var ra = class extends ea {
|
|
|
8005
8058
|
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);
|
|
8006
8059
|
}
|
|
8007
8060
|
};
|
|
8008
|
-
k([_({ fallback: 6 }), O("design:type", Number)],
|
|
8061
|
+
k([_({ fallback: 6 }), O("design:type", Number)], oa.prototype, "handleSize", void 0);
|
|
8009
8062
|
//#endregion
|
|
8010
8063
|
//#region src/scene/2d/Video2D.ts
|
|
8011
|
-
var
|
|
8064
|
+
var sa = class extends ra {
|
|
8012
8065
|
get videoDuration() {
|
|
8013
8066
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
8014
8067
|
}
|
|
@@ -8048,15 +8101,15 @@ var aa = class extends ta {
|
|
|
8048
8101
|
super._process(e), this._updateVideoCurrentTime();
|
|
8049
8102
|
}
|
|
8050
8103
|
};
|
|
8051
|
-
k([_({ fallback: "" }), O("design:type", String)],
|
|
8104
|
+
k([_({ fallback: "" }), O("design:type", String)], sa.prototype, "src", void 0), sa = k([S("Video2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], sa);
|
|
8052
8105
|
//#endregion
|
|
8053
8106
|
//#region src/scene/animation/Animation.ts
|
|
8054
|
-
function
|
|
8107
|
+
function ca(e) {
|
|
8055
8108
|
if (e == null) return 0;
|
|
8056
8109
|
let t = String(e).trim(), n = Number.parseFloat(t);
|
|
8057
8110
|
return Number.isNaN(n) ? 0 : n / 100;
|
|
8058
8111
|
}
|
|
8059
|
-
function
|
|
8112
|
+
function la(e, t) {
|
|
8060
8113
|
let n = t * 180 / Math.PI;
|
|
8061
8114
|
if (e == null || e === "auto") return n;
|
|
8062
8115
|
let r = String(e).trim();
|
|
@@ -8065,11 +8118,11 @@ function sa(e, t) {
|
|
|
8065
8118
|
let i = Number.parseFloat(r);
|
|
8066
8119
|
return Number.isNaN(i) ? n : i;
|
|
8067
8120
|
}
|
|
8068
|
-
function
|
|
8121
|
+
function ua(e) {
|
|
8069
8122
|
let t = e.trim(), n = /^path\((.*)\)$/s.exec(t);
|
|
8070
8123
|
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();
|
|
8071
8124
|
}
|
|
8072
|
-
function
|
|
8125
|
+
function da(e, t, n, r) {
|
|
8073
8126
|
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;
|
|
8074
8127
|
function m(e) {
|
|
8075
8128
|
let t = e, n, r;
|
|
@@ -8089,7 +8142,7 @@ function la(e, t, n, r) {
|
|
|
8089
8142
|
}
|
|
8090
8143
|
return (e) => p(m(e));
|
|
8091
8144
|
}
|
|
8092
|
-
var
|
|
8145
|
+
var fa = {
|
|
8093
8146
|
linear: [
|
|
8094
8147
|
0,
|
|
8095
8148
|
0,
|
|
@@ -8156,7 +8209,7 @@ var ua = {
|
|
|
8156
8209
|
.355,
|
|
8157
8210
|
1
|
|
8158
8211
|
]
|
|
8159
|
-
},
|
|
8212
|
+
}, pa = Object.fromEntries(Object.entries(fa).map(([e, [t, n, r, i]]) => [e, da(t, n, r, i)])), ma = class extends V {
|
|
8160
8213
|
_keyframes = [];
|
|
8161
8214
|
_isFirstUpdatePosition = !1;
|
|
8162
8215
|
_cachedProps = new t();
|
|
@@ -8192,7 +8245,7 @@ var ua = {
|
|
|
8192
8245
|
e = [this.getParent()].filter(Boolean);
|
|
8193
8246
|
break;
|
|
8194
8247
|
}
|
|
8195
|
-
return e.filter((e) => e instanceof
|
|
8248
|
+
return e.filter((e) => e instanceof na);
|
|
8196
8249
|
}
|
|
8197
8250
|
_updateKeyframes() {
|
|
8198
8251
|
this._pathMeasures.clear();
|
|
@@ -8225,7 +8278,7 @@ var ua = {
|
|
|
8225
8278
|
}
|
|
8226
8279
|
let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
|
|
8227
8280
|
e.forEach((e, r) => {
|
|
8228
|
-
let i = t === 1 ? n :
|
|
8281
|
+
let i = t === 1 ? n : St(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
|
|
8229
8282
|
if (!a) return;
|
|
8230
8283
|
let o = this._parseKeyframes(i, a);
|
|
8231
8284
|
o?.length && this._commitStyle(i, e, a, o[0], o[1]);
|
|
@@ -8243,14 +8296,14 @@ var ua = {
|
|
|
8243
8296
|
});
|
|
8244
8297
|
}
|
|
8245
8298
|
_parseEasing(e) {
|
|
8246
|
-
if (!e) return
|
|
8247
|
-
if (e in
|
|
8299
|
+
if (!e) return pa.linear;
|
|
8300
|
+
if (e in pa) return pa[e];
|
|
8248
8301
|
let t = /cubic-bezier\((.+)\)/.exec(e);
|
|
8249
8302
|
if (t) {
|
|
8250
8303
|
let e = t[1].split(",").map((e) => Number(e));
|
|
8251
|
-
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return
|
|
8304
|
+
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return da(e[0], e[1], e[2], e[3]);
|
|
8252
8305
|
}
|
|
8253
|
-
return
|
|
8306
|
+
return pa.linear;
|
|
8254
8307
|
}
|
|
8255
8308
|
_parseKeyframes(e, t) {
|
|
8256
8309
|
let n, r = this._keyframes;
|
|
@@ -8285,26 +8338,26 @@ var ua = {
|
|
|
8285
8338
|
});
|
|
8286
8339
|
}
|
|
8287
8340
|
_commitOffsetPath(e, t, n, r, i, a) {
|
|
8288
|
-
let o =
|
|
8341
|
+
let o = ua(t);
|
|
8289
8342
|
if (!o) return;
|
|
8290
8343
|
let s = this._pathMeasures.get(o);
|
|
8291
8344
|
if (!s) {
|
|
8292
|
-
let e = new
|
|
8345
|
+
let e = new y(new v(o)), t = e.getPosTanAtProgress(0).position;
|
|
8293
8346
|
s = {
|
|
8294
8347
|
measure: e,
|
|
8295
8348
|
startX: t.x,
|
|
8296
8349
|
startY: t.y
|
|
8297
8350
|
}, this._pathMeasures.set(o, s);
|
|
8298
8351
|
}
|
|
8299
|
-
let c =
|
|
8352
|
+
let c = St(D(ca(r.offsetDistance ?? i.offsetDistance), ca(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 = la(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
|
|
8300
8353
|
e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
|
|
8301
8354
|
}
|
|
8302
8355
|
_getDiffValue(e, t, n, r, i) {
|
|
8303
8356
|
let a, o;
|
|
8304
|
-
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a =
|
|
8305
|
-
else if (n !== void 0) o =
|
|
8357
|
+
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a = Oe(e, String(t), i), o = De(a);
|
|
8358
|
+
else if (n !== void 0) o = Oe(e, String(n), i), a = De(o);
|
|
8306
8359
|
else return;
|
|
8307
|
-
else a =
|
|
8360
|
+
else a = Oe(e, String(t), i), o = Oe(e, String(n), i);
|
|
8308
8361
|
if (Array.isArray(a) && Array.isArray(o)) {
|
|
8309
8362
|
let e = /* @__PURE__ */ new Set(), t = {}, n = {};
|
|
8310
8363
|
a.forEach(({ name: n, args: r }) => {
|
|
@@ -8343,14 +8396,14 @@ var ua = {
|
|
|
8343
8396
|
});
|
|
8344
8397
|
}
|
|
8345
8398
|
};
|
|
8346
|
-
k([_({ fallback: "parent" }), O("design:type", Object)],
|
|
8399
|
+
k([_({ fallback: "parent" }), O("design:type", Object)], ma.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], ma.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], ma.prototype, "easing", void 0), ma = k([S("Animation", {
|
|
8347
8400
|
renderMode: "disabled",
|
|
8348
8401
|
processSortMode: "parent-before",
|
|
8349
8402
|
duration: 2e3
|
|
8350
|
-
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])],
|
|
8403
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ma);
|
|
8351
8404
|
//#endregion
|
|
8352
8405
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
8353
|
-
var
|
|
8406
|
+
var ha = class t extends e {
|
|
8354
8407
|
static _instance;
|
|
8355
8408
|
static get instance() {
|
|
8356
8409
|
return this._instance ||= new t(), this._instance;
|
|
@@ -8380,7 +8433,7 @@ var pa = class t extends e {
|
|
|
8380
8433
|
togglePause() {
|
|
8381
8434
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
8382
8435
|
}
|
|
8383
|
-
},
|
|
8436
|
+
}, ga = class t extends e {
|
|
8384
8437
|
static PADDING = .1;
|
|
8385
8438
|
_source = null;
|
|
8386
8439
|
_audio = null;
|
|
@@ -8493,21 +8546,21 @@ var pa = class t extends e {
|
|
|
8493
8546
|
if (!this._source) return;
|
|
8494
8547
|
let { start: n = 0, end: r = 0 } = e;
|
|
8495
8548
|
r && console.assert(r > n, "End time is before start time"), e.playbackRate !== void 0 && (this._playbackRate = e.playbackRate), e.volume !== void 0 && (this._volume = e.volume), e.loop !== void 0 && (this._loop = e.loop), e.muted !== void 0 && (this._muted = e.muted), this.refresh(), this.loop && r !== null && (console.warn("Looping not support when specifying an \"end\" time"), this.loop = !1), this._start = n, this._end = r || this._duration, this._start = Math.max(0, this._start - t.PADDING), this._end = Math.min(this._end + t.PADDING, this._duration), this._source.onloadedmetadata = () => {
|
|
8496
|
-
this._source && (this._source.currentTime = n, this._source.onloadedmetadata = null, this.emit("progress", n, this._duration),
|
|
8549
|
+
this._source && (this._source.currentTime = n, this._source.onloadedmetadata = null, this.emit("progress", n, this._duration), C.on(this._onUpdate));
|
|
8497
8550
|
}, this._source.onended = this._onComplete.bind(this), this._source.play(), this.emit("start");
|
|
8498
8551
|
}
|
|
8499
8552
|
_onUpdate = () => {
|
|
8500
8553
|
this._source && (this.emit("progress", this.progress, this._duration), this._source.currentTime >= this._end && !this._source.loop && this._onComplete());
|
|
8501
8554
|
};
|
|
8502
8555
|
_onComplete() {
|
|
8503
|
-
|
|
8556
|
+
C.off(this._onUpdate), this._stop(), this.emit("progress", 1, this._duration), this.emit("end", this);
|
|
8504
8557
|
}
|
|
8505
8558
|
destroy() {
|
|
8506
|
-
|
|
8559
|
+
C.off(this._onUpdate), super.destroy();
|
|
8507
8560
|
let e = this._source;
|
|
8508
8561
|
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);
|
|
8509
8562
|
}
|
|
8510
|
-
},
|
|
8563
|
+
}, _a = class {
|
|
8511
8564
|
parent;
|
|
8512
8565
|
source = new globalThis.Audio();
|
|
8513
8566
|
_src = "";
|
|
@@ -8524,7 +8577,7 @@ var pa = class t extends e {
|
|
|
8524
8577
|
return !!this.source && this.source.readyState === 4;
|
|
8525
8578
|
}
|
|
8526
8579
|
get context() {
|
|
8527
|
-
return
|
|
8580
|
+
return ha.instance;
|
|
8528
8581
|
}
|
|
8529
8582
|
constructor(e) {
|
|
8530
8583
|
this.parent = e;
|
|
@@ -8535,9 +8588,9 @@ var pa = class t extends e {
|
|
|
8535
8588
|
});
|
|
8536
8589
|
}
|
|
8537
8590
|
createSound() {
|
|
8538
|
-
return new
|
|
8591
|
+
return new ga();
|
|
8539
8592
|
}
|
|
8540
|
-
},
|
|
8593
|
+
}, va = class extends e {
|
|
8541
8594
|
_input;
|
|
8542
8595
|
_output;
|
|
8543
8596
|
_processers = [];
|
|
@@ -8559,7 +8612,7 @@ var pa = class t extends e {
|
|
|
8559
8612
|
get destination() {
|
|
8560
8613
|
return this._input;
|
|
8561
8614
|
}
|
|
8562
|
-
},
|
|
8615
|
+
}, ya = class {
|
|
8563
8616
|
destination;
|
|
8564
8617
|
source;
|
|
8565
8618
|
constructor(e, t = null) {
|
|
@@ -8574,21 +8627,21 @@ var pa = class t extends e {
|
|
|
8574
8627
|
};
|
|
8575
8628
|
//#endregion
|
|
8576
8629
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
8577
|
-
function
|
|
8578
|
-
if (
|
|
8579
|
-
if (
|
|
8630
|
+
function ba() {
|
|
8631
|
+
if (Ve) return new AudioContext();
|
|
8632
|
+
if (He) {
|
|
8580
8633
|
let e = globalThis.webkitAudioContext;
|
|
8581
8634
|
return new e();
|
|
8582
8635
|
} else throw Error("Failed to createAudioContext");
|
|
8583
8636
|
}
|
|
8584
|
-
function
|
|
8585
|
-
if (
|
|
8586
|
-
if (
|
|
8637
|
+
function xa(e, t, n) {
|
|
8638
|
+
if (Ue) return new OfflineAudioContext(e, t, n);
|
|
8639
|
+
if (We) {
|
|
8587
8640
|
let r = globalThis.webkitOfflineAudioContext;
|
|
8588
8641
|
return new r(e, t, n);
|
|
8589
8642
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
8590
8643
|
}
|
|
8591
|
-
var
|
|
8644
|
+
var Sa = class e extends va {
|
|
8592
8645
|
static _instance;
|
|
8593
8646
|
static get instance() {
|
|
8594
8647
|
return this._instance ||= new e(), this._instance;
|
|
@@ -8629,8 +8682,8 @@ var ba = class e extends ga {
|
|
|
8629
8682
|
_compressor;
|
|
8630
8683
|
_analyser;
|
|
8631
8684
|
constructor() {
|
|
8632
|
-
let e =
|
|
8633
|
-
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" && (
|
|
8685
|
+
let e = ba(), t = xa(1, 2, Ue ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
8686
|
+
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" && (Re || ze), Ke && (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));
|
|
8634
8687
|
}
|
|
8635
8688
|
_onFocus() {
|
|
8636
8689
|
if (!this.autoPause) return;
|
|
@@ -8670,7 +8723,7 @@ var ba = class e extends ga {
|
|
|
8670
8723
|
setParamValue(e, t) {
|
|
8671
8724
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
8672
8725
|
}
|
|
8673
|
-
},
|
|
8726
|
+
}, Ca = class extends e {
|
|
8674
8727
|
_audio = null;
|
|
8675
8728
|
_sourceNode = null;
|
|
8676
8729
|
_gain = null;
|
|
@@ -8798,12 +8851,12 @@ var ba = class e extends ga {
|
|
|
8798
8851
|
};
|
|
8799
8852
|
_updateListener = () => this._update();
|
|
8800
8853
|
_enableTicker(e) {
|
|
8801
|
-
|
|
8854
|
+
C.off(this._updateListener), e && C.on(this._updateListener);
|
|
8802
8855
|
}
|
|
8803
8856
|
destroy() {
|
|
8804
8857
|
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;
|
|
8805
8858
|
}
|
|
8806
|
-
},
|
|
8859
|
+
}, wa = class extends va {
|
|
8807
8860
|
parent;
|
|
8808
8861
|
_sourceBuffer;
|
|
8809
8862
|
_sourceNode;
|
|
@@ -8811,7 +8864,7 @@ var ba = class e extends ga {
|
|
|
8811
8864
|
gain;
|
|
8812
8865
|
analyser;
|
|
8813
8866
|
get context() {
|
|
8814
|
-
return
|
|
8867
|
+
return Sa.instance;
|
|
8815
8868
|
}
|
|
8816
8869
|
get isPlayable() {
|
|
8817
8870
|
return !!this._sourceNode.buffer;
|
|
@@ -8826,8 +8879,8 @@ var ba = class e extends ga {
|
|
|
8826
8879
|
this._sourceNode.buffer = e;
|
|
8827
8880
|
}
|
|
8828
8881
|
constructor(e) {
|
|
8829
|
-
let t =
|
|
8830
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8882
|
+
let t = Sa.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8883
|
+
n.connect(i), i.connect(r), r.connect(Sa.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
8831
8884
|
}
|
|
8832
8885
|
async load() {
|
|
8833
8886
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -8840,7 +8893,7 @@ var ba = class e extends ga {
|
|
|
8840
8893
|
});
|
|
8841
8894
|
}
|
|
8842
8895
|
_decode(e) {
|
|
8843
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8896
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : Sa.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
8844
8897
|
}
|
|
8845
8898
|
cloneSource() {
|
|
8846
8899
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -8850,15 +8903,15 @@ var ba = class e extends ga {
|
|
|
8850
8903
|
};
|
|
8851
8904
|
}
|
|
8852
8905
|
createSound() {
|
|
8853
|
-
return new
|
|
8906
|
+
return new Ca();
|
|
8854
8907
|
}
|
|
8855
|
-
},
|
|
8908
|
+
}, Ta, Ea = class extends V {
|
|
8856
8909
|
static {
|
|
8857
|
-
|
|
8910
|
+
Ta = this;
|
|
8858
8911
|
}
|
|
8859
8912
|
static _soundPool = [];
|
|
8860
8913
|
_sounds = [];
|
|
8861
|
-
_platformAudio =
|
|
8914
|
+
_platformAudio = Ge ? new wa(this) : new _a(this);
|
|
8862
8915
|
get platformAudio() {
|
|
8863
8916
|
return this._platformAudio;
|
|
8864
8917
|
}
|
|
@@ -8951,7 +9004,7 @@ var ba = class e extends ga {
|
|
|
8951
9004
|
this._sounds.length = 0;
|
|
8952
9005
|
}
|
|
8953
9006
|
_createSound() {
|
|
8954
|
-
return
|
|
9007
|
+
return Ta._soundPool.length > 0 ? Ta._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
8955
9008
|
}
|
|
8956
9009
|
refresh() {
|
|
8957
9010
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -8967,7 +9020,7 @@ var ba = class e extends ga {
|
|
|
8967
9020
|
this._recycleSound(e);
|
|
8968
9021
|
};
|
|
8969
9022
|
_recycleSound(e) {
|
|
8970
|
-
e.destroy(),
|
|
9023
|
+
e.destroy(), Ta._soundPool.includes(e) || Ta._soundPool.push(e);
|
|
8971
9024
|
}
|
|
8972
9025
|
_prevTime = 0;
|
|
8973
9026
|
_timer = 0;
|
|
@@ -8983,13 +9036,13 @@ var ba = class e extends ga {
|
|
|
8983
9036
|
}, 100);
|
|
8984
9037
|
}
|
|
8985
9038
|
};
|
|
8986
|
-
|
|
9039
|
+
Ea = Ta = k([S("Audio"), O("design:paramtypes", [Object])], Ea);
|
|
8987
9040
|
//#endregion
|
|
8988
9041
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
8989
|
-
var
|
|
9042
|
+
var Da = class extends Tr {}, Oa = class extends na {
|
|
8990
9043
|
_audioBuffer;
|
|
8991
9044
|
_src = (() => {
|
|
8992
|
-
let e =
|
|
9045
|
+
let e = w();
|
|
8993
9046
|
return e ? new z({ source: e }) : void 0;
|
|
8994
9047
|
})();
|
|
8995
9048
|
_needsUpdateTexture = !1;
|
|
@@ -9010,7 +9063,7 @@ var Ta = class extends wr {}, Ea = class extends ea {
|
|
|
9010
9063
|
}
|
|
9011
9064
|
}
|
|
9012
9065
|
async _loadSrc(e) {
|
|
9013
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
9066
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Sa.decode(e)).then((e) => {
|
|
9014
9067
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
9015
9068
|
});
|
|
9016
9069
|
}
|
|
@@ -9045,12 +9098,12 @@ var Ta = class extends wr {}, Ea = class extends ea {
|
|
|
9045
9098
|
this.syncTexture(), super._process(e);
|
|
9046
9099
|
}
|
|
9047
9100
|
};
|
|
9048
|
-
k([_(), O("design:type", Object)],
|
|
9101
|
+
k([_(), O("design:type", Object)], Oa.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], Oa.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], Oa.prototype, "color", void 0), Oa = k([S("AudioWaveform"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Oa);
|
|
9049
9102
|
//#endregion
|
|
9050
9103
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
9051
|
-
var
|
|
9104
|
+
var ka, Aa = class extends wr {
|
|
9052
9105
|
static {
|
|
9053
|
-
|
|
9106
|
+
ka = this;
|
|
9054
9107
|
}
|
|
9055
9108
|
blur = 10;
|
|
9056
9109
|
quality = 10;
|
|
@@ -9069,7 +9122,7 @@ var Da, Oa = class extends Cr {
|
|
|
9069
9122
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
9070
9123
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
9071
9124
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
9072
|
-
L.draw(e,
|
|
9125
|
+
L.draw(e, ka.material, {
|
|
9073
9126
|
sampler: r,
|
|
9074
9127
|
progress: i,
|
|
9075
9128
|
...t
|
|
@@ -9077,31 +9130,31 @@ var Da, Oa = class extends Cr {
|
|
|
9077
9130
|
});
|
|
9078
9131
|
}
|
|
9079
9132
|
};
|
|
9080
|
-
|
|
9133
|
+
Aa = ka = k([S("KawaseTransition")], Aa);
|
|
9081
9134
|
//#endregion
|
|
9082
9135
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
9083
|
-
var
|
|
9136
|
+
var ja, Ma = class extends wr {
|
|
9084
9137
|
static {
|
|
9085
|
-
|
|
9138
|
+
ja = this;
|
|
9086
9139
|
}
|
|
9087
9140
|
static material = new I({ gl: {
|
|
9088
9141
|
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}",
|
|
9089
9142
|
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}"
|
|
9090
9143
|
} });
|
|
9091
9144
|
apply(e) {
|
|
9092
|
-
L.draw(e,
|
|
9145
|
+
L.draw(e, ja.material, {
|
|
9093
9146
|
previous: 0,
|
|
9094
9147
|
next: 1,
|
|
9095
9148
|
progress: this.currentTimeProgress
|
|
9096
9149
|
});
|
|
9097
9150
|
}
|
|
9098
9151
|
};
|
|
9099
|
-
|
|
9152
|
+
Ma = ja = k([S("LeftEraseTransition")], Ma);
|
|
9100
9153
|
//#endregion
|
|
9101
9154
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
9102
|
-
var
|
|
9155
|
+
var Na, Pa = class extends wr {
|
|
9103
9156
|
static {
|
|
9104
|
-
|
|
9157
|
+
Na = this;
|
|
9105
9158
|
}
|
|
9106
9159
|
blur = 100;
|
|
9107
9160
|
gradientBlur = 600;
|
|
@@ -9113,7 +9166,7 @@ var ja, Ma = class extends Cr {
|
|
|
9113
9166
|
let n = this.currentTimeProgress, r, i;
|
|
9114
9167
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9115
9168
|
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);
|
|
9116
|
-
L.draw(e,
|
|
9169
|
+
L.draw(e, Na.material, {
|
|
9117
9170
|
sampler: r,
|
|
9118
9171
|
progress: i,
|
|
9119
9172
|
blur: this.blur,
|
|
@@ -9122,7 +9175,7 @@ var ja, Ma = class extends Cr {
|
|
|
9122
9175
|
end: c,
|
|
9123
9176
|
delta: [u / f, d / f],
|
|
9124
9177
|
texSize: l
|
|
9125
|
-
}), L.draw(e,
|
|
9178
|
+
}), L.draw(e, Na.material, {
|
|
9126
9179
|
sampler: r,
|
|
9127
9180
|
progress: i,
|
|
9128
9181
|
blur: this.blur,
|
|
@@ -9134,12 +9187,12 @@ var ja, Ma = class extends Cr {
|
|
|
9134
9187
|
});
|
|
9135
9188
|
}
|
|
9136
9189
|
};
|
|
9137
|
-
|
|
9190
|
+
Pa = Na = k([S("TiltShiftTransition")], Pa);
|
|
9138
9191
|
//#endregion
|
|
9139
9192
|
//#region src/scene/transitions/TwistTransition.ts
|
|
9140
|
-
var
|
|
9193
|
+
var Fa, Ia = class extends wr {
|
|
9141
9194
|
static {
|
|
9142
|
-
|
|
9195
|
+
Fa = this;
|
|
9143
9196
|
}
|
|
9144
9197
|
radius;
|
|
9145
9198
|
angle = 4;
|
|
@@ -9153,7 +9206,7 @@ var Na, Pa = class extends Cr {
|
|
|
9153
9206
|
let n = this.currentTimeProgress, r, i;
|
|
9154
9207
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9155
9208
|
let a = t.width, o = t.height;
|
|
9156
|
-
L.draw(e,
|
|
9209
|
+
L.draw(e, Fa.material, {
|
|
9157
9210
|
sampler: r,
|
|
9158
9211
|
progress: i,
|
|
9159
9212
|
filterArea: [
|
|
@@ -9169,16 +9222,16 @@ var Na, Pa = class extends Cr {
|
|
|
9169
9222
|
});
|
|
9170
9223
|
}
|
|
9171
9224
|
};
|
|
9172
|
-
|
|
9225
|
+
Ia = Fa = k([S("TwistTransition")], Ia);
|
|
9173
9226
|
//#endregion
|
|
9174
9227
|
//#region src/asset/loaders/GifLoader.ts
|
|
9175
|
-
var
|
|
9228
|
+
var La = class extends Hn {
|
|
9176
9229
|
install(e) {
|
|
9177
9230
|
let t = async (t) => {
|
|
9178
9231
|
let { decodeFrames: n } = await import("modern-gif");
|
|
9179
|
-
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new
|
|
9232
|
+
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new er(e.map((e) => ({
|
|
9180
9233
|
duration: e.delay,
|
|
9181
|
-
texture: new
|
|
9234
|
+
texture: new ir({
|
|
9182
9235
|
source: e.data,
|
|
9183
9236
|
width: e.width,
|
|
9184
9237
|
height: e.height
|
|
@@ -9189,14 +9242,14 @@ var Fa = class extends Vn {
|
|
|
9189
9242
|
e.register(n, t);
|
|
9190
9243
|
}), e.gif = this, this;
|
|
9191
9244
|
}
|
|
9192
|
-
},
|
|
9245
|
+
}, Ra = class extends Hn {
|
|
9193
9246
|
install(e) {
|
|
9194
9247
|
let t = async (e) => JSON.parse(await e.text());
|
|
9195
9248
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
9196
9249
|
e.register(n, t);
|
|
9197
9250
|
}), e.json = this, this;
|
|
9198
9251
|
}
|
|
9199
|
-
},
|
|
9252
|
+
}, za = class extends Hn {
|
|
9200
9253
|
install(e) {
|
|
9201
9254
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
9202
9255
|
container: null,
|
|
@@ -9207,12 +9260,12 @@ var Fa = class extends Vn {
|
|
|
9207
9260
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
9208
9261
|
}), e.lottie = this, this;
|
|
9209
9262
|
}
|
|
9210
|
-
},
|
|
9263
|
+
}, Ba = class extends Hn {
|
|
9211
9264
|
install(e) {
|
|
9212
9265
|
let t = async (e) => e.text();
|
|
9213
9266
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
9214
9267
|
}
|
|
9215
|
-
},
|
|
9268
|
+
}, Va = class extends Hn {
|
|
9216
9269
|
install(e) {
|
|
9217
9270
|
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
|
|
9218
9271
|
source: e,
|
|
@@ -9236,11 +9289,11 @@ var Fa = class extends Vn {
|
|
|
9236
9289
|
e.register(n, t);
|
|
9237
9290
|
}), e.texture = this, this;
|
|
9238
9291
|
}
|
|
9239
|
-
},
|
|
9292
|
+
}, Ha = class extends Hn {
|
|
9240
9293
|
install(e) {
|
|
9241
|
-
return this.load = (t) => e.awaitBy(() => new
|
|
9294
|
+
return this.load = (t) => e.awaitBy(() => new or(t).load()), e.video = this, this;
|
|
9242
9295
|
}
|
|
9243
|
-
},
|
|
9296
|
+
}, Ua = Object.entries({
|
|
9244
9297
|
"font/woff": ["woff"],
|
|
9245
9298
|
"font/ttf": ["ttf"],
|
|
9246
9299
|
"font/otf": ["otf"],
|
|
@@ -9256,31 +9309,31 @@ var Fa = class extends Vn {
|
|
|
9256
9309
|
"image/webp": ["webp"],
|
|
9257
9310
|
"application/json": ["json"]
|
|
9258
9311
|
});
|
|
9259
|
-
function
|
|
9260
|
-
for (let [t, n] of
|
|
9312
|
+
function Wa(e) {
|
|
9313
|
+
for (let [t, n] of Ua) if (n.includes(e)) return t;
|
|
9261
9314
|
}
|
|
9262
|
-
function
|
|
9315
|
+
function Ga(e) {
|
|
9263
9316
|
let t;
|
|
9264
9317
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
9265
9318
|
else if (e.startsWith("http")) {
|
|
9266
9319
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
9267
|
-
n && (t =
|
|
9320
|
+
n && (t = Wa(n));
|
|
9268
9321
|
}
|
|
9269
9322
|
return t;
|
|
9270
9323
|
}
|
|
9271
9324
|
//#endregion
|
|
9272
9325
|
//#region src/asset/Assets.ts
|
|
9273
|
-
var
|
|
9326
|
+
var Ka = "WeakRef" in globalThis, qa = class extends e {
|
|
9274
9327
|
defaultHandler = (e) => e;
|
|
9275
9328
|
_handlers = /* @__PURE__ */ new Map();
|
|
9276
9329
|
_handleing = /* @__PURE__ */ new Map();
|
|
9277
9330
|
_handled = /* @__PURE__ */ new Map();
|
|
9278
|
-
_gc =
|
|
9331
|
+
_gc = Ka ? new FinalizationRegistry((e) => {
|
|
9279
9332
|
let t = this.get(e);
|
|
9280
9333
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
9281
9334
|
}) : void 0;
|
|
9282
9335
|
constructor() {
|
|
9283
|
-
super(),
|
|
9336
|
+
super(), Ka || C.on(this.gc.bind(this), { sort: 2 });
|
|
9284
9337
|
}
|
|
9285
9338
|
use(e) {
|
|
9286
9339
|
return e.install(this), this;
|
|
@@ -9320,7 +9373,7 @@ var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
|
9320
9373
|
}).then((e) => {
|
|
9321
9374
|
if (e.complete && e.naturalWidth && e.naturalHeight) return createImageBitmap(e, t);
|
|
9322
9375
|
{
|
|
9323
|
-
let e =
|
|
9376
|
+
let e = w(1, 1);
|
|
9324
9377
|
if (!e) throw Error("createImageBitmap fallback requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
9325
9378
|
return createImageBitmap(e);
|
|
9326
9379
|
}
|
|
@@ -9329,11 +9382,11 @@ var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
|
9329
9382
|
}
|
|
9330
9383
|
get(e) {
|
|
9331
9384
|
let t = this._handled.get(e);
|
|
9332
|
-
return
|
|
9385
|
+
return Ka && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
9333
9386
|
}
|
|
9334
9387
|
set(e, t) {
|
|
9335
9388
|
let n = t;
|
|
9336
|
-
|
|
9389
|
+
Ka && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
9337
9390
|
}
|
|
9338
9391
|
async awaitBy(e) {
|
|
9339
9392
|
let t = e(), n = c();
|
|
@@ -9348,7 +9401,7 @@ var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
|
9348
9401
|
return this._handleing.set(e, r), r;
|
|
9349
9402
|
}
|
|
9350
9403
|
async load(e, t) {
|
|
9351
|
-
let n = await this.loadBy(e), r =
|
|
9404
|
+
let n = await this.loadBy(e), r = Ga(e);
|
|
9352
9405
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
9353
9406
|
}
|
|
9354
9407
|
async waitUntilLoad() {
|
|
@@ -9362,14 +9415,14 @@ var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
|
9362
9415
|
n && "destroy" in n && n.destroy();
|
|
9363
9416
|
}), this._handled.clear();
|
|
9364
9417
|
}
|
|
9365
|
-
}, $ = new
|
|
9418
|
+
}, $ = new qa().use(new Un()).use(new La()).use(new Ra()).use(new za()).use(new Ba()).use(new Va()).use(new Ha()), Ja = {
|
|
9366
9419
|
alpha: !0,
|
|
9367
9420
|
stencil: !0,
|
|
9368
9421
|
antialias: !1,
|
|
9369
9422
|
premultipliedAlpha: !0,
|
|
9370
9423
|
preserveDrawingBuffer: !1,
|
|
9371
9424
|
powerPreference: "default"
|
|
9372
|
-
},
|
|
9425
|
+
}, Ya = class extends Cr {
|
|
9373
9426
|
renderer;
|
|
9374
9427
|
get view() {
|
|
9375
9428
|
return this.renderer.view;
|
|
@@ -9392,7 +9445,7 @@ var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
|
9392
9445
|
set pixelRatio(e) {
|
|
9393
9446
|
this.renderer.pixelRatio = e, this.resize(this.width, this.height);
|
|
9394
9447
|
}
|
|
9395
|
-
_resizeObserver =
|
|
9448
|
+
_resizeObserver = Pe ? new ResizeObserver((e) => {
|
|
9396
9449
|
let t = e[0];
|
|
9397
9450
|
if (t.target === this.view) {
|
|
9398
9451
|
let { inlineSize: e, blockSize: n } = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize;
|
|
@@ -9400,14 +9453,14 @@ var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
|
9400
9453
|
}
|
|
9401
9454
|
}) : void 0;
|
|
9402
9455
|
constructor(e = {}) {
|
|
9403
|
-
let { view: t, width: n, height: r, pixelRatio: i =
|
|
9404
|
-
super(), this.renderer = new
|
|
9405
|
-
alpha:
|
|
9406
|
-
stencil:
|
|
9407
|
-
antialias:
|
|
9408
|
-
premultipliedAlpha:
|
|
9409
|
-
preserveDrawingBuffer:
|
|
9410
|
-
powerPreference:
|
|
9456
|
+
let { view: t, width: n, height: r, pixelRatio: i = Je, autoResize: a, data: o } = e;
|
|
9457
|
+
super(), this.renderer = new Vn(t, {
|
|
9458
|
+
alpha: Ja.alpha ?? e.alpha,
|
|
9459
|
+
stencil: Ja.stencil ?? e.stencil,
|
|
9460
|
+
antialias: Ja.antialias ?? e.antialias,
|
|
9461
|
+
premultipliedAlpha: Ja.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
9462
|
+
preserveDrawingBuffer: Ja.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
9463
|
+
powerPreference: Ja.powerPreference ?? e.powerPreference
|
|
9411
9464
|
}), 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);
|
|
9412
9465
|
}
|
|
9413
9466
|
_updateProperty(e, t, n) {
|
|
@@ -9440,7 +9493,7 @@ var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
|
9440
9493
|
return this.renderer.resize(e, t, n), this.root.width = e, this.root.height = t, this.render(), this;
|
|
9441
9494
|
}
|
|
9442
9495
|
nextTick() {
|
|
9443
|
-
return
|
|
9496
|
+
return be();
|
|
9444
9497
|
}
|
|
9445
9498
|
async waitUntilLoad() {
|
|
9446
9499
|
await $.waitUntilLoad(), await this.nextTick();
|
|
@@ -9479,9 +9532,9 @@ var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
|
9479
9532
|
return new ImageData(this.toPixels(), this.root.width, this.root.height);
|
|
9480
9533
|
}
|
|
9481
9534
|
toCanvas2D(e = this.toImageData()) {
|
|
9482
|
-
let t =
|
|
9535
|
+
let t = w(e.width, e.height), n = t?.getContext("2d");
|
|
9483
9536
|
t && n && (n.fillStyle = "rgba(0, 0, 0, 0)", n.clearRect(0, 0, t.width, t.height), n.putImageData(e, 0, 0));
|
|
9484
|
-
let r =
|
|
9537
|
+
let r = w(e.width, e.height);
|
|
9485
9538
|
if (!r) throw Error("toCanvas2D requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
9486
9539
|
let i = r.getContext("2d");
|
|
9487
9540
|
return i && t && (i.fillStyle = "rgba(0, 0, 0, 0)", i.clearRect(0, 0, r.width, r.height), i.drawImage(t, 0, 0, t.width, t.height, 0, 0, r.width, r.height)), r;
|
|
@@ -9490,22 +9543,22 @@ var Wa = "WeakRef" in globalThis, Ga = class extends e {
|
|
|
9490
9543
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
9491
9544
|
}
|
|
9492
9545
|
};
|
|
9493
|
-
k([_({ fallback: !1 }), O("design:type", Boolean)],
|
|
9546
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], Ya.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Ya.prototype, "autoStart", void 0);
|
|
9494
9547
|
//#endregion
|
|
9495
9548
|
//#region src/render.ts
|
|
9496
|
-
var
|
|
9497
|
-
function
|
|
9498
|
-
return
|
|
9549
|
+
var Xa, Za = [], Qa = !1;
|
|
9550
|
+
function $a() {
|
|
9551
|
+
return Xa ??= new Ya({
|
|
9499
9552
|
pixelRatio: 1,
|
|
9500
9553
|
width: 1,
|
|
9501
9554
|
height: 1,
|
|
9502
9555
|
preserveDrawingBuffer: !0
|
|
9503
9556
|
});
|
|
9504
9557
|
}
|
|
9505
|
-
async function
|
|
9506
|
-
if (!
|
|
9507
|
-
for (
|
|
9508
|
-
let t =
|
|
9558
|
+
async function eo(e = 100) {
|
|
9559
|
+
if (!Qa) {
|
|
9560
|
+
for (Qa = !0; Za.length;) {
|
|
9561
|
+
let t = Za.shift();
|
|
9509
9562
|
if (t) try {
|
|
9510
9563
|
await t();
|
|
9511
9564
|
} catch (e) {
|
|
@@ -9513,11 +9566,11 @@ async function Qa(e = 100) {
|
|
|
9513
9566
|
}
|
|
9514
9567
|
else await new Promise((t) => setTimeout(t, e));
|
|
9515
9568
|
}
|
|
9516
|
-
|
|
9569
|
+
Qa = !1;
|
|
9517
9570
|
}
|
|
9518
9571
|
}
|
|
9519
|
-
async function
|
|
9520
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f =
|
|
9572
|
+
async function to(e) {
|
|
9573
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = $a();
|
|
9521
9574
|
if (f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resize(u, d, !0), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitAndRender(), o.length) {
|
|
9522
9575
|
let e = o.length, t = o[e - 1];
|
|
9523
9576
|
for (let n = 0; n < e; n++) {
|
|
@@ -9535,15 +9588,15 @@ async function $a(e) {
|
|
|
9535
9588
|
toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
|
|
9536
9589
|
};
|
|
9537
9590
|
}
|
|
9538
|
-
async function
|
|
9591
|
+
async function no(e) {
|
|
9539
9592
|
return new Promise((t) => {
|
|
9540
|
-
|
|
9593
|
+
Za.push(async () => t(await to(e).then((e) => e.toCanvas2D()))), eo();
|
|
9541
9594
|
});
|
|
9542
9595
|
}
|
|
9543
|
-
async function
|
|
9596
|
+
async function ro(e) {
|
|
9544
9597
|
return new Promise((t) => {
|
|
9545
|
-
|
|
9598
|
+
Za.push(async () => t(await to(e).then((e) => e.pixels))), eo();
|
|
9546
9599
|
});
|
|
9547
9600
|
}
|
|
9548
9601
|
//#endregion
|
|
9549
|
-
export {
|
|
9602
|
+
export { vt as Aabb2D, er as AnimatedTexture, ma as Animation, qa as Assets, Ea as Audio, va as AudioPipeline, ya as AudioProcessor, Da as AudioSpectrum, Oa as AudioWaveform, A as BufferUsage, Er as Camera2D, cr as CanvasContext, vr as CanvasItem, tr as CanvasTexture, yt as Color, W as ColorAdjustEffect, zr as ColorFilterEffect, Ct as ColorMatrix, Hr as ColorOverlayEffect, Wr as ColorRemoveEffect, qr as ColorReplaceEffect, nr as ColorTexture, T as CoreObject, bt as DEG_TO_RAD, Je as DEVICE_PIXEL_RATIO, G as DrawboardEffect, ei as DropShadowEffect, U as Effect, Zn as EffectMaterial, na as Element2D, vi as Element2DBackground, X as Element2DChart, Si as Element2DComments, Ci as Element2DConnection, Y as Element2DFill, ji as Element2DForeground, Ni as Element2DOutline, Pi as Element2DShadow, Fi as Element2DShape, Ii as Element2DStyle, Bi as Element2DTable, Z as Element2DText, ni as EmbossEffect, Ya as Engine, Zi as Flexbox, Un as FontLoader, Qr as GaussianBlurEffect, Gn as Geometry, La as GifLoader, un as GlBatch2DSystem, on as GlBlendMode, Ot as GlBuffer, Ft as GlBufferSystem, Dt as GlBufferTarget, mn as GlMaskSystem, qt as GlProgram, vn as GlRenderTarget, yn as GlRenderTargetSystem, nn as GlShaderSystem, cn as GlState, ln as GlStateSystem, gn as GlStencilSystem, j as GlSystem, _n as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, rr as GradientTexture, _a as HTMLAudio, ha as HTMLAudioContext, ga as HTMLSound, Ke as IN_BROWSER, qe as IN_MAC_OS, Wn as IndexBuffer, gt as Input, ut as InputEvent, Ra as JsonLoader, ci as KawaseBlurEffect, Aa as KawaseTransition, dt as KeyboardInputEvent, Ma as LeftEraseTransition, Hn as Loader, ia as Lottie2D, za as LottieLoader, Et as MainLoop, ui as MaskEffect, I as Material, aa as Mesh2D, ur as Meta, ft as MouseInputEvent, B as Node, Tr as Node2D, wt as Obb2D, J as OutlineEffect, xe as PI, Se as PI_2, mi as PixelateEffect, ir as PixelsTexture, pt as PointerInputEvent, Tt as Projection2D, Kn as QuadGeometry, L as QuadUvGeometry, xt as RAD_TO_DEG, _t as RefCounted, R as RenderTarget, kt as Renderer, E as Resource, Ve as SUPPORTS_AUDIO_CONTEXT, ze as SUPPORTS_CLICK_EVENTS, Be as SUPPORTS_CREATE_IMAGE_BITMAP, Ne as SUPPORTS_IMAGE_BITMAP, Le as SUPPORTS_MOUSE_EVENTS, Ue as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Fe as SUPPORTS_POINTER_EVENTS, Pe as SUPPORTS_RESIZE_OBSERVER, Re as SUPPORTS_TOUCH_EVENTS, Me as SUPPORTS_WEBGL2, He as SUPPORTS_WEBKIT_AUDIO_CONTEXT, We as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ge as SUPPORTS_WEB_AUDIO, Ie as SUPPORTS_WHEEL_EVENTS, Cr as SceneTree, Ba as TextLoader, z as Texture2D, Va as TextureLoader, ra as TextureRect2D, C as Ticker, Pa as TiltShiftTransition, xr as Timeline, V as TimelineNode, oa as TransformRect2D, wr as Transition, Ia as TwistTransition, jt as UniformGroup, $n as UvGeometry, Qn as UvMaterial, F as VertexAttribute, P as VertexBuffer, sa as Video2D, Ha as VideoLoader, or as VideoTexture, H as Viewport, sr as ViewportTexture, wa as WebAudio, Sa as WebAudioContext, Vn as WebGLRenderer, Ca as WebSound, mt as WheelInputEvent, Sr as Window, gi as ZoomBlurEffect, Hi as alignMap, $ as assets, Dr as axisDir, Xi as boxSizingMap, St as clamp, si as clampFrag, w as createHTMLCanvas, Pt as createIdFromString, ye as createNode, st as crossOrigin, fa as cssEasingPresets, da as cubicBezier, S as customNode, ve as customNodes, Ja as defaultOptions, ot as determineCrossOrigin, Wi as directionMap, Ui as displayMap, Q as edgeMap, Gi as flexDirectionMap, Ki as flexWrapMap, oi as frag, nt as getCanvasFactory, De as getDefaultCssPropertyValue, at as getGlContextProvider, $a as getRenderEngine, Vi as gutterMap, lt as instanceId, Qe as isCanvasElement, Ye as isElementNode, Ze as isImageElement, Ce as isPow2, Xe as isVideoElement, $e as isWebgl2, qi as justifyMap, D as lerp, fn as log2, sn as mapGlBlendModes, dn as nextPow2, be as nextTick, Ji as overflowMap, Fr as parseCssFilter, ke as parseCssFunctions, Oe as parseCssProperty, Ir as parseCssTransformOrigin, Yi as positionTypeMap, no as render, ro as renderPixels, gr as resetBatchPool, Or as routeConnection, tt as setCanvasFactory, it as setGlContextProvider, hn as stencilModeMap };
|