@harbour-enterprises/superdoc 0.11.57 → 0.11.58
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.
- package/dist/chunks/{index-Dw-Q9hD6.cjs → index-BWoN1jpL.cjs} +1 -1
- package/dist/chunks/{index-CWj8iOm4.es.js → index-Bu0Qz4_D.es.js} +1 -1
- package/dist/chunks/{index-CVyuWad2.es.js → index-CsjnTatF.es.js} +2 -2
- package/dist/chunks/{index-Dnm6LcB6.cjs → index-DLLQ5PJZ.cjs} +1 -1
- package/dist/chunks/{super-editor.es-kMbvFzrR.cjs → super-editor.es-D4v1tv4j.cjs} +41 -41
- package/dist/chunks/{super-editor.es-BuT2FFqD.es.js → super-editor.es-qCwVvR8-.es.js} +1958 -1978
- package/dist/chunks/{url-NtSPOzqh.es.js → url-D8ItQPzc.es.js} +1 -1
- package/dist/chunks/{url-BV2RvrTf.cjs → url-DRW8x74x.cjs} +1 -1
- package/dist/chunks/xml-js-DrlOWTO_.cjs +10 -0
- package/dist/chunks/{xml-js-BvgqUvJ5.es.js → xml-js-yTXP6usI.es.js} +638 -616
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-D3X034CV.js → converter-BIFb-l0C.js} +269 -289
- package/dist/super-editor/chunks/{docx-zipper-CczfH-Gl.js → docx-zipper-Bf04SHvT.js} +1 -1
- package/dist/super-editor/chunks/{editor-CMO-734F.js → editor-BZ4VbwzA.js} +3 -3
- package/dist/super-editor/chunks/{toolbar-d1TvqceK.js → toolbar-mC-hpKkm.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +6 -6
- package/dist/superdoc.umd.js +378 -398
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/xml-js-CCvZbbr7.cjs +0 -10
|
@@ -7852,7 +7852,7 @@ class Tr {
|
|
|
7852
7852
|
return this.excluded.indexOf(e) > -1;
|
|
7853
7853
|
}
|
|
7854
7854
|
}
|
|
7855
|
-
let
|
|
7855
|
+
let Pp = class {
|
|
7856
7856
|
/**
|
|
7857
7857
|
Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
|
|
7858
7858
|
*/
|
|
@@ -9315,7 +9315,7 @@ function ki(r, e, t, n = t.contentMatch, i = !0) {
|
|
|
9315
9315
|
function lf(r, e, t) {
|
|
9316
9316
|
return (e == 0 || r.canReplace(e, r.childCount)) && (t == r.childCount || r.canReplace(0, t));
|
|
9317
9317
|
}
|
|
9318
|
-
function
|
|
9318
|
+
function Lp(r) {
|
|
9319
9319
|
let t = r.parent.content.cutByIndex(r.startIndex, r.endIndex);
|
|
9320
9320
|
for (let n = r.depth; ; --n) {
|
|
9321
9321
|
let i = r.$from.node(n), s = r.$from.index(n), o = r.$to.indexAfter(n);
|
|
@@ -9335,7 +9335,7 @@ function cf(r, e, t) {
|
|
|
9335
9335
|
v || i.after(A + 1) < i.end(A) ? (v = !0, g = Q.from(i.node(A).copy(g)), E++) : c++;
|
|
9336
9336
|
r.step(new $e(u, c, o, a, new ae(l.append(g), h, E), l.size - h, !0));
|
|
9337
9337
|
}
|
|
9338
|
-
function
|
|
9338
|
+
function _p(r, e, t = null, n = r) {
|
|
9339
9339
|
let i = ff(r, e), s = i && df(n, e);
|
|
9340
9340
|
return s ? i.map(wo).concat({ type: e, attrs: t }).concat(s.map(wo)) : null;
|
|
9341
9341
|
}
|
|
@@ -9425,7 +9425,7 @@ function gf(r, e, t, n, i) {
|
|
|
9425
9425
|
throw new RangeError("Invalid content for node type " + t.name);
|
|
9426
9426
|
r.step(new $e(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new ae(Q.from(o), 0, 0), 1, !0));
|
|
9427
9427
|
}
|
|
9428
|
-
function
|
|
9428
|
+
function qp(r, e, t = 1, n) {
|
|
9429
9429
|
let i = r.resolve(e), s = i.depth - t, o = n && n[n.length - 1] || i.parent;
|
|
9430
9430
|
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)))
|
|
9431
9431
|
return !1;
|
|
@@ -9451,7 +9451,7 @@ function wf(r, e, t = 1, n) {
|
|
|
9451
9451
|
}
|
|
9452
9452
|
r.step(new Ie(e, e, new ae(s.append(o), t, t), !0));
|
|
9453
9453
|
}
|
|
9454
|
-
function
|
|
9454
|
+
function Mp(r, e) {
|
|
9455
9455
|
let t = r.resolve(e), n = t.index();
|
|
9456
9456
|
return Ga(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(n, n + 1);
|
|
9457
9457
|
}
|
|
@@ -9468,7 +9468,7 @@ function yf(r, e) {
|
|
|
9468
9468
|
function Ga(r, e) {
|
|
9469
9469
|
return !!(r && e && !r.isLeaf && yf(r, e));
|
|
9470
9470
|
}
|
|
9471
|
-
function
|
|
9471
|
+
function Up(r, e, t = -1) {
|
|
9472
9472
|
let n = r.resolve(e);
|
|
9473
9473
|
for (let i = n.depth; ; i--) {
|
|
9474
9474
|
let s, o, a = n.index(i);
|
|
@@ -9520,7 +9520,7 @@ function xf(r, e, t) {
|
|
|
9520
9520
|
}
|
|
9521
9521
|
return null;
|
|
9522
9522
|
}
|
|
9523
|
-
function
|
|
9523
|
+
function jp(r, e, t) {
|
|
9524
9524
|
let n = r.resolve(e);
|
|
9525
9525
|
if (!t.content.size)
|
|
9526
9526
|
return e;
|
|
@@ -10895,7 +10895,7 @@ function Xa(r, e, t) {
|
|
|
10895
10895
|
}
|
|
10896
10896
|
return t;
|
|
10897
10897
|
}
|
|
10898
|
-
class
|
|
10898
|
+
class Hp {
|
|
10899
10899
|
/**
|
|
10900
10900
|
Create a plugin.
|
|
10901
10901
|
*/
|
|
@@ -10913,7 +10913,7 @@ const oi = /* @__PURE__ */ Object.create(null);
|
|
|
10913
10913
|
function Ya(r) {
|
|
10914
10914
|
return r in oi ? r + "$" + ++oi[r] : (oi[r] = 0, r + "$");
|
|
10915
10915
|
}
|
|
10916
|
-
class
|
|
10916
|
+
class Vp {
|
|
10917
10917
|
/**
|
|
10918
10918
|
Create a plugin key.
|
|
10919
10919
|
*/
|
|
@@ -10934,7 +10934,7 @@ class zp {
|
|
|
10934
10934
|
return e[this.key];
|
|
10935
10935
|
}
|
|
10936
10936
|
}
|
|
10937
|
-
const Za = (r) => r.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`),
|
|
10937
|
+
const Za = (r) => r.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), zp = (r) => Za(r), Gp = Object.freeze({
|
|
10938
10938
|
RESOLVED: "resolved",
|
|
10939
10939
|
NEW: "new",
|
|
10940
10940
|
ADD: "add",
|
|
@@ -10947,7 +10947,7 @@ const Za = (r) => r.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Gp = (r) =>
|
|
|
10947
10947
|
// Tracked changes
|
|
10948
10948
|
CHANGE_ACCEPTED: "change-accepted",
|
|
10949
10949
|
CHANGE_REJECTED: "change-rejected"
|
|
10950
|
-
}),
|
|
10950
|
+
}), Wp = {
|
|
10951
10951
|
mounted(r, e, t) {
|
|
10952
10952
|
const n = (i) => {
|
|
10953
10953
|
r.contains(i.target) || e.value(i);
|
|
@@ -10958,20 +10958,20 @@ const Za = (r) => r.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Gp = (r) =>
|
|
|
10958
10958
|
document.removeEventListener("click", r.__clickOutsideHandler), delete r.__clickOutsideHandler;
|
|
10959
10959
|
}
|
|
10960
10960
|
};
|
|
10961
|
-
function
|
|
10961
|
+
function Jp(r, e = null, ...t) {
|
|
10962
10962
|
return typeof r == "function" ? e ? r.bind(e)(...t) : r(...t) : r;
|
|
10963
10963
|
}
|
|
10964
|
-
function
|
|
10964
|
+
function $p(r = {}) {
|
|
10965
10965
|
return Object.keys(r).length === 0 && r.constructor === Object;
|
|
10966
10966
|
}
|
|
10967
|
-
const
|
|
10967
|
+
const Kp = () => typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1, Xp = () => ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"].includes(
|
|
10968
10968
|
navigator.platform
|
|
10969
10969
|
), Rf = (r) => Object.prototype.toString.call(r) === "[object RegExp]";
|
|
10970
10970
|
function Pf(r, e, t = { strict: !0 }) {
|
|
10971
10971
|
const n = Object.keys(e);
|
|
10972
10972
|
return n.length ? n.every((i) => t.strict ? e[i] === r[i] : Rf(e[i]) ? e[i].test(r[i]) : e[i] === r[i]) : !0;
|
|
10973
10973
|
}
|
|
10974
|
-
function
|
|
10974
|
+
function Yp(r, e) {
|
|
10975
10975
|
const n = typeof e == "string" ? [e] : e;
|
|
10976
10976
|
return Object.keys(r).reduce((i, s) => (n.includes(s) || (i[s] = r[s]), i), {});
|
|
10977
10977
|
}
|
|
@@ -10980,7 +10980,7 @@ function _f(r = "0") {
|
|
|
10980
10980
|
const e = r.toString() || "0", t = Number.parseFloat(e), i = (e.match(Of)?.[1] ?? "").toLowerCase();
|
|
10981
10981
|
return [t, Lf.includes(i) ? i : null];
|
|
10982
10982
|
}
|
|
10983
|
-
function
|
|
10983
|
+
function Zp(r = 0, e = 0, t = 0) {
|
|
10984
10984
|
return Math.min(Math.max(r, e), t);
|
|
10985
10985
|
}
|
|
10986
10986
|
function It(r) {
|
|
@@ -11056,7 +11056,7 @@ const Uf = async (r, e) => {
|
|
|
11056
11056
|
}
|
|
11057
11057
|
const i = St.from(n, "base64");
|
|
11058
11058
|
return i.buffer.slice(i.byteOffset, i.byteOffset + i.byteLength);
|
|
11059
|
-
},
|
|
11059
|
+
}, Qp = (r) => {
|
|
11060
11060
|
const n = new window.DOMParser().parseFromString(r, "text/xml").querySelectorAll("Default");
|
|
11061
11061
|
return Array.from(n).map((i) => i.getAttribute("Extension"));
|
|
11062
11062
|
}, jf = (r) => (/* @__PURE__ */ new Map([
|
|
@@ -11092,7 +11092,7 @@ function Hf(r) {
|
|
|
11092
11092
|
const Vf = (r) => {
|
|
11093
11093
|
const e = Number(r).toString(16);
|
|
11094
11094
|
return e.length === 1 ? "0" + e : e;
|
|
11095
|
-
}, zf = (r) => "#" + r.match(/\d+/g).map(Vf).join(""),
|
|
11095
|
+
}, zf = (r) => "#" + r.match(/\d+/g).map(Vf).join(""), eh = (r, e, t = "", n = !1) => {
|
|
11096
11096
|
let [i, s] = _f(r);
|
|
11097
11097
|
return Number.isNaN(i) || i === 0 ? {} : t === "atLeast" && i < 1 ? {} : (s = s || e, i += s ? 4 : 0.2, n ? { "line-height": `${i}${s}` } : `line-height: ${i}${s}`);
|
|
11098
11098
|
}, Gf = (r, e) => {
|
|
@@ -13756,25 +13756,25 @@ function qt(r) {
|
|
|
13756
13756
|
doc: yd,
|
|
13757
13757
|
body: gd,
|
|
13758
13758
|
paragraph: su,
|
|
13759
|
-
text:
|
|
13759
|
+
text: bd,
|
|
13760
13760
|
bulletList: Fo,
|
|
13761
13761
|
orderedList: Fo,
|
|
13762
|
-
lineBreak:
|
|
13763
|
-
table:
|
|
13764
|
-
tableRow:
|
|
13765
|
-
tableCell:
|
|
13766
|
-
bookmarkStart:
|
|
13767
|
-
fieldAnnotation:
|
|
13768
|
-
tab:
|
|
13762
|
+
lineBreak: Td,
|
|
13763
|
+
table: Fd,
|
|
13764
|
+
tableRow: Pd,
|
|
13765
|
+
tableCell: Ld,
|
|
13766
|
+
bookmarkStart: Md,
|
|
13767
|
+
fieldAnnotation: Wd,
|
|
13768
|
+
tab: kd,
|
|
13769
13769
|
image: lu,
|
|
13770
|
-
hardBreak:
|
|
13770
|
+
hardBreak: Jd,
|
|
13771
13771
|
commentRangeStart: () => So(r, "Start"),
|
|
13772
13772
|
commentRangeEnd: () => So(r, "End"),
|
|
13773
13773
|
commentReference: () => null,
|
|
13774
|
-
shapeContainer:
|
|
13775
|
-
shapeTextbox:
|
|
13776
|
-
contentBlock:
|
|
13777
|
-
structuredContent:
|
|
13774
|
+
shapeContainer: $d,
|
|
13775
|
+
shapeTextbox: Kd,
|
|
13776
|
+
contentBlock: Xd,
|
|
13777
|
+
structuredContent: Qd
|
|
13778
13778
|
};
|
|
13779
13779
|
return t[e] ? t[e](r) : (console.error("No translation function found for node type:", e), null);
|
|
13780
13780
|
}
|
|
@@ -13894,29 +13894,9 @@ function lt(r) {
|
|
|
13894
13894
|
const t = [];
|
|
13895
13895
|
return e.forEach((n) => {
|
|
13896
13896
|
let i = qt({ ...r, node: n });
|
|
13897
|
-
|
|
13897
|
+
i?.name || i?.type, i instanceof Array ? t.push(...i) : t.push(i);
|
|
13898
13898
|
}), t.filter((n) => n);
|
|
13899
13899
|
}
|
|
13900
|
-
const bd = (r) => {
|
|
13901
|
-
if (!r) return r;
|
|
13902
|
-
const e = r.elements?.some((a) => a.name === "w:r"), t = r.elements?.some((a) => a.name === "w:sdt");
|
|
13903
|
-
if (!r.elements?.find((a) => a.name === "w:sdt")?.elements?.find((a) => a.name === "w:sdtPr")?.elements?.some((a) => a.name === "w:alias")) return r;
|
|
13904
|
-
let o = r;
|
|
13905
|
-
if (e && t) {
|
|
13906
|
-
const a = r.elements.filter((l) => l.name === "w:sdt"), u = r.elements.filter((l) => l.name !== "w:sdt");
|
|
13907
|
-
o = [
|
|
13908
|
-
...u.filter((l) => l.name === "w:r").every((l) => l.elements.filter((g) => g.name === "w:t")?.every((g) => g.elements[0].text.trim().length > 0)) ? [{
|
|
13909
|
-
...r,
|
|
13910
|
-
elements: u
|
|
13911
|
-
}] : [],
|
|
13912
|
-
{
|
|
13913
|
-
name: "w:p",
|
|
13914
|
-
elements: a
|
|
13915
|
-
}
|
|
13916
|
-
];
|
|
13917
|
-
}
|
|
13918
|
-
return o;
|
|
13919
|
-
};
|
|
13920
13900
|
function Br(r, e, t) {
|
|
13921
13901
|
const i = /^\s|\s$/.test(r) ? "preserve" : null, s = i ? { "xml:space": i } : null, o = [], a = kr(e);
|
|
13922
13902
|
if (o.push({
|
|
@@ -13952,14 +13932,14 @@ function Br(r, e, t) {
|
|
|
13952
13932
|
}
|
|
13953
13933
|
return Zt(o, a);
|
|
13954
13934
|
}
|
|
13955
|
-
function
|
|
13935
|
+
function bd(r) {
|
|
13956
13936
|
const { node: e } = r, t = [xr, Pi];
|
|
13957
|
-
if (e.marks?.some((a) => t.includes(a.type))) return
|
|
13958
|
-
if (e.marks?.some((a) => a.type === "link")) return
|
|
13937
|
+
if (e.marks?.some((a) => t.includes(a.type))) return Ad(r);
|
|
13938
|
+
if (e.marks?.some((a) => a.type === "link")) return Dd(r);
|
|
13959
13939
|
const { text: s, marks: o = [] } = e;
|
|
13960
13940
|
return Br(s, o, r);
|
|
13961
13941
|
}
|
|
13962
|
-
function
|
|
13942
|
+
function xd(r) {
|
|
13963
13943
|
const e = r.find((t) => t.type === Oi);
|
|
13964
13944
|
if (e)
|
|
13965
13945
|
return {
|
|
@@ -13974,8 +13954,8 @@ function Ad(r) {
|
|
|
13974
13954
|
elements: e.attrs.before.map((n) => kr([n])).filter((n) => n !== void 0)
|
|
13975
13955
|
};
|
|
13976
13956
|
}
|
|
13977
|
-
function
|
|
13978
|
-
const { node: e } = r, t = e.marks, n = [xr, Pi, Oi], i = t.find((c) => n.includes(c.type)), s = i.type === xr, o =
|
|
13957
|
+
function Ad(r) {
|
|
13958
|
+
const { node: e } = r, t = e.marks, n = [xr, Pi, Oi], i = t.find((c) => n.includes(c.type)), s = i.type === xr, o = xd(t);
|
|
13979
13959
|
e.marks = t.filter((c) => !n.includes(c.type)), o && e.marks.push(o);
|
|
13980
13960
|
const a = qt({ ...r, node: e });
|
|
13981
13961
|
if (!s) {
|
|
@@ -14013,7 +13993,7 @@ function kr(r = []) {
|
|
|
14013
13993
|
return Bo(i);
|
|
14014
13994
|
}) : Bo(e));
|
|
14015
13995
|
}
|
|
14016
|
-
function
|
|
13996
|
+
function Dd(r) {
|
|
14017
13997
|
const { node: e } = r, t = e.marks.find((u) => u.type === "link"), n = t.attrs.href;
|
|
14018
13998
|
let i = t.attrs.rId;
|
|
14019
13999
|
i || (i = uu(r, n)), e.marks = e.marks.filter((u) => u.type !== "link");
|
|
@@ -14082,9 +14062,9 @@ function To(r, e) {
|
|
|
14082
14062
|
return r.relationships.push(n), t;
|
|
14083
14063
|
}
|
|
14084
14064
|
function Fo(r) {
|
|
14085
|
-
const { type: e } = r.node, t =
|
|
14065
|
+
const { type: e } = r.node, t = Sd(r), n = [];
|
|
14086
14066
|
return t.forEach((i) => {
|
|
14087
|
-
const { level: s, listType: o, pPrs: a, content: u, attrs: c = {} } = i, g = (i.attrs.numId || i.listId) ??
|
|
14067
|
+
const { level: s, listType: o, pPrs: a, content: u, attrs: c = {} } = i, g = (i.attrs.numId || i.listId) ?? vd(r, o), E = Cd(s, g, a);
|
|
14088
14068
|
u.forEach((A, v) => {
|
|
14089
14069
|
const F = Object.assign({}, A);
|
|
14090
14070
|
F.attrs = {
|
|
@@ -14120,8 +14100,8 @@ function Fo(r) {
|
|
|
14120
14100
|
});
|
|
14121
14101
|
}), n;
|
|
14122
14102
|
}
|
|
14123
|
-
function
|
|
14124
|
-
const t =
|
|
14103
|
+
function vd(r, e) {
|
|
14104
|
+
const t = Ed(r.converter?.numbering?.definitions), n = e === "bullet" ? nd : rd, i = t, s = n.attributes["w:abstractNumId"], o = {
|
|
14125
14105
|
type: "element",
|
|
14126
14106
|
name: "w:num",
|
|
14127
14107
|
attributes: {
|
|
@@ -14134,8 +14114,8 @@ function Ed(r, e) {
|
|
|
14134
14114
|
};
|
|
14135
14115
|
return r.converter.numbering.definitions[i] = o, i;
|
|
14136
14116
|
}
|
|
14137
|
-
const
|
|
14138
|
-
function
|
|
14117
|
+
const Ed = (r) => !r || !Object.keys(r).length ? 0 : Math.max(...Object.keys(r).map((t) => parseInt(t, 10))) + 1;
|
|
14118
|
+
function Cd(r, e, t = []) {
|
|
14139
14119
|
return {
|
|
14140
14120
|
name: "w:pPr",
|
|
14141
14121
|
type: "element",
|
|
@@ -14160,7 +14140,7 @@ function Sd(r, e, t = []) {
|
|
|
14160
14140
|
]
|
|
14161
14141
|
};
|
|
14162
14142
|
}
|
|
14163
|
-
function
|
|
14143
|
+
function Sd({ node: r }) {
|
|
14164
14144
|
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((l) => l.name !== "w:numPr") || [], u = [];
|
|
14165
14145
|
function c(l, h = 0) {
|
|
14166
14146
|
!l || !l.length || l.forEach((g) => {
|
|
@@ -14181,22 +14161,22 @@ function Td({ node: r }) {
|
|
|
14181
14161
|
}
|
|
14182
14162
|
return c(e), u;
|
|
14183
14163
|
}
|
|
14184
|
-
function
|
|
14164
|
+
function Td(r) {
|
|
14185
14165
|
const e = {}, { lineBreakType: t } = r.node?.attrs || {};
|
|
14186
14166
|
return t && (e["w:type"] = t), {
|
|
14187
14167
|
name: "w:br",
|
|
14188
14168
|
attributes: e
|
|
14189
14169
|
};
|
|
14190
14170
|
}
|
|
14191
|
-
function
|
|
14192
|
-
r.node =
|
|
14193
|
-
const e = lt(r), t =
|
|
14171
|
+
function Fd(r) {
|
|
14172
|
+
r.node = Bd(r.node, r);
|
|
14173
|
+
const e = lt(r), t = Nd(r.node), n = Rd(r.node, r);
|
|
14194
14174
|
return e.unshift(t), e.unshift(n), {
|
|
14195
14175
|
name: "w:tbl",
|
|
14196
14176
|
elements: e
|
|
14197
14177
|
};
|
|
14198
14178
|
}
|
|
14199
|
-
function
|
|
14179
|
+
function Bd(r, { editorSchema: e }) {
|
|
14200
14180
|
const { content: t } = r;
|
|
14201
14181
|
for (let n = 0; n < t.length; n++) {
|
|
14202
14182
|
const i = t[n];
|
|
@@ -14232,13 +14212,13 @@ function kd(r, { editorSchema: e }) {
|
|
|
14232
14212
|
}
|
|
14233
14213
|
return r;
|
|
14234
14214
|
}
|
|
14235
|
-
function
|
|
14215
|
+
function kd(r) {
|
|
14236
14216
|
const { marks: e = [] } = r.node, t = kr(e);
|
|
14237
14217
|
return Zt({
|
|
14238
14218
|
name: "w:tab"
|
|
14239
14219
|
}, t);
|
|
14240
14220
|
}
|
|
14241
|
-
function
|
|
14221
|
+
function Nd(r) {
|
|
14242
14222
|
const e = [], { attrs: t } = r, { tableWidth: n, tableWidthType: i, tableStyleId: s, borders: o, tableIndent: a, tableLayout: u, tableCellSpacing: c } = t;
|
|
14243
14223
|
if (s) {
|
|
14244
14224
|
const l = {
|
|
@@ -14248,7 +14228,7 @@ function Id(r) {
|
|
|
14248
14228
|
e.push(l);
|
|
14249
14229
|
}
|
|
14250
14230
|
if (o) {
|
|
14251
|
-
const l =
|
|
14231
|
+
const l = Id(r);
|
|
14252
14232
|
e.push(l);
|
|
14253
14233
|
}
|
|
14254
14234
|
if (a) {
|
|
@@ -14283,7 +14263,7 @@ function Id(r) {
|
|
|
14283
14263
|
elements: e
|
|
14284
14264
|
};
|
|
14285
14265
|
}
|
|
14286
|
-
function
|
|
14266
|
+
function Id(r) {
|
|
14287
14267
|
const { borders: e } = r.attrs, t = [];
|
|
14288
14268
|
return e ? (["top", "bottom", "left", "right", "insideH", "insideV"].forEach((i) => {
|
|
14289
14269
|
const s = e[i];
|
|
@@ -14307,7 +14287,7 @@ function Rd(r) {
|
|
|
14307
14287
|
elements: t
|
|
14308
14288
|
}) : void 0;
|
|
14309
14289
|
}
|
|
14310
|
-
function
|
|
14290
|
+
function Rd(r, e) {
|
|
14311
14291
|
const { editorSchema: t } = e;
|
|
14312
14292
|
let n = [];
|
|
14313
14293
|
try {
|
|
@@ -14330,14 +14310,14 @@ function Pd(r, e) {
|
|
|
14330
14310
|
elements: i
|
|
14331
14311
|
};
|
|
14332
14312
|
}
|
|
14333
|
-
function
|
|
14334
|
-
const e = lt(r), t =
|
|
14313
|
+
function Pd(r) {
|
|
14314
|
+
const e = lt(r), t = Od(r.node);
|
|
14335
14315
|
return t.elements.length && e.unshift(t), {
|
|
14336
14316
|
name: "w:tr",
|
|
14337
14317
|
elements: e
|
|
14338
14318
|
};
|
|
14339
14319
|
}
|
|
14340
|
-
function
|
|
14320
|
+
function Od(r) {
|
|
14341
14321
|
const { attrs: e } = r, t = [], { rowHeight: n, rowHeightType: i } = e;
|
|
14342
14322
|
if (n) {
|
|
14343
14323
|
const s = { "w:val": Te(n) };
|
|
@@ -14353,17 +14333,17 @@ function Ld(r) {
|
|
|
14353
14333
|
elements: t
|
|
14354
14334
|
};
|
|
14355
14335
|
}
|
|
14356
|
-
function
|
|
14336
|
+
function Ld(r) {
|
|
14357
14337
|
const e = lt({
|
|
14358
14338
|
...r,
|
|
14359
14339
|
tableCell: r.node
|
|
14360
|
-
}), t =
|
|
14340
|
+
}), t = _d(r.node);
|
|
14361
14341
|
return e.unshift(t), {
|
|
14362
14342
|
name: "w:tc",
|
|
14363
14343
|
elements: e
|
|
14364
14344
|
};
|
|
14365
14345
|
}
|
|
14366
|
-
function
|
|
14346
|
+
function _d(r) {
|
|
14367
14347
|
const e = [], { attrs: t } = r, { colwidth: n = [], cellWidthType: i = "dxa", background: s = {}, colspan: o, rowspan: a, widthUnit: u } = t, c = n.reduce((v, F) => v + F, 0), l = {
|
|
14368
14348
|
name: "w:tcW",
|
|
14369
14349
|
attributes: { "w:w": u === "px" ? Te(c) : It(c), "w:type": i }
|
|
@@ -14387,7 +14367,7 @@ function qd(r) {
|
|
|
14387
14367
|
if (g) {
|
|
14388
14368
|
const v = {
|
|
14389
14369
|
name: "w:tcMar",
|
|
14390
|
-
elements:
|
|
14370
|
+
elements: qd(g)
|
|
14391
14371
|
};
|
|
14392
14372
|
e.push(v);
|
|
14393
14373
|
}
|
|
@@ -14439,11 +14419,11 @@ function qd(r) {
|
|
|
14439
14419
|
elements: e
|
|
14440
14420
|
};
|
|
14441
14421
|
}
|
|
14442
|
-
function
|
|
14422
|
+
function qd(r) {
|
|
14443
14423
|
const e = [], { top: t, right: n, bottom: i, left: s } = r;
|
|
14444
14424
|
return t != null && e.push({ name: "w:top", attributes: { "w:w": Te(t) } }), n != null && e.push({ name: "w:right", attributes: { "w:w": Te(n) } }), i != null && e.push({ name: "w:bottom", attributes: { "w:w": Te(i) } }), s != null && e.push({ name: "w:left", attributes: { "w:w": Te(s) } }), e;
|
|
14445
14425
|
}
|
|
14446
|
-
function
|
|
14426
|
+
function Md(r) {
|
|
14447
14427
|
const e = {
|
|
14448
14428
|
name: "w:bookmarkStart",
|
|
14449
14429
|
attributes: {
|
|
@@ -14500,7 +14480,7 @@ function Bo(r) {
|
|
|
14500
14480
|
}
|
|
14501
14481
|
return t;
|
|
14502
14482
|
}
|
|
14503
|
-
function
|
|
14483
|
+
function Ud(r) {
|
|
14504
14484
|
if (!r) return {};
|
|
14505
14485
|
const e = r.split(";")[0].split("/")[1];
|
|
14506
14486
|
if (!r || e !== "png")
|
|
@@ -14514,7 +14494,7 @@ function jd(r) {
|
|
|
14514
14494
|
originalHeight: i.getInt32(20)
|
|
14515
14495
|
};
|
|
14516
14496
|
}
|
|
14517
|
-
function
|
|
14497
|
+
function jd(r, e, t, n) {
|
|
14518
14498
|
let i = r, s = e, o = Math.min(t / r, n / e);
|
|
14519
14499
|
return i = Math.round(i * o), s = Math.round(s * o), { scaledWidth: i, scaledHeight: s };
|
|
14520
14500
|
}
|
|
@@ -14524,20 +14504,20 @@ function lu(r, e) {
|
|
|
14524
14504
|
tableCell: i
|
|
14525
14505
|
} = r;
|
|
14526
14506
|
let s = t.rId;
|
|
14527
|
-
const o = t.src || t.imageSrc, { originalWidth: a, originalHeight: u } =
|
|
14507
|
+
const o = t.src || t.imageSrc, { originalWidth: a, originalHeight: u } = Ud(o);
|
|
14528
14508
|
let c = t.size ? {
|
|
14529
14509
|
w: mt(t.size.width),
|
|
14530
14510
|
h: mt(t.size.height)
|
|
14531
14511
|
} : e;
|
|
14532
14512
|
if (a && u) {
|
|
14533
|
-
const F = Me(c.w), w = Me(c.h), { scaledWidth: B, scaledHeight: R } =
|
|
14513
|
+
const F = Me(c.w), w = Me(c.h), { scaledWidth: B, scaledHeight: R } = jd(a, u, F, w);
|
|
14534
14514
|
c = {
|
|
14535
14515
|
w: mt(B),
|
|
14536
14516
|
h: mt(R)
|
|
14537
14517
|
};
|
|
14538
14518
|
}
|
|
14539
14519
|
if (i) {
|
|
14540
|
-
const F = i.attrs.colwidth.reduce((N, M) => N + M, 0), w = i.attrs.cellMargins?.left || 8, B = i.attrs.cellMargins?.right || 8, R = mt(F - (w + B)), { width: D, height: k } =
|
|
14520
|
+
const F = i.attrs.colwidth.reduce((N, M) => N + M, 0), w = i.attrs.cellMargins?.left || 8, B = i.attrs.cellMargins?.right || 8, R = mt(F - (w + B)), { width: D, height: k } = Yd(c.w, c.h, R);
|
|
14541
14521
|
D && k && (c = { w: D, h: k });
|
|
14542
14522
|
}
|
|
14543
14523
|
if (r.node.type === "image" && !s) {
|
|
@@ -14778,13 +14758,13 @@ function cu(r) {
|
|
|
14778
14758
|
} = r, n = fu(e);
|
|
14779
14759
|
return Br(e.displayLabel, [...t, ...n], r);
|
|
14780
14760
|
}
|
|
14781
|
-
function
|
|
14761
|
+
function Hd(r) {
|
|
14782
14762
|
const {
|
|
14783
14763
|
node: { attrs: e = {}, marks: t = [] }
|
|
14784
14764
|
} = r, n = Rc.decode(e.displayLabel);
|
|
14785
14765
|
return Br(n, t, r);
|
|
14786
14766
|
}
|
|
14787
|
-
function
|
|
14767
|
+
function Vd(r) {
|
|
14788
14768
|
const {
|
|
14789
14769
|
node: { attrs: e = {}, marks: t = [] },
|
|
14790
14770
|
editorSchema: n
|
|
@@ -14792,7 +14772,7 @@ function zd(r) {
|
|
|
14792
14772
|
let u = Ct.create({
|
|
14793
14773
|
doc: yr.fromSchema(n).parse(s)
|
|
14794
14774
|
});
|
|
14795
|
-
a.length && (u =
|
|
14775
|
+
a.length && (u = Zd(u, a));
|
|
14796
14776
|
const c = u.doc.toJSON();
|
|
14797
14777
|
return {
|
|
14798
14778
|
name: "htmlAnnotation",
|
|
@@ -14805,7 +14785,7 @@ function zd(r) {
|
|
|
14805
14785
|
function ko(r, e) {
|
|
14806
14786
|
return lu(r, e);
|
|
14807
14787
|
}
|
|
14808
|
-
function
|
|
14788
|
+
function zd(r) {
|
|
14809
14789
|
const {
|
|
14810
14790
|
node: { attrs: e = {}, marks: t = [] }
|
|
14811
14791
|
} = r, n = uu(r, e.linkUrl), i = Br(e.linkUrl, t, r), s = au(i);
|
|
@@ -14819,7 +14799,7 @@ function Gd(r) {
|
|
|
14819
14799
|
elements: [s]
|
|
14820
14800
|
};
|
|
14821
14801
|
}
|
|
14822
|
-
function
|
|
14802
|
+
function Gd(r) {
|
|
14823
14803
|
const e = {
|
|
14824
14804
|
w: 4286250,
|
|
14825
14805
|
h: 4286250
|
|
@@ -14831,9 +14811,9 @@ function Wd(r) {
|
|
|
14831
14811
|
text: cu,
|
|
14832
14812
|
image: (i) => ko(i, e),
|
|
14833
14813
|
signature: (i) => ko(i, t),
|
|
14834
|
-
checkbox:
|
|
14835
|
-
html:
|
|
14836
|
-
link:
|
|
14814
|
+
checkbox: Hd,
|
|
14815
|
+
html: Vd,
|
|
14816
|
+
link: zd
|
|
14837
14817
|
}[r];
|
|
14838
14818
|
}
|
|
14839
14819
|
const fu = (r = {}) => {
|
|
@@ -14848,8 +14828,8 @@ const fu = (r = {}) => {
|
|
|
14848
14828
|
} = r, u = [];
|
|
14849
14829
|
return e && u.push({ type: "fontFamily", attrs: { fontFamily: e } }), t && u.push({ type: "fontSize", attrs: { fontSize: t } }), n && u.push({ type: "bold", attrs: {} }), i && u.push({ type: "underline", attrs: {} }), s && u.push({ type: "italic", attrs: {} }), o && u.push({ type: "color", attrs: { color: o } }), a && u.push({ type: "highlight", attrs: { color: a } }), u;
|
|
14850
14830
|
};
|
|
14851
|
-
function
|
|
14852
|
-
const { node: e, isFinalDoc: t } = r, { attrs: n = {} } = e, i =
|
|
14831
|
+
function Wd(r) {
|
|
14832
|
+
const { node: e, isFinalDoc: t } = r, { attrs: n = {} } = e, i = Gd(n.type);
|
|
14853
14833
|
if (!i) return {};
|
|
14854
14834
|
let s, o;
|
|
14855
14835
|
if (t)
|
|
@@ -14929,7 +14909,7 @@ function Jd(r) {
|
|
|
14929
14909
|
]
|
|
14930
14910
|
};
|
|
14931
14911
|
}
|
|
14932
|
-
function
|
|
14912
|
+
function Jd(r) {
|
|
14933
14913
|
const { node: e = {} } = r, { attrs: t = {} } = e, { pageBreakSource: n } = t;
|
|
14934
14914
|
return n === "sectPr" ? null : {
|
|
14935
14915
|
name: "w:r",
|
|
@@ -14940,7 +14920,7 @@ function $d(r) {
|
|
|
14940
14920
|
}]
|
|
14941
14921
|
};
|
|
14942
14922
|
}
|
|
14943
|
-
function
|
|
14923
|
+
function $d(r) {
|
|
14944
14924
|
const { node: e } = r, t = lt(r), n = {
|
|
14945
14925
|
name: "v:shape",
|
|
14946
14926
|
attributes: {
|
|
@@ -14966,7 +14946,7 @@ function Kd(r) {
|
|
|
14966
14946
|
elements: [Zt(i)]
|
|
14967
14947
|
};
|
|
14968
14948
|
}
|
|
14969
|
-
function
|
|
14949
|
+
function Kd(r) {
|
|
14970
14950
|
const { node: e } = r, n = {
|
|
14971
14951
|
name: "w:txbxContent",
|
|
14972
14952
|
elements: lt(r)
|
|
@@ -14979,7 +14959,7 @@ function Xd(r) {
|
|
|
14979
14959
|
elements: [n]
|
|
14980
14960
|
};
|
|
14981
14961
|
}
|
|
14982
|
-
function
|
|
14962
|
+
function Xd(r) {
|
|
14983
14963
|
const { node: e } = r, { drawingContent: t } = e.attrs, n = {
|
|
14984
14964
|
name: "w:drawing",
|
|
14985
14965
|
elements: [
|
|
@@ -15046,14 +15026,14 @@ nt = new WeakSet(), du = function(e, t = falase) {
|
|
|
15046
15026
|
}
|
|
15047
15027
|
return a || u.push(`</${n}>`), u;
|
|
15048
15028
|
};
|
|
15049
|
-
function
|
|
15029
|
+
function Yd(r, e, t) {
|
|
15050
15030
|
if (r > t) {
|
|
15051
15031
|
let n = t / r, i = Math.round(e * n);
|
|
15052
15032
|
return { width: t, height: i };
|
|
15053
15033
|
}
|
|
15054
15034
|
return { width: r, height: e };
|
|
15055
15035
|
}
|
|
15056
|
-
function
|
|
15036
|
+
function Zd(r, e) {
|
|
15057
15037
|
const { tr: t, doc: n, schema: i } = r, s = ["fontFamily", "fontSize", "highlight"];
|
|
15058
15038
|
if (!e.some((h) => s.includes(h.type)))
|
|
15059
15039
|
return r;
|
|
@@ -15075,7 +15055,7 @@ function Qd(r, e) {
|
|
|
15075
15055
|
}));
|
|
15076
15056
|
}), r.apply(t);
|
|
15077
15057
|
}
|
|
15078
|
-
function
|
|
15058
|
+
function Qd(r) {
|
|
15079
15059
|
const { node: e } = r, { attrs: t = {} } = e, i = [
|
|
15080
15060
|
{
|
|
15081
15061
|
name: "w:sdtContent",
|
|
@@ -15087,21 +15067,21 @@ function em(r) {
|
|
|
15087
15067
|
elements: i
|
|
15088
15068
|
};
|
|
15089
15069
|
}
|
|
15090
|
-
const
|
|
15070
|
+
const em = '<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>', tm = (r) => JSON.parse(ba.xml2json(r, null, 2)), rm = (r, e = em) => r["word/document.xml"] || tm(e), nm = (r) => {
|
|
15091
15071
|
const { nodes: e } = r;
|
|
15092
15072
|
if (e.length === 0)
|
|
15093
15073
|
return { nodes: [], consumed: 0 };
|
|
15094
15074
|
const t = e[0];
|
|
15095
15075
|
switch (t.name) {
|
|
15096
15076
|
case "w:tbl":
|
|
15097
|
-
return { nodes: [
|
|
15077
|
+
return { nodes: [sm(t, r)], consumed: 1 };
|
|
15098
15078
|
}
|
|
15099
15079
|
return { nodes: [], consumed: 0 };
|
|
15100
|
-
},
|
|
15080
|
+
}, im = {
|
|
15101
15081
|
handlerName: "tableNodeHandler",
|
|
15102
|
-
handler:
|
|
15082
|
+
handler: nm
|
|
15103
15083
|
};
|
|
15104
|
-
function
|
|
15084
|
+
function sm(r, e) {
|
|
15105
15085
|
const { docx: t, nodeListHandler: n } = e, i = r.elements.find((k) => k.name === "w:tblPr"), o = i.elements.find((k) => k.name === "w:tblBorders")?.elements || [], { borders: a, rowBorders: u } = pu(o), c = i.elements.find((k) => k.name === "w:tblStyle"), h = { tableStyleId: c?.attributes["w:val"] }, g = i?.elements.find((k) => k.name === "w:tblInd");
|
|
15106
15086
|
if (g) {
|
|
15107
15087
|
const { "w:w": k, "w:type": N } = g.attributes;
|
|
@@ -15126,7 +15106,7 @@ function om(r, e) {
|
|
|
15126
15106
|
h.borders = B;
|
|
15127
15107
|
const D = [];
|
|
15128
15108
|
return w.forEach((k) => {
|
|
15129
|
-
const N =
|
|
15109
|
+
const N = um(k, r, R, c, e);
|
|
15130
15110
|
N.content?.length && D.push(N);
|
|
15131
15111
|
}), {
|
|
15132
15112
|
type: "table",
|
|
@@ -15134,15 +15114,15 @@ function om(r, e) {
|
|
|
15134
15114
|
attrs: h
|
|
15135
15115
|
};
|
|
15136
15116
|
}
|
|
15137
|
-
function
|
|
15138
|
-
const { docx: u, nodeListHandler: c } = o, l = r.elements.find((se) => se.name === "w:tcPr"), h = l?.elements?.find((se) => se.name === "w:tcBorders"), g =
|
|
15117
|
+
function om(r, e, t, n, i = null, s, o, a) {
|
|
15118
|
+
const { docx: u, nodeListHandler: c } = o, l = r.elements.find((se) => se.name === "w:tcPr"), h = l?.elements?.find((se) => se.name === "w:tcBorders"), g = am(h, n), E = hu(t), A = l?.elements?.find((se) => se.name === "w:tcW");
|
|
15139
15119
|
let v = A ? be(A.attributes["w:w"]) : null;
|
|
15140
15120
|
const F = A?.attributes["w:type"];
|
|
15141
15121
|
!v && i && (v = i);
|
|
15142
15122
|
const w = Io(r), { attributes: B } = w || {}, D = {
|
|
15143
15123
|
color: l?.elements?.find((se) => se.name === "w:shd")?.attributes["w:fill"]
|
|
15144
15124
|
}, N = l?.elements?.find((se) => se.name === "w:gridSpan")?.attributes["w:val"], M = l?.elements?.find((se) => se.name === "w:tcMar"), C = l?.elements?.find((se) => se.name === "w:vAlign")?.attributes["w:val"] || "top", J = {}, oe = mu(s, u) || {};
|
|
15145
|
-
J.cellMargins =
|
|
15125
|
+
J.cellMargins = lm(M, oe);
|
|
15146
15126
|
const { fontSize: Z, fonts: fe = {} } = oe, de = fe.ascii;
|
|
15147
15127
|
if (v) {
|
|
15148
15128
|
J.colwidth = [v], J.widthUnit = "px";
|
|
@@ -15188,7 +15168,7 @@ const Io = (r) => r.elements.find((n) => n.name === "w:tcPr")?.elements?.find((n
|
|
|
15188
15168
|
return Object.keys(i) ? (i.val = "none", i) : null;
|
|
15189
15169
|
}
|
|
15190
15170
|
return null;
|
|
15191
|
-
},
|
|
15171
|
+
}, am = (r, e) => {
|
|
15192
15172
|
if (!r) return null;
|
|
15193
15173
|
const t = {}, n = or(r, "bottom", e);
|
|
15194
15174
|
n && (t.bottom = n);
|
|
@@ -15256,7 +15236,7 @@ function pu(r) {
|
|
|
15256
15236
|
rowBorders: t
|
|
15257
15237
|
};
|
|
15258
15238
|
}
|
|
15259
|
-
function
|
|
15239
|
+
function um(r, e, t, n, i) {
|
|
15260
15240
|
const s = {}, a = r.elements.find((A) => A.name === "w:trPr")?.elements?.find((A) => A.name === "w:trHeight"), u = a?.attributes["w:val"];
|
|
15261
15241
|
a?.attributes["w:hRule"];
|
|
15262
15242
|
const c = {};
|
|
@@ -15266,12 +15246,12 @@ function lm(r, e, t, n, i) {
|
|
|
15266
15246
|
type: "tableRow",
|
|
15267
15247
|
content: h?.map((A, v) => {
|
|
15268
15248
|
const F = h.length > 1 ? l[v] : null;
|
|
15269
|
-
return
|
|
15249
|
+
return om(A, r, e, c, F, n, i, v);
|
|
15270
15250
|
}) || [],
|
|
15271
15251
|
attrs: s
|
|
15272
15252
|
};
|
|
15273
15253
|
}
|
|
15274
|
-
const
|
|
15254
|
+
const lm = (r, e) => {
|
|
15275
15255
|
const t = r?.elements?.find((F) => F.name === "w:left"), n = r?.elements?.find((F) => F.name === "w:right"), i = r?.elements?.find((F) => F.name === "w:top"), s = r?.elements?.find((F) => F.name === "w:bottom"), o = t?.attributes["w:w"], a = n?.attributes["w:w"], u = i?.attributes["w:w"], c = s?.attributes["w:w"], { cellMargins: l = {} } = e, {
|
|
15276
15256
|
marginLeft: h,
|
|
15277
15257
|
marginRight: g,
|
|
@@ -15284,7 +15264,7 @@ const cm = (r, e) => {
|
|
|
15284
15264
|
top: be(u ?? E),
|
|
15285
15265
|
bottom: be(c ?? A)
|
|
15286
15266
|
};
|
|
15287
|
-
}, hu = (r) => r.elements.find((t) => t.name === "w:tblGrid")?.elements?.flatMap((t) => t.name !== "w:gridCol" ? [] : be(t.attributes["w:w"])) || [],
|
|
15267
|
+
}, hu = (r) => r.elements.find((t) => t.name === "w:tblGrid")?.elements?.flatMap((t) => t.name !== "w:gridCol" ? [] : be(t.attributes["w:w"])) || [], cm = (r) => {
|
|
15288
15268
|
const { nodes: e, filename: t } = r, n = ["w:drawing", "w:p"];
|
|
15289
15269
|
if (e.length === 0 || !n.includes(e[0].name))
|
|
15290
15270
|
return { nodes: [], consumed: 0 };
|
|
@@ -15308,7 +15288,7 @@ function Ro(r, e, t) {
|
|
|
15308
15288
|
height: Me(o.attributes?.cy)
|
|
15309
15289
|
}, c = r.elements.find((q) => q.name === "a:graphic").elements.find((q) => q.name === "a:graphicData"), { uri: l } = c?.attributes;
|
|
15310
15290
|
if (l && l === "http://schemas.microsoft.com/office/word/2010/wordprocessingShape")
|
|
15311
|
-
return
|
|
15291
|
+
return fm(t, r, c);
|
|
15312
15292
|
const g = c.elements.find((q) => q.name === "pic:pic");
|
|
15313
15293
|
if (!g || !g.elements) return null;
|
|
15314
15294
|
const A = g.elements.find((q) => q.name === "pic:blipFill").elements.find((q) => q.name === "a:blip"), v = r.elements.find((q) => q.name === "wp:positionH"), F = v?.elements.find((q) => q.name === "wp:posOffset"), w = Me(F?.elements[0]?.text), B = v?.attributes.relativeFrom, R = v?.elements.find((q) => q.name === "wp:align")?.elements[0]?.text, D = r.elements.find((q) => q.name === "wp:positionV"), k = D?.elements.find((q) => q.name === "wp:posOffset"), N = Me(k?.elements[0]?.text), M = D?.attributes.relativeFrom, _ = D?.elements.find((q) => q.name === "wp:align")?.elements[0]?.text, C = r.elements.find((q) => q.name === "wp:simplePos"), J = r.elements.find((q) => q.name === "wp:wrapSquare"), oe = r.elements.find((q) => q.name === "wp:wrapTopAndBottom"), Z = r.elements.find((q) => q.name === "wp:docPr");
|
|
@@ -15359,12 +15339,12 @@ function Ro(r, e, t) {
|
|
|
15359
15339
|
}
|
|
15360
15340
|
};
|
|
15361
15341
|
}
|
|
15362
|
-
const
|
|
15342
|
+
const fm = (r, e, t) => {
|
|
15363
15343
|
const n = t.elements.find((l) => l.name === "wps:wsp"), s = n.elements.find((l) => l.name === "wps:txbx")?.elements?.find((l) => l.name === "w:txbxContent");
|
|
15364
15344
|
e.elements.find((l) => l.name === "wp:docPr");
|
|
15365
15345
|
const o = n.elements.find((l) => l.name === "wps:spPr"), a = o?.elements.find((l) => l.name === "a:prstGeom");
|
|
15366
15346
|
if (a && a.attributes.prst === "rect")
|
|
15367
|
-
return
|
|
15347
|
+
return dm(r, o);
|
|
15368
15348
|
if (!s)
|
|
15369
15349
|
return null;
|
|
15370
15350
|
const { nodeListHandler: u } = r;
|
|
@@ -15373,7 +15353,7 @@ const dm = (r, e, t) => {
|
|
|
15373
15353
|
node: s.elements[0],
|
|
15374
15354
|
nodes: s.elements
|
|
15375
15355
|
})[0];
|
|
15376
|
-
},
|
|
15356
|
+
}, dm = (r, e) => {
|
|
15377
15357
|
const t = {}, [n] = r.nodes;
|
|
15378
15358
|
n?.name === "w:drawing" && (t.drawingContent = n);
|
|
15379
15359
|
const i = e.elements.find((l) => l.name === "a:xfrm"), s = i.elements.find((l) => l.name === "a:off"), o = i.elements.find((l) => l.name === "a:ext");
|
|
@@ -15390,9 +15370,9 @@ const dm = (r, e, t) => {
|
|
|
15390
15370
|
type: "contentBlock",
|
|
15391
15371
|
attrs: t
|
|
15392
15372
|
};
|
|
15393
|
-
},
|
|
15373
|
+
}, mm = {
|
|
15394
15374
|
handlerName: "drawingNodeHandler",
|
|
15395
|
-
handler:
|
|
15375
|
+
handler: cm
|
|
15396
15376
|
};
|
|
15397
15377
|
function Rt(r, e = [], t = null) {
|
|
15398
15378
|
const n = [], i = /* @__PURE__ */ new Set();
|
|
@@ -15417,7 +15397,7 @@ function Rt(r, e = [], t = null) {
|
|
|
15417
15397
|
const { attributes: u = {} } = s, c = { type: a.type };
|
|
15418
15398
|
if (!(u["w:val"] == "0" || u["w:val"] === "none")) {
|
|
15419
15399
|
if (a.mark && (c.type = a.mark), Object.keys(u).length) {
|
|
15420
|
-
const l =
|
|
15400
|
+
const l = hm(a.type, u, t);
|
|
15421
15401
|
if (l == null) return;
|
|
15422
15402
|
c.attrs = {}, c.attrs[a.property] = l;
|
|
15423
15403
|
}
|
|
@@ -15426,7 +15406,7 @@ function Rt(r, e = [], t = null) {
|
|
|
15426
15406
|
});
|
|
15427
15407
|
}), wi(n);
|
|
15428
15408
|
}
|
|
15429
|
-
function
|
|
15409
|
+
function pm(r, e) {
|
|
15430
15410
|
const t = r.elements?.find((o) => o.name === "w:rPrChange");
|
|
15431
15411
|
if (!t)
|
|
15432
15412
|
return [];
|
|
@@ -15447,25 +15427,25 @@ function wi(r) {
|
|
|
15447
15427
|
});
|
|
15448
15428
|
}), [...t, { type: "textStyle", attrs: n }];
|
|
15449
15429
|
}
|
|
15450
|
-
function
|
|
15430
|
+
function hm(r, e, t) {
|
|
15451
15431
|
r === "tabs" && (r = "textIndent");
|
|
15452
15432
|
const n = {
|
|
15453
15433
|
color: () => `#${e["w:val"]}`,
|
|
15454
15434
|
fontSize: () => `${e["w:val"] / 2}pt`,
|
|
15455
|
-
textIndent: () =>
|
|
15456
|
-
fontFamily: () =>
|
|
15457
|
-
lineHeight: () =>
|
|
15435
|
+
textIndent: () => wm(e),
|
|
15436
|
+
fontFamily: () => gm(e, t),
|
|
15437
|
+
lineHeight: () => ym(e),
|
|
15458
15438
|
textAlign: () => e["w:val"],
|
|
15459
15439
|
link: () => e.href,
|
|
15460
15440
|
underline: () => e["w:val"],
|
|
15461
15441
|
bold: () => e?.["w:val"] || null,
|
|
15462
15442
|
italic: () => e?.["w:val"] || null,
|
|
15463
|
-
highlight: () =>
|
|
15443
|
+
highlight: () => bm(e)
|
|
15464
15444
|
};
|
|
15465
15445
|
if (r in n || console.debug("❗️❗️ No value mapper for:", r, "Attributes:", e), r in n)
|
|
15466
15446
|
return n[r], n[r]();
|
|
15467
15447
|
}
|
|
15468
|
-
function
|
|
15448
|
+
function gm(r, e) {
|
|
15469
15449
|
const t = r["w:ascii"], n = r["w:asciiTheme"];
|
|
15470
15450
|
if (!e || !n) return t;
|
|
15471
15451
|
const i = e["word/theme/theme1.xml"];
|
|
@@ -15473,21 +15453,21 @@ function wm(r, e) {
|
|
|
15473
15453
|
const { elements: s } = i, { elements: o } = s[0];
|
|
15474
15454
|
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;
|
|
15475
15455
|
}
|
|
15476
|
-
function
|
|
15456
|
+
function wm(r) {
|
|
15477
15457
|
let e = r["w:left"];
|
|
15478
15458
|
return e ? `${qe(e)}in` : null;
|
|
15479
15459
|
}
|
|
15480
|
-
function
|
|
15460
|
+
function ym(r) {
|
|
15481
15461
|
const e = r["w:line"], t = r["w:lineRule"];
|
|
15482
15462
|
return !e || e === "0" ? null : t === "exact" ? `${tu(e)}pt` : `${Ii(e)}`;
|
|
15483
15463
|
}
|
|
15484
|
-
function
|
|
15464
|
+
function bm(r) {
|
|
15485
15465
|
const e = r["w:fill"];
|
|
15486
15466
|
return e && e !== "auto" ? `#${e}` : Hf(r?.["w:val"]) ? `#${r["w:val"]}` : jf(r?.["w:val"]) || null;
|
|
15487
15467
|
}
|
|
15488
15468
|
function xt(r, e) {
|
|
15489
|
-
const t = [], n = [], { attributes: i = {}, elements: s = [] } = r, { nodes: o, paragraphProperties: a = {}, runProperties: u = {} } =
|
|
15490
|
-
return s.find((l) => l.name === "w:r") && (a.elements = a?.elements?.filter((l) => l.name !== "w:rPr")), u && u?.elements?.length && t.push(...Rt(u, n)), a && a.elements?.length && t.push(...Rt(a, n)), t.push(...
|
|
15469
|
+
const t = [], n = [], { attributes: i = {}, elements: s = [] } = r, { nodes: o, paragraphProperties: a = {}, runProperties: u = {} } = xm(s);
|
|
15470
|
+
return s.find((l) => l.name === "w:r") && (a.elements = a?.elements?.filter((l) => l.name !== "w:rPr")), u && u?.elements?.length && t.push(...Rt(u, n)), a && a.elements?.length && t.push(...Rt(a, n)), t.push(...pm(u, t)), a && a.elements?.length && (i.paragraphProperties = a), t && r.name === "w:p" && t.forEach((l) => {
|
|
15491
15471
|
const h = Object.keys(l.attrs ?? {})[0];
|
|
15492
15472
|
if (h) {
|
|
15493
15473
|
const g = l.attrs[h];
|
|
@@ -15495,7 +15475,7 @@ function xt(r, e) {
|
|
|
15495
15475
|
}
|
|
15496
15476
|
}), { elements: o, attributes: i, marks: t, unknownMarks: n };
|
|
15497
15477
|
}
|
|
15498
|
-
function
|
|
15478
|
+
function xm(r) {
|
|
15499
15479
|
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");
|
|
15500
15480
|
return {
|
|
15501
15481
|
nodes: r.filter((s) => s.name !== "w:pPr" && s.name !== "w:rPr" && s.name !== "w:sectPr"),
|
|
@@ -15507,11 +15487,11 @@ function Am(r) {
|
|
|
15507
15487
|
function fr(r) {
|
|
15508
15488
|
return Ot.allowedElements[r.name || r.type];
|
|
15509
15489
|
}
|
|
15510
|
-
const
|
|
15490
|
+
const Am = (r) => !!Ot.propertyTypes[r.name || r.type];
|
|
15511
15491
|
function gu(r) {
|
|
15512
15492
|
return r.filter((n) => n.name === "w:r").some((n) => n.elements.some((i) => i.name === "w:t"));
|
|
15513
15493
|
}
|
|
15514
|
-
const
|
|
15494
|
+
const Dm = (r) => {
|
|
15515
15495
|
const { nodes: e, nodeListHandler: t } = r;
|
|
15516
15496
|
if (e.length === 0 || !(e[0].name === "w:del" || e[0].name === "w:ins" || e[0].name === "w:sdt"))
|
|
15517
15497
|
return { nodes: [], consumed: 0 };
|
|
@@ -15534,10 +15514,10 @@ const vm = (r) => {
|
|
|
15534
15514
|
return u.forEach((h) => {
|
|
15535
15515
|
h.marks === void 0 && (h.marks = []), h.marks.push({ type: c, attrs: l });
|
|
15536
15516
|
}), { nodes: u, consumed: 1 };
|
|
15537
|
-
},
|
|
15517
|
+
}, vm = {
|
|
15538
15518
|
handlerName: "trackChangeNodeHandler",
|
|
15539
|
-
handler:
|
|
15540
|
-
},
|
|
15519
|
+
handler: Dm
|
|
15520
|
+
}, Em = (r) => {
|
|
15541
15521
|
const { nodes: e, docx: t, nodeListHandler: n } = r;
|
|
15542
15522
|
if (e.length === 0 || e[0].name !== "w:hyperlink")
|
|
15543
15523
|
return { nodes: [], consumed: 0 };
|
|
@@ -15556,16 +15536,16 @@ const vm = (r) => {
|
|
|
15556
15536
|
}
|
|
15557
15537
|
}
|
|
15558
15538
|
return { nodes: n.handler({ ...r, nodes: A }), consumed: 1 };
|
|
15559
|
-
},
|
|
15539
|
+
}, Cm = {
|
|
15560
15540
|
handlerName: "hyperlinkNodeHandler",
|
|
15561
|
-
handler:
|
|
15562
|
-
},
|
|
15541
|
+
handler: Em
|
|
15542
|
+
}, Sm = (r) => {
|
|
15563
15543
|
const { nodes: e, nodeListHandler: t, parentStyleId: n, docx: i } = r;
|
|
15564
15544
|
if (e.length === 0 || e[0].name !== "w:r")
|
|
15565
15545
|
return { nodes: [], consumed: 0 };
|
|
15566
15546
|
const s = e[0], o = { ...r, nodes: s.elements };
|
|
15567
15547
|
let a = t.handler(o)?.filter((l) => l) || [];
|
|
15568
|
-
const u = s.elements?.some((l) => l.name === "w:rPr"), c =
|
|
15548
|
+
const u = s.elements?.some((l) => l.name === "w:rPr"), c = Tm(i, n);
|
|
15569
15549
|
if (u) {
|
|
15570
15550
|
const { marks: l = [], attributes: h = {} } = xt(s), g = l.find((v) => v.type === "textStyle"), E = g && Object.keys(g.attrs).length > 0;
|
|
15571
15551
|
c.marks && !E && l.push(...c.marks), s.marks && l.push(...s.marks);
|
|
@@ -15576,16 +15556,16 @@ const vm = (r) => {
|
|
|
15576
15556
|
});
|
|
15577
15557
|
} else c.marks && (a = a.map((l) => ({ ...l, marks: wi(c.marks) })));
|
|
15578
15558
|
return { nodes: a, consumed: 1 };
|
|
15579
|
-
},
|
|
15559
|
+
}, Tm = (r, e) => {
|
|
15580
15560
|
const t = r?.["word/styles.xml"];
|
|
15581
15561
|
if (!t)
|
|
15582
15562
|
return {};
|
|
15583
15563
|
const i = t.elements[0].elements.filter((s) => s.name === "w:style").find((s) => s.attributes["w:styleId"] === e) || {};
|
|
15584
15564
|
return i ? xt(i) : {};
|
|
15585
|
-
},
|
|
15565
|
+
}, Fm = {
|
|
15586
15566
|
handlerName: "runNodeHandler",
|
|
15587
|
-
handler:
|
|
15588
|
-
},
|
|
15567
|
+
handler: Sm
|
|
15568
|
+
}, Bm = (r) => {
|
|
15589
15569
|
const { nodes: e, insideTrackChange: t } = r;
|
|
15590
15570
|
if (e.length === 0 || !(e[0].name === "w:t" || t && e[0].name === "w:delText"))
|
|
15591
15571
|
return { nodes: [], consumed: 0 };
|
|
@@ -15606,29 +15586,29 @@ const vm = (r) => {
|
|
|
15606
15586
|
],
|
|
15607
15587
|
consumed: 1
|
|
15608
15588
|
};
|
|
15609
|
-
},
|
|
15589
|
+
}, km = {
|
|
15610
15590
|
handlerName: "textNodeHandler",
|
|
15611
|
-
handler:
|
|
15591
|
+
handler: Bm
|
|
15612
15592
|
}, wu = (r) => {
|
|
15613
15593
|
if (!r || !Array.isArray(r))
|
|
15614
15594
|
return r;
|
|
15615
15595
|
let e = [], t = null;
|
|
15616
15596
|
for (let n of r)
|
|
15617
|
-
n.type === "text" ? t &&
|
|
15597
|
+
n.type === "text" ? t && Nm(t, n) ? t = {
|
|
15618
15598
|
...t,
|
|
15619
15599
|
text: t.text += n.text
|
|
15620
15600
|
} : (t && e.push(t), t = { ...n }) : (t && (e.push(t), t = null), e.push(n));
|
|
15621
15601
|
return t && e.push(t), e;
|
|
15622
|
-
},
|
|
15602
|
+
}, Nm = (r, e) => {
|
|
15623
15603
|
if (!r || !e) return !1;
|
|
15624
15604
|
let t = r.marks ?? [], n = e.marks ?? [];
|
|
15625
15605
|
if (t.length !== n.length)
|
|
15626
15606
|
return !1;
|
|
15627
15607
|
for (let i = 0; i < t.length; i++)
|
|
15628
|
-
if (t[i].attrs || (t[i].attrs = {}), n[i].attrs || (n[i].attrs = {}), t[i].type !== n[i].type || Object.keys(t[i].attrs).length !== Object.keys(n[i].attrs).length || !
|
|
15608
|
+
if (t[i].attrs || (t[i].attrs = {}), n[i].attrs || (n[i].attrs = {}), t[i].type !== n[i].type || Object.keys(t[i].attrs).length !== Object.keys(n[i].attrs).length || !Im(t[i].attrs, n[i].attrs))
|
|
15629
15609
|
return !1;
|
|
15630
15610
|
return !0;
|
|
15631
|
-
},
|
|
15611
|
+
}, Im = (r = {}, e = {}) => Pf(r, e), Rm = (r) => {
|
|
15632
15612
|
const { nodes: e, lists: t, docx: n } = r;
|
|
15633
15613
|
if (e.length === 0 || e[0].name !== "w:p")
|
|
15634
15614
|
return { nodes: [], consumed: 0 };
|
|
@@ -15647,9 +15627,9 @@ const vm = (r) => {
|
|
|
15647
15627
|
};
|
|
15648
15628
|
} else
|
|
15649
15629
|
return { nodes: [], consumed: 0, lists: t };
|
|
15650
|
-
},
|
|
15630
|
+
}, Pm = {
|
|
15651
15631
|
handlerName: "listHandler",
|
|
15652
|
-
handler:
|
|
15632
|
+
handler: Rm
|
|
15653
15633
|
};
|
|
15654
15634
|
function yu({
|
|
15655
15635
|
listItems: r,
|
|
@@ -15688,9 +15668,9 @@ function yu({
|
|
|
15688
15668
|
lvlText: re,
|
|
15689
15669
|
lvlJc: ie,
|
|
15690
15670
|
numId: L
|
|
15691
|
-
} =
|
|
15671
|
+
} = qm(N, n, u);
|
|
15692
15672
|
E = se;
|
|
15693
|
-
const V = parseInt(ne), q = i === V && L === s, K =
|
|
15673
|
+
const V = parseInt(ne), q = i === V && L === s, K = _m({
|
|
15694
15674
|
firstListId: L,
|
|
15695
15675
|
secondListId: s,
|
|
15696
15676
|
level: V,
|
|
@@ -15814,7 +15794,7 @@ function Po(r, e, t) {
|
|
|
15814
15794
|
marks: t
|
|
15815
15795
|
};
|
|
15816
15796
|
}
|
|
15817
|
-
const
|
|
15797
|
+
const Om = [
|
|
15818
15798
|
"decimal",
|
|
15819
15799
|
// eg: 1, 2, 3, 4, 5, ...
|
|
15820
15800
|
"decimalZero",
|
|
@@ -15839,7 +15819,7 @@ const Lm = [
|
|
|
15839
15819
|
// eg: (0, 1, 2, ..., 9, 10, 11, 12, ..., 19, 1A, 1B, 1C, ..., 1Z, 20, 21, ..., 2Z)
|
|
15840
15820
|
"none"
|
|
15841
15821
|
// No bullet
|
|
15842
|
-
],
|
|
15822
|
+
], Lm = [
|
|
15843
15823
|
"bullet",
|
|
15844
15824
|
// A standard bullet point (•)
|
|
15845
15825
|
"square",
|
|
@@ -15848,7 +15828,7 @@ const Lm = [
|
|
|
15848
15828
|
// Circle bullets (◦)
|
|
15849
15829
|
"disc"
|
|
15850
15830
|
// Disc bullets (●)
|
|
15851
|
-
],
|
|
15831
|
+
], _m = ({ firstListId: r, secondListId: e, level: t, pStyleId: n, docx: i }) => {
|
|
15852
15832
|
const { numFmt: s, lvlText: o, lvlJc: a } = Ar(r, t, n, i), {
|
|
15853
15833
|
numFmt: u,
|
|
15854
15834
|
lvlText: c,
|
|
@@ -15878,7 +15858,7 @@ const Lm = [
|
|
|
15878
15858
|
}
|
|
15879
15859
|
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(
|
|
15880
15860
|
(N) => N.attributes["w:abstractNumId"] === h
|
|
15881
|
-
), E =
|
|
15861
|
+
), E = Mm(g, e), v = g?.elements?.find((N) => N.name === "w:numStyleLink")?.attributes["w:val"];
|
|
15882
15862
|
if (v) {
|
|
15883
15863
|
const N = Oo(v, n);
|
|
15884
15864
|
return Ar(N.numId, e, null, n);
|
|
@@ -15886,7 +15866,7 @@ const Lm = [
|
|
|
15886
15866
|
const F = E?.elements?.find((N) => N.name === "w:start")?.attributes["w:val"], w = E?.elements?.find((N) => N.name === "w:numFmt")?.attributes["w:val"], B = E?.elements?.find((N) => N.name === "w:lvlText").attributes["w:val"], R = E?.elements?.find((N) => N.name === "w:lvlJc").attributes["w:val"], D = E?.elements?.find((N) => N.name === "w:pPr"), k = E?.elements?.find((N) => N.name === "w:rPr");
|
|
15887
15867
|
return { start: F, numFmt: w, lvlText: B, lvlJc: R, pPr: D, rPr: k };
|
|
15888
15868
|
};
|
|
15889
|
-
function
|
|
15869
|
+
function qm(r, e, t) {
|
|
15890
15870
|
if (!r) return;
|
|
15891
15871
|
const { attributes: n = {} } = r, { paragraphProperties: i = {} } = n, { elements: s = [] } = i, u = r.elements.find((C) => C.name === "w:pPr")?.elements?.find((C) => C.name === "w:pStyle")?.attributes["w:val"], c = Nr({ node: r, styleId: u, docx: t });
|
|
15892
15872
|
if (!c) return {};
|
|
@@ -15899,17 +15879,17 @@ function Mm(r, e, t) {
|
|
|
15899
15879
|
rPr: k
|
|
15900
15880
|
} = Ar(h, e, v, t);
|
|
15901
15881
|
let N, M;
|
|
15902
|
-
D && (N =
|
|
15882
|
+
D && (N = Um(D)), k && (M = jm(k));
|
|
15903
15883
|
let _;
|
|
15904
|
-
if (
|
|
15905
|
-
else if (
|
|
15884
|
+
if (Lm.includes(w?.toLowerCase())) _ = "bulletList";
|
|
15885
|
+
else if (Om.includes(w)) _ = "orderedList";
|
|
15906
15886
|
else return {};
|
|
15907
15887
|
return { listType: _, listOrderingType: w, ilvl: E, numId: h, listrPrs: M, listpPrs: N, start: F, lvlText: B, lvlJc: R };
|
|
15908
15888
|
}
|
|
15909
|
-
function
|
|
15889
|
+
function Mm(r, e) {
|
|
15910
15890
|
return r?.elements?.find((t) => Number(t.attributes["w:ilvl"]) === e);
|
|
15911
15891
|
}
|
|
15912
|
-
function
|
|
15892
|
+
function Um(r) {
|
|
15913
15893
|
const { elements: e } = r, t = ["w:ind", "w:jc", "w:tabs"], n = {};
|
|
15914
15894
|
return e && e.forEach((i) => {
|
|
15915
15895
|
t.includes(i.name);
|
|
@@ -15919,7 +15899,7 @@ function jm(r) {
|
|
|
15919
15899
|
});
|
|
15920
15900
|
}), n;
|
|
15921
15901
|
}
|
|
15922
|
-
function
|
|
15902
|
+
function jm(r) {
|
|
15923
15903
|
const { elements: e } = r, t = [
|
|
15924
15904
|
"w:rFonts",
|
|
15925
15905
|
"w:b",
|
|
@@ -15976,7 +15956,7 @@ const xu = (r) => {
|
|
|
15976
15956
|
}
|
|
15977
15957
|
let v;
|
|
15978
15958
|
if (g && (v = g.attributes["w:val"], o.attrs.styleId = v), t) {
|
|
15979
|
-
const D =
|
|
15959
|
+
const D = Hm(s, t, v);
|
|
15980
15960
|
o.attrs.indent || (o.attrs.indent = {}), (D.left || D.left === 0) && (o.attrs.indent.left = D.left), (D.right || D.right === 0) && (o.attrs.indent.right = D.right), (D.firstLine || D.firstLine === 0) && (o.attrs.indent.firstLine = D.firstLine), (D.hanging || D.hanging === 0) && (o.attrs.indent.hanging = D.hanging), (D.textIndent || D.textIndent === 0) && (o.attrs.textIndent = `${D.textIndent}in`);
|
|
15981
15961
|
}
|
|
15982
15962
|
const F = h?.elements?.find((D) => D.name === "w:jc");
|
|
@@ -16000,7 +15980,7 @@ const xu = (r) => {
|
|
|
16000
15980
|
});
|
|
16001
15981
|
const R = h?.elements?.find((D) => D.name === "w:sectPr");
|
|
16002
15982
|
return R && (o.attrs.paragraphProperties || (o.attrs.paragraphProperties = {}), o.attrs.paragraphProperties.sectPr = R, o.attrs.pageBreakSource = "sectPr"), { nodes: o ? [o] : [], consumed: 1 };
|
|
16003
|
-
},
|
|
15983
|
+
}, Hm = (r, e, t = "") => {
|
|
16004
15984
|
const n = {
|
|
16005
15985
|
left: 0,
|
|
16006
15986
|
right: 0,
|
|
@@ -16043,11 +16023,11 @@ const xu = (r) => {
|
|
|
16043
16023
|
indent: k || R || D,
|
|
16044
16024
|
justify: B
|
|
16045
16025
|
};
|
|
16046
|
-
},
|
|
16026
|
+
}, Vm = {
|
|
16047
16027
|
handlerName: "paragraphNodeHandler",
|
|
16048
16028
|
handler: xu
|
|
16049
16029
|
};
|
|
16050
|
-
function
|
|
16030
|
+
function zm(r, e) {
|
|
16051
16031
|
const t = { lineSpaceBefore: null, lineSpaceAfter: null };
|
|
16052
16032
|
if (!r) return t;
|
|
16053
16033
|
const n = e["word/styles.xml"];
|
|
@@ -16111,14 +16091,14 @@ function vu(r = []) {
|
|
|
16111
16091
|
continue;
|
|
16112
16092
|
}
|
|
16113
16093
|
if (o === "end" && n) {
|
|
16114
|
-
t.push(i), e.push(...
|
|
16094
|
+
t.push(i), e.push(...Gm(t)), t = [], n = !1;
|
|
16115
16095
|
continue;
|
|
16116
16096
|
}
|
|
16117
16097
|
n ? t.push(i) : e.push(i);
|
|
16118
16098
|
}
|
|
16119
16099
|
return t.length && e.push(...t), e;
|
|
16120
16100
|
}
|
|
16121
|
-
const
|
|
16101
|
+
const Gm = (r = []) => {
|
|
16122
16102
|
let e = [], t = !1, n = !1;
|
|
16123
16103
|
const i = r.findIndex(
|
|
16124
16104
|
(h) => h.elements?.some((g) => g.name === "w:fldChar" && g.attributes["w:fldCharType"] === "separate")
|
|
@@ -16155,7 +16135,7 @@ const Wm = (r = []) => {
|
|
|
16155
16135
|
});
|
|
16156
16136
|
}
|
|
16157
16137
|
return e;
|
|
16158
|
-
},
|
|
16138
|
+
}, Wm = (r) => nodeListHandler.handler({ ...r, nodes: node.elements }), Jm = (r) => {
|
|
16159
16139
|
const { nodes: e } = r;
|
|
16160
16140
|
if (e.length === 0 || e[0].name !== "w:sdt")
|
|
16161
16141
|
return { nodes: [], consumed: 0 };
|
|
@@ -16170,14 +16150,14 @@ const Wm = (r = []) => {
|
|
|
16170
16150
|
consumed: 1
|
|
16171
16151
|
};
|
|
16172
16152
|
}, Lo = {
|
|
16173
|
-
"Table of Contents":
|
|
16174
|
-
},
|
|
16153
|
+
"Table of Contents": Wm
|
|
16154
|
+
}, $m = (r) => {
|
|
16175
16155
|
const { nodes: e, docx: t, nodeListHandler: n, insideTrackChange: i } = r;
|
|
16176
16156
|
if (e.length === 0 || e[0].name !== "w:sdt")
|
|
16177
16157
|
return { nodes: [], consumed: 0 };
|
|
16178
16158
|
const s = e[0], o = s.elements.find((_) => _.name === "w:sdtPr"), a = s.elements.find((_) => _.name === "w:sdtContent"), u = o?.elements.find((_) => _.name === "w:fieldTypeShort")?.attributes["w:val"], { attrs: c, marks: l } = Eu(a);
|
|
16179
16159
|
if (o?.elements.find((_) => _.name === "w:docPartObj"))
|
|
16180
|
-
return
|
|
16160
|
+
return Jm({ nodes: e, docx: t, nodeListHandler: n, insideTrackChange: i });
|
|
16181
16161
|
const g = o?.elements.find((_) => _.name === "w:alias"), E = o?.elements.find((_) => _.name === "w:tag"), A = o?.elements.find((_) => _.name === "w:fieldType")?.attributes["w:val"], v = o?.elements.find((_) => _.name === "w:fieldColor")?.attributes["w:val"], F = o?.elements.find((_) => _.name === "w:fieldMultipleImage")?.attributes["w:val"], w = o?.elements.find((_) => _.name === "w:fieldFontFamily")?.attributes["w:val"], B = o?.elements.find((_) => _.name === "w:fieldFontSize")?.attributes["w:val"], R = o?.elements.find((_) => _.name === "w:fieldTextColor")?.attributes["w:val"], D = o?.elements.find((_) => _.name === "w:fieldTextHighlight")?.attributes["w:val"], k = {
|
|
16182
16162
|
type: u,
|
|
16183
16163
|
fieldId: E?.attributes["w:val"],
|
|
@@ -16227,10 +16207,10 @@ const Wm = (r = []) => {
|
|
|
16227
16207
|
attrs: u,
|
|
16228
16208
|
marks: o
|
|
16229
16209
|
};
|
|
16230
|
-
},
|
|
16210
|
+
}, Km = {
|
|
16231
16211
|
handlerName: "annotationNodeHandler",
|
|
16232
|
-
handler:
|
|
16233
|
-
},
|
|
16212
|
+
handler: $m
|
|
16213
|
+
}, Xm = (r) => {
|
|
16234
16214
|
const { nodes: e, nodeListHandler: t } = r;
|
|
16235
16215
|
if (e.length === 0 || e[0].name !== "w:sdt")
|
|
16236
16216
|
return { nodes: [], consumed: 0 };
|
|
@@ -16246,17 +16226,17 @@ const Wm = (r = []) => {
|
|
|
16246
16226
|
}],
|
|
16247
16227
|
consumed: 1
|
|
16248
16228
|
};
|
|
16249
|
-
},
|
|
16229
|
+
}, Ym = {
|
|
16250
16230
|
handlerName: "sdtNodeHandler",
|
|
16251
|
-
handler:
|
|
16252
|
-
},
|
|
16231
|
+
handler: Xm
|
|
16232
|
+
}, Zm = (r) => {
|
|
16253
16233
|
const { nodes: e, docx: t, nodeListHandler: n } = r;
|
|
16254
16234
|
if (!e || e.length === 0)
|
|
16255
16235
|
return { nodes: [], consumed: 0 };
|
|
16256
16236
|
const i = e[0], { name: s } = i, { attributes: o, elements: a, marks: u = [] } = xt(i);
|
|
16257
16237
|
if (s === "w:sdt")
|
|
16258
16238
|
return { nodes: [], consumed: 0 };
|
|
16259
|
-
if (
|
|
16239
|
+
if (Am(i))
|
|
16260
16240
|
return {
|
|
16261
16241
|
nodes: [{
|
|
16262
16242
|
type: fr(i),
|
|
@@ -16276,7 +16256,7 @@ const Wm = (r = []) => {
|
|
|
16276
16256
|
consumed: 0,
|
|
16277
16257
|
unhandled: !0
|
|
16278
16258
|
};
|
|
16279
|
-
const c = [], l =
|
|
16259
|
+
const c = [], l = Qm(i);
|
|
16280
16260
|
if (a && a.length) {
|
|
16281
16261
|
const g = a.map((v) => (v.marks || (v.marks = []), v.marks.push(...u), v)), E = { ...r, nodes: g, parentStyleId: l }, A = n.handler(E);
|
|
16282
16262
|
c.push(...A);
|
|
@@ -16287,13 +16267,13 @@ const Wm = (r = []) => {
|
|
|
16287
16267
|
attrs: { ...o },
|
|
16288
16268
|
marks: []
|
|
16289
16269
|
}], consumed: 1 };
|
|
16290
|
-
},
|
|
16270
|
+
}, Qm = (r) => {
|
|
16291
16271
|
const t = r.elements?.find((n) => n.name === "w:pPr")?.elements?.find((n) => n.name === "w:pStyle");
|
|
16292
16272
|
return t ? t.attributes["w:val"] : null;
|
|
16293
|
-
},
|
|
16273
|
+
}, ep = {
|
|
16294
16274
|
handlerName: "standardNodeHandler",
|
|
16295
|
-
handler:
|
|
16296
|
-
},
|
|
16275
|
+
handler: Zm
|
|
16276
|
+
}, tp = (r) => {
|
|
16297
16277
|
const { nodes: e } = r;
|
|
16298
16278
|
return e.length === 0 || e[0].name !== "w:br" ? { nodes: [], consumed: 0 } : {
|
|
16299
16279
|
nodes: [{
|
|
@@ -16301,10 +16281,10 @@ const Wm = (r = []) => {
|
|
|
16301
16281
|
}],
|
|
16302
16282
|
consumed: 1
|
|
16303
16283
|
};
|
|
16304
|
-
},
|
|
16284
|
+
}, rp = {
|
|
16305
16285
|
handlerName: "lineBreakNodeHandler",
|
|
16306
|
-
handler:
|
|
16307
|
-
},
|
|
16286
|
+
handler: tp
|
|
16287
|
+
}, np = (r) => {
|
|
16308
16288
|
const { nodes: e, nodeListHandler: t, editor: n } = r;
|
|
16309
16289
|
if (e.length === 0 || e[0].name !== "w:bookmarkStart")
|
|
16310
16290
|
return { nodes: [], consumed: 0 };
|
|
@@ -16333,10 +16313,10 @@ const Wm = (r = []) => {
|
|
|
16333
16313
|
}
|
|
16334
16314
|
const c = { ...r, nodes: [i] }, l = s(c);
|
|
16335
16315
|
return l.nodes.length === 1 && (l.nodes[0].attrs.name = i.attributes["w:name"], l.nodes[0].attrs.id = i.attributes["w:id"]), l;
|
|
16336
|
-
},
|
|
16316
|
+
}, ip = {
|
|
16337
16317
|
handlerName: "bookmarkNodeHandler",
|
|
16338
|
-
handler:
|
|
16339
|
-
},
|
|
16318
|
+
handler: np
|
|
16319
|
+
}, sp = (r) => {
|
|
16340
16320
|
const e = { nodes: [], consumed: 0 }, { nodes: t, nodeListHandler: n, parentStyleId: i, docx: s } = r;
|
|
16341
16321
|
if (t.length === 0 || t[0].name !== "w:p")
|
|
16342
16322
|
return e;
|
|
@@ -16355,26 +16335,26 @@ const Wm = (r = []) => {
|
|
|
16355
16335
|
...r,
|
|
16356
16336
|
nodes: g
|
|
16357
16337
|
}), consumed: 1 };
|
|
16358
|
-
},
|
|
16338
|
+
}, op = {
|
|
16359
16339
|
handlerName: "alternateChoiceHandler",
|
|
16360
|
-
handler:
|
|
16361
|
-
},
|
|
16340
|
+
handler: sp
|
|
16341
|
+
}, ap = (r) => {
|
|
16362
16342
|
const { nodes: e } = r;
|
|
16363
16343
|
return e.length === 0 || e[0].name !== "sd:autoPageNumber" ? { nodes: [], consumed: 0 } : { nodes: [{
|
|
16364
16344
|
type: "page-number"
|
|
16365
16345
|
}], consumed: 1 };
|
|
16366
|
-
},
|
|
16346
|
+
}, up = {
|
|
16367
16347
|
handlerName: "autoPageNumberHandler",
|
|
16368
|
-
handler:
|
|
16369
|
-
},
|
|
16348
|
+
handler: ap
|
|
16349
|
+
}, lp = (r) => {
|
|
16370
16350
|
const { nodes: e } = r;
|
|
16371
16351
|
return e.length === 0 || e[0].name !== "sd:totalPageNumber" ? { nodes: [], consumed: 0 } : { nodes: [{
|
|
16372
16352
|
type: "total-page-number"
|
|
16373
16353
|
}], consumed: 1 };
|
|
16374
|
-
},
|
|
16354
|
+
}, cp = {
|
|
16375
16355
|
handlerName: "autoTotalPageCountEntity",
|
|
16376
|
-
handler:
|
|
16377
|
-
},
|
|
16356
|
+
handler: lp
|
|
16357
|
+
}, fp = (r) => {
|
|
16378
16358
|
const { nodes: e, docx: t, parentStyleId: n } = r;
|
|
16379
16359
|
if (e.length === 0 || e[0].name !== "w:tab")
|
|
16380
16360
|
return { nodes: [], consumed: 0 };
|
|
@@ -16391,10 +16371,10 @@ const Wm = (r = []) => {
|
|
|
16391
16371
|
},
|
|
16392
16372
|
content: []
|
|
16393
16373
|
}], consumed: 1 };
|
|
16394
|
-
},
|
|
16374
|
+
}, dp = {
|
|
16395
16375
|
handlerName: "tabNodeHandler",
|
|
16396
|
-
handler:
|
|
16397
|
-
},
|
|
16376
|
+
handler: fp
|
|
16377
|
+
}, mp = (r) => {
|
|
16398
16378
|
const { nodes: e } = r;
|
|
16399
16379
|
if (!e.length || e[0].name !== "w:p")
|
|
16400
16380
|
return { nodes: [], consumed: 0 };
|
|
@@ -16407,14 +16387,14 @@ const Wm = (r = []) => {
|
|
|
16407
16387
|
if (!o && !a)
|
|
16408
16388
|
return { nodes: [], consumed: 0 };
|
|
16409
16389
|
let u = null;
|
|
16410
|
-
return a && !o ? u = null : o.elements?.find((h) => h.name === "v:textbox") && (u =
|
|
16390
|
+
return a && !o ? u = null : o.elements?.find((h) => h.name === "v:textbox") && (u = pp({
|
|
16411
16391
|
pict: i,
|
|
16412
16392
|
pNode: t,
|
|
16413
16393
|
shape: o,
|
|
16414
16394
|
params: r
|
|
16415
16395
|
})), { nodes: u ? [u] : [], consumed: 1 };
|
|
16416
16396
|
};
|
|
16417
|
-
function
|
|
16397
|
+
function pp({
|
|
16418
16398
|
pict: r,
|
|
16419
16399
|
pNode: e,
|
|
16420
16400
|
shape: t,
|
|
@@ -16422,7 +16402,7 @@ function hp({
|
|
|
16422
16402
|
}) {
|
|
16423
16403
|
const i = {}, s = {}, o = t.attributes || {};
|
|
16424
16404
|
i.attributes = o, o.fillcolor && (i.fillcolor = o.fillcolor);
|
|
16425
|
-
const a =
|
|
16405
|
+
const a = hp(o.style), u = gp(a);
|
|
16426
16406
|
u && (i.style = u);
|
|
16427
16407
|
const c = t.elements?.find((w) => w.name === "v:textbox"), l = t.elements?.find((w) => w.name === "w10:wrap");
|
|
16428
16408
|
l?.attributes && (i.wrapAttributes = l.attributes), c?.attributes && (s.attributes = c.attributes);
|
|
@@ -16441,13 +16421,13 @@ function hp({
|
|
|
16441
16421
|
}]
|
|
16442
16422
|
};
|
|
16443
16423
|
}
|
|
16444
|
-
function
|
|
16424
|
+
function hp(r) {
|
|
16445
16425
|
return r ? r.split(";").filter((e) => !!e.trim()).reduce((e, t) => {
|
|
16446
16426
|
const [n, i] = t.split(":").map((s) => s.trim());
|
|
16447
16427
|
return n && i && (e[n] = i), e;
|
|
16448
16428
|
}, {}) : {};
|
|
16449
16429
|
}
|
|
16450
|
-
function
|
|
16430
|
+
function gp(r) {
|
|
16451
16431
|
const e = [
|
|
16452
16432
|
"width",
|
|
16453
16433
|
"height"
|
|
@@ -16465,11 +16445,11 @@ function wp(r) {
|
|
|
16465
16445
|
e.includes(n) && (t += `${n}: ${i};`);
|
|
16466
16446
|
return t;
|
|
16467
16447
|
}
|
|
16468
|
-
const
|
|
16448
|
+
const wp = {
|
|
16469
16449
|
handlerName: "handlePictNode",
|
|
16470
|
-
handler:
|
|
16450
|
+
handler: mp
|
|
16471
16451
|
};
|
|
16472
|
-
function
|
|
16452
|
+
function yp({ docx: r }) {
|
|
16473
16453
|
const e = Jt(), t = r["word/comments.xml"];
|
|
16474
16454
|
if (!t) return;
|
|
16475
16455
|
const { elements: n } = t;
|
|
@@ -16495,16 +16475,16 @@ function bp({ docx: r }) {
|
|
|
16495
16475
|
trackedDeletedText: B
|
|
16496
16476
|
};
|
|
16497
16477
|
});
|
|
16498
|
-
return
|
|
16478
|
+
return bp({ docx: r, comments: s });
|
|
16499
16479
|
}
|
|
16500
|
-
const
|
|
16480
|
+
const bp = ({ docx: r, comments: e }) => {
|
|
16501
16481
|
const t = r["word/commentsExtended.xml"];
|
|
16502
16482
|
if (!t) return [];
|
|
16503
16483
|
const { elements: n } = t, { elements: i } = n[0], s = i.filter((o) => o.name === "w15:commentEx");
|
|
16504
16484
|
return e.map((o) => {
|
|
16505
16485
|
const a = s.find((g) => g.attributes["w15:paraId"] === o.paraId);
|
|
16506
16486
|
if (!a) return { ...o };
|
|
16507
|
-
const { isDone: u, paraIdParent: c } =
|
|
16487
|
+
const { isDone: u, paraIdParent: c } = xp(a);
|
|
16508
16488
|
let l;
|
|
16509
16489
|
return c && (l = e.find((g) => g.paraId === c)), {
|
|
16510
16490
|
...o,
|
|
@@ -16512,11 +16492,11 @@ const xp = ({ docx: r, comments: e }) => {
|
|
|
16512
16492
|
parentCommentId: l?.commentId
|
|
16513
16493
|
};
|
|
16514
16494
|
});
|
|
16515
|
-
},
|
|
16495
|
+
}, xp = (r) => {
|
|
16516
16496
|
const { attributes: e } = r, t = e["w15:paraId"], n = e["w15:done"] === "1", i = e["w15:paraIdParent"];
|
|
16517
16497
|
return { paraId: t, isDone: n, paraIdParent: i };
|
|
16518
|
-
},
|
|
16519
|
-
const n = Ue(
|
|
16498
|
+
}, Ap = (r, e, t) => {
|
|
16499
|
+
const n = Ue(rm(r));
|
|
16520
16500
|
if (!n) return null;
|
|
16521
16501
|
if (e?.telemetry) {
|
|
16522
16502
|
const o = Object.keys(r).map((a) => {
|
|
@@ -16541,7 +16521,7 @@ const xp = ({ docx: r, comments: e }) => {
|
|
|
16541
16521
|
}
|
|
16542
16522
|
const i = Jt(), s = n.elements[0].elements.find((o) => o.name === "w:body");
|
|
16543
16523
|
if (s) {
|
|
16544
|
-
const o = s, a = ["w:sectPr"], u = o.elements?.filter((E) => !a.includes(E.name)) ?? [], c =
|
|
16524
|
+
const o = s, a = ["w:sectPr"], u = o.elements?.filter((E) => !a.includes(E.name)) ?? [], c = yp({ docx: r }), l = {}, g = {
|
|
16545
16525
|
type: "doc",
|
|
16546
16526
|
content: i.handler({
|
|
16547
16527
|
nodes: u,
|
|
@@ -16564,40 +16544,40 @@ const xp = ({ docx: r, comments: e }) => {
|
|
|
16564
16544
|
), {
|
|
16565
16545
|
pmDoc: g,
|
|
16566
16546
|
savedTagsToRestore: o,
|
|
16567
|
-
pageStyles:
|
|
16547
|
+
pageStyles: vp(o, r, e, t),
|
|
16568
16548
|
comments: c,
|
|
16569
|
-
linkedStyles:
|
|
16570
|
-
numbering:
|
|
16549
|
+
linkedStyles: Ep(r),
|
|
16550
|
+
numbering: Tp(r)
|
|
16571
16551
|
};
|
|
16572
16552
|
}
|
|
16573
16553
|
return null;
|
|
16574
16554
|
}, Jt = () => {
|
|
16575
16555
|
const r = [
|
|
16576
|
-
|
|
16577
|
-
|
|
16578
|
-
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
|
|
16582
|
-
|
|
16583
|
-
|
|
16584
|
-
|
|
16585
|
-
|
|
16586
|
-
|
|
16587
|
-
|
|
16588
|
-
|
|
16589
|
-
|
|
16590
|
-
|
|
16591
|
-
|
|
16592
|
-
|
|
16593
|
-
|
|
16556
|
+
op,
|
|
16557
|
+
Fm,
|
|
16558
|
+
wp,
|
|
16559
|
+
Vm,
|
|
16560
|
+
Pm,
|
|
16561
|
+
km,
|
|
16562
|
+
rp,
|
|
16563
|
+
Km,
|
|
16564
|
+
Ym,
|
|
16565
|
+
ip,
|
|
16566
|
+
Cm,
|
|
16567
|
+
mm,
|
|
16568
|
+
vm,
|
|
16569
|
+
im,
|
|
16570
|
+
dp,
|
|
16571
|
+
up,
|
|
16572
|
+
cp,
|
|
16573
|
+
ep
|
|
16594
16574
|
//this should be the last one, bcs this parses everything!!!
|
|
16595
16575
|
];
|
|
16596
16576
|
return {
|
|
16597
|
-
handler:
|
|
16577
|
+
handler: Dp(r),
|
|
16598
16578
|
handlerEntities: r
|
|
16599
16579
|
};
|
|
16600
|
-
},
|
|
16580
|
+
}, Dp = (r) => {
|
|
16601
16581
|
const e = (n, i, s, o) => !n || i < 0 || i >= n.length ? {
|
|
16602
16582
|
elementIndex: i,
|
|
16603
16583
|
error: "index_out_of_bounds",
|
|
@@ -16682,7 +16662,7 @@ const xp = ({ docx: r, comments: e }) => {
|
|
|
16682
16662
|
};
|
|
16683
16663
|
return t;
|
|
16684
16664
|
};
|
|
16685
|
-
function
|
|
16665
|
+
function vp(r, e, t, n) {
|
|
16686
16666
|
const i = r.elements?.find((o) => o.name === "w:sectPr"), s = {};
|
|
16687
16667
|
return i?.elements?.forEach((o) => {
|
|
16688
16668
|
const { name: a, attributes: u } = o;
|
|
@@ -16720,9 +16700,9 @@ function Ep(r, e, t, n) {
|
|
|
16720
16700
|
case "w:titlePg":
|
|
16721
16701
|
t.headerIds.titlePg = !0;
|
|
16722
16702
|
}
|
|
16723
|
-
}),
|
|
16703
|
+
}), Sp(e, t, n), s.alternateHeaders = Fp(e), s;
|
|
16724
16704
|
}
|
|
16725
|
-
function
|
|
16705
|
+
function Ep(r) {
|
|
16726
16706
|
const e = r["word/styles.xml"];
|
|
16727
16707
|
if (!e) return [];
|
|
16728
16708
|
const { elements: t } = e.elements[0], n = t.filter((o) => o.name === "w:style");
|
|
@@ -16732,7 +16712,7 @@ function Cp(r) {
|
|
|
16732
16712
|
});
|
|
16733
16713
|
const s = [];
|
|
16734
16714
|
return n.forEach((o) => {
|
|
16735
|
-
const a = o.attributes["w:styleId"], u =
|
|
16715
|
+
const a = o.attributes["w:styleId"], u = zm(a, r), c = {
|
|
16736
16716
|
id: o.attributes["w:styleId"],
|
|
16737
16717
|
type: o.attributes["w:type"],
|
|
16738
16718
|
definition: u,
|
|
@@ -16741,7 +16721,7 @@ function Cp(r) {
|
|
|
16741
16721
|
s.push(c);
|
|
16742
16722
|
}), s;
|
|
16743
16723
|
}
|
|
16744
|
-
function
|
|
16724
|
+
function Cp(r) {
|
|
16745
16725
|
if (!r) return null;
|
|
16746
16726
|
const e = Ue(r), { elements: t } = e.elements[0];
|
|
16747
16727
|
return Object.keys(Co).forEach((n) => {
|
|
@@ -16751,7 +16731,7 @@ function Sp(r) {
|
|
|
16751
16731
|
}
|
|
16752
16732
|
}), e;
|
|
16753
16733
|
}
|
|
16754
|
-
const
|
|
16734
|
+
const Sp = (r, e, t) => {
|
|
16755
16735
|
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), c = s.filter((g) => g.attributes.Type === a), h = (Cu(r["word/document.xml"]) || []).flatMap((g) => g.elements);
|
|
16756
16736
|
u.forEach((g) => {
|
|
16757
16737
|
const { rId: E, referenceFile: A, currentFileName: v } = _o(g, r);
|
|
@@ -16789,7 +16769,7 @@ const Tp = (r, e, t) => {
|
|
|
16789
16769
|
currentFileName: n
|
|
16790
16770
|
};
|
|
16791
16771
|
};
|
|
16792
|
-
function
|
|
16772
|
+
function Tp(r) {
|
|
16793
16773
|
let e = r["word/numbering.xml"];
|
|
16794
16774
|
(!e || !e.elements?.length || !e.elements[0].elements?.length) && (e = nu);
|
|
16795
16775
|
const t = e.elements[0].elements, n = t.filter((a) => a.name === "w:abstractNum"), i = t.filter((a) => a.name === "w:num"), s = {};
|
|
@@ -16806,12 +16786,12 @@ function Fp(r) {
|
|
|
16806
16786
|
definitions: o
|
|
16807
16787
|
};
|
|
16808
16788
|
}
|
|
16809
|
-
const
|
|
16789
|
+
const Fp = (r) => {
|
|
16810
16790
|
const e = r["word/settings.xml"];
|
|
16811
16791
|
if (!e || !e.elements?.length) return !1;
|
|
16812
16792
|
const { elements: t = [] } = e.elements[0];
|
|
16813
16793
|
return !!t.find((i) => i.name === "w:evenAndOddHeaders");
|
|
16814
|
-
},
|
|
16794
|
+
}, Bp = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
16815
16795
|
var it, Su, Tu, Fu, Bu;
|
|
16816
16796
|
const pt = class pt {
|
|
16817
16797
|
constructor(e = null) {
|
|
@@ -16820,7 +16800,7 @@ const pt = class pt {
|
|
|
16820
16800
|
}
|
|
16821
16801
|
parseFromXml() {
|
|
16822
16802
|
this.docx?.forEach((e) => {
|
|
16823
|
-
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] =
|
|
16803
|
+
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] = Cp(this.convertedXml[e.name]));
|
|
16824
16804
|
}), this.initialJSON = this.convertedXml["word/document.xml"], this.initialJSON || (this.initialJSON = this.parseXmlToJson(this.xml)), this.declaration = this.initialJSON?.declaration;
|
|
16825
16805
|
}
|
|
16826
16806
|
parseXmlToJson(e) {
|
|
@@ -16839,7 +16819,7 @@ const pt = class pt {
|
|
|
16839
16819
|
return;
|
|
16840
16820
|
}
|
|
16841
16821
|
}
|
|
16842
|
-
static updateDocumentVersion(e = this.convertedXml, t = "0.11.
|
|
16822
|
+
static updateDocumentVersion(e = this.convertedXml, t = "0.11.58") {
|
|
16843
16823
|
const n = "docProps/custom.xml";
|
|
16844
16824
|
e[n] || (e[n] = ku());
|
|
16845
16825
|
const i = e["docProps/custom.xml"];
|
|
@@ -16941,7 +16921,7 @@ const pt = class pt {
|
|
|
16941
16921
|
}
|
|
16942
16922
|
getSchema(e) {
|
|
16943
16923
|
this.getDocumentInternalId();
|
|
16944
|
-
const t =
|
|
16924
|
+
const t = Ap({ ...this.convertedXml, media: this.media }, this, e);
|
|
16945
16925
|
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;
|
|
16946
16926
|
}
|
|
16947
16927
|
schemaToXml(e, t = !1) {
|
|
@@ -16971,7 +16951,7 @@ const pt = class pt {
|
|
|
16971
16951
|
});
|
|
16972
16952
|
A = { ...F }, v = w;
|
|
16973
16953
|
}
|
|
16974
|
-
return this.convertedXml = { ...this.convertedXml, ...A }, Ke(this, it, Fu).call(this, [...h.relationships, ...v]),
|
|
16954
|
+
return this.convertedXml = { ...this.convertedXml, ...A }, Ke(this, it, Fu).call(this, [...h.relationships, ...v]), kp(this.convertedXml), Ke(this, it, Su).call(this, h), E;
|
|
16975
16955
|
}
|
|
16976
16956
|
exportToXmlJson({
|
|
16977
16957
|
data: e,
|
|
@@ -17023,7 +17003,7 @@ Tu = function({ defs: e, exportType: t, commentsWithParaIds: n }) {
|
|
|
17023
17003
|
const t = this.convertedXml["word/_rels/document.xml.rels"], n = t.elements.find((a) => a.name === "Relationships"), i = [], s = /rId|mi/g;
|
|
17024
17004
|
let o = Math.max(...n.elements.map((a) => Number(a.attributes.Id.replace(s, ""))));
|
|
17025
17005
|
e.forEach((a) => {
|
|
17026
|
-
const u = a.attributes.Id, c = n.elements.find((g) => g.attributes.Target === a.attributes.Target), l = a.attributes.Target?.startsWith("media/") && u.length > 6, h = a.attributes.Type ===
|
|
17006
|
+
const u = a.attributes.Id, c = n.elements.find((g) => g.attributes.Target === a.attributes.Target), l = a.attributes.Target?.startsWith("media/") && u.length > 6, h = a.attributes.Type === Bp && u.length > 6;
|
|
17027
17007
|
c && !l && !h || (a.attributes.Target = a.attributes?.Target?.replace(/&/g, "&"), a.attributes.Id = u.length > 6 ? u : `rId${++o}`, i.push(a));
|
|
17028
17008
|
}), n.elements = [...n.elements, ...i], this.convertedXml["word/_rels/document.xml.rels"] = t;
|
|
17029
17009
|
}, Bu = async function(e, t) {
|
|
@@ -17083,7 +17063,7 @@ Tu = function({ defs: e, exportType: t, commentsWithParaIds: n }) {
|
|
|
17083
17063
|
"w:tcPr": "tableCellProperties"
|
|
17084
17064
|
})), Mt(pt, "elements", /* @__PURE__ */ new Set(["w:document", "w:body", "w:p", "w:r", "w:t", "w:delText"]));
|
|
17085
17065
|
let Ot = pt;
|
|
17086
|
-
function
|
|
17066
|
+
function kp(r) {
|
|
17087
17067
|
const e = "docProps/custom.xml";
|
|
17088
17068
|
r[e] || (r[e] = ku());
|
|
17089
17069
|
const n = r[e].elements.find((a) => a.name === "Properties");
|
|
@@ -17102,7 +17082,7 @@ function Np(r) {
|
|
|
17102
17082
|
function ku() {
|
|
17103
17083
|
return Jf;
|
|
17104
17084
|
}
|
|
17105
|
-
function Nu(r = 2, e = "0.11.
|
|
17085
|
+
function Nu(r = 2, e = "0.11.58") {
|
|
17106
17086
|
return {
|
|
17107
17087
|
type: "element",
|
|
17108
17088
|
name: "property",
|
|
@@ -17134,7 +17114,7 @@ export {
|
|
|
17134
17114
|
xa as E,
|
|
17135
17115
|
Q as F,
|
|
17136
17116
|
Oi as G,
|
|
17137
|
-
|
|
17117
|
+
Gp as H,
|
|
17138
17118
|
ft as I,
|
|
17139
17119
|
et as J,
|
|
17140
17120
|
Ii as K,
|
|
@@ -17142,46 +17122,46 @@ export {
|
|
|
17142
17122
|
br as M,
|
|
17143
17123
|
We as N,
|
|
17144
17124
|
Ot as O,
|
|
17145
|
-
|
|
17125
|
+
Vp as P,
|
|
17146
17126
|
Ct as Q,
|
|
17147
17127
|
$e as R,
|
|
17148
|
-
|
|
17128
|
+
Pp as S,
|
|
17149
17129
|
tt as T,
|
|
17150
17130
|
_f as U,
|
|
17151
|
-
|
|
17152
|
-
|
|
17131
|
+
eh as V,
|
|
17132
|
+
zp as W,
|
|
17153
17133
|
Za as X,
|
|
17154
17134
|
pd as Y,
|
|
17155
17135
|
Bf as Z,
|
|
17156
17136
|
Ff as _,
|
|
17157
|
-
|
|
17137
|
+
Hp as a,
|
|
17158
17138
|
Je as a0,
|
|
17159
17139
|
qo as a1,
|
|
17160
|
-
|
|
17140
|
+
Qp as a2,
|
|
17161
17141
|
ba as a3,
|
|
17162
|
-
|
|
17163
|
-
|
|
17164
|
-
|
|
17165
|
-
|
|
17142
|
+
Wp as a4,
|
|
17143
|
+
qp as b,
|
|
17144
|
+
Jp as c,
|
|
17145
|
+
Mp as d,
|
|
17166
17146
|
Ee as e,
|
|
17167
17147
|
ae as f,
|
|
17168
|
-
|
|
17148
|
+
Yp as g,
|
|
17169
17149
|
Ie as h,
|
|
17170
|
-
|
|
17171
|
-
|
|
17150
|
+
$p as i,
|
|
17151
|
+
Up as j,
|
|
17172
17152
|
qc as k,
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17153
|
+
Lp as l,
|
|
17154
|
+
_p as m,
|
|
17155
|
+
Kp as n,
|
|
17176
17156
|
Pf as o,
|
|
17177
|
-
|
|
17157
|
+
Xp as p,
|
|
17178
17158
|
Ri as q,
|
|
17179
17159
|
Af as r,
|
|
17180
|
-
|
|
17160
|
+
Zp as s,
|
|
17181
17161
|
ru as t,
|
|
17182
17162
|
_a as u,
|
|
17183
17163
|
we as v,
|
|
17184
|
-
|
|
17164
|
+
jp as w,
|
|
17185
17165
|
ge as x,
|
|
17186
17166
|
Rf as y,
|
|
17187
17167
|
Pi as z
|