textmode.js 0.2.1-beta.1 → 0.2.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/textmode.esm.js +1466 -1433
  2. package/dist/textmode.esm.min.js +1331 -1298
  3. package/dist/textmode.umd.js +10 -26
  4. package/dist/textmode.umd.min.js +9 -25
  5. package/dist/types/assets/shaders-minified/frag/ascii.d.ts +14 -0
  6. package/dist/types/assets/shaders-minified/frag/copy-mrt.d.ts +14 -0
  7. package/dist/types/assets/shaders-minified/frag/instanced-ascii-mrt.d.ts +14 -0
  8. package/dist/types/assets/shaders-minified/index.d.ts +5 -0
  9. package/dist/types/assets/shaders-minified/vert/instanced-ascii-mrt.d.ts +14 -0
  10. package/dist/types/assets/shaders-minified/vert/shader.d.ts +14 -0
  11. package/dist/types/export/svg/SVGContentGenerator.d.ts +0 -6
  12. package/dist/types/index.d.ts +2 -0
  13. package/dist/types/rendering/index.d.ts +2 -0
  14. package/dist/types/rendering/webgl/Framebuffer.d.ts +8 -8
  15. package/dist/types/rendering/webgl/InstanceData.d.ts +1 -1
  16. package/dist/types/rendering/webgl/RenderPipeline.d.ts +10 -3
  17. package/dist/types/rendering/webgl/RenderState.d.ts +11 -11
  18. package/dist/types/rendering/webgl/Renderer.d.ts +26 -2
  19. package/dist/types/rendering/webgl/Shader.d.ts +6 -7
  20. package/dist/types/rendering/webgl/ShaderManager.d.ts +65 -1
  21. package/dist/types/rendering/webgl/index.d.ts +1 -0
  22. package/dist/types/rendering/webgl/types/GeometryTypes.d.ts +7 -7
  23. package/dist/types/rendering/webgl/types/ShaderTypes.d.ts +35 -0
  24. package/dist/types/textmode/Textmodifier.d.ts +2 -2
  25. package/dist/types/textmode/managers/index.d.ts +4 -0
  26. package/dist/types/textmode/mixins/KeyboardMixin.d.ts +1 -1
  27. package/dist/types/textmode/mixins/MouseMixin.d.ts +1 -1
  28. package/dist/types/textmode/mixins/RenderingMixin.d.ts +85 -0
  29. package/dist/types/textmode/mixins/TextmodifierMixin.d.ts +2 -2
  30. package/dist/types/textmode/mixins/index.d.ts +2 -2
  31. package/package.json +3 -2
  32. package/dist/types/textmode/keyboard/index.d.ts +0 -2
  33. package/dist/types/textmode/mouse/index.d.ts +0 -2
  34. /package/dist/types/textmode/{keyboard → managers}/KeyboardManager.d.ts +0 -0
  35. /package/dist/types/textmode/{mouse → managers}/MouseManager.d.ts +0 -0
