@docx-editor.dev/core 2.9.2 → 2.10.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 (94) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.js +1 -1
  3. package/dist/binding.cjs +1 -1
  4. package/dist/binding.d.cts +74 -10
  5. package/dist/binding.d.ts +74 -10
  6. package/dist/binding.js +1 -1
  7. package/dist/chunk-27APDXY2.js +2 -0
  8. package/dist/chunk-35MI6K7M.cjs +10 -0
  9. package/dist/chunk-4XL7SOWQ.cjs +2 -0
  10. package/dist/chunk-6K6QQVAZ.cjs +18 -0
  11. package/dist/chunk-7ZJL5AEY.cjs +1 -0
  12. package/dist/chunk-C6LK2BYA.cjs +2 -0
  13. package/dist/chunk-HBEBUCRM.cjs +5 -0
  14. package/dist/chunk-LG5K46OM.js +2 -0
  15. package/dist/chunk-LWADHMVV.js +5 -0
  16. package/dist/chunk-N725IUO7.js +18 -0
  17. package/dist/chunk-N7DBENH4.js +10 -0
  18. package/dist/chunk-NVGFWMCO.js +1 -0
  19. package/dist/chunk-SYTWKJPJ.cjs +18 -0
  20. package/dist/chunk-YI6JXF7U.js +18 -0
  21. package/dist/contracts/document.d.cts +6 -1
  22. package/dist/contracts/document.d.ts +6 -1
  23. package/dist/contracts/editor.d.cts +6 -6
  24. package/dist/contracts/editor.d.ts +6 -6
  25. package/dist/contracts/interaction.d.cts +6 -6
  26. package/dist/contracts/interaction.d.ts +6 -6
  27. package/dist/contracts/modules.d.cts +3 -4
  28. package/dist/contracts/modules.d.ts +3 -4
  29. package/dist/{custom-node-writes-D6SGwebL.d.ts → custom-node-writes-BvpWCnW8.d.ts} +35 -4
  30. package/dist/{custom-node-writes-Dy3b20PS.d.cts → custom-node-writes-Db8H6Z3n.d.cts} +35 -4
  31. package/dist/{editor-Cvd7Geoc.d.ts → editor-C0my6Uta.d.ts} +35 -14
  32. package/dist/{editor-cAEf1uXW.d.cts → editor-CwzY2Hcg.d.cts} +35 -14
  33. package/dist/editor.cjs +1 -1
  34. package/dist/editor.css +57 -456
  35. package/dist/editor.d.cts +20 -20
  36. package/dist/editor.d.ts +20 -20
  37. package/dist/editor.js +1 -1
  38. package/dist/{index-DRqY5JVF.d.ts → index-kID8Ymkp.d.ts} +79 -19
  39. package/dist/{index-wb-iOxfh.d.cts → index-nLFwo_17.d.cts} +79 -19
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.d.cts +13 -13
  42. package/dist/index.d.ts +13 -13
  43. package/dist/index.js +1 -1
  44. package/dist/layout.cjs +1 -1
  45. package/dist/layout.d.cts +38 -19
  46. package/dist/layout.d.ts +38 -19
  47. package/dist/layout.js +1 -1
  48. package/dist/output.cjs +1 -1
  49. package/dist/output.d.cts +6 -6
  50. package/dist/output.d.ts +6 -6
  51. package/dist/output.js +1 -1
  52. package/dist/{review-items-B8tffIXj.d.cts → review-items-CwixiHNe.d.cts} +1 -1
  53. package/dist/{review-items-bdGxFWNA.d.ts → review-items-Dw-8a6Ie.d.ts} +1 -1
  54. package/dist/{review-reads-Bxz03tHG.d.cts → review-reads-BqkiJTeR.d.cts} +1 -1
  55. package/dist/{review-reads-CHODU0LI.d.ts → review-reads-C0u-IKEA.d.ts} +1 -1
  56. package/dist/{semantic-cell-selection-BPzx6DdT.d.cts → semantic-cell-selection-DT9x9WLf.d.cts} +2 -2
  57. package/dist/{semantic-cell-selection-CsHcr-yk.d.ts → semantic-cell-selection-Utrf0lz7.d.ts} +2 -2
  58. package/dist/{semantic-interaction-BfWDD_0V.d.cts → semantic-interaction-B6hFRQLy.d.ts} +21 -2
  59. package/dist/{semantic-interaction-D-RZ9Ust.d.ts → semantic-interaction-Z0xKQcB4.d.cts} +21 -2
  60. package/dist/{semantic-paint-WhVtSDJK.d.ts → semantic-paint-CQEOC0Od.d.cts} +2 -2
  61. package/dist/{semantic-paint-Bd7EqzXV.d.cts → semantic-paint-quke354p.d.ts} +2 -2
  62. package/dist/{semantic-records-DadVT_E1.d.cts → semantic-records-CMakzQ1X.d.cts} +16 -2
  63. package/dist/{semantic-records-DCt-ZwKU.d.ts → semantic-records-Do3-i5oB.d.ts} +16 -2
  64. package/dist/{shaped-measurer-B9f4A7QA.d.ts → shaped-measurer-BxwTUluj.d.ts} +1 -1
  65. package/dist/{shaped-measurer-CninrHr_.d.cts → shaped-measurer-DzRwWrL5.d.cts} +1 -1
  66. package/dist/store.cjs +1 -1
  67. package/dist/store.d.cts +128 -12
  68. package/dist/store.d.ts +128 -12
  69. package/dist/store.js +1 -1
  70. package/dist/tree-op-revision-attribution-CN06Xshv.d.cts +24 -0
  71. package/dist/tree-op-revision-attribution-CN06Xshv.d.ts +24 -0
  72. package/dist/{tree-op-types-CnRb7AYo.d.ts → tree-op-types-BuOfCrkp.d.ts} +259 -32
  73. package/dist/{tree-op-types-D1vNJ7XC.d.cts → tree-op-types-DSJYmf5b.d.cts} +259 -32
  74. package/dist/{tree-session-Df02ajqc.d.cts → tree-session-contract-ByWx8eew.d.cts} +44 -104
  75. package/dist/{tree-session-ZuBFOhIh.d.ts → tree-session-contract-C1dfE9hy.d.ts} +44 -104
  76. package/dist/{tree-store-DgETo6Mf.d.ts → tree-store-ASBtz7UB.d.ts} +1 -1
  77. package/dist/{tree-store-B_sJBMIS.d.cts → tree-store-CWOUMGN8.d.cts} +1 -1
  78. package/package.json +2 -2
  79. package/dist/chunk-6JWP2H7K.js +0 -2
  80. package/dist/chunk-6KNLLEUW.cjs +0 -18
  81. package/dist/chunk-7ADTI533.cjs +0 -10
  82. package/dist/chunk-7ETDCPF6.cjs +0 -2
  83. package/dist/chunk-7I3BSGGS.js +0 -1
  84. package/dist/chunk-7UU5YFCD.cjs +0 -2
  85. package/dist/chunk-CKDAK3MV.js +0 -10
  86. package/dist/chunk-DIMEYVNS.js +0 -2
  87. package/dist/chunk-H2656QDI.cjs +0 -1
  88. package/dist/chunk-KQGENNL5.cjs +0 -15
  89. package/dist/chunk-LIXPSV4T.js +0 -18
  90. package/dist/chunk-O4UULRAQ.cjs +0 -5
  91. package/dist/chunk-SIIFNE6U.js +0 -15
  92. package/dist/chunk-VXYECPKA.js +0 -5
  93. package/dist/image-resources-BgA9EQxY.d.ts +0 -203
  94. package/dist/image-resources-BiA-IXgo.d.cts +0 -203
