oasis-editor 0.0.207 → 0.0.209

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.
@@ -0,0 +1,34 @@
1
+ import { EditorState } from '../model.js';
2
+ export type HeaderFooterSide = "header" | "footer";
3
+ export type HeaderFooterStoryKind = "default" | "firstPage" | "evenPage";
4
+ type HeaderFooterStoryKey = "header" | "firstPageHeader" | "evenPageHeader" | "footer" | "firstPageFooter" | "evenPageFooter";
5
+ /** Map a (side, kind) pair onto the section's story array field name. */
6
+ export declare function getHeaderFooterStoryKey(side: HeaderFooterSide, kind: HeaderFooterStoryKind): HeaderFooterStoryKey;
7
+ /**
8
+ * Ensure the active section has the requested header/footer story, seeding an
9
+ * empty zone-styled paragraph only when the story is absent. Existing content
10
+ * is never overwritten. Selection and editing zone are left untouched, so this
11
+ * is the "turn on a header / different first page / even pages" primitive.
12
+ */
13
+ export declare function enableHeaderFooterStory(state: EditorState, side: HeaderFooterSide, kind?: HeaderFooterStoryKind): EditorState;
14
+ /**
15
+ * Remove a header/footer story. If the caret was editing that story, the
16
+ * selection returns to the main body.
17
+ */
18
+ export declare function clearHeaderFooterStory(state: EditorState, side: HeaderFooterSide, kind?: HeaderFooterStoryKind): EditorState;
19
+ /**
20
+ * Enter header/footer editing: ensure the default story exists, move the caret
21
+ * into its first paragraph and set the active zone to `header`/`footer`.
22
+ *
23
+ * Only the default story is editable through today's zone stack; first/even
24
+ * variants are created via `enableHeaderFooterStory`.
25
+ */
26
+ export declare function editHeaderFooter(state: EditorState, side: HeaderFooterSide): EditorState;
27
+ /** Return the caret to the start of the section's main body. */
28
+ export declare function exitHeaderFooter(state: EditorState): EditorState;
29
+ /**
30
+ * Insert a page-number field (PAGE) at the active caret, inside the header,
31
+ * footer or main body. Placeholder text is resolved during layout projection.
32
+ */
33
+ export declare function insertPageNumber(state: EditorState): EditorState;
34
+ export {};
@@ -2,6 +2,11 @@
2
2
  * Local review timeline entries, created on successful comment mutations.
3
3
  * These are transaction-scoped editor data and are intentionally not emitted
4
4
  * as WordprocessingML. The host can persist/export them separately if needed.
5
+ *
6
+ * The array is deliberately NOT capped: it rides snapshot-based undo/redo, so
7
+ * truncating it here would desynchronize history from the document state and
8
+ * silently drop entries on undo/redo. Long sessions accumulate entries; hosts
9
+ * that need bounded history should persist/rotate it out-of-band.
5
10
  */
6
11
  export type EditorReviewActivityKind = "comment-created" | "comment-replied" | "comment-edited" | "comment-resolved" | "comment-reopened" | "comment-deleted";
