image-pii-redactor 0.5.0 → 0.5.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.
@@ -262,7 +262,7 @@ pt.elementStyles = [], pt.shadowRootOptions = { mode: "open" }, pt[It("elementPr
262
262
  * Copyright 2017 Google LLC
263
263
  * SPDX-License-Identifier: BSD-3-Clause
264
264
  */
265
- const Nr = globalThis, Yr = (e) => e, Pn = Nr.trustedTypes, eo = Pn ? Pn.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ga = "$lit$", ze = `lit$${Math.random().toFixed(9).slice(2)}$`, ma = "?" + ze, Ds = `<${ma}>`, et = document, Ht = () => et.createComment(""), Ft = (e) => e === null || typeof e != "object" && typeof e != "function", jr = Array.isArray, Os = (e) => jr(e) || typeof e?.[Symbol.iterator] == "function", Dn = `[
265
+ const Nr = globalThis, Yr = (e) => e, Pn = Nr.trustedTypes, eo = Pn ? Pn.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ga = "$lit$", ze = `lit$${Math.random().toFixed(9).slice(2)}$`, ma = "?" + ze, Ds = `<${ma}>`, et = document, Ht = () => et.createComment(""), Gt = (e) => e === null || typeof e != "object" && typeof e != "function", jr = Array.isArray, Os = (e) => jr(e) || typeof e?.[Symbol.iterator] == "function", Dn = `[
266
266
  \f\r]`, Ct = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, to = /-->/g, no = />/g, We = RegExp(`>|${Dn}(?:([^\\s"'>=/]+)(${Dn}*=${Dn}*(?:[^
267
267
  \f\r"'\`<>=]|("|')|))|$)`, "g"), ro = /'/g, oo = /"/g, ba = /^(?:script|style|textarea|title)$/i, ya = (e) => (t, ...n) => ({ _$litType$: e, strings: t, values: n }), se = ya(1), kn = ya(2), vt = Symbol.for("lit-noChange"), N = Symbol.for("lit-nothing"), io = /* @__PURE__ */ new WeakMap(), Qe = et.createTreeWalker(et, 129);
268
268
  function va(e, t) {
@@ -281,13 +281,13 @@ const Hs = (e, t) => {
281
281
  }
282
282
  return [va(e, i + (e[n] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
283
283
  };
284
- class Gt {
284
+ class Ft {
285
285
  constructor({ strings: t, _$litType$: n }, r) {
286
286
  let o;
287
287
  this.parts = [];
288
288
  let i = 0, a = 0;
289
289
  const s = t.length - 1, u = this.parts, [c, l] = Hs(t, n);
290
- if (this.el = Gt.createElement(c, r), Qe.currentNode = this.el.content, n === 2 || n === 3) {
290
+ if (this.el = Ft.createElement(c, r), Qe.currentNode = this.el.content, n === 2 || n === 3) {
291
291
  const h = this.el.content.firstChild;
292
292
  h.replaceWith(...h.childNodes);
293
293
  }
@@ -295,7 +295,7 @@ class Gt {
295
295
  if (o.nodeType === 1) {
296
296
  if (o.hasAttributes()) for (const h of o.getAttributeNames()) if (h.endsWith(ga)) {
297
297
  const d = l[a++], m = o.getAttribute(h).split(ze), M = /([.?@])?(.*)/.exec(d);
298
- u.push({ type: 1, index: i, name: M[2], strings: m, ctor: M[1] === "." ? Gs : M[1] === "?" ? Ss : M[1] === "@" ? zs : Nn }), o.removeAttribute(h);
298
+ u.push({ type: 1, index: i, name: M[2], strings: m, ctor: M[1] === "." ? Fs : M[1] === "?" ? Ss : M[1] === "@" ? zs : Nn }), o.removeAttribute(h);
299
299
  } else h.startsWith(ze) && (u.push({ type: 6, index: i }), o.removeAttribute(h));
300
300
  if (ba.test(o.tagName)) {
301
301
  const h = o.textContent.split(ze), d = h.length - 1;
@@ -321,10 +321,10 @@ class Gt {
321
321
  function wt(e, t, n = e, r) {
322
322
  if (t === vt) return t;
323
323
  let o = r !== void 0 ? n._$Co?.[r] : n._$Cl;
324
- const i = Ft(t) ? void 0 : t._$litDirective$;
324
+ const i = Gt(t) ? void 0 : t._$litDirective$;
325
325
  return o?.constructor !== i && (o?._$AO?.(!1), i === void 0 ? o = void 0 : (o = new i(e), o._$AT(e, n, r)), r !== void 0 ? (n._$Co ??= [])[r] = o : n._$Cl = o), o !== void 0 && (t = wt(e, o._$AS(e, t.values), o, r)), t;
326
326
  }
327
- class Fs {
327
+ class Gs {
328
328
  constructor(t, n) {
329
329
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = n;
330
330
  }
@@ -371,7 +371,7 @@ let Tr = class wa {
371
371
  return this._$AB;
372
372
  }
373
373
  _$AI(t, n = this) {
374
- t = wt(this, t, n), Ft(t) ? t === N || t == null || t === "" ? (this._$AH !== N && this._$AR(), this._$AH = N) : t !== this._$AH && t !== vt && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Os(t) ? this.k(t) : this._(t);
374
+ t = wt(this, t, n), Gt(t) ? t === N || t == null || t === "" ? (this._$AH !== N && this._$AR(), this._$AH = N) : t !== this._$AH && t !== vt && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Os(t) ? this.k(t) : this._(t);
375
375
  }
376
376
  O(t) {
377
377
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -380,19 +380,19 @@ let Tr = class wa {
380
380
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
381
381
  }
382
382
  _(t) {
383
- this._$AH !== N && Ft(this._$AH) ? this._$AA.nextSibling.data = t : this.T(et.createTextNode(t)), this._$AH = t;
383
+ this._$AH !== N && Gt(this._$AH) ? this._$AA.nextSibling.data = t : this.T(et.createTextNode(t)), this._$AH = t;
384
384
  }
385
385
  $(t) {
386
- const { values: n, _$litType$: r } = t, o = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Gt.createElement(va(r.h, r.h[0]), this.options)), r);
386
+ const { values: n, _$litType$: r } = t, o = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Ft.createElement(va(r.h, r.h[0]), this.options)), r);
387
387
  if (this._$AH?._$AD === o) this._$AH.p(n);
388
388
  else {
389
- const i = new Fs(o, this), a = i.u(this.options);
389
+ const i = new Gs(o, this), a = i.u(this.options);
390
390
  i.p(n), this.T(a), this._$AH = i;
391
391
  }
392
392
  }
393
393
  _$AC(t) {
394
394
  let n = io.get(t.strings);
395
- return n === void 0 && io.set(t.strings, n = new Gt(t)), n;
395
+ return n === void 0 && io.set(t.strings, n = new Ft(t)), n;
396
396
  }
397
397
  k(t) {
398
398
  jr(this._$AH) || (this._$AH = [], this._$AR());
@@ -424,11 +424,11 @@ class Nn {
424
424
  _$AI(t, n = this, r, o) {
425
425
  const i = this.strings;
426
426
  let a = !1;
427
- if (i === void 0) t = wt(this, t, n, 0), a = !Ft(t) || t !== this._$AH && t !== vt, a && (this._$AH = t);
427
+ if (i === void 0) t = wt(this, t, n, 0), a = !Gt(t) || t !== this._$AH && t !== vt, a && (this._$AH = t);
428
428
  else {
429
429
  const s = t;
430
430
  let u, c;
431
- for (t = i[0], u = 0; u < i.length - 1; u++) c = wt(this, s[r + u], n, u), c === vt && (c = this._$AH[u]), a ||= !Ft(c) || c !== this._$AH[u], c === N ? t = N : t !== N && (t += (c ?? "") + i[u + 1]), this._$AH[u] = c;
431
+ for (t = i[0], u = 0; u < i.length - 1; u++) c = wt(this, s[r + u], n, u), c === vt && (c = this._$AH[u]), a ||= !Gt(c) || c !== this._$AH[u], c === N ? t = N : t !== N && (t += (c ?? "") + i[u + 1]), this._$AH[u] = c;
432
432
  }
433
433
  a && !o && this.j(t);
434
434
  }
@@ -436,7 +436,7 @@ class Nn {
436
436
  t === N ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
437
437
  }
438
438
  }
439
- class Gs extends Nn {
439
+ class Fs extends Nn {
440
440
  constructor() {
441
441
  super(...arguments), this.type = 3;
442
442
  }
@@ -477,7 +477,7 @@ class Bs {
477
477
  }
478
478
  }
479
479
  const Vs = Nr.litHtmlPolyfillSupport;
480
- Vs?.(Gt, Tr), (Nr.litHtmlVersions ??= []).push("3.3.2");
480
+ Vs?.(Ft, Tr), (Nr.litHtmlVersions ??= []).push("3.3.2");
481
481
  const Ms = (e, t, n) => {
482
482
  const r = n?.renderBefore ?? t;
483
483
  let o = r._$litPart$;
@@ -1290,11 +1290,17 @@ const cu = [
1290
1290
  label: "IP_ADDRESS",
1291
1291
  pattern: /\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g
1292
1292
  },
1293
- // Dates (various formats these often contain birth dates)
1293
+ // Dates — numeric formats (MM/DD/YYYY, YYYY-MM-DD, etc.)
1294
1294
  {
1295
1295
  label: "DATE",
1296
1296
  pattern: /\b(?:\d{1,2}[/.-]\d{1,2}[/.-]\d{2,4}|\d{4}[/.-]\d{1,2}[/.-]\d{1,2})\b/g
1297
1297
  },
1298
+ // Dates — written-out month name (e.g. "October 24, 2025" or "January 2025")
1299
+ // Matches: <MonthName> [<day>,] <year>
1300
+ {
1301
+ label: "DATE",
1302
+ pattern: /\b(?:January|February|March|April|May|June|July|August|September|October|November|December)\s+(?:\d{1,2},\s*)?\d{4}\b/g
1303
+ },
1298
1304
  // URLs with paths (may contain identifying query params)
1299
1305
  {
1300
1306
  label: "URL",
@@ -1681,11 +1687,11 @@ const Hu = function(e) {
1681
1687
  r.add("#" + i[a]);
1682
1688
  }), r;
1683
1689
  });
1684
- }, Fu = {
1690
+ }, Gu = {
1685
1691
  one: {
1686
1692
  cacheDoc: Hu
1687
1693
  }
1688
- }, Gu = {
1694
+ }, Fu = {
1689
1695
  /** */
1690
1696
  cache: function() {
1691
1697
  return this._cache = this.methods.one.cacheDoc(this.document), this;
@@ -1695,7 +1701,7 @@ const Hu = function(e) {
1695
1701
  return this._cache = null, this;
1696
1702
  }
1697
1703
  }, Su = function(e) {
1698
- Object.assign(e.prototype, Gu);
1704
+ Object.assign(e.prototype, Fu);
1699
1705
  }, zu = {
1700
1706
  cache: function(e) {
1701
1707
  e._cache = e.methods.one.cacheDoc(e.document);
@@ -1703,7 +1709,7 @@ const Hu = function(e) {
1703
1709
  }, Bu = {
1704
1710
  api: Su,
1705
1711
  compute: zu,
1706
- methods: Fu
1712
+ methods: Gu
1707
1713
  }, Vu = {
1708
1714
  /** */
1709
1715
  toLowerCase: function() {
@@ -2142,7 +2148,7 @@ const rc = (e, t) => e.normal < t.normal ? -1 : e.normal > t.normal ? 1 : 0, oc
2142
2148
  contractions: $c,
2143
2149
  numberSuffixes: Nc
2144
2150
  }
2145
- }, Fn = function(e, t, n) {
2151
+ }, Gn = function(e, t, n) {
2146
2152
  const [r, o] = t;
2147
2153
  !n || n.length === 0 || (n = n.map((i, a) => (i.implicit = i.text, i.machine = i.text, i.pre = "", i.post = "", i.text = "", i.normal = "", i.index = [r, o + a], i)), n[0] && (n[0].pre = e[r][o].pre, n[n.length - 1].post = e[r][o].post, n[0].text = e[r][o].text, n[0].normal = e[r][o].normal), e[r].splice(o, 1, ...n));
2148
2154
  }, Tc = /'/, Ic = /* @__PURE__ */ new Set([
@@ -2173,13 +2179,13 @@ const rc = (e, t) => e.normal < t.normal ? -1 : e.normal > t.normal ? 1 : 0, oc
2173
2179
  return null;
2174
2180
  }, Hc = function(e, t) {
2175
2181
  return e[t].normal === "ain't" || e[t].normal === "aint" ? null : [e[t].normal.replace(/n't/, ""), "not"];
2176
- }, Hr = /'/, Fc = /(e|é|aison|sion|tion)$/, Gc = /(age|isme|acle|ege|oire)$/, Sc = (e, t) => {
2182
+ }, Hr = /'/, Gc = /(e|é|aison|sion|tion)$/, Fc = /(age|isme|acle|ege|oire)$/, Sc = (e, t) => {
2177
2183
  const n = e[t].normal.split(Hr)[1];
2178
2184
  return n && n.endsWith("e") ? ["la", n] : ["le", n];
2179
2185
  }, zc = (e, t) => {
2180
2186
  const n = e[t].normal.split(Hr)[1];
2181
- return n && Fc.test(n) && !Gc.test(n) ? ["du", n] : n && n.endsWith("s") ? ["des", n] : ["de", n];
2182
- }, Bc = (e, t) => ["je", e[t].normal.split(Hr)[1]], Gn = {
2187
+ return n && Gc.test(n) && !Fc.test(n) ? ["du", n] : n && n.endsWith("s") ? ["des", n] : ["de", n];
2188
+ }, Bc = (e, t) => ["je", e[t].normal.split(Hr)[1]], Fn = {
2183
2189
  preJ: Bc,
2184
2190
  preL: Sc,
2185
2191
  preD: zc
@@ -2206,11 +2212,11 @@ const rc = (e, t) => e.normal < t.normal ? -1 : e.normal > t.normal ? 1 : 0, oc
2206
2212
  d: (e, t) => Oc(e, t)
2207
2213
  }, Po = {
2208
2214
  // j'aime
2209
- j: (e, t) => Gn.preJ(e, t),
2215
+ j: (e, t) => Fn.preJ(e, t),
2210
2216
  // l'amour
2211
- l: (e, t) => Gn.preL(e, t),
2217
+ l: (e, t) => Fn.preL(e, t),
2212
2218
  // d'amerique
2213
- d: (e, t) => Gn.preD(e, t)
2219
+ d: (e, t) => Fn.preD(e, t)
2214
2220
  }, Uc = function(e, t, n, r) {
2215
2221
  for (let o = 0; o < e.length; o += 1) {
2216
2222
  const i = e[o];
@@ -2241,14 +2247,14 @@ const rc = (e, t) => e.normal < t.normal ? -1 : e.normal > t.normal ? 1 : 0, oc
2241
2247
  }
2242
2248
  let h = Uc(i, a[u], c, l);
2243
2249
  if (!h && wo.hasOwnProperty(l) && (h = wo[l](a, u, t)), !h && Po.hasOwnProperty(c) && (h = Po[c](a, u)), c === "there" && l === "s" && (h = Rc(a, u)), h) {
2244
- h = Sn(h, e), Fn(n, [s, u], h), vo(n[s], e, u, h.length);
2250
+ h = Sn(h, e), Gn(n, [s, u], h), vo(n[s], e, u, h.length);
2245
2251
  continue;
2246
2252
  }
2247
2253
  if (Jc.test(a[u].normal)) {
2248
- h = Wc(a, u), h && (h = Sn(h, e), Fn(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"), vo(n[s], e, u, h.length));
2254
+ h = Wc(a, u), h && (h = Sn(h, e), Gn(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"), vo(n[s], e, u, h.length));
2249
2255
  continue;
2250
2256
  }
2251
- h = _c(a, u, t), h && (h = Sn(h, e), Fn(n, [s, u], h), o.one.setTag([h[1]], "Unit", t, null, "contraction-unit"));
2257
+ h = _c(a, u, t), h && (h = Sn(h, e), Gn(n, [s, u], h), o.one.setTag([h[1]], "Unit", t, null, "contraction-unit"));
2252
2258
  }
2253
2259
  });
2254
2260
  }, Qc = { contractions: qc }, Zc = {
@@ -2612,32 +2618,32 @@ const vl = {
2612
2618
  return [e[0], e[1], t[2]];
2613
2619
  }, Dl = function(e) {
2614
2620
  return Object.prototype.toString.call(e) === "[object Array]";
2615
- }, Fr = (e, t, n) => typeof e == "string" || Dl(e) ? t.match(e, n) : e || t.none(), Gr = function(e, t) {
2621
+ }, Gr = (e, t, n) => typeof e == "string" || Dl(e) ? t.match(e, n) : e || t.none(), Fr = function(e, t) {
2616
2622
  const [n, r, o] = e;
2617
2623
  return t.document[n] && t.document[n][r] && (e[3] = e[3] || t.document[n][r].id, t.document[n][o - 1] && (e[4] = e[4] || t.document[n][o - 1].id)), e;
2618
2624
  }, Pt = {};
2619
2625
  Pt.splitOn = function(e, t) {
2620
- const { splitAll: n } = this.methods.one.pointer, r = Fr(e, this, t).fullPointer, o = n(this.fullPointer, r);
2626
+ const { splitAll: n } = this.methods.one.pointer, r = Gr(e, this, t).fullPointer, o = n(this.fullPointer, r);
2621
2627
  let i = [];
2622
2628
  return o.forEach((a) => {
2623
2629
  i.push(a.passthrough), i.push(a.before), i.push(a.match), i.push(a.after);
2624
- }), i = i.filter((a) => a), i = i.map((a) => Gr(a, this)), this.update(i);
2630
+ }), i = i.filter((a) => a), i = i.map((a) => Fr(a, this)), this.update(i);
2625
2631
  };
2626
2632
  Pt.splitBefore = function(e, t) {
2627
- const { splitAll: n } = this.methods.one.pointer, r = Fr(e, this, t).fullPointer, o = n(this.fullPointer, r);
2633
+ const { splitAll: n } = this.methods.one.pointer, r = Gr(e, this, t).fullPointer, o = n(this.fullPointer, r);
2628
2634
  for (let a = 0; a < o.length; a += 1)
2629
2635
  !o[a].after && o[a + 1] && o[a + 1].before && o[a].match && o[a].match[0] === o[a + 1].before[0] && (o[a].after = o[a + 1].before, delete o[a + 1].before);
2630
2636
  let i = [];
2631
2637
  return o.forEach((a) => {
2632
2638
  i.push(a.passthrough), i.push(a.before), a.match && a.after ? i.push(Ia(a.match, a.after)) : i.push(a.match);
2633
- }), i = i.filter((a) => a), i = i.map((a) => Gr(a, this)), this.update(i);
2639
+ }), i = i.filter((a) => a), i = i.map((a) => Fr(a, this)), this.update(i);
2634
2640
  };
2635
2641
  Pt.splitAfter = function(e, t) {
2636
- const { splitAll: n } = this.methods.one.pointer, r = Fr(e, this, t).fullPointer, o = n(this.fullPointer, r);
2642
+ const { splitAll: n } = this.methods.one.pointer, r = Gr(e, this, t).fullPointer, o = n(this.fullPointer, r);
2637
2643
  let i = [];
2638
2644
  return o.forEach((a) => {
2639
2645
  i.push(a.passthrough), a.before && a.match ? i.push(Ia(a.before, a.match)) : (i.push(a.before), i.push(a.match)), i.push(a.after);
2640
- }), i = i.filter((a) => a), i = i.map((a) => Gr(a, this)), this.update(i);
2646
+ }), i = i.filter((a) => a), i = i.map((a) => Fr(a, this)), this.update(i);
2641
2647
  };
2642
2648
  Pt.split = Pt.splitAfter;
2643
2649
  const Ol = function(e, t) {
@@ -2668,12 +2674,12 @@ ye.lookBefore = ye.before;
2668
2674
  ye.lookAhead = ye.after;
2669
2675
  ye.lookAfter = ye.after;
2670
2676
  ye.notIf = ye.ifNo;
2671
- const Fl = function(e) {
2677
+ const Gl = function(e) {
2672
2678
  Object.assign(e.prototype, ye);
2673
- }, Gl = /(?:^|\s)([![^]*(?:<[^<]*>)?\/.*?[^\\/]\/[?\]+*$~]*)(?:\s|$)/, Sl = /([!~[^]*(?:<[^<]*>)?\([^)]+[^\\)]\)[?\]+*$~]*)(?:\s|$)/, zl = / /g, Bl = (e) => /^[![^]*(<[^<]*>)?\(/.test(e) && /\)[?\]+*$~]*$/.test(e), To = (e) => /^[![^]*(<[^<]*>)?\//.test(e) && /\/[?\]+*$~]*$/.test(e), Io = function(e) {
2679
+ }, Fl = /(?:^|\s)([![^]*(?:<[^<]*>)?\/.*?[^\\/]\/[?\]+*$~]*)(?:\s|$)/, Sl = /([!~[^]*(?:<[^<]*>)?\([^)]+[^\\)]\)[?\]+*$~]*)(?:\s|$)/, zl = / /g, Bl = (e) => /^[![^]*(<[^<]*>)?\(/.test(e) && /\)[?\]+*$~]*$/.test(e), To = (e) => /^[![^]*(<[^<]*>)?\//.test(e) && /\/[?\]+*$~]*$/.test(e), Io = function(e) {
2674
2680
  return e = e.map((t) => t.trim()), e = e.filter((t) => t), e;
2675
2681
  }, Vl = function(e) {
2676
- const t = e.split(Gl);
2682
+ const t = e.split(Fl);
2677
2683
  let n = [];
2678
2684
  t.forEach((o) => {
2679
2685
  if (To(o)) {
@@ -2735,10 +2741,10 @@ const Fl = function(e) {
2735
2741
  }, Ho = function(e, t) {
2736
2742
  const { all: n } = t.methods.two.transform.verb || {}, r = e.root;
2737
2743
  return n ? n(r, t.model) : [];
2738
- }, Fo = function(e, t) {
2744
+ }, Go = function(e, t) {
2739
2745
  const { all: n } = t.methods.two.transform.noun || {};
2740
2746
  return n ? n(e.root, t.model) : [e.root];
2741
- }, Go = function(e, t) {
2747
+ }, Fo = function(e, t) {
2742
2748
  const { all: n } = t.methods.two.transform.adjective || {};
2743
2749
  return n ? n(e.root, t.model) : [e.root];
2744
2750
  }, Kl = function(e, t) {
@@ -2746,7 +2752,7 @@ const Fl = function(e) {
2746
2752
  if (n.root)
2747
2753
  if (t.methods.two && t.methods.two.transform) {
2748
2754
  let r = [];
2749
- n.pos ? n.pos === "Verb" ? r = r.concat(Ho(n, t)) : n.pos === "Noun" ? r = r.concat(Fo(n, t)) : n.pos === "Adjective" && (r = r.concat(Go(n, t))) : (r = r.concat(Ho(n, t)), r = r.concat(Fo(n, t)), r = r.concat(Go(n, t))), r = r.filter((o) => o), r.length > 0 && (n.operator = "or", n.fastOr = new Set(r));
2755
+ n.pos ? n.pos === "Verb" ? r = r.concat(Ho(n, t)) : n.pos === "Noun" ? r = r.concat(Go(n, t)) : n.pos === "Adjective" && (r = r.concat(Fo(n, t))) : (r = r.concat(Ho(n, t)), r = r.concat(Go(n, t)), r = r.concat(Fo(n, t))), r = r.filter((o) => o), r.length > 0 && (n.operator = "or", n.fastOr = new Set(r));
2750
2756
  } else
2751
2757
  n.machine = n.root, delete n.id, delete n.root;
2752
2758
  return n;
@@ -3208,7 +3214,7 @@ const rh = function(e, t) {
3208
3214
  return r && (e = r(e, n)), n.methods.one.parseMatch(e, t, n);
3209
3215
  }
3210
3216
  }, Ah = {
3211
- api: Fl,
3217
+ api: Gl,
3212
3218
  methods: Ph,
3213
3219
  lib: kh
3214
3220
  }, xh = /^\../, Ch = /^#./, $h = (e) => (e = e.replace(/&/g, "&amp;"), e = e.replace(/</g, "&lt;"), e = e.replace(/>/g, "&gt;"), e = e.replace(/"/g, "&quot;"), e = e.replace(/'/g, "&apos;"), e), Nh = function(e) {
@@ -3290,10 +3296,10 @@ const rh = function(e, t) {
3290
3296
  };
3291
3297
  Le.clean = Le.normal;
3292
3298
  Le.reduced = Le.root;
3293
- const Fa = [];
3299
+ const Ga = [];
3294
3300
  let Ze = 0;
3295
3301
  for (; Ze < 64; )
3296
- Fa[Ze] = 0 | Math.sin(++Ze % Math.PI) * 4294967296;
3302
+ Ga[Ze] = 0 | Math.sin(++Ze % Math.PI) * 4294967296;
3297
3303
  const zr = function(e) {
3298
3304
  let t, n, r, o = decodeURI(encodeURI(e)) + "€", i = o.length;
3299
3305
  const a = [t = 1732584193, n = 4023233417, ~t, ~n], s = [];
@@ -3302,7 +3308,7 @@ const zr = function(e) {
3302
3308
  for (Ze = o = 0; Ze < e; Ze += 16) {
3303
3309
  for (i = a; o < 64; i = [
3304
3310
  r = i[3],
3305
- t + ((r = i[0] + [t & n | ~t & r, r & t | ~r & n, t ^ n ^ r, n ^ (t | ~r)][i = o >> 4] + Fa[o] + ~~s[Ze | [o, 5 * o + 1, 3 * o + 5, 7 * o][i] & 15]) << (i = [7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21][4 * i + o++ % 4]) | r >>> -i),
3311
+ t + ((r = i[0] + [t & n | ~t & r, r & t | ~r & n, t ^ n ^ r, n ^ (t | ~r)][i = o >> 4] + Ga[o] + ~~s[Ze | [o, 5 * o + 1, 3 * o + 5, 7 * o][i] & 15]) << (i = [7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21][4 * i + o++ % 4]) | r >>> -i),
3306
3312
  t,
3307
3313
  n
3308
3314
  ])
@@ -3312,7 +3318,7 @@ const zr = function(e) {
3312
3318
  for (e = ""; o < 32; )
3313
3319
  e += (a[o >> 3] >> (1 ^ o++) * 4 & 15).toString(16);
3314
3320
  return e;
3315
- }, Fh = {
3321
+ }, Gh = {
3316
3322
  text: !0,
3317
3323
  terms: !0
3318
3324
  }, Bo = { case: "none", unicode: "some", form: "machine", punctuation: "some" }, Vn = function(e, t) {
@@ -3344,8 +3350,8 @@ const zr = function(e) {
3344
3350
  Oe.sentences = Oe.sentence;
3345
3351
  Oe.clean = Oe.normal;
3346
3352
  Oe.reduced = Oe.root;
3347
- const Gh = function(e, t) {
3348
- return t = t || {}, typeof t == "string" && (t = {}), t = Object.assign({}, Fh, t), t.offset && e.compute("offset"), e.docs.map((n, r) => {
3353
+ const Fh = function(e, t) {
3354
+ return t = t || {}, typeof t == "string" && (t = {}), t = Object.assign({}, Gh, t), t.offset && e.compute("offset"), e.docs.map((n, r) => {
3349
3355
  const o = {};
3350
3356
  return Object.keys(t).forEach((i) => {
3351
3357
  t[i] && Oe[i] && (o[i] = Oe[i](n, e, r));
@@ -3354,7 +3360,7 @@ const Gh = function(e, t) {
3354
3360
  }, sr = {
3355
3361
  /** return data */
3356
3362
  json: function(e) {
3357
- const t = Gh(this, e);
3363
+ const t = Fh(this, e);
3358
3364
  return typeof e == "number" ? t[e] : t;
3359
3365
  }
3360
3366
  };
@@ -3372,7 +3378,7 @@ const Sh = () => typeof window < "u" && window.document, zh = function(e) {
3372
3378
  n[i[3]] = { fn: t[r], end: i[2] };
3373
3379
  });
3374
3380
  }), n;
3375
- }, Ga = function(e, t) {
3381
+ }, Fa = function(e, t) {
3376
3382
  const n = Vh(e, t);
3377
3383
  let r = "";
3378
3384
  return e.docs.forEach((o, i) => {
@@ -3392,7 +3398,7 @@ const Sh = () => typeof window < "u" && window.document, zh = function(e) {
3392
3398
  }), Object.keys(t).map((r) => ({ normal: r, count: t[r] })).sort((r, o) => r.count > o.count ? -1 : 0);
3393
3399
  }, Wh = function(e) {
3394
3400
  if (Mh(e))
3395
- return Ga(this, e);
3401
+ return Fa(this, e);
3396
3402
  if (e === "text")
3397
3403
  return this.text();
3398
3404
  if (e === "normal")
@@ -3426,7 +3432,7 @@ const Sh = () => typeof window < "u" && window.document, zh = function(e) {
3426
3432
  out: Wh,
3427
3433
  /** */
3428
3434
  wrap: function(e) {
3429
- return Ga(this, e);
3435
+ return Fa(this, e);
3430
3436
  }
3431
3437
  }, _h = (e) => Object.prototype.toString.call(e) === "[object Object]", Jh = {
3432
3438
  /** */
@@ -3872,9 +3878,9 @@ const bd = function(e) {
3872
3878
  let s = o[a];
3873
3879
  s && (s = s.replace(/^#/, ""), La(i, s, n, r));
3874
3880
  });
3875
- }, Fd = function(e) {
3881
+ }, Gd = function(e) {
3876
3882
  return Object.prototype.toString.call(e) === "[object Array]";
3877
- }, Gd = (e, t, n = "") => {
3883
+ }, Fd = (e, t, n = "") => {
3878
3884
  const r = (a) => "\x1B[33m\x1B[3m" + a + "\x1B[0m", o = (a) => "\x1B[3m" + a + "\x1B[0m", i = e.map((a) => a.text || "[" + a.implicit + "]").join(" ");
3879
3885
  typeof t != "string" && t.length > 2 && (t = t.slice(0, 2).join(", #") + " +"), t = typeof t != "string" ? t.join(", #") : t, console.log(` ${r(i).padEnd(24)} \x1B[32m→\x1B[0m #${t.padEnd(22)} ${o(n)}`);
3880
3886
  }, Wa = function(e, t, n = {}, r, o) {
@@ -3882,7 +3888,7 @@ const bd = function(e) {
3882
3888
  if (!t)
3883
3889
  return;
3884
3890
  const a = typeof process > "u" || !process.env ? self.env || {} : process.env;
3885
- if (a && a.DEBUG_TAGS && Gd(e, t, o), Fd(t) === !0) {
3891
+ if (a && a.DEBUG_TAGS && Fd(e, t, o), Gd(t) === !0) {
3886
3892
  t.forEach((s) => Wa(e, s, n, r));
3887
3893
  return;
3888
3894
  }
@@ -4427,7 +4433,7 @@ let lr = [
4427
4433
  lr = lr.reduce((e, t) => (e[t] = !0, e), {});
4428
4434
  const Hf = function(e) {
4429
4435
  return Object.prototype.toString.call(e) === "[object Array]";
4430
- }, Ff = function(e, t) {
4436
+ }, Gf = function(e, t) {
4431
4437
  let n = [], r = [];
4432
4438
  if (e = e || "", typeof e == "number" && (e = String(e)), Hf(e))
4433
4439
  return e;
@@ -4445,7 +4451,7 @@ const Hf = function(e) {
4445
4451
  Ef.test(s) === !0 && lr.hasOwnProperty(s) === !1 && Df.test(s) === !1 ? (n.length > 0 ? (n[n.length - 1] += i, n.push(s)) : n.push(i + s), i = "") : i += s;
4446
4452
  }
4447
4453
  return i && (n.length === 0 && (n[0] = ""), n[n.length - 1] += i), n = If(n), n = jf(n), n = n.filter((a) => a), n;
4448
- }, Zo = /\p{Letter}/u, qt = /[\p{Number}\p{Currency_Symbol}]/u, Gf = /^[a-z]\.([a-z]\.)+/i, Sf = /[sn]['’]$/, zf = function(e, t) {
4454
+ }, Zo = /\p{Letter}/u, qt = /[\p{Number}\p{Currency_Symbol}]/u, Ff = /^[a-z]\.([a-z]\.)+/i, Sf = /[sn]['’]$/, zf = function(e, t) {
4449
4455
  const { prePunctuation: n, postPunctuation: r, emoticons: o } = t.one;
4450
4456
  let i = e, a = "", s = "";
4451
4457
  const u = Array.from(e);
@@ -4466,7 +4472,7 @@ const Hf = function(e) {
4466
4472
  if (r[h] !== !0) {
4467
4473
  if (Zo.test(h) || qt.test(h))
4468
4474
  break;
4469
- h === "." && Gf.test(i) === !0 || h === "'" && Sf.test(i) === !0 || (s = u.pop() + s);
4475
+ h === "." && Ff.test(i) === !0 || h === "'" && Sf.test(i) === !0 || (s = u.pop() + s);
4470
4476
  }
4471
4477
  }
4472
4478
  return e = u.join(""), e === "" && (i = i.replace(/ *$/, (l) => (s = l || "", "")), e = i, a = ""), { str: e, pre: a, post: s };
@@ -4516,7 +4522,7 @@ const Hf = function(e) {
4516
4522
  tokenize: {
4517
4523
  splitSentences: Cf,
4518
4524
  isSentence: ep,
4519
- splitTerms: Ff,
4525
+ splitTerms: Gf,
4520
4526
  splitWhitespace: Bf,
4521
4527
  fromString: Rf
4522
4528
  }
@@ -5038,7 +5044,7 @@ const fp = {
5038
5044
  }, Op = (e) => Object.prototype.toString.call(e) === "[object Object]", Hp = {
5039
5045
  safe: !0,
5040
5046
  min: 3
5041
- }, Fp = function(e = [], t = {}) {
5047
+ }, Gp = function(e = [], t = {}) {
5042
5048
  const n = this.model();
5043
5049
  t = Object.assign({}, Hp, t), Op(e) && (Object.assign(n.one.lexicon, e), e = Object.keys(e));
5044
5050
  const r = Dp(e, t, this.world());
@@ -5049,8 +5055,8 @@ const fp = {
5049
5055
  }
5050
5056
  n.one.typeahead[o] = r[o];
5051
5057
  }), this;
5052
- }, Gp = {
5053
- typeahead: Fp
5058
+ }, Fp = {
5059
+ typeahead: Gp
5054
5060
  }, Sp = {
5055
5061
  one: {
5056
5062
  typeahead: {}
@@ -5059,7 +5065,7 @@ const fp = {
5059
5065
  }, zp = {
5060
5066
  model: Sp,
5061
5067
  api: Ep,
5062
- lib: Gp,
5068
+ lib: Fp,
5063
5069
  compute: Tp,
5064
5070
  hooks: ["typeahead"]
5065
5071
  };
@@ -6749,7 +6755,7 @@ bt["Plural|Verb"] = {
6749
6755
  //changes seven gears
6750
6756
  })
6751
6757
  };
6752
- const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W = "PastTense", ut = "Adverb", ne = "Plural", F = "Actor", nn = "Verb", q = "Noun", pg = "ProperNoun", fe = "LastName", ri = "Modal", C = "Place", Wn = "Participle", gg = [
6758
+ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W = "PastTense", ut = "Adverb", ne = "Plural", G = "Actor", nn = "Verb", q = "Noun", pg = "ProperNoun", fe = "LastName", ri = "Modal", C = "Place", Wn = "Participle", gg = [
6753
6759
  null,
6754
6760
  null,
6755
6761
  {
@@ -6867,13 +6873,13 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
6867
6873
  fier: w,
6868
6874
  wned: W,
6869
6875
  gent: w,
6870
- tist: F,
6871
- pist: F,
6872
- rist: F,
6873
- mist: F,
6874
- yist: F,
6875
- vist: F,
6876
- ists: F,
6876
+ tist: G,
6877
+ pist: G,
6878
+ rist: G,
6879
+ mist: G,
6880
+ yist: G,
6881
+ vist: G,
6882
+ ists: G,
6877
6883
  lite: w,
6878
6884
  site: w,
6879
6885
  rite: w,
@@ -6883,8 +6889,8 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
6883
6889
  date: w,
6884
6890
  ndal: w,
6885
6891
  vent: w,
6886
- uist: F,
6887
- gist: F,
6892
+ uist: G,
6893
+ gist: G,
6888
6894
  note: w,
6889
6895
  cide: w,
6890
6896
  //homicide
@@ -6905,7 +6911,7 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
6905
6911
  nary: A,
6906
6912
  ghty: A,
6907
6913
  uent: A,
6908
- erer: F,
6914
+ erer: G,
6909
6915
  //caterer
6910
6916
  bury: C,
6911
6917
  dorf: q,
@@ -6921,7 +6927,7 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
6921
6927
  },
6922
6928
  {
6923
6929
  //5-letter
6924
- elist: F,
6930
+ elist: G,
6925
6931
  holic: w,
6926
6932
  phite: w,
6927
6933
  tized: W,
@@ -6952,11 +6958,11 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
6952
6958
  phate: q,
6953
6959
  ndent: w,
6954
6960
  scent: w,
6955
- onist: F,
6956
- anist: F,
6957
- alist: F,
6958
- olist: F,
6959
- icist: F,
6961
+ onist: G,
6962
+ anist: G,
6963
+ alist: G,
6964
+ olist: G,
6965
+ icist: G,
6960
6966
  ounce: L,
6961
6967
  iable: A,
6962
6968
  borne: A,
@@ -6967,7 +6973,7 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
6967
6973
  // ctory: Adj,
6968
6974
  rient: w,
6969
6975
  dient: w,
6970
- maker: F,
6976
+ maker: G,
6971
6977
  burgh: C,
6972
6978
  mouth: C,
6973
6979
  ceter: C,
@@ -6989,12 +6995,12 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
6989
6995
  ionary: w,
6990
6996
  cklist: w,
6991
6997
  brooke: C,
6992
- keeper: F,
6993
- logist: F,
6998
+ keeper: G,
6999
+ logist: G,
6994
7000
  teenth: "Value",
6995
- worker: F,
6996
- master: F,
6997
- writer: F,
7001
+ worker: G,
7002
+ master: G,
7003
+ writer: G,
6998
7004
  brough: C,
6999
7005
  cester: C,
7000
7006
  ington: C,
@@ -7004,7 +7010,7 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
7004
7010
  {
7005
7011
  //7-letter
7006
7012
  chester: C,
7007
- logists: F,
7013
+ logists: G,
7008
7014
  opoulos: fe,
7009
7015
  borough: C,
7010
7016
  sdottir: fe
@@ -7656,7 +7662,7 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
7656
7662
  "university",
7657
7663
  "utilities",
7658
7664
  "workers"
7659
- ].reduce((e, t) => (e[t] = !0, e), {}), Fg = [
7665
+ ].reduce((e, t) => (e[t] = !0, e), {}), Gg = [
7660
7666
  // geology
7661
7667
  "atoll",
7662
7668
  "basin",
@@ -7895,10 +7901,10 @@ const A = "Adjective", L = "Infinitive", _e = "PresentTense", w = "Singular", W
7895
7901
  [/(ss)$/i, "$1"],
7896
7902
  [/(ic)s$/i, "$1"],
7897
7903
  [/s$/i, ""]
7898
- ], Gg = function(e) {
7904
+ ], Fg = function(e) {
7899
7905
  return Object.keys(e).reduce((t, n) => (t[e[n]] = n, t), {});
7900
7906
  }, rs = function(e, t) {
7901
- const { irregularPlurals: n } = t.two, r = Gg(n);
7907
+ const { irregularPlurals: n } = t.two, r = Fg(n);
7902
7908
  if (r.hasOwnProperty(e))
7903
7909
  return r[e];
7904
7910
  for (let o = 0; o < un.length; o++)
@@ -8553,7 +8559,7 @@ let br = {
8553
8559
  clues: bt,
8554
8560
  uncountable: {},
8555
8561
  orgWords: Hg,
8556
- placeWords: Fg
8562
+ placeWords: Gg
8557
8563
  }
8558
8564
  };
8559
8565
  br = lm(br);
@@ -8584,7 +8590,7 @@ const hm = function(e, t, n, r) {
8584
8590
  }, pm = (e, t, n = "") => {
8585
8591
  const r = (a) => "\x1B[33m\x1B[3m" + a + "\x1B[0m", o = (a) => "\x1B[3m" + a + "\x1B[0m", i = e.text || "[" + e.implicit + "]";
8586
8592
  typeof t != "string" && t.length > 2 && (t = t.slice(0, 2).join(", #") + " +"), t = typeof t != "string" ? t.join(", #") : t, console.log(` ${r(i).padEnd(24)} \x1B[32m→\x1B[0m #${t.padEnd(22)} ${o(n)}`);
8587
- }, G = function(e, t, n) {
8593
+ }, F = function(e, t, n) {
8588
8594
  if (!t || t.length === 0 || e.frozen === !0)
8589
8595
  return;
8590
8596
  const r = typeof process > "u" || !process.env ? self.env || {} : process.env;
@@ -8600,19 +8606,19 @@ const hm = function(e, t, n, r) {
8600
8606
  "Honorific",
8601
8607
  "Month"
8602
8608
  ], mm = function(e) {
8603
- !e.tags.has("Noun") || e.tags.has("Plural") || e.tags.has("Singular") || gm.find((t) => e.tags.has(t)) || (ss(e.normal) ? G(e, "Plural", "3-plural-guess") : G(e, "Singular", "3-singular-guess"));
8609
+ !e.tags.has("Noun") || e.tags.has("Plural") || e.tags.has("Singular") || gm.find((t) => e.tags.has(t)) || (ss(e.normal) ? F(e, "Plural", "3-plural-guess") : F(e, "Singular", "3-singular-guess"));
8604
8610
  }, bm = function(e) {
8605
8611
  const t = e.tags;
8606
8612
  if (t.has("Verb") && t.size === 1) {
8607
8613
  const n = os(e.normal);
8608
- n && G(e, n, "3-verb-tense-guess");
8614
+ n && F(e, n, "3-verb-tense-guess");
8609
8615
  }
8610
8616
  }, _t = function(e, t, n) {
8611
8617
  const r = e[t], o = Array.from(r.tags);
8612
8618
  for (let i = 0; i < o.length; i += 1)
8613
8619
  if (n.one.tagSet[o[i]]) {
8614
8620
  const a = n.one.tagSet[o[i]].parents;
8615
- G(r, a, ` -inferred by #${o[i]}`);
8621
+ F(r, a, ` -inferred by #${o[i]}`);
8616
8622
  }
8617
8623
  mm(r), bm(r);
8618
8624
  }, ym = /^\p{Lu}[\p{Ll}'’]/u, vm = /[0-9]/, wm = ["Date", "Month", "WeekDay", "Unit", "Expression"], Pm = /[IVX]/, km = /^[IVXLCDM]{2,}$/, Am = /^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/, xm = {
@@ -8625,7 +8631,7 @@ const hm = function(e, t, n, r) {
8625
8631
  const r = e[t];
8626
8632
  r.index = r.index || [0, 0];
8627
8633
  const o = r.index[1], i = r.text || "";
8628
- return o !== 0 && ym.test(i) === !0 && vm.test(i) === !1 ? wm.find((a) => r.tags.has(a)) || r.pre.match(/["']$/) || r.normal === "the" ? null : (_t(e, t, n), !r.tags.has("Noun") && !r.frozen && r.tags.clear(), G(r, "ProperNoun", "2-titlecase"), !0) : i.length >= 2 && km.test(i) && Pm.test(i) && Am.test(i) && !xm[r.normal] ? (G(r, "RomanNumeral", "2-xvii"), !0) : null;
8634
+ return o !== 0 && ym.test(i) === !0 && vm.test(i) === !1 ? wm.find((a) => r.tags.has(a)) || r.pre.match(/["']$/) || r.normal === "the" ? null : (_t(e, t, n), !r.tags.has("Noun") && !r.frozen && r.tags.clear(), F(r, "ProperNoun", "2-titlecase"), !0) : i.length >= 2 && km.test(i) && Pm.test(i) && Am.test(i) && !xm[r.normal] ? (F(r, "RomanNumeral", "2-xvii"), !0) : null;
8629
8635
  }, yi = function(e = "", t = []) {
8630
8636
  const n = e.length;
8631
8637
  let r = 7;
@@ -8641,9 +8647,9 @@ const hm = function(e, t, n, r) {
8641
8647
  if (r.tags.size === 0) {
8642
8648
  let o = yi(r.normal, n.two.suffixPatterns);
8643
8649
  if (o !== null)
8644
- return G(r, o, "2-suffix"), r.confidence = 0.7, !0;
8650
+ return F(r, o, "2-suffix"), r.confidence = 0.7, !0;
8645
8651
  if (r.implicit && (o = yi(r.implicit, n.two.suffixPatterns), o !== null))
8646
- return G(r, o, "2-implicit-suffix"), r.confidence = 0.7, !0;
8652
+ return F(r, o, "2-implicit-suffix"), r.confidence = 0.7, !0;
8647
8653
  }
8648
8654
  return null;
8649
8655
  }, vi = /['‘’‛‵′`´]/, Kn = function(e, t) {
@@ -8681,7 +8687,7 @@ const hm = function(e, t, n, r) {
8681
8687
  if (r.tags.size === 0) {
8682
8688
  const o = Tm(r.normal, n.two.prefixPatterns);
8683
8689
  if (o !== null)
8684
- return G(r, o, "2-prefix"), r.confidence = 0.5, !0;
8690
+ return F(r, o, "2-prefix"), r.confidence = 0.5, !0;
8685
8691
  }
8686
8692
  return null;
8687
8693
  }, Em = 1400, Dm = 2100, Om = /* @__PURE__ */ new Set([
@@ -8725,22 +8731,22 @@ const hm = function(e, t, n, r) {
8725
8731
  if (r && !isNaN(r) && r > Em && r < Dm) {
8726
8732
  const o = e[t - 1], i = e[t + 1];
8727
8733
  if (wi(o) || wi(i))
8728
- return G(n, "Year", "2-tagYear");
8734
+ return F(n, "Year", "2-tagYear");
8729
8735
  if (r >= 1920 && r < 2025) {
8730
8736
  if (Pi(o) || Pi(i))
8731
- return G(n, "Year", "2-tagYear-close");
8737
+ return F(n, "Year", "2-tagYear-close");
8732
8738
  if (ki(e[t - 2]) || ki(e[t + 2]))
8733
- return G(n, "Year", "2-tagYear-far");
8739
+ return F(n, "Year", "2-tagYear-far");
8734
8740
  if (o && (o.tags.has("Determiner") || o.tags.has("Possessive")) && i && i.tags.has("Noun") && !i.tags.has("Plural"))
8735
- return G(n, "Year", "2-tagYear-noun");
8741
+ return F(n, "Year", "2-tagYear-noun");
8736
8742
  }
8737
8743
  }
8738
8744
  }
8739
8745
  return null;
8740
- }, Fm = function(e, t, n, r) {
8746
+ }, Gm = function(e, t, n, r) {
8741
8747
  const o = r.methods.one.setTag, i = e[t], a = ["PastTense", "PresentTense", "Auxiliary", "Modal", "Particle"];
8742
8748
  i.tags.has("Verb") && (a.find((u) => i.tags.has(u)) || o([i], "Infinitive", r, null, "2-verb-type''"));
8743
- }, cs = /^[A-Z]('s|,)?$/, ls = /^[A-Z-]+$/, hs = /^[A-Z]+s$/, Gm = /([A-Z]\.)+[A-Z]?,?$/, Sm = /[A-Z]{2,}('s|,)?$/, zm = /([a-z]\.)+[a-z]\.?$/, ds = {
8749
+ }, cs = /^[A-Z]('s|,)?$/, ls = /^[A-Z-]+$/, hs = /^[A-Z]+s$/, Fm = /([A-Z]\.)+[A-Z]?,?$/, Sm = /[A-Z]{2,}('s|,)?$/, zm = /([a-z]\.)+[a-z]\.?$/, ds = {
8744
8750
  I: !0,
8745
8751
  A: !0
8746
8752
  }, Bm = {
@@ -8756,10 +8762,10 @@ const hm = function(e, t, n, r) {
8756
8762
  n = n.replace(/s$/, "");
8757
8763
  else
8758
8764
  return !1;
8759
- return n.length > 5 || ds.hasOwnProperty(n) || t.one.lexicon.hasOwnProperty(e.normal) ? !1 : Gm.test(n) === !0 || zm.test(n) === !0 || cs.test(n) === !0 || Sm.test(n) === !0;
8765
+ return n.length > 5 || ds.hasOwnProperty(n) || t.one.lexicon.hasOwnProperty(e.normal) ? !1 : Fm.test(n) === !0 || zm.test(n) === !0 || cs.test(n) === !0 || Sm.test(n) === !0;
8760
8766
  }, Mm = function(e, t, n) {
8761
8767
  const r = e[t];
8762
- return r.tags.has("RomanNumeral") || r.tags.has("Acronym") || r.frozen ? null : Vm(r, n) ? (r.tags.clear(), G(r, ["Acronym", "Noun"], "3-no-period-acronym"), Bm[r.normal] === !0 && G(r, "Place", "3-place-acronym"), hs.test(r.text) === !0 && G(r, "Plural", "3-plural-acronym"), !0) : !ds.hasOwnProperty(r.text) && cs.test(r.text) ? (r.tags.clear(), G(r, ["Acronym", "Noun"], "3-one-letter-acronym"), !0) : r.tags.has("Organization") && r.text.length <= 3 ? (G(r, "Acronym", "3-org-acronym"), !0) : r.tags.has("Organization") && ls.test(r.text) && r.text.length <= 6 ? (G(r, "Acronym", "3-titlecase-acronym"), !0) : null;
8768
+ return r.tags.has("RomanNumeral") || r.tags.has("Acronym") || r.frozen ? null : Vm(r, n) ? (r.tags.clear(), F(r, ["Acronym", "Noun"], "3-no-period-acronym"), Bm[r.normal] === !0 && F(r, "Place", "3-place-acronym"), hs.test(r.text) === !0 && F(r, "Plural", "3-plural-acronym"), !0) : !ds.hasOwnProperty(r.text) && cs.test(r.text) ? (r.tags.clear(), F(r, ["Acronym", "Noun"], "3-one-letter-acronym"), !0) : r.tags.has("Organization") && r.text.length <= 3 ? (F(r, "Acronym", "3-org-acronym"), !0) : r.tags.has("Organization") && ls.test(r.text) && r.text.length <= 6 ? (F(r, "Acronym", "3-titlecase-acronym"), !0) : null;
8763
8769
  }, Ai = function(e, t) {
8764
8770
  if (!e)
8765
8771
  return null;
@@ -8775,7 +8781,7 @@ const hm = function(e, t, n, r) {
8775
8781
  if (s.tags.size === 0) {
8776
8782
  let u = null;
8777
8783
  if (u = u || Ai(e[t - 1], o), u = u || Ai(e[t + 1], i), u = u || xi(e[t - 1], r), u = u || xi(e[t + 1], a), u)
8778
- return G(s, u, "3-[neighbour]"), _t(e, t, n), e[t].confidence = 0.2, !0;
8784
+ return F(s, u, "3-[neighbour]"), _t(e, t, n), e[t].confidence = 0.2, !0;
8779
8785
  }
8780
8786
  return null;
8781
8787
  }, Wm = (e) => /^\p{Lu}[\p{Ll}'’]/u.test(e), Ci = function(e, t, n) {
@@ -8845,7 +8851,7 @@ const hm = function(e, t, n, r) {
8845
8851
  }, qm = function(e, t, n) {
8846
8852
  let r = !1;
8847
8853
  const o = e[t].tags;
8848
- (o.size === 0 || o.size === 1 && (o.has("Hyphenated") || o.has("HashTag") || o.has("Prefix") || o.has("SlashedTerm"))) && (r = !0), r && (G(e[t], "Noun", "3-[fallback]"), _t(e, t, n), e[t].confidence = 0.1);
8854
+ (o.size === 0 || o.size === 1 && (o.has("Hyphenated") || o.has("HashTag") || o.has("Prefix") || o.has("SlashedTerm"))) && (r = !0), r && (F(e[t], "Noun", "3-[fallback]"), _t(e, t, n), e[t].confidence = 0.1);
8849
8855
  }, Qm = /^[A-Z][a-z]/, pe = (e, t) => e[t].tags.has("ProperNoun") && Qm.test(e[t].text) ? "Noun" : null, ji = (e, t, n) => t === 0 && !e[1] ? n : null, Zm = function(e, t) {
8850
8856
  return !e[t + 1] && e[t - 1] && e[t - 1].tags.has("Determiner") ? "Noun" : null;
8851
8857
  }, Xm = function(e, t, n) {
@@ -8930,7 +8936,7 @@ const hm = function(e, t, n, r) {
8930
8936
  _t(e, o, t), i = i || Lm(e, o, t), i = i || qm(e, o, t);
8931
8937
  }
8932
8938
  for (let o = 0; o < e.length; o += 1)
8933
- e[o].frozen !== !0 && (Km(e, o, n, r), Rm(e, o, n, r), e0(e, o, n), Fm(e, o, t, n), dm(e, o, t, n));
8939
+ e[o].frozen !== !0 && (Km(e, o, n, r), Rm(e, o, n, r), e0(e, o, n), Gm(e, o, t, n), dm(e, o, t, n));
8934
8940
  n0(e, n);
8935
8941
  }, s0 = function(e) {
8936
8942
  const { methods: t, model: n, world: r } = e, o = e.docs;
@@ -9513,7 +9519,7 @@ const hm = function(e, t, n, r) {
9513
9519
  // 'i'd have' -> i would have..
9514
9520
  "be"
9515
9521
  //' she'd be'
9516
- ]), F0 = (e, t) => {
9522
+ ]), G0 = (e, t) => {
9517
9523
  for (let n = t + 1; n < e.length; n += 1) {
9518
9524
  const r = e[n];
9519
9525
  if (O0.has(r.normal))
@@ -9530,9 +9536,9 @@ const hm = function(e, t, n, r) {
9530
9536
  return "would";
9531
9537
  }
9532
9538
  return !1;
9533
- }, G0 = function(e, t) {
9539
+ }, F0 = function(e, t) {
9534
9540
  const n = e[t].normal.split(D0)[0];
9535
- return n === "how" || n === "what" ? [n, "did"] : F0(e, t) === "had" ? [n, "had"] : [n, "would"];
9541
+ return n === "how" || n === "what" ? [n, "did"] : G0(e, t) === "had" ? [n, "had"] : [n, "would"];
9536
9542
  }, S0 = function(e, t) {
9537
9543
  for (let n = t - 1; n >= 0; n -= 1)
9538
9544
  if (e[n].tags.has("Noun") || e[n].tags.has("Pronoun") || e[n].tags.has("Plural") || e[n].tags.has("Singular"))
@@ -9612,7 +9618,7 @@ const hm = function(e, t, n, r) {
9612
9618
  return o.switch === "Noun|Verb";
9613
9619
  }
9614
9620
  return !!r.tags.has("Value");
9615
- }, Fi = /'/, K0 = function(e) {
9621
+ }, Gi = /'/, K0 = function(e) {
9616
9622
  e.forEach((t, n) => {
9617
9623
  t.index && (t.index[1] = n);
9618
9624
  });
@@ -9621,9 +9627,9 @@ const hm = function(e, t, n, r) {
9621
9627
  o.document = [e];
9622
9628
  let i = n + r;
9623
9629
  n > 0 && (n -= 1), e[i] && (i += 1), o.ptrs = [[0, n, i]], o.compute(["freeze", "lexicon", "preTagger", "unfreeze"]), K0(e);
9624
- }, Gi = {
9630
+ }, Fi = {
9625
9631
  // how'd
9626
- d: (e, t) => G0(e, t),
9632
+ d: (e, t) => F0(e, t),
9627
9633
  // we ain't
9628
9634
  t: (e, t) => z0(e, t),
9629
9635
  // bob's
@@ -9638,9 +9644,9 @@ const hm = function(e, t, n, r) {
9638
9644
  if (r[i].implicit)
9639
9645
  continue;
9640
9646
  let a = null;
9641
- Fi.test(r[i].normal) === !0 && (a = r[i].normal.split(Fi)[1]);
9647
+ Gi.test(r[i].normal) === !0 && (a = r[i].normal.split(Gi)[1]);
9642
9648
  let s = null;
9643
- if (Gi.hasOwnProperty(a) && (s = Gi[a](r, i, t)), s) {
9649
+ if (Fi.hasOwnProperty(a) && (s = Fi[a](r, i, t)), s) {
9644
9650
  s = J0(s, e), C0(n, [o, i], s), _0(n[o], e, i, s.length);
9645
9651
  continue;
9646
9652
  }
@@ -11226,14 +11232,14 @@ const D1 = {
11226
11232
  e._cache || e.cache();
11227
11233
  const r = e._cache;
11228
11234
  return e.filter((o, i) => n.some((a) => r[i].has(a)));
11229
- }, F1 = function(e, t) {
11235
+ }, G1 = function(e, t) {
11230
11236
  let n = t;
11231
11237
  typeof t == "string" && (n = this.buildNet([{ match: t }]));
11232
11238
  const r = this.tokenize(e), o = H1(r, n);
11233
11239
  return o.found ? (o.compute(["index", "tagger"]), o.match(t)) : r.none();
11234
- }, G1 = {
11240
+ }, F1 = {
11235
11241
  lib: {
11236
- lazy: F1
11242
+ lazy: G1
11237
11243
  }
11238
11244
  }, S1 = function(e, t) {
11239
11245
  const n = e.methods.two.transform.verb.conjugate, r = n(t, e.model);
@@ -11270,7 +11276,7 @@ const D1 = {
11270
11276
  v.plugin(v0);
11271
11277
  v.plugin(q0);
11272
11278
  v.plugin(D1);
11273
- v.plugin(G1);
11279
+ v.plugin(F1);
11274
11280
  v.plugin(K1);
11275
11281
  const ct = function(e) {
11276
11282
  const { fromComparative: t, fromSuperlative: n } = e.methods.two.transform.adjective, r = e.text("normal");
@@ -11958,7 +11964,7 @@ const Ob = {
11958
11964
  "whom",
11959
11965
  "whomever",
11960
11966
  "whose"
11961
- ], Fb = function(e) {
11967
+ ], Gb = function(e) {
11962
11968
  if (e.before("#Preposition$").found)
11963
11969
  return !0;
11964
11970
  if (!e.before().found)
@@ -11967,10 +11973,10 @@ const Ob = {
11967
11973
  if (e.has(Li[n]))
11968
11974
  return !0;
11969
11975
  return !1;
11970
- }, Gb = "(#Pronoun|#Place|#Value|#Person|#Uncountable|#Month|#WeekDay|#Holiday|#Possessive)", Sb = function(e, t) {
11976
+ }, Fb = "(#Pronoun|#Place|#Value|#Person|#Uncountable|#Month|#WeekDay|#Holiday|#Possessive)", Sb = function(e, t) {
11971
11977
  if (e.has("#Plural") || e.has("#Noun and #Noun") || e.has("(we|they)"))
11972
11978
  return !0;
11973
- if (t.has(Gb) === !0 || e.has("#Singular"))
11979
+ if (t.has(Fb) === !0 || e.has("#Singular"))
11974
11980
  return !1;
11975
11981
  const n = t.text("normal");
11976
11982
  return n.length > 3 && n.endsWith("s") && !n.endsWith("ss");
@@ -11984,7 +11990,7 @@ const Ob = {
11984
11990
  adjectives: e.match("#Adjective"),
11985
11991
  number: e.values(),
11986
11992
  isPlural: Sb(e, t),
11987
- isSubordinate: Fb(e),
11993
+ isSubordinate: Gb(e),
11988
11994
  root: t
11989
11995
  };
11990
11996
  }, Wi = (e) => e.text(), Bb = (e) => e.json({ terms: !1, normal: !0 }).map((t) => t.normal), Vb = function(e) {
@@ -12501,18 +12507,18 @@ const Ob = {
12501
12507
  let r = Rb(this);
12502
12508
  return r = r.getNth(n), new t(this.document, r.pointer);
12503
12509
  };
12504
- }, fy = "one|two|three|four|five|six|seven|eight|nine", Fe = "twenty|thirty|forty|fifty|sixty|seventy|eighty|ninety|fourty", py = "eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen", Xn = function(e) {
12510
+ }, fy = "one|two|three|four|five|six|seven|eight|nine", Ge = "twenty|thirty|forty|fifty|sixty|seventy|eighty|ninety|fourty", py = "eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen", Xn = function(e) {
12505
12511
  let t = e.match("#Value+");
12506
- if (t.has("#NumericValue #NumericValue") && (t.has("#Value @hasComma #Value") ? t.splitAfter("@hasComma") : t.has("#NumericValue #Fraction") ? t.splitAfter("#NumericValue #Fraction") : t = t.splitAfter("#NumericValue")), t.has("#Value #Value #Value") && !t.has("#Multiple") && t.has("(" + Fe + ") #Cardinal #Cardinal") && (t = t.splitAfter("(" + Fe + ") #Cardinal")), t.has("#Value #Value")) {
12507
- t.has("#NumericValue #NumericValue") && (t = t.splitOn("#Year")), t.has("(" + Fe + ") (" + py + ")") && (t = t.splitAfter("(" + Fe + ")"));
12512
+ if (t.has("#NumericValue #NumericValue") && (t.has("#Value @hasComma #Value") ? t.splitAfter("@hasComma") : t.has("#NumericValue #Fraction") ? t.splitAfter("#NumericValue #Fraction") : t = t.splitAfter("#NumericValue")), t.has("#Value #Value #Value") && !t.has("#Multiple") && t.has("(" + Ge + ") #Cardinal #Cardinal") && (t = t.splitAfter("(" + Ge + ") #Cardinal")), t.has("#Value #Value")) {
12513
+ t.has("#NumericValue #NumericValue") && (t = t.splitOn("#Year")), t.has("(" + Ge + ") (" + py + ")") && (t = t.splitAfter("(" + Ge + ")"));
12508
12514
  const n = t.match("#Cardinal #Cardinal");
12509
12515
  if (n.found && !t.has("(point|decimal|#Fraction)") && !n.has("#Cardinal (#Multiple|point|decimal)")) {
12510
- const r = t.has(`(${fy}) (${Fe})`), o = n.has("(" + Fe + ") #Cardinal"), i = n.has("#Multiple #Value");
12516
+ const r = t.has(`(${fy}) (${Ge})`), o = n.has("(" + Ge + ") #Cardinal"), i = n.has("#Multiple #Value");
12511
12517
  !r && !o && !i && n.terms().forEach((a) => {
12512
12518
  t = t.splitOn(a);
12513
12519
  });
12514
12520
  }
12515
- t.match("#Ordinal #Ordinal").match("#TextValue").found && !t.has("#Multiple") && (t.has("(" + Fe + ") #Ordinal") || (t = t.splitAfter("#Ordinal"))), t = t.splitBefore("#Ordinal [#Cardinal]", 0), t.has("#TextValue #NumericValue") && !t.has("(" + Fe + "|#Multiple)") && (t = t.splitBefore("#TextValue #NumericValue"));
12521
+ t.match("#Ordinal #Ordinal").match("#TextValue").found && !t.has("#Multiple") && (t.has("(" + Ge + ") #Ordinal") || (t = t.splitAfter("#Ordinal"))), t = t.splitBefore("#Ordinal [#Cardinal]", 0), t.has("#TextValue #NumericValue") && !t.has("(" + Ge + "|#Multiple)") && (t = t.splitBefore("#TextValue #NumericValue"));
12516
12522
  }
12517
12523
  return t = t.splitAfter("#NumberRange"), t = t.splitBefore("#Year"), t;
12518
12524
  }, gy = function(e, t) {
@@ -12888,9 +12894,9 @@ const Ob = {
12888
12894
  });
12889
12895
  }
12890
12896
  return e;
12891
- }, Fy = function(e) {
12892
- return e.verbs().first().toNegative().compute("chunks"), e;
12893
12897
  }, Gy = function(e) {
12898
+ return e.verbs().first().toNegative().compute("chunks"), e;
12899
+ }, Fy = function(e) {
12894
12900
  return e.verbs().first().toPositive().compute("chunks"), e;
12895
12901
  }, Sy = function(e) {
12896
12902
  return e.verbs().toInfinitive(), e;
@@ -12923,10 +12929,10 @@ const Ob = {
12923
12929
  return this.getNth(o).map((i) => (Ue(i), Sy(i)));
12924
12930
  }
12925
12931
  toNegative(o) {
12926
- return this.getNth(o).map((i) => (Ue(i), Fy(i)));
12932
+ return this.getNth(o).map((i) => (Ue(i), Gy(i)));
12927
12933
  }
12928
12934
  toPositive(o) {
12929
- return this.getNth(o).map((i) => (Ue(i), Gy(i)));
12935
+ return this.getNth(o).map((i) => (Ue(i), Fy(i)));
12930
12936
  }
12931
12937
  isQuestion(o) {
12932
12938
  return this.questions(o);
@@ -13123,7 +13129,7 @@ const Ob = {
13123
13129
  negative: ev(t),
13124
13130
  phrasal: tv(n)
13125
13131
  };
13126
- }, ge = { tense: "PresentTense" }, fn = { conditional: !0 }, $e = { tense: "FutureTense" }, lt = { progressive: !0 }, K = { tense: "PastTense" }, ht = { complete: !0, progressive: !1 }, Ge = { passive: !0 }, nv = { plural: !0 }, rv = { plural: !1 }, ov = function(e) {
13132
+ }, ge = { tense: "PresentTense" }, fn = { conditional: !0 }, $e = { tense: "FutureTense" }, lt = { progressive: !0 }, K = { tense: "PastTense" }, ht = { complete: !0, progressive: !1 }, Fe = { passive: !0 }, nv = { plural: !0 }, rv = { plural: !1 }, ov = function(e) {
13127
13133
  const t = {};
13128
13134
  return e.forEach((n) => {
13129
13135
  Object.assign(t, n);
@@ -13213,25 +13219,25 @@ const Ob = {
13213
13219
  // ==== Passive ===
13214
13220
  "passive-past": [
13215
13221
  // got walked, was walked, were walked
13216
- ["(got|were|was) #Passive", [K, Ge]],
13222
+ ["(got|were|was) #Passive", [K, Fe]],
13217
13223
  // was being walked
13218
- ["^(was|were) being #Passive", [K, Ge]],
13224
+ ["^(was|were) being #Passive", [K, Fe]],
13219
13225
  // had been walked, have been eaten
13220
- ["^(had|have) been #Passive", [K, Ge]]
13226
+ ["^(had|have) been #Passive", [K, Fe]]
13221
13227
  ],
13222
13228
  "passive-present": [
13223
13229
  // is walked, are stolen
13224
- ["^(is|are|am) #Passive", [ge, Ge]],
13230
+ ["^(is|are|am) #Passive", [ge, Fe]],
13225
13231
  // is being walked
13226
- ["^(is|are|am) being #Passive", [ge, Ge]],
13232
+ ["^(is|are|am) being #Passive", [ge, Fe]],
13227
13233
  // has been cleaned
13228
- ["^has been #Passive", [ge, Ge]]
13234
+ ["^has been #Passive", [ge, Fe]]
13229
13235
  ],
13230
13236
  "passive-future": [
13231
13237
  // will have been walked
13232
- ["will have been #Passive", [$e, Ge, fn]],
13238
+ ["will have been #Passive", [$e, Fe, fn]],
13233
13239
  // will be cleaned
13234
- ["will be being? #Passive", [$e, Ge, fn]]
13240
+ ["will be being? #Passive", [$e, Fe, fn]]
13235
13241
  ],
13236
13242
  // === Conditional ===
13237
13243
  "present-conditional": [
@@ -13971,14 +13977,14 @@ function Hv(e, t, n = 0, r = 0) {
13971
13977
  if (i.start == null || i.end == null)
13972
13978
  continue;
13973
13979
  let s = ou(t, i.start, i.end);
13974
- if (s.length === 0 && i.text && (s = Fv(t, i.text)), s.length === 0)
13980
+ if (s.length === 0 && i.text && (s = Gv(t, i.text)), s.length === 0)
13975
13981
  continue;
13976
- const u = Gv(s);
13982
+ const u = Sv(s);
13977
13983
  for (const c of u.values()) {
13978
- const l = Sv(c.map((h) => h.bbox));
13984
+ const l = zv(c.map((h) => h.bbox));
13979
13985
  o.push({
13980
13986
  id: `redact-${Ov++}`,
13981
- bbox: zv(l, 2, n, r),
13987
+ bbox: Bv(l, 2, n, r),
13982
13988
  source: "auto",
13983
13989
  entityId: i.id,
13984
13990
  enabled: !0,
@@ -13988,7 +13994,7 @@ function Hv(e, t, n = 0, r = 0) {
13988
13994
  }
13989
13995
  return o;
13990
13996
  }
13991
- function Fv(e, t) {
13997
+ function Gv(e, t) {
13992
13998
  const n = t.toLowerCase().trim();
13993
13999
  if (!n) return [];
13994
14000
  const r = n.split(/\s+/);
@@ -14007,15 +14013,27 @@ function Fv(e, t) {
14007
14013
  return a === n || n.includes(a) || a.includes(n);
14008
14014
  });
14009
14015
  }
14010
- function Gv(e) {
14016
+ const Fv = 200;
14017
+ function Sv(e) {
14011
14018
  const t = /* @__PURE__ */ new Map();
14012
- for (const n of e) {
14013
- const r = t.get(n.lineIndex) ?? [];
14014
- r.push(n), t.set(n.lineIndex, r);
14019
+ for (const o of e) {
14020
+ const i = t.get(o.lineIndex) ?? [];
14021
+ i.push(o), t.set(o.lineIndex, i);
14015
14022
  }
14016
- return t;
14023
+ const n = /* @__PURE__ */ new Map();
14024
+ let r = 0;
14025
+ for (const [o, i] of t) {
14026
+ const a = [...i].sort((u, c) => u.bbox.x0 - c.bbox.x0);
14027
+ let s = [a[0]];
14028
+ for (let u = 1; u < a.length; u++) {
14029
+ const c = a[u - 1], l = a[u];
14030
+ l.bbox.x0 - c.bbox.x1 > Fv ? (n.set(o * 1e4 + r++, s), s = [l]) : s.push(l);
14031
+ }
14032
+ n.set(o * 1e4 + r++, s);
14033
+ }
14034
+ return n;
14017
14035
  }
14018
- function Sv(e) {
14036
+ function zv(e) {
14019
14037
  return {
14020
14038
  x0: Math.min(...e.map((t) => t.x0)),
14021
14039
  y0: Math.min(...e.map((t) => t.y0)),
@@ -14023,7 +14041,7 @@ function Sv(e) {
14023
14041
  y1: Math.max(...e.map((t) => t.y1))
14024
14042
  };
14025
14043
  }
14026
- function zv(e, t, n = 0, r = 0) {
14044
+ function Bv(e, t, n = 0, r = 0) {
14027
14045
  const o = e.x1 + t, i = e.y1 + t;
14028
14046
  return {
14029
14047
  x0: Math.max(0, e.x0 - t),
@@ -14032,7 +14050,7 @@ function zv(e, t, n = 0, r = 0) {
14032
14050
  y1: r > 0 ? Math.min(r, i) : i
14033
14051
  };
14034
14052
  }
14035
- function Bv(e, t) {
14053
+ function Vv(e, t) {
14036
14054
  const n = [...e, ...t];
14037
14055
  n.sort((o, i) => o.start - i.start || i.end - o.end);
14038
14056
  const r = [];
@@ -14051,8 +14069,8 @@ function Bv(e, t) {
14051
14069
  }
14052
14070
  return r;
14053
14071
  }
14054
- async function Vv(e, t) {
14055
- const n = e instanceof HTMLImageElement ? e.naturalWidth : e.width, r = e instanceof HTMLImageElement ? e.naturalHeight : e.height, o = Mv(n, r), i = Lv(o);
14072
+ async function Mv(e, t) {
14073
+ const n = e instanceof HTMLImageElement ? e.naturalWidth : e.width, r = e instanceof HTMLImageElement ? e.naturalHeight : e.height, o = Lv(n, r), i = Wv(o);
14056
14074
  i.drawImage(e, 0, 0, n, r), i.fillStyle = "#000000";
14057
14075
  const a = [];
14058
14076
  for (const u of t) {
@@ -14065,13 +14083,13 @@ async function Vv(e, t) {
14065
14083
  });
14066
14084
  }
14067
14085
  return {
14068
- blob: await Wv(o),
14086
+ blob: await Kv(o),
14069
14087
  entities: a,
14070
14088
  width: n,
14071
14089
  height: r
14072
14090
  };
14073
14091
  }
14074
- function Xv(e, t, n = {
14092
+ function Yv(e, t, n = {
14075
14093
  fill: "rgba(0, 0, 0, 0.7)",
14076
14094
  stroke: "#ff3333",
14077
14095
  lineWidth: 2
@@ -14082,18 +14100,18 @@ function Xv(e, t, n = {
14082
14100
  e.fillStyle = n.fill, e.fillRect(o, i, u, c), e.strokeStyle = n.stroke, e.lineWidth = n.lineWidth, e.strokeRect(o, i, u, c);
14083
14101
  }
14084
14102
  }
14085
- function Mv(e, t) {
14103
+ function Lv(e, t) {
14086
14104
  if (typeof OffscreenCanvas < "u")
14087
14105
  return new OffscreenCanvas(e, t);
14088
14106
  const n = document.createElement("canvas");
14089
14107
  return n.width = e, n.height = t, n;
14090
14108
  }
14091
- function Lv(e) {
14109
+ function Wv(e) {
14092
14110
  const t = e.getContext("2d");
14093
14111
  if (!t) throw new Error("Could not get 2D canvas context");
14094
14112
  return t;
14095
14113
  }
14096
- async function Wv(e) {
14114
+ async function Kv(e) {
14097
14115
  return e instanceof OffscreenCanvas ? e.convertToBlob({ type: "image/png" }) : new Promise((t, n) => {
14098
14116
  e.toBlob(
14099
14117
  (r) => {
@@ -14103,8 +14121,8 @@ async function Wv(e) {
14103
14121
  );
14104
14122
  });
14105
14123
  }
14106
- async function Kv(e, t, n) {
14107
- const r = { ...t }, o = _v(r.memoryMode);
14124
+ async function _v(e, t, n) {
14125
+ const r = { ...t }, o = Jv(r.memoryMode);
14108
14126
  n?.({ phase: "ocr", progress: 0, message: "Starting OCR..." });
14109
14127
  const i = await ru(e, r.lang, n);
14110
14128
  if (!i.fullText.trim())
@@ -14116,20 +14134,20 @@ async function Kv(e, t, n) {
14116
14134
  });
14117
14135
  const a = r.useRegex ? hu(i.fullText) : [], s = r.useCompromise ? Dv(i.fullText) : [];
14118
14136
  o === "low" && await uu();
14119
- const u = await su(i.fullText, r.nerModel, r.minConfidence, n), c = Bv(u, [...a, ...s]), l = Hv(c, i.words, i.imageWidth, i.imageHeight);
14137
+ const u = await su(i.fullText, r.nerModel, r.minConfidence, n), c = Vv(u, [...a, ...s]), l = Hv(c, i.words, i.imageWidth, i.imageHeight);
14120
14138
  return n?.({
14121
14139
  phase: "reviewing",
14122
14140
  progress: 1,
14123
14141
  message: `Found ${l.length} items to redact.`
14124
14142
  }), { ocr: i, entities: c, redactions: l };
14125
14143
  }
14126
- function _v(e) {
14144
+ function Jv(e) {
14127
14145
  if (e === "low") return "low";
14128
14146
  if (e === "normal") return "normal";
14129
14147
  const t = navigator.deviceMemory;
14130
14148
  return t !== void 0 && t < 4 ? "low" : "normal";
14131
14149
  }
14132
- const Jv = {
14150
+ const Uv = {
14133
14151
  GIVENNAME: "First name",
14134
14152
  SURNAME: "Last name",
14135
14153
  PERSON: "Person name",
@@ -14155,10 +14173,10 @@ const Jv = {
14155
14173
  useCompromise: !0,
14156
14174
  memoryMode: "auto"
14157
14175
  };
14158
- var Uv = Object.defineProperty, Rv = Object.getOwnPropertyDescriptor, D = (e, t, n, r) => {
14159
- for (var o = r > 1 ? void 0 : r ? Rv(t, n) : t, i = e.length - 1, a; i >= 0; i--)
14176
+ var Rv = Object.defineProperty, qv = Object.getOwnPropertyDescriptor, D = (e, t, n, r) => {
14177
+ for (var o = r > 1 ? void 0 : r ? qv(t, n) : t, i = e.length - 1, a; i >= 0; i--)
14160
14178
  (a = e[i]) && (o = (r ? a(t, n, o) : a(o)) || o);
14161
- return r && o && Uv(t, n, o), o;
14179
+ return r && o && Rv(t, n, o), o;
14162
14180
  };
14163
14181
  let j = class extends Et {
14164
14182
  constructor() {
@@ -14446,7 +14464,7 @@ let j = class extends Et {
14446
14464
  nerModel: this.nerModel,
14447
14465
  minConfidence: this.minConfidence,
14448
14466
  useRegex: this.useRegex
14449
- }, r = await Kv(
14467
+ }, r = await _v(
14450
14468
  e,
14451
14469
  n,
14452
14470
  (o) => this.handleProgress(o)
@@ -14549,7 +14567,7 @@ let j = class extends Et {
14549
14567
  if (this.imageElement) {
14550
14568
  this.phase = "exporting", this.progress = 0.5, this.progressMessage = "Rendering redacted image...";
14551
14569
  try {
14552
- const e = await Vv(
14570
+ const e = await Mv(
14553
14571
  this.imageElement,
14554
14572
  this.redactions
14555
14573
  );
@@ -14590,7 +14608,7 @@ let j = class extends Et {
14590
14608
  // --- Helpers ---
14591
14609
  /** Returns a user-friendly label for an entity type. */
14592
14610
  getDisplayLabel(e) {
14593
- return e ? Jv[e] ?? e : "Manual redaction";
14611
+ return e ? Uv[e] ?? e : "Manual redaction";
14594
14612
  }
14595
14613
  getRedactionText(e) {
14596
14614
  return e.source === "manual" ? "(manually drawn)" : !e.entityId || !this.ocrResult ? "" : this.entities.find((n) => n.id === e.entityId)?.text ?? "";
@@ -14676,7 +14694,7 @@ D([
14676
14694
  j = D([
14677
14695
  Ws("pii-redactor")
14678
14696
  ], j);
14679
- async function Yv(e = {}) {
14697
+ async function ew(e = {}) {
14680
14698
  if (!("serviceWorker" in navigator) || !navigator.serviceWorker)
14681
14699
  return null;
14682
14700
  const t = e.swPath ?? "/pii-redactor-sw.js", n = {};
@@ -14687,7 +14705,7 @@ async function Yv(e = {}) {
14687
14705
  return null;
14688
14706
  }
14689
14707
  }
14690
- async function ew() {
14708
+ async function tw() {
14691
14709
  if (!("serviceWorker" in navigator) || !navigator.serviceWorker)
14692
14710
  return !1;
14693
14711
  try {
@@ -14701,20 +14719,20 @@ export {
14701
14719
  Zs as DARK_THRESHOLD,
14702
14720
  ft as DEFAULT_CONFIG,
14703
14721
  j as PiiRedactor,
14704
- Kv as analyzeImage,
14722
+ _v as analyzeImage,
14705
14723
  eu as computeAverageLuminance,
14706
14724
  su as detectPiiNer,
14707
14725
  hu as detectPiiRegex,
14708
- Xv as drawRedactionPreview,
14726
+ Yv as drawRedactionPreview,
14709
14727
  Hv as entitiesToRedactions,
14710
14728
  tu as isDarkBackground,
14711
- Bv as mergeEntities,
14729
+ Vv as mergeEntities,
14712
14730
  co as preloadNerModel,
14713
14731
  nu as preprocessForOcr,
14714
- Yv as registerServiceWorker,
14732
+ ew as registerServiceWorker,
14715
14733
  uu as releaseNerModel,
14716
- Vv as renderRedactedImage,
14734
+ Mv as renderRedactedImage,
14717
14735
  ru as runOcr,
14718
- ew as unregisterServiceWorker
14736
+ tw as unregisterServiceWorker
14719
14737
  };
14720
14738
  //# sourceMappingURL=image-pii-redactor.js.map