@@ -1,12 +1,11 @@
1
- import { S as SupportedImageMime, b as ImageDecodePort } from './image-resources-BgA9EQxY.js';
2
- import { S as StoryScope, a as StoryTargetRejection, D as DocumentTrackingSettings, I as InsertCustomNodeWrite, C as CustomNodeWriteResult, b as CustomNodeSweepOutcome, E as EmbeddedFont, B as BookmarkIndex, L as ListKind, c as InsertImageInput, d as ImageIntentResult, R as ReplaceImageOptions, A as ApplyImagePropertiesInput } from './custom-node-writes-D6SGwebL.js';
3
- import { Node } from 'prosemirror-model';
4
- import { O as OoxmlPart, a as OoxmlNode, c as OoxmlPackage, b as OoxmlElement, o as OoxmlPackageRejection } from './ooxml-package-CdEy9ufK.js';
1
+ import { S as StoryScope, a as StoryTargetRejection, D as DocumentTrackingSettings, I as InsertCustomNodeWrite, C as CustomNodeWriteResult, b as CustomNodeSweepOutcome, E as EmbeddedFont, B as BookmarkIndex, L as ListKind, c as InsertImageInput, d as ImageIntentResult, R as ReplaceImageOptions, A as ApplyImagePropertiesInput, F as FragmentPasteInput, e as FragmentPasteResult } from './custom-node-writes-BvpWCnW8.js';
2
+ import { T as TreeDocOp, c as SupportedImageMime, j as ImageDecodePort } from './tree-op-types-BuOfCrkp.js';
3
+ import { O as OoxmlPart, a as OoxmlNode, c as OoxmlPackage, b as OoxmlElement } from './ooxml-package-CdEy9ufK.js';
5
4
  import { a as HeaderFooterParts, b as HeaderFooterSectionResolution } from './hf-references-z5Y4N1ab.js';
