@harbour-enterprises/superdoc 0.9.33 → 0.9.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/chunks/{index--PIRPKWt.cjs → index-DHS2ANjv.cjs} +1 -1
  2. package/dist/chunks/{index-B5GDfEJg.es.js → index-Dd_ce0Er.es.js} +1 -1
  3. package/dist/chunks/index-XHRxRUhd.es.js +1676 -0
  4. package/dist/chunks/index-YqE5-6V1.cjs +1 -0
  5. package/dist/chunks/{super-editor.es-B8noCvT1.es.js → super-editor.es-BAc4W6Tu.es.js} +2295 -2306
  6. package/dist/chunks/{super-editor.es-y2QD_ueu.cjs → super-editor.es-BBgPdIMs.cjs} +47 -47
  7. package/dist/chunks/{url-BDmRlERW.es.js → url-BWFemt_V.es.js} +1 -1
  8. package/dist/chunks/{url-C5DCBLAS.cjs → url-Cqg7fbSS.cjs} +1 -1
  9. package/dist/chunks/xml-js-Bzw8Bo_u.es.js +1739 -0
  10. package/dist/chunks/xml-js-Zwb1wsIy.cjs +10 -0
  11. package/dist/super-editor/chunks/{converter-CdhiEvSA.js → converter-UkRnMuKc.js} +274 -275
  12. package/dist/super-editor/chunks/{docx-zipper-Cb4eXMOp.js → docx-zipper-BiMOTpMh.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-Czx51mKu.js → editor-BLRcEmYR.js} +302 -312
  14. package/dist/super-editor/chunks/{toolbar-BE-PZVKR.js → toolbar-DWm-EjAe.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/super-editor.es.js +6 -6
  21. package/dist/super-editor/toolbar.es.js +2 -2
  22. package/dist/super-editor.cjs +1 -1
  23. package/dist/super-editor.es.js +1 -1
  24. package/dist/superdoc.cjs +3 -3
  25. package/dist/superdoc.es.js +6 -6
  26. package/dist/superdoc.umd.js +1211 -1222
  27. package/dist/superdoc.umd.js.map +1 -1
  28. package/package.json +1 -1
  29. package/dist/chunks/index-Bq_aNm9n.es.js +0 -473
  30. package/dist/chunks/index-DrgTIkvI.cjs +0 -1
  31. package/dist/chunks/xml-js-DMX8C2aY.es.js +0 -2965
  32. package/dist/chunks/xml-js-DN6JJ8Mw.cjs +0 -10
@@ -3559,9 +3559,7 @@ function Ct() {
3559
3559
  }
3560
3560
  }), jn;
3561
3561
  }
