@docx-editor.dev/core 2.23.0 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +7 -6
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +1 -1
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.js +1 -1
  7. package/dist/{chunk-KRBBWATQ.js → chunk-2LXGB2X7.js} +1 -1
  8. package/dist/chunk-3OMDEMLL.js +1 -0
  9. package/dist/{chunk-PCPBDYEL.cjs → chunk-6CPYOVRT.cjs} +1 -1
  10. package/dist/chunk-AKF5KM2W.cjs +4 -0
  11. package/dist/{chunk-QTFAXWVI.cjs → chunk-BOGQGMMU.cjs} +1 -1
  12. package/dist/chunk-CVNDMQIX.cjs +26 -0
  13. package/dist/{chunk-FWX535CS.cjs → chunk-DF7F7TNU.cjs} +1 -1
  14. package/dist/{chunk-UMBHUW6R.js → chunk-G765WG4R.js} +1 -1
  15. package/dist/{chunk-BUDXZ7T2.cjs → chunk-IEXYOLNR.cjs} +5 -5
  16. package/dist/chunk-J3EM5ZEA.js +18 -0
  17. package/dist/{chunk-QK23BSRK.cjs → chunk-JDAAGZNE.cjs} +1 -1
  18. package/dist/chunk-JNE6QF47.js +26 -0
  19. package/dist/{chunk-KV5HFE23.cjs → chunk-JQTVFP72.cjs} +1 -1
  20. package/dist/chunk-JXL25DRU.js +11 -0
  21. package/dist/{chunk-GRVRQBKU.js → chunk-KPSGB64S.js} +1 -1
  22. package/dist/chunk-P4SBMHHO.cjs +5 -0
  23. package/dist/chunk-QQAF64KN.js +5 -0
  24. package/dist/chunk-SI5FLZGU.js +4 -0
  25. package/dist/{chunk-DZOGUV7O.js → chunk-SOUJNWXV.js} +1 -1
  26. package/dist/chunk-T4TKRNZT.cjs +11 -0
  27. package/dist/{chunk-EHT4LKKZ.cjs → chunk-TBFZZX7Z.cjs} +1 -1
  28. package/dist/chunk-VPKKYCZI.cjs +2 -0
  29. package/dist/chunk-W3ZUPQIZ.cjs +18 -0
  30. package/dist/chunk-XMWH2R23.js +5 -0
  31. package/dist/{chunk-6QS5WL63.js → chunk-XWXJB4J7.js} +1 -1
  32. package/dist/chunk-YIBEBHT3.js +2 -0
  33. package/dist/{chunk-RLO64PHP.cjs → chunk-ZSM6X52G.cjs} +1 -1
  34. package/dist/chunk-ZXAGLAY2.js +2 -0
  35. package/dist/collaboration/replication.cjs +1 -1
  36. package/dist/collaboration/replication.js +1 -1
  37. package/dist/contracts/editor.d.ts +3 -3
  38. package/dist/{editor-DhUQsWWH.d.ts → editor-BU6rjQZz.d.ts} +3 -1
  39. package/dist/editor.cjs +1 -1
  40. package/dist/editor.css +1 -1
  41. package/dist/editor.d.ts +12 -12
  42. package/dist/editor.js +1 -1
  43. package/dist/export.cjs +2 -2
  44. package/dist/export.d.ts +5 -5
  45. package/dist/export.js +1 -1
  46. package/dist/{font-resolver-BwoHFBlr.d.ts → font-resolver-CPO7wtg6.d.ts} +1 -1
  47. package/dist/{index-BYaCkGKO.d.ts → index-BOkQYOsZ.d.ts} +21 -17
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.d.ts +7 -7
  50. package/dist/index.js +1 -1
  51. package/dist/{layout-shaping-DpWQG26a.d.ts → layout-shaping-BOOxnLxF.d.ts} +1 -1
  52. package/dist/layout.cjs +1 -1
  53. package/dist/layout.d.ts +55 -40
  54. package/dist/layout.js +1 -1
  55. package/dist/output.cjs +1 -1
  56. package/dist/output.d.ts +3 -3
  57. package/dist/output.js +1 -1
  58. package/dist/{semantic-cell-selection-B8GF_H2e.d.ts → semantic-cell-selection-BtO2s2Za.d.ts} +2 -2
  59. package/dist/{semantic-interaction-DQjtIruQ.d.ts → semantic-interaction-COMnWyBQ.d.ts} +1 -1
  60. package/dist/{semantic-paint-DoPl85nR.d.ts → semantic-paint-C032N0ps.d.ts} +1 -1
  61. package/dist/{semantic-records-DB0VgWsr.d.ts → semantic-records-BSjo-xck.d.ts} +3 -3
  62. package/dist/store.cjs +1 -1
  63. package/dist/store.d.ts +0 -1
  64. package/dist/store.js +1 -1
  65. package/package.json +2 -2
  66. package/dist/chunk-4OAXZNBU.js +0 -5
  67. package/dist/chunk-6745I4XF.cjs +0 -20
  68. package/dist/chunk-6KA3L3FR.cjs +0 -11
  69. package/dist/chunk-DYRXA5UJ.cjs +0 -2
  70. package/dist/chunk-F5LAOPAD.js +0 -20
  71. package/dist/chunk-JN62FLHE.cjs +0 -4
  72. package/dist/chunk-Q4RDWB3U.cjs +0 -18
  73. package/dist/chunk-T7RGKBCE.cjs +0 -5
  74. package/dist/chunk-VE6H5EJA.js +0 -5
  75. package/dist/chunk-WHG23WNI.js +0 -1
  76. package/dist/chunk-XBYZTDF7.js +0 -4
  77. package/dist/chunk-XRBPZCNK.js +0 -11
  78. package/dist/chunk-Y5JCIWTF.js +0 -2
  79. package/dist/chunk-ZA6HEWUM.js +0 -2
  80. package/dist/chunk-ZCRSPN4Q.js +0 -18
package/dist/editor.d.ts CHANGED
@@ -4,19 +4,19 @@ export { D as DEFAULT_IMAGE_RESOURCE_LIMITS, a as ImageDecodePort, I as ImageRes
4
4
  export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, resolveEditorModules } from './contracts/modules.js';
5
5
  import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-CHcCnz3W.js';
6
6
  export { a as TreeApplyResult } from './tree-session-contract-CHcCnz3W.js';
7
- import { a as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode, f as ClearAnchorHighlightOptions, A as AnchorHighlightOptions, S as ScrollToAnchorOptions, g as AnchorHighlightAnimation } from './editor-DhUQsWWH.js';
8
- export { I as ImageContext, h as ImageCropPercent, i as ImageCropPermille, j as SelectedImageState, T as TrackedChangeFilterMode, k as TrackedChangePredicate, l as cropPercentFromCropPermille, m as cropPercentFromPermille, n as cropPercentFromSourceCrop, o as cropPermilleFromCropPercent, p as cropPermilleFromPercent, s as sourceCropFromCropPercent, v as validateImageCropPercent } from './editor-DhUQsWWH.js';
9
- import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-DpWQG26a.js';
10
- export { d as disposeLayoutShaping } from './layout-shaping-DpWQG26a.js';
11
- export { C as ComposeFontOriginsOptions, b as FONT_RESOLVER_BRAND, c as FONT_RESOLVER_MARK_KEY, d as FontConfigurationBase, e as FontConfigurationFragment, a as FontOrigin, F as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, M as MAX_RESOLVER_FAMILIES, i as MarkedFontResolver, W as WORD_DEFAULT_FONT, j as composeFontConfiguration, k as composeFontOrigins, l as defineFontResolver, m as isFontResolver } from './font-resolver-BwoHFBlr.js';
12
- import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-BYaCkGKO.js';
13
- export { A as AnchorFrameOrigin, C as CHROME_GROUPS, b as CHROME_MENUS, c as CHROME_UNAVAILABLE_KEY, d as ChromeControl, e as ChromeControlId, f as ChromeControlState, g as ChromeExportError, h as ChromeExportFormat, i as ChromeExportHandlers, j as ChromeExportResult, k as ChromeGroup, l as ChromeGroupId, m as ChromeMenu, n as ChromeMenuEntry, o as ChromeMenuId, p as ChromeMenuItemEntry, q as ChromeMenuSeparatorEntry, r as ChromeMenuSubmenuEntry, s as ChromePrintError, t as ChromePrintErrorCode, u as ChromePrintJob, v as ChromePrintOptions, w as ChromeSlotId, x as ContentControlWidgetChromeHandlers, y as ContentControlWidgetSession, z as CustomFontsOptions, B as CustomFontsResolver, E as DEFAULT_TABLE_CHROME_DRAFT, F as DocxEditorConfig, G as DrawingSelectionIntent, H as EMU_PER_POINT, I as EditorCommandExecute, J as EquationActivation, K as EquationChromeHandlers, L as EquationOps, M as FinalizedImageOverlayInteraction, N as FontLoadFailure, Q as FontLoadFailureReason, R as FontMeasurementState, S as FontUrlSource, U as HistoryGroupBinding, V as HistoryGroupBindingOptions, W as HyperlinkActivation, X as HyperlinkChromeHandlers, Y as HyperlinkOps, Z as IMAGE_OVERLAY_NUDGE_PT, _ as IMAGE_OVERLAY_NUDGE_SHIFT_PT, $ as ImageInteractionSession, a0 as ImageOverlayScrollPort, a1 as ImageResizeHandle, a2 as ImageResizeResult, a3 as InvalidTextFormFieldChromeHandlers, a4 as InvalidTextFormFieldSession, a5 as LoadFontsRequest, a6 as LoadFontsResult, a7 as OverlayFrameRect, a8 as PaginatedSurfaceState, a9 as ParagraphPropertyEdit, aa as PopupChromeRegistrationOptions, ab as RemoteCaretLabelAnchor, ac as RemoteCaretLabelHost, ad as ReviewWriteIntent, ae as RunTableChromeCommandResult, af as SectionAnchor, ag as SectionBreakInsertType, ah as SelectedDrawingOverlayTarget, ai as SurfaceEquation, aj as SurfaceFormatting, ak as SurfaceHyperlink, al as SurfaceInsertImageInput, am as SurfaceNavigation, an as SurfaceOverlayCoordinates, ao as SurfaceParagraphFormat, ap as TABLE_BORDER_STYLE_OPTIONS, aq as TABLE_BORDER_TARGET_OPTIONS, ar as TABLE_BORDER_WIDTH_OPTIONS, as as TABLE_CHROME_SLOT_IDS, at as TableBorderStyleOption, au as TableBorderTargetOption, av as TableBorderTargetValue, aw as TableBorderWidthOption, ax as TableChromeDraft, ay as TableChromePick, az as TableChromeSlotId, aA as TableInteractionLabelKey, aB as TextFormFieldChromeHandlers, aC as TextFormFieldDialogSession, aD as ToolbarCommandState, aE as ToolbarSlotValue, aF as ToolbarValueMap, aG as ToolbarValueSlot, aH as applyTableChromePick, aI as bindHistoryGroup, aJ as blankDocumentBytes, aK as canExecuteImageCommand, aL as captureImageMutationPreconditions, aM as chromeControlCount, aN as chromeMenuSlots, aO as chromeProbeForSlot, aP as chromeSlotId, aQ as chromeSlotIsToggle, aR as commandExecOptions, aS as commandForSlot, aT as commandForSlotValue, aU as commandForTableChromeSlotValue, aV as computeImageResizeResult, aW as computeMovedImagePosition, aX as computeResizedImageExtentEmu, aY as createDocxEditor, aZ as createFontSource, a_ as createImageOverlayScrollPort, a$ as cssPixelsToLayoutPoints, b0 as customFonts, b1 as defaultChromeGroups, b2 as defaultTableLabel, b3 as emuToOverlayPoints, b4 as equationAtPosition, b5 as executeImageCommand, b6 as finalizeImageOverlayInteraction, b7 as formattingBarChromeGroups, b8 as isChromePrintShortcut, b9 as isStaleImageInteractionCommit, ba as isTableChromeSlot, bb as layoutPointsToCssPixels, bc as loadFonts, bd as overlayFrameToSheetCssPixels, be as overlayHostOrigin, bf as pointsToEmu, bg as probeTableChromeCommand, bh as resizePreservesAspect, bi as runChromeExport, bj as runChromePrint, bk as runSave, bl as runTableChromeCommand, bm as runTableCommand, bn as runToolbarCommand, bo as selectedDrawingOverlayTargetOf, bp as selectedImageStateOf, bq as surfacePaintScale, br as tableChromeIconPaths, bs as tableChromeLabelKeyForTarget, bt as tableChromeToolbarState, bu as tableChromeVisible, bv as tableCommandToolbarState, bw as toolbarCommandState, bx as toolbarCommandStates } from './index-BYaCkGKO.js';
7
+ import { a as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode, f as ClearAnchorHighlightOptions, A as AnchorHighlightOptions, S as ScrollToAnchorOptions, g as AnchorHighlightAnimation } from './editor-BU6rjQZz.js';
8
+ export { I as ImageContext, h as ImageCropPercent, i as ImageCropPermille, j as SelectedImageState, T as TrackedChangeFilterMode, k as TrackedChangePredicate, l as cropPercentFromCropPermille, m as cropPercentFromPermille, n as cropPercentFromSourceCrop, o as cropPermilleFromCropPercent, p as cropPermilleFromPercent, s as sourceCropFromCropPercent, v as validateImageCropPercent } from './editor-BU6rjQZz.js';
9
+ import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-BOOxnLxF.js';
10
+ export { d as disposeLayoutShaping } from './layout-shaping-BOOxnLxF.js';
11
+ export { C as ComposeFontOriginsOptions, b as FONT_RESOLVER_BRAND, c as FONT_RESOLVER_MARK_KEY, d as FontConfigurationBase, e as FontConfigurationFragment, a as FontOrigin, F as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, M as MAX_RESOLVER_FAMILIES, i as MarkedFontResolver, W as WORD_DEFAULT_FONT, j as composeFontConfiguration, k as composeFontOrigins, l as defineFontResolver, m as isFontResolver } from './font-resolver-CPO7wtg6.js';
12
+ import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-BOkQYOsZ.js';
13
+ export { A as AnchorFrameOrigin, C as CHROME_GROUPS, b as CHROME_MENUS, c as CHROME_UNAVAILABLE_KEY, d as ChromeControl, e as ChromeControlId, f as ChromeControlState, g as ChromeExportError, h as ChromeExportFormat, i as ChromeExportHandlers, j as ChromeExportResult, k as ChromeGroup, l as ChromeGroupId, m as ChromeMenu, n as ChromeMenuEntry, o as ChromeMenuId, p as ChromeMenuItemEntry, q as ChromeMenuSeparatorEntry, r as ChromeMenuSubmenuEntry, s as ChromePrintError, t as ChromePrintErrorCode, u as ChromePrintJob, v as ChromePrintOptions, w as ChromeSlotId, x as ContentControlWidgetChromeHandlers, y as ContentControlWidgetSession, z as CustomFontsOptions, B as CustomFontsResolver, E as DEFAULT_TABLE_CHROME_DRAFT, F as DocxEditorConfig, G as DrawingSelectionIntent, H as EMU_PER_POINT, I as EditorCommandExecute, J as EquationActivation, K as EquationChromeHandlers, L as EquationOps, M as FinalizedImageOverlayInteraction, N as FontLoadFailure, Q as FontLoadFailureReason, R as FontMeasurementState, S as FontUrlSource, U as HistoryGroupBinding, V as HistoryGroupBindingOptions, W as HyperlinkActivation, X as HyperlinkChromeHandlers, Y as HyperlinkOps, Z as IMAGE_OVERLAY_NUDGE_PT, _ as IMAGE_OVERLAY_NUDGE_SHIFT_PT, $ as ImageInteractionSession, a0 as ImageOverlayScrollPort, a1 as ImageResizeHandle, a2 as ImageResizeResult, a3 as InvalidTextFormFieldChromeHandlers, a4 as InvalidTextFormFieldSession, a5 as LoadFontsRequest, a6 as LoadFontsResult, a7 as OverlayFrameRect, a8 as PaginatedSurfaceState, a9 as ParagraphPropertyEdit, aa as PopupChromeRegistrationOptions, ab as RemoteCaretLabelAnchor, ac as RemoteCaretLabelHost, ad as ReviewWriteIntent, ae as RunTableChromeCommandResult, af as SectionAnchor, ag as SectionBreakInsertType, ah as SelectedDrawingOverlayTarget, ai as SurfaceEquation, aj as SurfaceFormatting, ak as SurfaceHyperlink, al as SurfaceInsertImageInput, am as SurfaceNavigation, an as SurfaceOverlayCoordinates, ao as SurfaceParagraphFormat, ap as TABLE_BORDER_STYLE_OPTIONS, aq as TABLE_BORDER_TARGET_OPTIONS, ar as TABLE_BORDER_WIDTH_OPTIONS, as as TABLE_CHROME_SLOT_IDS, at as TableBorderStyleOption, au as TableBorderTargetOption, av as TableBorderTargetValue, aw as TableBorderWidthOption, ax as TableChromeDraft, ay as TableChromePick, az as TableChromeSlotId, aA as TableInteractionLabelKey, aB as TextFormFieldChromeHandlers, aC as TextFormFieldDialogSession, aD as ToolbarCommandState, aE as ToolbarSlotValue, aF as ToolbarValueMap, aG as ToolbarValueSlot, aH as applyTableChromePick, aI as bindHistoryGroup, aJ as blankDocumentBytes, aK as canExecuteImageCommand, aL as captureImageMutationPreconditions, aM as chromeControlCount, aN as chromeMenuSlots, aO as chromeProbeForSlot, aP as chromeSlotId, aQ as chromeSlotIsToggle, aR as commandExecOptions, aS as commandForSlot, aT as commandForSlotValue, aU as commandForTableChromeSlotValue, aV as computeImageResizeResult, aW as computeMovedImagePosition, aX as computeResizedImageExtentEmu, aY as createDocxEditor, aZ as createFontSource, a_ as createImageOverlayScrollPort, a$ as cssPixelsToLayoutPoints, b0 as customFonts, b1 as defaultChromeGroups, b2 as defaultTableLabel, b3 as emuToOverlayPoints, b4 as equationAtPosition, b5 as executeImageCommand, b6 as finalizeImageOverlayInteraction, b7 as formattingBarChromeGroups, b8 as isChromePrintShortcut, b9 as isStaleImageInteractionCommit, ba as isTableChromeSlot, bb as layoutPointsToCssPixels, bc as loadFonts, bd as overlayFrameToSheetCssPixels, be as overlayHostOrigin, bf as pointsToEmu, bg as probeTableChromeCommand, bh as resizePreservesAspect, bi as runChromeExport, bj as runChromePrint, bk as runSave, bl as runTableChromeCommand, bm as runTableCommand, bn as runToolbarCommand, bo as selectedDrawingOverlayTargetOf, bp as selectedImageStateOf, bq as surfacePaintScale, br as tableChromeIconPaths, bs as tableChromeLabelKeyForTarget, bt as tableChromeToolbarState, bu as tableChromeVisible, bv as tableCommandToolbarState, bw as toolbarCommandState, bx as toolbarCommandStates } from './index-BOkQYOsZ.js';
14
14
  import { A as AutomationCapabilities, a as AutomationHost } from './protocol-CPAakntQ.js';
