iflow-engine-base 3.9.203 → 3.9.204

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.
@@ -1,170 +1,6 @@
1
1
  import { R as ra, b as Qe, V as lt, s as ta, aZ as na } from "./three-vendor-Dbcwwhki.js";
2
- import { E as lr, J as rn } from "./engine-2d-D5sGoz-x.js";
3
- import { a as tn } from "./engine-3d-5kLY2eW_.js";
4
- function Yr() {
5
- const e = globalThis.crypto?.subtle;
6
- if (!e)
7
- throw new Error("[BimEngine] Web Crypto API is required for secure sdkAuth credentials mode");
8
- return e;
9
- }
10
- function Me(e) {
11
- return new TextEncoder().encode(e);
12
- }
13
- function Ge(e) {
14
- return e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength);
15
- }
16
- function ft(e) {
17
- let r = "";
18
- return e.forEach((t) => {
19
- r += String.fromCharCode(t);
20
- }), btoa(r);
21
- }
22
- function aa(e) {
23
- const r = e.getUTCFullYear(), t = String(e.getUTCMonth() + 1).padStart(2, "0"), n = String(e.getUTCDate()).padStart(2, "0");
24
- return `${r}${t}${n}`;
25
- }
26
- async function sa(e) {
27
- const r = await Yr().digest("SHA-256", Ge(Me(e)));
28
- return Array.from(new Uint8Array(r)).map((t) => t.toString(16).padStart(2, "0")).join("");
29
- }
30
- async function ia(e, r) {
31
- const t = Yr(), n = await t.importKey("raw", Ge(e), { name: "HMAC", hash: "SHA-256" }, !1, ["sign"]);
32
- return t.sign("HMAC", n, Ge(Me(r)));
33
- }
34
- function oa(e) {
35
- return Me(
36
- [e.appId, e.engineType, e.requestDate, String(e.timestamp), e.nonce].join("|")
37
- );
38
- }
39
- async function ua(e) {
40
- const r = Yr(), t = /* @__PURE__ */ new Date(), n = t.getTime(), a = aa(t), s = globalThis.crypto.randomUUID(), i = globalThis.crypto.getRandomValues(new Uint8Array(12)), u = await sa(e.appSecret), o = await ia(Me(u), a), l = await r.importKey("raw", o, "AES-GCM", !1, ["encrypt"]), f = JSON.stringify({
41
- appKey: e.appKey,
42
- appSecret: e.appSecret
43
- }), p = await r.encrypt(
44
- {
45
- name: "AES-GCM",
46
- iv: i,
47
- additionalData: Ge(oa({
48
- appId: e.appId,
49
- engineType: e.engineType,
50
- requestDate: a,
51
- timestamp: n,
52
- nonce: s
53
- })),
54
- tagLength: 128
55
- },
56
- l,
57
- Ge(Me(f))
58
- );
59
- return {
60
- appId: e.appId,
61
- engineType: e.engineType,
62
- requestDate: a,
63
- timestamp: n,
64
- nonce: s,
65
- iv: ft(i),
66
- cipherText: ft(new Uint8Array(p)),
67
- sdkVersion: e.sdkVersion,
68
- origin: e.origin,
69
- product: e.product
70
- };
71
- }
72
- const wr = /* @__PURE__ */ new Map();
73
- function fr(e) {
74
- return e.replace(/\/+$/, "");
75
- }
76
- function cr(e) {
77
- if (e) return e;
78
- if (typeof window < "u" && typeof window.location?.origin == "string")
79
- return window.location.origin;
80
- }
81
- function la(e, r) {
82
- return JSON.stringify({
83
- endpoint: fr(e.endpoint),
84
- token: e.token ?? "",
85
- appId: e.appId ?? "",
86
- appKey: e.appKey ?? "",
87
- appSecret: e.appSecret ?? "",
88
- origin: cr(e.origin) ?? "",
89
- product: e.product ?? "",
90
- engineType: r,
91
- sdkVersion: lr
92
- });
93
- }
94
- async function Br(e, r, t) {
95
- const n = typeof AbortController < "u" ? new AbortController() : void 0, a = n ? setTimeout(() => n.abort(), t) : void 0;
96
- try {
97
- const s = await fetch(e, {
98
- method: "POST",
99
- headers: {
100
- "Content-Type": "application/json"
101
- },
102
- body: JSON.stringify(r),
103
- signal: n?.signal
104
- }), i = await s.json().catch(() => ({}));
105
- if (!s.ok) {
106
- const u = i?.error?.message ?? i?.message ?? `SDK authentication failed with status ${s.status}`;
107
- throw new Error(u);
108
- }
109
- return i;
110
- } finally {
111
- a != null && clearTimeout(a);
112
- }
113
- }
114
- async function fa(e, r) {
115
- const t = await Br(`${fr(e.endpoint)}/oauth/sdk-verify`, {
116
- sdkToken: e.token,
117
- engineType: r,
118
- sdkVersion: lr,
119
- origin: cr(e.origin),
120
- product: e.product
121
- }, e.timeoutMs ?? 8e3);
122
- return t.sdkToken = e.token, t;
123
- }
124
- async function ca(e, r) {
125
- const t = await ua({
126
- appId: e.appId,
127
- appKey: e.appKey,
128
- appSecret: e.appSecret,
129
- engineType: r,
130
- sdkVersion: lr,
131
- origin: cr(e.origin),
132
- product: e.product
133
- }), n = await Br(
134
- `${fr(e.endpoint)}/oauth/sdk-token/secure`,
135
- t,
136
- e.timeoutMs ?? 8e3
137
- ), a = await Br(`${fr(e.endpoint)}/oauth/sdk-verify`, {
138
- sdkToken: n.sdkToken,
139
- engineType: r,
140
- sdkVersion: lr,
141
- origin: cr(e.origin),
142
- product: e.product
143
- }, e.timeoutMs ?? 8e3);
144
- return a.sdkToken = n.sdkToken, a;
145
- }
146
- async function pa(e, r) {
147
- const t = e?.sdkAuth;
148
- if (!t)
149
- throw new Error("[BimEngine] sdkAuth is required. Provide sdkAuth.token or sdkAuth.appId/appKey/appSecret");
150
- if (!t.endpoint)
151
- throw new Error("[BimEngine] sdkAuth.endpoint is required");
152
- if (!t.token && !(t.appId && t.appKey && t.appSecret))
153
- throw new Error("[BimEngine] Provide sdkAuth.token or sdkAuth.appId/appKey/appSecret");
154
- const n = la(t, r), a = wr.get(n);
155
- if (a) {
156
- const i = await a;
157
- return e && (e.__sdkAuthSession = i), i;
158
- }
159
- const s = (t.token ? fa(t, r) : ca(t, r)).then((i) => {
160
- if (i.authorized !== !0)
161
- throw new Error("[BimEngine] SDK authorization rejected");
162
- return e && (e.__sdkAuthSession = i), i;
163
- }).catch((i) => {
164
- throw wr.delete(n), i;
165
- });
166
- return wr.set(n, s), s;
167
- }
2
+ import { J as rn, E as lr } from "./engine-2d-FTvtmsww.js";
3
+ import { a as tn } from "./engine-3d-CJwFNQj9.js";
168
4
  class il {
169
5
  /**
170
6
  * 构造函数
@@ -277,38 +113,38 @@ class il {
277
113
  this.scene = r;
278
114
  }
279
115
  }
280
- function ha(e) {
116
+ function aa(e) {
281
117
  return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in e && e.BYTES_PER_ELEMENT === 1;
282
118
  }
283
- function ct(e) {
119
+ function ft(e) {
284
120
  if (typeof e != "number")
285
121
  throw new TypeError("number expected, got " + typeof e);
286
122
  if (!Number.isSafeInteger(e) || e < 0)
287
123
  throw new RangeError("positive integer expected, got " + e);
288
124
  }
289
125
  function Q(e, r, t = "") {
290
- const n = ha(e), a = e?.length, s = r !== void 0;
126
+ const n = aa(e), a = e?.length, s = r !== void 0;
291
127
  if (!n || s && a !== r) {
292
128
  const i = t && `"${t}" `, u = s ? ` of length ${r}` : "", o = n ? `length=${a}` : `type=${typeof e}`, l = i + "expected Uint8Array" + u + ", got " + o;
293
129
  throw n ? new RangeError(l) : new TypeError(l);
294
130
  }
295
131
  return e;
296
132
  }
297
- function pt(e, r = !0) {
133
+ function ct(e, r = !0) {
298
134
  if (e.destroyed)
299
135
  throw new Error("Hash instance has been destroyed");
300
136
  if (r && e.finished)
301
137
  throw new Error("Hash#digest() has already been called");
302
138
  }
303
- function da(e, r, t = !1) {
139
+ function sa(e, r, t = !1) {
304
140
  Q(e, void 0, "output");
305
141
  const n = r.outputLen;
306
142
  if (e.length < n)
307
143
  throw new RangeError("digestInto() expects output buffer of length at least " + n);
308
- if (t && !Ne(e))
144
+ if (t && !Me(e))
309
145
  throw new Error("invalid output, must be aligned");
310
146
  }
311
- function va(e) {
147
+ function ia(e) {
312
148
  return new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
313
149
  }
314
150
  function Fe(e) {
@@ -321,12 +157,12 @@ function ye(...e) {
321
157
  function xr(e) {
322
158
  return new DataView(e.buffer, e.byteOffset, e.byteLength);
323
159
  }
324
- const Zr = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68, nn = (e) => e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255, G = Zr ? (e) => e : (e) => nn(e) >>> 0, ga = (e) => {
160
+ const Yr = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68, nn = (e) => e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255, G = Yr ? (e) => e : (e) => nn(e) >>> 0, oa = (e) => {
325
161
  for (let r = 0; r < e.length; r++)
326
162
  e[r] = nn(e[r]);
327
163
  return e;
328
- }, Kr = Zr ? (e) => e : ga;
329
- function ma(e, r) {
164
+ }, Zr = Yr ? (e) => e : oa;
165
+ function ua(e, r) {
330
166
  if (e.length !== r.length)
331
167
  return !1;
332
168
  let t = 0;
@@ -334,11 +170,11 @@ function ma(e, r) {
334
170
  t |= e[n] ^ r[n];
335
171
  return t === 0;
336
172
  }
337
- function ya(e, r, t) {
173
+ function la(e, r, t) {
338
174
  const n = r, a = t || (() => []), s = (u, o) => n(o, ...a(u)).update(u).digest(), i = n(new Uint8Array(e), ...a(new Uint8Array(0)));
339
175
  return s.outputLen = i.outputLen, s.blockLen = i.blockLen, s.create = (u, ...o) => n(u, ...o), s;
340
176
  }
341
- const xa = /* @__NO_SIDE_EFFECTS__ */ (e, r) => {
177
+ const fa = /* @__NO_SIDE_EFFECTS__ */ (e, r) => {
342
178
  function t(n, ...a) {
343
179
  if (Q(n, void 0, "key"), e.nonceLength !== void 0) {
344
180
  const f = a[0];
@@ -369,27 +205,27 @@ const xa = /* @__NO_SIDE_EFFECTS__ */ (e, r) => {
369
205
  }
370
206
  return Object.assign(t, e), t;
371
207
  };
372
- function ba(e, r, t = !0) {
208
+ function ca(e, r, t = !0) {
373
209
  if (r === void 0)
374
210
  return new Uint8Array(e);
375
211
  if (Q(r, void 0, "output"), r.length !== e)
376
212
  throw new Error('"output" expected Uint8Array of length ' + e + ", got: " + r.length);
377
- if (t && !Ne(r))
213
+ if (t && !Me(r))
378
214
  throw new Error("invalid output, must be aligned");
379
215
  return r;
380
216
  }
381
- function Sa(e, r, t) {
382
- ct(e), ct(r);
217
+ function pa(e, r, t) {
218
+ ft(e), ft(r);
383
219
  const n = new Uint8Array(16), a = xr(n);
384
220
  return a.setBigUint64(0, BigInt(r), t), a.setBigUint64(8, BigInt(e), t), n;
385
221
  }
386
- function Ne(e) {
222
+ function Me(e) {
387
223
  return e.byteOffset % 4 === 0;
388
224
  }
389
- function He(e) {
225
+ function Ge(e) {
390
226
  return Uint8Array.from(Q(e));
391
227
  }
392
- const Ue = 16, an = /* @__PURE__ */ new Uint8Array(16), De = /* @__PURE__ */ Fe(an), ka = 225, Ta = (e, r, t, n) => {
228
+ const Ue = 16, an = /* @__PURE__ */ new Uint8Array(16), De = /* @__PURE__ */ Fe(an), ha = 225, da = (e, r, t, n) => {
393
229
  const a = n & 1;
394
230
  return {
395
231
  s3: t << 31 | n >>> 1,
@@ -397,11 +233,11 @@ const Ue = 16, an = /* @__PURE__ */ new Uint8Array(16), De = /* @__PURE__ */ Fe(
397
233
  s1: e << 31 | r >>> 1,
398
234
  // NIST SP 800-38D §6.3 applies `V >> 1` and XORs R on carry. In this
399
235
  // 4x32-bit split, R = 0xe1 || 0^120 lives in the top byte of s0.
400
- s0: e >>> 1 ^ ka << 24 & -(a & 1)
236
+ s0: e >>> 1 ^ ha << 24 & -(a & 1)
401
237
  // reduce % poly
402
238
  };
403
- }, $e = (e) => (e >>> 0 & 255) << 24 | (e >>> 8 & 255) << 16 | (e >>> 16 & 255) << 8 | e >>> 24 & 255 | 0, wa = (e) => e > 64 * 1024 ? 8 : e > 1024 ? 4 : 2;
404
- class Fa {
239
+ }, $e = (e) => (e >>> 0 & 255) << 24 | (e >>> 8 & 255) << 16 | (e >>> 16 & 255) << 8 | e >>> 24 & 255 | 0, va = (e) => e > 64 * 1024 ? 8 : e > 1024 ? 4 : 2;
240
+ class ga {
405
241
  blockLen = Ue;
406
242
  outputLen = Ue;
407
243
  s0 = 0;
@@ -415,13 +251,13 @@ class Fa {
415
251
  windowSize;
416
252
  // We select bits per window adaptively based on expectedLength
417
253
  constructor(r, t) {
418
- Q(r, 16, "key"), r = He(r);
254
+ Q(r, 16, "key"), r = Ge(r);
419
255
  const n = xr(r);
420
256
  let a = n.getUint32(0, !1), s = n.getUint32(4, !1), i = n.getUint32(8, !1), u = n.getUint32(12, !1);
421
257
  const o = [];
422
258
  for (let v = 0; v < 128; v++)
423
- o.push({ s0: $e(a), s1: $e(s), s2: $e(i), s3: $e(u) }), { s0: a, s1: s, s2: i, s3: u } = Ta(a, s, i, u);
424
- const l = wa(t || 1024);
259
+ o.push({ s0: $e(a), s1: $e(s), s2: $e(i), s3: $e(u) }), { s0: a, s1: s, s2: i, s3: u } = da(a, s, i, u);
260
+ const l = va(t || 1024);
425
261
  if (![1, 2, 4, 8].includes(l))
426
262
  throw new Error("ghash: invalid window size, expected 2, 4 or 8");
427
263
  this.W = l;
@@ -456,7 +292,7 @@ class Fa {
456
292
  this.s0 = o, this.s1 = l, this.s2 = f, this.s3 = p;
457
293
  }
458
294
  update(r) {
459
- pt(this), Q(r), r = He(r);
295
+ ct(this), Q(r), r = Ge(r);
460
296
  const t = Fe(r), n = Math.floor(r.length / Ue), a = r.length % Ue;
461
297
  for (let s = 0; s < n; s++)
462
298
  this._updateBlock(G(t[s * 4 + 0]), G(t[s * 4 + 1]), G(t[s * 4 + 2]), G(t[s * 4 + 3]));
@@ -469,32 +305,32 @@ class Fa {
469
305
  t.s0 = 0, t.s1 = 0, t.s2 = 0, t.s3 = 0;
470
306
  }
471
307
  digestInto(r) {
472
- pt(this), da(r, this, !0), this.finished = !0;
308
+ ct(this), sa(r, this, !0), this.finished = !0;
473
309
  const { s0: t, s1: n, s2: a, s3: s } = this, i = Fe(r);
474
- i[0] = t, i[1] = n, i[2] = a, i[3] = s, Kr(i);
310
+ i[0] = t, i[1] = n, i[2] = a, i[3] = s, Zr(i);
475
311
  }
476
312
  digest() {
477
313
  const r = new Uint8Array(Ue);
478
314
  return this.digestInto(r), this.destroy(), r;
479
315
  }
480
316
  }
481
- const ht = /* @__PURE__ */ ya(16, (e, r) => new Fa(e, r), (e) => [e.length]), Mr = 16, Ca = 4, Je = /* @__PURE__ */ new Uint8Array(Mr), Ua = 283;
482
- function Ea(e) {
317
+ const pt = /* @__PURE__ */ la(16, (e, r) => new ga(e, r), (e) => [e.length]), Br = 16, ma = 4, Je = /* @__PURE__ */ new Uint8Array(Br), ya = 283;
318
+ function xa(e) {
483
319
  if (![16, 24, 32].includes(e.length))
484
320
  throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length=' + e.length);
485
321
  }
486
- function jr(e) {
487
- return e << 1 ^ Ua & -(e >> 7);
322
+ function Kr(e) {
323
+ return e << 1 ^ ya & -(e >> 7);
488
324
  }
489
- function dt(e, r) {
325
+ function ht(e, r) {
490
326
  let t = 0;
491
327
  for (; r > 0; r >>= 1)
492
- t ^= e & -(r & 1), e = jr(e);
328
+ t ^= e & -(r & 1), e = Kr(e);
493
329
  return t;
494
330
  }
495
- const La = /* @__PURE__ */ (() => {
331
+ const ba = /* @__PURE__ */ (() => {
496
332
  const e = new Uint8Array(256);
497
- for (let t = 0, n = 1; t < 256; t++, n ^= jr(n))
333
+ for (let t = 0, n = 1; t < 256; t++, n ^= Kr(n))
498
334
  e[t] = n;
499
335
  const r = new Uint8Array(256);
500
336
  r[0] = 99;
@@ -503,11 +339,11 @@ const La = /* @__PURE__ */ (() => {
503
339
  n |= n << 8, r[e[t]] = (n ^ n >> 4 ^ n >> 5 ^ n >> 6 ^ n >> 7 ^ 99) & 255;
504
340
  }
505
341
  return ye(e), r;
506
- })(), Oa = (e) => e << 24 | e >>> 8, Fr = (e) => e << 8 | e >>> 24;
507
- function Ra(e, r) {
342
+ })(), Sa = (e) => e << 24 | e >>> 8, wr = (e) => e << 8 | e >>> 24;
343
+ function ka(e, r) {
508
344
  if (e.length !== 256)
509
345
  throw new Error("Wrong sbox length");
510
- const t = new Uint32Array(256).map((l, f) => r(e[f])), n = t.map(Fr), a = n.map(Fr), s = a.map(Fr), i = new Uint32Array(256 * 256), u = new Uint32Array(256 * 256), o = new Uint16Array(256 * 256);
346
+ const t = new Uint32Array(256).map((l, f) => r(e[f])), n = t.map(wr), a = n.map(wr), s = a.map(wr), i = new Uint32Array(256 * 256), u = new Uint32Array(256 * 256), o = new Uint16Array(256 * 256);
511
347
  for (let l = 0; l < 256; l++)
512
348
  for (let f = 0; f < 256; f++) {
513
349
  const p = l * 256 + f;
@@ -515,23 +351,23 @@ function Ra(e, r) {
515
351
  }
516
352
  return { sbox: e, sbox2: o, T0: t, T1: n, T2: a, T3: s, T01: i, T23: u };
517
353
  }
518
- const sn = /* @__PURE__ */ Ra(La, (e) => dt(e, 3) << 24 | e << 16 | e << 8 | dt(e, 2)), Aa = /* @__PURE__ */ (() => {
354
+ const sn = /* @__PURE__ */ ka(ba, (e) => ht(e, 3) << 24 | e << 16 | e << 8 | ht(e, 2)), Ta = /* @__PURE__ */ (() => {
519
355
  const e = new Uint8Array(16);
520
- for (let r = 0, t = 1; r < 16; r++, t = jr(t))
356
+ for (let r = 0, t = 1; r < 16; r++, t = Kr(t))
521
357
  e[r] = t;
522
358
  return e;
523
359
  })();
524
- function Da(e) {
360
+ function wa(e) {
525
361
  Q(e);
526
362
  const r = e.length;
527
- Ea(e);
363
+ xa(e);
528
364
  const { sbox2: t } = sn, n = [];
529
- (!Zr || !Ne(e)) && n.push(e = He(e));
530
- const a = Kr(Fe(e)), s = a.length, i = (o) => Pe(t, o, o, o, o), u = new Uint32Array(r + 28);
365
+ (!Yr || !Me(e)) && n.push(e = Ge(e));
366
+ const a = Zr(Fe(e)), s = a.length, i = (o) => Pe(t, o, o, o, o), u = new Uint32Array(r + 28);
531
367
  u.set(a);
532
368
  for (let o = s; o < u.length; o++) {
533
369
  let l = u[o - 1];
534
- o % s === 0 ? l = i(Oa(l)) ^ Aa[o / s - 1] : s > 6 && o % s === 4 && (l = i(l)), u[o] = u[o - s] ^ l;
370
+ o % s === 0 ? l = i(Sa(l)) ^ Ta[o / s - 1] : s > 6 && o % s === 4 && (l = i(l)), u[o] = u[o - s] ^ l;
535
371
  }
536
372
  return ye(...n), u;
537
373
  }
@@ -541,7 +377,7 @@ function er(e, r, t, n, a, s) {
541
377
  function Pe(e, r, t, n, a) {
542
378
  return e[r & 255 | t & 65280] | e[n >>> 16 & 255 | a >>> 16 & 65280] << 16;
543
379
  }
544
- function vt(e, r, t, n, a) {
380
+ function dt(e, r, t, n, a) {
545
381
  const { sbox2: s, T01: i, T23: u } = sn;
546
382
  let o = 0;
547
383
  r ^= e[o++], t ^= e[o++], n ^= e[o++], a ^= e[o++];
@@ -554,48 +390,48 @@ function vt(e, r, t, n, a) {
554
390
  return { s0: f, s1: p, s2: c, s3: h };
555
391
  }
556
392
  function rr(e, r, t, n, a) {
557
- Q(t, Mr, "nonce"), Q(n), a = ba(n.length, a);
393
+ Q(t, Br, "nonce"), Q(n), a = ca(n.length, a);
558
394
  const s = t, i = Fe(s), u = xr(s), o = Fe(n), l = Fe(a), f = r ? 0 : 12, p = n.length;
559
- let c = u.getUint32(f, r), { s0: h, s1: v, s2: g, s3: m } = vt(e, G(i[0]), G(i[1]), G(i[2]), G(i[3]));
395
+ let c = u.getUint32(f, r), { s0: h, s1: v, s2: g, s3: m } = dt(e, G(i[0]), G(i[1]), G(i[2]), G(i[3]));
560
396
  for (let S = 0; S + 4 <= o.length; S += 4)
561
- l[S + 0] = o[S + 0] ^ G(h), l[S + 1] = o[S + 1] ^ G(v), l[S + 2] = o[S + 2] ^ G(g), l[S + 3] = o[S + 3] ^ G(m), c = c + 1 >>> 0, u.setUint32(f, c, r), { s0: h, s1: v, s2: g, s3: m } = vt(e, G(i[0]), G(i[1]), G(i[2]), G(i[3]));
562
- const y = Mr * Math.floor(o.length / Ca);
397
+ l[S + 0] = o[S + 0] ^ G(h), l[S + 1] = o[S + 1] ^ G(v), l[S + 2] = o[S + 2] ^ G(g), l[S + 3] = o[S + 3] ^ G(m), c = c + 1 >>> 0, u.setUint32(f, c, r), { s0: h, s1: v, s2: g, s3: m } = dt(e, G(i[0]), G(i[1]), G(i[2]), G(i[3]));
398
+ const y = Br * Math.floor(o.length / ma);
563
399
  if (y < p) {
564
400
  const S = new Uint32Array([h, v, g, m]);
565
- Kr(S);
566
- const b = va(S);
401
+ Zr(S);
402
+ const b = ia(S);
567
403
  for (let O = y, C = 0; O < p; O++, C++)
568
404
  a[O] = n[O] ^ b[C];
569
405
  ye(S);
570
406
  }
571
407
  return a;
572
408
  }
573
- function Ia(e, r, t, n, a) {
409
+ function Fa(e, r, t, n, a) {
574
410
  const s = a ? a.length : 0, i = e.create(t, n.length + s);
575
411
  a && i.update(a);
576
- const u = Sa(8 * n.length, 8 * s, r);
412
+ const u = pa(8 * n.length, 8 * s, r);
577
413
  i.update(n), i.update(u);
578
414
  const o = i.digest();
579
415
  return ye(u), o;
580
416
  }
581
- const Cr = /* @__PURE__ */ xa({ blockSize: 16, nonceLength: 12, tagLength: 16, varSizeNonce: !0 }, function(r, t, n) {
417
+ const Fr = /* @__PURE__ */ fa({ blockSize: 16, nonceLength: 12, tagLength: 16, varSizeNonce: !0 }, function(r, t, n) {
582
418
  if (t.length < 8)
583
419
  throw new Error("aes/gcm: invalid nonce length");
584
420
  const a = 16;
585
421
  function s(u, o, l) {
586
- const f = Ia(ht, !1, u, l, n);
422
+ const f = Fa(pt, !1, u, l, n);
587
423
  for (let p = 0; p < o.length; p++)
588
424
  f[p] ^= o[p];
589
425
  return f;
590
426
  }
591
427
  function i() {
592
- const u = Da(r), o = Je.slice(), l = Je.slice();
428
+ const u = wa(r), o = Je.slice(), l = Je.slice();
593
429
  if (rr(u, !1, l, l, o), t.length === 12)
594
430
  l.set(t);
595
431
  else {
596
432
  const p = Je.slice();
597
433
  xr(p).setBigUint64(8, BigInt(t.length * 8), !1);
598
- const h = ht.create(o).update(t).update(p);
434
+ const h = pt.create(o).update(t).update(p);
599
435
  h.digestInto(l), h.destroy();
600
436
  }
601
437
  const f = rr(u, !1, l, Je);
@@ -604,22 +440,22 @@ const Cr = /* @__PURE__ */ xa({ blockSize: 16, nonceLength: 12, tagLength: 16, v
604
440
  return {
605
441
  encrypt(u) {
606
442
  const { xk: o, authKey: l, counter: f, tagMask: p } = i(), c = new Uint8Array(u.length + a), h = [o, l, f, p];
607
- Ne(u) || h.push(u = He(u)), rr(o, !1, f, u, c.subarray(0, u.length));
443
+ Me(u) || h.push(u = Ge(u)), rr(o, !1, f, u, c.subarray(0, u.length));
608
444
  const v = s(l, p, c.subarray(0, c.length - a));
609
445
  return h.push(v), c.set(v, u.length), ye(...h), c;
610
446
  },
611
447
  decrypt(u) {
612
448
  const { xk: o, authKey: l, counter: f, tagMask: p } = i(), c = [o, l, p, f];
613
- Ne(u) || c.push(u = He(u));
449
+ Me(u) || c.push(u = Ge(u));
614
450
  const h = u.subarray(0, -a), v = u.subarray(-a), g = s(l, p, h);
615
- if (c.push(g), !ma(g, v))
451
+ if (c.push(g), !ua(g, v))
616
452
  throw ye(...c), new Error("aes/gcm: invalid ghash tag");
617
453
  const m = rr(o, !1, f, h);
618
454
  return ye(...c), m;
619
455
  }
620
456
  };
621
457
  });
622
- class pr {
458
+ class fr {
623
459
  static MAGIC = new TextEncoder().encode("BIMGCM01");
624
460
  /**
625
461
  * 检测二进制数据是否为 .pzenc 加密格式
@@ -630,7 +466,7 @@ class pr {
630
466
  if (r.byteLength < 8) return !1;
631
467
  const t = new Uint8Array(r);
632
468
  for (let n = 0; n < 8; n++)
633
- if (t[n] !== pr.MAGIC[n]) return !1;
469
+ if (t[n] !== fr.MAGIC[n]) return !1;
634
470
  return !0;
635
471
  }
636
472
  /**
@@ -655,7 +491,7 @@ class pr {
655
491
  const s = n[8];
656
492
  if (s !== 1)
657
493
  throw new Error(`不支持的 pzenc 版本: ${s}`);
658
- const i = n[9], u = n[10], o = 11, l = n.slice(o, o + i), f = n.slice(o + i, o + i + u), p = n.slice(o + i + u), c = Ba(p, f), h = Pa(t);
494
+ const i = n[9], u = n[10], o = 11, l = n.slice(o, o + i), f = n.slice(o + i, o + i + u), p = n.slice(o + i + u), c = Ua(p, f), h = Ca(t);
659
495
  if (h.length !== 32)
660
496
  throw new Error("AES-256 密钥必须是 32 字节");
661
497
  const v = n.slice(0, o);
@@ -678,23 +514,23 @@ class pr {
678
514
  );
679
515
  return new Uint8Array(m);
680
516
  }
681
- return Ma(h, l, v, c, u);
517
+ return Ea(h, l, v, c, u);
682
518
  }
683
519
  }
684
- function Pa(e) {
520
+ function Ca(e) {
685
521
  const r = atob(e), t = new Uint8Array(r.length);
686
522
  for (let n = 0; n < r.length; n++)
687
523
  t[n] = r.codePointAt(n);
688
524
  return t;
689
525
  }
690
- function Ba(e, r) {
526
+ function Ua(e, r) {
691
527
  const t = new Uint8Array(e.length + r.length);
692
528
  return t.set(e, 0), t.set(r, e.length), t;
693
529
  }
694
- function Ma(e, r, t, n, a) {
695
- if (a !== Cr.tagLength)
696
- throw new Error(`当前 HTTP 回退解密仅支持 ${Cr.tagLength} 字节 AES-GCM tag,当前文件 tagLen: ${a}`);
697
- return Cr(e, r, t).decrypt(n);
530
+ function Ea(e, r, t, n, a) {
531
+ if (a !== Fr.tagLength)
532
+ throw new Error(`当前 HTTP 回退解密仅支持 ${Fr.tagLength} 字节 AES-GCM tag,当前文件 tagLen: ${a}`);
533
+ return Fr(e, r, t).decrypt(n);
698
534
  }
699
535
  function ol(e, r) {
700
536
  tn({
@@ -738,7 +574,7 @@ function ul(e, r, t, n) {
738
574
  url: e
739
575
  }).then(async (s) => {
740
576
  let i = s.data;
741
- n && pr.isEncrypted(s.data) && (i = await pr.decryptPzEnc(s.data, n)), rn.loadAsync(i).then((u) => {
577
+ n && fr.isEncrypted(s.data) && (i = await fr.decryptPzEnc(s.data, n)), rn.loadAsync(i).then((u) => {
742
578
  for (let o in u.files) {
743
579
  const l = u.file(u.files[o].name);
744
580
  l && l.async("blob").then((f) => {
@@ -796,14 +632,14 @@ String.prototype.codePointAt || (function() {
796
632
  writable: !0
797
633
  }) : String.prototype.codePointAt = r;
798
634
  })();
799
- var Qr = 0, on = -3;
800
- function ze() {
635
+ var jr = 0, on = -3;
636
+ function Ne() {
801
637
  this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
802
638
  }
803
- function Ga(e, r) {
804
- this.source = e, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = r, this.destLen = 0, this.ltree = new ze(), this.dtree = new ze();
639
+ function La(e, r) {
640
+ this.source = e, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = r, this.destLen = 0, this.ltree = new Ne(), this.dtree = new Ne();
805
641
  }
806
- var un = new ze(), ln = new ze(), $r = new Uint8Array(30), Jr = new Uint16Array(30), fn = new Uint8Array(30), cn = new Uint16Array(30), Na = new Uint8Array([
642
+ var un = new Ne(), ln = new Ne(), Qr = new Uint8Array(30), $r = new Uint16Array(30), fn = new Uint8Array(30), cn = new Uint16Array(30), Oa = new Uint8Array([
807
643
  16,
808
644
  17,
809
645
  18,
@@ -823,7 +659,7 @@ var un = new ze(), ln = new ze(), $r = new Uint8Array(30), Jr = new Uint16Array(
823
659
  14,
824
660
  1,
825
661
  15
826
- ]), gt = new ze(), ue = new Uint8Array(320);
662
+ ]), vt = new Ne(), ue = new Uint8Array(320);
827
663
  function pn(e, r, t, n) {
828
664
  var a, s;
829
665
  for (a = 0; a < t; ++a)
@@ -833,7 +669,7 @@ function pn(e, r, t, n) {
833
669
  for (s = n, a = 0; a < 30; ++a)
834
670
  r[a] = s, s += 1 << e[a];
835
671
  }
836
- function Ha(e, r) {
672
+ function Ra(e, r) {
837
673
  var t;
838
674
  for (t = 0; t < 7; ++t)
839
675
  e.table[t] = 0;
@@ -850,19 +686,19 @@ function Ha(e, r) {
850
686
  for (r.table[5] = 32, t = 0; t < 32; ++t)
851
687
  r.trans[t] = t;
852
688
  }
853
- var mt = new Uint16Array(16);
854
- function Ur(e, r, t, n) {
689
+ var gt = new Uint16Array(16);
690
+ function Cr(e, r, t, n) {
855
691
  var a, s;
856
692
  for (a = 0; a < 16; ++a)
857
693
  e.table[a] = 0;
858
694
  for (a = 0; a < n; ++a)
859
695
  e.table[r[t + a]]++;
860
696
  for (e.table[0] = 0, s = 0, a = 0; a < 16; ++a)
861
- mt[a] = s, s += e.table[a];
697
+ gt[a] = s, s += e.table[a];
862
698
  for (a = 0; a < n; ++a)
863
- r[t + a] && (e.trans[mt[r[t + a]]++] = a);
699
+ r[t + a] && (e.trans[gt[r[t + a]]++] = a);
864
700
  }
865
- function za(e) {
701
+ function Aa(e) {
866
702
  e.bitcount-- || (e.tag = e.source[e.sourceIndex++], e.bitcount = 7);
867
703
  var r = e.tag & 1;
868
704
  return e.tag >>>= 1, r;
@@ -875,7 +711,7 @@ function le(e, r, t) {
875
711
  var n = e.tag & 65535 >>> 16 - r;
876
712
  return e.tag >>>= r, e.bitcount -= r, n + t;
877
713
  }
878
- function Gr(e, r) {
714
+ function Mr(e, r) {
879
715
  for (; e.bitcount < 24; )
880
716
  e.tag |= e.source[e.sourceIndex++] << e.bitcount, e.bitcount += 8;
881
717
  var t = 0, n = 0, a = 0, s = e.tag;
@@ -884,16 +720,16 @@ function Gr(e, r) {
884
720
  while (n >= 0);
885
721
  return e.tag = s, e.bitcount -= a, r.trans[t + n];
886
722
  }
887
- function Wa(e, r, t) {
723
+ function Da(e, r, t) {
888
724
  var n, a, s, i, u, o;
889
725
  for (n = le(e, 5, 257), a = le(e, 5, 1), s = le(e, 4, 4), i = 0; i < 19; ++i)
890
726
  ue[i] = 0;
891
727
  for (i = 0; i < s; ++i) {
892
728
  var l = le(e, 3, 0);
893
- ue[Na[i]] = l;
729
+ ue[Oa[i]] = l;
894
730
  }
895
- for (Ur(gt, ue, 0, 19), u = 0; u < n + a; ) {
896
- var f = Gr(e, gt);
731
+ for (Cr(vt, ue, 0, 19), u = 0; u < n + a; ) {
732
+ var f = Mr(e, vt);
897
733
  switch (f) {
898
734
  case 16:
899
735
  var p = ue[u - 1];
@@ -913,58 +749,58 @@ function Wa(e, r, t) {
913
749
  break;
914
750
  }
915
751
  }
916
- Ur(r, ue, 0, n), Ur(t, ue, n, a);
752
+ Cr(r, ue, 0, n), Cr(t, ue, n, a);
917
753
  }
918
- function yt(e, r, t) {
754
+ function mt(e, r, t) {
919
755
  for (; ; ) {
920
- var n = Gr(e, r);
756
+ var n = Mr(e, r);
921
757
  if (n === 256)
922
- return Qr;
758
+ return jr;
923
759
  if (n < 256)
924
760
  e.dest[e.destLen++] = n;
925
761
  else {
926
762
  var a, s, i, u;
927
- for (n -= 257, a = le(e, $r[n], Jr[n]), s = Gr(e, t), i = e.destLen - le(e, fn[s], cn[s]), u = i; u < i + a; ++u)
763
+ for (n -= 257, a = le(e, Qr[n], $r[n]), s = Mr(e, t), i = e.destLen - le(e, fn[s], cn[s]), u = i; u < i + a; ++u)
928
764
  e.dest[e.destLen++] = e.dest[u];
929
765
  }
930
766
  }
931
767
  }
932
- function _a(e) {
768
+ function Ia(e) {
933
769
  for (var r, t, n; e.bitcount > 8; )
934
770
  e.sourceIndex--, e.bitcount -= 8;
935
771
  if (r = e.source[e.sourceIndex + 1], r = 256 * r + e.source[e.sourceIndex], t = e.source[e.sourceIndex + 3], t = 256 * t + e.source[e.sourceIndex + 2], r !== (~t & 65535))
936
772
  return on;
937
773
  for (e.sourceIndex += 4, n = r; n; --n)
938
774
  e.dest[e.destLen++] = e.source[e.sourceIndex++];
939
- return e.bitcount = 0, Qr;
775
+ return e.bitcount = 0, jr;
940
776
  }
941
- function Va(e, r) {
942
- var t = new Ga(e, r), n, a, s;
777
+ function Pa(e, r) {
778
+ var t = new La(e, r), n, a, s;
943
779
  do {
944
- switch (n = za(t), a = le(t, 2, 0), a) {
780
+ switch (n = Aa(t), a = le(t, 2, 0), a) {
945
781
  case 0:
946
- s = _a(t);
782
+ s = Ia(t);
947
783
  break;
948
784
  case 1:
949
- s = yt(t, un, ln);
785
+ s = mt(t, un, ln);
950
786
  break;
951
787
  case 2:
952
- Wa(t, t.ltree, t.dtree), s = yt(t, t.ltree, t.dtree);
788
+ Da(t, t.ltree, t.dtree), s = mt(t, t.ltree, t.dtree);
953
789
  break;
954
790
  default:
955
791
  s = on;
956
792
  }
957
- if (s !== Qr)
793
+ if (s !== jr)
958
794
  throw new Error("Data error");
959
795
  } while (!n);
960
796
  return t.destLen < t.dest.length ? typeof t.dest.slice == "function" ? t.dest.slice(0, t.destLen) : t.dest.subarray(0, t.destLen) : t.dest;
961
797
  }
962
- Ha(un, ln);
963
- pn($r, Jr, 4, 3);
798
+ Ra(un, ln);
799
+ pn(Qr, $r, 4, 3);
964
800
  pn(fn, cn, 2, 1);
965
- $r[28] = 0;
966
- Jr[28] = 258;
967
- var qa = Va;
801
+ Qr[28] = 0;
802
+ $r[28] = 258;
803
+ var Ba = Pa;
968
804
  function Ee(e, r, t, n, a) {
969
805
  return Math.pow(1 - a, 3) * e + 3 * Math.pow(1 - a, 2) * a * r + 3 * (1 - a) * Math.pow(a, 2) * t + Math.pow(a, 3) * n;
970
806
  }
@@ -1122,10 +958,10 @@ N.prototype.toDOMElement = function(e) {
1122
958
  function hn(e) {
1123
959
  throw new Error(e);
1124
960
  }
1125
- function xt(e, r) {
961
+ function yt(e, r) {
1126
962
  e || hn(r);
1127
963
  }
1128
- var U = { fail: hn, argument: xt, assert: xt }, bt = 32768, St = 2147483648, Oe = {}, x = {}, E = {};
964
+ var U = { fail: hn, argument: yt, assert: yt }, xt = 32768, bt = 2147483648, Oe = {}, x = {}, E = {};
1129
965
  function ie(e) {
1130
966
  return function() {
1131
967
  return e;
@@ -1153,7 +989,7 @@ x.USHORT = function(e) {
1153
989
  };
1154
990
  E.USHORT = ie(2);
1155
991
  x.SHORT = function(e) {
1156
- return e >= bt && (e = -(2 * bt - e)), [e >> 8 & 255, e & 255];
992
+ return e >= xt && (e = -(2 * xt - e)), [e >> 8 & 255, e & 255];
1157
993
  };
1158
994
  E.SHORT = ie(2);
1159
995
  x.UINT24 = function(e) {
@@ -1165,7 +1001,7 @@ x.ULONG = function(e) {
1165
1001
  };
1166
1002
  E.ULONG = ie(4);
1167
1003
  x.LONG = function(e) {
1168
- return e >= St && (e = -(2 * St - e)), [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
1004
+ return e >= bt && (e = -(2 * bt - e)), [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
1169
1005
  };
1170
1006
  E.LONG = ie(4);
1171
1007
  x.FIXED = x.ULONG;
@@ -1251,7 +1087,7 @@ x.UTF16 = function(e) {
1251
1087
  E.UTF16 = function(e) {
1252
1088
  return e.length * 2;
1253
1089
  };
1254
- var Nr = {
1090
+ var Gr = {
1255
1091
  "x-mac-croatian": (
1256
1092
  // Python: 'mac_croatian'
1257
1093
  "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
@@ -1294,7 +1130,7 @@ var Nr = {
1294
1130
  )
1295
1131
  };
1296
1132
  Oe.MACSTRING = function(e, r, t, n) {
1297
- var a = Nr[n];
1133
+ var a = Gr[n];
1298
1134
  if (a !== void 0) {
1299
1135
  for (var s = "", i = 0; i < t; i++) {
1300
1136
  var u = e.getUint8(r + i);
@@ -1303,10 +1139,10 @@ Oe.MACSTRING = function(e, r, t, n) {
1303
1139
  return s;
1304
1140
  }
1305
1141
  };
1306
- var tr = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), nr, Xa = function(e) {
1142
+ var tr = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), nr, Ma = function(e) {
1307
1143
  if (!nr) {
1308
1144
  nr = {};
1309
- for (var r in Nr)
1145
+ for (var r in Gr)
1310
1146
  nr[r] = new String(r);
1311
1147
  }
1312
1148
  var t = nr[e];
@@ -1316,7 +1152,7 @@ var tr = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), nr, Xa =
1316
1152
  if (n !== void 0)
1317
1153
  return n;
1318
1154
  }
1319
- var a = Nr[e];
1155
+ var a = Gr[e];
1320
1156
  if (a !== void 0) {
1321
1157
  for (var s = {}, i = 0; i < a.length; i++)
1322
1158
  s[a.charCodeAt(i)] = i + 128;
@@ -1325,7 +1161,7 @@ var tr = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), nr, Xa =
1325
1161
  }
1326
1162
  };
1327
1163
  x.MACSTRING = function(e, r) {
1328
- var t = Xa(r);
1164
+ var t = Ma(r);
1329
1165
  if (t !== void 0) {
1330
1166
  for (var n = [], a = 0; a < e.length; a++) {
1331
1167
  var s = e.charCodeAt(a);
@@ -1340,18 +1176,18 @@ E.MACSTRING = function(e, r) {
1340
1176
  var t = x.MACSTRING(e, r);
1341
1177
  return t !== void 0 ? t.length : 0;
1342
1178
  };
1343
- function Hr(e) {
1179
+ function Nr(e) {
1344
1180
  return e >= -128 && e <= 127;
1345
1181
  }
1346
- function Ya(e, r, t) {
1182
+ function Ga(e, r, t) {
1347
1183
  for (var n = 0, a = e.length; r < a && n < 64 && e[r] === 0; )
1348
1184
  ++r, ++n;
1349
1185
  return t.push(128 | n - 1), r;
1350
1186
  }
1351
- function Za(e, r, t) {
1187
+ function Na(e, r, t) {
1352
1188
  for (var n = 0, a = e.length, s = r; s < a && n < 64; ) {
1353
1189
  var i = e[s];
1354
- if (!Hr(i) || i === 0 && s + 1 < a && e[s + 1] === 0)
1190
+ if (!Nr(i) || i === 0 && s + 1 < a && e[s + 1] === 0)
1355
1191
  break;
1356
1192
  ++s, ++n;
1357
1193
  }
@@ -1360,10 +1196,10 @@ function Za(e, r, t) {
1360
1196
  t.push(e[u] + 256 & 255);
1361
1197
  return s;
1362
1198
  }
1363
- function Ka(e, r, t) {
1199
+ function Ha(e, r, t) {
1364
1200
  for (var n = 0, a = e.length, s = r; s < a && n < 64; ) {
1365
1201
  var i = e[s];
1366
- if (i === 0 || Hr(i) && s + 1 < a && Hr(e[s + 1]))
1202
+ if (i === 0 || Nr(i) && s + 1 < a && Nr(e[s + 1]))
1367
1203
  break;
1368
1204
  ++s, ++n;
1369
1205
  }
@@ -1377,7 +1213,7 @@ function Ka(e, r, t) {
1377
1213
  x.VARDELTAS = function(e) {
1378
1214
  for (var r = 0, t = []; r < e.length; ) {
1379
1215
  var n = e[r];
1380
- n === 0 ? r = Ya(e, r, t) : n >= -128 && n <= 127 ? r = Za(e, r, t) : r = Ka(e, r, t);
1216
+ n === 0 ? r = Ga(e, r, t) : n >= -128 && n <= 127 ? r = Na(e, r, t) : r = Ha(e, r, t);
1381
1217
  }
1382
1218
  return t;
1383
1219
  };
@@ -1508,7 +1344,7 @@ W.prototype.encode = function() {
1508
1344
  W.prototype.sizeOf = function() {
1509
1345
  return E.TABLE(this);
1510
1346
  };
1511
- function We(e, r, t) {
1347
+ function He(e, r, t) {
1512
1348
  t === void 0 && (t = r.length);
1513
1349
  var n = new Array(r.length + 1);
1514
1350
  n[0] = { name: e + "Count", type: "USHORT", value: t };
@@ -1516,29 +1352,29 @@ function We(e, r, t) {
1516
1352
  n[a + 1] = { name: e + a, type: "USHORT", value: r[a] };
1517
1353
  return n;
1518
1354
  }
1519
- function zr(e, r, t) {
1355
+ function Hr(e, r, t) {
1520
1356
  var n = r.length, a = new Array(n + 1);
1521
1357
  a[0] = { name: e + "Count", type: "USHORT", value: n };
1522
1358
  for (var s = 0; s < n; s++)
1523
1359
  a[s + 1] = { name: e + s, type: "TABLE", value: t(r[s], s) };
1524
1360
  return a;
1525
1361
  }
1526
- function _e(e, r, t) {
1362
+ function ze(e, r, t) {
1527
1363
  var n = r.length, a = [];
1528
1364
  a[0] = { name: e + "Count", type: "USHORT", value: n };
1529
1365
  for (var s = 0; s < n; s++)
1530
1366
  a = a.concat(t(r[s], s));
1531
1367
  return a;
1532
1368
  }
1533
- function hr(e) {
1369
+ function cr(e) {
1534
1370
  e.format === 1 ? W.call(
1535
1371
  this,
1536
1372
  "coverageTable",
1537
- [{ name: "coverageFormat", type: "USHORT", value: 1 }].concat(We("glyph", e.glyphs))
1373
+ [{ name: "coverageFormat", type: "USHORT", value: 1 }].concat(He("glyph", e.glyphs))
1538
1374
  ) : e.format === 2 ? W.call(
1539
1375
  this,
1540
1376
  "coverageTable",
1541
- [{ name: "coverageFormat", type: "USHORT", value: 2 }].concat(_e("rangeRecord", e.ranges, function(r) {
1377
+ [{ name: "coverageFormat", type: "USHORT", value: 2 }].concat(ze("rangeRecord", e.ranges, function(r) {
1542
1378
  return [
1543
1379
  { name: "startGlyphID", type: "USHORT", value: r.start },
1544
1380
  { name: "endGlyphID", type: "USHORT", value: r.end },
@@ -1547,13 +1383,13 @@ function hr(e) {
1547
1383
  }))
1548
1384
  ) : U.assert(!1, "Coverage format must be 1 or 2.");
1549
1385
  }
1550
- hr.prototype = Object.create(W.prototype);
1551
- hr.prototype.constructor = hr;
1552
- function dr(e) {
1386
+ cr.prototype = Object.create(W.prototype);
1387
+ cr.prototype.constructor = cr;
1388
+ function pr(e) {
1553
1389
  W.call(
1554
1390
  this,
1555
1391
  "scriptListTable",
1556
- _e("scriptRecord", e, function(r, t) {
1392
+ ze("scriptRecord", e, function(r, t) {
1557
1393
  var n = r.script, a = n.defaultLangSys;
1558
1394
  return U.assert(!!a, "Unable to write GSUB: script " + r.tag + " has no default language system."), [
1559
1395
  { name: "scriptTag" + t, type: "TAG", value: r.tag },
@@ -1561,99 +1397,99 @@ function dr(e) {
1561
1397
  { name: "defaultLangSys", type: "TABLE", value: new W("defaultLangSys", [
1562
1398
  { name: "lookupOrder", type: "USHORT", value: 0 },
1563
1399
  { name: "reqFeatureIndex", type: "USHORT", value: a.reqFeatureIndex }
1564
- ].concat(We("featureIndex", a.featureIndexes))) }
1565
- ].concat(_e("langSys", n.langSysRecords, function(s, i) {
1400
+ ].concat(He("featureIndex", a.featureIndexes))) }
1401
+ ].concat(ze("langSys", n.langSysRecords, function(s, i) {
1566
1402
  var u = s.langSys;
1567
1403
  return [
1568
1404
  { name: "langSysTag" + i, type: "TAG", value: s.tag },
1569
1405
  { name: "langSys" + i, type: "TABLE", value: new W("langSys", [
1570
1406
  { name: "lookupOrder", type: "USHORT", value: 0 },
1571
1407
  { name: "reqFeatureIndex", type: "USHORT", value: u.reqFeatureIndex }
1572
- ].concat(We("featureIndex", u.featureIndexes))) }
1408
+ ].concat(He("featureIndex", u.featureIndexes))) }
1573
1409
  ];
1574
1410
  }))) }
1575
1411
  ];
1576
1412
  })
1577
1413
  );
1578
1414
  }
1579
- dr.prototype = Object.create(W.prototype);
1580
- dr.prototype.constructor = dr;
1581
- function vr(e) {
1415
+ pr.prototype = Object.create(W.prototype);
1416
+ pr.prototype.constructor = pr;
1417
+ function hr(e) {
1582
1418
  W.call(
1583
1419
  this,
1584
1420
  "featureListTable",
1585
- _e("featureRecord", e, function(r, t) {
1421
+ ze("featureRecord", e, function(r, t) {
1586
1422
  var n = r.feature;
1587
1423
  return [
1588
1424
  { name: "featureTag" + t, type: "TAG", value: r.tag },
1589
1425
  { name: "feature" + t, type: "TABLE", value: new W("featureTable", [
1590
1426
  { name: "featureParams", type: "USHORT", value: n.featureParams }
1591
- ].concat(We("lookupListIndex", n.lookupListIndexes))) }
1427
+ ].concat(He("lookupListIndex", n.lookupListIndexes))) }
1592
1428
  ];
1593
1429
  })
1594
1430
  );
1595
1431
  }
1596
- vr.prototype = Object.create(W.prototype);
1597
- vr.prototype.constructor = vr;
1598
- function gr(e, r) {
1599
- W.call(this, "lookupListTable", zr("lookup", e, function(t) {
1432
+ hr.prototype = Object.create(W.prototype);
1433
+ hr.prototype.constructor = hr;
1434
+ function dr(e, r) {
1435
+ W.call(this, "lookupListTable", Hr("lookup", e, function(t) {
1600
1436
  var n = r[t.lookupType];
1601
1437
  return U.assert(!!n, "Unable to write GSUB lookup type " + t.lookupType + " tables."), new W("lookupTable", [
1602
1438
  { name: "lookupType", type: "USHORT", value: t.lookupType },
1603
1439
  { name: "lookupFlag", type: "USHORT", value: t.lookupFlag }
1604
- ].concat(zr("subtable", t.subtables, n)));
1440
+ ].concat(Hr("subtable", t.subtables, n)));
1605
1441
  }));
1606
1442
  }
1607
- gr.prototype = Object.create(W.prototype);
1608
- gr.prototype.constructor = gr;
1443
+ dr.prototype = Object.create(W.prototype);
1444
+ dr.prototype.constructor = dr;
1609
1445
  var k = {
1610
1446
  Table: W,
1611
1447
  Record: W,
1612
- Coverage: hr,
1613
- ScriptList: dr,
1614
- FeatureList: vr,
1615
- LookupList: gr,
1616
- ushortList: We,
1617
- tableList: zr,
1618
- recordList: _e
1619
- };
1620
- function kt(e, r) {
1448
+ Coverage: cr,
1449
+ ScriptList: pr,
1450
+ FeatureList: hr,
1451
+ LookupList: dr,
1452
+ ushortList: He,
1453
+ tableList: Hr,
1454
+ recordList: ze
1455
+ };
1456
+ function St(e, r) {
1621
1457
  return e.getUint8(r);
1622
1458
  }
1623
- function mr(e, r) {
1459
+ function vr(e, r) {
1624
1460
  return e.getUint16(r, !1);
1625
1461
  }
1626
- function ja(e, r) {
1462
+ function za(e, r) {
1627
1463
  return e.getInt16(r, !1);
1628
1464
  }
1629
- function et(e, r) {
1465
+ function Jr(e, r) {
1630
1466
  return e.getUint32(r, !1);
1631
1467
  }
1632
1468
  function dn(e, r) {
1633
1469
  var t = e.getInt16(r, !1), n = e.getUint16(r + 2, !1);
1634
1470
  return t + n / 65535;
1635
1471
  }
1636
- function Qa(e, r) {
1472
+ function Wa(e, r) {
1637
1473
  for (var t = "", n = r; n < r + 4; n += 1)
1638
1474
  t += String.fromCharCode(e.getInt8(n));
1639
1475
  return t;
1640
1476
  }
1641
- function $a(e, r, t) {
1477
+ function _a(e, r, t) {
1642
1478
  for (var n = 0, a = 0; a < t; a += 1)
1643
1479
  n <<= 8, n += e.getUint8(r + a);
1644
1480
  return n;
1645
1481
  }
1646
- function Ja(e, r, t) {
1482
+ function Va(e, r, t) {
1647
1483
  for (var n = [], a = r; a < t; a += 1)
1648
1484
  n.push(e.getUint8(a));
1649
1485
  return n;
1650
1486
  }
1651
- function es(e) {
1487
+ function qa(e) {
1652
1488
  for (var r = "", t = 0; t < e.length; t += 1)
1653
1489
  r += String.fromCharCode(e[t]);
1654
1490
  return r;
1655
1491
  }
1656
- var rs = {
1492
+ var Xa = {
1657
1493
  byte: 1,
1658
1494
  uShort: 2,
1659
1495
  short: 2,
@@ -1690,7 +1526,7 @@ d.prototype.parseF2Dot14 = function() {
1690
1526
  return this.relativeOffset += 2, e;
1691
1527
  };
1692
1528
  d.prototype.parseULong = function() {
1693
- var e = et(this.data, this.offset + this.relativeOffset);
1529
+ var e = Jr(this.data, this.offset + this.relativeOffset);
1694
1530
  return this.relativeOffset += 4, e;
1695
1531
  };
1696
1532
  d.prototype.parseOffset32 = d.prototype.parseULong;
@@ -1709,15 +1545,15 @@ d.prototype.parseTag = function() {
1709
1545
  return this.parseString(4);
1710
1546
  };
1711
1547
  d.prototype.parseLongDateTime = function() {
1712
- var e = et(this.data, this.offset + this.relativeOffset + 4);
1548
+ var e = Jr(this.data, this.offset + this.relativeOffset + 4);
1713
1549
  return e -= 2082844800, this.relativeOffset += 8, e;
1714
1550
  };
1715
1551
  d.prototype.parseVersion = function(e) {
1716
- var r = mr(this.data, this.offset + this.relativeOffset), t = mr(this.data, this.offset + this.relativeOffset + 2);
1552
+ var r = vr(this.data, this.offset + this.relativeOffset), t = vr(this.data, this.offset + this.relativeOffset + 2);
1717
1553
  return this.relativeOffset += 4, e === void 0 && (e = 4096), r + t / e / 10;
1718
1554
  };
1719
1555
  d.prototype.skip = function(e, r) {
1720
- r === void 0 && (r = 1), this.relativeOffset += rs[e] * r;
1556
+ r === void 0 && (r = 1), this.relativeOffset += Xa[e] * r;
1721
1557
  };
1722
1558
  d.prototype.parseULongList = function(e) {
1723
1559
  e === void 0 && (e = this.parseULong());
@@ -1900,7 +1736,7 @@ d.uLongList = d.prototype.parseULongList;
1900
1736
  d.struct = d.prototype.parseStruct;
1901
1737
  d.coverage = d.prototype.parseCoverage;
1902
1738
  d.classDef = d.prototype.parseClassDef;
1903
- var Tt = {
1739
+ var kt = {
1904
1740
  reserved: d.uShort,
1905
1741
  reqFeatureIndex: d.uShort,
1906
1742
  featureIndexes: d.uShortList
@@ -1909,10 +1745,10 @@ d.prototype.parseScriptList = function() {
1909
1745
  return this.parsePointer(d.recordList({
1910
1746
  tag: d.tag,
1911
1747
  script: d.pointer({
1912
- defaultLangSys: d.pointer(Tt),
1748
+ defaultLangSys: d.pointer(kt),
1913
1749
  langSysRecords: d.recordList({
1914
1750
  tag: d.tag,
1915
- langSys: d.pointer(Tt)
1751
+ langSys: d.pointer(kt)
1916
1752
  })
1917
1753
  })
1918
1754
  })) || [];
@@ -1951,20 +1787,20 @@ d.prototype.parseFeatureVariationsList = function() {
1951
1787
  }) || [];
1952
1788
  };
1953
1789
  var w = {
1954
- getByte: kt,
1955
- getCard8: kt,
1956
- getUShort: mr,
1957
- getCard16: mr,
1958
- getShort: ja,
1959
- getULong: et,
1790
+ getByte: St,
1791
+ getCard8: St,
1792
+ getUShort: vr,
1793
+ getCard16: vr,
1794
+ getShort: za,
1795
+ getULong: Jr,
1960
1796
  getFixed: dn,
1961
- getTag: Qa,
1962
- getOffset: $a,
1963
- getBytes: Ja,
1964
- bytesToString: es,
1797
+ getTag: Wa,
1798
+ getOffset: _a,
1799
+ getBytes: Va,
1800
+ bytesToString: qa,
1965
1801
  Parser: d
1966
1802
  };
1967
- function ts(e, r) {
1803
+ function Ya(e, r) {
1968
1804
  r.parseUShort(), e.length = r.parseULong(), e.language = r.parseULong();
1969
1805
  var t;
1970
1806
  e.groupCount = t = r.parseULong(), e.glyphIndexMap = {};
@@ -1972,7 +1808,7 @@ function ts(e, r) {
1972
1808
  for (var a = r.parseULong(), s = r.parseULong(), i = r.parseULong(), u = a; u <= s; u += 1)
1973
1809
  e.glyphIndexMap[u] = i, i++;
1974
1810
  }
1975
- function ns(e, r, t, n, a) {
1811
+ function Za(e, r, t, n, a) {
1976
1812
  e.length = r.parseUShort(), e.language = r.parseUShort();
1977
1813
  var s;
1978
1814
  e.segCount = s = r.parseUShort() >> 1, r.skip("uShort", 3), e.glyphIndexMap = {};
@@ -1980,7 +1816,7 @@ function ns(e, r, t, n, a) {
1980
1816
  for (var c = void 0, h = i.parseUShort(), v = u.parseUShort(), g = o.parseShort(), m = l.parseUShort(), y = v; y <= h; y += 1)
1981
1817
  m !== 0 ? (f = l.offset + l.relativeOffset - 2, f += m, f += (y - v) * 2, c = w.getUShort(t, f), c !== 0 && (c = c + g & 65535)) : c = y + g & 65535, e.glyphIndexMap[y] = c;
1982
1818
  }
1983
- function as(e, r) {
1819
+ function Ka(e, r) {
1984
1820
  var t = {};
1985
1821
  t.version = w.getUShort(e, r), U.argument(t.version === 0, "cmap table version should be 0."), t.numTables = w.getUShort(e, r + 2);
1986
1822
  for (var n = -1, a = t.numTables - 1; a >= 0; a -= 1) {
@@ -1994,14 +1830,14 @@ function as(e, r) {
1994
1830
  throw new Error("No valid cmap sub-tables found.");
1995
1831
  var u = new w.Parser(e, r + n);
1996
1832
  if (t.format = u.parseUShort(), t.format === 12)
1997
- ts(t, u);
1833
+ Ya(t, u);
1998
1834
  else if (t.format === 4)
1999
- ns(t, u, e, r, n);
1835
+ Za(t, u, e, r, n);
2000
1836
  else
2001
1837
  throw new Error("Only format 4 and 12 cmap tables are supported (found format " + t.format + ").");
2002
1838
  return t;
2003
1839
  }
2004
- function ss(e, r, t) {
1840
+ function ja(e, r, t) {
2005
1841
  e.segments.push({
2006
1842
  end: r,
2007
1843
  start: r,
@@ -2010,7 +1846,7 @@ function ss(e, r, t) {
2010
1846
  glyphIndex: t
2011
1847
  });
2012
1848
  }
2013
- function is(e) {
1849
+ function Qa(e) {
2014
1850
  e.segments.push({
2015
1851
  end: 65535,
2016
1852
  start: 65535,
@@ -2018,7 +1854,7 @@ function is(e) {
2018
1854
  offset: 0
2019
1855
  });
2020
1856
  }
2021
- function os(e) {
1857
+ function $a(e) {
2022
1858
  var r = !0, t;
2023
1859
  for (t = e.length - 1; t > 0; t -= 1) {
2024
1860
  var n = e.get(t);
@@ -2054,12 +1890,12 @@ function os(e) {
2054
1890
  var s = new k.Table("cmap", a);
2055
1891
  for (s.segments = [], t = 0; t < e.length; t += 1) {
2056
1892
  for (var i = e.get(t), u = 0; u < i.unicodes.length; u += 1)
2057
- ss(s, i.unicodes[u], t);
1893
+ ja(s, i.unicodes[u], t);
2058
1894
  s.segments = s.segments.sort(function(S, b) {
2059
1895
  return S.start - b.start;
2060
1896
  });
2061
1897
  }
2062
- is(s);
1898
+ Qa(s);
2063
1899
  var o = s.segments.length, l = 0, f = [], p = [], c = [], h = [], v = [], g = [];
2064
1900
  for (t = 0; t < o; t += 1) {
2065
1901
  var m = s.segments[t];
@@ -2080,7 +1916,7 @@ function os(e) {
2080
1916
  }
2081
1917
  return s;
2082
1918
  }
2083
- var vn = { parse: as, make: os }, or = [
1919
+ var vn = { parse: Ka, make: $a }, or = [
2084
1920
  ".notdef",
2085
1921
  "space",
2086
1922
  "exclam",
@@ -2472,7 +2308,7 @@ var vn = { parse: as, make: os }, or = [
2472
2308
  "Regular",
2473
2309
  "Roman",
2474
2310
  "Semibold"
2475
- ], us = [
2311
+ ], Ja = [
2476
2312
  "",
2477
2313
  "",
2478
2314
  "",
@@ -2725,7 +2561,7 @@ var vn = { parse: as, make: os }, or = [
2725
2561
  "oslash",
2726
2562
  "oe",
2727
2563
  "germandbls"
2728
- ], ls = [
2564
+ ], es = [
2729
2565
  "",
2730
2566
  "",
2731
2567
  "",
@@ -3260,14 +3096,14 @@ function mn(e) {
3260
3096
  mn.prototype.charToGlyphIndex = function(e) {
3261
3097
  return this.cmap.glyphIndexMap[e.codePointAt(0)] || 0;
3262
3098
  };
3263
- function yr(e, r) {
3099
+ function gr(e, r) {
3264
3100
  this.encoding = e, this.charset = r;
3265
3101
  }
3266
- yr.prototype.charToGlyphIndex = function(e) {
3102
+ gr.prototype.charToGlyphIndex = function(e) {
3267
3103
  var r = e.codePointAt(0), t = this.encoding[r];
3268
3104
  return this.charset.indexOf(t);
3269
3105
  };
3270
- function rt(e) {
3106
+ function et(e) {
3271
3107
  switch (e.version) {
3272
3108
  case 1:
3273
3109
  this.names = Te.slice();
@@ -3290,13 +3126,13 @@ function rt(e) {
3290
3126
  break;
3291
3127
  }
3292
3128
  }
3293
- rt.prototype.nameToGlyphIndex = function(e) {
3129
+ et.prototype.nameToGlyphIndex = function(e) {
3294
3130
  return this.names.indexOf(e);
3295
3131
  };
3296
- rt.prototype.glyphIndexToName = function(e) {
3132
+ et.prototype.glyphIndexToName = function(e) {
3297
3133
  return this.names[e];
3298
3134
  };
3299
- function fs(e) {
3135
+ function rs(e) {
3300
3136
  for (var r, t = e.tables.cmap.glyphIndexMap, n = Object.keys(t), a = 0; a < n.length; a += 1) {
3301
3137
  var s = n[a], i = t[s];
3302
3138
  r = e.glyphs.get(i), r.addUnicode(parseInt(s));
@@ -3304,7 +3140,7 @@ function fs(e) {
3304
3140
  for (var u = 0; u < e.glyphs.length; u += 1)
3305
3141
  r = e.glyphs.get(u), e.cffEncoding ? e.isCIDFont ? r.name = "gid" + u : r.name = e.cffEncoding.charset[u] : e.glyphNames.names && (r.name = e.glyphNames.glyphIndexToName(u));
3306
3142
  }
3307
- function cs(e) {
3143
+ function ts(e) {
3308
3144
  e._IndexToUnicodeMap = {};
3309
3145
  for (var r = e.tables.cmap.glyphIndexMap, t = Object.keys(r), n = 0; n < t.length; n += 1) {
3310
3146
  var a = t[n], s = r[a];
@@ -3313,14 +3149,14 @@ function cs(e) {
3313
3149
  } : e._IndexToUnicodeMap[s].unicodes.push(parseInt(a));
3314
3150
  }
3315
3151
  }
3316
- function ps(e, r) {
3317
- r.lowMemory ? cs(e) : fs(e);
3152
+ function ns(e, r) {
3153
+ r.lowMemory ? ts(e) : rs(e);
3318
3154
  }
3319
- function hs(e, r, t, n, a) {
3155
+ function as(e, r, t, n, a) {
3320
3156
  e.beginPath(), e.moveTo(r, t), e.lineTo(n, a), e.stroke();
3321
3157
  }
3322
- var ke = { line: hs };
3323
- function ds(e, r) {
3158
+ var ke = { line: as };
3159
+ function ss(e, r) {
3324
3160
  var t = r || new N();
3325
3161
  return {
3326
3162
  configurable: !0,
@@ -3336,7 +3172,7 @@ function te(e) {
3336
3172
  this.bindConstructorValues(e);
3337
3173
  }
3338
3174
  te.prototype.bindConstructorValues = function(e) {
3339
- this.index = e.index || 0, this.name = e.name || null, this.unicode = e.unicode || void 0, this.unicodes = e.unicodes || e.unicode !== void 0 ? [e.unicode] : [], "xMin" in e && (this.xMin = e.xMin), "yMin" in e && (this.yMin = e.yMin), "xMax" in e && (this.xMax = e.xMax), "yMax" in e && (this.yMax = e.yMax), "advanceWidth" in e && (this.advanceWidth = e.advanceWidth), Object.defineProperty(this, "path", ds(this, e.path));
3175
+ this.index = e.index || 0, this.name = e.name || null, this.unicode = e.unicode || void 0, this.unicodes = e.unicodes || e.unicode !== void 0 ? [e.unicode] : [], "xMin" in e && (this.xMin = e.xMin), "yMin" in e && (this.yMin = e.yMin), "xMax" in e && (this.xMax = e.xMax), "yMax" in e && (this.yMax = e.yMax), "advanceWidth" in e && (this.advanceWidth = e.advanceWidth), Object.defineProperty(this, "path", ss(this, e.path));
3340
3176
  };
3341
3177
  te.prototype.addUnicode = function(e) {
3342
3178
  this.unicodes.length === 0 && (this.unicode = e), this.unicodes.push(e);
@@ -3432,7 +3268,7 @@ function sr(e, r, t) {
3432
3268
  configurable: !0
3433
3269
  });
3434
3270
  }
3435
- function tt(e, r) {
3271
+ function rt(e, r) {
3436
3272
  if (this.font = e, this.glyphs = {}, Array.isArray(r))
3437
3273
  for (var t = 0; t < r.length; t++) {
3438
3274
  var n = r[t];
@@ -3440,7 +3276,7 @@ function tt(e, r) {
3440
3276
  }
3441
3277
  this.length = r && r.length || 0;
3442
3278
  }
3443
- tt.prototype.get = function(e) {
3279
+ rt.prototype.get = function(e) {
3444
3280
  if (this.glyphs[e] === void 0) {
3445
3281
  this.font._push(e), typeof this.glyphs[e] == "function" && (this.glyphs[e] = this.glyphs[e]());
3446
3282
  var r = this.glyphs[e], t = this.font._IndexToUnicodeMap[e];
@@ -3452,13 +3288,13 @@ tt.prototype.get = function(e) {
3452
3288
  typeof this.glyphs[e] == "function" && (this.glyphs[e] = this.glyphs[e]());
3453
3289
  return this.glyphs[e];
3454
3290
  };
3455
- tt.prototype.push = function(e, r) {
3291
+ rt.prototype.push = function(e, r) {
3456
3292
  this.glyphs[e] = r, this.length++;
3457
3293
  };
3458
- function vs(e, r) {
3294
+ function is(e, r) {
3459
3295
  return new te({ index: r, font: e });
3460
3296
  }
3461
- function gs(e, r, t, n, a, s) {
3297
+ function os(e, r, t, n, a, s) {
3462
3298
  return function() {
3463
3299
  var i = new te({ index: r, font: e });
3464
3300
  return i.path = function() {
@@ -3468,7 +3304,7 @@ function gs(e, r, t, n, a, s) {
3468
3304
  }, sr(i, "xMin", "_xMin"), sr(i, "xMax", "_xMax"), sr(i, "yMin", "_yMin"), sr(i, "yMax", "_yMax"), i;
3469
3305
  };
3470
3306
  }
3471
- function ms(e, r, t, n) {
3307
+ function us(e, r, t, n) {
3472
3308
  return function() {
3473
3309
  var a = new te({ index: r, font: e });
3474
3310
  return a.path = function() {
@@ -3477,7 +3313,7 @@ function ms(e, r, t, n) {
3477
3313
  }, a;
3478
3314
  };
3479
3315
  }
3480
- var ce = { GlyphSet: tt, glyphLoader: vs, ttfGlyphLoader: gs, cffGlyphLoader: ms };
3316
+ var ce = { GlyphSet: rt, glyphLoader: is, ttfGlyphLoader: os, cffGlyphLoader: us };
3481
3317
  function yn(e, r) {
3482
3318
  if (e === r)
3483
3319
  return !0;
@@ -3491,7 +3327,7 @@ function yn(e, r) {
3491
3327
  } else
3492
3328
  return !1;
3493
3329
  }
3494
- function Wr(e) {
3330
+ function zr(e) {
3495
3331
  var r;
3496
3332
  return e.length < 1240 ? r = 107 : e.length < 33900 ? r = 1131 : r = 32768, r;
3497
3333
  }
@@ -3511,7 +3347,7 @@ function ge(e, r, t) {
3511
3347
  }
3512
3348
  return { objects: a, startOffset: r, endOffset: u };
3513
3349
  }
3514
- function ys(e, r) {
3350
+ function ls(e, r) {
3515
3351
  var t = [], n = w.getCard16(e, r), a, s;
3516
3352
  if (n !== 0) {
3517
3353
  var i = w.getByte(e, r + 2);
@@ -3523,7 +3359,7 @@ function ys(e, r) {
3523
3359
  s = r + 2;
3524
3360
  return { offsets: t, startOffset: r, endOffset: s };
3525
3361
  }
3526
- function xs(e, r, t, n, a) {
3362
+ function fs(e, r, t, n, a) {
3527
3363
  var s = w.getCard16(t, n), i = 0;
3528
3364
  if (s !== 0) {
3529
3365
  var u = w.getByte(t, n + 2);
@@ -3532,7 +3368,7 @@ function xs(e, r, t, n, a) {
3532
3368
  var o = w.getBytes(t, i + r[e], i + r[e + 1]);
3533
3369
  return o;
3534
3370
  }
3535
- function bs(e) {
3371
+ function cs(e) {
3536
3372
  for (var r = "", t = 15, n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"]; ; ) {
3537
3373
  var a = e.parseByte(), s = a >> 4, i = a & 15;
3538
3374
  if (s === t || (r += n[s], i === t))
@@ -3541,14 +3377,14 @@ function bs(e) {
3541
3377
  }
3542
3378
  return parseFloat(r);
3543
3379
  }
3544
- function Ss(e, r) {
3380
+ function ps(e, r) {
3545
3381
  var t, n, a, s;
3546
3382
  if (r === 28)
3547
3383
  return t = e.parseByte(), n = e.parseByte(), t << 8 | n;
3548
3384
  if (r === 29)
3549
3385
  return t = e.parseByte(), n = e.parseByte(), a = e.parseByte(), s = e.parseByte(), t << 24 | n << 16 | a << 8 | s;
3550
3386
  if (r === 30)
3551
- return bs(e);
3387
+ return cs(e);
3552
3388
  if (r >= 32 && r <= 246)
3553
3389
  return r - 139;
3554
3390
  if (r >= 247 && r <= 250)
@@ -3557,7 +3393,7 @@ function Ss(e, r) {
3557
3393
  return t = e.parseByte(), -(r - 251) * 256 - t - 108;
3558
3394
  throw new Error("Invalid b0 " + r);
3559
3395
  }
3560
- function ks(e) {
3396
+ function hs(e) {
3561
3397
  for (var r = {}, t = 0; t < e.length; t += 1) {
3562
3398
  var n = e[t][0], a = e[t][1], s = void 0;
3563
3399
  if (a.length === 1 ? s = a[0] : s = a, r.hasOwnProperty(n) && !isNaN(r[n]))
@@ -3571,9 +3407,9 @@ function xn(e, r, t) {
3571
3407
  var n = new w.Parser(e, r), a = [], s = [];
3572
3408
  for (t = t !== void 0 ? t : e.length; n.relativeOffset < t; ) {
3573
3409
  var i = n.parseByte();
3574
- i <= 21 ? (i === 12 && (i = 1200 + n.parseByte()), a.push([i, s]), s = []) : s.push(Ss(n, i));
3410
+ i <= 21 ? (i === 12 && (i = 1200 + n.parseByte()), a.push([i, s]), s = []) : s.push(ps(n, i));
3575
3411
  }
3576
- return ks(a);
3412
+ return hs(a);
3577
3413
  }
3578
3414
  function Be(e, r) {
3579
3415
  return r <= 390 ? r = or[r] : r = e[r - 391], r;
@@ -3592,7 +3428,7 @@ function bn(e, r, t) {
3592
3428
  }
3593
3429
  return n;
3594
3430
  }
3595
- function Ts(e, r) {
3431
+ function ds(e, r) {
3596
3432
  var t = {};
3597
3433
  return t.formatMajor = w.getCard8(e, r), t.formatMinor = w.getCard8(e, r + 1), t.size = w.getCard8(e, r + 2), t.offsetSize = w.getCard8(e, r + 3), t.startOffset = r, t.endOffset = r + 4, t;
3598
3434
  }
@@ -3637,7 +3473,7 @@ var Sn = [
3637
3473
  { name: "defaultWidthX", op: 20, type: "number", value: 0 },
3638
3474
  { name: "nominalWidthX", op: 21, type: "number", value: 0 }
3639
3475
  ];
3640
- function ws(e, r) {
3476
+ function vs(e, r) {
3641
3477
  var t = xn(e, 0, e.byteLength);
3642
3478
  return bn(t, Sn, r);
3643
3479
  }
@@ -3645,16 +3481,16 @@ function Tn(e, r, t, n) {
3645
3481
  var a = xn(e, r, t);
3646
3482
  return bn(a, kn, n);
3647
3483
  }
3648
- function wt(e, r, t, n) {
3484
+ function Tt(e, r, t, n) {
3649
3485
  for (var a = [], s = 0; s < t.length; s += 1) {
3650
- var i = new DataView(new Uint8Array(t[s]).buffer), u = ws(i, n);
3486
+ var i = new DataView(new Uint8Array(t[s]).buffer), u = vs(i, n);
3651
3487
  u._subrs = [], u._subrsBias = 0, u._defaultWidthX = 0, u._nominalWidthX = 0;
3652
3488
  var o = u.private[0], l = u.private[1];
3653
3489
  if (o !== 0 && l !== 0) {
3654
3490
  var f = Tn(e, l + r, o, n);
3655
3491
  if (u._defaultWidthX = f.defaultWidthX, u._nominalWidthX = f.nominalWidthX, f.subrs !== 0) {
3656
3492
  var p = l + f.subrs, c = ge(e, p + r);
3657
- u._subrs = c.objects, u._subrsBias = Wr(u._subrs);
3493
+ u._subrs = c.objects, u._subrsBias = zr(u._subrs);
3658
3494
  }
3659
3495
  u._privateDict = f;
3660
3496
  }
@@ -3662,7 +3498,7 @@ function wt(e, r, t, n) {
3662
3498
  }
3663
3499
  return a;
3664
3500
  }
3665
- function Fs(e, r, t, n) {
3501
+ function gs(e, r, t, n) {
3666
3502
  var a, s, i = new w.Parser(e, r);
3667
3503
  t -= 1;
3668
3504
  var u = [".notdef"], o = i.parseCard8();
@@ -3685,7 +3521,7 @@ function Fs(e, r, t, n) {
3685
3521
  throw new Error("Unknown charset format " + o);
3686
3522
  return u;
3687
3523
  }
3688
- function Cs(e, r, t) {
3524
+ function ms(e, r, t) {
3689
3525
  var n, a = {}, s = new w.Parser(e, r), i = s.parseCard8();
3690
3526
  if (i === 0)
3691
3527
  for (var u = s.parseCard8(), o = 0; o < u; o += 1)
@@ -3698,9 +3534,9 @@ function Cs(e, r, t) {
3698
3534
  a[h] = n, n += 1;
3699
3535
  } else
3700
3536
  throw new Error("Unknown encoding format " + i);
3701
- return new yr(a, t);
3537
+ return new gr(a, t);
3702
3538
  }
3703
- function Ft(e, r, t) {
3539
+ function wt(e, r, t) {
3704
3540
  var n, a, s, i, u = new N(), o = [], l = 0, f = !1, p = !1, c = 0, h = 0, v, g, m, y;
3705
3541
  if (e.isCIDFont) {
3706
3542
  var S = e.tables.cff.topDict._fdSelect[r.index], b = e.tables.cff.topDict._fdArray[S];
@@ -3826,7 +3662,7 @@ function Ft(e, r, t) {
3826
3662
  }
3827
3663
  return L(t), r.advanceWidth = O, u;
3828
3664
  }
3829
- function Us(e, r, t, n) {
3665
+ function ys(e, r, t, n) {
3830
3666
  var a = [], s, i = new w.Parser(e, r), u = i.parseCard8();
3831
3667
  if (u === 0)
3832
3668
  for (var o = 0; o < t; o++) {
@@ -3853,11 +3689,11 @@ function Us(e, r, t, n) {
3853
3689
  throw new Error("CFF Table CID Font FDSelect table has unsupported format " + u);
3854
3690
  return a;
3855
3691
  }
3856
- function Es(e, r, t, n) {
3692
+ function xs(e, r, t, n) {
3857
3693
  t.tables.cff = {};
3858
- var a = Ts(e, r), s = ge(e, a.endOffset, w.bytesToString), i = ge(e, s.endOffset), u = ge(e, i.endOffset, w.bytesToString), o = ge(e, u.endOffset);
3859
- t.gsubrs = o.objects, t.gsubrsBias = Wr(t.gsubrs);
3860
- var l = wt(e, r, i.objects, u.objects);
3694
+ var a = ds(e, r), s = ge(e, a.endOffset, w.bytesToString), i = ge(e, s.endOffset), u = ge(e, i.endOffset, w.bytesToString), o = ge(e, u.endOffset);
3695
+ t.gsubrs = o.objects, t.gsubrsBias = zr(t.gsubrs);
3696
+ var l = Tt(e, r, i.objects, u.objects);
3861
3697
  if (l.length !== 1)
3862
3698
  throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + l.length);
3863
3699
  var f = l[0];
@@ -3866,34 +3702,34 @@ function Es(e, r, t, n) {
3866
3702
  if (p === 0 || c === 0)
3867
3703
  throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
3868
3704
  p += r;
3869
- var h = ge(e, p), v = wt(e, r, h.objects, u.objects);
3870
- f._fdArray = v, c += r, f._fdSelect = Us(e, c, t.numGlyphs, v.length);
3705
+ var h = ge(e, p), v = Tt(e, r, h.objects, u.objects);
3706
+ f._fdArray = v, c += r, f._fdSelect = ys(e, c, t.numGlyphs, v.length);
3871
3707
  }
3872
3708
  var g = r + f.private[1], m = Tn(e, g, f.private[0], u.objects);
3873
3709
  if (t.defaultWidthX = m.defaultWidthX, t.nominalWidthX = m.nominalWidthX, m.subrs !== 0) {
3874
3710
  var y = g + m.subrs, S = ge(e, y);
3875
- t.subrs = S.objects, t.subrsBias = Wr(t.subrs);
3711
+ t.subrs = S.objects, t.subrsBias = zr(t.subrs);
3876
3712
  } else
3877
3713
  t.subrs = [], t.subrsBias = 0;
3878
3714
  var b;
3879
- n.lowMemory ? (b = ys(e, r + f.charStrings), t.nGlyphs = b.offsets.length) : (b = ge(e, r + f.charStrings), t.nGlyphs = b.objects.length);
3880
- var O = Fs(e, r + f.charset, t.nGlyphs, u.objects);
3881
- if (f.encoding === 0 ? t.cffEncoding = new yr(us, O) : f.encoding === 1 ? t.cffEncoding = new yr(ls, O) : t.cffEncoding = Cs(e, r + f.encoding, O), t.encoding = t.encoding || t.cffEncoding, t.glyphs = new ce.GlyphSet(t), n.lowMemory)
3715
+ n.lowMemory ? (b = ls(e, r + f.charStrings), t.nGlyphs = b.offsets.length) : (b = ge(e, r + f.charStrings), t.nGlyphs = b.objects.length);
3716
+ var O = gs(e, r + f.charset, t.nGlyphs, u.objects);
3717
+ if (f.encoding === 0 ? t.cffEncoding = new gr(Ja, O) : f.encoding === 1 ? t.cffEncoding = new gr(es, O) : t.cffEncoding = ms(e, r + f.encoding, O), t.encoding = t.encoding || t.cffEncoding, t.glyphs = new ce.GlyphSet(t), n.lowMemory)
3882
3718
  t._push = function(L) {
3883
- var F = xs(L, b.offsets, e, r + f.charStrings);
3884
- t.glyphs.push(L, ce.cffGlyphLoader(t, L, Ft, F));
3719
+ var F = fs(L, b.offsets, e, r + f.charStrings);
3720
+ t.glyphs.push(L, ce.cffGlyphLoader(t, L, wt, F));
3885
3721
  };
3886
3722
  else
3887
3723
  for (var C = 0; C < t.nGlyphs; C += 1) {
3888
3724
  var R = b.objects[C];
3889
- t.glyphs.push(C, ce.cffGlyphLoader(t, C, Ft, R));
3725
+ t.glyphs.push(C, ce.cffGlyphLoader(t, C, wt, R));
3890
3726
  }
3891
3727
  }
3892
3728
  function wn(e, r) {
3893
3729
  var t, n = or.indexOf(e);
3894
3730
  return n >= 0 && (t = n), n = r.indexOf(e), n >= 0 ? t = n + or.length : (t = or.length + r.length, r.push(e)), t;
3895
3731
  }
3896
- function Ls() {
3732
+ function bs() {
3897
3733
  return new k.Record("Header", [
3898
3734
  { name: "major", type: "Card8", value: 1 },
3899
3735
  { name: "minor", type: "Card8", value: 0 },
@@ -3901,7 +3737,7 @@ function Ls() {
3901
3737
  { name: "major", type: "Card8", value: 1 }
3902
3738
  ]);
3903
3739
  }
3904
- function Os(e) {
3740
+ function Ss(e) {
3905
3741
  var r = new k.Record("Name INDEX", [
3906
3742
  { name: "names", type: "INDEX", value: [] }
3907
3743
  ]);
@@ -3917,19 +3753,19 @@ function Fn(e, r, t) {
3917
3753
  }
3918
3754
  return n;
3919
3755
  }
3920
- function Ct(e, r) {
3756
+ function Ft(e, r) {
3921
3757
  var t = new k.Record("Top DICT", [
3922
3758
  { name: "dict", type: "DICT", value: {} }
3923
3759
  ]);
3924
3760
  return t.dict = Fn(Sn, e, r), t;
3925
3761
  }
3926
- function Ut(e) {
3762
+ function Ct(e) {
3927
3763
  var r = new k.Record("Top DICT INDEX", [
3928
3764
  { name: "topDicts", type: "INDEX", value: [] }
3929
3765
  ]);
3930
3766
  return r.topDicts = [{ name: "topDict_0", type: "TABLE", value: e }], r;
3931
3767
  }
3932
- function Rs(e) {
3768
+ function ks(e) {
3933
3769
  var r = new k.Record("String INDEX", [
3934
3770
  { name: "strings", type: "INDEX", value: [] }
3935
3771
  ]);
@@ -3938,12 +3774,12 @@ function Rs(e) {
3938
3774
  r.strings.push({ name: "string_" + t, type: "STRING", value: e[t] });
3939
3775
  return r;
3940
3776
  }
3941
- function As() {
3777
+ function Ts() {
3942
3778
  return new k.Record("Global Subr INDEX", [
3943
3779
  { name: "subrs", type: "INDEX", value: [] }
3944
3780
  ]);
3945
3781
  }
3946
- function Ds(e, r) {
3782
+ function ws(e, r) {
3947
3783
  for (var t = new k.Record("Charsets", [
3948
3784
  { name: "format", type: "Card8", value: 0 }
3949
3785
  ]), n = 0; n < e.length; n += 1) {
@@ -3952,7 +3788,7 @@ function Ds(e, r) {
3952
3788
  }
3953
3789
  return t;
3954
3790
  }
3955
- function Is(e) {
3791
+ function Fs(e) {
3956
3792
  var r = [], t = e.path;
3957
3793
  r.push({ name: "width", type: "NUMBER", value: e.advanceWidth });
3958
3794
  for (var n = 0, a = 0, s = 0; s < t.commands.length; s += 1) {
@@ -3980,22 +3816,22 @@ function Is(e) {
3980
3816
  }
3981
3817
  return r.push({ name: "endchar", type: "OP", value: 14 }), r;
3982
3818
  }
3983
- function Ps(e) {
3819
+ function Cs(e) {
3984
3820
  for (var r = new k.Record("CharStrings INDEX", [
3985
3821
  { name: "charStrings", type: "INDEX", value: [] }
3986
3822
  ]), t = 0; t < e.length; t += 1) {
3987
- var n = e.get(t), a = Is(n);
3823
+ var n = e.get(t), a = Fs(n);
3988
3824
  r.charStrings.push({ name: n.name, type: "CHARSTRING", value: a });
3989
3825
  }
3990
3826
  return r;
3991
3827
  }
3992
- function Bs(e, r) {
3828
+ function Us(e, r) {
3993
3829
  var t = new k.Record("Private DICT", [
3994
3830
  { name: "dict", type: "DICT", value: {} }
3995
3831
  ]);
3996
3832
  return t.dict = Fn(kn, e, r), t;
3997
3833
  }
3998
- function Ms(e, r) {
3834
+ function Es(e, r) {
3999
3835
  for (var t = new k.Table("CFF ", [
4000
3836
  { name: "header", type: "RECORD" },
4001
3837
  { name: "nameIndex", type: "RECORD" },
@@ -4019,18 +3855,18 @@ function Ms(e, r) {
4019
3855
  }, s = {}, i = [], u, o = 1; o < e.length; o += 1)
4020
3856
  u = e.get(o), i.push(u.name);
4021
3857
  var l = [];
4022
- t.header = Ls(), t.nameIndex = Os([r.postScriptName]);
4023
- var f = Ct(a, l);
4024
- t.topDictIndex = Ut(f), t.globalSubrIndex = As(), t.charsets = Ds(i, l), t.charStringsIndex = Ps(e), t.privateDict = Bs(s, l), t.stringIndex = Rs(l);
3858
+ t.header = bs(), t.nameIndex = Ss([r.postScriptName]);
3859
+ var f = Ft(a, l);
3860
+ t.topDictIndex = Ct(f), t.globalSubrIndex = Ts(), t.charsets = ws(i, l), t.charStringsIndex = Cs(e), t.privateDict = Us(s, l), t.stringIndex = ks(l);
4025
3861
  var p = t.header.sizeOf() + t.nameIndex.sizeOf() + t.topDictIndex.sizeOf() + t.stringIndex.sizeOf() + t.globalSubrIndex.sizeOf();
4026
- return a.charset = p, a.encoding = 0, a.charStrings = a.charset + t.charsets.sizeOf(), a.private[1] = a.charStrings + t.charStringsIndex.sizeOf(), f = Ct(a, l), t.topDictIndex = Ut(f), t;
3862
+ return a.charset = p, a.encoding = 0, a.charStrings = a.charset + t.charsets.sizeOf(), a.private[1] = a.charStrings + t.charStringsIndex.sizeOf(), f = Ft(a, l), t.topDictIndex = Ct(f), t;
4027
3863
  }
4028
- var Cn = { parse: Es, make: Ms };
4029
- function Gs(e, r) {
3864
+ var Cn = { parse: xs, make: Es };
3865
+ function Ls(e, r) {
4030
3866
  var t = {}, n = new w.Parser(e, r);
4031
3867
  return t.version = n.parseVersion(), t.fontRevision = Math.round(n.parseFixed() * 1e3) / 1e3, t.checkSumAdjustment = n.parseULong(), t.magicNumber = n.parseULong(), U.argument(t.magicNumber === 1594834165, "Font header has wrong magic number."), t.flags = n.parseUShort(), t.unitsPerEm = n.parseUShort(), t.created = n.parseLongDateTime(), t.modified = n.parseLongDateTime(), t.xMin = n.parseShort(), t.yMin = n.parseShort(), t.xMax = n.parseShort(), t.yMax = n.parseShort(), t.macStyle = n.parseUShort(), t.lowestRecPPEM = n.parseUShort(), t.fontDirectionHint = n.parseShort(), t.indexToLocFormat = n.parseShort(), t.glyphDataFormat = n.parseShort(), t;
4032
3868
  }
4033
- function Ns(e) {
3869
+ function Os(e) {
4034
3870
  var r = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) + 2082844800, t = r;
4035
3871
  return e.createdTimestamp && (t = e.createdTimestamp + 2082844800), new k.Table("head", [
4036
3872
  { name: "version", type: "FIXED", value: 65536 },
@@ -4052,12 +3888,12 @@ function Ns(e) {
4052
3888
  { name: "glyphDataFormat", type: "SHORT", value: 0 }
4053
3889
  ], e);
4054
3890
  }
4055
- var Un = { parse: Gs, make: Ns };
4056
- function Hs(e, r) {
3891
+ var Un = { parse: Ls, make: Os };
3892
+ function Rs(e, r) {
4057
3893
  var t = {}, n = new w.Parser(e, r);
4058
3894
  return t.version = n.parseVersion(), t.ascender = n.parseShort(), t.descender = n.parseShort(), t.lineGap = n.parseShort(), t.advanceWidthMax = n.parseUShort(), t.minLeftSideBearing = n.parseShort(), t.minRightSideBearing = n.parseShort(), t.xMaxExtent = n.parseShort(), t.caretSlopeRise = n.parseShort(), t.caretSlopeRun = n.parseShort(), t.caretOffset = n.parseShort(), n.relativeOffset += 8, t.metricDataFormat = n.parseShort(), t.numberOfHMetrics = n.parseUShort(), t;
4059
3895
  }
4060
- function zs(e) {
3896
+ function As(e) {
4061
3897
  return new k.Table("hhea", [
4062
3898
  { name: "version", type: "FIXED", value: 65536 },
4063
3899
  { name: "ascender", type: "FWORD", value: 0 },
@@ -4078,15 +3914,15 @@ function zs(e) {
4078
3914
  { name: "numberOfHMetrics", type: "USHORT", value: 0 }
4079
3915
  ], e);
4080
3916
  }
4081
- var En = { parse: Hs, make: zs };
4082
- function Ws(e, r, t, n, a) {
3917
+ var En = { parse: Rs, make: As };
3918
+ function Ds(e, r, t, n, a) {
4083
3919
  for (var s, i, u = new w.Parser(e, r), o = 0; o < n; o += 1) {
4084
3920
  o < t && (s = u.parseUShort(), i = u.parseShort());
4085
3921
  var l = a.get(o);
4086
3922
  l.advanceWidth = s, l.leftSideBearing = i;
4087
3923
  }
4088
3924
  }
4089
- function _s(e, r, t, n, a) {
3925
+ function Is(e, r, t, n, a) {
4090
3926
  e._hmtxTableData = {};
4091
3927
  for (var s, i, u = new w.Parser(r, t), o = 0; o < a; o += 1)
4092
3928
  o < n && (s = u.parseUShort(), i = u.parseShort()), e._hmtxTableData[o] = {
@@ -4094,18 +3930,18 @@ function _s(e, r, t, n, a) {
4094
3930
  leftSideBearing: i
4095
3931
  };
4096
3932
  }
4097
- function Vs(e, r, t, n, a, s, i) {
4098
- i.lowMemory ? _s(e, r, t, n, a) : Ws(r, t, n, a, s);
3933
+ function Ps(e, r, t, n, a, s, i) {
3934
+ i.lowMemory ? Is(e, r, t, n, a) : Ds(r, t, n, a, s);
4099
3935
  }
4100
- function qs(e) {
3936
+ function Bs(e) {
4101
3937
  for (var r = new k.Table("hmtx", []), t = 0; t < e.length; t += 1) {
4102
3938
  var n = e.get(t), a = n.advanceWidth || 0, s = n.leftSideBearing || 0;
4103
3939
  r.fields.push({ name: "advanceWidth_" + t, type: "USHORT", value: a }), r.fields.push({ name: "leftSideBearing_" + t, type: "SHORT", value: s });
4104
3940
  }
4105
3941
  return r;
4106
3942
  }
4107
- var Ln = { parse: Vs, make: qs };
4108
- function Xs(e) {
3943
+ var Ln = { parse: Ps, make: Bs };
3944
+ function Ms(e) {
4109
3945
  for (var r = new k.Table("ltag", [
4110
3946
  { name: "version", type: "ULONG", value: 1 },
4111
3947
  { name: "flags", type: "ULONG", value: 0 },
@@ -4116,7 +3952,7 @@ function Xs(e) {
4116
3952
  }
4117
3953
  return r.fields.push({ name: "stringPool", type: "CHARARRAY", value: t }), r;
4118
3954
  }
4119
- function Ys(e, r) {
3955
+ function Gs(e, r) {
4120
3956
  var t = new w.Parser(e, r), n = t.parseULong();
4121
3957
  U.argument(n === 1, "Unsupported ltag table version."), t.skip("uLong", 1);
4122
3958
  for (var a = t.parseULong(), s = [], i = 0; i < a; i++) {
@@ -4126,18 +3962,18 @@ function Ys(e, r) {
4126
3962
  }
4127
3963
  return s;
4128
3964
  }
4129
- var On = { make: Xs, parse: Ys };
4130
- function Zs(e, r) {
3965
+ var On = { make: Ms, parse: Gs };
3966
+ function Ns(e, r) {
4131
3967
  var t = {}, n = new w.Parser(e, r);
4132
3968
  return t.version = n.parseVersion(), t.numGlyphs = n.parseUShort(), t.version === 1 && (t.maxPoints = n.parseUShort(), t.maxContours = n.parseUShort(), t.maxCompositePoints = n.parseUShort(), t.maxCompositeContours = n.parseUShort(), t.maxZones = n.parseUShort(), t.maxTwilightPoints = n.parseUShort(), t.maxStorage = n.parseUShort(), t.maxFunctionDefs = n.parseUShort(), t.maxInstructionDefs = n.parseUShort(), t.maxStackElements = n.parseUShort(), t.maxSizeOfInstructions = n.parseUShort(), t.maxComponentElements = n.parseUShort(), t.maxComponentDepth = n.parseUShort()), t;
4133
3969
  }
4134
- function Ks(e) {
3970
+ function Hs(e) {
4135
3971
  return new k.Table("maxp", [
4136
3972
  { name: "version", type: "FIXED", value: 20480 },
4137
3973
  { name: "numGlyphs", type: "USHORT", value: e }
4138
3974
  ]);
4139
3975
  }
4140
- var Rn = { parse: Zs, make: Ks }, An = [
3976
+ var Rn = { parse: Ns, make: Hs }, An = [
4141
3977
  "copyright",
4142
3978
  // 0
4143
3979
  "fontFamily",
@@ -4304,7 +4140,7 @@ var Rn = { parse: Zs, make: Ks }, An = [
4304
4140
  149: "kl",
4305
4141
  150: "az",
4306
4142
  151: "nn"
4307
- }, js = {
4143
+ }, zs = {
4308
4144
  0: 0,
4309
4145
  // langEnglish → smRoman
4310
4146
  1: 0,
@@ -4757,7 +4593,7 @@ var Rn = { parse: Zs, make: Ks }, An = [
4757
4593
  1144: "ii",
4758
4594
  1130: "yo"
4759
4595
  };
4760
- function Qs(e, r, t) {
4596
+ function Ws(e, r, t) {
4761
4597
  switch (e) {
4762
4598
  case 0:
4763
4599
  if (r === 65535)
@@ -4771,7 +4607,7 @@ function Qs(e, r, t) {
4771
4607
  return In[r];
4772
4608
  }
4773
4609
  }
4774
- var _r = "utf-16", $s = {
4610
+ var Wr = "utf-16", _s = {
4775
4611
  0: "macintosh",
4776
4612
  // smRoman
4777
4613
  1: "x-mac-japanese",
@@ -4830,7 +4666,7 @@ var _r = "utf-16", $s = {
4830
4666
  // smVietnamese
4831
4667
  31: "x-mac-extarabic"
4832
4668
  // smExtArabic
4833
- }, Js = {
4669
+ }, Vs = {
4834
4670
  15: "x-mac-icelandic",
4835
4671
  // langIcelandic
4836
4672
  17: "x-mac-turkish",
@@ -4865,21 +4701,21 @@ var _r = "utf-16", $s = {
4865
4701
  function Pn(e, r, t) {
4866
4702
  switch (e) {
4867
4703
  case 0:
4868
- return _r;
4704
+ return Wr;
4869
4705
  case 1:
4870
- return Js[t] || $s[r];
4706
+ return Vs[t] || _s[r];
4871
4707
  case 3:
4872
4708
  if (r === 1 || r === 10)
4873
- return _r;
4709
+ return Wr;
4874
4710
  break;
4875
4711
  }
4876
4712
  }
4877
- function ei(e, r, t) {
4713
+ function qs(e, r, t) {
4878
4714
  for (var n = {}, a = new w.Parser(e, r), s = a.parseUShort(), i = a.parseUShort(), u = a.offset + a.parseUShort(), o = 0; o < i; o++) {
4879
- var l = a.parseUShort(), f = a.parseUShort(), p = a.parseUShort(), c = a.parseUShort(), h = An[c] || c, v = a.parseUShort(), g = a.parseUShort(), m = Qs(l, p, t), y = Pn(l, f, p);
4715
+ var l = a.parseUShort(), f = a.parseUShort(), p = a.parseUShort(), c = a.parseUShort(), h = An[c] || c, v = a.parseUShort(), g = a.parseUShort(), m = Ws(l, p, t), y = Pn(l, f, p);
4880
4716
  if (y !== void 0 && m !== void 0) {
4881
4717
  var S = void 0;
4882
- if (y === _r ? S = Oe.UTF16(e, u + g, v) : S = Oe.MACSTRING(e, u + g, v, y), S) {
4718
+ if (y === Wr ? S = Oe.UTF16(e, u + g, v) : S = Oe.MACSTRING(e, u + g, v, y), S) {
4883
4719
  var b = n[h];
4884
4720
  b === void 0 && (b = n[h] = {}), b[m] = S;
4885
4721
  }
@@ -4887,13 +4723,13 @@ function ei(e, r, t) {
4887
4723
  }
4888
4724
  return s === 1 && a.parseUShort(), n;
4889
4725
  }
4890
- function Er(e) {
4726
+ function Ur(e) {
4891
4727
  var r = {};
4892
4728
  for (var t in e)
4893
4729
  r[e[t]] = parseInt(t);
4894
4730
  return r;
4895
4731
  }
4896
- function Et(e, r, t, n, a, s) {
4732
+ function Ut(e, r, t, n, a, s) {
4897
4733
  return new k.Record("NameRecord", [
4898
4734
  { name: "platformID", type: "USHORT", value: e },
4899
4735
  { name: "encodingID", type: "USHORT", value: r },
@@ -4903,7 +4739,7 @@ function Et(e, r, t, n, a, s) {
4903
4739
  { name: "offset", type: "USHORT", value: s }
4904
4740
  ]);
4905
4741
  }
4906
- function ri(e, r) {
4742
+ function Xs(e, r) {
4907
4743
  var t = e.length, n = r.length - t + 1;
4908
4744
  e:
4909
4745
  for (var a = 0; a < n; a++)
@@ -4915,8 +4751,8 @@ function ri(e, r) {
4915
4751
  }
4916
4752
  return -1;
4917
4753
  }
4918
- function Lt(e, r) {
4919
- var t = ri(e, r);
4754
+ function Et(e, r) {
4755
+ var t = Xs(e, r);
4920
4756
  if (t < 0) {
4921
4757
  t = r.length;
4922
4758
  for (var n = 0, a = e.length; n < a; ++n)
@@ -4924,22 +4760,22 @@ function Lt(e, r) {
4924
4760
  }
4925
4761
  return t;
4926
4762
  }
4927
- function ti(e, r) {
4928
- var t, n = [], a = {}, s = Er(An);
4763
+ function Ys(e, r) {
4764
+ var t, n = [], a = {}, s = Ur(An);
4929
4765
  for (var i in e) {
4930
4766
  var u = s[i];
4931
4767
  if (u === void 0 && (u = i), t = parseInt(u), isNaN(t))
4932
4768
  throw new Error('Name table entry "' + i + '" does not exist, see nameTableNames for complete list.');
4933
4769
  a[t] = e[i], n.push(t);
4934
4770
  }
4935
- for (var o = Er(Dn), l = Er(In), f = [], p = [], c = 0; c < n.length; c++) {
4771
+ for (var o = Ur(Dn), l = Ur(In), f = [], p = [], c = 0; c < n.length; c++) {
4936
4772
  t = n[c];
4937
4773
  var h = a[t];
4938
4774
  for (var v in h) {
4939
- var g = h[v], m = 1, y = o[v], S = js[y], b = Pn(m, S, y), O = x.MACSTRING(g, b);
4775
+ var g = h[v], m = 1, y = o[v], S = zs[y], b = Pn(m, S, y), O = x.MACSTRING(g, b);
4940
4776
  O === void 0 && (m = 0, y = r.indexOf(v), y < 0 && (y = r.length, r.push(v)), S = 4, O = x.UTF16(g));
4941
- var C = Lt(O, p);
4942
- f.push(Et(
4777
+ var C = Et(O, p);
4778
+ f.push(Ut(
4943
4779
  m,
4944
4780
  S,
4945
4781
  y,
@@ -4949,8 +4785,8 @@ function ti(e, r) {
4949
4785
  ));
4950
4786
  var R = l[v];
4951
4787
  if (R !== void 0) {
4952
- var L = x.UTF16(g), F = Lt(L, p);
4953
- f.push(Et(
4788
+ var L = x.UTF16(g), F = Et(L, p);
4789
+ f.push(Ut(
4954
4790
  3,
4955
4791
  1,
4956
4792
  R,
@@ -4972,7 +4808,7 @@ function ti(e, r) {
4972
4808
  P.fields.push({ name: "record_" + K, type: "RECORD", value: f[K] });
4973
4809
  return P.fields.push({ name: "strings", type: "LITERAL", value: p }), P;
4974
4810
  }
4975
- var Bn = { parse: ei, make: ti }, Vr = [
4811
+ var Bn = { parse: qs, make: Ys }, _r = [
4976
4812
  { begin: 0, end: 127 },
4977
4813
  // Basic Latin
4978
4814
  { begin: 128, end: 255 },
@@ -5220,22 +5056,22 @@ var Bn = { parse: ei, make: ti }, Vr = [
5220
5056
  { begin: 127024, end: 127135 }
5221
5057
  // Domino Tiles
5222
5058
  ];
5223
- function ni(e) {
5224
- for (var r = 0; r < Vr.length; r += 1) {
5225
- var t = Vr[r];
5059
+ function Zs(e) {
5060
+ for (var r = 0; r < _r.length; r += 1) {
5061
+ var t = _r[r];
5226
5062
  if (e >= t.begin && e < t.end)
5227
5063
  return r;
5228
5064
  }
5229
5065
  return -1;
5230
5066
  }
5231
- function ai(e, r) {
5067
+ function Ks(e, r) {
5232
5068
  var t = {}, n = new w.Parser(e, r);
5233
5069
  t.version = n.parseUShort(), t.xAvgCharWidth = n.parseShort(), t.usWeightClass = n.parseUShort(), t.usWidthClass = n.parseUShort(), t.fsType = n.parseUShort(), t.ySubscriptXSize = n.parseShort(), t.ySubscriptYSize = n.parseShort(), t.ySubscriptXOffset = n.parseShort(), t.ySubscriptYOffset = n.parseShort(), t.ySuperscriptXSize = n.parseShort(), t.ySuperscriptYSize = n.parseShort(), t.ySuperscriptXOffset = n.parseShort(), t.ySuperscriptYOffset = n.parseShort(), t.yStrikeoutSize = n.parseShort(), t.yStrikeoutPosition = n.parseShort(), t.sFamilyClass = n.parseShort(), t.panose = [];
5234
5070
  for (var a = 0; a < 10; a++)
5235
5071
  t.panose[a] = n.parseByte();
5236
5072
  return t.ulUnicodeRange1 = n.parseULong(), t.ulUnicodeRange2 = n.parseULong(), t.ulUnicodeRange3 = n.parseULong(), t.ulUnicodeRange4 = n.parseULong(), t.achVendID = String.fromCharCode(n.parseByte(), n.parseByte(), n.parseByte(), n.parseByte()), t.fsSelection = n.parseUShort(), t.usFirstCharIndex = n.parseUShort(), t.usLastCharIndex = n.parseUShort(), t.sTypoAscender = n.parseShort(), t.sTypoDescender = n.parseShort(), t.sTypoLineGap = n.parseShort(), t.usWinAscent = n.parseUShort(), t.usWinDescent = n.parseUShort(), t.version >= 1 && (t.ulCodePageRange1 = n.parseULong(), t.ulCodePageRange2 = n.parseULong()), t.version >= 2 && (t.sxHeight = n.parseShort(), t.sCapHeight = n.parseShort(), t.usDefaultChar = n.parseUShort(), t.usBreakChar = n.parseUShort(), t.usMaxContent = n.parseUShort()), t;
5237
5073
  }
5238
- function si(e) {
5074
+ function js(e) {
5239
5075
  return new k.Table("OS/2", [
5240
5076
  { name: "version", type: "USHORT", value: 3 },
5241
5077
  { name: "xAvgCharWidth", type: "SHORT", value: 0 },
@@ -5285,8 +5121,8 @@ function si(e) {
5285
5121
  { name: "usMaxContext", type: "USHORT", value: 0 }
5286
5122
  ], e);
5287
5123
  }
5288
- var qr = { parse: ai, make: si, unicodeRanges: Vr, getUnicodeRange: ni };
5289
- function ii(e, r) {
5124
+ var Vr = { parse: Ks, make: js, unicodeRanges: _r, getUnicodeRange: Zs };
5125
+ function Qs(e, r) {
5290
5126
  var t = {}, n = new w.Parser(e, r);
5291
5127
  switch (t.version = n.parseVersion(), t.italicAngle = n.parseFixed(), t.underlinePosition = n.parseShort(), t.underlineThickness = n.parseShort(), t.isFixedPitch = n.parseULong(), t.minMemType42 = n.parseULong(), t.maxMemType42 = n.parseULong(), t.minMemType1 = n.parseULong(), t.maxMemType1 = n.parseULong(), t.version) {
5292
5128
  case 1:
@@ -5311,7 +5147,7 @@ function ii(e, r) {
5311
5147
  }
5312
5148
  return t;
5313
5149
  }
5314
- function oi() {
5150
+ function $s() {
5315
5151
  return new k.Table("post", [
5316
5152
  { name: "version", type: "FIXED", value: 196608 },
5317
5153
  { name: "italicAngle", type: "FIXED", value: 0 },
@@ -5324,7 +5160,7 @@ function oi() {
5324
5160
  { name: "maxMemType1", type: "ULONG", value: 0 }
5325
5161
  ]);
5326
5162
  }
5327
- var Mn = { parse: ii, make: oi }, ne = new Array(9);
5163
+ var Mn = { parse: Qs, make: $s }, ne = new Array(9);
5328
5164
  ne[1] = function() {
5329
5165
  var r = this.offset + this.relativeOffset, t = this.parseUShort();
5330
5166
  if (t === 1)
@@ -5472,7 +5308,7 @@ ne[8] = function() {
5472
5308
  substitutes: this.parseUShortList()
5473
5309
  };
5474
5310
  };
5475
- function ui(e, r) {
5311
+ function Js(e, r) {
5476
5312
  r = r || 0;
5477
5313
  var t = new d(e, r), n = t.parseVersion(1);
5478
5314
  return U.argument(n === 1 || n === 1.1, "Unsupported GSUB table version."), n === 1 ? {
@@ -5562,7 +5398,7 @@ Re[6] = function(r) {
5562
5398
  }
5563
5399
  U.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
5564
5400
  };
5565
- function li(e) {
5401
+ function ei(e) {
5566
5402
  return new k.Table("GSUB", [
5567
5403
  { name: "version", type: "ULONG", value: 65536 },
5568
5404
  { name: "scripts", type: "TABLE", value: new k.ScriptList(e.scripts) },
@@ -5570,8 +5406,8 @@ function li(e) {
5570
5406
  { name: "lookups", type: "TABLE", value: new k.LookupList(e.lookups, Re) }
5571
5407
  ]);
5572
5408
  }
5573
- var Gn = { parse: ui, make: li };
5574
- function fi(e, r) {
5409
+ var Gn = { parse: Js, make: ei };
5410
+ function ri(e, r) {
5575
5411
  var t = new w.Parser(e, r), n = t.parseULong();
5576
5412
  U.argument(n === 1, "Unsupported META table version."), t.parseULong(), t.parseULong();
5577
5413
  for (var a = t.parseULong(), s = {}, i = 0; i < a; i++) {
@@ -5580,7 +5416,7 @@ function fi(e, r) {
5580
5416
  }
5581
5417
  return s;
5582
5418
  }
5583
- function ci(e) {
5419
+ function ti(e) {
5584
5420
  var r = Object.keys(e).length, t = "", n = 16 + r * 12, a = new k.Table("meta", [
5585
5421
  { name: "version", type: "ULONG", value: 1 },
5586
5422
  { name: "flags", type: "ULONG", value: 0 },
@@ -5593,18 +5429,18 @@ function ci(e) {
5593
5429
  }
5594
5430
  return a.fields.push({ name: "stringPool", type: "CHARARRAY", value: t }), a;
5595
5431
  }
5596
- var Nn = { parse: fi, make: ci };
5597
- function Ot(e) {
5432
+ var Nn = { parse: ri, make: ti };
5433
+ function Lt(e) {
5598
5434
  return Math.log(e) / Math.log(2) | 0;
5599
5435
  }
5600
- function nt(e) {
5436
+ function tt(e) {
5601
5437
  for (; e.length % 4 !== 0; )
5602
5438
  e.push(0);
5603
5439
  for (var r = 0, t = 0; t < e.length; t += 4)
5604
5440
  r += (e[t] << 24) + (e[t + 1] << 16) + (e[t + 2] << 8) + e[t + 3];
5605
5441
  return r %= Math.pow(2, 32), r;
5606
5442
  }
5607
- function Rt(e, r, t, n) {
5443
+ function Ot(e, r, t, n) {
5608
5444
  return new k.Record("Table Record", [
5609
5445
  { name: "tag", type: "TAG", value: e !== void 0 ? e : "" },
5610
5446
  { name: "checkSum", type: "ULONG", value: r !== void 0 ? r : 0 },
@@ -5621,14 +5457,14 @@ function Hn(e) {
5621
5457
  { name: "rangeShift", type: "USHORT", value: 0 }
5622
5458
  ]);
5623
5459
  r.tables = e, r.numTables = e.length;
5624
- var t = Math.pow(2, Ot(r.numTables));
5625
- r.searchRange = 16 * t, r.entrySelector = Ot(t), r.rangeShift = r.numTables * 16 - r.searchRange;
5626
- for (var n = [], a = [], s = r.sizeOf() + Rt().sizeOf() * r.numTables; s % 4 !== 0; )
5460
+ var t = Math.pow(2, Lt(r.numTables));
5461
+ r.searchRange = 16 * t, r.entrySelector = Lt(t), r.rangeShift = r.numTables * 16 - r.searchRange;
5462
+ for (var n = [], a = [], s = r.sizeOf() + Ot().sizeOf() * r.numTables; s % 4 !== 0; )
5627
5463
  s += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
5628
5464
  for (var i = 0; i < e.length; i += 1) {
5629
5465
  var u = e[i];
5630
5466
  U.argument(u.tableName.length === 4, "Table name" + u.tableName + " is invalid.");
5631
- var o = u.sizeOf(), l = Rt(u.tableName, nt(u.encode()), s, o);
5467
+ var o = u.sizeOf(), l = Ot(u.tableName, tt(u.encode()), s, o);
5632
5468
  for (n.push({ name: l.tag + " Table Record", type: "RECORD", value: l }), a.push({ name: u.tableName + " table", type: "RECORD", value: u }), s += o, U.argument(!isNaN(s), "Something went wrong calculating the offset."); s % 4 !== 0; )
5633
5469
  s += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
5634
5470
  }
@@ -5636,7 +5472,7 @@ function Hn(e) {
5636
5472
  return f.value.tag > p.value.tag ? 1 : -1;
5637
5473
  }), r.fields = r.fields.concat(n), r.fields = r.fields.concat(a), r;
5638
5474
  }
5639
- function At(e, r, t) {
5475
+ function Rt(e, r, t) {
5640
5476
  for (var n = 0; n < r.length; n += 1) {
5641
5477
  var a = e.charToGlyphIndex(r[n]);
5642
5478
  if (a > 0) {
@@ -5646,18 +5482,18 @@ function At(e, r, t) {
5646
5482
  }
5647
5483
  return t;
5648
5484
  }
5649
- function pi(e) {
5485
+ function ni(e) {
5650
5486
  for (var r = 0, t = 0; t < e.length; t += 1)
5651
5487
  r += e[t];
5652
5488
  return r / e.length;
5653
5489
  }
5654
- function hi(e) {
5490
+ function ai(e) {
5655
5491
  for (var r = [], t = [], n = [], a = [], s = [], i = [], u = [], o, l = 0, f = 0, p = 0, c = 0, h = 0, v = 0; v < e.glyphs.length; v += 1) {
5656
5492
  var g = e.glyphs.get(v), m = g.unicode | 0;
5657
5493
  if (isNaN(g.advanceWidth))
5658
5494
  throw new Error("Glyph " + g.name + " (" + v + "): advanceWidth is not a number.");
5659
5495
  (o > m || o === void 0) && m > 0 && (o = m), l < m && (l = m);
5660
- var y = qr.getUnicodeRange(m);
5496
+ var y = Vr.getUnicodeRange(m);
5661
5497
  if (y < 32)
5662
5498
  f |= 1 << y;
5663
5499
  else if (y < 64)
@@ -5679,7 +5515,7 @@ function hi(e) {
5679
5515
  xMax: Math.max.apply(null, n),
5680
5516
  yMax: Math.max.apply(null, a),
5681
5517
  advanceWidthMax: Math.max.apply(null, s),
5682
- advanceWidthAvg: pi(s),
5518
+ advanceWidthAvg: ni(s),
5683
5519
  minLeftSideBearing: Math.min.apply(null, i),
5684
5520
  maxLeftSideBearing: Math.max.apply(null, i),
5685
5521
  minRightSideBearing: Math.min.apply(null, u)
@@ -5703,7 +5539,7 @@ function hi(e) {
5703
5539
  minRightSideBearing: b.minRightSideBearing,
5704
5540
  xMaxExtent: b.maxLeftSideBearing + (b.xMax - b.xMin),
5705
5541
  numberOfHMetrics: e.glyphs.length
5706
- }), R = Rn.make(e.glyphs.length), L = qr.make(Object.assign({
5542
+ }), R = Rn.make(e.glyphs.length), L = Vr.make(Object.assign({
5707
5543
  xAvgCharWidth: Math.round(b.advanceWidthAvg),
5708
5544
  usFirstCharIndex: o,
5709
5545
  usLastCharIndex: l,
@@ -5722,8 +5558,8 @@ function hi(e) {
5722
5558
  usWinDescent: Math.abs(b.yMin),
5723
5559
  ulCodePageRange1: 1,
5724
5560
  // FIXME: hard-code Latin 1 support for now
5725
- sxHeight: At(e, "xyvw", { yMax: Math.round(b.ascender / 2) }).yMax,
5726
- sCapHeight: At(e, "HIKLEFJMNTZBDPRAGOQSUVWXY", b).yMax,
5561
+ sxHeight: Rt(e, "xyvw", { yMax: Math.round(b.ascender / 2) }).yMax,
5562
+ sCapHeight: Rt(e, "HIKLEFJMNTZBDPRAGOQSUVWXY", b).yMax,
5727
5563
  usDefaultChar: e.hasChar(" ") ? 32 : 0,
5728
5564
  // Use space as the default character, if available.
5729
5565
  usBreakChar: e.hasChar(" ") ? 32 : 0
@@ -5744,7 +5580,7 @@ function hi(e) {
5744
5580
  fontBBox: [0, b.yMin, b.ascender, b.advanceWidthMax]
5745
5581
  }), D = e.metas && Object.keys(e.metas).length > 0 ? Nn.make(e.metas) : void 0, X = [O, C, R, L, V, P, z, Z, F];
5746
5582
  q && X.push(q), e.tables.gsub && X.push(Gn.make(e.tables.gsub)), D && X.push(D);
5747
- for (var kr = Hn(X), Jn = kr.encode(), ea = nt(Jn), Tr = kr.fields, ut = !1, je = 0; je < Tr.length; je += 1)
5583
+ for (var kr = Hn(X), Jn = kr.encode(), ea = tt(Jn), Tr = kr.fields, ut = !1, je = 0; je < Tr.length; je += 1)
5748
5584
  if (Tr[je].name === "head table") {
5749
5585
  Tr[je].value.checkSumAdjustment = 2981146554 - ea, ut = !0;
5750
5586
  break;
@@ -5753,8 +5589,8 @@ function hi(e) {
5753
5589
  throw new Error("Could not find head table with checkSum to adjust.");
5754
5590
  return kr;
5755
5591
  }
5756
- var di = { make: Hn, fontToTable: hi, computeCheckSum: nt };
5757
- function Lr(e, r) {
5592
+ var si = { make: Hn, fontToTable: ai, computeCheckSum: tt };
5593
+ function Er(e, r) {
5758
5594
  for (var t = 0, n = e.length - 1; t <= n; ) {
5759
5595
  var a = t + n >>> 1, s = e[a].tag;
5760
5596
  if (s === r)
@@ -5763,7 +5599,7 @@ function Lr(e, r) {
5763
5599
  }
5764
5600
  return -t - 1;
5765
5601
  }
5766
- function Dt(e, r) {
5602
+ function At(e, r) {
5767
5603
  for (var t = 0, n = e.length - 1; t <= n; ) {
5768
5604
  var a = t + n >>> 1, s = e[a];
5769
5605
  if (s === r)
@@ -5772,7 +5608,7 @@ function Dt(e, r) {
5772
5608
  }
5773
5609
  return -t - 1;
5774
5610
  }
5775
- function It(e, r) {
5611
+ function Dt(e, r) {
5776
5612
  for (var t, n = 0, a = e.length - 1; n <= a; ) {
5777
5613
  var s = n + a >>> 1;
5778
5614
  t = e[s];
@@ -5797,7 +5633,7 @@ qe.prototype = {
5797
5633
  * @param {string} tag
5798
5634
  * @return {number}
5799
5635
  */
5800
- searchTag: Lr,
5636
+ searchTag: Er,
5801
5637
  /**
5802
5638
  * Binary search in a list of numbers
5803
5639
  * @instance
@@ -5807,7 +5643,7 @@ qe.prototype = {
5807
5643
  * @param {number} value
5808
5644
  * @return {number}
5809
5645
  */
5810
- binSearch: Dt,
5646
+ binSearch: At,
5811
5647
  /**
5812
5648
  * Get or create the Layout table (GSUB, GPOS etc).
5813
5649
  * @param {boolean} create - Whether to create a new one.
@@ -5858,7 +5694,7 @@ qe.prototype = {
5858
5694
  var t = this.getTable(r);
5859
5695
  if (t) {
5860
5696
  e = e || "DFLT";
5861
- var n = t.scripts, a = Lr(t.scripts, e);
5697
+ var n = t.scripts, a = Er(t.scripts, e);
5862
5698
  if (a >= 0)
5863
5699
  return n[a].script;
5864
5700
  if (r) {
@@ -5886,7 +5722,7 @@ qe.prototype = {
5886
5722
  if (n) {
5887
5723
  if (!r || r === "dflt" || r === "DFLT")
5888
5724
  return n.defaultLangSys;
5889
- var a = Lr(n.langSysRecords, r);
5725
+ var a = Er(n.langSysRecords, r);
5890
5726
  if (a >= 0)
5891
5727
  return n.langSysRecords[a].langSys;
5892
5728
  if (t) {
@@ -5962,7 +5798,7 @@ qe.prototype = {
5962
5798
  case 1:
5963
5799
  return e.startGlyph <= r && r < e.startGlyph + e.classes.length ? e.classes[r - e.startGlyph] : 0;
5964
5800
  case 2:
5965
- var t = It(e.ranges, r);
5801
+ var t = Dt(e.ranges, r);
5966
5802
  return t ? t.classId : 0;
5967
5803
  }
5968
5804
  },
@@ -5976,10 +5812,10 @@ qe.prototype = {
5976
5812
  getCoverageIndex: function(e, r) {
5977
5813
  switch (e.format) {
5978
5814
  case 1:
5979
- var t = Dt(e.glyphs, r);
5815
+ var t = At(e.glyphs, r);
5980
5816
  return t >= 0 ? t : -1;
5981
5817
  case 2:
5982
- var n = It(e.ranges, r);
5818
+ var n = Dt(e.ranges, r);
5983
5819
  return n ? n.index + r - n.start : -1;
5984
5820
  }
5985
5821
  },
@@ -6036,7 +5872,7 @@ Xe.prototype.getKerningTables = function(e, r) {
6036
5872
  function $(e) {
6037
5873
  qe.call(this, e, "gsub");
6038
5874
  }
6039
- function vi(e, r) {
5875
+ function ii(e, r) {
6040
5876
  var t = e.length;
6041
5877
  if (t !== r.length)
6042
5878
  return !1;
@@ -6045,7 +5881,7 @@ function vi(e, r) {
6045
5881
  return !1;
6046
5882
  return !0;
6047
5883
  }
6048
- function at(e, r, t) {
5884
+ function nt(e, r, t) {
6049
5885
  for (var n = e.subtables, a = 0; a < n.length; a++) {
6050
5886
  var s = n[a];
6051
5887
  if (s.substFormat === r)
@@ -6119,7 +5955,7 @@ $.prototype.getLigatures = function(e, r, t) {
6119
5955
  return n;
6120
5956
  };
6121
5957
  $.prototype.addSingle = function(e, r, t, n) {
6122
- var a = this.getLookupTables(t, n, e, 1, !0)[0], s = at(a, 2, {
5958
+ var a = this.getLookupTables(t, n, e, 1, !0)[0], s = nt(a, 2, {
6123
5959
  // lookup type 1 subtable, format 2, coverage format 1
6124
5960
  substFormat: 2,
6125
5961
  coverage: { format: 1, glyphs: [] },
@@ -6131,7 +5967,7 @@ $.prototype.addSingle = function(e, r, t, n) {
6131
5967
  };
6132
5968
  $.prototype.addMultiple = function(e, r, t, n) {
6133
5969
  U.assert(r.by instanceof Array && r.by.length > 1, 'Multiple: "by" must be an array of two or more ids');
6134
- var a = this.getLookupTables(t, n, e, 2, !0)[0], s = at(a, 1, {
5970
+ var a = this.getLookupTables(t, n, e, 2, !0)[0], s = nt(a, 1, {
6135
5971
  // lookup type 2 subtable, format 1, coverage format 1
6136
5972
  substFormat: 1,
6137
5973
  coverage: { format: 1, glyphs: [] },
@@ -6142,7 +5978,7 @@ $.prototype.addMultiple = function(e, r, t, n) {
6142
5978
  u < 0 && (u = -1 - u, s.coverage.glyphs.splice(u, 0, i), s.sequences.splice(u, 0, 0)), s.sequences[u] = r.by;
6143
5979
  };
6144
5980
  $.prototype.addAlternate = function(e, r, t, n) {
6145
- var a = this.getLookupTables(t, n, e, 3, !0)[0], s = at(a, 1, {
5981
+ var a = this.getLookupTables(t, n, e, 3, !0)[0], s = nt(a, 1, {
6146
5982
  // lookup type 3 subtable, format 1, coverage format 1
6147
5983
  substFormat: 1,
6148
5984
  coverage: { format: 1, glyphs: [] },
@@ -6166,7 +6002,7 @@ $.prototype.addLigature = function(e, r, t, n) {
6166
6002
  }, l = this.binSearch(s.coverage.glyphs, i);
6167
6003
  if (l >= 0) {
6168
6004
  for (var f = s.ligatureSets[l], p = 0; p < f.length; p++)
6169
- if (vi(f[p].components, u))
6005
+ if (ii(f[p].components, u))
6170
6006
  return;
6171
6007
  f.push(o);
6172
6008
  } else
@@ -6204,10 +6040,10 @@ $.prototype.add = function(e, r, t, n) {
6204
6040
  return r.by instanceof Array ? this.addMultiple(e, r, t, n) : this.addLigature(e, r, t, n);
6205
6041
  }
6206
6042
  };
6207
- function gi() {
6043
+ function oi() {
6208
6044
  return typeof window < "u";
6209
6045
  }
6210
- function mi(e) {
6046
+ function ui(e) {
6211
6047
  for (var r = new Buffer(e.byteLength), t = new Uint8Array(e), n = 0; n < r.length; ++n)
6212
6048
  r[n] = t[n];
6213
6049
  return r;
@@ -6216,7 +6052,7 @@ function Ie(e, r) {
6216
6052
  if (!e)
6217
6053
  throw r;
6218
6054
  }
6219
- function Pt(e, r, t, n, a) {
6055
+ function It(e, r, t, n, a) {
6220
6056
  var s;
6221
6057
  return (r & n) > 0 ? (s = e.parseByte(), (r & a) === 0 && (s = -s), s = t + s) : (r & a) > 0 ? s = t : s = t + e.parseShort(), s;
6222
6058
  }
@@ -6242,9 +6078,9 @@ function zn(e, r, t) {
6242
6078
  for (var g = 0; g < l; g += 1)
6243
6079
  s = a[g], v = {}, v.onCurve = !!(s & 1), v.lastPointOfContour = i.indexOf(g) >= 0, h.push(v);
6244
6080
  for (var m = 0, y = 0; y < l; y += 1)
6245
- s = a[y], v = h[y], v.x = Pt(n, s, m, 2, 16), m = v.x;
6081
+ s = a[y], v = h[y], v.x = It(n, s, m, 2, 16), m = v.x;
6246
6082
  for (var S = 0, b = 0; b < l; b += 1)
6247
- s = a[b], v = h[b], v.y = Pt(n, s, S, 4, 32), S = v.y;
6083
+ s = a[b], v = h[b], v.y = It(n, s, S, 4, 32), S = v.y;
6248
6084
  }
6249
6085
  e.points = h;
6250
6086
  } else
@@ -6273,7 +6109,7 @@ function zn(e, r, t) {
6273
6109
  }
6274
6110
  }
6275
6111
  }
6276
- function Or(e, r) {
6112
+ function Lr(e, r) {
6277
6113
  for (var t = [], n = 0; n < e.length; n += 1) {
6278
6114
  var a = e[n], s = {
6279
6115
  x: r.xScale * a.x + r.scale01 * a.y + r.dx,
@@ -6285,7 +6121,7 @@ function Or(e, r) {
6285
6121
  }
6286
6122
  return t;
6287
6123
  }
6288
- function yi(e) {
6124
+ function li(e) {
6289
6125
  for (var r = [], t = [], n = 0; n < e.length; n += 1) {
6290
6126
  var a = e[n];
6291
6127
  t.push(a), a.lastPointOfContour && (r.push(t), t = []);
@@ -6296,7 +6132,7 @@ function Wn(e) {
6296
6132
  var r = new N();
6297
6133
  if (!e)
6298
6134
  return r;
6299
- for (var t = yi(e), n = 0; n < t.length; ++n) {
6135
+ for (var t = li(e), n = 0; n < t.length; ++n) {
6300
6136
  var a = t[n], s = null, i = a[a.length - 1], u = a[0];
6301
6137
  if (i.onCurve)
6302
6138
  r.moveTo(i.x, i.y);
@@ -6324,7 +6160,7 @@ function _n(e, r) {
6324
6160
  if (a.getPath(), a.points) {
6325
6161
  var s = void 0;
6326
6162
  if (n.matchedPoints === void 0)
6327
- s = Or(a.points, n);
6163
+ s = Lr(a.points, n);
6328
6164
  else {
6329
6165
  if (n.matchedPoints[0] > r.points.length - 1 || n.matchedPoints[1] > a.points.length - 1)
6330
6166
  throw Error("Matched points out of range in " + r.name);
@@ -6336,52 +6172,52 @@ function _n(e, r) {
6336
6172
  dx: 0,
6337
6173
  dy: 0
6338
6174
  };
6339
- u = Or([u], o)[0], o.dx = i.x - u.x, o.dy = i.y - u.y, s = Or(a.points, o);
6175
+ u = Lr([u], o)[0], o.dx = i.x - u.x, o.dy = i.y - u.y, s = Lr(a.points, o);
6340
6176
  }
6341
6177
  r.points = r.points.concat(s);
6342
6178
  }
6343
6179
  }
6344
6180
  return Wn(r.points);
6345
6181
  }
6346
- function xi(e, r, t, n) {
6182
+ function fi(e, r, t, n) {
6347
6183
  for (var a = new ce.GlyphSet(n), s = 0; s < t.length - 1; s += 1) {
6348
6184
  var i = t[s], u = t[s + 1];
6349
6185
  i !== u ? a.push(s, ce.ttfGlyphLoader(n, s, zn, e, r + i, _n)) : a.push(s, ce.glyphLoader(n, s));
6350
6186
  }
6351
6187
  return a;
6352
6188
  }
6353
- function bi(e, r, t, n) {
6189
+ function ci(e, r, t, n) {
6354
6190
  var a = new ce.GlyphSet(n);
6355
6191
  return n._push = function(s) {
6356
6192
  var i = t[s], u = t[s + 1];
6357
6193
  i !== u ? a.push(s, ce.ttfGlyphLoader(n, s, zn, e, r + i, _n)) : a.push(s, ce.glyphLoader(n, s));
6358
6194
  }, a;
6359
6195
  }
6360
- function Si(e, r, t, n, a) {
6361
- return a.lowMemory ? bi(e, r, t, n) : xi(e, r, t, n);
6196
+ function pi(e, r, t, n, a) {
6197
+ return a.lowMemory ? ci(e, r, t, n) : fi(e, r, t, n);
6362
6198
  }
6363
- var Vn = { getPath: Wn, parse: Si }, qn, Ce, Xn, Xr;
6199
+ var Vn = { getPath: Wn, parse: pi }, qn, Ce, Xn, qr;
6364
6200
  function Yn(e) {
6365
6201
  this.font = e, this.getCommands = function(r) {
6366
6202
  return Vn.getPath(r).commands;
6367
6203
  }, this._fpgmState = this._prepState = void 0, this._errorState = 0;
6368
6204
  }
6369
- function ki(e) {
6205
+ function hi(e) {
6370
6206
  return e;
6371
6207
  }
6372
6208
  function Zn(e) {
6373
6209
  return Math.sign(e) * Math.round(Math.abs(e));
6374
6210
  }
6375
- function Ti(e) {
6211
+ function di(e) {
6376
6212
  return Math.sign(e) * Math.round(Math.abs(e * 2)) / 2;
6377
6213
  }
6378
- function wi(e) {
6214
+ function vi(e) {
6379
6215
  return Math.sign(e) * (Math.round(Math.abs(e) + 0.5) - 0.5);
6380
6216
  }
6381
- function Fi(e) {
6217
+ function gi(e) {
6382
6218
  return Math.sign(e) * Math.ceil(Math.abs(e));
6383
6219
  }
6384
- function Ci(e) {
6220
+ function mi(e) {
6385
6221
  return Math.sign(e) * Math.floor(Math.abs(e));
6386
6222
  }
6387
6223
  var Kn = function(e) {
@@ -6557,7 +6393,7 @@ he.prototype.prevTouched = function(e) {
6557
6393
  r = r.prevPointOnContour;
6558
6394
  return r;
6559
6395
  };
6560
- var Ve = Object.freeze(new he(0, 0)), Ui = {
6396
+ var We = Object.freeze(new he(0, 0)), yi = {
6561
6397
  cvCutIn: 17 / 16,
6562
6398
  // control value cut in
6563
6399
  deltaBase: 9,
@@ -6585,7 +6421,7 @@ Yn.prototype.exec = function(e, r) {
6585
6421
  if (!n || n.ppem !== r) {
6586
6422
  var a = this._fpgmState;
6587
6423
  if (!a) {
6588
- me.prototype = Ui, a = this._fpgmState = new me("fpgm", t.tables.fpgm), a.funcs = [], a.font = t, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
6424
+ me.prototype = yi, a = this._fpgmState = new me("fpgm", t.tables.fpgm), a.funcs = [], a.font = t, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
6589
6425
  try {
6590
6426
  Ce(a);
6591
6427
  } catch (l) {
@@ -6619,13 +6455,13 @@ Yn.prototype.exec = function(e, r) {
6619
6455
  Xn = function(e, r) {
6620
6456
  var t = r.ppem / r.font.unitsPerEm, n = t, a = e.components, s, i, u;
6621
6457
  if (me.prototype = r, !a)
6622
- u = new me("glyf", e.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), u.step = -1), Xr(e, u, t, n), i = u.gZone;
6458
+ u = new me("glyf", e.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), u.step = -1), qr(e, u, t, n), i = u.gZone;
6623
6459
  else {
6624
6460
  var o = r.font;
6625
6461
  i = [], s = [];
6626
6462
  for (var l = 0; l < a.length; l++) {
6627
6463
  var f = a[l], p = o.glyphs.get(f.glyphIndex);
6628
- u = new me("glyf", p.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), u.step = -1), Xr(p, u, t, n);
6464
+ u = new me("glyf", p.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), u.step = -1), qr(p, u, t, n);
6629
6465
  for (var c = Math.round(f.dx * t), h = Math.round(f.dy * n), v = u.gZone, g = u.contours, m = 0; m < v.length; m++) {
6630
6466
  var y = v[m];
6631
6467
  y.xTouched = y.yTouched = !1, y.xo = y.x = y.x + c, y.yo = y.y = y.y + h;
@@ -6642,7 +6478,7 @@ Xn = function(e, r) {
6642
6478
  }
6643
6479
  return i;
6644
6480
  };
6645
- Xr = function(e, r, t, n) {
6481
+ qr = function(e, r, t, n) {
6646
6482
  for (var a = e.points || [], s = a.length, i = r.gZone = r.z0 = r.z1 = r.z2 = [], u = r.contours = [], o, l = 0; l < s; l++)
6647
6483
  o = a[l], i[l] = new he(
6648
6484
  o.x * t,
@@ -6705,62 +6541,62 @@ function jn(e, r) {
6705
6541
  while (a > 0);
6706
6542
  e.ip = n;
6707
6543
  }
6708
- function Bt(e, r) {
6544
+ function Pt(e, r) {
6709
6545
  exports.DEBUG && console.log(r.step, "SVTCA[" + e.axis + "]"), r.fv = r.pv = r.dpv = e;
6710
6546
  }
6711
- function Mt(e, r) {
6547
+ function Bt(e, r) {
6712
6548
  exports.DEBUG && console.log(r.step, "SPVTCA[" + e.axis + "]"), r.pv = r.dpv = e;
6713
6549
  }
6714
- function Gt(e, r) {
6550
+ function Mt(e, r) {
6715
6551
  exports.DEBUG && console.log(r.step, "SFVTCA[" + e.axis + "]"), r.fv = e;
6716
6552
  }
6717
- function Nt(e, r) {
6553
+ function Gt(e, r) {
6718
6554
  var t = r.stack, n = t.pop(), a = t.pop(), s = r.z2[n], i = r.z1[a];
6719
6555
  exports.DEBUG && console.log("SPVTL[" + e + "]", n, a);
6720
6556
  var u, o;
6721
6557
  e ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), r.pv = r.dpv = Ze(u, o);
6722
6558
  }
6723
- function Ht(e, r) {
6559
+ function Nt(e, r) {
6724
6560
  var t = r.stack, n = t.pop(), a = t.pop(), s = r.z2[n], i = r.z1[a];
6725
6561
  exports.DEBUG && console.log("SFVTL[" + e + "]", n, a);
6726
6562
  var u, o;
6727
6563
  e ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), r.fv = Ze(u, o);
6728
6564
  }
6729
- function Ei(e) {
6565
+ function xi(e) {
6730
6566
  var r = e.stack, t = r.pop(), n = r.pop();
6731
6567
  exports.DEBUG && console.log(e.step, "SPVFS[]", t, n), e.pv = e.dpv = Ze(n, t);
6732
6568
  }
6733
- function Li(e) {
6569
+ function bi(e) {
6734
6570
  var r = e.stack, t = r.pop(), n = r.pop();
6735
6571
  exports.DEBUG && console.log(e.step, "SPVFS[]", t, n), e.fv = Ze(n, t);
6736
6572
  }
6737
- function Oi(e) {
6573
+ function Si(e) {
6738
6574
  var r = e.stack, t = e.pv;
6739
6575
  exports.DEBUG && console.log(e.step, "GPV[]"), r.push(t.x * 16384), r.push(t.y * 16384);
6740
6576
  }
6741
- function Ri(e) {
6577
+ function ki(e) {
6742
6578
  var r = e.stack, t = e.fv;
6743
6579
  exports.DEBUG && console.log(e.step, "GFV[]"), r.push(t.x * 16384), r.push(t.y * 16384);
6744
6580
  }
6745
- function Ai(e) {
6581
+ function Ti(e) {
6746
6582
  e.fv = e.pv, exports.DEBUG && console.log(e.step, "SFVTPV[]");
6747
6583
  }
6748
- function Di(e) {
6584
+ function wi(e) {
6749
6585
  var r = e.stack, t = r.pop(), n = r.pop(), a = r.pop(), s = r.pop(), i = r.pop(), u = e.z0, o = e.z1, l = u[t], f = u[n], p = o[a], c = o[s], h = e.z2[i];
6750
6586
  exports.DEBUG && console.log("ISECT[], ", t, n, a, s, i);
6751
6587
  var v = l.x, g = l.y, m = f.x, y = f.y, S = p.x, b = p.y, O = c.x, C = c.y, R = (v - m) * (b - C) - (g - y) * (S - O), L = v * y - g * m, F = S * C - b * O;
6752
6588
  h.x = (L * (S - O) - F * (v - m)) / R, h.y = (L * (b - C) - F * (g - y)) / R;
6753
6589
  }
6754
- function Ii(e) {
6590
+ function Fi(e) {
6755
6591
  e.rp0 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP0[]", e.rp0);
6756
6592
  }
6757
- function Pi(e) {
6593
+ function Ci(e) {
6758
6594
  e.rp1 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP1[]", e.rp1);
6759
6595
  }
6760
- function Bi(e) {
6596
+ function Ui(e) {
6761
6597
  e.rp2 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP2[]", e.rp2);
6762
6598
  }
6763
- function Mi(e) {
6599
+ function Ei(e) {
6764
6600
  var r = e.stack.pop();
6765
6601
  switch (exports.DEBUG && console.log(e.step, "SZP0[]", r), e.zp0 = r, r) {
6766
6602
  case 0:
@@ -6773,7 +6609,7 @@ function Mi(e) {
6773
6609
  throw new Error("Invalid zone pointer");
6774
6610
  }
6775
6611
  }
6776
- function Gi(e) {
6612
+ function Li(e) {
6777
6613
  var r = e.stack.pop();
6778
6614
  switch (exports.DEBUG && console.log(e.step, "SZP1[]", r), e.zp1 = r, r) {
6779
6615
  case 0:
@@ -6786,7 +6622,7 @@ function Gi(e) {
6786
6622
  throw new Error("Invalid zone pointer");
6787
6623
  }
6788
6624
  }
6789
- function Ni(e) {
6625
+ function Oi(e) {
6790
6626
  var r = e.stack.pop();
6791
6627
  switch (exports.DEBUG && console.log(e.step, "SZP2[]", r), e.zp2 = r, r) {
6792
6628
  case 0:
@@ -6799,7 +6635,7 @@ function Ni(e) {
6799
6635
  throw new Error("Invalid zone pointer");
6800
6636
  }
6801
6637
  }
6802
- function Hi(e) {
6638
+ function Ri(e) {
6803
6639
  var r = e.stack.pop();
6804
6640
  switch (exports.DEBUG && console.log(e.step, "SZPS[]", r), e.zp0 = e.zp1 = e.zp2 = r, r) {
6805
6641
  case 0:
@@ -6812,49 +6648,49 @@ function Hi(e) {
6812
6648
  throw new Error("Invalid zone pointer");
6813
6649
  }
6814
6650
  }
6815
- function zi(e) {
6651
+ function Ai(e) {
6816
6652
  e.loop = e.stack.pop(), exports.DEBUG && console.log(e.step, "SLOOP[]", e.loop);
6817
6653
  }
6818
- function Wi(e) {
6654
+ function Di(e) {
6819
6655
  exports.DEBUG && console.log(e.step, "RTG[]"), e.round = Zn;
6820
6656
  }
6821
- function _i(e) {
6822
- exports.DEBUG && console.log(e.step, "RTHG[]"), e.round = wi;
6657
+ function Ii(e) {
6658
+ exports.DEBUG && console.log(e.step, "RTHG[]"), e.round = vi;
6823
6659
  }
6824
- function Vi(e) {
6660
+ function Pi(e) {
6825
6661
  var r = e.stack.pop();
6826
6662
  exports.DEBUG && console.log(e.step, "SMD[]", r), e.minDis = r / 64;
6827
6663
  }
6828
- function qi(e) {
6664
+ function Bi(e) {
6829
6665
  exports.DEBUG && console.log(e.step, "ELSE[]"), jn(e, !1);
6830
6666
  }
6831
- function Xi(e) {
6667
+ function Mi(e) {
6832
6668
  var r = e.stack.pop();
6833
6669
  exports.DEBUG && console.log(e.step, "JMPR[]", r), e.ip += r - 1;
6834
6670
  }
6835
- function Yi(e) {
6671
+ function Gi(e) {
6836
6672
  var r = e.stack.pop();
6837
6673
  exports.DEBUG && console.log(e.step, "SCVTCI[]", r), e.cvCutIn = r / 64;
6838
6674
  }
6839
- function Zi(e) {
6675
+ function Ni(e) {
6840
6676
  var r = e.stack;
6841
6677
  exports.DEBUG && console.log(e.step, "DUP[]"), r.push(r[r.length - 1]);
6842
6678
  }
6843
- function Rr(e) {
6679
+ function Or(e) {
6844
6680
  exports.DEBUG && console.log(e.step, "POP[]"), e.stack.pop();
6845
6681
  }
6846
- function Ki(e) {
6682
+ function Hi(e) {
6847
6683
  exports.DEBUG && console.log(e.step, "CLEAR[]"), e.stack.length = 0;
6848
6684
  }
6849
- function ji(e) {
6685
+ function zi(e) {
6850
6686
  var r = e.stack, t = r.pop(), n = r.pop();
6851
6687
  exports.DEBUG && console.log(e.step, "SWAP[]"), r.push(t), r.push(n);
6852
6688
  }
6853
- function Qi(e) {
6689
+ function Wi(e) {
6854
6690
  var r = e.stack;
6855
6691
  exports.DEBUG && console.log(e.step, "DEPTH[]"), r.push(r.length);
6856
6692
  }
6857
- function $i(e) {
6693
+ function _i(e) {
6858
6694
  var r = e.stack, t = r.pop(), n = r.pop();
6859
6695
  exports.DEBUG && console.log(e.step, "LOOPCALL[]", t, n);
6860
6696
  var a = e.ip, s = e.prog;
@@ -6867,21 +6703,21 @@ function $i(e) {
6867
6703
  );
6868
6704
  e.ip = a, e.prog = s;
6869
6705
  }
6870
- function Ji(e) {
6706
+ function Vi(e) {
6871
6707
  var r = e.stack.pop();
6872
6708
  exports.DEBUG && console.log(e.step, "CALL[]", r);
6873
6709
  var t = e.ip, n = e.prog;
6874
6710
  e.prog = e.funcs[r], Ce(e), e.ip = t, e.prog = n, exports.DEBUG && console.log(++e.step, "returning from", r);
6875
6711
  }
6876
- function eo(e) {
6712
+ function qi(e) {
6877
6713
  var r = e.stack, t = r.pop();
6878
6714
  exports.DEBUG && console.log(e.step, "CINDEX[]", t), r.push(r[r.length - t]);
6879
6715
  }
6880
- function ro(e) {
6716
+ function Xi(e) {
6881
6717
  var r = e.stack, t = r.pop();
6882
6718
  exports.DEBUG && console.log(e.step, "MINDEX[]", t), r.push(r.splice(r.length - t, 1)[0]);
6883
6719
  }
6884
- function to(e) {
6720
+ function Yi(e) {
6885
6721
  if (e.env !== "fpgm")
6886
6722
  throw new Error("FDEF not allowed here");
6887
6723
  var r = e.stack, t = e.prog, n = e.ip, a = r.pop(), s = n;
@@ -6889,19 +6725,19 @@ function to(e) {
6889
6725
  ;
6890
6726
  e.ip = n, e.funcs[a] = t.slice(s + 1, n);
6891
6727
  }
6892
- function zt(e, r) {
6728
+ function Ht(e, r) {
6893
6729
  var t = r.stack.pop(), n = r.z0[t], a = r.fv, s = r.pv;
6894
6730
  exports.DEBUG && console.log(r.step, "MDAP[" + e + "]", t);
6895
- var i = s.distance(n, Ve);
6896
- e && (i = r.round(i)), a.setRelative(n, Ve, i, s), a.touch(n), r.rp0 = r.rp1 = t;
6731
+ var i = s.distance(n, We);
6732
+ e && (i = r.round(i)), a.setRelative(n, We, i, s), a.touch(n), r.rp0 = r.rp1 = t;
6897
6733
  }
6898
- function Wt(e, r) {
6734
+ function zt(e, r) {
6899
6735
  var t = r.z2, n = t.length - 2, a, s, i;
6900
6736
  exports.DEBUG && console.log(r.step, "IUP[" + e.axis + "]");
6901
6737
  for (var u = 0; u < n; u++)
6902
6738
  a = t[u], !e.touched(a) && (s = a.prevTouched(e), s !== a && (i = a.nextTouched(e), s === i && e.setRelative(a, a, e.distance(s, s, !1, !0), e, !0), e.interpolate(a, s, i, e)));
6903
6739
  }
6904
- function _t(e, r) {
6740
+ function Wt(e, r) {
6905
6741
  for (var t = r.stack, n = e ? r.rp1 : r.rp2, a = (e ? r.z0 : r.z1)[n], s = r.fv, i = r.pv, u = r.loop, o = r.z2; u--; ) {
6906
6742
  var l = t.pop(), f = o[l], p = i.distance(a, a, !1, !0);
6907
6743
  s.setRelative(f, f, p, i), s.touch(f), exports.DEBUG && console.log(
@@ -6912,7 +6748,7 @@ function _t(e, r) {
6912
6748
  }
6913
6749
  r.loop = 1;
6914
6750
  }
6915
- function Vt(e, r) {
6751
+ function _t(e, r) {
6916
6752
  var t = r.stack, n = e ? r.rp1 : r.rp2, a = (e ? r.z0 : r.z1)[n], s = r.fv, i = r.pv, u = t.pop(), o = r.z2[r.contours[u]], l = o;
6917
6753
  exports.DEBUG && console.log(r.step, "SHC[" + e + "]", u);
6918
6754
  var f = i.distance(a, a, !1, !0);
@@ -6920,7 +6756,7 @@ function Vt(e, r) {
6920
6756
  l !== a && s.setRelative(l, l, f, i), l = l.nextPointOnContour;
6921
6757
  while (l !== o);
6922
6758
  }
6923
- function qt(e, r) {
6759
+ function Vt(e, r) {
6924
6760
  var t = r.stack, n = e ? r.rp1 : r.rp2, a = (e ? r.z0 : r.z1)[n], s = r.fv, i = r.pv, u = t.pop();
6925
6761
  exports.DEBUG && console.log(r.step, "SHZ[" + e + "]", u);
6926
6762
  var o;
@@ -6937,7 +6773,7 @@ function qt(e, r) {
6937
6773
  for (var l, f = i.distance(a, a, !1, !0), p = o.length - 2, c = 0; c < p; c++)
6938
6774
  l = o[c], s.setRelative(l, l, f, i);
6939
6775
  }
6940
- function no(e) {
6776
+ function Zi(e) {
6941
6777
  for (var r = e.stack, t = e.loop, n = e.fv, a = r.pop() / 64, s = e.z2; t--; ) {
6942
6778
  var i = r.pop(), u = s[i];
6943
6779
  exports.DEBUG && console.log(
@@ -6949,7 +6785,7 @@ function no(e) {
6949
6785
  }
6950
6786
  e.loop = 1;
6951
6787
  }
6952
- function ao(e) {
6788
+ function Ki(e) {
6953
6789
  for (var r = e.stack, t = e.rp1, n = e.rp2, a = e.loop, s = e.z0[t], i = e.z1[n], u = e.fv, o = e.dpv, l = e.z2; a--; ) {
6954
6790
  var f = r.pop(), p = l[f];
6955
6791
  exports.DEBUG && console.log(
@@ -6963,11 +6799,11 @@ function ao(e) {
6963
6799
  }
6964
6800
  e.loop = 1;
6965
6801
  }
6966
- function Xt(e, r) {
6802
+ function qt(e, r) {
6967
6803
  var t = r.stack, n = t.pop() / 64, a = t.pop(), s = r.z1[a], i = r.z0[r.rp0], u = r.fv, o = r.pv;
6968
6804
  u.setRelative(s, i, n, o), u.touch(s), exports.DEBUG && console.log(r.step, "MSIRP[" + e + "]", n, a), r.rp1 = r.rp0, r.rp2 = a, e && (r.rp0 = a);
6969
6805
  }
6970
- function so(e) {
6806
+ function ji(e) {
6971
6807
  for (var r = e.stack, t = e.rp0, n = e.z0[t], a = e.loop, s = e.fv, i = e.pv, u = e.z1; a--; ) {
6972
6808
  var o = r.pop(), l = u[o];
6973
6809
  exports.DEBUG && console.log(
@@ -6978,10 +6814,10 @@ function so(e) {
6978
6814
  }
6979
6815
  e.loop = 1;
6980
6816
  }
6981
- function io(e) {
6982
- exports.DEBUG && console.log(e.step, "RTDG[]"), e.round = Ti;
6817
+ function Qi(e) {
6818
+ exports.DEBUG && console.log(e.step, "RTDG[]"), e.round = di;
6983
6819
  }
6984
- function Yt(e, r) {
6820
+ function Xt(e, r) {
6985
6821
  var t = r.stack, n = t.pop(), a = t.pop(), s = r.z0[a], i = r.fv, u = r.pv, o = r.cvt[n];
6986
6822
  exports.DEBUG && console.log(
6987
6823
  r.step,
@@ -6992,17 +6828,17 @@ function Yt(e, r) {
6992
6828
  ")",
6993
6829
  a
6994
6830
  );
6995
- var l = u.distance(s, Ve);
6996
- e && (Math.abs(l - o) < r.cvCutIn && (l = o), l = r.round(l)), i.setRelative(s, Ve, l, u), r.zp0 === 0 && (s.xo = s.x, s.yo = s.y), i.touch(s), r.rp0 = r.rp1 = a;
6831
+ var l = u.distance(s, We);
6832
+ e && (Math.abs(l - o) < r.cvCutIn && (l = o), l = r.round(l)), i.setRelative(s, We, l, u), r.zp0 === 0 && (s.xo = s.x, s.yo = s.y), i.touch(s), r.rp0 = r.rp1 = a;
6997
6833
  }
6998
- function oo(e) {
6834
+ function $i(e) {
6999
6835
  var r = e.prog, t = e.ip, n = e.stack, a = r[++t];
7000
6836
  exports.DEBUG && console.log(e.step, "NPUSHB[]", a);
7001
6837
  for (var s = 0; s < a; s++)
7002
6838
  n.push(r[++t]);
7003
6839
  e.ip = t;
7004
6840
  }
7005
- function uo(e) {
6841
+ function Ji(e) {
7006
6842
  var r = e.ip, t = e.prog, n = e.stack, a = t[++r];
7007
6843
  exports.DEBUG && console.log(e.step, "NPUSHW[]", a);
7008
6844
  for (var s = 0; s < a; s++) {
@@ -7011,92 +6847,92 @@ function uo(e) {
7011
6847
  }
7012
6848
  e.ip = r;
7013
6849
  }
7014
- function lo(e) {
6850
+ function eo(e) {
7015
6851
  var r = e.stack, t = e.store;
7016
6852
  t || (t = e.store = []);
7017
6853
  var n = r.pop(), a = r.pop();
7018
6854
  exports.DEBUG && console.log(e.step, "WS", n, a), t[a] = n;
7019
6855
  }
7020
- function fo(e) {
6856
+ function ro(e) {
7021
6857
  var r = e.stack, t = e.store, n = r.pop();
7022
6858
  exports.DEBUG && console.log(e.step, "RS", n);
7023
6859
  var a = t && t[n] || 0;
7024
6860
  r.push(a);
7025
6861
  }
7026
- function co(e) {
6862
+ function to(e) {
7027
6863
  var r = e.stack, t = r.pop(), n = r.pop();
7028
6864
  exports.DEBUG && console.log(e.step, "WCVTP", t, n), e.cvt[n] = t / 64;
7029
6865
  }
7030
- function po(e) {
6866
+ function no(e) {
7031
6867
  var r = e.stack, t = r.pop();
7032
6868
  exports.DEBUG && console.log(e.step, "RCVT", t), r.push(e.cvt[t] * 64);
7033
6869
  }
7034
- function Zt(e, r) {
6870
+ function Yt(e, r) {
7035
6871
  var t = r.stack, n = t.pop(), a = r.z2[n];
7036
- exports.DEBUG && console.log(r.step, "GC[" + e + "]", n), t.push(r.dpv.distance(a, Ve, e, !1) * 64);
6872
+ exports.DEBUG && console.log(r.step, "GC[" + e + "]", n), t.push(r.dpv.distance(a, We, e, !1) * 64);
7037
6873
  }
7038
- function Kt(e, r) {
6874
+ function Zt(e, r) {
7039
6875
  var t = r.stack, n = t.pop(), a = t.pop(), s = r.z1[n], i = r.z0[a], u = r.dpv.distance(i, s, e, e);
7040
6876
  exports.DEBUG && console.log(r.step, "MD[" + e + "]", n, a, "->", u), r.stack.push(Math.round(u * 64));
7041
6877
  }
7042
- function ho(e) {
6878
+ function ao(e) {
7043
6879
  exports.DEBUG && console.log(e.step, "MPPEM[]"), e.stack.push(e.ppem);
7044
6880
  }
7045
- function vo(e) {
6881
+ function so(e) {
7046
6882
  exports.DEBUG && console.log(e.step, "FLIPON[]"), e.autoFlip = !0;
7047
6883
  }
7048
- function go(e) {
6884
+ function io(e) {
7049
6885
  var r = e.stack, t = r.pop(), n = r.pop();
7050
6886
  exports.DEBUG && console.log(e.step, "LT[]", t, n), r.push(n < t ? 1 : 0);
7051
6887
  }
7052
- function mo(e) {
6888
+ function oo(e) {
7053
6889
  var r = e.stack, t = r.pop(), n = r.pop();
7054
6890
  exports.DEBUG && console.log(e.step, "LTEQ[]", t, n), r.push(n <= t ? 1 : 0);
7055
6891
  }
7056
- function yo(e) {
6892
+ function uo(e) {
7057
6893
  var r = e.stack, t = r.pop(), n = r.pop();
7058
6894
  exports.DEBUG && console.log(e.step, "GT[]", t, n), r.push(n > t ? 1 : 0);
7059
6895
  }
7060
- function xo(e) {
6896
+ function lo(e) {
7061
6897
  var r = e.stack, t = r.pop(), n = r.pop();
7062
6898
  exports.DEBUG && console.log(e.step, "GTEQ[]", t, n), r.push(n >= t ? 1 : 0);
7063
6899
  }
7064
- function bo(e) {
6900
+ function fo(e) {
7065
6901
  var r = e.stack, t = r.pop(), n = r.pop();
7066
6902
  exports.DEBUG && console.log(e.step, "EQ[]", t, n), r.push(t === n ? 1 : 0);
7067
6903
  }
7068
- function So(e) {
6904
+ function co(e) {
7069
6905
  var r = e.stack, t = r.pop(), n = r.pop();
7070
6906
  exports.DEBUG && console.log(e.step, "NEQ[]", t, n), r.push(t !== n ? 1 : 0);
7071
6907
  }
7072
- function ko(e) {
6908
+ function po(e) {
7073
6909
  var r = e.stack, t = r.pop();
7074
6910
  exports.DEBUG && console.log(e.step, "ODD[]", t), r.push(Math.trunc(t) % 2 ? 1 : 0);
7075
6911
  }
7076
- function To(e) {
6912
+ function ho(e) {
7077
6913
  var r = e.stack, t = r.pop();
7078
6914
  exports.DEBUG && console.log(e.step, "EVEN[]", t), r.push(Math.trunc(t) % 2 ? 0 : 1);
7079
6915
  }
7080
- function wo(e) {
6916
+ function vo(e) {
7081
6917
  var r = e.stack.pop();
7082
6918
  exports.DEBUG && console.log(e.step, "IF[]", r), r || (jn(e, !0), exports.DEBUG && console.log(e.step, "EIF[]"));
7083
6919
  }
7084
- function Fo(e) {
6920
+ function go(e) {
7085
6921
  exports.DEBUG && console.log(e.step, "EIF[]");
7086
6922
  }
7087
- function Co(e) {
6923
+ function mo(e) {
7088
6924
  var r = e.stack, t = r.pop(), n = r.pop();
7089
6925
  exports.DEBUG && console.log(e.step, "AND[]", t, n), r.push(t && n ? 1 : 0);
7090
6926
  }
7091
- function Uo(e) {
6927
+ function yo(e) {
7092
6928
  var r = e.stack, t = r.pop(), n = r.pop();
7093
6929
  exports.DEBUG && console.log(e.step, "OR[]", t, n), r.push(t || n ? 1 : 0);
7094
6930
  }
7095
- function Eo(e) {
6931
+ function xo(e) {
7096
6932
  var r = e.stack, t = r.pop();
7097
6933
  exports.DEBUG && console.log(e.step, "NOT[]", t), r.push(t ? 0 : 1);
7098
6934
  }
7099
- function Ar(e, r) {
6935
+ function Rr(e, r) {
7100
6936
  var t = r.stack, n = t.pop(), a = r.fv, s = r.pv, i = r.ppem, u = r.deltaBase + (e - 1) * 16, o = r.deltaShift, l = r.z0;
7101
6937
  exports.DEBUG && console.log(r.step, "DELTAP[" + e + "]", n, t);
7102
6938
  for (var f = 0; f < n; f++) {
@@ -7109,43 +6945,43 @@ function Ar(e, r) {
7109
6945
  }
7110
6946
  }
7111
6947
  }
7112
- function Lo(e) {
6948
+ function bo(e) {
7113
6949
  var r = e.stack, t = r.pop();
7114
6950
  exports.DEBUG && console.log(e.step, "SDB[]", t), e.deltaBase = t;
7115
6951
  }
7116
- function Oo(e) {
6952
+ function So(e) {
7117
6953
  var r = e.stack, t = r.pop();
7118
6954
  exports.DEBUG && console.log(e.step, "SDS[]", t), e.deltaShift = Math.pow(0.5, t);
7119
6955
  }
7120
- function Ro(e) {
6956
+ function ko(e) {
7121
6957
  var r = e.stack, t = r.pop(), n = r.pop();
7122
6958
  exports.DEBUG && console.log(e.step, "ADD[]", t, n), r.push(n + t);
7123
6959
  }
7124
- function Ao(e) {
6960
+ function To(e) {
7125
6961
  var r = e.stack, t = r.pop(), n = r.pop();
7126
6962
  exports.DEBUG && console.log(e.step, "SUB[]", t, n), r.push(n - t);
7127
6963
  }
7128
- function Do(e) {
6964
+ function wo(e) {
7129
6965
  var r = e.stack, t = r.pop(), n = r.pop();
7130
6966
  exports.DEBUG && console.log(e.step, "DIV[]", t, n), r.push(n * 64 / t);
7131
6967
  }
7132
- function Io(e) {
6968
+ function Fo(e) {
7133
6969
  var r = e.stack, t = r.pop(), n = r.pop();
7134
6970
  exports.DEBUG && console.log(e.step, "MUL[]", t, n), r.push(n * t / 64);
7135
6971
  }
7136
- function Po(e) {
6972
+ function Co(e) {
7137
6973
  var r = e.stack, t = r.pop();
7138
6974
  exports.DEBUG && console.log(e.step, "ABS[]", t), r.push(Math.abs(t));
7139
6975
  }
7140
- function Bo(e) {
6976
+ function Uo(e) {
7141
6977
  var r = e.stack, t = r.pop();
7142
6978
  exports.DEBUG && console.log(e.step, "NEG[]", t), r.push(-t);
7143
6979
  }
7144
- function Mo(e) {
6980
+ function Eo(e) {
7145
6981
  var r = e.stack, t = r.pop();
7146
6982
  exports.DEBUG && console.log(e.step, "FLOOR[]", t), r.push(Math.floor(t / 64) * 64);
7147
6983
  }
7148
- function Go(e) {
6984
+ function Lo(e) {
7149
6985
  var r = e.stack, t = r.pop();
7150
6986
  exports.DEBUG && console.log(e.step, "CEILING[]", t), r.push(Math.ceil(t / 64) * 64);
7151
6987
  }
@@ -7153,11 +6989,11 @@ function ir(e, r) {
7153
6989
  var t = r.stack, n = t.pop();
7154
6990
  exports.DEBUG && console.log(r.step, "ROUND[]"), t.push(r.round(n / 64) * 64);
7155
6991
  }
7156
- function No(e) {
6992
+ function Oo(e) {
7157
6993
  var r = e.stack, t = r.pop(), n = r.pop();
7158
6994
  exports.DEBUG && console.log(e.step, "WCVTF[]", t, n), e.cvt[n] = t * e.ppem / e.font.unitsPerEm;
7159
6995
  }
7160
- function Dr(e, r) {
6996
+ function Ar(e, r) {
7161
6997
  var t = r.stack, n = t.pop(), a = r.ppem, s = r.deltaBase + (e - 1) * 16, i = r.deltaShift;
7162
6998
  exports.DEBUG && console.log(r.step, "DELTAC[" + e + "]", n, t);
7163
6999
  for (var u = 0; u < n; u++) {
@@ -7170,7 +7006,7 @@ function Dr(e, r) {
7170
7006
  }
7171
7007
  }
7172
7008
  }
7173
- function Ho(e) {
7009
+ function Ro(e) {
7174
7010
  var r = e.stack.pop();
7175
7011
  exports.DEBUG && console.log(e.step, "SROUND[]", r), e.round = Kn;
7176
7012
  var t;
@@ -7205,7 +7041,7 @@ function Ho(e) {
7205
7041
  }
7206
7042
  r &= 15, r === 0 ? e.srThreshold = 0 : e.srThreshold = (r / 8 - 0.5) * t;
7207
7043
  }
7208
- function zo(e) {
7044
+ function Ao(e) {
7209
7045
  var r = e.stack.pop();
7210
7046
  exports.DEBUG && console.log(e.step, "S45ROUND[]", r), e.round = Kn;
7211
7047
  var t;
@@ -7240,46 +7076,46 @@ function zo(e) {
7240
7076
  }
7241
7077
  r &= 15, r === 0 ? e.srThreshold = 0 : e.srThreshold = (r / 8 - 0.5) * t;
7242
7078
  }
7243
- function Wo(e) {
7244
- exports.DEBUG && console.log(e.step, "ROFF[]"), e.round = ki;
7079
+ function Do(e) {
7080
+ exports.DEBUG && console.log(e.step, "ROFF[]"), e.round = hi;
7245
7081
  }
7246
- function _o(e) {
7247
- exports.DEBUG && console.log(e.step, "RUTG[]"), e.round = Fi;
7082
+ function Io(e) {
7083
+ exports.DEBUG && console.log(e.step, "RUTG[]"), e.round = gi;
7248
7084
  }
7249
- function Vo(e) {
7250
- exports.DEBUG && console.log(e.step, "RDTG[]"), e.round = Ci;
7085
+ function Po(e) {
7086
+ exports.DEBUG && console.log(e.step, "RDTG[]"), e.round = mi;
7251
7087
  }
7252
- function qo(e) {
7088
+ function Bo(e) {
7253
7089
  var r = e.stack.pop();
7254
7090
  exports.DEBUG && console.log(e.step, "SCANCTRL[]", r);
7255
7091
  }
7256
- function jt(e, r) {
7092
+ function Kt(e, r) {
7257
7093
  var t = r.stack, n = t.pop(), a = t.pop(), s = r.z2[n], i = r.z1[a];
7258
7094
  exports.DEBUG && console.log(r.step, "SDPVTL[" + e + "]", n, a);
7259
7095
  var u, o;
7260
7096
  e ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), r.dpv = Ze(u, o);
7261
7097
  }
7262
- function Xo(e) {
7098
+ function Mo(e) {
7263
7099
  var r = e.stack, t = r.pop(), n = 0;
7264
7100
  exports.DEBUG && console.log(e.step, "GETINFO[]", t), t & 1 && (n = 35), t & 32 && (n |= 4096), r.push(n);
7265
7101
  }
7266
- function Yo(e) {
7102
+ function Go(e) {
7267
7103
  var r = e.stack, t = r.pop(), n = r.pop(), a = r.pop();
7268
7104
  exports.DEBUG && console.log(e.step, "ROLL[]"), r.push(n), r.push(t), r.push(a);
7269
7105
  }
7270
- function Zo(e) {
7106
+ function No(e) {
7271
7107
  var r = e.stack, t = r.pop(), n = r.pop();
7272
7108
  exports.DEBUG && console.log(e.step, "MAX[]", t, n), r.push(Math.max(n, t));
7273
7109
  }
7274
- function Ko(e) {
7110
+ function Ho(e) {
7275
7111
  var r = e.stack, t = r.pop(), n = r.pop();
7276
7112
  exports.DEBUG && console.log(e.step, "MIN[]", t, n), r.push(Math.min(n, t));
7277
7113
  }
7278
- function jo(e) {
7114
+ function zo(e) {
7279
7115
  var r = e.stack.pop();
7280
7116
  exports.DEBUG && console.log(e.step, "SCANTYPE[]", r);
7281
7117
  }
7282
- function Qo(e) {
7118
+ function Wo(e) {
7283
7119
  var r = e.stack.pop(), t = e.stack.pop();
7284
7120
  switch (exports.DEBUG && console.log(e.step, "INSTCTRL[]", r, t), r) {
7285
7121
  case 1:
@@ -7324,65 +7160,65 @@ function T(e, r, t, n, a, s) {
7324
7160
  }
7325
7161
  qn = [
7326
7162
  /* 0x00 */
7327
- Bt.bind(void 0, pe),
7163
+ Pt.bind(void 0, pe),
7328
7164
  /* 0x01 */
7329
- Bt.bind(void 0, fe),
7165
+ Pt.bind(void 0, fe),
7330
7166
  /* 0x02 */
7331
- Mt.bind(void 0, pe),
7167
+ Bt.bind(void 0, pe),
7332
7168
  /* 0x03 */
7333
- Mt.bind(void 0, fe),
7169
+ Bt.bind(void 0, fe),
7334
7170
  /* 0x04 */
7335
- Gt.bind(void 0, pe),
7171
+ Mt.bind(void 0, pe),
7336
7172
  /* 0x05 */
7337
- Gt.bind(void 0, fe),
7173
+ Mt.bind(void 0, fe),
7338
7174
  /* 0x06 */
7339
- Nt.bind(void 0, 0),
7175
+ Gt.bind(void 0, 0),
7340
7176
  /* 0x07 */
7341
- Nt.bind(void 0, 1),
7177
+ Gt.bind(void 0, 1),
7342
7178
  /* 0x08 */
7343
- Ht.bind(void 0, 0),
7179
+ Nt.bind(void 0, 0),
7344
7180
  /* 0x09 */
7345
- Ht.bind(void 0, 1),
7181
+ Nt.bind(void 0, 1),
7346
7182
  /* 0x0A */
7347
- Ei,
7183
+ xi,
7348
7184
  /* 0x0B */
7349
- Li,
7185
+ bi,
7350
7186
  /* 0x0C */
7351
- Oi,
7187
+ Si,
7352
7188
  /* 0x0D */
7353
- Ri,
7189
+ ki,
7354
7190
  /* 0x0E */
7355
- Ai,
7191
+ Ti,
7356
7192
  /* 0x0F */
7357
- Di,
7193
+ wi,
7358
7194
  /* 0x10 */
7359
- Ii,
7195
+ Fi,
7360
7196
  /* 0x11 */
7361
- Pi,
7197
+ Ci,
7362
7198
  /* 0x12 */
7363
- Bi,
7199
+ Ui,
7364
7200
  /* 0x13 */
7365
- Mi,
7201
+ Ei,
7366
7202
  /* 0x14 */
7367
- Gi,
7203
+ Li,
7368
7204
  /* 0x15 */
7369
- Ni,
7205
+ Oi,
7370
7206
  /* 0x16 */
7371
- Hi,
7207
+ Ri,
7372
7208
  /* 0x17 */
7373
- zi,
7209
+ Ai,
7374
7210
  /* 0x18 */
7375
- Wi,
7211
+ Di,
7376
7212
  /* 0x19 */
7377
- _i,
7213
+ Ii,
7378
7214
  /* 0x1A */
7379
- Vi,
7215
+ Pi,
7380
7216
  /* 0x1B */
7381
- qi,
7217
+ Bi,
7382
7218
  /* 0x1C */
7383
- Xi,
7219
+ Mi,
7384
7220
  /* 0x1D */
7385
- Yi,
7221
+ Gi,
7386
7222
  /* 0x1E */
7387
7223
  void 0,
7388
7224
  // TODO SSWCI
@@ -7390,19 +7226,19 @@ qn = [
7390
7226
  void 0,
7391
7227
  // TODO SSW
7392
7228
  /* 0x20 */
7393
- Zi,
7229
+ Ni,
7394
7230
  /* 0x21 */
7395
- Rr,
7231
+ Or,
7396
7232
  /* 0x22 */
7397
- Ki,
7233
+ Hi,
7398
7234
  /* 0x23 */
7399
- ji,
7235
+ zi,
7400
7236
  /* 0x24 */
7401
- Qi,
7237
+ Wi,
7402
7238
  /* 0x25 */
7403
- eo,
7239
+ qi,
7404
7240
  /* 0x26 */
7405
- ro,
7241
+ Xi,
7406
7242
  /* 0x27 */
7407
7243
  void 0,
7408
7244
  // TODO ALIGNPTS
@@ -7412,80 +7248,80 @@ qn = [
7412
7248
  void 0,
7413
7249
  // TODO UTP
7414
7250
  /* 0x2A */
7415
- $i,
7251
+ _i,
7416
7252
  /* 0x2B */
7417
- Ji,
7253
+ Vi,
7418
7254
  /* 0x2C */
7419
- to,
7255
+ Yi,
7420
7256
  /* 0x2D */
7421
7257
  void 0,
7422
7258
  // ENDF (eaten by FDEF)
7423
7259
  /* 0x2E */
7424
- zt.bind(void 0, 0),
7260
+ Ht.bind(void 0, 0),
7425
7261
  /* 0x2F */
7426
- zt.bind(void 0, 1),
7262
+ Ht.bind(void 0, 1),
7427
7263
  /* 0x30 */
7428
- Wt.bind(void 0, pe),
7264
+ zt.bind(void 0, pe),
7429
7265
  /* 0x31 */
7430
- Wt.bind(void 0, fe),
7266
+ zt.bind(void 0, fe),
7431
7267
  /* 0x32 */
7432
- _t.bind(void 0, 0),
7268
+ Wt.bind(void 0, 0),
7433
7269
  /* 0x33 */
7434
- _t.bind(void 0, 1),
7270
+ Wt.bind(void 0, 1),
7435
7271
  /* 0x34 */
7436
- Vt.bind(void 0, 0),
7272
+ _t.bind(void 0, 0),
7437
7273
  /* 0x35 */
7438
- Vt.bind(void 0, 1),
7274
+ _t.bind(void 0, 1),
7439
7275
  /* 0x36 */
7440
- qt.bind(void 0, 0),
7276
+ Vt.bind(void 0, 0),
7441
7277
  /* 0x37 */
7442
- qt.bind(void 0, 1),
7278
+ Vt.bind(void 0, 1),
7443
7279
  /* 0x38 */
7444
- no,
7280
+ Zi,
7445
7281
  /* 0x39 */
7446
- ao,
7282
+ Ki,
7447
7283
  /* 0x3A */
7448
- Xt.bind(void 0, 0),
7284
+ qt.bind(void 0, 0),
7449
7285
  /* 0x3B */
7450
- Xt.bind(void 0, 1),
7286
+ qt.bind(void 0, 1),
7451
7287
  /* 0x3C */
7452
- so,
7288
+ ji,
7453
7289
  /* 0x3D */
7454
- io,
7290
+ Qi,
7455
7291
  /* 0x3E */
7456
- Yt.bind(void 0, 0),
7292
+ Xt.bind(void 0, 0),
7457
7293
  /* 0x3F */
7458
- Yt.bind(void 0, 1),
7294
+ Xt.bind(void 0, 1),
7459
7295
  /* 0x40 */
7460
- oo,
7296
+ $i,
7461
7297
  /* 0x41 */
7462
- uo,
7298
+ Ji,
7463
7299
  /* 0x42 */
7464
- lo,
7300
+ eo,
7465
7301
  /* 0x43 */
7466
- fo,
7302
+ ro,
7467
7303
  /* 0x44 */
7468
- co,
7304
+ to,
7469
7305
  /* 0x45 */
7470
- po,
7306
+ no,
7471
7307
  /* 0x46 */
7472
- Zt.bind(void 0, 0),
7308
+ Yt.bind(void 0, 0),
7473
7309
  /* 0x47 */
7474
- Zt.bind(void 0, 1),
7310
+ Yt.bind(void 0, 1),
7475
7311
  /* 0x48 */
7476
7312
  void 0,
7477
7313
  // TODO SCFS
7478
7314
  /* 0x49 */
7479
- Kt.bind(void 0, 0),
7315
+ Zt.bind(void 0, 0),
7480
7316
  /* 0x4A */
7481
- Kt.bind(void 0, 1),
7317
+ Zt.bind(void 0, 1),
7482
7318
  /* 0x4B */
7483
- ho,
7319
+ ao,
7484
7320
  /* 0x4C */
7485
7321
  void 0,
7486
7322
  // TODO MPS
7487
7323
  /* 0x4D */
7488
- vo,
7324
+ so,
7489
7325
  /* 0x4E */
7490
7326
  void 0,
7491
7327
  // TODO FLIPOFF
@@ -7493,53 +7329,53 @@ qn = [
7493
7329
  void 0,
7494
7330
  // TODO DEBUG
7495
7331
  /* 0x50 */
7496
- go,
7332
+ io,
7497
7333
  /* 0x51 */
7498
- mo,
7334
+ oo,
7499
7335
  /* 0x52 */
7500
- yo,
7336
+ uo,
7501
7337
  /* 0x53 */
7502
- xo,
7338
+ lo,
7503
7339
  /* 0x54 */
7504
- bo,
7340
+ fo,
7505
7341
  /* 0x55 */
7506
- So,
7342
+ co,
7507
7343
  /* 0x56 */
7508
- ko,
7344
+ po,
7509
7345
  /* 0x57 */
7510
- To,
7346
+ ho,
7511
7347
  /* 0x58 */
7512
- wo,
7348
+ vo,
7513
7349
  /* 0x59 */
7514
- Fo,
7350
+ go,
7515
7351
  /* 0x5A */
7516
- Co,
7352
+ mo,
7517
7353
  /* 0x5B */
7518
- Uo,
7354
+ yo,
7519
7355
  /* 0x5C */
7520
- Eo,
7356
+ xo,
7521
7357
  /* 0x5D */
7522
- Ar.bind(void 0, 1),
7358
+ Rr.bind(void 0, 1),
7523
7359
  /* 0x5E */
7524
- Lo,
7360
+ bo,
7525
7361
  /* 0x5F */
7526
- Oo,
7362
+ So,
7527
7363
  /* 0x60 */
7528
- Ro,
7364
+ ko,
7529
7365
  /* 0x61 */
7530
- Ao,
7366
+ To,
7531
7367
  /* 0x62 */
7532
- Do,
7368
+ wo,
7533
7369
  /* 0x63 */
7534
- Io,
7370
+ Fo,
7535
7371
  /* 0x64 */
7536
- Po,
7372
+ Co,
7537
7373
  /* 0x65 */
7538
- Bo,
7374
+ Uo,
7539
7375
  /* 0x66 */
7540
- Mo,
7376
+ Eo,
7541
7377
  /* 0x67 */
7542
- Go,
7378
+ Lo,
7543
7379
  /* 0x68 */
7544
7380
  ir.bind(void 0, 0),
7545
7381
  /* 0x69 */
@@ -7561,21 +7397,21 @@ qn = [
7561
7397
  void 0,
7562
7398
  // TODO NROUND[ab]
7563
7399
  /* 0x70 */
7564
- No,
7400
+ Oo,
7565
7401
  /* 0x71 */
7566
- Ar.bind(void 0, 2),
7402
+ Rr.bind(void 0, 2),
7567
7403
  /* 0x72 */
7568
- Ar.bind(void 0, 3),
7404
+ Rr.bind(void 0, 3),
7569
7405
  /* 0x73 */
7570
- Dr.bind(void 0, 1),
7406
+ Ar.bind(void 0, 1),
7571
7407
  /* 0x74 */
7572
- Dr.bind(void 0, 2),
7408
+ Ar.bind(void 0, 2),
7573
7409
  /* 0x75 */
7574
- Dr.bind(void 0, 3),
7410
+ Ar.bind(void 0, 3),
7575
7411
  /* 0x76 */
7576
- Ho,
7412
+ Ro,
7577
7413
  /* 0x77 */
7578
- zo,
7414
+ Ao,
7579
7415
  /* 0x78 */
7580
7416
  void 0,
7581
7417
  // TODO JROT[]
@@ -7583,18 +7419,18 @@ qn = [
7583
7419
  void 0,
7584
7420
  // TODO JROF[]
7585
7421
  /* 0x7A */
7586
- Wo,
7422
+ Do,
7587
7423
  /* 0x7B */
7588
7424
  void 0,
7589
7425
  /* 0x7C */
7590
- _o,
7426
+ Io,
7591
7427
  /* 0x7D */
7592
- Vo,
7428
+ Po,
7593
7429
  /* 0x7E */
7594
- Rr,
7430
+ Or,
7595
7431
  // actually SANGW, supposed to do only a pop though
7596
7432
  /* 0x7F */
7597
- Rr,
7433
+ Or,
7598
7434
  // actually AA, supposed to do only a pop though
7599
7435
  /* 0x80 */
7600
7436
  void 0,
@@ -7610,26 +7446,26 @@ qn = [
7610
7446
  /* 0x84 */
7611
7447
  void 0,
7612
7448
  /* 0x85 */
7613
- qo,
7449
+ Bo,
7614
7450
  /* 0x86 */
7615
- jt.bind(void 0, 0),
7451
+ Kt.bind(void 0, 0),
7616
7452
  /* 0x87 */
7617
- jt.bind(void 0, 1),
7453
+ Kt.bind(void 0, 1),
7618
7454
  /* 0x88 */
7619
- Xo,
7455
+ Mo,
7620
7456
  /* 0x89 */
7621
7457
  void 0,
7622
7458
  // TODO IDEF
7623
7459
  /* 0x8A */
7624
- Yo,
7460
+ Go,
7625
7461
  /* 0x8B */
7626
- Zo,
7462
+ No,
7627
7463
  /* 0x8C */
7628
- Ko,
7464
+ Ho,
7629
7465
  /* 0x8D */
7630
- jo,
7466
+ zo,
7631
7467
  /* 0x8E */
7632
- Qo,
7468
+ Wo,
7633
7469
  /* 0x8F */
7634
7470
  void 0,
7635
7471
  /* 0x90 */
@@ -7860,10 +7696,10 @@ qn = [
7860
7696
  function Ae(e) {
7861
7697
  this.char = e, this.state = {}, this.activeState = null;
7862
7698
  }
7863
- function st(e, r, t) {
7699
+ function at(e, r, t) {
7864
7700
  this.contextName = t, this.startIndex = e, this.endOffset = r;
7865
7701
  }
7866
- function $o(e, r, t) {
7702
+ function _o(e, r, t) {
7867
7703
  this.contextName = e, this.openRange = null, this.ranges = [], this.checkStart = r, this.checkEnd = t;
7868
7704
  }
7869
7705
  function ae(e, r) {
@@ -7872,7 +7708,7 @@ function ae(e, r) {
7872
7708
  function Sr(e) {
7873
7709
  this.eventId = e, this.subscribers = [];
7874
7710
  }
7875
- function Jo(e) {
7711
+ function Vo(e) {
7876
7712
  var r = this, t = [
7877
7713
  "start",
7878
7714
  "end",
@@ -7911,7 +7747,7 @@ function Jo(e) {
7911
7747
  });
7912
7748
  }
7913
7749
  function I(e) {
7914
- this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], Jo.call(this, e);
7750
+ this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], Vo.call(this, e);
7915
7751
  }
7916
7752
  Ae.prototype.setState = function(e, r) {
7917
7753
  return this.state[e] = r, this.activeState = { key: e, value: this.state[e] }, this.activeState;
@@ -8012,7 +7848,7 @@ ae.prototype.get = function(e) {
8012
7848
  }
8013
7849
  };
8014
7850
  I.prototype.rangeToText = function(e) {
8015
- if (e instanceof st)
7851
+ if (e instanceof at)
8016
7852
  return this.getRangeTokens(e).map(function(r) {
8017
7853
  return r.char;
8018
7854
  }).join("");
@@ -8049,7 +7885,7 @@ I.prototype.registerContextChecker = function(e, r, t) {
8049
7885
  return {
8050
7886
  FAIL: "missing context end check."
8051
7887
  };
8052
- var n = new $o(
7888
+ var n = new _o(
8053
7889
  e,
8054
7890
  r,
8055
7891
  t
@@ -8085,14 +7921,14 @@ I.prototype.updateContextsRanges = function() {
8085
7921
  this.dispatch("updateContextsRanges", [this.registeredContexts]);
8086
7922
  };
8087
7923
  I.prototype.setEndOffset = function(e, r) {
8088
- var t = this.getContext(r).openRange.startIndex, n = new st(t, e, r), a = this.getContext(r).ranges;
7924
+ var t = this.getContext(r).openRange.startIndex, n = new at(t, e, r), a = this.getContext(r).ranges;
8089
7925
  return n.rangeId = r + "." + a.length, a.push(n), this.getContext(r).openRange = null, n;
8090
7926
  };
8091
7927
  I.prototype.runContextCheck = function(e) {
8092
7928
  var r = this, t = e.index;
8093
7929
  this.contextCheckers.forEach(function(n) {
8094
7930
  var a = n.contextName, s = r.getContext(a).openRange;
8095
- if (!s && n.checkStart(e) && (s = new st(t, null, a), r.getContext(a).openRange = s, r.dispatch("contextStart", [a, t])), s && n.checkEnd(e)) {
7931
+ if (!s && n.checkStart(e) && (s = new at(t, null, a), r.getContext(a).openRange = s, r.dispatch("contextStart", [a, t])), s && n.checkEnd(e)) {
8096
7932
  var i = t - s.startIndex + 1, u = r.setEndOffset(i, a);
8097
7933
  r.dispatch("contextEnd", [a, u]);
8098
7934
  }
@@ -8122,7 +7958,7 @@ function be(e) {
8122
7958
  function ur(e) {
8123
7959
  return /[A-z]/.test(e);
8124
7960
  }
8125
- function eu(e) {
7961
+ function qo(e) {
8126
7962
  return /\s/.test(e);
8127
7963
  }
8128
7964
  function J(e) {
@@ -8151,15 +7987,15 @@ function Ke(e, r) {
8151
7987
  }
8152
7988
  return -1;
8153
7989
  }
8154
- function ru(e, r) {
7990
+ function Xo(e, r) {
8155
7991
  var t = Ke(e, r.coverage);
8156
7992
  return t === -1 ? null : e + r.deltaGlyphId;
8157
7993
  }
8158
- function tu(e, r) {
7994
+ function Yo(e, r) {
8159
7995
  var t = Ke(e, r.coverage);
8160
7996
  return t === -1 ? null : r.substitute[t];
8161
7997
  }
8162
- function Ir(e, r) {
7998
+ function Dr(e, r) {
8163
7999
  for (var t = [], n = 0; n < e.length; n++) {
8164
8000
  var a = e[n], s = r.current;
8165
8001
  s = Array.isArray(s) ? s[0] : s;
@@ -8168,11 +8004,11 @@ function Ir(e, r) {
8168
8004
  }
8169
8005
  return t.length !== e.length ? -1 : t;
8170
8006
  }
8171
- function nu(e, r) {
8007
+ function Zo(e, r) {
8172
8008
  var t = r.inputCoverage.length + r.lookaheadCoverage.length + r.backtrackCoverage.length;
8173
8009
  if (e.context.length < t)
8174
8010
  return [];
8175
- var n = Ir(
8011
+ var n = Dr(
8176
8012
  r.inputCoverage,
8177
8013
  e
8178
8014
  );
@@ -8183,7 +8019,7 @@ function nu(e, r) {
8183
8019
  return [];
8184
8020
  for (var s = e.lookahead.slice(a); s.length && be(s[0].char); )
8185
8021
  s.shift();
8186
- var i = new ae(s, 0), u = Ir(
8022
+ var i = new ae(s, 0), u = Dr(
8187
8023
  r.lookaheadCoverage,
8188
8024
  i
8189
8025
  ), o = [].concat(e.backtrack);
@@ -8191,7 +8027,7 @@ function nu(e, r) {
8191
8027
  o.shift();
8192
8028
  if (o.length < r.backtrackCoverage.length)
8193
8029
  return [];
8194
- var l = new ae(o, 0), f = Ir(
8030
+ var l = new ae(o, 0), f = Dr(
8195
8031
  r.backtrackCoverage,
8196
8032
  l
8197
8033
  ), p = n.length === r.inputCoverage.length && u.length === r.lookaheadCoverage.length && f.length === r.backtrackCoverage.length, c = [];
@@ -8207,7 +8043,7 @@ function nu(e, r) {
8207
8043
  }
8208
8044
  return c;
8209
8045
  }
8210
- function au(e, r) {
8046
+ function Ko(e, r) {
8211
8047
  var t = e.current, n = Ke(t, r.coverage);
8212
8048
  if (n === -1)
8213
8049
  return null;
@@ -8223,7 +8059,7 @@ function au(e, r) {
8223
8059
  }
8224
8060
  return null;
8225
8061
  }
8226
- function su(e, r) {
8062
+ function jo(e, r) {
8227
8063
  var t = Ke(e, r.coverage);
8228
8064
  return t === -1 ? null : r.sequences[t];
8229
8065
  }
@@ -8285,35 +8121,35 @@ J.prototype.getLookupMethod = function(e, r) {
8285
8121
  switch (n) {
8286
8122
  case "11":
8287
8123
  return function(a) {
8288
- return ru.apply(
8124
+ return Xo.apply(
8289
8125
  t,
8290
8126
  [a, r]
8291
8127
  );
8292
8128
  };
8293
8129
  case "12":
8294
8130
  return function(a) {
8295
- return tu.apply(
8131
+ return Yo.apply(
8296
8132
  t,
8297
8133
  [a, r]
8298
8134
  );
8299
8135
  };
8300
8136
  case "63":
8301
8137
  return function(a) {
8302
- return nu.apply(
8138
+ return Zo.apply(
8303
8139
  t,
8304
8140
  [a, r]
8305
8141
  );
8306
8142
  };
8307
8143
  case "41":
8308
8144
  return function(a) {
8309
- return au.apply(
8145
+ return Ko.apply(
8310
8146
  t,
8311
8147
  [a, r]
8312
8148
  );
8313
8149
  };
8314
8150
  case "21":
8315
8151
  return function(a) {
8316
- return su.apply(
8152
+ return jo.apply(
8317
8153
  t,
8318
8154
  [a, r]
8319
8155
  );
@@ -8406,7 +8242,7 @@ J.prototype.getFeature = function(r) {
8406
8242
  var t = this.features[r.script];
8407
8243
  return t ? t.tags[r.tag] ? this.features[r.script].tags[r.tag] : null : { FAIL: "No feature for script " + r.script };
8408
8244
  };
8409
- function iu(e) {
8245
+ function Qo(e) {
8410
8246
  var r = e.current, t = e.get(-1);
8411
8247
  return (
8412
8248
  // ? arabic first char
@@ -8414,7 +8250,7 @@ function iu(e) {
8414
8250
  !xe(t) && xe(r)
8415
8251
  );
8416
8252
  }
8417
- function ou(e) {
8253
+ function $o(e) {
8418
8254
  var r = e.get(1);
8419
8255
  return (
8420
8256
  // ? last arabic char
@@ -8422,24 +8258,24 @@ function ou(e) {
8422
8258
  !xe(r)
8423
8259
  );
8424
8260
  }
8425
- var uu = {
8426
- startCheck: iu,
8427
- endCheck: ou
8261
+ var Jo = {
8262
+ startCheck: Qo,
8263
+ endCheck: $o
8428
8264
  };
8429
- function lu(e) {
8265
+ function eu(e) {
8430
8266
  var r = e.current, t = e.get(-1);
8431
8267
  return (
8432
8268
  // ? an arabic char preceded with a non arabic char
8433
8269
  (xe(r) || be(r)) && !xe(t)
8434
8270
  );
8435
8271
  }
8436
- function fu(e) {
8272
+ function ru(e) {
8437
8273
  var r = e.get(1);
8438
8274
  switch (!0) {
8439
8275
  case r === null:
8440
8276
  return !0;
8441
8277
  case (!xe(r) && !be(r)):
8442
- var t = eu(r);
8278
+ var t = qo(r);
8443
8279
  if (!t)
8444
8280
  return !0;
8445
8281
  if (t) {
@@ -8456,38 +8292,38 @@ function fu(e) {
8456
8292
  return !1;
8457
8293
  }
8458
8294
  }
8459
- var cu = {
8460
- startCheck: lu,
8461
- endCheck: fu
8295
+ var tu = {
8296
+ startCheck: eu,
8297
+ endCheck: ru
8462
8298
  };
8463
- function pu(e, r, t) {
8299
+ function nu(e, r, t) {
8464
8300
  r[t].setState(e.tag, e.substitution);
8465
8301
  }
8466
- function hu(e, r, t) {
8302
+ function au(e, r, t) {
8467
8303
  r[t].setState(e.tag, e.substitution);
8468
8304
  }
8469
- function du(e, r, t) {
8305
+ function su(e, r, t) {
8470
8306
  e.substitution.forEach(function(n, a) {
8471
8307
  var s = r[t + a];
8472
8308
  s.setState(e.tag, n);
8473
8309
  });
8474
8310
  }
8475
- function vu(e, r, t) {
8311
+ function iu(e, r, t) {
8476
8312
  var n = r[t];
8477
8313
  n.setState(e.tag, e.substitution.ligGlyph);
8478
8314
  for (var a = e.substitution.components.length, s = 0; s < a; s++)
8479
8315
  n = r[t + s + 1], n.setState("deleted", !0);
8480
8316
  }
8481
- var Qt = {
8482
- 11: pu,
8483
- 12: hu,
8484
- 63: du,
8485
- 41: vu
8317
+ var jt = {
8318
+ 11: nu,
8319
+ 12: au,
8320
+ 63: su,
8321
+ 41: iu
8486
8322
  };
8487
- function it(e, r, t) {
8488
- e instanceof we && Qt[e.id] && Qt[e.id](e, r, t);
8323
+ function st(e, r, t) {
8324
+ e instanceof we && jt[e.id] && jt[e.id](e, r, t);
8489
8325
  }
8490
- function gu(e) {
8326
+ function ou(e) {
8491
8327
  for (var r = [].concat(e.backtrack), t = r.length - 1; t >= 0; t--) {
8492
8328
  var n = r[t], a = Qn(n), s = be(n);
8493
8329
  if (!a && !s)
@@ -8497,7 +8333,7 @@ function gu(e) {
8497
8333
  }
8498
8334
  return !1;
8499
8335
  }
8500
- function mu(e) {
8336
+ function uu(e) {
8501
8337
  if (Qn(e.current))
8502
8338
  return !1;
8503
8339
  for (var r = 0; r < e.lookahead.length; r++) {
@@ -8507,7 +8343,7 @@ function mu(e) {
8507
8343
  }
8508
8344
  return !1;
8509
8345
  }
8510
- function yu(e) {
8346
+ function lu(e) {
8511
8347
  var r = this, t = "arab", n = this.featuresTags[t], a = this.tokenizer.getRangeTokens(e);
8512
8348
  if (a.length !== 1) {
8513
8349
  var s = new ae(
@@ -8529,7 +8365,7 @@ function yu(e) {
8529
8365
  if (!be(u.char)) {
8530
8366
  s.setCurrentIndex(o), i.setCurrentIndex(o);
8531
8367
  var l = 0;
8532
- gu(i) && (l |= 1), mu(i) && (l |= 2);
8368
+ ou(i) && (l |= 1), uu(i) && (l |= 2);
8533
8369
  var f;
8534
8370
  switch (l) {
8535
8371
  case 1:
@@ -8551,21 +8387,21 @@ function yu(e) {
8551
8387
  if (p instanceof Error)
8552
8388
  return console.info(p.message);
8553
8389
  p.forEach(function(c, h) {
8554
- c instanceof we && (it(c, a, h), s.context[h] = c.substitution);
8390
+ c instanceof we && (st(c, a, h), s.context[h] = c.substitution);
8555
8391
  });
8556
8392
  }
8557
8393
  }
8558
8394
  });
8559
8395
  }
8560
8396
  }
8561
- function $t(e, r) {
8397
+ function Qt(e, r) {
8562
8398
  var t = e.map(function(n) {
8563
8399
  return n.activeState.value;
8564
8400
  });
8565
8401
  return new ae(t, 0);
8566
8402
  }
8567
- function xu(e) {
8568
- var r = this, t = "arab", n = this.tokenizer.getRangeTokens(e), a = $t(n);
8403
+ function fu(e) {
8404
+ var r = this, t = "arab", n = this.tokenizer.getRangeTokens(e), a = Qt(n);
8569
8405
  a.context.forEach(function(s, i) {
8570
8406
  a.setCurrentIndex(i);
8571
8407
  var u = r.query.lookupFeature({
@@ -8575,12 +8411,12 @@ function xu(e) {
8575
8411
  });
8576
8412
  u.length && (u.forEach(
8577
8413
  function(o) {
8578
- return it(o, n, i);
8414
+ return st(o, n, i);
8579
8415
  }
8580
- ), a = $t(n));
8416
+ ), a = Qt(n));
8581
8417
  });
8582
8418
  }
8583
- function bu(e) {
8419
+ function cu(e) {
8584
8420
  var r = e.current, t = e.get(-1);
8585
8421
  return (
8586
8422
  // ? latin first char
@@ -8588,7 +8424,7 @@ function bu(e) {
8588
8424
  !ur(t) && ur(r)
8589
8425
  );
8590
8426
  }
8591
- function Su(e) {
8427
+ function pu(e) {
8592
8428
  var r = e.get(1);
8593
8429
  return (
8594
8430
  // ? last latin char
@@ -8596,18 +8432,18 @@ function Su(e) {
8596
8432
  !ur(r)
8597
8433
  );
8598
8434
  }
8599
- var ku = {
8600
- startCheck: bu,
8601
- endCheck: Su
8435
+ var hu = {
8436
+ startCheck: cu,
8437
+ endCheck: pu
8602
8438
  };
8603
- function Jt(e, r) {
8439
+ function $t(e, r) {
8604
8440
  var t = e.map(function(n) {
8605
8441
  return n.activeState.value;
8606
8442
  });
8607
8443
  return new ae(t, 0);
8608
8444
  }
8609
- function Tu(e) {
8610
- var r = this, t = "latn", n = this.tokenizer.getRangeTokens(e), a = Jt(n);
8445
+ function du(e) {
8446
+ var r = this, t = "latn", n = this.tokenizer.getRangeTokens(e), a = $t(n);
8611
8447
  a.context.forEach(function(s, i) {
8612
8448
  a.setCurrentIndex(i);
8613
8449
  var u = r.query.lookupFeature({
@@ -8617,9 +8453,9 @@ function Tu(e) {
8617
8453
  });
8618
8454
  u.length && (u.forEach(
8619
8455
  function(o) {
8620
- return it(o, n, i);
8456
+ return st(o, n, i);
8621
8457
  }
8622
- ), a = Jt(n));
8458
+ ), a = $t(n));
8623
8459
  });
8624
8460
  }
8625
8461
  function oe(e) {
@@ -8629,11 +8465,11 @@ oe.prototype.setText = function(e) {
8629
8465
  this.text = e;
8630
8466
  };
8631
8467
  oe.prototype.contextChecks = {
8632
- latinWordCheck: ku,
8633
- arabicWordCheck: uu,
8634
- arabicSentenceCheck: cu
8468
+ latinWordCheck: hu,
8469
+ arabicWordCheck: Jo,
8470
+ arabicSentenceCheck: tu
8635
8471
  };
8636
- function Pr(e) {
8472
+ function Ir(e) {
8637
8473
  var r = this.contextChecks[e + "Check"];
8638
8474
  return this.tokenizer.registerContextChecker(
8639
8475
  e,
@@ -8641,10 +8477,10 @@ function Pr(e) {
8641
8477
  r.endCheck
8642
8478
  );
8643
8479
  }
8644
- function wu() {
8645
- return Pr.call(this, "latinWord"), Pr.call(this, "arabicWord"), Pr.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
8480
+ function vu() {
8481
+ return Ir.call(this, "latinWord"), Ir.call(this, "arabicWord"), Ir.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
8646
8482
  }
8647
- function Fu() {
8483
+ function gu() {
8648
8484
  var e = this, r = this.tokenizer.getContextRanges("arabicSentence");
8649
8485
  r.forEach(function(t) {
8650
8486
  var n = e.tokenizer.getRangeTokens(t);
@@ -8677,44 +8513,44 @@ oe.prototype.applyFeatures = function(e, r) {
8677
8513
  oe.prototype.registerModifier = function(e, r, t) {
8678
8514
  this.tokenizer.registerModifier(e, r, t);
8679
8515
  };
8680
- function ot() {
8516
+ function it() {
8681
8517
  if (this.tokenizer.registeredModifiers.indexOf("glyphIndex") === -1)
8682
8518
  throw new Error(
8683
8519
  "glyphIndex modifier is required to apply arabic presentation features."
8684
8520
  );
8685
8521
  }
8686
- function Cu() {
8522
+ function mu() {
8687
8523
  var e = this, r = "arab";
8688
8524
  if (this.featuresTags.hasOwnProperty(r)) {
8689
- ot.call(this);
8525
+ it.call(this);
8690
8526
  var t = this.tokenizer.getContextRanges("arabicWord");
8691
8527
  t.forEach(function(n) {
8692
- yu.call(e, n);
8528
+ lu.call(e, n);
8693
8529
  });
8694
8530
  }
8695
8531
  }
8696
- function Uu() {
8532
+ function yu() {
8697
8533
  var e = this, r = "arab";
8698
8534
  if (this.featuresTags.hasOwnProperty(r)) {
8699
8535
  var t = this.featuresTags[r];
8700
8536
  if (t.indexOf("rlig") !== -1) {
8701
- ot.call(this);
8537
+ it.call(this);
8702
8538
  var n = this.tokenizer.getContextRanges("arabicWord");
8703
8539
  n.forEach(function(a) {
8704
- xu.call(e, a);
8540
+ fu.call(e, a);
8705
8541
  });
8706
8542
  }
8707
8543
  }
8708
8544
  }
8709
- function Eu() {
8545
+ function xu() {
8710
8546
  var e = this, r = "latn";
8711
8547
  if (this.featuresTags.hasOwnProperty(r)) {
8712
8548
  var t = this.featuresTags[r];
8713
8549
  if (t.indexOf("liga") !== -1) {
8714
- ot.call(this);
8550
+ it.call(this);
8715
8551
  var n = this.tokenizer.getContextRanges("latinWord");
8716
8552
  n.forEach(function(a) {
8717
- Tu.call(e, a);
8553
+ du.call(e, a);
8718
8554
  });
8719
8555
  }
8720
8556
  }
@@ -8723,10 +8559,10 @@ oe.prototype.checkContextReady = function(e) {
8723
8559
  return !!this.tokenizer.getContext(e);
8724
8560
  };
8725
8561
  oe.prototype.applyFeaturesToContexts = function() {
8726
- this.checkContextReady("arabicWord") && (Cu.call(this), Uu.call(this)), this.checkContextReady("latinWord") && Eu.call(this), this.checkContextReady("arabicSentence") && Fu.call(this);
8562
+ this.checkContextReady("arabicWord") && (mu.call(this), yu.call(this)), this.checkContextReady("latinWord") && xu.call(this), this.checkContextReady("arabicSentence") && gu.call(this);
8727
8563
  };
8728
8564
  oe.prototype.processText = function(e) {
8729
- (!this.text || this.text !== e) && (this.setText(e), wu.call(this), this.applyFeaturesToContexts());
8565
+ (!this.text || this.text !== e) && (this.setText(e), vu.call(this), this.applyFeaturesToContexts());
8730
8566
  };
8731
8567
  oe.prototype.getBidiText = function(e) {
8732
8568
  return this.processText(e), this.tokenizer.getText();
@@ -8895,7 +8731,7 @@ A.prototype.validate = function() {
8895
8731
  t("fontFamily"), t("weightName"), t("manufacturer"), t("copyright"), t("version"), this.unitsPerEm > 0;
8896
8732
  };
8897
8733
  A.prototype.toTables = function() {
8898
- return di.fontToTable(this);
8734
+ return si.fontToTable(this);
8899
8735
  };
8900
8736
  A.prototype.toBuffer = function() {
8901
8737
  return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."), this.toArrayBuffer();
@@ -8909,7 +8745,7 @@ A.prototype.download = function(e) {
8909
8745
  var r = this.getEnglishName("fontFamily"), t = this.getEnglishName("fontSubfamily");
8910
8746
  e = e || r.replace(/\s/g, "") + "-" + t + ".otf";
8911
8747
  var n = this.toArrayBuffer();
8912
- if (gi())
8748
+ if (oi())
8913
8749
  if (window.URL = window.URL || window.webkitURL, window.URL) {
8914
8750
  var a = new DataView(n), s = new Blob([a], { type: "font/opentype" }), i = document.createElement("a");
8915
8751
  i.href = window.URL.createObjectURL(s), i.download = e;
@@ -8918,7 +8754,7 @@ A.prototype.download = function(e) {
8918
8754
  } else
8919
8755
  console.warn("Font file could not be downloaded. Try using a different browser.");
8920
8756
  else {
8921
- var o = require("fs"), l = mi(n);
8757
+ var o = require("fs"), l = ui(n);
8922
8758
  o.writeFileSync(e, l);
8923
8759
  }
8924
8760
  };
@@ -8978,7 +8814,7 @@ function $n(e, r) {
8978
8814
  }
8979
8815
  return r[n] = e, n;
8980
8816
  }
8981
- function Lu(e, r, t) {
8817
+ function bu(e, r, t) {
8982
8818
  var n = $n(r.name, t);
8983
8819
  return [
8984
8820
  { name: "tag_" + e, type: "TAG", value: r.tag },
@@ -8989,11 +8825,11 @@ function Lu(e, r, t) {
8989
8825
  { name: "nameID_" + e, type: "USHORT", value: n }
8990
8826
  ];
8991
8827
  }
8992
- function Ou(e, r, t) {
8828
+ function Su(e, r, t) {
8993
8829
  var n = {}, a = new w.Parser(e, r);
8994
8830
  return n.tag = a.parseTag(), n.minValue = a.parseFixed(), n.defaultValue = a.parseFixed(), n.maxValue = a.parseFixed(), a.skip("uShort", 1), n.name = t[a.parseUShort()] || {}, n;
8995
8831
  }
8996
- function Ru(e, r, t, n) {
8832
+ function ku(e, r, t, n) {
8997
8833
  for (var a = $n(r.name, n), s = [
8998
8834
  { name: "nameID_" + e, type: "USHORT", value: a },
8999
8835
  { name: "flags_" + e, type: "USHORT", value: 0 }
@@ -9007,14 +8843,14 @@ function Ru(e, r, t, n) {
9007
8843
  }
9008
8844
  return s;
9009
8845
  }
9010
- function Au(e, r, t, n) {
8846
+ function Tu(e, r, t, n) {
9011
8847
  var a = {}, s = new w.Parser(e, r);
9012
8848
  a.name = n[s.parseUShort()] || {}, s.skip("uShort", 1), a.coordinates = {};
9013
8849
  for (var i = 0; i < t.length; ++i)
9014
8850
  a.coordinates[t[i].tag] = s.parseFixed();
9015
8851
  return a;
9016
8852
  }
9017
- function Du(e, r) {
8853
+ function wu(e, r) {
9018
8854
  var t = new k.Table("fvar", [
9019
8855
  { name: "version", type: "ULONG", value: 65536 },
9020
8856
  { name: "offsetToData", type: "USHORT", value: 0 },
@@ -9026,28 +8862,28 @@ function Du(e, r) {
9026
8862
  ]);
9027
8863
  t.offsetToData = t.sizeOf();
9028
8864
  for (var n = 0; n < e.axes.length; n++)
9029
- t.fields = t.fields.concat(Lu(n, e.axes[n], r));
8865
+ t.fields = t.fields.concat(bu(n, e.axes[n], r));
9030
8866
  for (var a = 0; a < e.instances.length; a++)
9031
- t.fields = t.fields.concat(Ru(a, e.instances[a], e.axes, r));
8867
+ t.fields = t.fields.concat(ku(a, e.instances[a], e.axes, r));
9032
8868
  return t;
9033
8869
  }
9034
- function Iu(e, r, t) {
8870
+ function Fu(e, r, t) {
9035
8871
  var n = new w.Parser(e, r), a = n.parseULong();
9036
8872
  U.argument(a === 65536, "Unsupported fvar table version.");
9037
8873
  var s = n.parseOffset16();
9038
8874
  n.skip("uShort", 1);
9039
8875
  for (var i = n.parseUShort(), u = n.parseUShort(), o = n.parseUShort(), l = n.parseUShort(), f = [], p = 0; p < i; p++)
9040
- f.push(Ou(e, r + s + p * u, t));
8876
+ f.push(Su(e, r + s + p * u, t));
9041
8877
  for (var c = [], h = r + s + i * u, v = 0; v < o; v++)
9042
- c.push(Au(e, h + v * l, f, t));
8878
+ c.push(Tu(e, h + v * l, f, t));
9043
8879
  return { axes: f, instances: c };
9044
8880
  }
9045
- var Pu = { make: Du, parse: Iu }, Bu = function() {
8881
+ var Cu = { make: wu, parse: Fu }, Uu = function() {
9046
8882
  return {
9047
8883
  coverage: this.parsePointer(d.coverage),
9048
8884
  attachPoints: this.parseList(d.pointer(d.uShortList))
9049
8885
  };
9050
- }, Mu = function() {
8886
+ }, Eu = function() {
9051
8887
  var e = this.parseUShort();
9052
8888
  if (U.argument(
9053
8889
  e === 1 || e === 2 || e === 3,
@@ -9058,17 +8894,17 @@ var Pu = { make: Du, parse: Iu }, Bu = function() {
9058
8894
  return { pointindex: this.parseShort() };
9059
8895
  if (e === 3)
9060
8896
  return { coordinate: this.parseShort() };
9061
- }, Gu = function() {
9062
- return this.parseList(d.pointer(Mu));
9063
- }, Nu = function() {
8897
+ }, Lu = function() {
8898
+ return this.parseList(d.pointer(Eu));
8899
+ }, Ou = function() {
9064
8900
  return {
9065
8901
  coverage: this.parsePointer(d.coverage),
9066
- ligGlyphs: this.parseList(d.pointer(Gu))
8902
+ ligGlyphs: this.parseList(d.pointer(Lu))
9067
8903
  };
9068
- }, Hu = function() {
8904
+ }, Ru = function() {
9069
8905
  return this.parseUShort(), this.parseList(d.pointer(d.coverage));
9070
8906
  };
9071
- function zu(e, r) {
8907
+ function Au(e, r) {
9072
8908
  r = r || 0;
9073
8909
  var t = new d(e, r), n = t.parseVersion(1);
9074
8910
  U.argument(
@@ -9078,13 +8914,13 @@ function zu(e, r) {
9078
8914
  var a = {
9079
8915
  version: n,
9080
8916
  classDef: t.parsePointer(d.classDef),
9081
- attachList: t.parsePointer(Bu),
9082
- ligCaretList: t.parsePointer(Nu),
8917
+ attachList: t.parsePointer(Uu),
8918
+ ligCaretList: t.parsePointer(Ou),
9083
8919
  markAttachClassDef: t.parsePointer(d.classDef)
9084
8920
  };
9085
- return n >= 1.2 && (a.markGlyphSets = t.parsePointer(Hu)), a;
8921
+ return n >= 1.2 && (a.markGlyphSets = t.parsePointer(Ru)), a;
9086
8922
  }
9087
- var Wu = { parse: zu }, se = new Array(10);
8923
+ var Du = { parse: Au }, se = new Array(10);
9088
8924
  se[1] = function() {
9089
8925
  var r = this.offset + this.relativeOffset, t = this.parseUShort();
9090
8926
  if (t === 1)
@@ -9162,7 +8998,7 @@ se[8] = function() {
9162
8998
  se[9] = function() {
9163
8999
  return { error: "GPOS Lookup 9 not supported" };
9164
9000
  };
9165
- function _u(e, r) {
9001
+ function Iu(e, r) {
9166
9002
  r = r || 0;
9167
9003
  var t = new d(e, r), n = t.parseVersion(1);
9168
9004
  return U.argument(n === 1 || n === 1.1, "Unsupported GPOS table version " + n), n === 1 ? {
@@ -9178,17 +9014,17 @@ function _u(e, r) {
9178
9014
  variations: t.parseFeatureVariationsList()
9179
9015
  };
9180
9016
  }
9181
- var Vu = new Array(10);
9182
- function qu(e) {
9017
+ var Pu = new Array(10);
9018
+ function Bu(e) {
9183
9019
  return new k.Table("GPOS", [
9184
9020
  { name: "version", type: "ULONG", value: 65536 },
9185
9021
  { name: "scripts", type: "TABLE", value: new k.ScriptList(e.scripts) },
9186
9022
  { name: "features", type: "TABLE", value: new k.FeatureList(e.features) },
9187
- { name: "lookups", type: "TABLE", value: new k.LookupList(e.lookups, Vu) }
9023
+ { name: "lookups", type: "TABLE", value: new k.LookupList(e.lookups, Pu) }
9188
9024
  ]);
9189
9025
  }
9190
- var Xu = { parse: _u, make: qu };
9191
- function Yu(e) {
9026
+ var Mu = { parse: Iu, make: Bu };
9027
+ function Gu(e) {
9192
9028
  var r = {};
9193
9029
  e.skip("uShort");
9194
9030
  var t = e.parseUShort();
@@ -9201,7 +9037,7 @@ function Yu(e) {
9201
9037
  }
9202
9038
  return r;
9203
9039
  }
9204
- function Zu(e) {
9040
+ function Nu(e) {
9205
9041
  var r = {};
9206
9042
  e.skip("uShort");
9207
9043
  var t = e.parseULong();
@@ -9217,31 +9053,31 @@ function Zu(e) {
9217
9053
  }
9218
9054
  return r;
9219
9055
  }
9220
- function Ku(e, r) {
9056
+ function Hu(e, r) {
9221
9057
  var t = new w.Parser(e, r), n = t.parseUShort();
9222
9058
  if (n === 0)
9223
- return Yu(t);
9059
+ return Gu(t);
9224
9060
  if (n === 1)
9225
- return Zu(t);
9061
+ return Nu(t);
9226
9062
  throw new Error("Unsupported kern table version (" + n + ").");
9227
9063
  }
9228
- var ju = { parse: Ku };
9229
- function Qu(e, r, t, n) {
9064
+ var zu = { parse: Hu };
9065
+ function Wu(e, r, t, n) {
9230
9066
  for (var a = new w.Parser(e, r), s = n ? a.parseUShort : a.parseULong, i = [], u = 0; u < t + 1; u += 1) {
9231
9067
  var o = s.call(a);
9232
9068
  n && (o *= 2), i.push(o);
9233
9069
  }
9234
9070
  return i;
9235
9071
  }
9236
- var $u = { parse: Qu };
9237
- function en(e, r) {
9072
+ var _u = { parse: Wu };
9073
+ function Jt(e, r) {
9238
9074
  for (var t = [], n = 12, a = 0; a < r; a += 1) {
9239
9075
  var s = w.getTag(e, n), i = w.getULong(e, n + 4), u = w.getULong(e, n + 8), o = w.getULong(e, n + 12);
9240
9076
  t.push({ tag: s, checksum: i, offset: u, length: o, compression: !1 }), n += 16;
9241
9077
  }
9242
9078
  return t;
9243
9079
  }
9244
- function Ju(e, r) {
9080
+ function Vu(e, r) {
9245
9081
  for (var t = [], n = 44, a = 0; a < r; a += 1) {
9246
9082
  var s = w.getTag(e, n), i = w.getULong(e, n + 4), u = w.getULong(e, n + 8), o = w.getULong(e, n + 12), l = void 0;
9247
9083
  u < o ? l = "WOFF" : l = !1, t.push({
@@ -9257,20 +9093,20 @@ function Ju(e, r) {
9257
9093
  function B(e, r) {
9258
9094
  if (r.compression === "WOFF") {
9259
9095
  var t = new Uint8Array(e.buffer, r.offset + 2, r.compressedLength - 2), n = new Uint8Array(r.length);
9260
- if (qa(t, n), n.byteLength !== r.length)
9096
+ if (Ba(t, n), n.byteLength !== r.length)
9261
9097
  throw new Error("Decompression error: " + r.tag + " decompressed length doesn't match recorded length");
9262
9098
  var a = new DataView(n.buffer, 0);
9263
9099
  return { data: a, offset: 0 };
9264
9100
  } else
9265
9101
  return { data: e, offset: r.offset };
9266
9102
  }
9267
- function el(e, r) {
9103
+ function qu(e, r) {
9268
9104
  r = r ?? {};
9269
9105
  var t, n, a = new A({ empty: !0 }), s = new DataView(e, 0), i, u = [], o = w.getTag(s, 0);
9270
9106
  if (o === "\0\0\0" || o === "true" || o === "typ1")
9271
- a.outlinesFormat = "truetype", i = w.getUShort(s, 4), u = en(s, i);
9107
+ a.outlinesFormat = "truetype", i = w.getUShort(s, 4), u = Jt(s, i);
9272
9108
  else if (o === "OTTO")
9273
- a.outlinesFormat = "cff", i = w.getUShort(s, 4), u = en(s, i);
9109
+ a.outlinesFormat = "cff", i = w.getUShort(s, 4), u = Jt(s, i);
9274
9110
  else if (o === "wOFF") {
9275
9111
  var l = w.getTag(s, 4);
9276
9112
  if (l === "\0\0\0")
@@ -9279,7 +9115,7 @@ function el(e, r) {
9279
9115
  a.outlinesFormat = "cff";
9280
9116
  else
9281
9117
  throw new Error("Unsupported OpenType flavor " + o);
9282
- i = w.getUShort(s, 12), u = Ju(s, i);
9118
+ i = w.getUShort(s, 12), u = Vu(s, i);
9283
9119
  } else
9284
9120
  throw new Error("Unsupported OpenType signature " + o);
9285
9121
  for (var f, p, c, h, v, g, m, y, S, b, O, C, R = 0; R < i; R += 1) {
@@ -9316,10 +9152,10 @@ function el(e, r) {
9316
9152
  b = L;
9317
9153
  break;
9318
9154
  case "OS/2":
9319
- F = B(s, L), a.tables.os2 = qr.parse(F.data, F.offset);
9155
+ F = B(s, L), a.tables.os2 = Vr.parse(F.data, F.offset);
9320
9156
  break;
9321
9157
  case "post":
9322
- F = B(s, L), a.tables.post = Mn.parse(F.data, F.offset), a.glyphNames = new rt(a.tables.post);
9158
+ F = B(s, L), a.tables.post = Mn.parse(F.data, F.offset), a.glyphNames = new et(a.tables.post);
9323
9159
  break;
9324
9160
  case "prep":
9325
9161
  F = B(s, L), C = new w.Parser(F.data, F.offset), a.tables.prep = C.parseByteList(L.length);
@@ -9352,7 +9188,7 @@ function el(e, r) {
9352
9188
  }
9353
9189
  var P = B(s, b);
9354
9190
  if (a.tables.name = Bn.parse(P.data, P.offset, n), a.names = a.tables.name, c && S) {
9355
- var K = t === 0, j = B(s, S), ee = $u.parse(j.data, j.offset, a.numGlyphs, K), re = B(s, c);
9191
+ var K = t === 0, j = B(s, S), ee = _u.parse(j.data, j.offset, a.numGlyphs, K), re = B(s, c);
9356
9192
  a.glyphs = Vn.parse(re.data, re.offset, ee, a, r);
9357
9193
  } else if (f) {
9358
9194
  var M = B(s, f);
@@ -9360,18 +9196,18 @@ function el(e, r) {
9360
9196
  } else
9361
9197
  throw new Error("Font doesn't contain TrueType or CFF outlines.");
9362
9198
  var H = B(s, m);
9363
- if (Ln.parse(a, H.data, H.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, r), ps(a, r), y) {
9199
+ if (Ln.parse(a, H.data, H.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, r), ns(a, r), y) {
9364
9200
  var _ = B(s, y);
9365
- a.kerningPairs = ju.parse(_.data, _.offset);
9201
+ a.kerningPairs = zu.parse(_.data, _.offset);
9366
9202
  } else
9367
9203
  a.kerningPairs = {};
9368
9204
  if (h) {
9369
9205
  var V = B(s, h);
9370
- a.tables.gdef = Wu.parse(V.data, V.offset);
9206
+ a.tables.gdef = Du.parse(V.data, V.offset);
9371
9207
  }
9372
9208
  if (v) {
9373
9209
  var q = B(s, v);
9374
- a.tables.gpos = Xu.parse(q.data, q.offset), a.position.init();
9210
+ a.tables.gpos = Mu.parse(q.data, q.offset), a.position.init();
9375
9211
  }
9376
9212
  if (g) {
9377
9213
  var z = B(s, g);
@@ -9379,7 +9215,7 @@ function el(e, r) {
9379
9215
  }
9380
9216
  if (p) {
9381
9217
  var Z = B(s, p);
9382
- a.tables.fvar = Pu.parse(Z.data, Z.offset, a.names);
9218
+ a.tables.fvar = Cu.parse(Z.data, Z.offset, a.names);
9383
9219
  }
9384
9220
  if (O) {
9385
9221
  var D = B(s, O);
@@ -9397,7 +9233,7 @@ class Y {
9397
9233
  }
9398
9234
  /** 从 ArrayBuffer 解析字体,生成 typeface.json。 */
9399
9235
  static fromArrayBuffer(r, t) {
9400
- const n = el(r);
9236
+ const n = qu(r);
9401
9237
  return Y._convert(n, t?.chars);
9402
9238
  }
9403
9239
  /** 将 typeface.json 转为 Three.js Font 对象,可直接用于文字几何。 */
@@ -9739,6 +9575,170 @@ class fl {
9739
9575
  r.stopImmediatePropagation();
9740
9576
  };
9741
9577
  }
9578
+ function ot() {
9579
+ const e = globalThis.crypto?.subtle;
9580
+ if (!e)
9581
+ throw new Error("[BimEngine] Web Crypto API is required for secure sdkAuth credentials mode");
9582
+ return e;
9583
+ }
9584
+ function _e(e) {
9585
+ return new TextEncoder().encode(e);
9586
+ }
9587
+ function Ve(e) {
9588
+ return e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength);
9589
+ }
9590
+ function en(e) {
9591
+ let r = "";
9592
+ return e.forEach((t) => {
9593
+ r += String.fromCharCode(t);
9594
+ }), btoa(r);
9595
+ }
9596
+ function Xu(e) {
9597
+ const r = e.getUTCFullYear(), t = String(e.getUTCMonth() + 1).padStart(2, "0"), n = String(e.getUTCDate()).padStart(2, "0");
9598
+ return `${r}${t}${n}`;
9599
+ }
9600
+ async function Yu(e) {
9601
+ const r = await ot().digest("SHA-256", Ve(_e(e)));
9602
+ return Array.from(new Uint8Array(r)).map((t) => t.toString(16).padStart(2, "0")).join("");
9603
+ }
9604
+ async function Zu(e, r) {
9605
+ const t = ot(), n = await t.importKey("raw", Ve(e), { name: "HMAC", hash: "SHA-256" }, !1, ["sign"]);
9606
+ return t.sign("HMAC", n, Ve(_e(r)));
9607
+ }
9608
+ function Ku(e) {
9609
+ return _e(
9610
+ [e.appId, e.engineType, e.requestDate, String(e.timestamp), e.nonce].join("|")
9611
+ );
9612
+ }
9613
+ async function ju(e) {
9614
+ const r = ot(), t = /* @__PURE__ */ new Date(), n = t.getTime(), a = Xu(t), s = globalThis.crypto.randomUUID(), i = globalThis.crypto.getRandomValues(new Uint8Array(12)), u = await Yu(e.appSecret), o = await Zu(_e(u), a), l = await r.importKey("raw", o, "AES-GCM", !1, ["encrypt"]), f = JSON.stringify({
9615
+ appKey: e.appKey,
9616
+ appSecret: e.appSecret
9617
+ }), p = await r.encrypt(
9618
+ {
9619
+ name: "AES-GCM",
9620
+ iv: i,
9621
+ additionalData: Ve(Ku({
9622
+ appId: e.appId,
9623
+ engineType: e.engineType,
9624
+ requestDate: a,
9625
+ timestamp: n,
9626
+ nonce: s
9627
+ })),
9628
+ tagLength: 128
9629
+ },
9630
+ l,
9631
+ Ve(_e(f))
9632
+ );
9633
+ return {
9634
+ appId: e.appId,
9635
+ engineType: e.engineType,
9636
+ requestDate: a,
9637
+ timestamp: n,
9638
+ nonce: s,
9639
+ iv: en(i),
9640
+ cipherText: en(new Uint8Array(p)),
9641
+ sdkVersion: e.sdkVersion,
9642
+ origin: e.origin,
9643
+ product: e.product
9644
+ };
9645
+ }
9646
+ const Pr = /* @__PURE__ */ new Map();
9647
+ function mr(e) {
9648
+ return e.replace(/\/+$/, "");
9649
+ }
9650
+ function yr(e) {
9651
+ if (e) return e;
9652
+ if (typeof window < "u" && typeof window.location?.origin == "string")
9653
+ return window.location.origin;
9654
+ }
9655
+ function Qu(e, r) {
9656
+ return JSON.stringify({
9657
+ endpoint: mr(e.endpoint),
9658
+ token: e.token ?? "",
9659
+ appId: e.appId ?? "",
9660
+ appKey: e.appKey ?? "",
9661
+ appSecret: e.appSecret ?? "",
9662
+ origin: yr(e.origin) ?? "",
9663
+ product: e.product ?? "",
9664
+ engineType: r,
9665
+ sdkVersion: lr
9666
+ });
9667
+ }
9668
+ async function Xr(e, r, t) {
9669
+ const n = typeof AbortController < "u" ? new AbortController() : void 0, a = n ? setTimeout(() => n.abort(), t) : void 0;
9670
+ try {
9671
+ const s = await fetch(e, {
9672
+ method: "POST",
9673
+ headers: {
9674
+ "Content-Type": "application/json"
9675
+ },
9676
+ body: JSON.stringify(r),
9677
+ signal: n?.signal
9678
+ }), i = await s.json().catch(() => ({}));
9679
+ if (!s.ok) {
9680
+ const u = i?.error?.message ?? i?.message ?? `SDK authentication failed with status ${s.status}`;
9681
+ throw new Error(u);
9682
+ }
9683
+ return i;
9684
+ } finally {
9685
+ a != null && clearTimeout(a);
9686
+ }
9687
+ }
9688
+ async function $u(e, r) {
9689
+ const t = await Xr(`${mr(e.endpoint)}/oauth/sdk-verify`, {
9690
+ sdkToken: e.token,
9691
+ engineType: r,
9692
+ sdkVersion: lr,
9693
+ origin: yr(e.origin),
9694
+ product: e.product
9695
+ }, e.timeoutMs ?? 8e3);
9696
+ return t.sdkToken = e.token, t;
9697
+ }
9698
+ async function Ju(e, r) {
9699
+ const t = await ju({
9700
+ appId: e.appId,
9701
+ appKey: e.appKey,
9702
+ appSecret: e.appSecret,
9703
+ engineType: r,
9704
+ sdkVersion: lr,
9705
+ origin: yr(e.origin),
9706
+ product: e.product
9707
+ }), n = await Xr(
9708
+ `${mr(e.endpoint)}/oauth/sdk-token/secure`,
9709
+ t,
9710
+ e.timeoutMs ?? 8e3
9711
+ ), a = await Xr(`${mr(e.endpoint)}/oauth/sdk-verify`, {
9712
+ sdkToken: n.sdkToken,
9713
+ engineType: r,
9714
+ sdkVersion: lr,
9715
+ origin: yr(e.origin),
9716
+ product: e.product
9717
+ }, e.timeoutMs ?? 8e3);
9718
+ return a.sdkToken = n.sdkToken, a;
9719
+ }
9720
+ async function el(e, r) {
9721
+ const t = e?.sdkAuth;
9722
+ if (!t)
9723
+ throw new Error("[BimEngine] sdkAuth is required. Provide sdkAuth.token or sdkAuth.appId/appKey/appSecret");
9724
+ if (!t.endpoint)
9725
+ throw new Error("[BimEngine] sdkAuth.endpoint is required");
9726
+ if (!t.token && !(t.appId && t.appKey && t.appSecret))
9727
+ throw new Error("[BimEngine] Provide sdkAuth.token or sdkAuth.appId/appKey/appSecret");
9728
+ const n = Qu(t, r), a = Pr.get(n);
9729
+ if (a) {
9730
+ const i = await a;
9731
+ return e && (e.__sdkAuthSession = i), i;
9732
+ }
9733
+ const s = (t.token ? $u(t, r) : Ju(t, r)).then((i) => {
9734
+ if (i.authorized !== !0)
9735
+ throw new Error("[BimEngine] SDK authorization rejected");
9736
+ return e && (e.__sdkAuthSession = i), i;
9737
+ }).catch((i) => {
9738
+ throw Pr.delete(n), i;
9739
+ });
9740
+ return Pr.set(n, s), s;
9741
+ }
9742
9742
  function rl(e) {
9743
9743
  return e.replace(/\/+$/, "");
9744
9744
  }
@@ -9763,7 +9763,7 @@ async function tl(e, r, t) {
9763
9763
  }
9764
9764
  }
9765
9765
  async function cl(e, r, t) {
9766
- const n = await pa(e, t), a = e?.sdkAuth;
9766
+ const n = await el(e, t), a = e?.sdkAuth;
9767
9767
  if (!a?.endpoint)
9768
9768
  throw new Error("[BimEngine] sdkAuth.endpoint is required for viewToken loading");
9769
9769
  if (!n?.sdkToken)
@@ -9779,12 +9779,11 @@ async function cl(e, r, t) {
9779
9779
  );
9780
9780
  }
9781
9781
  export {
9782
- pr as B,
9782
+ fr as B,
9783
9783
  Y as F,
9784
9784
  fl as L,
9785
9785
  il as W,
9786
9786
  ul as a,
9787
- pa as b,
9788
9787
  ll as g,
9789
9788
  ol as l,
9790
9789
  cl as r