3562
- var Hn = {}, Zt = { exports: {} };
3563
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
3564
- var Ws;
3562
+ var Hn = {}, Zt = { exports: {} }, Ws;
3565
3563
  function Wl() {
3566
3564
  return Ws || (Ws = 1, function(r, e) {
3567
3565
  var t = Dr, n = t.Buffer;
@@ -3573,7 +3571,7 @@ function Wl() {
3573
3571
  function s(o, a, u) {
3574
3572
  return n(o, a, u);
3575
3573
  }
3576
- s.prototype = Object.create(n.prototype), i(n, s), s.from = function(o, a, u) {
3574
+ i(n, s), s.from = function(o, a, u) {
3577
3575
  if (typeof o == "number")
3578
3576
  throw new TypeError("Argument must not be a number");
3579
3577
  return n(o, a, u);
@@ -7854,7 +7852,7 @@ class Sr {
7854
7852
  return this.excluded.indexOf(e) > -1;
7855
7853
  }
7856
7854
  }
7857
- let up = class {
7855
+ let fp = class {
7858
7856
  /**
7859
7857
  Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
7860
7858
  */
@@ -9312,7 +9310,7 @@ function Fi(r, e, t, n = t.contentMatch, i = !0) {
9312
9310
  function of(r, e, t) {
9313
9311
  return (e == 0 || r.canReplace(e, r.childCount)) && (t == r.childCount || r.canReplace(0, t));
9314
9312
  }
9315
- function cp(r) {
9313
+ function mp(r) {
9316
9314
  let t = r.parent.content.cutByIndex(r.startIndex, r.endIndex);
9317
9315
  for (let n = r.depth; ; --n) {
9318
9316
  let i = r.$from.node(n), s = r.$from.index(n), o = r.$to.indexAfter(n);
@@ -9332,7 +9330,7 @@ function af(r, e, t) {
9332
9330
  A || i.after(T + 1) < i.end(T) ? (A = !0, g = Z.from(i.node(T).copy(g)), S++) : f++;
9333
9331
  r.step(new Je(u, f, o, a, new ue(c.append(g), h, S), c.size - h, !0));
9334
9332
  }
9335
- function fp(r, e, t = null, n = r) {
9333
+ function pp(r, e, t = null, n = r) {
9336
9334
  let i = uf(r, e), s = i && lf(n, e);
9337
9335
  return s ? i.map(ho).concat({ type: e, attrs: t }).concat(s.map(ho)) : null;
9338
9336
  }
@@ -9422,7 +9420,7 @@ function mf(r, e, t, n, i) {
9422
9420
  throw new RangeError("Invalid content for node type " + t.name);
9423
9421
  r.step(new Je(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new ue(Z.from(o), 0, 0), 1, !0));
9424
9422
  }
9425
- function dp(r, e, t = 1, n) {
9423
+ function hp(r, e, t = 1, n) {
9426
9424
  let i = r.resolve(e), s = i.depth - t, o = n && n[n.length - 1] || i.parent;
9427
9425
  if (s < 0 || i.parent.type.spec.isolating || !i.parent.canReplace(i.index(), i.parent.childCount) || !o.type.validContent(i.parent.content.cutByIndex(i.index(), i.parent.childCount)))
9428
9426
  return !1;
@@ -9448,7 +9446,7 @@ function pf(r, e, t = 1, n) {
9448
9446
  }
9449
9447
  r.step(new Ie(e, e, new ue(s.append(o), t, t), !0));
9450
9448
  }
9451
- function mp(r, e) {
9449
+ function gp(r, e) {
9452
9450
  let t = r.resolve(e), n = t.index();
9453
9451
  return za(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(n, n + 1);
9454
9452
  }
@@ -9465,7 +9463,7 @@ function hf(r, e) {
9465
9463
  function za(r, e) {
9466
9464
  return !!(r && e && !r.isLeaf && hf(r, e));
9467
9465
  }
9468
- function pp(r, e, t = -1) {
9466
+ function wp(r, e, t = -1) {
9469
9467
  let n = r.resolve(e);
9470
9468
  for (let i = n.depth; ; i--) {
9471
9469
  let s, o, a = n.index(i);
@@ -9517,7 +9515,7 @@ function wf(r, e, t) {
9517
9515
  }
9518
9516
  return null;
9519
9517
  }
9520
- function hp(r, e, t) {
9518
+ function yp(r, e, t) {
9521
9519
  let n = r.resolve(e);
9522
9520
  if (!t.content.size)
9523
9521
  return e;
@@ -10887,7 +10885,7 @@ function $a(r, e, t) {
10887
10885
  }
10888
10886
  return t;
10889
10887
  }
10890
- class gp {
10888
+ class bp {
10891
10889
  /**
10892
10890
  Create a plugin.
10893
10891
  */
@@ -10905,7 +10903,7 @@ const si = /* @__PURE__ */ Object.create(null);
10905
10903
  function Xa(r) {
10906
10904
  return r in si ? r + "$" + ++si[r] : (si[r] = 0, r + "$");
10907
10905
  }
10908
- class wp {
10906
+ class xp {
10909
10907
  /**
10910
10908
  Create a plugin key.
10911
10909
  */
@@ -10926,7 +10924,7 @@ class wp {
10926
10924
  return e[this.key];
10927
10925
  }
10928
10926
  }
10929
- const Ya = (r) => r.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), yp = (r) => Ya(r), bp = Object.freeze({
10927
+ const Ya = (r) => r.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Ap = (r) => Ya(r), Dp = Object.freeze({
10930
10928
  RESOLVED: "resolved",
10931
10929
  NEW: "new",
10932
10930
  ADD: "add",
@@ -10939,7 +10937,7 @@ const Ya = (r) => r.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), yp = (r) =>
10939
10937
  // Tracked changes
10940
10938
  CHANGE_ACCEPTED: "change-accepted",
10941
10939
  CHANGE_REJECTED: "change-rejected"
10942
- }), xp = {
10940
+ }), Ep = {
10943
10941
  mounted(r, e, t) {
10944
10942
  const n = (i) => {
10945
10943
  r.contains(i.target) || e.value(i);
@@ -10995,7 +10993,7 @@ function eu(r) {
10995
10993
  if (r != null)
10996
10994
  return Math.round(r * 6);
10997
10995
  }
10998
- const Nf = async (r) => await (await fetch(r)).arrayBuffer(), Ap = (r) => {
10996
+ const Nf = async (r) => await (await fetch(r)).arrayBuffer(), vp = (r) => {
10999
10997
  const n = new window.DOMParser().parseFromString(r, "text/xml").querySelectorAll("Default");
11000
10998
  return Array.from(n).map((i) => i.getAttribute("Extension"));
11001
10999
  }, If = (r) => (/* @__PURE__ */ new Map([
@@ -12255,6 +12253,14 @@ const Lf = {
12255
12253
  console.error("Error in carbonCopy", r, e);
12256
12254
  return;
12257
12255
  }
12256
+ }, Wf = {
12257
+ attributes: {
12258
+ "w:abstractNumId": "1"
12259
+ }
12260
+ }, Jf = {
12261
+ attributes: {
12262
+ "w:abstractNumId": "0"
12263
+ }
12258
12264
  }, ru = {
12259
12265
  declaration: {
12260
12266
  attributes: {
@@ -13505,7 +13511,7 @@ function vo(r, e) {
13505
13511
  u && (f = r.comments.find((S) => S.commentId === u || S.importedId === u));
13506
13512
  const c = f?.isInternal || o.isInternal;
13507
13513
  if (n === "external" && c || !!o.resolvedTime) return;
13508
- let g = Wf(e, a);
13514
+ let g = Kf(e, a);
13509
13515
  if (e === "End") {
13510
13516
  const S = {
13511
13517
  name: "w:r",
@@ -13515,21 +13521,21 @@ function vo(r, e) {
13515
13521
  }
13516
13522
  return g;
13517
13523
  }
13518
- const Wf = (r, e) => ({
13524
+ const Kf = (r, e) => ({
13519
13525
  name: `w:commentRange${r}`,
13520
13526
  attributes: {
13521
13527
  "w:id": String(e)
13522
13528
  }
13523
- }), Jf = (r) => ({
13529
+ }), $f = (r) => ({
13524
13530
  ...r,
13525
13531
  commentParaId: tu()
13526
- }), Kf = (r, e, t) => {
13532
+ }), Xf = (r, e, t) => {
13527
13533
  const n = iu({ node: r.commentJSON }), i = {
13528
13534
  "w:id": String(e),
13529
13535
  "w:author": r.creatorName || r.importedAuthor?.name,
13530
13536
  "w:email": r.creatorEmail || r.importedAuthor?.email,
13531
13537
  "w:date": nu(r.createdTime),
13532
- "w:initials": $f(r.creatorName),
13538
+ "w:initials": Yf(r.creatorName),
13533
13539
  "w:done": r.resolvedTime ? "1" : "0",
13534
13540
  "w15:paraId": r.commentParaId,
13535
13541
  "custom:internalId": r.commentId || r.internalId,
@@ -13548,7 +13554,7 @@ const Wf = (r, e) => ({
13548
13554
  attributes: i,
13549
13555
  elements: [n]
13550
13556
  };
13551
- }, $f = (r) => r ? r.replace("(imported)", "").trim().split(" ").map((n) => n[0]).join("") : null, nu = (r) => new Date(r || Date.now()).toISOString().replace(/\.\d{3}Z$/, "Z"), Xf = (r = [], e) => {
13557
+ }, Yf = (r) => r ? r.replace("(imported)", "").trim().split(" ").map((n) => n[0]).join("") : null, nu = (r) => new Date(r || Date.now()).toISOString().replace(/\.\d{3}Z$/, "Z"), Qf = (r = [], e) => {
13552
13558
  const t = je(e);
13553
13559
  return r.forEach((n) => {
13554
13560
  n.elements[0].elements.unshift(Mf);
@@ -13567,7 +13573,7 @@ const Wf = (r, e) => ({
13567
13573
  "xmlns:custom": "http://schemas.openxmlformats.org/wordprocessingml/2006/main"
13568
13574
  };
13569
13575
  }), t.elements[0].elements = r, t;
13570
- }, Yf = (r = [], e) => {
13576
+ }, Zf = (r = [], e) => {
13571
13577
  const t = je(e), n = r.map((i) => {
13572
13578
  const s = {
13573
13579
  "w15:paraId": i.commentParaId,
@@ -13584,7 +13590,7 @@ const Wf = (r, e) => ({
13584
13590
  };
13585
13591
  });
13586
13592
  return t.elements[0].elements = n, t;
13587
- }, Qf = (r = [], e, t) => {
13593
+ }, ed = (r = [], e, t) => {
13588
13594
  const n = je(e), i = je(t);
13589
13595
  return n.elements[0].elements = [], i.elements[0].elements = [], r.forEach((s) => {
13590
13596
  const o = tu(), a = {
@@ -13609,13 +13615,13 @@ const Wf = (r, e) => ({
13609
13615
  documentIdsUpdated: n,
13610
13616
  extensibleUpdated: i
13611
13617
  };
13612
- }, Zf = (r) => {
13618
+ }, td = (r) => {
13613
13619
  const e = je(r);
13614
13620
  return e["word/comments.xml"] = xt.COMMENTS_XML_DEF, e["word/commentsExtended.xml"] = xt.COMMENTS_EXTENDED_XML_DEF, e["word/commentsExtensible.xml"] = xt.COMMENTS_EXTENSIBLE_XML_DEF, e["word/commentsIds.xml"] = xt.COMMENTS_IDS_XML_DEF, e["[Content_Types].xml"] = xt.CONTENT_TYPES, e;
13615
- }, ed = (r) => {
13621
+ }, rd = (r) => {
13616
13622
  const e = je(r);
13617
13623
  return delete e["word/comments.xml"], delete e["word/commentsExtended.xml"], delete e["word/commentsExtensible.xml"], delete e["word/commentsIds.xml"], e;
13618
- }, nr = (r) => ({ ...xt.DOCUMENT_RELS_XML_DEF.elements[0].elements.find((n) => n.attributes.Target === r) }), td = ({
13624
+ }, nr = (r) => ({ ...xt.DOCUMENT_RELS_XML_DEF.elements[0].elements.find((n) => n.attributes.Target === r) }), nd = ({
13619
13625
  convertedXml: r,
13620
13626
  defs: e,
13621
13627
  commentsWithParaIds: t,
@@ -13624,16 +13630,16 @@ const Wf = (r, e) => ({
13624
13630
  }) => {
13625
13631
  const s = [];
13626
13632
  if (n === "clean")
13627
- return { documentXml: ed(r), relationships: s };
13628
- const o = Zf(r);
13629
- o["word/comments.xml"] = Xf(
13633
+ return { documentXml: rd(r), relationships: s };
13634
+ const o = td(r);
13635
+ o["word/comments.xml"] = Qf(
13630
13636
  e,
13631
13637
  o["word/comments.xml"]
13632
- ), s.push(nr("comments.xml")), o["word/commentsExtended.xml"] = Yf(
13638
+ ), s.push(nr("comments.xml")), o["word/commentsExtended.xml"] = Zf(
13633
13639
  t,
13634
13640
  o["word/commentsExtended.xml"]
13635
13641
  ), s.push(nr("commentsExtended.xml"));
13636
- const { documentIdsUpdated: a, extensibleUpdated: u } = Qf(
13642
+ const { documentIdsUpdated: a, extensibleUpdated: u } = ed(
13637
13643
  t,
13638
13644
  o["word/commentsIds.xml"],
13639
13645
  o["word/commentsExtensible.xml"]
@@ -13642,7 +13648,7 @@ const Wf = (r, e) => ({
13642
13648
  relationships: s,
13643
13649
  documentXml: o
13644
13650
  };
13645
- }, rd = (r, e) => e ? ["width", `${Math.max(e, r)}px`] : ["min-width", `${r}px`], nd = (r, e, t, n) => {
13651
+ }, id = (r, e) => e ? ["width", `${Math.max(e, r)}px`] : ["min-width", `${r}px`], sd = (r, e, t, n) => {
13646
13652
  let i = 0, s = !0;
13647
13653
  const o = [], a = [], u = r.firstChild;
13648
13654
  if (!u) return {};
@@ -13651,7 +13657,7 @@ const Wf = (r, e) => ({
13651
13657
  for (let w = 0; w < A; w++, T++) {
13652
13658
  const k = t === T ? n : B && B[w];
13653
13659
  i += k || e, k || (s = !1);
13654
- const [I, C] = rd(e, k);
13660
+ const [I, C] = id(e, k);
13655
13661
  o.push(["col", { style: `${I}: ${C}` }]), a.push(parseInt(C, 10));
13656
13662
  }
13657
13663
  }
@@ -13665,28 +13671,28 @@ const Wf = (r, e) => ({
13665
13671
  };
13666
13672
  function Pt(r) {
13667
13673
  const { type: e } = r.node || {}, t = {
13668
- doc: od,
13669
- body: id,
13674
+ doc: ud,
13675
+ body: od,
13670
13676
  paragraph: iu,
13671
- text: ad,
13677
+ text: ld,
13672
13678
  bulletList: So,
13673
13679
  orderedList: So,
13674
- lineBreak: pd,
13675
- table: hd,
13676
- tableRow: Ad,
13677
- tableCell: Ed,
13678
- bookmarkStart: Sd,
13679
- fieldAnnotation: Pd,
13680
- tab: wd,
13680
+ lineBreak: wd,
13681
+ table: yd,
13682
+ tableRow: vd,
13683
+ tableCell: Sd,
13684
+ bookmarkStart: Bd,
13685
+ fieldAnnotation: _d,
13686
+ tab: xd,
13681
13687
  image: au,
13682
- hardBreak: Od,
13688
+ hardBreak: qd,
13683
13689
  commentRangeStart: () => vo(r, "Start"),
13684
13690
  commentRangeEnd: () => vo(r, "End"),
13685
13691
  commentReference: () => null
13686
13692
  };
13687
13693
  return t[e] ? t[e](r) : (console.error("No translation function found for node type:", e), null);
13688
13694
  }
13689
- function id(r) {
13695
+ function od(r) {
13690
13696
  const e = r.bodyNode?.elements.find((n) => n.name === "w:sectPr") || {};
13691
13697
  if (r.converter) {
13692
13698
  const n = r.converter.pageStyles.pageMargins, i = e.elements.find((o) => o.name === "w:pgMar"), { attributes: s } = i;
@@ -13704,7 +13710,7 @@ function iu(r) {
13704
13710
  const e = Ot(r), t = e.find((s) => s.name === "htmlAnnotation");
13705
13711
  if (e.length === 1 && t)
13706
13712
  return t.elements;
13707
- const n = sd(r.node);
13713
+ const n = ad(r.node);
13708
13714
  n && e.unshift(n);
13709
13715
  let i = {};
13710
13716
  return r.node.attrs?.rsidRDefault && (i["w:rsidRDefault"] = r.node.attrs.rsidRDefault), {
@@ -13713,7 +13719,7 @@ function iu(r) {
13713
13719
  attributes: i
13714
13720
  };
13715
13721
  }
13716
- function sd(r) {
13722
+ function ad(r) {
13717
13723
  const { attrs: e = {} } = r, t = [], { styleId: n } = e;
13718
13724
  n && t.push({ name: "w:pStyle", attributes: { "w:val": n } });
13719
13725
  const { spacing: i, indent: s, textAlign: o, textIndent: a, marksAttrs: u, keepLines: f, keepNext: c } = e;
@@ -13765,7 +13771,7 @@ function sd(r) {
13765
13771
  elements: t
13766
13772
  } : null;
13767
13773
  }
13768
- function od(r) {
13774
+ function ud(r) {
13769
13775
  const e = {
13770
13776
  type: "body",
13771
13777
  content: r.node.content
@@ -13793,14 +13799,14 @@ function Fr(r, e) {
13793
13799
  attributes: i
13794
13800
  }, s);
13795
13801
  }
13796
- function ad(r) {
13802
+ function ld(r) {
13797
13803
  const { node: e } = r, t = [yr, Ii];
13798
- if (e.marks?.some((a) => t.includes(a.type))) return ld(r);
13799
- if (e.marks?.some((a) => a.type === "link")) return cd(r);
13804
+ if (e.marks?.some((a) => t.includes(a.type))) return fd(r);
13805
+ if (e.marks?.some((a) => a.type === "link")) return dd(r);
13800
13806
  const { text: s, marks: o = [] } = e;
13801
13807
  return Fr(s, o);
13802
13808
  }
13803
- function ud(r) {
13809
+ function cd(r) {
13804
13810
  const e = r.find((t) => t.type === Ri);
13805
13811
  if (e)
13806
13812
  return {
@@ -13815,8 +13821,8 @@ function ud(r) {
13815
13821
  elements: e.attrs.before.map((n) => Br([n])).filter((n) => n !== void 0)
13816
13822
  };
13817
13823
  }
13818
- function ld(r) {
13819
- const { node: e } = r, t = e.marks, n = [yr, Ii, Ri], i = t.find((f) => n.includes(f.type)), s = i.type === yr, o = ud(t);
13824
+ function fd(r) {
13825
+ const { node: e } = r, t = e.marks, n = [yr, Ii, Ri], i = t.find((f) => n.includes(f.type)), s = i.type === yr, o = cd(t);
13820
13826
  e.marks = t.filter((f) => !n.includes(f.type)), o && e.marks.push(o);
13821
13827
  const a = Pt({ ...r, node: e });
13822
13828
  if (!s) {
@@ -13854,7 +13860,7 @@ function Br(r = []) {
13854
13860
  return To(i);
13855
13861
  }) : To(e));
13856
13862
  }
13857
- function cd(r) {
13863
+ function dd(r) {
13858
13864
  const { node: e } = r, t = e.marks.find((a) => a.type === "link"), n = t.attrs.href;
13859
13865
  let i = t.attrs.rId;
13860
13866
  i || (i = ou(r, n)), e.marks = e.marks.filter((a) => a.type !== "link");
@@ -13894,9 +13900,9 @@ function Co(r, e) {
13894
13900
  return r.relationships.push(n), t;
13895
13901
  }
13896
13902
  function So(r) {
13897
- const { type: e } = r.node, t = md(r), n = [];
13903
+ const { type: e } = r.node, t = gd(r), n = [];
13898
13904
  return t.forEach((i) => {
13899
- const { level: s, listType: o, pPrs: a, content: u, attrs: f = {} } = i, g = (i.attrs.numId || i.listId) ?? fd(r), S = dd(s, g, a);
13905
+ const { level: s, listType: o, pPrs: a, content: u, attrs: f = {} } = i, g = (i.attrs.numId || i.listId) ?? md(r, o), S = hd(s, g, a);
13900
13906
  u.forEach((T, A) => {
13901
13907
  const B = Object.assign({}, T);
13902
13908
  B.attrs = {
@@ -13927,30 +13933,22 @@ function So(r) {
13927
13933
  });
13928
13934
  }), n;
13929
13935
  }
13930
- function fd({ abstractId: r, listId: e }) {
13931
- const t = {
13932
- ...definition,
13933
- attributes: {
13934
- ...definition.attributes,
13935
- "w:abstractNumId": r
13936
- }
13937
- }, n = {
13936
+ function md(r, e) {
13937
+ const t = pd(r.converter?.numbering?.definitions), n = e === "bullet" ? Jf : Wf, i = t, s = n.attributes["w:abstractNumId"], o = {
13938
13938
  type: "element",
13939
13939
  name: "w:num",
13940
13940
  attributes: {
13941
- "w:numId": String(r),
13941
+ "w:numId": String(i),
13942
13942
  "w16cid:durableId": "485517411"
13943
13943
  },
13944
13944
  elements: [
13945
- { name: "w:abstractNumId", attributes: { "w:val": String(e) } }
13945
+ { name: "w:abstractNumId", attributes: { "w:val": String(s) } }
13946
13946
  ]
13947
13947
  };
13948
- return {
13949
- newAbstractDef: t,
13950
- newNumDef: n
13951
- };
13948
+ return r.converter.numbering.definitions[i] = o, i;
13952
13949
  }
13953
- function dd(r, e, t = []) {
13950
+ const pd = (r) => !r || !Object.keys(r).length ? 0 : Math.max(...Object.keys(r).map((t) => parseInt(t, 10))) + 1;
13951
+ function hd(r, e, t = []) {
13954
13952
  return {
13955
13953
  name: "w:pPr",
13956
13954
  type: "element",
@@ -13975,7 +13973,7 @@ function dd(r, e, t = []) {
13975
13973
  ]
13976
13974
  };
13977
13975
  }
13978
- function md({ node: r }) {
13976
+ function gd({ node: r }) {
13979
13977
  const { content: e, attrs: t = {} } = r, { listId: n, syncId: i } = r.attrs || {}, s = r.attrs["list-style-type"], { attributes: o = {} } = t, a = o?.parentAttributes?.paragraphProperties?.elements?.filter((c) => c.name !== "w:numPr") || [], u = [];
13980
13978
  function f(c, h = 0) {
13981
13979
  !c || !c.length || c.forEach((g) => {
@@ -13996,22 +13994,22 @@ function md({ node: r }) {
13996
13994
  }
13997
13995
  return f(e), u;
13998
13996
  }
13999
- function pd(r) {
13997
+ function wd(r) {
14000
13998
  const e = {}, { lineBreakType: t } = r.node?.attrs || {};
14001
13999
  return t && (e["w:type"] = t), {
14002
14000
  name: "w:br",
14003
14001
  attributes: e
14004
14002
  };
14005
14003
  }
14006
- function hd(r) {
14007
- r.node = gd(r.node, r);
14008
- const e = Ot(r), t = yd(r.node), n = xd(r.node, r);
14004
+ function yd(r) {
14005
+ r.node = bd(r.node, r);
14006
+ const e = Ot(r), t = Ad(r.node), n = Ed(r.node, r);
14009
14007
  return e.unshift(t), e.unshift(n), {
14010
14008
  name: "w:tbl",
14011
14009
  elements: e
14012
14010
  };
14013
14011
  }
14014
- function gd(r, { editorSchema: e }) {
14012
+ function bd(r, { editorSchema: e }) {
14015
14013
  const { content: t } = r;
14016
14014
  for (let n = 0; n < t.length; n++) {
14017
14015
  const i = t[n];
@@ -14047,13 +14045,13 @@ function gd(r, { editorSchema: e }) {
14047
14045
  }
14048
14046
  return r;
14049
14047
  }
14050
- function wd(r) {
14048
+ function xd(r) {
14051
14049
  const { marks: e = [] } = r.node, t = Br(e);
14052
14050
  return Pi({
14053
14051
  name: "w:tab"
14054
14052
  }, t);
14055
14053
  }
14056
- function yd(r) {
14054
+ function Ad(r) {
14057
14055
  const e = [], { attrs: t } = r, { tableWidth: n, tableWidthType: i, tableStyleId: s, borders: o, tableIndent: a, tableLayout: u, tableCellSpacing: f } = t;
14058
14056
  if (s) {
14059
14057
  const c = {
@@ -14063,7 +14061,7 @@ function yd(r) {
14063
14061
  e.push(c);
14064
14062
  }
14065
14063
  if (o) {
14066
- const c = bd(r);
14064
+ const c = Dd(r);
14067
14065
  e.push(c);
14068
14066
  }
14069
14067
  if (a) {
@@ -14098,7 +14096,7 @@ function yd(r) {
14098
14096
  elements: e
14099
14097
  };
14100
14098
  }
14101
- function bd(r) {
14099
+ function Dd(r) {
14102
14100
  const { borders: e } = r.attrs, t = [];
14103
14101
  return e ? (["top", "bottom", "left", "right", "insideH", "insideV"].forEach((i) => {
14104
14102
  const s = e[i];
@@ -14122,11 +14120,11 @@ function bd(r) {
14122
14120
  elements: t
14123
14121
  }) : void 0;
14124
14122
  }
14125
- function xd(r, e) {
14123
+ function Ed(r, e) {
14126
14124
  const { editorSchema: t } = e;
14127
14125
  let n = [];
14128
14126
  try {
14129
- const s = t.nodeFromJSON(r), o = 25, { colgroupValues: a } = nd(
14127
+ const s = t.nodeFromJSON(r), o = 25, { colgroupValues: a } = sd(
14130
14128
  s,
14131
14129
  o
14132
14130
  );
@@ -14145,14 +14143,14 @@ function xd(r, e) {
14145
14143
  elements: i
14146
14144
  };
14147
14145
  }
14148
- function Ad(r) {
14149
- const e = Ot(r), t = Dd(r.node);
14146
+ function vd(r) {
14147
+ const e = Ot(r), t = Cd(r.node);
14150
14148
  return t.elements.length && e.unshift(t), {
14151
14149
  name: "w:tr",
14152
14150
  elements: e
14153
14151
  };
14154
14152
  }
14155
- function Dd(r) {
14153
+ function Cd(r) {
14156
14154
  const { attrs: e } = r, t = [], { rowHeight: n, rowHeightType: i } = e;
14157
14155
  if (n) {
14158
14156
  const s = { "w:val": Se(n) };
@@ -14168,17 +14166,17 @@ function Dd(r) {
14168
14166
  elements: t
14169
14167
  };
14170
14168
  }
14171
- function Ed(r) {
14169
+ function Sd(r) {
14172
14170
  const e = Ot({
14173
14171
  ...r,
14174
14172
  tableCell: r.node
14175
- }), t = vd(r.node);
14173
+ }), t = Td(r.node);
14176
14174
  return e.unshift(t), {
14177
14175
  name: "w:tc",
14178
14176
  elements: e
14179
14177
  };
14180
14178
  }
14181
- function vd(r) {
14179
+ function Td(r) {
14182
14180
  const e = [], { attrs: t } = r, { colwidth: n = [], cellWidthType: i = "dxa", background: s = {}, colspan: o, rowspan: a, widthUnit: u } = t, f = n.reduce((A, B) => A + B, 0), c = {
14183
14181
  name: "w:tcW",
14184
14182
  attributes: { "w:w": u === "px" ? Se(f) : Ft(f), "w:type": i }
@@ -14202,7 +14200,7 @@ function vd(r) {
14202
14200
  if (g) {
14203
14201
  const A = {
14204
14202
  name: "w:tcMar",
14205
- elements: Cd(g)
14203
+ elements: Fd(g)
14206
14204
  };
14207
14205
  e.push(A);
14208
14206
  }
@@ -14254,11 +14252,11 @@ function vd(r) {
14254
14252
  elements: e
14255
14253
  };
14256
14254
  }
14257
- function Cd(r) {
14255
+ function Fd(r) {
14258
14256
  const e = [], { top: t, right: n, bottom: i, left: s } = r;
14259
14257
  return t != null && e.push({ name: "w:top", attributes: { "w:w": Se(t) } }), n != null && e.push({ name: "w:right", attributes: { "w:w": Se(n) } }), i != null && e.push({ name: "w:bottom", attributes: { "w:w": Se(i) } }), s != null && e.push({ name: "w:left", attributes: { "w:w": Se(s) } }), e;
14260
14258
  }
14261
- function Sd(r) {
14259
+ function Bd(r) {
14262
14260
  const e = {
14263
14261
  name: "w:bookmarkStart",
14264
14262
  attributes: {
@@ -14314,7 +14312,7 @@ function To(r) {
14314
14312
  }
14315
14313
  return t;
14316
14314
  }
14317
- function Td(r) {
14315
+ function kd(r) {
14318
14316
  if (!r) return {};
14319
14317
  const e = r.split(";")[0].split("/")[1];
14320
14318
  if (!r || e !== "png")
@@ -14328,7 +14326,7 @@ function Td(r) {
14328
14326
  originalHeight: i.getInt32(20)
14329
14327
  };
14330
14328
  }
14331
- function Fd(r, e, t, n) {
14329
+ function Nd(r, e, t, n) {
14332
14330
  let i = r, s = e, o = Math.min(t / r, n / e);
14333
14331
  return i = Math.round(i * o), s = Math.round(s * o), { scaledWidth: i, scaledHeight: s };
14334
14332
  }
@@ -14338,20 +14336,20 @@ function au(r, e) {
14338
14336
  tableCell: i
14339
14337
  } = r;
14340
14338
  let s = t.rId;
14341
- const o = t.src || t.imageSrc, { originalWidth: a, originalHeight: u } = Td(o);
14339
+ const o = t.src || t.imageSrc, { originalWidth: a, originalHeight: u } = kd(o);
14342
14340
  let f = t.size ? {
14343
14341
  w: qt(t.size.width),
14344
14342
  h: qt(t.size.height)
14345
14343
  } : e;
14346
14344
  if (a && u) {
14347
- const S = $e(f.w), T = $e(f.h), { scaledWidth: A, scaledHeight: B } = Fd(a, u, S, T);
14345
+ const S = $e(f.w), T = $e(f.h), { scaledWidth: A, scaledHeight: B } = Nd(a, u, S, T);
14348
14346
  f = {
14349
14347
  w: qt(A),
14350
14348
  h: qt(B)
14351
14349
  };
14352
14350
  }
14353
14351
  if (i) {
14354
- const S = i.attrs.colwidth.reduce((I, C) => I + C, 0), T = i.attrs.cellMargins?.left || 8, A = i.attrs.cellMargins?.right || 8, B = qt(S - (T + A)), { width: w, height: k } = Ld(f.w, f.h, B);
14352
+ const S = i.attrs.colwidth.reduce((I, C) => I + C, 0), T = i.attrs.cellMargins?.left || 8, A = i.attrs.cellMargins?.right || 8, B = qt(S - (T + A)), { width: w, height: k } = Md(f.w, f.h, B);
14355
14353
  w && k && (f = { w, h: k });
14356
14354
  }
14357
14355
  if (r.node.type === "image" && !s) {
@@ -14518,16 +14516,16 @@ function au(r, e) {
14518
14516
  function uu(r) {
14519
14517
  const {
14520
14518
  node: { attrs: e = {}, marks: t = [] }
14521
- } = r, n = Rd(e);
14519
+ } = r, n = Ld(e);
14522
14520
  return Fr(e.displayLabel, [...t, ...n]);
14523
14521
  }
14524
- function Bd(r) {
14522
+ function Id(r) {
14525
14523
  const {
14526
14524
  node: { attrs: e = {}, marks: t = [] }
14527
14525
  } = r, n = kc.decode(e.displayLabel);
14528
14526
  return Fr(n, t);
14529
14527
  }
14530
- function kd(r) {
14528
+ function Rd(r) {
14531
14529
  const {
14532
14530
  node: { attrs: e = {} }
14533
14531
  } = r, n = new window.DOMParser().parseFromString(e.rawHtml, "text/html"), s = At.create({
@@ -14536,6 +14534,7 @@ function kd(r) {
14536
14534
  return {
14537
14535
  name: "htmlAnnotation",
14538
14536
  elements: Ot({
14537
+ ...r,
14539
14538
  node: s
14540
14539
  })
14541
14540
  };
@@ -14543,7 +14542,7 @@ function kd(r) {
14543
14542
  function Fo(r, e) {
14544
14543
  return au(r, e);
14545
14544
  }
14546
- function Nd(r) {
14545
+ function Pd(r) {
14547
14546
  const {
14548
14547
  node: { attrs: e = {}, marks: t = [] }
14549
14548
  } = r, n = ou(r, e.linkUrl), i = Fr(e.linkUrl, t);
@@ -14557,7 +14556,7 @@ function Nd(r) {
14557
14556
  elements: [i]
14558
14557
  };
14559
14558
  }
14560
- function Id(r) {
14559
+ function Od(r) {
14561
14560
  const e = {
14562
14561
  w: 4286250,
14563
14562
  h: 4286250
@@ -14569,12 +14568,12 @@ function Id(r) {
14569
14568
  text: uu,
14570
14569
  image: (i) => Fo(i, e),
14571
14570
  signature: (i) => Fo(i, t),
14572
- checkbox: Bd,
14573
- html: kd,
14574
- link: Nd
14571
+ checkbox: Id,
14572
+ html: Rd,
14573
+ link: Pd
14575
14574
  }[r];
14576
14575
  }
14577
- const Rd = (r = {}) => {
14576
+ const Ld = (r = {}) => {
14578
14577
  const {
14579
14578
  fontFamily: e,
14580
14579
  fontSize: t,
@@ -14584,8 +14583,8 @@ const Rd = (r = {}) => {
14584
14583
  } = r, o = [];
14585
14584
  return e && o.push({ type: "fontFamily", attrs: { fontFamily: e } }), t && o.push({ type: "fontSize", attrs: { fontSize: t } }), n && o.push({ type: "bold", attrs: {} }), i && o.push({ type: "underline", attrs: {} }), s && o.push({ type: "italic", attrs: {} }), o;
14586
14585
  };
14587
- function Pd(r) {
14588
- const { node: e, isFinalDoc: t } = r, { attrs: n = {} } = e, i = Id(n.type);
14586
+ function _d(r) {
14587
+ const { node: e, isFinalDoc: t } = r, { attrs: n = {} } = e, i = Od(n.type);
14589
14588
  if (!i) return {};
14590
14589
  let s, o;
14591
14590
  if (t)
@@ -14637,7 +14636,7 @@ function Pd(r) {
14637
14636
  ]
14638
14637
  };
14639
14638
  }
14640
- function Od() {
14639
+ function qd() {
14641
14640
  return {
14642
14641
  name: "w:r",
14643
14642
  elements: [{
@@ -14689,28 +14688,28 @@ nt = new WeakSet(), lu = function(e, t = falase) {
14689
14688
  }
14690
14689
  return a || u.push(`</${n}>`), u;
14691
14690
  };
14692
- function Ld(r, e, t) {
14691
+ function Md(r, e, t) {
14693
14692
  if (r > t) {
14694
14693
  let n = t / r, i = Math.round(e * n);
14695
14694
  return { width: t, height: i };
14696
14695
  }
14697
14696
  return { width: r, height: e };
14698
14697
  }
14699
- const _d = '<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:oel="http://schemas.microsoft.com/office/2019/extlst" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14"><w:body></w:body></w:document>', qd = (r) => JSON.parse(ya.xml2json(r, null, 2)), Md = (r, e = _d) => r["word/document.xml"] || qd(e), Ud = (r) => {
14698
+ const Ud = '<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:oel="http://schemas.microsoft.com/office/2019/extlst" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14"><w:body></w:body></w:document>', jd = (r) => JSON.parse(ya.xml2json(r, null, 2)), Hd = (r, e = Ud) => r["word/document.xml"] || jd(e), Vd = (r) => {
14700
14699
  const { nodes: e } = r;
14701
14700
  if (e.length === 0)
14702
14701
  return { nodes: [], consumed: 0 };
14703
14702
  const t = e[0];
14704
14703
  switch (t.name) {
14705
14704
  case "w:tbl":
14706
- return { nodes: [Hd(t, r)], consumed: 1 };
14705
+ return { nodes: [Gd(t, r)], consumed: 1 };
14707
14706
  }
14708
14707
  return { nodes: [], consumed: 0 };
14709
- }, jd = {
14708
+ }, zd = {
14710
14709
  handlerName: "tableNodeHandler",
14711
- handler: Ud
14710
+ handler: Vd
14712
14711
  };
14713
- function Hd(r, e) {
14712
+ function Gd(r, e) {
14714
14713
  const { docx: t, nodeListHandler: n } = e, i = r.elements.find((F) => F.name === "w:tblPr"), o = i.elements.find((F) => F.name === "w:tblBorders")?.elements || [], { borders: a, rowBorders: u } = fu(o), f = i.elements.find((F) => F.name === "w:tblStyle"), h = { tableStyleId: f?.attributes["w:val"] }, g = i?.elements.find((F) => F.name === "w:tblInd");
14715
14714
  if (g) {
14716
14715
  const { "w:w": F, "w:type": N } = g.attributes;
@@ -14735,7 +14734,7 @@ function Hd(r, e) {
14735
14734
  h.borders = k;
14736
14735
  const C = [];
14737
14736
  return w.forEach((F) => {
14738
- const N = Gd(F, r, I, f, e);
14737
+ const N = Kd(F, r, I, f, e);
14739
14738
  N.content?.length && C.push(N);
14740
14739
  }), {
14741
14740
  type: "table",
@@ -14743,15 +14742,15 @@ function Hd(r, e) {
14743
14742
  attrs: h
14744
14743
  };
14745
14744
  }
14746
- function Vd(r, e, t, n, i = null, s, o, a) {
14747
- const { docx: u, nodeListHandler: f } = o, c = r.elements.find((ae) => ae.name === "w:tcPr"), h = c?.elements?.find((ae) => ae.name === "w:tcBorders"), g = zd(h, n), S = du(t), T = c?.elements?.find((ae) => ae.name === "w:tcW");
14745
+ function Wd(r, e, t, n, i = null, s, o, a) {
14746
+ const { docx: u, nodeListHandler: f } = o, c = r.elements.find((ae) => ae.name === "w:tcPr"), h = c?.elements?.find((ae) => ae.name === "w:tcBorders"), g = Jd(h, n), S = du(t), T = c?.elements?.find((ae) => ae.name === "w:tcW");
14748
14747
  let A = T ? xe(T.attributes["w:w"]) : null;
14749
14748
  const B = T?.attributes["w:type"];
14750
14749
  !A && i && (A = i);
14751
14750
  const w = ko(r), { attributes: k } = w || {}, C = {
14752
14751
  color: c?.elements?.find((ae) => ae.name === "w:shd")?.attributes["w:fill"]
14753
14752
  }, N = c?.elements?.find((ae) => ae.name === "w:gridSpan")?.attributes["w:val"], q = c?.elements?.find((ae) => ae.name === "w:tcMar"), D = c?.elements?.find((ae) => ae.name === "w:vAlign")?.attributes["w:val"] || "top", K = {}, oe = cu(s, u) || {};
14754
- K.cellMargins = Wd(q, oe);
14753
+ K.cellMargins = $d(q, oe);
14755
14754
  const { fontSize: ee, fonts: Q = {} } = oe, ce = Q.ascii;
14756
14755
  if (A) {
14757
14756
  K.colwidth = [A], K.widthUnit = "px";
@@ -14797,7 +14796,7 @@ const ko = (r) => r.elements.find((n) => n.name === "w:tcPr")?.elements?.find((n
14797
14796
  return Object.keys(i) ? (i.val = "none", i) : null;
14798
14797
  }
14799
14798
  return null;
14800
- }, zd = (r, e) => {
14799
+ }, Jd = (r, e) => {
14801
14800
  if (!r) return null;
14802
14801
  const t = {}, n = ir(r, "bottom", e);
14803
14802
  n && (t.bottom = n);
@@ -14865,7 +14864,7 @@ function fu(r) {
14865
14864
  rowBorders: t
14866
14865
  };
14867
14866
  }
14868
- function Gd(r, e, t, n, i) {
14867
+ function Kd(r, e, t, n, i) {
14869
14868
  const s = {}, a = r.elements.find((T) => T.name === "w:trPr")?.elements?.find((T) => T.name === "w:trHeight"), u = a?.attributes["w:val"];
14870
14869
  a?.attributes["w:hRule"];
14871
14870
  const f = {};
@@ -14875,12 +14874,12 @@ function Gd(r, e, t, n, i) {
14875
14874
  type: "tableRow",
14876
14875
  content: h?.map((T, A) => {
14877
14876
  const B = h.length > 1 ? c[A] : null;
14878
- return Vd(T, r, e, f, B, n, i, A);
14877
+ return Wd(T, r, e, f, B, n, i, A);
14879
14878
  }) || [],
14880
14879
  attrs: s
14881
14880
  };
14882
14881
  }
14883
- const Wd = (r, e) => {
14882
+ const $d = (r, e) => {
14884
14883
  const t = r?.elements?.find((B) => B.name === "w:left"), n = r?.elements?.find((B) => B.name === "w:right"), i = r?.elements?.find((B) => B.name === "w:top"), s = r?.elements?.find((B) => B.name === "w:bottom"), o = t?.attributes["w:w"], a = n?.attributes["w:w"], u = i?.attributes["w:w"], f = s?.attributes["w:w"], { cellMargins: c = {} } = e, {
14885
14884
  marginLeft: h,
14886
14885
  marginRight: g,
@@ -14893,7 +14892,7 @@ const Wd = (r, e) => {
14893
14892
  top: xe(u ?? S),
14894
14893
  bottom: xe(f ?? T)
14895
14894
  };
14896
- }, du = (r) => r.elements.find((t) => t.name === "w:tblGrid")?.elements?.flatMap((t) => t.name !== "w:gridCol" ? [] : xe(t.attributes["w:w"])) || [], Jd = (r) => {
14895
+ }, du = (r) => r.elements.find((t) => t.name === "w:tblGrid")?.elements?.flatMap((t) => t.name !== "w:gridCol" ? [] : xe(t.attributes["w:w"])) || [], Xd = (r) => {
14897
14896
  const { nodes: e, filename: t } = r;
14898
14897
  if (e.length === 0 || e[0].name !== "w:drawing")
14899
14898
  return { nodes: [], consumed: 0 };
@@ -14941,9 +14940,9 @@ function No(r, e, t) {
14941
14940
  }
14942
14941
  };
14943
14942
  }
14944
- const Kd = {
14943
+ const Yd = {
14945
14944
  handlerName: "drawingNodeHandler",
14946
- handler: Jd
14945
+ handler: Xd
14947
14946
  };
14948
14947
  function Bt(r, e = [], t = null) {
14949
14948
  const n = [], i = /* @__PURE__ */ new Set();
@@ -14968,7 +14967,7 @@ function Bt(r, e = [], t = null) {
14968
14967
  const { attributes: u = {} } = s, f = { type: a.type };
14969
14968
  if (!(u["w:val"] == "0" || u["w:val"] === "none")) {
14970
14969
  if (a.mark && (f.type = a.mark), Object.keys(u).length) {
14971
- const c = Xd(a.type, u, t);
14970
+ const c = Zd(a.type, u, t);
14972
14971
  if (c == null) return;
14973
14972
  f.attrs = {}, f.attrs[a.property] = c;
14974
14973
  }
@@ -14977,7 +14976,7 @@ function Bt(r, e = [], t = null) {
14977
14976
  });
14978
14977
  }), hi(n);
14979
14978
  }
14980
- function $d(r, e) {
14979
+ function Qd(r, e) {
14981
14980
  const t = r.elements?.find((o) => o.name === "w:rPrChange");
14982
14981
  if (!t)
14983
14982
  return [];
@@ -14998,25 +14997,25 @@ function hi(r) {
14998
14997
  });
14999
14998
  }), [...t, { type: "textStyle", attrs: n }];
15000
14999
  }
15001
- function Xd(r, e, t) {
15000
+ function Zd(r, e, t) {
15002
15001
  r === "tabs" && (r = "textIndent");
15003
15002
  const n = {
15004
15003
  color: () => `#${e["w:val"]}`,
15005
15004
  fontSize: () => `${e["w:val"] / 2}pt`,
15006
- textIndent: () => Qd(e),
15007
- fontFamily: () => Yd(e, t),
15008
- lineHeight: () => Zd(e),
15005
+ textIndent: () => tm(e),
15006
+ fontFamily: () => em(e, t),
15007
+ lineHeight: () => rm(e),
15009
15008
  textAlign: () => e["w:val"],
15010
15009
  link: () => e.href,
15011
15010
  underline: () => e["w:val"],
15012
15011
  bold: () => e?.["w:val"] || null,
15013
15012
  italic: () => e?.["w:val"] || null,
15014
- highlight: () => em(e)
15013
+ highlight: () => nm(e)
15015
15014
  };
15016
15015
  if (r in n || console.debug("❗️❗️ No value mapper for:", r, "Attributes:", e), r in n)
15017
15016
  return n[r], n[r]();
15018
15017
  }
15019
- function Yd(r, e) {
15018
+ function em(r, e) {
15020
15019
  const t = r["w:ascii"], n = r["w:asciiTheme"];
15021
15020
  if (!e || !n) return t;
15022
15021
  const i = e["word/theme/theme1.xml"];
@@ -15024,20 +15023,20 @@ function Yd(r, e) {
15024
15023
  const { elements: s } = i, { elements: o } = s[0];
15025
15024
  return o.find((g) => g.name === "a:themeElements").elements.find((g) => g.name === "a:fontScheme").elements.find((g) => g.name === "a:majorFont").elements.find((g) => g.name === "a:latin").attributes.typeface;
15026
15025
  }
15027
- function Qd(r) {
15026
+ function tm(r) {
15028
15027
  let e = r["w:left"];
15029
15028
  return e ? `${qe(e)}in` : null;
15030
15029
  }
15031
- function Zd(r) {
15030
+ function rm(r) {
15032
15031
  let e = r["w:line"];
15033
15032
  return !e || e === "0" ? null : `${ki(e)}`;
15034
15033
  }
15035
- function em(r) {
15034
+ function nm(r) {
15036
15035
  return r["w:fill"] ? `#${r["w:fill"]}` : Rf(r?.["w:val"]) ? `#${r["w:val"]}` : If(r?.["w:val"]) || null;
15037
15036
  }
15038
15037
  function Lt(r, e) {
15039
- const t = [], n = [], { attributes: i = {}, elements: s = [] } = r, { nodes: o, paragraphProperties: a = {}, runProperties: u = {} } = tm(s);
15040
- return s.find((c) => c.name === "w:r") && (a.elements = a?.elements?.filter((c) => c.name !== "w:rPr")), u && u?.elements?.length && t.push(...Bt(u, n)), a && a.elements?.length && t.push(...Bt(a, n)), t.push(...$d(u, t)), a && a.elements?.length && (i.paragraphProperties = a), t && r.name === "w:p" && t.forEach((c) => {
15038
+ const t = [], n = [], { attributes: i = {}, elements: s = [] } = r, { nodes: o, paragraphProperties: a = {}, runProperties: u = {} } = im(s);
15039
+ return s.find((c) => c.name === "w:r") && (a.elements = a?.elements?.filter((c) => c.name !== "w:rPr")), u && u?.elements?.length && t.push(...Bt(u, n)), a && a.elements?.length && t.push(...Bt(a, n)), t.push(...Qd(u, t)), a && a.elements?.length && (i.paragraphProperties = a), t && r.name === "w:p" && t.forEach((c) => {
15041
15040
  const h = Object.keys(c.attrs ?? {})[0];
15042
15041
  if (h) {
15043
15042
  const g = c.attrs[h];
@@ -15045,7 +15044,7 @@ function Lt(r, e) {
15045
15044
  }
15046
15045
  }), { elements: o, attributes: i, marks: t, unknownMarks: n };
15047
15046
  }
15048
- function tm(r) {
15047
+ function im(r) {
15049
15048
  const e = r.find((s) => s.name === "w:pPr"), t = r.find((s) => s.name === "w:rPr"), n = r.find((s) => s.name === "w:sectPr");
15050
15049
  return {
15051
15050
  nodes: r.filter((s) => s.name !== "w:pPr" && s.name !== "w:rPr" && s.name !== "w:sectPr"),
@@ -15057,11 +15056,11 @@ function tm(r) {
15057
15056
  function lr(r) {
15058
15057
  return Nt.allowedElements[r.name || r.type];
15059
15058
  }
15060
- const rm = (r) => !!Nt.propertyTypes[r.name || r.type];
15059
+ const sm = (r) => !!Nt.propertyTypes[r.name || r.type];
15061
15060
  function mu(r) {
15062
15061
  return r.filter((n) => n.name === "w:r").some((n) => n.elements.some((i) => i.name === "w:t"));
15063
15062
  }
15064
- const nm = (r) => {
15063
+ const om = (r) => {
15065
15064
  const { nodes: e, nodeListHandler: t } = r;
15066
15065
  if (e.length === 0 || !(e[0].name === "w:del" || e[0].name === "w:ins"))
15067
15066
  return { nodes: [], consumed: 0 };
@@ -15074,10 +15073,10 @@ const nm = (r) => {
15074
15073
  return a.forEach((c) => {
15075
15074
  c.marks === void 0 && (c.marks = []), c.marks.push({ type: u, attrs: f });
15076
15075
  }), { nodes: a, consumed: 1 };
15077
- }, im = {
15076
+ }, am = {
15078
15077
  handlerName: "trackChangeNodeHandler",
15079
- handler: nm
15080
- }, sm = (r) => {
15078
+ handler: om
15079
+ }, um = (r) => {
15081
15080
  const { nodes: e, docx: t, nodeListHandler: n } = r;
15082
15081
  if (e.length === 0 || e[0].name !== "w:hyperlink")
15083
15082
  return { nodes: [], consumed: 0 };
@@ -15096,31 +15095,31 @@ const nm = (r) => {
15096
15095
  }
15097
15096
  }
15098
15097
  return { nodes: n.handler({ ...r, nodes: T }), consumed: 1 };
15099
- }, om = {
15098
+ }, lm = {
15100
15099
  handlerName: "hyperlinkNodeHandler",
15101
- handler: sm
15102
- }, am = (r) => {
15100
+ handler: um
15101
+ }, cm = (r) => {
15103
15102
  const { nodes: e, nodeListHandler: t, parentStyleId: n, docx: i } = r;
15104
15103
  if (e.length === 0 || e[0].name !== "w:r")
15105
15104
  return { nodes: [], consumed: 0 };
15106
15105
  const s = e[0], o = { ...r, nodes: s.elements };
15107
15106
  let a = t.handler(o)?.filter((c) => c) || [];
15108
- const u = s.elements?.some((c) => c.name === "w:rPr"), f = um(i, n);
15107
+ const u = s.elements?.some((c) => c.name === "w:rPr"), f = fm(i, n);
15109
15108
  if (u) {
15110
15109
  const { marks: c = [], attributes: h = {} } = Lt(s), g = c.find((T) => T.type === "textStyle"), S = g && Object.keys(g.attrs).length > 0;
15111
15110
  f.marks && !S && c.push(...f.marks), s.marks && c.push(...s.marks), a = a.map((T) => ({ ...T, marks: hi(c), attributes: h }));
15112
15111
  } else f.marks && (a = a.map((c) => ({ ...c, marks: hi(f.marks) })));
15113
15112
  return { nodes: a, consumed: 1 };
15114
- }, um = (r, e) => {
15113
+ }, fm = (r, e) => {
15115
15114
  const t = r?.["word/styles.xml"];
15116
15115
  if (!t)
15117
15116
  return {};
15118
15117
  const i = t.elements[0].elements.filter((s) => s.name === "w:style").find((s) => s.attributes["w:styleId"] === e) || {};
15119
15118
  return i ? Lt(i) : {};
15120
- }, lm = {
15119
+ }, dm = {
15121
15120
  handlerName: "runNodeHandler",
15122
- handler: am
15123
- }, cm = (r) => {
15121
+ handler: cm
15122
+ }, mm = (r) => {
15124
15123
  const { nodes: e, insideTrackChange: t } = r;
15125
15124
  if (e.length === 0 || !(e[0].name === "w:t" || t && e[0].name === "w:delText"))
15126
15125
  return { nodes: [], consumed: 0 };
@@ -15141,41 +15140,41 @@ const nm = (r) => {
15141
15140
  ],
15142
15141
  consumed: 1
15143
15142
  };
15144
- }, fm = {
15143
+ }, pm = {
15145
15144
  handlerName: "textNodeHandler",
15146
- handler: cm
15147
- }, dm = (r) => Object.prototype.toString.call(r) === "[object RegExp]";
15148
- function mm(r, e, t = { strict: !0 }) {
15145
+ handler: mm
15146
+ }, hm = (r) => Object.prototype.toString.call(r) === "[object RegExp]";
15147
+ function gm(r, e, t = { strict: !0 }) {
15149
15148
  const n = Object.keys(e);
15150
- return n.length ? n.every((i) => t.strict ? e[i] === r[i] : dm(e[i]) ? e[i].test(r[i]) : e[i] === r[i]) : !0;
15149
+ return n.length ? n.every((i) => t.strict ? e[i] === r[i] : hm(e[i]) ? e[i].test(r[i]) : e[i] === r[i]) : !0;
15151
15150
  }
15152
15151
  const pu = (r) => {
15153
15152
  if (!r || !Array.isArray(r))
15154
15153
  return r;
15155
15154
  let e = [], t = null;
15156
15155
  for (let n of r)
15157
- n.type === "text" ? t && pm(t, n) ? t = {
15156
+ n.type === "text" ? t && wm(t, n) ? t = {
15158
15157
  ...t,
15159
15158
  text: t.text += n.text
15160
15159
  } : (t && e.push(t), t = { ...n }) : (t && (e.push(t), t = null), e.push(n));
15161
15160
  return t && e.push(t), e;
15162
- }, pm = (r, e) => {
15161
+ }, wm = (r, e) => {
15163
15162
  if (!r || !e) return !1;
15164
15163
  let t = r.marks ?? [], n = e.marks ?? [];
15165
15164
  if (t.length !== n.length)
15166
15165
  return !1;
15167
15166
  for (let i = 0; i < t.length; i++)
15168
- if (t[i].type !== n[i].type || !hm(t[i].attrs, n[i].attrs))
15167
+ if (t[i].type !== n[i].type || !ym(t[i].attrs, n[i].attrs))
15169
15168
  return !1;
15170
15169
  return !0;
15171
- }, hm = (r = {}, e = {}) => mm(r, e);
15170
+ }, ym = (r = {}, e = {}) => gm(r, e);
15172
15171
  function hu(r, e, t) {
15173
15172
  this.name = r, this.message = e || "", this.details = t;
15174
15173
  const n = new Error(this.message);
15175
15174
  this.stack = n.stack, n.name = this.name;
15176
15175
  }
15177
15176
  hu.prototype = Object.create(Error.prototype);
15178
- const gm = (r) => {
15177
+ const bm = (r) => {
15179
15178
  const { nodes: e, lists: t, docx: n } = r;
15180
15179
  if (e.length === 0 || e[0].name !== "w:p")
15181
15180
  return { nodes: [], consumed: 0 };
@@ -15194,9 +15193,9 @@ const gm = (r) => {
15194
15193
  };
15195
15194
  } else
15196
15195
  return { nodes: [], consumed: 0, lists: t };
15197
- }, wm = {
15196
+ }, xm = {
15198
15197
  handlerName: "listHandler",
15199
- handler: gm
15198
+ handler: bm
15200
15199
  };
15201
15200
  function gu({
15202
15201
  listItems: r,
@@ -15235,9 +15234,9 @@ function gu({
15235
15234
  lvlText: Y,
15236
15235
  lvlJc: de,
15237
15236
  numId: J
15238
- } = Am(N, n, u);
15237
+ } = vm(N, n, u);
15239
15238
  S = ee;
15240
- const te = parseInt(Q), ie = i === te && J === s, L = xm({
15239
+ const te = parseInt(Q), ie = i === te && J === s, L = Em({
15241
15240
  firstListId: J,
15242
15241
  secondListId: s,
15243
15242
  level: te,
@@ -15358,7 +15357,7 @@ function Io(r, e, t) {
15358
15357
  marks: t
15359
15358
  };
15360
15359
  }
15361
- const ym = [
15360
+ const Am = [
15362
15361
  "decimal",
15363
15362
  // eg: 1, 2, 3, 4, 5, ...
15364
15363
  "decimalZero",
@@ -15383,7 +15382,7 @@ const ym = [
15383
15382
  // eg: (0, 1, 2, ..., 9, 10, 11, 12, ..., 19, 1A, 1B, 1C, ..., 1Z, 20, 21, ..., 2Z)
15384
15383
  "none"
15385
15384
  // No bullet
15386
- ], bm = [
15385
+ ], Dm = [
15387
15386
  "bullet",
15388
15387
  // A standard bullet point (•)
15389
15388
  "square",
@@ -15392,7 +15391,7 @@ const ym = [
15392
15391
  // Circle bullets (◦)
15393
15392
  "disc"
15394
15393
  // Disc bullets (●)
15395
- ], xm = ({ firstListId: r, secondListId: e, level: t, pStyleId: n, docx: i }) => {
15394
+ ], Em = ({ firstListId: r, secondListId: e, level: t, pStyleId: n, docx: i }) => {
15396
15395
  const { numFmt: s, lvlText: o, lvlJc: a } = br(r, t, n, i), {
15397
15396
  numFmt: u,
15398
15397
  lvlText: f,
@@ -15422,7 +15421,7 @@ const ym = [
15422
15421
  }
15423
15422
  const a = o.elements, u = a.filter((N) => N.name === "w:abstractNum"), h = a.filter((N) => N.name === "w:num").find((N) => N.attributes["w:numId"] === r)?.elements[0].attributes["w:val"], g = u?.find(
15424
15423
  (N) => N.attributes["w:abstractNumId"] === h
15425
- ), S = Dm(g, e), A = g?.elements?.find((N) => N.name === "w:numStyleLink")?.attributes["w:val"];
15424
+ ), S = Cm(g, e), A = g?.elements?.find((N) => N.name === "w:numStyleLink")?.attributes["w:val"];
15426
15425
  if (A) {
15427
15426
  const N = Ro(A, n);
15428
15427
  return br(N.numId, e, null, n);
@@ -15430,7 +15429,7 @@ const ym = [
15430
15429
  const B = S?.elements?.find((N) => N.name === "w:start")?.attributes["w:val"], w = S?.elements?.find((N) => N.name === "w:numFmt")?.attributes["w:val"], k = S?.elements?.find((N) => N.name === "w:lvlText").attributes["w:val"], I = S?.elements?.find((N) => N.name === "w:lvlJc").attributes["w:val"], C = S?.elements?.find((N) => N.name === "w:pPr"), F = S?.elements?.find((N) => N.name === "w:rPr");
15431
15430
  return { start: B, numFmt: w, lvlText: k, lvlJc: I, pPr: C, rPr: F };
15432
15431
  };
15433
- function Am(r, e, t) {
15432
+ function vm(r, e, t) {
15434
15433
  if (!r) return;
15435
15434
  const { attributes: n } = r, { paragraphProperties: i = {} } = n, { elements: s = [] } = i, u = r.elements.find((D) => D.name === "w:pPr")?.elements?.find((D) => D.name === "w:pStyle")?.attributes["w:val"], f = kr({ node: r, styleId: u, docx: t });
15436
15435
  if (!f) return {};
@@ -15443,10 +15442,10 @@ function Am(r, e, t) {
15443
15442
  rPr: F
15444
15443
  } = br(h, e, A, t);
15445
15444
  let N, q;
15446
- C && (N = Em(C)), F && (q = vm(F));
15445
+ C && (N = Sm(C)), F && (q = Tm(F));
15447
15446
  let H;
15448
- if (bm.includes(w?.toLowerCase())) H = "bulletList";
15449
- else if (ym.includes(w)) H = "orderedList";
15447
+ if (Dm.includes(w?.toLowerCase())) H = "bulletList";
15448
+ else if (Am.includes(w)) H = "orderedList";
15450
15449
  else
15451
15450
  throw new hu("ListParsingError", `Unknown list type found during import: ${w}`, {
15452
15451
  listOrderingType: w,
@@ -15460,10 +15459,10 @@ function Am(r, e, t) {
15460
15459
  });
15461
15460
  return { listType: H, listOrderingType: w, ilvl: S, numId: h, listrPrs: q, listpPrs: N, start: B, lvlText: k, lvlJc: I };
15462
15461
  }
15463
- function Dm(r, e) {
15462
+ function Cm(r, e) {
15464
15463
  return r?.elements?.find((t) => Number(t.attributes["w:ilvl"]) === e);
15465
15464
  }
15466
- function Em(r) {
15465
+ function Sm(r) {
15467
15466
  const { elements: e } = r, t = ["w:ind", "w:jc", "w:tabs"], n = {};
15468
15467
  return e && e.forEach((i) => {
15469
15468
  t.includes(i.name);
@@ -15473,7 +15472,7 @@ function Em(r) {
15473
15472
  });
15474
15473
  }), n;
15475
15474
  }
15476
- function vm(r) {
15475
+ function Tm(r) {
15477
15476
  const { elements: e } = r, t = [
15478
15477
  "w:rFonts",
15479
15478
  "w:b",
@@ -15504,7 +15503,7 @@ function vm(r) {
15504
15503
  });
15505
15504
  }), n;
15506
15505
  }
15507
- const Cm = (r) => {
15506
+ const Fm = (r) => {
15508
15507
  const { nodes: e, docx: t, nodeListHandler: n, filename: i } = r;
15509
15508
  if (e.length === 0 || e[0].name !== "w:p")
15510
15509
  return { nodes: [], consumed: 0 };
@@ -15521,7 +15520,7 @@ const Cm = (r) => {
15521
15520
  c.nodes.length === 1 && (o = c.nodes[0]);
15522
15521
  const h = s.elements?.find((w) => w.name === "w:pPr"), g = h?.elements?.find((w) => w.name === "w:pStyle"), S = h?.elements?.find((w) => w.name === "w:rPr");
15523
15522
  if (S && (o.attrs.marksAttrs = Bt(S, [])), g && (o.attrs.styleId = g.attributes["w:val"]), t) {
15524
- const w = Sm(s, t, o.attrs.styleId);
15523
+ const w = Bm(s, t, o.attrs.styleId);
15525
15524
  o.attrs.indent || (o.attrs.indent = {}), w.left && (o.attrs.indent.left = w.left), w.right && (o.attrs.indent.right = w.right), w.firstLine && (o.attrs.indent.firstLine = w.firstLine), w.hanging && (o.attrs.indent.hanging = w.hanging), w.textIndent && (o.attrs.textIndent = `${w.textIndent}in`);
15526
15525
  }
15527
15526
  const T = h?.elements?.find((w) => w.name === "w:jc");
@@ -15537,7 +15536,7 @@ const Cm = (r) => {
15537
15536
  ...o,
15538
15537
  content: pu(o.content)
15539
15538
  }), { nodes: o ? [o] : [], consumed: 1 };
15540
- }, Sm = (r, e, t = "") => {
15539
+ }, Bm = (r, e, t = "") => {
15541
15540
  const n = {
15542
15541
  left: 0,
15543
15542
  right: 0,
@@ -15579,11 +15578,11 @@ const Cm = (r) => {
15579
15578
  spacing: B || T || A,
15580
15579
  indent: I || w || k
15581
15580
  };
15582
- }, Tm = {
15581
+ }, km = {
15583
15582
  handlerName: "paragraphNodeHandler",
15584
- handler: Cm
15583
+ handler: Fm
15585
15584
  };
15586
- function Fm(r, e) {
15585
+ function Nm(r, e) {
15587
15586
  const t = { lineSpaceBefore: null, lineSpaceAfter: null };
15588
15587
  if (!r) return t;
15589
15588
  const n = e["word/styles.xml"];
@@ -15693,7 +15692,7 @@ const Po = (r = []) => {
15693
15692
  });
15694
15693
  }
15695
15694
  return e;
15696
- }, Bm = (r) => nodeListHandler.handler({ ...r, nodes: node.elements }), km = (r) => {
15695
+ }, Im = (r) => nodeListHandler.handler({ ...r, nodes: node.elements }), Rm = (r) => {
15697
15696
  const { nodes: e } = r;
15698
15697
  if (e.length === 0 || e[0].name !== "w:sdt")
15699
15698
  return { nodes: [], consumed: 0 };
@@ -15708,14 +15707,14 @@ const Po = (r = []) => {
15708
15707
  consumed: 1
15709
15708
  };
15710
15709
  }, Oo = {
15711
- "Table of Contents": Bm
15712
- }, Nm = (r) => {
15710
+ "Table of Contents": Im
15711
+ }, Pm = (r) => {
15713
15712
  const { nodes: e, docx: t, nodeListHandler: n, insideTrackChange: i } = r;
15714
15713
  if (e.length === 0 || e[0].name !== "w:sdt")
15715
15714
  return { nodes: [], consumed: 0 };
15716
- const s = e[0], o = s.elements.find((I) => I.name === "w:sdtPr"), a = s.elements.find((I) => I.name === "w:sdtContent"), { attrs: u, marks: f } = Im(a);
15715
+ const s = e[0], o = s.elements.find((I) => I.name === "w:sdtPr"), a = s.elements.find((I) => I.name === "w:sdtContent"), { attrs: u, marks: f } = Om(a);
15717
15716
  if (o?.elements.find((I) => I.name === "w:docPartObj"))
15718
- return km({ nodes: e, docx: t, nodeListHandler: n, insideTrackChange: i });
15717
+ return Rm({ nodes: e, docx: t, nodeListHandler: n, insideTrackChange: i });
15719
15718
  const h = o?.elements.find((I) => I.name === "w:alias"), g = o?.elements.find((I) => I.name === "w:tag"), S = o?.elements.find((I) => I.name === "w:fieldType")?.attributes["w:val"], T = o?.elements.find((I) => I.name === "w:fieldTypeShort")?.attributes["w:val"], A = o?.elements.find((I) => I.name === "w:fieldColor")?.attributes["w:val"], B = o?.elements.find((I) => I.name === "w:fieldMultipleImage")?.attributes["w:val"], w = {
15720
15719
  type: T,
15721
15720
  fieldId: g?.attributes["w:val"],
@@ -15739,7 +15738,7 @@ const Po = (r = []) => {
15739
15738
  nodes: [k],
15740
15739
  consumed: 1
15741
15740
  };
15742
- }, Im = (r = {}) => {
15741
+ }, Om = (r = {}) => {
15743
15742
  const t = r.elements?.find((a) => a.name === "w:r")?.elements?.find((a) => a.name === "w:rPr");
15744
15743
  if (!t) return {};
15745
15744
  const i = Bt(t, []) || [], s = [];
@@ -15761,17 +15760,17 @@ const Po = (r = []) => {
15761
15760
  attrs: o,
15762
15761
  marks: i
15763
15762
  };
15764
- }, Rm = {
15763
+ }, Lm = {
15765
15764
  handlerName: "annotationNodeHandler",
15766
- handler: Nm
15767
- }, Pm = (r) => {
15765
+ handler: Pm
15766
+ }, _m = (r) => {
15768
15767
  const { nodes: e, docx: t, nodeListHandler: n } = r;
15769
15768
  if (!e || e.length === 0)
15770
15769
  return { nodes: [], consumed: 0 };
15771
15770
  const i = e[0], { name: s } = i, { attributes: o, elements: a, marks: u = [] } = Lt(i);
15772
15771
  if (s === "w:sdt")
15773
15772
  return { nodes: [], consumed: 0 };
15774
- if (rm(i))
15773
+ if (sm(i))
15775
15774
  return {
15776
15775
  nodes: [{
15777
15776
  type: lr(i),
@@ -15791,7 +15790,7 @@ const Po = (r = []) => {
15791
15790
  consumed: 0,
15792
15791
  unhandled: !0
15793
15792
  };
15794
- const f = [], c = Om(i);
15793
+ const f = [], c = qm(i);
15795
15794
  if (a && a.length) {
15796
15795
  const g = a.map((A) => (A.marks || (A.marks = []), A.marks.push(...u), A)), S = { ...r, nodes: g, parentStyleId: c }, T = n.handler(S);
15797
15796
  f.push(...T);
@@ -15802,13 +15801,13 @@ const Po = (r = []) => {
15802
15801
  attrs: { ...o },
15803
15802
  marks: []
15804
15803
  }], consumed: 1 };
15805
- }, Om = (r) => {
15804
+ }, qm = (r) => {
15806
15805
  const t = r.elements?.find((n) => n.name === "w:pPr")?.elements?.find((n) => n.name === "w:pStyle");
15807
15806
  return t ? t.attributes["w:val"] : null;
15808
- }, Lm = {
15807
+ }, Mm = {
15809
15808
  handlerName: "standardNodeHandler",
15810
- handler: Pm
15811
- }, _m = (r) => {
15809
+ handler: _m
15810
+ }, Um = (r) => {
15812
15811
  const { nodes: e } = r;
15813
15812
  return e.length === 0 || e[0].name !== "w:br" ? { nodes: [], consumed: 0 } : {
15814
15813
  nodes: [{
@@ -15816,10 +15815,10 @@ const Po = (r = []) => {
15816
15815
  }],
15817
15816
  consumed: 1
15818
15817
  };
15819
- }, qm = {
15818
+ }, jm = {
15820
15819
  handlerName: "lineBreakNodeHandler",
15821
- handler: _m
15822
- }, Mm = (r) => {
15820
+ handler: Um
15821
+ }, Hm = (r) => {
15823
15822
  const { nodes: e, nodeListHandler: t } = r;
15824
15823
  if (e.length === 0 || e[0].name !== "w:bookmarkStart")
15825
15824
  return { nodes: [], consumed: 0 };
@@ -15830,26 +15829,26 @@ const Po = (r = []) => {
15830
15829
  return console.error("Standard node handler not found"), { nodes: [], consumed: 0 };
15831
15830
  const s = { ...r, nodes: [n] }, o = i(s);
15832
15831
  return o.nodes.length === 1 && (o.nodes[0].attrs.name = n.attributes["w:name"], o.nodes[0].attrs.id = n.attributes["w:id"]), o;
15833
- }, Um = {
15832
+ }, Vm = {
15834
15833
  handlerName: "bookmarkNodeHandler",
15835
- handler: Mm
15836
- }, jm = (r) => {
15834
+ handler: Hm
15835
+ }, zm = (r) => {
15837
15836
  const { nodes: e } = r;
15838
15837
  return e.length === 0 || e[0].name !== "sd:autoPageNumber" ? { nodes: [], consumed: 0 } : { nodes: [{
15839
15838
  type: "page-number"
15840
15839
  }], consumed: 1 };
15841
- }, Hm = {
15840
+ }, Gm = {
15842
15841
  handlerName: "autoPageNumberHandler",
15843
- handler: jm
15844
- }, Vm = (r) => {
15842
+ handler: zm
15843
+ }, Wm = (r) => {
15845
15844
  const { nodes: e } = r;
15846
15845
  return e.length === 0 || e[0].name !== "sd:totalPageNumber" ? { nodes: [], consumed: 0 } : { nodes: [{
15847
15846
  type: "total-page-number"
15848
15847
  }], consumed: 1 };
15849
- }, zm = {
15848
+ }, Jm = {
15850
15849
  handlerName: "autoTotalPageCountEntity",
15851
- handler: Vm
15852
- }, Gm = (r) => {
15850
+ handler: Wm
15851
+ }, Km = (r) => {
15853
15852
  const { nodes: e } = r;
15854
15853
  if (e.length === 0 || e[0].name !== "w:tab")
15855
15854
  return { nodes: [], consumed: 0 };
@@ -15861,11 +15860,11 @@ const Po = (r = []) => {
15861
15860
  },
15862
15861
  content: []
15863
15862
  }], consumed: 1 };
15864
- }, Wm = {
15863
+ }, $m = {
15865
15864
  handlerName: "tabNodeHandler",
15866
- handler: Gm
15865
+ handler: Km
15867
15866
  };
15868
- function Jm({ docx: r }) {
15867
+ function Xm({ docx: r }) {
15869
15868
  const e = xr(), t = r["word/comments.xml"];
15870
15869
  if (!t) return;
15871
15870
  const { elements: n } = t;
@@ -15891,16 +15890,16 @@ function Jm({ docx: r }) {
15891
15890
  trackedDeletedText: k
15892
15891
  };
15893
15892
  });
15894
- return Km({ docx: r, comments: s });
15893
+ return Ym({ docx: r, comments: s });
15895
15894
  }
15896
- const Km = ({ docx: r, comments: e }) => {
15895
+ const Ym = ({ docx: r, comments: e }) => {
15897
15896
  const t = r["word/commentsExtended.xml"];
15898
15897
  if (!t) return [];
15899
15898
  const { elements: n } = t, { elements: i } = n[0], s = i.filter((o) => o.name === "w15:commentEx");
15900
15899
  return e.map((o) => {
15901
15900
  const a = s.find((g) => g.attributes["w15:paraId"] === o.paraId);
15902
15901
  if (!a) return { ...o };
15903
- const { isDone: u, paraIdParent: f } = $m(a);
15902
+ const { isDone: u, paraIdParent: f } = Qm(a);
15904
15903
  let c;
15905
15904
  return f && (c = e.find((g) => g.paraId === f)), {
15906
15905
  ...o,
@@ -15908,11 +15907,11 @@ const Km = ({ docx: r, comments: e }) => {
15908
15907
  parentCommentId: c?.commentId
15909
15908
  };
15910
15909
  });
15911
- }, $m = (r) => {
15910
+ }, Qm = (r) => {
15912
15911
  const { attributes: e } = r, t = e["w15:paraId"], n = e["w15:done"] === "1", i = e["w15:paraIdParent"];
15913
15912
  return { paraId: t, isDone: n, paraIdParent: i };
15914
- }, Xm = (r, e, t) => {
15915
- const n = je(Md(r));
15913
+ }, Zm = (r, e, t) => {
15914
+ const n = je(Hd(r));
15916
15915
  if (!n) return null;
15917
15916
  if (e?.telemetry) {
15918
15917
  const o = Object.keys(r).map((a) => {
@@ -15937,7 +15936,7 @@ const Km = ({ docx: r, comments: e }) => {
15937
15936
  }
15938
15937
  const i = xr(), s = n.elements[0].elements.find((o) => o.name === "w:body");
15939
15938
  if (s) {
15940
- const o = s, a = ["w:sectPr"], u = o.elements?.filter((S) => !a.includes(S.name)) ?? [], f = Jm({ docx: r }), c = {}, g = {
15939
+ const o = s, a = ["w:sectPr"], u = o.elements?.filter((S) => !a.includes(S.name)) ?? [], f = Xm({ docx: r }), c = {}, g = {
15941
15940
  type: "doc",
15942
15941
  content: i.handler({
15943
15942
  nodes: u,
@@ -15960,37 +15959,37 @@ const Km = ({ docx: r, comments: e }) => {
15960
15959
  ), {
15961
15960
  pmDoc: g,
15962
15961
  savedTagsToRestore: o,
15963
- pageStyles: Qm(o, r, e, t),
15962
+ pageStyles: tp(o, r, e, t),
15964
15963
  comments: f,
15965
- linkedStyles: Zm(r),
15966
- numbering: rp(r)
15964
+ linkedStyles: rp(r),
15965
+ numbering: sp(r)
15967
15966
  };
15968
15967
  }
15969
15968
  return null;
15970
15969
  }, xr = () => {
15971
15970
  const r = [
15971
+ dm,
15972
+ km,
15973
+ xm,
15974
+ pm,
15975
+ jm,
15976
+ Lm,
15977
+ Vm,
15972
15978
  lm,
15973
- Tm,
15974
- wm,
15975
- fm,
15976
- qm,
15977
- Rm,
15978
- Um,
15979
- om,
15980
- Kd,
15981
- im,
15982
- jd,
15983
- Wm,
15984
- Hm,
15985
- zm,
15986
- Lm
15979
+ Yd,
15980
+ am,
15981
+ zd,
15982
+ $m,
15983
+ Gm,
15984
+ Jm,
15985
+ Mm
15987
15986
  //this should be the last one, bcs this parses everything!!!
15988
15987
  ];
15989
15988
  return {
15990
- handler: Ym(r),
15989
+ handler: ep(r),
15991
15990
  handlerEntities: r
15992
15991
  };
15993
- }, Ym = (r) => {
15992
+ }, ep = (r) => {
15994
15993
  const e = (n, i, s, o) => !n || i < 0 || i >= n.length ? {
15995
15994
  elementIndex: i,
15996
15995
  error: "index_out_of_bounds",
@@ -16075,7 +16074,7 @@ const Km = ({ docx: r, comments: e }) => {
16075
16074
  };
16076
16075
  return t;
16077
16076
  };
16078
- function Qm(r, e, t, n) {
16077
+ function tp(r, e, t, n) {
16079
16078
  const i = r.elements?.find((o) => o.name === "w:sectPr"), s = {};
16080
16079
  return i?.elements?.forEach((o) => {
16081
16080
  const { name: a, attributes: u } = o;
@@ -16113,9 +16112,9 @@ function Qm(r, e, t, n) {
16113
16112
  case "w:titlePg":
16114
16113
  t.headerIds.titlePg = !0;
16115
16114
  }
16116
- }), tp(e, t, n), s.alternateHeaders = np(e), s;
16115
+ }), ip(e, t, n), s.alternateHeaders = op(e), s;
16117
16116
  }
16118
- function Zm(r) {
16117
+ function rp(r) {
16119
16118
  const e = r["word/styles.xml"];
16120
16119
  if (!e) return [];
16121
16120
  const { elements: t } = e.elements[0], n = t.filter((o) => o.name === "w:style");
@@ -16125,7 +16124,7 @@ function Zm(r) {
16125
16124
  });
16126
16125
  const s = [];
16127
16126
  return n.forEach((o) => {
16128
- const a = o.attributes["w:styleId"], u = Fm(a, r), f = {
16127
+ const a = o.attributes["w:styleId"], u = Nm(a, r), f = {
16129
16128
  id: o.attributes["w:styleId"],
16130
16129
  type: o.attributes["w:type"],
16131
16130
  definition: u,
@@ -16134,7 +16133,7 @@ function Zm(r) {
16134
16133
  s.push(f);
16135
16134
  }), s;
16136
16135
  }
16137
- function ep(r) {
16136
+ function np(r) {
16138
16137
  if (!r) return null;
16139
16138
  const e = je(r), { elements: t } = e.elements[0];
16140
16139
  return Object.keys(Eo).forEach((n) => {
@@ -16144,7 +16143,7 @@ function ep(r) {
16144
16143
  }
16145
16144
  }), e;
16146
16145
  }
16147
- const tp = (r, e, t) => {
16146
+ const ip = (r, e, t) => {
16148
16147
  const i = r["word/_rels/document.xml.rels"].elements.find((g) => g.name === "Relationships"), { elements: s } = i, o = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", a = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", u = s.filter((g) => g.attributes.Type === o), f = s.filter((g) => g.attributes.Type === a), h = (Du(r["word/document.xml"]) || []).flatMap((g) => g.elements);
16149
16148
  u.forEach((g) => {
16150
16149
  const { rId: S, referenceFile: T, currentFileName: A } = Lo(g, r), w = h.find((C) => C.name === "w:headerReference" && C.attributes["r:id"] === S)?.attributes["w:type"], k = xr(), I = k.handler({
@@ -16179,7 +16178,7 @@ const tp = (r, e, t) => {
16179
16178
  currentFileName: n
16180
16179
  };
16181
16180
  };
16182
- function rp(r) {
16181
+ function sp(r) {
16183
16182
  let e = r["word/numbering.xml"];
16184
16183
  (!e || !e.elements?.length || !e.elements[0].elements?.length) && (e = ru);
16185
16184
  const t = e.elements[0].elements, n = t.filter((a) => a.name === "w:abstractNum"), i = t.filter((a) => a.name === "w:num"), s = {};
@@ -16196,7 +16195,7 @@ function rp(r) {
16196
16195
  definitions: o
16197
16196
  };
16198
16197
  }
16199
- const np = (r) => {
16198
+ const op = (r) => {
16200
16199
  const e = r["word/settings.xml"];
16201
16200
  if (!e || !e.elements?.length) return !1;
16202
16201
  const { elements: t = [] } = e.elements[0];
@@ -16210,7 +16209,7 @@ const dt = class dt {
16210
16209
  }
16211
16210
  parseFromXml() {
16212
16211
  this.docx?.forEach((e) => {
16213
- this.convertedXml[e.name] = this.parseXmlToJson(e.content), e.name === "word/document.xml" && (this.documentAttributes = this.convertedXml[e.name].elements[0]?.attributes), e.name === "word/styles.xml" && (this.convertedXml[e.name] = ep(this.convertedXml[e.name]));
16212
+ this.convertedXml[e.name] = this.parseXmlToJson(e.content), e.name === "word/document.xml" && (this.documentAttributes = this.convertedXml[e.name].elements[0]?.attributes), e.name === "word/styles.xml" && (this.convertedXml[e.name] = np(this.convertedXml[e.name]));
16214
16213
  }), this.initialJSON = this.convertedXml["word/document.xml"], this.initialJSON || (this.initialJSON = this.parseXmlToJson(this.xml)), this.declaration = this.initialJSON?.declaration;
16215
16214
  }
16216
16215
  parseXmlToJson(e) {
@@ -16229,7 +16228,7 @@ const dt = class dt {
16229
16228
  return;
16230
16229
  }
16231
16230
  }
16232
- static updateDocumentVersion(e = this.convertedXml, t = "0.9.33") {
16231
+ static updateDocumentVersion(e = this.convertedXml, t = "0.9.35") {
16233
16232
  const n = "docProps/custom.xml";
16234
16233
  e[n] || (e[n] = Tu());
16235
16234
  const i = e["docProps/custom.xml"];
@@ -16296,14 +16295,14 @@ const dt = class dt {
16296
16295
  }
16297
16296
  getSchema(e) {
16298
16297
  this.getDocumentInternalId();
16299
- const t = Xm({ ...this.convertedXml, media: this.media }, this, e);
16298
+ const t = Zm({ ...this.convertedXml, media: this.media }, this, e);
16300
16299
  return t ? (this.savedTagsToRestore.push({ ...t.savedTagsToRestore }), this.pageStyles = t.pageStyles, this.numbering = t.numbering, this.comments = t.comments, this.linkedStyles = t.linkedStyles, t.pmDoc) : null;
16301
16300
  }
16302
16301
  schemaToXml(e, t = !1) {
16303
16302
  return new Bo(this).schemaToXml(e, t);
16304
16303
  }
16305
16304
  async exportToDocx(e, t, n, i = !1, s, o = []) {
16306
- const a = o.map((A) => Jf(A)), u = a.map((A, B) => Kf(A, B, a)), { result: f, params: c } = this.exportToXmlJson({
16305
+ const a = o.map((A) => $f(A)), u = a.map((A, B) => Xf(A, B, a)), { result: f, params: c } = this.exportToXmlJson({
16307
16306
  data: e,
16308
16307
  editorSchema: t,
16309
16308
  comments: o,
@@ -16325,7 +16324,7 @@ const dt = class dt {
16325
16324
  });
16326
16325
  S = { ...A }, T = B;
16327
16326
  }
16328
- return this.convertedXml = { ...this.convertedXml, ...S }, Ke(this, it, Cu).call(this, [...c.relationships, ...T]), ip(this.convertedXml), Ke(this, it, Eu).call(this, c), g;
16327
+ return this.convertedXml = { ...this.convertedXml, ...S }, Ke(this, it, Cu).call(this, [...c.relationships, ...T]), ap(this.convertedXml), Ke(this, it, Eu).call(this, c), g;
16329
16328
  }
16330
16329
  exportToXmlJson({
16331
16330
  data: e,
@@ -16363,7 +16362,7 @@ it = new WeakSet(), Eu = function(e) {
16363
16362
  * Update comments files and relationships depending on export type
16364
16363
  */
16365
16364
  vu = function({ defs: e, exportType: t, commentsWithParaIds: n }) {
16366
- const { documentXml: i, relationships: s } = td({
16365
+ const { documentXml: i, relationships: s } = nd({
16367
16366
  exportType: t,
16368
16367
  convertedXml: this.convertedXml,
16369
16368
  defs: e,
@@ -16435,7 +16434,7 @@ vu = function({ defs: e, exportType: t, commentsWithParaIds: n }) {
16435
16434
  "w:tcPr": "tableCellProperties"
16436
16435
  })), _t(dt, "elements", /* @__PURE__ */ new Set(["w:document", "w:body", "w:p", "w:r", "w:t", "w:delText"]));
16437
16436
  let Nt = dt;
16438
- function ip(r) {
16437
+ function ap(r) {
16439
16438
  const e = "docProps/custom.xml";
16440
16439
  r[e] || (r[e] = Tu());
16441
16440
  const n = r[e].elements.find((a) => a.name === "Properties");
@@ -16454,7 +16453,7 @@ function ip(r) {
16454
16453
  function Tu() {
16455
16454
  return _f;
16456
16455
  }
16457
- function Fu(r = 2, e = "0.9.33") {
16456
+ function Fu(r = 2, e = "0.9.35") {
16458
16457
  return {
16459
16458
  type: "element",
16460
16459
  name: "property",
@@ -16486,37 +16485,37 @@ export {
16486
16485
  Z as F,
16487
16486
  Nt as G,
16488
16487
  At as H,
16489
- yp as I,
16488
+ Ap as I,
16490
16489
  Ya as J,
16491
- rd as K,
16490
+ id as K,
16492
16491
  Sf as L,
16493
16492
  wr as M,
16494
16493
  Ge as N,
16495
16494
  Cf as O,
16496
- wp as P,
16497
- nd as Q,
16495
+ xp as P,
16496
+ sd as Q,
16498
16497
  Je as R,
16499
16498
  ve as S,
16500
16499
  tt as T,
16501
16500
  We as U,
16502
16501
  _o as V,
16503
- Ap as W,
16504
- xp as X,
16505
- gp as a,
16502
+ vp as W,
16503
+ Ep as X,
16504
+ bp as a,
16506
16505
  ue as b,
16507
16506
  gr as c,
16508
16507
  ge as d,
16509
- hp as e,
16510
- up as f,
16511
- dp as g,
16512
- mp as h,
16513
- dm as i,
16514
- pp as j,
16508
+ yp as e,
16509
+ fp as f,
16510
+ hp as g,
16511
+ gp as h,
16512
+ hm as i,
16513
+ wp as j,
16515
16514
  Ie as k,
16516
- cp as l,
16515
+ mp as l,
16517
16516
  Oc as m,
16518
- fp as n,
16519
- mm as o,
16517
+ pp as n,
16518
+ gm as o,
16520
16519
  he as p,
16521
16520
  Ii as q,
16522
16521
  yf as r,
@@ -16525,7 +16524,7 @@ export {
16525
16524
  tu as u,
16526
16525
  ba as v,
16527
16526
  Ri as w,
16528
- bp as x,
16527
+ Dp as x,
16529
16528
  ct as y,
16530
16529
  et as z
16531
16530
  };