7
12
  export interface EditorReviewActivity {
@@ -1 +1 @@
1
- import{A as e,Aa as t,Ar as o,B as n,Ba as r,C as i,Cr as s,D as a,Dr as l,E as c,Er as d,F as u,G as p,Ga as g,H as f,Ha as m,Hi as v,Hr as b,I as h,Ia as y,J as k,Jr as x,K as C,L as S,La as w,M as R,Ma as T,N as _,O as I,Or as B,P,Pa as L,Qt as A,R as D,Rr as $,S as M,Sr as E,T as F,Tr as j,Ur as O,V as H,Vr as z,W as N,Xa as q,Y as J,Yi as W,Za as X,_ as K,_r as G,ao as U,br as V,di as Y,fi as Q,gi as Z,hi as ee,ii as te,io as oe,j as ne,ja as re,jr as ie,k as se,kr as ae,li as le,mi as ce,no as de,oo as ue,pi as pe,q as ge,qa as fe,qr as me,t as ve,to as be,ui as he,v as ye,vr as ke,vt as xe,w as Ce,wr as Se,x as we,yr as Re,yt as Te,z as _e,zr as Ie}from"./defaultToolbar-BsQf2jiH.js";function Be(e={}){const t=y(()=>e.ui?.locale??"pt-BR"),[o,n]=be(0),[r,i]=be(null),s=()=>{const t=e.ui?.loading;return"object"==typeof t&&null!==t?t:void 0};return U(()=>{const e=performance.now();let t=!1;const o=()=>{if(t)return;const r=performance.now()-e;n(.9*(1-Math.exp(-r/5e3))),requestAnimationFrame(o)};requestAnimationFrame(o),oe(()=>{t=!0}),import("./OasisEditorApp-Bvvtm0S1.js").then(e=>{t=!0,n(1),setTimeout(()=>i(()=>e.OasisEditorApp),180)}).catch(()=>{t=!0})}),X(L,{translator:t,get children(){return X(q,{get when(){return r()},get fallback(){return X(T,{variant:"fill",get progress(){return o()},get label(){return s()?.label},get class(){return s()?.class},get style(){return s()?.style}})},children:t=>{const o=t();return X(o,e)}})}})}function Pe(e,t={}){const o=me(),n=m(()=>Be({...t,runtime:{...t.runtime,client:o}}),e);return o.setDispose(()=>{n(),e.innerHTML=""}),o}function Le(e){return X(Be,de(e,{get ui(){return{...e.ui,showChrome:!1}}}))}function Ae(e,t={}){const o=me(),n=m(()=>Le({...t,runtime:{...t.runtime,client:o}}),e);return o.setDispose(()=>{n(),e.innerHTML=""}),o}function De(e){return{execute(t,o){const n=re(t,o);return e.commands.execute(n.name,n.payload)},canExecute(t,o){const n=re(t,o);return e.commands.canExecute(n.name,n.payload)},state(t){const o=re(t);return e.commands.state(o.name,o.payload)}}}var $e=["selectAll","insertFootnote","insertText","insertEquation","updateEquation","insertTableOfContents","updateTableOfContents","pastePlainText","paste","pasteAsPlainText","pasteMergeFormatting","formatPainter","formatPainterContinuous","cancelFormatPainter","bold","italic","underline","strike","superscript","subscript","link","unlink","alignLeft","alignCenter","alignRight","alignJustify","orderedList","bulletList","find","replace","toggleTrackChanges","acceptRevisions","rejectRevisions","nextRevision","previousRevision","nextComment","previousComment","newComment","replyComment","editComment","toggleCommentsPanel","resolveComment","reopenComment","deleteComment","toggleShowMargins","toggleShowParagraphMarks","togglePreciseFonts","undo","redo","pageBreak","lineBreak","splitBlock","setFontFamily","setFontSize","increaseFontSize","decreaseFontSize","changeTextCase","clearFormatting","setColor","setHighlight","setTextShading","setStyleId","setCharacterStyleId","setUnderlineStyle","documentStyles","print","copy","cut","newDocument","exportDocx","exportPdf","importDocument","insertHtml","insertImage","editImageAlt","insertImageCaption","imageContext","imageWidthCm","imageHeightCm","imageCrop","imageCropAspect","imageCropShape","imageCropFill","imageCropFit","imageCropReset","imageBorder","outdent","indent","togglePageBreakBefore","toggleKeepWithNext","setSpacingAfter","setSpacingBefore","setIndentLeft","setIndentRight","setIndentFirstLine","setIndentHanging","setSpecialIndent","setParagraphShading","applyParagraphBorders","setLineHeight","setListFormat","setListStartAt","toggleOrientation","setOrientation","sectionBreakNextPage","sectionBreakContinuous","setPageMargins","applyDocumentTheme","setDocumentColorScheme","setDocumentFontScheme","setDocumentParagraphSpacing","setDocumentEffects","setDocumentPageColor","setDocumentWatermark","setDocumentPageBorder","setDocumentDesignDefault","tableContext","tableMerge","tableSplit","tableInsertColumnBefore","tableInsertColumnAfter","tableDeleteColumn","tableInsertRowBefore","tableInsertRowAfter","tableDeleteRow","tableCellShading","tableCellBorders","tableCellNoBorders","tableApplyBorderPreset","toggleTableDrawBorders","toggleTableGridlines","tableWidth100","tableAlignLeft","tableAlignCenter","tableAlignRight","tableSetCellWidth","tableToggleHeaderRow","tableToggleTotalRow","tableToggleBandedRows","tableToggleFirstColumn","tableToggleLastColumn","tableToggleBandedColumns","setTableStyle","tableToggleAutoFit","tableDistributeColumns","tableDistributeRows","insertTable","insertShape","openSymbolDialog","openEquationDialog"];function Me(e,t={}){const o=me(),n=m(()=>X(Be,de(t,{get runtime(){return{...t.runtime,client:o}}})),e);return o.setDispose(()=>{n(),e.innerHTML=""}),Object.assign(o,{unmount:()=>o.dispose()})}function Ee(e){const[t,o]=ue(e,["level","class","classList","children"]),n=t.level??2;return X(w,de({component:`h${n}`,get class(){return`oasis-editor-ui-heading ${t.class??""}`},get classList(){return{[`oasis-editor-ui-heading-${n}`]:!0,...t.classList}}},o,{get children(){return t.children}}))}var Fe=/*#__PURE__*/fe("<div>");function je(e){const[t,o]=ue(e,["align","wrap","class","classList","children"]);return n=Fe(),g(n,de({get class(){return`oasis-editor-ui-action-row ${t.class??""}`},get classList(){return{[`oasis-editor-ui-action-row-${t.align??"start"}`]:!0,"oasis-editor-ui-action-row-nowrap":!1===t.wrap,...t.classList}}},o),!1,!0),r(n,()=>t.children),n;var n}var Oe=/*#__PURE__*/fe("<div>"),He={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function ze(e){const[t,o]=ue(e,["align","class","style","children"]);return n=Oe(),g(n,de({get class(){return`oasis-editor-ui-field-row ${t.class??""}`},get style(){return{"align-items":He[t.align??"end"],..."object"==typeof t.style?t.style:{}}}},o),!1,!0),r(n,()=>t.children),n;var n}var Ne=/*#__PURE__*/fe("<div>");function qe(e){const[t,o]=ue(e,["align","class","classList","children"]);return n=Ne(),g(n,de({get class(){return`oasis-editor-ui-dialog-footer ${t.class??""}`},get classList(){return{[`oasis-editor-ui-dialog-footer-${t.align??"end"}`]:!0,...t.classList}}},o),!1,!0),r(n,()=>t.children),n;var n}function Je(e,t){return void 0===e.revisionId||e.revisionId===t}function We(e){e.matched=!0}function Xe(e,t){e.matched=!0,e.changed=!0,e.resolvedRevisionIds.add(t)}function Ke(e,t){e.matched=!0;const o=`${t.kind}:${t.revisionId??""}:${t.path}`;e.unresolvedKeys.has(o)||(e.unresolvedKeys.add(o),e.unresolved.push(t))}function Ge(e){const t=[],o=e=>{for(const n of e)if("paragraph"!==n.type)for(const e of n.rows)for(const t of e.cells)o(t.blocks);else{t.push(n);for(const e of n.runs)"textBox"===e.kind&&o(e.textBox.blocks)}};return o(e),t}function Ue(e){const t=Te(e);if(t)return delete t.propertyRevision,Object.keys(t).length>0?t:void 0}function Ve(e){const t=xe(e);if(t)return delete t.propertyRevision,Object.keys(t).length>0?t:void 0}function Ye(e,t,o){if(e.revisionRangeMarker&&Je(o,e.revisionRangeMarker.id))return Xe(o,e.revisionRangeMarker.id),null;if(!function(e,t,o){const n=e.revision;return!n||!Je(o,n.id)||(Xe(o,n.id),"accept"===o.action?"insert"===n.type:"delete"===n.type)}(e,0,o))return null;let n=e;e.revision&&Je(o,e.revision.id)&&(n={...n,revision:void 0});const r=function(e,t,o){const n=e?.propertyRevision;return n&&Je(o,n.id)?(Xe(o,n.id),"accept"===o.action?Ue(e):Ue(n.previous)):e}(n.styles,0,o);if(r!==n.styles&&(n={...n,styles:r}),"textBox"===n.kind){const e=nt(n.textBox.blocks,`${t}.textBox.blocks`,o);e!==n.textBox.blocks&&(n={...n,textBox:{...n.textBox,blocks:e}})}return n}function Qe(e,t,o){const n=[],r=[];let i=0,s=0;for(let d=0;d<e.runs.length;d+=1){const a=e.runs[d],l=Ye(a,`${t}.runs[${d}]`,o);if(!l&&"textBox"===a.kind)for(const t of Ge(a.textBox.blocks))o.paragraphRelocations.has(t.id)||o.paragraphRelocations.set(t.id,{paragraphId:e.id,offset:s});const c=a.text.length;r.push({oldStart:i,oldEnd:i+c,newStart:s,kept:null!==l}),i+=c,l&&(n.push(l),s+=l.text.length)}i!==s&&o.paragraphOffsetTransforms.set(e.id,{segments:r,oldLength:i,newLength:s});let a=n.length===e.runs.length&&n.every((t,o)=>t===e.runs[o])?e:{...e,runs:n};const l=function(e,t,o){const n=e?.propertyRevision;return n&&Je(o,n.id)?(Xe(o,n.id),"accept"===o.action?Ve(e):Ve(n.previous)):e}(a.style,0,o);l!==a.style&&(a={...a,style:l});const c=a.numberingRevision;return c&&Je(o,c.id)&&(We(o),"accept"===o.action?(Xe(o,c.id),a={...a,numberingRevision:void 0}):Ke(o,{kind:"numbering-original-unavailable",revisionId:c.id,path:`${t}.numberingRevision`,message:"w:numberingChange only stores the previous rendered-number cache; it cannot reconstruct the previous numId/ilvl safely."})),a}function Ze(e){const t=e.mergeRevisionState;if("vertical"===t?.orientation&&1===t.currentCellCount&&1===t.previousCells.length)return structuredClone(t.previousCells[0]);const o=e.style?.revision;return"merge"===o?.type&&"continue"===o.previous?.vMerge?{...e,blocks:[],rowSpan:void 0,vMerge:"continue",style:e.style?{...e.style,revision:void 0}:e.style,mergeRevisionState:void 0}:void 0}function et(e,t,o){let n=function(e,t,o){const n=e.style?.revision,r=e.mergeRevisionState&&Je(o,e.mergeRevisionState.revisionId);if(n&&Je(o,n.id)){if(We(o),"reject"===o.action&&"merge"===n.type){const r=Ze(e);return r?(Xe(o,n.id),r):(Ke(o,{kind:"cell-merge-original-unavailable",revisionId:n.id,path:t,message:"The previous merge topology lacks an exact semantic snapshot for safe restoration."}),e)}return Xe(o,n.id),{...e,style:e.style?{...e.style,revision:void 0}:e.style,..."merge"===n.type?{mergeRevisionState:void 0}:{}}}if(r){const n=e.mergeRevisionState.revisionId;if(We(o),"accept"===o.action)return Xe(o,n),{...e,mergeRevisionState:void 0};const r=Ze(e);if(r)return Xe(o,n),r;Ke(o,{kind:"cell-merge-original-unavailable",revisionId:n,path:`${t}.mergeRevisionState`,message:"The preserved merge snapshot is not a supported exact vertical-cell restoration."})}return e}(e,t,o);const r=function(e,t,o){const n=e?.propertyRevision;if(!n||!Je(o,n.id))return e;Xe(o,n.id);const r=e.revision?structuredClone(e.revision):void 0,i=structuredClone("accept"===o.action?e:n.previous);return delete i.propertyRevision,r&&(i.revision=r),i}(n.style,0,o);r!==n.style&&(n={...n,style:r});const i=nt(n.blocks,`${t}.blocks`,o);return i!==n.blocks&&(n={...n,blocks:i}),n}function tt(e,t,o){let n=function(e,t,o){const n=e.style?.revision;return n&&Je(o,n.id)?(We(o),"reject"===o.action&&"merge"===n.type?(Ke(o,{kind:"cell-merge-original-unavailable",revisionId:n.id,path:t,message:"The original table structure for this merge revision is not reconstructed by the core resolver yet."}),e):(Xe(o,n.id),{...e,style:e.style?{...e.style,revision:void 0}:e.style})):e}(e,t,o);const r=function(e,t,o){const n=e?.propertyRevision;if(!n||!Je(o,n.id))return e;Xe(o,n.id);const r=e.revision?structuredClone(e.revision):void 0,i=structuredClone("accept"===o.action?e:n.previous);return delete i.propertyRevision,r&&(i.revision=r),i}(n.style,0,o);r!==n.style&&(n={...n,style:r});const i=n.propertyExceptionsRevision;if(i&&Je(o,i.id))Xe(o,i.id),n={...n,propertyExceptions:"accept"===o.action?n.propertyExceptions:structuredClone(i.previous),propertyExceptionsRevision:void 0,tblPrExChangeXml:void 0};else if(n.tblPrExChangeXml&&!i){const e=(s=n.tblPrExChangeXml,/\bw:id\s*=\s*["']([^"']+)["']/.exec(s)?.[1]);e&&Je(o,e)&&(We(o),"accept"===o.action?(Xe(o,e),n={...n,tblPrExChangeXml:void 0}):Ke(o,{kind:"table-property-exception-original-unavailable",revisionId:e,path:`${t}.tblPrExChangeXml`,message:"The imported w:tblPrExChange has no decodable previous w:tblPrEx snapshot."}))}var s;const a=[];let l=!1;for(let c=0;c<n.cells.length;c+=1){const e=n.cells[c],r=e.style?.revision;if(r&&Je(o,r.id)&&("accept"===o.action&&"delete"===r.type||"reject"===o.action&&"insert"===r.type)){Xe(o,r.id),l=!0;continue}const i=et(e,`${t}.cells[${c}]`,o);a.push(i),i!==e&&(l=!0)}return l&&(n={...n,cells:a}),n}function ot(e,t,o){let n=e;const r=function(e,t,o){const n=e?.revision;if(!n||!Je(o,n.id))return e;Xe(o,n.id);const r=structuredClone("accept"===o.action?e:n.previous);return delete r.revision,r}(n.style,0,o);r!==n.style&&(n={...n,style:r});const i=n.gridRevision;i&&Je(o,i.id)&&(Xe(o,i.id),n="accept"===o.action?{...n,gridRevision:void 0}:{...n,gridCols:[...i.previous],gridRevision:void 0});const s=[];let a=!1;for(let l=0;l<n.rows.length;l+=1){const e=n.rows[l],r=e.style?.revision;if(r&&Je(o,r.id)&&("accept"===o.action&&"delete"===r.type||"reject"===o.action&&"insert"===r.type)){Xe(o,r.id),a=!0;continue}const i=tt(e,`${t}.rows[${l}]`,o);s.push(i),i!==e&&(a=!0)}return a&&(n={...n,rows:s}),a&&(n=function(e){let t=!1;const o=e.rows.map((o,n)=>{let r=!1;const i=o.cells.map((t,o)=>{let i;if("restart"===t.vMerge){i=1;for(let t=n+1;t<e.rows.length;t+=1){const n=e.rows[t].cells[o];if(!n||"continue"!==n.vMerge)break;i+=1}}return t.rowSpan===i?t:(r=!0,{...t,rowSpan:i})});return r?(t=!0,{...o,cells:i}):o});return t?{...e,rows:o}:e}(n),function(e,t,o){const n=Ge([e]),r=Ge([t]),i=new Map(r.map(e=>[e.id,e]));for(let s=0;s<n.length;s+=1){const e=n[s];if(i.has(e.id)||o.paragraphRelocations.has(e.id))continue;let t=null;for(let o=s-1;o>=0;o-=1){const e=i.get(n[o].id);if(e){t={paragraphId:e.id,offset:W(e).length};break}}if(!t)for(let o=s+1;o<n.length;o+=1){const e=i.get(n[o].id);if(e){t={paragraphId:e.id,offset:0};break}}o.paragraphRelocations.set(e.id,t)}}(e,n,o)),n}function nt(e,t,o){let n=!1;const r=e.map((e,r)=>{const i=`${t}[${r}]`,s="paragraph"===e.type?Qe(e,i,o):ot(e,i,o);return s!==e&&(n=!0),s});return n?r:e}var rt=["header","firstPageHeader","evenPageHeader","footer","firstPageFooter","evenPageFooter"];function it(e,t,o){if(!e)return;let n=e.paragraphId,r=e.offset,i=!1;const s=/* @__PURE__ */new Set;for(;o.has(n);){if(s.has(n))return;s.add(n);const e=o.get(n);if(!e)return;n=e.paragraphId,r=e.offset,i=!0}if(!i){const e=t.get(n);e&&(r=function(e,t){const o=Math.max(0,Math.min(t,e.oldLength));for(const n of e.segments)if(!(o>n.oldEnd))return n.kept?n.newStart+Math.max(0,o-n.oldStart):n.newStart;return e.newLength}(e,r))}return n===e.paragraphId&&r===e.offset?e:{...e,paragraphId:n,offset:r}}function st(e,t,o){const n={action:t,revisionId:o,changed:!1,matched:!1,resolvedRevisionIds:/* @__PURE__ */new Set,unresolved:[],unresolvedKeys:/* @__PURE__ */new Set,paragraphOffsetTransforms:/* @__PURE__ */new Map,paragraphRelocations:/* @__PURE__ */new Map},r=v(e).map(i),s={...e,sections:r,footnotes:M(e.footnotes),endnotes:we(e.endnotes)};return function(e,t){for(let o=0;o<e.length;o+=1){let n=e[o];const r=nt(n.blocks,`sections[${o}].blocks`,t);r!==n.blocks&&(n={...n,blocks:r});for(const e of rt){const r=n[e];if(!r)continue;const i=nt(r,`sections[${o}].${e}`,t);i!==r&&(n={...n,[e]:i})}e[o]=n}}(r,n),function(e,t){if(e.footnotes){for(const[o,n]of Object.entries(e.footnotes.items))n.blocks=nt(n.blocks,`footnotes.items[${JSON.stringify(o)}].blocks`,t);e.footnotes.separator&&(e.footnotes.separator=nt(e.footnotes.separator,"footnotes.separator",t)),e.footnotes.continuationSeparator&&(e.footnotes.continuationSeparator=nt(e.footnotes.continuationSeparator,"footnotes.continuationSeparator",t))}if(e.endnotes){for(const[o,n]of Object.entries(e.endnotes.items))n.blocks=nt(n.blocks,`endnotes.items[${JSON.stringify(o)}].blocks`,t);e.endnotes.separator&&(e.endnotes.separator=nt(e.endnotes.separator,"endnotes.separator",t)),e.endnotes.continuationSeparator&&(e.endnotes.continuationSeparator=nt(e.endnotes.continuationSeparator,"endnotes.continuationSeparator",t))}}(s,n),function(e,t){for(let o=0;o<e.length;o+=1){const n=e[o],r=n.propertyRevision;if(!r||!Je(t,r.id))continue;if(Xe(t,r.id),"accept"===t.action){e[o]={...n,propertyRevision:void 0};continue}const i=structuredClone(r.previous);e[o]={...n,pageSettings:i.pageSettings,pageBorder:i.pageBorder,pageNumbering:i.pageNumbering,verticalAlignment:i.verticalAlignment,bidi:i.bidi,propertyRevision:void 0};const s=e[o+1];s&&(e[o+1]={...s,breakType:i.nextBreakType})}}(r,n),function(e,t,o){if(!e.bookmarks||0===t.size&&0===o.size)return;let n=!1;const r={...e.bookmarks.items},i=[];for(const s of e.bookmarks.order){const a=e.bookmarks.items[s];if(!a)continue;const l=it(a.start,t,o),c=it(a.end,t,o),d=l??(a.start?c:void 0),u=c??(a.end?l:void 0);d||u?(i.push(s),d===a.start&&u===a.end||(r[s]={...a,start:d,end:u},n=!0)):(delete r[s],n=!0)}n&&(e.bookmarks={...e.bookmarks,items:r,order:i})}(s,n.paragraphOffsetTransforms,n.paragraphRelocations),s.comments=function(e,t,o){if(!e||0===t.size&&0===o.size)return e;let n=!1;const r={...e.items},i=[];for(const s of e.order){const a=e.items[s];if(!a)continue;const l=it(a.start,t,o),c=it(a.end,t,o),d=l??(a.start?c:void 0),u=c??(a.end?l:void 0);d||u?(i.push(s),d===a.start&&u===a.end||(r[s]={...a,start:d,end:u},n=!0)):(delete r[s],n=!0)}return n?{...e,items:r,order:i}:e}(s.comments,n.paragraphOffsetTransforms,n.paragraphRelocations),void 0===o||n.matched||n.unresolved.push({kind:"revision-not-found",revisionId:o,path:"document",message:`Tracked revision ${o} was not found in the modeled document.`}),{document:n.changed?s:e,changed:n.changed,complete:0===n.unresolved.length,resolvedRevisionIds:[...n.resolvedRevisionIds],unresolved:n.unresolved}}function at(e,t){return st(e,t)}function lt(e,t,o){return st(e,o,t)}function ct(e,t){return at(e,"final"===t?"accept":"reject")}var dt={newDocument:"editor-toolbar-new-document",importDocument:"editor-toolbar-import-document",exportDocx:"editor-toolbar-export-docx",exportPdf:"editor-toolbar-export-pdf",print:"editor-toolbar-print",undo:"editor-toolbar-undo",redo:"editor-toolbar-redo",style:"editor-toolbar-style",fontFamily:"editor-toolbar-font-family",fontSize:"editor-toolbar-font-size",color:"editor-toolbar-color",highlight:"editor-toolbar-highlight",textShading:"editor-toolbar-text-shading",bold:"editor-toolbar-bold",italic:"editor-toolbar-italic",underlineControl:"editor-toolbar-underline-control",strike:"editor-toolbar-strike",superscript:"editor-toolbar-superscript",subscript:"editor-toolbar-subscript",insertImage:"editor-toolbar-insert-image",insertTable:"editor-toolbar-insert-table",symbols:"editor-toolbar-symbols",link:"editor-toolbar-link",unlink:"editor-toolbar-unlink",footnote:"editor-toolbar-footnote",imageAlt:"editor-toolbar-image-alt",imageCaption:"editor-toolbar-image-caption",alignLeft:"editor-toolbar-align-left",alignCenter:"editor-toolbar-align-center",alignRight:"editor-toolbar-align-right",alignJustify:"editor-toolbar-align-justify",bulletList:"editor-toolbar-list-bullet",orderedList:"editor-toolbar-list-ordered",outdent:"editor-toolbar-list-outdent",indent:"editor-toolbar-list-indent",listOptions:"editor-toolbar-list-options",specialIndent:"editor-toolbar-special-indent",lineSpacing:"editor-toolbar-line-spacing-control",metrics:"editor-toolbar-metrics",margins:"editor-toolbar-margins",section:"editor-toolbar-section"},ut={fileNew:"file_new",fileImport:"file_import",fileSave:"file_save",fileExport:"file_export",fileExportPdf:"file_export_pdf",fileExportDocx:"file_export_docx",filePrint:"file_print",editUndo:"edit_undo",editRedo:"edit_redo",editCopy:"edit_copy",editFind:"edit_find",editSelectAll:"edit_selectAll",viewMargins:"view_margins",viewParagraphMarks:"view_paragraph_marks",viewPreciseFonts:"view_precise_fonts",insertImage:"insert_image",insertImageCaption:"insert_image_caption",insertTable:"insert_table",insertLink:"insert_link",insertFootnote:"insert_footnote",insertPageBreak:"insert_pageBreak",formatText:"format_text",formatTextBold:"format_text_bold",formatTextItalic:"format_text_italic",formatTextUnderline:"format_text_underline",formatTextStrike:"format_text_strike",formatAlign:"format_align",formatAlignLeft:"format_align_left",formatAlignCenter:"format_align_center",formatAlignRight:"format_align_right",formatAlignJustify:"format_align_justify",formatLists:"format_lists",formatListsBullet:"format_lists_bullet",formatListsNumbered:"format_lists_numbered"};export{je as ActionRow,n as BalloonShell,A as Button,e as Checkbox,ne as ColorField,j as ColorPicker,j as ToolbarColorPicker,b as CommandRegistry,s as DEFAULT_PALETTE,_e as Dialog,qe as DialogFooter,f as DocumentShell,le as EDITOR_SCHEMA_VERSION,z as Editor,F as FieldGroup,ze as FieldRow,J as FloatingActionButton,P as FormField,u as Grid,Se as GridPicker,Se as ToolbarGridPicker,Ee as Heading,N as IconButton,H as InlineShell,ae as Menu,ae as ToolbarMenu,K as MenuRegistry,I as NumberField,$e as OASIS_BUILTIN_COMMANDS,ut as OASIS_MENU_ITEMS,dt as OASIS_TOOLBAR_ITEMS,Be as OasisEditorAppLazy,Le as OasisEditorContainer,T as OasisEditorLoading,O as PluginCollection,o as Popover,Re as RIBBON_TABS,c as Radio,a as RadioGroup,B as Select,B as ToolbarSelect,se as SelectField,l as Separator,l as ToolbarSeparator,p as SidePanel,C as SidePanelBody,ge as SidePanelFooter,k as SidePanelHeader,d as SplitButton,d as ToolbarSplitButton,h as Stack,S as StatusText,E as StyleGallery,Ie as SurfaceButton,D as Tabs,$ as Text,R as TextAreaField,_ as TextField,Ce as ToggleChip,G as Toolbar,ie as ToolbarButton,ke as buildRibbonTabDefinitions,he as cloneDocument,t as commandRefName,ve as createDefaultToolbarPreset,Y as createDocument,De as createEditorCommandBus,Q as createHeading,Pe as createOasisEditor,Ae as createOasisEditorContainer,pe as createParagraph,ce as createTable,ye as createToolbarRegistry,x as exportEditorDocumentToHtml,te as importHtmlToEditorDocument,Me as mount,ee as normalizeDocument,ct as projectTrackedRevisions,V as registerToolbarRenderer,at as resolveAllTrackedRevisions,re as resolveCommandRef,lt as resolveTrackedRevision,Z as validateDocument};
1
+ import{A as e,Aa as t,Ar as o,B as n,Ba as r,C as i,Cr as s,D as a,Dr as l,E as c,Er as d,F as u,G as p,Ga as g,H as f,Ha as m,Hi as v,Hr as b,I as h,Ia as y,J as k,Jr as x,K as C,L as S,La as w,M as R,Ma as T,N as _,O as I,Or as B,P,Pa as L,Qt as A,R as D,Rr as $,S as M,Sr as E,T as F,Tr as j,Ur as O,V as H,Vr as z,W as N,Xa as q,Y as J,Yi as W,Za as X,_ as K,_r as G,ao as U,br as V,di as Y,fi as Q,gi as Z,hi as ee,ii as te,io as oe,j as ne,ja as re,jr as ie,k as se,kr as ae,li as le,mi as ce,no as de,oo as ue,pi as pe,q as ge,qa as fe,qr as me,t as ve,to as be,ui as he,v as ye,vr as ke,vt as xe,w as Ce,wr as Se,x as we,yr as Re,yt as Te,z as _e,zr as Ie}from"./defaultToolbar-BsQf2jiH.js";function Be(e={}){const t=y(()=>e.ui?.locale??"pt-BR"),[o,n]=be(0),[r,i]=be(null),s=()=>{const t=e.ui?.loading;return"object"==typeof t&&null!==t?t:void 0};return U(()=>{const e=performance.now();let t=!1;const o=()=>{if(t)return;const r=performance.now()-e;n(.9*(1-Math.exp(-r/5e3))),requestAnimationFrame(o)};requestAnimationFrame(o),oe(()=>{t=!0}),import("./OasisEditorApp-BZSScJOd.js").then(e=>{t=!0,n(1),setTimeout(()=>i(()=>e.OasisEditorApp),180)}).catch(()=>{t=!0})}),X(L,{translator:t,get children(){return X(q,{get when(){return r()},get fallback(){return X(T,{variant:"fill",get progress(){return o()},get label(){return s()?.label},get class(){return s()?.class},get style(){return s()?.style}})},children:t=>{const o=t();return X(o,e)}})}})}function Pe(e,t={}){const o=me(),n=m(()=>Be({...t,runtime:{...t.runtime,client:o}}),e);return o.setDispose(()=>{n(),e.innerHTML=""}),o}function Le(e){return X(Be,de(e,{get ui(){return{...e.ui,showChrome:!1}}}))}function Ae(e,t={}){const o=me(),n=m(()=>Le({...t,runtime:{...t.runtime,client:o}}),e);return o.setDispose(()=>{n(),e.innerHTML=""}),o}function De(e){return{execute(t,o){const n=re(t,o);return e.commands.execute(n.name,n.payload)},canExecute(t,o){const n=re(t,o);return e.commands.canExecute(n.name,n.payload)},state(t){const o=re(t);return e.commands.state(o.name,o.payload)}}}var $e=["selectAll","insertFootnote","insertText","insertEquation","updateEquation","insertTableOfContents","updateTableOfContents","pastePlainText","paste","pasteAsPlainText","pasteMergeFormatting","formatPainter","formatPainterContinuous","cancelFormatPainter","bold","italic","underline","strike","superscript","subscript","link","unlink","alignLeft","alignCenter","alignRight","alignJustify","orderedList","bulletList","find","replace","toggleTrackChanges","acceptRevisions","rejectRevisions","nextRevision","previousRevision","nextComment","previousComment","newComment","replyComment","editComment","toggleCommentsPanel","resolveComment","reopenComment","deleteComment","toggleShowMargins","toggleShowParagraphMarks","togglePreciseFonts","undo","redo","pageBreak","lineBreak","splitBlock","setFontFamily","setFontSize","increaseFontSize","decreaseFontSize","changeTextCase","clearFormatting","setColor","setHighlight","setTextShading","setStyleId","setCharacterStyleId","setUnderlineStyle","documentStyles","print","copy","cut","newDocument","exportDocx","exportPdf","importDocument","insertHtml","insertImage","editImageAlt","insertImageCaption","imageContext","imageWidthCm","imageHeightCm","imageCrop","imageCropAspect","imageCropShape","imageCropFill","imageCropFit","imageCropReset","imageBorder","outdent","indent","togglePageBreakBefore","toggleKeepWithNext","setSpacingAfter","setSpacingBefore","setIndentLeft","setIndentRight","setIndentFirstLine","setIndentHanging","setSpecialIndent","setParagraphShading","applyParagraphBorders","setLineHeight","setListFormat","setListStartAt","toggleOrientation","setOrientation","sectionBreakNextPage","sectionBreakContinuous","setPageMargins","applyDocumentTheme","setDocumentColorScheme","setDocumentFontScheme","setDocumentParagraphSpacing","setDocumentEffects","setDocumentPageColor","setDocumentWatermark","setDocumentPageBorder","setDocumentDesignDefault","tableContext","tableMerge","tableSplit","tableInsertColumnBefore","tableInsertColumnAfter","tableDeleteColumn","tableInsertRowBefore","tableInsertRowAfter","tableDeleteRow","tableCellShading","tableCellBorders","tableCellNoBorders","tableApplyBorderPreset","toggleTableDrawBorders","toggleTableGridlines","tableWidth100","tableAlignLeft","tableAlignCenter","tableAlignRight","tableSetCellWidth","tableToggleHeaderRow","tableToggleTotalRow","tableToggleBandedRows","tableToggleFirstColumn","tableToggleLastColumn","tableToggleBandedColumns","setTableStyle","tableToggleAutoFit","tableDistributeColumns","tableDistributeRows","insertTable","insertShape","openSymbolDialog","openEquationDialog"];function Me(e,t={}){const o=me(),n=m(()=>X(Be,de(t,{get runtime(){return{...t.runtime,client:o}}})),e);return o.setDispose(()=>{n(),e.innerHTML=""}),Object.assign(o,{unmount:()=>o.dispose()})}function Ee(e){const[t,o]=ue(e,["level","class","classList","children"]),n=t.level??2;return X(w,de({component:`h${n}`,get class(){return`oasis-editor-ui-heading ${t.class??""}`},get classList(){return{[`oasis-editor-ui-heading-${n}`]:!0,...t.classList}}},o,{get children(){return t.children}}))}var Fe=/*#__PURE__*/fe("<div>");function je(e){const[t,o]=ue(e,["align","wrap","class","classList","children"]);return n=Fe(),g(n,de({get class(){return`oasis-editor-ui-action-row ${t.class??""}`},get classList(){return{[`oasis-editor-ui-action-row-${t.align??"start"}`]:!0,"oasis-editor-ui-action-row-nowrap":!1===t.wrap,...t.classList}}},o),!1,!0),r(n,()=>t.children),n;var n}var Oe=/*#__PURE__*/fe("<div>"),He={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function ze(e){const[t,o]=ue(e,["align","class","style","children"]);return n=Oe(),g(n,de({get class(){return`oasis-editor-ui-field-row ${t.class??""}`},get style(){return{"align-items":He[t.align??"end"],..."object"==typeof t.style?t.style:{}}}},o),!1,!0),r(n,()=>t.children),n;var n}var Ne=/*#__PURE__*/fe("<div>");function qe(e){const[t,o]=ue(e,["align","class","classList","children"]);return n=Ne(),g(n,de({get class(){return`oasis-editor-ui-dialog-footer ${t.class??""}`},get classList(){return{[`oasis-editor-ui-dialog-footer-${t.align??"end"}`]:!0,...t.classList}}},o),!1,!0),r(n,()=>t.children),n;var n}function Je(e,t){return void 0===e.revisionId||e.revisionId===t}function We(e){e.matched=!0}function Xe(e,t){e.matched=!0,e.changed=!0,e.resolvedRevisionIds.add(t)}function Ke(e,t){e.matched=!0;const o=`${t.kind}:${t.revisionId??""}:${t.path}`;e.unresolvedKeys.has(o)||(e.unresolvedKeys.add(o),e.unresolved.push(t))}function Ge(e){const t=[],o=e=>{for(const n of e)if("paragraph"!==n.type)for(const e of n.rows)for(const t of e.cells)o(t.blocks);else{t.push(n);for(const e of n.runs)"textBox"===e.kind&&o(e.textBox.blocks)}};return o(e),t}function Ue(e){const t=Te(e);if(t)return delete t.propertyRevision,Object.keys(t).length>0?t:void 0}function Ve(e){const t=xe(e);if(t)return delete t.propertyRevision,Object.keys(t).length>0?t:void 0}function Ye(e,t,o){if(e.revisionRangeMarker&&Je(o,e.revisionRangeMarker.id))return Xe(o,e.revisionRangeMarker.id),null;if(!function(e,t,o){const n=e.revision;return!n||!Je(o,n.id)||(Xe(o,n.id),"accept"===o.action?"insert"===n.type:"delete"===n.type)}(e,0,o))return null;let n=e;e.revision&&Je(o,e.revision.id)&&(n={...n,revision:void 0});const r=function(e,t,o){const n=e?.propertyRevision;return n&&Je(o,n.id)?(Xe(o,n.id),"accept"===o.action?Ue(e):Ue(n.previous)):e}(n.styles,0,o);if(r!==n.styles&&(n={...n,styles:r}),"textBox"===n.kind){const e=nt(n.textBox.blocks,`${t}.textBox.blocks`,o);e!==n.textBox.blocks&&(n={...n,textBox:{...n.textBox,blocks:e}})}return n}function Qe(e,t,o){const n=[],r=[];let i=0,s=0;for(let d=0;d<e.runs.length;d+=1){const a=e.runs[d],l=Ye(a,`${t}.runs[${d}]`,o);if(!l&&"textBox"===a.kind)for(const t of Ge(a.textBox.blocks))o.paragraphRelocations.has(t.id)||o.paragraphRelocations.set(t.id,{paragraphId:e.id,offset:s});const c=a.text.length;r.push({oldStart:i,oldEnd:i+c,newStart:s,kept:null!==l}),i+=c,l&&(n.push(l),s+=l.text.length)}i!==s&&o.paragraphOffsetTransforms.set(e.id,{segments:r,oldLength:i,newLength:s});let a=n.length===e.runs.length&&n.every((t,o)=>t===e.runs[o])?e:{...e,runs:n};const l=function(e,t,o){const n=e?.propertyRevision;return n&&Je(o,n.id)?(Xe(o,n.id),"accept"===o.action?Ve(e):Ve(n.previous)):e}(a.style,0,o);l!==a.style&&(a={...a,style:l});const c=a.numberingRevision;return c&&Je(o,c.id)&&(We(o),"accept"===o.action?(Xe(o,c.id),a={...a,numberingRevision:void 0}):Ke(o,{kind:"numbering-original-unavailable",revisionId:c.id,path:`${t}.numberingRevision`,message:"w:numberingChange only stores the previous rendered-number cache; it cannot reconstruct the previous numId/ilvl safely."})),a}function Ze(e){const t=e.mergeRevisionState;if("vertical"===t?.orientation&&1===t.currentCellCount&&1===t.previousCells.length)return structuredClone(t.previousCells[0]);const o=e.style?.revision;return"merge"===o?.type&&"continue"===o.previous?.vMerge?{...e,blocks:[],rowSpan:void 0,vMerge:"continue",style:e.style?{...e.style,revision:void 0}:e.style,mergeRevisionState:void 0}:void 0}function et(e,t,o){let n=function(e,t,o){const n=e.style?.revision,r=e.mergeRevisionState&&Je(o,e.mergeRevisionState.revisionId);if(n&&Je(o,n.id)){if(We(o),"reject"===o.action&&"merge"===n.type){const r=Ze(e);return r?(Xe(o,n.id),r):(Ke(o,{kind:"cell-merge-original-unavailable",revisionId:n.id,path:t,message:"The previous merge topology lacks an exact semantic snapshot for safe restoration."}),e)}return Xe(o,n.id),{...e,style:e.style?{...e.style,revision:void 0}:e.style,..."merge"===n.type?{mergeRevisionState:void 0}:{}}}if(r){const n=e.mergeRevisionState.revisionId;if(We(o),"accept"===o.action)return Xe(o,n),{...e,mergeRevisionState:void 0};const r=Ze(e);if(r)return Xe(o,n),r;Ke(o,{kind:"cell-merge-original-unavailable",revisionId:n,path:`${t}.mergeRevisionState`,message:"The preserved merge snapshot is not a supported exact vertical-cell restoration."})}return e}(e,t,o);const r=function(e,t,o){const n=e?.propertyRevision;if(!n||!Je(o,n.id))return e;Xe(o,n.id);const r=e.revision?structuredClone(e.revision):void 0,i=structuredClone("accept"===o.action?e:n.previous);return delete i.propertyRevision,r&&(i.revision=r),i}(n.style,0,o);r!==n.style&&(n={...n,style:r});const i=nt(n.blocks,`${t}.blocks`,o);return i!==n.blocks&&(n={...n,blocks:i}),n}function tt(e,t,o){let n=function(e,t,o){const n=e.style?.revision;return n&&Je(o,n.id)?(We(o),"reject"===o.action&&"merge"===n.type?(Ke(o,{kind:"cell-merge-original-unavailable",revisionId:n.id,path:t,message:"The original table structure for this merge revision is not reconstructed by the core resolver yet."}),e):(Xe(o,n.id),{...e,style:e.style?{...e.style,revision:void 0}:e.style})):e}(e,t,o);const r=function(e,t,o){const n=e?.propertyRevision;if(!n||!Je(o,n.id))return e;Xe(o,n.id);const r=e.revision?structuredClone(e.revision):void 0,i=structuredClone("accept"===o.action?e:n.previous);return delete i.propertyRevision,r&&(i.revision=r),i}(n.style,0,o);r!==n.style&&(n={...n,style:r});const i=n.propertyExceptionsRevision;if(i&&Je(o,i.id))Xe(o,i.id),n={...n,propertyExceptions:"accept"===o.action?n.propertyExceptions:structuredClone(i.previous),propertyExceptionsRevision:void 0,tblPrExChangeXml:void 0};else if(n.tblPrExChangeXml&&!i){const e=(s=n.tblPrExChangeXml,/\bw:id\s*=\s*["']([^"']+)["']/.exec(s)?.[1]);e&&Je(o,e)&&(We(o),"accept"===o.action?(Xe(o,e),n={...n,tblPrExChangeXml:void 0}):Ke(o,{kind:"table-property-exception-original-unavailable",revisionId:e,path:`${t}.tblPrExChangeXml`,message:"The imported w:tblPrExChange has no decodable previous w:tblPrEx snapshot."}))}var s;const a=[];let l=!1;for(let c=0;c<n.cells.length;c+=1){const e=n.cells[c],r=e.style?.revision;if(r&&Je(o,r.id)&&("accept"===o.action&&"delete"===r.type||"reject"===o.action&&"insert"===r.type)){Xe(o,r.id),l=!0;continue}const i=et(e,`${t}.cells[${c}]`,o);a.push(i),i!==e&&(l=!0)}return l&&(n={...n,cells:a}),n}function ot(e,t,o){let n=e;const r=function(e,t,o){const n=e?.revision;if(!n||!Je(o,n.id))return e;Xe(o,n.id);const r=structuredClone("accept"===o.action?e:n.previous);return delete r.revision,r}(n.style,0,o);r!==n.style&&(n={...n,style:r});const i=n.gridRevision;i&&Je(o,i.id)&&(Xe(o,i.id),n="accept"===o.action?{...n,gridRevision:void 0}:{...n,gridCols:[...i.previous],gridRevision:void 0});const s=[];let a=!1;for(let l=0;l<n.rows.length;l+=1){const e=n.rows[l],r=e.style?.revision;if(r&&Je(o,r.id)&&("accept"===o.action&&"delete"===r.type||"reject"===o.action&&"insert"===r.type)){Xe(o,r.id),a=!0;continue}const i=tt(e,`${t}.rows[${l}]`,o);s.push(i),i!==e&&(a=!0)}return a&&(n={...n,rows:s}),a&&(n=function(e){let t=!1;const o=e.rows.map((o,n)=>{let r=!1;const i=o.cells.map((t,o)=>{let i;if("restart"===t.vMerge){i=1;for(let t=n+1;t<e.rows.length;t+=1){const n=e.rows[t].cells[o];if(!n||"continue"!==n.vMerge)break;i+=1}}return t.rowSpan===i?t:(r=!0,{...t,rowSpan:i})});return r?(t=!0,{...o,cells:i}):o});return t?{...e,rows:o}:e}(n),function(e,t,o){const n=Ge([e]),r=Ge([t]),i=new Map(r.map(e=>[e.id,e]));for(let s=0;s<n.length;s+=1){const e=n[s];if(i.has(e.id)||o.paragraphRelocations.has(e.id))continue;let t=null;for(let o=s-1;o>=0;o-=1){const e=i.get(n[o].id);if(e){t={paragraphId:e.id,offset:W(e).length};break}}if(!t)for(let o=s+1;o<n.length;o+=1){const e=i.get(n[o].id);if(e){t={paragraphId:e.id,offset:0};break}}o.paragraphRelocations.set(e.id,t)}}(e,n,o)),n}function nt(e,t,o){let n=!1;const r=e.map((e,r)=>{const i=`${t}[${r}]`,s="paragraph"===e.type?Qe(e,i,o):ot(e,i,o);return s!==e&&(n=!0),s});return n?r:e}var rt=["header","firstPageHeader","evenPageHeader","footer","firstPageFooter","evenPageFooter"];function it(e,t,o){if(!e)return;let n=e.paragraphId,r=e.offset,i=!1;const s=/* @__PURE__ */new Set;for(;o.has(n);){if(s.has(n))return;s.add(n);const e=o.get(n);if(!e)return;n=e.paragraphId,r=e.offset,i=!0}if(!i){const e=t.get(n);e&&(r=function(e,t){const o=Math.max(0,Math.min(t,e.oldLength));for(const n of e.segments)if(!(o>n.oldEnd))return n.kept?n.newStart+Math.max(0,o-n.oldStart):n.newStart;return e.newLength}(e,r))}return n===e.paragraphId&&r===e.offset?e:{...e,paragraphId:n,offset:r}}function st(e,t,o){const n={action:t,revisionId:o,changed:!1,matched:!1,resolvedRevisionIds:/* @__PURE__ */new Set,unresolved:[],unresolvedKeys:/* @__PURE__ */new Set,paragraphOffsetTransforms:/* @__PURE__ */new Map,paragraphRelocations:/* @__PURE__ */new Map},r=v(e).map(i),s={...e,sections:r,footnotes:M(e.footnotes),endnotes:we(e.endnotes)};return function(e,t){for(let o=0;o<e.length;o+=1){let n=e[o];const r=nt(n.blocks,`sections[${o}].blocks`,t);r!==n.blocks&&(n={...n,blocks:r});for(const e of rt){const r=n[e];if(!r)continue;const i=nt(r,`sections[${o}].${e}`,t);i!==r&&(n={...n,[e]:i})}e[o]=n}}(r,n),function(e,t){if(e.footnotes){for(const[o,n]of Object.entries(e.footnotes.items))n.blocks=nt(n.blocks,`footnotes.items[${JSON.stringify(o)}].blocks`,t);e.footnotes.separator&&(e.footnotes.separator=nt(e.footnotes.separator,"footnotes.separator",t)),e.footnotes.continuationSeparator&&(e.footnotes.continuationSeparator=nt(e.footnotes.continuationSeparator,"footnotes.continuationSeparator",t))}if(e.endnotes){for(const[o,n]of Object.entries(e.endnotes.items))n.blocks=nt(n.blocks,`endnotes.items[${JSON.stringify(o)}].blocks`,t);e.endnotes.separator&&(e.endnotes.separator=nt(e.endnotes.separator,"endnotes.separator",t)),e.endnotes.continuationSeparator&&(e.endnotes.continuationSeparator=nt(e.endnotes.continuationSeparator,"endnotes.continuationSeparator",t))}}(s,n),function(e,t){for(let o=0;o<e.length;o+=1){const n=e[o],r=n.propertyRevision;if(!r||!Je(t,r.id))continue;if(Xe(t,r.id),"accept"===t.action){e[o]={...n,propertyRevision:void 0};continue}const i=structuredClone(r.previous);e[o]={...n,pageSettings:i.pageSettings,pageBorder:i.pageBorder,pageNumbering:i.pageNumbering,verticalAlignment:i.verticalAlignment,bidi:i.bidi,propertyRevision:void 0};const s=e[o+1];s&&(e[o+1]={...s,breakType:i.nextBreakType})}}(r,n),function(e,t,o){if(!e.bookmarks||0===t.size&&0===o.size)return;let n=!1;const r={...e.bookmarks.items},i=[];for(const s of e.bookmarks.order){const a=e.bookmarks.items[s];if(!a)continue;const l=it(a.start,t,o),c=it(a.end,t,o),d=l??(a.start?c:void 0),u=c??(a.end?l:void 0);d||u?(i.push(s),d===a.start&&u===a.end||(r[s]={...a,start:d,end:u},n=!0)):(delete r[s],n=!0)}n&&(e.bookmarks={...e.bookmarks,items:r,order:i})}(s,n.paragraphOffsetTransforms,n.paragraphRelocations),s.comments=function(e,t,o){if(!e||0===t.size&&0===o.size)return e;let n=!1;const r={...e.items},i=[];for(const s of e.order){const a=e.items[s];if(!a)continue;const l=it(a.start,t,o),c=it(a.end,t,o),d=l??(a.start?c:void 0),u=c??(a.end?l:void 0);d||u?(i.push(s),d===a.start&&u===a.end||(r[s]={...a,start:d,end:u},n=!0)):(delete r[s],n=!0)}return n?{...e,items:r,order:i}:e}(s.comments,n.paragraphOffsetTransforms,n.paragraphRelocations),void 0===o||n.matched||n.unresolved.push({kind:"revision-not-found",revisionId:o,path:"document",message:`Tracked revision ${o} was not found in the modeled document.`}),{document:n.changed?s:e,changed:n.changed,complete:0===n.unresolved.length,resolvedRevisionIds:[...n.resolvedRevisionIds],unresolved:n.unresolved}}function at(e,t){return st(e,t)}function lt(e,t,o){return st(e,o,t)}function ct(e,t){return at(e,"final"===t?"accept":"reject")}var dt={newDocument:"editor-toolbar-new-document",importDocument:"editor-toolbar-import-document",exportDocx:"editor-toolbar-export-docx",exportPdf:"editor-toolbar-export-pdf",print:"editor-toolbar-print",undo:"editor-toolbar-undo",redo:"editor-toolbar-redo",style:"editor-toolbar-style",fontFamily:"editor-toolbar-font-family",fontSize:"editor-toolbar-font-size",color:"editor-toolbar-color",highlight:"editor-toolbar-highlight",textShading:"editor-toolbar-text-shading",bold:"editor-toolbar-bold",italic:"editor-toolbar-italic",underlineControl:"editor-toolbar-underline-control",strike:"editor-toolbar-strike",superscript:"editor-toolbar-superscript",subscript:"editor-toolbar-subscript",insertImage:"editor-toolbar-insert-image",insertTable:"editor-toolbar-insert-table",symbols:"editor-toolbar-symbols",link:"editor-toolbar-link",unlink:"editor-toolbar-unlink",footnote:"editor-toolbar-footnote",imageAlt:"editor-toolbar-image-alt",imageCaption:"editor-toolbar-image-caption",alignLeft:"editor-toolbar-align-left",alignCenter:"editor-toolbar-align-center",alignRight:"editor-toolbar-align-right",alignJustify:"editor-toolbar-align-justify",bulletList:"editor-toolbar-list-bullet",orderedList:"editor-toolbar-list-ordered",outdent:"editor-toolbar-list-outdent",indent:"editor-toolbar-list-indent",listOptions:"editor-toolbar-list-options",specialIndent:"editor-toolbar-special-indent",lineSpacing:"editor-toolbar-line-spacing-control",metrics:"editor-toolbar-metrics",margins:"editor-toolbar-margins",section:"editor-toolbar-section"},ut={fileNew:"file_new",fileImport:"file_import",fileSave:"file_save",fileExport:"file_export",fileExportPdf:"file_export_pdf",fileExportDocx:"file_export_docx",filePrint:"file_print",editUndo:"edit_undo",editRedo:"edit_redo",editCopy:"edit_copy",editFind:"edit_find",editSelectAll:"edit_selectAll",viewMargins:"view_margins",viewParagraphMarks:"view_paragraph_marks",viewPreciseFonts:"view_precise_fonts",insertImage:"insert_image",insertImageCaption:"insert_image_caption",insertTable:"insert_table",insertLink:"insert_link",insertFootnote:"insert_footnote",insertPageBreak:"insert_pageBreak",formatText:"format_text",formatTextBold:"format_text_bold",formatTextItalic:"format_text_italic",formatTextUnderline:"format_text_underline",formatTextStrike:"format_text_strike",formatAlign:"format_align",formatAlignLeft:"format_align_left",formatAlignCenter:"format_align_center",formatAlignRight:"format_align_right",formatAlignJustify:"format_align_justify",formatLists:"format_lists",formatListsBullet:"format_lists_bullet",formatListsNumbered:"format_lists_numbered"};export{je as ActionRow,n as BalloonShell,A as Button,e as Checkbox,ne as ColorField,j as ColorPicker,j as ToolbarColorPicker,b as CommandRegistry,s as DEFAULT_PALETTE,_e as Dialog,qe as DialogFooter,f as DocumentShell,le as EDITOR_SCHEMA_VERSION,z as Editor,F as FieldGroup,ze as FieldRow,J as FloatingActionButton,P as FormField,u as Grid,Se as GridPicker,Se as ToolbarGridPicker,Ee as Heading,N as IconButton,H as InlineShell,ae as Menu,ae as ToolbarMenu,K as MenuRegistry,I as NumberField,$e as OASIS_BUILTIN_COMMANDS,ut as OASIS_MENU_ITEMS,dt as OASIS_TOOLBAR_ITEMS,Be as OasisEditorAppLazy,Le as OasisEditorContainer,T as OasisEditorLoading,O as PluginCollection,o as Popover,Re as RIBBON_TABS,c as Radio,a as RadioGroup,B as Select,B as ToolbarSelect,se as SelectField,l as Separator,l as ToolbarSeparator,p as SidePanel,C as SidePanelBody,ge as SidePanelFooter,k as SidePanelHeader,d as SplitButton,d as ToolbarSplitButton,h as Stack,S as StatusText,E as StyleGallery,Ie as SurfaceButton,D as Tabs,$ as Text,R as TextAreaField,_ as TextField,Ce as ToggleChip,G as Toolbar,ie as ToolbarButton,ke as buildRibbonTabDefinitions,he as cloneDocument,t as commandRefName,ve as createDefaultToolbarPreset,Y as createDocument,De as createEditorCommandBus,Q as createHeading,Pe as createOasisEditor,Ae as createOasisEditorContainer,pe as createParagraph,ce as createTable,ye as createToolbarRegistry,x as exportEditorDocumentToHtml,te as importHtmlToEditorDocument,Me as mount,ee as normalizeDocument,ct as projectTrackedRevisions,V as registerToolbarRenderer,at as resolveAllTrackedRevisions,re as resolveCommandRef,lt as resolveTrackedRevision,Z as validateDocument};