@docx-editor.dev/core 2.31.0 → 2.32.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.
- package/README.md +24 -0
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +16 -16
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +17 -15
- package/dist/binding.js +1 -1
- package/dist/{chrome-print-BWvaVEhD.d.ts → chrome-print-CznJ0ucN.d.ts} +58 -23
- package/dist/chunk-25EXMBV2.cjs +5 -0
- package/dist/chunk-2CWQY27B.cjs +1 -0
- package/dist/chunk-3IEXDEFH.cjs +7 -0
- package/dist/chunk-65XBN67F.cjs +2 -0
- package/dist/{chunk-5JPIEN54.cjs → chunk-6NVZNB7O.cjs} +2 -2
- package/dist/chunk-6UDJUI3W.cjs +2 -0
- package/dist/chunk-ACLR4DMK.js +1 -0
- package/dist/{chunk-2E2RPEKX.js → chunk-B2BEELUE.js} +1 -1
- package/dist/chunk-DDFHKQFU.js +30 -0
- package/dist/{chunk-MOYYRVFV.cjs → chunk-E4IAO4CY.cjs} +1 -1
- package/dist/chunk-ETDZFNMI.js +2 -0
- package/dist/chunk-FDSL5OJU.cjs +30 -0
- package/dist/chunk-FS7CMYLT.js +4 -0
- package/dist/chunk-GDS24SZN.js +30 -0
- package/dist/chunk-GIY6NT2X.js +5 -0
- package/dist/chunk-GWM3AKUD.js +18 -0
- package/dist/chunk-HDOXACHP.js +2 -0
- package/dist/chunk-IILEENID.js +1 -0
- package/dist/chunk-L5TYBFDB.js +1 -0
- package/dist/chunk-MNF2K7NN.cjs +30 -0
- package/dist/chunk-O324RB6R.cjs +1 -0
- package/dist/chunk-OKMEMSKB.cjs +1 -0
- package/dist/chunk-QXJKYNYZ.js +1 -0
- package/dist/chunk-RALTVLB6.js +2 -0
- package/dist/chunk-SRVKFUFI.js +3 -0
- package/dist/chunk-TELQ52LG.cjs +1 -0
- package/dist/chunk-TJHE5EET.cjs +1 -0
- package/dist/chunk-UMMRURPE.js +7 -0
- package/dist/chunk-WN7ICTA5.js +1 -0
- package/dist/{chunk-XSTGE3NI.cjs → chunk-XJYZVGQR.cjs} +1 -1
- package/dist/chunk-ZGTIE3QJ.cjs +4 -0
- package/dist/chunk-ZOZI27AW.cjs +18 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +20 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +5 -5
- package/dist/collaboration.js +1 -1
- package/dist/contracts/document.d.ts +3 -3
- package/dist/contracts/editor.d.ts +13 -9
- package/dist/contracts/interaction.d.ts +2 -2
- package/dist/contracts/modules.d.ts +15 -12
- package/dist/contracts/types.d.ts +135 -2
- package/dist/{custom-node-writes-TeUvMP13.d.ts → custom-node-writes-CLJKGD9t.d.ts} +7 -2
- package/dist/{diagnostic-context-DJ0P1uZE.d.ts → diagnostic-context-BtDUY3v2.d.ts} +1 -1
- package/dist/{diagnostic-hints-C9JlLz1L.d.ts → diagnostic-hints-DK8-V0fk.d.ts} +2 -2
- package/dist/{document-protection-C8x3P2J6.d.ts → document-protection-NaniLHWF.d.ts} +1 -1
- package/dist/{editor-B2ShlO23.d.ts → editor-DZwOTmlR.d.ts} +104 -239
- package/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
- package/dist/{editor-scope-C7ke1KJG.d.ts → editor-scope-B3L-1ALc.d.ts} +1 -1
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +2 -2
- package/dist/editor.d.ts +74 -30
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +9 -15
- package/dist/export.js +1 -1
- package/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
- package/dist/{font-resolver-CWh40DYp.d.ts → font-resolver-BlQNGdvR.d.ts} +1 -1
- package/dist/{headless-document-view-qOpaCF82.d.ts → headless-document-view-Bcz9_Qva.d.ts} +115 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +27 -25
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-CWS3j0Xr.d.ts → layout-shaping-E5J4Z1Gf.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +24 -17
- package/dist/layout.js +1 -1
- package/dist/{note-properties-QsKh24sM.d.ts → note-properties-Ds5R2_3F.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +11 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-COZJUKUY.d.ts → protocol-DKa4qt7F.d.ts} +75 -5
- package/dist/{review-paragraph-order-C_QbCKcH.d.ts → review-paragraph-order-Dc17w_6v.d.ts} +1 -1
- package/dist/revision-projection-Cn6rZJ7H.d.ts +258 -0
- package/dist/{semantic-cell-selection-Cub9FDa8.d.ts → semantic-cell-selection-BaUR0iJ4.d.ts} +2 -2
- package/dist/{semantic-interaction-dApRIYpt.d.ts → semantic-interaction-CJoHLoOl.d.ts} +1 -1
- package/dist/{semantic-paint-DLzA8sjP.d.ts → semantic-paint-BPw_n0li.d.ts} +7 -4
- package/dist/{semantic-record-queries-3yp9o11g.d.ts → semantic-record-queries-C0rJ3sB4.d.ts} +1 -1
- package/dist/{semantic-records-B-akgRch.d.ts → semantic-records-BvN-WWst.d.ts} +216 -406
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +13 -14
- package/dist/store.js +1 -1
- package/dist/{types-barrel-CkF2JbU4.d.ts → tree-op-types-C_S2niXW.d.ts} +117 -26
- package/dist/{tree-package-store-B8l8DX3Z.d.ts → tree-package-store-CRHvMyNj.d.ts} +2 -2
- package/dist/{tree-session-contract-DeLRqohz.d.ts → tree-session-contract-D1awo_dA.d.ts} +5 -5
- package/dist/unsupported-elements-CVos5cqe.d.ts +23 -0
- package/docs/accept-reject-without-scrolling.md +95 -0
- package/docs/comment-on-found-text.md +72 -0
- package/docs/custom-review-cards.md +178 -0
- package/docs/highlight-ranges.md +48 -0
- package/docs/index.md +36 -0
- package/docs/propose-rewrite.md +247 -0
- package/docs/tracked-replacement.md +68 -0
- package/package.json +3 -2
- package/dist/chunk-243W4WW2.cjs +0 -2
- package/dist/chunk-4S24UOPG.js +0 -30
- package/dist/chunk-5SO5QDMV.cjs +0 -2
- package/dist/chunk-6IDOVU6L.cjs +0 -1
- package/dist/chunk-6JIJOZDW.js +0 -1
- package/dist/chunk-BTQKU64Q.cjs +0 -1
- package/dist/chunk-DBOOTED4.cjs +0 -30
- package/dist/chunk-EOTAXOJY.cjs +0 -5
- package/dist/chunk-FDAKJ2SJ.cjs +0 -30
- package/dist/chunk-FNNOJNGY.js +0 -3
- package/dist/chunk-FT33HRZP.js +0 -5
- package/dist/chunk-HC6YNKUI.cjs +0 -1
- package/dist/chunk-HZ66UCIS.js +0 -2
- package/dist/chunk-IBRBNT37.cjs +0 -1
- package/dist/chunk-IVIN7X43.js +0 -30
- package/dist/chunk-LZY6B6IV.js +0 -4
- package/dist/chunk-N6B3BXCL.js +0 -1
- package/dist/chunk-Q5K2GGNG.js +0 -2
- package/dist/chunk-R2XINWVE.js +0 -7
- package/dist/chunk-SUEXVBPR.js +0 -1
- package/dist/chunk-T2QQHG5C.js +0 -18
- package/dist/chunk-VWIJKH4A.js +0 -1
- package/dist/chunk-WO4V6PNS.cjs +0 -18
- package/dist/chunk-XMJKFURD.cjs +0 -4
- package/dist/chunk-YQWMI6J5.cjs +0 -7
- package/dist/chunk-ZCJS7D7S.js +0 -2
- package/dist/omml-equation-BsLAa2lX.d.ts +0 -115
package/dist/editor.d.ts
CHANGED
|
@@ -9,42 +9,46 @@
|
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
import { O as OoxmlPart, aU as TreeDocColorValue, r as ColorValue,
|
|
13
|
-
export { aV as DEFAULT_IMAGE_RESOURCE_LIMITS, aW as IMAGE_WRAP_TARGETS,
|
|
14
|
-
export { C as ContentLockPolicy, F as FieldResultsMode } from './tree-package-store-
|
|
15
|
-
import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-
|
|
16
|
-
export { a as TreeApplyResult } from './tree-session-contract-
|
|
12
|
+
import { O as OoxmlPart, aU as TreeDocColorValue, r as ColorValue, aa as DrawingPositionInput, G as ParagraphTabStop, ar as Watermark } from './tree-op-types-C_S2niXW.js';
|
|
13
|
+
export { aV as DEFAULT_IMAGE_RESOURCE_LIMITS, aW as IMAGE_WRAP_TARGETS, ad as ImageDecodePort, ae as ImageResourceLimits, ag as ImageWrapTarget, F as ParagraphFlags, al as RenderableImageMime, R as ReviewModelInput, an as SupportedImageMime, aX as TEXT_FORM_FORMATS, aq as VectorImageMime, aY as resolveImageResourceLimits, aZ as resolveSvgIntrinsicSize, a_ as sniffImageMime, a$ as validateRasterHeader } from './tree-op-types-C_S2niXW.js';
|
|
14
|
+
export { C as ContentLockPolicy, F as FieldResultsMode } from './tree-package-store-CRHvMyNj.js';
|
|
15
|
+
import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-D1awo_dA.js';
|
|
16
|
+
export { a as TreeApplyResult } from './tree-session-contract-D1awo_dA.js';
|
|
17
17
|
export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, RevisionMarkupDialog, RevisionMarkupDialogHost, resolveEditorModules } from './contracts/modules.js';
|
|
18
18
|
import { F as FontShapingOptions } from './font-shaping-policy-BvpkrfxM.js';
|
|
19
|
-
import {
|
|
20
|
-
export {
|
|
21
|
-
import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-
|
|
22
|
-
export { d as disposeLayoutShaping } from './layout-shaping-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import { b as
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
|
|
19
|
+
import { J as EditorFontError, W as EditorSnapshot, x as Editor, b as EditorCommand, C as CanResult, aP as ZoomMode, g as ClearAnchorHighlightOptions, c as AnchorHighlightOptions, av as ScrollToAnchorOptions, au as ScrollPlacement, A as AnchorHighlightAnimation, a4 as HighlightRange, a6 as HighlightResult, a3 as HighlightOptions, aK as TextMatch, f as BookmarkSummary, B as BookmarkPlace } from './editor-DZwOTmlR.js';
|
|
20
|
+
export { a2 as HighlightHit, a5 as HighlightRect, a9 as ImageContext, aa as ImageCropPercent, aQ as ImageCropPermille, am as ReviewItemHit, aw as SelectedImageState, aM as TrackedChangeFilterMode, aN as TrackedChangePredicate, aR as cropPercentFromCropPermille, aS as cropPercentFromPermille, aT as cropPercentFromSourceCrop, aU as cropPermilleFromCropPercent, aV as cropPermilleFromPercent, aW as sourceCropFromCropPercent, aX as validateImageCropPercent } from './editor-DZwOTmlR.js';
|
|
21
|
+
import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-E5J4Z1Gf.js';
|
|
22
|
+
export { d as disposeLayoutShaping } from './layout-shaping-E5J4Z1Gf.js';
|
|
23
|
+
import { F as FontConfiguration } from './editor-fonts-D_-vjuJi.js';
|
|
24
|
+
export { C as ComposeFontOriginsOptions, D as DEFAULT_FONT, F as FONT_RESOLVER_BRAND, a as FONT_RESOLVER_MARK_KEY, b as FontConfigurationBase, c as FontConfigurationFragment, d as FontOrigin, e as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, m as MAX_RESOLVER_FAMILIES, M as MarkedFontResolver, W as WORD_DEFAULT_FONT, i as composeFontConfiguration, j as composeFontOrigins, k as defineFontResolver, l as isFontResolver } from './font-resolver-BlQNGdvR.js';
|
|
25
|
+
import { ac as PaginatedSurfaceOptions, ad as OpenPaginatedResult, ae as PaginatedSurface, af as TableCommandPlan, y as DocxEditorInstance, ag as SurfaceFormatting } from './chrome-print-CznJ0ucN.js';
|
|
26
|
+
export { ah as AnchorFrameOrigin, A as AttachOptions, B as BookmarkChromeHandlers, a as BookmarkMarkInfo, b as BookmarkMarkOptions, ai as BookmarkMarkOptionsSource, C as CHROME_GROUPS, c as CHROME_MENUS, aj as CHROME_UNAVAILABLE_KEY, ak as ChromeControl, al as ChromeControlId, am as ChromeControlState, d as ChromeExportError, e as ChromeExportFormat, f as ChromeExportHandlers, g as ChromeExportResult, h as ChromeExportView, an as ChromeGroup, ao as ChromeGroupId, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromePrintError, p as ChromePrintErrorCode, q as ChromePrintJob, r as ChromePrintOptions, s as ChromeSlotId, t as CommentDraftChromeHandlers, u as ContentControlWidgetChromeHandlers, v as ContentControlWidgetSession, w as CustomFontsOptions, x as CustomFontsResolver, ap as DEFAULT_TABLE_CHROME_DRAFT, D as DocxEditorConfig, aq as DrawingSelectionIntent, ar as EMU_PER_POINT, as as EditorCommandExecute, E as EquationActivation, z as EquationChromeHandlers, at as EquationOps, au as FinalizedImageOverlayInteraction, F as FontLoadFailure, G as FontLoadFailureReason, H as FontMeasurementState, I as FontUrlSource, J as GoToChromeHandlers, K as HistoryGroupBinding, L as HistoryGroupBindingOptions, M as HyperlinkActivation, N as HyperlinkChromeHandlers, av as HyperlinkOps, aw as IMAGE_OVERLAY_NUDGE_PT, ax as IMAGE_OVERLAY_NUDGE_SHIFT_PT, ay as ImageInteractionSession, az as ImageOverlayScrollPort, aA as ImageResizeHandle, aB as ImageResizeResult, O as InvalidTextFormFieldChromeHandlers, P as InvalidTextFormFieldSession, Q as LoadFontsRequest, R as LoadFontsResult, S as LockedControlNavigation, aC as OpeningIndicatorHost, aD as OverlayFrameRect, aE as PaginatedSurfaceState, aF as ParagraphPropertyEdit, T as PopupChromeRegistrationOptions, aG as RemoteCaretLabelAnchor, aH as RemoteCaretLabelHost, aI as ReviewWriteIntent, aJ as RunTableChromeCommandResult, aK as SectionAnchor, aL as SectionBreakInsertType, aM as SelectedDrawingOverlayTarget, U as SurfaceEquation, V as SurfaceHyperlink, aN as SurfaceInsertImageInput, aO as SurfaceNavigation, aP as SurfaceOverlayCoordinates, aQ as SurfaceParagraphFormat, aR as TABLE_BORDER_STYLE_OPTIONS, aS as TABLE_BORDER_TARGET_OPTIONS, aT as TABLE_BORDER_WIDTH_OPTIONS, aU as TABLE_CHROME_SLOT_IDS, aV as TableBorderStyleOption, aW as TableBorderTargetOption, aX as TableBorderTargetValue, aY as TableBorderWidthOption, aZ as TableChromeDraft, a_ as TableChromePick, W as TableChromeSlotId, a$ as TableInteractionLabelKey, b0 as TextFormFieldChromeHandlers, b1 as TextFormFieldDialogSession, X as ToolbarCommandState, b2 as ToolbarSlotValue, Y as ToolbarValueMap, Z as ToolbarValueSlot, b3 as applyTableChromePick, _ as bindHistoryGroup, $ as blankDocumentBytes, b4 as canExecuteImageCommand, b5 as captureImageMutationPreconditions, b6 as chromeControlCount, a0 as chromeMenuSlots, b7 as chromeProbeForSlot, b8 as chromeSlotId, b9 as chromeSlotIsToggle, ba as commandExecOptions, a1 as commandForSlot, a2 as commandForSlotValue, bb as commandForTableChromeSlotValue, bc as computeImageResizeResult, bd as computeMovedImagePosition, be as computeResizedImageExtentEmu, a3 as createDocxEditor, a4 as createFontSource, bf as createImageOverlayScrollPort, bg as cssPixelsToLayoutPoints, a5 as customFonts, bh as defaultChromeGroups, bi as defaultTableLabel, bj as emuToOverlayPoints, bk as equationAtPosition, bl as executeImageCommand, bm as finalizeImageOverlayInteraction, bn as formattingBarChromeGroups, a6 as isChromePrintShortcut, bo as isStaleImageInteractionCommit, bp as isTableChromeSlot, bq as layoutPointsToCssPixels, a7 as loadFonts, br as overlayFrameToSheetCssPixels, bs as overlayHostOrigin, bt as pointsToEmu, bu as probeTableChromeCommand, bv as resizePreservesAspect, a8 as runChromeExport, a9 as runChromePrint, bw as runSave, bx as runTableChromeCommand, by as runTableCommand, aa as runToolbarCommand, bz as selectedDrawingOverlayTargetOf, bA as selectedImageStateOf, bB as surfacePaintScale, bC as tableChromeIconPaths, bD as tableChromeLabelKeyForTarget, bE as tableChromeToolbarState, bF as tableChromeVisible, bG as tableCommandToolbarState, ab as toolbarCommandState, bH as toolbarCommandStates } from './chrome-print-CznJ0ucN.js';
|
|
27
|
+
import { a as AutomationCapabilities, b as AutomationHost, e as AutomationBatchRequest, f as AutomationBatchResponse } from './protocol-DKa4qt7F.js';
|
|
28
|
+
import { c as HistoryGroup } from './editor-scope-B3L-1ALc.js';
|
|
29
|
+
export { d as HistoryGroupOptions } from './editor-scope-B3L-1ALc.js';
|
|
30
|
+
import { E as EditDiagnosticCode } from './diagnostic-hints-DK8-V0fk.js';
|
|
31
|
+
import { S as SemanticLayout, T as TextMeasurer } from './semantic-records-BvN-WWst.js';
|
|
32
|
+
export { t as SectionProperties, U as UnsupportedElement, e as UnsupportedElementLayout, f as UnsupportedElementRule } from './semantic-records-BvN-WWst.js';
|
|
33
|
+
import { ReviewPaneOverflow } from './contracts/types.js';
|
|
34
|
+
export { CommentMarkerStyle, DEFAULT_REVIEW_PANE, ResolvedReviewPane, ReviewPaneItemFields, ReviewPaneOpening, ReviewPaneOptions, RevisionDisplay, resolveReviewPane, reviewPaneListsItem } from './contracts/types.js';
|
|
35
|
+
export { D as DEFAULT_REVISION_MARKUP, c as REVISION_MARKUP_COLORS, d as ResolvedRevisionMarkup, a as ReviewDisplayMode, e as RevisionChangedLinesMark, f as RevisionDeletionMark, g as RevisionMarkupChromeHandlers, h as RevisionMarkupColor, R as RevisionMarkupDialogSession, i as RevisionMarkupMark, j as RevisionMarkupNamedColor, k as RevisionMarkupOptions, l as RevisionMarkupStyle, m as RevisionMarkupTextStyle, r as resolveRevisionMarkup } from './revision-projection-Cn6rZJ7H.js';
|
|
36
|
+
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-CJoHLoOl.js';
|
|
37
|
+
export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-BPw_n0li.js';
|
|
38
|
+
export { U as UnsupportedElementHost, o as observeUnsupportedElements } from './unsupported-elements-CVos5cqe.js';
|
|
34
39
|
import { B as BookmarkNameProblem } from './bookmark-names-DDuAra_V.js';
|
|
35
40
|
export { CollaborationModuleContribution } from './collaboration.js';
|
|
36
|
-
import './custom-node-writes-
|
|
37
|
-
import './headless-document-view-
|
|
41
|
+
import './custom-node-writes-CLJKGD9t.js';
|
|
42
|
+
import './headless-document-view-Bcz9_Qva.js';
|
|
38
43
|
import 'prosemirror-model';
|
|
39
44
|
import './collaboration/replication.js';
|
|
40
|
-
import './
|
|
41
|
-
import './
|
|
45
|
+
import './failure-6KGFrDO9.js';
|
|
46
|
+
import './document-protection-NaniLHWF.js';
|
|
42
47
|
import './contracts/document.js';
|
|
43
48
|
import './contracts/interaction.js';
|
|
44
|
-
import './
|
|
45
|
-
import './
|
|
46
|
-
import './semantic-
|
|
47
|
-
import './semantic-record-queries-3yp9o11g.js';
|
|
49
|
+
import './note-properties-Ds5R2_3F.js';
|
|
50
|
+
import './semantic-cell-selection-BaUR0iJ4.js';
|
|
51
|
+
import './semantic-record-queries-C0rJ3sB4.js';
|
|
48
52
|
|
|
49
53
|
declare function toEditorFontError(error: unknown): EditorFontError;
|
|
50
54
|
declare function createLayoutShaping(configuration: FontConfiguration, instrumentation?: LayoutShapingInstrumentation, execution?: FontShapingOptions): Promise<LayoutShapingOptions>;
|
|
@@ -1436,6 +1440,46 @@ declare function withTabStop(stops: readonly ParagraphTabStop[], stop: Paragraph
|
|
|
1436
1440
|
*/
|
|
1437
1441
|
declare function trapTabWithin(panel: HTMLElement, event: KeyboardEvent): boolean;
|
|
1438
1442
|
|
|
1443
|
+
/** Shared count reading and defaults for Split cells dialogs. */
|
|
1444
|
+
|
|
1445
|
+
/** The most rows and columns a cell splits into, as `splitCellConfig` answers. @public */
|
|
1446
|
+
interface SplitCellLimits {
|
|
1447
|
+
readonly maxRows: number;
|
|
1448
|
+
readonly maxCols: number;
|
|
1449
|
+
}
|
|
1450
|
+
/** The highest count a dialog offers when the editor gives no limit. @public */
|
|
1451
|
+
declare const SPLIT_CELL_FALLBACK_MAX = 63;
|
|
1452
|
+
/** Why typed counts cannot split, before the engine is asked. @public */
|
|
1453
|
+
type SplitCellCountProblem = {
|
|
1454
|
+
readonly kind: 'range';
|
|
1455
|
+
readonly field: 'columns' | 'rows';
|
|
1456
|
+
readonly max: number;
|
|
1457
|
+
} | {
|
|
1458
|
+
readonly kind: 'oneCell';
|
|
1459
|
+
};
|
|
1460
|
+
/** Typed split counts read against the cell's limits. @public */
|
|
1461
|
+
interface SplitCellCounts {
|
|
1462
|
+
/** The counts to ask the engine about, or null while a problem stands. */
|
|
1463
|
+
readonly counts: {
|
|
1464
|
+
readonly rows: number;
|
|
1465
|
+
readonly cols: number;
|
|
1466
|
+
} | null;
|
|
1467
|
+
readonly problem: SplitCellCountProblem | null;
|
|
1468
|
+
}
|
|
1469
|
+
/** Read the typed column and row counts of a Split cells dialog. @public */
|
|
1470
|
+
declare function readSplitCellCounts(columns: string, rows: string, limits: SplitCellLimits | null): SplitCellCounts;
|
|
1471
|
+
/**
|
|
1472
|
+
* The counts a Split cells dialog opens with: two columns, else two rows, else as many rows as
|
|
1473
|
+
* a merged cell spans, whichever the engine honours first.
|
|
1474
|
+
* @public
|
|
1475
|
+
*/
|
|
1476
|
+
declare function initialSplitCellCounts(limits: SplitCellLimits | null, can: (command: Extract<EditorCommand, {
|
|
1477
|
+
type: 'splitCell';
|
|
1478
|
+
}>) => CanResult): {
|
|
1479
|
+
readonly columns: string;
|
|
1480
|
+
readonly rows: string;
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1439
1483
|
/** One cell of a month grid. @public */
|
|
1440
1484
|
interface CalendarDay {
|
|
1441
1485
|
/** Local calendar date as `YYYY-MM-DD`. */
|
|
@@ -1983,5 +2027,5 @@ interface BookmarkDialogNameState {
|
|
|
1983
2027
|
*/
|
|
1984
2028
|
declare function bookmarkDialogNameState(bookmarks: readonly BookmarkSummary[], name: string, writable: boolean): BookmarkDialogNameState;
|
|
1985
2029
|
|
|
1986
|
-
export { AUTO_ZOOM_MODE, AnchorHighlightAnimation, AnchorHighlightOptions, BROWSER_AUTOMATION_CAPABILITIES, CONTENT_CONTROL_PICTURE_ACCEPT, ClearAnchorHighlightOptions, DEFAULT_WATERMARK_FONT, DRAWING_REL_FROM_H, DRAWING_REL_FROM_V, DocumentRefreshError, DocxEditorInstance, DrawingPositionInput, FIT_WIDTH_ZOOM_MODE, FontShapingOptions, HIGHLIGHT_REFRESH_MS, HighlightOptions, HighlightRange, HighlightResult, HistoryGroup, LINE_SPACING_PRESETS, LOADING_SNAPSHOT, NO_MIXED_FIELDS, OpenPaginatedResult, PX_PER_CM, PX_PER_INCH, PaginatedSurface, PaginatedSurfaceOptions, ParagraphTabStop, REVIEW_MARKERS_GUTTER_PX, ReviewPaneOverflow, SEARCH_DEBOUNCE_MS, SEARCH_HIGHLIGHT_PRIORITY, SEARCH_HIGHLIGHT_SET, SEARCH_MATCH_LIMIT, SNAP_TWIPS_CM, SNAP_TWIPS_INCH, ScrollPlacement, ScrollToAnchorOptions, SurfaceFormatting, TAB_ALIGNMENT_LABELS, TOOLBAR_COLLAPSE_ORDER, TOOLBAR_OVERFLOW_HYSTERESIS, TOOLBAR_PANEL_EDGE_MARGIN, TOOLBAR_PINNED_GROUPS, TWIPS_PER_CM, TWIPS_PER_INCH, TextMatch, TextMeasurer, TreeDocxSessionView, ZOOM_MAX, ZOOM_MIN, alignmentAfterDirectionChange, applyThemeShade, applyThemeTint, arrangeToolbarGroups, barRoomWidth, beginEditorPreview, bookmarkDialogInitialName, bookmarkDialogNameState, bookmarkDialogRows, calendarDateForKey, calendarDateFromText, calendarDateText, calendarMonth, calendarMonthNames, calendarMonthTitle, calendarWeekdays, changedFields, chordLetter, clipboardDropLandsText, clipboardPasteLandsContent, collapseOrder, collapsibleGroupCost, contentControlPopupKeyDown, contentControlPopupOpener, controlsOverflow, copyEditorStyles, createBrowserAutomationHost, createContentControlListNavigation, createDocumentRefresh, createDocumentSearch, createLayoutShaping, dragIndent, editorCommandKey, editorHostDocument, editorHostElement, editorHostWindow, editorInstanceScope, editorPreviewActive, firstDayOfWeek, formatInches, generateRulerTicks, goToBookmarkGroups, goToBookmarkMatch, goToBookmarkRows, goToBookmarkTarget, handlePosition, hasOpenNestedPopup, historyShortcutOf, hostDocumentOf, hostTimers, hostWindowOf, inchesToTwips, isDomNode, isElementNode, isGoToChord, isHTMLElementNode, isInputEvent, isKeyboardEvent, isMouseEvent, isPointerEvent, isTextNode, isoDateOf, lineSpacingMenuRowLabel, lineSpacingMenuRows, listenForPopupEscape, listenForPopupFocusLeave, lowerColorValueForBorder, lowerColorValueForFill, mixedFieldsOf, mountPaginatedSurface, observeContentControlPopup, openEditorWindow, parseIsoDate, partOfNodeId, positionContentControlPopup, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, readAvailableWidth, readColumnGap, readInlineMargins, reportAutomationException, reportAutomationRefusal, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, reviewPaneEntitledZoom, rulerPageBox, sameOverflow, sameTabStops, sameZoomMode, seedFields, separatorLeadingCost, shiftMonth, signedFirstLineOf, snapTwips, specialOf, surfaceExtent, tableCommandState, toEditorFontError, toolbarGroupPriority, toolbarOverflowGroups, toolbarPanelPlacement, toolbarPopupLeft, trailingGapCost, trapTabWithin, twipsToInches, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier, watchHighlights, watermarkShapeBox, withTabStop };
|
|
1987
|
-
export type { BarRoomInput, BookmarkDialogNameState, BookmarkSortOrder, BrowserAutomationHost, CalendarDay, CalendarMonth, CalendarMonthOptions, ClearRefreshHighlightsOptions, ColorLowerResult, ContentControlListNavigation, DocumentRefresh, DocumentRefreshState, DocumentSearch, DocumentSearchFindOptions, DocumentSearchHighlight, DocumentSearchNavigateOptions, DocumentSearchOptions, DocumentSearchState, EditorPreviewFork, EditorPreviewRefusal, EditorWindow, GoToBookmarkGroup, HighlightSource, HighlightWatch, HistoryGroupRun, HistoryShortcutKeys, HostTimers, HostWindow, LineSpacingMenuRow, LineSpacingMenuValue, NavigateToChangeOptions, OpenEditorWindowOptions, ParagraphDialogFields, ParagraphDialogMixed, ParagraphFlagKey, ParagraphFlagState, ParagraphFormatRead, ParagraphFormatUpdate, PopupEscapeOptions, PopupFocusLeaveOptions, RefreshChange, RefreshChangeInput, RefreshFailureCode, RefreshHighlightAnimation, RefreshHighlightOptions, RefreshLocation, RefreshResult, RefreshSubmission, RefreshUpdate, RulerDragOptions, RulerIndent, RulerIndentHandle, RulerPageMetrics, RulerTick, RulerUnit, SpecialIndent, SurfaceExtent, TabAlignment, TabLeaderName, ToolbarFitInput, ToolbarHostGroupPlacement, ToolbarPanelPlacement, WatchHighlightsOptions, WatermarkSize };
|
|
2030
|
+
export { AUTO_ZOOM_MODE, AnchorHighlightAnimation, AnchorHighlightOptions, BROWSER_AUTOMATION_CAPABILITIES, CONTENT_CONTROL_PICTURE_ACCEPT, ClearAnchorHighlightOptions, DEFAULT_WATERMARK_FONT, DRAWING_REL_FROM_H, DRAWING_REL_FROM_V, DocumentRefreshError, DocxEditorInstance, DrawingPositionInput, FIT_WIDTH_ZOOM_MODE, FontShapingOptions, HIGHLIGHT_REFRESH_MS, HighlightOptions, HighlightRange, HighlightResult, HistoryGroup, LINE_SPACING_PRESETS, LOADING_SNAPSHOT, NO_MIXED_FIELDS, OpenPaginatedResult, PX_PER_CM, PX_PER_INCH, PaginatedSurface, PaginatedSurfaceOptions, ParagraphTabStop, REVIEW_MARKERS_GUTTER_PX, ReviewPaneOverflow, SEARCH_DEBOUNCE_MS, SEARCH_HIGHLIGHT_PRIORITY, SEARCH_HIGHLIGHT_SET, SEARCH_MATCH_LIMIT, SNAP_TWIPS_CM, SNAP_TWIPS_INCH, SPLIT_CELL_FALLBACK_MAX, ScrollPlacement, ScrollToAnchorOptions, SurfaceFormatting, TAB_ALIGNMENT_LABELS, TOOLBAR_COLLAPSE_ORDER, TOOLBAR_OVERFLOW_HYSTERESIS, TOOLBAR_PANEL_EDGE_MARGIN, TOOLBAR_PINNED_GROUPS, TWIPS_PER_CM, TWIPS_PER_INCH, TextMatch, TextMeasurer, TreeDocxSessionView, ZOOM_MAX, ZOOM_MIN, alignmentAfterDirectionChange, applyThemeShade, applyThemeTint, arrangeToolbarGroups, barRoomWidth, beginEditorPreview, bookmarkDialogInitialName, bookmarkDialogNameState, bookmarkDialogRows, calendarDateForKey, calendarDateFromText, calendarDateText, calendarMonth, calendarMonthNames, calendarMonthTitle, calendarWeekdays, changedFields, chordLetter, clipboardDropLandsText, clipboardPasteLandsContent, collapseOrder, collapsibleGroupCost, contentControlPopupKeyDown, contentControlPopupOpener, controlsOverflow, copyEditorStyles, createBrowserAutomationHost, createContentControlListNavigation, createDocumentRefresh, createDocumentSearch, createLayoutShaping, dragIndent, editorCommandKey, editorHostDocument, editorHostElement, editorHostWindow, editorInstanceScope, editorPreviewActive, firstDayOfWeek, formatInches, generateRulerTicks, goToBookmarkGroups, goToBookmarkMatch, goToBookmarkRows, goToBookmarkTarget, handlePosition, hasOpenNestedPopup, historyShortcutOf, hostDocumentOf, hostTimers, hostWindowOf, inchesToTwips, initialSplitCellCounts, isDomNode, isElementNode, isGoToChord, isHTMLElementNode, isInputEvent, isKeyboardEvent, isMouseEvent, isPointerEvent, isTextNode, isoDateOf, lineSpacingMenuRowLabel, lineSpacingMenuRows, listenForPopupEscape, listenForPopupFocusLeave, lowerColorValueForBorder, lowerColorValueForFill, mixedFieldsOf, mountPaginatedSurface, observeContentControlPopup, openEditorWindow, parseIsoDate, partOfNodeId, positionContentControlPopup, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, readAvailableWidth, readColumnGap, readInlineMargins, readSplitCellCounts, reportAutomationException, reportAutomationRefusal, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, reviewPaneEntitledZoom, rulerPageBox, sameOverflow, sameTabStops, sameZoomMode, seedFields, separatorLeadingCost, shiftMonth, signedFirstLineOf, snapTwips, specialOf, surfaceExtent, tableCommandState, toEditorFontError, toolbarGroupPriority, toolbarOverflowGroups, toolbarPanelPlacement, toolbarPopupLeft, trailingGapCost, trapTabWithin, twipsToInches, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier, watchHighlights, watermarkShapeBox, withTabStop };
|
|
2031
|
+
export type { BarRoomInput, BookmarkDialogNameState, BookmarkSortOrder, BrowserAutomationHost, CalendarDay, CalendarMonth, CalendarMonthOptions, ClearRefreshHighlightsOptions, ColorLowerResult, ContentControlListNavigation, DocumentRefresh, DocumentRefreshState, DocumentSearch, DocumentSearchFindOptions, DocumentSearchHighlight, DocumentSearchNavigateOptions, DocumentSearchOptions, DocumentSearchState, EditorPreviewFork, EditorPreviewRefusal, EditorWindow, GoToBookmarkGroup, HighlightSource, HighlightWatch, HistoryGroupRun, HistoryShortcutKeys, HostTimers, HostWindow, LineSpacingMenuRow, LineSpacingMenuValue, NavigateToChangeOptions, OpenEditorWindowOptions, ParagraphDialogFields, ParagraphDialogMixed, ParagraphFlagKey, ParagraphFlagState, ParagraphFormatRead, ParagraphFormatUpdate, PopupEscapeOptions, PopupFocusLeaveOptions, RefreshChange, RefreshChangeInput, RefreshFailureCode, RefreshHighlightAnimation, RefreshHighlightOptions, RefreshLocation, RefreshResult, RefreshSubmission, RefreshUpdate, RulerDragOptions, RulerIndent, RulerIndentHandle, RulerPageMetrics, RulerTick, RulerUnit, SpecialIndent, SplitCellCountProblem, SplitCellCounts, SplitCellLimits, SurfaceExtent, TabAlignment, TabLeaderName, ToolbarFitInput, ToolbarHostGroupPlacement, ToolbarPanelPlacement, WatchHighlightsOptions, WatermarkSize };
|
package/dist/editor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Vb as AUTO_ZOOM_MODE,$b as BROWSER_AUTOMATION_CAPABILITIES,kb as CHROME_GROUPS,ob as CHROME_MENUS,rb as CHROME_UNAVAILABLE_KEY,wb as CONTENT_CONTROL_PICTURE_ACCEPT,
|
|
1
|
+
export{Vb as AUTO_ZOOM_MODE,$b as BROWSER_AUTOMATION_CAPABILITIES,kb as CHROME_GROUPS,ob as CHROME_MENUS,rb as CHROME_UNAVAILABLE_KEY,wb as CONTENT_CONTROL_PICTURE_ACCEPT,Sc as ChromeExportError,Uc as ChromePrintError,c as DEFAULT_REVIEW_PANE,ra as DEFAULT_TABLE_CHROME_DRAFT,W as DEFAULT_WATERMARK_FONT,Jc as DocumentRefreshError,da as EMU_PER_POINT,Wb as FIT_WIDTH_ZOOM_MODE,Lc as HIGHLIGHT_REFRESH_MS,ma as IMAGE_OVERLAY_NUDGE_PT,na as IMAGE_OVERLAY_NUDGE_SHIFT_PT,Gc as LINE_SPACING_PRESETS,f as LOADING_SNAPSHOT,vc as NO_MIXED_FIELDS,E as PX_PER_CM,D as PX_PER_INCH,Sb as REVIEW_MARKERS_GUTTER_PX,Nc as SEARCH_DEBOUNCE_MS,Qc as SEARCH_HIGHLIGHT_PRIORITY,Pc as SEARCH_HIGHLIGHT_SET,Oc as SEARCH_MATCH_LIMIT,K as SNAP_TWIPS_CM,J as SNAP_TWIPS_INCH,Cc as SPLIT_CELL_FALLBACK_MAX,xa as TABLE_BORDER_STYLE_OPTIONS,wa as TABLE_BORDER_TARGET_OPTIONS,ya as TABLE_BORDER_WIDTH_OPTIONS,sa as TABLE_CHROME_SLOT_IDS,rc as TAB_ALIGNMENT_LABELS,Ra as TOOLBAR_COLLAPSE_ORDER,Ta as TOOLBAR_OVERFLOW_HYSTERESIS,Xa as TOOLBAR_PANEL_EDGE_MARGIN,Sa as TOOLBAR_PINNED_GROUPS,I as TWIPS_PER_CM,H as TWIPS_PER_INCH,Ub as ZOOM_MAX,Tb as ZOOM_MIN,zc as alignmentAfterDirectionChange,za as applyTableChromePick,R as applyThemeShade,Q as applyThemeTint,Wa as arrangeToolbarGroups,fb as barRoomWidth,Rb as beginEditorPreview,Fc as bindHistoryGroup,g as blankDocumentBytes,ad as bookmarkDialogInitialName,bd as bookmarkDialogNameState,Xc as bookmarkDialogRows,Eb as calendarDateForKey,Gb as calendarDateFromText,Fb as calendarDateText,Cb as calendarMonth,Hb as calendarMonthNames,Ab as calendarMonthTitle,Bb as calendarWeekdays,ka as canExecuteImageCommand,ja as captureImageMutationPreconditions,yc as changedFields,ib as chordLetter,qb as chromeControlCount,pb as chromeMenuSlots,Da as chromeProbeForSlot,lb as chromeSlotId,Ja as chromeSlotIsToggle,i as clipboardDropLandsText,h as clipboardPasteLandsContent,Va as collapseOrder,bb as collapsibleGroupCost,O as commandExecOptions,Ea as commandForSlot,Ga as commandForSlotValue,Fa as commandForTableChromeSlotValue,lc as computeImageResizeResult,ha as computeMovedImagePosition,ga as computeResizedImageExtentEmu,ub as contentControlPopupKeyDown,vb as contentControlPopupOpener,gb as controlsOverflow,k as copyEditorStyles,ac as createBrowserAutomationHost,Ib as createContentControlListNavigation,Kc as createDocumentRefresh,Rc as createDocumentSearch,_b as createDocxEditor,B as createFontSource,mc as createImageOverlayScrollPort,b as createLayoutShaping,ba as cropPercentFromCropPermille,$ as cropPercentFromPermille,Y as cropPercentFromSourceCrop,aa as cropPermilleFromCropPercent,_ as cropPermilleFromPercent,hc as cssPixelsToLayoutPoints,C as customFonts,mb as defaultChromeGroups,ta as defaultTableLabel,N as dragIndent,Qa as editorCommandKey,o as editorHostDocument,n as editorHostElement,p as editorHostWindow,bc as editorInstanceScope,Qb as editorPreviewActive,fa as emuToOverlayPoints,Lb as equationAtPosition,la as executeImageCommand,nc as finalizeImageOverlayInteraction,zb as firstDayOfWeek,pc as formatInches,nb as formattingBarChromeGroups,F as generateRulerTicks,$c as goToBookmarkGroups,_c as goToBookmarkMatch,Yc as goToBookmarkRows,Zc as goToBookmarkTarget,L as handlePosition,dc as hasOpenNestedPopup,Kb as historyShortcutOf,l as hostDocumentOf,u as hostTimers,m as hostWindowOf,qc as inchesToTwips,Ec as initialSplitCellCounts,Vc as isChromePrintShortcut,t as isDomNode,q as isElementNode,jb as isGoToChord,r as isHTMLElementNode,y as isInputEvent,v as isKeyboardEvent,x as isMouseEvent,w as isPointerEvent,pa as isStaleImageInteractionCommit,ua as isTableChromeSlot,s as isTextNode,xb as isoDateOf,gc as layoutPointsToCssPixels,Ic as lineSpacingMenuRowLabel,Hc as lineSpacingMenuRows,cc as listenForPopupEscape,ec as listenForPopupFocusLeave,A as loadFonts,T as lowerColorValueForBorder,U as lowerColorValueForFill,wc as mixedFieldsOf,Mb as mountPaginatedSurface,tb as observeContentControlPopup,j as openEditorWindow,ic as overlayFrameToSheetCssPixels,jc as overlayHostOrigin,yb as parseIsoDate,z as partOfNodeId,ea as pointsToEmu,sb as positionContentControlPopup,Aa as probeTableChromeCommand,hb as readAvailableWidth,eb as readColumnGap,db as readInlineMargins,Dc as readSplitCellCounts,Pb as reportAutomationException,Ob as reportAutomationRefusal,kc as resizePreservesAspect,V as resolveColorValueToCss,d as resolveReviewPane,S as resolveThemeColorHex,Xb as resolveZoomMode,Zb as reviewPaneEntitledZoom,e as reviewPaneListsItem,G as rulerPageBox,Tc as runChromeExport,Wc as runChromePrint,Na as runSave,La as runTableChromeCommand,Pa as runTableCommand,Ma as runToolbarCommand,Za as sameOverflow,xc as sameTabStops,Yb as sameZoomMode,uc as seedFields,oa as selectedDrawingOverlayTargetOf,ia as selectedImageStateOf,ab as separatorLeadingCost,Db as shiftMonth,tc as signedFirstLineOf,M as snapTwips,Z as sourceCropFromCropPercent,sc as specialOf,Jb as surfaceExtent,fc as surfacePaintScale,Ca as tableChromeIconPaths,Ba as tableChromeLabelKeyForTarget,Ha as tableChromeToolbarState,va as tableChromeVisible,qa as tableCommandState,Oa as tableCommandToolbarState,a as toEditorFontError,Ia as toolbarCommandState,Ka as toolbarCommandStates,Ua as toolbarGroupPriority,_a as toolbarOverflowGroups,Ya as toolbarPanelPlacement,$a as toolbarPopupLeft,cb as trailingGapCost,Bc as trapTabWithin,oc as twipsToInches,ca as validateImageCropPercent,P as validateThemeModifier,Mc as watchHighlights,X as watermarkShapeBox,Ac as withTabStop}from'./chunk-GDS24SZN.js';export{a as resolveEditorModules}from'./chunk-4HENIAFG.js';export{a as observeUnsupportedElements}from'./chunk-FS7CMYLT.js';export{d as DEFAULT_FONT,i as FONT_RESOLVER_BRAND,h as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,e as WORD_DEFAULT_FONT,f as composeFontConfiguration,n as composeFontOrigins,j as defineFontResolver,k as isFontResolver}from'./chunk-RALTVLB6.js';export{t as disposeLayoutShaping}from'./chunk-SRVKFUFI.js';import'./chunk-RIYSCEFQ.js';import'./chunk-UMMRURPE.js';import'./chunk-QXJKYNYZ.js';export{Xa as DEFAULT_REVISION_MARKUP,Wa as REVISION_MARKUP_COLORS,Ya as resolveRevisionMarkup}from'./chunk-DDFHKQFU.js';import'./chunk-GIY6NT2X.js';import'./chunk-B2BEELUE.js';import'./chunk-ETDZFNMI.js';import'./chunk-L5TYBFDB.js';import'./chunk-ACLR4DMK.js';import'./chunk-HDOXACHP.js';import'./chunk-WN7ICTA5.js';import'./chunk-IILEENID.js';export{r as DEFAULT_IMAGE_RESOURCE_LIMITS,wl as DRAWING_REL_FROM_H,xl as DRAWING_REL_FROM_V,Ld as IMAGE_WRAP_TARGETS,fj as TEXT_FORM_FORMATS,zl as positionInputFromPropertiesCommand,yl as propertiesCommandHasPositionFields,s as resolveImageResourceLimits,oe as resolveSvgIntrinsicSize,ke as sniffImageMime,vl as validateDrawingPositionInput,pe as validateRasterHeader,Al as validateSetImagePositionCommand}from'./chunk-GWM3AKUD.js';import'./chunk-S6J4O5XP.js';
|
package/dist/export.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkMOYYRVFV_cjs=require('./chunk-MOYYRVFV.cjs'),chunk5JPIEN54_cjs=require('./chunk-5JPIEN54.cjs'),chunkHC6YNKUI_cjs=require('./chunk-HC6YNKUI.cjs'),chunkDBOOTED4_cjs=require('./chunk-DBOOTED4.cjs'),chunkXSTGE3NI_cjs=require('./chunk-XSTGE3NI.cjs');require('./chunk-IBRBNT37.cjs');var chunk243W4WW2_cjs=require('./chunk-243W4WW2.cjs'),chunkWO4V6PNS_cjs=require('./chunk-WO4V6PNS.cjs');function N(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},i=e.shape(n);if(t.glyphs.length!==i.glyphs.length||t.glyphs.some((l,c)=>l.id!==i.glyphs[c]?.id))return t;let r=[],s=0;for(let l of o.text){let c=l.toUpperCase()!==l,h=r.at(-1);h&&(h.lower===c||/\p{M}/u.test(l))?h.text+=l:r.push({text:l,start:s,lower:c}),s+=l.length;}let a=[],p=[],d=[],u=true,m=0;for(let l of o.environment.direction==="rtl"?r.reverse():r){let c=l.lower?.8:1,h=[],E=[],R="",f=l.start;for(let F of l.text){let y=l.lower?F.toUpperCase():F;for(let S=0;S<y.length;S++)h.push(f),E.push(f+F.length);R+=y,f+=F.length;}let g=e.shape({...n,text:R}),x=a.length;for(let[F,y]of g.glyphs.entries()){let S=g.exactAdvancesX?.[F];S===void 0?u=false:d.push(S*c),a.push({...y,cluster:h[y.cluster]??l.start,originX:chunkDBOOTED4_cjs.n(m+Math.round(y.originX*c)),originY:chunkDBOOTED4_cjs.n(Math.round(y.originY*c)),offsetX:chunkDBOOTED4_cjs.n(Math.round(y.offsetX*c)),offsetY:chunkDBOOTED4_cjs.n(Math.round(y.offsetY*c)),advanceX:chunkDBOOTED4_cjs.n(Math.round(y.advanceX*c)),advanceY:chunkDBOOTED4_cjs.n(Math.round(y.advanceY*c)),drawScale:c});}for(let F of g.clusters){let y=h[F.textStart]??l.start,S=E[F.textEnd-1]??f,b=chunkDBOOTED4_cjs.n(Math.round(F.advance*c)),T=p.at(-1);T&&T.textStart===y&&T.textEnd===S?p[p.length-1]={...T,glyphEnd:x+F.glyphEnd,advance:chunkDBOOTED4_cjs.n(T.advance+b),caretEdges:[chunkDBOOTED4_cjs.n(0),chunkDBOOTED4_cjs.n(T.advance+b)]}:p.push({...F,textStart:y,textEnd:S,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:b,caretEdges:F.caretEdges.map(V=>chunkDBOOTED4_cjs.n(Math.round(V*c))),fontSpan:0});}m+=g.glyphs.reduce((F,y)=>F+Math.round(y.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:u&&d.length===a.length?d:void 0}}var ft=new WeakMap;function Gt(e){let o=ft.get(e);return o===void 0&&(o=Yt(e.bytes,e.faceIndex),ft.set(e,o)),o}var Vt=new Set(["COLR","CBDT","sbix"]),Wt=512;function Yt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(mt(e,0)==="ttcf"){let r=t.getUint32(8);if(o<0||o>=r||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let i=Math.min(t.getUint16(n+4),Wt);for(let r=0;r<i;r++){let s=n+12+r*16;if(s+4>e.byteLength)return false;if(Vt.has(mt(e,s)))return true}return false}function mt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var $t=/\p{Emoji_Presentation}|️/u;function Kt(e){return $t.test(e)}function z(e,o){if(e.length<2)return e;let t=e.filter(Gt);if(t.length===0||t.length===e.length)return e;let n=e.filter(i=>!t.includes(i));return Kt(o)?[...t,...n]:[...n,...t]}var Zt=2048;function yt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Zt)return null;let i=(f,g)=>{let{context:x,...F}=o,y={...F,text:g,environment:chunkDBOOTED4_cjs.r({...o.environment,font:f})};return N(e,y,e.shape(y))},r=[],s=new Map;for(let f of [...t.clusters].sort((g,x)=>g.textStart-x.textStart)){let g=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=r.at(-1);if(/^[\uFE0E\uFE0F]$/.test(x)&&F&&F.end===f.textStart){F.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(x)&&F&&F.font!==o.environment.font&&F.end===f.textStart){F.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(S=>S.id===0)){let S=o.text.slice(f.textStart,f.textEnd+1),b=s.get(x)??z(n,S).find(T=>{try{return !i(T,x).glyphs.some(V=>V.id===0)}catch{return false}});if(!b)return null;s.set(x,b),g=b;}let y=r.at(-1);y&&y.font===g&&y.end===f.textStart?y.end=f.textEnd:r.push({start:f.textStart,end:f.textEnd,font:g});}let a=[],p=[],d=[],u=[],m=true,l=0,c=0,h=0,E=0,R=0;for(let f of o.environment.direction==="rtl"?r.reverse():r){let g=i(f.font,o.text.slice(f.start,f.end));if(g.glyphs.some(y=>y.id===0))return null;let x=a.length,F=d.length;for(let y of g.glyphs)a.push({...y,cluster:f.start+y.cluster,originX:chunkDBOOTED4_cjs.n(l+y.originX),originY:chunkDBOOTED4_cjs.n(c+y.originY)});if(g.exactAdvancesX===void 0)m=false;else for(let y of g.exactAdvancesX)u.push(y);for(let y of g.clusters)p.push({...y,textStart:f.start+y.textStart,textEnd:f.start+y.textEnd,glyphStart:x+y.glyphStart,glyphEnd:x+y.glyphEnd,fontSpan:F});g.glyphs.length&&d.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),l+=g.glyphs.reduce((y,S)=>y+S.advanceX,0),c+=g.glyphs.reduce((y,S)=>y+S.advanceY,0),h=Math.max(h,g.metrics.ascent),E=Math.max(E,g.metrics.descent),R=Math.max(R,g.metrics.lineGap);}return chunkDBOOTED4_cjs.u({...t,glyphs:a,clusters:p,fontSpans:d,exactAdvancesX:m&&u.length===a.length?u:void 0,metrics:{ascent:chunkDBOOTED4_cjs.n(h),descent:chunkDBOOTED4_cjs.n(E),lineGap:chunkDBOOTED4_cjs.n(R)}},{...o.environment,fallbackOrder:n})}var Jt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),Qt=512,ht=new WeakMap;function eo(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=c=>c+2<=n.byteLength?n.getUint16(c):-1,r=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=r(8);if(c<0||o<0||o>=c||(a=r(12+o*4),a<0))return t}let p=i(a+4);if(p<0||p>1024)return t;let d=-1;for(let c=0;c<p;c+=1){let h=a+12+c*16;if(s(h)==="GSUB"){d=r(h+8);break}}if(d<0)return t;let u=i(d+4);if(u<=0)return t;let m=d+u,l=i(m);if(l<0)return t;for(let c=0;c<Math.min(l,Qt);c+=1){let h=s(m+2+c*6);h&&t.add(h);}return t}function to(e,o){let t=ht.get(e);return t||(t=eo(e.bytes,e.faceIndex),ht.set(e,t)),(Jt.get(o)??[o.toLowerCase()]).some(i=>t.has(i))}function gt(e,o){let t=e.filter(n=>to(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function Q(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(r=>r.id===0).map(r=>r.cluster));if(!n.size)return t;let i=o.text.replace(/\u2011/g,(r,s)=>n.has(s)?"-":r);if(i===o.text)return t;try{let r=e.shape({...o,text:i});return chunkDBOOTED4_cjs.u({...r,text:o.text},o.environment)}catch{return t}}function xt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof chunkDBOOTED4_cjs.d)),n={shape(a){return Q(e.shaper,a,e.shaper.shape(a))}},i=new WeakMap,r={shape(a){let p=e.shaper.shape(a),d=i.get(p);if(d&&d.input.text===a.text&&d.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&d.input.bidiLevel===a.bidiLevel&&d.input.context?.before===a.context?.before&&d.input.context?.after===a.context?.after&&d.input.environment===a.environment)return d.run;let u=s(a,Q(e.shaper,a,p));return i.set(p,{input:a,run:u}),u}},s=(a,p)=>{let d=N(n,a,p);if(!d.glyphs.some(u=>u.id===0)||/^[\t\n\r\f]*$/.test(a.text))return d;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let u=yt(n,a,d,t);if(u)return u}for(let u of gt(z(t,a.text),a.environment.script))if(!(u.hash===a.environment.font.hash&&u.faceIndex===a.environment.font.faceIndex))try{let m={...a,environment:chunkDBOOTED4_cjs.r({...a.environment,font:u})},l=N(n,m,n.shape(m));if(!l.glyphs.some(c=>c.id===0))return l}catch{}return d};return {...e,shaper:r}}var ee=chunkDBOOTED4_cjs.b;function te(e){return typeof e.admittedFontFace=="function"}var oo=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function j(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var Ft=new WeakMap;function H(e){let o=Ft.get(e);return o||Ft.set(e,o=no(e)),o}function no(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:j(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:j(o.requested),resolved:j(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ro(e){return Object.freeze({...H(e),bytes:chunkDBOOTED4_cjs.i(e)})}function io(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkDBOOTED4_cjs.d?null:ro(t)}catch{return null}}function Et(e){return o=>{if(e.status()!=="active")throw e.unavailable();return io(e.resolve(),o)}}function ao(e){return Object.freeze(e.slice(0,ee).map(o=>Object.freeze({request:j(o.request),partName:o.partName,reason:o.reason})))}function oe(e,o,t,n,i=[],r=new Set){let s=new Map;for(let p of [...e,o]){let d=p.toLowerCase();s.has(d)||s.set(d,p);}let a=[...s.values()].map(p=>{let d=[];for(let m of oo){let l=n?.({family:p,...m});!l||l instanceof chunkDBOOTED4_cjs.d||d.push(Object.freeze({...m,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}let u=r.has(p.trim().toLowerCase())?d.filter(m=>m.via==="direct").length:d.length;return Object.freeze({family:p,coverage:u===4?"complete":u>0?"partial":"none",faces:Object.freeze(d)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:ao(i)})}function ne(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function re(e,o,t=[]){let n=d=>d.trim().toLowerCase(),i=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),r=new Set(t.map(d=>n(d.family))),s=d=>{if(!(d instanceof chunkMOYYRVFV_cjs.l))return true;let u=n(d.request.family);return i.has(u)||!r.has(u)},a=e.originFailures.some(({cause:d})=>d instanceof chunkMOYYRVFV_cjs.m?d.causes.length===0||d.causes.some(s):s(d));if(o.fontPolicy!=="strict"||!a&&e.families.every(d=>d.coverage==="complete"))return;let p=e.families.filter(d=>d.coverage!=="complete").map(d=>d.family).join(", ");throw new chunkHC6YNKUI_cjs.d("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function X(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let i={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},r=chunkDBOOTED4_cjs.h(i),s=o.get(r);if(!s){try{s=e.fonts.resolve(i);}catch{return null}o.set(r,s);}return s instanceof chunkDBOOTED4_cjs.d?null:s}function bt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function so(e){for(let o of e){let t=o.codePointAt(0);if(t!==32&&(t<=255||t>=61440&&t<=61695))return false}return true}function ae(e){let o=X(),t=new WeakMap;return n=>{let i=chunkDBOOTED4_cjs.wa(n.style,n.fontSlot),r=chunkDBOOTED4_cjs.gd(n)?chunkDBOOTED4_cjs.hd(n):chunkDBOOTED4_cjs.da(n.text,i);if(r.length===0)return null;let s=i.fontFamily??e.defaultFont.family,a=G(e,o,s,i)??(chunkWO4V6PNS_cjs.b(s)&&so(r)?G(e,o,e.defaultFont.family,i):null);if(!a)return null;try{if(i.smallCaps&&!chunk5JPIEN54_cjs.ea(e.shaper,e.environment,a,i,t))return null;let p=chunk5JPIEN54_cjs.da(e.shaper,e.environment,a,i,r);return Object.freeze({run:p,font:H(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(d=>H(d.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function Rt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var M=new Map,St=new WeakMap,se=0,C;var le=32,Ot=chunkDBOOTED4_cjs.c;function vt(){if(C)return C;let e=(async()=>(await chunk5JPIEN54_cjs.d(),chunk5JPIEN54_cjs.h({...chunk5JPIEN54_cjs.i,maxFontBytes:chunkDBOOTED4_cjs.a})))();return C=e,e.catch(()=>{C===e&&(C=void 0);}),e}function wt(e){let o=X();return chunk5JPIEN54_cjs.ga(e,{resolveFont(t){return bt(e,o,t)},fallback:chunkDBOOTED4_cjs.ja()})}async function At(e,o,t=[],n=false,i){if(!chunk5JPIEN54_cjs.m(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=chunk5JPIEN54_cjs.k(i,chunk5JPIEN54_cjs.i),s=await vt(),a=xt(await chunk5JPIEN54_cjs.t(e,s,r,o,n),t);return Object.freeze({createMeasurer:()=>wt(a),resolveFont:p=>a.fonts.resolve(p),shapeLaidOutText:ae(a),producer:["node-export-session",JSON.stringify(t),e.fingerprint,a.operation.shapingHash,`producer:${a.operation.producerVersion}`,`fallback:${chunkDBOOTED4_cjs.ia}`].join("|"),extensionFingerprint:e.fingerprint})}function lo(e,o,t){if(!chunk5JPIEN54_cjs.m(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let n=chunk5JPIEN54_cjs.k(t,chunk5JPIEN54_cjs.i),i=chunk5JPIEN54_cjs.j(n),r=St.get(e),s=r?.get(i);if(s)return s;let a=`${chunk5JPIEN54_cjs.o(e)}|${i}`,p=M.get(a);if(!p){if(M.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));p=(async()=>{let l=chunk5JPIEN54_cjs.n(e).sources.reduce((h,E)=>h+(E.availability==="forbidden"?0:E.bytes.byteLength),0);if(se+l>Ot)throw new RangeError(`Shared exporter shaping font bytes are limited to ${Ot} process-wide`);se+=l;let c;try{let h=await vt();c=await chunk5JPIEN54_cjs.t(e,h,n,o);}catch(h){throw se-=l,h}return Object.freeze({createMeasurer:()=>wt(c),shapeLaidOutText:ae(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),M.set(a,p),p.catch(()=>{M.get(a)===p&&M.delete(a);});}let d=e.fingerprint,u=p.then(m=>Object.freeze({createMeasurer:m.createMeasurer,shapeLaidOutText:m.shapeLaidOutText,producer:["node-export",d,m.shapingHash,`producer:${m.producerVersion}`,`fallback:${chunkDBOOTED4_cjs.ia}`].join("|"),extensionFingerprint:d}));return r||St.set(e,r=new Map),r.set(i,u),u.catch(()=>{r?.get(i)===u&&r.delete(i);}),u}var co="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function uo(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(i=>i.type===co),n;if(t){let i=chunkWO4V6PNS_cjs.J(t);i.mode==="Internal"&&i.target.ok&&(n=o.parts.get(i.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkWO4V6PNS_cjs.lf(o,n)}function Tt(e,o){let t=uo(e);if(t.length!==0)return chunkMOYYRVFV_cjs.j(n=>{let i=new Set((n.resolvedFaces??[]).map(s=>chunkDBOOTED4_cjs.h(s))),r=chunkMOYYRVFV_cjs.E(t,{maxFontBytes:chunkDBOOTED4_cjs.a,aggregateBudget:po(n),shadowedRequests:i});if(o)for(let s of r.dropped){if(o.dropped.length>=ee)break;o.dropped.push(s);}return {sources:r.sources}})}function po(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkDBOOTED4_cjs.c:Math.max(0,chunkDBOOTED4_cjs.c-o)}function fo(e){return te(e)&&ie(e)}var A=0,Lt=Symbol("font-resolution-timeout");function mo(e){let o=0,t=false;return e?.(A),{reserve:i=>{if(t)throw new Error("Document font-byte lease is already released");if(A+i>chunkDBOOTED4_cjs.c)throw new chunkHC6YNKUI_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkDBOOTED4_cjs.c}; requested ${i} bytes with ${A} bytes already active`);A+=i,o+=i,e?.(A);let r=false;return ()=>{r||t||(r=true,A-=i,o-=i,e?.(A));}},release:()=>{t||(t=true,A-=o,o=0,e?.(A));}}}function ce(e,o){return e.attributes.find(t=>t.localName===o)?.value}function yo(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunkWO4V6PNS_cjs.la||t.namespaceUri===""))?.value}async function ho(e,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=chunk243W4WW2_cjs.Ca(e);if(!t.ok)return t;let{fonts:n,lastResortFonts:i,fontResolutionTimeoutMs:r,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:d,fontShaping:u,...m}=o,l=Array.isArray(n)?n:[n],c=i===void 0?[]:Array.isArray(i)?i:[i],h,E;try{E=await go(t.view,l,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:d,fontShaping:u,lastResortFonts:c,onFontResolution:b=>(h=b,a?.(b))});}catch(b){if(b instanceof chunkHC6YNKUI_cjs.d&&b.code==="aborted")return {ok:false,reason:"aborted"};throw b}if(!h)throw E?.dispose(),new chunkHC6YNKUI_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=chunkHC6YNKUI_cjs.e(t.view,{...m,reuseAcrossRevisions:!1,...E?{measurer:E.createMeasurer(),producer:o.producer??E.producer}:o.producer?{producer:o.producer}:{}});}catch(b){throw E?.dispose(),b}if(!R.ok)return E?.dispose(),R;let f=R.session,g=E,x="active",F=()=>x==="aborted"?new chunkHC6YNKUI_cjs.d("aborted","Export resource settlement was aborted"):new chunkHC6YNKUI_cjs.d("disposed","Export session has been disposed"),y=b=>{if(x==="active"){x=b,o.signal?.removeEventListener("abort",S);try{f.dispose();}finally{g?.dispose(),g=void 0;}}},S=()=>y("aborted");return o.signal?.addEventListener("abort",S,{once:true}),o.signal?.aborted&&S(),{ok:true,session:Object.freeze({fontResolution:h,layout:()=>x==="active"?f.layout():Promise.reject(F()),layoutFor:b=>x==="active"?f.layoutFor(b):Promise.reject(F()),validatedImageBytes:b=>x==="active"?f.validatedImageBytes(b):null,admittedFontFace:Et({status:()=>x,unavailable:F,resolve:()=>g?.resolveFont}),shapeLaidOutText:Rt({status:()=>x,unavailable:F,shaping:()=>g}),dispose:()=>y("disposed")})}}async function go(e,o,t={}){let n=chunk5JPIEN54_cjs.k(t.fontShaping,chunk5JPIEN54_cjs.i);if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let i=xo(t.timeoutMs),r=new AbortController,s=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",s,{once:true}),t.signal?.aborted&&s();let a=setTimeout(()=>r.abort(Lt),i);try{de(r.signal);let p=(async()=>{let d=mo(t.onActiveFontBytesChange),u=!1;try{let m=Eo(e).slice(0,chunkMOYYRVFV_cjs.c),l=chunkMOYYRVFV_cjs.x(e,m),c=[],h={dropped:[]},E=Tt(e,h),R=[...o,...E?[E]:[],...t.lastResortFonts??[]],f=await chunkMOYYRVFV_cjs.o(R,{families:[...new Set([...(t.glyphFallbacks??[]).map(b=>b.family),...l.families])].slice(0,chunkMOYYRVFV_cjs.c),defaultFamily:chunkMOYYRVFV_cjs.d.family,signal:r.signal},{onOriginFailure:b=>c.push(b),reserveOwnedBytes:d.reserve,maxExecutionFontBytes:n.maxFontBytes});de(r.signal);let g=chunkMOYYRVFV_cjs.f(f??{}),x=chunkMOYYRVFV_cjs.z(g,l),F=chunkMOYYRVFV_cjs.A(g,x,l);if(x.sources.length===0){let b=oe(m,x.defaultFont.family,c,void 0,h.dropped);ne(b,t),re(b,t,t.glyphFallbacks);return}let y=await At(chunk5JPIEN54_cjs.q(x),void 0,t.glyphFallbacks,t.documentLigatures,{maxFontBytes:n.maxFontBytes});de(r.signal);let S=oe(m,x.defaultFont.family,c,y.resolveFont,h.dropped,F);return ne(S,t),re(S,t,t.glyphFallbacks),u=!0,Object.freeze({...y,dispose:d.release})}finally{u||d.release();}})();return await Promise.race([p,Fo(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",s);}}function xo(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function Fo(e){return new Promise((o,t)=>{let n=()=>{t(Pt(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function Pt(e){let o=e.reason===Lt;return new chunkHC6YNKUI_cjs.d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw Pt(e)}function Eo(e){let o=[e.part().root],t=[],n=[],i=new Set([e.part().name]),r=(u,m)=>{!m||i.has(m.name)||(i.add(m.name),u.push(m.root));};for(let u of e.headerFooterPartsBySection()){for(let m of u.headers.values())r(t,m);for(let m of u.footers.values())r(t,m);}for(let u of ["footnote","endnote"])n.push(...bo(e,u));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},p=new Map,d=(u,m)=>{let l=chunkXSTGE3NI_cjs.e(u,e.stylesRoot(),a,So(u,m)),c=chunkMOYYRVFV_cjs.v(u,e.numberingRoot(),e.stylesRoot(),a);for(let h of [...l.direct,...wo(u),...c,...chunkMOYYRVFV_cjs.s(u,e.stylesRoot(),a),...l.inherited]){let E=h.toLowerCase();p.has(E)||p.set(E,h);}};return d(o,"body"),d(t,"furniture"),d(n,"note"),[...p.values()]}function bo(e,o){let t=chunkWO4V6PNS_cjs.lh(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkWO4V6PNS_cjs.mh(e.part()).filter(r=>r.noteKind===o).map(r=>r.noteId)),i=[];for(let r of t.root.children){if(r.kind==="textValue")continue;let s=chunkWO4V6PNS_cjs.zc(r),a=chunkWO4V6PNS_cjs.yc(r);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&i.push(r);}return i}var Ro="http://schemas.openxmlformats.org/officeDocument/2006/math";function So(e,o){let t=new Set;for(let n of e){let i=[],r=[{node:n,context:o}];for(;r.length>0;){let{node:s,context:a}=r.pop();s.namespaceUri===chunkWO4V6PNS_cjs.la&&s.localName==="p"&&i.push({paragraph:s,context:a});let p=s.namespaceUri===chunkWO4V6PNS_cjs.la&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let d=s.children.length-1;d>=0;d-=1){let u=s.children[d];u.kind!=="textValue"&&r.push({node:u,context:p});}}for(let s of i)Oo(s.paragraph,t,s.context);}return t}function Oo(e,o,t){let n=chunkDBOOTED4_cjs.Xb(),i=null,r=null,s="",a=false,p=false,d=false,u=0,m=[];for(let l=e.children.length-1;l>=0;l-=1){let c=e.children[l];c.kind!=="textValue"&&m.push({node:c,runId:null,visibility:k,containerDepth:0});}for(;m.length>0;){let{node:l,runId:c,visibility:h,containerDepth:E}=m.pop();if(E>=chunkWO4V6PNS_cjs.wa||l.namespaceUri===chunkWO4V6PNS_cjs.la&&l.localName==="p")continue;let R=l.namespaceUri===chunkWO4V6PNS_cjs.la&&l.localName==="r"?l.id:c;if(l.namespaceUri===chunkWO4V6PNS_cjs.la&&l.localName==="fldSimple"){let f=ce(l,"instr")??"";chunkDBOOTED4_cjs._c(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&vo(l)!==k&&o.add(l.id);}if(l.namespaceUri===chunkWO4V6PNS_cjs.la&&l.localName==="fldChar"){let f=ce(l,"fldCharType");if(f==="begin")chunkDBOOTED4_cjs._b(n),n.nesting===1&&(i=R,r=null,s="",a=false,p=false,d=chunkWO4V6PNS_cjs.Ef(l),u=0);else if(f==="separate"){let g=n.nesting===1;if(chunkDBOOTED4_cjs.ac(n),g){let x=chunkDBOOTED4_cjs.Zb(n);s=x.instruction,a=x.overflow||n.nestingOverflow,r=R,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=chunkDBOOTED4_cjs.Zb(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&chunkDBOOTED4_cjs.Zc(s,{hasSeparate:p,hasLegacyFormData:d,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&u!==k){let x=r??i;x&&o.add(x);}}chunkDBOOTED4_cjs.bc(n);}continue}if(l.namespaceUri===chunkWO4V6PNS_cjs.la&&(l.localName==="instrText"||l.localName==="delInstrText")){chunkDBOOTED4_cjs.$b(n,Nt(l),l.localName==="delInstrText");continue}n.nesting>0&&chunkDBOOTED4_cjs.cc(n)&&l.namespaceUri===chunkWO4V6PNS_cjs.la&&Dt(l)&&(u|=h);for(let f=l.children.length-1;f>=0;f-=1){let g=l.children[f];g.kind!=="textValue"&&m.push({node:g,runId:R,visibility:h&_t(l),containerDepth:chunkWO4V6PNS_cjs.xa(l,E)});}}chunkDBOOTED4_cjs.Yb(n);}function Dt(e){return e.localName==="t"||e.localName==="delText"?Nt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ue=1,kt=2,It=4,k=ue|kt|It;function vo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:k});let t=0;for(;o.length>0;){let{node:n,visibility:i}=o.pop();if(!(n.namespaceUri===chunkWO4V6PNS_cjs.la&&n.localName==="p")){if(n.namespaceUri===chunkWO4V6PNS_cjs.la&&Dt(n)&&(t|=i,t===k))return t;for(let r of n.children)r.kind!=="textValue"&&o.push({node:r,visibility:i&_t(n)});}}return t}function _t(e){return e.namespaceUri!==chunkWO4V6PNS_cjs.la?k:e.localName==="ins"||e.localName==="moveTo"?ue|kt:e.localName==="del"||e.localName==="moveFrom"?ue|It:k}function wo(e){let o=new Map,t=n=>{let i=chunkXSTGE3NI_cjs.b(n??void 0);if(i===null)return;let r=i.toLowerCase();o.has(r)||o.set(r,i);};for(let n of e){let i=[n];for(;i.length>0;){let r=i.pop();if(r.namespaceUri===Ro&&t(chunkDBOOTED4_cjs.bd),r.namespaceUri===chunkWO4V6PNS_cjs.la&&r.localName==="sym"&&t(chunkXSTGE3NI_cjs.c(yo(r,"font"))),r.localName==="textpath"&&t(chunkWO4V6PNS_cjs.pd(r)),r.namespaceUri===chunkWO4V6PNS_cjs.la&&r.localName==="fldSimple"){let s=ce(r,"instr");t(chunkDBOOTED4_cjs.Yc(s??"")?.font??null);}if(r.namespaceUri===chunkWO4V6PNS_cjs.la&&r.localName==="p")for(let s of chunkMOYYRVFV_cjs.u(r))t(s);for(let s=r.children.length-1;s>=0;s-=1){let a=r.children[s];a.kind!=="textValue"&&i.push(a);}}}return [...o.values()]}function Nt(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let i=n.children.length-1;i>=0;i-=1)t.push(n.children[i]);}return o}var Ut="FILE_TOO_LARGE",Mt=8;function Ao(e){return typeof e=="object"&&e!==null}function Bt(e){if(!(!Ao(e)||typeof e.code!="string"))return e.code}function qt(e){return e===""||e.toLowerCase()==="localhost"}function To(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function zt(e){let o=To(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function jt(e){let o=zt(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Lo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function Po(e){let o;try{o=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!qt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=jt(o.pathname);if(t===null||Lo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Do(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function ko(e){let o=Do(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>Mt)throw new TypeError(`trustedRoot must not exceed ${Mt} directories`);return o.map(Po)}function Io(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkDBOOTED4_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkDBOOTED4_cjs.a}`);return e}function _o(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!qt(e.host))return null;let t=zt(e.pathname);if(t===null)return null;for(let n of o){let i=jt(n.pathname);if(i===null||!t.startsWith(i)||t.length<=i.length)continue;let r=new URL("file:///");return r.pathname=t,r}return null}function No(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function Mo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function Ct(e,o,t){return e.some(n=>Mo(n,o,t))}async function Co(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(i){if(Bt(i)==="ENOENT")continue;throw i}return t}function Uo(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:i,realpath:r},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),d=e.map(h=>p.resolve(a(h.href))),u=p.resolve(a(typeof o=="string"?o:o.href));if(!Ct(d,u,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let m=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",l=await i(u,m),c=()=>{l.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let h=await r(u);if(!Ct(await Co(d,r),h,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let E=(await l.stat()).size;if(!Number.isSafeInteger(E)||E<0||E>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Ut});let R=new Uint8Array(E),f=0;for(;f<R.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:g}=await l.read(R,f,R.byteLength-f,f);if(g===0)break;f+=g;}if(t?.aborted)throw t.reason;return f===R.byteLength?R:R.slice(0,f)}catch(h){throw t?.aborted?t.reason:h}finally{t?.removeEventListener("abort",c),await l.close().catch(()=>{});}}}function Bo(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let o=ko(e.trustedRoot),t=Io(e.maxBytes),n=e.read??Uo(o),i=e.networkFetch??fetch;return(async(r,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=No(r);if(p.protocol!=="file:")return i(p,s);let d=_o(p,o);if(!d)return new Response(null,{status:404});let u=a?new AbortController:void 0,m=()=>u?.abort(a?.reason);a?.addEventListener("abort",m,{once:true});let l;try{if(l=await n(d,{maxBytes:t,...u?{signal:u.signal}:{}}),a?.aborted)throw a.reason;if(l.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(u?.signal.aborted)throw u.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let h=Bt(c);if(h===Ut)return new Response(null,{status:413});if(h==="ENOENT"||h==="ENOTDIR"||h==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",m);}return new Response(l,{status:200})})}
|
|
2
|
-
Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return
|
|
1
|
+
'use strict';var chunkE4IAO4CY_cjs=require('./chunk-E4IAO4CY.cjs'),chunk6NVZNB7O_cjs=require('./chunk-6NVZNB7O.cjs'),chunkTELQ52LG_cjs=require('./chunk-TELQ52LG.cjs'),chunkFDSL5OJU_cjs=require('./chunk-FDSL5OJU.cjs'),chunkXJYZVGQR_cjs=require('./chunk-XJYZVGQR.cjs');require('./chunk-OKMEMSKB.cjs'),require('./chunk-TJHE5EET.cjs');var chunk65XBN67F_cjs=require('./chunk-65XBN67F.cjs'),chunkZOZI27AW_cjs=require('./chunk-ZOZI27AW.cjs');function N(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},i=e.shape(n);if(t.glyphs.length!==i.glyphs.length||t.glyphs.some((l,c)=>l.id!==i.glyphs[c]?.id))return t;let r=[],s=0;for(let l of o.text){let c=l.toUpperCase()!==l,h=r.at(-1);h&&(h.lower===c||/\p{M}/u.test(l))?h.text+=l:r.push({text:l,start:s,lower:c}),s+=l.length;}let a=[],p=[],d=[],u=true,m=0;for(let l of o.environment.direction==="rtl"?r.reverse():r){let c=l.lower?.8:1,h=[],E=[],R="",f=l.start;for(let F of l.text){let y=l.lower?F.toUpperCase():F;for(let S=0;S<y.length;S++)h.push(f),E.push(f+F.length);R+=y,f+=F.length;}let g=e.shape({...n,text:R}),x=a.length;for(let[F,y]of g.glyphs.entries()){let S=g.exactAdvancesX?.[F];S===void 0?u=false:d.push(S*c),a.push({...y,cluster:h[y.cluster]??l.start,originX:chunkFDSL5OJU_cjs.n(m+Math.round(y.originX*c)),originY:chunkFDSL5OJU_cjs.n(Math.round(y.originY*c)),offsetX:chunkFDSL5OJU_cjs.n(Math.round(y.offsetX*c)),offsetY:chunkFDSL5OJU_cjs.n(Math.round(y.offsetY*c)),advanceX:chunkFDSL5OJU_cjs.n(Math.round(y.advanceX*c)),advanceY:chunkFDSL5OJU_cjs.n(Math.round(y.advanceY*c)),drawScale:c});}for(let F of g.clusters){let y=h[F.textStart]??l.start,S=E[F.textEnd-1]??f,b=chunkFDSL5OJU_cjs.n(Math.round(F.advance*c)),T=p.at(-1);T&&T.textStart===y&&T.textEnd===S?p[p.length-1]={...T,glyphEnd:x+F.glyphEnd,advance:chunkFDSL5OJU_cjs.n(T.advance+b),caretEdges:[chunkFDSL5OJU_cjs.n(0),chunkFDSL5OJU_cjs.n(T.advance+b)]}:p.push({...F,textStart:y,textEnd:S,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:b,caretEdges:F.caretEdges.map(V=>chunkFDSL5OJU_cjs.n(Math.round(V*c))),fontSpan:0});}m+=g.glyphs.reduce((F,y)=>F+Math.round(y.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:u&&d.length===a.length?d:void 0}}var ft=new WeakMap;function Gt(e){let o=ft.get(e);return o===void 0&&(o=Yt(e.bytes,e.faceIndex),ft.set(e,o)),o}var Vt=new Set(["COLR","CBDT","sbix"]),Wt=512;function Yt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(mt(e,0)==="ttcf"){let r=t.getUint32(8);if(o<0||o>=r||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let i=Math.min(t.getUint16(n+4),Wt);for(let r=0;r<i;r++){let s=n+12+r*16;if(s+4>e.byteLength)return false;if(Vt.has(mt(e,s)))return true}return false}function mt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var $t=/\p{Emoji_Presentation}|️/u;function Kt(e){return $t.test(e)}function z(e,o){if(e.length<2)return e;let t=e.filter(Gt);if(t.length===0||t.length===e.length)return e;let n=e.filter(i=>!t.includes(i));return Kt(o)?[...t,...n]:[...n,...t]}var Zt=2048;function yt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Zt)return null;let i=(f,g)=>{let{context:x,...F}=o,y={...F,text:g,environment:chunkFDSL5OJU_cjs.r({...o.environment,font:f})};return N(e,y,e.shape(y))},r=[],s=new Map;for(let f of [...t.clusters].sort((g,x)=>g.textStart-x.textStart)){let g=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=r.at(-1);if(/^[\uFE0E\uFE0F]$/.test(x)&&F&&F.end===f.textStart){F.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(x)&&F&&F.font!==o.environment.font&&F.end===f.textStart){F.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(S=>S.id===0)){let S=o.text.slice(f.textStart,f.textEnd+1),b=s.get(x)??z(n,S).find(T=>{try{return !i(T,x).glyphs.some(V=>V.id===0)}catch{return false}});if(!b)return null;s.set(x,b),g=b;}let y=r.at(-1);y&&y.font===g&&y.end===f.textStart?y.end=f.textEnd:r.push({start:f.textStart,end:f.textEnd,font:g});}let a=[],p=[],d=[],u=[],m=true,l=0,c=0,h=0,E=0,R=0;for(let f of o.environment.direction==="rtl"?r.reverse():r){let g=i(f.font,o.text.slice(f.start,f.end));if(g.glyphs.some(y=>y.id===0))return null;let x=a.length,F=d.length;for(let y of g.glyphs)a.push({...y,cluster:f.start+y.cluster,originX:chunkFDSL5OJU_cjs.n(l+y.originX),originY:chunkFDSL5OJU_cjs.n(c+y.originY)});if(g.exactAdvancesX===void 0)m=false;else for(let y of g.exactAdvancesX)u.push(y);for(let y of g.clusters)p.push({...y,textStart:f.start+y.textStart,textEnd:f.start+y.textEnd,glyphStart:x+y.glyphStart,glyphEnd:x+y.glyphEnd,fontSpan:F});g.glyphs.length&&d.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),l+=g.glyphs.reduce((y,S)=>y+S.advanceX,0),c+=g.glyphs.reduce((y,S)=>y+S.advanceY,0),h=Math.max(h,g.metrics.ascent),E=Math.max(E,g.metrics.descent),R=Math.max(R,g.metrics.lineGap);}return chunkFDSL5OJU_cjs.u({...t,glyphs:a,clusters:p,fontSpans:d,exactAdvancesX:m&&u.length===a.length?u:void 0,metrics:{ascent:chunkFDSL5OJU_cjs.n(h),descent:chunkFDSL5OJU_cjs.n(E),lineGap:chunkFDSL5OJU_cjs.n(R)}},{...o.environment,fallbackOrder:n})}var Jt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),Qt=512,ht=new WeakMap;function eo(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=c=>c+2<=n.byteLength?n.getUint16(c):-1,r=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=r(8);if(c<0||o<0||o>=c||(a=r(12+o*4),a<0))return t}let p=i(a+4);if(p<0||p>1024)return t;let d=-1;for(let c=0;c<p;c+=1){let h=a+12+c*16;if(s(h)==="GSUB"){d=r(h+8);break}}if(d<0)return t;let u=i(d+4);if(u<=0)return t;let m=d+u,l=i(m);if(l<0)return t;for(let c=0;c<Math.min(l,Qt);c+=1){let h=s(m+2+c*6);h&&t.add(h);}return t}function to(e,o){let t=ht.get(e);return t||(t=eo(e.bytes,e.faceIndex),ht.set(e,t)),(Jt.get(o)??[o.toLowerCase()]).some(i=>t.has(i))}function gt(e,o){let t=e.filter(n=>to(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function Q(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(r=>r.id===0).map(r=>r.cluster));if(!n.size)return t;let i=o.text.replace(/\u2011/g,(r,s)=>n.has(s)?"-":r);if(i===o.text)return t;try{let r=e.shape({...o,text:i});return chunkFDSL5OJU_cjs.u({...r,text:o.text},o.environment)}catch{return t}}function xt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof chunkFDSL5OJU_cjs.d)),n={shape(a){return Q(e.shaper,a,e.shaper.shape(a))}},i=new WeakMap,r={shape(a){let p=e.shaper.shape(a),d=i.get(p);if(d&&d.input.text===a.text&&d.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&d.input.bidiLevel===a.bidiLevel&&d.input.context?.before===a.context?.before&&d.input.context?.after===a.context?.after&&d.input.environment===a.environment)return d.run;let u=s(a,Q(e.shaper,a,p));return i.set(p,{input:a,run:u}),u}},s=(a,p)=>{let d=N(n,a,p);if(!d.glyphs.some(u=>u.id===0)||/^[\t\n\r\f]*$/.test(a.text))return d;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let u=yt(n,a,d,t);if(u)return u}for(let u of gt(z(t,a.text),a.environment.script))if(!(u.hash===a.environment.font.hash&&u.faceIndex===a.environment.font.faceIndex))try{let m={...a,environment:chunkFDSL5OJU_cjs.r({...a.environment,font:u})},l=N(n,m,n.shape(m));if(!l.glyphs.some(c=>c.id===0))return l}catch{}return d};return {...e,shaper:r}}var ee=chunkFDSL5OJU_cjs.b;function te(e){return typeof e.admittedFontFace=="function"}var oo=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function j(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var Ft=new WeakMap;function H(e){let o=Ft.get(e);return o||Ft.set(e,o=no(e)),o}function no(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:j(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:j(o.requested),resolved:j(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ro(e){return Object.freeze({...H(e),bytes:chunkFDSL5OJU_cjs.i(e)})}function io(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkFDSL5OJU_cjs.d?null:ro(t)}catch{return null}}function Et(e){return o=>{if(e.status()!=="active")throw e.unavailable();return io(e.resolve(),o)}}function ao(e){return Object.freeze(e.slice(0,ee).map(o=>Object.freeze({request:j(o.request),partName:o.partName,reason:o.reason})))}function oe(e,o,t,n,i=[],r=new Set){let s=new Map;for(let p of [...e,o]){let d=p.toLowerCase();s.has(d)||s.set(d,p);}let a=[...s.values()].map(p=>{let d=[];for(let m of oo){let l=n?.({family:p,...m});!l||l instanceof chunkFDSL5OJU_cjs.d||d.push(Object.freeze({...m,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}let u=r.has(p.trim().toLowerCase())?d.filter(m=>m.via==="direct").length:d.length;return Object.freeze({family:p,coverage:u===4?"complete":u>0?"partial":"none",faces:Object.freeze(d)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:ao(i)})}function ne(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function re(e,o,t=[]){let n=d=>d.trim().toLowerCase(),i=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),r=new Set(t.map(d=>n(d.family))),s=d=>{if(!(d instanceof chunkE4IAO4CY_cjs.l))return true;let u=n(d.request.family);return i.has(u)||!r.has(u)},a=e.originFailures.some(({cause:d})=>d instanceof chunkE4IAO4CY_cjs.m?d.causes.length===0||d.causes.some(s):s(d));if(o.fontPolicy!=="strict"||!a&&e.families.every(d=>d.coverage==="complete"))return;let p=e.families.filter(d=>d.coverage!=="complete").map(d=>d.family).join(", ");throw new chunkTELQ52LG_cjs.g("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function X(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let i={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},r=chunkFDSL5OJU_cjs.h(i),s=o.get(r);if(!s){try{s=e.fonts.resolve(i);}catch{return null}o.set(r,s);}return s instanceof chunkFDSL5OJU_cjs.d?null:s}function bt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function so(e){for(let o of e){let t=o.codePointAt(0);if(t!==32&&(t<=255||t>=61440&&t<=61695))return false}return true}function ae(e){let o=X(),t=new WeakMap;return n=>{let i=chunkFDSL5OJU_cjs.xa(n.style,n.fontSlot),r=chunkFDSL5OJU_cjs.pd(n)?chunkFDSL5OJU_cjs.qd(n):chunkFDSL5OJU_cjs.ea(n.text,i);if(r.length===0)return null;let s=i.fontFamily??e.defaultFont.family,a=G(e,o,s,i)??(chunkZOZI27AW_cjs.b(s)&&so(r)?G(e,o,e.defaultFont.family,i):null);if(!a)return null;try{if(i.smallCaps&&!chunk6NVZNB7O_cjs.ea(e.shaper,e.environment,a,i,t))return null;let p=chunk6NVZNB7O_cjs.da(e.shaper,e.environment,a,i,r);return Object.freeze({run:p,font:H(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(d=>H(d.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function Rt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var M=new Map,St=new WeakMap,se=0,C;var le=32,Ot=chunkFDSL5OJU_cjs.c;function vt(){if(C)return C;let e=(async()=>(await chunk6NVZNB7O_cjs.d(),chunk6NVZNB7O_cjs.h({...chunk6NVZNB7O_cjs.i,maxFontBytes:chunkFDSL5OJU_cjs.a})))();return C=e,e.catch(()=>{C===e&&(C=void 0);}),e}function wt(e){let o=X();return chunk6NVZNB7O_cjs.ga(e,{resolveFont(t){return bt(e,o,t)},fallback:chunkFDSL5OJU_cjs.ka()})}async function At(e,o,t=[],n=false,i){if(!chunk6NVZNB7O_cjs.m(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=chunk6NVZNB7O_cjs.k(i,chunk6NVZNB7O_cjs.i),s=await vt(),a=xt(await chunk6NVZNB7O_cjs.t(e,s,r,o,n),t);return Object.freeze({createMeasurer:()=>wt(a),resolveFont:p=>a.fonts.resolve(p),shapeLaidOutText:ae(a),producer:["node-export-session",JSON.stringify(t),e.fingerprint,a.operation.shapingHash,`producer:${a.operation.producerVersion}`,`fallback:${chunkFDSL5OJU_cjs.ja}`].join("|"),extensionFingerprint:e.fingerprint})}function lo(e,o,t){if(!chunk6NVZNB7O_cjs.m(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let n=chunk6NVZNB7O_cjs.k(t,chunk6NVZNB7O_cjs.i),i=chunk6NVZNB7O_cjs.j(n),r=St.get(e),s=r?.get(i);if(s)return s;let a=`${chunk6NVZNB7O_cjs.o(e)}|${i}`,p=M.get(a);if(!p){if(M.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));p=(async()=>{let l=chunk6NVZNB7O_cjs.n(e).sources.reduce((h,E)=>h+(E.availability==="forbidden"?0:E.bytes.byteLength),0);if(se+l>Ot)throw new RangeError(`Shared exporter shaping font bytes are limited to ${Ot} process-wide`);se+=l;let c;try{let h=await vt();c=await chunk6NVZNB7O_cjs.t(e,h,n,o);}catch(h){throw se-=l,h}return Object.freeze({createMeasurer:()=>wt(c),shapeLaidOutText:ae(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),M.set(a,p),p.catch(()=>{M.get(a)===p&&M.delete(a);});}let d=e.fingerprint,u=p.then(m=>Object.freeze({createMeasurer:m.createMeasurer,shapeLaidOutText:m.shapeLaidOutText,producer:["node-export",d,m.shapingHash,`producer:${m.producerVersion}`,`fallback:${chunkFDSL5OJU_cjs.ja}`].join("|"),extensionFingerprint:d}));return r||St.set(e,r=new Map),r.set(i,u),u.catch(()=>{r?.get(i)===u&&r.delete(i);}),u}var co="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function uo(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(i=>i.type===co),n;if(t){let i=chunkZOZI27AW_cjs.N(t);i.mode==="Internal"&&i.target.ok&&(n=o.parts.get(i.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkZOZI27AW_cjs.qf(o,n)}function Tt(e,o){let t=uo(e);if(t.length!==0)return chunkE4IAO4CY_cjs.j(n=>{let i=new Set((n.resolvedFaces??[]).map(s=>chunkFDSL5OJU_cjs.h(s))),r=chunkE4IAO4CY_cjs.E(t,{maxFontBytes:chunkFDSL5OJU_cjs.a,aggregateBudget:po(n),shadowedRequests:i});if(o)for(let s of r.dropped){if(o.dropped.length>=ee)break;o.dropped.push(s);}return {sources:r.sources}})}function po(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkFDSL5OJU_cjs.c:Math.max(0,chunkFDSL5OJU_cjs.c-o)}function fo(e){return te(e)&&ie(e)}var A=0,Lt=Symbol("font-resolution-timeout");function mo(e){let o=0,t=false;return e?.(A),{reserve:i=>{if(t)throw new Error("Document font-byte lease is already released");if(A+i>chunkFDSL5OJU_cjs.c)throw new chunkTELQ52LG_cjs.g("layoutFailed",`Active document export font bytes are limited to ${chunkFDSL5OJU_cjs.c}; requested ${i} bytes with ${A} bytes already active`);A+=i,o+=i,e?.(A);let r=false;return ()=>{r||t||(r=true,A-=i,o-=i,e?.(A));}},release:()=>{t||(t=true,A-=o,o=0,e?.(A));}}}function ce(e,o){return e.attributes.find(t=>t.localName===o)?.value}function yo(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunkZOZI27AW_cjs.pa||t.namespaceUri===""))?.value}async function ho(e,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=chunk65XBN67F_cjs.za(e);if(!t.ok)return t;let{fonts:n,lastResortFonts:i,fontResolutionTimeoutMs:r,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:d,fontShaping:u,...m}=o,l=Array.isArray(n)?n:[n],c=i===void 0?[]:Array.isArray(i)?i:[i],h,E;try{E=await go(t.view,l,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:d,fontShaping:u,lastResortFonts:c,onFontResolution:b=>(h=b,a?.(b))});}catch(b){if(b instanceof chunkTELQ52LG_cjs.g&&b.code==="aborted")return {ok:false,reason:"aborted"};throw b}if(!h)throw E?.dispose(),new chunkTELQ52LG_cjs.g("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=chunkTELQ52LG_cjs.h(t.view,{...m,reuseAcrossRevisions:!1,...E?{measurer:E.createMeasurer(),producer:o.producer??E.producer}:o.producer?{producer:o.producer}:{}});}catch(b){throw E?.dispose(),b}if(!R.ok)return E?.dispose(),R;let f=R.session,g=E,x="active",F=()=>x==="aborted"?new chunkTELQ52LG_cjs.g("aborted","Export resource settlement was aborted"):new chunkTELQ52LG_cjs.g("disposed","Export session has been disposed"),y=b=>{if(x==="active"){x=b,o.signal?.removeEventListener("abort",S);try{f.dispose();}finally{g?.dispose(),g=void 0;}}},S=()=>y("aborted");return o.signal?.addEventListener("abort",S,{once:true}),o.signal?.aborted&&S(),{ok:true,session:Object.freeze({fontResolution:h,layout:()=>x==="active"?f.layout():Promise.reject(F()),layoutFor:b=>x==="active"?f.layoutFor(b):Promise.reject(F()),validatedImageBytes:b=>x==="active"?f.validatedImageBytes(b):null,admittedFontFace:Et({status:()=>x,unavailable:F,resolve:()=>g?.resolveFont}),shapeLaidOutText:Rt({status:()=>x,unavailable:F,shaping:()=>g}),dispose:()=>y("disposed")})}}async function go(e,o,t={}){let n=chunk6NVZNB7O_cjs.k(t.fontShaping,chunk6NVZNB7O_cjs.i);if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let i=xo(t.timeoutMs),r=new AbortController,s=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",s,{once:true}),t.signal?.aborted&&s();let a=setTimeout(()=>r.abort(Lt),i);try{de(r.signal);let p=(async()=>{let d=mo(t.onActiveFontBytesChange),u=!1;try{let m=Eo(e).slice(0,chunkE4IAO4CY_cjs.c),l=chunkE4IAO4CY_cjs.x(e,m),c=[],h={dropped:[]},E=Tt(e,h),R=[...o,...E?[E]:[],...t.lastResortFonts??[]],f=await chunkE4IAO4CY_cjs.o(R,{families:[...new Set([...(t.glyphFallbacks??[]).map(b=>b.family),...l.families])].slice(0,chunkE4IAO4CY_cjs.c),defaultFamily:chunkE4IAO4CY_cjs.d.family,signal:r.signal},{onOriginFailure:b=>c.push(b),reserveOwnedBytes:d.reserve,maxExecutionFontBytes:n.maxFontBytes});de(r.signal);let g=chunkE4IAO4CY_cjs.f(f??{}),x=chunkE4IAO4CY_cjs.z(g,l),F=chunkE4IAO4CY_cjs.A(g,x,l);if(x.sources.length===0){let b=oe(m,x.defaultFont.family,c,void 0,h.dropped);ne(b,t),re(b,t,t.glyphFallbacks);return}let y=await At(chunk6NVZNB7O_cjs.q(x),void 0,t.glyphFallbacks,t.documentLigatures,{maxFontBytes:n.maxFontBytes});de(r.signal);let S=oe(m,x.defaultFont.family,c,y.resolveFont,h.dropped,F);return ne(S,t),re(S,t,t.glyphFallbacks),u=!0,Object.freeze({...y,dispose:d.release})}finally{u||d.release();}})();return await Promise.race([p,Fo(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",s);}}function xo(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function Fo(e){return new Promise((o,t)=>{let n=()=>{t(Pt(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function Pt(e){let o=e.reason===Lt;return new chunkTELQ52LG_cjs.g(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw Pt(e)}function Eo(e){let o=[e.part().root],t=[],n=[],i=new Set([e.part().name]),r=(u,m)=>{!m||i.has(m.name)||(i.add(m.name),u.push(m.root));};for(let u of e.headerFooterPartsBySection()){for(let m of u.headers.values())r(t,m);for(let m of u.footers.values())r(t,m);}for(let u of ["footnote","endnote"])n.push(...bo(e,u));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},p=new Map,d=(u,m)=>{let l=chunkXJYZVGQR_cjs.e(u,e.stylesRoot(),a,So(u,m)),c=chunkE4IAO4CY_cjs.v(u,e.numberingRoot(),e.stylesRoot(),a);for(let h of [...l.direct,...wo(u),...c,...chunkE4IAO4CY_cjs.s(u,e.stylesRoot(),a),...l.inherited]){let E=h.toLowerCase();p.has(E)||p.set(E,h);}};return d(o,"body"),d(t,"furniture"),d(n,"note"),[...p.values()]}function bo(e,o){let t=chunkZOZI27AW_cjs.qh(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkZOZI27AW_cjs.rh(e.part()).filter(r=>r.noteKind===o).map(r=>r.noteId)),i=[];for(let r of t.root.children){if(r.kind==="textValue")continue;let s=chunkZOZI27AW_cjs.Dc(r),a=chunkZOZI27AW_cjs.Cc(r);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&i.push(r);}return i}var Ro="http://schemas.openxmlformats.org/officeDocument/2006/math";function So(e,o){let t=new Set;for(let n of e){let i=[],r=[{node:n,context:o}];for(;r.length>0;){let{node:s,context:a}=r.pop();s.namespaceUri===chunkZOZI27AW_cjs.pa&&s.localName==="p"&&i.push({paragraph:s,context:a});let p=s.namespaceUri===chunkZOZI27AW_cjs.pa&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let d=s.children.length-1;d>=0;d-=1){let u=s.children[d];u.kind!=="textValue"&&r.push({node:u,context:p});}}for(let s of i)Oo(s.paragraph,t,s.context);}return t}function Oo(e,o,t){let n=chunkFDSL5OJU_cjs.ac(),i=null,r=null,s="",a=false,p=false,d=false,u=0,m=[];for(let l=e.children.length-1;l>=0;l-=1){let c=e.children[l];c.kind!=="textValue"&&m.push({node:c,runId:null,visibility:k,containerDepth:0});}for(;m.length>0;){let{node:l,runId:c,visibility:h,containerDepth:E}=m.pop();if(E>=chunkZOZI27AW_cjs.Aa||l.namespaceUri===chunkZOZI27AW_cjs.pa&&l.localName==="p")continue;let R=l.namespaceUri===chunkZOZI27AW_cjs.pa&&l.localName==="r"?l.id:c;if(l.namespaceUri===chunkZOZI27AW_cjs.pa&&l.localName==="fldSimple"){let f=ce(l,"instr")??"";chunkFDSL5OJU_cjs.gd(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&vo(l)!==k&&o.add(l.id);}if(l.namespaceUri===chunkZOZI27AW_cjs.pa&&l.localName==="fldChar"){let f=ce(l,"fldCharType");if(f==="begin")chunkFDSL5OJU_cjs.dc(n),n.nesting===1&&(i=R,r=null,s="",a=false,p=false,d=chunkZOZI27AW_cjs.Jf(l),u=0);else if(f==="separate"){let g=n.nesting===1;if(chunkFDSL5OJU_cjs.fc(n),g){let x=chunkFDSL5OJU_cjs.cc(n);s=x.instruction,a=x.overflow||n.nestingOverflow,r=R,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=chunkFDSL5OJU_cjs.cc(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&chunkFDSL5OJU_cjs.fd(s,{hasSeparate:p,hasLegacyFormData:d,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&u!==k){let x=r??i;x&&o.add(x);}}chunkFDSL5OJU_cjs.gc(n);}continue}if(l.namespaceUri===chunkZOZI27AW_cjs.pa&&(l.localName==="instrText"||l.localName==="delInstrText")){chunkFDSL5OJU_cjs.ec(n,Nt(l),l.localName==="delInstrText");continue}n.nesting>0&&chunkFDSL5OJU_cjs.hc(n)&&l.namespaceUri===chunkZOZI27AW_cjs.pa&&Dt(l)&&(u|=h);for(let f=l.children.length-1;f>=0;f-=1){let g=l.children[f];g.kind!=="textValue"&&m.push({node:g,runId:R,visibility:h&_t(l),containerDepth:chunkZOZI27AW_cjs.Ba(l,E)});}}chunkFDSL5OJU_cjs.bc(n);}function Dt(e){return e.localName==="t"||e.localName==="delText"?Nt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ue=1,kt=2,It=4,k=ue|kt|It;function vo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:k});let t=0;for(;o.length>0;){let{node:n,visibility:i}=o.pop();if(!(n.namespaceUri===chunkZOZI27AW_cjs.pa&&n.localName==="p")){if(n.namespaceUri===chunkZOZI27AW_cjs.pa&&Dt(n)&&(t|=i,t===k))return t;for(let r of n.children)r.kind!=="textValue"&&o.push({node:r,visibility:i&_t(n)});}}return t}function _t(e){return e.namespaceUri!==chunkZOZI27AW_cjs.pa?k:e.localName==="ins"||e.localName==="moveTo"?ue|kt:e.localName==="del"||e.localName==="moveFrom"?ue|It:k}function wo(e){let o=new Map,t=n=>{let i=chunkXJYZVGQR_cjs.b(n??void 0);if(i===null)return;let r=i.toLowerCase();o.has(r)||o.set(r,i);};for(let n of e){let i=[n];for(;i.length>0;){let r=i.pop();if(r.namespaceUri===Ro&&t(chunkFDSL5OJU_cjs.kd),r.namespaceUri===chunkZOZI27AW_cjs.pa&&r.localName==="sym"&&t(chunkXJYZVGQR_cjs.c(yo(r,"font"))),r.localName==="textpath"&&t(chunkZOZI27AW_cjs.ud(r)),r.namespaceUri===chunkZOZI27AW_cjs.pa&&r.localName==="fldSimple"){let s=ce(r,"instr");t(chunkFDSL5OJU_cjs.ed(s??"")?.font??null);}if(r.namespaceUri===chunkZOZI27AW_cjs.pa&&r.localName==="p")for(let s of chunkE4IAO4CY_cjs.u(r))t(s);for(let s=r.children.length-1;s>=0;s-=1){let a=r.children[s];a.kind!=="textValue"&&i.push(a);}}}return [...o.values()]}function Nt(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let i=n.children.length-1;i>=0;i-=1)t.push(n.children[i]);}return o}var Ut="FILE_TOO_LARGE",Mt=8;function Ao(e){return typeof e=="object"&&e!==null}function Bt(e){if(!(!Ao(e)||typeof e.code!="string"))return e.code}function qt(e){return e===""||e.toLowerCase()==="localhost"}function To(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function zt(e){let o=To(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function jt(e){let o=zt(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Lo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function Po(e){let o;try{o=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!qt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=jt(o.pathname);if(t===null||Lo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Do(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function ko(e){let o=Do(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>Mt)throw new TypeError(`trustedRoot must not exceed ${Mt} directories`);return o.map(Po)}function Io(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkFDSL5OJU_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkFDSL5OJU_cjs.a}`);return e}function _o(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!qt(e.host))return null;let t=zt(e.pathname);if(t===null)return null;for(let n of o){let i=jt(n.pathname);if(i===null||!t.startsWith(i)||t.length<=i.length)continue;let r=new URL("file:///");return r.pathname=t,r}return null}function No(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function Mo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function Ct(e,o,t){return e.some(n=>Mo(n,o,t))}async function Co(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(i){if(Bt(i)==="ENOENT")continue;throw i}return t}function Uo(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:i,realpath:r},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),d=e.map(h=>p.resolve(a(h.href))),u=p.resolve(a(typeof o=="string"?o:o.href));if(!Ct(d,u,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let m=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",l=await i(u,m),c=()=>{l.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let h=await r(u);if(!Ct(await Co(d,r),h,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let E=(await l.stat()).size;if(!Number.isSafeInteger(E)||E<0||E>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Ut});let R=new Uint8Array(E),f=0;for(;f<R.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:g}=await l.read(R,f,R.byteLength-f,f);if(g===0)break;f+=g;}if(t?.aborted)throw t.reason;return f===R.byteLength?R:R.slice(0,f)}catch(h){throw t?.aborted?t.reason:h}finally{t?.removeEventListener("abort",c),await l.close().catch(()=>{});}}}function Bo(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let o=ko(e.trustedRoot),t=Io(e.maxBytes),n=e.read??Uo(o),i=e.networkFetch??fetch;return(async(r,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=No(r);if(p.protocol!=="file:")return i(p,s);let d=_o(p,o);if(!d)return new Response(null,{status:404});let u=a?new AbortController:void 0,m=()=>u?.abort(a?.reason);a?.addEventListener("abort",m,{once:true});let l;try{if(l=await n(d,{maxBytes:t,...u?{signal:u.signal}:{}}),a?.aborted)throw a.reason;if(l.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(u?.signal.aborted)throw u.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let h=Bt(c);if(h===Ut)return new Response(null,{status:413});if(h==="ENOENT"||h==="ENOTDIR"||h==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",m);}return new Response(l,{status:200})})}
|
|
2
|
+
Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunkTELQ52LG_cjs.g}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunkTELQ52LG_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunkTELQ52LG_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunkTELQ52LG_cjs.h}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=le;exports.acquireSharedExportShaping=lo;exports.createPackagedFileFetch=Bo;exports.hasExportAdmittedFont=te;exports.hasExportLaidOutText=ie;exports.hasFontBackedExportCapabilities=fo;exports.openFontBackedDocumentForExport=ho;
|
package/dist/export.d.ts
CHANGED
|
@@ -7,22 +7,16 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { a as ReviewDisplayMode, d as ResolvedRevisionMarkup, k as RevisionMarkupOptions } from './revision-projection-Cn6rZJ7H.js';
|
|
11
|
+
import { aj as PreservedImageMime, ae as ImageResourceLimits, an as SupportedImageMime, ad as ImageDecodePort } from './tree-op-types-C_S2niXW.js';
|
|
12
|
+
import { S as SemanticLayout, p as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, q as ListMarkerPictureRecord, T as TextMeasurer, o as FontRequest, r as FontSubstitution, s as ShapedRun, g as StyleSpanRecord } from './semantic-records-BvN-WWst.js';
|
|
13
|
+
import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-Bcz9_Qva.js';
|
|
13
14
|
import { F as FontShapingOptions } from './font-shaping-policy-BvpkrfxM.js';
|
|
14
|
-
import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-
|
|
15
|
-
import { e as FontOriginFailure, d as FontOrigin } from './font-resolver-
|
|
16
|
-
import './
|
|
17
|
-
import './
|
|
18
|
-
import './
|
|
19
|
-
import './editor-B2ShlO23.js';
|
|
20
|
-
import './diagnostic-hints-C9JlLz1L.js';
|
|
21
|
-
import './failure-NS2lsya4.js';
|
|
22
|
-
import './contracts/document.js';
|
|
23
|
-
import './contracts/interaction.js';
|
|
24
|
-
import './semantic-interaction-dApRIYpt.js';
|
|
25
|
-
import './document-protection-C8x3P2J6.js';
|
|
15
|
+
import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-E5J4Z1Gf.js';
|
|
16
|
+
import { e as FontOriginFailure, d as FontOrigin } from './font-resolver-BlQNGdvR.js';
|
|
17
|
+
import './editor-scope-B3L-1ALc.js';
|
|
18
|
+
import './tree-package-store-CRHvMyNj.js';
|
|
19
|
+
import './editor-fonts-D_-vjuJi.js';
|
|
26
20
|
|
|
27
21
|
/** Source content that cannot be certified by the layout snapshot. @public */
|
|
28
22
|
interface ExportContentWarning {
|
package/dist/export.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {c as c$1,x,o,d as d$1,f,z as z$1,A as A$1,v,s as s$1,j as j$2,E,m as m$1,u,l as l$1}from'./chunk-HZ66UCIS.js';import {l,j as j$1,h,i,n,m,s,p,c as c$2,g,da as da$1,ca,fa}from'./chunk-FNNOJNGY.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-SUEXVBPR.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-SUEXVBPR.js';import {c,ia,a,wa,gd,hd,da,ja,h as h$1,d as d$2,Yc,b as b$1,i as i$1,Xb,_c,_b,ac,Zb,Zc,bc,$b,cc,Yb,r,u as u$1,n as n$1,bd}from'./chunk-4S24UOPG.js';import {e as e$1,c as c$3,b as b$2}from'./chunk-2E2RPEKX.js';import'./chunk-VWIJKH4A.js';import {Ca}from'./chunk-Q5K2GGNG.js';import {lh,mh,zc,yc,b,la,pd,J,lf,wa as wa$1,Ef,xa}from'./chunk-T2QQHG5C.js';function N(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},i=e.shape(n);if(t.glyphs.length!==i.glyphs.length||t.glyphs.some((l,c)=>l.id!==i.glyphs[c]?.id))return t;let r=[],s=0;for(let l of o.text){let c=l.toUpperCase()!==l,h=r.at(-1);h&&(h.lower===c||/\p{M}/u.test(l))?h.text+=l:r.push({text:l,start:s,lower:c}),s+=l.length;}let a=[],p=[],d=[],u=true,m=0;for(let l of o.environment.direction==="rtl"?r.reverse():r){let c=l.lower?.8:1,h=[],E=[],R="",f=l.start;for(let F of l.text){let y=l.lower?F.toUpperCase():F;for(let S=0;S<y.length;S++)h.push(f),E.push(f+F.length);R+=y,f+=F.length;}let g=e.shape({...n,text:R}),x=a.length;for(let[F,y]of g.glyphs.entries()){let S=g.exactAdvancesX?.[F];S===void 0?u=false:d.push(S*c),a.push({...y,cluster:h[y.cluster]??l.start,originX:n$1(m+Math.round(y.originX*c)),originY:n$1(Math.round(y.originY*c)),offsetX:n$1(Math.round(y.offsetX*c)),offsetY:n$1(Math.round(y.offsetY*c)),advanceX:n$1(Math.round(y.advanceX*c)),advanceY:n$1(Math.round(y.advanceY*c)),drawScale:c});}for(let F of g.clusters){let y=h[F.textStart]??l.start,S=E[F.textEnd-1]??f,b=n$1(Math.round(F.advance*c)),T=p.at(-1);T&&T.textStart===y&&T.textEnd===S?p[p.length-1]={...T,glyphEnd:x+F.glyphEnd,advance:n$1(T.advance+b),caretEdges:[n$1(0),n$1(T.advance+b)]}:p.push({...F,textStart:y,textEnd:S,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:b,caretEdges:F.caretEdges.map(V=>n$1(Math.round(V*c))),fontSpan:0});}m+=g.glyphs.reduce((F,y)=>F+Math.round(y.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:u&&d.length===a.length?d:void 0}}var ft=new WeakMap;function Gt(e){let o=ft.get(e);return o===void 0&&(o=Yt(e.bytes,e.faceIndex),ft.set(e,o)),o}var Vt=new Set(["COLR","CBDT","sbix"]),Wt=512;function Yt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(mt(e,0)==="ttcf"){let r=t.getUint32(8);if(o<0||o>=r||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let i=Math.min(t.getUint16(n+4),Wt);for(let r=0;r<i;r++){let s=n+12+r*16;if(s+4>e.byteLength)return false;if(Vt.has(mt(e,s)))return true}return false}function mt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var $t=/\p{Emoji_Presentation}|️/u;function Kt(e){return $t.test(e)}function z(e,o){if(e.length<2)return e;let t=e.filter(Gt);if(t.length===0||t.length===e.length)return e;let n=e.filter(i=>!t.includes(i));return Kt(o)?[...t,...n]:[...n,...t]}var Zt=2048;function yt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Zt)return null;let i=(f,g)=>{let{context:x,...F}=o,y={...F,text:g,environment:r({...o.environment,font:f})};return N(e,y,e.shape(y))},r$1=[],s=new Map;for(let f of [...t.clusters].sort((g,x)=>g.textStart-x.textStart)){let g=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=r$1.at(-1);if(/^[\uFE0E\uFE0F]$/.test(x)&&F&&F.end===f.textStart){F.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(x)&&F&&F.font!==o.environment.font&&F.end===f.textStart){F.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(S=>S.id===0)){let S=o.text.slice(f.textStart,f.textEnd+1),b=s.get(x)??z(n,S).find(T=>{try{return !i(T,x).glyphs.some(V=>V.id===0)}catch{return false}});if(!b)return null;s.set(x,b),g=b;}let y=r$1.at(-1);y&&y.font===g&&y.end===f.textStart?y.end=f.textEnd:r$1.push({start:f.textStart,end:f.textEnd,font:g});}let a=[],p=[],d=[],u=[],m=true,l=0,c=0,h=0,E=0,R=0;for(let f of o.environment.direction==="rtl"?r$1.reverse():r$1){let g=i(f.font,o.text.slice(f.start,f.end));if(g.glyphs.some(y=>y.id===0))return null;let x=a.length,F=d.length;for(let y of g.glyphs)a.push({...y,cluster:f.start+y.cluster,originX:n$1(l+y.originX),originY:n$1(c+y.originY)});if(g.exactAdvancesX===void 0)m=false;else for(let y of g.exactAdvancesX)u.push(y);for(let y of g.clusters)p.push({...y,textStart:f.start+y.textStart,textEnd:f.start+y.textEnd,glyphStart:x+y.glyphStart,glyphEnd:x+y.glyphEnd,fontSpan:F});g.glyphs.length&&d.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),l+=g.glyphs.reduce((y,S)=>y+S.advanceX,0),c+=g.glyphs.reduce((y,S)=>y+S.advanceY,0),h=Math.max(h,g.metrics.ascent),E=Math.max(E,g.metrics.descent),R=Math.max(R,g.metrics.lineGap);}return u$1({...t,glyphs:a,clusters:p,fontSpans:d,exactAdvancesX:m&&u.length===a.length?u:void 0,metrics:{ascent:n$1(h),descent:n$1(E),lineGap:n$1(R)}},{...o.environment,fallbackOrder:n})}var Jt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),Qt=512,ht=new WeakMap;function eo(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=c=>c+2<=n.byteLength?n.getUint16(c):-1,r=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=r(8);if(c<0||o<0||o>=c||(a=r(12+o*4),a<0))return t}let p=i(a+4);if(p<0||p>1024)return t;let d=-1;for(let c=0;c<p;c+=1){let h=a+12+c*16;if(s(h)==="GSUB"){d=r(h+8);break}}if(d<0)return t;let u=i(d+4);if(u<=0)return t;let m=d+u,l=i(m);if(l<0)return t;for(let c=0;c<Math.min(l,Qt);c+=1){let h=s(m+2+c*6);h&&t.add(h);}return t}function to(e,o){let t=ht.get(e);return t||(t=eo(e.bytes,e.faceIndex),ht.set(e,t)),(Jt.get(o)??[o.toLowerCase()]).some(i=>t.has(i))}function gt(e,o){let t=e.filter(n=>to(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function Q(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(r=>r.id===0).map(r=>r.cluster));if(!n.size)return t;let i=o.text.replace(/\u2011/g,(r,s)=>n.has(s)?"-":r);if(i===o.text)return t;try{let r=e.shape({...o,text:i});return u$1({...r,text:o.text},o.environment)}catch{return t}}function xt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof d$2)),n={shape(a){return Q(e.shaper,a,e.shaper.shape(a))}},i=new WeakMap,r$1={shape(a){let p=e.shaper.shape(a),d=i.get(p);if(d&&d.input.text===a.text&&d.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&d.input.bidiLevel===a.bidiLevel&&d.input.context?.before===a.context?.before&&d.input.context?.after===a.context?.after&&d.input.environment===a.environment)return d.run;let u=s(a,Q(e.shaper,a,p));return i.set(p,{input:a,run:u}),u}},s=(a,p)=>{let d=N(n,a,p);if(!d.glyphs.some(u=>u.id===0)||/^[\t\n\r\f]*$/.test(a.text))return d;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let u=yt(n,a,d,t);if(u)return u}for(let u of gt(z(t,a.text),a.environment.script))if(!(u.hash===a.environment.font.hash&&u.faceIndex===a.environment.font.faceIndex))try{let m={...a,environment:r({...a.environment,font:u})},l=N(n,m,n.shape(m));if(!l.glyphs.some(c=>c.id===0))return l}catch{}return d};return {...e,shaper:r$1}}var ee=b$1;function te(e){return typeof e.admittedFontFace=="function"}var oo=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function j(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var Ft=new WeakMap;function H(e){let o=Ft.get(e);return o||Ft.set(e,o=no(e)),o}function no(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:j(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:j(o.requested),resolved:j(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ro(e){return Object.freeze({...H(e),bytes:i$1(e)})}function io(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$2?null:ro(t)}catch{return null}}function Et(e){return o=>{if(e.status()!=="active")throw e.unavailable();return io(e.resolve(),o)}}function ao(e){return Object.freeze(e.slice(0,ee).map(o=>Object.freeze({request:j(o.request),partName:o.partName,reason:o.reason})))}function oe(e,o,t,n,i=[],r=new Set){let s=new Map;for(let p of [...e,o]){let d=p.toLowerCase();s.has(d)||s.set(d,p);}let a=[...s.values()].map(p=>{let d=[];for(let m of oo){let l=n?.({family:p,...m});!l||l instanceof d$2||d.push(Object.freeze({...m,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}let u=r.has(p.trim().toLowerCase())?d.filter(m=>m.via==="direct").length:d.length;return Object.freeze({family:p,coverage:u===4?"complete":u>0?"partial":"none",faces:Object.freeze(d)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:ao(i)})}function ne(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function re(e,o,t=[]){let n=d=>d.trim().toLowerCase(),i=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),r=new Set(t.map(d=>n(d.family))),s=d=>{if(!(d instanceof l$1))return true;let u=n(d.request.family);return i.has(u)||!r.has(u)},a=e.originFailures.some(({cause:d})=>d instanceof m$1?d.causes.length===0||d.causes.some(s):s(d));if(o.fontPolicy!=="strict"||!a&&e.families.every(d=>d.coverage==="complete"))return;let p=e.families.filter(d=>d.coverage!=="complete").map(d=>d.family).join(", ");throw new d("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function X(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let i={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},r=h$1(i),s=o.get(r);if(!s){try{s=e.fonts.resolve(i);}catch{return null}o.set(r,s);}return s instanceof d$2?null:s}function bt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function so(e){for(let o of e){let t=o.codePointAt(0);if(t!==32&&(t<=255||t>=61440&&t<=61695))return false}return true}function ae(e){let o=X(),t=new WeakMap;return n=>{let i=wa(n.style,n.fontSlot),r=gd(n)?hd(n):da(n.text,i);if(r.length===0)return null;let s=i.fontFamily??e.defaultFont.family,a=G(e,o,s,i)??(b(s)&&so(r)?G(e,o,e.defaultFont.family,i):null);if(!a)return null;try{if(i.smallCaps&&!da$1(e.shaper,e.environment,a,i,t))return null;let p=ca(e.shaper,e.environment,a,i,r);return Object.freeze({run:p,font:H(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(d=>H(d.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function Rt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var M=new Map,St=new WeakMap,se=0,C;var le=32,Ot=c;function vt(){if(C)return C;let e=(async()=>(await c$2(),g({...h,maxFontBytes:a})))();return C=e,e.catch(()=>{C===e&&(C=void 0);}),e}function wt(e){let o=X();return fa(e,{resolveFont(t){return bt(e,o,t)},fallback:ja()})}async function At(e,o,t=[],n=false,i){if(!l(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=j$1(i,h),s$1=await vt(),a=xt(await s(e,s$1,r,o,n),t);return Object.freeze({createMeasurer:()=>wt(a),resolveFont:p=>a.fonts.resolve(p),shapeLaidOutText:ae(a),producer:["node-export-session",JSON.stringify(t),e.fingerprint,a.operation.shapingHash,`producer:${a.operation.producerVersion}`,`fallback:${ia}`].join("|"),extensionFingerprint:e.fingerprint})}function lo(e,o,t){if(!l(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let n$1=j$1(t,h),i$1=i(n$1),r=St.get(e),s$1=r?.get(i$1);if(s$1)return s$1;let a=`${n(e)}|${i$1}`,p=M.get(a);if(!p){if(M.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));p=(async()=>{let l=m(e).sources.reduce((h,E)=>h+(E.availability==="forbidden"?0:E.bytes.byteLength),0);if(se+l>Ot)throw new RangeError(`Shared exporter shaping font bytes are limited to ${Ot} process-wide`);se+=l;let c;try{let h=await vt();c=await s(e,h,n$1,o);}catch(h){throw se-=l,h}return Object.freeze({createMeasurer:()=>wt(c),shapeLaidOutText:ae(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),M.set(a,p),p.catch(()=>{M.get(a)===p&&M.delete(a);});}let d=e.fingerprint,u=p.then(m=>Object.freeze({createMeasurer:m.createMeasurer,shapeLaidOutText:m.shapeLaidOutText,producer:["node-export",d,m.shapingHash,`producer:${m.producerVersion}`,`fallback:${ia}`].join("|"),extensionFingerprint:d}));return r||St.set(e,r=new Map),r.set(i$1,u),u.catch(()=>{r?.get(i$1)===u&&r.delete(i$1);}),u}var co="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function uo(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(i=>i.type===co),n;if(t){let i=J(t);i.mode==="Internal"&&i.target.ok&&(n=o.parts.get(i.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),lf(o,n)}function Tt(e,o){let t=uo(e);if(t.length!==0)return j$2(n=>{let i=new Set((n.resolvedFaces??[]).map(s=>h$1(s))),r=E(t,{maxFontBytes:a,aggregateBudget:po(n),shadowedRequests:i});if(o)for(let s of r.dropped){if(o.dropped.length>=ee)break;o.dropped.push(s);}return {sources:r.sources}})}function po(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,c-o)}function fo(e){return te(e)&&ie(e)}var A=0,Lt=Symbol("font-resolution-timeout");function mo(e){let o=0,t=false;return e?.(A),{reserve:i=>{if(t)throw new Error("Document font-byte lease is already released");if(A+i>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${i} bytes with ${A} bytes already active`);A+=i,o+=i,e?.(A);let r=false;return ()=>{r||t||(r=true,A-=i,o-=i,e?.(A));}},release:()=>{t||(t=true,A-=o,o=0,e?.(A));}}}function ce(e,o){return e.attributes.find(t=>t.localName===o)?.value}function yo(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===la||t.namespaceUri===""))?.value}async function ho(e$1,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=Ca(e$1);if(!t.ok)return t;let{fonts:n,lastResortFonts:i,fontResolutionTimeoutMs:r,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:d$1,fontShaping:u,...m}=o,l=Array.isArray(n)?n:[n],c=i===void 0?[]:Array.isArray(i)?i:[i],h,E;try{E=await go(t.view,l,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:d$1,fontShaping:u,lastResortFonts:c,onFontResolution:b=>(h=b,a?.(b))});}catch(b){if(b instanceof d&&b.code==="aborted")return {ok:false,reason:"aborted"};throw b}if(!h)throw E?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=e(t.view,{...m,reuseAcrossRevisions:!1,...E?{measurer:E.createMeasurer(),producer:o.producer??E.producer}:o.producer?{producer:o.producer}:{}});}catch(b){throw E?.dispose(),b}if(!R.ok)return E?.dispose(),R;let f=R.session,g=E,x="active",F=()=>x==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),y=b=>{if(x==="active"){x=b,o.signal?.removeEventListener("abort",S);try{f.dispose();}finally{g?.dispose(),g=void 0;}}},S=()=>y("aborted");return o.signal?.addEventListener("abort",S,{once:true}),o.signal?.aborted&&S(),{ok:true,session:Object.freeze({fontResolution:h,layout:()=>x==="active"?f.layout():Promise.reject(F()),layoutFor:b=>x==="active"?f.layoutFor(b):Promise.reject(F()),validatedImageBytes:b=>x==="active"?f.validatedImageBytes(b):null,admittedFontFace:Et({status:()=>x,unavailable:F,resolve:()=>g?.resolveFont}),shapeLaidOutText:Rt({status:()=>x,unavailable:F,shaping:()=>g}),dispose:()=>y("disposed")})}}async function go(e,o$1,t={}){let n=j$1(t.fontShaping,h);if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let i=xo(t.timeoutMs),r=new AbortController,s=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",s,{once:true}),t.signal?.aborted&&s();let a=setTimeout(()=>r.abort(Lt),i);try{de(r.signal);let p$1=(async()=>{let d=mo(t.onActiveFontBytesChange),u=!1;try{let m=Eo(e).slice(0,c$1),l=x(e,m),c=[],h={dropped:[]},E=Tt(e,h),R=[...o$1,...E?[E]:[],...t.lastResortFonts??[]],f$1=await o(R,{families:[...new Set([...(t.glyphFallbacks??[]).map(b=>b.family),...l.families])].slice(0,c$1),defaultFamily:d$1.family,signal:r.signal},{onOriginFailure:b=>c.push(b),reserveOwnedBytes:d.reserve,maxExecutionFontBytes:n.maxFontBytes});de(r.signal);let g=f(f$1??{}),x$1=z$1(g,l),F=A$1(g,x$1,l);if(x$1.sources.length===0){let b=oe(m,x$1.defaultFont.family,c,void 0,h.dropped);ne(b,t),re(b,t,t.glyphFallbacks);return}let y=await At(p(x$1),void 0,t.glyphFallbacks,t.documentLigatures,{maxFontBytes:n.maxFontBytes});de(r.signal);let S=oe(m,x$1.defaultFont.family,c,y.resolveFont,h.dropped,F);return ne(S,t),re(S,t,t.glyphFallbacks),u=!0,Object.freeze({...y,dispose:d.release})}finally{u||d.release();}})();return await Promise.race([p$1,Fo(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",s);}}function xo(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function Fo(e){return new Promise((o,t)=>{let n=()=>{t(Pt(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function Pt(e){let o=e.reason===Lt;return new d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw Pt(e)}function Eo(e){let o=[e.part().root],t=[],n=[],i=new Set([e.part().name]),r=(u,m)=>{!m||i.has(m.name)||(i.add(m.name),u.push(m.root));};for(let u of e.headerFooterPartsBySection()){for(let m of u.headers.values())r(t,m);for(let m of u.footers.values())r(t,m);}for(let u of ["footnote","endnote"])n.push(...bo(e,u));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},p=new Map,d=(u,m)=>{let l=e$1(u,e.stylesRoot(),a,So(u,m)),c=v(u,e.numberingRoot(),e.stylesRoot(),a);for(let h of [...l.direct,...wo(u),...c,...s$1(u,e.stylesRoot(),a),...l.inherited]){let E=h.toLowerCase();p.has(E)||p.set(E,h);}};return d(o,"body"),d(t,"furniture"),d(n,"note"),[...p.values()]}function bo(e,o){let t=lh(e.currentPackage(),o);if(!t)return [];let n=new Set(mh(e.part()).filter(r=>r.noteKind===o).map(r=>r.noteId)),i=[];for(let r of t.root.children){if(r.kind==="textValue")continue;let s=zc(r),a=yc(r);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&i.push(r);}return i}var Ro="http://schemas.openxmlformats.org/officeDocument/2006/math";function So(e,o){let t=new Set;for(let n of e){let i=[],r=[{node:n,context:o}];for(;r.length>0;){let{node:s,context:a}=r.pop();s.namespaceUri===la&&s.localName==="p"&&i.push({paragraph:s,context:a});let p=s.namespaceUri===la&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let d=s.children.length-1;d>=0;d-=1){let u=s.children[d];u.kind!=="textValue"&&r.push({node:u,context:p});}}for(let s of i)Oo(s.paragraph,t,s.context);}return t}function Oo(e,o,t){let n=Xb(),i=null,r=null,s="",a=false,p=false,d=false,u=0,m=[];for(let l=e.children.length-1;l>=0;l-=1){let c=e.children[l];c.kind!=="textValue"&&m.push({node:c,runId:null,visibility:k,containerDepth:0});}for(;m.length>0;){let{node:l,runId:c,visibility:h,containerDepth:E}=m.pop();if(E>=wa$1||l.namespaceUri===la&&l.localName==="p")continue;let R=l.namespaceUri===la&&l.localName==="r"?l.id:c;if(l.namespaceUri===la&&l.localName==="fldSimple"){let f=ce(l,"instr")??"";_c(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&vo(l)!==k&&o.add(l.id);}if(l.namespaceUri===la&&l.localName==="fldChar"){let f=ce(l,"fldCharType");if(f==="begin")_b(n),n.nesting===1&&(i=R,r=null,s="",a=false,p=false,d=Ef(l),u=0);else if(f==="separate"){let g=n.nesting===1;if(ac(n),g){let x=Zb(n);s=x.instruction,a=x.overflow||n.nestingOverflow,r=R,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=Zb(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&Zc(s,{hasSeparate:p,hasLegacyFormData:d,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&u!==k){let x=r??i;x&&o.add(x);}}bc(n);}continue}if(l.namespaceUri===la&&(l.localName==="instrText"||l.localName==="delInstrText")){$b(n,Nt(l),l.localName==="delInstrText");continue}n.nesting>0&&cc(n)&&l.namespaceUri===la&&Dt(l)&&(u|=h);for(let f=l.children.length-1;f>=0;f-=1){let g=l.children[f];g.kind!=="textValue"&&m.push({node:g,runId:R,visibility:h&_t(l),containerDepth:xa(l,E)});}}Yb(n);}function Dt(e){return e.localName==="t"||e.localName==="delText"?Nt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ue=1,kt=2,It=4,k=ue|kt|It;function vo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:k});let t=0;for(;o.length>0;){let{node:n,visibility:i}=o.pop();if(!(n.namespaceUri===la&&n.localName==="p")){if(n.namespaceUri===la&&Dt(n)&&(t|=i,t===k))return t;for(let r of n.children)r.kind!=="textValue"&&o.push({node:r,visibility:i&_t(n)});}}return t}function _t(e){return e.namespaceUri!==la?k:e.localName==="ins"||e.localName==="moveTo"?ue|kt:e.localName==="del"||e.localName==="moveFrom"?ue|It:k}function wo(e){let o=new Map,t=n=>{let i=b$2(n??void 0);if(i===null)return;let r=i.toLowerCase();o.has(r)||o.set(r,i);};for(let n of e){let i=[n];for(;i.length>0;){let r=i.pop();if(r.namespaceUri===Ro&&t(bd),r.namespaceUri===la&&r.localName==="sym"&&t(c$3(yo(r,"font"))),r.localName==="textpath"&&t(pd(r)),r.namespaceUri===la&&r.localName==="fldSimple"){let s=ce(r,"instr");t(Yc(s??"")?.font??null);}if(r.namespaceUri===la&&r.localName==="p")for(let s of u(r))t(s);for(let s=r.children.length-1;s>=0;s-=1){let a=r.children[s];a.kind!=="textValue"&&i.push(a);}}}return [...o.values()]}function Nt(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let i=n.children.length-1;i>=0;i-=1)t.push(n.children[i]);}return o}var Ut="FILE_TOO_LARGE",Mt=8;function Ao(e){return typeof e=="object"&&e!==null}function Bt(e){if(!(!Ao(e)||typeof e.code!="string"))return e.code}function qt(e){return e===""||e.toLowerCase()==="localhost"}function To(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function zt(e){let o=To(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function jt(e){let o=zt(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Lo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function Po(e){let o;try{o=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!qt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=jt(o.pathname);if(t===null||Lo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Do(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function ko(e){let o=Do(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>Mt)throw new TypeError(`trustedRoot must not exceed ${Mt} directories`);return o.map(Po)}function Io(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a)throw new TypeError(`maxBytes must not exceed ${a}`);return e}function _o(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!qt(e.host))return null;let t=zt(e.pathname);if(t===null)return null;for(let n of o){let i=jt(n.pathname);if(i===null||!t.startsWith(i)||t.length<=i.length)continue;let r=new URL("file:///");return r.pathname=t,r}return null}function No(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function Mo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function Ct(e,o,t){return e.some(n=>Mo(n,o,t))}async function Co(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(i){if(Bt(i)==="ENOENT")continue;throw i}return t}function Uo(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:i,realpath:r},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),d=e.map(h=>p.resolve(a(h.href))),u=p.resolve(a(typeof o=="string"?o:o.href));if(!Ct(d,u,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let m=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",l=await i(u,m),c=()=>{l.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let h=await r(u);if(!Ct(await Co(d,r),h,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let E=(await l.stat()).size;if(!Number.isSafeInteger(E)||E<0||E>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Ut});let R=new Uint8Array(E),f=0;for(;f<R.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:g}=await l.read(R,f,R.byteLength-f,f);if(g===0)break;f+=g;}if(t?.aborted)throw t.reason;return f===R.byteLength?R:R.slice(0,f)}catch(h){throw t?.aborted?t.reason:h}finally{t?.removeEventListener("abort",c),await l.close().catch(()=>{});}}}function Bo(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let o=ko(e.trustedRoot),t=Io(e.maxBytes),n=e.read??Uo(o),i=e.networkFetch??fetch;return(async(r,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=No(r);if(p.protocol!=="file:")return i(p,s);let d=_o(p,o);if(!d)return new Response(null,{status:404});let u=a?new AbortController:void 0,m=()=>u?.abort(a?.reason);a?.addEventListener("abort",m,{once:true});let l;try{if(l=await n(d,{maxBytes:t,...u?{signal:u.signal}:{}}),a?.aborted)throw a.reason;if(l.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(u?.signal.aborted)throw u.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let h=Bt(c);if(h===Ut)return new Response(null,{status:413});if(h==="ENOENT"||h==="ENOTDIR"||h==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",m);}return new Response(l,{status:200})})}
|
|
1
|
+
import {c as c$1,x,o,d,f,z as z$1,A as A$1,v,s as s$1,j as j$2,E,m as m$1,u,l as l$1}from'./chunk-RALTVLB6.js';import {l,j as j$1,h,i,n,m,s,p,c as c$2,g as g$1,da,ca,fa}from'./chunk-SRVKFUFI.js';import'./chunk-RIYSCEFQ.js';import {g,h as h$1}from'./chunk-QXJKYNYZ.js';export{g as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,h as openDocumentForExport}from'./chunk-QXJKYNYZ.js';import {c,ja,a,xa,pd,qd,ea,ka,h as h$2,d as d$1,ed,b as b$1,i as i$1,ac,gd,dc,fc,cc,fd,gc,ec,hc,bc,r,u as u$1,n as n$1,kd}from'./chunk-DDFHKQFU.js';import {e,c as c$3,b as b$2}from'./chunk-B2BEELUE.js';import'./chunk-L5TYBFDB.js';import'./chunk-ACLR4DMK.js';import {za}from'./chunk-HDOXACHP.js';import {qh,rh,Dc,Cc,b,pa,ud,N as N$1,qf,Aa,Jf,Ba}from'./chunk-GWM3AKUD.js';function N(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},i=e.shape(n);if(t.glyphs.length!==i.glyphs.length||t.glyphs.some((l,c)=>l.id!==i.glyphs[c]?.id))return t;let r=[],s=0;for(let l of o.text){let c=l.toUpperCase()!==l,h=r.at(-1);h&&(h.lower===c||/\p{M}/u.test(l))?h.text+=l:r.push({text:l,start:s,lower:c}),s+=l.length;}let a=[],p=[],d=[],u=true,m=0;for(let l of o.environment.direction==="rtl"?r.reverse():r){let c=l.lower?.8:1,h=[],E=[],R="",f=l.start;for(let F of l.text){let y=l.lower?F.toUpperCase():F;for(let S=0;S<y.length;S++)h.push(f),E.push(f+F.length);R+=y,f+=F.length;}let g=e.shape({...n,text:R}),x=a.length;for(let[F,y]of g.glyphs.entries()){let S=g.exactAdvancesX?.[F];S===void 0?u=false:d.push(S*c),a.push({...y,cluster:h[y.cluster]??l.start,originX:n$1(m+Math.round(y.originX*c)),originY:n$1(Math.round(y.originY*c)),offsetX:n$1(Math.round(y.offsetX*c)),offsetY:n$1(Math.round(y.offsetY*c)),advanceX:n$1(Math.round(y.advanceX*c)),advanceY:n$1(Math.round(y.advanceY*c)),drawScale:c});}for(let F of g.clusters){let y=h[F.textStart]??l.start,S=E[F.textEnd-1]??f,b=n$1(Math.round(F.advance*c)),T=p.at(-1);T&&T.textStart===y&&T.textEnd===S?p[p.length-1]={...T,glyphEnd:x+F.glyphEnd,advance:n$1(T.advance+b),caretEdges:[n$1(0),n$1(T.advance+b)]}:p.push({...F,textStart:y,textEnd:S,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:b,caretEdges:F.caretEdges.map(V=>n$1(Math.round(V*c))),fontSpan:0});}m+=g.glyphs.reduce((F,y)=>F+Math.round(y.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:u&&d.length===a.length?d:void 0}}var ft=new WeakMap;function Gt(e){let o=ft.get(e);return o===void 0&&(o=Yt(e.bytes,e.faceIndex),ft.set(e,o)),o}var Vt=new Set(["COLR","CBDT","sbix"]),Wt=512;function Yt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(mt(e,0)==="ttcf"){let r=t.getUint32(8);if(o<0||o>=r||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let i=Math.min(t.getUint16(n+4),Wt);for(let r=0;r<i;r++){let s=n+12+r*16;if(s+4>e.byteLength)return false;if(Vt.has(mt(e,s)))return true}return false}function mt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var $t=/\p{Emoji_Presentation}|️/u;function Kt(e){return $t.test(e)}function z(e,o){if(e.length<2)return e;let t=e.filter(Gt);if(t.length===0||t.length===e.length)return e;let n=e.filter(i=>!t.includes(i));return Kt(o)?[...t,...n]:[...n,...t]}var Zt=2048;function yt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Zt)return null;let i=(f,g)=>{let{context:x,...F}=o,y={...F,text:g,environment:r({...o.environment,font:f})};return N(e,y,e.shape(y))},r$1=[],s=new Map;for(let f of [...t.clusters].sort((g,x)=>g.textStart-x.textStart)){let g=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=r$1.at(-1);if(/^[\uFE0E\uFE0F]$/.test(x)&&F&&F.end===f.textStart){F.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(x)&&F&&F.font!==o.environment.font&&F.end===f.textStart){F.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(S=>S.id===0)){let S=o.text.slice(f.textStart,f.textEnd+1),b=s.get(x)??z(n,S).find(T=>{try{return !i(T,x).glyphs.some(V=>V.id===0)}catch{return false}});if(!b)return null;s.set(x,b),g=b;}let y=r$1.at(-1);y&&y.font===g&&y.end===f.textStart?y.end=f.textEnd:r$1.push({start:f.textStart,end:f.textEnd,font:g});}let a=[],p=[],d=[],u=[],m=true,l=0,c=0,h=0,E=0,R=0;for(let f of o.environment.direction==="rtl"?r$1.reverse():r$1){let g=i(f.font,o.text.slice(f.start,f.end));if(g.glyphs.some(y=>y.id===0))return null;let x=a.length,F=d.length;for(let y of g.glyphs)a.push({...y,cluster:f.start+y.cluster,originX:n$1(l+y.originX),originY:n$1(c+y.originY)});if(g.exactAdvancesX===void 0)m=false;else for(let y of g.exactAdvancesX)u.push(y);for(let y of g.clusters)p.push({...y,textStart:f.start+y.textStart,textEnd:f.start+y.textEnd,glyphStart:x+y.glyphStart,glyphEnd:x+y.glyphEnd,fontSpan:F});g.glyphs.length&&d.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),l+=g.glyphs.reduce((y,S)=>y+S.advanceX,0),c+=g.glyphs.reduce((y,S)=>y+S.advanceY,0),h=Math.max(h,g.metrics.ascent),E=Math.max(E,g.metrics.descent),R=Math.max(R,g.metrics.lineGap);}return u$1({...t,glyphs:a,clusters:p,fontSpans:d,exactAdvancesX:m&&u.length===a.length?u:void 0,metrics:{ascent:n$1(h),descent:n$1(E),lineGap:n$1(R)}},{...o.environment,fallbackOrder:n})}var Jt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),Qt=512,ht=new WeakMap;function eo(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=c=>c+2<=n.byteLength?n.getUint16(c):-1,r=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=r(8);if(c<0||o<0||o>=c||(a=r(12+o*4),a<0))return t}let p=i(a+4);if(p<0||p>1024)return t;let d=-1;for(let c=0;c<p;c+=1){let h=a+12+c*16;if(s(h)==="GSUB"){d=r(h+8);break}}if(d<0)return t;let u=i(d+4);if(u<=0)return t;let m=d+u,l=i(m);if(l<0)return t;for(let c=0;c<Math.min(l,Qt);c+=1){let h=s(m+2+c*6);h&&t.add(h);}return t}function to(e,o){let t=ht.get(e);return t||(t=eo(e.bytes,e.faceIndex),ht.set(e,t)),(Jt.get(o)??[o.toLowerCase()]).some(i=>t.has(i))}function gt(e,o){let t=e.filter(n=>to(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function Q(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(r=>r.id===0).map(r=>r.cluster));if(!n.size)return t;let i=o.text.replace(/\u2011/g,(r,s)=>n.has(s)?"-":r);if(i===o.text)return t;try{let r=e.shape({...o,text:i});return u$1({...r,text:o.text},o.environment)}catch{return t}}function xt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof d$1)),n={shape(a){return Q(e.shaper,a,e.shaper.shape(a))}},i=new WeakMap,r$1={shape(a){let p=e.shaper.shape(a),d=i.get(p);if(d&&d.input.text===a.text&&d.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&d.input.bidiLevel===a.bidiLevel&&d.input.context?.before===a.context?.before&&d.input.context?.after===a.context?.after&&d.input.environment===a.environment)return d.run;let u=s(a,Q(e.shaper,a,p));return i.set(p,{input:a,run:u}),u}},s=(a,p)=>{let d=N(n,a,p);if(!d.glyphs.some(u=>u.id===0)||/^[\t\n\r\f]*$/.test(a.text))return d;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let u=yt(n,a,d,t);if(u)return u}for(let u of gt(z(t,a.text),a.environment.script))if(!(u.hash===a.environment.font.hash&&u.faceIndex===a.environment.font.faceIndex))try{let m={...a,environment:r({...a.environment,font:u})},l=N(n,m,n.shape(m));if(!l.glyphs.some(c=>c.id===0))return l}catch{}return d};return {...e,shaper:r$1}}var ee=b$1;function te(e){return typeof e.admittedFontFace=="function"}var oo=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function j(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var Ft=new WeakMap;function H(e){let o=Ft.get(e);return o||Ft.set(e,o=no(e)),o}function no(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:j(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:j(o.requested),resolved:j(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ro(e){return Object.freeze({...H(e),bytes:i$1(e)})}function io(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$1?null:ro(t)}catch{return null}}function Et(e){return o=>{if(e.status()!=="active")throw e.unavailable();return io(e.resolve(),o)}}function ao(e){return Object.freeze(e.slice(0,ee).map(o=>Object.freeze({request:j(o.request),partName:o.partName,reason:o.reason})))}function oe(e,o,t,n,i=[],r=new Set){let s=new Map;for(let p of [...e,o]){let d=p.toLowerCase();s.has(d)||s.set(d,p);}let a=[...s.values()].map(p=>{let d=[];for(let m of oo){let l=n?.({family:p,...m});!l||l instanceof d$1||d.push(Object.freeze({...m,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}let u=r.has(p.trim().toLowerCase())?d.filter(m=>m.via==="direct").length:d.length;return Object.freeze({family:p,coverage:u===4?"complete":u>0?"partial":"none",faces:Object.freeze(d)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:ao(i)})}function ne(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function re(e,o,t=[]){let n=d=>d.trim().toLowerCase(),i=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),r=new Set(t.map(d=>n(d.family))),s=d=>{if(!(d instanceof l$1))return true;let u=n(d.request.family);return i.has(u)||!r.has(u)},a=e.originFailures.some(({cause:d})=>d instanceof m$1?d.causes.length===0||d.causes.some(s):s(d));if(o.fontPolicy!=="strict"||!a&&e.families.every(d=>d.coverage==="complete"))return;let p=e.families.filter(d=>d.coverage!=="complete").map(d=>d.family).join(", ");throw new g("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function X(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let i={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},r=h$2(i),s=o.get(r);if(!s){try{s=e.fonts.resolve(i);}catch{return null}o.set(r,s);}return s instanceof d$1?null:s}function bt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function so(e){for(let o of e){let t=o.codePointAt(0);if(t!==32&&(t<=255||t>=61440&&t<=61695))return false}return true}function ae(e){let o=X(),t=new WeakMap;return n=>{let i=xa(n.style,n.fontSlot),r=pd(n)?qd(n):ea(n.text,i);if(r.length===0)return null;let s=i.fontFamily??e.defaultFont.family,a=G(e,o,s,i)??(b(s)&&so(r)?G(e,o,e.defaultFont.family,i):null);if(!a)return null;try{if(i.smallCaps&&!da(e.shaper,e.environment,a,i,t))return null;let p=ca(e.shaper,e.environment,a,i,r);return Object.freeze({run:p,font:H(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(d=>H(d.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function Rt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var M=new Map,St=new WeakMap,se=0,C;var le=32,Ot=c;function vt(){if(C)return C;let e=(async()=>(await c$2(),g$1({...h,maxFontBytes:a})))();return C=e,e.catch(()=>{C===e&&(C=void 0);}),e}function wt(e){let o=X();return fa(e,{resolveFont(t){return bt(e,o,t)},fallback:ka()})}async function At(e,o,t=[],n=false,i){if(!l(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=j$1(i,h),s$1=await vt(),a=xt(await s(e,s$1,r,o,n),t);return Object.freeze({createMeasurer:()=>wt(a),resolveFont:p=>a.fonts.resolve(p),shapeLaidOutText:ae(a),producer:["node-export-session",JSON.stringify(t),e.fingerprint,a.operation.shapingHash,`producer:${a.operation.producerVersion}`,`fallback:${ja}`].join("|"),extensionFingerprint:e.fingerprint})}function lo(e,o,t){if(!l(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let n$1=j$1(t,h),i$1=i(n$1),r=St.get(e),s$1=r?.get(i$1);if(s$1)return s$1;let a=`${n(e)}|${i$1}`,p=M.get(a);if(!p){if(M.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));p=(async()=>{let l=m(e).sources.reduce((h,E)=>h+(E.availability==="forbidden"?0:E.bytes.byteLength),0);if(se+l>Ot)throw new RangeError(`Shared exporter shaping font bytes are limited to ${Ot} process-wide`);se+=l;let c;try{let h=await vt();c=await s(e,h,n$1,o);}catch(h){throw se-=l,h}return Object.freeze({createMeasurer:()=>wt(c),shapeLaidOutText:ae(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),M.set(a,p),p.catch(()=>{M.get(a)===p&&M.delete(a);});}let d=e.fingerprint,u=p.then(m=>Object.freeze({createMeasurer:m.createMeasurer,shapeLaidOutText:m.shapeLaidOutText,producer:["node-export",d,m.shapingHash,`producer:${m.producerVersion}`,`fallback:${ja}`].join("|"),extensionFingerprint:d}));return r||St.set(e,r=new Map),r.set(i$1,u),u.catch(()=>{r?.get(i$1)===u&&r.delete(i$1);}),u}var co="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function uo(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(i=>i.type===co),n;if(t){let i=N$1(t);i.mode==="Internal"&&i.target.ok&&(n=o.parts.get(i.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),qf(o,n)}function Tt(e,o){let t=uo(e);if(t.length!==0)return j$2(n=>{let i=new Set((n.resolvedFaces??[]).map(s=>h$2(s))),r=E(t,{maxFontBytes:a,aggregateBudget:po(n),shadowedRequests:i});if(o)for(let s of r.dropped){if(o.dropped.length>=ee)break;o.dropped.push(s);}return {sources:r.sources}})}function po(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,c-o)}function fo(e){return te(e)&&ie(e)}var A=0,Lt=Symbol("font-resolution-timeout");function mo(e){let o=0,t=false;return e?.(A),{reserve:i=>{if(t)throw new Error("Document font-byte lease is already released");if(A+i>c)throw new g("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${i} bytes with ${A} bytes already active`);A+=i,o+=i,e?.(A);let r=false;return ()=>{r||t||(r=true,A-=i,o-=i,e?.(A));}},release:()=>{t||(t=true,A-=o,o=0,e?.(A));}}}function ce(e,o){return e.attributes.find(t=>t.localName===o)?.value}function yo(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===pa||t.namespaceUri===""))?.value}async function ho(e,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=za(e);if(!t.ok)return t;let{fonts:n,lastResortFonts:i,fontResolutionTimeoutMs:r,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:d,fontShaping:u,...m}=o,l=Array.isArray(n)?n:[n],c=i===void 0?[]:Array.isArray(i)?i:[i],h,E;try{E=await go(t.view,l,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:d,fontShaping:u,lastResortFonts:c,onFontResolution:b=>(h=b,a?.(b))});}catch(b){if(b instanceof g&&b.code==="aborted")return {ok:false,reason:"aborted"};throw b}if(!h)throw E?.dispose(),new g("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=h$1(t.view,{...m,reuseAcrossRevisions:!1,...E?{measurer:E.createMeasurer(),producer:o.producer??E.producer}:o.producer?{producer:o.producer}:{}});}catch(b){throw E?.dispose(),b}if(!R.ok)return E?.dispose(),R;let f=R.session,g$1=E,x="active",F=()=>x==="aborted"?new g("aborted","Export resource settlement was aborted"):new g("disposed","Export session has been disposed"),y=b=>{if(x==="active"){x=b,o.signal?.removeEventListener("abort",S);try{f.dispose();}finally{g$1?.dispose(),g$1=void 0;}}},S=()=>y("aborted");return o.signal?.addEventListener("abort",S,{once:true}),o.signal?.aborted&&S(),{ok:true,session:Object.freeze({fontResolution:h,layout:()=>x==="active"?f.layout():Promise.reject(F()),layoutFor:b=>x==="active"?f.layoutFor(b):Promise.reject(F()),validatedImageBytes:b=>x==="active"?f.validatedImageBytes(b):null,admittedFontFace:Et({status:()=>x,unavailable:F,resolve:()=>g$1?.resolveFont}),shapeLaidOutText:Rt({status:()=>x,unavailable:F,shaping:()=>g$1}),dispose:()=>y("disposed")})}}async function go(e,o$1,t={}){let n=j$1(t.fontShaping,h);if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let i=xo(t.timeoutMs),r=new AbortController,s=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",s,{once:true}),t.signal?.aborted&&s();let a=setTimeout(()=>r.abort(Lt),i);try{de(r.signal);let p$1=(async()=>{let d$1=mo(t.onActiveFontBytesChange),u=!1;try{let m=Eo(e).slice(0,c$1),l=x(e,m),c=[],h={dropped:[]},E=Tt(e,h),R=[...o$1,...E?[E]:[],...t.lastResortFonts??[]],f$1=await o(R,{families:[...new Set([...(t.glyphFallbacks??[]).map(b=>b.family),...l.families])].slice(0,c$1),defaultFamily:d.family,signal:r.signal},{onOriginFailure:b=>c.push(b),reserveOwnedBytes:d$1.reserve,maxExecutionFontBytes:n.maxFontBytes});de(r.signal);let g=f(f$1??{}),x$1=z$1(g,l),F=A$1(g,x$1,l);if(x$1.sources.length===0){let b=oe(m,x$1.defaultFont.family,c,void 0,h.dropped);ne(b,t),re(b,t,t.glyphFallbacks);return}let y=await At(p(x$1),void 0,t.glyphFallbacks,t.documentLigatures,{maxFontBytes:n.maxFontBytes});de(r.signal);let S=oe(m,x$1.defaultFont.family,c,y.resolveFont,h.dropped,F);return ne(S,t),re(S,t,t.glyphFallbacks),u=!0,Object.freeze({...y,dispose:d$1.release})}finally{u||d$1.release();}})();return await Promise.race([p$1,Fo(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",s);}}function xo(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function Fo(e){return new Promise((o,t)=>{let n=()=>{t(Pt(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function Pt(e){let o=e.reason===Lt;return new g(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw Pt(e)}function Eo(e$1){let o=[e$1.part().root],t=[],n=[],i=new Set([e$1.part().name]),r=(u,m)=>{!m||i.has(m.name)||(i.add(m.name),u.push(m.root));};for(let u of e$1.headerFooterPartsBySection()){for(let m of u.headers.values())r(t,m);for(let m of u.footers.values())r(t,m);}for(let u of ["footnote","endnote"])n.push(...bo(e$1,u));let s=e$1.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},p=new Map,d=(u,m)=>{let l=e(u,e$1.stylesRoot(),a,So(u,m)),c=v(u,e$1.numberingRoot(),e$1.stylesRoot(),a);for(let h of [...l.direct,...wo(u),...c,...s$1(u,e$1.stylesRoot(),a),...l.inherited]){let E=h.toLowerCase();p.has(E)||p.set(E,h);}};return d(o,"body"),d(t,"furniture"),d(n,"note"),[...p.values()]}function bo(e,o){let t=qh(e.currentPackage(),o);if(!t)return [];let n=new Set(rh(e.part()).filter(r=>r.noteKind===o).map(r=>r.noteId)),i=[];for(let r of t.root.children){if(r.kind==="textValue")continue;let s=Dc(r),a=Cc(r);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&i.push(r);}return i}var Ro="http://schemas.openxmlformats.org/officeDocument/2006/math";function So(e,o){let t=new Set;for(let n of e){let i=[],r=[{node:n,context:o}];for(;r.length>0;){let{node:s,context:a}=r.pop();s.namespaceUri===pa&&s.localName==="p"&&i.push({paragraph:s,context:a});let p=s.namespaceUri===pa&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let d=s.children.length-1;d>=0;d-=1){let u=s.children[d];u.kind!=="textValue"&&r.push({node:u,context:p});}}for(let s of i)Oo(s.paragraph,t,s.context);}return t}function Oo(e,o,t){let n=ac(),i=null,r=null,s="",a=false,p=false,d=false,u=0,m=[];for(let l=e.children.length-1;l>=0;l-=1){let c=e.children[l];c.kind!=="textValue"&&m.push({node:c,runId:null,visibility:k,containerDepth:0});}for(;m.length>0;){let{node:l,runId:c,visibility:h,containerDepth:E}=m.pop();if(E>=Aa||l.namespaceUri===pa&&l.localName==="p")continue;let R=l.namespaceUri===pa&&l.localName==="r"?l.id:c;if(l.namespaceUri===pa&&l.localName==="fldSimple"){let f=ce(l,"instr")??"";gd(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&vo(l)!==k&&o.add(l.id);}if(l.namespaceUri===pa&&l.localName==="fldChar"){let f=ce(l,"fldCharType");if(f==="begin")dc(n),n.nesting===1&&(i=R,r=null,s="",a=false,p=false,d=Jf(l),u=0);else if(f==="separate"){let g=n.nesting===1;if(fc(n),g){let x=cc(n);s=x.instruction,a=x.overflow||n.nestingOverflow,r=R,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=cc(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&fd(s,{hasSeparate:p,hasLegacyFormData:d,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&u!==k){let x=r??i;x&&o.add(x);}}gc(n);}continue}if(l.namespaceUri===pa&&(l.localName==="instrText"||l.localName==="delInstrText")){ec(n,Nt(l),l.localName==="delInstrText");continue}n.nesting>0&&hc(n)&&l.namespaceUri===pa&&Dt(l)&&(u|=h);for(let f=l.children.length-1;f>=0;f-=1){let g=l.children[f];g.kind!=="textValue"&&m.push({node:g,runId:R,visibility:h&_t(l),containerDepth:Ba(l,E)});}}bc(n);}function Dt(e){return e.localName==="t"||e.localName==="delText"?Nt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ue=1,kt=2,It=4,k=ue|kt|It;function vo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:k});let t=0;for(;o.length>0;){let{node:n,visibility:i}=o.pop();if(!(n.namespaceUri===pa&&n.localName==="p")){if(n.namespaceUri===pa&&Dt(n)&&(t|=i,t===k))return t;for(let r of n.children)r.kind!=="textValue"&&o.push({node:r,visibility:i&_t(n)});}}return t}function _t(e){return e.namespaceUri!==pa?k:e.localName==="ins"||e.localName==="moveTo"?ue|kt:e.localName==="del"||e.localName==="moveFrom"?ue|It:k}function wo(e){let o=new Map,t=n=>{let i=b$2(n??void 0);if(i===null)return;let r=i.toLowerCase();o.has(r)||o.set(r,i);};for(let n of e){let i=[n];for(;i.length>0;){let r=i.pop();if(r.namespaceUri===Ro&&t(kd),r.namespaceUri===pa&&r.localName==="sym"&&t(c$3(yo(r,"font"))),r.localName==="textpath"&&t(ud(r)),r.namespaceUri===pa&&r.localName==="fldSimple"){let s=ce(r,"instr");t(ed(s??"")?.font??null);}if(r.namespaceUri===pa&&r.localName==="p")for(let s of u(r))t(s);for(let s=r.children.length-1;s>=0;s-=1){let a=r.children[s];a.kind!=="textValue"&&i.push(a);}}}return [...o.values()]}function Nt(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let i=n.children.length-1;i>=0;i-=1)t.push(n.children[i]);}return o}var Ut="FILE_TOO_LARGE",Mt=8;function Ao(e){return typeof e=="object"&&e!==null}function Bt(e){if(!(!Ao(e)||typeof e.code!="string"))return e.code}function qt(e){return e===""||e.toLowerCase()==="localhost"}function To(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function zt(e){let o=To(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function jt(e){let o=zt(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Lo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function Po(e){let o;try{o=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!qt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=jt(o.pathname);if(t===null||Lo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Do(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function ko(e){let o=Do(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>Mt)throw new TypeError(`trustedRoot must not exceed ${Mt} directories`);return o.map(Po)}function Io(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a)throw new TypeError(`maxBytes must not exceed ${a}`);return e}function _o(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!qt(e.host))return null;let t=zt(e.pathname);if(t===null)return null;for(let n of o){let i=jt(n.pathname);if(i===null||!t.startsWith(i)||t.length<=i.length)continue;let r=new URL("file:///");return r.pathname=t,r}return null}function No(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function Mo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function Ct(e,o,t){return e.some(n=>Mo(n,o,t))}async function Co(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(i){if(Bt(i)==="ENOENT")continue;throw i}return t}function Uo(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:i,realpath:r},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),d=e.map(h=>p.resolve(a(h.href))),u=p.resolve(a(typeof o=="string"?o:o.href));if(!Ct(d,u,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let m=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",l=await i(u,m),c=()=>{l.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let h=await r(u);if(!Ct(await Co(d,r),h,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let E=(await l.stat()).size;if(!Number.isSafeInteger(E)||E<0||E>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Ut});let R=new Uint8Array(E),f=0;for(;f<R.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:g}=await l.read(R,f,R.byteLength-f,f);if(g===0)break;f+=g;}if(t?.aborted)throw t.reason;return f===R.byteLength?R:R.slice(0,f)}catch(h){throw t?.aborted?t.reason:h}finally{t?.removeEventListener("abort",c),await l.close().catch(()=>{});}}}function Bo(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let o=ko(e.trustedRoot),t=Io(e.maxBytes),n=e.read??Uo(o),i=e.networkFetch??fetch;return(async(r,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=No(r);if(p.protocol!=="file:")return i(p,s);let d=_o(p,o);if(!d)return new Response(null,{status:404});let u=a?new AbortController:void 0,m=()=>u?.abort(a?.reason);a?.addEventListener("abort",m,{once:true});let l;try{if(l=await n(d,{maxBytes:t,...u?{signal:u.signal}:{}}),a?.aborted)throw a.reason;if(l.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(u?.signal.aborted)throw u.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let h=Bt(c);if(h===Ut)return new Response(null,{status:413});if(h==="ENOENT"||h==="ENOTDIR"||h==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",m);}return new Response(l,{status:200})})}
|
|
2
2
|
export{le as MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS,lo as acquireSharedExportShaping,Bo as createPackagedFileFetch,te as hasExportAdmittedFont,ie as hasExportLaidOutText,fo as hasFontBackedExportCapabilities,ho as openFontBackedDocumentForExport};
|
|
@@ -112,4 +112,4 @@ interface CollaborationStatusTracker {
|
|
|
112
112
|
declare function createCollaborationStatusTracker(initial?: CollaborationStatus): CollaborationStatusTracker;
|
|
113
113
|
|
|
114
114
|
export { createCollaborationStatusTracker as d, isCollaborationFailureCode as i };
|
|
115
|
-
export type {
|
|
115
|
+
export type { CollaborationFailureCode as C, CollaborationStatus as a, CollaborationStatusSnapshot as b, CollaborationFailure as c };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as FontFaceRequest, F as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-fonts-D_-vjuJi.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A partial font configuration one origin contributes: sources, substitutions, or both.
|