@@ -1,466 +1,483 @@
1
- var J = Object.defineProperty;
2
- var Z = (E, A, t) => A in E ? J(E, A, { enumerable: !0, configurable: !0, writable: !0, value: t }) : E[A] = t;
3
- var n = (E, A, t) => Z(E, typeof A != "symbol" ? A + "" : A, t);
4
- class m extends Error {
1
+ var q = Object.defineProperty;
2
+ var AA = (E, A, t) => A in E ? q(E, A, { enumerable: !0, configurable: !0, writable: !0, value: t }) : E[A] = t;
3
+ var Q = (E, A, t) => AA(E, typeof A != "symbol" ? A + "" : A, t);
4
+ class I extends Error {
5
5
  constructor(A, t = {}) {
6
- super(m.A(A, t)), this.name = "TextmodeError";
6
+ super(I.A(A, t)), this.name = "TextmodeError";
7
7
  }
8
8
  static A(A, t) {
9
- let e = A;
10
- if (t && Object.keys(t).length > 0) {
11
- e += `
9
+ return `${A}${t && Object.keys(t).length > 0 ? `
12
10
 
13
- 📋 Context:`;
14
- for (const [s, i] of Object.entries(t))
15
- e += `
16
- - ${s}: ${m.i(i)}`;
17
- }
18
- return e += `
11
+ 📋 Context:` + Object.entries(t).map(([e, s]) => `
12
+ - ${e}: ${I.C(s)}`).join("") : ""}
19
13
 
20
- `, e += "↓".repeat(24) + `
21
- `, e;
14
+ ${"↓".repeat(24)}
15
+ `;
22
16
  }
23
- static i(A) {
17
+ static C(A) {
24
18
  if (A === null) return "null";
25
19
  if (A === void 0) return "undefined";
26
20
  if (typeof A == "string") return `"${A}"`;
27
21
  if (typeof A == "number" || typeof A == "boolean") return A + "";
28
- if (Array.isArray(A)) return A.length === 0 ? "[]" : A.length <= 5 ? `[${A.map((t) => m.i(t)).join(", ")}]` : `[${A.slice(0, 3).map((t) => m.i(t)).join(", ")}, ... +${A.length - 3} more]`;
22
+ if (Array.isArray(A)) return A.length === 0 ? "[]" : A.length <= 5 ? `[${A.map((t) => I.C(t)).join(", ")}]` : `[${A.slice(0, 3).map((t) => I.C(t)).join(", ")}, ... +${A.length - 3} more]`;
29
23
  if (typeof A == "object") {
30
24
  const t = Object.keys(A);
31
- return t.length === 0 ? "{}" : t.length <= 3 ? `{ ${t.map((e) => `${e}: ${m.i(A[e])}`).join(", ")} }` : `{ ${t.slice(0, 2).map((e) => `${e}: ${m.i(A[e])}`).join(", ")}, ... +${t.length - 2} more }`;
25
+ return t.length === 0 ? "{}" : t.length <= 3 ? `{ ${t.map((e) => `${e}: ${I.C(A[e])}`).join(", ")} }` : `{ ${t.slice(0, 2).map((e) => `${e}: ${I.C(A[e])}`).join(", ")}, ... +${t.length - 2} more }`;
32
26
  }
33
27
  return A + "";
34
28
  }
35
29
  }
36
- var q = ((E) => (E[E.SILENT = 0] = "SILENT", E[E.WARNING = 1] = "WARNING", E[E.ERROR = 2] = "ERROR", E[E.THROW = 3] = "THROW", E))(q || {});
37
- const x = class x {
30
+ var tA = ((E) => (E[E.SILENT = 0] = "SILENT", E[E.WARNING = 1] = "WARNING", E[E.ERROR = 2] = "ERROR", E[E.THROW = 3] = "THROW", E))(tA || {});
31
+ const v = class v {
38
32
  constructor() {
39
- n(this, "l", { globalLevel: 3 });
33
+ Q(this, "P", { globalLevel: 3 });
40
34
  }
41
- static C() {
42
- return x.o || (x.o = new x()), x.o;
35
+ static u() {
36
+ return v.D || (v.D = new v()), v.D;
43
37
  }
44
- D(A, t) {
38
+ I(A, t) {
45
39
  const e = "%c[textmode.js] Oops! (╯°□°)╯︵ Something went wrong in your code.", s = "color: #f44336; font-weight: bold; background: #ffebee; padding: 2px 6px; border-radius: 3px;";
46
- switch (this.l.globalLevel) {
40
+ switch (this.P.globalLevel) {
47
41
  case 0:
48
42
  return !1;
49
43
  case 1:
50
- return console.group(e, s), console.warn(m.A(A, t)), console.groupEnd(), !1;
44
+ return console.group(e, s), console.warn(I.A(A, t)), console.groupEnd(), !1;
51
45
  case 2:
52
- return console.group(e, s), console.error(m.A(A, t)), console.groupEnd(), !1;
46
+ return console.group(e, s), console.error(I.A(A, t)), console.groupEnd(), !1;
53
47
  default:
54
- throw new m(A, t);
48
+ throw new I(A, t);
55
49
  }
56
50
  }
57
- u(A, t, e) {
58
- return !!A || (this.D(t, e), !1);
51
+ _(A, t, e) {
52
+ return !!A || (this.I(t, e), !1);
59
53
  }
60
- P(A) {
61
- this.l.globalLevel = A;
54
+ v(A) {
55
+ this.P.globalLevel = A;
62
56
  }
63
57
  };
64
- n(x, "o", null);
65
- let Y = x;
66
- const G = Y.C(), V = /* @__PURE__ */ new WeakMap();
67
- function M(E, A) {
68
- V.set(E, A);
58
+ Q(v, "D", null);
59
+ let L = v;
60
+ const M = L.u(), X = /* @__PURE__ */ new WeakMap();
61
+ function F(E, A) {
62
+ X.set(E, A);
63
+ }
64
+ function G(E) {
65
+ return X.get(E);
69
66
  }
70
- function b(E) {
71
- return V.get(E);
67
+ class V {
68
+ constructor() {
69
+ Q(this, "G", 1);
70
+ Q(this, "M", 0);
71
+ Q(this, "$", 0);
72
+ Q(this, "Y", 0);
73
+ Q(this, "F", [0, 0, 0]);
74
+ Q(this, "R", [1, 1, 1, 1]);
75
+ Q(this, "S", [0, 0, 0, 1]);
76
+ Q(this, "O", !1);
77
+ Q(this, "L", !1);
78
+ Q(this, "U", !1);
79
+ Q(this, "H", [0, 0]);
80
+ Q(this, "W", [0, 0, 0, 1]);
81
+ Q(this, "K", []);
82
+ }
83
+ J() {
84
+ this.K.push({ V: this.G, Z: this.M, N: this.$, X: this.Y, H: [...this.H], O: this.O, L: this.L, U: this.U, AA: [...this.F], tA: [...this.R], eA: [...this.S] });
85
+ }
86
+ sA() {
87
+ const A = this.K.pop();
88
+ A ? (this.G = A.V, this.M = A.Z, this.$ = A.N, this.Y = A.X, this.H = A.H, this.O = A.O, this.L = A.L, this.U = A.U, this.F = A.AA, this.R = A.tA, this.S = A.eA) : console.warn("pop() called without matching push()");
89
+ }
90
+ iA() {
91
+ this.K = [], this.M = 0, this.$ = 0, this.Y = 0;
92
+ }
93
+ BA(A) {
94
+ A.lineWeight = this.G, A.rotationX = this.M, A.rotationY = this.$, A.rotationZ = this.Y, A.character[0] = this.F[0], A.character[1] = this.F[1], A.character[2] = this.F[2], A.charColor[0] = this.R[0], A.charColor[1] = this.R[1], A.charColor[2] = this.R[2], A.charColor[3] = this.R[3], A.bgColor[0] = this.S[0], A.bgColor[1] = this.S[1], A.bgColor[2] = this.S[2], A.bgColor[3] = this.S[3], A.flipHorizontally = this.O, A.flipVertically = this.L, A.invert = this.U, A.charRotation[0] = this.H[0], A.charRotation[1] = this.H[1];
95
+ }
96
+ get lineWeight() {
97
+ return this.G;
98
+ }
99
+ get canvasBackgroundColor() {
100
+ return this.W;
101
+ }
102
+ QA(A) {
103
+ this.G = Math.abs(A);
104
+ }
105
+ EA(A) {
106
+ this.M = A;
107
+ }
108
+ rA(A) {
109
+ this.$ = A;
110
+ }
111
+ nA(A) {
112
+ this.Y = A;
113
+ }
114
+ gA(A) {
115
+ this.F = A;
116
+ }
117
+ oA(A, t, e, s = 255) {
118
+ this.R = [A / 255, t / 255, e / 255, s / 255];
119
+ }
120
+ aA(A, t, e, s = 255) {
121
+ this.S = [A / 255, t / 255, e / 255, s / 255];
122
+ }
123
+ hA(A) {
124
+ this.O = A;
125
+ }
126
+ cA(A) {
127
+ this.L = A;
128
+ }
129
+ CA(A) {
130
+ this.U = A;
131
+ }
132
+ lA(A) {
133
+ const t = 255 * A / 360, e = Math.floor(t) / 255, s = Math.round(t - Math.floor(t));
134
+ this.H = [e, s];
135
+ }
136
+ DA(A, t, e, s) {
137
+ this.W = [A / 255, t / 255, e / 255, s / 255];
138
+ }
72
139
  }
73
140
  class U {
74
- constructor(A, t, e = t, s = 1, i = {}) {
75
- n(this, "I");
76
- n(this, "p");
77
- n(this, "l");
78
- n(this, "_", null);
79
- n(this, "m");
80
- n(this, "v");
81
- n(this, "G", []);
82
- n(this, "$");
83
- n(this, "M", null);
84
- n(this, "Y", []);
85
- this.I = t, this.p = e, this.l = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...i }, this.m = A, this.$ = Math.min(Math.max(1, s), 8);
86
- const r = A.getParameter(A.MAX_DRAW_BUFFERS), B = A.getParameter(A.MAX_COLOR_ATTACHMENTS);
87
- this.$ = Math.min(this.$, r, B), this.v = A.createFramebuffer(), this.R(), this.F(), this.Y = Array(this.$).fill(null);
88
- }
89
- R() {
90
- const A = this.m, t = this.l.filter === "linear" ? A.LINEAR : A.NEAREST, e = this.l.wrap === "repeat" ? A.REPEAT : A.CLAMP_TO_EDGE, s = this.l.type === "float" ? A.FLOAT : A.UNSIGNED_BYTE;
91
- for (let i = 0; i < this.$; i++) {
92
- const r = A.createTexture();
93
- A.bindTexture(A.TEXTURE_2D, r), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MIN_FILTER, t), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MAG_FILTER, t), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_S, e), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_T, e), A.texImage2D(A.TEXTURE_2D, 0, A.RGBA, this.I, this.p, 0, A.RGBA, s, null), this.G.push(r);
141
+ constructor(A, t, e = t, s = 1, i = {}, B = null, r = !1) {
142
+ Q(this, "PA");
143
+ Q(this, "uA");
144
+ Q(this, "P");
145
+ Q(this, "IA", null);
146
+ Q(this, "wA");
147
+ Q(this, "fA");
148
+ Q(this, "dA", []);
149
+ Q(this, "_A");
150
+ Q(this, "pA", null);
151
+ Q(this, "mA", []);
152
+ Q(this, "vA", null);
153
+ Q(this, "yA", !1);
154
+ Q(this, "bA", null);
155
+ this.PA = t, this.uA = e, this.P = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...i }, this.wA = A, this._A = Math.min(Math.max(1, s), 8), this.vA = B, this.yA = !!r, this.bA = this.yA ? new V() : null;
156
+ const n = A.getParameter(A.MAX_DRAW_BUFFERS), o = A.getParameter(A.MAX_COLOR_ATTACHMENTS);
157
+ this._A = Math.min(this._A, n, o), this.fA = A.createFramebuffer(), this.GA(), this.MA(), this.mA = Array(this._A).fill(null);
158
+ }
159
+ GA() {
160
+ const A = this.wA, t = this.P.filter === "linear" ? A.LINEAR : A.NEAREST, e = this.P.wrap === "repeat" ? A.REPEAT : A.CLAMP_TO_EDGE, s = this.P.type === "float" ? A.FLOAT : A.UNSIGNED_BYTE;
161
+ for (let i = 0; i < this._A; i++) {
162
+ const B = A.createTexture();
163
+ A.bindTexture(A.TEXTURE_2D, B), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MIN_FILTER, t), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MAG_FILTER, t), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_S, e), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_T, e), A.texImage2D(A.TEXTURE_2D, 0, A.RGBA, this.PA, this.uA, 0, A.RGBA, s, null), this.dA.push(B);
94
164
  }
95
165
  A.bindTexture(A.TEXTURE_2D, null);
96
166
  }
97
- F() {
98
- const A = this.m;
99
- if (A.bindFramebuffer(A.FRAMEBUFFER, this.v), this.$ === 1) A.framebufferTexture2D(A.FRAMEBUFFER, A.COLOR_ATTACHMENT0, A.TEXTURE_2D, this.G[0], 0);
167
+ MA() {
168
+ const A = this.wA;
169
+ if (A.bindFramebuffer(A.FRAMEBUFFER, this.fA), this._A === 1) A.framebufferTexture2D(A.FRAMEBUFFER, A.COLOR_ATTACHMENT0, A.TEXTURE_2D, this.dA[0], 0);
100
170
  else {
101
171
  const e = [];
102
- for (let s = 0; s < this.$; s++) {
172
+ for (let s = 0; s < this._A; s++) {
103
173
  const i = A.COLOR_ATTACHMENT0 + s;
104
- A.framebufferTexture2D(A.FRAMEBUFFER, i, A.TEXTURE_2D, this.G[s], 0), e.push(i);
174
+ A.framebufferTexture2D(A.FRAMEBUFFER, i, A.TEXTURE_2D, this.dA[s], 0), e.push(i);
105
175
  }
106
176
  A.drawBuffers(e);
107
177
  }
108
178
  const t = A.checkFramebufferStatus(A.FRAMEBUFFER);
109
179
  t !== A.FRAMEBUFFER_COMPLETE && console.error("GLFramebuffer is not complete:", t), A.bindFramebuffer(A.FRAMEBUFFER, null);
110
180
  }
111
- S(A) {
112
- const t = this.m;
113
- t.bindTexture(t.TEXTURE_2D, this.G[0]), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, 1), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, A), t.bindTexture(t.TEXTURE_2D, null);
181
+ $A(A) {
182
+ const t = this.wA;
183
+ t.bindTexture(t.TEXTURE_2D, this.dA[0]), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, 1), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, A), t.bindTexture(t.TEXTURE_2D, null);
114
184
  }
115
- O(A, t) {
116
- this.I = A, this.p = t, this._ = null, this.Y = Array(this.$).fill(null);
117
- const e = this.m, s = this.l.type === "float" ? e.FLOAT : e.UNSIGNED_BYTE;
118
- for (const i of this.G) e.bindTexture(e.TEXTURE_2D, i), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, this.I, this.p, 0, e.RGBA, s, null);
185
+ resize(A, t) {
186
+ this.PA = A, this.uA = t, this.IA = null, this.mA = Array(this._A).fill(null);
187
+ const e = this.wA, s = this.P.type === "float" ? e.FLOAT : e.UNSIGNED_BYTE;
188
+ for (const i of this.dA) e.bindTexture(e.TEXTURE_2D, i), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, this.PA, this.uA, 0, e.RGBA, s, null);
119
189
  e.bindTexture(e.TEXTURE_2D, null);
120
190
  }
121
- k(A) {
122
- const t = this.m;
123
- if (A < 0 || A >= this.$) throw Error(`GLFramebuffer: attachment index ${A} out of range (count=${this.$})`);
124
- const e = this.Y[A];
191
+ xA(A) {
192
+ const t = this.wA, e = this.mA[A];
125
193
  if (e) return e;
126
- const s = this.I, i = this.p, r = new Uint8Array(s * i * 4), B = t.getParameter(t.READ_FRAMEBUFFER_BINDING);
127
- t.bindFramebuffer(t.READ_FRAMEBUFFER, this.v), t.readBuffer(t.COLOR_ATTACHMENT0 + A), t.readPixels(0, 0, s, i, t.RGBA, t.UNSIGNED_BYTE, r), t.bindFramebuffer(t.READ_FRAMEBUFFER, B);
128
- const o = 4 * s, Q = new Uint8Array(r.length);
129
- for (let g = 0; g < i; g++) {
130
- const a = (i - 1 - g) * o, h = g * o;
131
- Q.set(r.subarray(a, a + o), h);
194
+ const s = this.PA, i = this.uA, B = new Uint8Array(s * i * 4), r = t.getParameter(t.READ_FRAMEBUFFER_BINDING);
195
+ t.bindFramebuffer(t.READ_FRAMEBUFFER, this.fA), t.readBuffer(t.COLOR_ATTACHMENT0 + A), t.readPixels(0, 0, s, i, t.RGBA, t.UNSIGNED_BYTE, B), t.bindFramebuffer(t.READ_FRAMEBUFFER, r);
196
+ const n = 4 * s, o = new Uint8Array(B.length);
197
+ for (let a = 0; a < i; a++) {
198
+ const g = (i - 1 - a) * n, h = a * n;
199
+ o.set(B.subarray(g, g + n), h);
132
200
  }
133
- return this.Y[A] = Q, Q;
134
- }
135
- L() {
136
- for (let A = 0; A < this.$; A++) this.k(A);
137
- }
138
- U() {
139
- const A = this.m;
140
- this.M = { framebuffer: A.getParameter(A.FRAMEBUFFER_BINDING), viewport: A.getParameter(A.VIEWPORT) }, A.bindFramebuffer(A.FRAMEBUFFER, this.v), this.Y = Array(this.$).fill(null);
141
- for (let t = 0; t < this.$; t++) A.clearBufferfv(A.COLOR, t, new Float32Array([0, 0, 0, 0]));
142
- A.viewport(0, 0, this.I, this.p), M(A, [0, 0, this.I, this.p]);
143
- }
144
- W() {
145
- if (!this.M) return;
146
- const A = this.m;
147
- A.bindFramebuffer(A.FRAMEBUFFER, this.M.framebuffer), A.viewport(...this.M.viewport), M(A, this.M.viewport), this.M = null;
201
+ return this.mA[A] = o, o;
202
+ }
203
+ begin() {
204
+ var t, e, s, i;
205
+ const A = this.wA;
206
+ if (this.vA) {
207
+ const B = ((e = (t = this.vA).YA) == null ? void 0 : e.call(t)) ?? null;
208
+ B && this.vA.FA(B), this.yA && this.bA && ((i = (s = this.vA).RA) == null || i.call(s, this.bA));
209
+ }
210
+ this.pA = { framebuffer: A.getParameter(A.FRAMEBUFFER_BINDING), viewport: A.getParameter(A.VIEWPORT) }, A.bindFramebuffer(A.FRAMEBUFFER, this.fA), this.mA = Array(this._A).fill(null);
211
+ for (let B = 0; B < this._A; B++) A.clearBufferfv(A.COLOR, B, new Float32Array([0, 0, 0, 0]));
212
+ A.viewport(0, 0, this.PA, this.uA), F(A, [0, 0, this.PA, this.uA]);
213
+ }
214
+ end() {
215
+ var t, e, s, i;
216
+ if (!this.pA) return;
217
+ const A = this.wA;
218
+ if (this.vA) {
219
+ const B = ((e = (t = this.vA).YA) == null ? void 0 : e.call(t)) ?? null;
220
+ B && this.vA.FA(B);
221
+ }
222
+ A.bindFramebuffer(A.FRAMEBUFFER, this.pA.framebuffer), A.viewport(...this.pA.viewport), F(A, this.pA.viewport), this.pA = null, this.vA && this.yA && this.bA && ((i = (s = this.vA).SA) == null || i.call(s));
148
223
  }
149
- H() {
150
- const A = this.m;
151
- this.v && A.deleteFramebuffer(this.v);
152
- for (const t of this.G) A.deleteTexture(t);
153
- this.G = [], this.Y = [];
224
+ zA() {
225
+ const A = this.wA;
226
+ A.deleteFramebuffer(this.fA);
227
+ for (const t of this.dA) A.deleteTexture(t);
154
228
  }
155
229
  get width() {
156
- return this.I;
230
+ return this.PA;
157
231
  }
158
232
  get height() {
159
- return this.p;
233
+ return this.uA;
160
234
  }
161
235
  get pixels() {
162
- return this._;
236
+ return this.IA;
163
237
  }
164
238
  get options() {
165
- return { ...this.l };
239
+ return { ...this.P };
166
240
  }
167
241
  get framebuffer() {
168
- return this.v;
242
+ return this.fA;
169
243
  }
170
244
  get texture() {
171
- return this.G[0];
245
+ return this.dA[0];
172
246
  }
173
247
  get textures() {
174
- return [...this.G];
248
+ return [...this.dA];
175
249
  }
176
250
  get attachmentCount() {
177
- return this.$;
178
- }
179
- getAttachmentPixels(A) {
180
- return this.Y[A] ?? null;
251
+ return this._A;
181
252
  }
182
253
  }
183
- class L {
254
+ function N(E) {
255
+ return typeof E == "string" ? E : E.sourceCode;
256
+ }
257
+ class T {
184
258
  constructor(A, t, e) {
185
- n(this, "m");
186
- n(this, "K");
187
- n(this, "J", /* @__PURE__ */ new Map());
188
- n(this, "V", /* @__PURE__ */ new Map());
189
- n(this, "Z", 0);
190
- n(this, "j");
191
- this.m = A, this.K = this.N(t, e), this.j = A.getParameter(A.MAX_TEXTURE_IMAGE_UNITS), this.X();
192
- }
193
- X() {
194
- const A = this.m.getProgramParameter(this.K, this.m.ACTIVE_UNIFORMS);
259
+ Q(this, "wA");
260
+ Q(this, "kA");
261
+ Q(this, "OA", /* @__PURE__ */ new Map());
262
+ Q(this, "LA", 0);
263
+ this.wA = A, this.kA = this.UA(N(t), N(e)), this.TA();
264
+ }
265
+ TA() {
266
+ const A = this.wA.getProgramParameter(this.kA, this.wA.ACTIVE_UNIFORMS);
195
267
  for (let t = 0; t < A; t++) {
196
- const e = this.m.getActiveUniform(this.K, t);
268
+ const e = this.wA.getActiveUniform(this.kA, t);
197
269
  if (e) {
198
- const s = this.m.getUniformLocation(this.K, e.name);
199
- s && (this.J.set(e.name, s), this.V.set(e.name, e.type));
270
+ const s = this.wA.getUniformLocation(this.kA, e.name);
271
+ s && this.OA.set(e.name, s);
200
272
  }
201
273
  }
202
274
  }
203
- N(A, t) {
204
- const e = this.q(this.m.VERTEX_SHADER, A), s = this.q(this.m.FRAGMENT_SHADER, t), i = this.m.createProgram();
205
- if (this.m.attachShader(i, e), this.m.attachShader(i, s), this.m.linkProgram(i), !this.m.getProgramParameter(i, this.m.LINK_STATUS)) {
206
- const r = this.m.getProgramInfoLog(i);
207
- throw Error("Shader program link error: " + r);
275
+ UA(A, t) {
276
+ const e = this.HA(this.wA.VERTEX_SHADER, A), s = this.HA(this.wA.FRAGMENT_SHADER, t), i = this.wA.createProgram();
277
+ if (this.wA.attachShader(i, e), this.wA.attachShader(i, s), this.wA.linkProgram(i), !this.wA.getProgramParameter(i, this.wA.LINK_STATUS)) {
278
+ const B = this.wA.getProgramInfoLog(i);
279
+ throw Error("Shader program link error: " + B);
208
280
  }
209
- return this.m.deleteShader(e), this.m.deleteShader(s), i;
281
+ return this.wA.deleteShader(e), this.wA.deleteShader(s), i;
210
282
  }
211
- q(A, t) {
212
- const e = this.m.createShader(A);
213
- if (this.m.shaderSource(e, t), this.m.compileShader(e), !this.m.getShaderParameter(e, this.m.COMPILE_STATUS)) {
214
- const s = this.m.getShaderInfoLog(e);
215
- throw this.m.deleteShader(e), Error("Shader compilation error: " + s);
283
+ HA(A, t) {
284
+ const e = this.wA.createShader(A);
285
+ if (this.wA.shaderSource(e, t), this.wA.compileShader(e), !this.wA.getShaderParameter(e, this.wA.COMPILE_STATUS)) {
286
+ const s = this.wA.getShaderInfoLog(e);
287
+ throw this.wA.deleteShader(e), Error("Shader compilation error: " + s);
216
288
  }
217
289
  return e;
218
290
  }
219
- AA() {
220
- this.m.useProgram(this.K), this.tA();
291
+ WA() {
292
+ this.wA.useProgram(this.kA), this.KA();
221
293
  }
222
- tA() {
223
- this.Z = 0;
294
+ KA() {
295
+ this.LA = 0;
224
296
  }
225
- eA(A) {
226
- for (const [t, e] of Object.entries(A)) this.sA(t, e);
297
+ JA(A) {
298
+ for (const [t, e] of Object.entries(A)) this.VA(t, e);
227
299
  }
228
- iA(A) {
229
- return this.J.has(A);
300
+ ZA(A) {
301
+ return this.OA.has(A);
230
302
  }
231
- sA(A, t) {
232
- if (this.m.getParameter(this.m.CURRENT_PROGRAM) !== this.K) return void console.warn(`Attempting to set uniform '${A}' on shader that is not currently bound`);
233
- const e = this.J.get(A);
234
- if (e) if (typeof t == "number") this.m.uniform1f(e, t);
235
- else if (typeof t == "boolean") this.m.uniform1i(e, t ? 1 : 0);
303
+ VA(A, t) {
304
+ const e = this.OA.get(A);
305
+ if (e) if (typeof t == "number") this.wA.uniform1f(e, t);
306
+ else if (typeof t == "boolean") this.wA.uniform1i(e, t ? 1 : 0);
236
307
  else if (Array.isArray(t)) switch (t.length) {
237
308
  case 2:
238
- this.m.uniform2f(e, t[0], t[1]);
309
+ this.wA.uniform2f(e, t[0], t[1]);
239
310
  break;
240
311
  case 3:
241
- this.m.uniform3f(e, t[0], t[1], t[2]);
312
+ this.wA.uniform3f(e, t[0], t[1], t[2]);
242
313
  break;
243
314
  case 4:
244
- this.m.uniform4f(e, t[0], t[1], t[2], t[3]);
315
+ this.wA.uniform4f(e, t[0], t[1], t[2], t[3]);
245
316
  break;
246
317
  default:
247
- console.warn(`Unsupported array length ${t.length} for uniform '${A}'`);
318
+ return;
248
319
  }
249
320
  else if (t instanceof WebGLTexture) {
250
- const s = this.BA();
251
- this.m.uniform1i(e, s), this.m.activeTexture(this.m.TEXTURE0 + s), this.m.bindTexture(this.m.TEXTURE_2D, t);
321
+ const s = this.NA();
322
+ this.wA.uniform1i(e, s), this.wA.activeTexture(this.wA.TEXTURE0 + s), this.wA.bindTexture(this.wA.TEXTURE_2D, t);
252
323
  } else if (t instanceof U) {
253
- const s = this.BA();
254
- this.m.uniform1i(e, s), this.m.activeTexture(this.m.TEXTURE0 + s), this.m.bindTexture(this.m.TEXTURE_2D, t.texture);
324
+ const s = this.NA();
325
+ this.wA.uniform1i(e, s), this.wA.activeTexture(this.wA.TEXTURE0 + s), this.wA.bindTexture(this.wA.TEXTURE_2D, t.texture);
255
326
  } else if (typeof t == "object" && "texture" in t) {
256
- const s = this.BA();
257
- this.m.uniform1i(e, s), this.m.activeTexture(this.m.TEXTURE0 + s), this.m.bindTexture(this.m.TEXTURE_2D, t.texture);
327
+ const s = this.NA();
328
+ this.wA.uniform1i(e, s), this.wA.activeTexture(this.wA.TEXTURE0 + s), this.wA.bindTexture(this.wA.TEXTURE_2D, t.texture);
258
329
  } else console.warn(`Unsupported uniform type for '${A}':`, typeof t);
259
330
  }
260
- BA() {
261
- return this.Z >= this.j && console.warn(`Exceeded maximum texture units (${this.j}). Texture may not render correctly.`), this.Z++;
331
+ NA() {
332
+ return this.LA++;
262
333
  }
263
- get rA() {
264
- return this.K;
334
+ get XA() {
335
+ return this.kA;
265
336
  }
266
- H() {
267
- this.m.deleteProgram(this.K);
337
+ zA() {
338
+ this.wA.deleteProgram(this.kA);
268
339
  }
269
340
  }
270
- class AA {
271
- constructor() {
272
- n(this, "QA", 1);
273
- n(this, "EA", 0);
274
- n(this, "nA", 0);
275
- n(this, "oA", 0);
276
- n(this, "gA", [0, 0, 0]);
277
- n(this, "aA", [1, 1, 1, 1]);
278
- n(this, "hA", [0, 0, 0, 1]);
279
- n(this, "cA", !1);
280
- n(this, "lA", !1);
281
- n(this, "CA", !1);
282
- n(this, "DA", [0, 0]);
283
- n(this, "uA", [0, 0, 0, 1]);
284
- n(this, "PA", []);
285
- }
286
- IA() {
287
- this.PA.push({ lineWeight: this.QA, rotationX: this.EA, rotationY: this.nA, rotationZ: this.oA, charRotation: [...this.DA], flipHorizontally: this.cA, flipVertically: this.lA, invert: this.CA, character: [...this.gA], charColor: [...this.aA], cellColor: [...this.hA] });
288
- }
289
- wA() {
290
- const A = this.PA.pop();
291
- A ? (this.QA = A.lineWeight, this.EA = A.rotationX, this.nA = A.rotationY, this.oA = A.rotationZ, this.DA = A.charRotation, this.cA = A.flipHorizontally, this.lA = A.flipVertically, this.CA = A.invert, this.gA = A.character, this.aA = A.charColor, this.hA = A.cellColor) : console.warn("pop() called without matching push()");
292
- }
293
- fA() {
294
- this.PA = [], this.EA = 0, this.nA = 0, this.oA = 0;
295
- }
296
- dA(A) {
297
- A.lineWeight = this.QA, A.rotationX = this.EA, A.rotationY = this.nA, A.rotationZ = this.oA, A.character[0] = this.gA[0], A.character[1] = this.gA[1], A.character[2] = this.gA[2], A.charColor[0] = this.aA[0], A.charColor[1] = this.aA[1], A.charColor[2] = this.aA[2], A.charColor[3] = this.aA[3], A.bgColor[0] = this.hA[0], A.bgColor[1] = this.hA[1], A.bgColor[2] = this.hA[2], A.bgColor[3] = this.hA[3], A.flipHorizontally = this.cA, A.flipVertically = this.lA, A.invert = this.CA, A.charRotation[0] = this.DA[0], A.charRotation[1] = this.DA[1];
298
- }
299
- get lineWeight() {
300
- return this.QA;
301
- }
302
- get canvasBackgroundColor() {
303
- return this.uA;
304
- }
305
- pA(A) {
306
- this.QA = Math.abs(A);
307
- }
308
- _A(A) {
309
- this.EA = A;
310
- }
311
- mA(A) {
312
- this.nA = A;
313
- }
314
- vA(A) {
315
- this.oA = A;
316
- }
317
- yA(A) {
318
- this.gA = A;
341
+ const S = `#version 300 es
342
+ in vec2 a_position;in vec2 a_texCoord;in vec2 a_instancePosition;in vec2 a_instanceSize;in vec3 a_instanceCharacter;in vec4 a_instancePrimaryColor;in vec4 a_instanceSecondaryColor;in vec2 a_instanceRotation;in vec3 a_instanceTransform;in vec3 a_instanceGlobalRotation;in vec2 a_instanceRotationCenter;in vec2 a_instanceBezierCP1;in vec2 a_instanceBezierCP2;in vec2 a_instanceBezierStart;in vec2 a_instanceBezierEnd;in vec2 a_instanceArcAngles;uniform float k;uniform vec2 r;out vec2 v_uv;out vec3 v_character;out vec4 v_primaryColor;out vec4 v_secondaryColor;out vec2 v_rotation;out vec3 v_transform;mat3 A(float B){float C=sin(B),D=cos(B);return mat3(1,0,0,0,D,-C,0,C,D);}mat3 E(float B){float C=sin(B),D=cos(B);return mat3(D,0,C,0,1,0,-C,0,D);}mat3 F(float B){float C=sin(B),D=cos(B);return mat3(D,-C,0,C,D,0,0,0,1);}vec2 G(float H,vec2 I,vec2 J,vec2 K,vec2 L){float M=1.-H,N=M*M,O=H*H;return N*M*I+3.*N*H*J+3.*M*O*K+O*H*L;}vec2 P(float H,vec2 I,vec2 J,vec2 K,vec2 L){float M=1.-H,N=M*M,O=H*H;return-3.*N*I+3.*N*J-6.*M*H*J+6.*M*H*K-3.*O*K+3.*O*L;}void main(){v_uv=a_texCoord;v_character=a_instanceCharacter;v_primaryColor=a_instancePrimaryColor;v_secondaryColor=a_instanceSecondaryColor;v_rotation=a_instanceRotation;v_transform=a_instanceTransform;vec2 Q;bool R=length(a_instanceBezierCP1)+length(a_instanceBezierCP2)+length(a_instanceBezierStart)+length(a_instanceBezierEnd)>0.;bool S=a_instanceArcAngles.x!=0.||a_instanceArcAngles.y!=0.;if(R){float H=a_position.x;vec2 T=G(H,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);vec2 U=P(H,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);float V=length(U);U=V>0.?U/V:vec2(1,0);Q=T+vec2(-U.y,U.x)*a_position.y*a_instanceSize.y;}else if(S){float C=a_instanceArcAngles.x,W=a_instanceArcAngles.y;C=mod(C,6.28318530718);if(C<0.)C+=6.28318530718;W=mod(W,6.28318530718);if(W<0.)W+=6.28318530718;float X=C-W;if(X<=0.)X+=6.28318530718;float Y=C-a_position.x*X;vec2 Z=vec2(cos(Y),sin(Y))*a_position.y;Q=Z*a_instanceSize*.5+a_instanceSize*.5+a_instancePosition;}else{Q=a_position*a_instanceSize+a_instancePosition;}vec2 a=(Q/r)*2.-1.;a.y=-a.y;if(length(a_instanceGlobalRotation)>0.){vec3 b=vec3(a-a_instanceRotationCenter,0);b.x*=k;if(a_instanceGlobalRotation.x!=0.)b=A(-a_instanceGlobalRotation.x)*b;if(a_instanceGlobalRotation.y!=0.)b=E(-a_instanceGlobalRotation.y)*b;if(a_instanceGlobalRotation.z!=0.)b=F(-a_instanceGlobalRotation.z)*b;b.x/=k;a=b.xy+a_instanceRotationCenter;}gl_Position=vec4(a,0,1);}`;
343
+ class eA {
344
+ constructor(A) {
345
+ Q(this, "jA", /* @__PURE__ */ new Map());
346
+ Q(this, "wA");
347
+ this.wA = A;
348
+ }
349
+ qA(A, t) {
350
+ if (!this.jA.has(A)) {
351
+ const e = t();
352
+ this.jA.set(A, e);
353
+ }
354
+ return this.jA.get(A);
319
355
  }
320
- xA(A, t, e, s = 255) {
321
- this.aA = [A / 255, t / 255, e / 255, s / 255];
356
+ At() {
357
+ return this.qA("mrt-copy", () => new T(this.wA, S, `#version 300 es
358
+ precision highp float;in vec2 v_uv;uniform sampler2D l;uniform sampler2D m;uniform sampler2D n;uniform sampler2D o;uniform sampler2D p;uniform vec2 q;layout(location=0)out vec4 o_character;layout(location=1)out vec4 o_primaryColor;layout(location=2)out vec4 o_secondaryColor;layout(location=3)out vec4 o_rotation;layout(location=4)out vec4 o_transform;void main(){vec2 A=vec2(v_uv.x,1.-v_uv.y);vec2 B=A*q;vec2 C=(floor(B)+0.5f)/q;vec4 D=texture(l,C);vec4 E=texture(m,C);if(E.a==0.){discard;}vec4 F=texture(n,C);vec4 G=texture(o,C);vec4 H=texture(p,C);o_character=D;o_primaryColor=E;o_secondaryColor=F;o_rotation=G;o_transform=H;}`));
322
359
  }
323
- bA(A, t, e, s = 255) {
324
- this.hA = [A / 255, t / 255, e / 255, s / 255];
360
+ YA() {
361
+ return this.qA("mrt-draw", () => new T(this.wA, S, `#version 300 es
362
+ precision highp float;in vec2 v_uv;in vec3 v_character;in vec4 v_primaryColor;in vec4 v_secondaryColor;in vec2 v_rotation;in vec3 v_transform;layout(location=0)out vec4 o_character;layout(location=1)out vec4 o_primaryColor;layout(location=2)out vec4 o_secondaryColor;layout(location=3)out vec4 o_rotation;layout(location=4)out vec4 o_transform;void main(){o_character=vec4(v_character,1.);o_primaryColor=v_primaryColor;o_secondaryColor=v_secondaryColor;o_rotation=vec4(v_rotation,0.,1.);o_transform=vec4(v_transform,1.);}`));
325
363
  }
326
- GA(A) {
327
- this.cA = A;
364
+ tt() {
365
+ return this.qA("ascii-conversion", () => new T(this.wA, "attribute vec2 a_position;attribute vec2 a_texCoord;varying vec2 v_uv;void main(){v_uv=a_texCoord;gl_Position=vec4(a_position,0.,1.);}", "precision mediump float;uniform sampler2D a;uniform vec2 b;uniform sampler2D d;uniform sampler2D e;uniform sampler2D f;uniform sampler2D c;uniform sampler2D g;uniform vec2 h;uniform vec2 i;uniform vec2 j;mat2 A(float B){float C=sin(B);float c=cos(B);return mat2(c,-C,C,c);}void main(){vec2 D=(gl_FragCoord.xy-j)/i;vec2 E=D*h;vec2 F=floor(E);vec2 G=(F+0.5)/h;vec4 H=texture2D(d,G);vec4 I=texture2D(e,G);vec4 J=texture2D(f,G);bool K=J.r>0.5;bool L=J.g>0.5;bool M=J.b>0.5;vec4 N=texture2D(c,G);int O=int(N.r*255.+0.5)+int(N.g*255.+0.5)*256;int P=int(mod(float(O),b.x));int Q=O/int(b.x);float R=(b.y-1.)-float(Q);vec2 S=vec2(float(P),R)/b;vec4 T=texture2D(g,G);float U=T.r*255.+T.g;float V=-(U*360./255.)*0.017453292;vec2 W=fract(E)-0.5;if(L)W.x=-W.x;if(M)W.y=-W.y;W=A(V)*W+0.5;vec2 X=1./b;vec2 Y=S+W*X;vec2 Z=S+X;if(any(lessThan(Y,S))||any(greaterThan(Y,Z))){gl_FragColor=K?H:I;return;}vec4 a=texture2D(a,Y);if(K)a.rgb=1.-a.rgb;gl_FragColor=mix(I,H,a);}"));
328
366
  }
329
- $A(A) {
330
- this.lA = A;
367
+ et(A) {
368
+ return new T(this.wA, S, A);
331
369
  }
332
- MA(A) {
333
- this.CA = A;
370
+ st(A, t) {
371
+ return new T(this.wA, A, t);
334
372
  }
335
- YA(A) {
336
- const t = 255 * A / 360, e = Math.floor(t) / 255, s = Math.round(t - Math.floor(t));
337
- this.DA = [e, s];
338
- }
339
- RA(A, t, e, s) {
340
- this.uA = [A / 255, t / 255, e / 255, s / 255];
373
+ zA() {
374
+ for (const A of this.jA.values()) A.zA();
375
+ this.jA.clear();
341
376
  }
342
377
  }
343
- var z = `#version 300 es
344
- in vec2 a_position;in vec2 a_texCoord;in vec2 a_instancePosition;in vec2 a_instanceSize;in vec3 a_instanceCharacter;in vec4 a_instancePrimaryColor;in vec4 a_instanceSecondaryColor;in vec2 a_instanceRotation;in vec3 a_instanceTransform;in vec3 a_instanceGlobalRotation;in vec2 a_instanceRotationCenter;in vec2 a_instanceBezierCP1;in vec2 a_instanceBezierCP2;in vec2 a_instanceBezierStart;in vec2 a_instanceBezierEnd;in vec2 a_instanceArcAngles;uniform float u_aspectRatio;uniform vec2 u_viewportSize;out vec2 v_uv;out vec3 v_character;out vec4 v_primaryColor;out vec4 v_secondaryColor;out vec2 v_rotation;out vec3 v_transform;mat3 rotateX(float a){float s=sin(a),c=cos(a);return mat3(1,0,0,0,c,-s,0,s,c);}mat3 rotateY(float a){float s=sin(a),c=cos(a);return mat3(c,0,s,0,1,0,-s,0,c);}mat3 rotateZ(float a){float s=sin(a),c=cos(a);return mat3(c,-s,0,s,c,0,0,0,1);}vec2 evaluateBezier(float t,vec2 p0,vec2 p1,vec2 p2,vec2 p3){float u=1.-t,u2=u*u,t2=t*t;return u2*u*p0+3.*u2*t*p1+3.*u*t2*p2+t2*t*p3;}vec2 evaluateBezierDerivative(float t,vec2 p0,vec2 p1,vec2 p2,vec2 p3){float u=1.-t,u2=u*u,t2=t*t;return-3.*u2*p0+3.*u2*p1-6.*u*t*p1+6.*u*t*p2-3.*t2*p2+3.*t2*p3;}void main(){v_uv=a_texCoord;v_character=a_instanceCharacter;v_primaryColor=a_instancePrimaryColor;v_secondaryColor=a_instanceSecondaryColor;v_rotation=a_instanceRotation;v_transform=a_instanceTransform;vec2 worldPosition;bool isBezier=length(a_instanceBezierCP1)+length(a_instanceBezierCP2)+length(a_instanceBezierStart)+length(a_instanceBezierEnd)>0.;bool isArc=a_instanceArcAngles.x!=0.||a_instanceArcAngles.y!=0.;if(isBezier){float t=a_position.x;vec2 curvePoint=evaluateBezier(t,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);vec2 tangent=evaluateBezierDerivative(t,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);float tLen=length(tangent);tangent=tLen>0.?tangent/tLen:vec2(1,0);worldPosition=curvePoint+vec2(-tangent.y,tangent.x)*a_position.y*a_instanceSize.y;}else if(isArc){float s=a_instanceArcAngles.x,e=a_instanceArcAngles.y;s=mod(s,6.28318530718);if(s<0.)s+=6.28318530718;e=mod(e,6.28318530718);if(e<0.)e+=6.28318530718;float d=s-e;if(d<=0.)d+=6.28318530718;float angle=s-a_position.x*d;vec2 local=vec2(cos(angle),sin(angle))*a_position.y;worldPosition=local*a_instanceSize*.5+a_instanceSize*.5+a_instancePosition;}else{worldPosition=a_position*a_instanceSize+a_instancePosition;}vec2 ndc=(worldPosition/u_viewportSize)*2.-1.;ndc.y=-ndc.y;if(length(a_instanceGlobalRotation)>0.){vec3 pos3D=vec3(ndc-a_instanceRotationCenter,0);pos3D.x*=u_aspectRatio;if(a_instanceGlobalRotation.x!=0.)pos3D=rotateX(-a_instanceGlobalRotation.x)*pos3D;if(a_instanceGlobalRotation.y!=0.)pos3D=rotateY(-a_instanceGlobalRotation.y)*pos3D;if(a_instanceGlobalRotation.z!=0.)pos3D=rotateZ(-a_instanceGlobalRotation.z)*pos3D;pos3D.x/=u_aspectRatio;ndc=pos3D.xy+a_instanceRotationCenter;}gl_Position=vec4(ndc,0,1);}`, D = ((E) => (E.RECTANGLE = "rectangle", E.LINE = "line", E.ELLIPSE = "ellipse", E.ARC = "arc", E.TRIANGLE = "triangle", E.BEZIER_CURVE = "bezier_curve", E.CUSTOM = "custom", E))(D || {});
345
- class tA {
378
+ var D = ((E) => (E.RECTANGLE = "rectangle", E.LINE = "line", E.ELLIPSE = "ellipse", E.ARC = "arc", E.TRIANGLE = "triangle", E.BEZIER_CURVE = "bezier_curve", E.CUSTOM = "custom", E))(D || {});
379
+ class sA {
346
380
  constructor(A) {
347
- n(this, "m");
348
- n(this, "zA", /* @__PURE__ */ new Map());
349
- this.m = A;
350
- }
351
- FA(A, t, e, s) {
352
- const i = this.m;
353
- let r = this.zA.get(A);
354
- r || (r = /* @__PURE__ */ new Map(), this.zA.set(A, r));
355
- let B = r.get(t) || null;
356
- if (!B) {
357
- B = i.createVertexArray(), r.set(t, B), i.bindVertexArray(B), i.bindBuffer(i.ARRAY_BUFFER, s);
358
- const o = i.getAttribLocation(A, "a_position");
359
- o !== -1 && (i.enableVertexAttribArray(o), i.vertexAttribPointer(o, e.attributes.position.size, i.FLOAT, !1, e.stride, e.attributes.position.offset), i.vertexAttribDivisor(o, 0));
360
- const Q = i.getAttribLocation(A, "a_texCoord");
361
- Q !== -1 && (i.enableVertexAttribArray(Q), i.vertexAttribPointer(Q, e.attributes.texCoord.size, i.FLOAT, !1, e.stride, e.attributes.texCoord.offset), i.vertexAttribDivisor(Q, 0));
381
+ Q(this, "wA");
382
+ Q(this, "it", /* @__PURE__ */ new Map());
383
+ this.wA = A;
384
+ }
385
+ Bt(A, t, e, s) {
386
+ const i = this.wA;
387
+ let B = this.it.get(A);
388
+ B || (B = /* @__PURE__ */ new Map(), this.it.set(A, B));
389
+ let r = B.get(t) || null;
390
+ if (!r) {
391
+ r = i.createVertexArray(), B.set(t, r), i.bindVertexArray(r), i.bindBuffer(i.ARRAY_BUFFER, s);
392
+ const n = i.getAttribLocation(A, "a_position");
393
+ n !== -1 && (i.enableVertexAttribArray(n), i.vertexAttribPointer(n, e.Et.Qt.size, i.FLOAT, !1, e.rt, e.Et.Qt.offset), i.vertexAttribDivisor(n, 0));
394
+ const o = i.getAttribLocation(A, "a_texCoord");
395
+ o !== -1 && (i.enableVertexAttribArray(o), i.vertexAttribPointer(o, e.Et.nt.size, i.FLOAT, !1, e.rt, e.Et.nt.offset), i.vertexAttribDivisor(o, 0));
362
396
  }
363
- i.bindVertexArray(B);
397
+ i.bindVertexArray(r);
364
398
  }
365
- SA() {
366
- this.m.bindVertexArray(null);
399
+ gt() {
400
+ this.wA.bindVertexArray(null);
367
401
  }
368
- H() {
369
- const A = this.m;
370
- for (const [, t] of this.zA) for (const [, e] of t) e && A.deleteVertexArray(e);
371
- this.zA.clear();
402
+ zA() {
403
+ const A = this.wA;
404
+ for (const [, t] of this.it) for (const [, e] of t) e && A.deleteVertexArray(e);
405
+ this.it.clear();
372
406
  }
373
407
  }
374
- class eA {
375
- constructor(A) {
376
- n(this, "TA");
377
- n(this, "m");
378
- n(this, "OA", null);
379
- n(this, "kA", null);
380
- n(this, "LA", null);
381
- this.m = A, this.TA = new tA(A);
382
- }
383
- UA(A, t, e) {
384
- const { shader: s } = A, i = b(this.m) || this.m.getParameter(this.m.VIEWPORT), r = { u_aspectRatio: i[2] / i[3], u_viewportSize: [i[2], i[3]] }, B = {};
385
- for (const [a, h] of Object.entries(r)) s.iA(a) && (B[a] = h);
386
- Object.keys(B).length > 0 && s.eA(B);
387
- const o = (a) => {
388
- if (!a || !a.WA()) return;
389
- const h = a.unitGeometry, l = a.unitBuffer;
408
+ class iA {
409
+ constructor(A, t) {
410
+ Q(this, "ot");
411
+ Q(this, "wA");
412
+ Q(this, "vA");
413
+ Q(this, "ht", null);
414
+ Q(this, "ct", null);
415
+ this.wA = A, this.ot = new sA(A), this.vA = t;
416
+ }
417
+ Ct(A, t, e) {
418
+ const { shader: s } = A, i = G(this.wA) || this.wA.getParameter(this.wA.VIEWPORT);
419
+ s.JA({ k: i[2] / i[3], r: [i[2], i[3]] });
420
+ const B = (o) => {
421
+ if (!o || !o.lt()) return;
422
+ const a = o.unitGeometry, g = o.unitBuffer;
390
423
  try {
391
- this.TA.FA(s.rA, a.type + "", h, l), a.batch.HA(s), a.batch.KA(h.primitiveType, h.vertexCount);
424
+ this.ot.Bt(s.XA, o.type + "", a, g), o.batch.Dt(s), o.batch.Pt(a.ut, a.It);
392
425
  } finally {
393
- a.batch.JA(s), this.TA.SA(), a.VA();
426
+ o.batch.wt(s), this.ot.gt(), o.ft();
394
427
  }
395
428
  };
396
- let Q = null, g = null;
397
- for (const a of t) {
398
- if (a.type === D.CUSTOM) {
399
- g && (o(g), Q = null, g = null), this.ZA(A, a.params, a.state, e.get(D.RECTANGLE) || null);
429
+ let r = null, n = null;
430
+ for (const o of t) {
431
+ if (o.type === D.CUSTOM) {
432
+ n && (B(n), r = null, n = null), this.dt(A, o.params, o.state, e.get(D.RECTANGLE));
400
433
  continue;
401
434
  }
402
- Q !== null && a.type !== Q && (o(g), Q = null, g = null);
403
- let h = g;
404
- h && a.type === Q || (h = e.get(a.type) || null, g = h, Q = a.type), h && h.jA(a.params, a.state);
405
- }
406
- o(g);
407
- }
408
- ZA(A, t, e, s) {
409
- if (!s) return;
410
- const { x: i, y: r, width: B, height: o, shader: Q, uniforms: g } = t, a = this.m;
411
- Q.AA(), s.VA();
412
- const h = this.NA(Math.max(1, Math.floor(B)), Math.max(1, Math.floor(o)));
413
- h.U(), Q.AA(), g && Object.keys(g).length && Q.eA(g);
414
- {
415
- const u = b(a) || a.getParameter(a.VIEWPORT);
416
- Q.iA("u_aspectRatio") && Q.sA("u_aspectRatio", u[2] / u[3]), Q.iA("u_viewportSize") && Q.sA("u_viewportSize", [u[2], u[3]]);
417
- }
418
- const l = { ...e, rotationX: 0, rotationY: 0, rotationZ: 0 };
419
- if (s.jA({ x: 0, y: 0, width: h.width, height: h.height }, l), s.WA()) {
420
- const u = s.unitGeometry, _ = s.unitBuffer;
421
- try {
422
- this.TA.FA(Q.rA, s.type + "", u, _), s.batch.HA(Q), s.batch.KA(u.primitiveType, u.vertexCount);
423
- } finally {
424
- s.batch.JA(Q), this.TA.SA(), s.VA();
425
- }
435
+ r !== null && o.type !== r && (B(n), r = null, n = null);
436
+ let a = n;
437
+ a && o.type === r || (a = e.get(o.type) || null, n = a, r = o.type), a && a._t(o.params, o.state);
426
438
  }
427
- h.W();
428
- const c = this.XA();
429
- c.AA(), c.eA({ u_src0: h.textures[0], u_src1: h.textures[1], u_src2: h.textures[2], u_src3: h.textures[3], u_src4: h.textures[4], u_srcSize: [h.width, h.height] });
430
- const C = b(a) || a.getParameter(a.VIEWPORT);
431
- c.iA("u_aspectRatio") && c.sA("u_aspectRatio", C[2] / C[3]), c.iA("u_viewportSize") && c.sA("u_viewportSize", [C[2], C[3]]);
432
- const d = Math.floor(i), I = Math.floor(r), w = Math.max(1, Math.floor(B)), p = Math.max(1, Math.floor(o));
433
- if (s.jA({ x: d, y: I, width: w, height: p }, e), s.WA()) {
434
- const u = s.unitGeometry, _ = s.unitBuffer;
439
+ B(n);
440
+ }
441
+ dt(A, t, e, s) {
442
+ const { x: i, y: B, width: r, height: n, shader: o, uniforms: a } = t;
443
+ if (o === this.vt()) return this.yt(s, o, a, Math.floor(i), Math.floor(B), Math.max(1, Math.floor(r)), Math.max(1, Math.floor(n)), e), void A.shader.WA();
444
+ const g = this.bt(Math.max(1, Math.floor(r)), Math.max(1, Math.floor(n)));
445
+ g.begin(), this.yt(s, o, a, 0, 0, g.width, g.height, {}), g.end();
446
+ const h = this.vt(), c = { l: g.textures[0], m: g.textures[1], n: g.textures[2], o: g.textures[3], p: g.textures[4], q: [g.width, g.height] };
447
+ this.yt(s, h, c, Math.floor(i), Math.floor(B), Math.max(1, Math.floor(r)), Math.max(1, Math.floor(n)), e), A.shader.WA();
448
+ }
449
+ yt(A, t, e, s, i, B, r, n) {
450
+ t.WA(), t.JA(e);
451
+ const o = this.wA.getParameter(this.wA.VIEWPORT);
452
+ if (t.JA({ k: o[2] / o[3], r: [o[2], o[3]] }), A.ft(), A._t({ x: s, y: i, width: B, height: r }, n), A.lt()) {
453
+ const a = A.unitGeometry, g = A.unitBuffer;
435
454
  try {
436
- this.TA.FA(c.rA, s.type + "", u, _), s.batch.HA(c), s.batch.KA(u.primitiveType, u.vertexCount);
455
+ this.ot.Bt(t.XA, A.type + "", a, g), A.batch.Dt(t), A.batch.Pt(a.ut, a.It);
437
456
  } finally {
438
- s.batch.JA(c), this.TA.SA(), s.VA();
457
+ A.batch.wt(t), this.ot.gt(), A.ft();
439
458
  }
440
459
  }
441
- A.shader.AA();
442
460
  }
443
- XA() {
444
- return this.OA || (this.OA = new L(this.m, z, `#version 300 es
445
- precision highp float;in vec2 v_uv;uniform sampler2D u_src0;uniform sampler2D u_src1;uniform sampler2D u_src2;uniform sampler2D u_src3;uniform sampler2D u_src4;uniform vec2 u_srcSize;layout(location=0)out vec4 o_character;layout(location=1)out vec4 o_primaryColor;layout(location=2)out vec4 o_secondaryColor;layout(location=3)out vec4 o_rotation;layout(location=4)out vec4 o_transform;void main(){vec2 uvTex=v_uv*u_srcSize;vec2 uvQ=(floor(uvTex)+0.5f)/u_srcSize;o_character=texture(u_src0,uvQ);o_primaryColor=texture(u_src1,uvQ);o_secondaryColor=texture(u_src2,uvQ);o_rotation=texture(u_src3,uvQ);o_transform=texture(u_src4,uvQ);}`)), this.OA;
461
+ vt() {
462
+ return this.vA.At();
446
463
  }
447
- NA(A, t) {
448
- return this.kA && this.LA && this.LA.w === A && this.LA.h === t || (this.kA && this.kA.H(), this.kA = new U(this.m, A, t, 5), this.LA = { w: A, h: t }), this.kA;
464
+ bt(A, t) {
465
+ return this.ht && this.ct && this.ct.w === A && this.ct.h === t || (this.ht && this.ht.zA(), this.ht = new U(this.wA, A, t, 5), this.ct = { w: A, h: t }), this.ht;
449
466
  }
450
467
  }
451
- class sA {
468
+ class BA {
452
469
  constructor() {
453
- n(this, "qA", []);
454
- n(this, "At", 1);
455
- n(this, "tt", 0);
456
- }
457
- et(A) {
458
- if (this.tt >= this.qA.length) {
459
- const e = { id: this.At++, type: A, params: {}, state: { lineWeight: 1, rotationX: 0, rotationY: 0, rotationZ: 0, character: [0, 0, 0], charColor: [1, 1, 1, 1], bgColor: [0, 0, 0, 1], flipHorizontally: !1, flipVertically: !1, invert: !1, charRotation: [0, 0] } };
460
- this.qA.push(e);
470
+ Q(this, "Gt", []);
471
+ Q(this, "Mt", 1);
472
+ Q(this, "$t", 0);
473
+ }
474
+ xt(A) {
475
+ if (this.$t >= this.Gt.length) {
476
+ const e = { id: this.Mt++, type: A, params: {}, state: { V: 1, Z: 0, N: 0, X: 0, character: [0, 0, 0], charColor: [1, 1, 1, 1], bgColor: [0, 0, 0, 1], flipHorizontally: !1, flipVertically: !1, invert: !1, charRotation: [0, 0] } };
477
+ this.Gt.push(e);
461
478
  }
462
- const t = this.qA[this.tt];
463
- switch (t.id = this.At++, t.type = A, A) {
479
+ const t = this.Gt[this.$t];
480
+ switch (t.id = this.Mt++, t.type = A, A) {
464
481
  case D.RECTANGLE:
465
482
  case D.ELLIPSE:
466
483
  t.params && "width" in t.params || (t.params = { x: 0, y: 0, width: 0, height: 0 });
@@ -483,389 +500,412 @@ class sA {
483
500
  default:
484
501
  t.params || (t.params = {});
485
502
  }
486
- return this.tt++, t;
503
+ return this.$t++, t;
487
504
  }
488
- st(A, t, e, s, i) {
489
- const r = this.et(D.RECTANGLE);
490
- return r.params.x = A, r.params.y = t, r.params.width = e, r.params.height = s, i.dA(r.state), r.id;
505
+ Yt(A, t, e, s, i) {
506
+ const B = this.xt(D.RECTANGLE);
507
+ return B.params.x = A, B.params.y = t, B.params.width = e, B.params.height = s, i.BA(B.state), B.id;
491
508
  }
492
- it(A, t, e, s, i, r, B) {
493
- const o = this.et(D.CUSTOM);
494
- return o.params.x = A, o.params.y = t, o.params.width = e, o.params.height = s, o.params.shader = i, o.params.uniforms = r, B.dA(o.state), o.id;
509
+ Ft(A, t, e, s, i, B, r) {
510
+ const n = this.xt(D.CUSTOM);
511
+ return n.params.x = A, n.params.y = t, n.params.width = e, n.params.height = s, n.params.shader = i, n.params.uniforms = B, r.BA(n.state), n.id;
495
512
  }
496
- Bt(A, t, e, s, i, r) {
497
- const B = this.et(D.LINE);
498
- return B.params.x1 = A, B.params.y1 = t, B.params.x2 = e, B.params.y2 = s, B.params.thickness = i, r.dA(B.state), B.id;
513
+ Rt(A, t, e, s, i, B) {
514
+ const r = this.xt(D.LINE);
515
+ return r.params.x1 = A, r.params.y1 = t, r.params.x2 = e, r.params.y2 = s, r.params.thickness = i, B.BA(r.state), r.id;
499
516
  }
500
- rt(A, t, e, s, i) {
501
- const r = this.et(D.ELLIPSE);
502
- return r.params.x = A, r.params.y = t, r.params.width = e, r.params.height = s, i.dA(r.state), r.id;
517
+ St(A, t, e, s, i) {
518
+ const B = this.xt(D.ELLIPSE);
519
+ return B.params.x = A, B.params.y = t, B.params.width = e, B.params.height = s, i.BA(B.state), B.id;
503
520
  }
504
- Qt(A, t, e, s, i, r, B) {
505
- const o = this.et(D.ARC);
506
- return o.params.x = A, o.params.y = t, o.params.width = e, o.params.height = s, o.params.start = i, o.params.stop = r, B.dA(o.state), o.id;
521
+ zt(A, t, e, s, i, B, r) {
522
+ const n = this.xt(D.ARC);
523
+ return n.params.x = A, n.params.y = t, n.params.width = e, n.params.height = s, n.params.start = i, n.params.stop = B, r.BA(n.state), n.id;
507
524
  }
508
- Et(A, t, e, s, i, r, B) {
509
- const o = this.et(D.TRIANGLE);
510
- return o.params.x1 = A, o.params.y1 = t, o.params.x2 = e, o.params.y2 = s, o.params.x3 = i, o.params.y3 = r, B.dA(o.state), o.id;
525
+ kt(A, t, e, s, i, B, r) {
526
+ const n = this.xt(D.TRIANGLE);
527
+ return n.params.x1 = A, n.params.y1 = t, n.params.x2 = e, n.params.y2 = s, n.params.x3 = i, n.params.y3 = B, r.BA(n.state), n.id;
511
528
  }
512
- nt(A, t, e, s, i, r, B, o, Q, g) {
513
- const a = this.et(D.BEZIER_CURVE);
514
- return a.params.x1 = A, a.params.y1 = t, a.params.cp1x = e, a.params.cp1y = s, a.params.cp2x = i, a.params.cp2y = r, a.params.x2 = B, a.params.y2 = o, a.params.thickness = Q, g.dA(a.state), a.id;
529
+ Ot(A, t, e, s, i, B, r, n, o, a) {
530
+ const g = this.xt(D.BEZIER_CURVE);
531
+ return g.params.x1 = A, g.params.y1 = t, g.params.cp1x = e, g.params.cp1y = s, g.params.cp2x = i, g.params.cp2y = B, g.params.x2 = r, g.params.y2 = n, g.params.thickness = o, a.BA(g.state), g.id;
515
532
  }
516
533
  get length() {
517
- return this.tt;
534
+ return this.$t;
518
535
  }
519
536
  get isEmpty() {
520
- return this.tt === 0;
537
+ return this.$t === 0;
521
538
  }
522
- ot() {
523
- this.tt = 0;
539
+ Lt() {
540
+ this.$t = 0;
524
541
  }
525
542
  [Symbol.iterator]() {
526
543
  let A = 0;
527
- const t = this.tt, e = this.qA;
544
+ const t = this.$t, e = this.Gt;
528
545
  return { next: () => A < t ? { value: e[A++], done: !1 } : { value: void 0, done: !0 } };
529
546
  }
530
547
  }
531
- const v = class v {
532
- static gt(A, t, e = 0) {
533
- var r, B, o, Q, g, a, h, l, c, C;
534
- const s = t || new Float32Array(v.FLOATS_PER_INSTANCE);
548
+ const y = class y {
549
+ static Ut(A, t, e = 0) {
550
+ var B, r, n, o, a, g, h, c, l, C;
551
+ const s = t || new Float32Array(y.FLOATS_PER_INSTANCE);
535
552
  let i = e;
536
- return s[i++] = A.position[0], s[i++] = A.position[1], s[i++] = A.size[0], s[i++] = A.size[1], s[i++] = A.character[0], s[i++] = A.character[1], s[i++] = A.character[2], s[i++] = A.primaryColor[0], s[i++] = A.primaryColor[1], s[i++] = A.primaryColor[2], s[i++] = A.primaryColor[3], s[i++] = A.secondaryColor[0], s[i++] = A.secondaryColor[1], s[i++] = A.secondaryColor[2], s[i++] = A.secondaryColor[3], s[i++] = A.rotation[0], s[i++] = A.rotation[1], s[i++] = A.transform[0], s[i++] = A.transform[1], s[i++] = A.transform[2], s[i++] = A.globalRotationX, s[i++] = A.globalRotationY, s[i++] = A.globalRotationZ, s[i++] = A.rotationCenter[0], s[i++] = A.rotationCenter[1], s[i++] = ((r = A.arcAngles) == null ? void 0 : r[0]) || 0, s[i++] = ((B = A.arcAngles) == null ? void 0 : B[1]) || 0, s[i++] = ((o = A.bezierControlPoint1) == null ? void 0 : o[0]) || 0, s[i++] = ((Q = A.bezierControlPoint1) == null ? void 0 : Q[1]) || 0, s[i++] = ((g = A.bezierControlPoint2) == null ? void 0 : g[0]) || 0, s[i++] = ((a = A.bezierControlPoint2) == null ? void 0 : a[1]) || 0, s[i++] = ((h = A.bezierStartPoint) == null ? void 0 : h[0]) || 0, s[i++] = ((l = A.bezierStartPoint) == null ? void 0 : l[1]) || 0, s[i++] = ((c = A.bezierEndPoint) == null ? void 0 : c[0]) || 0, s[i++] = ((C = A.bezierEndPoint) == null ? void 0 : C[1]) || 0, s;
553
+ return s[i++] = A.position[0], s[i++] = A.position[1], s[i++] = A.size[0], s[i++] = A.size[1], s[i++] = A.AA[0], s[i++] = A.AA[1], s[i++] = A.AA[2], s[i++] = A.primaryColor[0], s[i++] = A.primaryColor[1], s[i++] = A.primaryColor[2], s[i++] = A.primaryColor[3], s[i++] = A.secondaryColor[0], s[i++] = A.secondaryColor[1], s[i++] = A.secondaryColor[2], s[i++] = A.secondaryColor[3], s[i++] = A.rotation[0], s[i++] = A.rotation[1], s[i++] = A.transform[0], s[i++] = A.transform[1], s[i++] = A.transform[2], s[i++] = A.globalRotationX, s[i++] = A.globalRotationY, s[i++] = A.globalRotationZ, s[i++] = A.rotationCenter[0], s[i++] = A.rotationCenter[1], s[i++] = ((B = A.arcAngles) == null ? void 0 : B[0]) || 0, s[i++] = ((r = A.arcAngles) == null ? void 0 : r[1]) || 0, s[i++] = ((n = A.bezierControlPoint1) == null ? void 0 : n[0]) || 0, s[i++] = ((o = A.bezierControlPoint1) == null ? void 0 : o[1]) || 0, s[i++] = ((a = A.bezierControlPoint2) == null ? void 0 : a[0]) || 0, s[i++] = ((g = A.bezierControlPoint2) == null ? void 0 : g[1]) || 0, s[i++] = ((h = A.bezierStartPoint) == null ? void 0 : h[0]) || 0, s[i++] = ((c = A.bezierStartPoint) == null ? void 0 : c[1]) || 0, s[i++] = ((l = A.bezierEndPoint) == null ? void 0 : l[0]) || 0, s[i++] = ((C = A.bezierEndPoint) == null ? void 0 : C[1]) || 0, s;
537
554
  }
538
- static ht(A) {
539
- const t = A.length * v.FLOATS_PER_INSTANCE, e = new Float32Array(t);
555
+ static Tt(A) {
556
+ const t = A.length * y.FLOATS_PER_INSTANCE, e = new Float32Array(t);
540
557
  for (let s = 0; s < A.length; s++) {
541
- const i = s * v.FLOATS_PER_INSTANCE;
542
- v.gt(A[s], e, i);
558
+ const i = s * y.FLOATS_PER_INSTANCE;
559
+ y.Ut(A[s], e, i);
543
560
  }
544
561
  return e;
545
562
  }
546
563
  };
547
- n(v, "BYTES_PER_INSTANCE", 140), n(v, "FLOATS_PER_INSTANCE", 35);
548
- let R = v;
564
+ Q(y, "BYTES_PER_INSTANCE", 140), Q(y, "FLOATS_PER_INSTANCE", 35);
565
+ let x = y;
549
566
  const P = class P {
550
567
  };
551
- n(P, "STRIDE", R.BYTES_PER_INSTANCE), n(P, "ATTRIBUTES", { a_instancePosition: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 0, divisor: 1 }, a_instanceSize: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 8, divisor: 1 }, a_instanceCharacter: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 16, divisor: 1 }, a_instancePrimaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 28, divisor: 1 }, a_instanceSecondaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 44, divisor: 1 }, a_instanceRotation: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 60, divisor: 1 }, a_instanceTransform: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 68, divisor: 1 }, a_instanceGlobalRotation: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 80, divisor: 1 }, a_instanceRotationCenter: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 92, divisor: 1 }, a_instanceArcAngles: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 100, divisor: 1 }, a_instanceBezierCP1: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 108, divisor: 1 }, a_instanceBezierCP2: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 116, divisor: 1 }, a_instanceBezierStart: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 124, divisor: 1 }, a_instanceBezierEnd: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 132, divisor: 1 } });
552
- let F = P;
553
- class iA {
568
+ Q(P, "STRIDE", x.BYTES_PER_INSTANCE), Q(P, "ATTRIBUTES", { a_instancePosition: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 0, divisor: 1 }, a_instanceSize: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 8, divisor: 1 }, a_instanceCharacter: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 16, divisor: 1 }, a_instancePrimaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 28, divisor: 1 }, a_instanceSecondaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 44, divisor: 1 }, a_instanceRotation: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 60, divisor: 1 }, a_instanceTransform: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 68, divisor: 1 }, a_instanceGlobalRotation: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 80, divisor: 1 }, a_instanceRotationCenter: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 92, divisor: 1 }, a_instanceArcAngles: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 100, divisor: 1 }, a_instanceBezierCP1: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 108, divisor: 1 }, a_instanceBezierCP2: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 116, divisor: 1 }, a_instanceBezierStart: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 124, divisor: 1 }, a_instanceBezierEnd: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 132, divisor: 1 } });
569
+ let Y = P;
570
+ class rA {
554
571
  constructor(A, t = 1e3, e = 1.5) {
555
- n(this, "m");
556
- n(this, "ct", []);
557
- n(this, "lt");
558
- n(this, "Ct");
559
- n(this, "Dt", null);
560
- n(this, "ut", !0);
561
- n(this, "Pt", 0);
562
- n(this, "It", /* @__PURE__ */ new Map());
563
- n(this, "wt", null);
564
- this.m = A, this.lt = t, this.Ct = e, this.ft();
565
- }
566
- jA(A) {
567
- const t = this.ct.length;
568
- return this.ct.push(A), this.ut = !0, t;
572
+ Q(this, "wA");
573
+ Q(this, "Ht", []);
574
+ Q(this, "Wt");
575
+ Q(this, "Kt");
576
+ Q(this, "Jt", null);
577
+ Q(this, "Vt", !0);
578
+ Q(this, "Zt", 0);
579
+ Q(this, "Nt", /* @__PURE__ */ new Map());
580
+ Q(this, "Xt", null);
581
+ this.wA = A, this.Wt = t, this.Kt = e, this.jt();
582
+ }
583
+ _t(A) {
584
+ const t = this.Ht.length;
585
+ return this.Ht.push(A), this.Vt = !0, t;
569
586
  }
570
587
  get count() {
571
- return this.ct.length;
588
+ return this.Ht.length;
572
589
  }
573
590
  get isEmpty() {
574
- return this.ct.length === 0;
591
+ return this.Ht.length === 0;
575
592
  }
576
593
  clear() {
577
- this.ct.length = 0, this.ut = !0;
578
- }
579
- dt(A) {
580
- if (A <= this.lt) return;
581
- const t = Math.ceil(A * this.Ct);
582
- this.lt = t, this.ft();
583
- }
584
- ft() {
585
- const A = this.m;
586
- this.Dt && A.deleteBuffer(this.Dt), this.Dt = A.createBuffer();
587
- const t = this.lt * R.BYTES_PER_INSTANCE;
588
- A.bindBuffer(A.ARRAY_BUFFER, this.Dt), A.bufferData(A.ARRAY_BUFFER, t, A.DYNAMIC_DRAW), A.bindBuffer(A.ARRAY_BUFFER, null), this.ut = !0, this.Pt = 0;
589
- }
590
- _t() {
591
- if (!this.ut || this.ct.length === 0) return;
592
- const A = this.m, t = this.ct.length;
593
- this.dt(t), (!this.wt || this.wt.length < t * R.FLOATS_PER_INSTANCE) && (this.wt = new Float32Array(t * R.FLOATS_PER_INSTANCE));
594
- const e = R.ht(this.ct);
595
- A.bindBuffer(A.ARRAY_BUFFER, this.Dt), t <= this.Pt ? A.bufferSubData(A.ARRAY_BUFFER, 0, e) : A.bufferData(A.ARRAY_BUFFER, e, A.DYNAMIC_DRAW), A.bindBuffer(A.ARRAY_BUFFER, null), this.ut = !1, this.Pt = t;
596
- }
597
- vt(A) {
598
- let t = this.It.get(A);
594
+ this.Ht.length = 0, this.Vt = !0;
595
+ }
596
+ qt(A) {
597
+ if (A <= this.Wt) return;
598
+ const t = Math.ceil(A * this.Kt);
599
+ this.Wt = t, this.jt();
600
+ }
601
+ jt() {
602
+ const A = this.wA;
603
+ this.Jt && A.deleteBuffer(this.Jt), this.Jt = A.createBuffer();
604
+ const t = this.Wt * x.BYTES_PER_INSTANCE;
605
+ A.bindBuffer(A.ARRAY_BUFFER, this.Jt), A.bufferData(A.ARRAY_BUFFER, t, A.DYNAMIC_DRAW), A.bindBuffer(A.ARRAY_BUFFER, null), this.Vt = !0, this.Zt = 0;
606
+ }
607
+ Ae() {
608
+ if (!this.Vt || this.Ht.length === 0) return;
609
+ const A = this.wA, t = this.Ht.length;
610
+ this.qt(t), (!this.Xt || this.Xt.length < t * x.FLOATS_PER_INSTANCE) && (this.Xt = new Float32Array(t * x.FLOATS_PER_INSTANCE));
611
+ const e = x.Tt(this.Ht);
612
+ A.bindBuffer(A.ARRAY_BUFFER, this.Jt), t <= this.Zt ? A.bufferSubData(A.ARRAY_BUFFER, 0, e) : A.bufferData(A.ARRAY_BUFFER, e, A.DYNAMIC_DRAW), A.bindBuffer(A.ARRAY_BUFFER, null), this.Vt = !1, this.Zt = t;
613
+ }
614
+ te(A) {
615
+ let t = this.Nt.get(A);
599
616
  if (!t) {
600
617
  t = /* @__PURE__ */ new Map();
601
- const e = this.m;
602
- for (const s in F.ATTRIBUTES) {
618
+ const e = this.wA;
619
+ for (const s in Y.ATTRIBUTES) {
603
620
  const i = e.getAttribLocation(A, s);
604
621
  i !== -1 && t.set(s, i);
605
622
  }
606
- this.It.set(A, t);
623
+ this.Nt.set(A, t);
607
624
  }
608
625
  return t;
609
626
  }
610
- HA(A) {
611
- if (!this.Dt || this.ct.length === 0) return;
612
- const t = this.m, e = A.rA;
613
- this._t();
614
- const s = this.vt(e);
615
- t.bindBuffer(t.ARRAY_BUFFER, this.Dt);
616
- for (const [i, r] of s) {
617
- const B = F.ATTRIBUTES[i];
618
- B && (t.enableVertexAttribArray(r), t.vertexAttribPointer(r, B.size, B.type, B.normalized, B.stride, B.offset), t.vertexAttribDivisor(r, B.divisor));
627
+ Dt(A) {
628
+ if (!this.Jt || this.Ht.length === 0) return;
629
+ const t = this.wA, e = A.XA;
630
+ this.Ae();
631
+ const s = this.te(e);
632
+ t.bindBuffer(t.ARRAY_BUFFER, this.Jt);
633
+ for (const [i, B] of s) {
634
+ const r = Y.ATTRIBUTES[i];
635
+ r && (t.enableVertexAttribArray(B), t.vertexAttribPointer(B, r.size, r.type, r.normalized, r.stride, r.offset), t.vertexAttribDivisor(B, r.divisor));
619
636
  }
620
637
  }
621
- JA(A) {
622
- const t = this.m, e = this.vt(A.rA);
638
+ wt(A) {
639
+ const t = this.wA, e = this.te(A.XA);
623
640
  for (const [, s] of e) t.disableVertexAttribArray(s), t.vertexAttribDivisor(s, 0);
624
641
  }
625
- KA(A, t) {
626
- this.ct.length !== 0 && this.m.drawArraysInstanced(A, 0, t, this.ct.length);
642
+ Pt(A, t) {
643
+ this.Ht.length !== 0 && this.wA.drawArraysInstanced(A, 0, t, this.Ht.length);
627
644
  }
628
- H() {
629
- const A = this.m;
630
- this.Dt && (A.deleteBuffer(this.Dt), this.Dt = null), this.ct.length = 0, this.It.clear(), this.wt = null;
645
+ zA() {
646
+ const A = this.wA;
647
+ this.Jt && (A.deleteBuffer(this.Jt), this.Jt = null), this.Ht.length = 0, this.Nt.clear(), this.Xt = null;
631
648
  }
632
649
  }
633
- class T {
650
+ class b {
634
651
  constructor(A, t, e, s) {
635
- n(this, "m");
636
- n(this, "yt");
637
- n(this, "xt");
638
- n(this, "bt");
639
- n(this, "Gt", null);
640
- this.m = A, this.yt = t, this.xt = e, this.bt = s;
641
- const i = this.m.createBuffer();
652
+ Q(this, "wA");
653
+ Q(this, "ee");
654
+ Q(this, "se");
655
+ Q(this, "ie");
656
+ Q(this, "Be", null);
657
+ this.wA = A, this.ee = t, this.se = e, this.ie = s;
658
+ const i = this.wA.createBuffer();
642
659
  if (!i) throw Error("Failed to create unit geometry buffer");
643
- this.m.bindBuffer(this.m.ARRAY_BUFFER, i), this.m.bufferData(this.m.ARRAY_BUFFER, this.bt.vertices, this.m.STATIC_DRAW), this.m.bindBuffer(this.m.ARRAY_BUFFER, null), this.Gt = i;
660
+ this.wA.bindBuffer(this.wA.ARRAY_BUFFER, i), this.wA.bufferData(this.wA.ARRAY_BUFFER, this.ie.Qe, this.wA.STATIC_DRAW), this.wA.bindBuffer(this.wA.ARRAY_BUFFER, null), this.Be = i;
644
661
  }
645
662
  get type() {
646
- return this.xt;
663
+ return this.se;
647
664
  }
648
665
  get unitGeometry() {
649
- return this.bt;
666
+ return this.ie;
650
667
  }
651
668
  get unitBuffer() {
652
- return this.Gt;
669
+ return this.Be;
653
670
  }
654
671
  get batch() {
655
- return this.yt;
672
+ return this.ee;
656
673
  }
657
- VA() {
658
- this.yt.clear();
674
+ ft() {
675
+ this.ee.clear();
659
676
  }
660
- WA() {
661
- return !this.yt.isEmpty;
677
+ lt() {
678
+ return !this.ee.isEmpty;
662
679
  }
663
- H() {
664
- this.yt.H(), this.Gt && (this.m.deleteBuffer(this.Gt), this.Gt = null);
680
+ zA() {
681
+ this.ee.zA(), this.Be && (this.wA.deleteBuffer(this.Be), this.Be = null);
665
682
  }
666
- $t(A, t, e, s, i) {
667
- const r = this.Mt(A, t, e, s, i.rotationX || 0, i.rotationY || 0, i.rotationZ || 0);
668
- return { position: [A, t], size: [e, s], character: i.character || [0, 0, 0], primaryColor: i.charColor || [1, 1, 1, 1], secondaryColor: i.bgColor || [0, 0, 0, 1], rotation: i.charRotation || [0, 0], transform: [i.invert ? 1 : 0, i.flipHorizontally ? 1 : 0, i.flipVertically ? 1 : 0], globalRotationX: r.radiansX, globalRotationY: r.radiansY, globalRotationZ: r.radiansZ, rotationCenter: [r.centerX, r.centerY] };
683
+ Ee(A, t, e, s, i) {
684
+ const B = this.re(A, t, e, s, i.rotationX || 0, i.rotationY || 0, i.rotationZ || 0);
685
+ return { position: [A, t], size: [e, s], AA: i.character || [0, 0, 0], primaryColor: i.charColor || [1, 1, 1, 1], secondaryColor: i.bgColor || [0, 0, 0, 1], rotation: i.charRotation || [0, 0], transform: [i.invert ? 1 : 0, i.flipHorizontally ? 1 : 0, i.flipVertically ? 1 : 0], globalRotationX: B.radiansX, globalRotationY: B.radiansY, globalRotationZ: B.radiansZ, rotationCenter: [B.centerX, B.centerY] };
669
686
  }
670
- Yt(A, t) {
671
- const e = b(this.m) || [0, 0, this.m.canvas.width, this.m.canvas.height];
687
+ ne(A, t) {
688
+ const e = G(this.wA) || [0, 0, this.wA.canvas.width, this.wA.canvas.height];
672
689
  return { nx: A / e[2] * 2 - 1, ny: 1 - t / e[3] * 2 };
673
690
  }
674
- Rt(A, t, e) {
675
- const s = this.Yt(t, e);
691
+ ge(A, t, e) {
692
+ const s = this.ne(t, e);
676
693
  A.rotationCenter = [s.nx, s.ny];
677
694
  }
678
- Mt(A, t, e, s, i, r, B) {
679
- const o = b(this.m) || [0, 0, this.m.canvas.width, this.m.canvas.height], Q = o[2], g = o[3];
680
- return { centerX: (A + e / 2) / Q * 2 - 1, centerY: 1 - (t + s / 2) / g * 2, radiansX: -i * Math.PI / 180, radiansY: -r * Math.PI / 180, radiansZ: -B * Math.PI / 180, aspectRatio: Q / g };
695
+ re(A, t, e, s, i, B, r) {
696
+ const n = G(this.wA) || [0, 0, this.wA.canvas.width, this.wA.canvas.height], o = n[2], a = n[3];
697
+ return { centerX: (A + e / 2) / o * 2 - 1, centerY: 1 - (t + s / 2) / a * 2, radiansX: -i * Math.PI / 180, radiansY: -B * Math.PI / 180, radiansZ: -r * Math.PI / 180, aspectRatio: o / a };
681
698
  }
682
699
  }
683
- const rA = { vertices: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1]), vertexCount: 6, primitiveType: WebGL2RenderingContext.TRIANGLES, stride: 16, attributes: { position: { size: 2, offset: 0 }, texCoord: { size: 2, offset: 8 } } };
684
- class BA extends T {
700
+ const EA = { Qe: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1]), It: 6, ut: WebGL2RenderingContext.TRIANGLES, rt: 16, Et: { Qt: { size: 2, offset: 0 }, nt: { size: 2, offset: 8 } } };
701
+ class QA extends b {
685
702
  constructor(A, t) {
686
- super(A, t, D.RECTANGLE, rA);
703
+ super(A, t, D.RECTANGLE, EA);
687
704
  }
688
- jA(A, t) {
689
- const e = this.$t(A.x, A.y, A.width, A.height, t);
690
- return this.yt.jA(e);
705
+ _t(A, t) {
706
+ const e = this.Ee(A.x, A.y, A.width, A.height, t);
707
+ return this.ee._t(e);
691
708
  }
692
709
  }
693
- const EA = { vertices: new Float32Array([0, -0.5, 0, 0, 1, -0.5, 1, 0, 0, 0.5, 0, 1, 0, 0.5, 0, 1, 1, -0.5, 1, 0, 1, 0.5, 1, 1]), vertexCount: 6, primitiveType: WebGL2RenderingContext.TRIANGLES, stride: 16, attributes: { position: { size: 2, offset: 0 }, texCoord: { size: 2, offset: 8 } } };
694
- class nA extends T {
710
+ const nA = { Qe: new Float32Array([0, -0.5, 0, 0, 1, -0.5, 1, 0, 0, 0.5, 0, 1, 0, 0.5, 0, 1, 1, -0.5, 1, 0, 1, 0.5, 1, 1]), It: 6, ut: WebGL2RenderingContext.TRIANGLES, rt: 16, Et: { Qt: { size: 2, offset: 0 }, nt: { size: 2, offset: 8 } } };
711
+ class oA extends b {
695
712
  constructor(A, t) {
696
- super(A, t, D.LINE, EA);
713
+ super(A, t, D.LINE, nA);
697
714
  }
698
- jA(A, t) {
699
- const e = A.x2 - A.x1, s = A.y2 - A.y1, i = Math.hypot(e, s), r = Math.atan2(s, e), B = A.thickness || t.lineWeight || 1, o = A.x1 + e / 2, Q = A.y1 + s / 2, g = o - i / 2, a = Q, h = { character: t.character, charColor: t.charColor, bgColor: t.bgColor, charRotation: t.charRotation, flipHorizontally: t.flipHorizontally, flipVertically: t.flipVertically, invert: t.invert, rotationX: t.rotationX || 0, rotationY: t.rotationY || 0, rotationZ: (t.rotationZ || 0) + 180 * r / Math.PI, lineWeight: B }, l = this.$t(g, a, i, B, h);
700
- return this.Rt(l, o, Q), this.yt.jA(l);
715
+ _t(A, t) {
716
+ const e = A.x2 - A.x1, s = A.y2 - A.y1, i = Math.hypot(e, s), B = Math.atan2(s, e), r = A.thickness || t.lineWeight || 1, n = A.x1 + e / 2, o = A.y1 + s / 2, a = n - i / 2, g = o, h = { character: t.character, charColor: t.charColor, bgColor: t.bgColor, charRotation: t.charRotation, flipHorizontally: t.flipHorizontally, flipVertically: t.flipVertically, invert: t.invert, rotationX: t.rotationX || 0, rotationY: t.rotationY || 0, rotationZ: (t.rotationZ || 0) + 180 * B / Math.PI, lineWeight: r }, c = this.Ee(a, g, i, r, h);
717
+ return this.ge(c, n, o), this.ee._t(c);
701
718
  }
702
719
  }
703
- const oA = { vertices: function(E = 32) {
720
+ const gA = { Qe: function(E = 32) {
704
721
  const A = [], t = 2 * Math.PI / E;
705
722
  for (let e = 0; e < E; e++) {
706
- const s = e * t, i = (e + 1) % E * t, r = Math.cos(s), B = Math.sin(s), o = 0.5 * (r + 1), Q = 0.5 * (B + 1), g = Math.cos(i), a = Math.sin(i), h = 0.5 * (g + 1), l = 0.5 * (a + 1);
707
- A.push(0, 0, 0.5, 0.5, r, B, o, Q, g, a, h, l);
723
+ const s = e * t, i = (e + 1) % E * t, B = Math.cos(s), r = Math.sin(s), n = 0.5 * (B + 1), o = 0.5 * (r + 1), a = Math.cos(i), g = Math.sin(i), h = 0.5 * (a + 1), c = 0.5 * (g + 1);
724
+ A.push(0, 0, 0.5, 0.5, B, r, n, o, a, g, h, c);
708
725
  }
709
726
  return new Float32Array(A);
710
- }(32), vertexCount: 96, primitiveType: WebGL2RenderingContext.TRIANGLES, stride: 16, attributes: { position: { size: 2, offset: 0 }, texCoord: { size: 2, offset: 8 } } };
711
- class QA extends T {
727
+ }(32), It: 96, ut: WebGL2RenderingContext.TRIANGLES, rt: 16, Et: { Qt: { size: 2, offset: 0 }, nt: { size: 2, offset: 8 } } };
728
+ class aA extends b {
712
729
  constructor(A, t) {
713
- super(A, t, D.ELLIPSE, oA);
730
+ super(A, t, D.ELLIPSE, gA);
714
731
  }
715
- jA(A, t) {
716
- const e = this.$t(A.x, A.y, A.width, A.height, t);
717
- return this.Rt(e, A.x, A.y), this.yt.jA(e);
732
+ _t(A, t) {
733
+ const e = this.Ee(A.x, A.y, A.width, A.height, t);
734
+ return this.ge(e, A.x, A.y), this.ee._t(e);
718
735
  }
719
736
  }
720
- let aA = { vertices: function(E) {
737
+ let hA = { Qe: function(E) {
721
738
  const A = [];
722
739
  for (let t = 0; t < E; t++) {
723
740
  const e = t / E, s = (t + 1) / E;
724
741
  A.push(e, 0, e, 0, e, 1, e, 1, s, 1, s, 1);
725
742
  }
726
743
  return new Float32Array(A);
727
- }(32), vertexCount: 96, primitiveType: WebGL2RenderingContext.TRIANGLES, stride: 16, attributes: { position: { size: 2, offset: 0 }, texCoord: { size: 2, offset: 8 } } };
728
- class gA extends T {
744
+ }(32), It: 96, ut: WebGL2RenderingContext.TRIANGLES, rt: 16, Et: { Qt: { size: 2, offset: 0 }, nt: { size: 2, offset: 8 } } };
745
+ class cA extends b {
729
746
  constructor(A, t) {
730
- super(A, t, D.ARC, aA);
747
+ super(A, t, D.ARC, hA);
731
748
  }
732
- jA(A, t) {
733
- const e = A.x - A.width / 2, s = A.y - A.height / 2, i = A.start * Math.PI / 180, r = A.stop * Math.PI / 180, B = this.$t(e, s, A.width, A.height, t);
734
- return this.Rt(B, A.x, A.y), B.arcAngles = [i, r], this.yt.jA(B);
749
+ _t(A, t) {
750
+ const e = A.x - A.width / 2, s = A.y - A.height / 2, i = A.start * Math.PI / 180, B = A.stop * Math.PI / 180, r = this.Ee(e, s, A.width, A.height, t);
751
+ return this.ge(r, A.x, A.y), r.arcAngles = [i, B], this.ee._t(r);
735
752
  }
736
753
  }
737
- const hA = { vertices: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), vertexCount: 3, primitiveType: WebGL2RenderingContext.TRIANGLES, stride: 16, attributes: { position: { size: 2, offset: 0 }, texCoord: { size: 2, offset: 8 } } };
738
- class cA extends T {
754
+ const lA = { Qe: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), It: 3, ut: WebGL2RenderingContext.TRIANGLES, rt: 16, Et: { Qt: { size: 2, offset: 0 }, nt: { size: 2, offset: 8 } } };
755
+ class CA extends b {
739
756
  constructor(A, t) {
740
- super(A, t, D.TRIANGLE, hA);
757
+ super(A, t, D.TRIANGLE, lA);
741
758
  }
742
- jA(A, t) {
743
- const e = Math.min(A.x1, A.x2, A.x3), s = Math.max(A.x1, A.x2, A.x3), i = Math.min(A.y1, A.y2, A.y3), r = s - e, B = Math.max(A.y1, A.y2, A.y3) - i, o = this.$t(e, i, r, B, t), Q = e + 0.5 * r, g = i + B * (1 / 3);
744
- return this.Rt(o, Q, g), this.yt.jA(o);
759
+ _t(A, t) {
760
+ const e = Math.min(A.x1, A.x2, A.x3), s = Math.max(A.x1, A.x2, A.x3), i = Math.min(A.y1, A.y2, A.y3), B = s - e, r = Math.max(A.y1, A.y2, A.y3) - i, n = this.Ee(e, i, B, r, t), o = e + 0.5 * B, a = i + r * (1 / 3);
761
+ return this.ge(n, o, a), this.ee._t(n);
745
762
  }
746
763
  }
747
- function W(E, A, t, e, s) {
748
- const i = 1 - E, r = i * i, B = E * E;
749
- return r * i * A + 3 * r * E * t + 3 * i * B * e + B * E * s;
764
+ function H(E, A, t, e, s) {
765
+ const i = 1 - E, B = i * i, r = E * E;
766
+ return B * i * A + 3 * B * E * t + 3 * i * r * e + r * E * s;
750
767
  }
751
- const lA = { vertices: function(E = 16) {
768
+ const DA = { Qe: function(E = 16) {
752
769
  const A = [];
753
770
  for (let t = 0; t < E; t++) {
754
771
  const e = t / E, s = (t + 1) / E;
755
772
  A.push(e, -0.5, e, 0), A.push(s, -0.5, s, 0), A.push(e, 0.5, e, 1), A.push(e, 0.5, e, 1), A.push(s, -0.5, s, 0), A.push(s, 0.5, s, 1);
756
773
  }
757
774
  return new Float32Array(A);
758
- }(16), vertexCount: 96, primitiveType: WebGL2RenderingContext.TRIANGLES, stride: 16, attributes: { position: { size: 2, offset: 0 }, texCoord: { size: 2, offset: 8 } } };
759
- class CA extends T {
775
+ }(16), It: 96, ut: WebGL2RenderingContext.TRIANGLES, rt: 16, Et: { Qt: { size: 2, offset: 0 }, nt: { size: 2, offset: 8 } } };
776
+ class PA extends b {
760
777
  constructor(A, t) {
761
- super(A, t, D.BEZIER_CURVE, lA);
778
+ super(A, t, D.BEZIER_CURVE, DA);
762
779
  }
763
- jA(A, t) {
764
- const e = t.lineWeight || 1, s = W(0.5, A.x1, A.cp1x, A.cp2x, A.x2), i = W(0.5, A.y1, A.cp1y, A.cp2y, A.y2), r = { character: t.character, charColor: t.charColor, bgColor: t.bgColor, charRotation: t.charRotation, flipHorizontally: t.flipHorizontally, flipVertically: t.flipVertically, invert: t.invert, rotationX: t.rotationX || 0, rotationY: t.rotationY || 0, rotationZ: t.rotationZ || 0, lineWeight: e }, B = this.$t(0, 0, 1, e, r);
765
- return this.Rt(B, s, i), B.bezierStartPoint = [A.x1, A.y1], B.bezierControlPoint1 = [A.cp1x, A.cp1y], B.bezierControlPoint2 = [A.cp2x, A.cp2y], B.bezierEndPoint = [A.x2, A.y2], this.yt.jA(B);
780
+ _t(A, t) {
781
+ const e = t.lineWeight || 1, s = H(0.5, A.x1, A.cp1x, A.cp2x, A.x2), i = H(0.5, A.y1, A.cp1y, A.cp2y, A.y2), B = { character: t.character, charColor: t.charColor, bgColor: t.bgColor, charRotation: t.charRotation, flipHorizontally: t.flipHorizontally, flipVertically: t.flipVertically, invert: t.invert, rotationX: t.rotationX || 0, rotationY: t.rotationY || 0, rotationZ: t.rotationZ || 0, lineWeight: e }, r = this.Ee(0, 0, 1, e, B);
782
+ return this.ge(r, s, i), r.bezierStartPoint = [A.x1, A.y1], r.bezierControlPoint1 = [A.cp1x, A.cp1y], r.bezierControlPoint2 = [A.cp2x, A.cp2y], r.bezierEndPoint = [A.x2, A.y2], this.ee._t(r);
766
783
  }
767
784
  }
768
- class DA {
785
+ class uA {
769
786
  constructor(A) {
770
- n(this, "m");
771
- n(this, "zt", null);
772
- n(this, "Ft", null);
773
- n(this, "St", {});
774
- n(this, "Tt", null);
775
- n(this, "Ot", /* @__PURE__ */ new Map());
776
- n(this, "kt");
777
- n(this, "Lt");
778
- n(this, "Ut");
779
- this.m = A, this.Ut = new AA(), this.kt = new eA(A), this.Lt = new sA(), this.Tt = A.createBuffer(), M(this.m, [0, 0, this.m.canvas.width, this.m.canvas.height]);
780
- }
781
- Wt(A) {
782
- let t = this.Ot.get(A);
787
+ Q(this, "wA");
788
+ Q(this, "oe", null);
789
+ Q(this, "ae");
790
+ Q(this, "he", null);
791
+ Q(this, "ce", {});
792
+ Q(this, "Ce", null);
793
+ Q(this, "le", /* @__PURE__ */ new Map());
794
+ Q(this, "De");
795
+ Q(this, "Pe");
796
+ Q(this, "ue");
797
+ Q(this, "K", []);
798
+ this.wA = A, this.ae = new eA(A), this.ue = new V(), this.De = new iA(A, this), this.Pe = new BA(), this.Ce = A.createBuffer(), F(this.wA, [0, 0, this.wA.canvas.width, this.wA.canvas.height]);
799
+ }
800
+ Ie(A) {
801
+ let t = this.le.get(A);
783
802
  if (t) return t;
784
- const e = new iA(this.m);
785
- return t = (0, { [D.RECTANGLE]: () => new BA(this.m, e), [D.LINE]: () => new nA(this.m, e), [D.ELLIPSE]: () => new QA(this.m, e), [D.ARC]: () => new gA(this.m, e), [D.TRIANGLE]: () => new cA(this.m, e), [D.BEZIER_CURVE]: () => new CA(this.m, e) }[A])(), this.Ot.set(A, t), t;
803
+ const e = new rA(this.wA);
804
+ return t = (0, { [D.RECTANGLE]: () => new QA(this.wA, e), [D.LINE]: () => new oA(this.wA, e), [D.ELLIPSE]: () => new aA(this.wA, e), [D.ARC]: () => new cA(this.wA, e), [D.TRIANGLE]: () => new CA(this.wA, e), [D.BEZIER_CURVE]: () => new PA(this.wA, e) }[A])(), this.le.set(A, t), t;
786
805
  }
787
- Ht(A) {
788
- this.zt !== A && (this.zt = A, A.AA());
806
+ we(A) {
807
+ this.oe !== A && (this.oe = A, A.WA());
789
808
  }
790
- Kt(A, t) {
791
- return new L(this.m, A, t);
809
+ fe(A, t) {
810
+ return this.ae.st(A, t);
792
811
  }
793
- Jt(A) {
794
- this.Ft = A, A && (this.St = {});
812
+ At() {
813
+ return this.ae.At();
795
814
  }
796
- Vt(A, t) {
797
- this.St[A] = t;
815
+ YA() {
816
+ return this.ae.YA();
798
817
  }
799
- Zt(A) {
800
- Object.assign(this.St, A);
818
+ tt() {
819
+ return this.ae.tt();
801
820
  }
802
- jt(A) {
803
- return new L(this.m, z, A);
821
+ de(A) {
822
+ this.he = A, A && (this.ce = {});
804
823
  }
805
- Nt(A, t, e, s) {
824
+ VA(A, t) {
825
+ this.ce[A] = t;
826
+ }
827
+ _e(A) {
828
+ Object.assign(this.ce, A);
829
+ }
830
+ et(A) {
831
+ return this.ae.et(A);
832
+ }
833
+ pe(A, t, e, s, i) {
834
+ const B = this.At(), r = { l: A.textures[0], m: A.textures[1], n: A.textures[2], o: A.textures[3], p: A.textures[4], q: [A.width, A.height] };
835
+ this.Pe.Ft(t, e, s, i, B, r, this.ue);
836
+ }
837
+ me(A, t, e, s) {
806
838
  var C;
807
- const i = this.m, r = i.canvas.width, B = i.canvas.height, o = A / r * 2 - 1, Q = (A + e) / r * 2 - 1, g = 1 - t / B * 2, a = 1 - (t + s) / B * 2, h = new Float32Array([o, a, Q, a, o, g, Q, a, Q, g, o, g]);
808
- i.bindBuffer(i.ARRAY_BUFFER, this.Tt), i.bufferData(i.ARRAY_BUFFER, h, i.DYNAMIC_DRAW);
809
- const l = ((C = this.zt) == null ? void 0 : C.rA) || i.getParameter(i.CURRENT_PROGRAM), c = l ? i.getAttribLocation(l, "a_position") : -1;
810
- c !== -1 && (i.enableVertexAttribArray(c), i.vertexAttribPointer(c, 2, i.FLOAT, !1, 8, 0)), i.drawArrays(i.TRIANGLES, 0, 6), c !== -1 && i.disableVertexAttribArray(c);
839
+ const i = this.wA, B = i.canvas.width, r = i.canvas.height, n = A / B * 2 - 1, o = (A + e) / B * 2 - 1, a = 1 - t / r * 2, g = 1 - (t + s) / r * 2, h = new Float32Array([n, g, o, g, n, a, o, g, o, a, n, a]);
840
+ i.bindBuffer(i.ARRAY_BUFFER, this.Ce), i.bufferData(i.ARRAY_BUFFER, h, i.DYNAMIC_DRAW);
841
+ const c = ((C = this.oe) == null ? void 0 : C.XA) || i.getParameter(i.CURRENT_PROGRAM), l = c ? i.getAttribLocation(c, "a_position") : -1;
842
+ l !== -1 && (i.enableVertexAttribArray(l), i.vertexAttribPointer(l, 2, i.FLOAT, !1, 8, 0)), i.drawArrays(i.TRIANGLES, 0, 6), l !== -1 && i.disableVertexAttribArray(l);
811
843
  }
812
- Xt(A, t, e, s) {
813
- this.Ft ? (this.Lt.it(A, t, e, s, this.Ft, { ...this.St }, this.Ut), this.Ft = null, this.St = {}) : this.Lt.st(A, t, e, s, this.Ut);
844
+ ve(A, t, e, s) {
845
+ this.he ? (this.Pe.Ft(A, t, e, s, this.he, { ...this.ce }, this.ue), this.he = null, this.ce = {}) : this.Pe.Yt(A, t, e, s, this.ue);
814
846
  }
815
- qt(A, t, e, s) {
816
- this.Lt.Bt(A, t, e, s, this.Ut.lineWeight, this.Ut);
847
+ ye(A, t, e, s) {
848
+ this.Pe.Rt(A, t, e, s, this.ue.lineWeight, this.ue);
817
849
  }
818
- Ae(A, t, e, s) {
819
- this.Lt.rt(A, t, e, s, this.Ut);
850
+ be(A, t, e, s) {
851
+ this.Pe.St(A, t, e, s, this.ue);
820
852
  }
821
- te(A, t, e, s, i, r) {
822
- this.Lt.Et(A, t, e, s, i, r, this.Ut);
853
+ Ge(A, t, e, s, i, B) {
854
+ this.Pe.kt(A, t, e, s, i, B, this.ue);
823
855
  }
824
- ee(A, t, e, s, i, r, B, o) {
825
- const Q = this.Ut.lineWeight;
826
- this.Lt.nt(A, t, e, s, i, r, B, o, Q, this.Ut);
856
+ Me(A, t, e, s, i, B, r, n) {
857
+ const o = this.ue.lineWeight;
858
+ this.Pe.Ot(A, t, e, s, i, B, r, n, o, this.ue);
827
859
  }
828
- se(A, t, e = 1, s = {}) {
829
- return new U(this.m, A, t, e, s);
860
+ $e(A, t, e = 1, s = {}) {
861
+ return new U(this.wA, A, t, e, s, this, !0);
830
862
  }
831
- ie(A, t, e, s, i, r) {
832
- this.Lt.Qt(A, t, e, s, i, r, this.Ut);
863
+ xe(A, t, e, s, i, B) {
864
+ this.Pe.zt(A, t, e, s, i, B, this.ue);
833
865
  }
834
- Be(A, t = A, e = A, s = 255) {
835
- this.state.RA(A, t, e, s), this.ot(A / 255, t / 255, e / 255, s / 255);
866
+ Ye(A, t = A, e = A, s = 255) {
867
+ this.state.DA(A, t, e, s), this.Lt(A / 255, t / 255, e / 255, s / 255);
836
868
  }
837
- ot(A = 0, t = 0, e = 0, s = 0) {
838
- this.m.clearColor(A, t, e, s), this.m.clear(this.m.COLOR_BUFFER_BIT);
869
+ Lt(A = 0, t = 0, e = 0, s = 0) {
870
+ this.wA.clearColor(A, t, e, s), this.wA.clear(this.wA.COLOR_BUFFER_BIT);
839
871
  }
840
- re() {
841
- this.m.viewport(0, 0, this.m.canvas.width, this.m.canvas.height), M(this.m, [0, 0, this.m.canvas.width, this.m.canvas.height]);
872
+ Fe() {
873
+ this.wA.viewport(0, 0, this.wA.canvas.width, this.wA.canvas.height), F(this.wA, [0, 0, this.wA.canvas.width, this.wA.canvas.height]);
842
874
  }
843
875
  get context() {
844
- return this.m;
876
+ return this.wA;
845
877
  }
846
878
  get state() {
847
- return this.Ut;
879
+ return this.ue;
880
+ }
881
+ RA(A) {
882
+ this.K.push(this.ue), this.ue = A;
848
883
  }
849
- Qe(A) {
850
- const t = A, e = b(this.m) ?? this.m.getParameter(this.m.VIEWPORT), s = { shader: t, gl: this.m, viewport: e };
851
- this.Ht(t);
884
+ SA() {
885
+ const A = this.K.pop();
886
+ A && (this.ue = A);
887
+ }
888
+ FA(A) {
889
+ const t = A, e = G(this.wA) ?? this.wA.getParameter(this.wA.VIEWPORT), s = { shader: t, gl: this.wA, viewport: e };
890
+ this.we(t);
852
891
  const i = /* @__PURE__ */ new Set();
853
- for (const r of this.Lt) r.type === D.CUSTOM ? i.add(D.RECTANGLE) : i.add(r.type);
854
- for (const r of i) r !== D.CUSTOM && this.Wt(r);
855
- this.kt.UA(s, this.Lt, this.Ot), this.Lt.ot();
892
+ for (const B of this.Pe) B.type === D.CUSTOM ? i.add(D.RECTANGLE) : i.add(B.type);
893
+ for (const B of i) B !== D.CUSTOM && this.Ie(B);
894
+ this.De.Ct(s, this.Pe, this.le), this.Pe.Lt();
856
895
  }
857
- H() {
858
- this.m.deleteBuffer(this.Tt), this.Lt.ot();
859
- for (const A of this.Ot.values()) A.H();
896
+ zA() {
897
+ this.wA.deleteBuffer(this.Ce), this.Pe.Lt();
898
+ for (const A of this.le.values()) A.zA();
899
+ this.ae.zA();
860
900
  }
861
901
  }
862
- const f = { readShort: (E, A) => (f.t.uint16[0] = E[A] << 8 | E[A + 1], f.t.int16[0]), readUshort: (E, A) => E[A] << 8 | E[A + 1], readUshorts(E, A, t) {
902
+ const u = { readShort: (E, A) => (u.t.uint16[0] = E[A] << 8 | E[A + 1], u.t.int16[0]), readUshort: (E, A) => E[A] << 8 | E[A + 1], readUshorts(E, A, t) {
863
903
  const e = [];
864
- for (let s = 0; s < t; s++) e.push(f.readUshort(E, A + 2 * s));
904
+ for (let s = 0; s < t; s++) e.push(u.readUshort(E, A + 2 * s));
865
905
  return e;
866
906
  }, readUint(E, A) {
867
- const t = f.t.uint8;
868
- return t[3] = E[A], t[2] = E[A + 1], t[1] = E[A + 2], t[0] = E[A + 3], f.t.uint32[0];
907
+ const t = u.t.uint8;
908
+ return t[3] = E[A], t[2] = E[A + 1], t[1] = E[A + 2], t[0] = E[A + 3], u.t.uint32[0];
869
909
  }, readASCII(E, A, t) {
870
910
  let e = "";
871
911
  for (let s = 0; s < t; s++) e += String.fromCharCode(E[A + s]);
@@ -873,177 +913,177 @@ const f = { readShort: (E, A) => (f.t.uint16[0] = E[A] << 8 | E[A + 1], f.t.int1
873
913
  }, t: (() => {
874
914
  const E = new ArrayBuffer(8);
875
915
  return { uint8: new Uint8Array(E), int16: new Int16Array(E), uint16: new Uint16Array(E), uint32: new Uint32Array(E) };
876
- })() }, uA = { parseTab(E, A, t) {
916
+ })() }, wA = { parseTab(E, A, t) {
877
917
  const e = { tables: [], ids: {}, off: A };
878
918
  E = new Uint8Array(E.buffer, A, t), A = 0;
879
- const s = f, i = s.readUshort, r = i(E, A += 2);
919
+ const s = u, i = s.readUshort, B = i(E, A += 2);
880
920
  A += 2;
881
- const B = [];
882
- for (let o = 0; o < r; o++) {
883
- const Q = i(E, A), g = i(E, A += 2);
921
+ const r = [];
922
+ for (let n = 0; n < B; n++) {
923
+ const o = i(E, A), a = i(E, A += 2);
884
924
  A += 2;
885
- const a = s.readUint(E, A);
925
+ const g = s.readUint(E, A);
886
926
  A += 4;
887
- const h = `p${Q}e${g}`;
888
- let l = B.indexOf(a);
889
- if (l === -1) {
890
- let c;
891
- l = e.tables.length, B.push(a);
892
- const C = i(E, a);
893
- c = C === 4 ? this.parse4(E, a) : C === 12 ? this.parse12(E, a) : { format: C }, e.tables.push(c);
927
+ const h = `p${o}e${a}`;
928
+ let c = r.indexOf(g);
929
+ if (c === -1) {
930
+ let l;
931
+ c = e.tables.length, r.push(g);
932
+ const C = i(E, g);
933
+ l = C === 4 ? this.parse4(E, g) : C === 12 ? this.parse12(E, g) : { format: C }, e.tables.push(l);
894
934
  }
895
- e.ids[h] != null && console.warn("Multiple tables for one platform+encoding: " + h), e.ids[h] = l;
935
+ e.ids[h] = c;
896
936
  }
897
937
  return e;
898
938
  }, parse4(E, A) {
899
- const t = f, e = t.readUshort, s = t.readUshorts, i = A, r = e(E, A += 2);
939
+ const t = u, e = t.readUshort, s = t.readUshorts, i = A, B = e(E, A += 2);
900
940
  A += 2;
901
- const B = e(E, A += 2) >>> 1, o = { format: 4, searchRange: e(E, A += 2), entrySelector: 0, rangeShift: 0, endCount: [], startCount: [], idDelta: [], idRangeOffset: [], glyphIdArray: [] };
902
- A += 2, o.entrySelector = e(E, A), A += 2, o.rangeShift = e(E, A), A += 2, o.endCount = s(E, A, B), A += 2 * B, A += 2, o.startCount = s(E, A, B), A += 2 * B;
903
- for (let Q = 0; Q < B; Q++) o.idDelta.push(t.readShort(E, A)), A += 2;
904
- return o.idRangeOffset = s(E, A, B), A += 2 * B, o.glyphIdArray = s(E, A, i + r - A >> 1), o;
941
+ const r = e(E, A += 2) >>> 1, n = { format: 4, searchRange: e(E, A += 2), entrySelector: 0, rangeShift: 0, endCount: [], startCount: [], idDelta: [], idRangeOffset: [], glyphIdArray: [] };
942
+ A += 2, n.entrySelector = e(E, A), A += 2, n.rangeShift = e(E, A), A += 2, n.endCount = s(E, A, r), A += 2 * r, A += 2, n.startCount = s(E, A, r), A += 2 * r;
943
+ for (let o = 0; o < r; o++) n.idDelta.push(t.readShort(E, A)), A += 2;
944
+ return n.idRangeOffset = s(E, A, r), A += 2 * r, n.glyphIdArray = s(E, A, i + B - A >> 1), n;
905
945
  }, parse12(E, A) {
906
- const t = f.readUint;
946
+ const t = u.readUint;
907
947
  t(E, A += 4), t(E, A += 4);
908
948
  const e = t(E, A += 4);
909
949
  A += 4;
910
950
  const s = new Uint32Array(3 * e);
911
951
  for (let i = 0; i < 3 * e; i += 3) s[i] = t(E, A + (i << 2)), s[i + 1] = t(E, A + (i << 2) + 4), s[i + 2] = t(E, A + (i << 2) + 8);
912
952
  return { format: 12, groups: s };
913
- } }, PA = { parseTab(E, A, t) {
914
- const e = f;
953
+ } }, IA = { parseTab(E, A, t) {
954
+ const e = u;
915
955
  A += 18;
916
956
  const s = e.readUshort(E, A);
917
957
  A += 2, A += 16;
918
958
  const i = e.readShort(E, A);
919
959
  A += 2;
920
- const r = e.readShort(E, A);
921
- A += 2;
922
960
  const B = e.readShort(E, A);
923
961
  A += 2;
924
- const o = e.readShort(E, A);
925
- return A += 2, A += 6, { unitsPerEm: s, xMin: i, yMin: r, xMax: B, yMax: o, indexToLocFormat: e.readShort(E, A) };
926
- } }, IA = { parseTab(E, A, t) {
927
- const e = f;
962
+ const r = e.readShort(E, A);
963
+ A += 2;
964
+ const n = e.readShort(E, A);
965
+ return A += 2, A += 6, { unitsPerEm: s, xMin: i, yMin: B, xMax: r, yMax: n, indexToLocFormat: e.readShort(E, A) };
966
+ } }, fA = { parseTab(E, A, t) {
967
+ const e = u;
928
968
  A += 4;
929
969
  const s = ["ascender", "descender", "lineGap", "advanceWidthMax", "minLeftSideBearing", "minRightSideBearing", "xMaxExtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], i = {};
930
- for (let r = 0; r < s.length; r++) {
931
- const B = s[r], o = B === "advanceWidthMax" || B === "numberOfHMetrics" ? e.readUshort : e.readShort;
932
- i[B] = o(E, A + 2 * r);
970
+ for (let B = 0; B < s.length; B++) {
971
+ const r = s[B], n = r === "advanceWidthMax" || r === "numberOfHMetrics" ? e.readUshort : e.readShort;
972
+ i[r] = n(E, A + 2 * B);
933
973
  }
934
974
  return i;
935
- } }, fA = { parseTab(E, A, t, e) {
936
- const s = f, i = [], r = [], B = e.maxp.numGlyphs, o = e.hhea.numberOfHMetrics;
937
- let Q = 0, g = 0, a = 0;
938
- for (; a < o; ) Q = s.readUshort(E, A + (a << 2)), g = s.readShort(E, A + (a << 2) + 2), i.push(Q), r.push(g), a++;
939
- for (; a < B; ) i.push(Q), r.push(g), a++;
940
- return { aWidth: i, lsBearing: r };
941
- } }, N = { cmap: uA, head: PA, hhea: IA, maxp: { parseTab(E, A, t) {
942
- const e = f;
975
+ } }, dA = { parseTab(E, A, t, e) {
976
+ const s = u, i = [], B = [], r = e.maxp.numGlyphs, n = e.hhea.numberOfHMetrics;
977
+ let o = 0, a = 0, g = 0;
978
+ for (; g < n; ) o = s.readUshort(E, A + (g << 2)), a = s.readShort(E, A + (g << 2) + 2), i.push(o), B.push(a), g++;
979
+ for (; g < r; ) i.push(o), B.push(a), g++;
980
+ return { aWidth: i, lsBearing: B };
981
+ } }, k = { cmap: wA, head: IA, hhea: fA, maxp: { parseTab(E, A, t) {
982
+ const e = u;
943
983
  return e.readUint(E, A), A += 4, { numGlyphs: e.readUshort(E, A) };
944
- } }, hmtx: fA, loca: { parseTab(E, A, t, e) {
945
- const s = f, i = [], r = e.head.indexToLocFormat, B = e.maxp.numGlyphs + 1;
946
- if (r === 0) for (let o = 0; o < B; o++) i.push(s.readUshort(E, A + (o << 1)) << 1);
947
- else if (r === 1) for (let o = 0; o < B; o++) i.push(s.readUint(E, A + (o << 2)));
984
+ } }, hmtx: dA, loca: { parseTab(E, A, t, e) {
985
+ const s = u, i = [], B = e.head.indexToLocFormat, r = e.maxp.numGlyphs + 1;
986
+ if (B === 0) for (let n = 0; n < r; n++) i.push(s.readUshort(E, A + (n << 1)) << 1);
987
+ else if (B === 1) for (let n = 0; n < r; n++) i.push(s.readUint(E, A + (n << 2)));
948
988
  return i;
949
989
  } }, glyf: { parseTab(E, A, t, e) {
950
990
  const s = [], i = e.maxp.numGlyphs;
951
- for (let r = 0; r < i; r++) s.push(null);
991
+ for (let B = 0; B < i; B++) s.push(null);
952
992
  return s;
953
- }, Ee(E, A) {
954
- const t = f, e = E.ne, s = E.loca;
993
+ }, Re(E, A) {
994
+ const t = u, e = E.Se, s = E.loca;
955
995
  if (s[A] === s[A + 1]) return null;
956
- const i = y.findTable(e, "glyf", E.oe);
996
+ const i = m.findTable(e, "glyf", E.ze);
957
997
  if (!i) return null;
958
- let r = i[0] + s[A];
959
- const B = {};
960
- if (B.noc = t.readShort(e, r), r += 2, B.xMin = t.readShort(e, r), r += 2, B.yMin = t.readShort(e, r), r += 2, B.xMax = t.readShort(e, r), r += 2, B.yMax = t.readShort(e, r), r += 2, B.xMin >= B.xMax || B.yMin >= B.yMax) return null;
961
- if (B.noc > 0) {
962
- B.endPts = [];
963
- for (let h = 0; h < B.noc; h++) B.endPts.push(t.readUshort(e, r)), r += 2;
964
- const o = t.readUshort(e, r);
965
- if (r += 2, e.length - r < o) return null;
966
- r += o;
967
- const Q = B.endPts[B.noc - 1] + 1;
968
- B.flags = [];
969
- for (let h = 0; h < Q; h++) {
970
- const l = e[r];
971
- if (r++, B.flags.push(l), 8 & l) {
972
- const c = e[r];
973
- r++;
974
- for (let C = 0; C < c; C++) B.flags.push(l), h++;
998
+ let B = i[0] + s[A];
999
+ const r = {};
1000
+ if (r.noc = t.readShort(e, B), B += 2, r.xMin = t.readShort(e, B), B += 2, r.yMin = t.readShort(e, B), B += 2, r.xMax = t.readShort(e, B), B += 2, r.yMax = t.readShort(e, B), B += 2, r.xMin >= r.xMax || r.yMin >= r.yMax) return null;
1001
+ if (r.noc > 0) {
1002
+ r.endPts = [];
1003
+ for (let h = 0; h < r.noc; h++) r.endPts.push(t.readUshort(e, B)), B += 2;
1004
+ const n = t.readUshort(e, B);
1005
+ if (B += 2, e.length - B < n) return null;
1006
+ B += n;
1007
+ const o = r.endPts[r.noc - 1] + 1;
1008
+ r.flags = [];
1009
+ for (let h = 0; h < o; h++) {
1010
+ const c = e[B];
1011
+ if (B++, r.flags.push(c), 8 & c) {
1012
+ const l = e[B];
1013
+ B++;
1014
+ for (let C = 0; C < l; C++) r.flags.push(c), h++;
975
1015
  }
976
1016
  }
977
- B.xs = [];
978
- for (let h = 0; h < Q; h++) {
979
- const l = B.flags[h], c = !!(16 & l);
980
- 2 & l ? (B.xs.push(c ? e[r] : -e[r]), r++) : c ? B.xs.push(0) : (B.xs.push(t.readShort(e, r)), r += 2);
1017
+ r.xs = [];
1018
+ for (let h = 0; h < o; h++) {
1019
+ const c = r.flags[h], l = !!(16 & c);
1020
+ 2 & c ? (r.xs.push(l ? e[B] : -e[B]), B++) : l ? r.xs.push(0) : (r.xs.push(t.readShort(e, B)), B += 2);
981
1021
  }
982
- B.ys = [];
983
- for (let h = 0; h < Q; h++) {
984
- const l = B.flags[h], c = !!(32 & l);
985
- 4 & l ? (B.ys.push(c ? e[r] : -e[r]), r++) : c ? B.ys.push(0) : (B.ys.push(t.readShort(e, r)), r += 2);
1022
+ r.ys = [];
1023
+ for (let h = 0; h < o; h++) {
1024
+ const c = r.flags[h], l = !!(32 & c);
1025
+ 4 & c ? (r.ys.push(l ? e[B] : -e[B]), B++) : l ? r.ys.push(0) : (r.ys.push(t.readShort(e, B)), B += 2);
986
1026
  }
987
- let g = 0, a = 0;
988
- for (let h = 0; h < Q; h++) g += B.xs[h], a += B.ys[h], B.xs[h] = g, B.ys[h] = a;
989
- } else B.parts = [], B.endPts = [], B.flags = [], B.xs = [], B.ys = [];
990
- return B;
991
- } } }, y = { parse: (E) => [((A, t, e, s) => {
992
- const i = N, r = { ne: A, ge: t, oe: e };
993
- for (const B in i) {
994
- const o = B, Q = y.findTable(A, o, e);
995
- if (Q) {
996
- const [g, a] = Q;
997
- let h = s[g];
998
- h == null && (h = i[o].parseTab(A, g, a, r), s[g] = h), r[o] = h;
1027
+ let a = 0, g = 0;
1028
+ for (let h = 0; h < o; h++) a += r.xs[h], g += r.ys[h], r.xs[h] = a, r.ys[h] = g;
1029
+ } else r.parts = [], r.endPts = [], r.flags = [], r.xs = [], r.ys = [];
1030
+ return r;
1031
+ } } }, m = { parse: (E) => [((A, t, e, s) => {
1032
+ const i = k, B = { Se: A, ke: t, ze: e };
1033
+ for (const r in i) {
1034
+ const n = r, o = m.findTable(A, n, e);
1035
+ if (o) {
1036
+ const [a, g] = o;
1037
+ let h = s[a];
1038
+ h == null && (h = i[n].parseTab(A, a, g, B), s[a] = h), B[n] = h;
999
1039
  }
1000
1040
  }
1001
- return r;
1041
+ return B;
1002
1042
  })(new Uint8Array(E), 0, 0, {})], findTable(E, A, t) {
1003
- const e = f, s = e.readUshort(E, t + 4);
1043
+ const e = u, s = e.readUshort(E, t + 4);
1004
1044
  let i = t + 12;
1005
- for (let r = 0; r < s; r++) {
1006
- const B = e.readASCII(E, i, 4);
1045
+ for (let B = 0; B < s; B++) {
1046
+ const r = e.readASCII(E, i, 4);
1007
1047
  e.readUint(E, i + 4);
1008
- const o = e.readUint(E, i + 8), Q = e.readUint(E, i + 12);
1009
- if (B === A) return [o, Q];
1048
+ const n = e.readUint(E, i + 8), o = e.readUint(E, i + 12);
1049
+ if (r === A) return [n, o];
1010
1050
  i += 16;
1011
1051
  }
1012
1052
  return null;
1013
- }, T: N, B: f };
1014
- class S {
1053
+ }, T: k, B: u };
1054
+ class _ {
1015
1055
  constructor() {
1016
- n(this, "ae", /* @__PURE__ */ new Map());
1017
- n(this, "he", /* @__PURE__ */ new Map());
1056
+ Q(this, "Oe", /* @__PURE__ */ new Map());
1057
+ Q(this, "Le", /* @__PURE__ */ new Map());
1018
1058
  }
1019
- ce(A, t) {
1020
- const e = `${this.le(A)}_${t}`;
1021
- if (this.ae.has(e)) return this.ae.get(e);
1059
+ Ue(A, t) {
1060
+ const e = `${this.Te(A)}_${t}`;
1061
+ if (this.Oe.has(e)) return this.Oe.get(e);
1022
1062
  const s = A.cmap;
1023
- if (!s || !s.tables) return this.ae.set(e, 0), 0;
1063
+ if (!s || !s.tables) return this.Oe.set(e, 0), 0;
1024
1064
  let i = 0;
1025
- for (const r of s.tables) if (r.format === 4 ? i = this.Ce(t, r) : r.format === 12 && (i = this.De(t, r)), i > 0) break;
1026
- return this.ae.set(e, i), i;
1065
+ for (const B of s.tables) if (B.format === 4 ? i = this.He(t, B) : B.format === 12 && (i = this.We(t, B)), i > 0) break;
1066
+ return this.Oe.set(e, i), i;
1027
1067
  }
1028
- ue(A, t) {
1068
+ Ke(A, t) {
1029
1069
  const e = t.codePointAt(0);
1030
- return e === void 0 ? 0 : this.ce(A, e);
1070
+ return e === void 0 ? 0 : this.Ue(A, e);
1031
1071
  }
1032
- Pe(A, t) {
1072
+ Je(A, t) {
1033
1073
  const e = A.hmtx;
1034
1074
  return e && e.aWidth && e.aWidth.length !== 0 ? t < e.aWidth.length ? e.aWidth[t] : e.aWidth[e.aWidth.length - 1] : 0;
1035
1075
  }
1036
- Ie(A, t) {
1037
- const e = t / A.head.unitsPerEm, s = A.hhea.ascender * e, i = A.hhea.descender * e, r = A.hhea.lineGap * e;
1038
- return { ascender: s, descender: i, lineGap: r, lineHeight: s - i + r, unitsPerEm: A.head.unitsPerEm, scale: e };
1076
+ Ve(A, t) {
1077
+ const e = t / A.head.unitsPerEm, s = A.hhea.ascender * e, i = A.hhea.descender * e, B = A.hhea.lineGap * e;
1078
+ return { ascender: s, descender: i, lineGap: B, lineHeight: s - i + B, unitsPerEm: A.head.unitsPerEm, scale: e };
1039
1079
  }
1040
- we() {
1041
- this.ae.clear(), this.he.clear();
1080
+ Ze() {
1081
+ this.Oe.clear(), this.Le.clear();
1042
1082
  }
1043
- le(A) {
1044
- return `${A.oe}_${A.ne.length}`;
1083
+ Te(A) {
1084
+ return `${A.ze}_${A.Se.length}`;
1045
1085
  }
1046
- Ce(A, t) {
1086
+ He(A, t) {
1047
1087
  const e = t.endCount.length;
1048
1088
  let s = -1;
1049
1089
  for (let i = 0; i < e; i++) if (A <= t.endCount[i]) {
@@ -1055,83 +1095,83 @@ class S {
1055
1095
  {
1056
1096
  const i = t.idRangeOffset[s] / 2 + (A - t.startCount[s]) - (e - s);
1057
1097
  if (i >= 0 && i < t.glyphIdArray.length) {
1058
- const r = t.glyphIdArray[i];
1059
- return r === 0 ? 0 : r + t.idDelta[s] & 65535;
1098
+ const B = t.glyphIdArray[i];
1099
+ return B === 0 ? 0 : B + t.idDelta[s] & 65535;
1060
1100
  }
1061
1101
  }
1062
1102
  return 0;
1063
1103
  }
1064
- De(A, t) {
1104
+ We(A, t) {
1065
1105
  const e = t.groups.length / 3;
1066
1106
  for (let s = 0; s < e; s++) {
1067
- const i = t.groups[3 * s], r = t.groups[3 * s + 1], B = t.groups[3 * s + 2];
1068
- if (A >= i && A <= r) return B + (A - i);
1107
+ const i = t.groups[3 * s], B = t.groups[3 * s + 1], r = t.groups[3 * s + 2];
1108
+ if (A >= i && A <= B) return r + (A - i);
1069
1109
  }
1070
1110
  return 0;
1071
1111
  }
1072
1112
  }
1073
- class dA {
1113
+ class pA {
1074
1114
  constructor(A) {
1075
- n(this, "fe");
1076
- this.fe = A;
1115
+ Q(this, "Ne");
1116
+ this.Ne = A;
1077
1117
  }
1078
- de(A) {
1118
+ Xe(A) {
1079
1119
  var e;
1080
1120
  const t = [];
1081
1121
  return (e = A.cmap) != null && e.tables ? (A.cmap.tables.forEach((s) => {
1082
1122
  if (s.format === 4) {
1083
- const i = this.pe(s);
1123
+ const i = this.je(s);
1084
1124
  t.push(...i);
1085
1125
  } else if (s.format === 12) {
1086
- const i = this._e(s);
1126
+ const i = this.qe(s);
1087
1127
  t.push(...i);
1088
1128
  }
1089
1129
  }), [...new Set(t)]) : [];
1090
1130
  }
1091
- me(A, t) {
1092
- return this.fe.ue(A, t) > 0;
1131
+ As(A, t) {
1132
+ return this.Ne.Ke(A, t) > 0;
1093
1133
  }
1094
- ve(A, t) {
1095
- for (const e of t) if (!this.me(A, e)) return !1;
1134
+ ts(A, t) {
1135
+ for (const e of t) if (!this.As(A, e)) return !1;
1096
1136
  return !0;
1097
1137
  }
1098
- ye(A, t) {
1099
- return t.filter((e) => this.me(A, e));
1138
+ es(A, t) {
1139
+ return t.filter((e) => this.As(A, e));
1100
1140
  }
1101
- xe(A) {
1102
- return A.filter((t) => this.be(t));
1141
+ ss(A) {
1142
+ return A.filter((t) => this.Bs(t));
1103
1143
  }
1104
- pe(A) {
1144
+ je(A) {
1105
1145
  const t = [];
1106
1146
  if (!(A.startCount && A.endCount && A.idRangeOffset && A.idDelta)) return t;
1107
1147
  for (let e = 0; e < A.startCount.length; e++) {
1108
1148
  const s = A.startCount[e], i = A.endCount[e];
1109
1149
  if (s !== 65535 || i !== 65535) {
1110
- for (let r = s; r <= i; r++)
1111
- if (this.Ge(A, r, e) > 0) try {
1112
- const B = String.fromCodePoint(r);
1113
- t.push(B);
1150
+ for (let B = s; B <= i; B++)
1151
+ if (this.Qs(A, B, e) > 0) try {
1152
+ const r = String.fromCodePoint(B);
1153
+ t.push(r);
1114
1154
  } catch {
1115
1155
  }
1116
1156
  }
1117
1157
  }
1118
1158
  return t;
1119
1159
  }
1120
- _e(A) {
1160
+ qe(A) {
1121
1161
  const t = [];
1122
1162
  if (!A.groups) return t;
1123
1163
  for (let e = 0; e < A.groups.length; e += 3) {
1124
- const s = A.groups[e], i = A.groups[e + 1], r = A.groups[e + 2];
1125
- for (let B = s; B <= i; B++)
1126
- if (r + (B - s) > 0) try {
1127
- const o = String.fromCodePoint(B);
1128
- t.push(o);
1164
+ const s = A.groups[e], i = A.groups[e + 1], B = A.groups[e + 2];
1165
+ for (let r = s; r <= i; r++)
1166
+ if (B + (r - s) > 0) try {
1167
+ const n = String.fromCodePoint(r);
1168
+ t.push(n);
1129
1169
  } catch {
1130
1170
  }
1131
1171
  }
1132
1172
  return t;
1133
1173
  }
1134
- Ge(A, t, e) {
1174
+ Qs(A, t, e) {
1135
1175
  if (A.idRangeOffset[e] === 0) return t + A.idDelta[e] & 65535;
1136
1176
  {
1137
1177
  const s = A.idRangeOffset[e] / 2 + (t - A.startCount[e]) - (A.startCount.length - e);
@@ -1142,922 +1182,915 @@ class dA {
1142
1182
  }
1143
1183
  return 0;
1144
1184
  }
1145
- be(A) {
1185
+ Bs(A) {
1146
1186
  const t = A.codePointAt(0) || 0;
1147
1187
  return !(t >= 0 && t <= 31 && t !== 9 && t !== 10 && t !== 13 || t >= 127 && t <= 159);
1148
1188
  }
1149
1189
  }
1150
- class wA {
1190
+ class mA {
1151
1191
  constructor() {
1152
- n(this, "$e");
1153
- const A = new S();
1154
- this.$e = new dA(A);
1192
+ Q(this, "Es");
1193
+ const A = new _();
1194
+ this.Es = new pA(A);
1155
1195
  }
1156
1196
  extractCharacters(A) {
1157
- return this.$e.de(A);
1197
+ return this.Es.Xe(A);
1158
1198
  }
1159
1199
  filterProblematicCharacters(A) {
1160
- return this.$e.xe(A);
1200
+ return this.Es.ss(A);
1161
1201
  }
1162
1202
  characterExists(A, t) {
1163
- return this.$e.me(A, t);
1203
+ return this.Es.As(A, t);
1164
1204
  }
1165
1205
  allCharactersExist(A, t) {
1166
- return this.$e.ve(A, t);
1206
+ return this.Es.ts(A, t);
1167
1207
  }
1168
1208
  }
1169
- class mA {
1209
+ class yA {
1170
1210
  constructor(A) {
1171
- n(this, "Me");
1172
- n(this, "Ye");
1173
- n(this, "Re");
1174
- n(this, "ze");
1175
- this.Re = A, this.ze = new S(), this.Me = document.createElement("canvas"), this.Ye = this.Me.getContext("2d", { willReadFrequently: !0, alpha: !1 });
1211
+ Q(this, "rs");
1212
+ Q(this, "ns");
1213
+ Q(this, "vA");
1214
+ Q(this, "gs");
1215
+ this.vA = A, this.gs = new _(), this.rs = document.createElement("canvas"), this.ns = this.rs.getContext("2d", { willReadFrequently: !0, alpha: !1 });
1176
1216
  }
1177
1217
  createTextureAtlas(A, t, e, s) {
1178
- const i = A.length, r = Math.ceil(Math.sqrt(i)), B = Math.ceil(i / r), o = t.width * r, Q = t.height * B, g = typeof s == "object" ? s : null;
1179
- this.Fe(o, Q), this.Se(A, t, r, e, g);
1180
- const a = this.Re.se(o, Q, 1, { filter: "nearest" });
1181
- return a.S(this.Me), { framebuffer: a, columns: r, rows: B };
1182
- }
1183
- Fe(A, t) {
1184
- this.Me.width = A, this.Me.height = t, this.Me.style.width = A + "px", this.Me.style.height = A + "px", this.Ye.imageSmoothingEnabled = !1, this.Me.style.imageRendering = "pixelated", this.Ye.fillStyle = "black", this.Ye.fillRect(0, 0, A, t), this.Ye.textBaseline = "top", this.Ye.textAlign = "left", this.Ye.fillStyle = "white";
1185
- }
1186
- Se(A, t, e, s, i) {
1187
- const r = s / i.head.unitsPerEm;
1188
- for (let B = 0; B < A.length; B++) {
1189
- const o = B % e, Q = Math.floor(B / e), g = A[B].character, a = this.Te(i, g);
1190
- if (!a) continue;
1191
- const h = g.codePointAt(0) || 0, l = this.ze.ce(i, h), c = this.Oe(i, l) * r, C = o * t.width, d = Q * t.height, I = C + 0.5 * t.width, w = d + 0.5 * t.height, p = Math.round(I - 0.5 * t.width), u = Math.round(w - 0.5 * s), _ = p + 0.5 * (t.width - c), j = u + i.hhea.ascender * r;
1192
- this.ke(a, _, j, r);
1218
+ const i = A.length, B = Math.ceil(Math.sqrt(i)), r = Math.ceil(i / B), n = t.width * B, o = t.height * r, a = typeof s == "object" ? s : null;
1219
+ this.hs(n, o), this.cs(A, t, B, e, a);
1220
+ const g = this.vA.$e(n, o, 1, { filter: "nearest" });
1221
+ return g.$A(this.rs), { framebuffer: g, columns: B, rows: r };
1222
+ }
1223
+ hs(A, t) {
1224
+ this.rs.width = A, this.rs.height = t, this.rs.style.width = A + "px", this.rs.style.height = A + "px", this.ns.imageSmoothingEnabled = !1, this.rs.style.imageRendering = "pixelated", this.ns.fillStyle = "black", this.ns.fillRect(0, 0, A, t), this.ns.textBaseline = "top", this.ns.textAlign = "left", this.ns.fillStyle = "white";
1225
+ }
1226
+ cs(A, t, e, s, i) {
1227
+ const B = s / i.head.unitsPerEm;
1228
+ for (let r = 0; r < A.length; r++) {
1229
+ const n = r % e, o = Math.floor(r / e), a = A[r].character, g = this.Cs(i, a);
1230
+ if (!g) continue;
1231
+ const h = a.codePointAt(0) || 0, c = this.gs.Ue(i, h), l = this.ls(i, c) * B, C = n * t.width, f = o * t.height, w = C + 0.5 * t.width, d = f + 0.5 * t.height, p = Math.round(w - 0.5 * t.width), R = Math.round(d - 0.5 * s), Z = p + 0.5 * (t.width - l), j = R + i.hhea.ascender * B;
1232
+ this.Ds(g, Z, j, B);
1193
1233
  }
1194
1234
  }
1195
- Te(A, t) {
1196
- const e = t.codePointAt(0) || 0, s = this.ze.ce(A, e);
1235
+ Cs(A, t) {
1236
+ const e = t.codePointAt(0) || 0, s = this.gs.Ue(A, e);
1197
1237
  if (s === 0) return null;
1198
1238
  if (A.glyf && A.glyf[s] !== null) return A.glyf[s];
1199
- if (y && y.T && y.T.glyf) {
1200
- const i = y.T.glyf.Ee(A, s);
1239
+ if (m && m.T && m.T.glyf) {
1240
+ const i = m.T.glyf.Re(A, s);
1201
1241
  return A.glyf && i && (A.glyf[s] = i), i;
1202
1242
  }
1203
1243
  return null;
1204
1244
  }
1205
- Oe(A, t) {
1245
+ ls(A, t) {
1206
1246
  const e = A.hmtx;
1207
1247
  return e && e.aWidth ? t < e.aWidth.length ? e.aWidth[t] : e.aWidth[e.aWidth.length - 1] : 0;
1208
1248
  }
1209
- ke(A, t, e, s) {
1249
+ Ds(A, t, e, s) {
1210
1250
  if (!A || !A.xs || A.noc === 0) return;
1211
- const { xs: i, ys: r, endPts: B, flags: o } = A;
1212
- if (!(i && r && B && o)) return;
1213
- this.Ye.beginPath();
1214
- let Q = 0;
1215
- for (let g = 0; g < B.length; g++) {
1216
- const a = B[g];
1217
- if (!(a < Q)) {
1218
- if (a >= Q) {
1219
- const h = t + i[Q] * s, l = e - r[Q] * s;
1220
- this.Ye.moveTo(h, l);
1221
- let c = Q + 1;
1222
- for (; c <= a; )
1223
- if (1 & o[c]) {
1224
- const C = t + i[c] * s, d = e - r[c] * s;
1225
- this.Ye.lineTo(C, d), c++;
1251
+ const { xs: i, ys: B, endPts: r, flags: n } = A;
1252
+ if (!(i && B && r && n)) return;
1253
+ this.ns.beginPath();
1254
+ let o = 0;
1255
+ for (let a = 0; a < r.length; a++) {
1256
+ const g = r[a];
1257
+ if (!(g < o)) {
1258
+ if (g >= o) {
1259
+ const h = t + i[o] * s, c = e - B[o] * s;
1260
+ this.ns.moveTo(h, c);
1261
+ let l = o + 1;
1262
+ for (; l <= g; )
1263
+ if (1 & n[l]) {
1264
+ const C = t + i[l] * s, f = e - B[l] * s;
1265
+ this.ns.lineTo(C, f), l++;
1226
1266
  } else {
1227
- const C = t + i[c] * s, d = e - r[c] * s;
1228
- let I = c + 1 > a ? Q : c + 1;
1229
- if (1 & o[I]) {
1230
- const w = t + i[I] * s, p = e - r[I] * s;
1231
- this.Ye.quadraticCurveTo(C, d, w, p), c = I + 1;
1267
+ const C = t + i[l] * s, f = e - B[l] * s;
1268
+ let w = l + 1 > g ? o : l + 1;
1269
+ if (1 & n[w]) {
1270
+ const d = t + i[w] * s, p = e - B[w] * s;
1271
+ this.ns.quadraticCurveTo(C, f, d, p), l = w + 1;
1232
1272
  } else {
1233
- const w = (C + (t + i[I] * s)) / 2, p = (d + (e - r[I] * s)) / 2;
1234
- this.Ye.quadraticCurveTo(C, d, w, p), c = I;
1273
+ const d = (C + (t + i[w] * s)) / 2, p = (f + (e - B[w] * s)) / 2;
1274
+ this.ns.quadraticCurveTo(C, f, d, p), l = w;
1235
1275
  }
1236
1276
  }
1237
- this.Ye.closePath();
1277
+ this.ns.closePath();
1238
1278
  }
1239
- Q = a + 1;
1279
+ o = g + 1;
1240
1280
  }
1241
1281
  }
1242
- this.Ye.fill();
1282
+ this.ns.fill();
1243
1283
  }
1244
1284
  }
1245
- class pA {
1285
+ class vA {
1246
1286
  constructor() {
1247
- n(this, "fe");
1248
- this.fe = new S();
1287
+ Q(this, "Ne");
1288
+ this.Ne = new _();
1249
1289
  }
1250
1290
  calculateMaxGlyphDimensions(A, t, e) {
1251
1291
  let s = 0;
1252
- const i = this.fe.Ie(e, t), r = i.lineHeight;
1253
- for (const B of A) {
1254
- const o = this.fe.ue(e, B);
1255
- if (o === 0) continue;
1256
- const Q = this.fe.Pe(e, o) * i.scale;
1257
- s = Math.max(s, Q);
1292
+ const i = this.Ne.Ve(e, t), B = i.lineHeight;
1293
+ for (const r of A) {
1294
+ const n = this.Ne.Ke(e, r);
1295
+ if (n === 0) continue;
1296
+ const o = this.Ne.Je(e, n) * i.scale;
1297
+ s = Math.max(s, o);
1258
1298
  }
1259
- return { width: Math.ceil(s), height: Math.ceil(r) };
1299
+ return { width: Math.ceil(s), height: Math.ceil(B) };
1260
1300
  }
1261
1301
  getCharacterAdvanceWidth(A, t, e) {
1262
- const s = this.fe.Ie(e, t), i = this.fe.ue(e, A);
1263
- return this.fe.Pe(e, i) * s.scale;
1302
+ const s = this.Ne.Ve(e, t), i = this.Ne.Ke(e, A);
1303
+ return this.Ne.Je(e, i) * s.scale;
1264
1304
  }
1265
1305
  getFontMetrics(A, t) {
1266
- return this.fe.Ie(t, A);
1306
+ return this.Ne.Ve(t, A);
1267
1307
  }
1268
- we() {
1269
- this.fe.we();
1308
+ Ze() {
1309
+ this.Ne.Ze();
1270
1310
  }
1271
1311
  }
1272
- class yA {
1312
+ class xA {
1273
1313
  constructor() {
1274
- n(this, "ze");
1275
- this.ze = new S();
1314
+ Q(this, "gs");
1315
+ this.gs = new _();
1276
1316
  }
1277
1317
  createCharacterObjects(A, t) {
1278
1318
  return A.map((e, s) => {
1279
- const i = e.codePointAt(0) || 0, r = this.Le(s);
1280
- let B = 0;
1319
+ const i = e.codePointAt(0) || 0, B = this.Ps(s);
1320
+ let r = 0;
1281
1321
  if (t.hmtx && t.hmtx.aWidth) {
1282
- const o = this.ze.ce(t, i);
1283
- o > 0 && t.hmtx.aWidth[o] !== void 0 && (B = t.hmtx.aWidth[o]);
1322
+ const n = this.gs.Ue(t, i);
1323
+ n > 0 && t.hmtx.aWidth[n] !== void 0 && (r = t.hmtx.aWidth[n]);
1284
1324
  }
1285
- return { character: e, unicode: i, color: r, advanceWidth: B };
1325
+ return { character: e, unicode: i, color: B, advanceWidth: r };
1286
1326
  });
1287
1327
  }
1288
- Le(A) {
1328
+ Ps(A) {
1289
1329
  return [A % 256 / 255, Math.floor(A / 256) % 256 / 255, Math.floor(A / 65536) % 256 / 255];
1290
1330
  }
1291
- Ue(A, t) {
1292
- if (!G.u(typeof A == "string", "Character must be a string.", { method: "getCharacterColor", providedValue: A })) return [0, 0, 0];
1331
+ us(A, t) {
1332
+ if (!M._(typeof A == "string", "Character must be a string.", { method: "getCharacterColor", providedValue: A })) return [0, 0, 0];
1293
1333
  const e = t.find((s) => s.character === A);
1294
1334
  return e ? e.color : [0, 0, 0];
1295
1335
  }
1296
- We(A, t) {
1297
- return G.u(typeof A == "string" && A.length > 0, "Characters must be a string with at least one character.", { method: "getCharacterColors", providedValue: A }) ? Array.from(A).map((e) => this.Ue(e, t) || [0, 0, 0]) : [[0, 0, 0]];
1336
+ Is(A, t) {
1337
+ return M._(typeof A == "string" && A.length > 0, "Characters must be a string with at least one character.", { method: "getCharacterColors", providedValue: A }) ? Array.from(A).map((e) => this.us(e, t) || [0, 0, 0]) : [[0, 0, 0]];
1298
1338
  }
1299
1339
  }
1300
- class vA {
1340
+ class bA {
1301
1341
  constructor(A, t = 16) {
1302
- n(this, "He");
1303
- n(this, "Ke", []);
1304
- n(this, "Je");
1305
- n(this, "Ve", 16);
1306
- n(this, "Ze", 0);
1307
- n(this, "je", 0);
1308
- n(this, "Ne", { width: 0, height: 0 });
1309
- n(this, "Xe");
1310
- n(this, "qe");
1311
- n(this, "As");
1312
- n(this, "ts");
1313
- n(this, "es");
1314
- this.Ve = t, this.qe = new wA(), this.As = new mA(A), this.ts = new pA(), this.es = new yA();
1315
- }
1316
- async ss(A) {
1342
+ Q(this, "ws");
1343
+ Q(this, "fs", []);
1344
+ Q(this, "ds");
1345
+ Q(this, "_s", 16);
1346
+ Q(this, "ps", 0);
1347
+ Q(this, "vs", 0);
1348
+ Q(this, "bs", { width: 0, height: 0 });
1349
+ Q(this, "Gs");
1350
+ Q(this, "Ms");
1351
+ Q(this, "$s");
1352
+ Q(this, "Ys");
1353
+ Q(this, "Fs");
1354
+ this._s = t, this.Ms = new mA(), this.$s = new yA(A), this.Ys = new vA(), this.Fs = new xA();
1355
+ }
1356
+ async Rs(A) {
1317
1357
  let t;
1318
1358
  if (A) {
1319
1359
  const e = await fetch(A);
1320
- if (!e.ok) throw new m(`Failed to load font file: ${e.status} ${e.statusText}`);
1360
+ if (!e.ok) throw new I(`Failed to load font file: ${e.status} ${e.statusText}`);
1321
1361
  t = await e.arrayBuffer();
1322
1362
  } else
1323
1363
  t = await (await fetch(`data:font/truetype;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMs+QEyQAAAEoAAAAYGNtYXAg7yVJAAAFjAAACSBnbHlmuHLTdAAAErQAAGi0aGVhZFvXdUwAAACsAAAANmhoZWELAQUCAAAA5AAAACRobXR4BACDgAAAAYgAAAQEbG9jYQAy54AAAA6sAAAECG1heHABIgCCAAABCAAAACBuYW1lVs/OSgAAe2gAAAOicG9zdABpADQAAH8MAAAAIAABAAAAAQAAzOWHqV8PPPUAAAQAAAAAAHxiGCcAAAAAfGIYJwAAAAAEAAQAAAAACAACAAEAAAAAAAEAAAQAAAAAAAQAAAAAAAcAAAEAAAAAAAAAAAAAAAAAAAEBAAEAAAEBAIAAIAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAgQAAZAABQAEAgACAAAAAAACAAIAAAACAAAzAMwAAAAABAAAAAAAAACAAACLAABw4wAAAAAAAAAAWUFMLgBAACAmawQAAAAAAAQAAAAAAAFRAAAAAAMABAAAAAAgAAAEAAAABAAAAAQAAAAEAAGABAABAAQAAIAEAACABAAAgAQAAIAEAAGABAABAAQAAQAEAACABAABAAQAAIAEAACABAABAAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABAAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABAAQAAIAEAAEABAAAgAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAAEABAAAgAQAAIAEAAGABAAAgAQAAIAEAAGABAAAgAQAAIAEAACABAAAgAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABgAQAAQAEAACABAAAAAQAAgAEAACABAAAgAQAAIAEAACABAACAAQAAAAEAAIABAABgAQAAgAEAACABAAAgAQAAAAEAACABAAAAAQAAAAEAAAABAAAAAQAAAAEAAIABAADAAQAAAAEAAAABAAAgAQAAYAEAAAABAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\r
1324
1364
  `)).arrayBuffer();
1325
- await this.Bs(t), this.He = y.parse(t)[0], await this.rs();
1365
+ await this.Ss(t), this.ws = m.parse(t)[0], await this.zs();
1326
1366
  }
1327
- Qs(A) {
1328
- if (A === void 0) return this.Ve;
1329
- this.Ve = A, this.Ne = this.ts.calculateMaxGlyphDimensions(this.Ke.map((e) => e.character), this.Ve, this.He);
1330
- const t = this.As.createTextureAtlas(this.Ke, this.Ne, this.Ve, this.He);
1331
- this.Je = t.framebuffer, this.Ze = t.columns, this.je = t.rows;
1367
+ ks(A) {
1368
+ if (A === void 0) return this._s;
1369
+ this._s = A, this.bs = this.Ys.calculateMaxGlyphDimensions(this.fs.map((e) => e.character), this._s, this.ws);
1370
+ const t = this.$s.createTextureAtlas(this.fs, this.bs, this._s, this.ws);
1371
+ this.ds = t.framebuffer, this.ps = t.columns, this.vs = t.rows;
1332
1372
  }
1333
- async Es(A) {
1373
+ async Os(A) {
1334
1374
  try {
1335
1375
  const t = await fetch(A);
1336
- if (!t.ok) throw new m(`Failed to load font file: ${t.status} ${t.statusText}`);
1376
+ if (!t.ok) throw new I(`Failed to load font file: ${t.status} ${t.statusText}`);
1337
1377
  const e = await t.arrayBuffer();
1338
- await this.Bs(e);
1339
- const s = y.parse(e);
1378
+ await this.Ss(e);
1379
+ const s = m.parse(e);
1340
1380
  if (!s || s.length === 0) throw Error("Failed to parse font file");
1341
- this.He = s[0], await this.rs();
1381
+ this.ws = s[0], await this.zs();
1342
1382
  } catch (t) {
1343
- throw new m("Failed to load font: " + (t instanceof Error ? t.message : "Unknown error"), t);
1383
+ throw new I("Failed to load font: " + (t instanceof Error ? t.message : "Unknown error"), t);
1344
1384
  }
1345
1385
  }
1346
- async Bs(A) {
1386
+ async Ss(A) {
1347
1387
  const t = Date.now();
1348
- this.Xe = new FontFace("CustomFont_" + t, A), await this.Xe.load(), document.fonts.add(this.Xe);
1388
+ this.Gs = new FontFace("CustomFont_" + t, A), await this.Gs.load(), document.fonts.add(this.Gs);
1349
1389
  }
1350
- async rs() {
1351
- const A = this.qe.extractCharacters(this.He), t = this.qe.filterProblematicCharacters(A);
1352
- this.Ke = this.es.createCharacterObjects(t, this.He), this.Ne = this.ts.calculateMaxGlyphDimensions(t, this.Ve, this.He);
1353
- const e = this.As.createTextureAtlas(this.Ke, this.Ne, this.Ve, this.He);
1354
- this.Je = e.framebuffer, this.Ze = e.columns, this.je = e.rows;
1390
+ async zs() {
1391
+ const A = this.Ms.extractCharacters(this.ws), t = this.Ms.filterProblematicCharacters(A);
1392
+ this.fs = this.Fs.createCharacterObjects(t, this.ws), this.bs = this.Ys.calculateMaxGlyphDimensions(t, this._s, this.ws);
1393
+ const e = this.$s.createTextureAtlas(this.fs, this.bs, this._s, this.ws);
1394
+ this.ds = e.framebuffer, this.ps = e.columns, this.vs = e.rows;
1355
1395
  }
1356
- Ue(A) {
1357
- return this.es.Ue(A, this.Ke);
1396
+ us(A) {
1397
+ return this.Fs.us(A, this.fs);
1358
1398
  }
1359
- We(A) {
1360
- return this.es.We(A, this.Ke);
1399
+ Is(A) {
1400
+ return this.Fs.Is(A, this.fs);
1361
1401
  }
1362
- H() {
1363
- this.Je.H(), document.fonts.delete(this.Xe);
1402
+ zA() {
1403
+ this.ds.zA(), document.fonts.delete(this.Gs);
1364
1404
  }
1365
1405
  get fontFramebuffer() {
1366
- return this.Je;
1406
+ return this.ds;
1367
1407
  }
1368
1408
  get characters() {
1369
- return this.Ke;
1409
+ return this.fs;
1370
1410
  }
1371
1411
  get textureColumns() {
1372
- return this.Ze;
1412
+ return this.ps;
1373
1413
  }
1374
1414
  get textureRows() {
1375
- return this.je;
1415
+ return this.vs;
1376
1416
  }
1377
1417
  get maxGlyphDimensions() {
1378
- return this.Ne;
1418
+ return this.bs;
1379
1419
  }
1380
1420
  get fontSize() {
1381
- return this.Ve;
1421
+ return this._s;
1382
1422
  }
1383
1423
  get font() {
1384
- return this.He;
1424
+ return this.ws;
1385
1425
  }
1386
1426
  }
1387
- class xA {
1427
+ class RA {
1388
1428
  constructor(A, t, e) {
1389
- n(this, "ns");
1390
- n(this, "gs");
1391
- n(this, "I");
1392
- n(this, "p");
1393
- n(this, "hs");
1394
- n(this, "cs");
1395
- n(this, "ls");
1396
- n(this, "Cs");
1397
- n(this, "Ds");
1398
- this.ls = A, this.Cs = t, this.Ds = e, this.fA();
1399
- }
1400
- fA() {
1401
- this.ns = Math.floor(this.ls.width / this.Cs), this.gs = Math.floor(this.ls.height / this.Ds), this.I = this.ns * this.Cs, this.p = this.gs * this.Ds, this.hs = Math.floor((this.ls.width - this.I) / 2), this.cs = Math.floor((this.ls.height - this.p) / 2);
1402
- }
1403
- us(A, t) {
1404
- this.Cs = A, this.Ds = t, this.fA();
1429
+ Q(this, "Ls");
1430
+ Q(this, "Us");
1431
+ Q(this, "PA");
1432
+ Q(this, "uA");
1433
+ Q(this, "Ts");
1434
+ Q(this, "Hs");
1435
+ Q(this, "Ws");
1436
+ Q(this, "Ks");
1437
+ Q(this, "Js");
1438
+ this.Ws = A, this.Ks = t, this.Js = e, this.iA();
1439
+ }
1440
+ iA() {
1441
+ this.Ls = Math.floor(this.Ws.width / this.Ks), this.Us = Math.floor(this.Ws.height / this.Js), this.PA = this.Ls * this.Ks, this.uA = this.Us * this.Js, this.Ts = Math.floor((this.Ws.width - this.PA) / 2), this.Hs = Math.floor((this.Ws.height - this.uA) / 2);
1442
+ }
1443
+ Vs(A, t) {
1444
+ this.Ks = A, this.Js = t, this.iA();
1405
1445
  }
1406
1446
  get cellWidth() {
1407
- return this.Cs;
1447
+ return this.Ks;
1408
1448
  }
1409
1449
  get cellHeight() {
1410
- return this.Ds;
1450
+ return this.Js;
1411
1451
  }
1412
1452
  get cols() {
1413
- return this.ns;
1453
+ return this.Ls;
1414
1454
  }
1415
1455
  get rows() {
1416
- return this.gs;
1456
+ return this.Us;
1417
1457
  }
1418
1458
  get width() {
1419
- return this.I;
1459
+ return this.PA;
1420
1460
  }
1421
1461
  get height() {
1422
- return this.p;
1462
+ return this.uA;
1423
1463
  }
1424
1464
  get offsetX() {
1425
- return this.hs;
1465
+ return this.Ts;
1426
1466
  }
1427
1467
  get offsetY() {
1428
- return this.cs;
1468
+ return this.Hs;
1429
1469
  }
1430
1470
  }
1431
- class RA {
1471
+ class TA {
1432
1472
  constructor(A = {}) {
1433
- n(this, "ls");
1434
- n(this, "Ps");
1435
- n(this, "Is");
1436
- A.canvas ? (this.ls = A.canvas, this.Is = !1) : (this.ls = this.ws(A.width, A.height), this.Is = !0), this.ls.style.imageRendering = "pixelated";
1473
+ Q(this, "Ws");
1474
+ Q(this, "Zs");
1475
+ Q(this, "Ns");
1476
+ A.canvas ? (this.Ws = A.canvas, this.Ns = !1) : (this.Ws = this.Xs(A.width, A.height), this.Ns = !0), this.Ws.style.imageRendering = "pixelated";
1437
1477
  }
1438
- ws(A, t) {
1478
+ Xs(A, t) {
1439
1479
  const e = document.createElement("canvas");
1440
1480
  return e.className = "textmodeCanvas", e.style.imageRendering = "pixelated", e.width = A || 800, e.height = t || 600, document.body.appendChild(e), e;
1441
1481
  }
1442
- O(A, t) {
1443
- this.ls.width = A ?? this.ls.width, this.ls.height = t ?? this.ls.height;
1482
+ js(A, t) {
1483
+ this.Ws.width = A ?? this.Ws.width, this.Ws.height = t ?? this.Ws.height;
1444
1484
  }
1445
- fs() {
1446
- const A = this.ls.getContext("webgl2", { alpha: !0, premultipliedAlpha: !1, preserveDrawingBuffer: !0, antialias: !1, depth: !1, stencil: !1, powerPreference: "high-performance" });
1447
- if (!A) throw new m("`textmode.js` requires WebGL2 support.");
1485
+ qs() {
1486
+ const A = this.Ws.getContext("webgl2", { alpha: !0, premultipliedAlpha: !1, preserveDrawingBuffer: !0, antialias: !1, depth: !1, stencil: !1, powerPreference: "high-performance" });
1487
+ if (!A) throw new I("`textmode.js` requires WebGL2 support.");
1448
1488
  return A;
1449
1489
  }
1450
- H() {
1451
- this.Ps && this.Ps.disconnect();
1452
- const A = this.ls.getContext("webgl") || this.ls.getContext("webgl2");
1490
+ zA() {
1491
+ this.Zs && this.Zs.disconnect();
1492
+ const A = this.Ws.getContext("webgl") || this.Ws.getContext("webgl2");
1453
1493
  if (A) {
1454
1494
  const t = A.getExtension("WEBGL_lose_context");
1455
1495
  t && t.loseContext();
1456
1496
  }
1457
- this.Is && this.ls.parentNode && this.ls.parentNode.removeChild(this.ls);
1497
+ this.Ns && this.Ws.parentNode && this.Ws.parentNode.removeChild(this.Ws);
1458
1498
  }
1459
1499
  get canvas() {
1460
- return this.ls;
1500
+ return this.Ws;
1461
1501
  }
1462
1502
  get width() {
1463
- return this.ls.width;
1503
+ return this.Ws.width;
1464
1504
  }
1465
1505
  get height() {
1466
- return this.ls.height;
1506
+ return this.Ws.height;
1467
1507
  }
1468
1508
  }
1469
- class bA {
1509
+ class MA {
1470
1510
  constructor(A = 60) {
1471
- n(this, "ds");
1472
- n(this, "ps");
1473
- n(this, "_s", null);
1474
- n(this, "vs", 0);
1475
- n(this, "bs", !0);
1476
- n(this, "Gs", 0);
1477
- n(this, "$s", 0);
1478
- n(this, "Ms", []);
1479
- n(this, "Ys", 10);
1480
- n(this, "Rs", 0);
1481
- this.ds = A, this.ps = 1e3 / A;
1511
+ Q(this, "Ai");
1512
+ Q(this, "ti");
1513
+ Q(this, "ei", null);
1514
+ Q(this, "si", 0);
1515
+ Q(this, "ii", !0);
1516
+ Q(this, "Bi", 0);
1517
+ Q(this, "Qi", 0);
1518
+ Q(this, "Ei", []);
1519
+ Q(this, "ri", 10);
1520
+ Q(this, "ni", 0);
1521
+ this.Ai = A, this.ti = 1e3 / A;
1482
1522
  }
1483
1523
  start(A) {
1484
- if (!this.bs) return;
1485
- this.vs = performance.now();
1524
+ if (!this.ii) return;
1525
+ this.si = performance.now();
1486
1526
  const t = (e) => {
1487
- if (!this.bs) return void (this._s = null);
1488
- const s = e - this.vs;
1489
- s >= this.ps && (A(), this.vs = e - s % this.ps), this.bs && (this._s = requestAnimationFrame(t));
1527
+ if (!this.ii) return void (this.ei = null);
1528
+ const s = e - this.si;
1529
+ s >= this.ti && (A(), this.si = e - s % this.ti), this.ii && (this.ei = requestAnimationFrame(t));
1490
1530
  };
1491
- this._s = requestAnimationFrame(t);
1531
+ this.ei = requestAnimationFrame(t);
1492
1532
  }
1493
1533
  stop() {
1494
- this._s && (cancelAnimationFrame(this._s), this._s = null);
1534
+ this.ei && (cancelAnimationFrame(this.ei), this.ei = null);
1495
1535
  }
1496
1536
  pause() {
1497
- this.bs && (this.bs = !1, this.stop());
1537
+ this.ii && (this.ii = !1, this.stop());
1498
1538
  }
1499
1539
  resume(A) {
1500
- this.bs || (this.bs = !0, this.start(A));
1540
+ this.ii || (this.ii = !0, this.start(A));
1501
1541
  }
1502
1542
  frameRate(A, t) {
1503
- if (A === void 0) return this.Gs;
1504
- this.ds = A, this.ps = 1e3 / A, this.bs && t && (this.stop(), this.start(t));
1543
+ if (A === void 0) return this.Bi;
1544
+ this.Ai = A, this.ti = 1e3 / A, this.ii && t && (this.stop(), this.start(t));
1505
1545
  }
1506
1546
  measureFrameRate() {
1507
1547
  const A = performance.now();
1508
- if (this.$s > 0) {
1509
- const t = A - this.$s;
1510
- this.Ms.push(t), this.Ms.length > this.Ys && this.Ms.shift();
1511
- const e = this.Ms.reduce((s, i) => s + i, 0) / this.Ms.length;
1512
- this.Gs = 1e3 / e;
1548
+ if (this.Qi > 0) {
1549
+ const t = A - this.Qi;
1550
+ this.Ei.push(t), this.Ei.length > this.ri && this.Ei.shift();
1551
+ const e = this.Ei.reduce((s, i) => s + i, 0) / this.Ei.length;
1552
+ this.Bi = 1e3 / e;
1513
1553
  }
1514
- this.$s = A;
1554
+ this.Qi = A;
1515
1555
  }
1516
1556
  get isLooping() {
1517
- return this.bs;
1557
+ return this.ii;
1518
1558
  }
1519
1559
  get frameRateLimit() {
1520
- return this.ds;
1560
+ return this.Ai;
1521
1561
  }
1522
1562
  get currentFrameRate() {
1523
- return this.Gs;
1563
+ return this.Bi;
1524
1564
  }
1525
1565
  get frameCount() {
1526
- return this.Rs;
1566
+ return this.ni;
1527
1567
  }
1528
1568
  set frameCount(A) {
1529
- this.Rs = A;
1569
+ this.ni = A;
1530
1570
  }
1531
1571
  incrementFrame() {
1532
- this.Rs++;
1572
+ this.ni++;
1533
1573
  }
1534
1574
  resetFrameCount() {
1535
- this.Rs = 0;
1575
+ this.ni = 0;
1536
1576
  }
1537
1577
  }
1538
- class TA {
1539
- constructor(A) {
1540
- n(this, "ls");
1541
- n(this, "zs");
1542
- n(this, "Fs", { x: -1, y: -1 });
1543
- n(this, "Ss", { x: -1, y: -1 });
1544
- n(this, "Ts", null);
1545
- n(this, "Os");
1546
- n(this, "ks");
1547
- n(this, "Ls");
1548
- n(this, "Us");
1549
- n(this, "Ws");
1550
- n(this, "Hs");
1551
- n(this, "Ks", !1);
1552
- n(this, "Js");
1553
- n(this, "Vs");
1554
- n(this, "Zs");
1555
- n(this, "js");
1556
- n(this, "Ns");
1557
- this.ls = A;
1558
- }
1559
- ss(A) {
1560
- this.zs = A, this.Xs();
1561
- }
1562
- qs() {
1563
- if (this.Ks) return;
1564
- const A = this.ls.canvas;
1565
- this.Os = (t) => {
1566
- this.Ai(t), this.ti(t);
1567
- }, this.ks = () => {
1568
- this.Ss = { ...this.Fs }, this.Fs.x = -1, this.Fs.y = -1, this.Ts = null;
1569
- }, this.Ls = (t) => {
1570
- this.Ai(t), this.ei(t);
1571
- }, this.Us = (t) => {
1572
- this.Ai(t), this.si(t);
1573
- }, this.Ws = (t) => {
1574
- this.Ai(t), this.ii(t);
1575
- }, this.Hs = (t) => {
1576
- this.Ai(t), this.Bi(t);
1577
- }, A.addEventListener("mousemove", this.Os, { passive: !0 }), A.addEventListener("mouseleave", this.ks, { passive: !0 }), A.addEventListener("mousedown", this.Ls, { passive: !0 }), A.addEventListener("mouseup", this.Us, { passive: !0 }), A.addEventListener("click", this.Ws, { passive: !0 }), A.addEventListener("wheel", this.Hs, { passive: !1 }), this.Ks = !0;
1578
- }
1579
- ri() {
1580
- if (!this.Ks) return;
1581
- const A = this.ls.canvas;
1582
- A.removeEventListener("mousemove", this.Os), A.removeEventListener("mouseleave", this.ks), A.removeEventListener("mousedown", this.Ls), A.removeEventListener("mouseup", this.Us), A.removeEventListener("click", this.Ws), A.removeEventListener("wheel", this.Hs), this.Ks = !1;
1583
- }
1584
- Xs() {
1585
- if (this.Ks) try {
1586
- if (this.Ts) {
1587
- const A = new MouseEvent("mousemove", { clientX: this.Ts.x, clientY: this.Ts.y, bubbles: !1, cancelable: !1 });
1588
- this.Ai(A);
1589
- } else this.Fs.x !== -1 && this.Fs.y !== -1 && (this.Fs.x >= this.zs.cols || this.Fs.y >= this.zs.rows) && (this.Fs.x = -1, this.Fs.y = -1);
1590
- } catch {
1591
- this.Fs.x = -1, this.Fs.y = -1;
1592
- }
1578
+ class FA {
1579
+ constructor() {
1580
+ Q(this, "gi", /* @__PURE__ */ new Map());
1581
+ Q(this, "oi", null);
1582
+ Q(this, "ai", null);
1583
+ Q(this, "hi");
1584
+ Q(this, "ci");
1585
+ Q(this, "Ci", !1);
1586
+ Q(this, "li");
1587
+ Q(this, "Di");
1588
+ Q(this, "Pi", { ArrowUp: "UP_ARROW", ArrowDown: "DOWN_ARROW", ArrowLeft: "LEFT_ARROW", ArrowRight: "RIGHT_ARROW", F1: "F1", F2: "F2", F3: "F3", F4: "F4", F5: "F5", F6: "F6", F7: "F7", F8: "F8", F9: "F9", F10: "F10", F11: "F11", F12: "F12", Enter: "ENTER", Return: "RETURN", Tab: "TAB", Escape: "ESCAPE", Backspace: "BACKSPACE", Delete: "DELETE", Insert: "INSERT", Home: "HOME", End: "END", PageUp: "PAGE_UP", PageDown: "PAGE_DOWN", Shift: "SHIFT", Control: "CONTROL", Alt: "ALT", Meta: "META", " ": "SPACE" });
1589
+ }
1590
+ ui() {
1591
+ this.Ci || (this.hi = (A) => {
1592
+ this.Ii(A);
1593
+ }, this.ci = (A) => {
1594
+ this.wi(A);
1595
+ }, window.addEventListener("keydown", this.hi, { passive: !1 }), window.addEventListener("keyup", this.ci, { passive: !1 }), this.Ci = !0);
1593
1596
  }
1594
- Qi(A) {
1595
- this.Js = A;
1597
+ fi() {
1598
+ this.Ci && (window.removeEventListener("keydown", this.hi), window.removeEventListener("keyup", this.ci), this.Ci = !1, this.gi.clear(), this.oi = null, this.ai = null);
1596
1599
  }
1597
- Ei(A) {
1598
- this.Vs = A;
1600
+ di(A) {
1601
+ this.li = A;
1599
1602
  }
1600
- ni(A) {
1601
- this.Zs = A;
1603
+ _i(A) {
1604
+ this.Di = A;
1602
1605
  }
1603
- oi(A) {
1604
- this.js = A;
1606
+ pi(A) {
1607
+ const t = this.mi(A), e = this.gi.get(A) || this.gi.get(t);
1608
+ return (e == null ? void 0 : e.isPressed) || !1;
1605
1609
  }
1606
- gi(A) {
1607
- this.Ns = A;
1610
+ yi() {
1611
+ return this.oi;
1608
1612
  }
1609
- ai() {
1610
- return { x: this.Fs.x, y: this.Fs.y };
1613
+ bi() {
1614
+ return this.ai;
1611
1615
  }
1612
- ti(A) {
1613
- if (this.js) {
1614
- const t = { position: { ...this.Fs }, previousPosition: { ...this.Ss }, originalEvent: A };
1615
- this.js(t);
1616
- }
1616
+ Gi() {
1617
+ const A = [];
1618
+ for (const [t, e] of this.gi) e.isPressed && A.push(t);
1619
+ return A;
1617
1620
  }
1618
- ei(A) {
1619
- if (this.Vs) {
1620
- const t = { position: { ...this.Fs }, previousPosition: { ...this.Ss }, button: A.button, originalEvent: A };
1621
- this.Vs(t);
1622
- }
1621
+ Mi() {
1622
+ return { ctrl: this.pi("Control"), shift: this.pi("Shift"), alt: this.pi("Alt"), meta: this.pi("Meta") };
1623
1623
  }
1624
- si(A) {
1625
- if (this.Zs) {
1626
- const t = { position: { ...this.Fs }, previousPosition: { ...this.Ss }, button: A.button, originalEvent: A };
1627
- this.Zs(t);
1628
- }
1624
+ $i() {
1625
+ this.gi.clear(), this.oi = null, this.ai = null;
1629
1626
  }
1630
- ii(A) {
1631
- if (this.Js) {
1632
- const t = { position: { ...this.Fs }, previousPosition: { ...this.Ss }, button: A.button, originalEvent: A };
1633
- this.Js(t);
1627
+ Ii(A) {
1628
+ const t = A.key, e = Date.now();
1629
+ this.gi.has(t) || this.gi.set(t, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
1630
+ const s = this.gi.get(t);
1631
+ if (!s.isPressed && (s.isPressed = !0, s.lastPressTime = e, this.oi = t, this.li)) {
1632
+ const i = { key: t, keyCode: A.keyCode, ctrlKey: A.ctrlKey, shiftKey: A.shiftKey, altKey: A.altKey, metaKey: A.metaKey, isPressed: !0, originalEvent: A };
1633
+ this.li(i);
1634
1634
  }
1635
1635
  }
1636
- Bi(A) {
1637
- if (this.Ns) {
1638
- const t = { position: { ...this.Fs }, previousPosition: { ...this.Ss }, delta: { x: A.deltaX, y: A.deltaY }, originalEvent: A };
1639
- this.Ns(t);
1636
+ wi(A) {
1637
+ const t = A.key, e = Date.now();
1638
+ this.gi.has(t) || this.gi.set(t, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
1639
+ const s = this.gi.get(t);
1640
+ if (s.isPressed = !1, s.lastReleaseTime = e, this.ai = t, this.Di) {
1641
+ const i = { key: t, keyCode: A.keyCode, ctrlKey: A.ctrlKey, shiftKey: A.shiftKey, altKey: A.altKey, metaKey: A.metaKey, isPressed: !1, originalEvent: A };
1642
+ this.Di(i);
1640
1643
  }
1641
1644
  }
1642
- Ai(A) {
1643
- const t = this.ls.canvas;
1644
- this.Ss = { ...this.Fs }, this.Ts = { x: A.clientX, y: A.clientY };
1645
- const e = t.getBoundingClientRect(), s = A.clientX - e.left, i = A.clientY - e.top, r = t.width / e.width, B = i * (t.height / e.height), o = s * r - this.zs.offsetX, Q = B - this.zs.offsetY, g = Math.floor(o / this.zs.cellWidth), a = Math.floor(Q / this.zs.cellHeight);
1646
- g >= 0 && g < this.zs.cols && a >= 0 && a < this.zs.rows ? (this.Fs.x = g, this.Fs.y = a) : (this.Fs.x = -1, this.Fs.y = -1);
1645
+ mi(A) {
1646
+ return this.Pi[A] || A.toLowerCase();
1647
1647
  }
1648
1648
  }
1649
- class _A {
1650
- constructor() {
1651
- n(this, "hi", /* @__PURE__ */ new Map());
1652
- n(this, "ci", null);
1653
- n(this, "li", null);
1654
- n(this, "Ci");
1655
- n(this, "Di");
1656
- n(this, "Ks", !1);
1657
- n(this, "ui");
1658
- n(this, "Pi");
1659
- n(this, "Ii", { ArrowUp: "UP_ARROW", ArrowDown: "DOWN_ARROW", ArrowLeft: "LEFT_ARROW", ArrowRight: "RIGHT_ARROW", F1: "F1", F2: "F2", F3: "F3", F4: "F4", F5: "F5", F6: "F6", F7: "F7", F8: "F8", F9: "F9", F10: "F10", F11: "F11", F12: "F12", Enter: "ENTER", Return: "RETURN", Tab: "TAB", Escape: "ESCAPE", Backspace: "BACKSPACE", Delete: "DELETE", Insert: "INSERT", Home: "HOME", End: "END", PageUp: "PAGE_UP", PageDown: "PAGE_DOWN", Shift: "SHIFT", Control: "CONTROL", Alt: "ALT", Meta: "META", " ": "SPACE" });
1660
- }
1661
- qs() {
1662
- this.Ks || (this.Ci = (A) => {
1663
- this.wi(A);
1664
- }, this.Di = (A) => {
1665
- this.fi(A);
1666
- }, window.addEventListener("keydown", this.Ci, { passive: !1 }), window.addEventListener("keyup", this.Di, { passive: !1 }), this.Ks = !0);
1649
+ class GA {
1650
+ constructor(A) {
1651
+ Q(this, "Ws");
1652
+ Q(this, "xi");
1653
+ Q(this, "Yi", { x: -1, y: -1 });
1654
+ Q(this, "Fi", { x: -1, y: -1 });
1655
+ Q(this, "Ri", null);
1656
+ Q(this, "Si");
1657
+ Q(this, "zi");
1658
+ Q(this, "ki");
1659
+ Q(this, "Oi");
1660
+ Q(this, "Li");
1661
+ Q(this, "Ui");
1662
+ Q(this, "Ci", !1);
1663
+ Q(this, "Ti");
1664
+ Q(this, "Hi");
1665
+ Q(this, "Wi");
1666
+ Q(this, "Ki");
1667
+ Q(this, "Ji");
1668
+ this.Ws = A;
1669
+ }
1670
+ Rs(A) {
1671
+ this.xi = A, this.Vi();
1672
+ }
1673
+ ui() {
1674
+ if (this.Ci) return;
1675
+ const A = this.Ws.canvas;
1676
+ this.Si = (t) => {
1677
+ this.Zi(t), this.Ni(t);
1678
+ }, this.zi = () => {
1679
+ this.Fi = { ...this.Yi }, this.Yi.x = -1, this.Yi.y = -1, this.Ri = null;
1680
+ }, this.ki = (t) => {
1681
+ this.Zi(t), this.Xi(t);
1682
+ }, this.Oi = (t) => {
1683
+ this.Zi(t), this.ji(t);
1684
+ }, this.Li = (t) => {
1685
+ this.Zi(t), this.qi(t);
1686
+ }, this.Ui = (t) => {
1687
+ this.Zi(t), this.AB(t);
1688
+ }, A.addEventListener("mousemove", this.Si, { passive: !0 }), A.addEventListener("mouseleave", this.zi, { passive: !0 }), A.addEventListener("mousedown", this.ki, { passive: !0 }), A.addEventListener("mouseup", this.Oi, { passive: !0 }), A.addEventListener("click", this.Li, { passive: !0 }), A.addEventListener("wheel", this.Ui, { passive: !1 }), this.Ci = !0;
1689
+ }
1690
+ fi() {
1691
+ if (!this.Ci) return;
1692
+ const A = this.Ws.canvas;
1693
+ A.removeEventListener("mousemove", this.Si), A.removeEventListener("mouseleave", this.zi), A.removeEventListener("mousedown", this.ki), A.removeEventListener("mouseup", this.Oi), A.removeEventListener("click", this.Li), A.removeEventListener("wheel", this.Ui), this.Ci = !1;
1694
+ }
1695
+ Vi() {
1696
+ if (this.Ci) try {
1697
+ if (this.Ri) {
1698
+ const A = new MouseEvent("mousemove", { clientX: this.Ri.x, clientY: this.Ri.y, bubbles: !1, cancelable: !1 });
1699
+ this.Zi(A);
1700
+ } else this.Yi.x !== -1 && this.Yi.y !== -1 && (this.Yi.x >= this.xi.cols || this.Yi.y >= this.xi.rows) && (this.Yi.x = -1, this.Yi.y = -1);
1701
+ } catch {
1702
+ this.Yi.x = -1, this.Yi.y = -1;
1703
+ }
1667
1704
  }
1668
- ri() {
1669
- this.Ks && (window.removeEventListener("keydown", this.Ci), window.removeEventListener("keyup", this.Di), this.Ks = !1, this.hi.clear(), this.ci = null, this.li = null);
1705
+ tB(A) {
1706
+ this.Ti = A;
1670
1707
  }
1671
- Ei(A) {
1672
- this.ui = A;
1708
+ di(A) {
1709
+ this.Hi = A;
1673
1710
  }
1674
- ni(A) {
1675
- this.Pi = A;
1711
+ _i(A) {
1712
+ this.Wi = A;
1676
1713
  }
1677
- di(A) {
1678
- const t = this.pi(A), e = this.hi.get(A) || this.hi.get(t);
1679
- return (e == null ? void 0 : e.isPressed) || !1;
1714
+ eB(A) {
1715
+ this.Ki = A;
1680
1716
  }
1681
- _i() {
1682
- return this.ci;
1717
+ sB(A) {
1718
+ this.Ji = A;
1683
1719
  }
1684
- mi() {
1685
- return this.li;
1720
+ iB() {
1721
+ return { x: this.Yi.x, y: this.Yi.y };
1686
1722
  }
1687
- yi() {
1688
- const A = [];
1689
- for (const [t, e] of this.hi) e.isPressed && A.push(t);
1690
- return A;
1723
+ Ni(A) {
1724
+ if (this.Ki) {
1725
+ const t = { position: { ...this.Yi }, previousPosition: { ...this.Fi }, originalEvent: A };
1726
+ this.Ki(t);
1727
+ }
1691
1728
  }
1692
- xi() {
1693
- return { ctrl: this.di("Control"), shift: this.di("Shift"), alt: this.di("Alt"), meta: this.di("Meta") };
1729
+ Xi(A) {
1730
+ if (this.Hi) {
1731
+ const t = { position: { ...this.Yi }, previousPosition: { ...this.Fi }, button: A.button, originalEvent: A };
1732
+ this.Hi(t);
1733
+ }
1694
1734
  }
1695
- bi() {
1696
- this.hi.clear(), this.ci = null, this.li = null;
1735
+ ji(A) {
1736
+ if (this.Wi) {
1737
+ const t = { position: { ...this.Yi }, previousPosition: { ...this.Fi }, button: A.button, originalEvent: A };
1738
+ this.Wi(t);
1739
+ }
1697
1740
  }
1698
- wi(A) {
1699
- const t = A.key, e = Date.now();
1700
- this.hi.has(t) || this.hi.set(t, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
1701
- const s = this.hi.get(t);
1702
- if (!s.isPressed && (s.isPressed = !0, s.lastPressTime = e, this.ci = t, this.ui)) {
1703
- const i = { key: t, keyCode: A.keyCode, ctrlKey: A.ctrlKey, shiftKey: A.shiftKey, altKey: A.altKey, metaKey: A.metaKey, isPressed: !0, originalEvent: A };
1704
- this.ui(i);
1741
+ qi(A) {
1742
+ if (this.Ti) {
1743
+ const t = { position: { ...this.Yi }, previousPosition: { ...this.Fi }, button: A.button, originalEvent: A };
1744
+ this.Ti(t);
1705
1745
  }
1706
1746
  }
1707
- fi(A) {
1708
- const t = A.key, e = Date.now();
1709
- this.hi.has(t) || this.hi.set(t, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
1710
- const s = this.hi.get(t);
1711
- if (s.isPressed = !1, s.lastReleaseTime = e, this.li = t, this.Pi) {
1712
- const i = { key: t, keyCode: A.keyCode, ctrlKey: A.ctrlKey, shiftKey: A.shiftKey, altKey: A.altKey, metaKey: A.metaKey, isPressed: !1, originalEvent: A };
1713
- this.Pi(i);
1747
+ AB(A) {
1748
+ if (this.Ji) {
1749
+ const t = { position: { ...this.Yi }, previousPosition: { ...this.Fi }, delta: { x: A.deltaX, y: A.deltaY }, originalEvent: A };
1750
+ this.Ji(t);
1714
1751
  }
1715
1752
  }
1716
- pi(A) {
1717
- return this.Ii[A] || A.toLowerCase();
1753
+ Zi(A) {
1754
+ const t = this.Ws.canvas;
1755
+ this.Fi = { ...this.Yi }, this.Ri = { x: A.clientX, y: A.clientY };
1756
+ const e = t.getBoundingClientRect(), s = A.clientX - e.left, i = A.clientY - e.top, B = t.width / e.width, r = i * (t.height / e.height), n = s * B - this.xi.offsetX, o = r - this.xi.offsetY, a = Math.floor(n / this.xi.cellWidth), g = Math.floor(o / this.xi.cellHeight);
1757
+ a >= 0 && a < this.xi.cols && g >= 0 && g < this.xi.rows ? (this.Yi.x = a, this.Yi.y = g) : (this.Yi.x = -1, this.Yi.y = -1);
1718
1758
  }
1719
1759
  }
1720
- const GA = (E) => class extends E {
1760
+ const YA = (E) => class extends E {
1721
1761
  rotate(A = 0, t = 0, e = 0) {
1722
- this.Re.state._A(A), this.Re.state.mA(t), this.Re.state.vA(e);
1762
+ this.vA.state.EA(A), this.vA.state.rA(t), this.vA.state.nA(e);
1723
1763
  }
1724
1764
  rotateX(A) {
1725
- this.Re.state._A(A);
1765
+ this.vA.state.EA(A);
1726
1766
  }
1727
1767
  rotateY(A) {
1728
- this.Re.state.mA(A);
1768
+ this.vA.state.rA(A);
1729
1769
  }
1730
1770
  rotateZ(A) {
1731
- this.Re.state.vA(A);
1771
+ this.vA.state.nA(A);
1732
1772
  }
1733
1773
  push() {
1734
- this.Re.state.IA();
1774
+ this.vA.state.J();
1735
1775
  }
1736
1776
  pop() {
1737
- this.Re.state.wA();
1777
+ this.vA.state.sA();
1738
1778
  }
1739
1779
  rect(A, t, e = 1, s = 1) {
1740
- this.Re.Xt(A, t, e, s);
1780
+ this.vA.ve(A, t, e, s);
1741
1781
  }
1742
1782
  point(A, t) {
1743
- this.Re.Xt(A, t, 1, 1);
1783
+ this.vA.ve(A, t, 1, 1);
1744
1784
  }
1745
1785
  line(A, t, e, s) {
1746
- this.Re.qt(A, t, e, s);
1786
+ this.vA.ye(A, t, e, s);
1747
1787
  }
1748
1788
  lineWeight(A) {
1749
- this.Re.state.pA(A);
1789
+ this.vA.state.QA(A);
1750
1790
  }
1751
1791
  background(A, t = A, e = A, s = 255) {
1752
- this.Re.Be(A, t, e, s);
1792
+ this.vA.Ye(A, t, e, s);
1753
1793
  }
1754
1794
  char(A) {
1755
- this.Re.state.yA(this.He.Ue(A));
1795
+ this.vA.state.gA(this.ws.us(A));
1756
1796
  }
1757
1797
  charColor(A, t, e) {
1758
- this.Re.state.xA(A, t, e);
1798
+ this.vA.state.oA(A, t, e);
1759
1799
  }
1760
1800
  cellColor(A, t, e) {
1761
- this.Re.state.bA(A, t, e);
1801
+ this.vA.state.aA(A, t, e);
1762
1802
  }
1763
1803
  flipX(A) {
1764
- this.Re.state.GA(A);
1804
+ this.vA.state.hA(A);
1765
1805
  }
1766
1806
  flipY(A) {
1767
- this.Re.state.$A(A);
1807
+ this.vA.state.cA(A);
1768
1808
  }
1769
1809
  charRotation(A) {
1770
- this.Re.state.YA(A);
1810
+ this.vA.state.lA(A);
1771
1811
  }
1772
1812
  invert(A) {
1773
- this.Re.state.MA(A);
1813
+ this.vA.state.CA(A);
1774
1814
  }
1775
1815
  clear() {
1776
- this.Re.Be(0, 0, 0, 0);
1816
+ this.vA.Ye(0, 0, 0, 0);
1777
1817
  }
1778
1818
  ellipse(A, t, e, s) {
1779
- this.Re.Ae(A, t, e / 2, s / 2);
1819
+ this.vA.be(A, t, e / 2, s / 2);
1780
1820
  }
1781
- triangle(A, t, e, s, i, r) {
1782
- this.Re.te(A, t, e, s, i, r);
1821
+ triangle(A, t, e, s, i, B) {
1822
+ this.vA.Ge(A, t, e, s, i, B);
1783
1823
  }
1784
- bezierCurve(A, t, e, s, i, r, B, o) {
1785
- this.Re.ee(A, t, e, s, i, r, B, o);
1824
+ bezierCurve(A, t, e, s, i, B, r, n) {
1825
+ this.vA.Me(A, t, e, s, i, B, r, n);
1786
1826
  }
1787
- arc(A, t, e, s, i, r) {
1788
- this.Re.ie(A, t, e, s, i, r);
1827
+ arc(A, t, e, s, i, B) {
1828
+ this.vA.xe(A, t, e, s, i, B);
1789
1829
  }
1790
1830
  shader(A) {
1791
- this.Re.Jt(A);
1831
+ this.vA.de(A);
1792
1832
  }
1793
1833
  setUniform(A, t) {
1794
- this.Re.Vt(A, t);
1834
+ this.vA.VA(A, t);
1795
1835
  }
1796
1836
  setUniforms(A) {
1797
- this.Re.Zt(A);
1837
+ this.vA._e(A);
1798
1838
  }
1799
1839
  createFilterShader(A) {
1800
- return this.Re.jt(A);
1840
+ return this.vA.et(A);
1841
+ }
1842
+ createFramebuffer(A) {
1843
+ return this.vA.$e(A.width, A.height, 5, { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte" });
1844
+ }
1845
+ image(A, t, e, s, i) {
1846
+ this.vA.pe(A, t, e, s ?? A.width, i ?? A.height);
1801
1847
  }
1802
1848
  };
1803
1849
  class O {
1804
- Gi(A) {
1805
- const t = A.k(0), e = A.k(1), s = A.k(2), i = A.k(3);
1806
- return { characterPixels: t, primaryColorPixels: e, secondaryColorPixels: s, transformPixels: A.k(4), rotationPixels: i };
1850
+ BB(A) {
1851
+ const t = A.xA(0), e = A.xA(1), s = A.xA(2), i = A.xA(3);
1852
+ return { characterPixels: t, primaryColorPixels: e, secondaryColorPixels: s, transformPixels: A.xA(4), rotationPixels: i };
1807
1853
  }
1808
- $i(A, t) {
1854
+ QB(A, t) {
1809
1855
  return A[t] + (A[t + 1] << 8);
1810
1856
  }
1811
- Mi(A, t) {
1857
+ EB(A, t) {
1812
1858
  return { r: A[t], g: A[t + 1], b: A[t + 2], a: A[t + 3] };
1813
1859
  }
1814
1860
  }
1815
- class H {
1816
- Yi(A, t) {
1861
+ class W {
1862
+ rB(A, t) {
1817
1863
  return new Blob([A], { type: t });
1818
1864
  }
1819
- Ri(A, t, e) {
1865
+ nB(A, t, e) {
1820
1866
  try {
1821
- const s = this.Yi(A, e), i = URL.createObjectURL(s), r = document.createElement("a");
1822
- r.href = i, r.download = t, r.style.display = "none", r.rel = "noopener", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(i);
1867
+ const s = this.rB(A, e), i = URL.createObjectURL(s), B = document.createElement("a");
1868
+ B.href = i, B.download = t, B.style.display = "none", B.rel = "noopener", document.body.appendChild(B), B.click(), document.body.removeChild(B), URL.revokeObjectURL(i);
1823
1869
  } catch (s) {
1824
1870
  throw console.error("Failed to download file:", s), Error("File download failed: " + (s instanceof Error ? s.message : "Unknown error"));
1825
1871
  }
1826
1872
  }
1827
- zi() {
1873
+ gB() {
1828
1874
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/:/g, "-");
1829
1875
  }
1830
- Fi() {
1876
+ oB() {
1831
1877
  const A = /* @__PURE__ */ new Date();
1832
1878
  return { date: A.toISOString().split("T")[0], time: A.toTimeString().split(" ")[0].replace(/:/g, "-") };
1833
1879
  }
1834
- Si(A) {
1880
+ aB(A) {
1835
1881
  return A.replace(/[<>:"/\\|?*]/g, "_").replace(/\s+/g, "_").replace(/_{2,}/g, "_").replace(/^_+|_+$/g, "").substring(0, 255);
1836
1882
  }
1837
- Ti() {
1838
- return "textmode-export-" + this.zi();
1883
+ hB() {
1884
+ return "textmode-export-" + this.gB();
1839
1885
  }
1840
1886
  }
1841
- class MA extends O {
1842
- Oi(A, t, e) {
1843
- const s = A[e] === 255, i = A[e + 1] === 255, r = A[e + 2] === 255, B = t[e], o = t[e + 1];
1844
- return { isInverted: s, flipHorizontal: i, flipVertical: r, rotation: Math.round(360 * (B + o / 255) / 255 * 100) / 100 };
1887
+ class _A extends O {
1888
+ cB(A, t, e) {
1889
+ const s = A[e] === 255, i = A[e + 1] === 255, B = A[e + 2] === 255, r = t[e], n = t[e + 1];
1890
+ return { isInverted: s, flipHorizontal: i, flipVertical: B, rotation: Math.round(360 * (r + n / 255) / 255 * 100) / 100 };
1845
1891
  }
1846
- ki(A, t, e) {
1892
+ CB(A, t, e) {
1847
1893
  return { x: A, y: t, cellX: A * e.cellWidth, cellY: t * e.cellHeight };
1848
1894
  }
1849
- Li(A, t) {
1895
+ lB(A, t) {
1850
1896
  const e = [];
1851
1897
  let s = 0;
1852
- for (let i = 0; i < t.rows; i++) for (let r = 0; r < t.cols; r++) {
1853
- const B = 4 * s, o = this.$i(A.characterPixels, B);
1854
- let Q = this.Mi(A.primaryColorPixels, B), g = this.Mi(A.secondaryColorPixels, B);
1855
- const a = this.Oi(A.transformPixels, A.rotationPixels, B);
1856
- if (a.isInverted) {
1857
- const l = Q;
1858
- Q = g, g = l;
1898
+ for (let i = 0; i < t.rows; i++) for (let B = 0; B < t.cols; B++) {
1899
+ const r = 4 * s, n = this.QB(A.characterPixels, r);
1900
+ let o = this.EB(A.primaryColorPixels, r), a = this.EB(A.secondaryColorPixels, r);
1901
+ const g = this.cB(A.transformPixels, A.rotationPixels, r);
1902
+ if (g.isInverted) {
1903
+ const c = o;
1904
+ o = a, a = c;
1859
1905
  }
1860
- const h = this.ki(r, i, t);
1861
- e.push({ charIndex: o, primaryColor: Q, secondaryColor: g, transform: a, position: h }), s++;
1906
+ const h = this.CB(B, i, t);
1907
+ e.push({ charIndex: n, primaryColor: o, secondaryColor: a, transform: g, position: h }), s++;
1862
1908
  }
1863
1909
  return e;
1864
1910
  }
1865
1911
  }
1866
- class FA {
1867
- Ui(A, t) {
1912
+ class SA {
1913
+ DB(A, t) {
1868
1914
  const e = A.cmap;
1869
1915
  for (const s of e.tables) if (s.format === 4) {
1870
1916
  const i = s;
1871
- for (let r = 0; r < i.startCount.length; r++) if (t >= i.startCount[r] && t <= i.endCount[r]) {
1872
- if (i.idRangeOffset[r] === 0) return t + i.idDelta[r] & 65535;
1917
+ for (let B = 0; B < i.startCount.length; B++) if (t >= i.startCount[B] && t <= i.endCount[B]) {
1918
+ if (i.idRangeOffset[B] === 0) return t + i.idDelta[B] & 65535;
1873
1919
  {
1874
- const B = i.idRangeOffset[r] / 2 + (t - i.startCount[r]) - (i.startCount.length - r);
1875
- if (B >= 0 && B < i.glyphIdArray.length) {
1876
- const o = i.glyphIdArray[B];
1877
- if (o !== 0) return o + i.idDelta[r] & 65535;
1920
+ const r = i.idRangeOffset[B] / 2 + (t - i.startCount[B]) - (i.startCount.length - B);
1921
+ if (r >= 0 && r < i.glyphIdArray.length) {
1922
+ const n = i.glyphIdArray[r];
1923
+ if (n !== 0) return n + i.idDelta[B] & 65535;
1878
1924
  }
1879
1925
  }
1880
1926
  }
1881
1927
  } else if (s.format === 12) {
1882
1928
  const i = s;
1883
- for (let r = 0; r < i.groups.length; r += 3) {
1884
- const B = i.groups[r], o = i.groups[r + 1], Q = i.groups[r + 2];
1885
- if (t >= B && t <= o) return Q + (t - B);
1929
+ for (let B = 0; B < i.groups.length; B += 3) {
1930
+ const r = i.groups[B], n = i.groups[B + 1], o = i.groups[B + 2];
1931
+ if (t >= r && t <= n) return o + (t - r);
1886
1932
  }
1887
1933
  }
1888
1934
  return 0;
1889
1935
  }
1890
- Wi(A, t, e, s, i) {
1891
- const r = i / A.head.unitsPerEm;
1892
- return { getBoundingBox: () => ({ x1: e + t.xMin * r, y1: s + -t.yMax * r, x2: e + t.xMax * r, y2: s + -t.yMin * r }), toSVG: () => this.Hi(t, e, s, r) };
1936
+ PB(A, t, e, s, i) {
1937
+ const B = i / A.head.unitsPerEm;
1938
+ return { getBoundingBox: () => ({ x1: e + t.xMin * B, y1: s + -t.yMax * B, x2: e + t.xMax * B, y2: s + -t.yMin * B }), toSVG: () => this.uB(t, e, s, B) };
1893
1939
  }
1894
- Hi(A, t, e, s) {
1940
+ uB(A, t, e, s) {
1895
1941
  if (!A || !A.xs) return "";
1896
- const { xs: i, ys: r, endPts: B, flags: o } = A;
1897
- if (!(i && r && B && o)) return "";
1898
- let Q = "", g = 0;
1899
- for (let a = 0; a < B.length; a++) {
1900
- const h = B[a];
1901
- if (!(h < g)) {
1902
- if (h >= g) {
1903
- const l = t + i[g] * s, c = e - r[g] * s;
1904
- Q += `M${l.toFixed(2)},${c.toFixed(2)}`;
1905
- let C = g + 1;
1942
+ const { xs: i, ys: B, endPts: r, flags: n } = A;
1943
+ if (!(i && B && r && n)) return "";
1944
+ let o = "", a = 0;
1945
+ for (let g = 0; g < r.length; g++) {
1946
+ const h = r[g];
1947
+ if (!(h < a)) {
1948
+ if (h >= a) {
1949
+ const c = t + i[a] * s, l = e - B[a] * s;
1950
+ o += `M${c.toFixed(2)},${l.toFixed(2)}`;
1951
+ let C = a + 1;
1906
1952
  for (; C <= h; )
1907
- if (1 & o[C]) {
1908
- const d = t + i[C] * s, I = e - r[C] * s;
1909
- Q += `L${d.toFixed(2)},${I.toFixed(2)}`, C++;
1953
+ if (1 & n[C]) {
1954
+ const f = t + i[C] * s, w = e - B[C] * s;
1955
+ o += `L${f.toFixed(2)},${w.toFixed(2)}`, C++;
1910
1956
  } else {
1911
- const d = t + i[C] * s, I = e - r[C] * s;
1912
- let w = C + 1 > h ? g : C + 1;
1913
- if (1 & o[w]) {
1914
- const p = t + i[w] * s, u = e - r[w] * s;
1915
- Q += `Q${d.toFixed(2)},${I.toFixed(2)} ${p.toFixed(2)},${u.toFixed(2)}`, C = w + 1;
1957
+ const f = t + i[C] * s, w = e - B[C] * s;
1958
+ let d = C + 1 > h ? a : C + 1;
1959
+ if (1 & n[d]) {
1960
+ const p = t + i[d] * s, R = e - B[d] * s;
1961
+ o += `Q${f.toFixed(2)},${w.toFixed(2)} ${p.toFixed(2)},${R.toFixed(2)}`, C = d + 1;
1916
1962
  } else {
1917
- const p = (d + (t + i[w] * s)) / 2, u = (I + (e - r[w] * s)) / 2;
1918
- Q += `Q${d.toFixed(2)},${I.toFixed(2)} ${p.toFixed(2)},${u.toFixed(2)}`, C = w;
1963
+ const p = (f + (t + i[d] * s)) / 2, R = (w + (e - B[d] * s)) / 2;
1964
+ o += `Q${f.toFixed(2)},${w.toFixed(2)} ${p.toFixed(2)},${R.toFixed(2)}`, C = d;
1919
1965
  }
1920
1966
  }
1921
- Q += "Z";
1967
+ o += "Z";
1922
1968
  }
1923
- g = h + 1;
1969
+ a = h + 1;
1924
1970
  }
1925
1971
  }
1926
- return Q;
1972
+ return o;
1927
1973
  }
1928
- Ki(A, t, e, s, i) {
1929
- const r = A.codePointAt(0) || 0, B = this.Ui(t, r);
1930
- let o = null;
1931
- return t.glyf && t.glyf[B] !== null ? o = t.glyf[B] : (o = y.T.glyf.Ee(t, B), t.glyf[B] = o), this.Wi(t, o, e, s, i);
1974
+ IB(A, t, e, s, i) {
1975
+ const B = A.codePointAt(0) || 0, r = this.DB(t, B);
1976
+ let n = null;
1977
+ return t.glyf && t.glyf[r] !== null ? n = t.glyf[r] : (n = m.T.glyf.Re(t, r), t.glyf[r] = n), this.PB(t, n, e, s, i);
1932
1978
  }
1933
- Ji(A, t, e, s, i, r, B, o) {
1934
- const Q = e + (i - o * (B / t.head.unitsPerEm)) / 2, g = s + (r + 0.7 * B) / 2;
1935
- return this.Ki(A, t, Q, g, B).toSVG() || null;
1979
+ wB(A, t, e, s, i, B, r, n) {
1980
+ const o = e + (i - n * (r / t.head.unitsPerEm)) / 2, a = s + (B + 0.7 * r) / 2;
1981
+ return this.IB(A, t, o, a, r).toSVG() || null;
1936
1982
  }
1937
1983
  }
1938
- class SA {
1984
+ class LA {
1939
1985
  constructor() {
1940
- n(this, "Vi");
1941
- this.Vi = new FA();
1986
+ Q(this, "fB");
1987
+ this.fB = new SA();
1942
1988
  }
1943
- Zi(A) {
1944
- return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1945
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
1946
- <svg width="${A.width}" height="${A.height}" viewBox="0 0 ${A.width} ${A.height}"
1947
- xmlns="http://www.w3.org/2000/svg" version="1.1">
1948
- <title>textmode art generated via textmode.js</title>
1949
- <desc>textmode art visualization generated by textmode.js library</desc>`;
1950
- }
1951
- ji() {
1952
- return `
1953
- </g>
1954
- </svg>`;
1955
- }
1956
- Ni(A, t) {
1957
- if (!t.includeBackgroundRectangles) return "";
1958
- const e = t.backgroundColor, s = `rgba(${e[0]},${e[1]},${e[2]},${e[3] / 255})`;
1959
- return `
1960
- <rect width="${A.width}" height="${A.height}" fill="${s}" />`;
1989
+ dB(A) {
1990
+ const { width: t, height: e } = A;
1991
+ return `<?xml version="1.0" encoding="UTF-8"?><svg width="${t}" height="${e}" viewBox="0 0 ${t} ${e}" xmlns="http://www.w3.org/2000/svg"><title>textmode.js sketch</title>`;
1961
1992
  }
1962
- Xi(A) {
1963
- return `rgba(${A.r},${A.g},${A.b},${A.a / 255})`;
1993
+ _B() {
1994
+ return "</g></svg>";
1995
+ }
1996
+ pB(A, t) {
1997
+ if (!t.includeBackgroundRectangles) return "";
1998
+ const [e, s, i, B] = t.backgroundColor;
1999
+ return `<rect width="${A.width}" height="${A.height}" fill="rgba(${e},${s},${i},${B / 255})"/>`;
1964
2000
  }
1965
- qi(A, t) {
1966
- const { transform: e, position: s } = A, i = s.cellX + t.cellWidth / 2, r = s.cellY + t.cellHeight / 2, B = [];
2001
+ mB(A, t) {
2002
+ const { transform: e, position: s } = A;
2003
+ if (!e.flipHorizontal && !e.flipVertical && !e.rotation) return "";
2004
+ const i = s.cellX + t.cellWidth / 2, B = s.cellY + t.cellHeight / 2, r = [];
1967
2005
  if (e.flipHorizontal || e.flipVertical) {
1968
- const o = e.flipHorizontal ? -1 : 1, Q = e.flipVertical ? -1 : 1;
1969
- B.push(`translate(${i} ${r})`), B.push(`scale(${o} ${Q})`), B.push(`translate(${-i} ${-r})`);
2006
+ const n = e.flipHorizontal ? -1 : 1, o = e.flipVertical ? -1 : 1;
2007
+ r.push(`translate(${i} ${B})scale(${n} ${o})translate(${-i} ${-B})`);
1970
2008
  }
1971
- return e.rotation && B.push(`rotate(${e.rotation} ${i} ${r})`), B.length ? ` transform="${B.join(" ")}"` : "";
2009
+ return e.rotation && r.push(`rotate(${e.rotation} ${i} ${B})`), ` transform="${r.join(" ")}"`;
1972
2010
  }
1973
- AB(A, t, e) {
2011
+ vB(A, t, e) {
1974
2012
  if (!e.includeBackgroundRectangles || A.secondaryColor.a === 0) return "";
1975
- const { position: s } = A, i = this.Xi(A.secondaryColor);
1976
- return e.drawMode === "stroke" ? `
1977
- <rect x="${s.cellX}" y="${s.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" stroke="${i}" fill="none" stroke-width="${e.strokeWidth}" />` : `
1978
- <rect x="${s.cellX}" y="${s.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" fill="${i}" />`;
2013
+ const { position: s } = A, { r: i, g: B, b: r, a: n } = A.secondaryColor, o = `rgba(${i},${B},${r},${n / 255})`;
2014
+ return e.drawMode === "stroke" ? `<rect x="${s.cellX}" y="${s.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" stroke="${o}" fill="none" stroke-width="${e.strokeWidth}"/>` : `<rect x="${s.cellX}" y="${s.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" fill="${o}"/>`;
1979
2015
  }
1980
- Ki(A, t, e, s) {
2016
+ IB(A, t, e, s) {
1981
2017
  const i = e.characters[A.charIndex];
1982
2018
  if (!i) return "";
1983
- const r = this.Vi.Ji(i.character, e.font, A.position.cellX, A.position.cellY, t.cellWidth, t.cellHeight, e.fontSize, i.advanceWidth);
1984
- if (!r) return "";
1985
- const B = this.Xi(A.primaryColor);
1986
- return s.drawMode === "stroke" ? `
1987
- <path id="${`path-${A.charIndex}-${A.position.cellX}-${A.position.cellY}`.replace(/\./g, "-")}" d="${r}" stroke="${B}" stroke-width="${s.strokeWidth}" fill="none" />` : `
1988
- <path d="${r}" fill="${B}" />`;
1989
- }
1990
- tB(A, t, e, s) {
1991
- let i = "";
1992
- i += this.AB(A, t, s);
1993
- const r = this.qi(A, t), B = this.Ki(A, t, e, s);
1994
- return B && (r ? (i += `
1995
- <g${r}>`, i += B, i += `
1996
- </g>`) : i += B), i;
1997
- }
1998
- eB(A, t, e, s) {
1999
- let i = this.Zi(t);
2000
- i += this.Ni(t, s), i += `
2001
- <g id="ascii-cells">`;
2002
- for (const r of A) i += this.tB(r, t, e, s);
2003
- return i += this.ji(), i;
2019
+ const B = this.fB.wB(i.character, e.font, A.position.cellX, A.position.cellY, t.cellWidth, t.cellHeight, e.fontSize, i.advanceWidth);
2020
+ if (!B) return "";
2021
+ const { r, g: n, b: o, a } = A.primaryColor, g = `rgba(${r},${n},${o},${a / 255})`;
2022
+ return s.drawMode === "stroke" ? `<path d="${B}" stroke="${g}" stroke-width="${s.strokeWidth}" fill="none"/>` : `<path d="${B}" fill="${g}"/>`;
2023
+ }
2024
+ yB(A, t, e, s) {
2025
+ const i = [], B = this.vB(A, t, s);
2026
+ B && i.push(B);
2027
+ const r = this.IB(A, t, e, s);
2028
+ if (r) {
2029
+ const n = this.mB(A, t);
2030
+ i.push(n ? `<g${n}>${r}</g>` : r);
2031
+ }
2032
+ return i.join("");
2004
2033
  }
2005
- sB(A) {
2006
- return A.replace(/<path[^>]*d=""[^>]*\/>/g, "").replace(/\n\s*\n/g, `
2007
- `).replace(/[ \t]+$/gm, "");
2034
+ bB(A, t, e, s) {
2035
+ const i = [this.dB(t), this.pB(t, s), '<g id="ascii-cells">'];
2036
+ for (const B of A) i.push(this.yB(B, t, e, s));
2037
+ return i.push(this._B()), i.join("");
2038
+ }
2039
+ GB(A) {
2040
+ return A.replace(/<path[^>]*d=""[^>]*\/>/g, "").replace(/\s+/g, " ").replace(/> </g, "><");
2008
2041
  }
2009
2042
  }
2010
- class YA extends H {
2011
- iB(A) {
2012
- return this.Yi(A, "image/svg+xml;charset=utf-8");
2043
+ class UA extends W {
2044
+ MB(A) {
2045
+ return this.rB(A, "image/svg+xml;charset=utf-8");
2013
2046
  }
2014
- BB(A, t) {
2015
- this.Ri(A, this.Si(t) + ".svg", "image/svg+xml;charset=utf-8");
2047
+ $B(A, t) {
2048
+ this.nB(A, this.aB(t) + ".svg", "image/svg+xml;charset=utf-8");
2016
2049
  }
2017
- rB(A, t) {
2018
- this.BB(A, t || this.Ti());
2050
+ xB(A, t) {
2051
+ this.$B(A, t || this.hB());
2019
2052
  }
2020
2053
  }
2021
- class $ {
2054
+ class J {
2022
2055
  constructor() {
2023
- n(this, "QB");
2024
- n(this, "EB");
2025
- n(this, "nB");
2026
- this.QB = new MA(), this.EB = new SA(), this.nB = new YA();
2056
+ Q(this, "YB");
2057
+ Q(this, "FB");
2058
+ Q(this, "RB");
2059
+ this.YB = new _A(), this.FB = new LA(), this.RB = new UA();
2027
2060
  }
2028
- oB(A) {
2029
- return { includeBackgroundRectangles: A.includeBackgroundRectangles ?? !0, drawMode: A.drawMode ?? "fill", strokeWidth: A.strokeWidth ?? 1, backgroundColor: A.backgroundColor ?? [0, 0, 0, 0], filename: A.filename || this.nB.Ti() };
2061
+ SB(A) {
2062
+ return { includeBackgroundRectangles: A.includeBackgroundRectangles ?? !0, drawMode: A.drawMode ?? "fill", strokeWidth: A.strokeWidth ?? 1, backgroundColor: A.backgroundColor ?? [0, 0, 0, 0], filename: A.filename || this.RB.hB() };
2030
2063
  }
2031
- gB(A, t = {}) {
2032
- const e = this.QB.Li(this.QB.Gi(A.pipeline), A.grid), s = this.EB.eB(e, A.grid, A.font, this.oB(t));
2033
- return this.EB.sB(s);
2064
+ zB(A, t = {}) {
2065
+ const e = this.YB.lB(this.YB.BB(A.pipeline), A.grid), s = this.FB.bB(e, A.grid, A.font, this.SB(t));
2066
+ return this.FB.GB(s);
2034
2067
  }
2035
- rB(A, t = {}) {
2036
- this.nB.rB(this.gB(A, t), t.filename);
2068
+ xB(A, t = {}) {
2069
+ this.RB.xB(this.zB(A, t), t.filename);
2037
2070
  }
2038
2071
  }
2039
- class LA extends O {
2040
- aB(A, t, e, s = " ") {
2041
- var B;
2072
+ class OA extends O {
2073
+ kB(A, t, e, s = " ") {
2074
+ var r;
2042
2075
  const i = [];
2043
- let r = 0;
2044
- for (let o = 0; o < t.rows; o++) {
2045
- const Q = [];
2046
- for (let g = 0; g < t.cols; g++) {
2047
- const a = 4 * r, h = this.$i(A.characterPixels, a), l = ((B = e.characters[h]) == null ? void 0 : B.character) || s;
2048
- Q.push(l), r++;
2076
+ let B = 0;
2077
+ for (let n = 0; n < t.rows; n++) {
2078
+ const o = [];
2079
+ for (let a = 0; a < t.cols; a++) {
2080
+ const g = 4 * B, h = this.QB(A.characterPixels, g), c = ((r = e.characters[h]) == null ? void 0 : r.character) || s;
2081
+ o.push(c), B++;
2049
2082
  }
2050
- i.push(Q);
2083
+ i.push(o);
2051
2084
  }
2052
2085
  return i;
2053
2086
  }
2054
2087
  }
2055
- class UA {
2056
- hB(A, t) {
2088
+ class WA {
2089
+ OB(A, t) {
2057
2090
  const e = [];
2058
2091
  for (const i of A) {
2059
- let r = i.join("");
2060
- t.preserveTrailingSpaces || (r = r.replace(/\s+$/, "")), e.push(r);
2092
+ let B = i.join("");
2093
+ t.preserveTrailingSpaces || (B = B.replace(/\s+$/, "")), e.push(B);
2061
2094
  }
2062
2095
  const s = t.lineEnding === "crlf" ? `\r
2063
2096
  ` : `
@@ -2065,56 +2098,56 @@ class UA {
2065
2098
  return e.join(s);
2066
2099
  }
2067
2100
  }
2068
- class zA extends H {
2069
- cB(A, t) {
2070
- const e = this.lB(t);
2071
- this.Ri(A, e, "text/plain;charset=utf-8");
2101
+ class zA extends W {
2102
+ LB(A, t) {
2103
+ const e = this.UB(t);
2104
+ this.nB(A, e, "text/plain;charset=utf-8");
2072
2105
  }
2073
- lB(A) {
2074
- let t = this.Si(A);
2075
- return t === ".txt" || t.length <= 4 ? this.Ti() : t;
2106
+ UB(A) {
2107
+ let t = this.aB(A);
2108
+ return t === ".txt" || t.length <= 4 ? this.hB() : t;
2076
2109
  }
2077
2110
  }
2078
2111
  class K {
2079
2112
  constructor() {
2080
- n(this, "QB");
2081
- n(this, "EB");
2082
- n(this, "nB");
2083
- this.QB = new LA(), this.EB = new UA(), this.nB = new zA();
2113
+ Q(this, "YB");
2114
+ Q(this, "FB");
2115
+ Q(this, "RB");
2116
+ this.YB = new OA(), this.FB = new WA(), this.RB = new zA();
2084
2117
  }
2085
- oB(A) {
2086
- return { preserveTrailingSpaces: A.preserveTrailingSpaces ?? !1, lineEnding: A.lineEnding ?? "lf", emptyCharacter: A.emptyCharacter ?? " ", filename: A.filename || this.nB.Ti() };
2118
+ SB(A) {
2119
+ return { preserveTrailingSpaces: A.preserveTrailingSpaces ?? !1, lineEnding: A.lineEnding ?? "lf", emptyCharacter: A.emptyCharacter ?? " ", filename: A.filename || this.RB.hB() };
2087
2120
  }
2088
- CB(A, t = {}) {
2089
- const e = this.oB(t), s = this.QB.aB(this.QB.Gi(A.pipeline), A.grid, A.font, e.emptyCharacter);
2090
- return this.EB.hB(s, e);
2121
+ TB(A, t = {}) {
2122
+ const e = this.SB(t), s = this.YB.kB(this.YB.BB(A.pipeline), A.grid, A.font, e.emptyCharacter);
2123
+ return this.FB.OB(s, e);
2091
2124
  }
2092
- cB(A, t = {}) {
2093
- this.nB.cB(this.CB(A, t), t.filename);
2125
+ LB(A, t = {}) {
2126
+ this.RB.LB(this.TB(A, t), t.filename);
2094
2127
  }
2095
2128
  }
2096
- class OA extends O {
2097
- DB(A, t = 1, e = "transparent") {
2129
+ class NA extends O {
2130
+ HB(A, t = 1, e = "transparent") {
2098
2131
  const s = A.canvas;
2099
2132
  if (t === 1 && e === "transparent") return s;
2100
- const i = document.createElement("canvas"), r = i.getContext("2d"), B = Math.round(s.width * t), o = Math.round(s.height * t);
2101
- return i.width = B, i.height = o, e !== "transparent" && (r.fillStyle = e, r.fillRect(0, 0, B, o)), r.imageSmoothingEnabled = !1, r.drawImage(s, 0, 0, s.width, s.height, 0, 0, B, o), i;
2133
+ const i = document.createElement("canvas"), B = i.getContext("2d"), r = Math.round(s.width * t), n = Math.round(s.height * t);
2134
+ return i.width = r, i.height = n, e !== "transparent" && (B.fillStyle = e, B.fillRect(0, 0, r, n)), B.imageSmoothingEnabled = !1, B.drawImage(s, 0, 0, s.width, s.height, 0, 0, r, n), i;
2102
2135
  }
2103
2136
  }
2104
2137
  class HA {
2105
- uB(A, t) {
2106
- const e = this.PB(t.format);
2138
+ WB(A, t) {
2139
+ const e = this.KB(t.format);
2107
2140
  return t.format === "png" ? A.toDataURL(e) : A.toDataURL(e, t.quality);
2108
2141
  }
2109
- async IB(A, t) {
2142
+ async JB(A, t) {
2110
2143
  return new Promise((e, s) => {
2111
- const i = this.PB(t.format), r = (B) => {
2112
- B ? e(B) : s(Error(`Failed to generate ${t.format.toUpperCase()} blob`));
2144
+ const i = this.KB(t.format), B = (r) => {
2145
+ r ? e(r) : s(Error(`Failed to generate ${t.format.toUpperCase()} blob`));
2113
2146
  };
2114
- t.format === "png" ? A.toBlob(r, i) : A.toBlob(r, i, t.quality);
2147
+ t.format === "png" ? A.toBlob(B, i) : A.toBlob(B, i, t.quality);
2115
2148
  });
2116
2149
  }
2117
- PB(A) {
2150
+ KB(A) {
2118
2151
  switch (A) {
2119
2152
  case "png":
2120
2153
  return "image/png";
@@ -2127,12 +2160,12 @@ class HA {
2127
2160
  }
2128
2161
  }
2129
2162
  }
2130
- const kA = { png: "image/png", jpg: "image/jpeg", webp: "image/webp" }, X = { png: ".png", jpg: ".jpg", webp: ".webp" };
2131
- class WA extends H {
2132
- wB(A, t, e) {
2133
- this.fB(A, this.Si(t) + X[e]);
2163
+ const kA = { png: "image/png", jpg: "image/jpeg", webp: "image/webp" }, $ = { png: ".png", jpg: ".jpg", webp: ".webp" };
2164
+ class JA extends W {
2165
+ VB(A, t, e) {
2166
+ this.ZB(A, this.aB(t) + $[e]);
2134
2167
  }
2135
- fB(A, t) {
2168
+ ZB(A, t) {
2136
2169
  const e = URL.createObjectURL(A);
2137
2170
  try {
2138
2171
  const s = document.createElement("a");
@@ -2141,253 +2174,253 @@ class WA extends H {
2141
2174
  URL.revokeObjectURL(e);
2142
2175
  }
2143
2176
  }
2144
- dB(A) {
2145
- return A in kA && A in X;
2177
+ NB(A) {
2178
+ return A in kA && A in $;
2146
2179
  }
2147
2180
  }
2148
- class NA {
2181
+ class KA {
2149
2182
  constructor() {
2150
- n(this, "QB");
2151
- n(this, "EB");
2152
- n(this, "nB");
2153
- this.QB = new OA(), this.EB = new HA(), this.nB = new WA();
2183
+ Q(this, "YB");
2184
+ Q(this, "FB");
2185
+ Q(this, "RB");
2186
+ this.YB = new NA(), this.FB = new HA(), this.RB = new JA();
2154
2187
  }
2155
- oB(A) {
2156
- return { format: A.format ?? "png", quality: A.quality ?? 1, scale: A.scale ?? 1, backgroundColor: A.backgroundColor ?? "transparent", filename: A.filename || this.nB.Ti() };
2188
+ SB(A) {
2189
+ return { format: A.format ?? "png", quality: A.quality ?? 1, scale: A.scale ?? 1, backgroundColor: A.backgroundColor ?? "transparent", filename: A.filename || this.RB.hB() };
2157
2190
  }
2158
- pB(A) {
2159
- if (!this.nB.dB(A.format)) throw Error(`Saving '${A.format}' files is not supported`);
2191
+ XB(A) {
2192
+ if (!this.RB.NB(A.format)) throw Error(`Saving '${A.format}' files is not supported`);
2160
2193
  if (A.quality < 0 || A.quality > 1) throw Error("Image quality must be between 0.0 and 1.0");
2161
2194
  if (A.scale <= 0) throw Error("Scale factor must be greater than 0");
2162
2195
  A.format === "jpg" && A.backgroundColor === "transparent" && (A.backgroundColor = "black");
2163
2196
  }
2164
- async IB(A, t) {
2165
- if (t.scale === 1 && t.backgroundColor === "transparent") return await this.EB.IB(A.canvas, t);
2166
- const e = this.QB.DB(A, t.scale, t.backgroundColor);
2167
- return await this.EB.IB(e, t);
2197
+ async JB(A, t) {
2198
+ if (t.scale === 1 && t.backgroundColor === "transparent") return await this.FB.JB(A.canvas, t);
2199
+ const e = this.YB.HB(A, t.scale, t.backgroundColor);
2200
+ return await this.FB.JB(e, t);
2168
2201
  }
2169
- async wB(A, t = {}) {
2170
- const e = this.oB(t);
2171
- this.pB(e);
2172
- const s = await this.IB(A, e);
2173
- this.nB.wB(s, e.filename, e.format);
2202
+ async VB(A, t = {}) {
2203
+ const e = this.SB(t);
2204
+ this.XB(e);
2205
+ const s = await this.JB(A, e);
2206
+ this.RB.VB(s, e.filename, e.format);
2174
2207
  }
2175
2208
  }
2176
2209
  const $A = (E) => class extends E {
2177
- _B() {
2178
- this.Re.Qe(this.mB);
2210
+ jB() {
2211
+ this.vA.FA(this.qB);
2179
2212
  }
2180
2213
  toString(A = {}) {
2181
- return this._B(), new K().CB({ pipeline: this.vB, grid: this.zs, font: this.He }, A);
2214
+ return this.jB(), new K().TB({ pipeline: this.AQ, grid: this.xi, font: this.ws }, A);
2182
2215
  }
2183
2216
  saveStrings(A = {}) {
2184
- this._B(), new K().cB({ pipeline: this.vB, grid: this.zs, font: this.He }, A);
2217
+ this.jB(), new K().LB({ pipeline: this.AQ, grid: this.xi, font: this.ws }, A);
2185
2218
  }
2186
2219
  toSVG(A = {}) {
2187
- return this._B(), new $().gB({ pipeline: this.vB, grid: this.zs, font: this.He }, A);
2220
+ return this.jB(), new J().zB({ pipeline: this.AQ, grid: this.xi, font: this.ws }, A);
2188
2221
  }
2189
2222
  saveSVG(A = {}) {
2190
- this._B(), new $().rB({ pipeline: this.vB, grid: this.zs, font: this.He }, A);
2223
+ this.jB(), new J().xB({ pipeline: this.AQ, grid: this.xi, font: this.ws }, A);
2191
2224
  }
2192
2225
  async saveCanvas(A = {}) {
2193
- await new NA().wB(this.ls, A);
2226
+ await new KA().VB(this.Ws, A);
2194
2227
  }
2195
- }, KA = (E) => class extends E {
2228
+ }, XA = (E) => class extends E {
2196
2229
  async loadFont(A) {
2197
- return this.He.Es(A).then(() => {
2198
- const t = this.He.maxGlyphDimensions;
2199
- this.zs.us(t.width, t.height), this.vB.O(this.zs.cols, this.zs.rows), this.Re.re(), this.yB.Xs();
2230
+ return this.ws.Os(A).then(() => {
2231
+ const t = this.ws.maxGlyphDimensions;
2232
+ this.xi.Vs(t.width, t.height), this.AQ.resize(this.xi.cols, this.xi.rows), this.vA.Fe(), this.tQ.Vi();
2200
2233
  });
2201
2234
  }
2202
2235
  fontSize(A) {
2203
- if (!G.u(typeof A == "number" && A > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", providedValue: A }) || this.He.fontSize === A) return;
2204
- this.He.Qs(A);
2205
- const t = this.He.maxGlyphDimensions;
2206
- this.zs.us(t.width, t.height), this.vB.O(this.zs.cols, this.zs.rows), this.Re.re(), this.yB.Xs();
2236
+ if (!M._(typeof A == "number" && A > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", providedValue: A }) || this.ws.fontSize === A) return;
2237
+ this.ws.ks(A);
2238
+ const t = this.ws.maxGlyphDimensions;
2239
+ this.xi.Vs(t.width, t.height), this.AQ.resize(this.xi.cols, this.xi.rows), this.vA.Fe(), this.tQ.Vi();
2207
2240
  }
2208
- }, XA = (E) => class extends E {
2241
+ }, VA = (E) => class extends E {
2209
2242
  get frameCount() {
2210
- return this.xB.frameCount;
2243
+ return this.eQ.frameCount;
2211
2244
  }
2212
2245
  set frameCount(A) {
2213
- this.xB.frameCount = A;
2246
+ this.eQ.frameCount = A;
2214
2247
  }
2215
2248
  frameRate(A) {
2216
- return A === void 0 ? this.xB.currentFrameRate : this.xB.frameRate(A, () => this.bB());
2249
+ return A === void 0 ? this.eQ.currentFrameRate : this.eQ.frameRate(A, () => this.sQ());
2217
2250
  }
2218
2251
  noLoop() {
2219
- this.xB.pause();
2252
+ this.eQ.pause();
2220
2253
  }
2221
2254
  loop() {
2222
- this.xB.resume(() => this.bB());
2255
+ this.eQ.resume(() => this.sQ());
2223
2256
  }
2224
2257
  redraw(A = 1) {
2225
- if (G.u(typeof A == "number" && A > 0 && Number.isInteger(A), "Redraw count must be a positive integer.", { method: "redraw", providedValue: A })) for (let t = 0; t < A; t++) this.bB();
2258
+ if (M._(typeof A == "number" && A > 0 && Number.isInteger(A), "Redraw count must be a positive integer.", { method: "redraw", providedValue: A })) for (let t = 0; t < A; t++) this.sQ();
2226
2259
  }
2227
2260
  isLooping() {
2228
- return this.xB.isLooping;
2261
+ return this.eQ.isLooping;
2229
2262
  }
2230
- }, VA = (E) => class extends E {
2263
+ }, ZA = (E) => class extends E {
2231
2264
  constructor(...A) {
2232
2265
  super(...A);
2233
2266
  }
2234
2267
  mouseClicked(A) {
2235
- this.yB.Qi(A);
2268
+ this.tQ.tB(A);
2236
2269
  }
2237
2270
  mousePressed(A) {
2238
- this.yB.Ei(A);
2271
+ this.tQ.di(A);
2239
2272
  }
2240
2273
  mouseReleased(A) {
2241
- this.yB.ni(A);
2274
+ this.tQ._i(A);
2242
2275
  }
2243
2276
  mouseMoved(A) {
2244
- this.yB.oi(A);
2277
+ this.tQ.eB(A);
2245
2278
  }
2246
2279
  mouseScrolled(A) {
2247
- this.yB.gi(A);
2280
+ this.tQ.sB(A);
2248
2281
  }
2249
2282
  get mouse() {
2250
- return this.yB.ai();
2283
+ return this.tQ.iB();
2251
2284
  }
2252
2285
  }, jA = (E) => class extends E {
2253
2286
  constructor(...A) {
2254
2287
  super(...A);
2255
2288
  }
2256
2289
  keyPressed(A) {
2257
- this.GB.Ei(A);
2290
+ this.iQ.di(A);
2258
2291
  }
2259
2292
  keyReleased(A) {
2260
- this.GB.ni(A);
2293
+ this.iQ._i(A);
2261
2294
  }
2262
2295
  isKeyPressed(A) {
2263
- return this.GB.di(A);
2296
+ return this.iQ.pi(A);
2264
2297
  }
2265
2298
  clearKeyStates() {
2266
- this.GB.bi();
2299
+ this.iQ.$i();
2267
2300
  }
2268
2301
  get lastKeyPressed() {
2269
- return this.GB._i();
2302
+ return this.iQ.yi();
2270
2303
  }
2271
2304
  get lastKeyReleased() {
2272
- return this.GB.mi();
2305
+ return this.iQ.bi();
2273
2306
  }
2274
2307
  get pressedKeys() {
2275
- return this.GB.yi();
2308
+ return this.iQ.Gi();
2276
2309
  }
2277
2310
  get modifierState() {
2278
- return this.GB.xi();
2311
+ return this.iQ.Mi();
2279
2312
  }
2280
2313
  };
2281
- class JA {
2314
+ class qA {
2282
2315
  constructor() {
2283
- n(this, "Re");
2284
- n(this, "He");
2285
- n(this, "ls");
2286
- n(this, "zs");
2287
- n(this, "xB");
2288
- n(this, "yB");
2289
- n(this, "GB");
2290
- n(this, "mB");
2291
- n(this, "vB");
2292
- n(this, "$B");
2293
- }
2294
- bB() {
2316
+ Q(this, "vA");
2317
+ Q(this, "ws");
2318
+ Q(this, "Ws");
2319
+ Q(this, "xi");
2320
+ Q(this, "eQ");
2321
+ Q(this, "tQ");
2322
+ Q(this, "iQ");
2323
+ Q(this, "qB");
2324
+ Q(this, "AQ");
2325
+ Q(this, "BQ");
2326
+ }
2327
+ sQ() {
2295
2328
  }
2296
2329
  }
2297
- class ZA extends function(t, ...e) {
2330
+ class At extends function(t, ...e) {
2298
2331
  return e.reduce((s, i) => i(s), t);
2299
- }(JA, GA, $A, KA, XA, VA, jA) {
2332
+ }(qA, YA, $A, XA, VA, ZA, jA) {
2300
2333
  constructor(t = {}) {
2301
2334
  super();
2302
- n(this, "MB", !1);
2303
- n(this, "YB", () => {
2335
+ Q(this, "QQ", !1);
2336
+ Q(this, "EQ", () => {
2304
2337
  });
2305
- n(this, "RB", () => {
2338
+ Q(this, "rQ", () => {
2306
2339
  });
2307
- n(this, "zB", () => {
2340
+ Q(this, "nQ", () => {
2308
2341
  });
2309
- n(this, "FB");
2310
- this.ls = new RA(t), this.Re = new DA(this.ls.fs()), this.He = new vA(this.Re, t.fontSize ?? 16), this.xB = new bA(t.frameRate ?? 60), this.yB = new TA(this.ls), this.GB = new _A(), this.mB = this.Re.Kt(z, `#version 300 es
2311
- precision highp float;in vec2 v_uv;in vec3 v_character;in vec4 v_primaryColor;in vec4 v_secondaryColor;in vec2 v_rotation;in vec3 v_transform;layout(location=0)out vec4 o_character;layout(location=1)out vec4 o_primaryColor;layout(location=2)out vec4 o_secondaryColor;layout(location=3)out vec4 o_rotation;layout(location=4)out vec4 o_transform;void main(){o_character=vec4(v_character,1.0);o_primaryColor=v_primaryColor;o_secondaryColor=v_secondaryColor;o_rotation=vec4(v_rotation,0.0,1.0);o_transform=vec4(v_transform,1.0);}`), this.$B = this.Re.Kt("attribute vec2 a_position;attribute vec2 a_texCoord;varying vec2 v_uv;void main(){v_uv=a_texCoord;gl_Position=vec4(a_position,0.0,1.0);}", "precision mediump float;uniform sampler2D u_characterTexture;uniform vec2 u_charsetDimensions;uniform sampler2D u_primaryColorTexture;uniform sampler2D u_secondaryColorTexture;uniform sampler2D u_transformTexture;uniform sampler2D u_asciiCharacterTexture;uniform sampler2D u_rotationTexture;uniform vec2 u_gridCellDimensions;uniform vec2 u_gridPixelDimensions;uniform vec2 u_gridOffsetPixels;mat2 rotate2D(float angle){float s=sin(angle);float c=cos(angle);return mat2(c,-s,s,c);}void main(){vec2 adjustedCoord=(gl_FragCoord.xy-u_gridOffsetPixels)/u_gridPixelDimensions;vec2 gridCoord=adjustedCoord*u_gridCellDimensions;vec2 cellCoord=floor(gridCoord);vec2 charIndexTexCoord=(cellCoord+0.5)/u_gridCellDimensions;vec4 primaryColor=texture2D(u_primaryColorTexture,charIndexTexCoord);vec4 secondaryColor=texture2D(u_secondaryColorTexture,charIndexTexCoord);vec4 transformColor=texture2D(u_transformTexture,charIndexTexCoord);bool isInverted=transformColor.r>0.5;bool flipHorizontal=transformColor.g>0.5;bool flipVertical=transformColor.b>0.5;vec4 encodedIndexVec=texture2D(u_asciiCharacterTexture,charIndexTexCoord);int charIndex=int(encodedIndexVec.r*255.0+0.5)+int(encodedIndexVec.g*255.0+0.5)*256;int charCol=int(mod(float(charIndex),u_charsetDimensions.x));int charRow=charIndex/int(u_charsetDimensions.x);float flippedRow=(u_charsetDimensions.y-1.0)-float(charRow);vec2 charCoord=vec2(float(charCol),flippedRow)/u_charsetDimensions;vec4 rotationColor=texture2D(u_rotationTexture,charIndexTexCoord);float scaledAngle=rotationColor.r*255.0+rotationColor.g;float rotationAngle=-(scaledAngle*360.0/255.0)*0.017453292;vec2 fractionalPart=fract(gridCoord)-0.5;if(flipHorizontal)fractionalPart.x=-fractionalPart.x;if(flipVertical)fractionalPart.y=-fractionalPart.y;fractionalPart=rotate2D(rotationAngle)*fractionalPart+0.5;vec2 cellSize=1.0/u_charsetDimensions;vec2 texCoord=charCoord+fractionalPart*cellSize;vec2 cellMax=charCoord+cellSize;if(any(lessThan(texCoord,charCoord))||any(greaterThan(texCoord,cellMax))){gl_FragColor=isInverted ? primaryColor : secondaryColor;return;}vec4 charTexel=texture2D(u_characterTexture,texCoord);if(isInverted)charTexel.rgb=1.0-charTexel.rgb;gl_FragColor=mix(secondaryColor,primaryColor,charTexel);}"), this.SB(t);
2312
- }
2313
- async SB(t) {
2314
- await this.He.ss(t.fontSource);
2315
- const e = this.He.maxGlyphDimensions;
2316
- this.zs = new xA(this.ls.canvas, e.width, e.height), this.yB.ss(this.zs), this.vB = this.Re.se(this.zs.cols, this.zs.rows, 5), this.TB(), this.YB(), this.xB.start(() => this.bB());
2317
- }
2318
- TB() {
2319
- this.FB = () => {
2320
- this.zB();
2321
- }, window.addEventListener("resize", this.FB), this.yB.qs(), this.GB.qs(), window.addEventListener("blur", () => {
2322
- this.GB.bi();
2342
+ Q(this, "gQ");
2343
+ this.Ws = new TA(t), this.vA = new uA(this.Ws.qs()), this.ws = new bA(this.vA, t.fontSize ?? 16), this.eQ = new MA(t.frameRate ?? 60), this.tQ = new GA(this.Ws), this.iQ = new FA(), this.qB = this.vA.YA(), this.BQ = this.vA.tt(), this.oQ(t);
2344
+ }
2345
+ async oQ(t) {
2346
+ await this.ws.Rs(t.fontSource);
2347
+ const e = this.ws.maxGlyphDimensions;
2348
+ this.xi = new RA(this.Ws.canvas, e.width, e.height), this.tQ.Rs(this.xi), this.AQ = this.vA.$e(this.xi.cols, this.xi.rows, 5), this.aQ(), this.EQ(), this.eQ.start(() => this.sQ());
2349
+ }
2350
+ aQ() {
2351
+ this.gQ = () => {
2352
+ this.nQ();
2353
+ }, window.addEventListener("resize", this.gQ), this.tQ.ui(), this.iQ.ui(), window.addEventListener("blur", () => {
2354
+ this.iQ.$i();
2323
2355
  });
2324
2356
  }
2325
- bB() {
2326
- if (this.xB.measureFrameRate(), this.xB.incrementFrame(), this.MB) return;
2327
- this.vB.U(), this.Re.Ht(this.mB), this.RB(), this.Re.Qe(this.mB), this.vB.W();
2328
- const t = this.Re.state.canvasBackgroundColor;
2329
- this.Re.ot(t[0], t[1], t[2], t[3]), this.Re.Ht(this.$B), this.$B.eA({ u_characterTexture: this.He.fontFramebuffer, u_charsetDimensions: [this.He.textureColumns, this.He.textureRows], u_asciiCharacterTexture: this.vB.textures[0], u_primaryColorTexture: this.vB.textures[1], u_secondaryColorTexture: this.vB.textures[2], u_transformTexture: this.vB.textures[4], u_rotationTexture: this.vB.textures[3], u_gridCellDimensions: [this.zs.cols, this.zs.rows], u_gridPixelDimensions: [this.zs.width, this.zs.height], u_gridOffsetPixels: [this.zs.offsetX, this.zs.offsetY], u_aspectRatio: this.zs.width / this.zs.height }), this.Re.Nt(this.zs.offsetX, this.zs.offsetY, this.zs.width, this.zs.height);
2357
+ sQ() {
2358
+ if (this.eQ.measureFrameRate(), this.eQ.incrementFrame(), this.QQ) return;
2359
+ this.AQ.begin(), this.vA.we(this.qB), this.rQ(), this.vA.FA(this.qB), this.AQ.end();
2360
+ const t = this.vA.state.canvasBackgroundColor;
2361
+ this.vA.Lt(t[0], t[1], t[2], t[3]), this.vA.we(this.BQ), this.BQ.JA({ a: this.ws.fontFramebuffer, b: [this.ws.textureColumns, this.ws.textureRows], c: this.AQ.textures[0], d: this.AQ.textures[1], e: this.AQ.textures[2], f: this.AQ.textures[4], g: this.AQ.textures[3], h: [this.xi.cols, this.xi.rows], i: [this.xi.width, this.xi.height], j: [this.xi.offsetX, this.xi.offsetY], k: this.xi.width / this.xi.height }), this.vA.me(this.xi.offsetX, this.xi.offsetY, this.xi.width, this.xi.height);
2330
2362
  }
2331
2363
  setup(t) {
2332
- this.YB = t;
2364
+ this.EQ = t;
2333
2365
  }
2334
2366
  draw(t) {
2335
- this.RB = t;
2367
+ this.rQ = t;
2336
2368
  }
2337
2369
  windowResized(t) {
2338
- this.zB = t;
2370
+ this.nQ = t;
2339
2371
  }
2340
2372
  resizeCanvas(t, e) {
2341
- this.ls.O(t, e), this.zs.fA(), this.vB.O(this.zs.cols, this.zs.rows), this.Re.re(), this.yB.Xs(), this.bB();
2373
+ this.Ws.js(t, e), this.xi.iA(), this.AQ.resize(this.xi.cols, this.xi.rows), this.vA.Fe(), this.tQ.Vi(), this.sQ();
2342
2374
  }
2343
2375
  destroy() {
2344
- this.MB || (this.xB.stop(), window.removeEventListener("resize", this.FB), this.yB.ri(), this.GB.ri(), this.He.H(), this.Re.H(), this.MB = !0);
2376
+ this.QQ || (this.eQ.stop(), window.removeEventListener("resize", this.gQ), this.tQ.fi(), this.iQ.fi(), this.ws.zA(), this.vA.zA(), this.QQ = !0);
2345
2377
  }
2346
2378
  get grid() {
2347
- return this.zs;
2379
+ return this.xi;
2348
2380
  }
2349
2381
  get font() {
2350
- return this.He;
2382
+ return this.ws;
2351
2383
  }
2352
2384
  get width() {
2353
- return this.ls.width;
2385
+ return this.Ws.width;
2354
2386
  }
2355
2387
  get height() {
2356
- return this.ls.height;
2388
+ return this.Ws.height;
2357
2389
  }
2358
2390
  get canvas() {
2359
- return this.ls.canvas;
2391
+ return this.Ws.canvas;
2360
2392
  }
2361
2393
  get isDisposed() {
2362
- return this.MB;
2394
+ return this.QQ;
2363
2395
  }
2364
2396
  get drawFramebuffer() {
2365
- return this.vB;
2397
+ return this.AQ;
2366
2398
  }
2367
2399
  }
2368
- class k {
2400
+ class z {
2369
2401
  constructor() {
2370
2402
  }
2371
2403
  static create(A = {}) {
2372
- return new ZA(A);
2404
+ return new At(A);
2373
2405
  }
2374
2406
  static setErrorLevel(A) {
2375
- G.P(A);
2407
+ M.v(A);
2376
2408
  }
2377
2409
  static get version() {
2378
- return "0.2.1-beta.1";
2410
+ return "0.2.1-beta.2";
2379
2411
  }
2380
2412
  }
2381
- const At = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), tt = k.create, et = k.setErrorLevel, st = k.version;
2413
+ const et = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), st = z.create, it = z.setErrorLevel, Bt = z.version;
2382
2414
  export {
2383
- RA as TextmodeCanvas,
2384
- q as TextmodeErrorLevel,
2385
- vA as TextmodeFont,
2386
- xA as TextmodeGrid,
2387
- ZA as Textmodifier,
2388
- tt as create,
2389
- At as export,
2390
- et as setErrorLevel,
2391
- k as textmode,
2392
- st as version
2415
+ U as GLFramebuffer,
2416
+ TA as TextmodeCanvas,
2417
+ tA as TextmodeErrorLevel,
2418
+ bA as TextmodeFont,
2419
+ RA as TextmodeGrid,
2420
+ At as Textmodifier,
2421
+ st as create,
2422
+ et as export,
2423
+ it as setErrorLevel,
2424
+ z as textmode,
2425
+ Bt as version
2393
2426
  };