15
- import { S as SemanticLayout } from './semantic-records-DB0VgWsr.js';
16
- export { T as TextMeasurer } from './semantic-records-DB0VgWsr.js';
17
- export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-DQjtIruQ.js';
18
- export { S as SectionProperties } from './semantic-cell-selection-B8GF_H2e.js';
19
- export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-DoPl85nR.js';
15
+ import { S as SemanticLayout } from './semantic-records-BSjo-xck.js';
16
+ export { T as TextMeasurer } from './semantic-records-BSjo-xck.js';
17
+ export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-COMnWyBQ.js';
18
+ export { S as SectionProperties } from './semantic-cell-selection-BtO2s2Za.js';
19
+ export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-C032N0ps.js';
20
20
  export { CollaborationModuleContribution } from './collaboration.js';
21
21
  import './editor-scope-OHPwVQ5l.js';
22
22
  import './revision-projection-CVJeA2jp.js';
package/dist/editor.js CHANGED
@@ -1 +1 @@
1
- export{_a as AUTO_ZOOM_MODE,db as BROWSER_AUTOMATION_CAPABILITIES,wa as CHROME_GROUPS,Aa as CHROME_MENUS,Da as CHROME_UNAVAILABLE_KEY,Ia as CONTENT_CONTROL_PICTURE_ACCEPT,Fb as ChromeExportError,Hb as ChromePrintError,Y as DEFAULT_TABLE_CHROME_DRAFT,Db as DocumentRefreshError,Q as EMU_PER_POINT,$a as FIT_WIDTH_ZOOM_MODE,O as IMAGE_OVERLAY_NUDGE_PT,P as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,vb as NO_MIXED_FIELDS,l as PX_PER_CM,k as PX_PER_INCH,r as SNAP_TWIPS_CM,q as SNAP_TWIPS_INCH,ca as TABLE_BORDER_STYLE_OPTIONS,ba as TABLE_BORDER_TARGET_OPTIONS,da as TABLE_BORDER_WIDTH_OPTIONS,Z as TABLE_CHROME_SLOT_IDS,rb as TAB_ALIGNMENT_LABELS,p as TWIPS_PER_CM,o as TWIPS_PER_INCH,Za as ZOOM_MAX,Ya as ZOOM_MIN,zb as alignmentAfterDirectionChange,ea as applyTableChromePick,y as applyThemeShade,x as applyThemeTint,Cb as bindHistoryGroup,d as blankDocumentBytes,Qa as calendarDateForKey,Sa as calendarDateFromText,Ra as calendarDateText,Oa as calendarMonth,Ta as calendarMonthNames,Ma as calendarMonthTitle,Na as calendarWeekdays,M as canExecuteImageCommand,L as captureImageMutationPreconditions,yb as changedFields,Ca as chromeControlCount,Ba as chromeMenuSlots,ia as chromeProbeForSlot,xa as chromeSlotId,oa as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,v as commandExecOptions,ja as commandForSlot,la as commandForSlotValue,ka as commandForTableChromeSlotValue,lb as computeImageResizeResult,V as computeMovedImagePosition,U as computeResizedImageExtentEmu,Ga as contentControlPopupKeyDown,Ha as contentControlPopupOpener,eb as createBrowserAutomationHost,Ua as createContentControlListNavigation,Eb as createDocumentRefresh,cb as createDocxEditor,i as createFontSource,mb as createImageOverlayScrollPort,b as createLayoutShaping,I as cropPercentFromCropPermille,G as cropPercentFromPermille,D as cropPercentFromSourceCrop,H as cropPermilleFromCropPercent,F as cropPermilleFromPercent,hb as cssPixelsToLayoutPoints,j as customFonts,ya as defaultChromeGroups,_ as defaultTableLabel,u as dragIndent,va as editorCommandKey,T as emuToOverlayPoints,Wa as equationAtPosition,N as executeImageCommand,nb as finalizeImageOverlayInteraction,La as firstDayOfWeek,pb as formatInches,za as formattingBarChromeGroups,m as generateRulerTicks,s as handlePosition,qb as inchesToTwips,Ib as isChromePrintShortcut,W as isStaleImageInteractionCommit,$ as isTableChromeSlot,Ja as isoDateOf,gb as layoutPointsToCssPixels,h as loadFonts,A as lowerColorValueForBorder,B as lowerColorValueForFill,wb as mixedFieldsOf,Xa as mountPaginatedSurface,Fa as observeContentControlPopup,ib as overlayFrameToSheetCssPixels,jb as overlayHostOrigin,Ka as parseIsoDate,g as partOfNodeId,S as pointsToEmu,Ea as positionContentControlPopup,fa as probeTableChromeCommand,kb as resizePreservesAspect,C as resolveColorValueToCss,z as resolveThemeColorHex,ab as resolveZoomMode,n as rulerPageBox,Gb as runChromeExport,Jb as runChromePrint,sa as runSave,qa as runTableChromeCommand,ua as runTableCommand,ra as runToolbarCommand,xb as sameTabStops,bb as sameZoomMode,ub as seedFields,R as selectedDrawingOverlayTargetOf,K as selectedImageStateOf,Pa as shiftMonth,tb as signedFirstLineOf,t as snapTwips,E as sourceCropFromCropPercent,sb as specialOf,Va as surfaceExtent,fb as surfacePaintScale,ha as tableChromeIconPaths,ga as tableChromeLabelKeyForTarget,ma as tableChromeToolbarState,aa as tableChromeVisible,X as tableCommandState,ta as tableCommandToolbarState,a as toEditorFontError,na as toolbarCommandState,pa as toolbarCommandStates,Bb as trapTabWithin,ob as twipsToInches,J as validateImageCropPercent,w as validateThemeModifier,Ab as withTabStop}from'./chunk-F5LAOPAD.js';export{a as resolveEditorModules}from'./chunk-AJCCS53D.js';import'./chunk-Y5JCIWTF.js';export{h as FONT_RESOLVER_BRAND,g as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,d as WORD_DEFAULT_FONT,e as composeFontConfiguration,k as composeFontOrigins,i as defineFontResolver,j as isFontResolver}from'./chunk-GRVRQBKU.js';export{r as disposeLayoutShaping}from'./chunk-XBYZTDF7.js';import'./chunk-RIYSCEFQ.js';import'./chunk-ZA6HEWUM.js';import'./chunk-WHG23WNI.js';import'./chunk-ZCRSPN4Q.js';import'./chunk-4OAXZNBU.js';import'./chunk-UMBHUW6R.js';import'./chunk-DZOGUV7O.js';import'./chunk-6QS5WL63.js';import'./chunk-VE6H5EJA.js';import'./chunk-6JIJOZDW.js';import'./chunk-KRBBWATQ.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,$i as DRAWING_REL_FROM_H,aj as DRAWING_REL_FROM_V,Uc as IMAGE_WRAP_TARGETS,Oh as TEXT_FORM_FORMATS,cj as positionInputFromPropertiesCommand,bj as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,nd as resolveSvgIntrinsicSize,jd as sniffImageMime,_i as validateDrawingPositionInput,od as validateRasterHeader,dj as validateSetImagePositionCommand}from'./chunk-XRBPZCNK.js';import'./chunk-S6J4O5XP.js';
1
+ export{_a as AUTO_ZOOM_MODE,db as BROWSER_AUTOMATION_CAPABILITIES,wa as CHROME_GROUPS,Aa as CHROME_MENUS,Da as CHROME_UNAVAILABLE_KEY,Ia as CONTENT_CONTROL_PICTURE_ACCEPT,Fb as ChromeExportError,Hb as ChromePrintError,Y as DEFAULT_TABLE_CHROME_DRAFT,Db as DocumentRefreshError,Q as EMU_PER_POINT,$a as FIT_WIDTH_ZOOM_MODE,O as IMAGE_OVERLAY_NUDGE_PT,P as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,vb as NO_MIXED_FIELDS,l as PX_PER_CM,k as PX_PER_INCH,r as SNAP_TWIPS_CM,q as SNAP_TWIPS_INCH,ca as TABLE_BORDER_STYLE_OPTIONS,ba as TABLE_BORDER_TARGET_OPTIONS,da as TABLE_BORDER_WIDTH_OPTIONS,Z as TABLE_CHROME_SLOT_IDS,rb as TAB_ALIGNMENT_LABELS,p as TWIPS_PER_CM,o as TWIPS_PER_INCH,Za as ZOOM_MAX,Ya as ZOOM_MIN,zb as alignmentAfterDirectionChange,ea as applyTableChromePick,y as applyThemeShade,x as applyThemeTint,Cb as bindHistoryGroup,d as blankDocumentBytes,Qa as calendarDateForKey,Sa as calendarDateFromText,Ra as calendarDateText,Oa as calendarMonth,Ta as calendarMonthNames,Ma as calendarMonthTitle,Na as calendarWeekdays,M as canExecuteImageCommand,L as captureImageMutationPreconditions,yb as changedFields,Ca as chromeControlCount,Ba as chromeMenuSlots,ia as chromeProbeForSlot,xa as chromeSlotId,oa as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,v as commandExecOptions,ja as commandForSlot,la as commandForSlotValue,ka as commandForTableChromeSlotValue,lb as computeImageResizeResult,V as computeMovedImagePosition,U as computeResizedImageExtentEmu,Ga as contentControlPopupKeyDown,Ha as contentControlPopupOpener,eb as createBrowserAutomationHost,Ua as createContentControlListNavigation,Eb as createDocumentRefresh,cb as createDocxEditor,i as createFontSource,mb as createImageOverlayScrollPort,b as createLayoutShaping,I as cropPercentFromCropPermille,G as cropPercentFromPermille,D as cropPercentFromSourceCrop,H as cropPermilleFromCropPercent,F as cropPermilleFromPercent,hb as cssPixelsToLayoutPoints,j as customFonts,ya as defaultChromeGroups,_ as defaultTableLabel,u as dragIndent,va as editorCommandKey,T as emuToOverlayPoints,Wa as equationAtPosition,N as executeImageCommand,nb as finalizeImageOverlayInteraction,La as firstDayOfWeek,pb as formatInches,za as formattingBarChromeGroups,m as generateRulerTicks,s as handlePosition,qb as inchesToTwips,Ib as isChromePrintShortcut,W as isStaleImageInteractionCommit,$ as isTableChromeSlot,Ja as isoDateOf,gb as layoutPointsToCssPixels,h as loadFonts,A as lowerColorValueForBorder,B as lowerColorValueForFill,wb as mixedFieldsOf,Xa as mountPaginatedSurface,Fa as observeContentControlPopup,ib as overlayFrameToSheetCssPixels,jb as overlayHostOrigin,Ka as parseIsoDate,g as partOfNodeId,S as pointsToEmu,Ea as positionContentControlPopup,fa as probeTableChromeCommand,kb as resizePreservesAspect,C as resolveColorValueToCss,z as resolveThemeColorHex,ab as resolveZoomMode,n as rulerPageBox,Gb as runChromeExport,Jb as runChromePrint,sa as runSave,qa as runTableChromeCommand,ua as runTableCommand,ra as runToolbarCommand,xb as sameTabStops,bb as sameZoomMode,ub as seedFields,R as selectedDrawingOverlayTargetOf,K as selectedImageStateOf,Pa as shiftMonth,tb as signedFirstLineOf,t as snapTwips,E as sourceCropFromCropPercent,sb as specialOf,Va as surfaceExtent,fb as surfacePaintScale,ha as tableChromeIconPaths,ga as tableChromeLabelKeyForTarget,ma as tableChromeToolbarState,aa as tableChromeVisible,X as tableCommandState,ta as tableCommandToolbarState,a as toEditorFontError,na as toolbarCommandState,pa as toolbarCommandStates,Bb as trapTabWithin,ob as twipsToInches,J as validateImageCropPercent,w as validateThemeModifier,Ab as withTabStop}from'./chunk-JNE6QF47.js';export{a as resolveEditorModules}from'./chunk-AJCCS53D.js';import'./chunk-YIBEBHT3.js';export{h as FONT_RESOLVER_BRAND,g as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,d as WORD_DEFAULT_FONT,e as composeFontConfiguration,k as composeFontOrigins,i as defineFontResolver,j as isFontResolver}from'./chunk-KPSGB64S.js';export{r as disposeLayoutShaping}from'./chunk-SI5FLZGU.js';import'./chunk-RIYSCEFQ.js';import'./chunk-ZXAGLAY2.js';import'./chunk-3OMDEMLL.js';import'./chunk-J3EM5ZEA.js';import'./chunk-QQAF64KN.js';import'./chunk-G765WG4R.js';import'./chunk-SOUJNWXV.js';import'./chunk-XWXJB4J7.js';import'./chunk-XMWH2R23.js';import'./chunk-6JIJOZDW.js';import'./chunk-2LXGB2X7.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,dj as DRAWING_REL_FROM_H,ej as DRAWING_REL_FROM_V,Xc as IMAGE_WRAP_TARGETS,Rh as TEXT_FORM_FORMATS,gj as positionInputFromPropertiesCommand,fj as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,qd as resolveSvgIntrinsicSize,md as sniffImageMime,cj as validateDrawingPositionInput,rd as validateRasterHeader,hj as validateSetImagePositionCommand}from'./chunk-JXL25DRU.js';import'./chunk-S6J4O5XP.js';
package/dist/export.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkFWX535CS_cjs=require('./chunk-FWX535CS.cjs'),chunkJN62FLHE_cjs=require('./chunk-JN62FLHE.cjs'),chunkRLO64PHP_cjs=require('./chunk-RLO64PHP.cjs'),chunkQ4RDWB3U_cjs=require('./chunk-Q4RDWB3U.cjs'),chunkPCPBDYEL_cjs=require('./chunk-PCPBDYEL.cjs');require('./chunk-EHT4LKKZ.cjs');var chunkT7RGKBCE_cjs=require('./chunk-T7RGKBCE.cjs'),chunk6KA3L3FR_cjs=require('./chunk-6KA3L3FR.cjs');function I(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}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((d,c)=>d.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let d of o.text){let c=d.toUpperCase()!==d,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(d))?y.text+=d:i.push({text:d,start:s,lower:c}),s+=d.length;}let a=[],u=[],p=[],l=true,g=0;for(let d of o.environment.direction==="rtl"?i.reverse():i){let c=d.lower?.8:1,y=[],R=[],b="",f=d.start;for(let F of d.text){let m=d.lower?F.toUpperCase():F;for(let E=0;E<m.length;E++)y.push(f),R.push(f+F.length);b+=m,f+=F.length;}let h=e.shape({...n,text:b}),x=a.length;for(let[F,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[F];E===void 0?l=false:p.push(E*c),a.push({...m,cluster:y[m.cluster]??d.start,originX:chunkQ4RDWB3U_cjs.o(g+Math.round(m.originX*c)),originY:chunkQ4RDWB3U_cjs.o(Math.round(m.originY*c)),offsetX:chunkQ4RDWB3U_cjs.o(Math.round(m.offsetX*c)),offsetY:chunkQ4RDWB3U_cjs.o(Math.round(m.offsetY*c)),advanceX:chunkQ4RDWB3U_cjs.o(Math.round(m.advanceX*c)),advanceY:chunkQ4RDWB3U_cjs.o(Math.round(m.advanceY*c)),drawScale:c});}for(let F of h.clusters){let m=y[F.textStart]??d.start,E=R[F.textEnd-1]??f,L=chunkQ4RDWB3U_cjs.o(Math.round(F.advance*c)),A=u.at(-1);A&&A.textStart===m&&A.textEnd===E?u[u.length-1]={...A,glyphEnd:x+F.glyphEnd,advance:chunkQ4RDWB3U_cjs.o(A.advance+L),caretEdges:[chunkQ4RDWB3U_cjs.o(0),chunkQ4RDWB3U_cjs.o(A.advance+L)]}:u.push({...F,textStart:m,textEnd:E,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:L,caretEdges:F.caretEdges.map(G=>chunkQ4RDWB3U_cjs.o(Math.round(G*c))),fontSpan:0});}g+=h.glyphs.reduce((F,m)=>F+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:u,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:l&&p.length===a.length?p:void 0}}var nt=new WeakMap;function Nt(e){let o=nt.get(e);return o===void 0&&(o=Ct(e.bytes,e.faceIndex),nt.set(e,o)),o}var _t=new Set(["COLR","CBDT","sbix"]),Mt=512;function Ct(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(rt(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),Mt);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(_t.has(rt(e,s)))return true}return false}function rt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var Ut=/\p{Emoji_Presentation}|️/u;function Bt(e){return Ut.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(Nt);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Bt(o)?[...t,...n]:[...n,...t]}var qt=2048;function it(e,o,t,n){if(!t.clusters.length||t.clusters.length>qt)return null;let r=(f,h)=>{let{context:x,...F}=o,m={...F,text:h,environment:chunkQ4RDWB3U_cjs.q({...o.environment,font:f})};return I(e,m,e.shape(m))},i=[],s=new Map;for(let f of [...t.clusters].sort((h,x)=>h.textStart-x.textStart)){let h=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=i.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(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),L=s.get(x)??q(n,E).find(A=>{try{return !r(A,x).glyphs.some(G=>G.id===0)}catch{return false}});if(!L)return null;s.set(x,L),h=L;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],u=[],p=[],l=[],g=true,d=0,c=0,y=0,R=0,b=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let x=a.length,F=p.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:chunkQ4RDWB3U_cjs.o(d+m.originX),originY:chunkQ4RDWB3U_cjs.o(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)l.push(m);for(let m of h.clusters)u.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:x+m.glyphStart,glyphEnd:x+m.glyphEnd,fontSpan:F});h.glyphs.length&&p.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),d+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),R=Math.max(R,h.metrics.descent),b=Math.max(b,h.metrics.lineGap);}return chunkQ4RDWB3U_cjs.t({...t,glyphs:a,clusters:u,fontSpans:p,exactAdvancesX:g&&l.length===a.length?l:void 0,metrics:{ascent:chunkQ4RDWB3U_cjs.o(y),descent:chunkQ4RDWB3U_cjs.o(R),lineGap:chunkQ4RDWB3U_cjs.o(b)}},{...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 "]]]),zt=512,at=new WeakMap;function Ht(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=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=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let u=r(a+4);if(u<0||u>1024)return t;let p=-1;for(let c=0;c<u;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){p=i(y+8);break}}if(p<0)return t;let l=r(p+4);if(l<=0)return t;let g=p+l,d=r(g);if(d<0)return t;for(let c=0;c<Math.min(d,zt);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Xt(e,o){let t=at.get(e);return t||(t=Ht(e.bytes,e.faceIndex),at.set(e,t)),(jt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function st(e,o){let t=e.filter(n=>Xt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function J(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t;try{let i=e.shape({...o,text:r});return chunkQ4RDWB3U_cjs.t({...i,text:o.text},o.environment)}catch{return t}}function lt(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 chunkQ4RDWB3U_cjs.e)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let u=e.shaper.shape(a),p=r.get(u);if(p&&p.input.text===a.text&&p.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&p.input.bidiLevel===a.bidiLevel&&p.input.context?.before===a.context?.before&&p.input.context?.after===a.context?.after&&p.input.environment===a.environment)return p.run;let l=s(a,J(e.shaper,a,u));return r.set(u,{input:a,run:l}),l}},s=(a,u)=>{let p=I(n,a,u);if(!p.glyphs.some(l=>l.id===0)||/^[\t\n\r\f]*$/.test(a.text))return p;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let l=it(n,a,p,t);if(l)return l}for(let l of st(q(t,a.text),a.environment.script))if(!(l.hash===a.environment.font.hash&&l.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:chunkQ4RDWB3U_cjs.q({...a.environment,font:l})},d=I(n,g,n.shape(g));if(!d.glyphs.some(c=>c.id===0))return d}catch{}return p};return {...e,shaper:i}}var Q=chunkQ4RDWB3U_cjs.c;function ee(e){return typeof e.admittedFontFace=="function"}var Gt=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 dt=new WeakMap;function z(e){let o=dt.get(e);return o||dt.set(e,o=Vt(e)),o}function Vt(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 Wt(e){return Object.freeze({...z(e),bytes:chunkQ4RDWB3U_cjs.j(e)})}function Yt(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkQ4RDWB3U_cjs.e?null:Wt(t)}catch{return null}}function ct(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Yt(e.resolve(),o)}}function $t(e){return Object.freeze(e.slice(0,Q).map(o=>Object.freeze({request:j(o.request),partName:o.partName,reason:o.reason})))}function te(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let u=a.toLowerCase();i.has(u)||i.set(u,a);}let s=[...i.values()].map(a=>{let u=[];for(let p of Gt){let l=n?.({family:a,...p});!l||l instanceof chunkQ4RDWB3U_cjs.e||u.push(Object.freeze({...p,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}return Object.freeze({family:a,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:$t(r)})}function oe(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 ne(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new chunkRLO64PHP_cjs.d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function H(){return new Map}function re(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=chunkQ4RDWB3U_cjs.i(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof chunkQ4RDWB3U_cjs.e?null:s}function ut(e,o,t){let n=t.fontFamily??e.defaultFont.family;return re(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=chunkQ4RDWB3U_cjs.sa(n.style,n.fontSlot),i=chunkQ4RDWB3U_cjs.$(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=re(e,o,s,r);if(!a)return null;try{if(r.smallCaps&&!chunkJN62FLHE_cjs.$(e.shaper,e.environment,a,r,t))return null;let u=chunkJN62FLHE_cjs._(e.shaper,e.environment,a,r,i);return Object.freeze({run:u,font:z(u.fontSpans[0]?.font??a),...u.fontSpans.length>1?{fonts:Object.freeze(u.fontSpans.map(p=>z(p.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function pt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,X=new WeakMap,se=0,_,le=32,ft=chunkQ4RDWB3U_cjs.d;function mt(){if(_)return _;let e=(async()=>(await chunkJN62FLHE_cjs.c(),chunkJN62FLHE_cjs.h(chunkJN62FLHE_cjs.i)))();return _=e,e.catch(()=>{_===e&&(_=void 0);}),e}function yt(e){let o=H();return chunkJN62FLHE_cjs.ba(e,{resolveFont(t){return ut(e,o,t)},fallback:chunkQ4RDWB3U_cjs.fa()})}async function ht(e,o,t=[],n=false){if(!chunkJN62FLHE_cjs.k(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await mt(),i=lt(await chunkJN62FLHE_cjs.r(e,r,chunkJN62FLHE_cjs.i,o,n),t);return Object.freeze({createMeasurer:()=>yt(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${chunkQ4RDWB3U_cjs.ea}`].join("|"),extensionFingerprint:e.fingerprint})}function Kt(e,o){if(!chunkJN62FLHE_cjs.k(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=X.get(e);if(t)return t;let n=chunkJN62FLHE_cjs.m(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let u=chunkJN62FLHE_cjs.l(e).sources.reduce((l,g)=>l+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+u>ft)throw new RangeError(`Shared exporter shaping font bytes are limited to ${ft} process-wide`);se+=u;let p;try{let l=await mt();p=await chunkJN62FLHE_cjs.r(e,l,chunkJN62FLHE_cjs.i,o);}catch(l){throw se-=u,l}return Object.freeze({createMeasurer:()=>yt(p),shapeLaidOutText:ae(p),shapingHash:p.operation.shapingHash,producerVersion:p.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${chunkQ4RDWB3U_cjs.ea}`].join("|"),extensionFingerprint:i}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var Zt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function Jt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Zt),n;if(t){let r=chunk6KA3L3FR_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunk6KA3L3FR_cjs.ge(o,n)}function gt(e,o){let t=Jt(e);if(t.length!==0)return chunkFWX535CS_cjs.i(n=>{let r=new Set((n.resolvedFaces??[]).map(s=>chunkQ4RDWB3U_cjs.i(s))),i=chunkFWX535CS_cjs.o(t,{maxFontBytes:chunkQ4RDWB3U_cjs.b,aggregateBudget:Qt(n),shadowedRequests:r});if(o)for(let s of i.dropped){if(o.dropped.length>=Q)break;o.dropped.push(s);}return {sources:i.sources}})}function Qt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkQ4RDWB3U_cjs.d:Math.max(0,chunkQ4RDWB3U_cjs.d-o)}function eo(e){return ee(e)&&ie(e)}var w=0,xt=Symbol("font-resolution-timeout");function to(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>chunkQ4RDWB3U_cjs.d)throw new chunkRLO64PHP_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkQ4RDWB3U_cjs.d}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ce(e,o){return e.attributes.find(t=>t.localName===o)?.value}function oo(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunk6KA3L3FR_cjs.da||t.namespaceUri===""))?.value}async function no(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=chunkT7RGKBCE_cjs.Ka(e);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:u,documentLigatures:p,...l}=o,g=Array.isArray(n)?n:[n],d=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await ro(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:u,documentLigatures:p,lastResortFonts:d,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof chunkRLO64PHP_cjs.d&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new chunkRLO64PHP_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=chunkRLO64PHP_cjs.e(t.view,{...l,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!R.ok)return y?.dispose(),R;let b=R.session,f=y,h="active",x=()=>h==="aborted"?new chunkRLO64PHP_cjs.d("aborted","Export resource settlement was aborted"):new chunkRLO64PHP_cjs.d("disposed","Export session has been disposed"),F=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{b.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>F("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?b.layout():Promise.reject(x()),layoutFor:E=>h==="active"?b.layoutFor(E):Promise.reject(x()),validatedImageBytes:E=>h==="active"?b.validatedImageBytes(E):null,admittedFontFace:ct({status:()=>h,unavailable:x,resolve:()=>f?.resolveFont}),shapeLaidOutText:pt({status:()=>h,unavailable:x,shaping:()=>f}),dispose:()=>F("disposed")})}}async function ro(e,o,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n=io(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(xt),n);try{de(r.signal);let a=(async()=>{let u=to(t.onActiveFontBytesChange),p=!1;try{let l=so(e).slice(0,chunkFWX535CS_cjs.c),g=[],d={dropped:[]},c=gt(e,d),y=[...o,...c?[c]:[],...t.lastResortFonts??[]],R=await chunkFWX535CS_cjs.l(y,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...l])].slice(0,chunkFWX535CS_cjs.c),defaultFamily:chunkFWX535CS_cjs.d.family,signal:r.signal},{onOriginFailure:x=>g.push(x),reserveOwnedBytes:u.reserve});de(r.signal);let b=chunkFWX535CS_cjs.e(R??{});if(b.sources.length===0){let x=te(l,b.defaultFont.family,g,void 0,d.dropped);oe(x,t),ne(x,t);return}let f=await ht(chunkJN62FLHE_cjs.o(b),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let h=te(l,b.defaultFont.family,g,f.resolveFont,d.dropped);return oe(h,t),ne(h,t),p=!0,Object.freeze({...f,dispose:u.release})}finally{p||u.release();}})();return await Promise.race([a,ao(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function io(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 ao(e){return new Promise((o,t)=>{let n=()=>{t(Ft(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function Ft(e){let o=e.reason===xt;return new chunkRLO64PHP_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 Ft(e)}function so(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(l,g)=>{!g||r.has(g.name)||(r.add(g.name),l.push(g.root));};for(let l of e.headerFooterPartsBySection()){for(let g of l.headers.values())i(t,g);for(let g of l.footers.values())i(t,g);}for(let l of ["footnote","endnote"])n.push(...lo(e,l));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},u=new Map,p=(l,g)=>{let d=chunkPCPBDYEL_cjs.d(l,e.stylesRoot(),a,uo(l,g)),c=chunkFWX535CS_cjs.v(l,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...d.direct,...mo(l),...c,...chunkFWX535CS_cjs.s(l,e.stylesRoot(),a),...d.inherited]){let R=y.toLowerCase();u.has(R)||u.set(R,y);}};return p(o,"body"),p(t,"furniture"),p(n,"note"),[...u.values()]}function lo(e,o){let t=chunk6KA3L3FR_cjs.bg(e.currentPackage(),o);if(!t)return [];let n=new Set(chunk6KA3L3FR_cjs.cg(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let s=chunk6KA3L3FR_cjs.Yb(i),a=chunk6KA3L3FR_cjs.Xb(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var co="http://schemas.openxmlformats.org/officeDocument/2006/math";function uo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===chunk6KA3L3FR_cjs.da&&s.localName==="p"&&r.push({paragraph:s,context:a});let u=s.namespaceUri===chunk6KA3L3FR_cjs.da&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let p=s.children.length-1;p>=0;p-=1){let l=s.children[p];l.kind!=="textValue"&&i.push({node:l,context:u});}}for(let s of r)po(s.paragraph,t,s.context);}return t}function po(e,o,t){let n=chunkQ4RDWB3U_cjs.gb(),r=null,i=null,s="",a=false,u=false,p=false,l=0,g=[];for(let d=e.children.length-1;d>=0;d-=1){let c=e.children[d];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:d,runId:c,visibility:y,containerDepth:R}=g.pop();if(R>=chunk6KA3L3FR_cjs.la||d.namespaceUri===chunk6KA3L3FR_cjs.da&&d.localName==="p")continue;let b=d.namespaceUri===chunk6KA3L3FR_cjs.da&&d.localName==="r"?d.id:c;if(d.namespaceUri===chunk6KA3L3FR_cjs.da&&d.localName==="fldSimple"){let f=ce(d,"instr")??"";chunkQ4RDWB3U_cjs.$c(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&fo(d)!==D&&o.add(d.id);}if(d.namespaceUri===chunk6KA3L3FR_cjs.da&&d.localName==="fldChar"){let f=ce(d,"fldCharType");if(f==="begin")chunkQ4RDWB3U_cjs.jb(n),n.nesting===1&&(r=b,i=null,s="",a=false,u=false,p=chunk6KA3L3FR_cjs.ve(d),l=0);else if(f==="separate"){let h=n.nesting===1;if(chunkQ4RDWB3U_cjs.lb(n),h){let x=chunkQ4RDWB3U_cjs.ib(n);s=x.instruction,a=x.overflow||n.nestingOverflow,i=b,u=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=chunkQ4RDWB3U_cjs.ib(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&chunkQ4RDWB3U_cjs._c(s,{hasSeparate:u,hasLegacyFormData:p,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&l!==D){let x=i??r;x&&o.add(x);}}chunkQ4RDWB3U_cjs.mb(n);}continue}if(d.namespaceUri===chunk6KA3L3FR_cjs.da&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkQ4RDWB3U_cjs.kb(n,Ot(d),d.localName==="delInstrText");continue}n.nesting>0&&chunkQ4RDWB3U_cjs.nb(n)&&d.namespaceUri===chunk6KA3L3FR_cjs.da&&Et(d)&&(l|=y);for(let f=d.children.length-1;f>=0;f-=1){let h=d.children[f];h.kind!=="textValue"&&g.push({node:h,runId:b,visibility:y&St(d),containerDepth:chunk6KA3L3FR_cjs.ma(d,R)});}}chunkQ4RDWB3U_cjs.hb(n);}function Et(e){return e.localName==="t"||e.localName==="delText"?Ot(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ue=1,bt=2,Rt=4,D=ue|bt|Rt;function fo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunk6KA3L3FR_cjs.da&&n.localName==="p")){if(n.namespaceUri===chunk6KA3L3FR_cjs.da&&Et(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&St(n)});}}return t}function St(e){return e.namespaceUri!==chunk6KA3L3FR_cjs.da?D:e.localName==="ins"||e.localName==="moveTo"?ue|bt:e.localName==="del"||e.localName==="moveFrom"?ue|Rt:D}function mo(e){let o=new Map,t=n=>{let r=chunkPCPBDYEL_cjs.a(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===co&&t(chunkQ4RDWB3U_cjs.Zb),i.namespaceUri===chunk6KA3L3FR_cjs.da&&i.localName==="sym"&&t(chunkPCPBDYEL_cjs.b(oo(i,"font"))),i.namespaceUri===chunk6KA3L3FR_cjs.da&&i.localName==="fldSimple"){let s=ce(i,"instr");t(chunkQ4RDWB3U_cjs.Vc(s??"")?.font??null);}if(i.namespaceUri===chunk6KA3L3FR_cjs.da&&i.localName==="p")for(let s of chunkFWX535CS_cjs.u(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Ot(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 r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var At="FILE_TOO_LARGE",vt=8;function yo(e){return typeof e=="object"&&e!==null}function Tt(e){if(!(!yo(e)||typeof e.code!="string"))return e.code}function Lt(e){return e===""||e.toLowerCase()==="localhost"}function ho(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function Pt(e){let o=ho(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 Dt(e){let o=Pt(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function go(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function xo(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(!Lt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Dt(o.pathname);if(t===null||go(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Fo(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 Eo(e){let o=Fo(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>vt)throw new TypeError(`trustedRoot must not exceed ${vt} directories`);return o.map(xo)}function bo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkQ4RDWB3U_cjs.b)throw new TypeError(`maxBytes must not exceed ${chunkQ4RDWB3U_cjs.b}`);return e}function Ro(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Lt(e.host))return null;let t=Pt(e.pathname);if(t===null)return null;for(let n of o){let r=Dt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function So(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 Oo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function wt(e,o,t){return e.some(n=>Oo(n,o,t))}async function vo(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(Tt(r)==="ENOENT")continue;throw r}return t}function wo(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),p=e.map(y=>u.resolve(a(y.href))),l=u.resolve(a(typeof o=="string"?o:o.href));if(!wt(p,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",d=await r(l,g),c=()=>{d.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(l);if(!wt(await vo(p,i),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let R=(await d.stat()).size;if(!Number.isSafeInteger(R)||R<0||R>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:At});let b=new Uint8Array(R),f=0;for(;f<b.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await d.read(b,f,b.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===b.byteLength?b:b.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await d.close().catch(()=>{});}}}function Ao(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=Eo(e.trustedRoot),t=bo(e.maxBytes),n=e.read??wo(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let u=So(i);if(u.protocol!=="file:")return r(u,s);let p=Ro(u,o);if(!p)return new Response(null,{status:404});let l=a?new AbortController:void 0,g=()=>l?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let d;try{if(d=await n(p,{maxBytes:t,...l?{signal:l.signal}:{}}),a?.aborted)throw a.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(l?.signal.aborted)throw l.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=Tt(c);if(y===At)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(d,{status:200})})}
2
- Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunkRLO64PHP_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunkRLO64PHP_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunkRLO64PHP_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunkRLO64PHP_cjs.e}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=le;exports.acquireSharedExportShaping=Kt;exports.createPackagedFileFetch=Ao;exports.hasExportAdmittedFont=ee;exports.hasExportLaidOutText=ie;exports.hasFontBackedExportCapabilities=eo;exports.openFontBackedDocumentForExport=no;
1
+ 'use strict';var chunkDF7F7TNU_cjs=require('./chunk-DF7F7TNU.cjs'),chunkAKF5KM2W_cjs=require('./chunk-AKF5KM2W.cjs'),chunkZSM6X52G_cjs=require('./chunk-ZSM6X52G.cjs'),chunkW3ZUPQIZ_cjs=require('./chunk-W3ZUPQIZ.cjs'),chunk6CPYOVRT_cjs=require('./chunk-6CPYOVRT.cjs');require('./chunk-TBFZZX7Z.cjs');var chunkP4SBMHHO_cjs=require('./chunk-P4SBMHHO.cjs'),chunkT4TKRNZT_cjs=require('./chunk-T4TKRNZT.cjs');function I(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}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((d,c)=>d.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let d of o.text){let c=d.toUpperCase()!==d,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(d))?y.text+=d:i.push({text:d,start:s,lower:c}),s+=d.length;}let a=[],u=[],p=[],l=true,g=0;for(let d of o.environment.direction==="rtl"?i.reverse():i){let c=d.lower?.8:1,y=[],R=[],b="",f=d.start;for(let F of d.text){let m=d.lower?F.toUpperCase():F;for(let E=0;E<m.length;E++)y.push(f),R.push(f+F.length);b+=m,f+=F.length;}let h=e.shape({...n,text:b}),x=a.length;for(let[F,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[F];E===void 0?l=false:p.push(E*c),a.push({...m,cluster:y[m.cluster]??d.start,originX:chunkW3ZUPQIZ_cjs.o(g+Math.round(m.originX*c)),originY:chunkW3ZUPQIZ_cjs.o(Math.round(m.originY*c)),offsetX:chunkW3ZUPQIZ_cjs.o(Math.round(m.offsetX*c)),offsetY:chunkW3ZUPQIZ_cjs.o(Math.round(m.offsetY*c)),advanceX:chunkW3ZUPQIZ_cjs.o(Math.round(m.advanceX*c)),advanceY:chunkW3ZUPQIZ_cjs.o(Math.round(m.advanceY*c)),drawScale:c});}for(let F of h.clusters){let m=y[F.textStart]??d.start,E=R[F.textEnd-1]??f,L=chunkW3ZUPQIZ_cjs.o(Math.round(F.advance*c)),A=u.at(-1);A&&A.textStart===m&&A.textEnd===E?u[u.length-1]={...A,glyphEnd:x+F.glyphEnd,advance:chunkW3ZUPQIZ_cjs.o(A.advance+L),caretEdges:[chunkW3ZUPQIZ_cjs.o(0),chunkW3ZUPQIZ_cjs.o(A.advance+L)]}:u.push({...F,textStart:m,textEnd:E,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:L,caretEdges:F.caretEdges.map(G=>chunkW3ZUPQIZ_cjs.o(Math.round(G*c))),fontSpan:0});}g+=h.glyphs.reduce((F,m)=>F+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:u,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:l&&p.length===a.length?p:void 0}}var nt=new WeakMap;function Nt(e){let o=nt.get(e);return o===void 0&&(o=Ct(e.bytes,e.faceIndex),nt.set(e,o)),o}var _t=new Set(["COLR","CBDT","sbix"]),Mt=512;function Ct(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(rt(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),Mt);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(_t.has(rt(e,s)))return true}return false}function rt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var Ut=/\p{Emoji_Presentation}|️/u;function Bt(e){return Ut.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(Nt);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Bt(o)?[...t,...n]:[...n,...t]}var qt=2048;function it(e,o,t,n){if(!t.clusters.length||t.clusters.length>qt)return null;let r=(f,h)=>{let{context:x,...F}=o,m={...F,text:h,environment:chunkW3ZUPQIZ_cjs.q({...o.environment,font:f})};return I(e,m,e.shape(m))},i=[],s=new Map;for(let f of [...t.clusters].sort((h,x)=>h.textStart-x.textStart)){let h=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=i.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(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),L=s.get(x)??q(n,E).find(A=>{try{return !r(A,x).glyphs.some(G=>G.id===0)}catch{return false}});if(!L)return null;s.set(x,L),h=L;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],u=[],p=[],l=[],g=true,d=0,c=0,y=0,R=0,b=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let x=a.length,F=p.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:chunkW3ZUPQIZ_cjs.o(d+m.originX),originY:chunkW3ZUPQIZ_cjs.o(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)l.push(m);for(let m of h.clusters)u.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:x+m.glyphStart,glyphEnd:x+m.glyphEnd,fontSpan:F});h.glyphs.length&&p.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),d+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),R=Math.max(R,h.metrics.descent),b=Math.max(b,h.metrics.lineGap);}return chunkW3ZUPQIZ_cjs.t({...t,glyphs:a,clusters:u,fontSpans:p,exactAdvancesX:g&&l.length===a.length?l:void 0,metrics:{ascent:chunkW3ZUPQIZ_cjs.o(y),descent:chunkW3ZUPQIZ_cjs.o(R),lineGap:chunkW3ZUPQIZ_cjs.o(b)}},{...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 "]]]),zt=512,at=new WeakMap;function Ht(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=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=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let u=r(a+4);if(u<0||u>1024)return t;let p=-1;for(let c=0;c<u;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){p=i(y+8);break}}if(p<0)return t;let l=r(p+4);if(l<=0)return t;let g=p+l,d=r(g);if(d<0)return t;for(let c=0;c<Math.min(d,zt);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Xt(e,o){let t=at.get(e);return t||(t=Ht(e.bytes,e.faceIndex),at.set(e,t)),(jt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function st(e,o){let t=e.filter(n=>Xt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function J(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t;try{let i=e.shape({...o,text:r});return chunkW3ZUPQIZ_cjs.t({...i,text:o.text},o.environment)}catch{return t}}function lt(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 chunkW3ZUPQIZ_cjs.e)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let u=e.shaper.shape(a),p=r.get(u);if(p&&p.input.text===a.text&&p.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&p.input.bidiLevel===a.bidiLevel&&p.input.context?.before===a.context?.before&&p.input.context?.after===a.context?.after&&p.input.environment===a.environment)return p.run;let l=s(a,J(e.shaper,a,u));return r.set(u,{input:a,run:l}),l}},s=(a,u)=>{let p=I(n,a,u);if(!p.glyphs.some(l=>l.id===0)||/^[\t\n\r\f]*$/.test(a.text))return p;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let l=it(n,a,p,t);if(l)return l}for(let l of st(q(t,a.text),a.environment.script))if(!(l.hash===a.environment.font.hash&&l.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:chunkW3ZUPQIZ_cjs.q({...a.environment,font:l})},d=I(n,g,n.shape(g));if(!d.glyphs.some(c=>c.id===0))return d}catch{}return p};return {...e,shaper:i}}var Q=chunkW3ZUPQIZ_cjs.c;function ee(e){return typeof e.admittedFontFace=="function"}var Gt=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 dt=new WeakMap;function z(e){let o=dt.get(e);return o||dt.set(e,o=Vt(e)),o}function Vt(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 Wt(e){return Object.freeze({...z(e),bytes:chunkW3ZUPQIZ_cjs.j(e)})}function Yt(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkW3ZUPQIZ_cjs.e?null:Wt(t)}catch{return null}}function ct(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Yt(e.resolve(),o)}}function $t(e){return Object.freeze(e.slice(0,Q).map(o=>Object.freeze({request:j(o.request),partName:o.partName,reason:o.reason})))}function te(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let u=a.toLowerCase();i.has(u)||i.set(u,a);}let s=[...i.values()].map(a=>{let u=[];for(let p of Gt){let l=n?.({family:a,...p});!l||l instanceof chunkW3ZUPQIZ_cjs.e||u.push(Object.freeze({...p,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}return Object.freeze({family:a,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:$t(r)})}function oe(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 ne(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new chunkZSM6X52G_cjs.d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function H(){return new Map}function re(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=chunkW3ZUPQIZ_cjs.i(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof chunkW3ZUPQIZ_cjs.e?null:s}function ut(e,o,t){let n=t.fontFamily??e.defaultFont.family;return re(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=chunkW3ZUPQIZ_cjs.sa(n.style,n.fontSlot),i=chunkW3ZUPQIZ_cjs.$(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=re(e,o,s,r);if(!a)return null;try{if(r.smallCaps&&!chunkAKF5KM2W_cjs.$(e.shaper,e.environment,a,r,t))return null;let u=chunkAKF5KM2W_cjs._(e.shaper,e.environment,a,r,i);return Object.freeze({run:u,font:z(u.fontSpans[0]?.font??a),...u.fontSpans.length>1?{fonts:Object.freeze(u.fontSpans.map(p=>z(p.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function pt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,X=new WeakMap,se=0,_,le=32,ft=chunkW3ZUPQIZ_cjs.d;function mt(){if(_)return _;let e=(async()=>(await chunkAKF5KM2W_cjs.d(),chunkAKF5KM2W_cjs.h(chunkAKF5KM2W_cjs.i)))();return _=e,e.catch(()=>{_===e&&(_=void 0);}),e}function yt(e){let o=H();return chunkAKF5KM2W_cjs.ba(e,{resolveFont(t){return ut(e,o,t)},fallback:chunkW3ZUPQIZ_cjs.fa()})}async function ht(e,o,t=[],n=false){if(!chunkAKF5KM2W_cjs.k(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await mt(),i=lt(await chunkAKF5KM2W_cjs.r(e,r,chunkAKF5KM2W_cjs.i,o,n),t);return Object.freeze({createMeasurer:()=>yt(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${chunkW3ZUPQIZ_cjs.ea}`].join("|"),extensionFingerprint:e.fingerprint})}function Kt(e,o){if(!chunkAKF5KM2W_cjs.k(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=X.get(e);if(t)return t;let n=chunkAKF5KM2W_cjs.m(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let u=chunkAKF5KM2W_cjs.l(e).sources.reduce((l,g)=>l+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+u>ft)throw new RangeError(`Shared exporter shaping font bytes are limited to ${ft} process-wide`);se+=u;let p;try{let l=await mt();p=await chunkAKF5KM2W_cjs.r(e,l,chunkAKF5KM2W_cjs.i,o);}catch(l){throw se-=u,l}return Object.freeze({createMeasurer:()=>yt(p),shapeLaidOutText:ae(p),shapingHash:p.operation.shapingHash,producerVersion:p.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${chunkW3ZUPQIZ_cjs.ea}`].join("|"),extensionFingerprint:i}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var Zt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function Jt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Zt),n;if(t){let r=chunkT4TKRNZT_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkT4TKRNZT_cjs.je(o,n)}function gt(e,o){let t=Jt(e);if(t.length!==0)return chunkDF7F7TNU_cjs.i(n=>{let r=new Set((n.resolvedFaces??[]).map(s=>chunkW3ZUPQIZ_cjs.i(s))),i=chunkDF7F7TNU_cjs.o(t,{maxFontBytes:chunkW3ZUPQIZ_cjs.b,aggregateBudget:Qt(n),shadowedRequests:r});if(o)for(let s of i.dropped){if(o.dropped.length>=Q)break;o.dropped.push(s);}return {sources:i.sources}})}function Qt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkW3ZUPQIZ_cjs.d:Math.max(0,chunkW3ZUPQIZ_cjs.d-o)}function eo(e){return ee(e)&&ie(e)}var w=0,xt=Symbol("font-resolution-timeout");function to(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>chunkW3ZUPQIZ_cjs.d)throw new chunkZSM6X52G_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkW3ZUPQIZ_cjs.d}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ce(e,o){return e.attributes.find(t=>t.localName===o)?.value}function oo(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunkT4TKRNZT_cjs.fa||t.namespaceUri===""))?.value}async function no(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=chunkP4SBMHHO_cjs.Ka(e);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:u,documentLigatures:p,...l}=o,g=Array.isArray(n)?n:[n],d=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await ro(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:u,documentLigatures:p,lastResortFonts:d,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof chunkZSM6X52G_cjs.d&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new chunkZSM6X52G_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=chunkZSM6X52G_cjs.e(t.view,{...l,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!R.ok)return y?.dispose(),R;let b=R.session,f=y,h="active",x=()=>h==="aborted"?new chunkZSM6X52G_cjs.d("aborted","Export resource settlement was aborted"):new chunkZSM6X52G_cjs.d("disposed","Export session has been disposed"),F=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{b.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>F("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?b.layout():Promise.reject(x()),layoutFor:E=>h==="active"?b.layoutFor(E):Promise.reject(x()),validatedImageBytes:E=>h==="active"?b.validatedImageBytes(E):null,admittedFontFace:ct({status:()=>h,unavailable:x,resolve:()=>f?.resolveFont}),shapeLaidOutText:pt({status:()=>h,unavailable:x,shaping:()=>f}),dispose:()=>F("disposed")})}}async function ro(e,o,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n=io(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(xt),n);try{de(r.signal);let a=(async()=>{let u=to(t.onActiveFontBytesChange),p=!1;try{let l=so(e).slice(0,chunkDF7F7TNU_cjs.c),g=[],d={dropped:[]},c=gt(e,d),y=[...o,...c?[c]:[],...t.lastResortFonts??[]],R=await chunkDF7F7TNU_cjs.l(y,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...l])].slice(0,chunkDF7F7TNU_cjs.c),defaultFamily:chunkDF7F7TNU_cjs.d.family,signal:r.signal},{onOriginFailure:x=>g.push(x),reserveOwnedBytes:u.reserve});de(r.signal);let b=chunkDF7F7TNU_cjs.e(R??{});if(b.sources.length===0){let x=te(l,b.defaultFont.family,g,void 0,d.dropped);oe(x,t),ne(x,t);return}let f=await ht(chunkAKF5KM2W_cjs.o(b),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let h=te(l,b.defaultFont.family,g,f.resolveFont,d.dropped);return oe(h,t),ne(h,t),p=!0,Object.freeze({...f,dispose:u.release})}finally{p||u.release();}})();return await Promise.race([a,ao(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function io(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 ao(e){return new Promise((o,t)=>{let n=()=>{t(Ft(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function Ft(e){let o=e.reason===xt;return new chunkZSM6X52G_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 Ft(e)}function so(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(l,g)=>{!g||r.has(g.name)||(r.add(g.name),l.push(g.root));};for(let l of e.headerFooterPartsBySection()){for(let g of l.headers.values())i(t,g);for(let g of l.footers.values())i(t,g);}for(let l of ["footnote","endnote"])n.push(...lo(e,l));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},u=new Map,p=(l,g)=>{let d=chunk6CPYOVRT_cjs.d(l,e.stylesRoot(),a,uo(l,g)),c=chunkDF7F7TNU_cjs.v(l,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...d.direct,...mo(l),...c,...chunkDF7F7TNU_cjs.s(l,e.stylesRoot(),a),...d.inherited]){let R=y.toLowerCase();u.has(R)||u.set(R,y);}};return p(o,"body"),p(t,"furniture"),p(n,"note"),[...u.values()]}function lo(e,o){let t=chunkT4TKRNZT_cjs.eg(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkT4TKRNZT_cjs.fg(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let s=chunkT4TKRNZT_cjs._b(i),a=chunkT4TKRNZT_cjs.Zb(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var co="http://schemas.openxmlformats.org/officeDocument/2006/math";function uo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===chunkT4TKRNZT_cjs.fa&&s.localName==="p"&&r.push({paragraph:s,context:a});let u=s.namespaceUri===chunkT4TKRNZT_cjs.fa&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let p=s.children.length-1;p>=0;p-=1){let l=s.children[p];l.kind!=="textValue"&&i.push({node:l,context:u});}}for(let s of r)po(s.paragraph,t,s.context);}return t}function po(e,o,t){let n=chunkW3ZUPQIZ_cjs.hb(),r=null,i=null,s="",a=false,u=false,p=false,l=0,g=[];for(let d=e.children.length-1;d>=0;d-=1){let c=e.children[d];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:d,runId:c,visibility:y,containerDepth:R}=g.pop();if(R>=chunkT4TKRNZT_cjs.na||d.namespaceUri===chunkT4TKRNZT_cjs.fa&&d.localName==="p")continue;let b=d.namespaceUri===chunkT4TKRNZT_cjs.fa&&d.localName==="r"?d.id:c;if(d.namespaceUri===chunkT4TKRNZT_cjs.fa&&d.localName==="fldSimple"){let f=ce(d,"instr")??"";chunkW3ZUPQIZ_cjs.$c(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&fo(d)!==D&&o.add(d.id);}if(d.namespaceUri===chunkT4TKRNZT_cjs.fa&&d.localName==="fldChar"){let f=ce(d,"fldCharType");if(f==="begin")chunkW3ZUPQIZ_cjs.kb(n),n.nesting===1&&(r=b,i=null,s="",a=false,u=false,p=chunkT4TKRNZT_cjs.ye(d),l=0);else if(f==="separate"){let h=n.nesting===1;if(chunkW3ZUPQIZ_cjs.mb(n),h){let x=chunkW3ZUPQIZ_cjs.jb(n);s=x.instruction,a=x.overflow||n.nestingOverflow,i=b,u=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=chunkW3ZUPQIZ_cjs.jb(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&chunkW3ZUPQIZ_cjs._c(s,{hasSeparate:u,hasLegacyFormData:p,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&l!==D){let x=i??r;x&&o.add(x);}}chunkW3ZUPQIZ_cjs.nb(n);}continue}if(d.namespaceUri===chunkT4TKRNZT_cjs.fa&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkW3ZUPQIZ_cjs.lb(n,Ot(d),d.localName==="delInstrText");continue}n.nesting>0&&chunkW3ZUPQIZ_cjs.ob(n)&&d.namespaceUri===chunkT4TKRNZT_cjs.fa&&Et(d)&&(l|=y);for(let f=d.children.length-1;f>=0;f-=1){let h=d.children[f];h.kind!=="textValue"&&g.push({node:h,runId:b,visibility:y&St(d),containerDepth:chunkT4TKRNZT_cjs.oa(d,R)});}}chunkW3ZUPQIZ_cjs.ib(n);}function Et(e){return e.localName==="t"||e.localName==="delText"?Ot(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ue=1,bt=2,Rt=4,D=ue|bt|Rt;function fo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunkT4TKRNZT_cjs.fa&&n.localName==="p")){if(n.namespaceUri===chunkT4TKRNZT_cjs.fa&&Et(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&St(n)});}}return t}function St(e){return e.namespaceUri!==chunkT4TKRNZT_cjs.fa?D:e.localName==="ins"||e.localName==="moveTo"?ue|bt:e.localName==="del"||e.localName==="moveFrom"?ue|Rt:D}function mo(e){let o=new Map,t=n=>{let r=chunk6CPYOVRT_cjs.a(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===co&&t(chunkW3ZUPQIZ_cjs._b),i.namespaceUri===chunkT4TKRNZT_cjs.fa&&i.localName==="sym"&&t(chunk6CPYOVRT_cjs.b(oo(i,"font"))),i.namespaceUri===chunkT4TKRNZT_cjs.fa&&i.localName==="fldSimple"){let s=ce(i,"instr");t(chunkW3ZUPQIZ_cjs.Vc(s??"")?.font??null);}if(i.namespaceUri===chunkT4TKRNZT_cjs.fa&&i.localName==="p")for(let s of chunkDF7F7TNU_cjs.u(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Ot(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 r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var At="FILE_TOO_LARGE",vt=8;function yo(e){return typeof e=="object"&&e!==null}function Tt(e){if(!(!yo(e)||typeof e.code!="string"))return e.code}function Lt(e){return e===""||e.toLowerCase()==="localhost"}function ho(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function Pt(e){let o=ho(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 Dt(e){let o=Pt(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function go(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function xo(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(!Lt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Dt(o.pathname);if(t===null||go(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Fo(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 Eo(e){let o=Fo(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>vt)throw new TypeError(`trustedRoot must not exceed ${vt} directories`);return o.map(xo)}function bo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkW3ZUPQIZ_cjs.b)throw new TypeError(`maxBytes must not exceed ${chunkW3ZUPQIZ_cjs.b}`);return e}function Ro(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Lt(e.host))return null;let t=Pt(e.pathname);if(t===null)return null;for(let n of o){let r=Dt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function So(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 Oo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function wt(e,o,t){return e.some(n=>Oo(n,o,t))}async function vo(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(Tt(r)==="ENOENT")continue;throw r}return t}function wo(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),p=e.map(y=>u.resolve(a(y.href))),l=u.resolve(a(typeof o=="string"?o:o.href));if(!wt(p,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",d=await r(l,g),c=()=>{d.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(l);if(!wt(await vo(p,i),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let R=(await d.stat()).size;if(!Number.isSafeInteger(R)||R<0||R>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:At});let b=new Uint8Array(R),f=0;for(;f<b.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await d.read(b,f,b.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===b.byteLength?b:b.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await d.close().catch(()=>{});}}}function Ao(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=Eo(e.trustedRoot),t=bo(e.maxBytes),n=e.read??wo(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let u=So(i);if(u.protocol!=="file:")return r(u,s);let p=Ro(u,o);if(!p)return new Response(null,{status:404});let l=a?new AbortController:void 0,g=()=>l?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let d;try{if(d=await n(p,{maxBytes:t,...l?{signal:l.signal}:{}}),a?.aborted)throw a.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(l?.signal.aborted)throw l.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=Tt(c);if(y===At)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(d,{status:200})})}
2
+ Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunkZSM6X52G_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunkZSM6X52G_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunkZSM6X52G_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunkZSM6X52G_cjs.e}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=le;exports.acquireSharedExportShaping=Kt;exports.createPackagedFileFetch=Ao;exports.hasExportAdmittedFont=ee;exports.hasExportLaidOutText=ie;exports.hasFontBackedExportCapabilities=eo;exports.openFontBackedDocumentForExport=no;
package/dist/export.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import { P as PreservedImageMime, I as ImageResourceLimits, S as SupportedImageMime, a as ImageDecodePort } from './image-resources-DkuzBnTM.js';
2
2
  import { a as RevisionDisplayMode } from './revision-projection-CVJeA2jp.js';
3
- import { S as SemanticLayout, j as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, k as ListMarkerPictureRecord, T as TextMeasurer, i as FontRequest, l as FontSubstitution, m as ShapedRun, a as StyleSpanRecord } from './semantic-records-DB0VgWsr.js';
3
+ import { S as SemanticLayout, j as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, k as ListMarkerPictureRecord, T as TextMeasurer, i as FontRequest, l as FontSubstitution, m as ShapedRun, a as StyleSpanRecord } from './semantic-records-BSjo-xck.js';
4
4
  import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-Cc3fFWhv.js';
5
- import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-DpWQG26a.js';
6
- import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-BwoHFBlr.js';
5
+ import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-BOOxnLxF.js';
6
+ import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-CPO7wtg6.js';
7
7
  import './types-barrel-DN_-gaRX.js';
8
8
  import './editor-scope-OHPwVQ5l.js';
9
9
  import './omml-equation-BY7OdfGY.js';
10
10
  import './tree-package-fragment-BIyGh6L8.js';
11
- import './editor-DhUQsWWH.js';
11
+ import './editor-BU6rjQZz.js';
12
12
  import './contracts/document.js';
13
13
  import './contracts/interaction.js';
14
- import './semantic-interaction-DQjtIruQ.js';
14
+ import './semantic-interaction-COMnWyBQ.js';
15
15
  import './document-protection-CYIjO-li.js';
16
16
  import './failure-BIPVQbRm.js';
17
17
 
package/dist/export.js CHANGED
@@ -1,2 +1,2 @@
1
- import {c,l as l$1,d as d$2,e as e$1,v,s,i,o,u}from'./chunk-GRVRQBKU.js';import {j as j$1,l,k,q as q$1,h,n,b,g,_ as _$1,Z,aa}from'./chunk-XBYZTDF7.js';import'./chunk-RIYSCEFQ.js';import {d as d$1,e}from'./chunk-WHG23WNI.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-WHG23WNI.js';import {d,ea,sa,$,fa,i as i$1,b as b$1,e as e$2,Vc,c as c$1,j as j$2,gb,$c,jb,lb,ib,_c,mb,kb,nb,hb,q as q$2,t,o as o$1,Zb}from'./chunk-ZCRSPN4Q.js';import {d as d$3,b as b$2,a}from'./chunk-UMBHUW6R.js';import'./chunk-6QS5WL63.js';import {Ka}from'./chunk-VE6H5EJA.js';import {bg,cg,Yb,Xb,da,E,ge,la,ve,ma}from'./chunk-XRBPZCNK.js';function I(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}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((d,c)=>d.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let d of o.text){let c=d.toUpperCase()!==d,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(d))?y.text+=d:i.push({text:d,start:s,lower:c}),s+=d.length;}let a=[],u=[],p=[],l=true,g=0;for(let d of o.environment.direction==="rtl"?i.reverse():i){let c=d.lower?.8:1,y=[],R=[],b="",f=d.start;for(let F of d.text){let m=d.lower?F.toUpperCase():F;for(let E=0;E<m.length;E++)y.push(f),R.push(f+F.length);b+=m,f+=F.length;}let h=e.shape({...n,text:b}),x=a.length;for(let[F,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[F];E===void 0?l=false:p.push(E*c),a.push({...m,cluster:y[m.cluster]??d.start,originX:o$1(g+Math.round(m.originX*c)),originY:o$1(Math.round(m.originY*c)),offsetX:o$1(Math.round(m.offsetX*c)),offsetY:o$1(Math.round(m.offsetY*c)),advanceX:o$1(Math.round(m.advanceX*c)),advanceY:o$1(Math.round(m.advanceY*c)),drawScale:c});}for(let F of h.clusters){let m=y[F.textStart]??d.start,E=R[F.textEnd-1]??f,L=o$1(Math.round(F.advance*c)),A=u.at(-1);A&&A.textStart===m&&A.textEnd===E?u[u.length-1]={...A,glyphEnd:x+F.glyphEnd,advance:o$1(A.advance+L),caretEdges:[o$1(0),o$1(A.advance+L)]}:u.push({...F,textStart:m,textEnd:E,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:L,caretEdges:F.caretEdges.map(G=>o$1(Math.round(G*c))),fontSpan:0});}g+=h.glyphs.reduce((F,m)=>F+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:u,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:l&&p.length===a.length?p:void 0}}var nt=new WeakMap;function Nt(e){let o=nt.get(e);return o===void 0&&(o=Ct(e.bytes,e.faceIndex),nt.set(e,o)),o}var _t=new Set(["COLR","CBDT","sbix"]),Mt=512;function Ct(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(rt(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),Mt);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(_t.has(rt(e,s)))return true}return false}function rt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var Ut=/\p{Emoji_Presentation}|️/u;function Bt(e){return Ut.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(Nt);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Bt(o)?[...t,...n]:[...n,...t]}var qt=2048;function it(e,o,t$1,n){if(!t$1.clusters.length||t$1.clusters.length>qt)return null;let r=(f,h)=>{let{context:x,...F}=o,m={...F,text:h,environment:q$2({...o.environment,font:f})};return I(e,m,e.shape(m))},i=[],s=new Map;for(let f of [...t$1.clusters].sort((h,x)=>h.textStart-x.textStart)){let h=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=i.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$1.glyphs.slice(f.glyphStart,f.glyphEnd).some(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),L=s.get(x)??q(n,E).find(A=>{try{return !r(A,x).glyphs.some(G=>G.id===0)}catch{return false}});if(!L)return null;s.set(x,L),h=L;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],u=[],p=[],l=[],g=true,d=0,c=0,y=0,R=0,b=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let x=a.length,F=p.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:o$1(d+m.originX),originY:o$1(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)l.push(m);for(let m of h.clusters)u.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:x+m.glyphStart,glyphEnd:x+m.glyphEnd,fontSpan:F});h.glyphs.length&&p.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),d+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),R=Math.max(R,h.metrics.descent),b=Math.max(b,h.metrics.lineGap);}return t({...t$1,glyphs:a,clusters:u,fontSpans:p,exactAdvancesX:g&&l.length===a.length?l:void 0,metrics:{ascent:o$1(y),descent:o$1(R),lineGap:o$1(b)}},{...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 "]]]),zt=512,at=new WeakMap;function Ht(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=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=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let u=r(a+4);if(u<0||u>1024)return t;let p=-1;for(let c=0;c<u;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){p=i(y+8);break}}if(p<0)return t;let l=r(p+4);if(l<=0)return t;let g=p+l,d=r(g);if(d<0)return t;for(let c=0;c<Math.min(d,zt);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Xt(e,o){let t=at.get(e);return t||(t=Ht(e.bytes,e.faceIndex),at.set(e,t)),(jt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function st(e,o){let t=e.filter(n=>Xt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function J(e,o,t$1){if(!o.text.includes("\u2011"))return t$1;let n=new Set(t$1.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t$1;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t$1;try{let i=e.shape({...o,text:r});return t({...i,text:o.text},o.environment)}catch{return t$1}}function lt(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 e$2)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let u=e.shaper.shape(a),p=r.get(u);if(p&&p.input.text===a.text&&p.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&p.input.bidiLevel===a.bidiLevel&&p.input.context?.before===a.context?.before&&p.input.context?.after===a.context?.after&&p.input.environment===a.environment)return p.run;let l=s(a,J(e.shaper,a,u));return r.set(u,{input:a,run:l}),l}},s=(a,u)=>{let p=I(n,a,u);if(!p.glyphs.some(l=>l.id===0)||/^[\t\n\r\f]*$/.test(a.text))return p;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let l=it(n,a,p,t);if(l)return l}for(let l of st(q(t,a.text),a.environment.script))if(!(l.hash===a.environment.font.hash&&l.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:q$2({...a.environment,font:l})},d=I(n,g,n.shape(g));if(!d.glyphs.some(c=>c.id===0))return d}catch{}return p};return {...e,shaper:i}}var Q=c$1;function ee(e){return typeof e.admittedFontFace=="function"}var Gt=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 dt=new WeakMap;function z(e){let o=dt.get(e);return o||dt.set(e,o=Vt(e)),o}function Vt(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 Wt(e){return Object.freeze({...z(e),bytes:j$2(e)})}function Yt(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof e$2?null:Wt(t)}catch{return null}}function ct(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Yt(e.resolve(),o)}}function $t(e){return Object.freeze(e.slice(0,Q).map(o=>Object.freeze({request:j(o.request),partName:o.partName,reason:o.reason})))}function te(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let u=a.toLowerCase();i.has(u)||i.set(u,a);}let s=[...i.values()].map(a=>{let u=[];for(let p of Gt){let l=n?.({family:a,...p});!l||l instanceof e$2||u.push(Object.freeze({...p,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}return Object.freeze({family:a,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:$t(r)})}function oe(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 ne(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new d$1("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function H(){return new Map}function re(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=i$1(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof e$2?null:s}function ut(e,o,t){let n=t.fontFamily??e.defaultFont.family;return re(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=sa(n.style,n.fontSlot),i=$(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=re(e,o,s,r);if(!a)return null;try{if(r.smallCaps&&!_$1(e.shaper,e.environment,a,r,t))return null;let u=Z(e.shaper,e.environment,a,r,i);return Object.freeze({run:u,font:z(u.fontSpans[0]?.font??a),...u.fontSpans.length>1?{fonts:Object.freeze(u.fontSpans.map(p=>z(p.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function pt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,X=new WeakMap,se=0,_,le=32,ft=d;function mt(){if(_)return _;let e=(async()=>(await b(),g(h)))();return _=e,e.catch(()=>{_===e&&(_=void 0);}),e}function yt(e){let o=H();return aa(e,{resolveFont(t){return ut(e,o,t)},fallback:fa()})}async function ht(e,o,t=[],n=false){if(!j$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await mt(),i=lt(await q$1(e,r,h,o,n),t);return Object.freeze({createMeasurer:()=>yt(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${ea}`].join("|"),extensionFingerprint:e.fingerprint})}function Kt(e,o){if(!j$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=X.get(e);if(t)return t;let n=l(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let u=k(e).sources.reduce((l,g)=>l+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+u>ft)throw new RangeError(`Shared exporter shaping font bytes are limited to ${ft} process-wide`);se+=u;let p;try{let l=await mt();p=await q$1(e,l,h,o);}catch(l){throw se-=u,l}return Object.freeze({createMeasurer:()=>yt(p),shapeLaidOutText:ae(p),shapingHash:p.operation.shapingHash,producerVersion:p.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${ea}`].join("|"),extensionFingerprint:i}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var Zt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function Jt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Zt),n;if(t){let r=E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),ge(o,n)}function gt(e,o$1){let t=Jt(e);if(t.length!==0)return i(n=>{let r=new Set((n.resolvedFaces??[]).map(s=>i$1(s))),i=o(t,{maxFontBytes:b$1,aggregateBudget:Qt(n),shadowedRequests:r});if(o$1)for(let s of i.dropped){if(o$1.dropped.length>=Q)break;o$1.dropped.push(s);}return {sources:i.sources}})}function Qt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?d:Math.max(0,d-o)}function eo(e){return ee(e)&&ie(e)}var w=0,xt=Symbol("font-resolution-timeout");function to(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>d)throw new d$1("layoutFailed",`Active document export font bytes are limited to ${d}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ce(e,o){return e.attributes.find(t=>t.localName===o)?.value}function oo(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===da||t.namespaceUri===""))?.value}async function no(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=Ka(e$1);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:u,documentLigatures:p,...l}=o,g=Array.isArray(n)?n:[n],d=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await ro(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:u,documentLigatures:p,lastResortFonts:d,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof d$1&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new d$1("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=e(t.view,{...l,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!R.ok)return y?.dispose(),R;let b=R.session,f=y,h="active",x=()=>h==="aborted"?new d$1("aborted","Export resource settlement was aborted"):new d$1("disposed","Export session has been disposed"),F=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{b.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>F("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?b.layout():Promise.reject(x()),layoutFor:E=>h==="active"?b.layoutFor(E):Promise.reject(x()),validatedImageBytes:E=>h==="active"?b.validatedImageBytes(E):null,admittedFontFace:ct({status:()=>h,unavailable:x,resolve:()=>f?.resolveFont}),shapeLaidOutText:pt({status:()=>h,unavailable:x,shaping:()=>f}),dispose:()=>F("disposed")})}}async function ro(e,o,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n$1=io(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(xt),n$1);try{de(r.signal);let a=(async()=>{let u=to(t.onActiveFontBytesChange),p=!1;try{let l=so(e).slice(0,c),g=[],d={dropped:[]},c$1=gt(e,d),y=[...o,...c$1?[c$1]:[],...t.lastResortFonts??[]],R=await l$1(y,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...l])].slice(0,c),defaultFamily:d$2.family,signal:r.signal},{onOriginFailure:x=>g.push(x),reserveOwnedBytes:u.reserve});de(r.signal);let b=e$1(R??{});if(b.sources.length===0){let x=te(l,b.defaultFont.family,g,void 0,d.dropped);oe(x,t),ne(x,t);return}let f=await ht(n(b),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let h=te(l,b.defaultFont.family,g,f.resolveFont,d.dropped);return oe(h,t),ne(h,t),p=!0,Object.freeze({...f,dispose:u.release})}finally{p||u.release();}})();return await Promise.race([a,ao(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function io(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 ao(e){return new Promise((o,t)=>{let n=()=>{t(Ft(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function Ft(e){let o=e.reason===xt;return new d$1(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 Ft(e)}function so(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(l,g)=>{!g||r.has(g.name)||(r.add(g.name),l.push(g.root));};for(let l of e.headerFooterPartsBySection()){for(let g of l.headers.values())i(t,g);for(let g of l.footers.values())i(t,g);}for(let l of ["footnote","endnote"])n.push(...lo(e,l));let s$1=e.documentThemeFonts(),a={...s$1,major:s$1.major,minor:s$1.minor,majorEastAsia:s$1.majorEastAsia??null,minorEastAsia:s$1.minorEastAsia??null},u=new Map,p=(l,g)=>{let d=d$3(l,e.stylesRoot(),a,uo(l,g)),c=v(l,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...d.direct,...mo(l),...c,...s(l,e.stylesRoot(),a),...d.inherited]){let R=y.toLowerCase();u.has(R)||u.set(R,y);}};return p(o,"body"),p(t,"furniture"),p(n,"note"),[...u.values()]}function lo(e,o){let t=bg(e.currentPackage(),o);if(!t)return [];let n=new Set(cg(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let s=Yb(i),a=Xb(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var co="http://schemas.openxmlformats.org/officeDocument/2006/math";function uo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===da&&s.localName==="p"&&r.push({paragraph:s,context:a});let u=s.namespaceUri===da&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let p=s.children.length-1;p>=0;p-=1){let l=s.children[p];l.kind!=="textValue"&&i.push({node:l,context:u});}}for(let s of r)po(s.paragraph,t,s.context);}return t}function po(e,o,t){let n=gb(),r=null,i=null,s="",a=false,u=false,p=false,l=0,g=[];for(let d=e.children.length-1;d>=0;d-=1){let c=e.children[d];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:d,runId:c,visibility:y,containerDepth:R}=g.pop();if(R>=la||d.namespaceUri===da&&d.localName==="p")continue;let b=d.namespaceUri===da&&d.localName==="r"?d.id:c;if(d.namespaceUri===da&&d.localName==="fldSimple"){let f=ce(d,"instr")??"";$c(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&fo(d)!==D&&o.add(d.id);}if(d.namespaceUri===da&&d.localName==="fldChar"){let f=ce(d,"fldCharType");if(f==="begin")jb(n),n.nesting===1&&(r=b,i=null,s="",a=false,u=false,p=ve(d),l=0);else if(f==="separate"){let h=n.nesting===1;if(lb(n),h){let x=ib(n);s=x.instruction,a=x.overflow||n.nestingOverflow,i=b,u=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=ib(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&_c(s,{hasSeparate:u,hasLegacyFormData:p,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&l!==D){let x=i??r;x&&o.add(x);}}mb(n);}continue}if(d.namespaceUri===da&&(d.localName==="instrText"||d.localName==="delInstrText")){kb(n,Ot(d),d.localName==="delInstrText");continue}n.nesting>0&&nb(n)&&d.namespaceUri===da&&Et(d)&&(l|=y);for(let f=d.children.length-1;f>=0;f-=1){let h=d.children[f];h.kind!=="textValue"&&g.push({node:h,runId:b,visibility:y&St(d),containerDepth:ma(d,R)});}}hb(n);}function Et(e){return e.localName==="t"||e.localName==="delText"?Ot(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ue=1,bt=2,Rt=4,D=ue|bt|Rt;function fo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===da&&n.localName==="p")){if(n.namespaceUri===da&&Et(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&St(n)});}}return t}function St(e){return e.namespaceUri!==da?D:e.localName==="ins"||e.localName==="moveTo"?ue|bt:e.localName==="del"||e.localName==="moveFrom"?ue|Rt:D}function mo(e){let o=new Map,t=n=>{let r=a(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===co&&t(Zb),i.namespaceUri===da&&i.localName==="sym"&&t(b$2(oo(i,"font"))),i.namespaceUri===da&&i.localName==="fldSimple"){let s=ce(i,"instr");t(Vc(s??"")?.font??null);}if(i.namespaceUri===da&&i.localName==="p")for(let s of u(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Ot(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 r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var At="FILE_TOO_LARGE",vt=8;function yo(e){return typeof e=="object"&&e!==null}function Tt(e){if(!(!yo(e)||typeof e.code!="string"))return e.code}function Lt(e){return e===""||e.toLowerCase()==="localhost"}function ho(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function Pt(e){let o=ho(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 Dt(e){let o=Pt(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function go(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function xo(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(!Lt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Dt(o.pathname);if(t===null||go(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Fo(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 Eo(e){let o=Fo(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>vt)throw new TypeError(`trustedRoot must not exceed ${vt} directories`);return o.map(xo)}function bo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>b$1)throw new TypeError(`maxBytes must not exceed ${b$1}`);return e}function Ro(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Lt(e.host))return null;let t=Pt(e.pathname);if(t===null)return null;for(let n of o){let r=Dt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function So(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 Oo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function wt(e,o,t){return e.some(n=>Oo(n,o,t))}async function vo(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(Tt(r)==="ENOENT")continue;throw r}return t}function wo(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),p=e.map(y=>u.resolve(a(y.href))),l=u.resolve(a(typeof o=="string"?o:o.href));if(!wt(p,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",d=await r(l,g),c=()=>{d.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(l);if(!wt(await vo(p,i),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let R=(await d.stat()).size;if(!Number.isSafeInteger(R)||R<0||R>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:At});let b=new Uint8Array(R),f=0;for(;f<b.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await d.read(b,f,b.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===b.byteLength?b:b.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await d.close().catch(()=>{});}}}function Ao(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=Eo(e.trustedRoot),t=bo(e.maxBytes),n=e.read??wo(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let u=So(i);if(u.protocol!=="file:")return r(u,s);let p=Ro(u,o);if(!p)return new Response(null,{status:404});let l=a?new AbortController:void 0,g=()=>l?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let d;try{if(d=await n(p,{maxBytes:t,...l?{signal:l.signal}:{}}),a?.aborted)throw a.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(l?.signal.aborted)throw l.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=Tt(c);if(y===At)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(d,{status:200})})}
1
+ import {c,l as l$1,d as d$2,e as e$1,v,s,i,o,u}from'./chunk-KPSGB64S.js';import {j as j$1,l,k,q as q$1,h,n,c as c$1,g,_ as _$1,Z,aa}from'./chunk-SI5FLZGU.js';import'./chunk-RIYSCEFQ.js';import {d as d$1,e}from'./chunk-3OMDEMLL.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-3OMDEMLL.js';import {d,ea,sa,$,fa,i as i$1,b,e as e$2,Vc,c as c$2,j as j$2,hb,$c,kb,mb,jb,_c,nb,lb,ob,ib,q as q$2,t,o as o$1,_b as _b$1}from'./chunk-J3EM5ZEA.js';import {d as d$3,b as b$1,a}from'./chunk-G765WG4R.js';import'./chunk-XWXJB4J7.js';import {Ka}from'./chunk-XMWH2R23.js';import {eg,fg,_b,Zb,fa as fa$1,E,je,na,ye,oa}from'./chunk-JXL25DRU.js';function I(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}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((d,c)=>d.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let d of o.text){let c=d.toUpperCase()!==d,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(d))?y.text+=d:i.push({text:d,start:s,lower:c}),s+=d.length;}let a=[],u=[],p=[],l=true,g=0;for(let d of o.environment.direction==="rtl"?i.reverse():i){let c=d.lower?.8:1,y=[],R=[],b="",f=d.start;for(let F of d.text){let m=d.lower?F.toUpperCase():F;for(let E=0;E<m.length;E++)y.push(f),R.push(f+F.length);b+=m,f+=F.length;}let h=e.shape({...n,text:b}),x=a.length;for(let[F,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[F];E===void 0?l=false:p.push(E*c),a.push({...m,cluster:y[m.cluster]??d.start,originX:o$1(g+Math.round(m.originX*c)),originY:o$1(Math.round(m.originY*c)),offsetX:o$1(Math.round(m.offsetX*c)),offsetY:o$1(Math.round(m.offsetY*c)),advanceX:o$1(Math.round(m.advanceX*c)),advanceY:o$1(Math.round(m.advanceY*c)),drawScale:c});}for(let F of h.clusters){let m=y[F.textStart]??d.start,E=R[F.textEnd-1]??f,L=o$1(Math.round(F.advance*c)),A=u.at(-1);A&&A.textStart===m&&A.textEnd===E?u[u.length-1]={...A,glyphEnd:x+F.glyphEnd,advance:o$1(A.advance+L),caretEdges:[o$1(0),o$1(A.advance+L)]}:u.push({...F,textStart:m,textEnd:E,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:L,caretEdges:F.caretEdges.map(G=>o$1(Math.round(G*c))),fontSpan:0});}g+=h.glyphs.reduce((F,m)=>F+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:u,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:l&&p.length===a.length?p:void 0}}var nt=new WeakMap;function Nt(e){let o=nt.get(e);return o===void 0&&(o=Ct(e.bytes,e.faceIndex),nt.set(e,o)),o}var _t=new Set(["COLR","CBDT","sbix"]),Mt=512;function Ct(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(rt(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),Mt);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(_t.has(rt(e,s)))return true}return false}function rt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var Ut=/\p{Emoji_Presentation}|️/u;function Bt(e){return Ut.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(Nt);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Bt(o)?[...t,...n]:[...n,...t]}var qt=2048;function it(e,o,t$1,n){if(!t$1.clusters.length||t$1.clusters.length>qt)return null;let r=(f,h)=>{let{context:x,...F}=o,m={...F,text:h,environment:q$2({...o.environment,font:f})};return I(e,m,e.shape(m))},i=[],s=new Map;for(let f of [...t$1.clusters].sort((h,x)=>h.textStart-x.textStart)){let h=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=i.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$1.glyphs.slice(f.glyphStart,f.glyphEnd).some(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),L=s.get(x)??q(n,E).find(A=>{try{return !r(A,x).glyphs.some(G=>G.id===0)}catch{return false}});if(!L)return null;s.set(x,L),h=L;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],u=[],p=[],l=[],g=true,d=0,c=0,y=0,R=0,b=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let x=a.length,F=p.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:o$1(d+m.originX),originY:o$1(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)l.push(m);for(let m of h.clusters)u.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:x+m.glyphStart,glyphEnd:x+m.glyphEnd,fontSpan:F});h.glyphs.length&&p.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),d+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),R=Math.max(R,h.metrics.descent),b=Math.max(b,h.metrics.lineGap);}return t({...t$1,glyphs:a,clusters:u,fontSpans:p,exactAdvancesX:g&&l.length===a.length?l:void 0,metrics:{ascent:o$1(y),descent:o$1(R),lineGap:o$1(b)}},{...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 "]]]),zt=512,at=new WeakMap;function Ht(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=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=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let u=r(a+4);if(u<0||u>1024)return t;let p=-1;for(let c=0;c<u;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){p=i(y+8);break}}if(p<0)return t;let l=r(p+4);if(l<=0)return t;let g=p+l,d=r(g);if(d<0)return t;for(let c=0;c<Math.min(d,zt);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Xt(e,o){let t=at.get(e);return t||(t=Ht(e.bytes,e.faceIndex),at.set(e,t)),(jt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function st(e,o){let t=e.filter(n=>Xt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function J(e,o,t$1){if(!o.text.includes("\u2011"))return t$1;let n=new Set(t$1.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t$1;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t$1;try{let i=e.shape({...o,text:r});return t({...i,text:o.text},o.environment)}catch{return t$1}}function lt(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 e$2)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let u=e.shaper.shape(a),p=r.get(u);if(p&&p.input.text===a.text&&p.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&p.input.bidiLevel===a.bidiLevel&&p.input.context?.before===a.context?.before&&p.input.context?.after===a.context?.after&&p.input.environment===a.environment)return p.run;let l=s(a,J(e.shaper,a,u));return r.set(u,{input:a,run:l}),l}},s=(a,u)=>{let p=I(n,a,u);if(!p.glyphs.some(l=>l.id===0)||/^[\t\n\r\f]*$/.test(a.text))return p;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let l=it(n,a,p,t);if(l)return l}for(let l of st(q(t,a.text),a.environment.script))if(!(l.hash===a.environment.font.hash&&l.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:q$2({...a.environment,font:l})},d=I(n,g,n.shape(g));if(!d.glyphs.some(c=>c.id===0))return d}catch{}return p};return {...e,shaper:i}}var Q=c$2;function ee(e){return typeof e.admittedFontFace=="function"}var Gt=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 dt=new WeakMap;function z(e){let o=dt.get(e);return o||dt.set(e,o=Vt(e)),o}function Vt(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 Wt(e){return Object.freeze({...z(e),bytes:j$2(e)})}function Yt(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof e$2?null:Wt(t)}catch{return null}}function ct(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Yt(e.resolve(),o)}}function $t(e){return Object.freeze(e.slice(0,Q).map(o=>Object.freeze({request:j(o.request),partName:o.partName,reason:o.reason})))}function te(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let u=a.toLowerCase();i.has(u)||i.set(u,a);}let s=[...i.values()].map(a=>{let u=[];for(let p of Gt){let l=n?.({family:a,...p});!l||l instanceof e$2||u.push(Object.freeze({...p,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}return Object.freeze({family:a,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:$t(r)})}function oe(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 ne(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new d$1("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function H(){return new Map}function re(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=i$1(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof e$2?null:s}function ut(e,o,t){let n=t.fontFamily??e.defaultFont.family;return re(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=sa(n.style,n.fontSlot),i=$(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=re(e,o,s,r);if(!a)return null;try{if(r.smallCaps&&!_$1(e.shaper,e.environment,a,r,t))return null;let u=Z(e.shaper,e.environment,a,r,i);return Object.freeze({run:u,font:z(u.fontSpans[0]?.font??a),...u.fontSpans.length>1?{fonts:Object.freeze(u.fontSpans.map(p=>z(p.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function pt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,X=new WeakMap,se=0,_,le=32,ft=d;function mt(){if(_)return _;let e=(async()=>(await c$1(),g(h)))();return _=e,e.catch(()=>{_===e&&(_=void 0);}),e}function yt(e){let o=H();return aa(e,{resolveFont(t){return ut(e,o,t)},fallback:fa()})}async function ht(e,o,t=[],n=false){if(!j$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await mt(),i=lt(await q$1(e,r,h,o,n),t);return Object.freeze({createMeasurer:()=>yt(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${ea}`].join("|"),extensionFingerprint:e.fingerprint})}function Kt(e,o){if(!j$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=X.get(e);if(t)return t;let n=l(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let u=k(e).sources.reduce((l,g)=>l+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+u>ft)throw new RangeError(`Shared exporter shaping font bytes are limited to ${ft} process-wide`);se+=u;let p;try{let l=await mt();p=await q$1(e,l,h,o);}catch(l){throw se-=u,l}return Object.freeze({createMeasurer:()=>yt(p),shapeLaidOutText:ae(p),shapingHash:p.operation.shapingHash,producerVersion:p.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${ea}`].join("|"),extensionFingerprint:i}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var Zt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function Jt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Zt),n;if(t){let r=E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),je(o,n)}function gt(e,o$1){let t=Jt(e);if(t.length!==0)return i(n=>{let r=new Set((n.resolvedFaces??[]).map(s=>i$1(s))),i=o(t,{maxFontBytes:b,aggregateBudget:Qt(n),shadowedRequests:r});if(o$1)for(let s of i.dropped){if(o$1.dropped.length>=Q)break;o$1.dropped.push(s);}return {sources:i.sources}})}function Qt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?d:Math.max(0,d-o)}function eo(e){return ee(e)&&ie(e)}var w=0,xt=Symbol("font-resolution-timeout");function to(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>d)throw new d$1("layoutFailed",`Active document export font bytes are limited to ${d}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ce(e,o){return e.attributes.find(t=>t.localName===o)?.value}function oo(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===fa$1||t.namespaceUri===""))?.value}async function no(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=Ka(e$1);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:u,documentLigatures:p,...l}=o,g=Array.isArray(n)?n:[n],d=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await ro(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:u,documentLigatures:p,lastResortFonts:d,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof d$1&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new d$1("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=e(t.view,{...l,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!R.ok)return y?.dispose(),R;let b=R.session,f=y,h="active",x=()=>h==="aborted"?new d$1("aborted","Export resource settlement was aborted"):new d$1("disposed","Export session has been disposed"),F=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{b.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>F("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?b.layout():Promise.reject(x()),layoutFor:E=>h==="active"?b.layoutFor(E):Promise.reject(x()),validatedImageBytes:E=>h==="active"?b.validatedImageBytes(E):null,admittedFontFace:ct({status:()=>h,unavailable:x,resolve:()=>f?.resolveFont}),shapeLaidOutText:pt({status:()=>h,unavailable:x,shaping:()=>f}),dispose:()=>F("disposed")})}}async function ro(e,o,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n$1=io(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(xt),n$1);try{de(r.signal);let a=(async()=>{let u=to(t.onActiveFontBytesChange),p=!1;try{let l=so(e).slice(0,c),g=[],d={dropped:[]},c$1=gt(e,d),y=[...o,...c$1?[c$1]:[],...t.lastResortFonts??[]],R=await l$1(y,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...l])].slice(0,c),defaultFamily:d$2.family,signal:r.signal},{onOriginFailure:x=>g.push(x),reserveOwnedBytes:u.reserve});de(r.signal);let b=e$1(R??{});if(b.sources.length===0){let x=te(l,b.defaultFont.family,g,void 0,d.dropped);oe(x,t),ne(x,t);return}let f=await ht(n(b),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let h=te(l,b.defaultFont.family,g,f.resolveFont,d.dropped);return oe(h,t),ne(h,t),p=!0,Object.freeze({...f,dispose:u.release})}finally{p||u.release();}})();return await Promise.race([a,ao(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function io(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 ao(e){return new Promise((o,t)=>{let n=()=>{t(Ft(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function Ft(e){let o=e.reason===xt;return new d$1(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 Ft(e)}function so(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(l,g)=>{!g||r.has(g.name)||(r.add(g.name),l.push(g.root));};for(let l of e.headerFooterPartsBySection()){for(let g of l.headers.values())i(t,g);for(let g of l.footers.values())i(t,g);}for(let l of ["footnote","endnote"])n.push(...lo(e,l));let s$1=e.documentThemeFonts(),a={...s$1,major:s$1.major,minor:s$1.minor,majorEastAsia:s$1.majorEastAsia??null,minorEastAsia:s$1.minorEastAsia??null},u=new Map,p=(l,g)=>{let d=d$3(l,e.stylesRoot(),a,uo(l,g)),c=v(l,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...d.direct,...mo(l),...c,...s(l,e.stylesRoot(),a),...d.inherited]){let R=y.toLowerCase();u.has(R)||u.set(R,y);}};return p(o,"body"),p(t,"furniture"),p(n,"note"),[...u.values()]}function lo(e,o){let t=eg(e.currentPackage(),o);if(!t)return [];let n=new Set(fg(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let s=_b(i),a=Zb(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var co="http://schemas.openxmlformats.org/officeDocument/2006/math";function uo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===fa$1&&s.localName==="p"&&r.push({paragraph:s,context:a});let u=s.namespaceUri===fa$1&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let p=s.children.length-1;p>=0;p-=1){let l=s.children[p];l.kind!=="textValue"&&i.push({node:l,context:u});}}for(let s of r)po(s.paragraph,t,s.context);}return t}function po(e,o,t){let n=hb(),r=null,i=null,s="",a=false,u=false,p=false,l=0,g=[];for(let d=e.children.length-1;d>=0;d-=1){let c=e.children[d];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:d,runId:c,visibility:y,containerDepth:R}=g.pop();if(R>=na||d.namespaceUri===fa$1&&d.localName==="p")continue;let b=d.namespaceUri===fa$1&&d.localName==="r"?d.id:c;if(d.namespaceUri===fa$1&&d.localName==="fldSimple"){let f=ce(d,"instr")??"";$c(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&fo(d)!==D&&o.add(d.id);}if(d.namespaceUri===fa$1&&d.localName==="fldChar"){let f=ce(d,"fldCharType");if(f==="begin")kb(n),n.nesting===1&&(r=b,i=null,s="",a=false,u=false,p=ye(d),l=0);else if(f==="separate"){let h=n.nesting===1;if(mb(n),h){let x=jb(n);s=x.instruction,a=x.overflow||n.nestingOverflow,i=b,u=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=jb(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&_c(s,{hasSeparate:u,hasLegacyFormData:p,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&l!==D){let x=i??r;x&&o.add(x);}}nb(n);}continue}if(d.namespaceUri===fa$1&&(d.localName==="instrText"||d.localName==="delInstrText")){lb(n,Ot(d),d.localName==="delInstrText");continue}n.nesting>0&&ob(n)&&d.namespaceUri===fa$1&&Et(d)&&(l|=y);for(let f=d.children.length-1;f>=0;f-=1){let h=d.children[f];h.kind!=="textValue"&&g.push({node:h,runId:b,visibility:y&St(d),containerDepth:oa(d,R)});}}ib(n);}function Et(e){return e.localName==="t"||e.localName==="delText"?Ot(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ue=1,bt=2,Rt=4,D=ue|bt|Rt;function fo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===fa$1&&n.localName==="p")){if(n.namespaceUri===fa$1&&Et(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&St(n)});}}return t}function St(e){return e.namespaceUri!==fa$1?D:e.localName==="ins"||e.localName==="moveTo"?ue|bt:e.localName==="del"||e.localName==="moveFrom"?ue|Rt:D}function mo(e){let o=new Map,t=n=>{let r=a(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===co&&t(_b$1),i.namespaceUri===fa$1&&i.localName==="sym"&&t(b$1(oo(i,"font"))),i.namespaceUri===fa$1&&i.localName==="fldSimple"){let s=ce(i,"instr");t(Vc(s??"")?.font??null);}if(i.namespaceUri===fa$1&&i.localName==="p")for(let s of u(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Ot(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 r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var At="FILE_TOO_LARGE",vt=8;function yo(e){return typeof e=="object"&&e!==null}function Tt(e){if(!(!yo(e)||typeof e.code!="string"))return e.code}function Lt(e){return e===""||e.toLowerCase()==="localhost"}function ho(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function Pt(e){let o=ho(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 Dt(e){let o=Pt(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function go(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function xo(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(!Lt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Dt(o.pathname);if(t===null||go(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function Fo(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 Eo(e){let o=Fo(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>vt)throw new TypeError(`trustedRoot must not exceed ${vt} directories`);return o.map(xo)}function bo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>b)throw new TypeError(`maxBytes must not exceed ${b}`);return e}function Ro(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Lt(e.host))return null;let t=Pt(e.pathname);if(t===null)return null;for(let n of o){let r=Dt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function So(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 Oo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function wt(e,o,t){return e.some(n=>Oo(n,o,t))}async function vo(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(Tt(r)==="ENOENT")continue;throw r}return t}function wo(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),p=e.map(y=>u.resolve(a(y.href))),l=u.resolve(a(typeof o=="string"?o:o.href));if(!wt(p,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",d=await r(l,g),c=()=>{d.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(l);if(!wt(await vo(p,i),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let R=(await d.stat()).size;if(!Number.isSafeInteger(R)||R<0||R>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:At});let b=new Uint8Array(R),f=0;for(;f<b.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await d.read(b,f,b.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===b.byteLength?b:b.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await d.close().catch(()=>{});}}}function Ao(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=Eo(e.trustedRoot),t=bo(e.maxBytes),n=e.read??wo(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let u=So(i);if(u.protocol!=="file:")return r(u,s);let p=Ro(u,o);if(!p)return new Response(null,{status:404});let l=a?new AbortController:void 0,g=()=>l?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let d;try{if(d=await n(p,{maxBytes:t,...l?{signal:l.signal}:{}}),a?.aborted)throw a.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(l?.signal.aborted)throw l.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=Tt(c);if(y===At)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(d,{status:200})})}
2
2
  export{le as MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS,Kt as acquireSharedExportShaping,Ao as createPackagedFileFetch,ee as hasExportAdmittedFont,ie as hasExportLaidOutText,eo as hasFontBackedExportCapabilities,no as openFontBackedDocumentForExport};
@@ -1,4 +1,4 @@
1
- import { F as FontFaceRequest, a as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-DhUQsWWH.js';
1
+ import { F as FontFaceRequest, a as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-BU6rjQZz.js';
2
2
 
3
3
  /**
4
4
  * A partial font configuration one origin contributes: sources, substitutions, or both.
@@ -2,17 +2,17 @@ import { W as TreeDocOp, cl as TextFormFieldRange, ck as TextFormFieldOptions, a
2
2
  import { a as ImageDecodePort, S as SupportedImageMime } from './image-resources-DkuzBnTM.js';
3
3
  import './document-protection-CYIjO-li.js';
4
4
  import { EditorModule, ReviewModuleContribution } from './contracts/modules.js';
5
- import { D as DocumentSource, a as FontConfiguration, Z as ZoomMode, E as EditorFontError, q as Editor, e as EditorCommand, C as CanResult, j as SelectedImageState, r as FormatPainterSurfaceState, k as TrackedChangePredicate, T as TrackedChangeFilterMode, F as FontFaceRequest, b as FontSource, I as ImageContext, t as TableBorderEdgeTarget, u as TableBorderSpec, w as TableBorderStyle, x as TableContext } from './editor-DhUQsWWH.js';
5
+ import { D as DocumentSource, a as FontConfiguration, Z as ZoomMode, E as EditorFontError, q as Editor, e as EditorCommand, C as CanResult, j as SelectedImageState, r as FormatPainterSurfaceState, k as TrackedChangePredicate, T as TrackedChangeFilterMode, F as FontFaceRequest, b as FontSource, I as ImageContext, t as TableBorderEdgeTarget, u as TableBorderSpec, w as TableBorderStyle, x as TableContext } from './editor-BU6rjQZz.js';
6
6
  import { R as ReviewDisplayMode } from './revision-projection-CVJeA2jp.js';
7
- import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-DQjtIruQ.js';
8
- import { e as FontConfigurationFragment, g as FontResolver, i as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-BwoHFBlr.js';
7
+ import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-COMnWyBQ.js';
8
+ import { e as FontConfigurationFragment, g as FontResolver, i as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-CPO7wtg6.js';
9
9
  import { EditorCollaborationSession, CollaborationRemoteSelection, CollaborationModuleContribution } from './collaboration.js';
10
- import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, F as FieldShadingMode, d as DrawingPaintStrings } from './semantic-paint-DoPl85nR.js';
10
+ import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, F as FieldShadingMode, d as DrawingPaintStrings } from './semantic-paint-C032N0ps.js';
11
11
  import { b as ResolvedFootnoteProperties, R as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-DMfKK3QU.js';
12
- import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-DB0VgWsr.js';
12
+ import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-BSjo-xck.js';
13
13
  import { B as BookmarkIndex } from './custom-node-writes-77rvPW2-.js';
14
14
  import { I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, i as ImageIntentResult } from './tree-package-fragment-BIyGh6L8.js';
15
- import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-B8GF_H2e.js';
15
+ import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-BtO2s2Za.js';
16
16
  import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-CHcCnz3W.js';
17
17
  import { C as CollaborationStatus } from './failure-BIPVQbRm.js';
18
18
  import { V as ViewScope, b as EditorExecOptions } from './editor-scope-OHPwVQ5l.js';
@@ -631,9 +631,7 @@ type ImageMutationPreconditions = Readonly<{
631
631
  /**
632
632
  * The selected image and what may be done to it, or null when nothing image-like is selected.
633
633
  *
634
- * Null covers more than "no selection": a placeholder graphic, a drawing the file marks hidden,
635
- * and one whose `select` lock is set all read as no selection, because chrome that offered
636
- * resize handles on them would promise an edit the store is about to refuse.
634
+ * Unsupported placeholders, hidden drawings, and select-locked drawings cannot be selected.
637
635
  */
638
636
  declare function selectedImageStateOf(surface: PaginatedSurface | null): SelectedImageState | null;
639
637
  /**
@@ -719,6 +717,8 @@ interface ImageOverlayScrollPort {
719
717
  * decide what it is looking at.
720
718
  */
721
719
  interface SelectedDrawingOverlayTarget {
720
+ /** Keep the text area available for pointer editing through the frame. */
721
+ readonly textbox?: boolean;
722
722
  readonly id: string;
723
723
  readonly pageIndex: number;
724
724
  readonly x: number;
@@ -831,7 +831,7 @@ declare function overlayHostOrigin(surfaceElement: HTMLElement | null): {
831
831
  readonly top: number;
832
832
  };
833
833
  /** Whether this handle drag should preserve aspect ratio. */
834
- declare function resizePreservesAspect(handle: ImageResizeHandle, aspectLocked: boolean, shiftKey: boolean): boolean;
834
+ declare function resizePreservesAspect(handle: ImageResizeHandle, aspectLocked: boolean, shiftKey: boolean, textbox?: boolean): boolean;
835
835
  /**
836
836
  * Where an anchored drawing's positioning frame begins, in layout points.
837
837
  *
@@ -912,6 +912,7 @@ declare function finalizeImageOverlayInteraction(options: {
912
912
  readonly accumulatedScrollPt: number;
913
913
  readonly aspectLocked: boolean;
914
914
  readonly shiftKey: boolean;
915
+ readonly textbox?: boolean;
915
916
  readonly anchorFrameOrigin: AnchorFrameOrigin | null;
916
917
  }): FinalizedImageOverlayInteraction;
917
918
 
@@ -2688,6 +2689,7 @@ declare const CHROME_GROUPS: readonly [{
2688
2689
  }, {
2689
2690
  readonly id: "direction";
2690
2691
  readonly labelKey: "formattingBar.groups.direction";
2692
+ readonly contextual: true;
2691
2693
  readonly controls: readonly [{
2692
2694
  readonly id: "ltr";
2693
2695
  readonly labelKey: "toolbar.leftToRight";
@@ -3069,6 +3071,13 @@ declare const CHROME_GROUPS: readonly [{
3069
3071
  readonly labelKey: "toolbar.insert";
3070
3072
  readonly contextual: true;
3071
3073
  readonly controls: readonly [{
3074
+ readonly id: "textBox";
3075
+ readonly labelKey: "toolbar.insertTextBox";
3076
+ readonly paths: readonly string[];
3077
+ readonly state: {
3078
+ readonly kind: "command";
3079
+ };
3080
+ }, {
3072
3081
  readonly id: "footnote";
3073
3082
  readonly labelKey: "toolbar.insertFootnote";
3074
3083
  readonly paths: readonly string[];
@@ -3154,7 +3163,7 @@ type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script'
3154
3163
  *
3155
3164
  * @public
3156
3165
  */
3157
- type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'direction.ltr' | 'direction.rtl' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.painter' | 'format.clear' | 'review.comments' | 'review.paragraphMarks' | 'review.protectDocument' | 'review.simpleMarkup' | 'review.allMarkup' | 'review.noMarkup' | 'review.original' | 'review.previousChange' | 'review.nextChange' | 'review.acceptAllChanges' | 'review.rejectAllChanges' | 'review.authors' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'file.open' | 'file.save' | 'file.exportMarkdown' | 'file.exportPdf' | 'file.print' | 'paragraph.dialog' | 'file.pageSetup' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc';
3166
+ type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'direction.ltr' | 'direction.rtl' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.painter' | 'format.clear' | 'review.comments' | 'review.paragraphMarks' | 'review.protectDocument' | 'review.simpleMarkup' | 'review.allMarkup' | 'review.noMarkup' | 'review.original' | 'review.previousChange' | 'review.nextChange' | 'review.acceptAllChanges' | 'review.rejectAllChanges' | 'review.authors' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'file.open' | 'file.save' | 'file.exportMarkdown' | 'file.exportPdf' | 'file.print' | 'paragraph.dialog' | 'file.pageSetup' | 'insert.textBox' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc';
3158
3167
  /**
3159
3168
  * Every control id in the chrome, as a literal union. Unique WITHIN a group, not
3160
3169
  * globally (`image.insert` / `table.insert`) — key consumers on {@link ChromeSlotId}.
@@ -3270,12 +3279,7 @@ declare const CHROME_MENUS: readonly ChromeMenu[];
3270
3279
  declare function chromeMenuSlots(): readonly ChromeSlotId[];
3271
3280
  /** Total controls, so a parity test can assert none were dropped. */
3272
3281
  declare function chromeControlCount(): number;
3273
- /**
3274
- * i18n key for the tooltip on a control an ADAPTER renders but cannot drive yet — a
3275
- * value slot in a toolbar that has grown no picker for it, say. It is never the reason
3276
- * a control is disabled: when the ENGINE refuses, the tooltip is the engine's own
3277
- * `disabledReason`, never an adapter paraphrase.
3278
- */
3282
+ /** Tooltip for adapter controls without a picker; command refusals use engine reasons. */
3279
3283
  declare const CHROME_UNAVAILABLE_KEY = "formattingBar.unavailableInPreview";
3280
3284
 
3281
3285
  /** Material Symbol name → SVG path data (viewBox "0 -960 960 960"). */
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunk6745I4XF_cjs=require('./chunk-6745I4XF.cjs');require('./chunk-TKQH7BNE.cjs'),require('./chunk-DYRXA5UJ.cjs');var chunkFWX535CS_cjs=require('./chunk-FWX535CS.cjs');require('./chunk-JN62FLHE.cjs'),require('./chunk-KV5HFE23.cjs'),require('./chunk-RLO64PHP.cjs'),require('./chunk-Q4RDWB3U.cjs'),require('./chunk-BUDXZ7T2.cjs'),require('./chunk-PCPBDYEL.cjs'),require('./chunk-QTFAXWVI.cjs'),require('./chunk-EHT4LKKZ.cjs'),require('./chunk-T7RGKBCE.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-QK23BSRK.cjs'),require('./chunk-6KA3L3FR.cjs'),require('./chunk-UKVVUHZL.cjs');Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunk6745I4XF_cjs.wa}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Aa}});Object.defineProperty(exports,"ChromeExportError",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Fb}});Object.defineProperty(exports,"ChromePrintError",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Hb}});Object.defineProperty(exports,"bindHistoryGroup",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Cb}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunk6745I4XF_cjs.d}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Ba}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunk6745I4XF_cjs.ja}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunk6745I4XF_cjs.la}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunk6745I4XF_cjs.cb}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunk6745I4XF_cjs.i}});Object.defineProperty(exports,"customFonts",{enumerable:true,get:function(){return chunk6745I4XF_cjs.j}});Object.defineProperty(exports,"isChromePrintShortcut",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Ib}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunk6745I4XF_cjs.h}});Object.defineProperty(exports,"runChromeExport",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Gb}});Object.defineProperty(exports,"runChromePrint",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Jb}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunk6745I4XF_cjs.ra}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunk6745I4XF_cjs.na}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunkFWX535CS_cjs.h}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunkFWX535CS_cjs.g}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunkFWX535CS_cjs.d}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunkFWX535CS_cjs.e}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunkFWX535CS_cjs.k}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunkFWX535CS_cjs.i}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunkFWX535CS_cjs.j}});
1
+ 'use strict';var chunkCVNDMQIX_cjs=require('./chunk-CVNDMQIX.cjs');require('./chunk-TKQH7BNE.cjs'),require('./chunk-VPKKYCZI.cjs');var chunkDF7F7TNU_cjs=require('./chunk-DF7F7TNU.cjs');require('./chunk-AKF5KM2W.cjs'),require('./chunk-JQTVFP72.cjs'),require('./chunk-ZSM6X52G.cjs'),require('./chunk-W3ZUPQIZ.cjs'),require('./chunk-IEXYOLNR.cjs'),require('./chunk-6CPYOVRT.cjs'),require('./chunk-BOGQGMMU.cjs'),require('./chunk-TBFZZX7Z.cjs'),require('./chunk-P4SBMHHO.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-JDAAGZNE.cjs'),require('./chunk-T4TKRNZT.cjs'),require('./chunk-UKVVUHZL.cjs');Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.wa}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.Aa}});Object.defineProperty(exports,"ChromeExportError",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.Fb}});Object.defineProperty(exports,"ChromePrintError",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.Hb}});Object.defineProperty(exports,"bindHistoryGroup",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.Cb}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.d}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.Ba}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.ja}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.la}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.cb}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.i}});Object.defineProperty(exports,"customFonts",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.j}});Object.defineProperty(exports,"isChromePrintShortcut",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.Ib}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.h}});Object.defineProperty(exports,"runChromeExport",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.Gb}});Object.defineProperty(exports,"runChromePrint",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.Jb}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.ra}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunkCVNDMQIX_cjs.na}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunkDF7F7TNU_cjs.h}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunkDF7F7TNU_cjs.g}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunkDF7F7TNU_cjs.d}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunkDF7F7TNU_cjs.e}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunkDF7F7TNU_cjs.k}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunkDF7F7TNU_cjs.i}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunkDF7F7TNU_cjs.j}});