@docx-editor.dev/core 2.9.2 → 2.11.0

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 (140) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.cts +14 -5
  3. package/dist/automation.d.ts +14 -5
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.cts +78 -13
  7. package/dist/binding.d.ts +78 -13
  8. package/dist/binding.js +1 -1
  9. package/dist/chunk-34BNQUD4.js +10 -0
  10. package/dist/chunk-5AVHO75P.cjs +19 -0
  11. package/dist/chunk-6HMSC7UV.js +2 -0
  12. package/dist/chunk-6JIJOZDW.js +1 -0
  13. package/dist/chunk-76Y3Y45J.cjs +2 -0
  14. package/dist/chunk-BP7ANXGA.js +1 -0
  15. package/dist/chunk-BTQKU64Q.cjs +1 -0
  16. package/dist/chunk-CRZR6K5Z.js +19 -0
  17. package/dist/chunk-D5EHDHYV.js +1 -0
  18. package/dist/chunk-EJATEGJZ.cjs +1 -0
  19. package/dist/{chunk-PSZH2VXP.js → chunk-GOEBQ26R.js} +1 -1
  20. package/dist/chunk-GRDFEH5Q.cjs +2 -0
  21. package/dist/chunk-GWV65NQW.cjs +10 -0
  22. package/dist/chunk-GXLZCXEH.js +2 -0
  23. package/dist/chunk-JUQOPVSK.cjs +2 -0
  24. package/dist/chunk-LAETEBHD.js +1 -0
  25. package/dist/chunk-M6Z3KFXM.cjs +5 -0
  26. package/dist/{chunk-YMYCPY5Y.cjs → chunk-OHJQ7GPZ.cjs} +1 -1
  27. package/dist/chunk-UQFOYZJO.cjs +18 -0
  28. package/dist/chunk-WPQMPHNR.cjs +1 -0
  29. package/dist/chunk-WXQ245MQ.js +18 -0
  30. package/dist/chunk-WZHIFNSU.js +5 -0
  31. package/dist/chunk-X7A5XART.js +2 -0
  32. package/dist/chunk-ZKWRCLT2.cjs +1 -0
  33. package/dist/collaboration/replication.cjs +1 -0
  34. package/dist/collaboration/replication.d.cts +216 -0
  35. package/dist/collaboration/replication.d.ts +216 -0
  36. package/dist/collaboration/replication.js +1 -0
  37. package/dist/collaboration.cjs +1 -0
  38. package/dist/collaboration.d.cts +176 -0
  39. package/dist/collaboration.d.ts +176 -0
  40. package/dist/collaboration.js +1 -0
  41. package/dist/contracts/document.d.cts +6 -1
  42. package/dist/contracts/document.d.ts +6 -1
  43. package/dist/contracts/editor.cjs +1 -1
  44. package/dist/contracts/editor.d.cts +8 -9
  45. package/dist/contracts/editor.d.ts +8 -9
  46. package/dist/contracts/editor.js +1 -1
  47. package/dist/contracts/interaction.d.cts +8 -9
  48. package/dist/contracts/interaction.d.ts +8 -9
  49. package/dist/contracts/modules.cjs +1 -1
  50. package/dist/contracts/modules.d.cts +20 -8
  51. package/dist/contracts/modules.d.ts +20 -8
  52. package/dist/contracts/modules.js +1 -1
  53. package/dist/custom-node-writes-CwkYRw3V.d.cts +310 -0
  54. package/dist/custom-node-writes-JfTn-Sy6.d.ts +310 -0
  55. package/dist/document-properties-D6Ahr8D6.d.cts +28 -0
  56. package/dist/document-properties-D6Ahr8D6.d.ts +28 -0
  57. package/dist/{editor-Cvd7Geoc.d.ts → editor-BogcVHXk.d.ts} +176 -59
  58. package/dist/{editor-cAEf1uXW.d.cts → editor-C8edZgy5.d.cts} +176 -59
  59. package/dist/editor.cjs +1 -1
  60. package/dist/editor.css +1 -7698
  61. package/dist/editor.d.cts +26 -25
  62. package/dist/editor.d.ts +26 -25
  63. package/dist/editor.js +1 -1
  64. package/dist/failure-BnGjoXf0.d.cts +64 -0
  65. package/dist/failure-BnGjoXf0.d.ts +64 -0
  66. package/dist/{index-DRqY5JVF.d.ts → index-BNv-ZLQP.d.ts} +327 -86
  67. package/dist/{index-wb-iOxfh.d.cts → index-Dn0lOp9Z.d.cts} +327 -86
  68. package/dist/index.cjs +1 -1
  69. package/dist/index.d.cts +20 -19
  70. package/dist/index.d.ts +20 -19
  71. package/dist/index.js +1 -1
  72. package/dist/layout.cjs +1 -1
  73. package/dist/layout.d.cts +92 -55
  74. package/dist/layout.d.ts +92 -55
  75. package/dist/layout.js +1 -1
  76. package/dist/{note-properties-jvnw_DGG.d.ts → note-properties-BmoSdyKS.d.ts} +1 -1
  77. package/dist/{note-properties-CQlxjic_.d.cts → note-properties-BvGfHk5e.d.cts} +1 -1
  78. package/dist/{omml-equation-Dd3mBep-.d.ts → omml-equation-Ciq5rgb7.d.ts} +1 -1
  79. package/dist/{omml-equation-BD-LsmWE.d.cts → omml-equation-CqQOt_dD.d.cts} +1 -1
  80. package/dist/output.cjs +1 -1
  81. package/dist/output.d.cts +6 -8
  82. package/dist/output.d.ts +6 -8
  83. package/dist/output.js +1 -1
  84. package/dist/{protocol-UuZOcOp7.d.cts → protocol-BB-WP3zk.d.cts} +2 -2
  85. package/dist/{protocol-C7ahrdUx.d.ts → protocol-Ckl7hWsv.d.ts} +2 -2
  86. package/dist/{review-items-bdGxFWNA.d.ts → review-items-BdeLNRi2.d.cts} +1 -2
  87. package/dist/{review-items-B8tffIXj.d.cts → review-items-CkYyXhXM.d.ts} +1 -2
  88. package/dist/{review-reads-Bxz03tHG.d.cts → review-reads-BOLSBm5w.d.cts} +2 -2
  89. package/dist/{review-reads-CHODU0LI.d.ts → review-reads-Crf0Xn42.d.ts} +2 -2
  90. package/dist/{revision-projection-CILpvv4M.d.ts → revision-projection-Ae2CWa8E.d.ts} +1 -1
  91. package/dist/{revision-projection-Cc4wz30g.d.cts → revision-projection-C2S8PSQm.d.cts} +1 -1
  92. package/dist/{semantic-cell-selection-BPzx6DdT.d.cts → semantic-cell-selection-C0OFD4D9.d.cts} +4 -4
  93. package/dist/{semantic-cell-selection-CsHcr-yk.d.ts → semantic-cell-selection-DdmoxC-y.d.ts} +4 -4
  94. package/dist/{semantic-interaction-D-RZ9Ust.d.ts → semantic-interaction-COyhZ9WH.d.ts} +21 -2
  95. package/dist/{semantic-interaction-BfWDD_0V.d.cts → semantic-interaction-Cs2jErnt.d.cts} +21 -2
  96. package/dist/{semantic-paint-WhVtSDJK.d.ts → semantic-paint-UHaj3sBY.d.cts} +2 -2
  97. package/dist/{semantic-paint-Bd7EqzXV.d.cts → semantic-paint-vA-oLSdV.d.ts} +2 -2
  98. package/dist/{semantic-records-DadVT_E1.d.cts → semantic-records-5AOQJmLX.d.cts} +20 -5
  99. package/dist/{semantic-records-DCt-ZwKU.d.ts → semantic-records-9xhwbJ23.d.ts} +20 -5
  100. package/dist/{shaped-measurer-CninrHr_.d.cts → shaped-measurer-NeF2mPSu.d.cts} +1 -1
  101. package/dist/{shaped-measurer-B9f4A7QA.d.ts → shaped-measurer-vzsY88oK.d.ts} +1 -1
  102. package/dist/store.cjs +1 -1
  103. package/dist/store.d.cts +193 -19
  104. package/dist/store.d.ts +193 -19
  105. package/dist/store.js +1 -1
  106. package/dist/tree-op-types-BPyXNxyL.d.cts +3053 -0
  107. package/dist/tree-op-types-DnzAOnc9.d.ts +3053 -0
  108. package/dist/{custom-node-writes-D6SGwebL.d.ts → tree-package-fragment-BjZ3RWAS.d.cts} +128 -312
  109. package/dist/{custom-node-writes-Dy3b20PS.d.cts → tree-package-fragment-CDER0G3B.d.ts} +128 -312
  110. package/dist/{tree-session-ZuBFOhIh.d.ts → tree-session-contract-BF2FVBOM.d.cts} +52 -106
  111. package/dist/{tree-session-Df02ajqc.d.cts → tree-session-contract-DhdsFT_z.d.ts} +52 -106
  112. package/dist/{tree-store-B_sJBMIS.d.cts → tree-store-CNZ3O83s.d.ts} +130 -25
  113. package/dist/{tree-store-DgETo6Mf.d.ts → tree-store-DfZi7FqY.d.cts} +130 -25
  114. package/package.json +14 -3
  115. package/dist/chunk-6JWP2H7K.js +0 -2
  116. package/dist/chunk-6KNLLEUW.cjs +0 -18
  117. package/dist/chunk-7ADTI533.cjs +0 -10
  118. package/dist/chunk-7ETDCPF6.cjs +0 -2
  119. package/dist/chunk-7I3BSGGS.js +0 -1
  120. package/dist/chunk-7UU5YFCD.cjs +0 -2
  121. package/dist/chunk-7VQ7YLW3.cjs +0 -1
  122. package/dist/chunk-CKDAK3MV.js +0 -10
  123. package/dist/chunk-DIMEYVNS.js +0 -2
  124. package/dist/chunk-GQQOL4PV.js +0 -1
  125. package/dist/chunk-H2656QDI.cjs +0 -1
  126. package/dist/chunk-KQGENNL5.cjs +0 -15
  127. package/dist/chunk-LIXPSV4T.js +0 -18
  128. package/dist/chunk-O4UULRAQ.cjs +0 -5
  129. package/dist/chunk-SIIFNE6U.js +0 -15
  130. package/dist/chunk-VXYECPKA.js +0 -5
  131. package/dist/hf-references-Dvk6De4Q.d.cts +0 -70
  132. package/dist/hf-references-z5Y4N1ab.d.ts +0 -70
  133. package/dist/image-resources-BgA9EQxY.d.ts +0 -203
  134. package/dist/image-resources-BiA-IXgo.d.cts +0 -203
  135. package/dist/note-nodes-BNCANoGN.d.ts +0 -108
  136. package/dist/note-nodes-DL-Au22P.d.cts +0 -108
  137. package/dist/ooxml-package-CdEy9ufK.d.cts +0 -1222
  138. package/dist/ooxml-package-CdEy9ufK.d.ts +0 -1222
  139. package/dist/tree-op-types-CnRb7AYo.d.ts +0 -1589
  140. package/dist/tree-op-types-D1vNJ7XC.d.cts +0 -1589
@@ -1,32 +1,121 @@
1
- import { O as OoxmlPart, c as OoxmlPackage } from './ooxml-package-CdEy9ufK.js';
2
- import { I as ImpactClass, T as TreeDocOp, a as TreeOpRejection } from './tree-op-types-CnRb7AYo.js';
1
+ import { a as OoxmlNode, j as OoxmlParagraphNode, k as OoxmlNoteNode, l as OoxmlContinuationSeparatorNode, m as OoxmlEndnotesNode, n as OoxmlFootnotesNode, o as OoxmlNoteRefNode, p as OoxmlNoteReferenceNode, q as OoxmlSeparatorNode, I as ImpactClass, O as OoxmlPart, b as OoxmlPackage, T as TreeDocOp, r as TreeOpRejection } from './tree-op-types-BPyXNxyL.cjs';
3
2
 
