@codingfactory/mediables-vue 2.18.1 → 2.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PixiFrameExporter-8s_FrDYj.cjs → PixiFrameExporter-C8Ty9X-z.cjs} +2 -2
- package/dist/{PixiFrameExporter-8s_FrDYj.cjs.map → PixiFrameExporter-C8Ty9X-z.cjs.map} +1 -1
- package/dist/{PixiFrameExporter-COMYNpK0.js → PixiFrameExporter-CVa0D6mr.js} +2 -2
- package/dist/{PixiFrameExporter-COMYNpK0.js.map → PixiFrameExporter-CVa0D6mr.js.map} +1 -1
- package/dist/{editor-OIsQEaJg.js → editor-4KRKCBKe.js} +404 -442
- package/dist/editor-4KRKCBKe.js.map +1 -0
- package/dist/editor-HgfBAw_0.cjs +2 -0
- package/dist/editor-HgfBAw_0.cjs.map +1 -0
- package/dist/{index-DwhIlbEz.cjs → index-Boyt6ME1.cjs} +15 -15
- package/dist/index-Boyt6ME1.cjs.map +1 -0
- package/dist/{index-BfdtvGh8.js → index-ZHcVI7XG.js} +4525 -4440
- package/dist/index-ZHcVI7XG.js.map +1 -0
- package/dist/mediables-vanilla.cjs +1 -1
- package/dist/mediables-vanilla.mjs +1 -1
- package/dist/mediables-vue.cjs +1 -1
- package/dist/mediables-vue.mjs +2 -2
- package/dist/style.css +1 -1
- package/dist/vanilla-editor/styles/editor-v2.css +151 -0
- package/dist/vanilla-editor/ui/Toolbar.d.ts +0 -6
- package/dist/vanilla-editor/ui-v2/SplitPanelLayout.d.ts +2 -0
- package/package.json +1 -1
- package/dist/editor-DLvndiXG.cjs +0 -2
- package/dist/editor-DLvndiXG.cjs.map +0 -1
- package/dist/editor-OIsQEaJg.js.map +0 -1
- package/dist/index-BfdtvGh8.js.map +0 -1
- package/dist/index-DwhIlbEz.cjs.map +0 -1
|
@@ -2,7 +2,7 @@ var nt = Object.defineProperty;
|
|
|
2
2
|
var ot = (a, e, t) => e in a ? nt(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
3
|
var ve = (a, e, t) => ot(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as v from "pixi-filters";
|
|
5
|
-
import * as
|
|
5
|
+
import * as I from "pixi.js";
|
|
6
6
|
class de {
|
|
7
7
|
constructor() {
|
|
8
8
|
this._events = /* @__PURE__ */ new Map();
|
|
@@ -41,7 +41,7 @@ const lt = Object.freeze([
|
|
|
41
41
|
"Times New Roman",
|
|
42
42
|
"Courier New",
|
|
43
43
|
"Verdana"
|
|
44
|
-
]),
|
|
44
|
+
]), ze = Object.freeze(["normal", "multiply", "screen", "overlay"]), he = Object.freeze({ x: 0.2, y: 0.2, width: 0.6, height: 0.18 }), H = Object.freeze({
|
|
45
45
|
fontFamily: "Inter",
|
|
46
46
|
fontSize: 64,
|
|
47
47
|
fontWeight: 700,
|
|
@@ -50,7 +50,7 @@ const lt = Object.freeze([
|
|
|
50
50
|
align: "center",
|
|
51
51
|
lineHeight: 1.2,
|
|
52
52
|
letterSpacing: 0
|
|
53
|
-
}),
|
|
53
|
+
}), B = Object.freeze({
|
|
54
54
|
stroke: Object.freeze({ enabled: !1, color: "#000000", width: 0 }),
|
|
55
55
|
shadow: Object.freeze({ enabled: !1, color: "#000000", alpha: 0.5, blur: 0, distance: 0, angle: 45 }),
|
|
56
56
|
glow: Object.freeze({ enabled: !1, color: "#ffffff", alpha: 0.5, blur: 0 }),
|
|
@@ -405,7 +405,7 @@ class ct extends de {
|
|
|
405
405
|
* @returns {string}
|
|
406
406
|
*/
|
|
407
407
|
_normalizeBlendMode(e, t = "normal") {
|
|
408
|
-
return
|
|
408
|
+
return ze.includes(e) ? e : ze.includes(t) ? t : "normal";
|
|
409
409
|
}
|
|
410
410
|
/**
|
|
411
411
|
* @param {*} value
|
|
@@ -468,38 +468,38 @@ class ct extends de {
|
|
|
468
468
|
*/
|
|
469
469
|
_normalizeTextEffects(e, t = null) {
|
|
470
470
|
const r = e && typeof e == "object" ? e : {}, i = t && typeof t == "object" ? t : {}, s = {
|
|
471
|
-
stroke: { ...
|
|
472
|
-
shadow: { ...
|
|
473
|
-
glow: { ...
|
|
474
|
-
backdrop: { ...
|
|
471
|
+
stroke: { ...B.stroke, ...i.stroke && typeof i.stroke == "object" ? i.stroke : {} },
|
|
472
|
+
shadow: { ...B.shadow, ...i.shadow && typeof i.shadow == "object" ? i.shadow : {} },
|
|
473
|
+
glow: { ...B.glow, ...i.glow && typeof i.glow == "object" ? i.glow : {} },
|
|
474
|
+
backdrop: { ...B.backdrop, ...i.backdrop && typeof i.backdrop == "object" ? i.backdrop : {} }
|
|
475
475
|
}, n = r.stroke && typeof r.stroke == "object" ? r.stroke : {}, o = r.shadow && typeof r.shadow == "object" ? r.shadow : {}, l = r.glow && typeof r.glow == "object" ? r.glow : {}, c = r.backdrop && typeof r.backdrop == "object" ? r.backdrop : {};
|
|
476
476
|
return {
|
|
477
477
|
stroke: {
|
|
478
478
|
enabled: this._normalizeBoolean(n.enabled, s.stroke.enabled),
|
|
479
479
|
color: this._normalizeTextColor(n.color, s.stroke.color),
|
|
480
|
-
width: this._clampNumber(n.width, 0, 80, this._clampNumber(s.stroke.width, 0, 80,
|
|
480
|
+
width: this._clampNumber(n.width, 0, 80, this._clampNumber(s.stroke.width, 0, 80, B.stroke.width))
|
|
481
481
|
},
|
|
482
482
|
shadow: {
|
|
483
483
|
enabled: this._normalizeBoolean(o.enabled, s.shadow.enabled),
|
|
484
484
|
color: this._normalizeTextColor(o.color, s.shadow.color),
|
|
485
|
-
alpha: this._clampNumber(o.alpha, 0, 1, this._clampNumber(s.shadow.alpha, 0, 1,
|
|
486
|
-
blur: this._clampNumber(o.blur, 0, 120, this._clampNumber(s.shadow.blur, 0, 120,
|
|
487
|
-
distance: this._clampNumber(o.distance, 0, 200, this._clampNumber(s.shadow.distance, 0, 200,
|
|
488
|
-
angle: this._normalizeDegrees(o.angle ?? s.shadow.angle ??
|
|
485
|
+
alpha: this._clampNumber(o.alpha, 0, 1, this._clampNumber(s.shadow.alpha, 0, 1, B.shadow.alpha)),
|
|
486
|
+
blur: this._clampNumber(o.blur, 0, 120, this._clampNumber(s.shadow.blur, 0, 120, B.shadow.blur)),
|
|
487
|
+
distance: this._clampNumber(o.distance, 0, 200, this._clampNumber(s.shadow.distance, 0, 200, B.shadow.distance)),
|
|
488
|
+
angle: this._normalizeDegrees(o.angle ?? s.shadow.angle ?? B.shadow.angle)
|
|
489
489
|
},
|
|
490
490
|
glow: {
|
|
491
491
|
enabled: this._normalizeBoolean(l.enabled, s.glow.enabled),
|
|
492
492
|
color: this._normalizeTextColor(l.color, s.glow.color),
|
|
493
|
-
alpha: this._clampNumber(l.alpha, 0, 1, this._clampNumber(s.glow.alpha, 0, 1,
|
|
494
|
-
blur: this._clampNumber(l.blur, 0, 120, this._clampNumber(s.glow.blur, 0, 120,
|
|
493
|
+
alpha: this._clampNumber(l.alpha, 0, 1, this._clampNumber(s.glow.alpha, 0, 1, B.glow.alpha)),
|
|
494
|
+
blur: this._clampNumber(l.blur, 0, 120, this._clampNumber(s.glow.blur, 0, 120, B.glow.blur))
|
|
495
495
|
},
|
|
496
496
|
backdrop: {
|
|
497
497
|
enabled: this._normalizeBoolean(c.enabled, s.backdrop.enabled),
|
|
498
498
|
color: this._normalizeTextColor(c.color, s.backdrop.color),
|
|
499
|
-
opacity: this._clampNumber(c.opacity, 0, 1, this._clampNumber(s.backdrop.opacity, 0, 1,
|
|
500
|
-
padding: this._clampNumber(c.padding, 0, 200, this._clampNumber(s.backdrop.padding, 0, 200,
|
|
501
|
-
radius: this._clampNumber(c.radius, 0, 200, this._clampNumber(s.backdrop.radius, 0, 200,
|
|
502
|
-
blur: this._clampNumber(c.blur, 0, 80, this._clampNumber(s.backdrop.blur, 0, 80,
|
|
499
|
+
opacity: this._clampNumber(c.opacity, 0, 1, this._clampNumber(s.backdrop.opacity, 0, 1, B.backdrop.opacity)),
|
|
500
|
+
padding: this._clampNumber(c.padding, 0, 200, this._clampNumber(s.backdrop.padding, 0, 200, B.backdrop.padding)),
|
|
501
|
+
radius: this._clampNumber(c.radius, 0, 200, this._clampNumber(s.backdrop.radius, 0, 200, B.backdrop.radius)),
|
|
502
|
+
blur: this._clampNumber(c.blur, 0, 80, this._clampNumber(s.backdrop.blur, 0, 80, B.backdrop.blur))
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
}
|
|
@@ -998,7 +998,7 @@ class ct extends de {
|
|
|
998
998
|
function ht() {
|
|
999
999
|
return new ct();
|
|
1000
1000
|
}
|
|
1001
|
-
const dt = Object.freeze(["normal", "multiply", "screen", "overlay"]),
|
|
1001
|
+
const dt = Object.freeze(["normal", "multiply", "screen", "overlay"]), E = Object.freeze({
|
|
1002
1002
|
stroke: Object.freeze({ enabled: !1, color: "#000000", width: 0 }),
|
|
1003
1003
|
shadow: Object.freeze({ enabled: !1, color: "#000000", alpha: 0.5, blur: 0, distance: 0, angle: 45 }),
|
|
1004
1004
|
glow: Object.freeze({ enabled: !1, color: "#ffffff", alpha: 0.5, blur: 0 }),
|
|
@@ -1349,30 +1349,30 @@ class ut extends de {
|
|
|
1349
1349
|
return {
|
|
1350
1350
|
stroke: {
|
|
1351
1351
|
enabled: r.enabled === !0,
|
|
1352
|
-
color: this._supportedTextColor(r.color,
|
|
1353
|
-
width: this._clampNumber(r.width, 0, 80,
|
|
1352
|
+
color: this._supportedTextColor(r.color, E.stroke.color),
|
|
1353
|
+
width: this._clampNumber(r.width, 0, 80, E.stroke.width)
|
|
1354
1354
|
},
|
|
1355
1355
|
shadow: {
|
|
1356
1356
|
enabled: i.enabled === !0,
|
|
1357
|
-
color: this._supportedTextColor(i.color,
|
|
1358
|
-
alpha: this._clampNumber(i.alpha, 0, 1,
|
|
1359
|
-
blur: this._clampNumber(i.blur, 0, 120,
|
|
1360
|
-
distance: this._clampNumber(i.distance, 0, 200,
|
|
1361
|
-
angle: this._normalizeDegrees(i.angle ??
|
|
1357
|
+
color: this._supportedTextColor(i.color, E.shadow.color),
|
|
1358
|
+
alpha: this._clampNumber(i.alpha, 0, 1, E.shadow.alpha),
|
|
1359
|
+
blur: this._clampNumber(i.blur, 0, 120, E.shadow.blur),
|
|
1360
|
+
distance: this._clampNumber(i.distance, 0, 200, E.shadow.distance),
|
|
1361
|
+
angle: this._normalizeDegrees(i.angle ?? E.shadow.angle)
|
|
1362
1362
|
},
|
|
1363
1363
|
glow: {
|
|
1364
1364
|
enabled: s.enabled === !0,
|
|
1365
|
-
color: this._supportedTextColor(s.color,
|
|
1366
|
-
alpha: this._clampNumber(s.alpha, 0, 1,
|
|
1367
|
-
blur: this._clampNumber(s.blur, 0, 120,
|
|
1365
|
+
color: this._supportedTextColor(s.color, E.glow.color),
|
|
1366
|
+
alpha: this._clampNumber(s.alpha, 0, 1, E.glow.alpha),
|
|
1367
|
+
blur: this._clampNumber(s.blur, 0, 120, E.glow.blur)
|
|
1368
1368
|
},
|
|
1369
1369
|
backdrop: {
|
|
1370
1370
|
enabled: n.enabled === !0,
|
|
1371
|
-
color: this._supportedTextColor(n.color,
|
|
1372
|
-
opacity: this._clampNumber(n.opacity, 0, 1,
|
|
1373
|
-
padding: this._clampNumber(n.padding, 0, 200,
|
|
1374
|
-
radius: this._clampNumber(n.radius, 0, 200,
|
|
1375
|
-
blur: this._clampNumber(n.blur, 0, 80,
|
|
1371
|
+
color: this._supportedTextColor(n.color, E.backdrop.color),
|
|
1372
|
+
opacity: this._clampNumber(n.opacity, 0, 1, E.backdrop.opacity),
|
|
1373
|
+
padding: this._clampNumber(n.padding, 0, 200, E.backdrop.padding),
|
|
1374
|
+
radius: this._clampNumber(n.radius, 0, 200, E.backdrop.radius),
|
|
1375
|
+
blur: this._clampNumber(n.blur, 0, 80, E.backdrop.blur)
|
|
1376
1376
|
}
|
|
1377
1377
|
};
|
|
1378
1378
|
}
|
|
@@ -1593,9 +1593,9 @@ class ut extends de {
|
|
|
1593
1593
|
t.filters = g ? [g] : null;
|
|
1594
1594
|
}
|
|
1595
1595
|
_fitTextDisplayObjectToRect(e, t, r) {
|
|
1596
|
-
var g,
|
|
1596
|
+
var g, y;
|
|
1597
1597
|
const i = this._normalizeTextBox(t), s = r.x + i.x * r.width, n = r.y + i.y * r.height, o = i.width * r.width, l = i.height * r.height, c = Number((g = this.originalTexture) == null ? void 0 : g.width) || r.width, d = c > 0 ? r.width / c : 1, h = this._textEffectsForLayer(t);
|
|
1598
|
-
e.x = s, e.y = n, e.rotation = this._normalizeDegrees(Number((
|
|
1598
|
+
e.x = s, e.y = n, e.rotation = this._normalizeDegrees(Number((y = t == null ? void 0 : t.transform) == null ? void 0 : y.rotation) || 0) * Math.PI / 180, e.blendMode = this._textBlendMode(t), e.__textBox = i, e.__textLayout = { x: s, y: n, width: o, height: l, scale: d };
|
|
1599
1599
|
const u = e.__textObject || e, p = e.__textMask || null, m = e.__textEffectMask || null;
|
|
1600
1600
|
if (u.text = this._textContentForLayer(t), u.style = this._textStyleForLayer(t, d, o), u.x = 0, u.y = 0, u.rotation = 0, p && typeof p.clear == "function" && typeof p.rect == "function" && typeof p.fill == "function" && (p.clear(), p.rect(0, 0, o, l).fill(16777215), u.mask = p), m && typeof m.clear == "function" && typeof m.rect == "function" && typeof m.fill == "function") {
|
|
1601
1601
|
const C = this._textEffectPadding(h, d);
|
|
@@ -1604,7 +1604,7 @@ class ut extends de {
|
|
|
1604
1604
|
this._syncTextBackdrop(window.PIXI, e.__textBackdrop, h, d, o, l, m), this._syncTextEffectPrimitive(window.PIXI, e.__textShadow, t, h, "shadow", d, o, m), this._syncTextEffectPrimitive(window.PIXI, e.__textGlow, t, h, "glow", d, o, m);
|
|
1605
1605
|
}
|
|
1606
1606
|
_fitDisplayObjectToRect(e, t, r) {
|
|
1607
|
-
var h, u, p, m, g,
|
|
1607
|
+
var h, u, p, m, g, y, C, k;
|
|
1608
1608
|
const i = this._backgroundFillForLayer(t), s = (i == null ? void 0 : i.fit) || "cover";
|
|
1609
1609
|
if (e.__isTilingBackground) {
|
|
1610
1610
|
e.x = r.x, e.y = r.y, e.width = r.width, e.height = r.height, (u = (h = e.tilePosition) == null ? void 0 : h.set) == null || u.call(h, 0, 0), (m = (p = e.tileScale) == null ? void 0 : p.set) == null || m.call(p, 1, 1);
|
|
@@ -1614,7 +1614,7 @@ class ut extends de {
|
|
|
1614
1614
|
e.x = r.x, e.y = r.y, e.width = r.width, e.height = r.height;
|
|
1615
1615
|
return;
|
|
1616
1616
|
}
|
|
1617
|
-
const n = Number(e.__sourceWidth || ((g = i == null ? void 0 : i.source) == null ? void 0 : g.originalWidth) || ((
|
|
1617
|
+
const n = Number(e.__sourceWidth || ((g = i == null ? void 0 : i.source) == null ? void 0 : g.originalWidth) || ((y = e.texture) == null ? void 0 : y.width) || r.width), o = Number(e.__sourceHeight || ((C = i == null ? void 0 : i.source) == null ? void 0 : C.originalHeight) || ((k = e.texture) == null ? void 0 : k.height) || r.height);
|
|
1618
1618
|
if (!Number.isFinite(n) || !Number.isFinite(o) || n <= 0 || o <= 0) {
|
|
1619
1619
|
e.x = r.x, e.y = r.y, e.width = r.width, e.height = r.height;
|
|
1620
1620
|
return;
|
|
@@ -1685,7 +1685,7 @@ class ut extends de {
|
|
|
1685
1685
|
* @returns {boolean}
|
|
1686
1686
|
*/
|
|
1687
1687
|
rotateBy(e) {
|
|
1688
|
-
var g,
|
|
1688
|
+
var g, y, C;
|
|
1689
1689
|
const t = this._normalizeDegrees(e);
|
|
1690
1690
|
if (t === 0) return !0;
|
|
1691
1691
|
if (!((g = this.app) != null && g.renderer) || !this.originalTexture || !this.sprite)
|
|
@@ -1693,7 +1693,7 @@ class ut extends de {
|
|
|
1693
1693
|
const r = window.PIXI, i = Math.round(this.originalTexture.width), s = Math.round(this.originalTexture.height);
|
|
1694
1694
|
if (i <= 0 || s <= 0) return !1;
|
|
1695
1695
|
const { width: n, height: o } = this.getRotatedBounds(i, s, t), l = t * Math.PI / 180, c = new r.Container(), d = new r.Sprite(this.originalTexture);
|
|
1696
|
-
(C = (
|
|
1696
|
+
(C = (y = d.anchor) == null ? void 0 : y.set) == null || C.call(y, 0.5), d.x = n / 2, d.y = o / 2, d.rotation = l, c.addChild(d);
|
|
1697
1697
|
const h = r.RenderTexture.create({ width: n, height: o, resolution: 1 });
|
|
1698
1698
|
try {
|
|
1699
1699
|
this.app.renderer.render({
|
|
@@ -1744,56 +1744,56 @@ class ut extends de {
|
|
|
1744
1744
|
} else
|
|
1745
1745
|
g.push(x);
|
|
1746
1746
|
}
|
|
1747
|
-
let
|
|
1747
|
+
let y = 0;
|
|
1748
1748
|
for (const x of g) {
|
|
1749
1749
|
const S = typeof x.getExportPadding == "function" ? Number(x.getExportPadding()) || 0 : typeof x._exportPadding == "number" ? x._exportPadding : typeof x.padding == "number" ? x.padding : 0;
|
|
1750
|
-
S > 0 && (
|
|
1750
|
+
S > 0 && (y += S);
|
|
1751
1751
|
}
|
|
1752
|
-
const C = Math.max(Math.ceil(
|
|
1753
|
-
var pe, fe,
|
|
1754
|
-
const S = Math.ceil(o + 2 * x),
|
|
1752
|
+
const C = Math.max(Math.ceil(y), 64), k = (x) => {
|
|
1753
|
+
var pe, fe, D, me;
|
|
1754
|
+
const S = Math.ceil(o + 2 * x), T = Math.ceil(l + 2 * x), F = new n.Container(), R = [], V = (b = null) => {
|
|
1755
1755
|
const w = new n.Sprite(this.originalTexture);
|
|
1756
1756
|
w.x = x, w.y = x, w.scale.set(1, 1), w.alpha = b ? this._layerOpacity(b) : 1, b && this._applyLayerFilterInstances(w, b, {
|
|
1757
1757
|
forExport: !0,
|
|
1758
1758
|
previewToNativeScale: u,
|
|
1759
1759
|
sourceWidth: o,
|
|
1760
1760
|
sourceHeight: l
|
|
1761
|
-
}), g.length > 0 && (w.filters = g, w.filterArea = new n.Rectangle(0, 0, o, l)), F.addChild(w),
|
|
1761
|
+
}), g.length > 0 && (w.filters = g, w.filterArea = new n.Rectangle(0, 0, o, l)), F.addChild(w), R.push(w);
|
|
1762
1762
|
}, M = (b) => {
|
|
1763
|
-
var
|
|
1764
|
-
const w = (
|
|
1763
|
+
var z, le, ce;
|
|
1764
|
+
const w = (z = this._layerDisplayObjects.get(b.id)) == null ? void 0 : z.displayObject, G = (w == null ? void 0 : w.texture) || (this._isSubjectLayer(b) ? this.originalTexture : null);
|
|
1765
1765
|
if (!G || typeof n.Sprite != "function") return !1;
|
|
1766
|
-
const
|
|
1767
|
-
return
|
|
1766
|
+
const O = new n.Sprite(G);
|
|
1767
|
+
return O.__sourceWidth = Number(((le = b.source) == null ? void 0 : le.originalWidth) || (w == null ? void 0 : w.__sourceWidth) || G.width || o), O.__sourceHeight = Number(((ce = b.source) == null ? void 0 : ce.originalHeight) || (w == null ? void 0 : w.__sourceHeight) || G.height || l), this._fitDisplayObjectToRect(O, b, { x, y: x, width: o, height: l }), O.alpha = this._layerOpacity(b), !m && this._isSubjectLayer(b) && g.length > 0 && (O.filters = g, O.filterArea = new n.Rectangle(0, 0, o, l)), this._applyLayerEffects(n, O, b), this._applyLayerFilterInstances(O, b, {
|
|
1768
1768
|
forExport: !0,
|
|
1769
1769
|
previewToNativeScale: u,
|
|
1770
1770
|
sourceWidth: o,
|
|
1771
1771
|
sourceHeight: l
|
|
1772
|
-
}), F.addChild(
|
|
1772
|
+
}), F.addChild(O), R.push(O), !0;
|
|
1773
1773
|
}, L = (b) => {
|
|
1774
|
-
var le, ce,
|
|
1775
|
-
const w = this._backgroundFillForLayer(b), G = this._backgroundColorForLayer(b),
|
|
1776
|
-
let
|
|
1774
|
+
var le, ce, Te;
|
|
1775
|
+
const w = this._backgroundFillForLayer(b), G = this._backgroundColorForLayer(b), O = { x, y: x, width: o, height: l };
|
|
1776
|
+
let z = null;
|
|
1777
1777
|
if (G && typeof n.Graphics == "function")
|
|
1778
|
-
|
|
1778
|
+
z = new n.Graphics(), z.rect(x, x, o, l).fill(G);
|
|
1779
1779
|
else if ((w == null ? void 0 : w.kind) === "gradient" && typeof n.Sprite == "function") {
|
|
1780
1780
|
const $ = this._createGradientTexture(n, w, o, l);
|
|
1781
1781
|
if (!$) return !1;
|
|
1782
|
-
|
|
1782
|
+
z = new n.Sprite($), z.__ownsTexture = !0, z.__sourceWidth = o, z.__sourceHeight = l, this._fitDisplayObjectToRect(z, b, O);
|
|
1783
1783
|
} else if ((w == null ? void 0 : w.kind) === "media") {
|
|
1784
1784
|
const $ = (le = this._layerDisplayObjects.get(b.id)) == null ? void 0 : le.displayObject, ge = $ == null ? void 0 : $.texture;
|
|
1785
1785
|
if (!ge) return !1;
|
|
1786
|
-
|
|
1786
|
+
z = this._createBackgroundSprite(n, ge, w.fit), z.__sourceWidth = Number(((ce = w.source) == null ? void 0 : ce.originalWidth) || $.__sourceWidth || ge.width || 1), z.__sourceHeight = Number(((Te = w.source) == null ? void 0 : Te.originalHeight) || $.__sourceHeight || ge.height || 1), this._fitDisplayObjectToRect(z, b, O);
|
|
1787
1787
|
}
|
|
1788
|
-
return
|
|
1788
|
+
return z ? (z.alpha = this._layerOpacity(b), this._applyLayerEffects(n, z, b), this._applyLayerFilterInstances(z, b, {
|
|
1789
1789
|
forExport: !0,
|
|
1790
1790
|
previewToNativeScale: u,
|
|
1791
1791
|
sourceWidth: o,
|
|
1792
1792
|
sourceHeight: l
|
|
1793
|
-
}), F.addChild(
|
|
1793
|
+
}), F.addChild(z), R.push(z), !0) : !1;
|
|
1794
1794
|
}, X = (b) => {
|
|
1795
1795
|
const w = this._createTextDisplayObjectForLayer(n, b);
|
|
1796
|
-
return w ? (this._fitTextDisplayObjectToRect(w, b, { x, y: x, width: o, height: l }), w.alpha = this._layerOpacity(b), F.addChild(w),
|
|
1796
|
+
return w ? (this._fitTextDisplayObjectToRect(w, b, { x, y: x, width: o, height: l }), w.alpha = this._layerOpacity(b), F.addChild(w), R.push(w), !0) : !1;
|
|
1797
1797
|
}, ee = p, ne = m;
|
|
1798
1798
|
if (ne) {
|
|
1799
1799
|
for (const b of ee.layers)
|
|
@@ -1817,7 +1817,7 @@ class ut extends de {
|
|
|
1817
1817
|
!ne && ((pe = F.children) == null ? void 0 : pe.length) === 0 && V();
|
|
1818
1818
|
const oe = n.RenderTexture.create({
|
|
1819
1819
|
width: S,
|
|
1820
|
-
height:
|
|
1820
|
+
height: T,
|
|
1821
1821
|
resolution: 1
|
|
1822
1822
|
}), we = ((fe = F.children) == null ? void 0 : fe.length) ?? 0;
|
|
1823
1823
|
try {
|
|
@@ -1827,37 +1827,37 @@ class ut extends de {
|
|
|
1827
1827
|
clear: !0,
|
|
1828
1828
|
clearColor: [0, 0, 0, 0]
|
|
1829
1829
|
});
|
|
1830
|
-
const b = (me = (
|
|
1831
|
-
return b ? { canvas: b, width: S, height:
|
|
1830
|
+
const b = (me = (D = this.app.renderer.extract) == null ? void 0 : D.canvas) == null ? void 0 : me.call(D, oe);
|
|
1831
|
+
return b ? { canvas: b, width: S, height: T, margin: x, childCount: we } : null;
|
|
1832
1832
|
} finally {
|
|
1833
|
-
for (const b of
|
|
1833
|
+
for (const b of R)
|
|
1834
1834
|
b.filters = null;
|
|
1835
1835
|
F.removeChildren();
|
|
1836
|
-
for (const b of
|
|
1836
|
+
for (const b of R) {
|
|
1837
1837
|
const w = (b == null ? void 0 : b.__ownsTexture) === !0;
|
|
1838
1838
|
b.destroy({ children: !1, texture: w, textureSource: w });
|
|
1839
1839
|
}
|
|
1840
1840
|
F.destroy({ children: !1 }), oe.destroy(!0);
|
|
1841
1841
|
}
|
|
1842
|
-
}, A = (x, S,
|
|
1842
|
+
}, A = (x, S, T) => {
|
|
1843
1843
|
const F = typeof x.getContext == "function" ? x.getContext("2d") : null;
|
|
1844
1844
|
if (!F) return null;
|
|
1845
|
-
let
|
|
1845
|
+
let R;
|
|
1846
1846
|
try {
|
|
1847
|
-
|
|
1847
|
+
R = F.getImageData(0, 0, S, T).data;
|
|
1848
1848
|
} catch {
|
|
1849
1849
|
return null;
|
|
1850
1850
|
}
|
|
1851
1851
|
const V = 1;
|
|
1852
|
-
let M = S, L =
|
|
1852
|
+
let M = S, L = T, X = -1, ee = -1;
|
|
1853
1853
|
const ne = 4, oe = S * ne;
|
|
1854
|
-
for (let
|
|
1855
|
-
const me =
|
|
1854
|
+
for (let D = 0; D < T; D++) {
|
|
1855
|
+
const me = D * oe;
|
|
1856
1856
|
for (let b = 0; b < S; b++)
|
|
1857
|
-
|
|
1857
|
+
R[me + b * ne + 3] >= V && (b < M && (M = b), b > X && (X = b), D < L && (L = D), D > ee && (ee = D));
|
|
1858
1858
|
}
|
|
1859
1859
|
if (X < 0) return null;
|
|
1860
|
-
const we = X - M + 1, pe = ee - L + 1, fe = M === 0 || L === 0 || X === S - 1 || ee ===
|
|
1860
|
+
const we = X - M + 1, pe = ee - L + 1, fe = M === 0 || L === 0 || X === S - 1 || ee === T - 1;
|
|
1861
1861
|
return { x: M, y: L, width: we, height: pe, touchesEdge: fe };
|
|
1862
1862
|
};
|
|
1863
1863
|
let P = null;
|
|
@@ -1884,19 +1884,19 @@ class ut extends de {
|
|
|
1884
1884
|
X && !X.touchesEdge ? (x = L, S = X) : (x = L, S = X ?? S);
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
|
-
let
|
|
1887
|
+
let T = S.width, F = S.height;
|
|
1888
1888
|
if (r > 0) {
|
|
1889
|
-
const M = Math.max(
|
|
1889
|
+
const M = Math.max(T, F);
|
|
1890
1890
|
let L = r / M;
|
|
1891
|
-
i && (L = Math.min(1, L)),
|
|
1891
|
+
i && (L = Math.min(1, L)), T = Math.max(1, Math.round(T * L)), F = Math.max(1, Math.round(F * L));
|
|
1892
1892
|
}
|
|
1893
|
-
if (s > 0 &&
|
|
1894
|
-
const M = Math.sqrt(s / (
|
|
1895
|
-
|
|
1893
|
+
if (s > 0 && T * F > s) {
|
|
1894
|
+
const M = Math.sqrt(s / (T * F));
|
|
1895
|
+
T = Math.max(1, Math.floor(T * M)), F = Math.max(1, Math.floor(F * M));
|
|
1896
1896
|
}
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1899
|
-
const V =
|
|
1897
|
+
const R = document.createElement("canvas");
|
|
1898
|
+
R.width = T, R.height = F;
|
|
1899
|
+
const V = R.getContext("2d");
|
|
1900
1900
|
return V ? (V.drawImage(
|
|
1901
1901
|
x.canvas,
|
|
1902
1902
|
S.x,
|
|
@@ -1905,9 +1905,9 @@ class ut extends de {
|
|
|
1905
1905
|
S.height,
|
|
1906
1906
|
0,
|
|
1907
1907
|
0,
|
|
1908
|
-
|
|
1908
|
+
T,
|
|
1909
1909
|
F
|
|
1910
|
-
), P =
|
|
1910
|
+
), P = R.toDataURL(`image/${e}`, t), this._lastExportDimensions = { width: T, height: F }, P || null) : null;
|
|
1911
1911
|
} catch {
|
|
1912
1912
|
return null;
|
|
1913
1913
|
}
|
|
@@ -2011,79 +2011,79 @@ class ut extends de {
|
|
|
2011
2011
|
this.sprite = null, this.originalTexture = null, this.baseTexture = null, this._container = null, this.removeAllListeners();
|
|
2012
2012
|
}
|
|
2013
2013
|
}
|
|
2014
|
-
const $e = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M328 112L184 256l144 144"/></svg>', Ge = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M184 112l144 144-144 144"/></svg>', pt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M221.09 64a157.09 157.09 0 10157.09 157.09A157.1 157.1 0 00221.09 64z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M338.29 338.29L448 448M256 184v74m-37-37h74"/></svg>', ft = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M221.09 64a157.09 157.09 0 10157.09 157.09A157.1 157.1 0 00221.09 64z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M338.29 338.29L448 448M184 221h74"/></svg>', mt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M432 320v112H320M80 192V80h112M320 80h112v112M192 432H80V320"/></svg>', gt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M262.29 192.31a64 64 0 1057.4 57.4 64.13 64.13 0 00-57.4-57.4z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M416.39 256a154.34 154.34 0 01-1.53 20.79l45.21 35.46a10.81 10.81 0 012.45 13.75l-42.77 74a10.81 10.81 0 01-13.14 4.59l-44.9-18.08a16.11 16.11 0 00-15.17 1.75A164.48 164.48 0 01325 400.8a15.94 15.94 0 00-8.82 12.14l-6.73 47.89a11.08 11.08 0 01-10.68 9.17h-85.54a11.11 11.11 0 01-10.69-8.87l-6.72-47.82a16.07 16.07 0 00-9-12.22 155.3 155.3 0 01-21.46-12.57 16 16 0 00-15.11-1.71l-44.89 18.07a10.81 10.81 0 01-13.14-4.58l-42.77-74a10.8 10.8 0 012.45-13.75l38.21-30a16.05 16.05 0 006-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 00-6.07-13.94l-38.19-30A10.81 10.81 0 0149.48 186l42.77-74a10.81 10.81 0 0113.14-4.59l44.9 18.08a16.11 16.11 0 0015.17-1.75A164.48 164.48 0 01187 111.2a15.94 15.94 0 008.82-12.14l6.73-47.89A11.08 11.08 0 01213.23 42h85.54a11.11 11.11 0 0110.69 8.87l6.72 47.82a16.07 16.07 0 009 12.22 155.3 155.3 0 0121.46 12.57 16 16 0 0015.11 1.71l44.89-18.07a10.81 10.81 0 0113.14 4.58l42.77 74a10.8 10.8 0 01-2.45 13.75l-38.21 30a16.05 16.05 0 00-6.05 14.08c.33 4.14.55 8.3.55 12.47z"/></svg>', bt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M400 320c0 88.37-55.63 144-144 144s-144-55.63-144-144c0-94.83 103.23-222.85 134.89-259.88a12 12 0 0118.23 0C296.77 97.15 400 225.17 400 320z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M344 328a72 72 0 01-72 72"/></svg>', _t = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32" d="M430.11 347.9c-6.6-6.1-16.3-7.6-24.6-9-11.5-1.9-15.9-4-22.6-10-14.3-12.7-14.3-31.1 0-43.8l30.3-26.9c46.4-41 46.4-108.2 0-149.2-34.2-30.1-80.1-45-127.8-45-55.7 0-113.9 20.3-158.8 60.1-83.5 73.8-83.5 194.7 0 268.5 41.5 36.7 97.5 55 152.9 55.4h1.7c55.4 0 110-17.9 148.8-52.4 14.4-12.7 11.99-36.6.1-47.7z"/><circle cx="144" cy="208" r="32"/><circle cx="152" cy="311" r="32"/><circle cx="224" cy="144" r="32"/><circle cx="256" cy="367" r="32"/><circle cx="328" cy="144" r="32"/></svg>', yt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M259.92 262.91L216.4 149.77a9 9 0 00-16.8 0l-43.52 113.14a9 9 0 01-5.17 5.17L37.77 311.6a9 9 0 000 16.8l113.14 43.52a9 9 0 015.17 5.17l43.52 113.14a9 9 0 0016.8 0l43.52-113.14a9 9 0 015.17-5.17l113.14-43.52a9 9 0 000-16.8l-113.14-43.52a9 9 0 01-5.17-5.17zM108 68L88 16 68 68 16 88l52 20 20 52 20-52 52-20-52-20zM426.67 117.33L400 48l-26.67 69.33L304 144l69.33 26.67L400 240l26.67-69.33L496 144l-69.33-26.67z"/></svg>', xt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M176 112l80-80 80 80M255.98 32l.02 448M176 400l80 80 80-80M400 176l80 80-80 80M112 176l-80 80 80 80M32 256h448"/></svg>', wt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M452.37 59.63h0a40.49 40.49 0 00-57.26 0L184 294.74c23.08 4.7 46.12 27.29 49.26 49.26l219.11-227.11a40.49 40.49 0 000-57.26z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M138 336c-29.88 0-54 24.5-54 54.86 0 23.95-20.67 36.57-34 44.78 15.08 8.08 32.23 12.36 50 12.36 48.49 0 88-38.89 88-88 0-30.36-24.12-54-50-54z"/></svg>', vt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M315.27 33L96 304h128l-31.51 173.23a2.36 2.36 0 002.33 2.77h0a2.36 2.36 0 001.89-.95L416 208H288l31.66-173.25a2.45 2.45 0 00-2.44-2.75h0a2.42 2.42 0 00-1.95 1z"/></svg>', Ze = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M144 48v272a48 48 0 0048 48h272"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 464V192a48 48 0 00-48-48H48"/></svg>', Ct = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M380.93 57.37A32 32 0 00358.3 48H94.22A46.21 46.21 0 0048 94.22v323.56A46.21 46.21 0 0094.22 464h323.56A46.36 46.36 0 00464 417.78V153.7a32 32 0 00-9.37-22.63zM256 416a64 64 0 1164-64 63.92 63.92 0 01-64 64zm48-224H112a16 16 0 01-16-16v-64a16 16 0 0116-16h192a16 16 0 0116 16v64a16 16 0 01-16 16z"/></svg>', Ae = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 368L144 144M368 144L144 368"/></svg>', Ke = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 146s24.36-12-64-12a160 160 0 10160 160"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 58l80 80-80 80"/></svg>', kt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M176 112l-64 64 64 64"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M112 176h176a112 112 0 110 224H160"/></svg>', St = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M336 112l64 64-64 64"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M400 176H224a112 112 0 100 224h128"/></svg>', Ft = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M80 112h352"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M192 112V72h0a23.93 23.93 0 0124-24h80a23.93 23.93 0 0124 24h0v40M256 176v224M184 176l8 224M328 176l-8 224"/></svg>', Mt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M64 192v-72a40 40 0 0140-40h75.89a40 40 0 0122.19 6.72l27.84 18.56a40 40 0 0022.19 6.72H408a40 40 0 0140 40v40"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M479.9 226.55L463.68 392a40 40 0 01-39.93 40H88.25a40 40 0 01-39.93-40L32.1 226.55A32 32 0 0164 192h384.1a32 32 0 0131.8 34.55z"/></svg>', Me = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M416 128L192 384l-96-96"/></svg>', Pt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 256l208 112 208-112-208-112L48 256z"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 336l208 112 208-112M48 176L256 64l208 112"/></svg>', Kr = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 256s80-144 208-144 208 144 208 144-80 144-208 144S48 256 48 256z"/><circle cx="256" cy="256" r="64" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/></svg>', Jr = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M432 448L80 64M160 160c-67.2 36.8-112 96-112 96s80 144 208 144c35.8 0 68.4-11.3 96-28.1M224.4 113.8A199.6 199.6 0 01256 112c128 0 208 144 208 144a334.2 334.2 0 01-65.1 78.6"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M213.3 213.3A64 64 0 10298.7 298.7"/></svg>', Qr = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="96" y="208" width="320" height="240" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 208v-64a96 96 0 01192 0v64"/></svg>', ei = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="96" y="208" width="320" height="240" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 208v-64a96 96 0 01168-63.7"/></svg>', ti = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M96 352l-32 96 96-32L421.5 154.5a45.3 45.3 0 000-64h0a45.3 45.3 0 00-64 0L96 352z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 128l64 64"/></svg>', ri = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="144" y="144" width="288" height="288" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M80 368V112a32 32 0 0132-32h256"/></svg>', At = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M96 112V80h320v32M256 80v352M184 432h144"/></svg>', Nt = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="64" y="64" width="384" height="384" rx="48" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/></svg>', zt = '<svg viewBox="0 0 512 512" width="20" height="20"><circle cx="256" cy="256" r="208" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg>', Tt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M80 96h64l64 320h64l64-160h96"/></svg>', Le = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M256 48v48M256 416v48M403.08 108.92l-33.94 33.94M142.86 369.14l-33.94 33.94M464 256h-48M96 256H48M403.08 403.08l-33.94-33.94M142.86 142.86l-33.94-33.94"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32"/></svg>', Re = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 136c0-30.62 4.51-61.61 16-88C99.57 81.27 48 159.32 48 248c0 119.29 96.71 216 216 216 88.68 0 166.73-51.57 200-128-26.39 11.49-57.38 16-88 16-119.29 0-216-96.71-216-216z"/></svg>', Lt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M436 80H76a44.05 44.05 0 00-44 44v264a44.05 44.05 0 0044 44h360a44.05 44.05 0 0044-44V124a44.05 44.05 0 00-44-44z"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M220 80v56M292 80v56M220 376v56M292 376v56M80 144h56M80 224h56M80 304h56M376 144h56M376 224h56M376 304h56"/></svg>', Rt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M344 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z"/><path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32" d="M256 304c-87 0-175.3 48-191.64 138.6C62.39 453.52 68.57 464 80 464h352c11.44 0 17.62-10.48 15.65-21.4C431.3 352 343 304 256 304z"/></svg>', Ne = [
|
|
2014
|
+
const $e = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M328 112L184 256l144 144"/></svg>', Ge = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M184 112l144 144-144 144"/></svg>', $r = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M221.09 64a157.09 157.09 0 10157.09 157.09A157.1 157.1 0 00221.09 64z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M338.29 338.29L448 448M256 184v74m-37-37h74"/></svg>', Gr = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M221.09 64a157.09 157.09 0 10157.09 157.09A157.1 157.1 0 00221.09 64z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M338.29 338.29L448 448M184 221h74"/></svg>', Zr = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M432 320v112H320M80 192V80h112M320 80h112v112M192 432H80V320"/></svg>', pt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M262.29 192.31a64 64 0 1057.4 57.4 64.13 64.13 0 00-57.4-57.4z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M416.39 256a154.34 154.34 0 01-1.53 20.79l45.21 35.46a10.81 10.81 0 012.45 13.75l-42.77 74a10.81 10.81 0 01-13.14 4.59l-44.9-18.08a16.11 16.11 0 00-15.17 1.75A164.48 164.48 0 01325 400.8a15.94 15.94 0 00-8.82 12.14l-6.73 47.89a11.08 11.08 0 01-10.68 9.17h-85.54a11.11 11.11 0 01-10.69-8.87l-6.72-47.82a16.07 16.07 0 00-9-12.22 155.3 155.3 0 01-21.46-12.57 16 16 0 00-15.11-1.71l-44.89 18.07a10.81 10.81 0 01-13.14-4.58l-42.77-74a10.8 10.8 0 012.45-13.75l38.21-30a16.05 16.05 0 006-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 00-6.07-13.94l-38.19-30A10.81 10.81 0 0149.48 186l42.77-74a10.81 10.81 0 0113.14-4.59l44.9 18.08a16.11 16.11 0 0015.17-1.75A164.48 164.48 0 01187 111.2a15.94 15.94 0 008.82-12.14l6.73-47.89A11.08 11.08 0 01213.23 42h85.54a11.11 11.11 0 0110.69 8.87l6.72 47.82a16.07 16.07 0 009 12.22 155.3 155.3 0 0121.46 12.57 16 16 0 0015.11 1.71l44.89-18.07a10.81 10.81 0 0113.14 4.58l42.77 74a10.8 10.8 0 01-2.45 13.75l-38.21 30a16.05 16.05 0 00-6.05 14.08c.33 4.14.55 8.3.55 12.47z"/></svg>', ft = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M400 320c0 88.37-55.63 144-144 144s-144-55.63-144-144c0-94.83 103.23-222.85 134.89-259.88a12 12 0 0118.23 0C296.77 97.15 400 225.17 400 320z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M344 328a72 72 0 01-72 72"/></svg>', mt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32" d="M430.11 347.9c-6.6-6.1-16.3-7.6-24.6-9-11.5-1.9-15.9-4-22.6-10-14.3-12.7-14.3-31.1 0-43.8l30.3-26.9c46.4-41 46.4-108.2 0-149.2-34.2-30.1-80.1-45-127.8-45-55.7 0-113.9 20.3-158.8 60.1-83.5 73.8-83.5 194.7 0 268.5 41.5 36.7 97.5 55 152.9 55.4h1.7c55.4 0 110-17.9 148.8-52.4 14.4-12.7 11.99-36.6.1-47.7z"/><circle cx="144" cy="208" r="32"/><circle cx="152" cy="311" r="32"/><circle cx="224" cy="144" r="32"/><circle cx="256" cy="367" r="32"/><circle cx="328" cy="144" r="32"/></svg>', gt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M259.92 262.91L216.4 149.77a9 9 0 00-16.8 0l-43.52 113.14a9 9 0 01-5.17 5.17L37.77 311.6a9 9 0 000 16.8l113.14 43.52a9 9 0 015.17 5.17l43.52 113.14a9 9 0 0016.8 0l43.52-113.14a9 9 0 015.17-5.17l113.14-43.52a9 9 0 000-16.8l-113.14-43.52a9 9 0 01-5.17-5.17zM108 68L88 16 68 68 16 88l52 20 20 52 20-52 52-20-52-20zM426.67 117.33L400 48l-26.67 69.33L304 144l69.33 26.67L400 240l26.67-69.33L496 144l-69.33-26.67z"/></svg>', bt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M176 112l80-80 80 80M255.98 32l.02 448M176 400l80 80 80-80M400 176l80 80-80 80M112 176l-80 80 80 80M32 256h448"/></svg>', yt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M452.37 59.63h0a40.49 40.49 0 00-57.26 0L184 294.74c23.08 4.7 46.12 27.29 49.26 49.26l219.11-227.11a40.49 40.49 0 000-57.26z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M138 336c-29.88 0-54 24.5-54 54.86 0 23.95-20.67 36.57-34 44.78 15.08 8.08 32.23 12.36 50 12.36 48.49 0 88-38.89 88-88 0-30.36-24.12-54-50-54z"/></svg>', _t = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M315.27 33L96 304h128l-31.51 173.23a2.36 2.36 0 002.33 2.77h0a2.36 2.36 0 001.89-.95L416 208H288l31.66-173.25a2.45 2.45 0 00-2.44-2.75h0a2.42 2.42 0 00-1.95 1z"/></svg>', Ze = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M144 48v272a48 48 0 0048 48h272"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 464V192a48 48 0 00-48-48H48"/></svg>', xt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M380.93 57.37A32 32 0 00358.3 48H94.22A46.21 46.21 0 0048 94.22v323.56A46.21 46.21 0 0094.22 464h323.56A46.36 46.36 0 00464 417.78V153.7a32 32 0 00-9.37-22.63zM256 416a64 64 0 1164-64 63.92 63.92 0 01-64 64zm48-224H112a16 16 0 01-16-16v-64a16 16 0 0116-16h192a16 16 0 0116 16v64a16 16 0 01-16 16z"/></svg>', Ae = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 368L144 144M368 144L144 368"/></svg>', Ke = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 146s24.36-12-64-12a160 160 0 10160 160"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 58l80 80-80 80"/></svg>', wt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M176 112l-64 64 64 64"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M112 176h176a112 112 0 110 224H160"/></svg>', vt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M336 112l64 64-64 64"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M400 176H224a112 112 0 100 224h128"/></svg>', Ct = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M80 112h352"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M192 112V72h0a23.93 23.93 0 0124-24h80a23.93 23.93 0 0124 24h0v40M256 176v224M184 176l8 224M328 176l-8 224"/></svg>', kt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M64 192v-72a40 40 0 0140-40h75.89a40 40 0 0122.19 6.72l27.84 18.56a40 40 0 0022.19 6.72H408a40 40 0 0140 40v40"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M479.9 226.55L463.68 392a40 40 0 01-39.93 40H88.25a40 40 0 01-39.93-40L32.1 226.55A32 32 0 0164 192h384.1a32 32 0 0131.8 34.55z"/></svg>', Me = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M416 128L192 384l-96-96"/></svg>', St = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 256l208 112 208-112-208-112L48 256z"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 336l208 112 208-112M48 176L256 64l208 112"/></svg>', Kr = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 256s80-144 208-144 208 144 208 144-80 144-208 144S48 256 48 256z"/><circle cx="256" cy="256" r="64" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/></svg>', Jr = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M432 448L80 64M160 160c-67.2 36.8-112 96-112 96s80 144 208 144c35.8 0 68.4-11.3 96-28.1M224.4 113.8A199.6 199.6 0 01256 112c128 0 208 144 208 144a334.2 334.2 0 01-65.1 78.6"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M213.3 213.3A64 64 0 10298.7 298.7"/></svg>', Qr = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="96" y="208" width="320" height="240" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 208v-64a96 96 0 01192 0v64"/></svg>', ei = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="96" y="208" width="320" height="240" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 208v-64a96 96 0 01168-63.7"/></svg>', ti = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M96 352l-32 96 96-32L421.5 154.5a45.3 45.3 0 000-64h0a45.3 45.3 0 00-64 0L96 352z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 128l64 64"/></svg>', ri = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="144" y="144" width="288" height="288" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M80 368V112a32 32 0 0132-32h256"/></svg>', Ft = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M96 112V80h320v32M256 80v352M184 432h144"/></svg>', Mt = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="64" y="64" width="384" height="384" rx="48" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/></svg>', Pt = '<svg viewBox="0 0 512 512" width="20" height="20"><circle cx="256" cy="256" r="208" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg>', At = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M80 96h64l64 320h64l64-160h96"/></svg>', Le = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M256 48v48M256 416v48M403.08 108.92l-33.94 33.94M142.86 369.14l-33.94 33.94M464 256h-48M96 256H48M403.08 403.08l-33.94-33.94M142.86 142.86l-33.94-33.94"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32"/></svg>', Re = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 136c0-30.62 4.51-61.61 16-88C99.57 81.27 48 159.32 48 248c0 119.29 96.71 216 216 216 88.68 0 166.73-51.57 200-128-26.39 11.49-57.38 16-88 16-119.29 0-216-96.71-216-216z"/></svg>', Nt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M436 80H76a44.05 44.05 0 00-44 44v264a44.05 44.05 0 0044 44h360a44.05 44.05 0 0044-44V124a44.05 44.05 0 00-44-44z"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M220 80v56M292 80v56M220 376v56M292 376v56M80 144h56M80 224h56M80 304h56M376 144h56M376 224h56M376 304h56"/></svg>', Tt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M344 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z"/><path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32" d="M256 304c-87 0-175.3 48-191.64 138.6C62.39 453.52 68.57 464 80 464h352c11.44 0 17.62-10.48 15.65-21.4C431.3 352 343 304 256 304z"/></svg>', Ne = [
|
|
2015
2015
|
{
|
|
2016
2016
|
id: "adjust",
|
|
2017
2017
|
name: "Adjust",
|
|
2018
|
-
icon:
|
|
2018
|
+
icon: pt,
|
|
2019
2019
|
registryCategories: ["adjust", "advanced"]
|
|
2020
2020
|
// adjustment, adjustmentAdvanced, alpha, colorMatrix
|
|
2021
2021
|
},
|
|
2022
2022
|
{
|
|
2023
2023
|
id: "blur",
|
|
2024
2024
|
name: "Blur",
|
|
2025
|
-
icon:
|
|
2025
|
+
icon: ft,
|
|
2026
2026
|
registryCategories: ["blur"]
|
|
2027
2027
|
},
|
|
2028
2028
|
{
|
|
2029
2029
|
id: "color",
|
|
2030
2030
|
name: "Color",
|
|
2031
|
-
icon:
|
|
2031
|
+
icon: mt,
|
|
2032
2032
|
registryCategories: ["color"]
|
|
2033
2033
|
},
|
|
2034
2034
|
{
|
|
2035
2035
|
id: "effects",
|
|
2036
2036
|
name: "Effects",
|
|
2037
|
-
icon:
|
|
2037
|
+
icon: gt,
|
|
2038
2038
|
registryCategories: ["effects"]
|
|
2039
2039
|
},
|
|
2040
2040
|
{
|
|
2041
2041
|
id: "distortion",
|
|
2042
2042
|
name: "Distortion",
|
|
2043
|
-
icon:
|
|
2043
|
+
icon: bt,
|
|
2044
2044
|
registryCategories: ["distortion"]
|
|
2045
2045
|
},
|
|
2046
2046
|
{
|
|
2047
2047
|
id: "light",
|
|
2048
2048
|
name: "Light",
|
|
2049
|
-
icon:
|
|
2049
|
+
icon: _t,
|
|
2050
2050
|
registryCategories: ["light"]
|
|
2051
2051
|
},
|
|
2052
2052
|
{
|
|
2053
2053
|
id: "stylize",
|
|
2054
2054
|
name: "Stylize",
|
|
2055
|
-
icon:
|
|
2055
|
+
icon: Nt,
|
|
2056
2056
|
registryCategories: ["stylize"]
|
|
2057
2057
|
},
|
|
2058
2058
|
{
|
|
2059
2059
|
id: "text",
|
|
2060
2060
|
name: "Text",
|
|
2061
|
-
icon:
|
|
2061
|
+
icon: Ft
|
|
2062
2062
|
},
|
|
2063
2063
|
{
|
|
2064
2064
|
id: "background",
|
|
2065
2065
|
name: "Background",
|
|
2066
|
-
icon:
|
|
2066
|
+
icon: yt
|
|
2067
2067
|
},
|
|
2068
2068
|
{
|
|
2069
2069
|
id: "layers",
|
|
2070
2070
|
name: "Layers",
|
|
2071
|
-
icon:
|
|
2071
|
+
icon: St
|
|
2072
2072
|
},
|
|
2073
2073
|
{
|
|
2074
2074
|
id: "crop",
|
|
2075
2075
|
name: "Crop",
|
|
2076
2076
|
icon: Ze
|
|
2077
2077
|
}
|
|
2078
|
-
],
|
|
2078
|
+
], zt = Object.fromEntries(
|
|
2079
2079
|
Ne.filter((a) => Array.isArray(a.registryCategories) && a.registryCategories.length > 0).map((a) => [a.id, a.registryCategories])
|
|
2080
|
-
),
|
|
2080
|
+
), Lt = Object.fromEntries(
|
|
2081
2081
|
Ne.filter((a) => Array.isArray(a.registryCategories)).flatMap((a) => a.registryCategories.map((e) => [e, a.id]))
|
|
2082
2082
|
);
|
|
2083
|
-
function
|
|
2084
|
-
return
|
|
2083
|
+
function Rt(a) {
|
|
2084
|
+
return zt[a] || [a];
|
|
2085
2085
|
}
|
|
2086
|
-
class
|
|
2086
|
+
class Bt extends de {
|
|
2087
2087
|
constructor(e, t) {
|
|
2088
2088
|
super(), this.state = e, this.renderer = t, this.instances = {}, this._filterRegistry = null;
|
|
2089
2089
|
}
|
|
@@ -2119,7 +2119,7 @@ class Dt extends de {
|
|
|
2119
2119
|
*/
|
|
2120
2120
|
getFiltersByCategory(e) {
|
|
2121
2121
|
if (!this._filterRegistry) return [];
|
|
2122
|
-
const t =
|
|
2122
|
+
const t = Rt(e), r = [], i = /* @__PURE__ */ new Set();
|
|
2123
2123
|
for (const s of t) {
|
|
2124
2124
|
const n = this._filterRegistry.getFiltersByCategory(s) || [];
|
|
2125
2125
|
for (const o of n)
|
|
@@ -2358,17 +2358,17 @@ class Dt extends de {
|
|
|
2358
2358
|
const m = this.getFilterDef(p);
|
|
2359
2359
|
if (!m || !m.createFilter || typeof m.createFilter != "function")
|
|
2360
2360
|
return;
|
|
2361
|
-
const g = this.state.getFilterValues(p),
|
|
2361
|
+
const g = this.state.getFilterValues(p), y = m.defaultParams ? { ...m.defaultParams } : {};
|
|
2362
2362
|
m.controls && Array.isArray(m.controls) && m.controls.forEach((N) => {
|
|
2363
2363
|
const ue = N.property || N.id;
|
|
2364
|
-
|
|
2364
|
+
y[ue] = g[N.id] ?? N.default;
|
|
2365
2365
|
});
|
|
2366
2366
|
const C = new Set((m.controls || []).map((N) => N.id));
|
|
2367
2367
|
for (const [N, ue] of Object.entries(g))
|
|
2368
|
-
C.has(N) || (
|
|
2368
|
+
C.has(N) || (y[N] = ue);
|
|
2369
2369
|
const k = this.renderer.sprite, A = this.renderer.originalTexture;
|
|
2370
|
-
|
|
2371
|
-
const P = m.createFilter(
|
|
2370
|
+
y._sourceWidth = Math.round((A == null ? void 0 : A.width) || (k == null ? void 0 : k.width) || 0), y._sourceHeight = Math.round((A == null ? void 0 : A.height) || (k == null ? void 0 : k.height) || 0);
|
|
2371
|
+
const P = m.createFilter(y);
|
|
2372
2372
|
P && (r.push(P), this.instances[p] = P);
|
|
2373
2373
|
} catch {
|
|
2374
2374
|
i.push(p);
|
|
@@ -2533,8 +2533,8 @@ const J = class J extends de {
|
|
|
2533
2533
|
if (!l) return;
|
|
2534
2534
|
const c = this.state.get("crop.shape");
|
|
2535
2535
|
if (o.save(), c === "circle") {
|
|
2536
|
-
const
|
|
2537
|
-
o.beginPath(), o.arc(
|
|
2536
|
+
const y = l.x + l.width / 2, C = l.y + l.height / 2, k = Math.min(l.width, l.height) / 2;
|
|
2537
|
+
o.beginPath(), o.arc(y, C, k, 0, Math.PI * 2), o.clip();
|
|
2538
2538
|
} else
|
|
2539
2539
|
o.beginPath(), o.rect(l.x, l.y, l.width, l.height), o.clip();
|
|
2540
2540
|
o.clearRect(l.x, l.y, l.width, l.height), o.restore(), o.strokeStyle = "#ffffff", o.lineWidth = 2, o.setLineDash([5, 5]), c === "circle" ? (o.beginPath(), o.arc(
|
|
@@ -2545,8 +2545,8 @@ const J = class J extends de {
|
|
|
2545
2545
|
Math.PI * 2
|
|
2546
2546
|
), o.stroke()) : o.strokeRect(l.x, l.y, l.width, l.height), o.setLineDash([]), o.strokeStyle = "rgba(255,255,255,0.3)", o.lineWidth = 1;
|
|
2547
2547
|
const d = l.width / 3, h = l.height / 3;
|
|
2548
|
-
for (let
|
|
2549
|
-
o.beginPath(), o.moveTo(l.x + d *
|
|
2548
|
+
for (let y = 1; y <= 2; y++)
|
|
2549
|
+
o.beginPath(), o.moveTo(l.x + d * y, l.y), o.lineTo(l.x + d * y, l.y + l.height), o.stroke(), o.beginPath(), o.moveTo(l.x, l.y + h * y), o.lineTo(l.x + l.width, l.y + h * y), o.stroke();
|
|
2550
2550
|
const u = this.HANDLE_SIZE, p = [
|
|
2551
2551
|
{ x: l.x, y: l.y, m: "resize-nw" },
|
|
2552
2552
|
{ x: l.x + l.width, y: l.y, m: "resize-ne" },
|
|
@@ -2558,9 +2558,9 @@ const J = class J extends de {
|
|
|
2558
2558
|
{ x: l.x, y: l.y + l.height / 2, m: "w" },
|
|
2559
2559
|
{ x: l.x + l.width, y: l.y + l.height / 2, m: "e" }
|
|
2560
2560
|
], g = [...p, ...m];
|
|
2561
|
-
for (const
|
|
2562
|
-
const C = this._hoverMode ===
|
|
2563
|
-
o.beginPath(), o.rect(
|
|
2561
|
+
for (const y of g) {
|
|
2562
|
+
const C = this._hoverMode === y.m, k = C ? u + 4 : u;
|
|
2563
|
+
o.beginPath(), o.rect(y.x - k / 2, y.y - k / 2, k, k), o.fillStyle = C ? "#4da3ff" : "#ffffff", o.strokeStyle = "rgba(0,0,0,0.6)", o.lineWidth = 1, o.fill(), o.stroke();
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
2566
|
/**
|
|
@@ -2684,14 +2684,14 @@ const J = class J extends de {
|
|
|
2684
2684
|
const s = window.PIXI, n = this.renderer.zoom, o = r.width / t.width, l = r.height / t.height, c = (i.x - t.x) * o, d = (i.y - t.y) * l;
|
|
2685
2685
|
let h = Math.round(Math.max(1, i.width * o)), u = Math.round(Math.max(1, i.height * l)), p = Math.round(c), m = Math.round(d);
|
|
2686
2686
|
if (h <= 0 || u <= 0) return null;
|
|
2687
|
-
const g = new s.Container(),
|
|
2687
|
+
const g = new s.Container(), y = new s.Sprite(r);
|
|
2688
2688
|
if (this.state.get("crop.shape") === "circle") {
|
|
2689
|
-
const F = Math.round(Math.max(h, u)),
|
|
2690
|
-
p = Math.round(
|
|
2689
|
+
const F = Math.round(Math.max(h, u)), R = p + h / 2, V = m + u / 2;
|
|
2690
|
+
p = Math.round(R - F / 2), m = Math.round(V - F / 2), h = u = F;
|
|
2691
2691
|
const M = new s.Graphics();
|
|
2692
|
-
typeof M.circle == "function" && typeof M.fill == "function" ? M.circle(h / 2, u / 2, h / 2).fill(16777215) : (M.beginFill(16777215, 1), M.drawCircle(h / 2, u / 2, h / 2), M.endFill()),
|
|
2692
|
+
typeof M.circle == "function" && typeof M.fill == "function" ? M.circle(h / 2, u / 2, h / 2).fill(16777215) : (M.beginFill(16777215, 1), M.drawCircle(h / 2, u / 2, h / 2), M.endFill()), y.mask = M, g.addChild(M);
|
|
2693
2693
|
}
|
|
2694
|
-
|
|
2694
|
+
y.x = -p, y.y = -m, g.addChild(y);
|
|
2695
2695
|
const k = s.RenderTexture.create({ width: h, height: u });
|
|
2696
2696
|
e.renderer.render({
|
|
2697
2697
|
container: g,
|
|
@@ -2707,8 +2707,8 @@ const J = class J extends de {
|
|
|
2707
2707
|
y: Math.round(N.y + m),
|
|
2708
2708
|
width: h,
|
|
2709
2709
|
height: u
|
|
2710
|
-
} : { x: p, y: m, width: h, height: u }, S = this.state.get("crop.shape") || "free",
|
|
2711
|
-
return this.disable(), this.state.set("crop.appliedRect", x), this.state.set("crop.appliedShape", S), this.state.set("crop.appliedAspect",
|
|
2710
|
+
} : { x: p, y: m, width: h, height: u }, S = this.state.get("crop.shape") || "free", T = this.state.get("crop.aspect") || "free";
|
|
2711
|
+
return this.disable(), this.state.set("crop.appliedRect", x), this.state.set("crop.appliedShape", S), this.state.set("crop.appliedAspect", T), this.state.set("crop.dirty", !1), this.emit("applied", { width: h, height: u }), { texture: k, preservedZoom: n };
|
|
2712
2712
|
}
|
|
2713
2713
|
/**
|
|
2714
2714
|
* Apply a crop from saved texture-pixel coordinates (for state rehydration).
|
|
@@ -2735,8 +2735,8 @@ const J = class J extends de {
|
|
|
2735
2735
|
r.renderer.render({ container: u, target: m, clear: !0 }), u.destroy({ children: !0 });
|
|
2736
2736
|
const g = this.renderer.originalTexture;
|
|
2737
2737
|
g && g !== this.renderer.baseTexture && g.destroy(!0), this.renderer.originalTexture = m, r.stage.removeChild(i), i.destroy();
|
|
2738
|
-
const
|
|
2739
|
-
return r.stage.addChild(
|
|
2738
|
+
const y = new n.Sprite(m);
|
|
2739
|
+
return r.stage.addChild(y), this.renderer.sprite = y, this.renderer.fitScale = this.renderer.getFitScaleFor(m), this.renderer.setZoom(o, { keepCenter: !1 }), this.renderer.applyViewTransform(), this.renderer.render(), { texture: m, preservedZoom: o };
|
|
2740
2740
|
}
|
|
2741
2741
|
/**
|
|
2742
2742
|
* Cancel crop
|
|
@@ -2773,7 +2773,7 @@ ve(J, "AUTO_ZOOM_PADDING", 1.1), /**
|
|
|
2773
2773
|
*/
|
|
2774
2774
|
ve(J, "AUTO_ZOOM_THROTTLE_MS", 100);
|
|
2775
2775
|
let Pe = J;
|
|
2776
|
-
class
|
|
2776
|
+
class Et {
|
|
2777
2777
|
/**
|
|
2778
2778
|
* Create a new RemoveBgManager
|
|
2779
2779
|
* @param {Object} options
|
|
@@ -2873,8 +2873,8 @@ class Ot {
|
|
|
2873
2873
|
if (!c.ok) {
|
|
2874
2874
|
let g = `Background removal failed (HTTP ${c.status})`;
|
|
2875
2875
|
try {
|
|
2876
|
-
const
|
|
2877
|
-
|
|
2876
|
+
const y = await c.text();
|
|
2877
|
+
y && (g += `: ${y}`);
|
|
2878
2878
|
} catch {
|
|
2879
2879
|
}
|
|
2880
2880
|
throw new Error(g);
|
|
@@ -3133,7 +3133,7 @@ function rt({ id: a, label: e, options: t = [], value: r, onChange: i }) {
|
|
|
3133
3133
|
o.value = l;
|
|
3134
3134
|
}, s;
|
|
3135
3135
|
}
|
|
3136
|
-
function
|
|
3136
|
+
function j({ label: a, className: e = "", onClick: t, icon: r = null, disabled: i = !1 }) {
|
|
3137
3137
|
const s = f("button", {
|
|
3138
3138
|
type: "button",
|
|
3139
3139
|
className: `btn ${e}`.trim(),
|
|
@@ -3148,7 +3148,7 @@ function Y({ label: a, className: e = "", onClick: t, icon: r = null, disabled:
|
|
|
3148
3148
|
}
|
|
3149
3149
|
return a && s.appendChild(document.createTextNode(a)), s;
|
|
3150
3150
|
}
|
|
3151
|
-
function
|
|
3151
|
+
function Y({ icon: a, title: e, className: t = "", onClick: r, disabled: i = !1, testId: s = null, ariaLabel: n = null }) {
|
|
3152
3152
|
const o = {
|
|
3153
3153
|
type: "button",
|
|
3154
3154
|
className: `icon-btn ${t}`.trim(),
|
|
@@ -3163,7 +3163,7 @@ function R({ icon: a, title: e, className: t = "", onClick: r, disabled: i = !1,
|
|
|
3163
3163
|
const c = l.querySelector("svg");
|
|
3164
3164
|
return c && c.setAttribute("aria-hidden", "true"), l;
|
|
3165
3165
|
}
|
|
3166
|
-
function
|
|
3166
|
+
function _e({ label: a, icon: e, active: t = !1, onClick: r }) {
|
|
3167
3167
|
const i = f("button", {
|
|
3168
3168
|
type: "button",
|
|
3169
3169
|
className: `chip ${t ? "active" : ""}`.trim(),
|
|
@@ -3179,7 +3179,7 @@ function ye({ label: a, icon: e, active: t = !1, onClick: r }) {
|
|
|
3179
3179
|
i.classList.toggle("active", s);
|
|
3180
3180
|
}, i;
|
|
3181
3181
|
}
|
|
3182
|
-
class
|
|
3182
|
+
class It {
|
|
3183
3183
|
constructor(e, t) {
|
|
3184
3184
|
this.state = e, this.editor = t, this.element = null, this._removeBgBtn = null, this._removeBgTierSelect = null, this._removeBgStatus = null, this._removeBgTier = "balanced", this._unsubscribers = [];
|
|
3185
3185
|
}
|
|
@@ -3189,8 +3189,8 @@ class jt {
|
|
|
3189
3189
|
*/
|
|
3190
3190
|
render() {
|
|
3191
3191
|
this.element = f("div", { className: "editor-toolbar" });
|
|
3192
|
-
const e = f("div", { className: "toolbar-section toolbar-left" }), t =
|
|
3193
|
-
icon:
|
|
3192
|
+
const e = f("div", { className: "toolbar-section toolbar-left" }), t = Y({
|
|
3193
|
+
icon: kt,
|
|
3194
3194
|
title: "Open Image",
|
|
3195
3195
|
className: "toolbar-btn",
|
|
3196
3196
|
testId: "btn-open-image",
|
|
@@ -3198,51 +3198,15 @@ class jt {
|
|
|
3198
3198
|
onClick: () => this.editor.openFilePicker()
|
|
3199
3199
|
});
|
|
3200
3200
|
e.appendChild(t);
|
|
3201
|
-
const r = f("div", { className: "toolbar-section toolbar-
|
|
3202
|
-
|
|
3203
|
-
title: "Zoom Out",
|
|
3204
|
-
className: "toolbar-btn",
|
|
3205
|
-
testId: "btn-zoom-out",
|
|
3206
|
-
ariaLabel: "Zoom out",
|
|
3207
|
-
onClick: () => {
|
|
3208
|
-
const u = this.state.get("zoom");
|
|
3209
|
-
this.editor.setZoom(u - 0.25);
|
|
3210
|
-
}
|
|
3211
|
-
});
|
|
3212
|
-
this._zoomLabel = f("span", {
|
|
3213
|
-
className: "zoom-label",
|
|
3214
|
-
"aria-live": "polite",
|
|
3215
|
-
"aria-atomic": "true",
|
|
3216
|
-
role: "status"
|
|
3217
|
-
}, "100%");
|
|
3218
|
-
const s = R({
|
|
3219
|
-
icon: pt,
|
|
3220
|
-
title: "Zoom In",
|
|
3221
|
-
className: "toolbar-btn",
|
|
3222
|
-
testId: "btn-zoom-in",
|
|
3223
|
-
ariaLabel: "Zoom in",
|
|
3224
|
-
onClick: () => {
|
|
3225
|
-
const u = this.state.get("zoom");
|
|
3226
|
-
this.editor.setZoom(u + 0.25);
|
|
3227
|
-
}
|
|
3228
|
-
}), n = R({
|
|
3229
|
-
icon: mt,
|
|
3230
|
-
title: "Fit to Screen",
|
|
3231
|
-
className: "toolbar-btn",
|
|
3232
|
-
testId: "btn-fit-screen",
|
|
3233
|
-
ariaLabel: "Fit to screen",
|
|
3234
|
-
onClick: () => this.editor.fitToScreen()
|
|
3235
|
-
});
|
|
3236
|
-
r.appendChild(i), r.appendChild(this._zoomLabel), r.appendChild(s), r.appendChild(n);
|
|
3237
|
-
const o = f("div", { className: "toolbar-section toolbar-right" });
|
|
3238
|
-
this._themeBtn = R({
|
|
3201
|
+
const r = f("div", { className: "toolbar-section toolbar-right" });
|
|
3202
|
+
this._themeBtn = Y({
|
|
3239
3203
|
icon: this.state.get("isDarkMode") ? Le : Re,
|
|
3240
3204
|
title: "Toggle Theme",
|
|
3241
3205
|
className: "toolbar-btn toolbar-btn-theme",
|
|
3242
3206
|
testId: "btn-toggle-theme",
|
|
3243
3207
|
ariaLabel: "Toggle theme",
|
|
3244
3208
|
onClick: () => this.editor.toggleTheme()
|
|
3245
|
-
}), this._cropBtn =
|
|
3209
|
+
}), this._cropBtn = Y({
|
|
3246
3210
|
icon: Ze,
|
|
3247
3211
|
title: "Crop",
|
|
3248
3212
|
className: "toolbar-btn toolbar-btn-crop",
|
|
@@ -3252,26 +3216,26 @@ class jt {
|
|
|
3252
3216
|
this.state.get("mode") === "crop" ? this.editor.setMode("filters") : this.editor.setMode("crop");
|
|
3253
3217
|
}
|
|
3254
3218
|
});
|
|
3255
|
-
const
|
|
3219
|
+
const i = f("div", { className: "remove-bg-control" });
|
|
3256
3220
|
this._removeBgTierSelect = f("select", {
|
|
3257
3221
|
className: "remove-bg-tier-select",
|
|
3258
3222
|
title: "Background removal quality",
|
|
3259
3223
|
"aria-label": "Background removal quality",
|
|
3260
3224
|
dataset: { testid: "select-remove-background-tier" },
|
|
3261
|
-
onChange: (
|
|
3262
|
-
this._removeBgTier =
|
|
3225
|
+
onChange: (d) => {
|
|
3226
|
+
this._removeBgTier = d.target.value;
|
|
3263
3227
|
}
|
|
3264
3228
|
});
|
|
3265
|
-
for (const
|
|
3229
|
+
for (const d of [
|
|
3266
3230
|
["fast", "Fast"],
|
|
3267
3231
|
["balanced", "Balanced"],
|
|
3268
3232
|
["best", "Best"]
|
|
3269
3233
|
]) {
|
|
3270
|
-
const
|
|
3271
|
-
|
|
3234
|
+
const h = f("option", { value: d[0] }, d[1]);
|
|
3235
|
+
d[0] === this._removeBgTier && (h.selected = !0), this._removeBgTierSelect.appendChild(h);
|
|
3272
3236
|
}
|
|
3273
|
-
this._removeBgBtn =
|
|
3274
|
-
icon:
|
|
3237
|
+
this._removeBgBtn = Y({
|
|
3238
|
+
icon: Tt,
|
|
3275
3239
|
title: "Remove Background",
|
|
3276
3240
|
className: "toolbar-btn toolbar-btn-remove-bg",
|
|
3277
3241
|
testId: "btn-remove-background",
|
|
@@ -3294,22 +3258,26 @@ class jt {
|
|
|
3294
3258
|
role: "status",
|
|
3295
3259
|
"aria-live": "polite",
|
|
3296
3260
|
"aria-atomic": "true"
|
|
3297
|
-
}),
|
|
3298
|
-
const
|
|
3261
|
+
}), i.appendChild(this._removeBgTierSelect), i.appendChild(this._removeBgBtn), i.appendChild(this._removeBgStatus);
|
|
3262
|
+
const s = Y({
|
|
3299
3263
|
icon: Ke,
|
|
3300
3264
|
title: "Reset All",
|
|
3301
3265
|
className: "toolbar-btn",
|
|
3302
3266
|
testId: "btn-reset-all",
|
|
3303
3267
|
ariaLabel: "Reset all changes",
|
|
3304
3268
|
onClick: () => this.editor.resetAll()
|
|
3305
|
-
}),
|
|
3306
|
-
|
|
3269
|
+
}), n = f("button", {
|
|
3270
|
+
type: "button",
|
|
3271
|
+
className: "icon-btn toolbar-btn toolbar-btn-primary toolbar-save-labeled",
|
|
3307
3272
|
title: "Save Image",
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
ariaLabel: "Save image",
|
|
3273
|
+
"aria-label": "Save image",
|
|
3274
|
+
dataset: { testid: "btn-save-edit" },
|
|
3311
3275
|
onClick: () => this.editor.save()
|
|
3312
|
-
}),
|
|
3276
|
+
}), o = f("span", { className: "btn-icon" });
|
|
3277
|
+
o.innerHTML = xt;
|
|
3278
|
+
const l = o.querySelector("svg");
|
|
3279
|
+
l && l.setAttribute("aria-hidden", "true"), n.appendChild(o), n.appendChild(f("span", { className: "toolbar-save-label" }, "Save"));
|
|
3280
|
+
const c = Y({
|
|
3313
3281
|
icon: Ae,
|
|
3314
3282
|
title: "Close",
|
|
3315
3283
|
className: "toolbar-btn",
|
|
@@ -3317,36 +3285,32 @@ class jt {
|
|
|
3317
3285
|
ariaLabel: "Close editor",
|
|
3318
3286
|
onClick: () => this.editor.close()
|
|
3319
3287
|
});
|
|
3320
|
-
return
|
|
3288
|
+
return r.appendChild(this._themeBtn), r.appendChild(this._cropBtn), r.appendChild(i), r.appendChild(s), r.appendChild(n), r.appendChild(c), this.element.appendChild(e), this.element.appendChild(r), this._subscribeToState(), this.element;
|
|
3321
3289
|
}
|
|
3322
3290
|
/**
|
|
3323
3291
|
* Subscribe to state changes
|
|
3324
3292
|
*/
|
|
3325
3293
|
_subscribeToState() {
|
|
3326
|
-
const e = this.state.on("change:
|
|
3327
|
-
this.
|
|
3294
|
+
const e = this.state.on("change:isDarkMode", ({ value: c }) => {
|
|
3295
|
+
this._themeBtn.innerHTML = c ? Le : Re;
|
|
3328
3296
|
});
|
|
3329
3297
|
this._unsubscribers.push(e);
|
|
3330
|
-
const t = this.state.on("change:
|
|
3331
|
-
this.
|
|
3298
|
+
const t = this.state.on("change:mode", ({ value: c }) => {
|
|
3299
|
+
this._cropBtn && this._cropBtn.classList.toggle("toolbar-btn-primary", c === "crop");
|
|
3332
3300
|
});
|
|
3333
3301
|
this._unsubscribers.push(t);
|
|
3334
|
-
const r = this.state.on("change:
|
|
3335
|
-
this._cropBtn && this._cropBtn.classList.toggle("toolbar-btn-primary", d === "crop");
|
|
3336
|
-
});
|
|
3302
|
+
const r = this.state.on("change:hasImage", () => this._updateRemoveBgButton());
|
|
3337
3303
|
this._unsubscribers.push(r);
|
|
3338
|
-
const i = this.state.on("change:
|
|
3304
|
+
const i = this.state.on("change:isProcessing", () => this._updateRemoveBgButton());
|
|
3339
3305
|
this._unsubscribers.push(i);
|
|
3340
|
-
const s = this.state.on("change:
|
|
3306
|
+
const s = this.state.on("change:backgroundRemovalAvailable", () => this._updateRemoveBgButton());
|
|
3341
3307
|
this._unsubscribers.push(s);
|
|
3342
|
-
const n = this.state.on("change:
|
|
3308
|
+
const n = this.state.on("change:editorDocument", () => this._updateRemoveBgButton());
|
|
3343
3309
|
this._unsubscribers.push(n);
|
|
3344
|
-
const o = this.state.on("change:
|
|
3310
|
+
const o = this.state.on("change:layers", () => this._updateRemoveBgButton());
|
|
3345
3311
|
this._unsubscribers.push(o);
|
|
3346
|
-
const l = this.state.on("change:
|
|
3312
|
+
const l = this.state.on("change:activeLayerId", () => this._updateRemoveBgButton());
|
|
3347
3313
|
this._unsubscribers.push(l);
|
|
3348
|
-
const c = this.state.on("change:activeLayerId", () => this._updateRemoveBgButton());
|
|
3349
|
-
this._unsubscribers.push(c);
|
|
3350
3314
|
}
|
|
3351
3315
|
_canRemoveBackground() {
|
|
3352
3316
|
return typeof this.editor.canRemoveBackground == "function" ? this.editor.canRemoveBackground() : !!this.state.get("hasImage") && typeof this.editor.removeBackground == "function";
|
|
@@ -3359,13 +3323,6 @@ class jt {
|
|
|
3359
3323
|
_setRemoveBgStatus(e) {
|
|
3360
3324
|
this._removeBgStatus && (this._removeBgStatus.textContent = e);
|
|
3361
3325
|
}
|
|
3362
|
-
/**
|
|
3363
|
-
* Update zoom display
|
|
3364
|
-
* @param {number} zoom
|
|
3365
|
-
*/
|
|
3366
|
-
updateZoom(e) {
|
|
3367
|
-
this._zoomLabel && (this._zoomLabel.textContent = `${Math.round(e * 100)}%`);
|
|
3368
|
-
}
|
|
3369
3326
|
/**
|
|
3370
3327
|
* Clean up
|
|
3371
3328
|
*/
|
|
@@ -3375,7 +3332,7 @@ class jt {
|
|
|
3375
3332
|
}
|
|
3376
3333
|
}
|
|
3377
3334
|
const be = Ne;
|
|
3378
|
-
class
|
|
3335
|
+
class Dt {
|
|
3379
3336
|
constructor(e, t) {
|
|
3380
3337
|
this.state = e, this.editor = t, this.element = null, this._chips = /* @__PURE__ */ new Map(), this._scrollIndex = 0, this._unsubscribers = [];
|
|
3381
3338
|
}
|
|
@@ -3388,20 +3345,20 @@ class Yt {
|
|
|
3388
3345
|
this._onSelect = e, this.element = f("div", {
|
|
3389
3346
|
className: "category-carousel-container",
|
|
3390
3347
|
"data-testid": "category-carousel"
|
|
3391
|
-
}), this._leftBtn =
|
|
3348
|
+
}), this._leftBtn = Y({
|
|
3392
3349
|
icon: $e,
|
|
3393
3350
|
title: "Previous categories",
|
|
3394
3351
|
className: "carousel-nav carousel-nav-left",
|
|
3395
3352
|
onClick: () => this._scrollLeft()
|
|
3396
3353
|
}), this._carousel = f("div", { className: "category-carousel" }), be.forEach((r) => {
|
|
3397
|
-
const i =
|
|
3354
|
+
const i = _e({
|
|
3398
3355
|
label: r.name,
|
|
3399
3356
|
icon: r.icon,
|
|
3400
3357
|
active: this.state.get("selectedCategory") === r.id,
|
|
3401
3358
|
onClick: () => this._selectCategory(r.id)
|
|
3402
3359
|
});
|
|
3403
3360
|
i.dataset.categoryId = r.id, i.dataset.category = r.id, i.dataset.testid = `category-${r.id}`, this._chips.set(r.id, i), this._carousel.appendChild(i);
|
|
3404
|
-
}), this._rightBtn =
|
|
3361
|
+
}), this._rightBtn = Y({
|
|
3405
3362
|
icon: Ge,
|
|
3406
3363
|
title: "Next categories",
|
|
3407
3364
|
className: "carousel-nav carousel-nav-right",
|
|
@@ -3514,7 +3471,7 @@ class Yt {
|
|
|
3514
3471
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._chips.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
3515
3472
|
}
|
|
3516
3473
|
}
|
|
3517
|
-
class
|
|
3474
|
+
class Ot {
|
|
3518
3475
|
constructor(e, t) {
|
|
3519
3476
|
this.state = e, this.filterManager = t, this.element = null, this._filterCards = /* @__PURE__ */ new Map(), this._scrollIndex = 0, this._unsubscribers = [], this._onToggle = null, this._onSelect = null;
|
|
3520
3477
|
}
|
|
@@ -3524,12 +3481,12 @@ class Ut {
|
|
|
3524
3481
|
* @returns {HTMLElement}
|
|
3525
3482
|
*/
|
|
3526
3483
|
render({ onToggle: e, onSelect: t }) {
|
|
3527
|
-
return this._onToggle = e, this._onSelect = t, this.element = f("div", { className: "filter-carousel-container" }), this._leftBtn =
|
|
3484
|
+
return this._onToggle = e, this._onSelect = t, this.element = f("div", { className: "filter-carousel-container" }), this._leftBtn = Y({
|
|
3528
3485
|
icon: $e,
|
|
3529
3486
|
title: "Previous filters",
|
|
3530
3487
|
className: "carousel-nav carousel-nav-left",
|
|
3531
3488
|
onClick: () => this._scrollLeft()
|
|
3532
|
-
}), this._carousel = f("div", { className: "filter-carousel" }), this._rightBtn =
|
|
3489
|
+
}), this._carousel = f("div", { className: "filter-carousel" }), this._rightBtn = Y({
|
|
3533
3490
|
icon: Ge,
|
|
3534
3491
|
title: "Next filters",
|
|
3535
3492
|
className: "carousel-nav carousel-nav-right",
|
|
@@ -3671,7 +3628,7 @@ class Ut {
|
|
|
3671
3628
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._filterCards.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
3672
3629
|
}
|
|
3673
3630
|
}
|
|
3674
|
-
class
|
|
3631
|
+
class jt {
|
|
3675
3632
|
constructor(e, t) {
|
|
3676
3633
|
this.state = e, this.filterManager = t, this.element = null, this._controls = /* @__PURE__ */ new Map(), this._onChange = null, this._onReset = null, this._onAction = null, this._unsubscribers = [];
|
|
3677
3634
|
}
|
|
@@ -3720,7 +3677,7 @@ class Xt {
|
|
|
3720
3677
|
return;
|
|
3721
3678
|
}
|
|
3722
3679
|
const r = f("div", { className: "adjustments-header" });
|
|
3723
|
-
r.appendChild(f("span", { className: "adjustments-title" }, t.name)), r.appendChild(
|
|
3680
|
+
r.appendChild(f("span", { className: "adjustments-title" }, t.name)), r.appendChild(j({
|
|
3724
3681
|
label: "Reset",
|
|
3725
3682
|
className: "btn-text",
|
|
3726
3683
|
onClick: () => this._handleReset(e)
|
|
@@ -3805,7 +3762,7 @@ class Xt {
|
|
|
3805
3762
|
});
|
|
3806
3763
|
case "button":
|
|
3807
3764
|
const l = f("div", { className: "button-control" });
|
|
3808
|
-
return l.appendChild(
|
|
3765
|
+
return l.appendChild(j({
|
|
3809
3766
|
label: i,
|
|
3810
3767
|
className: "btn-secondary",
|
|
3811
3768
|
onClick: () => this._handleAction(e, t.action || t.id)
|
|
@@ -3905,7 +3862,7 @@ class Xt {
|
|
|
3905
3862
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._controls.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
3906
3863
|
}
|
|
3907
3864
|
}
|
|
3908
|
-
class
|
|
3865
|
+
class Yt {
|
|
3909
3866
|
constructor(e, t) {
|
|
3910
3867
|
this.state = e, this.filterManager = t, this._drawer = null, this._body = null, this._titleEl = null, this._isOpen = !1, this._currentFilterId = null, this._controls = /* @__PURE__ */ new Map(), this._onChange = null, this._onReset = null, this._onRemove = null, this._onAction = null, this._container = null;
|
|
3911
3868
|
}
|
|
@@ -3918,21 +3875,21 @@ class Vt {
|
|
|
3918
3875
|
this._onChange = t, this._onReset = r, this._onRemove = i, this._onAction = s, this._container = e, this._drawer = f("div", { className: "mobile-filter-drawer" });
|
|
3919
3876
|
const n = f("div", { className: "drawer-header" });
|
|
3920
3877
|
this._titleEl = f("span", { className: "drawer-title" }, "Filter");
|
|
3921
|
-
const o = f("div", { className: "drawer-header-actions" }), l =
|
|
3878
|
+
const o = f("div", { className: "drawer-header-actions" }), l = j({
|
|
3922
3879
|
label: "Reset",
|
|
3923
3880
|
className: "btn-text",
|
|
3924
3881
|
onClick: () => {
|
|
3925
3882
|
var h;
|
|
3926
3883
|
this._currentFilterId && ((h = this._onReset) == null || h.call(this, this._currentFilterId), this._renderControls());
|
|
3927
3884
|
}
|
|
3928
|
-
}), c =
|
|
3885
|
+
}), c = j({
|
|
3929
3886
|
label: "Remove",
|
|
3930
3887
|
className: "btn-text btn-danger",
|
|
3931
3888
|
onClick: () => {
|
|
3932
3889
|
var h;
|
|
3933
3890
|
this._currentFilterId && ((h = this._onRemove) == null || h.call(this, this._currentFilterId), this.close());
|
|
3934
3891
|
}
|
|
3935
|
-
}), d =
|
|
3892
|
+
}), d = Y({
|
|
3936
3893
|
icon: Ae,
|
|
3937
3894
|
title: "Close",
|
|
3938
3895
|
className: "btn-icon-sm",
|
|
@@ -4082,7 +4039,7 @@ class Vt {
|
|
|
4082
4039
|
});
|
|
4083
4040
|
case "button": {
|
|
4084
4041
|
const o = f("div", { className: "button-control" });
|
|
4085
|
-
return o.appendChild(
|
|
4042
|
+
return o.appendChild(j({
|
|
4086
4043
|
label: i,
|
|
4087
4044
|
className: "btn-secondary",
|
|
4088
4045
|
onClick: () => {
|
|
@@ -4129,7 +4086,7 @@ class Vt {
|
|
|
4129
4086
|
this._controls.clear(), (e = this._drawer) == null || e.remove(), this._drawer = null, this._isOpen = !1, this._currentFilterId = null, this._container = null;
|
|
4130
4087
|
}
|
|
4131
4088
|
}
|
|
4132
|
-
class
|
|
4089
|
+
class Ut {
|
|
4133
4090
|
constructor(e, t) {
|
|
4134
4091
|
this.state = e, this.filterManager = t, this.element = null, this._scrollContainer = null, this._chips = /* @__PURE__ */ new Map(), this._unsubscribers = [], this._onToggle = null, this._onSelect = null;
|
|
4135
4092
|
}
|
|
@@ -4202,18 +4159,18 @@ class Ht {
|
|
|
4202
4159
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._chips.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
4203
4160
|
}
|
|
4204
4161
|
}
|
|
4205
|
-
const
|
|
4206
|
-
{ id: "free", name: "Free", icon:
|
|
4207
|
-
{ id: "square", name: "Square", icon:
|
|
4208
|
-
{ id: "circle", name: "Circle", icon:
|
|
4209
|
-
],
|
|
4162
|
+
const Xt = [
|
|
4163
|
+
{ id: "free", name: "Free", icon: At },
|
|
4164
|
+
{ id: "square", name: "Square", icon: Mt },
|
|
4165
|
+
{ id: "circle", name: "Circle", icon: Pt }
|
|
4166
|
+
], Vt = [
|
|
4210
4167
|
{ id: "free", name: "Free" },
|
|
4211
4168
|
{ id: "1:1", name: "1:1" },
|
|
4212
4169
|
{ id: "4:3", name: "4:3" },
|
|
4213
4170
|
{ id: "16:9", name: "16:9" },
|
|
4214
4171
|
{ id: "3:2", name: "3:2" },
|
|
4215
4172
|
{ id: "2:3", name: "2:3" }
|
|
4216
|
-
],
|
|
4173
|
+
], Ht = [
|
|
4217
4174
|
{ id: "0", label: "0°", angle: 0 },
|
|
4218
4175
|
{ id: "90", label: "90°", angle: 90 },
|
|
4219
4176
|
{ id: "180", label: "180°", angle: 180 },
|
|
@@ -4224,7 +4181,7 @@ function te(a) {
|
|
|
4224
4181
|
const e = Number(a) % 360;
|
|
4225
4182
|
return e < 0 ? e + 360 : e;
|
|
4226
4183
|
}
|
|
4227
|
-
class
|
|
4184
|
+
class Wt {
|
|
4228
4185
|
constructor(e, t, r = null) {
|
|
4229
4186
|
this.state = e, this.cropManager = t, this.editor = r, this.element = null, this._shapeChips = /* @__PURE__ */ new Map(), this._aspectChips = /* @__PURE__ */ new Map(), this._rotationPresetChips = /* @__PURE__ */ new Map(), this._rotationRange = null, this._rotationNumber = null, this._rotationValue = null, this._unsubscribers = [];
|
|
4230
4187
|
}
|
|
@@ -4248,8 +4205,8 @@ class Gt {
|
|
|
4248
4205
|
const e = f("div", { className: "crop-section" });
|
|
4249
4206
|
e.appendChild(f("label", { className: "section-label" }, "Shape"));
|
|
4250
4207
|
const t = f("div", { className: "chip-row" }), r = this.state.get("crop.shape");
|
|
4251
|
-
|
|
4252
|
-
const d =
|
|
4208
|
+
Xt.forEach((c) => {
|
|
4209
|
+
const d = _e({
|
|
4253
4210
|
label: c.name,
|
|
4254
4211
|
icon: c.icon,
|
|
4255
4212
|
active: r === c.id,
|
|
@@ -4258,22 +4215,22 @@ class Gt {
|
|
|
4258
4215
|
d.dataset.shape = c.id, d.dataset.testid = `crop-shape-${c.id}`, this._shapeChips.set(c.id, d), t.appendChild(d);
|
|
4259
4216
|
}), e.appendChild(t), this.element.appendChild(e), this.state.get("lockCropShape") && (e.style.display = "none"), this._shapeSection = e, this._aspectSection = f("div", { className: "crop-section" }), this._aspectSection.appendChild(f("label", { className: "section-label" }, "Aspect Ratio"));
|
|
4260
4217
|
const i = f("div", { className: "chip-row aspect-row" }), s = this.state.get("crop.aspect");
|
|
4261
|
-
|
|
4262
|
-
const d =
|
|
4218
|
+
Vt.forEach((c) => {
|
|
4219
|
+
const d = _e({
|
|
4263
4220
|
label: c.name,
|
|
4264
4221
|
active: s === c.id,
|
|
4265
4222
|
onClick: () => this._selectAspect(c.id)
|
|
4266
4223
|
});
|
|
4267
4224
|
d.dataset.ratio = c.id, d.dataset.testid = `crop-ratio-${c.id}`, this._aspectChips.set(c.id, d), i.appendChild(d);
|
|
4268
4225
|
}), this._aspectSection.appendChild(i), this.element.appendChild(this._aspectSection), this._updateAspectVisibility();
|
|
4269
|
-
const n = f("div", { className: "crop-actions" }), o =
|
|
4226
|
+
const n = f("div", { className: "crop-actions" }), o = j({
|
|
4270
4227
|
label: "Cancel",
|
|
4271
4228
|
className: "btn-secondary crop-cancel-btn",
|
|
4272
4229
|
icon: Ae,
|
|
4273
4230
|
onClick: () => this.cropManager.cancel()
|
|
4274
4231
|
});
|
|
4275
4232
|
o.dataset.testid = "cancel-crop";
|
|
4276
|
-
const l =
|
|
4233
|
+
const l = j({
|
|
4277
4234
|
label: "Apply Crop",
|
|
4278
4235
|
className: "btn-primary crop-apply-btn",
|
|
4279
4236
|
icon: Me,
|
|
@@ -4284,35 +4241,35 @@ class Gt {
|
|
|
4284
4241
|
_renderRotationSection() {
|
|
4285
4242
|
const e = f("div", { className: "crop-section rotation-section" });
|
|
4286
4243
|
e.appendChild(f("label", { className: "section-label" }, "Rotate"));
|
|
4287
|
-
const t = f("div", { className: "rotation-action-row" }), r =
|
|
4244
|
+
const t = f("div", { className: "rotation-action-row" }), r = j({
|
|
4288
4245
|
label: "Left 90°",
|
|
4289
4246
|
className: "btn-secondary rotation-action-btn",
|
|
4290
|
-
icon:
|
|
4247
|
+
icon: wt,
|
|
4291
4248
|
onClick: () => this._rotateBy(-90)
|
|
4292
4249
|
});
|
|
4293
4250
|
r.dataset.testid = "rotate-left-90";
|
|
4294
|
-
const i =
|
|
4251
|
+
const i = j({
|
|
4295
4252
|
label: "Right 90°",
|
|
4296
4253
|
className: "btn-secondary rotation-action-btn",
|
|
4297
|
-
icon:
|
|
4254
|
+
icon: vt,
|
|
4298
4255
|
onClick: () => this._rotateBy(90)
|
|
4299
4256
|
});
|
|
4300
4257
|
i.dataset.testid = "rotate-right-90";
|
|
4301
|
-
const s =
|
|
4258
|
+
const s = j({
|
|
4302
4259
|
label: "Rotate 180°",
|
|
4303
4260
|
className: "btn-secondary rotation-action-btn",
|
|
4304
4261
|
onClick: () => this._rotateBy(180)
|
|
4305
4262
|
});
|
|
4306
4263
|
s.dataset.testid = "rotate-180";
|
|
4307
|
-
const n =
|
|
4264
|
+
const n = j({
|
|
4308
4265
|
label: "Rotate 270°",
|
|
4309
4266
|
className: "btn-secondary rotation-action-btn",
|
|
4310
4267
|
onClick: () => this._rotateBy(270)
|
|
4311
4268
|
});
|
|
4312
4269
|
n.dataset.testid = "rotate-270", t.appendChild(r), t.appendChild(i), t.appendChild(s), t.appendChild(n), e.appendChild(t);
|
|
4313
4270
|
const o = f("div", { className: "chip-row rotation-preset-row" }), l = te(this.state.get("transform.rotation") ?? 0);
|
|
4314
|
-
|
|
4315
|
-
const m =
|
|
4271
|
+
Ht.forEach((p) => {
|
|
4272
|
+
const m = _e({
|
|
4316
4273
|
label: p.label,
|
|
4317
4274
|
active: Math.round(l) === p.angle,
|
|
4318
4275
|
onClick: () => this._setRotation(p.angle)
|
|
@@ -4356,7 +4313,7 @@ class Gt {
|
|
|
4356
4313
|
this._rotationNumber
|
|
4357
4314
|
);
|
|
4358
4315
|
c.appendChild(d), c.appendChild(h);
|
|
4359
|
-
const u =
|
|
4316
|
+
const u = j({
|
|
4360
4317
|
label: "Reset rotation",
|
|
4361
4318
|
className: "btn-text rotation-reset-btn",
|
|
4362
4319
|
onClick: () => this._setRotation(0)
|
|
@@ -4459,7 +4416,7 @@ class Gt {
|
|
|
4459
4416
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._shapeChips.clear(), this._aspectChips.clear(), this._rotationPresetChips.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
4460
4417
|
}
|
|
4461
4418
|
}
|
|
4462
|
-
class
|
|
4419
|
+
class qt {
|
|
4463
4420
|
constructor(e, t) {
|
|
4464
4421
|
this.state = e, this.filterManager = t, this.element = null, this._filterItems = /* @__PURE__ */ new Map(), this._unsubscribers = [], this._onRemove = null, this._onReset = null, this._onClearAll = null, this._onUpdateValue = null, this._onSelect = null;
|
|
4465
4422
|
}
|
|
@@ -4475,7 +4432,7 @@ class Zt {
|
|
|
4475
4432
|
});
|
|
4476
4433
|
const n = f("div", { className: "panel-header" });
|
|
4477
4434
|
n.appendChild(f("h3", { className: "panel-title" }, "Active Filters"));
|
|
4478
|
-
const o =
|
|
4435
|
+
const o = j({
|
|
4479
4436
|
label: "Clear All",
|
|
4480
4437
|
className: "btn-text btn-danger",
|
|
4481
4438
|
onClick: () => this._handleClearAll()
|
|
@@ -4541,13 +4498,13 @@ class Zt {
|
|
|
4541
4498
|
onClick: (p) => {
|
|
4542
4499
|
p.target.closest(".filter-item-actions") || this._handleSelect(e);
|
|
4543
4500
|
}
|
|
4544
|
-
}), n = f("div", { className: "filter-item-header" }), o = f("span", { className: "filter-item-name" }, t.name), l = f("div", { className: "filter-item-actions" }), c =
|
|
4501
|
+
}), n = f("div", { className: "filter-item-header" }), o = f("span", { className: "filter-item-name" }, t.name), l = f("div", { className: "filter-item-actions" }), c = Y({
|
|
4545
4502
|
icon: Ke,
|
|
4546
4503
|
title: "Reset filter",
|
|
4547
4504
|
className: "btn-icon-sm",
|
|
4548
4505
|
onClick: () => this._handleReset(e)
|
|
4549
|
-
}), d =
|
|
4550
|
-
icon:
|
|
4506
|
+
}), d = Y({
|
|
4507
|
+
icon: Ct,
|
|
4551
4508
|
title: "Remove filter",
|
|
4552
4509
|
className: "btn-icon-sm btn-danger",
|
|
4553
4510
|
onClick: () => this._handleRemove(e)
|
|
@@ -4717,7 +4674,7 @@ const ie = {
|
|
|
4717
4674
|
lockAspectRatio: !1
|
|
4718
4675
|
}
|
|
4719
4676
|
};
|
|
4720
|
-
function
|
|
4677
|
+
function $t(a) {
|
|
4721
4678
|
if (!a)
|
|
4722
4679
|
return { ...ke.free };
|
|
4723
4680
|
if (typeof a == "object" && a !== null)
|
|
@@ -4730,7 +4687,7 @@ function ae(a) {
|
|
|
4730
4687
|
const e = Number(a) % 360;
|
|
4731
4688
|
return e < 0 ? e + 360 : e;
|
|
4732
4689
|
}
|
|
4733
|
-
function
|
|
4690
|
+
function Gt(a, e) {
|
|
4734
4691
|
const t = ae(a);
|
|
4735
4692
|
return (ae(e) - t + 540) % 360 - 180;
|
|
4736
4693
|
}
|
|
@@ -4745,7 +4702,7 @@ class ii extends de {
|
|
|
4745
4702
|
if (super(), !e)
|
|
4746
4703
|
throw new Error("VanillaImageEditor: container element is required");
|
|
4747
4704
|
this._container = e, this._destroyed = !1, this._loadVersion = 0, this._objectUrls = /* @__PURE__ */ new Set(), this._activeObjectUrl = null;
|
|
4748
|
-
const r = t.preset ?
|
|
4705
|
+
const r = t.preset ? $t(t.preset) : null, i = r ? {
|
|
4749
4706
|
initialMode: r.initialMode === "crop" ? "crop" : "adjust",
|
|
4750
4707
|
cropShape: r.cropShape,
|
|
4751
4708
|
initialAspectRatio: r.aspectRatio
|
|
@@ -4764,7 +4721,7 @@ class ii extends de {
|
|
|
4764
4721
|
},
|
|
4765
4722
|
...i,
|
|
4766
4723
|
...t
|
|
4767
|
-
}, this._preset = r, this._state = ht(), this._state.set("theme", this._options.theme), this._state.set("crop.shape", this._options.cropShape), this._state.set("crop.aspect", this._options.initialAspectRatio), this._preset && (this._state.set("lockCropShape", !!this._preset.lockCropShape), this._state.set("lockAspectRatio", !!this._preset.lockAspectRatio), this._state.set("showFilters", this._preset.showFilters !== !1), this._state.set("showCropControls", this._preset.showCropControls !== !1), this._state.set("autoZoomOnCropOverflow", !!this._preset.autoZoomOnCropOverflow)), this._renderer = new ut(), this._filterManager = new
|
|
4724
|
+
}, this._preset = r, this._state = ht(), this._state.set("theme", this._options.theme), this._state.set("crop.shape", this._options.cropShape), this._state.set("crop.aspect", this._options.initialAspectRatio), this._preset && (this._state.set("lockCropShape", !!this._preset.lockCropShape), this._state.set("lockAspectRatio", !!this._preset.lockAspectRatio), this._state.set("showFilters", this._preset.showFilters !== !1), this._state.set("showCropControls", this._preset.showCropControls !== !1), this._state.set("autoZoomOnCropOverflow", !!this._preset.autoZoomOnCropOverflow)), this._renderer = new ut(), this._filterManager = new Bt(this._state, this._renderer), this._cropManager = new Pe(this._state, this._renderer), this._removeBgManager = null, this._backgroundRemovalAvailable = !1, ((s = this._options.backgroundRemoval) == null ? void 0 : s.enabled) !== !1 && (this._removeBgManager = new Et({
|
|
4768
4725
|
endpoint: (n = this._options.backgroundRemoval) == null ? void 0 : n.endpoint,
|
|
4769
4726
|
optionsEndpoint: (o = this._options.backgroundRemoval) == null ? void 0 : o.optionsEndpoint,
|
|
4770
4727
|
fallbackEndpoint: (l = this._options.backgroundRemoval) == null ? void 0 : l.fallbackEndpoint
|
|
@@ -4803,31 +4760,31 @@ class ii extends de {
|
|
|
4803
4760
|
* Initialize UI components
|
|
4804
4761
|
*/
|
|
4805
4762
|
_initUI() {
|
|
4806
|
-
this._toolbar = new
|
|
4763
|
+
this._toolbar = new It(this._state, this), this._toolbarContainer.appendChild(this._toolbar.render()), this._filterControlsEl = f("div", { className: "filter-controls-container" }), this._categoryCarousel = new Dt(this._state, this), this._filterControlsEl.appendChild(this._categoryCarousel.render((i) => {
|
|
4807
4764
|
}));
|
|
4808
4765
|
const e = f("div", { className: "filter-layout" }), t = f("div", { className: "filter-left-column" });
|
|
4809
|
-
this._filterCarousel = new
|
|
4766
|
+
this._filterCarousel = new Ot(this._state, this._filterManager), t.appendChild(this._filterCarousel.render({
|
|
4810
4767
|
onToggle: (i, s) => this._handleFilterToggle(i, s),
|
|
4811
4768
|
onSelect: (i) => {
|
|
4812
4769
|
this._handleFilterSelect(i), this._isMobile && this._mobileFilterDrawer && this._mobileFilterDrawer.open(i);
|
|
4813
4770
|
}
|
|
4814
|
-
})), this._filterAdjustments = new
|
|
4771
|
+
})), this._filterAdjustments = new jt(this._state, this._filterManager), t.appendChild(this._filterAdjustments.render({
|
|
4815
4772
|
onChange: (i, s, n) => this._handleFilterChange(i, s, n),
|
|
4816
4773
|
onReset: (i) => this._handleFilterReset(i),
|
|
4817
4774
|
onAction: (i, s) => this._handleFilterAction(i, s)
|
|
4818
4775
|
})), e.appendChild(t);
|
|
4819
4776
|
const r = f("div", { className: "filter-right-column" });
|
|
4820
|
-
this._activeFiltersPanel = new
|
|
4777
|
+
this._activeFiltersPanel = new qt(this._state, this._filterManager), r.appendChild(this._activeFiltersPanel.render({
|
|
4821
4778
|
onRemove: (i) => this._handleFilterToggle(i, !1),
|
|
4822
4779
|
onReset: (i) => this._handleFilterReset(i),
|
|
4823
4780
|
onClearAll: () => this.resetAll(),
|
|
4824
4781
|
onSelect: (i) => this._handleFilterSelect(i)
|
|
4825
|
-
})), e.appendChild(r), this._filterControlsEl.appendChild(e), this._mobileActiveFilters = new
|
|
4782
|
+
})), e.appendChild(r), this._filterControlsEl.appendChild(e), this._mobileActiveFilters = new Ut(this._state, this._filterManager), this._filterControlsEl.appendChild(this._mobileActiveFilters.render({
|
|
4826
4783
|
onToggle: (i, s) => this._handleFilterToggle(i, s),
|
|
4827
4784
|
onSelect: (i) => {
|
|
4828
4785
|
this._handleFilterSelect(i), this._isMobile && this._mobileFilterDrawer && this._mobileFilterDrawer.open(i);
|
|
4829
4786
|
}
|
|
4830
|
-
})), this._cropControls = new
|
|
4787
|
+
})), this._cropControls = new Wt(this._state, this._cropManager, this), this._cropControlsEl = this._cropControls.render(), this._cropControlsEl.style.display = "none", this._controlsSection.appendChild(this._filterControlsEl), this._controlsSection.appendChild(this._cropControlsEl), this._mobileFilterDrawer = new Yt(this._state, this._filterManager), this._mobileFilterDrawer.build(this._controlsSection, {
|
|
4831
4788
|
onChange: (i, s, n) => this._handleFilterChange(i, s, n),
|
|
4832
4789
|
onReset: (i) => this._handleFilterReset(i),
|
|
4833
4790
|
onRemove: (i) => {
|
|
@@ -5007,7 +4964,7 @@ class ii extends de {
|
|
|
5007
4964
|
this._state.set("selectedFilter", i);
|
|
5008
4965
|
const s = this._filterManager.getFilterDef(i);
|
|
5009
4966
|
if (typeof (s == null ? void 0 : s.category) == "string") {
|
|
5010
|
-
const n =
|
|
4967
|
+
const n = Lt[s.category] ?? s.category;
|
|
5011
4968
|
this._state.set("selectedCategory", n);
|
|
5012
4969
|
}
|
|
5013
4970
|
}
|
|
@@ -5138,7 +5095,7 @@ class ii extends de {
|
|
|
5138
5095
|
}
|
|
5139
5096
|
setRotationAngle(e) {
|
|
5140
5097
|
if (!this._state.get("hasImage")) return !1;
|
|
5141
|
-
const t = ae(this._state.get("transform.rotation") ?? 0), r = ae(e), i =
|
|
5098
|
+
const t = ae(this._state.get("transform.rotation") ?? 0), r = ae(e), i = Gt(t, r), s = this._state.get("mode") === "crop";
|
|
5142
5099
|
if (Math.abs(i) > 1e-3) {
|
|
5143
5100
|
if (s && this._cropManager.disable(), !this._renderer.rotateBy(i))
|
|
5144
5101
|
return s && this._cropManager.enable(), !1;
|
|
@@ -5289,25 +5246,25 @@ class ii extends de {
|
|
|
5289
5246
|
}
|
|
5290
5247
|
}
|
|
5291
5248
|
const U = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map();
|
|
5292
|
-
function
|
|
5249
|
+
function Zt(a, e) {
|
|
5293
5250
|
return !Array.isArray(a.mediaTargets) || a.mediaTargets.length === 0 ? !0 : a.mediaTargets.includes(e);
|
|
5294
5251
|
}
|
|
5295
|
-
function
|
|
5252
|
+
function _(a) {
|
|
5296
5253
|
var e;
|
|
5297
5254
|
return U.has(a.id), U.set(a.id, a), Q.has(a.category) || Q.set(a.category, []), (e = Q.get(a.category)) == null || e.push(a.id), a;
|
|
5298
5255
|
}
|
|
5299
|
-
function
|
|
5256
|
+
function Kt(a) {
|
|
5300
5257
|
return U.get(a);
|
|
5301
5258
|
}
|
|
5302
5259
|
function xe() {
|
|
5303
5260
|
return Array.from(U.values());
|
|
5304
5261
|
}
|
|
5305
|
-
function
|
|
5262
|
+
function Jt() {
|
|
5306
5263
|
xe().map((t) => t.id), Object.entries(v).filter(
|
|
5307
5264
|
(t) => /Filter$/.test(t[0]) && typeof t[1] == "function"
|
|
5308
5265
|
).forEach(([t, r]) => {
|
|
5309
5266
|
const i = t.replace(/Filter$/, "").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
5310
|
-
U.has(i) ||
|
|
5267
|
+
U.has(i) || _({
|
|
5311
5268
|
id: i,
|
|
5312
5269
|
name: t.replace(/Filter$/, ""),
|
|
5313
5270
|
category: "unlisted",
|
|
@@ -5326,16 +5283,16 @@ function tr() {
|
|
|
5326
5283
|
});
|
|
5327
5284
|
});
|
|
5328
5285
|
}
|
|
5329
|
-
function
|
|
5286
|
+
function Qt(a) {
|
|
5330
5287
|
return (Q.get(a) || []).map((t) => U.get(t)).filter(Boolean);
|
|
5331
5288
|
}
|
|
5332
|
-
function
|
|
5289
|
+
function er() {
|
|
5333
5290
|
return Array.from(Q.keys());
|
|
5334
5291
|
}
|
|
5335
5292
|
function si(a) {
|
|
5336
5293
|
return U.has(a);
|
|
5337
5294
|
}
|
|
5338
|
-
function
|
|
5295
|
+
function tr(a) {
|
|
5339
5296
|
const e = U.get(a);
|
|
5340
5297
|
if (!e)
|
|
5341
5298
|
return !1;
|
|
@@ -5349,9 +5306,9 @@ function sr(a) {
|
|
|
5349
5306
|
}
|
|
5350
5307
|
function ai(a, e) {
|
|
5351
5308
|
const t = U.get(a);
|
|
5352
|
-
return t ?
|
|
5309
|
+
return t ? Zt(t, e) : !1;
|
|
5353
5310
|
}
|
|
5354
|
-
function
|
|
5311
|
+
function rr() {
|
|
5355
5312
|
return Array.from(U.values()).map((a) => ({
|
|
5356
5313
|
id: a.id,
|
|
5357
5314
|
name: a.name,
|
|
@@ -5360,8 +5317,8 @@ function ar() {
|
|
|
5360
5317
|
}));
|
|
5361
5318
|
}
|
|
5362
5319
|
if (typeof window < "u") {
|
|
5363
|
-
window.__DEBUG_FILTERS_LIST = Array.from(U.keys()), window.getAllFilters = xe, window.getFilter =
|
|
5364
|
-
const a =
|
|
5320
|
+
window.__DEBUG_FILTERS_LIST = Array.from(U.keys()), window.getAllFilters = xe, window.getFilter = Kt, window.getFiltersByCategory = Qt, window.getRegisteredFilters = rr;
|
|
5321
|
+
const a = _;
|
|
5365
5322
|
window.registerFilter = (e) => {
|
|
5366
5323
|
const t = a(e);
|
|
5367
5324
|
return window.__DEBUG_FILTERS_LIST = Array.from(U.keys()), t;
|
|
@@ -5370,7 +5327,7 @@ if (typeof window < "u") {
|
|
|
5370
5327
|
typeof window < "u" && (window.initializeFilterRegistry = window.initializeFilterRegistry || function() {
|
|
5371
5328
|
return [];
|
|
5372
5329
|
});
|
|
5373
|
-
const { AdjustmentFilter:
|
|
5330
|
+
const { AdjustmentFilter: ir } = v, { ColorMatrixFilter: sr } = I, W = {
|
|
5374
5331
|
gamma: 1,
|
|
5375
5332
|
saturation: 1,
|
|
5376
5333
|
contrast: 1,
|
|
@@ -5379,7 +5336,7 @@ const { AdjustmentFilter: nr } = v, { ColorMatrixFilter: or } = D, W = {
|
|
|
5379
5336
|
green: 1,
|
|
5380
5337
|
blue: 1,
|
|
5381
5338
|
alpha: 1
|
|
5382
|
-
},
|
|
5339
|
+
}, ar = /* @__PURE__ */ new Set([
|
|
5383
5340
|
"gamma",
|
|
5384
5341
|
"saturation",
|
|
5385
5342
|
"contrast",
|
|
@@ -5400,9 +5357,9 @@ function q(a, e) {
|
|
|
5400
5357
|
return e;
|
|
5401
5358
|
}
|
|
5402
5359
|
function Be(a) {
|
|
5403
|
-
return
|
|
5360
|
+
return ar.has(a);
|
|
5404
5361
|
}
|
|
5405
|
-
function
|
|
5362
|
+
function nr(a) {
|
|
5406
5363
|
return {
|
|
5407
5364
|
gamma: q(a.gamma, W.gamma),
|
|
5408
5365
|
saturation: q(a.saturation, W.saturation),
|
|
@@ -5417,7 +5374,7 @@ function cr(a) {
|
|
|
5417
5374
|
function Ee(a, e) {
|
|
5418
5375
|
a.reset(), a.brightness(e.brightness, !0), a.contrast(e.contrast, !0), a.saturate(e.saturation, !0);
|
|
5419
5376
|
}
|
|
5420
|
-
|
|
5377
|
+
_({
|
|
5421
5378
|
id: "adjustment",
|
|
5422
5379
|
name: "Adjustment",
|
|
5423
5380
|
category: "adjust",
|
|
@@ -5425,9 +5382,9 @@ y({
|
|
|
5425
5382
|
// Create an instance of the AdjustmentFilter with the provided parameters
|
|
5426
5383
|
createFilter: (a) => {
|
|
5427
5384
|
try {
|
|
5428
|
-
const e =
|
|
5385
|
+
const e = nr(a ?? {}), t = { ...e };
|
|
5429
5386
|
try {
|
|
5430
|
-
const r = new
|
|
5387
|
+
const r = new ir(t), i = r;
|
|
5431
5388
|
return i._customParams = { ...e }, i.updateUIParam = function(n, o) {
|
|
5432
5389
|
try {
|
|
5433
5390
|
if (!Be(n))
|
|
@@ -5440,7 +5397,7 @@ y({
|
|
|
5440
5397
|
}
|
|
5441
5398
|
}, r;
|
|
5442
5399
|
} catch {
|
|
5443
|
-
const i = new
|
|
5400
|
+
const i = new sr(), s = i;
|
|
5444
5401
|
return s._customParams = { ...e }, Ee(i, e), s.updateUIParam = function(o, l) {
|
|
5445
5402
|
try {
|
|
5446
5403
|
if (!Be(o))
|
|
@@ -5550,14 +5507,14 @@ y({
|
|
|
5550
5507
|
}
|
|
5551
5508
|
]
|
|
5552
5509
|
});
|
|
5553
|
-
const { ColorMatrixFilter:
|
|
5510
|
+
const { ColorMatrixFilter: or } = I, K = {
|
|
5554
5511
|
brightness: 1,
|
|
5555
5512
|
contrast: 1,
|
|
5556
5513
|
saturation: 1,
|
|
5557
5514
|
hue: 0,
|
|
5558
5515
|
sepia: 0,
|
|
5559
5516
|
negative: !1
|
|
5560
|
-
},
|
|
5517
|
+
}, lr = /* @__PURE__ */ new Set([
|
|
5561
5518
|
"brightness",
|
|
5562
5519
|
"contrast",
|
|
5563
5520
|
"saturation",
|
|
@@ -5565,8 +5522,8 @@ const { ColorMatrixFilter: hr } = D, K = {
|
|
|
5565
5522
|
"sepia",
|
|
5566
5523
|
"negative"
|
|
5567
5524
|
]);
|
|
5568
|
-
function
|
|
5569
|
-
return
|
|
5525
|
+
function cr(a) {
|
|
5526
|
+
return lr.has(a);
|
|
5570
5527
|
}
|
|
5571
5528
|
function se(a, e) {
|
|
5572
5529
|
if (typeof a == "number" && Number.isFinite(a))
|
|
@@ -5589,7 +5546,7 @@ function it(a, e) {
|
|
|
5589
5546
|
}
|
|
5590
5547
|
return e;
|
|
5591
5548
|
}
|
|
5592
|
-
function
|
|
5549
|
+
function hr(a) {
|
|
5593
5550
|
return {
|
|
5594
5551
|
brightness: se(a.brightness, K.brightness),
|
|
5595
5552
|
contrast: se(a.contrast, K.contrast),
|
|
@@ -5602,7 +5559,7 @@ function pr(a) {
|
|
|
5602
5559
|
function Ie(a, e) {
|
|
5603
5560
|
a.reset(), e.brightness !== 1 && a.brightness(e.brightness, !0), e.contrast !== 1 && a.contrast(e.contrast, !0), e.saturation !== 1 && a.saturate(e.saturation, !0), e.hue !== 0 && a.hue(e.hue, !0), e.sepia > 0 && a.sepia(!0), e.negative && a.negative(!0);
|
|
5604
5561
|
}
|
|
5605
|
-
|
|
5562
|
+
_({
|
|
5606
5563
|
id: "adjustment-advanced",
|
|
5607
5564
|
name: "Advanced Adjustment",
|
|
5608
5565
|
category: "adjust",
|
|
@@ -5610,10 +5567,10 @@ y({
|
|
|
5610
5567
|
// Create an instance of the ColorMatrixFilter with the provided parameters
|
|
5611
5568
|
createFilter: (a) => {
|
|
5612
5569
|
try {
|
|
5613
|
-
const e =
|
|
5570
|
+
const e = hr(a ?? {}), t = new or(), r = t;
|
|
5614
5571
|
return r._customParams = { ...e }, Ie(t, e), r.updateUIParam = function(s, n) {
|
|
5615
5572
|
try {
|
|
5616
|
-
if (!
|
|
5573
|
+
if (!cr(s))
|
|
5617
5574
|
return;
|
|
5618
5575
|
const o = this._customParams ?? { ...K };
|
|
5619
5576
|
if (s === "negative")
|
|
@@ -5701,13 +5658,13 @@ y({
|
|
|
5701
5658
|
]
|
|
5702
5659
|
});
|
|
5703
5660
|
const De = (a) => Math.max(0, Math.min(1, a));
|
|
5704
|
-
|
|
5661
|
+
_({
|
|
5705
5662
|
id: "alpha",
|
|
5706
5663
|
name: "Alpha",
|
|
5707
5664
|
category: "adjust",
|
|
5708
5665
|
description: "Adjust the opacity of the image",
|
|
5709
5666
|
createFilter: (a) => {
|
|
5710
|
-
const e = De(a.alpha !== void 0 ? Number(a.alpha) : 1), t = new
|
|
5667
|
+
const e = De(a.alpha !== void 0 ? Number(a.alpha) : 1), t = new I.AlphaFilter(e);
|
|
5711
5668
|
return t.updateUIParam = function(r, i) {
|
|
5712
5669
|
r === "alpha" && (this.alpha = De(Number(i)));
|
|
5713
5670
|
}, t;
|
|
@@ -5728,7 +5685,7 @@ y({
|
|
|
5728
5685
|
}
|
|
5729
5686
|
]
|
|
5730
5687
|
});
|
|
5731
|
-
|
|
5688
|
+
_({
|
|
5732
5689
|
id: "blur",
|
|
5733
5690
|
name: "Blur",
|
|
5734
5691
|
category: "blur",
|
|
@@ -5739,7 +5696,7 @@ y({
|
|
|
5739
5696
|
*/
|
|
5740
5697
|
createFilter: (a) => {
|
|
5741
5698
|
try {
|
|
5742
|
-
const e = new
|
|
5699
|
+
const e = new I.BlurFilter({
|
|
5743
5700
|
strength: a.blur || 8,
|
|
5744
5701
|
quality: a.quality || 4
|
|
5745
5702
|
});
|
|
@@ -5804,13 +5761,13 @@ function je(a) {
|
|
|
5804
5761
|
negative: !!a.negative
|
|
5805
5762
|
};
|
|
5806
5763
|
}
|
|
5807
|
-
|
|
5764
|
+
_({
|
|
5808
5765
|
id: "color-matrix",
|
|
5809
5766
|
name: "Color Matrix",
|
|
5810
5767
|
category: "advanced",
|
|
5811
5768
|
description: "Advanced color adjustments including sepia, hue rotation, and negative",
|
|
5812
5769
|
createFilter: (a) => {
|
|
5813
|
-
const e =
|
|
5770
|
+
const e = I.ColorMatrixFilter;
|
|
5814
5771
|
if (!e) return null;
|
|
5815
5772
|
const t = new e(), r = je(a);
|
|
5816
5773
|
return t._customParams = { ...r }, Oe(t, r), t.updateUIParam = function(i, s) {
|
|
@@ -5899,8 +5856,8 @@ y({
|
|
|
5899
5856
|
}
|
|
5900
5857
|
]
|
|
5901
5858
|
});
|
|
5902
|
-
const { ColorOverlayFilter:
|
|
5903
|
-
|
|
5859
|
+
const { ColorOverlayFilter: dr } = v;
|
|
5860
|
+
_({
|
|
5904
5861
|
id: "colorOverlay",
|
|
5905
5862
|
name: "Color Overlay",
|
|
5906
5863
|
category: "color",
|
|
@@ -5914,7 +5871,7 @@ y({
|
|
|
5914
5871
|
try {
|
|
5915
5872
|
let e = 16711680;
|
|
5916
5873
|
a.color && (typeof a.color == "string" ? e = parseInt(a.color.replace("#", "0x"), 16) : typeof a.color == "number" && (e = a.color));
|
|
5917
|
-
const t = new
|
|
5874
|
+
const t = new dr({
|
|
5918
5875
|
color: e,
|
|
5919
5876
|
alpha: a.alpha || 0.5
|
|
5920
5877
|
});
|
|
@@ -5964,7 +5921,7 @@ y({
|
|
|
5964
5921
|
}
|
|
5965
5922
|
]
|
|
5966
5923
|
});
|
|
5967
|
-
|
|
5924
|
+
_({
|
|
5968
5925
|
id: "drop-shadow",
|
|
5969
5926
|
name: "Drop Shadow",
|
|
5970
5927
|
category: "effects",
|
|
@@ -5990,8 +5947,8 @@ y({
|
|
|
5990
5947
|
y: a.pixelSizeY !== void 0 ? a.pixelSizeY : 1
|
|
5991
5948
|
}
|
|
5992
5949
|
}), l = (h, u, p, m) => {
|
|
5993
|
-
const g = h * u * 2,
|
|
5994
|
-
return Math.ceil(g +
|
|
5950
|
+
const g = h * u * 2, y = Math.sqrt(p * p + m * m);
|
|
5951
|
+
return Math.ceil(g + y + 2);
|
|
5995
5952
|
};
|
|
5996
5953
|
o._exportPadding = l(i, s, n.x, n.y), o.padding = Math.max(o.padding ?? 0, o._exportPadding), o._customParams = {
|
|
5997
5954
|
...a,
|
|
@@ -6001,7 +5958,7 @@ y({
|
|
|
6001
5958
|
_angle: r
|
|
6002
5959
|
};
|
|
6003
5960
|
const c = (h, u) => {
|
|
6004
|
-
const p = Number(h._distance ?? h.distance ?? 5) * u, m = Number(h._angle ?? h.angle ?? 90), g = Number(h.blur ?? 2) * u,
|
|
5961
|
+
const p = Number(h._distance ?? h.distance ?? 5) * u, m = Number(h._angle ?? h.angle ?? 90), g = Number(h.blur ?? 2) * u, y = Number(h.quality ?? 3), C = {
|
|
6005
5962
|
x: p * Math.cos(m * Math.PI / 180),
|
|
6006
5963
|
y: p * Math.sin(m * Math.PI / 180)
|
|
6007
5964
|
}, k = h.color ? String(h.color).replace("#", "0x") : "0x000000", A = new v.DropShadowFilter({
|
|
@@ -6009,13 +5966,13 @@ y({
|
|
|
6009
5966
|
color: parseInt(k, 16),
|
|
6010
5967
|
alpha: h.alpha !== void 0 ? Number(h.alpha) : 0.5,
|
|
6011
5968
|
blur: g,
|
|
6012
|
-
quality:
|
|
5969
|
+
quality: y,
|
|
6013
5970
|
shadowOnly: h.shadowOnly !== void 0 ? !!h.shadowOnly : !1,
|
|
6014
5971
|
pixelSize: {
|
|
6015
5972
|
x: h.pixelSizeX !== void 0 ? Number(h.pixelSizeX) : 1,
|
|
6016
5973
|
y: h.pixelSizeY !== void 0 ? Number(h.pixelSizeY) : 1
|
|
6017
5974
|
}
|
|
6018
|
-
}), P = l(g,
|
|
5975
|
+
}), P = l(g, y, C.x, C.y);
|
|
6019
5976
|
return A._exportPadding = P, A.padding = Math.max(A.padding ?? 0, P), A;
|
|
6020
5977
|
};
|
|
6021
5978
|
o.createExportFilter = function(h = {}) {
|
|
@@ -6025,8 +5982,8 @@ y({
|
|
|
6025
5982
|
return Number(this._exportPadding || this.padding || 0);
|
|
6026
5983
|
};
|
|
6027
5984
|
const d = (h) => {
|
|
6028
|
-
var
|
|
6029
|
-
const u = ((
|
|
5985
|
+
var y;
|
|
5986
|
+
const u = ((y = h._customParams) == null ? void 0 : y._offset) ?? { x: 0, y: 0 }, p = Number(h.blur ?? 0), m = Number(h.quality ?? 1), g = l(p, m, u.x, u.y);
|
|
6030
5987
|
h._exportPadding = g, h.padding = Math.max(h.padding ?? 0, g);
|
|
6031
5988
|
};
|
|
6032
5989
|
return o.updateUIParam = function(h, u) {
|
|
@@ -6177,8 +6134,8 @@ y({
|
|
|
6177
6134
|
}
|
|
6178
6135
|
]
|
|
6179
6136
|
});
|
|
6180
|
-
const { ColorMatrixFilter:
|
|
6181
|
-
|
|
6137
|
+
const { ColorMatrixFilter: ur } = I;
|
|
6138
|
+
_({
|
|
6182
6139
|
id: "grayscale",
|
|
6183
6140
|
name: "Grayscale",
|
|
6184
6141
|
category: "color",
|
|
@@ -6190,7 +6147,7 @@ y({
|
|
|
6190
6147
|
*/
|
|
6191
6148
|
createFilter: (a) => {
|
|
6192
6149
|
try {
|
|
6193
|
-
const e = new
|
|
6150
|
+
const e = new ur();
|
|
6194
6151
|
e._customParams = { ...a };
|
|
6195
6152
|
const t = a.intensity !== void 0 ? a.intensity : 1;
|
|
6196
6153
|
return Ye(e, t), e.updateUIParam = function(r, i) {
|
|
@@ -6230,8 +6187,8 @@ y({
|
|
|
6230
6187
|
function Ye(a, e) {
|
|
6231
6188
|
a.reset(), a.greyscale(e);
|
|
6232
6189
|
}
|
|
6233
|
-
const { HslAdjustmentFilter:
|
|
6234
|
-
|
|
6190
|
+
const { HslAdjustmentFilter: pr } = v;
|
|
6191
|
+
_({
|
|
6235
6192
|
id: "hsl-adjustment",
|
|
6236
6193
|
name: "HSL Adjustment",
|
|
6237
6194
|
category: "color",
|
|
@@ -6242,7 +6199,7 @@ y({
|
|
|
6242
6199
|
*/
|
|
6243
6200
|
createFilter: (a) => {
|
|
6244
6201
|
try {
|
|
6245
|
-
const e = new
|
|
6202
|
+
const e = new pr({
|
|
6246
6203
|
hue: a.hue !== void 0 ? a.hue : 0,
|
|
6247
6204
|
saturation: a.saturation !== void 0 ? a.saturation : 0,
|
|
6248
6205
|
lightness: a.lightness !== void 0 ? a.lightness : 0,
|
|
@@ -6340,8 +6297,8 @@ y({
|
|
|
6340
6297
|
}
|
|
6341
6298
|
]
|
|
6342
6299
|
});
|
|
6343
|
-
const { KawaseBlurFilter:
|
|
6344
|
-
|
|
6300
|
+
const { KawaseBlurFilter: fr } = v;
|
|
6301
|
+
_({
|
|
6345
6302
|
id: "kawase-blur",
|
|
6346
6303
|
name: "Kawase Blur",
|
|
6347
6304
|
category: "blur",
|
|
@@ -6353,7 +6310,7 @@ y({
|
|
|
6353
6310
|
*/
|
|
6354
6311
|
createFilter: (a) => {
|
|
6355
6312
|
try {
|
|
6356
|
-
const e = new
|
|
6313
|
+
const e = new fr({
|
|
6357
6314
|
strength: a.strength || 4,
|
|
6358
6315
|
quality: a.quality || 3,
|
|
6359
6316
|
clamp: a.clamp || !1,
|
|
@@ -6458,8 +6415,8 @@ y({
|
|
|
6458
6415
|
}
|
|
6459
6416
|
]
|
|
6460
6417
|
});
|
|
6461
|
-
const { MotionBlurFilter:
|
|
6462
|
-
|
|
6418
|
+
const { MotionBlurFilter: mr } = v;
|
|
6419
|
+
_({
|
|
6463
6420
|
id: "motion-blur",
|
|
6464
6421
|
name: "Motion Blur",
|
|
6465
6422
|
category: "blur",
|
|
@@ -6471,7 +6428,7 @@ y({
|
|
|
6471
6428
|
*/
|
|
6472
6429
|
createFilter: (a) => {
|
|
6473
6430
|
try {
|
|
6474
|
-
const e = new
|
|
6431
|
+
const e = new mr({
|
|
6475
6432
|
velocity: {
|
|
6476
6433
|
x: a.velocityX !== void 0 ? a.velocityX : 0,
|
|
6477
6434
|
y: a.velocityY !== void 0 ? a.velocityY : 0
|
|
@@ -6566,8 +6523,8 @@ y({
|
|
|
6566
6523
|
}
|
|
6567
6524
|
]
|
|
6568
6525
|
});
|
|
6569
|
-
const { RadialBlurFilter:
|
|
6570
|
-
|
|
6526
|
+
const { RadialBlurFilter: gr } = v;
|
|
6527
|
+
_({
|
|
6571
6528
|
id: "radial-blur",
|
|
6572
6529
|
name: "Radial Blur",
|
|
6573
6530
|
category: "blur",
|
|
@@ -6575,7 +6532,7 @@ y({
|
|
|
6575
6532
|
// Create an instance of the RadialBlurFilter with the provided parameters
|
|
6576
6533
|
createFilter: (a) => {
|
|
6577
6534
|
try {
|
|
6578
|
-
const e = new
|
|
6535
|
+
const e = new gr({
|
|
6579
6536
|
angle: a.angle ?? 20,
|
|
6580
6537
|
center: { x: a.centerX ?? 0, y: a.centerY ?? 0 },
|
|
6581
6538
|
kernelSize: a.kernelSize ?? 15,
|
|
@@ -6690,8 +6647,8 @@ y({
|
|
|
6690
6647
|
}
|
|
6691
6648
|
]
|
|
6692
6649
|
});
|
|
6693
|
-
const { TiltShiftFilter:
|
|
6694
|
-
|
|
6650
|
+
const { TiltShiftFilter: br } = v;
|
|
6651
|
+
_({
|
|
6695
6652
|
id: "tilt-shift",
|
|
6696
6653
|
name: "Tilt Shift",
|
|
6697
6654
|
category: "blur",
|
|
@@ -6699,7 +6656,7 @@ y({
|
|
|
6699
6656
|
// Create an instance of the TiltShiftFilter with the provided parameters
|
|
6700
6657
|
createFilter: (a) => {
|
|
6701
6658
|
try {
|
|
6702
|
-
const e = typeof a.blur == "number" ? a.blur : 100, t = typeof a.gradientBlur == "number" ? a.gradientBlur : 600, r = typeof a.startX == "number" ? a.startX : 0, i = typeof a.startY == "number" ? a.startY : 0.5, s = typeof a.endX == "number" ? a.endX : 1, n = typeof a.endY == "number" ? a.endY : 0.5, o = new
|
|
6659
|
+
const e = typeof a.blur == "number" ? a.blur : 100, t = typeof a.gradientBlur == "number" ? a.gradientBlur : 600, r = typeof a.startX == "number" ? a.startX : 0, i = typeof a.startY == "number" ? a.startY : 0.5, s = typeof a.endX == "number" ? a.endX : 1, n = typeof a.endY == "number" ? a.endY : 0.5, o = new br({
|
|
6703
6660
|
blur: Number(e),
|
|
6704
6661
|
gradientBlur: Number(t),
|
|
6705
6662
|
start: { x: Number(r), y: Number(i) },
|
|
@@ -6818,8 +6775,8 @@ y({
|
|
|
6818
6775
|
}
|
|
6819
6776
|
]
|
|
6820
6777
|
});
|
|
6821
|
-
const { ZoomBlurFilter:
|
|
6822
|
-
|
|
6778
|
+
const { ZoomBlurFilter: yr } = v;
|
|
6779
|
+
_({
|
|
6823
6780
|
id: "zoom-blur",
|
|
6824
6781
|
name: "Zoom Blur",
|
|
6825
6782
|
category: "blur",
|
|
@@ -6831,7 +6788,7 @@ y({
|
|
|
6831
6788
|
*/
|
|
6832
6789
|
createFilter: (a) => {
|
|
6833
6790
|
try {
|
|
6834
|
-
const e = new
|
|
6791
|
+
const e = new yr({
|
|
6835
6792
|
strength: a.strength || 0.1,
|
|
6836
6793
|
center: {
|
|
6837
6794
|
x: a.centerX !== void 0 ? a.centerX : 0.5,
|
|
@@ -6949,7 +6906,7 @@ const { ColorGradientFilter: Ue } = v;
|
|
|
6949
6906
|
function st(a) {
|
|
6950
6907
|
return parseInt(a.replace("#", "0x"), 16);
|
|
6951
6908
|
}
|
|
6952
|
-
function
|
|
6909
|
+
function _r(a) {
|
|
6953
6910
|
return "#" + a.toString(16).padStart(6, "0");
|
|
6954
6911
|
}
|
|
6955
6912
|
function Xe(a) {
|
|
@@ -6962,11 +6919,11 @@ function Xe(a) {
|
|
|
6962
6919
|
function Ve(a) {
|
|
6963
6920
|
return {
|
|
6964
6921
|
offset: a.offset,
|
|
6965
|
-
color: typeof a.color == "number" ?
|
|
6922
|
+
color: typeof a.color == "number" ? _r(a.color) : a.color,
|
|
6966
6923
|
alpha: a.alpha
|
|
6967
6924
|
};
|
|
6968
6925
|
}
|
|
6969
|
-
|
|
6926
|
+
_({
|
|
6970
6927
|
id: "color-gradient",
|
|
6971
6928
|
name: "Color Gradient",
|
|
6972
6929
|
category: "color",
|
|
@@ -7173,7 +7130,7 @@ y({
|
|
|
7173
7130
|
}
|
|
7174
7131
|
]
|
|
7175
7132
|
});
|
|
7176
|
-
|
|
7133
|
+
_({
|
|
7177
7134
|
id: "color-map",
|
|
7178
7135
|
name: "Color Map",
|
|
7179
7136
|
category: "color",
|
|
@@ -7185,7 +7142,7 @@ y({
|
|
|
7185
7142
|
if (!e)
|
|
7186
7143
|
return null;
|
|
7187
7144
|
let t = null;
|
|
7188
|
-
a.texturePath ? t =
|
|
7145
|
+
a.texturePath ? t = I.Texture.from(a.texturePath) : t = I.Texture.from("/examples/filters-main/examples/images/colormap.png");
|
|
7189
7146
|
const r = new e({
|
|
7190
7147
|
colorMap: t,
|
|
7191
7148
|
nearest: a.nearest,
|
|
@@ -7195,7 +7152,7 @@ y({
|
|
|
7195
7152
|
const n = this._customParams || {};
|
|
7196
7153
|
switch (this._customParams = n, n[i] = s, i) {
|
|
7197
7154
|
case "texturePath":
|
|
7198
|
-
s && (this.colorMap =
|
|
7155
|
+
s && (this.colorMap = I.Texture.from(s));
|
|
7199
7156
|
break;
|
|
7200
7157
|
case "mix":
|
|
7201
7158
|
this.mix = s;
|
|
@@ -7256,8 +7213,8 @@ y({
|
|
|
7256
7213
|
}
|
|
7257
7214
|
]
|
|
7258
7215
|
});
|
|
7259
|
-
const
|
|
7260
|
-
|
|
7216
|
+
const xr = v.ColorReplaceFilter;
|
|
7217
|
+
_({
|
|
7261
7218
|
id: "color-replace",
|
|
7262
7219
|
name: "Color Replace",
|
|
7263
7220
|
category: "color",
|
|
@@ -7273,7 +7230,7 @@ y({
|
|
|
7273
7230
|
a.originalColor && (typeof a.originalColor == "string" ? e = parseInt(a.originalColor.replace("#", "0x"), 16) : typeof a.originalColor == "number" && (e = a.originalColor));
|
|
7274
7231
|
let t = 255;
|
|
7275
7232
|
a.targetColor && (typeof a.targetColor == "string" ? t = parseInt(a.targetColor.replace("#", "0x"), 16) : typeof a.targetColor == "number" && (t = a.targetColor));
|
|
7276
|
-
const r = new
|
|
7233
|
+
const r = new xr({
|
|
7277
7234
|
originalColor: e,
|
|
7278
7235
|
targetColor: t,
|
|
7279
7236
|
tolerance: a.tolerance || 0.4
|
|
@@ -7337,8 +7294,8 @@ y({
|
|
|
7337
7294
|
}
|
|
7338
7295
|
]
|
|
7339
7296
|
});
|
|
7340
|
-
const
|
|
7341
|
-
|
|
7297
|
+
const wr = v.MultiColorReplaceFilter;
|
|
7298
|
+
_({
|
|
7342
7299
|
id: "multi-color-replace",
|
|
7343
7300
|
name: "Multi-Color Replace",
|
|
7344
7301
|
category: "color",
|
|
@@ -7363,7 +7320,7 @@ y({
|
|
|
7363
7320
|
const r = typeof a.originalColor3 == "string" ? parseInt(a.originalColor3.replace("#", "0x"), 16) : a.originalColor3, i = typeof a.targetColor3 == "string" ? parseInt(a.targetColor3.replace("#", "0x"), 16) : a.targetColor3;
|
|
7364
7321
|
e.push([r, i]);
|
|
7365
7322
|
}
|
|
7366
|
-
const t = new
|
|
7323
|
+
const t = new wr(
|
|
7367
7324
|
e,
|
|
7368
7325
|
a.tolerance || 0.05,
|
|
7369
7326
|
3
|
|
@@ -7474,8 +7431,8 @@ y({
|
|
|
7474
7431
|
}
|
|
7475
7432
|
]
|
|
7476
7433
|
});
|
|
7477
|
-
const { RGBSplitFilter:
|
|
7478
|
-
|
|
7434
|
+
const { RGBSplitFilter: vr } = v;
|
|
7435
|
+
_({
|
|
7479
7436
|
id: "rgb-split",
|
|
7480
7437
|
name: "RGB Split",
|
|
7481
7438
|
category: "color",
|
|
@@ -7495,7 +7452,7 @@ y({
|
|
|
7495
7452
|
}, r = {
|
|
7496
7453
|
x: a.blueX !== void 0 ? a.blueX : 0,
|
|
7497
7454
|
y: a.blueY !== void 0 ? a.blueY : 0
|
|
7498
|
-
}, i = new
|
|
7455
|
+
}, i = new vr({
|
|
7499
7456
|
red: e,
|
|
7500
7457
|
green: t,
|
|
7501
7458
|
blue: r
|
|
@@ -7608,8 +7565,8 @@ y({
|
|
|
7608
7565
|
}
|
|
7609
7566
|
]
|
|
7610
7567
|
});
|
|
7611
|
-
const { AdvancedBloomFilter:
|
|
7612
|
-
|
|
7568
|
+
const { AdvancedBloomFilter: Cr } = v;
|
|
7569
|
+
_({
|
|
7613
7570
|
id: "advanced-bloom",
|
|
7614
7571
|
name: "Advanced Bloom",
|
|
7615
7572
|
category: "light",
|
|
@@ -7617,7 +7574,7 @@ y({
|
|
|
7617
7574
|
// Create an instance of the AdvancedBloomFilter with the provided parameters
|
|
7618
7575
|
createFilter: (a) => {
|
|
7619
7576
|
try {
|
|
7620
|
-
const e = new
|
|
7577
|
+
const e = new Cr({
|
|
7621
7578
|
threshold: a.threshold || 0.5,
|
|
7622
7579
|
bloomScale: a.bloomScale || 1,
|
|
7623
7580
|
brightness: a.brightness || 1,
|
|
@@ -7764,8 +7721,8 @@ y({
|
|
|
7764
7721
|
}
|
|
7765
7722
|
]
|
|
7766
7723
|
});
|
|
7767
|
-
const
|
|
7768
|
-
|
|
7724
|
+
const kr = v.AsciiFilter;
|
|
7725
|
+
_({
|
|
7769
7726
|
id: "ascii",
|
|
7770
7727
|
name: "ASCII",
|
|
7771
7728
|
category: "stylize",
|
|
@@ -7776,7 +7733,7 @@ y({
|
|
|
7776
7733
|
const e = typeof a.size == "number" ? a.size : 8;
|
|
7777
7734
|
let t = a.color;
|
|
7778
7735
|
typeof t == "string" && t.startsWith("#") && (t = parseInt(t.replace("#", "0x"), 16));
|
|
7779
|
-
const r = a.replaceColor === !0, i = new
|
|
7736
|
+
const r = a.replaceColor === !0, i = new kr({
|
|
7780
7737
|
size: e,
|
|
7781
7738
|
color: t,
|
|
7782
7739
|
replaceColor: r
|
|
@@ -7843,8 +7800,8 @@ y({
|
|
|
7843
7800
|
}
|
|
7844
7801
|
]
|
|
7845
7802
|
});
|
|
7846
|
-
const
|
|
7847
|
-
|
|
7803
|
+
const Sr = v.BackdropBlurFilter;
|
|
7804
|
+
_({
|
|
7848
7805
|
id: "backdrop-blur",
|
|
7849
7806
|
name: "Backdrop Blur",
|
|
7850
7807
|
category: "blur",
|
|
@@ -7852,7 +7809,7 @@ y({
|
|
|
7852
7809
|
// Create an instance of the BackdropBlurFilter with the provided parameters
|
|
7853
7810
|
createFilter: (a) => {
|
|
7854
7811
|
try {
|
|
7855
|
-
const e = new
|
|
7812
|
+
const e = new Sr({
|
|
7856
7813
|
// Higher strength values (20-50) make the effect more noticeable
|
|
7857
7814
|
strength: a.strength || 20,
|
|
7858
7815
|
quality: a.quality || 4,
|
|
@@ -7950,8 +7907,8 @@ y({
|
|
|
7950
7907
|
}
|
|
7951
7908
|
]
|
|
7952
7909
|
});
|
|
7953
|
-
const { BevelFilter:
|
|
7954
|
-
|
|
7910
|
+
const { BevelFilter: Fr } = v;
|
|
7911
|
+
_({
|
|
7955
7912
|
id: "bevel",
|
|
7956
7913
|
name: "Bevel",
|
|
7957
7914
|
category: "effects",
|
|
@@ -7962,7 +7919,7 @@ y({
|
|
|
7962
7919
|
*/
|
|
7963
7920
|
createFilter: (a) => {
|
|
7964
7921
|
try {
|
|
7965
|
-
const e = a.lightColor ? a.lightColor.replace("#", "0x") : "0xffffff", t = a.shadowColor ? a.shadowColor.replace("#", "0x") : "0x000000", r = new
|
|
7922
|
+
const e = a.lightColor ? a.lightColor.replace("#", "0x") : "0xffffff", t = a.shadowColor ? a.shadowColor.replace("#", "0x") : "0x000000", r = new Fr({
|
|
7966
7923
|
rotation: a.rotation !== void 0 ? a.rotation : 45,
|
|
7967
7924
|
thickness: a.thickness !== void 0 ? a.thickness : 2,
|
|
7968
7925
|
lightColor: parseInt(e, 16),
|
|
@@ -8078,8 +8035,8 @@ y({
|
|
|
8078
8035
|
}
|
|
8079
8036
|
]
|
|
8080
8037
|
});
|
|
8081
|
-
const { BloomFilter:
|
|
8082
|
-
|
|
8038
|
+
const { BloomFilter: Mr } = v;
|
|
8039
|
+
_({
|
|
8083
8040
|
id: "bloom",
|
|
8084
8041
|
name: "Bloom/Glow",
|
|
8085
8042
|
category: "light",
|
|
@@ -8087,7 +8044,7 @@ y({
|
|
|
8087
8044
|
// Create an instance of the BloomFilter with the provided parameters
|
|
8088
8045
|
createFilter: (a) => {
|
|
8089
8046
|
try {
|
|
8090
|
-
const e = typeof a.strengthX == "number" ? a.strengthX : 2, t = typeof a.strengthY == "number" ? a.strengthY : 2, r = typeof a.quality == "number" ? a.quality : 4, i = typeof a.resolution == "number" ? a.resolution : 1, s = typeof a.kernelSize == "number" ? a.kernelSize : 5, n = new
|
|
8047
|
+
const e = typeof a.strengthX == "number" ? a.strengthX : 2, t = typeof a.strengthY == "number" ? a.strengthY : 2, r = typeof a.quality == "number" ? a.quality : 4, i = typeof a.resolution == "number" ? a.resolution : 1, s = typeof a.kernelSize == "number" ? a.kernelSize : 5, n = new Mr({
|
|
8091
8048
|
strength: {
|
|
8092
8049
|
x: Number(e),
|
|
8093
8050
|
y: Number(t)
|
|
@@ -8194,7 +8151,7 @@ const { BulgePinchFilter: He } = v, Se = (a) => {
|
|
|
8194
8151
|
const e = Math.max(0, Number(a) || 0);
|
|
8195
8152
|
return Math.ceil(e + 2);
|
|
8196
8153
|
};
|
|
8197
|
-
|
|
8154
|
+
_({
|
|
8198
8155
|
id: "bulge-pinch",
|
|
8199
8156
|
name: "Bulge/Pinch",
|
|
8200
8157
|
category: "distortion",
|
|
@@ -8298,7 +8255,7 @@ y({
|
|
|
8298
8255
|
}
|
|
8299
8256
|
]
|
|
8300
8257
|
});
|
|
8301
|
-
const { ConvolutionFilter:
|
|
8258
|
+
const { ConvolutionFilter: Pr } = v, re = {
|
|
8302
8259
|
normal: [0, 0, 0, 0, 1, 0, 0, 0, 0],
|
|
8303
8260
|
gaussianBlur: [0.045, 0.122, 0.045, 0.122, 0.332, 0.122, 0.045, 0.122, 0.045],
|
|
8304
8261
|
boxBlur: [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9],
|
|
@@ -8309,7 +8266,7 @@ const { ConvolutionFilter: zr } = v, re = {
|
|
|
8309
8266
|
sobelHorizontal: [1, 2, 1, 0, 0, 0, -1, -2, -1],
|
|
8310
8267
|
sobelVertical: [1, 0, -1, 2, 0, -2, 1, 0, -1]
|
|
8311
8268
|
};
|
|
8312
|
-
|
|
8269
|
+
_({
|
|
8313
8270
|
id: "convolution",
|
|
8314
8271
|
name: "Convolution Matrix",
|
|
8315
8272
|
category: "effects",
|
|
@@ -8333,7 +8290,7 @@ y({
|
|
|
8333
8290
|
const r = a.preset;
|
|
8334
8291
|
e = re[r] || re.normal;
|
|
8335
8292
|
}
|
|
8336
|
-
const t = new
|
|
8293
|
+
const t = new Pr(e, a.width || 200, a.height || 200);
|
|
8337
8294
|
return t._customParams = { ...a }, t.updateUIParam = function(r, i) {
|
|
8338
8295
|
const s = this._customParams || {};
|
|
8339
8296
|
switch (this._customParams = s, s[r] = i, r) {
|
|
@@ -8544,8 +8501,8 @@ y({
|
|
|
8544
8501
|
}
|
|
8545
8502
|
]
|
|
8546
8503
|
});
|
|
8547
|
-
const { CrossHatchFilter:
|
|
8548
|
-
|
|
8504
|
+
const { CrossHatchFilter: Ar } = v;
|
|
8505
|
+
_({
|
|
8549
8506
|
id: "cross-hatch",
|
|
8550
8507
|
name: "Cross Hatch",
|
|
8551
8508
|
category: "stylize",
|
|
@@ -8554,7 +8511,7 @@ y({
|
|
|
8554
8511
|
// Note: CrossHatchFilter has NO parameters according to PixiJS examples
|
|
8555
8512
|
createFilter: (a) => {
|
|
8556
8513
|
try {
|
|
8557
|
-
const e = new
|
|
8514
|
+
const e = new Ar();
|
|
8558
8515
|
return e.updateUIParam = function(t, r) {
|
|
8559
8516
|
return !0;
|
|
8560
8517
|
}, e;
|
|
@@ -8567,7 +8524,7 @@ y({
|
|
|
8567
8524
|
// No UI controls since CrossHatchFilter has no parameters
|
|
8568
8525
|
controls: []
|
|
8569
8526
|
});
|
|
8570
|
-
|
|
8527
|
+
_({
|
|
8571
8528
|
id: "crt",
|
|
8572
8529
|
name: "CRT Screen",
|
|
8573
8530
|
category: "stylize",
|
|
@@ -8751,8 +8708,8 @@ y({
|
|
|
8751
8708
|
}
|
|
8752
8709
|
]
|
|
8753
8710
|
});
|
|
8754
|
-
const
|
|
8755
|
-
|
|
8711
|
+
const Nr = I.DisplacementFilter, Tr = I.Sprite, Fe = I.Texture;
|
|
8712
|
+
_({
|
|
8756
8713
|
id: "displacement",
|
|
8757
8714
|
// ID must match what the application expects
|
|
8758
8715
|
name: "Displacement Map",
|
|
@@ -8777,7 +8734,7 @@ y({
|
|
|
8777
8734
|
}
|
|
8778
8735
|
t = Fe.from(n);
|
|
8779
8736
|
}
|
|
8780
|
-
const r = new
|
|
8737
|
+
const r = new Tr(t), i = new Nr(r, a.scale || 50);
|
|
8781
8738
|
return i.scale.x = a.scaleX || 50, i.scale.y = a.scaleY || 50, i._customParams = { ...a }, i._displacementSprite = r, i.updateUIParam = function(s, n) {
|
|
8782
8739
|
const o = this._customParams || {};
|
|
8783
8740
|
switch (this._customParams = o, o[s] = n, s) {
|
|
@@ -8850,7 +8807,7 @@ y({
|
|
|
8850
8807
|
}
|
|
8851
8808
|
]
|
|
8852
8809
|
});
|
|
8853
|
-
|
|
8810
|
+
_({
|
|
8854
8811
|
id: "dot",
|
|
8855
8812
|
name: "Dot Screen",
|
|
8856
8813
|
category: "stylize",
|
|
@@ -8924,8 +8881,8 @@ y({
|
|
|
8924
8881
|
}
|
|
8925
8882
|
]
|
|
8926
8883
|
});
|
|
8927
|
-
const { EmbossFilter:
|
|
8928
|
-
|
|
8884
|
+
const { EmbossFilter: zr } = v;
|
|
8885
|
+
_({
|
|
8929
8886
|
id: "emboss",
|
|
8930
8887
|
name: "Emboss",
|
|
8931
8888
|
category: "stylize",
|
|
@@ -8933,7 +8890,7 @@ y({
|
|
|
8933
8890
|
// Create an instance of the Emboss filter with the provided parameters
|
|
8934
8891
|
createFilter: (a) => {
|
|
8935
8892
|
try {
|
|
8936
|
-
const e = typeof a.strength == "number" ? a.strength : 5, t = new
|
|
8893
|
+
const e = typeof a.strength == "number" ? a.strength : 5, t = new zr(e);
|
|
8937
8894
|
return t._customParams = {
|
|
8938
8895
|
strength: e
|
|
8939
8896
|
}, t.updateUIParam = function(r, i) {
|
|
@@ -8973,21 +8930,21 @@ y({
|
|
|
8973
8930
|
}
|
|
8974
8931
|
]
|
|
8975
8932
|
});
|
|
8976
|
-
const { GlitchFilter:
|
|
8933
|
+
const { GlitchFilter: Lr } = v, Z = {
|
|
8977
8934
|
TRANSPARENT: 0,
|
|
8978
8935
|
ORIGINAL: 1,
|
|
8979
8936
|
LOOP: 2,
|
|
8980
8937
|
CLAMP: 3,
|
|
8981
8938
|
MIRROR: 4
|
|
8982
8939
|
};
|
|
8983
|
-
|
|
8940
|
+
_({
|
|
8984
8941
|
id: "glitch",
|
|
8985
8942
|
name: "Glitch",
|
|
8986
8943
|
category: "effects",
|
|
8987
8944
|
description: "Apply digital distortion and glitch effects",
|
|
8988
8945
|
createFilter: (a) => {
|
|
8989
8946
|
try {
|
|
8990
|
-
const e = { x: a.redX, y: a.redY }, t = { x: a.greenX, y: a.greenY }, r = { x: a.blueX, y: a.blueY }, i = new
|
|
8947
|
+
const e = { x: a.redX, y: a.redY }, t = { x: a.greenX, y: a.greenY }, r = { x: a.blueX, y: a.blueY }, i = new Lr({
|
|
8991
8948
|
slices: a.slices,
|
|
8992
8949
|
offset: a.offset,
|
|
8993
8950
|
direction: a.direction,
|
|
@@ -9228,8 +9185,8 @@ y({
|
|
|
9228
9185
|
}
|
|
9229
9186
|
]
|
|
9230
9187
|
});
|
|
9231
|
-
const { GlowFilter:
|
|
9232
|
-
|
|
9188
|
+
const { GlowFilter: Rr } = v;
|
|
9189
|
+
_({
|
|
9233
9190
|
id: "glow",
|
|
9234
9191
|
name: "Glow",
|
|
9235
9192
|
category: "light",
|
|
@@ -9237,7 +9194,7 @@ y({
|
|
|
9237
9194
|
// Create an instance of the GlowFilter with the provided parameters
|
|
9238
9195
|
createFilter: (a) => {
|
|
9239
9196
|
try {
|
|
9240
|
-
const e = parseInt(a.color.replace("#", "0x"), 16), t = new
|
|
9197
|
+
const e = parseInt(a.color.replace("#", "0x"), 16), t = new Rr({
|
|
9241
9198
|
distance: a.distance || 10,
|
|
9242
9199
|
outerStrength: a.outerStrength || 4,
|
|
9243
9200
|
innerStrength: a.innerStrength || 0,
|
|
@@ -9363,8 +9320,8 @@ y({
|
|
|
9363
9320
|
}
|
|
9364
9321
|
]
|
|
9365
9322
|
});
|
|
9366
|
-
const { GodrayFilter:
|
|
9367
|
-
|
|
9323
|
+
const { GodrayFilter: Br } = v;
|
|
9324
|
+
_({
|
|
9368
9325
|
id: "godray",
|
|
9369
9326
|
name: "Godray",
|
|
9370
9327
|
category: "light",
|
|
@@ -9372,7 +9329,7 @@ y({
|
|
|
9372
9329
|
// Create an instance of the GodrayFilter with the provided parameters
|
|
9373
9330
|
createFilter: (a) => {
|
|
9374
9331
|
try {
|
|
9375
|
-
const e = new
|
|
9332
|
+
const e = new Br({
|
|
9376
9333
|
angle: a.angle || 30,
|
|
9377
9334
|
parallel: a.parallel ?? !0,
|
|
9378
9335
|
center: {
|
|
@@ -9525,8 +9482,8 @@ y({
|
|
|
9525
9482
|
}
|
|
9526
9483
|
]
|
|
9527
9484
|
});
|
|
9528
|
-
const
|
|
9529
|
-
|
|
9485
|
+
const Er = v.SimpleLightmapFilter, We = I.Texture;
|
|
9486
|
+
_({
|
|
9530
9487
|
id: "lightmap",
|
|
9531
9488
|
name: "Lightmap",
|
|
9532
9489
|
category: "light",
|
|
@@ -9557,7 +9514,7 @@ y({
|
|
|
9557
9514
|
} catch {
|
|
9558
9515
|
o = 0;
|
|
9559
9516
|
}
|
|
9560
|
-
const l = new
|
|
9517
|
+
const l = new Er(n, o, r);
|
|
9561
9518
|
return l._customParams = {
|
|
9562
9519
|
textureType: e,
|
|
9563
9520
|
color: t,
|
|
@@ -9656,15 +9613,15 @@ y({
|
|
|
9656
9613
|
}
|
|
9657
9614
|
]
|
|
9658
9615
|
});
|
|
9659
|
-
const { NoiseFilter:
|
|
9660
|
-
|
|
9616
|
+
const { NoiseFilter: Ir } = I;
|
|
9617
|
+
_({
|
|
9661
9618
|
id: "noise",
|
|
9662
9619
|
name: "Noise",
|
|
9663
9620
|
category: "effects",
|
|
9664
9621
|
description: "Add random noise to the image",
|
|
9665
9622
|
createFilter: (a) => {
|
|
9666
9623
|
try {
|
|
9667
|
-
const e = new
|
|
9624
|
+
const e = new Ir({
|
|
9668
9625
|
noise: a.noise || 0.5,
|
|
9669
9626
|
seed: a.seed || Math.random()
|
|
9670
9627
|
});
|
|
@@ -9741,15 +9698,15 @@ y({
|
|
|
9741
9698
|
}
|
|
9742
9699
|
]
|
|
9743
9700
|
});
|
|
9744
|
-
const { OldFilmFilter:
|
|
9745
|
-
|
|
9701
|
+
const { OldFilmFilter: Dr } = v;
|
|
9702
|
+
_({
|
|
9746
9703
|
id: "old-film",
|
|
9747
9704
|
name: "Old Film",
|
|
9748
9705
|
category: "effects",
|
|
9749
9706
|
description: "Apply a vintage film effect with scratches and grain",
|
|
9750
9707
|
createFilter: (a) => {
|
|
9751
9708
|
try {
|
|
9752
|
-
const e = new
|
|
9709
|
+
const e = new Dr({
|
|
9753
9710
|
sepia: a.sepia,
|
|
9754
9711
|
noise: a.noise,
|
|
9755
9712
|
noiseSize: a.noiseSize,
|
|
@@ -9930,8 +9887,8 @@ y({
|
|
|
9930
9887
|
}
|
|
9931
9888
|
]
|
|
9932
9889
|
});
|
|
9933
|
-
const { OutlineFilter:
|
|
9934
|
-
|
|
9890
|
+
const { OutlineFilter: Or } = v;
|
|
9891
|
+
_({
|
|
9935
9892
|
id: "outline",
|
|
9936
9893
|
name: "Outline",
|
|
9937
9894
|
category: "effects",
|
|
@@ -9940,7 +9897,7 @@ y({
|
|
|
9940
9897
|
try {
|
|
9941
9898
|
let e = a.color;
|
|
9942
9899
|
typeof e == "string" && (e = parseInt(e.replace("#", "0x"), 16));
|
|
9943
|
-
const t = new
|
|
9900
|
+
const t = new Or({
|
|
9944
9901
|
thickness: a.thickness || 4,
|
|
9945
9902
|
color: e,
|
|
9946
9903
|
alpha: a.alpha || 1,
|
|
@@ -10030,15 +9987,15 @@ y({
|
|
|
10030
9987
|
}
|
|
10031
9988
|
]
|
|
10032
9989
|
});
|
|
10033
|
-
const { PixelateFilter:
|
|
10034
|
-
|
|
9990
|
+
const { PixelateFilter: jr } = v;
|
|
9991
|
+
_({
|
|
10035
9992
|
id: "pixelate",
|
|
10036
9993
|
name: "Pixelate",
|
|
10037
9994
|
category: "effects",
|
|
10038
9995
|
description: "Create a pixelated or mosaic effect",
|
|
10039
9996
|
createFilter: (a) => {
|
|
10040
9997
|
try {
|
|
10041
|
-
const e = new
|
|
9998
|
+
const e = new jr(
|
|
10042
9999
|
a.useUniform ? Math.max(4, a.size || 10) : [Math.max(4, a.sizeX || 10), Math.max(4, a.sizeY || 10)]
|
|
10043
10000
|
);
|
|
10044
10001
|
return e._customParams = { ...a }, e.updateUIParam = function(t, r) {
|
|
@@ -10121,8 +10078,8 @@ y({
|
|
|
10121
10078
|
}
|
|
10122
10079
|
]
|
|
10123
10080
|
});
|
|
10124
|
-
const { ReflectionFilter:
|
|
10125
|
-
|
|
10081
|
+
const { ReflectionFilter: Yr } = v;
|
|
10082
|
+
_({
|
|
10126
10083
|
id: "reflection",
|
|
10127
10084
|
// ID must match what the application expects
|
|
10128
10085
|
name: "Reflection",
|
|
@@ -10138,7 +10095,7 @@ y({
|
|
|
10138
10095
|
waveLength: new Float32Array([a.wavelengthStart ?? 30, a.wavelengthEnd ?? 100]),
|
|
10139
10096
|
alpha: new Float32Array([a.alphaStart ?? 1, a.alphaEnd ?? 1]),
|
|
10140
10097
|
time: a.time ?? 0
|
|
10141
|
-
}, t = new
|
|
10098
|
+
}, t = new Yr(e);
|
|
10142
10099
|
return t._customParams = { ...a }, t.animating = a.animating ?? !1, t.updateUIParam = function(r, i) {
|
|
10143
10100
|
const s = this._customParams || {};
|
|
10144
10101
|
switch (this._customParams = s, s[r] = i, r) {
|
|
@@ -10289,8 +10246,8 @@ y({
|
|
|
10289
10246
|
}
|
|
10290
10247
|
]
|
|
10291
10248
|
});
|
|
10292
|
-
const { ShockwaveFilter:
|
|
10293
|
-
|
|
10249
|
+
const { ShockwaveFilter: Ur } = v;
|
|
10250
|
+
_({
|
|
10294
10251
|
id: "shockwave",
|
|
10295
10252
|
// ID must match what the application expects
|
|
10296
10253
|
name: "Shockwave",
|
|
@@ -10299,7 +10256,7 @@ y({
|
|
|
10299
10256
|
// Create an instance of the ShockwaveFilter with the provided parameters
|
|
10300
10257
|
createFilter: (a) => {
|
|
10301
10258
|
try {
|
|
10302
|
-
const e = a.centerX ?? 0.5, t = a.centerY ?? 0.5, r = { x: e, y: t }, i = a.amplitude ?? 30, s = a.wavelength ?? 160, n = a.speed ?? 500, o = a.brightness ?? 1, l = a.radius ?? -1, c = a.time ?? 0, d = new
|
|
10259
|
+
const e = a.centerX ?? 0.5, t = a.centerY ?? 0.5, r = { x: e, y: t }, i = a.amplitude ?? 30, s = a.wavelength ?? 160, n = a.speed ?? 500, o = a.brightness ?? 1, l = a.radius ?? -1, c = a.time ?? 0, d = new Ur({
|
|
10303
10260
|
center: r,
|
|
10304
10261
|
amplitude: i,
|
|
10305
10262
|
wavelength: s,
|
|
@@ -10441,15 +10398,15 @@ y({
|
|
|
10441
10398
|
}
|
|
10442
10399
|
]
|
|
10443
10400
|
});
|
|
10444
|
-
const { SimplexNoiseFilter:
|
|
10445
|
-
|
|
10401
|
+
const { SimplexNoiseFilter: Xr } = v;
|
|
10402
|
+
_({
|
|
10446
10403
|
id: "simplex-noise",
|
|
10447
10404
|
name: "Simplex Noise",
|
|
10448
10405
|
category: "effects",
|
|
10449
10406
|
description: "Apply procedural noise to create texture effects",
|
|
10450
10407
|
createFilter: (a) => {
|
|
10451
10408
|
try {
|
|
10452
|
-
const e = a.animating ? 0 : a.offsetZ || 0, t = new
|
|
10409
|
+
const e = a.animating ? 0 : a.offsetZ || 0, t = new Xr({
|
|
10453
10410
|
strength: a.strength,
|
|
10454
10411
|
noiseScale: a.noiseScale,
|
|
10455
10412
|
offsetX: a.offsetX,
|
|
@@ -10596,15 +10553,15 @@ y({
|
|
|
10596
10553
|
}
|
|
10597
10554
|
]
|
|
10598
10555
|
});
|
|
10599
|
-
const { TwistFilter:
|
|
10600
|
-
const t = Math.max(1, Number(a._sourceWidth ?? 0)), r = Math.max(1, Number(a._sourceHeight ?? 0)), i = Math.min(t, r), s = Number(a.centerX ?? 0.5), n = Number(a.centerY ?? 0.5), o = Number(a.radius ?? 0.25), l = Number(a.angle ?? 4), c = s * t * e, d = n * r * e, h = o * i * e, u = new
|
|
10556
|
+
const { TwistFilter: Vr } = v, at = (a) => Math.ceil(Math.max(0, Number(a) || 0) + 2), qe = (a, e = 1) => {
|
|
10557
|
+
const t = Math.max(1, Number(a._sourceWidth ?? 0)), r = Math.max(1, Number(a._sourceHeight ?? 0)), i = Math.min(t, r), s = Number(a.centerX ?? 0.5), n = Number(a.centerY ?? 0.5), o = Number(a.radius ?? 0.25), l = Number(a.angle ?? 4), c = s * t * e, d = n * r * e, h = o * i * e, u = new Vr({
|
|
10601
10558
|
offset: { x: c, y: d },
|
|
10602
10559
|
radius: h,
|
|
10603
10560
|
angle: l
|
|
10604
10561
|
}), p = at(h);
|
|
10605
10562
|
return u.padding = Math.max(u.padding ?? 0, p), u._exportPadding = p, u;
|
|
10606
10563
|
};
|
|
10607
|
-
|
|
10564
|
+
_({
|
|
10608
10565
|
id: "twist",
|
|
10609
10566
|
name: "Twist",
|
|
10610
10567
|
category: "distortion",
|
|
@@ -10690,8 +10647,8 @@ y({
|
|
|
10690
10647
|
}
|
|
10691
10648
|
]
|
|
10692
10649
|
});
|
|
10693
|
-
const { AdjustmentFilter:
|
|
10694
|
-
function
|
|
10650
|
+
const { AdjustmentFilter: Hr } = v;
|
|
10651
|
+
function ye(a) {
|
|
10695
10652
|
const e = typeof a == "string" ? parseInt(a.replace("#", "0x"), 16) : a;
|
|
10696
10653
|
return [
|
|
10697
10654
|
(e >> 16 & 255) / 255,
|
|
@@ -10699,14 +10656,14 @@ function _e(a) {
|
|
|
10699
10656
|
(e & 255) / 255
|
|
10700
10657
|
];
|
|
10701
10658
|
}
|
|
10702
|
-
class
|
|
10659
|
+
class Wr extends Hr {
|
|
10703
10660
|
constructor(e = {}) {
|
|
10704
10661
|
super({
|
|
10705
10662
|
brightness: 1,
|
|
10706
10663
|
contrast: 1,
|
|
10707
10664
|
saturation: 1,
|
|
10708
10665
|
alpha: 1
|
|
10709
|
-
}), this._radius = 0.8, this._strength = 1, this._colorRgb = [0, 0, 0], this._colorValue = "#000000", this._radius = e.radius ?? 0.8, this._strength = e.strength ?? 1, e.color !== void 0 && (typeof e.color == "string" ? (this._colorValue = e.color, this._colorRgb =
|
|
10666
|
+
}), this._radius = 0.8, this._strength = 1, this._colorRgb = [0, 0, 0], this._colorValue = "#000000", this._radius = e.radius ?? 0.8, this._strength = e.strength ?? 1, e.color !== void 0 && (typeof e.color == "string" ? (this._colorValue = e.color, this._colorRgb = ye(e.color)) : (this._colorValue = "#" + e.color.toString(16).padStart(6, "0"), this._colorRgb = ye(e.color))), this.updateVignette();
|
|
10710
10667
|
}
|
|
10711
10668
|
/**
|
|
10712
10669
|
* Updates the filter parameters to simulate a vignette effect
|
|
@@ -10732,17 +10689,17 @@ class Gr extends $r {
|
|
|
10732
10689
|
return this._colorValue;
|
|
10733
10690
|
}
|
|
10734
10691
|
set color(e) {
|
|
10735
|
-
typeof e == "string" ? (this._colorValue = e, this._colorRgb =
|
|
10692
|
+
typeof e == "string" ? (this._colorValue = e, this._colorRgb = ye(e)) : (this._colorValue = "#" + e.toString(16).padStart(6, "0"), this._colorRgb = ye(e)), this.updateVignette();
|
|
10736
10693
|
}
|
|
10737
10694
|
}
|
|
10738
|
-
|
|
10695
|
+
_({
|
|
10739
10696
|
id: "vignette",
|
|
10740
10697
|
name: "Vignette",
|
|
10741
10698
|
category: "effects",
|
|
10742
10699
|
description: "Add a classic darkened border effect to the image",
|
|
10743
10700
|
createFilter: (a) => {
|
|
10744
10701
|
try {
|
|
10745
|
-
const e = new
|
|
10702
|
+
const e = new Wr({
|
|
10746
10703
|
radius: a.radius || 0.8,
|
|
10747
10704
|
strength: a.strength || 1,
|
|
10748
10705
|
color: a.color || "#000000"
|
|
@@ -10810,18 +10767,18 @@ function ni(a) {
|
|
|
10810
10767
|
try {
|
|
10811
10768
|
let e = [], t = [];
|
|
10812
10769
|
try {
|
|
10813
|
-
e = xe(), e.length === 0 &&
|
|
10770
|
+
e = xe(), e.length === 0 && Jt();
|
|
10814
10771
|
} catch {
|
|
10815
10772
|
}
|
|
10816
10773
|
const r = a == null ? void 0 : a.disabled;
|
|
10817
10774
|
if (Array.isArray(r) && r.length > 0) {
|
|
10818
10775
|
let i = 0;
|
|
10819
10776
|
for (const s of r)
|
|
10820
|
-
|
|
10777
|
+
tr(s) && i++;
|
|
10821
10778
|
i > 0;
|
|
10822
10779
|
}
|
|
10823
10780
|
try {
|
|
10824
|
-
e = xe(), t =
|
|
10781
|
+
e = xe(), t = er();
|
|
10825
10782
|
} catch {
|
|
10826
10783
|
e || (e = []), t || (t = []);
|
|
10827
10784
|
}
|
|
@@ -10831,33 +10788,38 @@ function ni(a) {
|
|
|
10831
10788
|
}
|
|
10832
10789
|
}
|
|
10833
10790
|
export {
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10791
|
+
bt as A,
|
|
10792
|
+
Y as B,
|
|
10793
|
+
Gr as C,
|
|
10794
|
+
$r as D,
|
|
10838
10795
|
Ne as E,
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10796
|
+
Zr as F,
|
|
10797
|
+
de as G,
|
|
10798
|
+
$t as H,
|
|
10799
|
+
ht as I,
|
|
10800
|
+
Bt as J,
|
|
10801
|
+
Pe as K,
|
|
10802
|
+
It as L,
|
|
10803
|
+
Wt as M,
|
|
10804
|
+
Lt as N,
|
|
10805
|
+
xt as O,
|
|
10847
10806
|
ut as P,
|
|
10848
|
-
|
|
10807
|
+
Jt as Q,
|
|
10808
|
+
Et as R,
|
|
10809
|
+
ai as S,
|
|
10849
10810
|
lt as T,
|
|
10811
|
+
rr as U,
|
|
10850
10812
|
ii as V,
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10813
|
+
Kt as a,
|
|
10814
|
+
Qt as b,
|
|
10815
|
+
er as c,
|
|
10854
10816
|
Me as d,
|
|
10855
10817
|
f as e,
|
|
10856
10818
|
Ge as f,
|
|
10857
10819
|
xe as g,
|
|
10858
10820
|
si as h,
|
|
10859
10821
|
ni as i,
|
|
10860
|
-
|
|
10822
|
+
j,
|
|
10861
10823
|
tt as k,
|
|
10862
10824
|
rt as l,
|
|
10863
10825
|
et as m,
|
|
@@ -10865,14 +10827,14 @@ export {
|
|
|
10865
10827
|
Je as o,
|
|
10866
10828
|
Ae as p,
|
|
10867
10829
|
Kr as q,
|
|
10868
|
-
|
|
10830
|
+
_ as r,
|
|
10869
10831
|
Jr as s,
|
|
10870
10832
|
Qr as t,
|
|
10871
10833
|
ei as u,
|
|
10872
10834
|
$e as v,
|
|
10873
10835
|
ti as w,
|
|
10874
10836
|
ri as x,
|
|
10875
|
-
|
|
10876
|
-
|
|
10837
|
+
Ct as y,
|
|
10838
|
+
St as z
|
|
10877
10839
|
};
|
|
10878
|
-
//# sourceMappingURL=editor-
|
|
10840
|
+
//# sourceMappingURL=editor-4KRKCBKe.js.map
|