6
- import { T as TreeDocOp } from './tree-op-types-CnRb7AYo.js';
7
- import { S as SelectionMark, T as TreeModelChange, D as DocumentProperties } from './tree-store-DgETo6Mf.js';
8
- import { a as ReviewItem } from './review-items-bdGxFWNA.js';
9
- import { ReviewModuleContribution } from './contracts/modules.js';
5
+ import { S as SelectionMark, T as TreeModelChange, D as DocumentProperties } from './tree-store-ASBtz7UB.js';
6
+ import { a as ReviewItem } from './review-items-Dw-8a6Ie.js';
7
+ import { Node } from 'prosemirror-model';
8
+ import { a as RevisionAttributionInput } from './tree-op-revision-attribution-CN06Xshv.js';
10
9
 
11
10
  /**
12
11
  * Why an edited projection could not be mapped back into tree ops.
@@ -91,6 +90,27 @@ interface DocumentStyleEntry {
91
90
  readonly preview: DocumentStylePreview;
92
91
  }
93
92
 
93
+ /**
94
+ * The scheme slots the picker shows, in Word's column order.
95
+ *
96
+ * Assumes the default `w:clrSchemeMapping` (bg1→lt1, t1→dk1, ...); a settings part
97
+ * that remaps them is rare and a follow-up.
98
+ */
99
+ declare const PICKER_SLOTS: readonly ["lt1", "dk1", "lt2", "dk2", "accent1", "accent2", "accent3", "accent4", "accent5", "accent6"];
100
+ type ThemeColorSlot = (typeof PICKER_SLOTS)[number];
101
+ /** One theme colour: the scheme slot and its resolved six-digit hex (no '#'). */
102
+ interface DocumentThemeColorEntry {
103
+ readonly slot: ThemeColorSlot;
104
+ readonly hex: string;
105
+ }
106
+ /** The theme's two font slots, for resolving `w:rFonts` theme attributes. */
107
+ interface DocumentThemeFonts {
108
+ /** `a:majorFont` latin typeface — headings. */
109
+ readonly major: string | null;
110
+ /** `a:minorFont` latin typeface — body text. */
111
+ readonly minor: string | null;
112
+ }
113
+
94
114
  /** One heading of the outline, in document order. `level` is 0-based (Heading 1 = 0). */