3
+ /** UTF-16 placeholder for one atomic note unit in `paragraphTextOf` / segments. */
4
+ declare const NOTE_ATOM_CHAR = "\uFFFC";
5
+ /** Signed 32-bit Word-compatible note id range (positive allocation only). */
6
+ declare const NOTE_ID_MIN = 1;
7
+ /** Largest note id Word accepts — signed 32-bit. */
8
+ declare const NOTE_ID_MAX = 2147483647;
9
+ /** Reserved separator / continuation ids — never allocated for normal notes. */
10
+ declare const NOTE_SEPARATOR_ID = -1;
11
+ /** Reserved id of the continuation-separator entry. Never allocated to a real note. */
12
+ declare const NOTE_CONTINUATION_SEPARATOR_ID = 0;
13
+ /** Which notes part a note lives in. Decides both placement and numbering rules. */
14
+ type NoteKind = 'footnote' | 'endnote';
15
+ /** Authored `ST_FtnEdn` including explicit `normal`. Absent means Word default (normal). */
4
16
  /**
5
- * The document metadata Word's document-property fields render.
17
+ * What a note entry IS.
6
18
  *
7
- * Every member is optional: an absent part, an absent element, or an empty value all read as
8
- * `undefined`, and a field over a missing property paints nothing. Keys are engine-internal
9
- * names; the field → property mapping (`TITLE` → `title`, `AUTHOR` → `creator`, …) lives in
10
- * `layout/field-doc-property.ts`.
19
+ * Only `normal` is a note a reader sees. The others are the furniture Word stores in the same
20
+ * part — the rules and notices drawn around the note area — reached by reserved ids.
11
21
  */
