image-pii-redactor 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -294,8 +294,8 @@ class Lt {
294
294
  for (; (o = rt.nextNode()) !== null && u.length < s; ) {
295
295
  if (o.nodeType === 1) {
296
296
  if (o.hasAttributes()) for (const h of o.getAttributeNames()) if (h.endsWith(Pa)) {
297
- const d = l[a++], m = o.getAttribute(h).split(Ke), C = /([.?@])?(.*)/.exec(d);
298
- u.push({ type: 1, index: i, name: C[2], strings: m, ctor: C[1] === "." ? Bs : C[1] === "?" ? Ms : C[1] === "@" ? Vs : Dn }), o.removeAttribute(h);
297
+ const d = l[a++], m = o.getAttribute(h).split(Ke), P = /([.?@])?(.*)/.exec(d);
298
+ u.push({ type: 1, index: i, name: P[2], strings: m, ctor: P[1] === "." ? Bs : P[1] === "?" ? Ms : P[1] === "@" ? Vs : Dn }), o.removeAttribute(h);
299
299
  } else h.startsWith(Ke) && (u.push({ type: 6, index: i }), o.removeAttribute(h));
300
300
  if (Aa.test(o.tagName)) {
301
301
  const h = o.textContent.split(Ke), d = h.length - 1;
@@ -524,7 +524,7 @@ _s?.({ LitElement: Ft });
524
524
  * Copyright 2017 Google LLC
525
525
  * SPDX-License-Identifier: BSD-3-Clause
526
526
  */
527
- const Js = (e) => (t, n) => {
527
+ const Rs = (e) => (t, n) => {
528
528
  n !== void 0 ? n.addInitializer(() => {
529
529
  customElements.define(e, t);
530
530
  }) : customElements.define(e, t);
@@ -534,7 +534,7 @@ const Js = (e) => (t, n) => {
534
534
  * Copyright 2017 Google LLC
535
535
  * SPDX-License-Identifier: BSD-3-Clause
536
536
  */
537
- const Rs = { attribute: !0, type: String, converter: Cn, reflect: !1, hasChanged: Er }, Us = (e = Rs, t, n) => {
537
+ const Js = { attribute: !0, type: String, converter: Cn, reflect: !1, hasChanged: Er }, Us = (e = Js, t, n) => {
538
538
  const { kind: r, metadata: o } = n;
539
539
  let i = globalThis.litPropertyMetadata.get(o);
540
540
  if (i === void 0 && globalThis.litPropertyMetadata.set(o, i = /* @__PURE__ */ new Map()), r === "setter" && ((e = Object.create(e)).wrapped = !0), i.set(n.name, e), r === "accessor") {
@@ -1198,7 +1198,7 @@ async function au(e, t = "eng", n) {
1198
1198
  T < m.length - 1 && (h += `
1199
1199
  `, d += 1);
1200
1200
  }
1201
- const C = c.data, ee = C.imageWidth ?? a, Ae = C.imageHeight ?? s;
1201
+ const P = c.data, ee = P.imageWidth ?? a, Ae = P.imageHeight ?? s;
1202
1202
  return { fullText: h, words: l, imageWidth: ee, imageHeight: Ae };
1203
1203
  }
1204
1204
  function su(e, t, n) {
@@ -1491,7 +1491,7 @@ be.lastTerm = be.lastTerms;
1491
1491
  be.firstTerm = be.firstTerms;
1492
1492
  const sr = Object.assign({}, be, Pu, ju);
1493
1493
  sr.get = sr.eq;
1494
- class Re {
1494
+ class Je {
1495
1495
  constructor(t, n, r = {}) {
1496
1496
  [
1497
1497
  ["document", t],
@@ -1544,7 +1544,7 @@ class Re {
1544
1544
  }
1545
1545
  // create a new View, from this one
1546
1546
  update(t) {
1547
- const n = new Re(this.document, t);
1547
+ const n = new Je(this.document, t);
1548
1548
  if (this._cache && t && t.length > 0) {
1549
1549
  const r = [];
1550
1550
  t.forEach((o, i) => {
@@ -1556,10 +1556,10 @@ class Re {
1556
1556
  }
1557
1557
  // create a new View, from this one
1558
1558
  toView(t) {
1559
- return new Re(this.document, t || this.pointer);
1559
+ return new Je(this.document, t || this.pointer);
1560
1560
  }
1561
1561
  fromText(t) {
1562
- const { methods: n } = this, r = n.one.tokenize.fromString(t, this.world), o = new Re(r);
1562
+ const { methods: n } = this, r = n.one.tokenize.fromString(t, this.world), o = new Je(r);
1563
1563
  return o.world = this.world, o.compute(["normal", "freeze", "lexicon"]), this.world.compute.preTagger && o.compute("preTagger"), o.compute("unfreeze"), o;
1564
1564
  }
1565
1565
  clone() {
@@ -1569,7 +1569,7 @@ class Re {
1569
1569
  return n.document = t, n._cache = this._cache, n;
1570
1570
  }
1571
1571
  }
1572
- Object.assign(Re.prototype, sr);
1572
+ Object.assign(Je.prototype, sr);
1573
1573
  const Tu = "14.15.0", mo = function(e) {
1574
1574
  return e && typeof e == "object" && !Array.isArray(e);
1575
1575
  }, Iu = function(e) {
@@ -1635,7 +1635,7 @@ const Du = function(e, t) {
1635
1635
  return o;
1636
1636
  }, jn = Object.assign({}, ar), v = function(e, t) {
1637
1637
  t && v.addWords(t);
1638
- const n = Ta(e, Re, jn);
1638
+ const n = Ta(e, Je, jn);
1639
1639
  return e && n.compute(jn.hooks), n;
1640
1640
  };
1641
1641
  Object.defineProperty(v, "_world", {
@@ -1645,11 +1645,11 @@ Object.defineProperty(v, "_world", {
1645
1645
  v.tokenize = function(e, t) {
1646
1646
  const { compute: n } = this._world;
1647
1647
  t && v.addWords(t);
1648
- const r = Ta(e, Re, jn);
1648
+ const r = Ta(e, Je, jn);
1649
1649
  return n.contractions && r.compute(["alias", "normal", "machine", "contractions"]), r;
1650
1650
  };
1651
1651
  v.plugin = function(e) {
1652
- return ja(e, this._world, Re, this), this;
1652
+ return ja(e, this._world, Je, this), this;
1653
1653
  };
1654
1654
  v.extend = v.plugin;
1655
1655
  v.world = function() {
@@ -1744,16 +1744,16 @@ const Fu = function(e) {
1744
1744
  const a = i.match(r).join(""), s = n[n.length - 1];
1745
1745
  s.post = a + s.post, o.post = o.post.replace(r, "");
1746
1746
  }
1747
- }, Ju = function(e, t, n) {
1747
+ }, Ru = function(e, t, n) {
1748
1748
  const r = e[t];
1749
1749
  if (t !== 0 || !bo(r.text))
1750
1750
  return;
1751
1751
  n[0].text = Ku(n[0].text);
1752
1752
  const o = e[t];
1753
1753
  o.tags.has("ProperNoun") || o.tags.has("Acronym") || bo(o.text) && o.text.length > 1 && (o.text = _u(o.text));
1754
- }, Ru = function(e, t, n, r) {
1754
+ }, Ju = function(e, t, n, r) {
1755
1755
  const [o, i, a] = t;
1756
- i === 0 || a === r[o].length ? xt(n) : (xt(n), xt([e[t[1]]])), Ju(e, i, n), Ia(e, i, n);
1756
+ i === 0 || a === r[o].length ? xt(n) : (xt(n), xt([e[t[1]]])), Ru(e, i, n), Ia(e, i, n);
1757
1757
  }, Uu = function(e, t, n, r) {
1758
1758
  const [o, , i] = t, a = (r[o] || []).length;
1759
1759
  i < a ? (yo(e, i, n), xt(n)) : a === i && (xt(e), yo(e, i, n), r[o + 1] && (n[n.length - 1].post += " ")), Ia(e, t[2], n), t[4] = n[n.length - 1].id;
@@ -1782,7 +1782,7 @@ const vo = (e) => (e = e.length < 3 ? "0" + e : e, e.length < 3 ? "0" + e : e),
1782
1782
  t.forEach((u, c) => {
1783
1783
  const l = u.fullPointer[0], [h] = l, d = r[h];
1784
1784
  let m = Qu(e, o);
1785
- m.length !== 0 && (m = qu(m), n ? (wo(t.update([l]).firstTerm()), Ru(d, l, m, r)) : (wo(t.update([l]).lastTerm()), Uu(d, l, m, r)), r[h] && r[h][l[1]] && (l[3] = r[h][l[1]].id), a[c] = l, l[2] += m.length, i[c] = l);
1785
+ m.length !== 0 && (m = qu(m), n ? (wo(t.update([l]).firstTerm()), Ju(d, l, m, r)) : (wo(t.update([l]).lastTerm()), Uu(d, l, m, r)), r[h] && r[h][l[1]] && (l[3] = r[h][l[1]].id), a[c] = l, l[2] += m.length, i[c] = l);
1786
1786
  });
1787
1787
  const s = t.toView(i);
1788
1788
  return t.ptrs = a, s.compute(["id", "index", "freeze", "lexicon"]), s.world.compute.preTagger && s.compute("preTagger"), s.compute("unfreeze"), s;
@@ -2178,12 +2178,12 @@ const ac = (e, t) => e.normal < t.normal ? -1 : e.normal > t.normal ? 1 : 0, sc
2178
2178
  preJ: Lc,
2179
2179
  preL: Mc,
2180
2180
  preD: Vc
2181
- }, Wc = /^([0-9.]{1,4}[a-z]{0,2}) ?[-–—] ?([0-9]{1,4}[a-z]{0,2})$/i, Kc = /^([0-9]{1,2}(:[0-9][0-9])?(am|pm)?) ?[-–—] ?([0-9]{1,2}(:[0-9][0-9])?(am|pm)?)$/i, _c = /^[0-9]{3}-[0-9]{4}$/, Jc = function(e, t) {
2181
+ }, Wc = /^([0-9.]{1,4}[a-z]{0,2}) ?[-–—] ?([0-9]{1,4}[a-z]{0,2})$/i, Kc = /^([0-9]{1,2}(:[0-9][0-9])?(am|pm)?) ?[-–—] ?([0-9]{1,2}(:[0-9][0-9])?(am|pm)?)$/i, _c = /^[0-9]{3}-[0-9]{4}$/, Rc = function(e, t) {
2182
2182
  const n = e[t];
2183
2183
  let r = n.text.match(Wc);
2184
2184
  return r !== null ? n.tags.has("PhoneNumber") === !0 || _c.test(n.text) ? null : [r[1], "to", r[2]] : (r = n.text.match(Kc), r !== null ? [r[1], "to", r[4]] : null);
2185
- }, Rc = /^([+-]?[0-9][.,0-9]*)([a-z°²³µ/]+)$/, Uc = function(e, t, n) {
2186
- const r = n.model.one.numberSuffixes || {}, i = e[t].text.match(Rc);
2185
+ }, Jc = /^([+-]?[0-9][.,0-9]*)([a-z°²³µ/]+)$/, Uc = function(e, t, n) {
2186
+ const r = n.model.one.numberSuffixes || {}, i = e[t].text.match(Jc);
2187
2187
  if (i !== null) {
2188
2188
  const a = i[2].toLowerCase().trim();
2189
2189
  return r.hasOwnProperty(a) ? null : [i[1], a];
@@ -2240,7 +2240,7 @@ const ac = (e, t) => e.normal < t.normal ? -1 : e.normal > t.normal ? 1 : 0, sc
2240
2240
  continue;
2241
2241
  }
2242
2242
  if (qc.test(a[u].normal)) {
2243
- h = Jc(a, u), h && (h = Ln(h, e), Mn(n, [s, u], h), o.one.setTag(h, "NumberRange", t), h[2] && h[2].tags.has("Time") && o.one.setTag([h[0]], "Time", t, null, "time-range"), xo(n[s], e, u, h.length));
2243
+ h = Rc(a, u), h && (h = Ln(h, e), Mn(n, [s, u], h), o.one.setTag(h, "NumberRange", t), h[2] && h[2].tags.has("Time") && o.one.setTag([h[0]], "Time", t, null, "time-range"), xo(n[s], e, u, h.length));
2244
2244
  continue;
2245
2245
  }
2246
2246
  h = Uc(a, u, t), h && (h = Ln(h, e), Mn(n, [s, u], h), o.one.setTag([h[1]], "Unit", t, null, "contraction-unit"));
@@ -2258,9 +2258,9 @@ const ac = (e, t) => e.normal < t.normal ? -1 : e.normal > t.normal ? 1 : 0, sc
2258
2258
  if (a[l] !== void 0 && s[u + 1]) {
2259
2259
  const h = u + a[l] - 1;
2260
2260
  for (let d = h; d > u; d -= 1) {
2261
- const m = s.slice(u, d + 1), C = m.map((ee) => ee.machine || ee.normal).join(" ");
2262
- if (i.hasOwnProperty(C) === !0) {
2263
- o(m, i[C], t, !1, "1-frozen-multi-lexicon"), m.forEach((ee) => ee.frozen = !0);
2261
+ const m = s.slice(u, d + 1), P = m.map((ee) => ee.machine || ee.normal).join(" ");
2262
+ if (i.hasOwnProperty(P) === !0) {
2263
+ o(m, i[P], t, !1, "1-frozen-multi-lexicon"), m.forEach((ee) => ee.frozen = !0);
2264
2264
  continue;
2265
2265
  }
2266
2266
  }
@@ -2316,10 +2316,10 @@ const ac = (e, t) => e.normal < t.normal ? -1 : e.normal > t.normal ? 1 : 0, sc
2316
2316
  const d = e.slice(t, h + 1);
2317
2317
  if (d.length <= 1)
2318
2318
  return !1;
2319
- const m = d.map((C) => C.machine || C.normal).join(" ");
2319
+ const m = d.map((P) => P.machine || P.normal).join(" ");
2320
2320
  if (s.hasOwnProperty(m) === !0) {
2321
- const C = s[m];
2322
- return i(d, C, n, !1, "1-multi-lexicon"), C && C.length === 2 && (C[0] === "PhrasalVerb" || C[1] === "PhrasalVerb") && i([d[1]], "Particle", n, !1, "1-phrasal-particle"), !0;
2321
+ const P = s[m];
2322
+ return i(d, P, n, !1, "1-multi-lexicon"), P && P.length === 2 && (P[0] === "PhrasalVerb" || P[1] === "PhrasalVerb") && i([d[1]], "Particle", n, !1, "1-phrasal-particle"), !0;
2323
2323
  }
2324
2324
  }
2325
2325
  return !1;
@@ -2503,7 +2503,7 @@ const kl = {
2503
2503
  return n = Do(n, t), Object.keys(r).forEach((o) => {
2504
2504
  r[o] = Do(r[o], t);
2505
2505
  }), { ptrs: n, byGroup: r };
2506
- }, Rt = function(e, t, n) {
2506
+ }, Jt = function(e, t, n) {
2507
2507
  const r = n.methods.one;
2508
2508
  return typeof e == "number" && (e = String(e)), typeof e == "string" && (e = r.killUnicode(e, n), e = r.parseMatch(e, t, n)), e;
2509
2509
  }, Sa = (e) => Object.prototype.toString.call(e) === "[object Object]", Ut = (e) => e && Sa(e) && e.isView === !0, qt = (e) => e && Sa(e) && e.isNet === !0, Al = function(e, t, n) {
@@ -2512,7 +2512,7 @@ const kl = {
2512
2512
  return this.intersection(e);
2513
2513
  if (qt(e))
2514
2514
  return this.sweep(e, { tagger: !1 }).view.settle();
2515
- e = Rt(e, n, this.world);
2515
+ e = Jt(e, n, this.world);
2516
2516
  const o = { regs: e, group: t }, i = r.match(this.docs, o, this._cache), { ptrs: a, byGroup: s } = Ha(i, this.fullPointer), u = this.toView(a);
2517
2517
  return u._groups = s, u;
2518
2518
  }, xl = function(e, t, n) {
@@ -2521,7 +2521,7 @@ const kl = {
2521
2521
  return this.intersection(e).eq(0);
2522
2522
  if (qt(e))
2523
2523
  return this.sweep(e, { tagger: !1, matchOne: !0 }).view;
2524
- e = Rt(e, n, this.world);
2524
+ e = Jt(e, n, this.world);
2525
2525
  const o = { regs: e, group: t, justOne: !0 }, i = r.match(this.docs, o, this._cache), { ptrs: a, byGroup: s } = Ha(i, this.fullPointer), u = this.toView(a);
2526
2526
  return u._groups = s, u;
2527
2527
  }, Cl = function(e, t, n) {
@@ -2530,7 +2530,7 @@ const kl = {
2530
2530
  return this.intersection(e).fullPointer.length > 0;
2531
2531
  if (qt(e))
2532
2532
  return this.sweep(e, { tagger: !1 }).view.found;
2533
- e = Rt(e, n, this.world);
2533
+ e = Jt(e, n, this.world);
2534
2534
  const o = { regs: e, group: t, justOne: !0 };
2535
2535
  return r.match(this.docs, o, this._cache).ptrs.length > 0;
2536
2536
  }, $l = function(e, t, n) {
@@ -2541,7 +2541,7 @@ const kl = {
2541
2541
  const u = this.sweep(e, { tagger: !1 }).view.settle();
2542
2542
  return this.if(u);
2543
2543
  }
2544
- e = Rt(e, n, this.world);
2544
+ e = Jt(e, n, this.world);
2545
2545
  const o = { regs: e, group: t, justOne: !0 };
2546
2546
  let i = this.fullPointer;
2547
2547
  const a = this._cache || [];
@@ -2559,7 +2559,7 @@ const kl = {
2559
2559
  const s = this.sweep(e, { tagger: !1 }).view.settle();
2560
2560
  return this.ifNo(s);
2561
2561
  }
2562
- e = Rt(e, n, this.world);
2562
+ e = Jt(e, n, this.world);
2563
2563
  const i = this._cache || [], a = this.filter((s, u) => {
2564
2564
  const c = { regs: e, group: t, justOne: !0 };
2565
2565
  return o.match(s.docs, c, i[u]).ptrs.length === 0;
@@ -2712,7 +2712,7 @@ const zl = function(e) {
2712
2712
  return e = Ot(e), n.switch = e, n;
2713
2713
  }
2714
2714
  return ne(e) === "#" ? (n.tag = Pt(e), n.tag = zo(n.tag), n) : ne(e) === "@" ? (n.method = Pt(e), n) : e === "." ? (n.anything = !0, n) : e === "*" ? (n.anything = !0, n.greedy = !0, n.optional = !0, n) : (e && (e = e.replace("\\*", "*"), e = e.replace("\\.", "."), t.caseSensitive ? n.use = "text" : e = e.toLowerCase(), n.word = e), n);
2715
- }, _l = /[a-z0-9][-–—][a-z]/i, Jl = function(e, t) {
2715
+ }, _l = /[a-z0-9][-–—][a-z]/i, Rl = function(e, t) {
2716
2716
  const n = t.model.one.prefixes;
2717
2717
  for (let r = e.length - 1; r >= 0; r -= 1) {
2718
2718
  const o = e[r];
@@ -2736,7 +2736,7 @@ const zl = function(e) {
2736
2736
  }, Vo = function(e, t) {
2737
2737
  const { all: n } = t.methods.two.transform.adjective || {};
2738
2738
  return n ? n(e.root, t.model) : [e.root];
2739
- }, Rl = function(e, t) {
2739
+ }, Jl = function(e, t) {
2740
2740
  return e = e.map((n) => {
2741
2741
  if (n.root)
2742
2742
  if (t.methods.two && t.methods.two.transform) {
@@ -2780,7 +2780,7 @@ const zl = function(e) {
2780
2780
  return [];
2781
2781
  t = t || {}, typeof e == "number" && (e = String(e));
2782
2782
  let r = Wl(e);
2783
- return r = r.map((o) => Fa(o, t)), r = Jl(r, n), r = Rl(r, n), r = Zl(r), r;
2783
+ return r = r.map((o) => Fa(o, t)), r = Rl(r, n), r = Jl(r, n), r = Zl(r), r;
2784
2784
  }, Yl = function(e, t) {
2785
2785
  for (const n of t)
2786
2786
  if (e.has(n))
@@ -3385,7 +3385,7 @@ const Mh = () => typeof window < "u" && window.document, Vh = function(e) {
3385
3385
  return e.forEach((r) => {
3386
3386
  t[r] = t[r] || 0, t[r] += 1;
3387
3387
  }), Object.keys(t).map((r) => ({ normal: r, count: t[r] })).sort((r, o) => r.count > o.count ? -1 : 0);
3388
- }, Jh = function(e) {
3388
+ }, Rh = function(e) {
3389
3389
  if (Kh(e))
3390
3390
  return La(this, e);
3391
3391
  if (e === "text")
@@ -3414,11 +3414,11 @@ const Mh = () => typeof window < "u" && window.document, Vh = function(e) {
3414
3414
  }), t;
3415
3415
  }
3416
3416
  return e === "tags" ? this.docs.map((t) => t.reduce((n, r) => (n[r.implicit || r.normal] = Array.from(r.tags), n), {})) : e === "debug" ? this.debug() : this.text();
3417
- }, Rh = {
3417
+ }, Jh = {
3418
3418
  /** */
3419
3419
  debug: Vh,
3420
3420
  /** */
3421
- out: Jh,
3421
+ out: Rh,
3422
3422
  /** */
3423
3423
  wrap: function(e) {
3424
3424
  return La(this, e);
@@ -3433,7 +3433,7 @@ const Mh = () => typeof window < "u" && window.document, Vh = function(e) {
3433
3433
  }
3434
3434
  return t.keepPunct === void 0 && (t.keepPunct = !0), t.keepSpace === void 0 && (t.keepSpace = !0), Fh(this.docs, t);
3435
3435
  }
3436
- }, Qh = Object.assign({}, Rh, qh, dr, Oh), Zh = function(e) {
3436
+ }, Qh = Object.assign({}, Jh, qh, dr, Oh), Zh = function(e) {
3437
3437
  Object.assign(e.prototype, Qh);
3438
3438
  }, Xh = function(e) {
3439
3439
  console.log("%c -=-=- ", "background-color:#6699cc;"), e.forEach((t) => {
@@ -3634,7 +3634,7 @@ const Mh = () => typeof window < "u" && window.document, Vh = function(e) {
3634
3634
  const u = sd(s);
3635
3635
  o.push(u);
3636
3636
  }), o = ud(o), o;
3637
- }, Ja = function(e, t) {
3637
+ }, Ra = function(e, t) {
3638
3638
  const n = [];
3639
3639
  return Ka(e, t).forEach((o) => {
3640
3640
  o.passthrough && n.push(o.passthrough), o.before && n.push(o.before), o.after && n.push(o.after);
@@ -3672,13 +3672,13 @@ ke.intersection = function(e) {
3672
3672
  };
3673
3673
  ke.not = function(e) {
3674
3674
  e = Kr(e, this);
3675
- let t = Ja(this.fullPointer, e.fullPointer);
3675
+ let t = Ra(this.fullPointer, e.fullPointer);
3676
3676
  return t = Qt(t, this.document), this.toView(t);
3677
3677
  };
3678
3678
  ke.difference = ke.not;
3679
3679
  ke.complement = function() {
3680
3680
  const e = this.all();
3681
- let t = Ja(e.fullPointer, this.fullPointer);
3681
+ let t = Ra(e.fullPointer, this.fullPointer);
3682
3682
  return t = Qt(t, this.document), this.toView(t);
3683
3683
  };
3684
3684
  ke.settle = function() {
@@ -3842,7 +3842,7 @@ const wd = function(e) {
3842
3842
  methods: {
3843
3843
  one: Sd
3844
3844
  }
3845
- }, Ra = / /, _o = function(e, t) {
3845
+ }, Ja = / /, _o = function(e, t) {
3846
3846
  t === "Noun" && (e.chunk = t), t === "Verb" && (e.chunk = t);
3847
3847
  }, Ua = function(e, t, n, r) {
3848
3848
  if (e.tags.has(t) === !0 || t === ".")
@@ -3862,7 +3862,7 @@ const wd = function(e) {
3862
3862
  }
3863
3863
  return e.tags.add(t), e.dirty = !0, _o(e, t), !0;
3864
3864
  }, Fd = function(e, t, n, r) {
3865
- const o = t.split(Ra);
3865
+ const o = t.split(Ja);
3866
3866
  e.forEach((i, a) => {
3867
3867
  let s = o[a];
3868
3868
  s && (s = s.replace(/^#/, ""), Ua(i, s, n, r));
@@ -3885,7 +3885,7 @@ const wd = function(e) {
3885
3885
  console.warn(`compromise: Invalid tag '${t}'`);
3886
3886
  return;
3887
3887
  }
3888
- if (t = t.trim(), Ra.test(t)) {
3888
+ if (t = t.trim(), Ja.test(t)) {
3889
3889
  Fd(e, t, i, r);
3890
3890
  return;
3891
3891
  }
@@ -3981,9 +3981,9 @@ const wd = function(e) {
3981
3981
  })), o;
3982
3982
  })(e) : (Ge(t = e).forEach(_e), t);
3983
3983
  var t;
3984
- }, _d = (e) => "\x1B[31m" + e + "\x1B[0m", Jd = (e) => "\x1B[2m" + e + "\x1B[0m", pr = function(e, t) {
3984
+ }, _d = (e) => "\x1B[31m" + e + "\x1B[0m", Rd = (e) => "\x1B[2m" + e + "\x1B[0m", pr = function(e, t) {
3985
3985
  let n = "-> ";
3986
- t && (n = Jd("→ "));
3986
+ t && (n = Rd("→ "));
3987
3987
  let r = "";
3988
3988
  return Ge(e).forEach(((o, i) => {
3989
3989
  let a = o.id || "";
@@ -3992,20 +3992,20 @@ const wd = function(e) {
3992
3992
  r += " ".repeat(s) + n + a + `
3993
3993
  `;
3994
3994
  })), r;
3995
- }, Jo = function(e) {
3995
+ }, Ro = function(e) {
3996
3996
  let t = Ge(e);
3997
3997
  t.forEach(((r) => {
3998
3998
  delete (r = Object.assign({}, r)).children;
3999
3999
  }));
4000
4000
  let n = t[0];
4001
4001
  return n && !n.id && Object.keys(n.props).length === 0 && t.shift(), t;
4002
- }, Ro = { text: pr, txt: pr, array: Jo, flat: Jo }, Uo = function(e, t) {
4003
- return t === "nested" || t === "json" ? e : t === "debug" ? (console.log(pr(e, !0)), null) : Ro.hasOwnProperty(t) ? Ro[t](e) : e;
4004
- }, Jn = (e) => {
4002
+ }, Jo = { text: pr, txt: pr, array: Ro, flat: Ro }, Uo = function(e, t) {
4003
+ return t === "nested" || t === "json" ? e : t === "debug" ? (console.log(pr(e, !0)), null) : Jo.hasOwnProperty(t) ? Jo[t](e) : e;
4004
+ }, Rn = (e) => {
4005
4005
  Ge(e, ((t, n) => {
4006
4006
  t.id && (t._cache.parents = t._cache.parents || [], n._cache.parents = t._cache.parents.concat([t.id]));
4007
4007
  }));
4008
- }, Rd = (e, t) => (Object.keys(t).forEach(((n) => {
4008
+ }, Jd = (e, t) => (Object.keys(t).forEach(((n) => {
4009
4009
  if (t[n] instanceof Set) {
4010
4010
  let r = e[n] || /* @__PURE__ */ new Set();
4011
4011
  e[n] = /* @__PURE__ */ new Set([...r, ...t[n]]);
@@ -4079,11 +4079,11 @@ let qd = class Pn {
4079
4079
  fillDown() {
4080
4080
  var t;
4081
4081
  return t = this.json, Ge(t, ((n, r) => {
4082
- r.props = Rd(r.props, n.props);
4082
+ r.props = Jd(r.props, n.props);
4083
4083
  })), this;
4084
4084
  }
4085
4085
  depth() {
4086
- Jn(this.json);
4086
+ Rn(this.json);
4087
4087
  let t = Ge(this.json), n = t.length > 1 ? 1 : 0;
4088
4088
  return t.forEach(((r) => {
4089
4089
  if (r._cache.parents.length === 0) return;
@@ -4092,10 +4092,10 @@ let qd = class Pn {
4092
4092
  })), n;
4093
4093
  }
4094
4094
  out(t) {
4095
- return Jn(this.json), Uo(this.json, t);
4095
+ return Rn(this.json), Uo(this.json, t);
4096
4096
  }
4097
4097
  debug() {
4098
- return Jn(this.json), Uo(this.json, "debug"), this;
4098
+ return Rn(this.json), Uo(this.json, "debug"), this;
4099
4099
  }
4100
4100
  };
4101
4101
  const Qa = function(e) {
@@ -4484,8 +4484,8 @@ const Ff = function(e) {
4484
4484
  e = e || "", e = e.toLowerCase(), e = e.trim();
4485
4485
  const t = e;
4486
4486
  return e = e.replace(/[,;.!?]+$/, ""), e = e.replace(/\u2026/g, "..."), e = e.replace(/\u2013/g, "-"), /^[:;]/.test(e) === !1 && (e = e.replace(/\.{3,}$/g, ""), e = e.replace(/[",.!:;?)]+$/g, ""), e = e.replace(/^['"(]+/g, "")), e = e.replace(/[\u200B-\u200D\uFEFF]/g, ""), e = e.trim(), e === "" && (e = t), e = e.replace(/([0-9]),([0-9])/g, "$1$2"), e;
4487
- }, _f = /([A-Z]\.)+[A-Z]?,?$/, Jf = /^[A-Z]\.,?$/, Rf = /[A-Z]{2,}('s|,)?$/, Uf = /([a-z]\.)+[a-z]\.?$/, qf = function(e) {
4488
- return _f.test(e) === !0 || Uf.test(e) === !0 || Jf.test(e) === !0 || Rf.test(e) === !0;
4487
+ }, _f = /([A-Z]\.)+[A-Z]?,?$/, Rf = /^[A-Z]\.,?$/, Jf = /[A-Z]{2,}('s|,)?$/, Uf = /([a-z]\.)+[a-z]\.?$/, qf = function(e) {
4488
+ return _f.test(e) === !0 || Uf.test(e) === !0 || Rf.test(e) === !0 || Jf.test(e) === !0;
4489
4489
  }, Qf = function(e) {
4490
4490
  return qf(e) && (e = e.replace(/\./g, "")), e;
4491
4491
  }, Xa = function(e, t) {
@@ -4971,15 +4971,15 @@ const mp = {
4971
4971
  for (let r = 0; r < n.length; r += 1)
4972
4972
  for (let o = 0; o < n[r].length; o += 1)
4973
4973
  n[r][o].normal !== "" && (t += 1, n[r][o].wordCount = t);
4974
- }, Rn = function(e, t) {
4974
+ }, Jn = function(e, t) {
4975
4975
  const n = e.docs;
4976
4976
  for (let r = 0; r < n.length; r += 1)
4977
4977
  for (let o = 0; o < n[r].length; o += 1)
4978
4978
  t(n[r][o], e.world);
4979
4979
  }, Tp = {
4980
- alias: (e) => Rn(e, kp),
4981
- machine: (e) => Rn(e, xp),
4982
- normal: (e) => Rn(e, Xa),
4980
+ alias: (e) => Jn(e, kp),
4981
+ machine: (e) => Jn(e, xp),
4982
+ normal: (e) => Jn(e, Xa),
4983
4983
  freq: Cp,
4984
4984
  offset: $p,
4985
4985
  index: Np,
@@ -5279,7 +5279,7 @@ const ts = {
5279
5279
  }, _p = function(e, t, n) {
5280
5280
  const r = br.fromAlphaCode(t);
5281
5281
  return r < e.symCount ? e.syms[r] : n + r + 1 - e.symCount;
5282
- }, Jp = function(e) {
5282
+ }, Rp = function(e) {
5283
5283
  const t = [], n = (r, o) => {
5284
5284
  let i = e.nodes[r];
5285
5285
  i[0] === "!" && (t.push(o), i = i.slice(1));
@@ -5298,13 +5298,13 @@ const ts = {
5298
5298
  }
5299
5299
  };
5300
5300
  return n(0, ""), t;
5301
- }, Rp = function(e) {
5301
+ }, Jp = function(e) {
5302
5302
  const t = {
5303
5303
  nodes: e.split(";"),
5304
5304
  syms: [],
5305
5305
  symCount: 0
5306
5306
  };
5307
- return e.match(":") && Kp(t), Jp(t);
5307
+ return e.match(":") && Kp(t), Rp(t);
5308
5308
  }, Up = function(e) {
5309
5309
  if (!e)
5310
5310
  return {};
@@ -5313,7 +5313,7 @@ const ts = {
5313
5313
  return r[i[0]] = i[1], r;
5314
5314
  }, {}), n = {};
5315
5315
  return Object.keys(t).forEach(function(r) {
5316
- const o = Rp(t[r]);
5316
+ const o = Jp(t[r]);
5317
5317
  r === "true" && (r = !0);
5318
5318
  for (let i = 0; i < o.length; i++) {
5319
5319
  const a = o[i];
@@ -6132,7 +6132,7 @@ const f = "Singular", G = {
6132
6132
  //as shocking as
6133
6133
  //about: jj, //cool about
6134
6134
  }
6135
- }, b = "Gerund", Je = {
6135
+ }, b = "Gerund", Re = {
6136
6136
  beforeTags: {
6137
6137
  // Verb: g, // loves shocking
6138
6138
  Adverb: b,
@@ -6230,65 +6230,65 @@ const f = "Singular", G = {
6230
6230
  down: b
6231
6231
  //
6232
6232
  }
6233
- }, k = "Gerund", Be = "Adjective", rg = {
6234
- beforeTags: Object.assign({}, M.beforeTags, Je.beforeTags, {
6233
+ }, A = "Gerund", Be = "Adjective", rg = {
6234
+ beforeTags: Object.assign({}, M.beforeTags, Re.beforeTags, {
6235
6235
  // Copula: jj,
6236
- Imperative: k,
6236
+ Imperative: A,
6237
6237
  //recommend living in
6238
6238
  Infinitive: Be,
6239
6239
  //say charming things
6240
6240
  // PresentTense: g,
6241
- Plural: k
6241
+ Plural: A
6242
6242
  //kids cutting
6243
6243
  }),
6244
- afterTags: Object.assign({}, M.afterTags, Je.afterTags, {
6244
+ afterTags: Object.assign({}, M.afterTags, Re.afterTags, {
6245
6245
  Noun: Be
6246
6246
  //shocking ignorance
6247
6247
  // Plural: jj, //shocking lies
6248
6248
  }),
6249
- beforeWords: Object.assign({}, M.beforeWords, Je.beforeWords, {
6249
+ beforeWords: Object.assign({}, M.beforeWords, Re.beforeWords, {
6250
6250
  is: Be,
6251
- are: k,
6251
+ are: A,
6252
6252
  //is overflowing: JJ, are overflowing : VB ??
6253
6253
  was: Be,
6254
6254
  of: Be,
6255
6255
  //of varying
6256
- suggest: k,
6257
- suggests: k,
6258
- suggested: k,
6259
- recommend: k,
6260
- recommends: k,
6261
- recommended: k,
6262
- imagine: k,
6263
- imagines: k,
6264
- imagined: k,
6265
- consider: k,
6266
- considered: k,
6267
- considering: k,
6268
- resist: k,
6269
- resists: k,
6270
- resisted: k,
6271
- avoid: k,
6272
- avoided: k,
6273
- avoiding: k,
6256
+ suggest: A,
6257
+ suggests: A,
6258
+ suggested: A,
6259
+ recommend: A,
6260
+ recommends: A,
6261
+ recommended: A,
6262
+ imagine: A,
6263
+ imagines: A,
6264
+ imagined: A,
6265
+ consider: A,
6266
+ considered: A,
6267
+ considering: A,
6268
+ resist: A,
6269
+ resists: A,
6270
+ resisted: A,
6271
+ avoid: A,
6272
+ avoided: A,
6273
+ avoiding: A,
6274
6274
  except: Be,
6275
6275
  accept: Be,
6276
- assess: k,
6277
- explore: k,
6278
- fear: k,
6279
- fears: k,
6280
- appreciate: k,
6281
- question: k,
6282
- help: k,
6283
- embrace: k,
6276
+ assess: A,
6277
+ explore: A,
6278
+ fear: A,
6279
+ fears: A,
6280
+ appreciate: A,
6281
+ question: A,
6282
+ help: A,
6283
+ embrace: A,
6284
6284
  with: Be
6285
6285
  //filled with daring
6286
6286
  }),
6287
- afterWords: Object.assign({}, M.afterWords, Je.afterWords, {
6288
- to: k,
6289
- not: k,
6287
+ afterWords: Object.assign({}, M.afterWords, Re.afterWords, {
6288
+ to: A,
6289
+ not: A,
6290
6290
  //trying not to car
6291
- the: k
6291
+ the: A
6292
6292
  //sweeping the country
6293
6293
  })
6294
6294
  }, si = {
@@ -6494,10 +6494,10 @@ const f = "Singular", G = {
6494
6494
  them: "Gerund"
6495
6495
  }
6496
6496
  }, ug = {
6497
- beforeTags: Object.assign({}, Je.beforeTags, G.beforeTags, rn.beforeTags),
6498
- afterTags: Object.assign({}, Je.afterTags, G.afterTags, rn.afterTags),
6499
- beforeWords: Object.assign({}, Je.beforeWords, G.beforeWords, rn.beforeWords),
6500
- afterWords: Object.assign({}, Je.afterWords, G.afterWords, rn.afterWords)
6497
+ beforeTags: Object.assign({}, Re.beforeTags, G.beforeTags, rn.beforeTags),
6498
+ afterTags: Object.assign({}, Re.afterTags, G.afterTags, rn.afterTags),
6499
+ beforeWords: Object.assign({}, Re.beforeWords, G.beforeWords, rn.beforeWords),
6500
+ afterWords: Object.assign({}, Re.afterWords, G.afterWords, rn.afterWords)
6501
6501
  }, pt = "Singular", Ze = "Infinitive", cg = {
6502
6502
  beforeTags: Object.assign({}, Q.beforeTags, G.beforeTags, {
6503
6503
  // Noun: undefined
@@ -6536,49 +6536,49 @@ const f = "Singular", G = {
6536
6536
  by: null,
6537
6537
  in: null
6538
6538
  })
6539
- }, x = "Person", V = {
6539
+ }, C = "Person", V = {
6540
6540
  beforeTags: {
6541
- Honorific: x,
6542
- Person: x
6541
+ Honorific: C,
6542
+ Person: C
6543
6543
  // Preposition: p, //with sue
6544
6544
  },
6545
6545
  afterTags: {
6546
- Person: x,
6547
- ProperNoun: x,
6548
- Verb: x
6546
+ Person: C,
6547
+ ProperNoun: C,
6548
+ Verb: C
6549
6549
  //bob could
6550
6550
  // Modal:true, //bob could
6551
6551
  // Copula:true, //bob is
6552
6552
  // PresentTense:true, //bob seems
6553
6553
  },
6554
6554
  beforeWords: {
6555
- hi: x,
6556
- hey: x,
6557
- yo: x,
6558
- dear: x,
6559
- hello: x
6555
+ hi: C,
6556
+ hey: C,
6557
+ yo: C,
6558
+ dear: C,
6559
+ hello: C
6560
6560
  },
6561
6561
  afterWords: {
6562
6562
  // person-usually verbs
6563
- said: x,
6564
- says: x,
6565
- told: x,
6566
- tells: x,
6567
- feels: x,
6568
- felt: x,
6569
- seems: x,
6570
- thinks: x,
6571
- thought: x,
6572
- spends: x,
6573
- spendt: x,
6574
- plays: x,
6575
- played: x,
6576
- sing: x,
6577
- sang: x,
6578
- learn: x,
6579
- learned: x,
6580
- wants: x,
6581
- wanted: x
6563
+ said: C,
6564
+ says: C,
6565
+ told: C,
6566
+ tells: C,
6567
+ feels: C,
6568
+ felt: C,
6569
+ seems: C,
6570
+ thinks: C,
6571
+ thought: C,
6572
+ spends: C,
6573
+ spendt: C,
6574
+ plays: C,
6575
+ played: C,
6576
+ sing: C,
6577
+ sang: C,
6578
+ learn: C,
6579
+ learned: C,
6580
+ wants: C,
6581
+ wanted: C
6582
6582
  // and:true, //sue and jeff
6583
6583
  }
6584
6584
  }, O = "Month", lg = "Person", on = {
@@ -6635,31 +6635,31 @@ const f = "Singular", G = {
6635
6635
  afterTags: Object.assign({}, G.afterTags, V.afterTags, Q.afterTags),
6636
6636
  beforeWords: Object.assign({}, G.beforeWords, V.beforeWords, Q.beforeWords),
6637
6637
  afterWords: Object.assign({}, G.afterWords, V.afterWords, Q.afterWords)
6638
- }, J = "Place", an = {
6638
+ }, R = "Place", an = {
6639
6639
  beforeTags: {
6640
- Place: J
6640
+ Place: R
6641
6641
  },
6642
6642
  afterTags: {
6643
- Place: J,
6644
- Abbreviation: J
6643
+ Place: R,
6644
+ Abbreviation: R
6645
6645
  },
6646
6646
  beforeWords: {
6647
- in: J,
6648
- by: J,
6649
- near: J,
6650
- from: J,
6651
- to: J
6647
+ in: R,
6648
+ by: R,
6649
+ near: R,
6650
+ from: R,
6651
+ to: R
6652
6652
  },
6653
6653
  afterWords: {
6654
- in: J,
6655
- by: J,
6656
- near: J,
6657
- from: J,
6658
- to: J,
6659
- government: J,
6660
- council: J,
6661
- region: J,
6662
- city: J
6654
+ in: R,
6655
+ by: R,
6656
+ near: R,
6657
+ from: R,
6658
+ to: R,
6659
+ government: R,
6660
+ council: R,
6661
+ region: R,
6662
+ city: R
6663
6663
  }
6664
6664
  }, pg = {
6665
6665
  beforeTags: Object.assign({}, an.beforeTags, V.beforeTags),
@@ -6744,14 +6744,14 @@ At["Plural|Verb"] = {
6744
6744
  //changes seven gears
6745
6745
  })
6746
6746
  };
6747
- const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W = "PastTense", gt = "Adverb", re = "Plural", F = "Actor", un = "Verb", U = "Noun", bg = "ProperNoun", fe = "LastName", ui = "Modal", $ = "Place", Un = "Participle", yg = [
6747
+ const x = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W = "PastTense", gt = "Adverb", re = "Plural", F = "Actor", un = "Verb", U = "Noun", bg = "ProperNoun", fe = "LastName", ui = "Modal", $ = "Place", Un = "Participle", yg = [
6748
6748
  null,
6749
6749
  null,
6750
6750
  {
6751
6751
  //2-letter
6752
6752
  ea: w,
6753
6753
  ia: U,
6754
- ic: A,
6754
+ ic: x,
6755
6755
  ly: gt,
6756
6756
  "'n": un,
6757
6757
  "'t": un
@@ -6764,22 +6764,22 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6764
6764
  " so": gt,
6765
6765
  "'ll": ui,
6766
6766
  "'re": "Copula",
6767
- azy: A,
6767
+ azy: x,
6768
6768
  eer: U,
6769
6769
  end: un,
6770
6770
  ped: W,
6771
- ffy: A,
6771
+ ffy: x,
6772
6772
  ify: L,
6773
6773
  ing: "Gerund",
6774
6774
  ize: L,
6775
6775
  ibe: L,
6776
- lar: A,
6777
- mum: A,
6776
+ lar: x,
6777
+ mum: x,
6778
6778
  nes: Xe,
6779
- nny: A,
6779
+ nny: x,
6780
6780
  // oid: Adj,
6781
- ous: A,
6782
- que: A,
6781
+ ous: x,
6782
+ que: x,
6783
6783
  ger: U,
6784
6784
  ber: U,
6785
6785
  rol: w,
@@ -6800,8 +6800,8 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6800
6800
  // ide: Inf,
6801
6801
  ign: L,
6802
6802
  oze: L,
6803
- ful: A,
6804
- bal: A,
6803
+ ful: x,
6804
+ bal: x,
6805
6805
  ton: U,
6806
6806
  pur: $
6807
6807
  },
@@ -6814,7 +6814,7 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6814
6814
  rked: W,
6815
6815
  reed: W,
6816
6816
  nded: W,
6817
- mned: A,
6817
+ mned: x,
6818
6818
  cted: W,
6819
6819
  dged: W,
6820
6820
  ield: w,
@@ -6833,7 +6833,7 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6833
6833
  fies: Xe,
6834
6834
  fore: gt,
6835
6835
  gate: L,
6836
- gone: A,
6836
+ gone: x,
6837
6837
  ices: re,
6838
6838
  ints: re,
6839
6839
  ruct: L,
@@ -6842,20 +6842,20 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6842
6842
  ners: re,
6843
6843
  pers: re,
6844
6844
  lers: re,
6845
- less: A,
6846
- llen: A,
6847
- made: A,
6845
+ less: x,
6846
+ llen: x,
6847
+ made: x,
6848
6848
  nsen: fe,
6849
6849
  oses: Xe,
6850
6850
  ould: ui,
6851
- some: A,
6851
+ some: x,
6852
6852
  sson: fe,
6853
6853
  ians: re,
6854
6854
  // tage: Inf,
6855
6855
  tion: w,
6856
6856
  tage: U,
6857
6857
  ique: w,
6858
- tive: A,
6858
+ tive: x,
6859
6859
  tors: U,
6860
6860
  vice: w,
6861
6861
  lier: w,
@@ -6885,7 +6885,7 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6885
6885
  //homicide
6886
6886
  ence: w,
6887
6887
  //absence
6888
- wide: A,
6888
+ wide: x,
6889
6889
  //nationwide
6890
6890
  // side: Adj,//alongside
6891
6891
  vide: L,
@@ -6896,10 +6896,10 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6896
6896
  eive: L,
6897
6897
  lyze: L,
6898
6898
  lyse: L,
6899
- iant: A,
6900
- nary: A,
6901
- ghty: A,
6902
- uent: A,
6899
+ iant: x,
6900
+ nary: x,
6901
+ ghty: x,
6902
+ uent: x,
6903
6903
  erer: F,
6904
6904
  //caterer
6905
6905
  bury: $,
@@ -6923,7 +6923,7 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6923
6923
  urned: W,
6924
6924
  eased: W,
6925
6925
  ances: re,
6926
- bound: A,
6926
+ bound: x,
6927
6927
  ettes: re,
6928
6928
  fully: gt,
6929
6929
  ishes: Xe,
@@ -6934,7 +6934,7 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6934
6934
  osome: w,
6935
6935
  tment: w,
6936
6936
  ports: re,
6937
- rough: A,
6937
+ rough: x,
6938
6938
  tches: Xe,
6939
6939
  tieth: "Ordinal",
6940
6940
  tures: re,
@@ -6953,12 +6953,12 @@ const A = "Adjective", L = "Infinitive", Xe = "PresentTense", w = "Singular", W
6953
6953
  olist: F,
6954
6954
  icist: F,
6955
6955
  ounce: L,
6956
- iable: A,
6957
- borne: A,
6958
- gnant: A,
6959
- inant: A,
6960
- igent: A,
6961
- atory: A,
6956
+ iable: x,
6957
+ borne: x,
6958
+ gnant: x,
6959
+ inant: x,
6960
+ igent: x,
6961
+ atory: x,
6962
6962
  // ctory: Adj,
6963
6963
  rient: w,
6964
6964
  dient: w,
@@ -8032,7 +8032,7 @@ const ls = function(e) {
8032
8032
  else
8033
8033
  return e;
8034
8034
  return c && (l += " " + c), s && (l = s + " " + l), l;
8035
- }, Wg = (e) => / /.test(e) ? e.split(/ /) : [e, ""], Jr = function(e, t) {
8035
+ }, Wg = (e) => / /.test(e) ? e.split(/ /) : [e, ""], Rr = function(e, t) {
8036
8036
  const { toPast: n, toPresent: r, toGerund: o, toParticiple: i } = t.two.models;
8037
8037
  if (e === "be")
8038
8038
  return {
@@ -8057,22 +8057,22 @@ const ls = function(e) {
8057
8057
  u[l] += " " + s;
8058
8058
  }), u;
8059
8059
  }, Kg = function(e, t) {
8060
- const n = Jr(e, t);
8060
+ const n = Rr(e, t);
8061
8061
  return delete n.FutureTense, Object.values(n).filter((r) => r);
8062
8062
  }, _g = {
8063
8063
  toInfinitive: vr,
8064
- conjugate: Jr,
8064
+ conjugate: Rr,
8065
8065
  all: Kg
8066
- }, Rr = function(e, t) {
8066
+ }, Jr = function(e, t) {
8067
8067
  const n = t.two.models.toSuperlative;
8068
8068
  return ae(e, n);
8069
8069
  }, Ur = function(e, t) {
8070
8070
  const n = t.two.models.toComparative;
8071
8071
  return ae(e, n);
8072
- }, Jg = function(e, t) {
8072
+ }, Rg = function(e, t) {
8073
8073
  const n = t.two.models.fromComparative;
8074
8074
  return ae(e, n);
8075
- }, Rg = function(e, t) {
8075
+ }, Jg = function(e, t) {
8076
8076
  const n = t.two.models.fromSuperlative;
8077
8077
  return ae(e, n);
8078
8078
  }, Ug = function(e, t) {
@@ -8088,72 +8088,72 @@ const ls = function(e) {
8088
8088
  }
8089
8089
  }
8090
8090
  return null;
8091
- }, P = "ically", qg = /* @__PURE__ */ new Set([
8092
- "analyt" + P,
8091
+ }, k = "ically", qg = /* @__PURE__ */ new Set([
8092
+ "analyt" + k,
8093
8093
  //analytical
8094
- "chem" + P,
8094
+ "chem" + k,
8095
8095
  // chemical
8096
- "class" + P,
8096
+ "class" + k,
8097
8097
  //classical
8098
- "clin" + P,
8098
+ "clin" + k,
8099
8099
  // clinical
8100
- "crit" + P,
8100
+ "crit" + k,
8101
8101
  // critical
8102
- "ecolog" + P,
8102
+ "ecolog" + k,
8103
8103
  // ecological
8104
- "electr" + P,
8104
+ "electr" + k,
8105
8105
  // electrical
8106
- "empir" + P,
8106
+ "empir" + k,
8107
8107
  // empirical
8108
- "frant" + P,
8108
+ "frant" + k,
8109
8109
  // frantical
8110
- "grammat" + P,
8110
+ "grammat" + k,
8111
8111
  // grammatical
8112
- "ident" + P,
8112
+ "ident" + k,
8113
8113
  // identical
8114
- "ideolog" + P,
8114
+ "ideolog" + k,
8115
8115
  // ideological
8116
- "log" + P,
8116
+ "log" + k,
8117
8117
  // logical
8118
- "mag" + P,
8118
+ "mag" + k,
8119
8119
  //magical
8120
- "mathemat" + P,
8120
+ "mathemat" + k,
8121
8121
  // mathematical
8122
- "mechan" + P,
8122
+ "mechan" + k,
8123
8123
  // mechanical
8124
- "med" + P,
8124
+ "med" + k,
8125
8125
  // medical
8126
- "method" + P,
8126
+ "method" + k,
8127
8127
  // methodical
8128
- "method" + P,
8128
+ "method" + k,
8129
8129
  // methodical
8130
- "mus" + P,
8130
+ "mus" + k,
8131
8131
  // musical
8132
- "phys" + P,
8132
+ "phys" + k,
8133
8133
  // physical
8134
- "phys" + P,
8134
+ "phys" + k,
8135
8135
  // physical
8136
- "polit" + P,
8136
+ "polit" + k,
8137
8137
  // political
8138
- "pract" + P,
8138
+ "pract" + k,
8139
8139
  // practical
8140
- "rad" + P,
8140
+ "rad" + k,
8141
8141
  //radical
8142
- "satir" + P,
8142
+ "satir" + k,
8143
8143
  // satirical
8144
- "statist" + P,
8144
+ "statist" + k,
8145
8145
  // statistical
8146
- "techn" + P,
8146
+ "techn" + k,
8147
8147
  // technical
8148
- "technolog" + P,
8148
+ "technolog" + k,
8149
8149
  // technological
8150
- "theoret" + P,
8150
+ "theoret" + k,
8151
8151
  // theoretical
8152
- "typ" + P,
8152
+ "typ" + k,
8153
8153
  // typical
8154
- "vert" + P,
8154
+ "vert" + k,
8155
8155
  // vertical
8156
- "whims" + P
8156
+ "whims" + k
8157
8157
  // whimsical
8158
8158
  ]), Qg = [
8159
8159
  null,
@@ -8259,15 +8259,15 @@ const ls = function(e) {
8259
8259
  return t || (t = e + "ly"), t;
8260
8260
  }, em = function(e, t) {
8261
8261
  let n = [e];
8262
- return n.push(Rr(e, t)), n.push(Ur(e, t)), n.push(ds(e)), n = n.filter((r) => r), n = new Set(n), Array.from(n);
8262
+ return n.push(Jr(e, t)), n.push(Ur(e, t)), n.push(ds(e)), n = n.filter((r) => r), n = new Set(n), Array.from(n);
8263
8263
  }, tm = {
8264
- toSuperlative: Rr,
8264
+ toSuperlative: Jr,
8265
8265
  toComparative: Ur,
8266
8266
  toAdverb: ds,
8267
8267
  toNoun: Ug,
8268
8268
  fromAdverb: Xg,
8269
- fromSuperlative: Rg,
8270
- fromComparative: Jg,
8269
+ fromSuperlative: Jg,
8270
+ fromComparative: Rg,
8271
8271
  all: em
8272
8272
  }, nm = {
8273
8273
  noun: Vg,
@@ -8502,10 +8502,10 @@ const ls = function(e) {
8502
8502
  e[n] === "Uncountable" && (t.two.uncountable[n] = !0, e[n] = "Uncountable");
8503
8503
  }), t;
8504
8504
  }, wi = function(e, t, n) {
8505
- const r = Jr(e, Pr);
8505
+ const r = Rr(e, Pr);
8506
8506
  t[r.PastTense] = t[r.PastTense] || "PastTense", t[r.Gerund] = t[r.Gerund] || "Gerund", n === !0 && (t[r.PresentTense] = t[r.PresentTense] || "PresentTense");
8507
8507
  }, Pi = function(e, t, n) {
8508
- const r = Rr(e, n);
8508
+ const r = Jr(e, n);
8509
8509
  t[r] = t[r] || "Superlative";
8510
8510
  const o = Ur(e, n);
8511
8511
  t[o] = t[o] || "Comparative";
@@ -8773,9 +8773,9 @@ const pm = function(e, t, n, r) {
8773
8773
  return z(s, u, "3-[neighbour]"), Zt(e, t, n), e[t].confidence = 0.2, !0;
8774
8774
  }
8775
8775
  return null;
8776
- }, Jm = (e) => /^\p{Lu}[\p{Ll}'’]/u.test(e), Ii = function(e, t, n) {
8777
- return !e || e.tags.has("FirstName") || e.tags.has("Place") ? !1 : e.tags.has("ProperNoun") || e.tags.has("Organization") || e.tags.has("Acronym") ? !0 : !n && Jm(e.text) ? t === 0 ? e.tags.has("Singular") : !0 : !1;
8778
- }, Rm = function(e, t, n, r) {
8776
+ }, Rm = (e) => /^\p{Lu}[\p{Ll}'’]/u.test(e), Ii = function(e, t, n) {
8777
+ return !e || e.tags.has("FirstName") || e.tags.has("Place") ? !1 : e.tags.has("ProperNoun") || e.tags.has("Organization") || e.tags.has("Acronym") ? !0 : !n && Rm(e.text) ? t === 0 ? e.tags.has("Singular") : !0 : !1;
8778
+ }, Jm = function(e, t, n, r) {
8779
8779
  const o = n.model.two.orgWords, i = n.methods.one.setTag, a = e[t], s = a.machine || a.normal;
8780
8780
  if (o[s] === !0 && Ii(e[t - 1], t - 1, r)) {
8781
8781
  i([e[t]], "Organization", n, null, "3-[org-word]");
@@ -8925,7 +8925,7 @@ const pm = function(e, t, n, r) {
8925
8925
  Zt(e, o, t), i = i || _m(e, o, t), i = i || Xm(e, o, t);
8926
8926
  }
8927
8927
  for (let o = 0; o < e.length; o += 1)
8928
- e[o].frozen !== !0 && (Rm(e, o, n, r), Zm(e, o, n, r), r0(e, o, n), zm(e, o, t, n), gm(e, o, t, n));
8928
+ e[o].frozen !== !0 && (Jm(e, o, n, r), Zm(e, o, n, r), r0(e, o, n), zm(e, o, t, n), gm(e, o, t, n));
8929
8929
  i0(e, n);
8930
8930
  }, l0 = function(e) {
8931
8931
  const { methods: t, model: n, world: r } = e, o = e.docs;
@@ -9562,7 +9562,7 @@ const pm = function(e, t, n, r) {
9562
9562
  //by sunday's
9563
9563
  for: !0
9564
9564
  //for sunday's
9565
- }, K0 = /* @__PURE__ */ new Set(["too", "also", "enough", "about"]), _0 = /* @__PURE__ */ new Set(["is", "are", "did", "were", "could", "should", "must", "had", "have"]), J0 = (e, t) => {
9565
+ }, K0 = /* @__PURE__ */ new Set(["too", "also", "enough", "about"]), _0 = /* @__PURE__ */ new Set(["is", "are", "did", "were", "could", "should", "must", "had", "have"]), R0 = (e, t) => {
9566
9566
  const n = e[t];
9567
9567
  if (L0.hasOwnProperty(n.machine || n.normal))
9568
9568
  return !1;
@@ -9607,7 +9607,7 @@ const pm = function(e, t, n, r) {
9607
9607
  return o.switch === "Noun|Verb";
9608
9608
  }
9609
9609
  return !!r.tags.has("Value");
9610
- }, Mi = /'/, R0 = function(e) {
9610
+ }, Mi = /'/, J0 = function(e) {
9611
9611
  e.forEach((t, n) => {
9612
9612
  t.index && (t.index[1] = n);
9613
9613
  });
@@ -9615,14 +9615,14 @@ const pm = function(e, t, n, r) {
9615
9615
  const o = t.update();
9616
9616
  o.document = [e];
9617
9617
  let i = n + r;
9618
- n > 0 && (n -= 1), e[i] && (i += 1), o.ptrs = [[0, n, i]], o.compute(["freeze", "lexicon", "preTagger", "unfreeze"]), R0(e);
9618
+ n > 0 && (n -= 1), e[i] && (i += 1), o.ptrs = [[0, n, i]], o.compute(["freeze", "lexicon", "preTagger", "unfreeze"]), J0(e);
9619
9619
  }, Vi = {
9620
9620
  // how'd
9621
9621
  d: (e, t) => B0(e, t),
9622
9622
  // we ain't
9623
9623
  t: (e, t) => V0(e, t),
9624
9624
  // bob's
9625
- s: (e, t, n) => J0(e, t) ? n.methods.one.setTag([e[t]], "Possessive", n, null, "2-contraction") : H0(e, t)
9625
+ s: (e, t, n) => R0(e, t) ? n.methods.one.setTag([e[t]], "Possessive", n, null, "2-contraction") : H0(e, t)
9626
9626
  }, q0 = function(e, t) {
9627
9627
  const n = t.fromText(e.join(" "));
9628
9628
  return n.compute("id"), n.docs[0];
@@ -11257,16 +11257,16 @@ const S1 = {
11257
11257
  r = r.filter((i) => i), r = r.map((i) => `{${i}}`).join(" ");
11258
11258
  let o = this.match(r);
11259
11259
  return n && (o = o.if(n)), o.has("#Verb") ? V1(o, t) : o.has("#Noun") ? L1(o, t) : o.has("#Adverb") ? W1(o, t) : o.has("#Adjective") ? K1(o, t) : this;
11260
- }, J1 = function(e) {
11260
+ }, R1 = function(e) {
11261
11261
  e.prototype.swap = _1;
11262
- }, R1 = {
11263
- api: J1
11262
+ }, J1 = {
11263
+ api: R1
11264
11264
  };
11265
11265
  v.plugin(k0);
11266
11266
  v.plugin(X0);
11267
11267
  v.plugin(S1);
11268
11268
  v.plugin(B1);
11269
- v.plugin(R1);
11269
+ v.plugin(J1);
11270
11270
  const mt = function(e) {
11271
11271
  const { fromComparative: t, fromSuperlative: n } = e.methods.two.transform.adjective, r = e.text("normal");
11272
11272
  return e.has("#Comparative") ? t(r, e.model) : e.has("#Superlative") ? n(r, e.model) : r;
@@ -11900,10 +11900,10 @@ const ub = function(e, t, n) {
11900
11900
  t.test(n[0].pre) && (n[0].pre = n[0].pre.replace(t, ""));
11901
11901
  }), e;
11902
11902
  }
11903
- }, tr = (e) => e.split("|").reduce((t, n) => (t[n] = !0, t), {}), nr = "unicode|punctuation|whitespace|acronyms", Ji = "|case|contractions|parentheses|quotations|emoji|honorifics|debullet", Ob = "|possessives|adverbs|nouns|verbs", Hb = {
11903
+ }, tr = (e) => e.split("|").reduce((t, n) => (t[n] = !0, t), {}), nr = "unicode|punctuation|whitespace|acronyms", Ri = "|case|contractions|parentheses|quotations|emoji|honorifics|debullet", Ob = "|possessives|adverbs|nouns|verbs", Hb = {
11904
11904
  light: tr(nr),
11905
- medium: tr(nr + Ji),
11906
- heavy: tr(nr + Ji + Ob)
11905
+ medium: tr(nr + Ri),
11906
+ heavy: tr(nr + Ri + Ob)
11907
11907
  };
11908
11908
  function Sb(e) {
11909
11909
  e.prototype.normalize = function(t = "light") {
@@ -11917,7 +11917,7 @@ const Gb = {
11917
11917
  }, Fb = function(e) {
11918
11918
  let t = e.clauses().match("<Noun>"), n = t.match("@hasComma");
11919
11919
  return n = n.not("#Place"), n.found && (t = t.splitAfter(n)), t = t.splitOn("#Expression"), t = t.splitOn("(he|she|we|you|they|i)"), t = t.splitOn("(#Noun|#Adjective) [(he|him|she|it)]", 0), t = t.splitOn("[(he|him|she|it)] (#Determiner|#Value)", 0), t = t.splitBefore("#Noun [(the|a|an)] #Adjective? #Noun", 0), t = t.splitOn("[(here|there)] #Noun", 0), t = t.splitOn("[#Noun] (here|there)", 0), t = t.splitBefore("(our|my|their|your)"), t = t.splitOn("#Noun [#Determiner]", 0), t = t.if("#Noun"), t;
11920
- }, Ri = [
11920
+ }, Ji = [
11921
11921
  "after",
11922
11922
  "although",
11923
11923
  "as if",
@@ -11958,8 +11958,8 @@ const Gb = {
11958
11958
  return !0;
11959
11959
  if (!e.before().found)
11960
11960
  return !1;
11961
- for (let n = 0; n < Ri.length; n += 1)
11962
- if (e.has(Ri[n]))
11961
+ for (let n = 0; n < Ji.length; n += 1)
11962
+ if (e.has(Ji[n]))
11963
11963
  return !0;
11964
11964
  return !1;
11965
11965
  }, Bb = "(#Pronoun|#Place|#Value|#Person|#Uncountable|#Month|#WeekDay|#Holiday|#Possessive)", Mb = function(e, t) {
@@ -11999,18 +11999,18 @@ const Gb = {
11999
11999
  };
12000
12000
  }, Ps = function(e) {
12001
12001
  return !e.has("^(#Uncountable|#ProperNoun|#Place|#Pronoun|#Acronym)+$");
12002
- }, _b = { tags: !0 }, Jb = function(e, t) {
12002
+ }, _b = { tags: !0 }, Rb = function(e, t) {
12003
12003
  if (t.isPlural === !0 || (t.root.has("#Possessive") && (t.root = t.root.possessives().strip()), !Ps(t.root)))
12004
12004
  return e;
12005
12005
  const { methods: n, model: r } = e.world, { toPlural: o } = n.two.transform.noun, i = t.root.text({ keepPunct: !1 }), a = o(i, r);
12006
12006
  e.match(t.root).replaceWith(a, _b).tag("Plural", "toPlural"), t.determiner.has("(a|an)") && e.remove(t.determiner);
12007
12007
  const s = t.root.after("not? #Adverb+? [#Copula]", 0);
12008
12008
  return s.found && (s.has("is") ? e.replace(s, "are") : s.has("was") && e.replace(s, "were")), e;
12009
- }, Rb = { tags: !0 }, Ub = function(e, t) {
12009
+ }, Jb = { tags: !0 }, Ub = function(e, t) {
12010
12010
  if (t.isPlural === !1)
12011
12011
  return e;
12012
12012
  const { methods: n, model: r } = e.world, { toSingular: o } = n.two.transform.noun, i = t.root.text("normal"), a = o(i, r);
12013
- return e.replace(t.root, a, Rb).tag("Singular", "toPlural"), e;
12013
+ return e.replace(t.root, a, Jb).tag("Singular", "toPlural"), e;
12014
12014
  }, qb = function(e) {
12015
12015
  class t extends e {
12016
12016
  constructor(r, o, i) {
@@ -12049,7 +12049,7 @@ const Gb = {
12049
12049
  }), o.getNth(r);
12050
12050
  }
12051
12051
  toPlural(r) {
12052
- return this.getNth(r).map((o) => Jb(o, We(o)));
12052
+ return this.getNth(r).map((o) => Rb(o, We(o)));
12053
12053
  }
12054
12054
  toSingular(r) {
12055
12055
  return this.getNth(r).map((o) => {
@@ -12394,7 +12394,7 @@ const Gb = {
12394
12394
  for (let a = 0; a < i.length; a++)
12395
12395
  n.push(t[i[a]]);
12396
12396
  return n;
12397
- }, Jt = function(e) {
12397
+ }, Rt = function(e) {
12398
12398
  let t = e.num;
12399
12399
  if (t === 0 || t === "0")
12400
12400
  return "zero";
@@ -12410,7 +12410,7 @@ const Gb = {
12410
12410
  }, fy = function(e) {
12411
12411
  if (!e.numerator || !e.denominator)
12412
12412
  return "";
12413
- const t = Jt({ num: e.numerator }), n = Jt({ num: e.denominator });
12413
+ const t = Rt({ num: e.numerator }), n = Rt({ num: e.denominator });
12414
12414
  return `${t} out of ${n}`;
12415
12415
  }, Xi = {
12416
12416
  one: "first",
@@ -12430,12 +12430,12 @@ const Gb = {
12430
12430
  eighty: "eightieth",
12431
12431
  ninety: "ninetieth"
12432
12432
  }, ks = (e) => {
12433
- const t = Jt(e).split(" "), n = t[t.length - 1];
12433
+ const t = Rt(e).split(" "), n = t[t.length - 1];
12434
12434
  return Xi.hasOwnProperty(n) ? t[t.length - 1] = Xi[n] : t[t.length - 1] = n.replace(/y$/, "i") + "th", t.join(" ");
12435
12435
  }, py = function(e) {
12436
12436
  if (!e.numerator || !e.denominator)
12437
12437
  return "";
12438
- const t = Jt({ num: e.numerator });
12438
+ const t = Rt({ num: e.numerator });
12439
12439
  let n = ks({ num: e.denominator });
12440
12440
  return e.denominator === 2 && (n = "half"), t && n ? (e.numerator !== 1 && (n += "s"), `${t} ${n}`) : "";
12441
12441
  }, gy = function(e) {
@@ -12519,7 +12519,7 @@ const Gb = {
12519
12519
  num: o,
12520
12520
  suffix: i
12521
12521
  }) : null;
12522
- }, R = function(e) {
12522
+ }, J = function(e) {
12523
12523
  if (typeof e == "string")
12524
12524
  return { num: Ar(e) };
12525
12525
  let t = e.text("reduced");
@@ -12596,7 +12596,7 @@ const Gb = {
12596
12596
  return e.prefix + vy(e) + e.suffix;
12597
12597
  if (t === "TextCardinal") {
12598
12598
  const { prefix: r, suffix: o } = ta(e);
12599
- return r + Jt(e) + o;
12599
+ return r + Rt(e) + o;
12600
12600
  }
12601
12601
  let n = e.num;
12602
12602
  return e.hasComma && (n = n.toLocaleString()), e.prefix + String(n) + e.suffix;
@@ -12608,7 +12608,7 @@ const Gb = {
12608
12608
  return wy(e) ? e.reduce((t, n) => (t[n] = !0, t), {}) : e || {};
12609
12609
  }, ky = function(e, t = {}) {
12610
12610
  return t = Py(t), e.filter((n) => {
12611
- const { unit: r } = R(n);
12611
+ const { unit: r } = J(n);
12612
12612
  return !!(r && t[r] === !0);
12613
12613
  });
12614
12614
  }, Ay = function(e) {
@@ -12617,15 +12617,15 @@ const Gb = {
12617
12617
  super(r, o, i), this.viewType = "Numbers";
12618
12618
  }
12619
12619
  parse(r) {
12620
- return this.getNth(r).map(R);
12620
+ return this.getNth(r).map(J);
12621
12621
  }
12622
12622
  get(r) {
12623
- return this.getNth(r).map(R).map((o) => o.num);
12623
+ return this.getNth(r).map(J).map((o) => o.num);
12624
12624
  }
12625
12625
  json(r) {
12626
12626
  const o = typeof r == "object" ? r : {};
12627
12627
  return this.getNth(r).map((i) => {
12628
- const a = i.toView().json(o)[0], s = R(i);
12628
+ const a = i.toView().json(o)[0], s = J(i);
12629
12629
  return a.number = {
12630
12630
  prefix: s.prefix,
12631
12631
  num: s.num,
@@ -12656,7 +12656,7 @@ const Gb = {
12656
12656
  const r = this.map((o) => {
12657
12657
  if (!this.has("#TextValue"))
12658
12658
  return o;
12659
- const i = R(o);
12659
+ const i = J(o);
12660
12660
  if (i.num === null)
12661
12661
  return o;
12662
12662
  const a = o.has("#Ordinal") ? "Ordinal" : "Cardinal", s = Ye(i, a);
@@ -12667,7 +12667,7 @@ const Gb = {
12667
12667
  /** add commas, or nicer formatting for numbers */
12668
12668
  toLocaleString() {
12669
12669
  return this.forEach((o) => {
12670
- const i = R(o);
12670
+ const i = J(o);
12671
12671
  if (i.num === null)
12672
12672
  return;
12673
12673
  let a = i.num.toLocaleString();
@@ -12683,7 +12683,7 @@ const Gb = {
12683
12683
  const o = this.map((i) => {
12684
12684
  if (i.has("#TextValue"))
12685
12685
  return i;
12686
- const a = R(i);
12686
+ const a = J(i);
12687
12687
  if (a.num === null)
12688
12688
  return i;
12689
12689
  const s = i.has("#Ordinal") ? "TextOrdinal" : "TextCardinal", u = Ye(a, s);
@@ -12696,7 +12696,7 @@ const Gb = {
12696
12696
  const o = this.map((i) => {
12697
12697
  if (!i.has("#Ordinal"))
12698
12698
  return i;
12699
- const a = R(i);
12699
+ const a = J(i);
12700
12700
  if (a.num === null)
12701
12701
  return i;
12702
12702
  const s = i.has("#TextValue") ? "TextCardinal" : "Cardinal", u = Ye(a, s);
@@ -12709,7 +12709,7 @@ const Gb = {
12709
12709
  const o = this.map((i) => {
12710
12710
  if (i.has("#Ordinal"))
12711
12711
  return i;
12712
- const a = R(i);
12712
+ const a = J(i);
12713
12713
  if (a.num === null)
12714
12714
  return i;
12715
12715
  const s = i.has("#TextValue") ? "TextOrdinal" : "Ordinal", u = Ye(a, s);
@@ -12719,20 +12719,20 @@ const Gb = {
12719
12719
  }
12720
12720
  /** return only numbers that are == n */
12721
12721
  isEqual(r) {
12722
- return this.filter((o) => R(o).num === r);
12722
+ return this.filter((o) => J(o).num === r);
12723
12723
  }
12724
12724
  /** return only numbers that are > n*/
12725
12725
  greaterThan(r) {
12726
- return this.filter((o) => R(o).num > r);
12726
+ return this.filter((o) => J(o).num > r);
12727
12727
  }
12728
12728
  /** return only numbers that are < n*/
12729
12729
  lessThan(r) {
12730
- return this.filter((o) => R(o).num < r);
12730
+ return this.filter((o) => J(o).num < r);
12731
12731
  }
12732
12732
  /** return only numbers > min and < max */
12733
12733
  between(r, o) {
12734
12734
  return this.filter((i) => {
12735
- const a = R(i).num;
12735
+ const a = J(i).num;
12736
12736
  return a > r && a < o;
12737
12737
  });
12738
12738
  }
@@ -12740,9 +12740,9 @@ const Gb = {
12740
12740
  set(r) {
12741
12741
  if (r === void 0)
12742
12742
  return this;
12743
- typeof r == "string" && (r = R(r).num);
12743
+ typeof r == "string" && (r = J(r).num);
12744
12744
  const i = this.map((a) => {
12745
- const s = R(a);
12745
+ const s = J(a);
12746
12746
  if (s.num = r, s.num === null)
12747
12747
  return a;
12748
12748
  let u = a.has("#Ordinal") ? "Ordinal" : "Cardinal";
@@ -12755,9 +12755,9 @@ const Gb = {
12755
12755
  add(r) {
12756
12756
  if (!r)
12757
12757
  return this;
12758
- typeof r == "string" && (r = R(r).num);
12758
+ typeof r == "string" && (r = J(r).num);
12759
12759
  const i = this.map((a) => {
12760
- const s = R(a);
12760
+ const s = J(a);
12761
12761
  if (s.num === null)
12762
12762
  return a;
12763
12763
  s.num += r;
@@ -13049,12 +13049,12 @@ const Gb = {
13049
13049
  let r = Wy(this);
13050
13050
  return r = r.getNth(n), new t(this.document, r.pointer);
13051
13051
  };
13052
- }, Jy = function(e) {
13052
+ }, Ry = function(e) {
13053
13053
  let t = e.match("(#Place|#Address)+"), n = t.match("@hasComma");
13054
13054
  return n = n.filter((r) => r.has("(asia|africa|europe|america)$") ? !0 : !(r.has("(#City|#Region|#ProperNoun)$") && r.after("^(#Country|#Region)").found)), t = t.splitAfter(n), t;
13055
- }, Ry = function(e) {
13055
+ }, Jy = function(e) {
13056
13056
  e.prototype.places = function(t) {
13057
- let n = Jy(this);
13057
+ let n = Ry(this);
13058
13058
  return n = n.getNth(t), new e(this.document, n.pointer);
13059
13059
  };
13060
13060
  }, Uy = function(e) {
@@ -13068,7 +13068,7 @@ const Gb = {
13068
13068
  }, Qy = function(e) {
13069
13069
  e.prototype.topics = qy;
13070
13070
  }, Zy = function(e) {
13071
- _y(e), Ry(e), Uy(e), Qy(e);
13071
+ _y(e), Jy(e), Uy(e), Qy(e);
13072
13072
  }, Xy = { api: Zy }, Yy = function(e) {
13073
13073
  let t = e.match("<Verb>");
13074
13074
  return t = t.not("#Conjunction"), t = t.not("#Preposition"), t = t.splitAfter("@hasComma"), t = t.splitAfter("[(do|did|am|was|is|will)] (is|was)", 0), t = t.splitBefore("(#Verb && !#Copula) [being] #Verb", 0), t = t.splitBefore("#Verb [to be] #Verb", 0), t = t.splitAfter("[help] #PresentTense", 0), t = t.splitBefore("(#PresentTense|#PastTense) [#Copula]$", 0), t = t.splitBefore("(#PresentTense|#PastTense) [will be]$", 0), t = t.splitBefore("(#PresentTense|#PastTense) [(had|has)]", 0), t = t.not("#Reflexive$"), t = t.not("#Adjective"), t = t.splitAfter("[#PastTense] #PastTense", 0), t = t.splitAfter("[#PastTense] #Auxiliary+ #PastTense", 0), t = t.splitAfter("#Copula [#Gerund] #PastTense", 0), t = t.if("#Verb"), t.has("(#Verb && !#Auxiliary) #Adverb+? #Copula") && (t = t.splitBefore("#Copula")), t;
@@ -14058,7 +14058,7 @@ function Wv(e, t) {
14058
14058
  }
14059
14059
  return r;
14060
14060
  }
14061
- const Kv = /* @__PURE__ */ new Set(["GIVENNAME", "SURNAME", "PERSON"]), _v = 8, Jv = 5, Rv = 0.5, va = 230, Uv = 210;
14061
+ const Kv = /* @__PURE__ */ new Set(["GIVENNAME", "SURNAME", "PERSON"]), _v = 8, Rv = 5, Jv = 0.5, va = 230, Uv = 210;
14062
14062
  let qv = 0;
14063
14063
  function Qv(e, t, n, r) {
14064
14064
  const o = [], i = /* @__PURE__ */ new Set(), a = e.filter((s) => s.label && Kv.has(s.label)).sort((s, u) => s.bbox.x0 - u.bbox.x0);
@@ -14068,10 +14068,10 @@ function Qv(e, t, n, r) {
14068
14068
  i.add(l);
14069
14069
  const h = Math.round(c * _v);
14070
14070
  if (u.x0 < h * 0.25) continue;
14071
- const d = Math.max(0, u.x0 - h), m = Math.max(0, u.y0), C = Math.min(n, u.y1);
14071
+ const d = Math.max(0, u.x0 - h), m = Math.max(0, u.y0), P = Math.min(n, u.y1);
14072
14072
  let ee = 0, Ae = -1, T = -1, ze = "gap";
14073
14073
  for (let ve = u.x0 - 1; ve >= d; ve--) {
14074
- const Yr = r(ve, m, C);
14074
+ const Yr = r(ve, m, P);
14075
14075
  if (ze === "gap")
14076
14076
  Yr >= va ? ee++ : (ze = "dark", T = ve, Ae = ve);
14077
14077
  else if (ze === "dark")
@@ -14082,12 +14082,12 @@ function Qv(e, t, n, r) {
14082
14082
  break;
14083
14083
  }
14084
14084
  }
14085
- if (ze === "dark" && (Ae = d), ee < Jv || T < 0 || Ae < 0) continue;
14086
- const ht = T - Ae + 1, dt = Math.round(c * Rv);
14085
+ if (ze === "dark" && (Ae = d), ee < Rv || T < 0 || Ae < 0) continue;
14086
+ const ht = T - Ae + 1, dt = Math.round(c * Jv);
14087
14087
  if (ht < dt) continue;
14088
14088
  let xe = 0;
14089
14089
  for (let ve = Ae; ve <= T; ve++)
14090
- xe += r(ve, m, C);
14090
+ xe += r(ve, m, P);
14091
14091
  if (xe / ht > Uv) continue;
14092
14092
  const Xt = Math.round(c * 1.5), Gn = {
14093
14093
  x0: Ae,
@@ -14114,15 +14114,15 @@ function Zv(e, t, n) {
14114
14114
  const l = Math.max(0, Math.min(t - 1, Math.round(s))), h = Math.max(0, Math.round(u)), d = Math.min(n, Math.round(c));
14115
14115
  if (h >= d) return 255;
14116
14116
  let m = 0;
14117
- for (let C = h; C < d; C++) {
14118
- const ee = (C * t + l) * 4;
14117
+ for (let P = h; P < d; P++) {
14118
+ const ee = (P * t + l) * 4;
14119
14119
  m += (a[ee] + a[ee + 1] + a[ee + 2]) / 3;
14120
14120
  }
14121
14121
  return m / (d - h);
14122
14122
  };
14123
14123
  }
14124
14124
  async function Xv(e, t) {
14125
- const n = e instanceof HTMLImageElement ? e.naturalWidth : e.width, r = e instanceof HTMLImageElement ? e.naturalHeight : e.height, o = Yv(n, r), i = ew(o);
14125
+ const n = e instanceof HTMLImageElement ? e.naturalWidth : e.width, r = e instanceof HTMLImageElement ? e.naturalHeight : e.height, o = ew(n, r), i = tw(o);
14126
14126
  i.drawImage(e, 0, 0, n, r), i.fillStyle = "#000000";
14127
14127
  const a = [];
14128
14128
  for (const u of t) {
@@ -14135,13 +14135,14 @@ async function Xv(e, t) {
14135
14135
  });
14136
14136
  }
14137
14137
  return {
14138
- blob: await tw(o),
14138
+ blob: await nw(o),
14139
14139
  entities: a,
14140
14140
  width: n,
14141
- height: r
14141
+ height: r,
14142
+ redactedText: ""
14142
14143
  };
14143
14144
  }
14144
- function lw(e, t, n = {
14145
+ function hw(e, t, n = {
14145
14146
  fill: "rgba(0, 0, 0, 0.7)",
14146
14147
  stroke: "#ff3333",
14147
14148
  lineWidth: 2
@@ -14152,18 +14153,44 @@ function lw(e, t, n = {
14152
14153
  e.fillStyle = n.fill, e.fillRect(o, i, u, c), e.strokeStyle = n.stroke, e.lineWidth = n.lineWidth, e.strokeRect(o, i, u, c);
14153
14154
  }
14154
14155
  }
14155
- function Yv(e, t) {
14156
+ function Yv(e, t, n) {
14157
+ if (e === null) return "";
14158
+ const { fullText: r, words: o } = e, i = new Map(n.map((h) => [h.id, h])), a = /* @__PURE__ */ new Set();
14159
+ for (const h of t)
14160
+ if (h.enabled && h.label !== "AVATAR")
14161
+ if (h.entityId !== void 0) {
14162
+ const d = i.get(h.entityId);
14163
+ if (!d) continue;
14164
+ for (let m = 0; m < o.length; m++) {
14165
+ const P = o[m];
14166
+ P.charStart < d.end && P.charEnd > d.start && a.add(m);
14167
+ }
14168
+ } else {
14169
+ const d = h.bbox;
14170
+ for (let m = 0; m < o.length; m++) {
14171
+ const P = o[m].bbox;
14172
+ P.x0 < d.x1 && P.x1 > d.x0 && P.y0 < d.y1 && P.y1 > d.y0 && a.add(m);
14173
+ }
14174
+ }
14175
+ let s = "", u = 0, c = !1, l = -1;
14176
+ for (let h = 0; h < o.length; h++) {
14177
+ const d = o[h], m = r.slice(u, d.charStart);
14178
+ a.has(h) ? c && d.lineIndex === l || (s += m, s += "[REDACTED]", c = !0, l = d.lineIndex) : (s += m, s += d.text, c = !1), u = d.charEnd;
14179
+ }
14180
+ return s += r.slice(u), s;
14181
+ }
14182
+ function ew(e, t) {
14156
14183
  if (typeof OffscreenCanvas < "u")
14157
14184
  return new OffscreenCanvas(e, t);
14158
14185
  const n = document.createElement("canvas");
14159
14186
  return n.width = e, n.height = t, n;
14160
14187
  }
14161
- function ew(e) {
14188
+ function tw(e) {
14162
14189
  const t = e.getContext("2d");
14163
14190
  if (!t) throw new Error("Could not get 2D canvas context");
14164
14191
  return t;
14165
14192
  }
14166
- async function tw(e) {
14193
+ async function nw(e) {
14167
14194
  return e instanceof OffscreenCanvas ? e.convertToBlob({ type: "image/png" }) : new Promise((t, n) => {
14168
14195
  e.toBlob(
14169
14196
  (r) => {
@@ -14173,8 +14200,8 @@ async function tw(e) {
14173
14200
  );
14174
14201
  });
14175
14202
  }
14176
- async function nw(e, t, n) {
14177
- const r = { ...t }, o = rw(r.memoryMode);
14203
+ async function rw(e, t, n) {
14204
+ const r = { ...t }, o = ow(r.memoryMode);
14178
14205
  n?.({ phase: "ocr", progress: 0, message: "Starting OCR..." });
14179
14206
  const i = await au(e, r.lang, n);
14180
14207
  if (!i.fullText.trim())
@@ -14194,8 +14221,8 @@ async function nw(e, t, n) {
14194
14221
  if (h.length > 0) {
14195
14222
  let d;
14196
14223
  e instanceof Blob ? d = await createImageBitmap(e) : d = e;
14197
- const m = Zv(d, i.imageWidth, i.imageHeight), C = Qv(h, i.imageWidth, i.imageHeight, m);
14198
- l.push(...C);
14224
+ const m = Zv(d, i.imageWidth, i.imageHeight), P = Qv(h, i.imageWidth, i.imageHeight, m);
14225
+ l.push(...P);
14199
14226
  }
14200
14227
  }
14201
14228
  return n?.({
@@ -14204,13 +14231,13 @@ async function nw(e, t, n) {
14204
14231
  message: `Found ${l.length} items to redact.`
14205
14232
  }), { ocr: i, entities: c, redactions: l };
14206
14233
  }
14207
- function rw(e) {
14234
+ function ow(e) {
14208
14235
  if (e === "low") return "low";
14209
14236
  if (e === "normal") return "normal";
14210
14237
  const t = navigator.deviceMemory;
14211
14238
  return t !== void 0 && t < 4 ? "low" : "normal";
14212
14239
  }
14213
- const ow = {
14240
+ const iw = {
14214
14241
  GIVENNAME: "First name",
14215
14242
  SURNAME: "Last name",
14216
14243
  PERSON: "Person name",
@@ -14238,10 +14265,10 @@ const ow = {
14238
14265
  detectAvatars: !0,
14239
14266
  memoryMode: "auto"
14240
14267
  };
14241
- var iw = Object.defineProperty, aw = Object.getOwnPropertyDescriptor, H = (e, t, n, r) => {
14242
- for (var o = r > 1 ? void 0 : r ? aw(t, n) : t, i = e.length - 1, a; i >= 0; i--)
14268
+ var aw = Object.defineProperty, sw = Object.getOwnPropertyDescriptor, H = (e, t, n, r) => {
14269
+ for (var o = r > 1 ? void 0 : r ? sw(t, n) : t, i = e.length - 1, a; i >= 0; i--)
14243
14270
  (a = e[i]) && (o = (r ? a(t, n, o) : a(o)) || o);
14244
- return r && o && iw(t, n, o), o;
14271
+ return r && o && aw(t, n, o), o;
14245
14272
  };
14246
14273
  let j = class extends Ft {
14247
14274
  constructor() {
@@ -14516,7 +14543,7 @@ let j = class extends Ft {
14516
14543
  try {
14517
14544
  const t = await this.loadImage(this.imageUrl);
14518
14545
  this.imageElement = t, this.imageWidth = t.naturalWidth, this.imageHeight = t.naturalHeight;
14519
- const n = await nw(
14546
+ const n = await rw(
14520
14547
  e,
14521
14548
  this.pipelineConfig,
14522
14549
  (r) => this.handleProgress(r)
@@ -14610,10 +14637,14 @@ let j = class extends Ft {
14610
14637
  const e = await Xv(
14611
14638
  this.imageElement,
14612
14639
  this.redactions
14640
+ ), t = Yv(
14641
+ this.ocrResult,
14642
+ this.redactions,
14643
+ this.entities
14613
14644
  );
14614
14645
  this.dispatchEvent(
14615
14646
  new CustomEvent("redaction-complete", {
14616
- detail: e,
14647
+ detail: { ...e, redactedText: t },
14617
14648
  bubbles: !0,
14618
14649
  composed: !0
14619
14650
  })
@@ -14648,7 +14679,7 @@ let j = class extends Ft {
14648
14679
  // --- Helpers ---
14649
14680
  /** Returns a user-friendly label for an entity type. */
14650
14681
  getDisplayLabel(e) {
14651
- return e ? ow[e] ?? e : "Manual redaction";
14682
+ return e ? iw[e] ?? e : "Manual redaction";
14652
14683
  }
14653
14684
  getRedactionText(e) {
14654
14685
  return e.source === "manual" ? "(manually drawn)" : !e.entityId || !this.ocrResult ? "" : this.entities.find((n) => n.id === e.entityId)?.text ?? "";
@@ -14732,9 +14763,9 @@ H([
14732
14763
  Qs(".file-input")
14733
14764
  ], j.prototype, "fileInput", 2);
14734
14765
  j = H([
14735
- Js("pii-redactor")
14766
+ Rs("pii-redactor")
14736
14767
  ], j);
14737
- async function hw(e = {}) {
14768
+ async function dw(e = {}) {
14738
14769
  if (!("serviceWorker" in navigator) || !navigator.serviceWorker)
14739
14770
  return null;
14740
14771
  const t = e.swPath ?? "/pii-redactor-sw.js", n = {};
@@ -14745,7 +14776,7 @@ async function hw(e = {}) {
14745
14776
  return null;
14746
14777
  }
14747
14778
  }
14748
- async function dw() {
14779
+ async function fw() {
14749
14780
  if (!("serviceWorker" in navigator) || !navigator.serviceWorker)
14750
14781
  return !1;
14751
14782
  try {
@@ -14759,20 +14790,20 @@ export {
14759
14790
  eu as DARK_THRESHOLD,
14760
14791
  Le as DEFAULT_CONFIG,
14761
14792
  j as PiiRedactor,
14762
- nw as analyzeImage,
14793
+ rw as analyzeImage,
14763
14794
  ru as computeAverageLuminance,
14764
14795
  lu as detectPiiNer,
14765
14796
  pu as detectPiiRegex,
14766
- lw as drawRedactionPreview,
14797
+ hw as drawRedactionPreview,
14767
14798
  Fv as entitiesToRedactions,
14768
14799
  ou as isDarkBackground,
14769
14800
  Wv as mergeEntities,
14770
14801
  go as preloadNerModel,
14771
14802
  iu as preprocessForOcr,
14772
- hw as registerServiceWorker,
14803
+ dw as registerServiceWorker,
14773
14804
  hu as releaseNerModel,
14774
14805
  Xv as renderRedactedImage,
14775
14806
  au as runOcr,
14776
- dw as unregisterServiceWorker
14807
+ fw as unregisterServiceWorker
14777
14808
  };
14778
14809
  //# sourceMappingURL=image-pii-redactor.js.map