95
115
  interface DocumentOutlineEntry {
96
116
  /** The paragraph's text, control characters flattened, bounded to 200 characters. */
@@ -142,38 +162,6 @@ interface DocumentSearchResult {
142
162
  readonly truncated: boolean;
143
163
  }
144
164
 
145
- /**
146
- * The scheme slots the picker shows, in Word's column order.
147
- *
148
- * Assumes the default `w:clrSchemeMapping` (bg1→lt1, t1→dk1, ...); a settings part
149
- * that remaps them is rare and a follow-up.
150
- */
151
- declare const PICKER_SLOTS: readonly ["lt1", "dk1", "lt2", "dk2", "accent1", "accent2", "accent3", "accent4", "accent5", "accent6"];
152
- type ThemeColorSlot = (typeof PICKER_SLOTS)[number];
153
- /** One theme colour: the scheme slot and its resolved six-digit hex (no '#'). */
154
- interface DocumentThemeColorEntry {
155
- readonly slot: ThemeColorSlot;
156
- readonly hex: string;
157
- }
158
- /** The theme's two font slots, for resolving `w:rFonts` theme attributes. */
159
- interface DocumentThemeFonts {
160
- /** `a:majorFont` latin typeface — headings. */
161
- readonly major: string | null;
162
- /** `a:minorFont` latin typeface — body text. */
163
- readonly minor: string | null;
164
- }
165
-
166
- /** What a run inherits at one point of the chain — null means "nothing authored". */
167
- interface StyleRunDefaults {
168
- readonly fontFamily: string | null;
169
- readonly fontSizeHalfPoints: number | null;
170
- }
171
- /** One run property as the layout records carry it (structurally SurfaceProperty). */
172
- interface RunPropertyLike {
173
- readonly localName: string;
174
- readonly attributes?: Record<string, string>;
175
- }
176
-
177
165
  interface ParagraphAnchorIndex {
178
166
  /** nodeId → `w14:paraId`, verbatim as authored/minted. Paragraphs without one are absent. */
179
167
  readonly paraIdByNode: ReadonlyMap<string, string>;
@@ -209,6 +197,17 @@ interface ParagraphAnchorIndex {
209
197
  readonly claimantsByParaId: ReadonlyMap<string, readonly string[]>;
210
198
  }
211
199
 
200
+ /** What a run inherits at one point of the chain — null means "nothing authored". */
201
+ interface StyleRunDefaults {
202
+ readonly fontFamily: string | null;
203
+ readonly fontSizeHalfPoints: number | null;
204
+ }
205
+ /** One run property as the layout records carry it (structurally SurfaceProperty). */
206
+ interface RunPropertyLike {
207
+ readonly localName: string;
208
+ readonly attributes?: Record<string, string>;
209
+ }
210
+
212
211
  /**
213
212
  * What applying ops produced: whether it committed, and why not when it did not.
214
213
  *
@@ -570,71 +569,12 @@ interface TreeDocxSessionView {
570
569
  replaceImage(scope: StoryScope, drawingNodeId: string, bytes: Uint8Array, mime: SupportedImageMime, decodePort: ImageDecodePort, options: ReplaceImageOptions): Promise<ImageIntentResult>;
571
570
  /** Delete a picture drawing and collect orphaned media in one package undo unit. */
572
571
  deleteImage(scope: StoryScope, drawingNodeId: string): ImageIntentResult;
572
+ /** Propose the drawing's deletion as a tracked change (`w:del`); media stays untouched. */
573
+ deleteImageTracked(scope: StoryScope, drawingNodeId: string, revision: RevisionAttributionInput): ImageIntentResult;
573
574
  /** Apply image property tree ops plus hyperlink relationship wiring atomically. */
574
575
  applyImageProperties(scope: StoryScope, input: ApplyImagePropertiesInput): ImageIntentResult;
576
+ /** Land a clipboard fragment (resource merge + blocks) as one package undo unit. */
577
+ applyFragmentPaste(scope: StoryScope, input: FragmentPasteInput): FragmentPasteResult;
575
578
  }
576
- /**
577
- * Binding-only session methods that exchange ProseMirror projections.
578
- *
579
- * Editor surfaces expose {@link TreeDocxSessionView}. Only the binding lane sees this extension.
580
- */
581
- interface TreeDocxSession extends TreeDocxSessionView {
582
- /** Project the current BODY revision into a ProseMirror doc. */
583
- projectDoc(): Node;
584
- /** Re-project incrementally from the last committed change, reusing untouched paragraphs. */
585
- reconcile(previousDoc: Node): Node;
586
- /**
587
- * Whether the last commit changed the BLOCK SEQUENCE (a split, join, insert or delete).
588
- *
589
- * A host needs this to decide whether the view must be re-projected at all. After a pure
590
- * text edit, the view already holds what the model holds. Re-projecting wastes work and
591
- * races the next keystroke.
592
- */
593
- lastCommitWasStructural(): boolean;
594
- /** Map an edited BODY doc to tree ops and commit them as one transaction. */
595
- applyPmDoc(doc: Node): TreeApplyResult;
596
- }
597
-
598
- /**
599
- * Why bytes could not be opened: any bounded-reader rejection, plus the package that parsed but
600
- * carried no main document tree.
601
- */
602
- type TreeSessionRejection = OoxmlPackageRejection | 'no-main-document-tree';
603
- /**
604
- * An open session, or a typed refusal.
605
- *
606
- * A result rather than a throw: every failure here is a property of the FILE, and a host needs to
607
- * tell "this is not a package" from "this package is malicious" from "this document has no body".
608
- */
609
- type OpenTreeSessionResult = {
610
- readonly ok: true;
611
- readonly session: TreeDocxSession;
612
- } | {
613
- readonly ok: false;
614
- readonly reason: TreeSessionRejection;
615
- readonly detail?: string;
616
- };
617
- interface OpenTreeSessionOptions {
618
- /**
619
- * The review module's derivation hooks, contributed through the editor's
620
- * `EditorModule` seam. Absent — the free engine — the session's
621
- * `reviewItems()` reports the typed empty queue; parse, preservation, and
622
- * `hasReviewContent` are unaffected.
623
- */
624
- readonly reviewModel?: ReviewModuleContribution;
625
- }
626
- /**
627
- * Open DOCX bytes into a tree-backed session.
628
- *
629
- * Returns a typed rejection rather than throwing: every failure here is a property of the FILE,
630
- * and a host needs to tell "this is not a package" from "this package is malicious" from "this
631
- * document has no body".
632
- *
633
- * The read is BOUNDED — decompression ratio, part count, XML depth and element counts are all
634
- * capped — because the bytes are untrusted by definition.
635
- */
636
- declare function openTreeSession(bytes: Uint8Array, options?: OpenTreeSessionOptions): OpenTreeSessionResult;
637
- /** The origin a host should use when committing a reconciliation rather than a user edit. */
638
- declare const PROJECTION_ORIGIN: "dev.docx-editor.core.origin.projection";
639
579
 
640
- export { type DocumentStyleEntry as D, type MapResult as M, type OpenTreeSessionResult as O, PROJECTION_ORIGIN as P, type TreeDocxSession as T, type TreeApplyResult as a, type TreeBindingRejection as b, type TreeDocxSessionView as c, type TreeSessionRejection as d, bodyParagraphs as e, docToTreeOps as f, type DocumentThemeColorEntry as g, openTreeSession as o, partHasNode as p, reconcileDoc as r, treeToDoc as t };
580
+ export { type DocumentStyleEntry as D, type MapResult as M, type TreeDocxSessionView as T, type TreeApplyResult as a, type TreeBindingRejection as b, bodyParagraphs as c, docToTreeOps as d, type DocumentThemeColorEntry as e, partHasNode as p, reconcileDoc as r, treeToDoc as t };
@@ -1,5 +1,5 @@
1
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';
2
+ import { I as ImpactClass, T as TreeDocOp, a as TreeOpRejection } from './tree-op-types-BuOfCrkp.js';
3
3
 
4
4
  /**
5
5
  * The document metadata Word's document-property fields render.
@@ -1,5 +1,5 @@
1
1
  import { O as OoxmlPart, c as OoxmlPackage } from './ooxml-package-CdEy9ufK.cjs';
2
- import { I as ImpactClass, T as TreeDocOp, a as TreeOpRejection } from './tree-op-types-D1vNJ7XC.cjs';
2
+ import { I as ImpactClass, T as TreeDocOp, a as TreeOpRejection } from './tree-op-types-DSJYmf5b.cjs';
3
3
 
4
4
  /**
5
5
  * The document metadata Word's document-property fields render.
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.10.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": {
@@ -86,7 +86,7 @@
86
86
  "directory": "packages/core"
87
87
  },
88
88
  "dependencies": {
89
- "@docx-editor.dev/i18n": "^2.9.2",
89
+ "@docx-editor.dev/i18n": "^2.10.0",
90
90
  "bidi-js": "1.0.3",
91
91
  "emf-converter": "2.0.2",
92
92
  "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};