12
- interface DocumentProperties {
13
- /** `dc:title` — TITLE. */
14
- readonly title?: string;
15
- /** `dc:creator` — AUTHOR. */
16
- readonly creator?: string;
17
- /** `dc:subject` — SUBJECT. */
18
- readonly subject?: string;
19
- /** `cp:keywords` — KEYWORDS. */
20
- readonly keywords?: string;
21
- /** `cp:lastModifiedBy` — LASTSAVEDBY. */
22
- readonly lastModifiedBy?: string;
23
- /** `dc:description` — COMMENTS. */
24
- readonly description?: string;
25
- /** `Company` from `docProps/app.xml`. No field maps to it yet; carried for completeness. */
26
- readonly company?: string;
27
- /** `Manager` from `docProps/app.xml`. No field maps to it yet; carried for completeness. */
28
- readonly manager?: string;
22
+ type NoteType = 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
23
+ /** Parse a signed decimal note id; reject non-integers and out-of-int32 values. */
24
+ declare function parseNoteId(raw: string | undefined): number | null;
25
+ /**
26
+ * Canonical `EditorScope { kind: 'note'; id }` encoding.
27
+ *
28
+ * Footnote id `1` and endnote id `1` coexist, so the kind is part of the string:
29
+ * `footnote:2` / `endnote:-1`. Do not invent a parallel scope union arm.
30
+ */
31
+ declare function formatNoteScopeId(noteKind: NoteKind, noteId: number): string;
32
+ /**
33
+ * Parse {@link formatNoteScopeId}. Returns `null` for malformed / out-of-range ids.
34
+ */
35
+ declare function parseNoteScopeId(id: string): {
36
+ readonly noteKind: NoteKind;
37
+ readonly noteId: number;
38
+ } | null;
39
+ /** Whether a node is a `w:footnotes` part root. */
40
+ declare function isFootnotesNode(node: OoxmlNode): node is OoxmlFootnotesNode;
41
+ /** Whether a node is a `w:endnotes` part root. */
42
+ declare function isEndnotesNode(node: OoxmlNode): node is OoxmlEndnotesNode;
43
+ /** Whether a node is a `w:footnote` or `w:endnote` body. */
44
+ declare function isNoteNode(node: OoxmlNode): node is OoxmlNoteNode;
45
+ /** Whether a node is a body-side `w:footnoteReference` / `w:endnoteReference`. */
46
+ declare function isNoteReferenceNode(node: OoxmlNode): node is OoxmlNoteReferenceNode;
47
+ /** Whether a node is the `w:footnoteRef` / `w:endnoteRef` mark inside a note's own body. */
48
+ declare function isNoteRefNode(node: OoxmlNode): node is OoxmlNoteRefNode;
49
+ /** Whether a node is the `w:separator` rule drawn above the note area. */
50
+ declare function isSeparatorNode(node: OoxmlNode): node is OoxmlSeparatorNode;
51
+ /** Whether a node is the `w:continuationSeparator` rule used on continuation pages. */
52
+ declare function isContinuationSeparatorNode(node: OoxmlNode): node is OoxmlContinuationSeparatorNode;
53
+ /** Typed or generic `w:footnote` / `w:endnote`. */
54
+ declare function noteKindOf(node: OoxmlNode): NoteKind | null;
55
+ /** Authored `@w:id` on a note or noteReference when parseable. */
56
+ declare function noteIdOf(node: OoxmlNode): number | null;
57
+ /** Authored `@w:type` (`ST_FtnEdn`) when present and schema-legal; else `undefined`. */
58
+ declare function noteTypeOf(node: OoxmlNode): NoteType | undefined;
59
+ /** Whether a note is a normal (body) note — absent type and explicit `normal` both count. */
60
+ declare function isNormalNote(node: OoxmlNode): boolean;
61
+ /** Typed or generic footnote/endnote reference kind. */
62
+ declare function noteReferenceKindOf(node: OoxmlNode): NoteKind | null;
63
+ /** Typed or generic `w:footnoteRef` / `w:endnoteRef`. */
64
+ declare function noteRefKindOf(node: OoxmlNode): NoteKind | null;
65
+ /**
66
+ * Read `@w:customMarkFollows` on a note reference.
67
+ * Returns `undefined` when absent; otherwise the OOXML on/off interpretation.
68
+ */
69
+ declare function customMarkFollows(node: OoxmlNode): boolean | undefined;
70
+ /** Model text contributed by one atomic note unit. */
71
+ declare function noteAtomText(): typeof NOTE_ATOM_CHAR;
72
+ /**
73
+ * True when a run-inner node is a typed note atom that contributes one UTF-16 unit.
74
+ * Demoted/malformed known locals stay generic and contribute nothing.
75
+ */
76
+ declare function isNoteAtomNode(node: OoxmlNode): boolean;
77
+ /**
78
+ * One atomic note span inside a paragraph for caret / delete / selection.
79
+ *
80
+ * Each typed note atom is a single-node span (`removeNodeIds` = that node).
81
+ */
82
+ interface AtomicNoteSpan {
83
+ readonly kind: 'noteReference' | 'noteRef' | 'separator' | 'continuationSeparator';
84
+ readonly node: OoxmlNode;
85
+ readonly runId: string;
86
+ readonly removeNodeIds: readonly string[];
29
87
  }
88
+ /**
89
+ * Collect typed note atoms in document order (one segment each).
90
+ *
91
+ * Walks the same paragraph-inline surface as `segmentsOf` / `walkParagraphInline`:
92
+ * hyperlinks and content controls flatten; only direct run children contribute atoms.
93
+ * A demoted run-inner SDT husk stays opaque — no phantom addressable hit.
94
+ */
95
+ declare function atomicNoteSpansOf(paragraph: OoxmlParagraphNode): readonly AtomicNoteSpan[];
96
+ /** Cap on notes scanned when allocating / indexing a notes part. */
97
+ declare const MAX_NOTES_PER_PART = 10000;
98
+ /**
99
+ * Allocate the next positive signed 32-bit note id for a notes-part root.
100
+ *
101
+ * Solo: `max(existing)+1`, the dense sequence Word writes. `null` on exhaustion, so the
102
+ * caller refuses rather than wrapping onto an id a note already holds.
103
+ *
104
+ * With a collaboration actor bound — explicit argument, or the open store transaction — the
105
+ * id is the next unused value in that actor's stripe. Two peers each adding their first
106
+ * footnote from one snapshot otherwise both mint `w:id="1"`: the merge keeps both bodies
107
+ * under one id, both `w:footnoteReference` marks resolve to the first, and one author's note
108
+ * becomes unreachable.
109
+ *
110
+ * The reserved ids stay reserved either way. `0` (continuation separator) is seeded as used,
111
+ * so a residue of 0 advances one class instead of taking Word's furniture, and a stripe walk
112
+ * only ever climbs from a non-negative residue, so `-1` (separator) is unreachable.
113
+ */
114
+ declare function allocateNoteId(notesRoot: OoxmlNode, actorId?: string): number | null;
115
+ /** Collect note bodies from a footnotes/endnotes root, bounded. */
116
+ declare function notesOf(root: OoxmlNode): readonly OoxmlNoteNode[];
117
+ /** Find a typed note by id inside a notes-part root. */
118
+ declare function findNoteById(root: OoxmlNode, noteId: number): OoxmlNoteNode | undefined;
30
119
 
31
120
  /** A selection the caller wants restored when an entry is undone or redone. */
32
121
  /** A selection captured with a transaction, so undo restores where the caret was. */
@@ -67,6 +156,10 @@ interface TreeModelChange {
67
156
  readonly toRevision: number;
68
157
  readonly commitId: string;
69
158
  readonly origin: string;
159
+ /** Stable collaboration actor attribution, when the caller supplied it. */
160
+ readonly actorId?: string;
161
+ /** Stable collaboration operation identity, when the caller supplied it. */
162
+ readonly operationId?: string;
70
163
  readonly dirty: readonly string[];
71
164
  readonly created: readonly string[];
72
165
  readonly deleted: readonly string[];
@@ -132,6 +225,17 @@ interface TransactionContext {
132
225
  /** How one transaction behaves: its story scope, its attribution, and its selection marks. */
133
226
  interface TransactOptions {
134
227
  readonly origin?: string;
228
+ /** Stable actor attribution for collaboration and audit correlation. */
229
+ readonly actorId?: string;
230
+ /** Stable constituent identity for collaboration duplicate correlation. */
231
+ readonly operationId?: string;
232
+ /**
233
+ * Whether this transaction enters the legacy snapshot undo stack.
234
+ *
235
+ * Collaboration commits set this to false because their actor-local undo authority is the
236
+ * CRDT undo manager. Omitted preserves the ordinary non-collaborative history behavior.
237
+ */
238
+ readonly recordsHistory?: boolean;
135
239
  /**
136
240
  * A COMMAND is one user intent that may need several ops (a toolbar click applying a
137
241
  * property across a multi-run selection). It is still exactly one history entry, which is
@@ -284,6 +388,7 @@ declare class TreeDocumentStore {
284
388
  * is open, in which case the entry already exists and this transaction joins it.
285
389
  */
286
390
  transact(build: (ctx: TransactionContext) => void, options?: TransactOptions): TransactResult;
391
+ private commitTransaction;
287
392
  /**
288
393
  * Open one history entry for an IME composition.
289
394
  *
@@ -308,4 +413,4 @@ declare class TreeDocumentStore {
308
413
  private publish;
309
414
  }
310
415
 
311
- export { type DocumentProperties as D, type SelectionMark as S, type TreeModelChange as T, type TreeStoryRef as a, TreeDocumentStore as b, type TransactionContext as c, type TransactOptions as d, type TreeDocumentCheckpoint as e, type TreeDocumentStoreOptions as f, type TransactResult as g };
416
+ export { type AtomicNoteSpan as A, isNoteReferenceNode as B, isSeparatorNode as C, noteAtomText as D, noteIdOf as E, noteKindOf as F, noteRefKindOf as G, noteReferenceKindOf as H, notesOf as I, parseNoteId as J, parseNoteScopeId as K, MAX_NOTES_PER_PART as M, type NoteKind as N, type SelectionMark as S, type TreeModelChange as T, TreeDocumentStore as a, type TransactOptions as b, type TreeStoryRef as c, type TransactionContext as d, type TreeDocumentCheckpoint as e, NOTE_ATOM_CHAR as f, NOTE_CONTINUATION_SEPARATOR_ID as g, NOTE_ID_MAX as h, NOTE_ID_MIN as i, NOTE_SEPARATOR_ID as j, type NoteType as k, type TreeDocumentStoreOptions as l, type TransactResult as m, noteTypeOf as n, allocateNoteId as o, atomicNoteSpansOf as p, customMarkFollows as q, findNoteById as r, formatNoteScopeId as s, isContinuationSeparatorNode as t, isEndnotesNode as u, isFootnotesNode as v, isNormalNote as w, isNoteAtomNode as x, isNoteNode as y, isNoteRefNode as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docx-editor.dev/core",
3
- "version": "2.9.2",
3
+ "version": "2.11.0",
4
4
  "description": "Framework-agnostic core for docx-editor.dev: OOXML parse/serialize, the canonical document tree, layout and paint, and the Editor contract the adapters render.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,6 +19,16 @@
19
19
  "import": "./dist/binding.js",
20
20
  "require": "./dist/binding.cjs"
21
21
  },
22
+ "./collaboration": {
23
+ "types": "./dist/collaboration.d.ts",
24
+ "import": "./dist/collaboration.js",
25
+ "require": "./dist/collaboration.cjs"
26
+ },
27
+ "./collaboration/replication": {
28
+ "types": "./dist/collaboration/replication.d.ts",
29
+ "import": "./dist/collaboration/replication.js",
30
+ "require": "./dist/collaboration/replication.cjs"
31
+ },
22
32
  "./contracts/editor": {
23
33
  "types": "./dist/contracts/editor.d.ts",
24
34
  "import": "./dist/contracts/editor.js",
@@ -74,7 +84,8 @@
74
84
  },
75
85
  "devDependencies": {
76
86
  "autoprefixer": "^10.4.17",
77
- "postcss": "^8.4.33",
87
+ "cssnano": "^7.1.9",
88
+ "postcss": "^8.5.13",
78
89
  "tailwindcss": "^3.4.1",
79
90
  "tailwindcss-animate": "^1.0.7",
80
91
  "typescript": "^5.3.3"
@@ -86,7 +97,7 @@
86
97
  "directory": "packages/core"
87
98
  },
88
99
  "dependencies": {
89
- "@docx-editor.dev/i18n": "^2.9.2",
100
+ "@docx-editor.dev/i18n": "^2.11.0",
90
101
  "bidi-js": "1.0.3",
91
102
  "emf-converter": "2.0.2",
92
103
  "fast-xml-parser": "^5.10.1",
@@ -1,2 +0,0 @@
1
- import {Gd,Y as Y$1,_ as _$1,Ma,pb,qb,uc,Ab,$ as $$1,kb,sb,zb}from'./chunk-LIXPSV4T.js';var M=8,ge={color:"painted",background:"painted",spanClassName:"painted",avatarUrl:"card-only"},xe=Object.keys(ge),dt=xe.filter(t=>ge[t]==="painted"),ct=new Set(["http","https","data","blob"]),yt=/^([a-zA-Z][a-zA-Z0-9+.-]*):/;function ut(t){let e=t.replace(/[\u0000-\u0020\u007f]/g,"");if(e.length===0)return;let n=yt.exec(e);if(n)return !ct.has(n[1].toLowerCase())||/^data:/i.test(e)&&!/^data:image\/(?!svg)/i.test(e)?void 0:e;let o=a=>e[a]==="/"||e[a]==="\\";return o(0)&&o(1)?void 0:e}function pt(t){if(typeof t=="string")return t.length>0?{color:t}:null;if(t===null||typeof t!="object")return null;let e={},n=Object.prototype.hasOwnProperty;for(let o of xe){if(!n.call(t,o))continue;let a=t[o];if(!(typeof a!="string"||a.length===0)){if(o==="avatarUrl"){let r=ut(a);r!==void 0&&(e.avatarUrl=r);continue}e[o]=a;}}return Object.keys(e).length>0?e:null}function _(t){return `var(--doc-review-author-${t%M})`}function be(t){let e=new Map;if(t===void 0||t==="kind"||t==="author")return e;for(let[n,o]of Object.entries(t.authors)){let a=pt(o);a&&e.set(n,a);}return e}function En(t,e){let n=be(e);return [...t].map(([o,a])=>{let r=n.get(o);return {author:o,slot:a,color:r?.color??_(a),...r?{style:r}:{}}})}var ht=128;function K(t,e,n=ht){let o=e.length<n?e.length:n,a=t;for(let r=0;r<o;r+=1)a=Math.imul(a^e.charCodeAt(r),16777619);return Math.imul(a^e.length,16777619)}function ft(t,e,n){let o=K(2166136261,n);for(let a of t.keys())o=K(o,a);for(let[a,r]of e){o=K(o,a);for(let i of dt)o=K(o,r[i]??"",1/0);}return `${t.size}.${e.size}.${(o>>>0).toString(36)}`}function me(t){return t===null?"kind":t.key}var X=new WeakMap;function ve(t,e,n){if(t==="kind")return null;let o=X.get(e);if(o&&o.option===t&&o.authorSlots===n)return o.context;let a=be(t),r=t===void 0||t==="author"?"author":t.others??"author";if(a.size===0&&r==="kind")return X.set(e,{option:t,authorSlots:n,context:null}),null;let i=n??xt(e),s=new Map;for(let[d,c]of a){if(!c.spanClassName)continue;let y=c.spanClassName.split(/\s+/).filter(u=>u.length>0);y.length>0&&s.set(d,y);}let l={authorSlots:i,styles:a,classTokens:s,others:r,key:ft(i,a,r)};return X.set(e,{option:t,authorSlots:n,context:l}),l}var he=new WeakMap;function gt(t){let e=he.get(t);if(e)return e;let n=[],o=new Set,a=r=>{r===""||o.has(r)||(o.add(r),n.push(r));};for(let r of Y$1(t)){for(let s of r.lines)for(let l of s.spans){let d=l.revisions;if(d!==void 0)for(let c=0;c<d.length;c+=1)a(d[c].author);for(let c of l.props){if(c.localName!=="rPrChange"&&c.localName!=="pPrChange")continue;let y=c.attributes?.author;a(y??"");break}}let i=r.markRevisions;if(i)for(let s=0;s<i.length;s+=1)a(i[s].author);}return he.set(t,n),n}var fe=new WeakMap;function xt(t){let e=fe.get(t);if(e)return e;let n=new Map,o=a=>{for(let r of gt(a))n.has(r)||n.set(r,n.size);};for(let a of t.pages){o(a.fragments),a.header&&o(a.header.fragments),a.footer&&o(a.footer.fragments);for(let r of [a.footnotes,a.endnotes])if(r){r.separator&&o(r.separator.fragments);for(let i of r.notes)o(i.fragments);}for(let r of [a.anchoredDrawings,a.header?.anchoredDrawings,a.footer?.anchoredDrawings])if(r)for(let i of r)i.textboxStory&&o(i.textboxStory.fragments);}return fe.set(t,n),n}function bt(t,e){let n=null;for(let o of e)o===""||t.has(o)||(n===null&&(n=new Map(t)),n.has(o)||n.set(o,n.size));return n??t}function Pn(){let t=new Map,e=0;return {resolve(n,o){let a=bt(n,o);for(let r of a.keys())t.has(r)||(t.set(r,e),e+=1);return new Map([...a.keys()].map(r=>[r,t.get(r)]).sort((r,i)=>r[1]-i[1]))}}}function Re(t,e,n){if(t===void 0||t.length===0)return null;let o=t[t.length-1],a=t.some(s=>s.kind==="delete"||s.kind==="moveFrom"),r=o.kind,i=r==="delete"||r==="moveFrom"?"line-through":r==="insert"||r==="moveTo"?"underline":null;return {attribution:o,line:a&&i==="underline"?"line-through":i,decorationStyle:r==="moveFrom"||r==="moveTo"?"double":r==="insert"?"dashed":"solid",color:a?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",authorColor:n?.get(o.author)?.color??_(e?.get(o.author)??0),deleted:a}}function Se(t,e,n,o,a,r){for(let i of [n.footnotes,n.endnotes])i&&e.append(mt(t,n,i,o,a,r));}function mt(t,e,n,o,a,r){let i=t.createElement("div");if(i.className="docx-notes",i.dataset.docxNotes=n.kind,i.dataset.docxNotesPlacement=n.placement,i.style.position="absolute",i.style.left=`${(n.box.x-e.box.x)*o.scale}px`,i.style.top=`${(n.box.y-e.box.y)*o.scale}px`,i.style.width=`${n.box.width*o.scale}px`,i.style.height=`${n.box.height*o.scale}px`,n.separator){let s=t.createElement("div");s.className="docx-note-separator",s.dataset.docxNoteSeparator=n.separator.kind,s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left=`${(n.separator.box.x-n.box.x)*o.scale}px`,s.style.top=`${(n.separator.box.y-n.box.y)*o.scale}px`,s.style.width=`${n.separator.box.width*o.scale}px`,s.style.height=`${Math.max(n.separator.box.height,.75)*o.scale}px`;let l=n.separator.ruleStyle;if(l||n.separator.synthetic||n.separator.fragments.length===0)vt(s,t,l??"single",o.scale);else for(let d of n.separator.fragments)s.append(d.kind==="table"?r(t,d,o):a(t,d,o));i.append(s);}for(let s of n.notes){let l=t.createElement("div");l.className="docx-note",l.dataset.docxNote=s.noteKind,l.dataset.docxNoteId=String(s.noteId),l.dataset.docxNoteScope=s.scopeId,s.mark!==null&&(l.dataset.docxNoteMark=s.mark),s.continuation&&(l.dataset.docxNoteContinuation=""),l.setAttribute("role","doc-footnote"),l.style.position="absolute",l.style.left=`${(s.box.x-n.box.x)*o.scale}px`,l.style.top=`${(s.box.y-n.box.y)*o.scale}px`,l.style.width=`${s.box.width*o.scale}px`,l.style.height=`${s.box.height*o.scale}px`;for(let d of s.fragments)l.append(d.kind==="table"?r(t,d,o):a(t,d,o));i.append(l);}return i}function vt(t,e,n,o){t.dataset.docxNoteRule=n;let a=Math.max(1,o*.75);if(n==="single"){t.style.borderTop=`${a}px solid currentColor`,t.style.opacity="0.85";return}t.style.opacity="0.85";let r=Math.max(1,o*1.25);for(let i of [0,a+r]){let s=e.createElement("div");s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top=`${i}px`,s.style.height="0",s.style.borderTop=`${a}px solid currentColor`,t.append(s);}}function j(t,e,n){return !!n.activeHeaderFooterRId&&!!t.rId&&n.activeHeaderFooterRId===t.rId&&(n.activeHeaderFooterPageIndex===void 0||n.activeHeaderFooterPageIndex===e)}function Y(t,e,n){return n?t.kind==="footer"?Math.max(t.box.height,e.box.y+e.box.height-t.box.y):Math.max(t.box.height,e.contentBox.y-t.box.y):t.box.height}function we(t,e){for(let{record:n,element:o,materialized:a}of t){if(!a)continue;let r=o.querySelector(":scope > .docx-page-content");r&&(e.activeHeaderFooterRId?r.setAttribute("contenteditable","false"):r.removeAttribute("contenteditable"));for(let i of o.querySelectorAll(":scope > .docx-hf:not(.docx-hf--placeholder)")){let s=Rt(n,i);if(!s)continue;let l=j(s,n.index,e);St(i,n,s,l,e.scale);}for(let i of o.querySelectorAll(":scope > [data-docx-hf-front]")){let s=ke(n,i.dataset.docxHfFront);Ae(i,!!s&&j(s,n.index,e));}}}function Rt(t,e){return ke(t,e.dataset.docxHf)}function ke(t,e){if(e==="header")return t.header;if(e==="footer")return t.footer}function St(t,e,n,o,a){o?(t.dataset.docxHfActive="",t.setAttribute("contenteditable","true")):(delete t.dataset.docxHfActive,t.setAttribute("contenteditable","false")),t.style.height=`${Y(n,e,o)*a}px`,Ae(t,o);}function Ae(t,e){let n=t.querySelectorAll(t instanceof Element&&t.classList.contains("docx-drawing-layer")?":scope > *":":scope > .docx-drawing-layer > *");for(let o of n){o.style.pointerEvents=e?"auto":"none";for(let a of o.querySelectorAll(".docx-drawing"))a.style.pointerEvents=e?"auto":"none";}}var Ee=Object.freeze({"image/svg+xml":"SVG","image/tiff":"TIFF","image/x-emf":"EMF","image/x-wmf":"WMF",unknown:"Unknown"}),G=new WeakMap,Z=new WeakMap,wt=256;function $e(t,e){let n=G.get(t);if(n)return n;let o=new Map,a=new Map;return n=Object.freeze({urlForReady(r,i){let s=o.get(r.resourceKey);if(s)return s;let l=e.create(r,i);return o.set(r.resourceKey,l),l},imageFor(r,i,s){let l=a.get(r);if(l&&l.resourceKey===i)return l.element;let d=s.createElement("img");return a.size<wt&&a.set(r,{element:d,resourceKey:i,...l?.readyElement?{readyElement:l.readyElement}:{}}),d},imageForPending(r){return a.get(r)?.element??null},readyElementFor(r){return a.get(r)?.readyElement??null},rememberReadyElement(r,i){let s=a.get(r);s&&a.set(r,{...s,readyElement:i});},reconcile(r,i){for(let[s,l]of o)r.has(s)||(e.revoke(l),o.delete(s));for(let[s,l]of a)i.has(s)||(l.element.removeAttribute("src"),a.delete(s));},revokeAll(){for(let r of o.values())e.revoke(r);o.clear();for(let r of a.values())r.element.removeAttribute("src");a.clear();}}),G.set(t,n),n}function J(t,e){return `${e.paintInstance??""}|${t.drawingNodeId}`}function Dn(t){G.get(t)?.revokeAll(),G.delete(t);}function E(t){return Number.isFinite(t)?String(t):"0"}function Te(t,e){if(t.length<3||e.width<=0||e.height<=0)return null;let n=[];for(let o of t){if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return null;let a=(o.x-e.x)/e.width*100,r=(o.y-e.y)/e.height*100;n.push(`${E(a)}% ${E(r)}%`);}return `polygon(${n.join(", ")})`}function Me(t){let e=t.geometry.contentBounds;return zb({transform:t.transform,contentWidth:e.width,contentHeight:e.height})}function He(t){let{effects:e}=t,n=[];if(e.grayscale&&n.push("grayscale(1)"),e.brightness!==0&&Number.isFinite(e.brightness)){let o=1+e.brightness/100;Number.isFinite(o)&&n.push(`brightness(${E(Math.max(0,o))})`);}if(e.contrast!==0&&Number.isFinite(e.contrast)){let o=1+e.contrast/100;Number.isFinite(o)&&n.push(`contrast(${E(Math.max(0,o))})`);}return n.length>0?n.join(" "):void 0}function Ie(t,e){let{crop:n}=t,o=Math.max(0,Math.min(1,n.left)),a=Math.max(0,Math.min(1,n.top)),r=Math.max(0,Math.min(1,n.right)),i=Math.max(0,Math.min(1,n.bottom)),s=Math.max(1e-4,1-o-r),l=Math.max(1e-4,1-a-i);return Object.freeze({width:`${E(1/s*100)}%`,height:`${E(1/l*100)}%`,left:`${E(-o/s*100)}%`,top:`${E(-a/l*100)}%`})}function kt(t,e){let{resource:n}=t;switch(n.kind){case "external":return e.externalResource;case "missing":return e.missingResource;case "pending":return e.pendingResource;case "unrenderable":switch(n.reason){case "unsupported-format":return e.unsupportedFormat(Ee[n.mime]??Ee.unknown);case "non-picture-graphic":return e.nonPictureGraphic(t.placeholderGraphicKind??"graphic");case "signature-mismatch":return e.contentMismatch;case "decode-failed":return e.decodeFailed;case "resource-limit":return e.resourceLimit;default:return e.invalidResource}default:return e.invalidResource}}function H(t,e,n){let{accessibility:o}=e;o.hidden||(t.setAttribute("role",n?"link":"img"),o.label?t.setAttribute("aria-label",o.label):n||t.setAttribute("aria-hidden","true"));}function O(t,e,n,o){let a=o?.x??0,r=o?.y??0;t.style.position="absolute",t.style.left=`${(e.x-a)*n}px`,t.style.top=`${(e.y-r)*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`,t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.pointerEvents="auto";}function At(t,e,n,o,a){let r=t.paintBounds,i=t.geometry.contentBounds,s=Ie(t);return [o,n.scale,a?.x??0,a?.y??0,r.x,r.y,r.width,r.height,i.x,i.y,i.width,i.height,Te(t.geometry.clipPolygon??[],r)??"",He(t)??"",Me(t)??"",s.width,s.height,s.left,s.top,n.inertLinks?"":t.hyperlinkHref??"",t.accessibility.label??""].join("|")}function N(t,e,n,o){let a=t.createElement("div");a.className="docx-drawing docx-drawing-placeholder",a.dataset.drawingNodeId=e.drawingNodeId,O(a,e.paintBounds,n.scale,o);let r=t.createElement("div");r.className="docx-drawing-placeholder-card";let i=t.createElement("span");return i.className="docx-drawing-placeholder-label",i.textContent=kt(e,n.strings),r.append(i),a.append(r),e.hyperlinkHref&&!n.inertLinks?(a.dataset.docxDrawingLink=e.drawingNodeId,a.dataset.docxDrawingLinkKind="external",a.dataset.docxDrawingLinkHref=e.hyperlinkHref,a.setAttribute("tabindex","-1"),H(a,e,true)):H(a,e,false),a}function Et(t,e,n,o,a,r){let i=e.resource;if(i.kind!=="ready")return N(t,e,n,r);let s=J(e,n),l=a?.readyElementFor?.(s)??t.createElement("div"),d=At(e,i,n,o,r);if(Z.get(l)===d)return l;l.className="docx-drawing docx-drawing-ready",l.style.cssText="",l.dataset.drawingNodeId=e.drawingNodeId,delete l.dataset.docxDrawingLink,delete l.dataset.docxDrawingLinkKind,delete l.dataset.docxDrawingLinkHref,l.removeAttribute("aria-hidden"),l.removeAttribute("aria-label"),l.removeAttribute("role"),l.removeAttribute("tabindex"),O(l,e.paintBounds,n.scale,r);let c=Te(e.geometry.clipPolygon??[],e.paintBounds);c&&(l.style.clipPath=c);let y=t.createElement("div");y.className="docx-drawing-image-frame",y.style.position="absolute";let u=e.geometry.contentBounds,h=e.paintBounds;y.style.left=`${(u.x-h.x)*n.scale}px`,y.style.top=`${(u.y-h.y)*n.scale}px`,y.style.width=`${u.width*n.scale}px`,y.style.height=`${u.height*n.scale}px`;let p=He(e);p&&(y.style.filter=p);let g=t.createElement("div");g.className="docx-drawing-transform-stage",g.style.position="relative",g.style.width="100%",g.style.height="100%";let w=Me(e);w&&(g.style.transform=w,g.style.transformOrigin="0 0");let S=t.createElement("div");S.className="docx-drawing-crop-viewport",S.style.position="relative",S.style.width="100%",S.style.height="100%",S.style.overflow="hidden";let R=a?.imageFor?.(s,i.resourceKey,t)??t.createElement("img");R.className="docx-drawing-image",R.setAttribute("draggable","false"),R.getAttribute("src")!==o&&R.setAttribute("src",o),R.setAttribute("alt","");let P=Ie(e);return R.style.position="absolute",R.style.width=P.width,R.style.height=P.height,R.style.left=P.left,R.style.top=P.top,R.style.maxWidth="none",R.style.maxHeight="none",S.append(R),g.append(S),y.append(g),l.replaceChildren(y),e.hyperlinkHref&&!n.inertLinks?(l.dataset.docxDrawingLink=e.drawingNodeId,l.dataset.docxDrawingLinkKind="external",l.dataset.docxDrawingLinkHref=e.hyperlinkHref,l.setAttribute("tabindex","-1"),H(l,e,true)):H(l,e,false),a?.rememberReadyElement?.(s,l),Z.set(l,d),l}var Pe="http://www.w3.org/2000/svg";function Pt(t,e,n,o){let a=e.vectorShape,r=t.createElement("div");r.className="docx-drawing docx-drawing-shape",r.dataset.drawingNodeId=e.drawingNodeId,O(r,e.paintBounds,n.scale,o);let i=e.geometry.contentBounds,s=e.paintBounds,l=t.createElement("div");l.className="docx-drawing-image-frame",l.style.position="absolute",l.style.left=`${(i.x-s.x)*n.scale}px`,l.style.top=`${(i.y-s.y)*n.scale}px`,l.style.width=`${i.width*n.scale}px`,l.style.height=`${i.height*n.scale}px`;let d=t.createElementNS(Pe,"svg");d.setAttribute("viewBox",`0 0 ${E(Math.max(1,a.extentEmu.cx))} ${E(Math.max(1,a.extentEmu.cy))}`),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.style.display="block";let c=t.createElementNS(Pe,"path"),y=a.subpathsEmu.map(u=>`M${u.map(h=>`${E(h.x)} ${E(h.y)}`).join("L")}Z`).join("");return c.setAttribute("d",y),c.setAttribute("fill",a.fillHex!==null?`#${a.fillHex}`:"none"),c.setAttribute("fill-rule","evenodd"),a.strokeHex!==null&&(c.setAttribute("stroke",`#${a.strokeHex}`),c.setAttribute("stroke-width",E(Math.max(1,a.strokeWidthEmu)))),d.append(c),l.append(d),r.append(l),e.hyperlinkHref&&!n.inertLinks?(r.dataset.docxDrawingLink=e.drawingNodeId,r.dataset.docxDrawingLinkKind="external",r.dataset.docxDrawingLinkHref=e.hyperlinkHref,r.setAttribute("tabindex","-1"),H(r,e,true)):H(r,e,false),r}function Lt(t,e,n,o,a){let r=o.scale,i=t.createElement("div");i.className="docx-drawing docx-drawing-textbox",i.dataset.drawingNodeId=e.drawingNodeId,i.setAttribute("contenteditable","false"),O(i,e.paintBounds,o.scale,a),i.style.overflow="hidden";let s=(e.x-e.paintBounds.x)*r,l=(e.y-e.paintBounds.y)*r;if(n.fillHex!==null||n.strokeHex!==null){let c=t.createElement("div");c.className="docx-drawing-textbox-box",c.style.position="absolute",c.style.left=`${s}px`,c.style.top=`${l}px`,c.style.width=`${e.width*r}px`,c.style.height=`${e.height*r}px`,c.style.boxSizing="border-box",n.fillHex!==null&&(c.style.backgroundColor=`#${n.fillHex}`),n.strokeHex!==null&&(c.style.border=`${Math.max(n.strokeWidthPt*r,.5)}px solid #${n.strokeHex}`),i.append(c);}let d=t.createElement("div");d.className="docx-drawing-textbox-content",d.style.position="absolute",d.style.left=`${s+n.contentOffset.x*r}px`,d.style.top=`${l+n.contentOffset.y*r}px`,d.style.width=`${n.contentWidth*r}px`,d.style.height=`${Math.max(0,n.contentHeight)*r}px`,d.style.overflow="hidden";for(let c of n.fragments)d.append(o.paintStoryFragment(t,c));for(let c of d.querySelectorAll("[data-paragraph-id]"))delete c.dataset.paragraphId;return i.append(d),H(i,e,false),i}function De(t,e,n,o,a){if(e.accessibility.hidden||e.paintBounds.width<=0||e.paintBounds.height<=0)return null;if(e.kind==="anchoredDrawing"&&e.textboxStory!==void 0&&n.paintStoryFragment!==void 0)return Lt(t,e,e.textboxStory,n,a);if(e.vectorShape&&e.vectorShape.subpathsEmu.length>0)return Pt(t,e,n,a);let{resource:r}=e;if(r.kind==="ready"){if(!n.imageUrlPort||!o)return N(t,e,n,a);let i=o.urlForReady(r.validatedHandle,r.mime);return i?Et(t,e,n,i,o,a):N(t,e,n,a)}if(r.kind==="pending"){let i=o?.readyElementFor?.(J(e,n))??o?.imageForPending?.(J(e,n))?.closest(".docx-drawing-ready");return i?(Z.delete(i),i.dataset.drawingNodeId=e.drawingNodeId,O(i,e.paintBounds,n.scale,a),i):N(t,e,n,a)}return N(t,e,n,a)}function Ce(t,e,n,o,a){let r=[];for(let i of e.drawings??[]){let s=De(t,i,n,o,a);s&&r.push(s);}return Object.freeze(r)}function Fe(t,e,n,o,a,r){let i=[];for(let s of e){if(Ab(s)!==n)continue;let l=De(t,s,o,a,r);l&&(l.dataset.drawingLayer=n,i.push(l));}return Object.freeze(i)}function $t(t,e){$$1({fragments:t.fragments,...t.anchoredDrawings?{anchoredDrawings:t.anchoredDrawings}:{}},e);for(let n of [t.header,t.footer])n&&$$1(n,e);for(let n of [t.footnotes,t.endnotes])if(n){n.separator&&$$1(n.separator,e);for(let o of n.notes)$$1(o,e);}}var Le=new WeakMap;function Be(t){let e=Le.get(t);if(e)return e;let n=[],o=[];$t(t,r=>{r.resource.kind==="ready"&&n.push(r.resource.resourceKey),o.push(`p${t.index}|${r.drawingNodeId}`);});let a=Object.freeze({resourceKeys:Object.freeze(n),elementKeys:Object.freeze(o)});return Le.set(t,a),a}function Ne(t){let e=new Set;for(let n of t.pages)for(let o of Be(n).resourceKeys)e.add(o);return e}function Oe(t){let e=new Set;for(let n of t.pages)for(let o of Be(n).elementKeys)e.add(o);return e}function ze(t){return [t.missingResource,t.externalResource,t.invalidResource,t.contentMismatch,t.decodeFailed,t.resourceLimit,t.pendingResource,t.unsupportedFormat("probe"),t.nonPictureGraphic("probe")].join("\0")}var Q=Object.freeze({unsupportedFormat:t=>`Unsupported image format (${t})`,nonPictureGraphic:t=>`Unsupported graphic (${t})`,missingResource:"Image missing",externalResource:"External image not loaded",invalidResource:"Invalid image",contentMismatch:"Image content does not match its type",decodeFailed:"Image could not be decoded",resourceLimit:"Image exceeds size limits",pendingResource:"Loading image"});function Cn(t){return Object.freeze({unsupportedFormat:e=>t("image.unsupportedFormat",{format:e}),nonPictureGraphic:e=>t("image.nonPictureGraphic",{kind:e}),missingResource:t("image.missingResource"),externalResource:t("image.externalResource"),invalidResource:t("image.invalidResource"),contentMismatch:t("image.contentMismatch"),decodeFailed:t("image.decodeFailed"),resourceLimit:t("image.resourceLimit"),pendingResource:t("image.pendingResource")})}function Tt(t,e,n){t.style.position="absolute",t.style.left=`${e.x*n}px`,t.style.top=`${e.y*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`;}function Ue(t,e,n,o){let a=t.createElement("span");return a.className=e,a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.display="block",a.style.left=`${n.x*o}px`,a.style.top=`${n.y*o}px`,a.style.width=`${n.width*o}px`,a.style.height=`${n.height*o}px`,a.style.backgroundColor="currentColor",a.style.pointerEvents="none",a}function A(t,e,n,o,a=0,r=0,i=[]){let s=a+n.box.x,l=r+n.box.y,d=[...i,n.kind];switch(n.kind){case "text":case "fallback":{let c=t.createElement("span");c.className=["docx-equation-node",...d.map(y=>`docx-equation-${y}`)].join(" "),Tt(c,{x:s,y:l,width:n.box.width,height:n.box.height},o),c.textContent=n.text,c.style.display="block",c.style.fontSize=`${n.fontSizePt*o}px`,c.style.lineHeight=`${n.box.height*o}px`,c.style.whiteSpace="pre",e.append(c);break}case "row":for(let c of n.items)A(t,e,c,o,s,l,d);break;case "fraction":A(t,e,n.numerator,o,s,l,d),e.append(Ue(t,"docx-equation-fraction-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},o)),A(t,e,n.denominator,o,s,l,d);break;case "radical":A(t,e,n.sign,o,s,l,d),n.degree&&A(t,e,n.degree,o,s,l,d),e.append(Ue(t,"docx-equation-radical-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},o)),A(t,e,n.radicand,o,s,l,d);break;case "script":A(t,e,n.base,o,s,l,d),n.subscript&&A(t,e,n.subscript,o,s,l,d),n.superscript&&A(t,e,n.superscript,o,s,l,d);break;case "nary":A(t,e,n.operator,o,s,l,d),n.lowerLimit&&A(t,e,n.lowerLimit,o,s,l,d),n.upperLimit&&A(t,e,n.upperLimit,o,s,l,d),A(t,e,n.body,o,s,l,d);break}}function Ke(t,e,n,o){let a=n.geometry;e.className="layout-run docx-equation",e.dataset.docxEquation=n.sourceNodeId,e.setAttribute("contenteditable","false"),e.setAttribute("role","math"),n.fallbackText&&e.setAttribute("aria-label",n.fallbackText),e.style.position="relative",e.style.display="inline-block",e.style.width=`${a.box.width*o}px`,e.style.height=`${a.box.height*o}px`,e.style.lineHeight="0",e.style.pointerEvents="auto",e.style.userSelect="none",e.style.verticalAlign=`${-(a.box.height-a.baseline)*o}px`;let r=t.createDocumentFragment();A(t,r,a,o),e.append(r);}var Mt=/^[0-9A-Fa-f]{6}$/;function Ht(t){switch(t){case "dashed":return "dashed";case "dotted":return "dotted";case "double":case "triple":return "solid";default:return "solid"}}function _e(t){return t&&Mt.test(t)?t:"000000"}function ee(t,e){let n=t.createElement("div");return n.className=e,n.setAttribute("aria-hidden","true"),n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.right="0",n.style.bottom="0",n.style.overflow="visible",n.style.pointerEvents="none",n.style.boxSizing="border-box",n}function W(t,e,n,o){if(!n)return;let a=`#${_e(n.color)}`,r=`${Math.max(0,n.widthPt*o)}px`;if(t.style[`border${e}Width`]=r,t.style[`border${e}Color`]=a,n.style==="double"||n.style==="triple"){t.style[`border${e}Style`]="none";return}t.style[`border${e}Style`]=Ht(n.style);}function te(t,e,n,o,a){let r=t.createElement("div");r.className=a,r.dataset.edge=n.side,r.dataset.stroke=n.role,r.style.position="absolute",r.style.left=`${n.x*o}px`,r.style.top=`${n.y*o}px`,r.style.width=`${n.width*o}px`,r.style.height=`${n.height*o}px`,r.style.pointerEvents="none",r.style.backgroundColor=`#${_e(n.color)}`,n.cssStyle!=="solid"&&(r.dataset.cssStyle=n.cssStyle),e.append(r);}function It(t){let e=new Set;for(let n of t)e.add(`${n.side}\0${n.role}`);return e}function Dt(t,e,n,o){let a=It(n),r=u=>a.has(`${u}\0middle`),i=ee(t,"docx-table-border-double"),s=ee(t,"docx-table-border-triple"),l=ee(t,"docx-table-border-edge"),d=false,c=false,y=false;for(let u of n){if(u.role==="edge"){y=true,te(t,l,u,o,"docx-table-border-edge-stroke");continue}if(r(u.side)){c=true,te(t,s,u,o,"docx-table-border-triple-stroke");continue}(u.role==="outer"||u.role==="inner")&&(d=true,te(t,i,u,o,"docx-table-border-double-stroke"));}d&&e.append(i),c&&e.append(s),y&&e.append(l);}function je(t,e,n,o){W(e,"Top",n?.top,o),W(e,"Right",n?.right,o),W(e,"Bottom",n?.bottom,o),W(e,"Left",n?.left,o),n?.strokes&&n.strokes.length>0&&Dt(t,e,n.strokes,o);}var ne="when-selected",Ge=new WeakMap,We=0;function Ct(t){let e=Ge.get(t);return e||(We+=1,e=`alias${We}`,Ge.set(t,e)),e}function tt(t){return {...t,drawingStrings:t.drawingStrings??Q,urlRegistry:t.urlRegistry??null}}function Ft(t){let e={...t,inertLinks:true};return Object.freeze({scale:t.scale,strings:t.drawingStrings,...t.imageUrlPort?{imageUrlPort:t.imageUrlPort}:{},...t.inertLinks?{inertLinks:true}:{},...t.paintInstance?{paintInstance:t.paintInstance}:{},paintStoryFragment:(n,o)=>o.kind==="table"?C(n,o,e):D(n,o,e)})}function nt(t){return Object.freeze({ctx:Ft(t),urlRegistry:t.urlRegistry})}function qe(t,e,n,o,a,r){V(t,e,_$1(n),o,a,r);}function V(t,e,n,o,a,r,i=true,s){if(n.length===0)return;let l=nt(o),d=t.createElement("div");d.className=r==="behind"?"docx-drawing-layer docx-drawing-layer-behind":"docx-drawing-layer docx-drawing-layer-front",d.style.position="absolute",d.style.inset="0",d.style.pointerEvents="none",s&&(d.dataset.docxHfFront=s);for(let c of Fe(t,n,r,l.ctx,l.urlRegistry,a)){if(c.style.pointerEvents=i?"auto":"none",!i)for(let y of c.querySelectorAll(".docx-drawing"))y.style.pointerEvents="none";d.append(c);}d.childElementCount>0&&e.append(d);}function ot(t){return t.horizontalFrame==="page"||t.verticalFrame==="page"}function rt(t,e,n){let o=e.paintBounds,a=e.horizontalFrame==="page"?n.x+(o.x-e.horizontalFrameOrigin):t.box.x+o.x,r=e.verticalFrame==="page"?n.y+(o.y-e.verticalFrameOrigin):t.box.y+o.y,i=a-o.x,s=r-o.y,l=d=>Object.freeze({x:d.x+i,y:d.y+s,width:d.width,height:d.height});return Object.freeze({...e,x:e.x+i,y:e.y+s,paintBounds:l(o),hitBounds:l(e.hitBounds),geometry:Object.freeze({...e.geometry,contentBounds:l(e.geometry.contentBounds),paintBounds:l(e.geometry.paintBounds),...e.geometry.clipPolygon?{clipPolygon:Object.freeze(e.geometry.clipPolygon.map(d=>Object.freeze({x:d.x+i,y:d.y+s})))}:{}})})}function Bt(t,e,n,o,a,r){let i=o.map(l=>rt(n,l,r)),s=t.createElement("div");s.className="docx-hf-behind-layer",s.dataset.docxHfBehind=n.kind,s.setAttribute("contenteditable","false"),s.style.position="absolute",s.style.inset="0",s.style.overflow="hidden",s.style.pointerEvents="none",V(t,s,i,a,r,"behind",false),s.childElementCount>0&&e.append(s);}function Nt(t,e,n,o,a,r,i,s=false){let l=o.filter(ot).map(d=>rt(n,d,r));V(t,e,l,a,r,i,s,n.kind);}var F=/^[0-9A-Fa-f]{6}$/,Ve=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,Ot=new Map(Object.entries({single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"})),zt=new Map(Object.entries({black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"}));function Ut(t){return t.doubleStrike?"double":t.strike?"single":"none"}function Kt(t){return t==="thick"||t.endsWith("Heavy")}function at(t){if(!t.underline)return null;let e=t.underline.color&&F.test(t.underline.color)?t.underline.color:null;return {cssStyle:Ot.get(t.underline.variant)??"solid",color:e,heavy:Kt(t.underline.variant)}}function it(t,e,n,o){t.textDecorationLine=e,t.textDecorationStyle=n,o.color&&(t.textDecorationColor=`#${o.color}`),o.heavy&&(t.textDecorationThickness=`max(${2*o.scale}px, 0.12em)`);}function Xe(t,e,n){e!=="none"&&it(t,"line-through",e==="double"?"double":"solid",{scale:n});}function Ye(t,e,n){it(t,"underline",e.cssStyle,{color:e.color,heavy:e.heavy,scale:n});}function _t(t,e,n){let o=e.color?`#${e.color}`:"currentColor";t.borderBottomWidth=`${(e.heavy?2:1)*n}px`,t.borderBottomStyle=e.cssStyle==="wavy"?"solid":e.cssStyle,t.borderBottomColor=o;}function q(t,e,n){let o=t.style,a=n.scale,r=e.verticalAlign==="baseline"?1:.75;o.fontSize=`${e.fontSizePt*r*a}px`,e.bold&&(o.fontWeight="bold"),e.italic&&(o.fontStyle="italic");let i=e.fontFamily&&Ve.test(e.fontFamily)?e.fontFamily:n.defaultFontFamily&&Ve.test(n.defaultFontFamily)?n.defaultFontFamily:null;if(i){let d=n.fontAlias?.(i);o.fontFamily=d?`"${d}", "${i}", ${Gd}`:`"${i}", ${Gd}`;}e.color&&F.test(e.color)&&(o.color=`#${e.color}`);let s=e.highlight?zt.get(e.highlight):void 0;s?(o.backgroundColor=s,t.dataset.highlight=e.highlight??""):e.shading&&F.test(e.shading)&&(o.backgroundColor=`#${e.shading}`),e.caps&&(o.textTransform="uppercase"),e.smallCaps&&(o.fontVariant="small-caps");let l=kb(e);l!==0&&(o.position="relative",o.top=`${-l*a}px`),e.characterSpacingPt!==0&&(o.letterSpacing=`${e.characterSpacingPt*a}px`),e.horizontalScalePercent!==100&&(o.transformOrigin="left",o.transform=`scaleX(${e.horizontalScalePercent/100})`);}function st(t,e,n,o,a){let r=n===" "?null:at(o),i=Ut(o),s=e;if(r&&i!=="none"){let l=t.createElement("span");l.dataset.docxDeco="underline",Ye(l.style,r,a);let d=t.createElement("span");d.dataset.docxDeco="strike",Xe(d.style,i,a),l.append(d),e.append(l),s=d;}else r?Ye(e.style,r,a):i!=="none"&&Xe(e.style,i,a);s.textContent=n;}function $(t,e,n,o){let a=t.createElement(e);return a.style.position="absolute",a.style.left=`${n.x*o}px`,a.style.top=`${n.y*o}px`,a.style.width=`${n.width*o}px`,a.style.height=`${n.height*o}px`,a}function jt(t,e,n){let o=e.fieldAtom;!o||(t.dataset.fieldAtom=o.formField?"form":"field",!(o.formField?n.shadeFormFields!==false:(n.fieldShading??ne)!=="never"))||(t.classList.add("docx-field-atom"),(o.formField||(n.fieldShading??ne)==="always")&&t.classList.add("docx-field-atom--shaded"));}function Ze(t,e,n){let o=sb(e.props),a=n.revisionStyles,r=Re(e.revisions,a?.authorSlots,a?.styles);if(!(!r&&!o)){if(r){let{attribution:i}=r;t.classList.add("docx-revision",`docx-revision-${i.kind}`),t.dataset.revisionKind=i.kind,t.dataset.revisionId=i.id,i.author!==""&&(t.dataset.reviewAuthor=i.author),i.date!==void 0&&(t.dataset.revisionDate=i.date);let s=a?.styles.get(i.author);if(a){t.dataset.reviewAuthorSlot=String((a.authorSlots.get(i.author)??0)%M);let c=a.classTokens.get(i.author);if(c)for(let y=0;y<c.length;y+=1)t.classList.add(c[y]);}let d=a!==void 0&&(s?.color!==void 0||a.others==="author")?r.authorColor:r.color;t.style.color=d,t.style.backgroundColor=s?.background??(r.deleted?"var(--doc-revision-deletion-wash)":"var(--doc-revision-insertion-wash)"),r.line&&(t.style.textDecorationLine=r.line,t.style.textDecorationStyle=r.decorationStyle,t.style.textDecorationColor=d);return}if(t.classList.add("docx-revision","docx-revision-format"),t.dataset.revisionKind="format",t.dataset.revisionId=o.id,o.author!==""&&(t.dataset.reviewAuthor=o.author),o.date!==void 0&&(t.dataset.revisionDate=o.date),a){let i=a.styles.get(o.author);t.dataset.reviewAuthorSlot=String((a.authorSlots.get(o.author)??0)%M);let s=a.classTokens.get(o.author);if(s)for(let l=0;l<s.length;l+=1)t.classList.add(s[l]);i?.color!==void 0&&(t.style.color=i.color),i?.background!==void 0&&(t.style.backgroundColor=i.background);}}}function Gt(t,e,n,o){let a=pb(e),r=t.createElement("span");r.className=`docx-revision-pmark docx-revision-pmark-${a.kind}`,r.setAttribute("aria-hidden","true"),r.contentEditable="false",r.dataset.revisionKind=a.kind,r.dataset.revisionId=a.id,a.author!==""&&(r.dataset.reviewAuthor=a.author),r.dataset.revisionIds=e.map(d=>d.id).join(" "),r.dataset.revisionKinds=e.map(d=>d.kind).join(" "),r.textContent="\xB6",r.style.position="absolute",r.style.pointerEvents="none",r.style.marginLeft=`${2*n}px`;let i=qb(a),s=o?.styles.get(a.author),l=o?(o.authorSlots.get(a.author)??0)%M:0;if(o){r.dataset.reviewAuthorSlot=String(l);let d=o.classTokens.get(a.author);if(d)for(let c=0;c<d.length;c+=1)r.classList.add(d[c]);}return r.style.color=s?.color??(o?.others==="author"?_(l):i?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)"),i&&(r.style.textDecorationLine="line-through"),r}function Wt(t,e,n){let o=[],a=e.lines[e.lines.length-1];for(let i of e.lines){let s=[...i.spans.flatMap(u=>u.revisions??[]),...i===a?e.markRevisions??[]:[]];if(s.length===0)continue;let l=s.some(u=>u.kind==="delete"||u.kind==="moveFrom"),d=i.box.y-e.box.y,c=d+i.box.height,y=o[o.length-1];if(y&&y.deleted===l&&d<=y.bottom+.5){y.bottom=Math.max(y.bottom,c);continue}o.push({top:d,bottom:c,deleted:l});}if(o.length===0)return null;let r=t.createElement("div");r.className="docx-change-bars",r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.inset="0",r.style.pointerEvents="none";for(let i of o){let s=t.createElement("div");s.className=`docx-change-bar docx-change-bar-${i.deleted?"deletion":"insertion"}`,s.style.position="absolute",s.style.top=`${i.top*n}px`,s.style.height=`${(i.bottom-i.top)*n}px`,s.style.left=`${(-e.box.x-qt)*n}px`,s.style.width=`${Vt*n}px`,s.style.pointerEvents="none",s.style.backgroundColor=i.deleted?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",r.append(s);}return r}var qt=7.5,Vt=1.5;function Xt(t,e,n,o,a){let r=t.createElement("span");if(e.equation)return r.dataset.paragraphId=e.range.paragraphId,r.dataset.start=String(e.range.start),r.dataset.end=String(e.range.end),q(r,e.style,n),Ke(t,r,e.equation,n.scale),Ze(r,e,n),r;if(r.className="layout-run layout-run-text",r.style.display="inline-block",r.style.verticalAlign="baseline",r.style.boxSizing="border-box",r.style.height=`${o*n.scale}px`,r.style.paddingTop=`${a*n.scale}px`,r.style.lineHeight=`${(o-a)*n.scale}px`,e.range.end>e.range.start?(r.dataset.paragraphId=e.range.paragraphId,r.dataset.start=String(e.range.start),r.dataset.end=String(e.range.end)):(r.setAttribute("aria-hidden","true"),r.contentEditable="false"),q(r,e.style,n),jt(r,e,n),Ze(r,e,n),(e.style.horizontalScalePercent!==100||e.text===" ")&&(r.style.width=`${e.box.width*n.scale}px`),e.text===" "){r.style.overflow="hidden",r.style.verticalAlign="top";let i=at(e.style);i&&(r.dataset.docxTabUnderline="",_t(r.style,i,n.scale));}return st(t,r,e.text,e.style,n.scale),e.projected&&(r.dataset.docxField="",r.setAttribute("contenteditable","false"),e.noteNav?(r.style.userSelect="none",e.noteNav.direction==="to-note"?(r.dataset.docxNoteRef="",r.dataset.docxNoteScope=e.noteNav.scopeId,e.text.length>0&&r.setAttribute("aria-description",e.text)):(r.dataset.docxNoteMarkBack="",r.dataset.docxNoteScope=e.noteNav.scopeId)):(r.style.pointerEvents="none",r.style.userSelect="none")),r}function Je(t,e,n){let o=t.createElement("a");return o.className="docx-hyperlink",o.dataset.docxLink=e.id,o.dataset.docxLinkKind=e.kind,o.setAttribute("tabindex","-1"),!n.inertLinks&&e.href&&(o.setAttribute("href",e.href),e.kind==="external"&&o.setAttribute("rel","noopener noreferrer")),e.tooltip&&o.setAttribute("title",e.tooltip),o.style.display="inline-block",o.style.verticalAlign="baseline",o.style.textDecoration="none",o.style.color="inherit",o}function Yt(t,e,n){let o=n.scale,a=t.createElement("div");a.className="docx-line layout-line",a.dataset.lineId=e.id,a.dataset.paragraphId=e.range.paragraphId,a.style.position="absolute",a.style.top=`${e.box.y*o}px`,a.style.left=`${e.contentX*o}px`,a.style.height=`${e.box.height*o}px`,a.style.fontSize="0",a.style.whiteSpace="pre",a.style.overflow="visible";let r=e.leading??0,i=Math.min(Math.max(r,...e.spans.map(v=>v.box.height+r),e.spans.length===0?e.box.height-(e.trailingSpacing??0):0),e.box.height),s=Math.max(0,e.box.height-i);a.style.boxSizing="border-box",a.style.paddingBottom=`${s*o}px`,a.style.lineHeight=`${(e.box.height-s)*o}px`;let l=null,d=null,c=null,y=new Map;for(let[v,b]of uc(e).entries())y.set(b.paragraphId,v);let u=v=>y.get(v)??0,h=[...e.drawings??[]].sort((v,b)=>u(v.paragraphId)-u(b.paragraphId)||v.start-b.start),p=0,g=(v,b)=>{for(;p<h.length&&(u(h[p].paragraphId)<u(v)||u(h[p].paragraphId)===u(v)&&h[p].start<b);){let x=h[p],f=Math.max(0,x.advanceEnd-x.advanceStart),m=t.createElement("span");m.className="docx-inline-drawing-advance",m.dataset.docxMarker="",m.setAttribute("contenteditable","false"),m.setAttribute("aria-hidden","true"),m.style.display="inline-block",m.style.width=`${f*o}px`,m.style.height=`${x.baselineOffset*o}px`,m.style.lineHeight="0",m.style.pointerEvents="none",m.style.verticalAlign="baseline",a.append(m),p+=1,l=null,d=null;}},w=v=>{let b=v.wrapAdvanceBefore??0;if(b<=.001)return;let x=t.createElement("span");x.className="docx-wrap-advance",x.dataset.docxMarker="",x.setAttribute("contenteditable","false"),x.setAttribute("aria-hidden","true"),x.style.display="inline-block",x.style.width=`${b*o}px`,x.style.height="0",x.style.lineHeight="0",x.style.pointerEvents="none",x.style.verticalAlign="baseline",a.append(x),l=null,d=null;},S=0,R=false;for(let[v,b]of e.spans.entries()){g(b.range.paragraphId,b.range.start),w(b);let x=Math.min(b.box.height+r,e.box.height),f=Xt(t,b,n,x,r);S>0&&!R&&(f.style.marginLeft=`${S*o}px`);let m=e.spans[v+1],T=Zt(e,v+1,u);R=T>0&&m!==void 0&&Qt(b,m),R&&(f.style.wordSpacing=`${T*o}px`),S=T;let k=b.link;if(!k){l=null,d=null,c=null,a.append(f);continue}if(b.fieldAtom){l!==null&&d===k.id&&c===b.range.start||(l=Je(t,k,n),d=k.id,c=b.range.start,a.append(l)),l.append(f);continue}(!l||d!==k.id||c!==null)&&(l=Je(t,k,n),d=k.id,c=null,a.append(l)),l.append(f);}if(g(uc(e)[uc(e).length-1]?.paragraphId??e.range.paragraphId,Number.POSITIVE_INFINITY),e.spans.length===0){let v=t.createElement("br");v.style.lineHeight=`${e.box.height*o}px`,a.append(v);}let P=Object.freeze({x:e.contentX,y:e.box.y,width:e.box.width,height:e.box.height}),L=nt(tt(n));if(e.drawings&&e.drawings.length>0)for(let v of Ce(t,e,L.ctx,L.urlRegistry,P))a.append(v);return a}function Zt(t,e,n){if(e<=0||e>=t.spans.length)return 0;let o=t.spans[e-1],a=t.spans[e],r=n(o.range.paragraphId),i=n(a.range.paragraphId);if(t.drawings?.some(d=>{let c=n(d.paragraphId),y=c>r||c===r&&d.start>=o.range.start,u=c<i||c===i&&d.start<a.range.start;return y&&u}))return 0;let l=a.box.x-(o.box.x+o.box.width)-(a.wrapAdvanceBefore??0);return l>.25?l:0}var Jt=/[\t\n\r \u00A0\u1361\u{10100}-\u{10102}\u{1039F}\u{1091F}]/u;function Qt(t,e){return !t.text.endsWith(" ")||t.style.horizontalScalePercent!==100||!en(t,e)||(e.wrapAdvanceBefore??0)>.001?false:!Jt.test(t.text.slice(0,-1))}function en(t,e){return !t.link&&!e.link?true:!t.link||!e.link||t.link.id!==e.link.id||!!t.fieldAtom!=!!e.fieldAtom?false:!t.fieldAtom||t.range.start===e.range.start}function D(t,e,n){let o=n.scale,a=$(t,"div",e.box,o);a.className="docx-paragraph-fragment layout-paragraph",a.dataset.paragraphId=e.paragraphId,a.dataset.fragmentIndex=String(e.fragmentIndex),n.readOnlyParagraphIds?.has(e.paragraphId)&&(a.classList.add("docx-generated-region"),a.dataset.docxReadOnly="",a.setAttribute("contenteditable","false"),a.setAttribute("aria-readonly","true")),n.emptyTocPlaceholderIds?.has(e.paragraphId)&&(a.classList.add("docx-toc-empty-placeholder"),a.dataset.docxTocEmpty=""),e.shading&&F.test(e.shading)&&e.shadingBox&&a.append(rn(t,e,o)),e.marker&&a.append(tn(t,e,n));for(let i of e.lines)for(let s of i.spans){if(!s.tabLeader)continue;let l=on(t,e,i,s,n);l&&a.append(l);}let r=Wt(t,e,o);if(r&&a.append(r),e.markRevisions&&e.markRevisions.length>0){let i=Gt(t,e.markRevisions,o,n.revisionStyles),s=e.lines[e.lines.length-1];if(s){let l=s.spans[s.spans.length-1];i.style.top=`${(s.box.y-e.box.y)*o}px`,i.style.left=`${((l?l.box.x+l.box.width:s.contentX)-e.box.x)*o}px`,a.append(i);}}for(let i of e.lines){let s=Yt(t,i,n);s.style.top=`${(i.box.y-e.box.y)*o}px`,s.style.left=`${(i.contentX-e.box.x)*o}px`,a.append(s);}if(e.borders)for(let i of e.borders)a.append(Qe(t,e,i,o));else e.bottomBorder&&a.append(Qe(t,e,{side:"bottom",edge:e.bottomBorder.edge,box:e.bottomBorder.box},o));return a}function tn(t,e,n){let o=e.marker,a=n.scale,r=e.lines[0]?.leading??0,i=$(t,"span",o.box,a);i.className="docx-list-marker",i.dataset.docxMarker="",i.setAttribute("contenteditable","false"),i.setAttribute("aria-hidden","true"),i.style.left=`${(o.box.x-e.box.x)*a}px`,i.style.top=`${(o.box.y-e.box.y)*a}px`,i.style.display="block",i.style.overflow="visible",i.style.whiteSpace="pre";let s=e.lines[0],l=s?Math.max(r,...s.spans.map(u=>u.box.height+r),s.spans.length===0?s.box.height-(s.trailingSpacing??0):0):o.box.height,d=Math.min(l,o.box.height),c=Math.max(0,o.box.height-d);i.style.fontSize="0",i.style.boxSizing="border-box",i.style.paddingBottom=`${c*a}px`,i.style.lineHeight=`${d*a}px`;let y=t.createElement("span");return y.style.display="inline-block",y.style.verticalAlign="baseline",y.style.boxSizing="border-box",y.style.height=`${d*a}px`,y.style.paddingTop=`${r*a}px`,y.style.lineHeight=`${(d-r)*a}px`,q(y,o.style,n),st(t,y,o.text,o.style,a),i.append(y),i}var nn=512;function on(t,e,n,o,a){let r=o.tabLeader?Ma.get(o.tabLeader):void 0;if(!r||o.box.width<=0)return null;let i=a.scale,s=t.createElement("div");s.className="docx-tab-leader",s.dataset.docxTabLeader="",s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left=`${(o.box.x-e.box.x)*i}px`,s.style.top=`${(n.box.y-e.box.y)*i}px`,s.style.width=`${o.box.width*i}px`,s.style.height=`${n.box.height*i}px`,s.style.overflow="hidden",s.style.whiteSpace="pre",s.style.pointerEvents="none",s.style.userSelect="none";let l=n.leading??0,d=Math.min(o.box.height+l,n.box.height),c=Math.max(0,n.box.height-d);s.style.fontSize="0",s.style.boxSizing="border-box",s.style.paddingBottom=`${c*i}px`,s.style.lineHeight=`${(n.box.height-c)*i}px`;let y=t.createElement("span");y.style.display="inline-block",y.style.verticalAlign="baseline",q(y,o.style,a),y.style.boxSizing="border-box",y.style.height=`${d*i}px`,y.style.paddingTop=`${l*i}px`,y.style.lineHeight=`${(d-l)*i}px`,o.tabLeader==="heavy"&&(y.style.fontWeight="bold");let u=o.tabLeaderAdvancePt&&o.tabLeaderAdvancePt>0?o.tabLeaderAdvancePt:Math.max(.5,o.style.fontSizePt*.2),h=Math.min(nn,Math.max(1,Math.floor(o.box.width/u)+2));return y.textContent=r.repeat(h),y.style.letterSpacing="0",s.append(y),s}function rn(t,e,n){let o=e.shadingBox,a=$(t,"div",o,n);return a.className="docx-paragraph-shading",a.setAttribute("aria-hidden","true"),a.style.left=`${(o.x-e.box.x)*n}px`,a.style.top=`${(o.y-e.box.y)*n}px`,a.style.backgroundColor=`#${e.shading}`,a}function Qe(t,e,n,o){let a=$(t,"div",n.box,o);a.className=`docx-paragraph-border docx-paragraph-border-${n.side}`,a.setAttribute("aria-hidden","true");let r=(n.box.x-e.box.x)*o,i=(n.box.y-e.box.y)*o,s=n.side==="left"||n.side==="right"||n.side==="bar",l=(s?n.box.width:n.box.height)*o,c=an(n.edge.val)?l:Math.max(1,l);a.style.left=`${n.side==="right"?r-(c-l):r}px`,a.style.top=`${n.side==="bottom"?i-(c-l):i}px`,s?a.style.width=`${c}px`:a.style.height=`${c}px`;let y=n.edge.color&&F.test(n.edge.color)?n.edge.color:"000000";return a.style.backgroundColor=`#${y}`,sn(a,n.edge.val,y,s,c,o),a}function an(t){return t==="double"||t==="triple"||t==="doubleWave"||t.startsWith("thinThick")||t.startsWith("thickThin")}function sn(t,e,n,o,a,r){switch(e){case "dashed":case "dashSmallGap":case "dotDash":case "dotDotDash":case "dashDotStroked":{let i=Math.max(4,4*r);t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 60%, transparent 60%)`,t.style.backgroundSize=o?`100% ${i}px`:`${i}px 100%`;return}case "dotted":{let i=Math.max(3,3*r);t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 35%, transparent 35%)`,t.style.backgroundSize=o?`100% ${i}px`:`${i}px 100%`;return}case "double":case "doubleWave":case "triple":case "thinThickSmallGap":case "thickThinSmallGap":case "thinThickThinSmallGap":case "thinThickMediumGap":case "thickThinMediumGap":case "thinThickThinMediumGap":case "thinThickLargeGap":case "thickThinLargeGap":case "thinThickThinLargeGap":{let i=Math.max(1,a/3);t.style.backgroundColor="transparent",o?(t.style.borderLeft=`${i}px solid #${n}`,t.style.borderRight=`${i}px solid #${n}`):(t.style.borderTop=`${i}px solid #${n}`,t.style.borderBottom=`${i}px solid #${n}`),t.style.boxSizing="border-box";return}case "threeDEmboss":case "ridge":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px ridge #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "threeDEngrave":case "groove":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px groove #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "inset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px inset #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "outset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px outset #${n}`,o?t.style.width="0px":t.style.height="0px";return}default:return}}function ln(t,e,n,o){let a=o.scale,r=$(t,"div",e.box,a);if(r.className="docx-table-cell",r.style.left=`${(e.box.x-n.x)*a}px`,r.style.top=`${(e.box.y-n.y)*a}px`,r.style.boxSizing="border-box",r.style.overflow="visible",r.dataset.cellId=e.id,r.dataset.gridColumn=String(e.gridColumn),r.dataset.gridSpan=String(e.gridSpan),e.rowSpan&&e.rowSpan>1&&(r.dataset.rowSpan=String(e.rowSpan)),e.paintInert||e.vMergeContinue)return r.dataset.vMergeContinue="true",r.style.border="none",r.style.backgroundColor="transparent",r;r.style.border="none",je(t,r,e.borders,a),e.shading&&F.test(e.shading)&&(r.style.backgroundColor=`#${e.shading}`);for(let i of e.blocks){let s=i.kind==="table"?C(t,i,o):D(t,i,o);s.style.left=`${(i.box.x-e.box.x)*a}px`,s.style.top=`${(i.box.y-e.box.y)*a}px`,r.append(s);}return r}function C(t,e,n){let o=n.scale,a=$(t,"div",e.box,o);a.className="docx-table-fragment layout-table",a.dataset.tableId=e.tableId,a.dataset.fragmentIndex=String(e.fragmentIndex),a.style.overflow="visible";for(let r of e.rows){let i=$(t,"div",r.box,o);i.className="docx-table-row",r.revisionKind&&(i.classList.add("docx-table-row--revision",r.revisionKind==="insert"?"layout-revision-ins":"layout-revision-del"),i.dataset.revisionKind=r.revisionKind,r.revisionId!==void 0&&(i.dataset.revisionId=r.revisionId),r.revisionAuthor!==void 0&&(i.dataset.reviewAuthor=r.revisionAuthor),r.revisionDate!==void 0&&(i.dataset.revisionDate=r.revisionDate)),i.dataset.rowId=r.id,r.isHeaderRepeat&&(i.dataset.headerRepeat="true"),i.style.left=`${(r.box.x-e.box.x)*o}px`,i.style.top=`${(r.box.y-e.box.y)*o}px`,i.style.overflow="visible";for(let s of r.cells)i.append(ln(t,s,r.box,n));a.append(i);}return a}function dn(t,e,n,o,a){let r={...n,paintInstance:`p${e.index}`},i=$(t,"div",e.box,r.scale);if(i.className="docx-page",i.style.fontFamily=Gd,i.dataset.pageIndex=String(e.index),r.ariaHidden&&(i.setAttribute("aria-hidden","true"),i.setAttribute("role","presentation")),i.dataset.materialized=String(o),!o)return i;let s=Object.freeze({x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height}),l=Object.freeze({x:-(e.contentBox.x-e.box.x),y:-(e.contentBox.y-e.box.y),width:e.box.width,height:e.box.height});qe(t,i,e,r,l,"behind");for(let y of [e.header,e.footer])y?.anchoredDrawings?.length&&Bt(t,i,y,y.anchoredDrawings,r,{x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height});let d=t.createElement("div");d.className="docx-page-content",d.style.position="absolute",d.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,d.style.top=`${(e.contentBox.y-e.box.y)*r.scale}px`,d.style.width=`${e.contentBox.width*r.scale}px`,d.style.height=`${e.contentBox.height*r.scale}px`,r.activeHeaderFooterRId&&d.setAttribute("contenteditable","false");for(let y of e.columnSeparators??[]){let u=t.createElement("div");u.className="docx-column-separator",u.setAttribute("contenteditable","false"),u.style.position="absolute",u.style.left=`${y.x*r.scale}px`,u.style.top=`${y.y*r.scale}px`,u.style.width=`${y.width*r.scale}px`,u.style.height=`${y.height*r.scale}px`,u.style.backgroundColor="currentColor",u.style.pointerEvents="none",d.append(u);}let c=a?new Map:null;for(let y of e.fragments){let u=y.kind==="table"?C(t,y,r):D(t,y,r);c?.set(y,u),d.append(u);}a&&c&&(a.content=d,a.blocks=c),i.append(d),qe(t,i,e,r,l,"inFront"),Se(t,i,e,r,D,C);for(let y of ["header","footer"]){if(e[y])continue;let u=t.createElement("div");u.className="docx-hf docx-hf--placeholder",u.dataset.docxHf=y,u.setAttribute("contenteditable","false");let h=y==="header"?e.contentBox.y-e.box.y:e.box.y+e.box.height-(e.contentBox.y+e.contentBox.height),p=Math.min(h,cn);if(p<=0)continue;let g=Math.max(0,Math.min(yn,h-p)),w=y==="header"?g:e.box.height-g-p;u.style.position="absolute",u.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,u.style.top=`${w*r.scale}px`,u.style.width=`${e.contentBox.width*r.scale}px`,u.style.height=`${p*r.scale}px`,i.append(u);}for(let y of [e.header,e.footer]){if(!y)continue;let u=y.anchoredDrawings??[],h=j(y,e.index,r),p=t.createElement("div");p.className="docx-hf",p.dataset.docxHf=y.kind,y.rId&&(p.dataset.docxRId=y.rId),h?(p.dataset.docxHfActive="",p.setAttribute("contenteditable","true")):p.setAttribute("contenteditable","false"),p.style.position="absolute",p.style.left=`${(y.box.x-e.box.x)*r.scale}px`,p.style.top=`${(y.box.y-e.box.y)*r.scale}px`,p.style.width=`${y.box.width*r.scale}px`;let g=Y(y,e,h);p.style.height=`${g*r.scale}px`,p.style.overflow="visible";let w=(e.box.x-y.box.x)*r.scale,S=(e.box.y-y.box.y)*r.scale,R=w+e.box.width*r.scale,P=S+e.box.height*r.scale;p.style.clipPath=`polygon(${w}px ${S}px, ${R}px ${S}px, ${R}px ${P}px, ${w}px ${P}px)`;let L=Object.freeze({x:0,y:0,width:y.box.width,height:y.box.height}),v=u.filter(f=>!ot(f)),b={...r,inertLinks:true};for(let f of y.fragments)p.append(f.kind==="table"?C(t,f,b):D(t,f,b));V(t,p,v,tt(r),L,"inFront",h),i.append(p);let x=t.createElement("div");x.className="docx-hf-edit-hint",x.dataset.docxHfHint=y.kind,x.setAttribute("contenteditable","false"),x.style.position="absolute",x.style.left=p.style.left,x.style.width=p.style.width,x.style.top=y.kind==="header"?`${(y.box.y+y.box.height-e.box.y)*r.scale}px`:`${(y.box.y-e.box.y)*r.scale}px`,y.kind==="footer"&&(x.style.transform="translateY(-100%)"),i.append(x),Nt(t,i,y,u,r,s,"inFront",h);}return hn(t,i,e,r),i}var cn=30,yn=36,un=16,pn=new Set(["dropdown","comboBox","date","checkbox"]);function hn(t,e,n,o){let a=o.contentControlChrome,r=a?.suppressedIds,i=(n.contentControls??[]).filter(u=>r?.has(u.id)!==true),s=[...i,...(a?.additionalBoundaries??[]).filter(u=>r?.has(u.id)!==true&&!i.some(h=>h.id===u.id))];if(s.length===0)return;let l=a?.showAll===true,d=a?.activeIds,c=a?.hoverIds,y=a?.tocControlIds;for(let u of s){let h=y?.has(u.id)===true,p=!h&&d?.has(u.id)===true,g=c?.has(u.id)===true;e.append(fn(t,n,u,o.scale,p,g,l||p||h&&g,a?.checkedIds?.has(u.id),h,a?.readOnly===true));}}function fn(t,e,n,o,a,r,i,s,l,d){let c=t.createElement("div");c.className="docx-content-control-chrome",c.dataset.docxContentControl=n.id,c.dataset.docxMarker="",c.dataset.controlType=n.controlType,c.dataset.lock=n.effectiveLock,n.bound&&(c.dataset.bound=""),n.placeholder&&(c.dataset.placeholder=""),l&&(c.dataset.docxToc=""),d&&(c.dataset.readOnly=""),a&&(c.dataset.active=""),r&&(c.dataset.hover=""),i&&(c.dataset.boundaryVisible=""),c.setAttribute("contenteditable","false"),c.setAttribute("role","group"),n.alias&&(c.dataset.alias=n.alias),n.tag&&(c.dataset.tag=n.tag),n.alias&&c.setAttribute("aria-label",n.alias),c.style.position="absolute",c.style.inset="0",c.style.pointerEvents="none",c.style.zIndex="2";let y=e.contentBox.x-e.box.x,u=e.contentBox.y-e.box.y;for(let p of n.fragments){if(p.pageIndex!==e.index)continue;let g=t.createElement("div");g.className="docx-content-control-boundary",g.dataset.docxMarker="",g.setAttribute("contenteditable","false"),g.setAttribute("aria-hidden","true"),g.style.position="absolute",g.style.left=`${(y+p.box.x)*o}px`,g.style.top=`${(u+p.box.y)*o}px`,g.style.width=`${Math.max(p.box.width,1)*o}px`,g.style.height=`${Math.max(p.box.height,1)*o}px`,g.style.pointerEvents="none",c.append(g);}let h=n.fragments.find(p=>p.pageIndex===e.index);if(h&&n.alias){let p=t.createElement("div");p.className="docx-content-control-label",p.dataset.docxMarker="",p.setAttribute("contenteditable","false"),p.setAttribute("aria-hidden","true"),p.textContent=n.alias,p.style.position="absolute",p.style.left=`${(y+h.box.x)*o}px`,p.style.top=`${Math.max(0,(u+h.box.y)*o-un)}px`,p.style.pointerEvents="none",c.append(p);}if(h&&pn.has(n.controlType)){let p=t.createElement("button");p.type="button",p.className="docx-content-control-widget",p.dataset.docxMarker="",p.dataset.docxCcWidget=n.controlType,p.dataset.docxCcId=n.id,p.setAttribute("contenteditable","false"),p.setAttribute("tabindex","-1"),n.controlType==="checkbox"?p.setAttribute("role","checkbox"):n.controlType==="dropdown"||n.controlType==="comboBox"?p.setAttribute("role","listbox"):n.controlType==="date"&&p.setAttribute("role","button"),n.alias&&(p.dataset.name=n.alias),n.alias&&p.setAttribute("aria-label",n.alias),n.controlType==="checkbox"&&(p.setAttribute("data-checked",s?"true":"false"),p.setAttribute("aria-checked",s?"true":"false"));let g=n.effectiveLock==="contentLocked"||n.effectiveLock==="sdtContentLocked";(d||g||n.bound)&&(p.disabled=true,p.dataset.disabledReason=d?"readOnly":n.bound?"bound":"locked",p.setAttribute("aria-disabled","true")),p.style.position="absolute",p.style.left=`${(y+h.box.x+h.box.width)*o-18}px`,p.style.top=`${(u+h.box.y)*o}px`,p.style.width="16px",p.style.height="16px",p.style.pointerEvents="auto",p.style.padding="0",p.style.margin="0",p.style.cursor=p.disabled?"not-allowed":"pointer",c.append(p);}return c}var oe=new WeakMap;function Yn(t){oe.delete(t);}function gn(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function xn(t,e){let n=Object.keys(t);if(n.length!==Object.keys(e).length)return false;for(let o of n){let a=t[o],r=e[o];if(a!==r)return false}return true}function bn(t,e){if(t.length!==e.length)return false;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return false;return true}function mn(t,e){if(t===e)return false;let n=new Set([...Object.keys(t),...Object.keys(e)]);for(let o of n){if(o==="fragments")continue;let a=t[o],r=e[o];if(a!==r&&!(Array.isArray(a)&&Array.isArray(r)&&bn(a,r))&&!(typeof a=="object"&&typeof r=="object"&&a!==null&&r!==null&&!Array.isArray(a)&&!Array.isArray(r)&&xn(a,r)))return false}return true}var et="docx-column-separator";function vn(t,e,n,o){let a=e.content,r=e.blocks;if(!a||!r||a.parentElement!==e.element)return null;let i={...o,paintInstance:`p${n.index}`},s=new Map,l=[];for(let u of n.fragments){let h=r.get(u)??(u.kind==="table"?C(t,u,i):D(t,u,i));s.set(u,h),l.push(h);}let d=new Set(l),c=a.firstChild;for(;c;){let u=c.nextSibling,h=c;!d.has(h)&&h.classList?.contains(et)!==true&&c.remove(),c=u;}let y=a.firstChild;for(;y&&y.classList?.contains(et);)y=y.nextSibling;for(let u of l){if(u===y){y=y.nextSibling;continue}a.insertBefore(u,y);}return {record:n,materialized:true,element:e.element,content:a,blocks:s}}function Rn(t,e,n,o){let a=t.element;return !t.materialized&&gn(t.record.box,e.box)&&a.style.left===`${e.box.x*n}px`&&a.style.top===`${e.box.y*n}px`&&a.style.width===`${e.box.width*n}px`&&a.style.height===`${e.box.height*n}px`&&a.getAttribute("aria-hidden")===(o?"true":null)}function Sn(t,e,n={}){wn(t,e,n);}function wn(t,e,n,o){let a=n.contentControlChrome,r=a?`${a.showAll===true?"1":"0"}:${a.activeIds?[...a.activeIds].sort().join(","):""}:${a.checkedIds?[...a.checkedIds].sort().join(","):""}:${a.tocControlIds?[...a.tocControlIds].sort().join(","):""}:${a.suppressedIds?[...a.suppressedIds].sort().join(","):""}:${a.readOnly===true?"ro":""}`:"",i=n.drawingStrings??Q,s=n.imageUrlPort!==void 0?$e(t,n.imageUrlPort):null,l=a?.additionalBoundaries?a.additionalBoundaries.flatMap(f=>f.fragments.map(m=>`${f.id}:${m.pageIndex}:${m.box.x}:${m.box.y}:${m.box.width}:${m.box.height}`)).sort().join(","):"",d=n.readOnlyParagraphIds?[...n.readOnlyParagraphIds].sort().join(","):"",c=n.emptyTocPlaceholderIds?[...n.emptyTocPlaceholderIds].sort().join(","):"",y=a?.tocControlIds?[...a.tocControlIds].sort().join(","):"",u=ve(n.revisionStyles,e,o),h={scale:n.scale??96/72,ariaHidden:n.ariaHidden??true,drawingStrings:i,urlRegistry:s,...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.readOnlyParagraphIds?{readOnlyParagraphIds:n.readOnlyParagraphIds}:{},...n.emptyTocPlaceholderIds?{emptyTocPlaceholderIds:n.emptyTocPlaceholderIds}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},...n.fieldShading?{fieldShading:n.fieldShading}:{},...n.shadeFormFields!==void 0?{shadeFormFields:n.shadeFormFields}:{},...u?{revisionStyles:u}:{},...n.imageUrlPort?{imageUrlPort:n.imageUrlPort}:{},...n.activeHeaderFooterRId?{activeHeaderFooterRId:n.activeHeaderFooterRId}:{},...n.activeHeaderFooterPageIndex!==void 0?{activeHeaderFooterPageIndex:n.activeHeaderFooterPageIndex}:{},...a?{contentControlChrome:a}:{}},p=t.ownerDocument,g=`${h.scale}|${h.ariaHidden}|${h.fontAlias?Ct(h.fontAlias):""}|${h.defaultFontFamily??""}|cc:${r}:${l}|toc:${y}|ro:${d}|tocEmpty:${c}|${n.imageUrlPort?"url":""}|${ze(i)}|rev:${me(u)}`,w=oe.get(t),S=w?.parameters===g,R=S?new Map(w.pages.map(f=>[f.record,f])):null,P=w?new Map(w.pages.map(f=>[f.record.index,f])):null,L=e.pages.map(f=>{let m=n.materialize?.has(f.index)??true,T=R?.get(f);if(T&&T.materialized===m)return T;let k=P?.get(f.index);if(!m&&k&&Rn(k,f,h.scale,h.ariaHidden))return {record:f,materialized:false,element:k.element};if(S&&m&&k?.materialized&&mn(k.record,f)){let re=vn(p,k,f,h);if(re)return re}let I={},lt=dn(p,f,h,m,I);return {record:f,materialized:m,element:lt,...I.content?{content:I.content}:{},...I.blocks?{blocks:I.blocks}:{}}});oe.set(t,{parameters:g,pages:L}),t.dataset.revision=String(e.revision),s&&s.reconcile(Ne(e),Oe(e));let v=new Set(L.map(f=>f.element)),b=t.firstChild;for(;b;){let f=b.nextSibling;v.has(b)||b.remove(),b=f;}let x=t.firstChild;for(let f of L){if(f.element===x){x=x.nextSibling;continue}t.insertBefore(f.element,x);}we(L,h);}function kn(t,e,n,o){let a=t.ownerDocument,r=o.scale,i=[];for(let s of n){let l=e.pages[s.pageIndex];if(!l)continue;let d=a.createElement("div");d.className=s.className??o.className??"docx-cell-selection-rect",d.style.position="absolute";let c=o.pageOffsetX?.get(s.pageIndex)??0;d.style.left=`${(l.contentBox.x+s.x+c)*r}px`,d.style.top=`${(l.contentBox.y+s.y)*r}px`,d.style.width=`${s.width*r}px`,d.style.height=`${s.height*r}px`,s.reviewAuthor&&(d.dataset.reviewAuthor=s.reviewAuthor.author,d.dataset.reviewAuthorSlot=String(s.reviewAuthor.slot%M),d.style.setProperty("--doc-review-author-current",s.reviewAuthor.color)),i.push(d);}t.replaceChildren(...i);}
2
- export{be as a,En as b,xt as c,Pn as d,Dn as e,Q as f,Cn as g,ne as h,Yn as i,Sn as j,wn as k,kn as l};