@ones-editor/editor 1.1.14 → 1.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ Available method signatures are:
24
24
  `:""}const PB={boxType:"br",updateBoxContent:UM,convertTo:OM},FB=I("editor-boxes");class KB{constructor(t){m(this,"boxes",new Map);this.editor=t}registerBoxClass(t){const e=t.boxType,r=this.boxes.get(e);p(FB,!r,`duplicated box type: ${e}`),this.boxes.set(e,t)}getBoxClass(t){const e=this.boxes.get(t);return p(FB,e,`unknown box type: ${t}`),e}createBox(t,e){const r=Kv(e),i=$v(r);return this.getBoxClass(e.type).updateBoxContent(this.editor,r,i,e),r}forEach(t){this.boxes.forEach(t)}}function NM(n,t,e,r){const i=r,{width:o,height:s,src:l}=i,c=["editor-box-image"];i.link&&c.push("editor-box-image-link");const d=B("img",c,e);o&&(d.style.width=`${o}px`),s&&(d.style.height=`${s}px`),d.src=n.doc.buildResourceUrl(l)}const VB={boxType:"image",updateBoxContent:NM},PM="data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9InJnYigxNzgsIDE4OCwgMjA1KSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0ibTE3IDE1IDEuNTUgMS41NWMtLjk2IDEuNjktMy4zMyAzLjA0LTUuNTUgMy4zN1YxMWgzVjloLTNWNy44MkMxNC4xNiA3LjQgMTUgNi4zIDE1IDVjMC0xLjY1LTEuMzUtMy0zLTNTOSAzLjM1IDkgNWMwIDEuMy44NCAyLjQgMiAyLjgyVjlIOHYyaDN2OC45MmMtMi4yMi0uMzMtNC41OS0xLjY4LTUuNTUtMy4zN0w3IDE1bC00LTN2M2MwIDMuODggNC45MiA3IDkgN3M5LTMuMTIgOS03di0zbC00IDN6TTEyIDRjLjU1IDAgMSAuNDUgMSAxcy0uNDUgMS0xIDEtMS0uNDUtMS0xIC40NS0xIDEtMXoiPjwvcGF0aD4KPC9zdmc+Cg==";function FM(n,t,e){z(e,"editor-box-anchor"),Dg(PM,[],e)}const $B={boxType:"anchor",updateBoxContent:FM};function KM(n,t,e,r){B("span",[],e,r.text)}const HB={insertionType:"inputting",updateInsertionContent:KM},jB=I("editor-insertion");class zB{constructor(t){m(this,"insertions",new Map);this.editor=t}registerInsertionClass(t){const e=t.insertionType,r=this.insertions.get(e);p(jB,!r,`duplicated insertion type: ${e}`),this.insertions.set(e,t)}getInsertionClass(t){const e=this.insertions.get(t);return p(jB,e,`unknown insertion type: ${t}`),e}createInsertion(t,e){const r=Hv(e.type,e.id,e.attributes),i=zv(r);return this.getInsertionClass(e.type).updateInsertionContent(this.editor,r,i,e),r}}class VM{constructor(t){m(this,"cursors",new Map);m(this,"timer");this.editor=t,this.timer=this.startTimer()}add(t,e){this.cursors.set(t,e)}startTimer(){return setInterval(()=>{const t=Date.now();Array.from(this.cursors).forEach(([e,r])=>{if(t-r>3e3){const i=jv(this.editor,e);i&&ot(i,"active"),this.cursors.delete(e)}})},1e3)}destroy(){clearInterval(this.timer)}}function $M(n,t,e,r){var l;const i=r;Date.now()-i.time<5*1e3&&(n.addCustom("active-cursors",d=>new VM(d)).add(i.id,i.time),z(t,"active")),B("span",[],e,"|").setAttribute("data-cursor-name",i.name),t.style.setProperty("--cursor-color",n.getColor((l=i.rainbowIndex)!=null?l:0))}const tp={insertionType:"remote-cursor",updateInsertionContent:$M};class GB{constructor(t){m(this,"decorators",[]);this.editor=t}registerDecorator(t){this.decorators.push(t)}decorateBlock(t,e){let r=e;return this.decorators.forEach(i=>{if(i.decorateBlock){const o=i.decorateBlock(this.editor,t,e);o&&(r=mt.default(o))}}),r}decorateText(t,e){let r=e;const i=new Map;return this.decorators.forEach(o=>{if(o.decorateText){const s=o.decorateText(this.editor,t,e);if(s){const{insertions:l,text:c}=s;l&&Array.from(l.entries()).forEach(([d,h])=>{const C=i.get(d);C?C.push(...h):i.set(d,h)}),c&&(r=mt.default(c))}}}),{insertions:i,text:r}}}const ep=I("editor-input");class HM{constructor(t,e){m(this,"editor");m(this,"composing",!1);m(this,"callbacks");m(this,"inputElement");m(this,"handleWindowBlur",()=>{this.editor.emit("blur",this.editor),this.callbacks.onBlur()});m(this,"handleDocumentClick",t=>{const e=this.editor.rootContainer,r=t.target;if(r&&e.contains(r)&&!Xs(r)){this.editor.emit("focus",this.editor),this.callbacks.onFocus(),this.editor.input.focus();return}this.editor.emit("blur",this.editor),this.callbacks.onBlur()});m(this,"handleDocumentSelectionChange",()=>{setTimeout(()=>{var e;const t=(e=document.getSelection())==null?void 0:e.focusNode;t&&this.editor.contains(t)&&!Xs(t)||(this.editor.emit("blur",this.editor),this.callbacks.onBlur())},100)});m(this,"handleEditorSelectionChanged",()=>{const e=!this.editor.isWritable();this.inputElement.readOnly=e});m(this,"handleReadonlyChanged",()=>{this.handleEditorSelectionChanged()});m(this,"handleCompositionstart",t=>{!this.editor.isWritable()||(this.composing=!0,this.callbacks.onCompositionStart(t))});m(this,"handleCompositionend",t=>{ha()?setTimeout(()=>{this.composing=!1},100):this.composing=!1,this.callbacks.onUpdateCompositionText(t,this.inputElement.value,!0),this.inputElement.value=""});m(this,"handleInput",t=>{if(t instanceof InputEvent&&!!t.data){if(this.editor.readonly||!this.editor.isWritable()){this.inputElement.value="";return}this.composing?this.callbacks.onUpdateCompositionText(t,t.data,!1):(this.callbacks.onInsertText(t,t.data),this.inputElement.value="")}});m(this,"handleKeyDown",t=>{if(!this.composing){if(this.callbacks.onKeyDown(t)){t.preventDefault(),t.stopPropagation();return}!this.editor.isWritable()||setTimeout(()=>{this.composing||(this.inputElement.value="")})}});m(this,"handleCopy",t=>{this.callbacks.onCopy(t)});m(this,"handleCut",t=>{if(this.editor.readonly){t.stopPropagation(),t.preventDefault();return}this.callbacks.onCut(t),ep.debug("on cut")});m(this,"handlePaste",t=>{if(!(t.isTrusted&&(!(t.target instanceof HTMLInputElement)||this.inputElement!==t.target))){if(this.editor.readonly){t.stopPropagation(),t.preventDefault();return}this.callbacks.onPaste(t)}});m(this,"handlePasteText",(t,e)=>{this.callbacks.onPasteText(t,e)});this.editor=t,this.callbacks=e;const r=B("input",["editor-input"],t.contentElement);r.type="text",r.name="editor-input",r.onkeydown=this.handleKeyDown,r.oninput=this.handleInput,r.oncopy=this.handleCopy,document.addEventListener("paste",this.handlePaste),r.oncut=this.handleCut,r.addEventListener("compositionstart",this.handleCompositionstart),r.addEventListener("compositionend",this.handleCompositionend),this.inputElement=r,document.addEventListener("click",this.handleDocumentClick),document.addEventListener("selectionchange",this.handleDocumentSelectionChange),this.editor.addListener("selectionChanged",this.handleEditorSelectionChanged),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged),window.addEventListener("blur",this.handleWindowBlur)}destroy(){this.callbacks.destroy(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("selectionchange",this.handleDocumentSelectionChange),this.editor.removeListener("selectionChanged",this.handleEditorSelectionChanged),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged);const t=this.inputElement;t.removeEventListener("compositionstart",this.handleCompositionstart),t.removeEventListener("compositionend",this.handleCompositionend),t.onkeydown=null,t.oninput=null,t.oncopy=null,document.removeEventListener("paste",this.handlePaste),window.removeEventListener("blur",this.handleWindowBlur),t.oncut=null}getInput(){return this.inputElement}focus(){this.editor.selection.caret.visible()||this.editor.selection.caret.update(),ce.isMobileSafari?(this.inputElement.focus(),z(this.editor.rootElement,"active")):setTimeout(()=>{this.inputElement.focus(),z(this.editor.rootElement,"active")})}handleChanged(t){this.callbacks.onChanged(t)}handleRemoteChanged(t){this.callbacks.onRemoteChanged(t)}addHandler(t){this.callbacks.addHandler(t)}removeHandler(t){this.callbacks.removeHandler(t)}defaultInsertText(t,e,r,i,o){p(ep,t===this.editor,"invalid editor"),this.callbacks.defaultInsertText(t,e,r,i,o)}defaultHandleKeydown(t,e){return p(ep,t===this.editor,"invalid editor"),this.callbacks.defaultHandleKeydown(t,e)}forEach(t){this.callbacks.forEach(t)}}function WB(n){const t=n.rootElement,e=t.getBoundingClientRect(),r=ur(t),i=window.innerWidth,o=window.innerHeight,s=e.left<0?0:e.left,l=e.top<0?0:e.top,c=e.right>i?i:e.right,d=e.bottom>o?o:e.bottom,h=(s+c)/2,C=(l+d)/2,E=0-e.left+h,A=0-e.top+C,v=n.input.inputElement;v.style.left=`${E/r}px`,v.style.top=`${A/r}px`}const np=I("editor-caret");function jM(){const t=window.navigator.userAgent.match(/Firefox\/(\d+)\./);return t?Number.parseInt(t[1],10):null}class zM{constructor(t){m(this,"editor");m(this,"caretElem");m(this,"handleReadOnlyChanged",()=>{this.update()});if(this.editor=t,this.caretElem=B("div",["editor-cursor"],this.editor.contentElement),ce.isFirefox){const e=jM();e&&e<=79&&(this.caretElem.style.transition="none")}this.editor.on("readonlyChanged",this.handleReadOnlyChanged)}destroy(){this.editor.off("readonlyChanged",this.handleReadOnlyChanged)}visible(){const t=window.getComputedStyle(this.caretElem);return t.display!=="none"&&t.opacity!=="0"}hasCaret(){if(this.editor.readonly||!this.editor.selection.range.isCollapsed())return!1;const t=this.editor.selection.range.start;if(!(t instanceof Ye))return!1;const e=this.editor.getBlockById(t.blockId);return!!nt(this.editor,e)}update(){if(Ug(this.editor.rootElement))return;const t=this.caretElem;if(this.hasCaret())t.style.display="";else{t.style.display="none",WB(this.editor);return}const{range:e}=this.editor.selection;p(np,e.isCollapsed,"range is not collapsed");const r=e.start;p(np,r instanceof Ye,"only simple block position can has caret");const i=this.editor.getBlockById(r.blockId);p(np,nt(this.editor,i),"only text kind block can has caret");let o;const s=i.querySelector("span.inputting-insertion");s?(o=Ps(s),o=new DOMRect(o.right,o.top,1,o.height)):o=Qn(i,r);const l=this.editor.contentElement.getBoundingClientRect(),c=o.left-l.left,d=o.top-l.top;t.style.left=`${c}px`,t.style.top=`${d}px`,t.style.height=`${o.height}px`;const h=this.editor.input.inputElement;h.style.left=`${c}px`,h.style.top=`${d+o.height-24}px`,ce.isMobileSafari&&(h.style.left=`${c-4}px`,h.style.height=`${o.height}px`);const E=We(i,{horizontal:!0}).getBoundingClientRect(),A=E.left-l.left,v=A+E.width;c<A||c>v?(WB(this.editor),t.style.display="none"):t.style.display=""}}function GM(n){qv(n),n.selection.range.getSelectedBlocks().forEach(t=>Xv(n,t.block,t.start,t.end))}const WM=I("editor-dom");function Th(n){return We(n.rootContainer).clientHeight}function Eu(n){const e=We(n.rootContainer).getBoundingClientRect(),r=e.x<0?0:e.x,i=e.y<0?0:e.y,o=e.right>window.innerWidth?window.innerWidth:e.right,s=e.bottom>window.innerHeight?window.innerHeight:e.bottom;return new DOMRect(r,i,o-r,s-i)}function qM(n,t){const e=Eu(n),r=n.getBlockById(t.blockId),o=Vo(n,r,t);return Vs(e,o.x,o.y)&&Vs(e,o.right,o.bottom)}function qB(n,t){const e=Eu(n),r=t.getBoundingClientRect();return r.top>=e.top&&r.top<=e.bottom||r.bottom<=e.bottom&&r.bottom>=e.top}function XM(n,t){const e=Eu(n),r=t.getBoundingClientRect();if(r.top>=e.top&&r.top<=e.bottom&&r.bottom<=e.bottom&&r.bottom>=e.top)return 100;const i=Math.max(0,Math.min(r.right,e.right)-Math.max(r.left,e.left)),o=Math.max(0,Math.min(r.bottom,e.bottom)-Math.max(r.top,e.top)),s=i*o,l=r.width*r.height;return s/l*100}function YM(n,t){const e=Eu(n),r=t.getBoundingClientRect();return Vs(e,r.x,r.y)||Vs(e,r.right,r.bottom)}function QM(n,t){const e=Eu(n),r=t.getBoundingClientRect();return r.right>e.right||r.left<e.left}function Au(n,t,e){!t||(e!=null&&e.animation?(QM(n,t)&&Ks(t,{elementToScroll:We(t,{horizontal:!0}),disableHorizontal:!1}),Ks(t,{elementToScroll:We(t),disableHorizontal:!0})):t.scrollIntoView&&t.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}))}function JM(n){if(!Pg(n.rootContainer)){WM.warn("editorScrollIntoView: editor is not visible");return}const t=n.rootContainer.getBoundingClientRect();if(t.height<1&&t.width<1)return;const e=n.selection,r=e.range.focus;if(!r.isSimple()){const C=r,E=n.getContainerById(C.childContainerId);YM(n,E)||E.scrollIntoView();return}if(e.range.start.blockId===e.range.end.blockId){const C=n.getBlockById(e.range.start.blockId);if(ge(C)&&qB(n,C)&&XM(n,C)>=95||Mt(n,C)&&qB(n,C))return}const i=r,o=n.getBlockById(i.blockId);if(qM(n,i))return;if(ge(o)){const C=Jt(o);if(C){["image"].includes(qe(o))?setTimeout(()=>{Au(n,C,{animation:!0})},500):Au(n,C,{animation:!0});return}}const s=Vo(n,o,i),l=o.getBoundingClientRect(),c=ie(o),d=B("div",["editor-block-anchor"],c),h=ur(o);d.style.top=`${(s.top-l.top)/h}px`,Au(n,d,{animation:!0}),setTimeout(()=>{d.remove()},200)}function ZM(n,t){if(t.isCollapsed())return!1;const e=Re(n.rootContainer),r=Me(n.rootContainer),{start:i,end:o}=t;return i.blockId===lt(e)&&i.offset===0&&o.blockId===lt(r)&&o.offset===dt(n,r)}const XB=I("range-in-block");function YB(n,t){const e=t.getEditor(),r=e.getBlockById(t.start.blockId),i=e.getBlockById(t.end.blockId),o=r===n||re(n,r),s=i===n||re(n,i);return!!(o||s)}function QB(n,t){const e=n.doc.toJSON(),r=new Set(Object.values(e.blocks).map(s=>s.map(l=>l.id)).flat());let i,o=dr(t);if(o){for(;o&&!r.has(lt(o));)o=dr(o);p(XB,o,"no prev block while deleting a block"),i=Te(n,o,dt(n,o))}else{const s=hr(t);p(XB,s,"no prev and next block while deleting a block"),i=Te(n,s,0)}return i}const tU=I("block-to-html");function rp(n,t,e,r){const i=js(n,t.type);if(i.convertTo)return i.convertTo(n,t,e,"html",r);if(i.blockKind!=="text")return`[${t.type}]`;p(tU,t.text,"no text");const o=de(t.text);return`<div>${Hd(o)}</div>`}const JB=I("block-to-text");function eU(n,t,e){let r="";return t.forEach(i=>{if(p(JB,typeof i.insert=="string","invalid op"),i.attributes&&i.attributes.box===!0){const o=i.attributes,s=n.editorBoxes.getBoxClass(o.type);if(s!=null&&s.convertTo){r+=s.convertTo(n,o,e,"text");return}if(i.attributes.text){r+=i.attributes.text;return}r+=`[${o.type}]`}r+=i.insert}),r}function yh(n,t,e,r){const i=js(n,t.type);return i.convertTo?i.convertTo(n,t,e,"text",r):i.blockKind!=="text"?`[${t.type}]`:(p(JB,t.text,"no text"),eU(n,t.text,e))}function kh(n,t,e,r){const i=js(n,t.type);return i.convertTo?i.convertTo(n,t,e,"markdown",r):yh(n,t,e,r)}function xu(n,t){return t.blocks.root.map((i,o)=>rp(n,i,t,[{containerId:"root",blockIndex:o}])).join(`
25
25
  `)}function ZB(n,t){return`<!doctype html><html><head><meta charset="utf8" /></head><body>${xu(n,t)}</body></html>`}function qo(n,t){return t.blocks.root.map((i,o)=>yh(n,i,t,[{containerId:"root",blockIndex:o}])).join(`
26
26
  `)}function t5(n,t){const e=t.blocks.root.map((i,o)=>kh(n,i,t,[{containerId:"root",blockIndex:o}]));return e[e.length-1]=e[e.length-1].trimEnd(),e.join(`
27
- `)}const nU=I("get-text-position");function ya(n,t){const e=t!=null?t:n.selection.range.start;e instanceof Ye||p(nU,!1,`invalid insert pos type: ${typeof e}`);const{blockId:r}=e,i=n.getBlockById(r),o=vt(i),s=rt(i),l=at(s),{offset:c}=e;return{block:i,container:s,containerId:l,blockIndex:o,offset:c}}const ka=I("insert-text");function ip(n,t,e,r){var s;const i=n.doc.getBlockData(t,e);if(p(ka,i,"no block data"),p(ka,i.text,"no block text"),mn(i.text)===0)return p(ka,r===0,"invalid text offset"),n.editorCommandProviders.getEmptyBlockTextAttributes(n,i.id);if(r===0)return;const o=Je(i.text,r-1,1).middle;if(!((s=o[0].attributes)!=null&&s.box))return o[0].attributes}function rU(n,t,e){const r=rt(t),i=at(r),o=vt(t);return ip(n,i,o,e)}function e5(n,t,e,r,i){const o=rt(t),s=at(o),l=vt(t),c=rU(n,t,e),d=ph(e,r,c!=null?c:null);return n.doc.localUpdateBlockText(s,l,d,i),Tn(n,t)}function n5(n,t,e,r){const i=rt(t),o=at(i),s=vt(t),l=ph(e," ",r);return n.doc.localUpdateBlockText(o,s,l),Tn(n,t)}function iU(n,t){let e=0;if(t===0)return!1;for(let r=0;r<n.length;r++){const i=n[r];p(ka,typeof i.insert=="string","invalid text op, no insert");const o=e+ch(i);if(o===t)return!1;if(o>t)return!0;e=o}return!1}function op(n,t,e,r,i){const o=n.doc.getBlockData(e,r);p(ka,o,"no block data"),p(ka,o.text,"no block text");const s=ip(n,e,r,i);s&&Object.keys(s).includes("link")&&(iU(o.text,i)||delete s.link);const l=ph(i,t,s!=null?s:null);return n.doc.localUpdateBlockText(e,r,l),Tn(n,n.getBlockById(o.id))}function sp(n,t){n.selection.range.isCollapsed()||n.clearSelectedContents();const{containerId:e,blockIndex:r,offset:i}=ya(n);op(n,t,e,r,i)}const Rh=I("update-composition-text");function r5(n){const t=n.selection.range.start;t instanceof Ye||p(Rh,!1,`invalid insert pos type: ${typeof t}`);const{blockId:e}=t,r=n.getBlockById(e);p(Rh,nt(n,r),"not a text kind block");const i=rt(r),o=at(i),s=vt(r),l=n.doc.getBlockData(o,s);p(Rh,l,"no block data in doc"),p(Rh,l.text,"no text data in text block");const c=Ot(r);fh(n,$o(r),e,c,l.text)}function lp(n){T_(n)}function Ra(n,t,e,r,i,o){return n.doc.localInsertBlock(t,e,r,i,o),n.getBlockById(r.id)}const bu=I("delete-block-text");function ap(n,t,e,r,i){if(!n.isBlockWritable(t))return bu.error("block is not writable"),0;p(bu,nt(n,t),"block is not a text kind block");const o=rt(t),s=at(o),l=vt(t),c=n.doc.getBlockData(s,l);p(bu,c,"no block data in doc"),p(bu,c.text,"no text data in text block");let d=e;Un(t,e)||(d=Go(t,d));let h=e+r;p(bu,h<=dt(n,t),`invalid offset and count: ${e}, ${r}`),Un(t,h)||(h=el(t,h));const C=h-d,E=BB(d,C);return n.doc.localUpdateBlockText(s,l,E,i),console.log("delete"),C}const cp=I("break-text-block");function i5(n,t){const r=n.getBlockData(t).quoted;return r?{quoted:r}:{}}function wa(n,t,e,r){p(cp,nt(n,t),`block is not a text kind block: ${Dt(t)}`),p(cp,e>=0&&e<=dt(n,t),`invalid offset: ${e}`);const i=rt(t),o=at(i),s=vt(t),l=r!=null&&r.copyBlockAttributes?i5(n,t):{};if(!(r!=null&&r.forceInsertAfter)&&(e===0||e===dt(n,t))){let k=s;if(e!==0){let F=hr(t);F?k=vt(F):(F=Me(i),k=vt(F)+1)}const L={...Ci(""),...l,...r==null?void 0:r.newBlockData},M=Te(n,t.id,0),U=Ra(n,o,k,L,M);return{block:t,newBlock:U}}p(cp,Un(t,e),"not a valid offset");const c=Tn(n,t),{right:d}=_n(c,e),h=mn(d);h>0&&ap(n,t,e,h);let C=hr(t),E;C?E=vt(C):(C=Me(i),E=vt(C)+1);const A={...Ci(d),...l,...r==null?void 0:r.newBlockData},v=Ra(n,o,E,A,Te(n,A.id,0));return{block:t,newBlock:v}}const oU=I("prepare-insert-new-block");function sU(n,t,e){if(t&&e!==void 0&&e!==null){const d=n.getContainerById(t),h=ue(d);return p(oU,e>=0&&e<=h.length,`invalid blockIndex: ${e}`),{containerId:t,blockIndex:e}}const r=n.selection.range.start;if(!r.isSimple())return null;const i=n.getBlockById(r.blockId);if(t=at(rt(i)),e=vt(i),!nt(n,i))return{containerId:t,blockIndex:e+1};const s=r.offset;if(s===0||s===dt(n,i))return{containerId:t,blockIndex:s===0?e:e+1};const c=wa(n,i,s).newBlock;return{containerId:t,blockIndex:vt(c)}}const lU=I("auto-insert-block");function o5(n,t,e,r,i,o){const s=sU(n,e,r);p(lU,s,`not an valid insert position: ${n.selection.range}`);const l={blockId:t.id,offset:0},c={anchor:l,focus:l};return Ra(n,s.containerId,s.blockIndex,t,i!=null?i:c,o)}const aU=I("delete-block");function wh(n,t,e){t.children&&(e.push(...t.children),t.children.forEach(r=>{n.getChildContainerData(r).forEach(o=>{wh(n,o,e)})}))}function Sh(n,t,e){const r=rt(t),i=at(r),o=vt(t),s=n.doc.getBlockData(i,o);return p(aU,s,"no block data in doc"),n.doc.localDeleteBlock(i,o,Qe(n,{anchor:e.start,focus:e.end})),s}function up(n,t,e){return n.undoManager.runInGroup(()=>{const r=rt(t);Dr(r)===1&&n.insertTextBlock("",at(r),0);let i=e?Ho(n,e):null;if(!i){const l=n.selection.range;YB(t,l)?i=QB(n,t):i=l}const o=Sh(n,t,i),s=[];return wh(n,o,s),s.length>0&&n.doc.localDeleteChildContainers(s),o})}function cU(n,t){const e=[t];n.doc.getContainerBlocks(t).forEach(i=>{wh(n,i,e)}),n.doc.localDeleteChildContainers(e)}function s5(n,t){const e=[...t];t.forEach(r=>{n.doc.getContainerBlocks(r).forEach(o=>{wh(n,o,e)})}),n.doc.localDeleteChildContainers(e)}const fp=I("merge-text-block");function l5(n,t,e){p(fp,nt(n,t),"only text block can be merged"),p(fp,nt(n,e),"only text block can be merged");const r=Wo(n,t),i=Wo(n,e),o=r.text,s=i.text;p(fp,o&&s,"block data has no text");const l=rt(t),c=at(l),d=vt(t),h=dt(n,t),C=op(n,s,c,d,h),E=Te(n,t,mn(o));return up(n,e,E),C}const Ei=I("clear-selected-contents");function Lh(n,t){p(Ei,nt(n,t.block),"not a text kind block");const{start:e,end:r}=t;p(Ei,e.isSimple(),"not a simple block position"),p(Ei,r.isSimple(),"not a simple block position");const i=e.offset,o=r.offset;p(Ei,i<=o,`invalid delete text offset: ${i}, ${o}`),i!==o&&n.deleteTextFromBlock(t.block,i,o-i)}function a5(n,t,e){const r=at(t),i=ue(t),o=e.focus?void 0:n.selection.range.toDocRange(),s=n.insertTextBlock("",r,0,{newRange:o});e.focus&&n.selection.selectBlock(s,0),i.reverse().forEach(l=>{n.deleteBlock(l)})}function uU(n,t){const{block:e,start:r,end:i}=t;if(nt(n,e)){Lh(n,t);return}if(ge(e)||r.isSimple()){p(Ei,i.isSimple(),"invalid range");const s=rt(e),l=vt(e),c=n.insertTextBlock("",at(s),l);n.selection.selectBlock(c,0),n.deleteBlock(e);return}p(Ei,Mt(n,e),"invalid block kind"),p(Ei,!r.isSimple()&&!i.isSimple(),"invalid range"),Ea(n,e,r,i),n.selection.range.getSelectedContainers().forEach((s,l)=>{a5(n,s,{focus:l===0})})}function fU(n){if(!n.isWritable())return;const t=n.selection.range;if(t.isCollapsed())return;const e=t.getSelectedBlocks();if(p(Ei,e.length>0,"no selected block"),e.length===1){uU(n,e[0]);return}const r=e[0],i=r.block,o=rt(i);p(Ei,e.length>1,"no selected block");const s=e[e.length-1],l=s.block;if(nt(n,i)){Lh(n,r);const h=Te(n,r.block,r.start.offset);if(e.slice(1,e.length-1).reverse().forEach(E=>n.deleteBlock(E.block)),nt(n,l)){Lh(n,s),n.mergeTextBlock(i,l,{focus:!0}),n.selection.setRange(h);return}n.deleteBlock(l),n.selection.setRange(h);return}if(nt(n,l)){Lh(n,s),e.slice(0,e.length-1).reverse().forEach(h=>n.deleteBlock(h.block)),n.selection.selectBlock(s.block,0);return}if(e.length===Dr(o)){a5(n,o,{focus:!0});return}const c=Ue(i),d=Jt(l);p(Ei,c||d,"no prev or next block"),e.forEach(h=>n.deleteBlock(h.block))}function Ih(n){n.selection.range.isCollapsed()||n.undoManager.runInGroup(()=>{n.emit("beforeClearSelection",n);try{n.doc.beginBatchUpdate(),fU(n)}finally{n.doc.endBatchUpdate()}n.emit("afterClearSelection",n)})}const dU=I("core");function c5(n,t,e){const r=rt(t),i=at(r),o=vt(t);return n.doc.localUpdateBlockText(i,o,e),setTimeout(()=>{n.selection.updateSelection(null)}),Tn(n,t)}function u5(n,t,e){if(!n.isBlockWritable(t)){dU.error("block is not writable");return}const r=n.getBlockText(t),i=gn.diff(r,e);c5(n,t,i)}function Dh(n,t,e){const r=Tn(n,t),i=typeof e=="string"?rl(e):e,o=gn.diff(r,i);return c5(n,t,o)}const vu=I("update-block-data");function _h(n,t,e,r){const i=rt(t),o=at(i),s=vt(t),l=n.doc.getBlockData(o,s),c={insert:{},delete:[]},d=new Set(Object.keys(l)),h=new Set(Object.keys(e));return d.forEach(E=>{if(!h.has(E)){if(E==="id"||E==="type"||E==="text")return;vu.debug(`delete key: ${E}`),c.delete.push(E)}}),Object.entries(e).forEach(([E,A])=>{p(vu,E!=="id"&&E!=="type",`invalid block data delta, ${E}`);const v=l[E];if(A==null){v!=null&&(vu.debug(`delete key: ${E}`),c.delete.push(E));return}v!==A&&(jc.default(v,A)||E==="text"&&gn.diff(v,A).length===0||(d.has(E)?(vu.debug(`replace key: ${E}`),c.delete.push(E)):vu.debug(`insert key: ${E}`),c.insert[E]=A))}),n.doc.localUpdateBlockData(o,s,c,r),Wo(n,t)}function f5(n,t,e,r){const o={...n.getBlockData(t),embedData:e};return n.updateBlockData(t,o,r)}function dp(n,t,e){if(!Mt(n,t)||!(e!=null&&e.tryFocusToChildSimpleBlock)){n.selection.selectBlock(t,0);return}const i=fr(n,t).getChildContainers(n,t)[0],o=Re(i);dp(n,o,e)}function il(n){const t=[];let e={};return n.forEach(r=>{t.push(...r.blocks.root);const{root:i,...o}=r.blocks;e={...e,...o}}),{blocks:{...e,root:t},meta:{},comments:{}}}const Bu=I("clone-block");function Xo(n,t,e,r){const i=n.getBlockClass(e.type);if(i.blockToDoc)return i.blockToDoc(t,e,(h,C)=>(p(Bu,e!==C,"invalid child block"),Xo(n,h,e,r)));let o={};const s=new Map,l=mt.default(e);l.children&&(l.children=l.children.map(h=>{const C=tt(),E=t.blocks[h];p(Bu,Array.isArray(E),"invalid child blocks");const A=E.map(M=>Xo(n,t,M,r)),v=il(A),{root:k,...L}=v.blocks;return o={...o,...L},o[C]=v.blocks.root,s.set(h,C),C}));const c=Array.from(s.entries()),d=h=>{for(const C of c){const[E,A]=C;{const v=`${E}/`;if(h.startsWith(v)){const k=h.substring(v.length),L=`${A}/${k}`;return Bu.debug(`replace key: ${h} -> ${L}`),L}}{const v=`${E}_`;if(h.startsWith(v)){const k=h.substring(v.length),L=`${A}_${k}`;return Bu.debug(`replace key: ${h} -> ${L}`),L}}}return h};return Array.from(Object.entries(l)).forEach(([h,C])=>{const E=d(h);E!==h&&delete l.key,l[E]=C}),l.id=tt(),r&&(r.blockIdMap.set(e.id,l.id),s.forEach((h,C)=>r.containerIdMap.set(C,h))),{blocks:{root:[l],...o},meta:{},comments:{}}}function hp(n,t,e,r){const i=t.blocks[e];p(Bu,Array.isArray(i),"invalid child blocks");const o=i.map(l=>Xo(n,t,l,r));return il(o)}function mp(n,t,e){const r=t.blocks.root.map(i=>Xo(n.editorBlocks,t,i,e));return mt.default(il(r))}const d5=I("insert-doc");function h5(n,t,e,r,i){if(Mt(n,t)){d5.warn("failed to insert doc into a complex block");return}const o=mp(n,r,i),s=rt(t),l=vt(t),c=at(s);n.doc.beginBatchUpdate(),n.undoManager.runInGroup(()=>{var F,G,q,it;const d=[];Object.entries(o.blocks).forEach(([st,Et])=>{st!=="root"&&d.push({containerId:st,blocks:Et})}),d.length>0&&n.doc.localInsertChildContainers(d);const h=o.blocks.root;if(ge(t)){n.deleteBlock(t);let st;h.reverse().forEach(Et=>{const gt=n.insertBlock(c,l,Et,void 0,{noFocus:!0});st||(st=gt)}),st&&n.selection.selectBlock(st,dt(n,st));return}if(p(d5,nt(n,t),"not a text block"),fe(n,t)){const st=vt(t);let Et,gt=!1;for(let At=0;At<h.length;At++){if(At===0){const Gt=n.findBlockByIndex(c,st),cn=h[At].type==="text"||h[At].type==="list";if(Gt&&nt(n,Gt)&&fe(n,Gt)&&cn){n.insertTextToBlock(t,0,(F=h[At].text)!=null?F:[]),Object.keys(h[At]).length>3&&n.updateBlockData(Gt,x_(h[At],["id","text","type","heading","quoted"]));continue}Gt&&zi(Gt)&&(gt=!0)}const Vt=n.insertBlock(c,st+At,h[At],void 0,{noFocus:!0});At===h.length-1&&(Et=Vt)}Et&&n.selection.selectBlock(Et,dt(n,Et)),gt&&n.deleteBlock(t);return}if(h.length===1){const st=h[0];if(nu(n,st.type)){n.insertTextToBlock(t,e,(G=st.text)!=null?G:[]);return}n.breakTextBlock(t,e),n.insertBlock(c,l+1,st);return}const C=e===dt(n,t),E=e===0,A=h[0],v=h[h.length-1];let k;!C&&!E?k=n.breakTextBlock(t,e,{forceInsertAfter:!0}):k=t;const L=E?l:l+1;C?(k=n.insertBlock(c,l+1,v),n.selection.selectBlock(k,dt(n,k))):(n.selection.selectBlock(k,0),nu(n,v.type)?n.insertTextToBlock(k,0,(q=v.text)!=null?q:[]):n.insertBlock(c,L,v));const M=n.selection.range;let U=L;nu(n,A.type)?E?(n.insertBlock(c,L,A),U+=1):n.insertTextToBlock(t,e,(it=A.text)!=null?it:[]):(n.insertBlock(c,L,A),U+=1),h.slice(1,h.length-1).reverse().forEach(st=>{n.insertBlock(c,U,st)}),n.selection.setRange(M)}),n.doc.endBatchUpdate()}function gp(n,t,e,r,i){const o=mp(n,r,i),s=at(t),l=[];return n.undoManager.runInGroup(()=>{const c=[];Object.entries(o.blocks).forEach(([h,C])=>{h!=="root"&&c.push({containerId:h,blocks:C})}),n.doc.localInsertChildContainers(c),o.blocks.root.reverse().forEach(h=>{const C=n.insertBlock(s,e,h,void 0,{noFocus:!0,noScroll:!0});l.push(C)})}),l}function m5(n,t,e,r){const i=Dr(t);gp(n,t,i,e,r);for(let o=0;o<i;o++){const s=Re(t);n.deleteBlock(s)}}const Tu=I("add-text-attribute");function hU(n,t,e,r){const{start:i,end:o}=e;p(Tu,i.blockId===o.blockId&&i.blockId===lt(t),"invalid range"),p(Tu,r,"invalid attribute name");const s=n.getBlockText(t),l=va(i.offset,o.offset-i.offset,s,r,void 0,{ignoreValue:!0});return n.setBlockText(t,l),l}function g5(n,t,e,r,i){const{start:o,end:s}=e;p(Tu,o.blockId===s.blockId&&o.blockId===lt(t),"invalid range"),p(Tu,r,"invalid attribute name");const l=n.getBlockText(t),c=hu(o.offset,s.offset-o.offset,l,r,i);return n.setBlockText(t,c),c}function Sa(n,t,e,r,i){const{start:o,end:s}=e;p(Tu,o.blockId===s.blockId&&o.blockId===lt(t),"invalid range");const l=n.getBlockText(t),c=cB(o.offset,s.offset-o.offset,l,r,i);return n.setBlockText(t,c),c}function p5(n,t,e,r){const i=mi(n,{simpleBlockOnly:!0});n.undoManager.runInGroup(()=>{i.forEach(o=>{const{block:s,start:l,end:c}=o;if(!nt(n,s))return;if(fe(n,s)){r(n,lt(s),t,e);return}const d=Qe(n,{anchor:l,focus:c});t==="color"||t==="backgroundColor"?Sa(n,s,d,t,e):(Sa(n,s,d,"color",null),Sa(n,s,d,"backgroundColor",null))})})}function C5(n,t,e){const r=mi(n,{simpleBlockOnly:!0});n.undoManager.runInGroup(()=>{r.forEach(i=>{const{block:o,start:s,end:l}=i;if(!nt(n,o))return;if(fe(n,o)){(t==="clearColor"||t==="clearAll")&&e(n,lt(o),"color",null),(t==="clearBackground"||t==="clearAll")&&e(n,lt(o),"backgroundColor",null);return}const c=Qe(n,{anchor:s,focus:l});(t==="clearColor"||t==="clearAll")&&Sa(n,o,c,"color",null),(t==="clearBackground"||t==="clearAll")&&Sa(n,o,c,"backgroundColor",null)})})}function E5(n,t,e){const r=t.getSelectedBlocks().filter(l=>nt(n,l.block));if(r.length===0)return[null,null];const i=l=>{if(dt(n,l.block)===0)return e(n,lt(l.block));const c=l.start,d=l.end,h=n.getBlockText(l.block);return dB(c.offset,d.offset-c.offset,h)};let[o,s]=i(r[0]);return o===null&&s===null?[o,s]:(r.forEach(l=>{const[c,d]=i(l);c===null||o===null?o=null:o=c===o?o:null,d===null||s===null?s=null:s=d===s?s:null}),[o,s])}const Jn=I("adjust-selection-pos");function A5(n){const t=[];for(;n;){const e=rt(n);if(t.unshift(e),qt(e))return t;const r=J(e);p(Jn,r,"child container has not parent container"),n=r}p(Jn,!1,"should not come here: getParentContainers")}function x5(n,t){for(;t;){const e=rt(t);if(e===n)return t;const r=J(e);p(Jn,r,"could not find parent block for a child container"),t=r}p(Jn,!1,"no parent block in specified container")}function mU(n,t){const e=A5(n),r=A5(t);p(Jn,e.length>0&&r.length>0,"block has not parent container"),p(Jn,e[0]===r[0],"root container does not equal");let i=e[0];for(let l=1;l<e.length||r.length;l++)if(e[l]!==r[l]){i=e[l-1];break}const o=x5(i,n),s=x5(i,t);return{parentContainer:i,newBlock1:o,newBlock2:s}}function b5(n,t){let e=J(t);for(p(Jn,e,"element is not in a block");e;){const r=rt(e);p(Jn,Ur(r),"not a child container");const i=J(r);if(p(Jn,i,"child container has not parent block"),i===n)return r;e=i}p(Jn,!1,"failed to find parent container in complex block")}function Mh(n,t,e){const r=n.getBlockById(t.blockId),i=n.getBlockById(e.blockId);if(r===i)return t instanceof Ye&&e instanceof Ye?{anchor:t,focus:e}:t instanceof Or&&e instanceof Or?nh(n,r,t,e):null;const o=rt(r),s=rt(i);if(o===s)return t instanceof Or&&(t=ct(r,0,"home")),e instanceof Or&&(e=ct(i,dt(n,i),"end")),p(Jn,t instanceof Ye,"not valid position type"),p(Jn,e instanceof Ye,"not valid position type"),{anchor:t,focus:e};if(r.contains(s))return null;if(i.contains(o)){if(t instanceof Ye&&e instanceof Or){const v=n.getContainerById(e.childContainerId);if(v===o)return{anchor:e,focus:e};const k=J(o);if(k&&k===J(v)){const L=Ee(k,at(o)),M=Ee(k,at(v));return nh(n,k,L,M)}}return null}const l=Vd(r,i)>0,{newBlock1:c,newBlock2:d}=mU(r,i);if(c===d){const v=c,k=b5(v,r),L=b5(v,i);return t=Ee(c,at(k)),e=Ee(c,at(L)),Jn.debug(`select in complex block: ${k.id}, ${L.id}`),nh(n,v,t,e)}let h=l?dt(n,c):0;c===r&&t instanceof Ye&&(h=t.offset);let E=l?0:dt(n,d);return d===i&&e instanceof Ye&&(E=e.offset),t=ct(c,h,l?"end":"home"),e=ct(d,E,l?"home":"end"),{anchor:t,focus:e}}const gU=I("move-complex-block-position");function pU(n,t,e){const r=n.getBlockById(t.blockId);p(gU,Mt(n,r),"is not a complex block");const i=fr(n,r),o=n.getContainerById(t.childContainerId),s=i.getNextContainer(n,r,o,e,{noWrap:!0});return s?Ee(r,at(s)):null}const Yo=I("move-simple-block-position");function v5(n,t){const e=hn(n,t,{visibleOnly:!0});if(e.length===0)return Yo.warn("complex block has not any child container, not loaded?"),null;p(Yo,e.length>0,"complex block has not any child container");const r=e[0];return Re(r)}function B5(n,t){const e=hn(n,t,{visibleOnly:!0});if(e.length===0)return Yo.warn("complex block has not any child container, not loaded?"),null;p(Yo,e.length>0,"complex block has not any child container");const r=e[e.length-1];return Me(r)}function T5(n,t,e){const r=e?v5(n,t):B5(n,t);return r?Mt(n,r)?T5(n,r,e):r:null}function CU(n,t,e){const r=n.getBlockById(t.blockId);return e==="move"&&Mt(n,r)&&t.offset===0?v5(n,r):hr(r)}function EU(n,t,e){const r=n.getBlockById(t.blockId);return e==="move"&&Mt(n,r)&&t.offset===1?B5(n,r):dr(r)}function pp(n){return n==="ArrowLeft"||n==="ArrowUp"}function Cp(n,t,e){const r=rt(t);if(qt(r))return null;const i=J(r);p(Yo,i,"child container has not parent block"),p(Yo,Mt(n,i),"is not a complex block");const o=fr(n,i).getNextContainer(n,i,r,e);return o?pp(e)?Me(o):Re(o):Cp(n,i,e)}function AU(n,t,e){const r=rt(t);if(qt(r))return null;const i=J(r);if(p(Yo,i,"child container has not parent block"),pp(e)){const l=Ue(i);if(l)return l}else{const l=Jt(i);if(l)return l}const o=Cp(n,i,e);if(o)return o;let s=i;for(;!qt(rt(s));)s=J(rt(s));return pp(e)?Ue(s):Jt(s)}function xU(n,t,e){if(!Mt(n,t)||fr(n,t).enableKeyboardSelect)return t;const i=T5(n,t,e==="ArrowDown"||e==="ArrowRight");return i||t}function bU(n,t,e,r){const i=n.getBlockById(t.blockId),s=Qt(n,i).moveCaret(n,i,t,e);if(s)return s;let l=e==="ArrowDown"||e==="ArrowRight"?CU(n,t,r):EU(n,t,r);if(l||(l=Cp(n,i,e),l||(l=AU(n,i,e))),l||Mt(n,i)&&hn(n,i).length===0&&(Yo.warn("complex block has not any child container, not loaded?"),l=e==="ArrowDown"?hr(i):dr(i)),!l){if(e==="ArrowDown"||e==="ArrowRight"){if(n.readonly||!qt(rt(i)))return null;const c=n.insertTextBlock("",at(n.rootContainer),Dr(n.rootContainer));return ct(c,0,"home")}return null}if(l=xU(n,l,e),nt(n,l)){const c=n.selection.getSuggestedCaretX();if(e==="ArrowDown")return W_(n,l,i,t,c);if(e==="ArrowUp")return G_(n,l,i,t,c)}return e==="ArrowLeft"||e==="ArrowUp"?ct(l,dt(n,l),"end"):e==="ArrowRight"||e==="ArrowDown"?ct(l,0,"home"):null}function vU(n,t,e){if(t==="ArrowLeft")return e.start;const r=e.end,i=n.getBlockById(r.blockId);if(nt(n,i))return r;const o=Jt(i);if(o)return ct(o,0,"home");if(!qt(rt(i))||n.readonly)return r;const s=n.insertTextBlock("",at(n.rootContainer),Dr(n.rootContainer));return ct(s,0,"home")}function BU(n,t,e){const r=n.selection.range;let i;if(r instanceof nn)e==="move"&&!r.isCollapsed()&&(t==="ArrowLeft"||t==="ArrowRight")?i=vU(n,t,r):i=bU(n,r.getFocusedPos(),t,e);else if(i=pU(n,r.focus,t),e==="move"){const o=i!=null?i:r.focus,s=n.getContainerById(o.childContainerId);if(t==="ArrowLeft"||t==="ArrowUp"){const l=Me(s);i=ct(l,0,"home")}else{const l=Re(s);i=ct(l,dt(n,l),"end")}}return i?e==="move"?{anchor:i,focus:i}:Mh(n,r.anchor,i):null}function Qo(n,t,e){const r=BU(n,t,e);if(!r)return!1;const{anchor:i,focus:o}=r;return n.selection.setSelection(i,o),(t==="ArrowLeft"||t==="ArrowRight")&&n.selection.updateLastCaretRect(),!0}function y5(n){return Qo(n,"ArrowLeft","move"),!0}function k5(n){return Qo(n,"ArrowRight","move"),!0}function R5(n){return Qo(n,"ArrowUp","move"),!0}function w5(n){if(Qo(n,"ArrowDown","move")||n.readonly)return!0;const t=n.getFocusedBlock(),e=rt(t);if(qt(e)||Me(e)!==t)return!0;const r=n.rootContainer;return n.insertTextBlock("",at(r),Dr(r)),!0}function S5(n){return Qo(n,"ArrowDown","select"),!0}function L5(n){return Qo(n,"ArrowLeft","select"),!0}function I5(n){return Qo(n,"ArrowRight","select"),!0}function D5(n){return Qo(n,"ArrowUp","select"),!0}const _5=I("word-offset");function Ep(n,t){const e=n.selection.range.focus;p(_5,e.isSimple(),"invalid range type");const r=n.getBlockById(e.blockId);if(fe(n,r))return ct(r,0,"home");if(e.offset===0||!nt(n,r)){const s=Ue(r);if(!s)return null;const l=ct(s,dt(n,s),"end");if(t==="select"&&nt(n,s)){const c=J1(n,s,l.offset);return ct(s,c,"normal")}return l}const i=J1(n,r,e.offset);return ct(r,i,"normal")}function Ap(n,t){const e=n.selection.range.focus;p(_5,e.isSimple(),"invalid range type");const r=n.getBlockById(e.blockId);if(fe(n,r))return ct(r,0,"end");if(e.offset===dt(n,r)||!nt(n,r)){const s=Jt(r);if(!s)return null;const l=ct(s,0,"home");if(t==="select"&&nt(n,s)){const c=Z1(n,s,l.offset);return ct(s,c,"end")}return l}const i=Z1(n,r,e.offset);return ct(r,i,"normal")}function M5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Ep(n,"move");return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}function U5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Ap(n,"move");return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}function O5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Ep(n,"select");return e?(n.selection.setSelection(n.selection.getAnchorPos(),e),n.selection.updateLastCaretRect(),!0):!1}function N5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Ap(n,"select");return e?(n.selection.setSelection(n.selection.range.anchor,e),n.selection.updateLastCaretRect(),!0):!1}I("find-block");function xp(n,t){if(!Mt(n,t))return t;const r=fr(n,t).getChildContainers(n,t)[0],o=ue(r)[0];return xp(n,o)}function bp(n,t){if(!Mt(n,t))return t;const e=fr(n,t).getChildContainers(n,t),r=e[e.length-1],i=ue(r),o=i[i.length-1];return bp(n,o)}function vp(n){const t=bp(n,Me(n.rootContainer)),e=ct(t,dt(n,t),"end");return n.selection.setSelection(e),!0}function P5(n){const t=xp(n,n.getFirstBlock()),e=ct(t,0,"home");return n.selection.setSelection(e),!0}function F5(n){const t=xp(n,n.getFirstBlock()),e=ct(t,0,"home");return n.selection.setSelection(n.selection.getAnchorPos(),e),!0}function Bp(n){const t=bp(n,Me(n.rootContainer)),e=ct(t,dt(n,t),"end");return n.selection.setSelection(n.selection.getAnchorPos(),e),!0}const K5=I("line-offset");function V5(n){const t=n.selection.range.focus;p(K5,t.isSimple(),"invalid range type");const e=n.getBlockById(t.blockId);if(t.offset===0||!nt(n,e))return ct(e,0,"home");let i=CB(e,t).start;const{next:o}=lu(e,i);return o&&Yn(o)&&ru(o)==="br"&&(i+=1),ct(e,i,"home")}function $5(n){const t=n.selection.range.focus;p(K5,t.isSimple(),"invalid range type");const e=n.getBlockById(t.blockId);if(t.offset===dt(n,e)||!nt(n,e))return ct(e,dt(n,e),"end");const r=CB(e,t);return ct(e,r.end,"end")}function H5(n){if(!n.selection.range.focus.isSimple())return!1;const e=V5(n);return e?(n.selection.setSelection(n.selection.getAnchorPos(),e),n.selection.updateLastCaretRect(),!0):!1}function j5(n){if(!n.selection.range.focus.isSimple())return!1;const e=$5(n);return e?(n.selection.setSelection(n.selection.getAnchorPos(),e),n.selection.updateLastCaretRect(),!0):!1}function z5(n){if(!n.selection.range.focus.isSimple())return!1;const e=V5(n);return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}function G5(n){if(!n.selection.range.focus.isSimple())return!1;const e=$5(n);return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}I("find-block-position"),I("page-offset");function W5(n,t){const r=Qt(n,t).getBlockTextLength(t),i=ct(t,r,"normal"),o=Mh(n,n.selection.getAnchorPos(),i);if(!o)return!1;const{anchor:s,focus:l}=o;return n.selection.setSelection(s,l,{noScroll:!0}),n.selection.updateLastCaretRect(),!0}function q5(n,t){const e=ct(t,0,"normal"),r=Mh(n,n.selection.getAnchorPos(),e);if(!r)return!1;const{anchor:i,focus:o}=r;return n.selection.setSelection(i,o,{noScroll:!0}),n.selection.updateLastCaretRect(),!0}async function X5(n){const t=Th(n)*.9,e=We(n.rootContainer);await Ks(Math.min(e.scrollTop+t*2,e.scrollHeight),{elementToScroll:e})}async function Y5(n){const t=Th(n)*.9,e=We(n.rootContainer);await Ks(Math.max(e.scrollTop-t,0),{elementToScroll:e})}function Q5(n){return Y5(n),!0}function J5(n){return X5(n),!0}const TU=I("table-scroll");class Z5{constructor(t,e,r,i,o){m(this,"handleEvent",t=>{this.handler(this.editor,t,this.data)});this.editor=t,this.dom=e,this.name=r,this.handler=i,this.data=o,e.addEventListener(r,this.handleEvent)}destroy(){this.dom.removeEventListener(this.name,this.handleEvent)}}class yU{constructor(t){m(this,"handlers",new Map);this.editor=t}destroy(){Array.from(this.handlers.entries()).forEach(([t,e])=>{e.forEach(r=>r.destroy()),this.handlers.delete(t)})}addEventListener(t,e,r,i){const o=this.handlers.get(t);if(o){if(o.find(s=>s.handler===r&&s.name===e)){TU.warn(`event has already registered: ${e}`);return}o.push(new Z5(this.editor,t,e,r,i))}else{const s=new Z5(this.editor,t,e,r,i);this.handlers.set(t,[s])}}removeEventListener(t,e,r){if(!t){for(const[o,s]of Array.from(this.handlers.entries()))for(let l=s.length-1;l>=0;l--){const c=s[l];if(e)e===c.name&&r===c.handler&&s.splice(l,1);else if(r===c.handler){s.splice(l,1),c.destroy(),s.length===0&&this.handlers.delete(o);continue}}return}const i=this.handlers.get(t);if(i){const o=i.findIndex(s=>s.handler===r&&s.name===e);if(o!==-1){const s=i[o];i.splice(o,1),s.destroy(),i.length===0&&this.handlers.delete(t)}}}removeAllListeners(t,e){const r=this.handlers.get(t);if(r)if(e)for(let i=0;i<r.length;i++){const o=r[i];o.name===e&&(r.splice(i,1),o.destroy())}else r.forEach(i=>{i.destroy()}),this.handlers.delete(t)}}function tT(n){if(!n.selection.range.focus.isSimple())return!1;const e=We(n.rootContainer);return e.scrollTop===0?q5(n,n.getFirstBlock()):(Y5(n).then(()=>{const r=e.getBoundingClientRect(),i=r.left+r.width/2,o=r.top+Th(n)*.1,s=document.elementFromPoint(i,o);if(s){const l=J(s);l&&q5(n,l)}}),!0)}function eT(n){if(!n.selection.range.focus.isSimple())return!1;const e=We(n.rootContainer);return e.scrollTop+e.clientHeight>=e.scrollHeight?W5(n,n.getLastBlock()):(X5(n).then(()=>{const r=Th(n)*.9,i=e.getBoundingClientRect(),o=i.left+i.width/2,s=i.top+r,l=document.elementFromPoint(o,s);if(l){const c=J(l);c&&W5(n,c)}}),!0)}const yu=I("select-all");function nT(n,t){const e=Re(n),r=Me(n);return t.start.offset===0&&t.start.blockId===lt(e)&&t.end.offset===dt(t.getEditor(),r)&&t.end.blockId===lt(r)}function kU(n,t){const e=t.getEditor(),r=fr(e,n).getChildContainers(e,n),i=r[0],o=r[r.length-1],s=lt(n);return t.start.blockId===s&&t.start.childContainerId===at(i)&&t.end.blockId===s&&t.end.childContainerId===at(o)}function RU(n,t){p(yu,t,"no parent block"),p(yu,Mt(n,t),"not a complex block");const e=fr(n,t).getChildContainers(n,t),r=e[0],i=e[e.length-1];n.selection.setRange(Qe(n,{anchor:Ee(t,at(r)),focus:Ee(t,at(i))}))}function rT(n,t){const e=rt(t);Uh(n,e)}function Tp(n){const t=n.getFocusedBlock(),e=n.selection.range;if(e.start.isSimple()){if(e.start.blockId===e.end.blockId&&nt(n,t)){const i=e.start,o=e.end,s=dt(n,t);if(i.offset>0||o.offset<s)return n.selection.selectBlock(t,0,s),!1}return z(n.rootContainer,"select-all"),rT(n,Re(n.rootContainer)),!1}return p(yu,!e.isSimple(),"invalid range type"),kU(t,e)?(rT(n,t),!1):(p(yu,t,"no parent block"),p(yu,Mt(n,t),"not a complex block"),RU(n,t),!0)}function Uh(n,t){const e=ue(t),r=e[0],i=e[e.length-1],o=ct(r,0,"home"),s=ct(i,dt(n,i),"end");n.selection.setSelection(o,s,{noScroll:!0})}function wU(n){Bp(n),n.focus()}function SU(n){const t=[];return n.forEach(e=>{var r;((r=e.attributes)==null?void 0:r.box)===!0?(t.length>0&&t[t.length-1].length===0&&t.pop(),t.push([e]),t.push([])):t.length>0?t[t.length-1].push(e):t.push([e])}),t.length>0&&t[t.length-1].length===0&&t.pop(),t}function yp(n,t,e,r=!1){var c;if(!e)return[];const i=e.length;e=e.toLowerCase();const o=[];let s=0;const l=SU(t);for(const d of l){if(((c=d[0].attributes)==null?void 0:c.box)===!0){const E=d[0].attributes,A=n.editorBoxes.getBoxClass(E.type);(A==null?void 0:A.matchText)&&!r&&A.matchText(n,E,e)&&o.push({start:s,end:s+1}),s+=1;continue}const h=de(d,{boxReplacement:" "}).toLowerCase();let C=h.indexOf(e,0);for(;C!==-1;)o.push({start:C+s,end:C+i+s}),C=h.indexOf(e,C+i);s+=h.length}return o}function iT(n,t,e,r,i){const o=yp(n,t,e,!0);let s=mt.default(t);return o.length===0||(o.reverse().forEach(l=>{s=Ch(s,l.start,l.end,r)}),i&&(i.count=o.length)),s}const kp=I("selected-block-to-doc");function oT(n,t,e){!t.children||t.children.forEach(r=>{const i=n.getChildContainerData(r);i.forEach(o=>{oT(n,o,e)}),e.blocks[r]=mt.default(i)})}function Oh(n,t){const e=Qt(n,t.block);if(e.selectionToDoc)return e.selectionToDoc(n,t);const r=mt.default(Wo(n,t.block));if(nt(n,t.block)){const o=t.start,s=t.end;if(p(kp,r.text,"no block text"),o.offset===s.offset)return{blocks:{root:[{...r,text:[]}]},meta:{},comments:{}};const{middle:l}=Je(r.text,o.offset,s.offset-o.offset);return{blocks:{root:[{...r,text:l}]},meta:{},comments:{}}}if(ge(t.block))return{blocks:{root:[r]},meta:{},comments:{}};p(kp,Mt(n,t.block),"not complex block"),p(kp,r.children,"no children");const i={blocks:{root:[r]},meta:{},comments:{}};return oT(n,r,i),i}function Rp(n,t){const e=ct(t,0,"normal"),r=ct(t,dt(n,t),"end");return Oh(n,{block:t,start:e,end:r})}const LU=I("block-to-doc");function sT(n,t){p(LU,t.length>0,"invalid params, no blocks");const e=t.map(r=>Rp(n,r));return il(e)}function La(n){const e=n.selection.range.getSelectedBlocks().map(r=>Oh(n,r));return il(e)}function lT(n,t){const e=n.getContainerById(t),o=ue(e).map(s=>({start:ct(s,0,"home"),end:ct(s,dt(n,s),"end"),block:s})).map(s=>Oh(n,s));return il(o)}const aT=I("ensure-block-visible");function IU(n,t){var e;for(;t;){const r=rt(t);if(qt(r))return;const i=J(r);p(aT,i,"no parent block");const o=Qt(n,i);o.isChildContainerVisible&&!((e=o.isChildContainerVisible)!=null&&e.call(o,n,i,r))&&(p(aT,o.showChildContainer,"no showChildContainer method"),o.showChildContainer(n,i,r)),t=i}}const Nh=I("editor-selection");class DU{constructor(t){m(this,"editor");m(this,"caret");m(this,"_range");m(this,"lastCaretRect");m(this,"handleBlockDelete",(t,e,r,i)=>{if(r||i.child)return;const o=this.range;if(YB(e,o)){Nh.debug("adjust selection because remote deleted current block");const s=QB(t,e);this.setRange(s,{noScroll:!0})}});this.editor=t;const e=t.getFirstBlock(),r=lt(e);this.caret=new zM(t);const i=ct(r,0,"normal");this._range=Qe(t,{anchor:i,focus:i}),this.lastCaretRect=null,this.editor.addListener("blockDeleted",this.handleBlockDelete),setTimeout(()=>{this.updateFocusedBlock(null)})}destroy(){this.caret.destroy()}get range(){return this._range}get focusedBlock(){return this.getFocusedBlock()}get startBlock(){return this.getStartBlock()}get endBlock(){return this.getEndBlock()}getFocusedBlock(){const t=this.range.focus;return this.editor.getBlockById(t.blockId)}getStartBlock(){const t=this.range.start;return this.editor.getBlockById(t.blockId)}getEndBlock(){const t=this.range.end;return this.editor.getBlockById(t.blockId)}selectBlock(t,e,r,i){const o=ct(t,e,"normal");let s;r&&(s=ct(t,r,"normal")),this.setSelection(o,s,i)}setSelection(t,e,r){if(e||(e=t),this.verifyPos(t),this.verifyPos(e),!this.selectionChanging(t,e))return this.range;const i=this.editor.getBlockById(t.blockId);IU(this.editor,i);const o=Qe(this.editor,{anchor:t,focus:e});if(this.range.isEqual(o))return this.range;const s=this._range;return this._range=o,this.selectionChanged(),this.updateFocusedBlock(s),wt(this.editor.rootContainer,"select-all")&&(!o.isSimple()||!ZM(this.editor,o))&&ot(this.editor.rootContainer,"select-all"),r!=null&&r.noScroll||this.scrollIntoView(),this.range}setRange(t,e){return this.setSelection(t.anchor,t.focus,e)}updateSelection(){this.caret.update(),GM(this.editor)}getFocusedPos(){return this.range.focus}getAnchorPos(){return this.range.anchor}selectionChanging(t,e){return!0}selectionChanged(){this.updateSelection(),this.editor.emit("selectionChanged",this.editor)}updateLastCaretRect(){const t=this.range.focus;if(!di(t))return;const e=this.editor.getBlockById(t.blockId);this.lastCaretRect=Vo(this.editor,e,t)}getSuggestedCaretX(){var t;return(t=this.lastCaretRect)==null?void 0:t.x}scrollIntoView(){JM(this.editor)}verifyPos(t){const e=this.editor.getBlockById(t.blockId);if(t.isSimple())t.offset>=0&&t.offset<=dt(this.editor,e)||p(Nh,!1,"invalid block position, out of range");else{const r=t.childContainerId;!!this.editor.getContainerById(r)||p(Nh,!1,"invalid complex block position, no container found")}}updateFocusedBlock(t){if(t&&this.range.start.blockId===t.start.blockId)return;let e;t&&t.start.blockId===t.end.blockId&&(e=this.editor.findBlockById(t.start.blockId));let r;(this.range.isCollapsed()||!this.range.isSimple()||this.range.start.blockId===this.range.end.blockId)&&(r=this.editor.getBlockById(this.range.start.blockId));let i=!1;e&&wt(e,"focused")&&(ot(e,"focused"),i=!0),this.removeAllBlockFocusedClass(),r&&this.setBlockFocused(r)&&(i=!0),i&&this.editor.emit("focusBlockChanged",this.editor,r!=null?r:null,e!=null?e:null)}verify(){this.verifyPos(this._range.start),this.verifyPos(this._range.end)}to(t){const e=La(this.editor);return t==="text"?qo(this.editor,e):t==="markdown"?t5(this.editor,e):ZB(this.editor,e)}removeAllBlockFocusedClass(){this.editor.rootContainer.querySelectorAll('div[data-type="editor-block"].focused, div[data-type="editor-block"].child-focused').forEach(t=>{ot(t,"focused"),ot(t,"child-focused")})}setBlockFocused(t){if(wt(t,"focused"))return!1;z(t,"focused");let e=rt(t);for(;Ur(e);){const r=J(e);p(Nh,r,"parent block not found"),z(r,"child-focused"),e=rt(r)}return!0}}function _U(n){const t=n.selection.range.focus;if(!t.isSimple())return;const e=n.findBlockById(t.blockId);!e||n.selection.selectBlock(e,0,dt(n,e))}function MU(n){const t=n.selection.range.focus;if(!t.isSimple())return;const e=n.findBlockById(t.blockId);if(!e||!nt(n,e))return;let r=Ep(n,"select"),i=Ap(n,"select");if(!r||!i)return;const o=t.blockId;r.blockId!==o&&(r=ct(e,0,"home")),i.blockId!==o&&(i=ct(e,dt(n,e),"end")),n.selection.setSelection(r,i)}class UU{constructor(t){m(this,"editor");m(this,"startPos",null);m(this,"lastCaretRect");m(this,"mouseDownEvent",null);m(this,"autoScroll",null);m(this,"handleMouseDown",(t,e)=>{var i;this.mouseDownEvent=t;const r=A1(this.editor,t.x,t.y);if(r){if(r instanceof hi)return;if(!this.autoScroll&&e.autoScroll){const s=r.getSelectedBlocks(),l=We(s[0].block);this.autoScroll=new Xd({scrollElement:l,edge:{top:50,bottom:50}})}const o=this.editor.selection.range;if(t.shiftKey&&o.isSimple()){const s=o.anchor;this.editor.selection.setSelection(s,r.focus),this.startPos=r.start}else this.editor.selection.setSelection(r.anchor,r.focus),this.startPos=r.start;this.editor.selection.updateLastCaretRect(),e.autoScroll&&((i=this.autoScroll)==null||i.active())}});m(this,"handleMouseMove",t=>{if(!this.startPos||!this.mouseDownEvent||Math.abs(this.mouseDownEvent.x-t.x)<3&&Math.abs(this.mouseDownEvent.y-t.y)<3)return;const e=rh(this.editor,t.x,t.y);if(!e)return;const r=Mh(this.editor,this.startPos,e.end);if(!r)return;const{anchor:i,focus:o}=r;this.editor.selection.setSelection(i,o)});m(this,"handleMouseUp",t=>{var e;(e=this.autoScroll)==null||e.inactive(),this.startPos=null});this.editor=t,this.startPos=null,this.lastCaretRect=new DOMRect}isSelecting(){return this.startPos!==null}stopSelection(){this.startPos=null}handleDblClick(t){MU(this.editor)}handleTripleClick(t){_U(this.editor)}}function OU(n){return n.readonly||!n.isWritable()?!1:(n.undoManager.undo(),!0)}function NU(n){return n.readonly||!n.isWritable()?!1:(n.undoManager.redo(),!0)}const cT=I("delete-text");function uT(n,t,e,r){const i=r!=null?r:n.selection.range.start;i instanceof Ye||p(cT,!1,`invalid insert pos type: ${typeof i}`);const{blockId:o}=i,s=n.getBlockById(o);p(cT,nt(n,s),"block is not a text kind block");let{offset:l}=i;if(t==="backward"){if(l-e<0)return 0;if(!Un(s,l-e)){const c=Go(s,l);e=l-c}}else if(t==="forward"&&l+e>dt(n,s))return 0;return t==="backward"&&(l-=e),n.deleteTextFromBlock(s,l,e)}function fT(n,t){if(n.getBlockData(t).quoted){const e={quoted:null};return n.updateBlockData(t,e),!0}return!1}const PU=I("handle-backspace");function wp(n,t){if(!fe(n,t))return;const e=rt(t);Dr(e)!==1&&n.deleteBlock(t)}function FU(n,t){if(!n.selection.range.isCollapsed()){n.clearSelectedContents();return}const e=n.selection.range.start,r=n.getBlockById(e.blockId);if(nt(n,r))if(e.offset===0){if(fT(n,r))return;const i=dr(r);if(i){if(!n.isBlockWritable(i))return;if(nt(n,i))n.mergeTextBlock(i,r,{focus:!0});else if(Mt(n,i)){wp(n,r);const o=Aa(n,i);o?n.selection.selectBlock(o,dt(n,o)):n.selection.selectBlock(i,0,dt(n,i))}else wp(n,r),p(PU,ge(i),"prev block is not embed block"),n.selection.selectBlock(i,1)}else{const o=rt(r);if(Ur(o)){const s=A3(n,o,{visibleOnly:!0});if(s){if(!n.isBlockWritable(s))return;wp(n,r),n.selection.selectBlock(s,dt(n,s))}}}}else uT(n,"backward",1,null),n.selection.updateLastCaretRect();else{const i=vt(r),o=rt(r);n.insertTextBlock("",at(o),i),n.deleteBlock(r)}}function KU(n,t){if(!n.selection.range.isCollapsed()){n.clearSelectedContents();return}const e=n.selection.range.start,r=n.getBlockById(e.blockId);if(nt(n,r))if(e.offset===dt(n,r)){const i=Jt(r);if(i){if(!n.isBlockWritable(i))return;nt(n,i)?n.mergeTextBlock(r,i,{focus:!0}):fe(n,r)?n.deleteBlock(r,Te(n,i,0)):n.deleteBlock(i)}}else uT(n,"forward",1,null);else{const i=vt(r),o=rt(r);n.insertTextBlock("",at(o),i),n.deleteBlock(r)}}function VU(n){const{range:t}=n.selection,{start:e,end:r}=t,i=n.getBlockById(e.blockId),o=n.getBlockById(r.blockId);if(i!==o||!Mt(n,i))return!1;if(di(e))return!0;const s=Ea(n,i,e,r),l=hn(n,i);return s.length===l.length}function $U(n,t){if(VU(n)){const s=n.getFocusedBlock(),l=vt(s),c=at(rt(s));n.insertTextBlock("",c,l+1);return}const e=n.getFocusedBlock(),{start:r,end:i}=n.selection.range,o=r.blockId===i.blockId&&ge(e);if(!n.selection.range.isCollapsed()&&!o&&n.clearSelectedContents(),nt(n,e)){if(fe(n,e)&&fT(n,e))return;const s=n.selection.range.start,l=n.breakTextBlock(e,s.offset,{copyBlockAttributes:!0});s.offset!==0?n.selection.selectBlock(l,0):n.selection.scrollIntoView()}else{const s=n.insertTextBlock();n.selection.selectBlock(s,0)}}function HU(n,t){const e=n.selection.range.getSelectedBlocks()[0],{block:r}=e;if(!nt(n,r))return!1;const i=e.end;return n.insertBoxToBlock(r,i.offset,{type:"br",id:tt(),box:!0,created:Date.now()}),!0}function Sp(n,t,e,r){if(e.type==="embed"){const l=e.embedData.src;if(l&&typeof l=="string")for(const c of l.split("|"))r.add(c);return}const i=e.text;i&&i.forEach(s=>{if(s.attributes&&s.attributes.src&&typeof s.attributes.src=="string")if(zo(s)){const l=n.editorBoxes.getBoxClass(s.attributes.type);if(l.getResources){const c=l.getResources(n,s.attributes);c?c.forEach(d=>{r.add(d)}):r.add(s.attributes.src)}else r.add(s.attributes.src)}else r.add(s.attributes.src)});const o=e.children;o&&o.forEach(s=>{t.blocks[s].forEach(c=>{Sp(n,t,c,r)})})}function jU(n,t){const e=new Set;return t.blocks.root.forEach(i=>{const o=n.editorBlocks.getBlockClass(i.type);if(o.getResources){const s=o.getResources(n,i);s?s.forEach(l=>{e.add(l)}):Sp(n,t,i,e)}else Sp(n,t,i,e)}),Array.from(e)}function ku(n,t){return ce.isFirefox?`<!doctype html><html><head><meta charset="utf8" /></head><body><canvas data-editor-doc="${ai(JSON.stringify(t))}" id="ones-editor-doc">${n}</body></html>`:`<!doctype html><html><head><meta charset="utf8" />${`<meta charset="utf-8"><ones-editor-doc data-source="ones-editor-doc::${ai(JSON.stringify(t))}::ones-editor-doc" />`}</head><body>${n}</body></html>`}function Ru(n,t){var o,s,l;const e=(l=(s=(o=n.doc).getServerMeta)==null?void 0:s.call(o))!=null?l:{},r=jU(n,t),i={};r.forEach(c=>{const d=n.doc.buildResourceUrl(c,{withToken:!0});i[c]=d}),t.meta={...e,resources:i}}function zU(n,t,e){if(t.preventDefault(),t.stopPropagation(),!t.clipboardData)return;let r=La(n);const i=e==null?void 0:e(n,t,r);if(i===!0)return;typeof i=="object"&&i!==null&&(r=i),Ru(n,r);const o=xu(n,r),s=qo(n,r),l=ku(o,r);t.clipboardData.setData("text/html",l),t.clipboardData.setData("text/plain",s),t.clipboardData.setData("text/x-ones-editor-doc",JSON.stringify(r))}function Ph(n,t){Ru(n,t);const e=xu(n,t),r=ku(e,t),i=qo(n,t),o=new Blob([r],{type:"text/html"});Qc([{type:"text/plain",data:new Blob([i],{type:"text/plain"})},{type:"text/html",data:o}])}function GU(n,t){if(n.selection.range.isCollapsed())return;let e=La(n);const r=t==null?void 0:t(n,new ClipboardEvent("mock-event"),e);r!==!0&&(typeof r=="object"&&r!==null&&(e=r),Ph(n,e))}async function Lp(n,t){if(!window.isSecureContext)throw new Error("Can't copy block in insecure context.");const e=Rp(n,t);Ph(n,e)}const WU=I("input-handler-actions");function dT(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>($U(n),!0))}function hT(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(KU(n),!0))}function mT(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(FU(n),!0))}function gT(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(HU(n),!0))}function pT(n){return n.readonly||!n.isWritable()||!window.isSecureContext?!1:(navigator.clipboard.readText().then(t=>{n.input.handlePasteText(t,{toPlainText:!0})}).catch(t=>{WU.error(t)}),!0)}function CT(n){return n.selection.range.getSelectedBlocks().every(e=>{const r=e.block,i=rt(r);if(qt(i))return!1;const o=J(i);return o&&Dt(o)==="code"})}function ET(n,t){const e=n.selection.range.getSelectedBlocks(),r=rt(e[0].block),i=J(r);return i?`\`\`\`${n.getBlockData(i).language}
27
+ `)}const nU=I("get-text-position");function ya(n,t){const e=t!=null?t:n.selection.range.start;e instanceof Ye||p(nU,!1,`invalid insert pos type: ${typeof e}`);const{blockId:r}=e,i=n.getBlockById(r),o=vt(i),s=rt(i),l=at(s),{offset:c}=e;return{block:i,container:s,containerId:l,blockIndex:o,offset:c}}const ka=I("insert-text");function ip(n,t,e,r){var s;const i=n.doc.getBlockData(t,e);if(p(ka,i,"no block data"),p(ka,i.text,"no block text"),mn(i.text)===0)return p(ka,r===0,"invalid text offset"),n.editorCommandProviders.getEmptyBlockTextAttributes(n,i.id);if(r===0)return;const o=Je(i.text,r-1,1).middle;if(!((s=o[0].attributes)!=null&&s.box))return o[0].attributes}function rU(n,t,e){const r=rt(t),i=at(r),o=vt(t);return ip(n,i,o,e)}function e5(n,t,e,r,i){const o=rt(t),s=at(o),l=vt(t),c=rU(n,t,e),d=ph(e,r,c!=null?c:null);return n.doc.localUpdateBlockText(s,l,d,i),Tn(n,t)}function n5(n,t,e,r){const i=rt(t),o=at(i),s=vt(t),l=ph(e," ",r);return n.doc.localUpdateBlockText(o,s,l),Tn(n,t)}function iU(n,t){let e=0;if(t===0)return!1;for(let r=0;r<n.length;r++){const i=n[r];p(ka,typeof i.insert=="string","invalid text op, no insert");const o=e+ch(i);if(o===t)return!1;if(o>t)return!0;e=o}return!1}function op(n,t,e,r,i){const o=n.doc.getBlockData(e,r);p(ka,o,"no block data"),p(ka,o.text,"no block text");const s=ip(n,e,r,i);s&&Object.keys(s).includes("link")&&(iU(o.text,i)||delete s.link);const l=ph(i,t,s!=null?s:null);return n.doc.localUpdateBlockText(e,r,l),Tn(n,n.getBlockById(o.id))}function sp(n,t){n.selection.range.isCollapsed()||n.clearSelectedContents();const{containerId:e,blockIndex:r,offset:i}=ya(n);op(n,t,e,r,i)}const Rh=I("update-composition-text");function r5(n){const t=n.selection.range.start;t instanceof Ye||p(Rh,!1,`invalid insert pos type: ${typeof t}`);const{blockId:e}=t,r=n.getBlockById(e);p(Rh,nt(n,r),"not a text kind block");const i=rt(r),o=at(i),s=vt(r),l=n.doc.getBlockData(o,s);p(Rh,l,"no block data in doc"),p(Rh,l.text,"no text data in text block");const c=Ot(r);fh(n,$o(r),e,c,l.text)}function lp(n){T_(n)}function Ra(n,t,e,r,i,o){return n.doc.localInsertBlock(t,e,r,i,o),n.getBlockById(r.id)}const bu=I("delete-block-text");function ap(n,t,e,r,i){if(!n.isBlockWritable(t))return bu.error("block is not writable"),0;p(bu,nt(n,t),"block is not a text kind block");const o=rt(t),s=at(o),l=vt(t),c=n.doc.getBlockData(s,l);p(bu,c,"no block data in doc"),p(bu,c.text,"no text data in text block");let d=e;Un(t,e)||(d=Go(t,d));let h=e+r;p(bu,h<=dt(n,t),`invalid offset and count: ${e}, ${r}`),Un(t,h)||(h=el(t,h));const C=h-d,E=BB(d,C);return n.doc.localUpdateBlockText(s,l,E,i),console.log("delete"),C}const cp=I("break-text-block");function i5(n,t){const r=n.getBlockData(t).quoted;return r?{quoted:r}:{}}function wa(n,t,e,r){p(cp,nt(n,t),`block is not a text kind block: ${Dt(t)}`),p(cp,e>=0&&e<=dt(n,t),`invalid offset: ${e}`);const i=rt(t),o=at(i),s=vt(t),l=r!=null&&r.copyBlockAttributes?i5(n,t):{};if(!(r!=null&&r.forceInsertAfter)&&(e===0||e===dt(n,t))){let k=s;if(e!==0){let F=hr(t);F?k=vt(F):(F=Me(i),k=vt(F)+1)}const L={...Ci(""),...l,...r==null?void 0:r.newBlockData},M=Te(n,t.id,0),U=Ra(n,o,k,L,M);return{block:t,newBlock:U}}p(cp,Un(t,e),"not a valid offset");const c=Tn(n,t),{right:d}=_n(c,e),h=mn(d);h>0&&ap(n,t,e,h);let C=hr(t),E;C?E=vt(C):(C=Me(i),E=vt(C)+1);const A={...Ci(d),...l,...r==null?void 0:r.newBlockData},v=Ra(n,o,E,A,Te(n,A.id,0));return{block:t,newBlock:v}}const oU=I("prepare-insert-new-block");function sU(n,t,e){if(t&&e!==void 0&&e!==null){const d=n.getContainerById(t),h=ue(d);return p(oU,e>=0&&e<=h.length,`invalid blockIndex: ${e}`),{containerId:t,blockIndex:e}}const r=n.selection.range.start;if(!r.isSimple())return null;const i=n.getBlockById(r.blockId);if(t=at(rt(i)),e=vt(i),!nt(n,i))return{containerId:t,blockIndex:e+1};const s=r.offset;if(s===0||s===dt(n,i))return{containerId:t,blockIndex:s===0?e:e+1};const c=wa(n,i,s).newBlock;return{containerId:t,blockIndex:vt(c)}}const lU=I("auto-insert-block");function o5(n,t,e,r,i,o){const s=sU(n,e,r);p(lU,s,`not an valid insert position: ${n.selection.range}`);const l={blockId:t.id,offset:0},c={anchor:l,focus:l};return Ra(n,s.containerId,s.blockIndex,t,i!=null?i:c,o)}const aU=I("delete-block");function wh(n,t,e){t.children&&(e.push(...t.children),t.children.forEach(r=>{n.getChildContainerData(r).forEach(o=>{wh(n,o,e)})}))}function Sh(n,t,e){const r=rt(t),i=at(r),o=vt(t),s=n.doc.getBlockData(i,o);return p(aU,s,"no block data in doc"),n.doc.localDeleteBlock(i,o,Qe(n,{anchor:e.start,focus:e.end})),s}function up(n,t,e){return n.undoManager.runInGroup(()=>{const r=rt(t);Dr(r)===1&&n.insertTextBlock("",at(r),0);let i=e?Ho(n,e):null;if(!i){const l=n.selection.range;YB(t,l)?i=QB(n,t):i=l}const o=Sh(n,t,i),s=[];return wh(n,o,s),s.length>0&&n.doc.localDeleteChildContainers(s),o})}function cU(n,t){const e=[t];n.doc.getContainerBlocks(t).forEach(i=>{wh(n,i,e)}),n.doc.localDeleteChildContainers(e)}function s5(n,t){const e=[...t];t.forEach(r=>{n.doc.getContainerBlocks(r).forEach(o=>{wh(n,o,e)})}),n.doc.localDeleteChildContainers(e)}const fp=I("merge-text-block");function l5(n,t,e){p(fp,nt(n,t),"only text block can be merged"),p(fp,nt(n,e),"only text block can be merged");const r=Wo(n,t),i=Wo(n,e),o=r.text,s=i.text;p(fp,o&&s,"block data has no text");const l=rt(t),c=at(l),d=vt(t),h=dt(n,t),C=op(n,s,c,d,h),E=Te(n,t,mn(o));return up(n,e,E),C}const Ei=I("clear-selected-contents");function Lh(n,t){p(Ei,nt(n,t.block),"not a text kind block");const{start:e,end:r}=t;p(Ei,e.isSimple(),"not a simple block position"),p(Ei,r.isSimple(),"not a simple block position");const i=e.offset,o=r.offset;p(Ei,i<=o,`invalid delete text offset: ${i}, ${o}`),i!==o&&n.deleteTextFromBlock(t.block,i,o-i)}function a5(n,t,e){const r=at(t),i=ue(t),o=e.focus?void 0:n.selection.range.toDocRange(),s=n.insertTextBlock("",r,0,{newRange:o});e.focus&&n.selection.selectBlock(s,0),i.reverse().forEach(l=>{n.deleteBlock(l)})}function uU(n,t){const{block:e,start:r,end:i}=t;if(nt(n,e)){Lh(n,t);return}if(ge(e)||r.isSimple()){p(Ei,i.isSimple(),"invalid range");const s=rt(e),l=vt(e),c=n.insertTextBlock("",at(s),l);n.selection.selectBlock(c,0),n.deleteBlock(e);return}p(Ei,Mt(n,e),"invalid block kind"),p(Ei,!r.isSimple()&&!i.isSimple(),"invalid range"),Ea(n,e,r,i),n.selection.range.getSelectedContainers().forEach((s,l)=>{a5(n,s,{focus:l===0})})}function fU(n){if(!n.isWritable())return;const t=n.selection.range;if(t.isCollapsed())return;const e=t.getSelectedBlocks();if(p(Ei,e.length>0,"no selected block"),e.length===1){uU(n,e[0]);return}const r=e[0],i=r.block,o=rt(i);p(Ei,e.length>1,"no selected block");const s=e[e.length-1],l=s.block;if(nt(n,i)){Lh(n,r);const h=Te(n,r.block,r.start.offset);if(e.slice(1,e.length-1).reverse().forEach(E=>n.deleteBlock(E.block)),nt(n,l)){Lh(n,s),n.mergeTextBlock(i,l,{focus:!0}),n.selection.setRange(h);return}n.deleteBlock(l),n.selection.setRange(h);return}if(nt(n,l)){Lh(n,s),e.slice(0,e.length-1).reverse().forEach(h=>n.deleteBlock(h.block)),n.selection.selectBlock(s.block,0);return}if(e.length===Dr(o)){a5(n,o,{focus:!0});return}const c=Ue(i),d=Jt(l);p(Ei,c||d,"no prev or next block"),e.forEach(h=>n.deleteBlock(h.block))}function Ih(n){n.selection.range.isCollapsed()||n.undoManager.runInGroup(()=>{n.emit("beforeClearSelection",n);try{n.doc.beginBatchUpdate(),fU(n)}finally{n.doc.endBatchUpdate()}n.emit("afterClearSelection",n)})}const dU=I("core");function c5(n,t,e){const r=rt(t),i=at(r),o=vt(t);return n.doc.localUpdateBlockText(i,o,e),setTimeout(()=>{n.selection.updateSelection(null)}),Tn(n,t)}function u5(n,t,e){if(!n.isBlockWritable(t)){dU.error("block is not writable");return}const r=n.getBlockText(t),i=gn.diff(r,e);c5(n,t,i)}function Dh(n,t,e){const r=Tn(n,t),i=typeof e=="string"?rl(e):e,o=gn.diff(r,i);return c5(n,t,o)}const vu=I("update-block-data");function _h(n,t,e,r){const i=rt(t),o=at(i),s=vt(t),l=n.doc.getBlockData(o,s),c={insert:{},delete:[]},d=new Set(Object.keys(l)),h=new Set(Object.keys(e));return d.forEach(E=>{if(!h.has(E)){if(E==="id"||E==="type"||E==="text")return;vu.debug(`delete key: ${E}`),c.delete.push(E)}}),Object.entries(e).forEach(([E,A])=>{p(vu,E!=="id"&&E!=="type",`invalid block data delta, ${E}`);const v=l[E];if(A==null){v!=null&&(vu.debug(`delete key: ${E}`),c.delete.push(E));return}v!==A&&(jc.default(v,A)||E==="text"&&gn.diff(v,A).length===0||(d.has(E)?(vu.debug(`replace key: ${E}`),c.delete.push(E)):vu.debug(`insert key: ${E}`),c.insert[E]=A))}),n.doc.localUpdateBlockData(o,s,c,r),Wo(n,t)}function f5(n,t,e,r){const o={...n.getBlockData(t),embedData:e};return n.updateBlockData(t,o,r)}function dp(n,t,e){if(!Mt(n,t)||!(e!=null&&e.tryFocusToChildSimpleBlock)){n.selection.selectBlock(t,0);return}const i=fr(n,t).getChildContainers(n,t)[0],o=Re(i);dp(n,o,e)}function il(n){const t=[];let e={};return n.forEach(r=>{t.push(...r.blocks.root);const{root:i,...o}=r.blocks;e={...e,...o}}),{blocks:{...e,root:t},meta:{},comments:{}}}const Bu=I("clone-block");function Xo(n,t,e,r){const i=n.getBlockClass(e.type);if(i.blockToDoc)return i.blockToDoc(t,e,(h,C)=>(p(Bu,e!==C,"invalid child block"),Xo(n,h,e,r)));let o={};const s=new Map,l=mt.default(e);l.children&&(l.children=l.children.map(h=>{const C=tt(),E=t.blocks[h];p(Bu,Array.isArray(E),"invalid child blocks");const A=E.map(M=>Xo(n,t,M,r)),v=il(A),{root:k,...L}=v.blocks;return o={...o,...L},o[C]=v.blocks.root,s.set(h,C),C}));const c=Array.from(s.entries()),d=h=>{for(const C of c){const[E,A]=C;{const v=`${E}/`;if(h.startsWith(v)){const k=h.substring(v.length),L=`${A}/${k}`;return Bu.debug(`replace key: ${h} -> ${L}`),L}}{const v=`${E}_`;if(h.startsWith(v)){const k=h.substring(v.length),L=`${A}_${k}`;return Bu.debug(`replace key: ${h} -> ${L}`),L}}}return h};return Array.from(Object.entries(l)).forEach(([h,C])=>{const E=d(h);E!==h&&delete l.key,l[E]=C}),l.id=tt(),r&&(r.blockIdMap.set(e.id,l.id),s.forEach((h,C)=>r.containerIdMap.set(C,h))),{blocks:{root:[l],...o},meta:{},comments:{}}}function hp(n,t,e,r){const i=t.blocks[e];p(Bu,Array.isArray(i),"invalid child blocks");const o=i.map(l=>Xo(n,t,l,r));return il(o)}function mp(n,t,e){const r=t.blocks.root.map(i=>Xo(n.editorBlocks,t,i,e));return mt.default(il(r))}const d5=I("insert-doc");function h5(n,t,e,r,i){if(Mt(n,t)){d5.warn("failed to insert doc into a complex block");return}const o=mp(n,r,i),s=rt(t),l=vt(t),c=at(s);n.doc.beginBatchUpdate(),n.undoManager.runInGroup(()=>{var F,G,q,it;const d=[];Object.entries(o.blocks).forEach(([st,Et])=>{st!=="root"&&d.push({containerId:st,blocks:Et})}),d.length>0&&n.doc.localInsertChildContainers(d);const h=o.blocks.root;if(ge(t)){n.deleteBlock(t);let st;h.reverse().forEach(Et=>{const gt=n.insertBlock(c,l,Et,void 0,{noFocus:!0});st||(st=gt)}),st&&n.selection.selectBlock(st,dt(n,st));return}if(p(d5,nt(n,t),"not a text block"),fe(n,t)){const st=vt(t);let Et,gt=!1;for(let At=0;At<h.length;At++){if(At===0){const Gt=n.findBlockByIndex(c,st),cn=h[At].type==="text"||h[At].type==="list";if(Gt&&nt(n,Gt)&&fe(n,Gt)&&cn){n.insertTextToBlock(t,0,(F=h[At].text)!=null?F:[]),Object.keys(h[At]).length>3&&n.updateBlockData(Gt,x_(h[At],["id","text","type","heading","quoted"]));continue}Gt&&zi(Gt)&&(gt=!0)}const Vt=n.insertBlock(c,st+At,h[At],void 0,{noFocus:!0});At===h.length-1&&(Et=Vt)}Et&&n.selection.selectBlock(Et,dt(n,Et)),gt&&n.deleteBlock(t);return}if(h.length===1){const st=h[0];if(nu(n,st.type)){n.insertTextToBlock(t,e,(G=st.text)!=null?G:[]);return}n.breakTextBlock(t,e),n.insertBlock(c,l+1,st);return}const C=e===dt(n,t),E=e===0,A=h[0],v=h[h.length-1];let k;!C&&!E?k=n.breakTextBlock(t,e,{forceInsertAfter:!0}):k=t;const L=E?l:l+1;C?(k=n.insertBlock(c,l+1,v),n.selection.selectBlock(k,dt(n,k))):(n.selection.selectBlock(k,0),nu(n,v.type)?n.insertTextToBlock(k,0,(q=v.text)!=null?q:[]):n.insertBlock(c,L,v));const M=n.selection.range;let U=L;nu(n,A.type)?E?(n.insertBlock(c,L,A),U+=1):n.insertTextToBlock(t,e,(it=A.text)!=null?it:[]):(n.insertBlock(c,L,A),U+=1),h.slice(1,h.length-1).reverse().forEach(st=>{n.insertBlock(c,U,st)}),n.selection.setRange(M)}),n.doc.endBatchUpdate()}function gp(n,t,e,r,i){const o=mp(n,r,i),s=at(t),l=[];return n.undoManager.runInGroup(()=>{const c=[];Object.entries(o.blocks).forEach(([h,C])=>{h!=="root"&&c.push({containerId:h,blocks:C})}),n.doc.localInsertChildContainers(c),o.blocks.root.reverse().forEach(h=>{const C=n.insertBlock(s,e,h,void 0,{noFocus:!0,noScroll:!0});l.push(C)})}),l}function m5(n,t,e,r){const i=Dr(t);gp(n,t,i,e,r);for(let o=0;o<i;o++){const s=Re(t);n.deleteBlock(s)}}const Tu=I("add-text-attribute");function hU(n,t,e,r){const{start:i,end:o}=e;p(Tu,i.blockId===o.blockId&&i.blockId===lt(t),"invalid range"),p(Tu,r,"invalid attribute name");const s=n.getBlockText(t),l=va(i.offset,o.offset-i.offset,s,r,void 0,{ignoreValue:!0});return n.setBlockText(t,l),l}function g5(n,t,e,r,i){const{start:o,end:s}=e;p(Tu,o.blockId===s.blockId&&o.blockId===lt(t),"invalid range"),p(Tu,r,"invalid attribute name");const l=n.getBlockText(t),c=hu(o.offset,s.offset-o.offset,l,r,i);return n.setBlockText(t,c),c}function Sa(n,t,e,r,i){const{start:o,end:s}=e;p(Tu,o.blockId===s.blockId&&o.blockId===lt(t),"invalid range");const l=n.getBlockText(t),c=cB(o.offset,s.offset-o.offset,l,r,i);return n.setBlockText(t,c),c}function p5(n,t,e,r){const i=mi(n,{simpleBlockOnly:!0});n.undoManager.runInGroup(()=>{i.forEach(o=>{const{block:s,start:l,end:c}=o;if(!nt(n,s))return;if(fe(n,s)){r(n,lt(s),t,e);return}const d=Qe(n,{anchor:l,focus:c});t==="color"||t==="backgroundColor"?Sa(n,s,d,t,e):(Sa(n,s,d,"color",null),Sa(n,s,d,"backgroundColor",null))})})}function C5(n,t,e){const r=mi(n,{simpleBlockOnly:!0});n.undoManager.runInGroup(()=>{r.forEach(i=>{const{block:o,start:s,end:l}=i;if(!nt(n,o))return;if(fe(n,o)){(t==="clearColor"||t==="clearAll")&&e(n,lt(o),"color",null),(t==="clearBackground"||t==="clearAll")&&e(n,lt(o),"backgroundColor",null);return}const c=Qe(n,{anchor:s,focus:l});(t==="clearColor"||t==="clearAll")&&Sa(n,o,c,"color",null),(t==="clearBackground"||t==="clearAll")&&Sa(n,o,c,"backgroundColor",null)})})}function E5(n,t,e){const r=t.getSelectedBlocks().filter(l=>nt(n,l.block));if(r.length===0)return[null,null];const i=l=>{if(dt(n,l.block)===0)return e(n,lt(l.block));const c=l.start,d=l.end,h=n.getBlockText(l.block);return dB(c.offset,d.offset-c.offset,h)};let[o,s]=i(r[0]);return o===null&&s===null?[o,s]:(r.forEach(l=>{const[c,d]=i(l);c===null||o===null?o=null:o=c===o?o:null,d===null||s===null?s=null:s=d===s?s:null}),[o,s])}const Jn=I("adjust-selection-pos");function A5(n){const t=[];for(;n;){const e=rt(n);if(t.unshift(e),qt(e))return t;const r=J(e);p(Jn,r,"child container has not parent container"),n=r}p(Jn,!1,"should not come here: getParentContainers")}function x5(n,t){for(;t;){const e=rt(t);if(e===n)return t;const r=J(e);p(Jn,r,"could not find parent block for a child container"),t=r}p(Jn,!1,"no parent block in specified container")}function mU(n,t){const e=A5(n),r=A5(t);p(Jn,e.length>0&&r.length>0,"block has not parent container"),p(Jn,e[0]===r[0],"root container does not equal");let i=e[0];for(let l=1;l<e.length||r.length;l++)if(e[l]!==r[l]){i=e[l-1];break}const o=x5(i,n),s=x5(i,t);return{parentContainer:i,newBlock1:o,newBlock2:s}}function b5(n,t){let e=J(t);for(p(Jn,e,"element is not in a block");e;){const r=rt(e);p(Jn,Ur(r),"not a child container");const i=J(r);if(p(Jn,i,"child container has not parent block"),i===n)return r;e=i}p(Jn,!1,"failed to find parent container in complex block")}function Mh(n,t,e){const r=n.getBlockById(t.blockId),i=n.getBlockById(e.blockId);if(r===i)return t instanceof Ye&&e instanceof Ye?{anchor:t,focus:e}:t instanceof Or&&e instanceof Or?nh(n,r,t,e):null;const o=rt(r),s=rt(i);if(o===s)return t instanceof Or&&(t=ct(r,0,"home")),e instanceof Or&&(e=ct(i,dt(n,i),"end")),p(Jn,t instanceof Ye,"not valid position type"),p(Jn,e instanceof Ye,"not valid position type"),{anchor:t,focus:e};if(r.contains(s))return null;if(i.contains(o)){if(t instanceof Ye&&e instanceof Or){const v=n.getContainerById(e.childContainerId);if(v===o)return{anchor:e,focus:e};const k=J(o);if(k&&k===J(v)){const L=Ee(k,at(o)),M=Ee(k,at(v));return nh(n,k,L,M)}}return null}const l=Vd(r,i)>0,{newBlock1:c,newBlock2:d}=mU(r,i);if(c===d){const v=c,k=b5(v,r),L=b5(v,i);return t=Ee(c,at(k)),e=Ee(c,at(L)),Jn.debug(`select in complex block: ${k.id}, ${L.id}`),nh(n,v,t,e)}let h=l?dt(n,c):0;c===r&&t instanceof Ye&&(h=t.offset);let E=l?0:dt(n,d);return d===i&&e instanceof Ye&&(E=e.offset),t=ct(c,h,l?"end":"home"),e=ct(d,E,l?"home":"end"),{anchor:t,focus:e}}const gU=I("move-complex-block-position");function pU(n,t,e){const r=n.getBlockById(t.blockId);p(gU,Mt(n,r),"is not a complex block");const i=fr(n,r),o=n.getContainerById(t.childContainerId),s=i.getNextContainer(n,r,o,e,{noWrap:!0});return s?Ee(r,at(s)):null}const Yo=I("move-simple-block-position");function v5(n,t){const e=hn(n,t,{visibleOnly:!0});if(e.length===0)return Yo.warn("complex block has not any child container, not loaded?"),null;p(Yo,e.length>0,"complex block has not any child container");const r=e[0];return Re(r)}function B5(n,t){const e=hn(n,t,{visibleOnly:!0});if(e.length===0)return Yo.warn("complex block has not any child container, not loaded?"),null;p(Yo,e.length>0,"complex block has not any child container");const r=e[e.length-1];return Me(r)}function T5(n,t,e){const r=e?v5(n,t):B5(n,t);return r?Mt(n,r)?T5(n,r,e):r:null}function CU(n,t,e){const r=n.getBlockById(t.blockId);return e==="move"&&Mt(n,r)&&t.offset===0?v5(n,r):hr(r)}function EU(n,t,e){const r=n.getBlockById(t.blockId);return e==="move"&&Mt(n,r)&&t.offset===1?B5(n,r):dr(r)}function pp(n){return n==="ArrowLeft"||n==="ArrowUp"}function Cp(n,t,e){const r=rt(t);if(qt(r))return null;const i=J(r);p(Yo,i,"child container has not parent block"),p(Yo,Mt(n,i),"is not a complex block");const o=fr(n,i).getNextContainer(n,i,r,e);return o?pp(e)?Me(o):Re(o):Cp(n,i,e)}function AU(n,t,e){const r=rt(t);if(qt(r))return null;const i=J(r);if(p(Yo,i,"child container has not parent block"),pp(e)){const l=Ue(i);if(l)return l}else{const l=Jt(i);if(l)return l}const o=Cp(n,i,e);if(o)return o;let s=i;for(;!qt(rt(s));)s=J(rt(s));return pp(e)?Ue(s):Jt(s)}function xU(n,t,e){if(!Mt(n,t)||fr(n,t).enableKeyboardSelect)return t;const i=T5(n,t,e==="ArrowDown"||e==="ArrowRight");return i||t}function bU(n,t,e,r){const i=n.getBlockById(t.blockId),s=Qt(n,i).moveCaret(n,i,t,e);if(s)return s;let l=e==="ArrowDown"||e==="ArrowRight"?CU(n,t,r):EU(n,t,r);if(l||(l=Cp(n,i,e),l||(l=AU(n,i,e))),l||Mt(n,i)&&hn(n,i).length===0&&(Yo.warn("complex block has not any child container, not loaded?"),l=e==="ArrowDown"||e==="ArrowRight"?hr(i):dr(i)),!l){if(e==="ArrowDown"||e==="ArrowRight"){if(n.readonly||!qt(rt(i)))return null;const c=n.insertTextBlock("",at(n.rootContainer),Dr(n.rootContainer));return ct(c,0,"home")}return null}if(l=xU(n,l,e),nt(n,l)){const c=n.selection.getSuggestedCaretX();if(e==="ArrowDown")return W_(n,l,i,t,c);if(e==="ArrowUp")return G_(n,l,i,t,c)}return e==="ArrowLeft"||e==="ArrowUp"?ct(l,dt(n,l),"end"):e==="ArrowRight"||e==="ArrowDown"?ct(l,0,"home"):null}function vU(n,t,e){if(t==="ArrowLeft")return e.start;const r=e.end,i=n.getBlockById(r.blockId);if(nt(n,i))return r;const o=Jt(i);if(o)return ct(o,0,"home");if(!qt(rt(i))||n.readonly)return r;const s=n.insertTextBlock("",at(n.rootContainer),Dr(n.rootContainer));return ct(s,0,"home")}function BU(n,t,e){const r=n.selection.range;let i;if(r instanceof nn)e==="move"&&!r.isCollapsed()&&(t==="ArrowLeft"||t==="ArrowRight")?i=vU(n,t,r):i=bU(n,r.getFocusedPos(),t,e);else if(i=pU(n,r.focus,t),e==="move"){const o=i!=null?i:r.focus,s=n.getContainerById(o.childContainerId);if(t==="ArrowLeft"||t==="ArrowUp"){const l=Me(s);i=ct(l,0,"home")}else{const l=Re(s);i=ct(l,dt(n,l),"end")}}return i?e==="move"?{anchor:i,focus:i}:Mh(n,r.anchor,i):null}function Qo(n,t,e){const r=BU(n,t,e);if(!r)return!1;const{anchor:i,focus:o}=r;return n.selection.setSelection(i,o),(t==="ArrowLeft"||t==="ArrowRight")&&n.selection.updateLastCaretRect(),!0}function y5(n){return Qo(n,"ArrowLeft","move"),!0}function k5(n){return Qo(n,"ArrowRight","move"),!0}function R5(n){return Qo(n,"ArrowUp","move"),!0}function w5(n){if(Qo(n,"ArrowDown","move")||n.readonly)return!0;const t=n.getFocusedBlock(),e=rt(t);if(qt(e)||Me(e)!==t)return!0;const r=n.rootContainer;return n.insertTextBlock("",at(r),Dr(r)),!0}function S5(n){return Qo(n,"ArrowDown","select"),!0}function L5(n){return Qo(n,"ArrowLeft","select"),!0}function I5(n){return Qo(n,"ArrowRight","select"),!0}function D5(n){return Qo(n,"ArrowUp","select"),!0}const _5=I("word-offset");function Ep(n,t){const e=n.selection.range.focus;p(_5,e.isSimple(),"invalid range type");const r=n.getBlockById(e.blockId);if(fe(n,r))return ct(r,0,"home");if(e.offset===0||!nt(n,r)){const s=Ue(r);if(!s)return null;const l=ct(s,dt(n,s),"end");if(t==="select"&&nt(n,s)){const c=J1(n,s,l.offset);return ct(s,c,"normal")}return l}const i=J1(n,r,e.offset);return ct(r,i,"normal")}function Ap(n,t){const e=n.selection.range.focus;p(_5,e.isSimple(),"invalid range type");const r=n.getBlockById(e.blockId);if(fe(n,r))return ct(r,0,"end");if(e.offset===dt(n,r)||!nt(n,r)){const s=Jt(r);if(!s)return null;const l=ct(s,0,"home");if(t==="select"&&nt(n,s)){const c=Z1(n,s,l.offset);return ct(s,c,"end")}return l}const i=Z1(n,r,e.offset);return ct(r,i,"normal")}function M5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Ep(n,"move");return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}function U5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Ap(n,"move");return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}function O5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Ep(n,"select");return e?(n.selection.setSelection(n.selection.getAnchorPos(),e),n.selection.updateLastCaretRect(),!0):!1}function N5(n){if(!n.selection.range.focus.isSimple())return!1;const e=Ap(n,"select");return e?(n.selection.setSelection(n.selection.range.anchor,e),n.selection.updateLastCaretRect(),!0):!1}I("find-block");function xp(n,t){if(!Mt(n,t))return t;const r=fr(n,t).getChildContainers(n,t)[0],o=ue(r)[0];return xp(n,o)}function bp(n,t){if(!Mt(n,t))return t;const e=fr(n,t).getChildContainers(n,t),r=e[e.length-1],i=ue(r),o=i[i.length-1];return bp(n,o)}function vp(n){const t=bp(n,Me(n.rootContainer)),e=ct(t,dt(n,t),"end");return n.selection.setSelection(e),!0}function P5(n){const t=xp(n,n.getFirstBlock()),e=ct(t,0,"home");return n.selection.setSelection(e),!0}function F5(n){const t=xp(n,n.getFirstBlock()),e=ct(t,0,"home");return n.selection.setSelection(n.selection.getAnchorPos(),e),!0}function Bp(n){const t=bp(n,Me(n.rootContainer)),e=ct(t,dt(n,t),"end");return n.selection.setSelection(n.selection.getAnchorPos(),e),!0}const K5=I("line-offset");function V5(n){const t=n.selection.range.focus;p(K5,t.isSimple(),"invalid range type");const e=n.getBlockById(t.blockId);if(t.offset===0||!nt(n,e))return ct(e,0,"home");let i=CB(e,t).start;const{next:o}=lu(e,i);return o&&Yn(o)&&ru(o)==="br"&&(i+=1),ct(e,i,"home")}function $5(n){const t=n.selection.range.focus;p(K5,t.isSimple(),"invalid range type");const e=n.getBlockById(t.blockId);if(t.offset===dt(n,e)||!nt(n,e))return ct(e,dt(n,e),"end");const r=CB(e,t);return ct(e,r.end,"end")}function H5(n){if(!n.selection.range.focus.isSimple())return!1;const e=V5(n);return e?(n.selection.setSelection(n.selection.getAnchorPos(),e),n.selection.updateLastCaretRect(),!0):!1}function j5(n){if(!n.selection.range.focus.isSimple())return!1;const e=$5(n);return e?(n.selection.setSelection(n.selection.getAnchorPos(),e),n.selection.updateLastCaretRect(),!0):!1}function z5(n){if(!n.selection.range.focus.isSimple())return!1;const e=V5(n);return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}function G5(n){if(!n.selection.range.focus.isSimple())return!1;const e=$5(n);return e?(n.selection.setSelection(e),n.selection.updateLastCaretRect(),!0):!1}I("find-block-position"),I("page-offset");function W5(n,t){const r=Qt(n,t).getBlockTextLength(t),i=ct(t,r,"normal"),o=Mh(n,n.selection.getAnchorPos(),i);if(!o)return!1;const{anchor:s,focus:l}=o;return n.selection.setSelection(s,l,{noScroll:!0}),n.selection.updateLastCaretRect(),!0}function q5(n,t){const e=ct(t,0,"normal"),r=Mh(n,n.selection.getAnchorPos(),e);if(!r)return!1;const{anchor:i,focus:o}=r;return n.selection.setSelection(i,o,{noScroll:!0}),n.selection.updateLastCaretRect(),!0}async function X5(n){const t=Th(n)*.9,e=We(n.rootContainer);await Ks(Math.min(e.scrollTop+t*2,e.scrollHeight),{elementToScroll:e})}async function Y5(n){const t=Th(n)*.9,e=We(n.rootContainer);await Ks(Math.max(e.scrollTop-t,0),{elementToScroll:e})}function Q5(n){return Y5(n),!0}function J5(n){return X5(n),!0}const TU=I("table-scroll");class Z5{constructor(t,e,r,i,o){m(this,"handleEvent",t=>{this.handler(this.editor,t,this.data)});this.editor=t,this.dom=e,this.name=r,this.handler=i,this.data=o,e.addEventListener(r,this.handleEvent)}destroy(){this.dom.removeEventListener(this.name,this.handleEvent)}}class yU{constructor(t){m(this,"handlers",new Map);this.editor=t}destroy(){Array.from(this.handlers.entries()).forEach(([t,e])=>{e.forEach(r=>r.destroy()),this.handlers.delete(t)})}addEventListener(t,e,r,i){const o=this.handlers.get(t);if(o){if(o.find(s=>s.handler===r&&s.name===e)){TU.warn(`event has already registered: ${e}`);return}o.push(new Z5(this.editor,t,e,r,i))}else{const s=new Z5(this.editor,t,e,r,i);this.handlers.set(t,[s])}}removeEventListener(t,e,r){if(!t){for(const[o,s]of Array.from(this.handlers.entries()))for(let l=s.length-1;l>=0;l--){const c=s[l];if(e)e===c.name&&r===c.handler&&s.splice(l,1);else if(r===c.handler){s.splice(l,1),c.destroy(),s.length===0&&this.handlers.delete(o);continue}}return}const i=this.handlers.get(t);if(i){const o=i.findIndex(s=>s.handler===r&&s.name===e);if(o!==-1){const s=i[o];i.splice(o,1),s.destroy(),i.length===0&&this.handlers.delete(t)}}}removeAllListeners(t,e){const r=this.handlers.get(t);if(r)if(e)for(let i=0;i<r.length;i++){const o=r[i];o.name===e&&(r.splice(i,1),o.destroy())}else r.forEach(i=>{i.destroy()}),this.handlers.delete(t)}}function tT(n){if(!n.selection.range.focus.isSimple())return!1;const e=We(n.rootContainer);return e.scrollTop===0?q5(n,n.getFirstBlock()):(Y5(n).then(()=>{const r=e.getBoundingClientRect(),i=r.left+r.width/2,o=r.top+Th(n)*.1,s=document.elementFromPoint(i,o);if(s){const l=J(s);l&&q5(n,l)}}),!0)}function eT(n){if(!n.selection.range.focus.isSimple())return!1;const e=We(n.rootContainer);return e.scrollTop+e.clientHeight>=e.scrollHeight?W5(n,n.getLastBlock()):(X5(n).then(()=>{const r=Th(n)*.9,i=e.getBoundingClientRect(),o=i.left+i.width/2,s=i.top+r,l=document.elementFromPoint(o,s);if(l){const c=J(l);c&&W5(n,c)}}),!0)}const yu=I("select-all");function nT(n,t){const e=Re(n),r=Me(n);return t.start.offset===0&&t.start.blockId===lt(e)&&t.end.offset===dt(t.getEditor(),r)&&t.end.blockId===lt(r)}function kU(n,t){const e=t.getEditor(),r=fr(e,n).getChildContainers(e,n),i=r[0],o=r[r.length-1],s=lt(n);return t.start.blockId===s&&t.start.childContainerId===at(i)&&t.end.blockId===s&&t.end.childContainerId===at(o)}function RU(n,t){p(yu,t,"no parent block"),p(yu,Mt(n,t),"not a complex block");const e=fr(n,t).getChildContainers(n,t),r=e[0],i=e[e.length-1];n.selection.setRange(Qe(n,{anchor:Ee(t,at(r)),focus:Ee(t,at(i))}))}function rT(n,t){const e=rt(t);Uh(n,e)}function Tp(n){const t=n.getFocusedBlock(),e=n.selection.range;if(e.start.isSimple()){if(e.start.blockId===e.end.blockId&&nt(n,t)){const i=e.start,o=e.end,s=dt(n,t);if(i.offset>0||o.offset<s)return n.selection.selectBlock(t,0,s),!1}return z(n.rootContainer,"select-all"),rT(n,Re(n.rootContainer)),!1}return p(yu,!e.isSimple(),"invalid range type"),kU(t,e)?(rT(n,t),!1):(p(yu,t,"no parent block"),p(yu,Mt(n,t),"not a complex block"),RU(n,t),!0)}function Uh(n,t){const e=ue(t),r=e[0],i=e[e.length-1],o=ct(r,0,"home"),s=ct(i,dt(n,i),"end");n.selection.setSelection(o,s,{noScroll:!0})}function wU(n){Bp(n),n.focus()}function SU(n){const t=[];return n.forEach(e=>{var r;((r=e.attributes)==null?void 0:r.box)===!0?(t.length>0&&t[t.length-1].length===0&&t.pop(),t.push([e]),t.push([])):t.length>0?t[t.length-1].push(e):t.push([e])}),t.length>0&&t[t.length-1].length===0&&t.pop(),t}function yp(n,t,e,r=!1){var c;if(!e)return[];const i=e.length;e=e.toLowerCase();const o=[];let s=0;const l=SU(t);for(const d of l){if(((c=d[0].attributes)==null?void 0:c.box)===!0){const E=d[0].attributes,A=n.editorBoxes.getBoxClass(E.type);(A==null?void 0:A.matchText)&&!r&&A.matchText(n,E,e)&&o.push({start:s,end:s+1}),s+=1;continue}const h=de(d,{boxReplacement:" "}).toLowerCase();let C=h.indexOf(e,0);for(;C!==-1;)o.push({start:C+s,end:C+i+s}),C=h.indexOf(e,C+i);s+=h.length}return o}function iT(n,t,e,r,i){const o=yp(n,t,e,!0);let s=mt.default(t);return o.length===0||(o.reverse().forEach(l=>{s=Ch(s,l.start,l.end,r)}),i&&(i.count=o.length)),s}const kp=I("selected-block-to-doc");function oT(n,t,e){!t.children||t.children.forEach(r=>{const i=n.getChildContainerData(r);i.forEach(o=>{oT(n,o,e)}),e.blocks[r]=mt.default(i)})}function Oh(n,t){const e=Qt(n,t.block);if(e.selectionToDoc)return e.selectionToDoc(n,t);const r=mt.default(Wo(n,t.block));if(nt(n,t.block)){const o=t.start,s=t.end;if(p(kp,r.text,"no block text"),o.offset===s.offset)return{blocks:{root:[{...r,text:[]}]},meta:{},comments:{}};const{middle:l}=Je(r.text,o.offset,s.offset-o.offset);return{blocks:{root:[{...r,text:l}]},meta:{},comments:{}}}if(ge(t.block))return{blocks:{root:[r]},meta:{},comments:{}};p(kp,Mt(n,t.block),"not complex block"),p(kp,r.children,"no children");const i={blocks:{root:[r]},meta:{},comments:{}};return oT(n,r,i),i}function Rp(n,t){const e=ct(t,0,"normal"),r=ct(t,dt(n,t),"end");return Oh(n,{block:t,start:e,end:r})}const LU=I("block-to-doc");function sT(n,t){p(LU,t.length>0,"invalid params, no blocks");const e=t.map(r=>Rp(n,r));return il(e)}function La(n){const e=n.selection.range.getSelectedBlocks().map(r=>Oh(n,r));return il(e)}function lT(n,t){const e=n.getContainerById(t),o=ue(e).map(s=>({start:ct(s,0,"home"),end:ct(s,dt(n,s),"end"),block:s})).map(s=>Oh(n,s));return il(o)}const aT=I("ensure-block-visible");function IU(n,t){var e;for(;t;){const r=rt(t);if(qt(r))return;const i=J(r);p(aT,i,"no parent block");const o=Qt(n,i);o.isChildContainerVisible&&!((e=o.isChildContainerVisible)!=null&&e.call(o,n,i,r))&&(p(aT,o.showChildContainer,"no showChildContainer method"),o.showChildContainer(n,i,r)),t=i}}const Nh=I("editor-selection");class DU{constructor(t){m(this,"editor");m(this,"caret");m(this,"_range");m(this,"lastCaretRect");m(this,"handleBlockDelete",(t,e,r,i)=>{if(r||i.child)return;const o=this.range;if(YB(e,o)){Nh.debug("adjust selection because remote deleted current block");const s=QB(t,e);this.setRange(s,{noScroll:!0})}});this.editor=t;const e=t.getFirstBlock(),r=lt(e);this.caret=new zM(t);const i=ct(r,0,"normal");this._range=Qe(t,{anchor:i,focus:i}),this.lastCaretRect=null,this.editor.addListener("blockDeleted",this.handleBlockDelete),setTimeout(()=>{this.updateFocusedBlock(null)})}destroy(){this.caret.destroy()}get range(){return this._range}get focusedBlock(){return this.getFocusedBlock()}get startBlock(){return this.getStartBlock()}get endBlock(){return this.getEndBlock()}getFocusedBlock(){const t=this.range.focus;return this.editor.getBlockById(t.blockId)}getStartBlock(){const t=this.range.start;return this.editor.getBlockById(t.blockId)}getEndBlock(){const t=this.range.end;return this.editor.getBlockById(t.blockId)}selectBlock(t,e,r,i){const o=ct(t,e,"normal");let s;r&&(s=ct(t,r,"normal")),this.setSelection(o,s,i)}setSelection(t,e,r){if(e||(e=t),this.verifyPos(t),this.verifyPos(e),!this.selectionChanging(t,e))return this.range;const i=this.editor.getBlockById(t.blockId);IU(this.editor,i);const o=Qe(this.editor,{anchor:t,focus:e});if(this.range.isEqual(o))return this.range;const s=this._range;return this._range=o,this.selectionChanged(),this.updateFocusedBlock(s),wt(this.editor.rootContainer,"select-all")&&(!o.isSimple()||!ZM(this.editor,o))&&ot(this.editor.rootContainer,"select-all"),r!=null&&r.noScroll||this.scrollIntoView(),this.range}setRange(t,e){return this.setSelection(t.anchor,t.focus,e)}updateSelection(){this.caret.update(),GM(this.editor)}getFocusedPos(){return this.range.focus}getAnchorPos(){return this.range.anchor}selectionChanging(t,e){return!0}selectionChanged(){this.updateSelection(),this.editor.emit("selectionChanged",this.editor)}updateLastCaretRect(){const t=this.range.focus;if(!di(t))return;const e=this.editor.getBlockById(t.blockId);this.lastCaretRect=Vo(this.editor,e,t)}getSuggestedCaretX(){var t;return(t=this.lastCaretRect)==null?void 0:t.x}scrollIntoView(){JM(this.editor)}verifyPos(t){const e=this.editor.getBlockById(t.blockId);if(t.isSimple())t.offset>=0&&t.offset<=dt(this.editor,e)||p(Nh,!1,"invalid block position, out of range");else{const r=t.childContainerId;!!this.editor.getContainerById(r)||p(Nh,!1,"invalid complex block position, no container found")}}updateFocusedBlock(t){if(t&&this.range.start.blockId===t.start.blockId)return;let e;t&&t.start.blockId===t.end.blockId&&(e=this.editor.findBlockById(t.start.blockId));let r;(this.range.isCollapsed()||!this.range.isSimple()||this.range.start.blockId===this.range.end.blockId)&&(r=this.editor.getBlockById(this.range.start.blockId));let i=!1;e&&wt(e,"focused")&&(ot(e,"focused"),i=!0),this.removeAllBlockFocusedClass(),r&&this.setBlockFocused(r)&&(i=!0),i&&this.editor.emit("focusBlockChanged",this.editor,r!=null?r:null,e!=null?e:null)}verify(){this.verifyPos(this._range.start),this.verifyPos(this._range.end)}to(t){const e=La(this.editor);return t==="text"?qo(this.editor,e):t==="markdown"?t5(this.editor,e):ZB(this.editor,e)}removeAllBlockFocusedClass(){this.editor.rootContainer.querySelectorAll('div[data-type="editor-block"].focused, div[data-type="editor-block"].child-focused').forEach(t=>{ot(t,"focused"),ot(t,"child-focused")})}setBlockFocused(t){if(wt(t,"focused"))return!1;z(t,"focused");let e=rt(t);for(;Ur(e);){const r=J(e);p(Nh,r,"parent block not found"),z(r,"child-focused"),e=rt(r)}return!0}}function _U(n){const t=n.selection.range.focus;if(!t.isSimple())return;const e=n.findBlockById(t.blockId);!e||n.selection.selectBlock(e,0,dt(n,e))}function MU(n){const t=n.selection.range.focus;if(!t.isSimple())return;const e=n.findBlockById(t.blockId);if(!e||!nt(n,e))return;let r=Ep(n,"select"),i=Ap(n,"select");if(!r||!i)return;const o=t.blockId;r.blockId!==o&&(r=ct(e,0,"home")),i.blockId!==o&&(i=ct(e,dt(n,e),"end")),n.selection.setSelection(r,i)}class UU{constructor(t){m(this,"editor");m(this,"startPos",null);m(this,"lastCaretRect");m(this,"mouseDownEvent",null);m(this,"autoScroll",null);m(this,"handleMouseDown",(t,e)=>{var i;this.mouseDownEvent=t;const r=A1(this.editor,t.x,t.y);if(r){if(r instanceof hi)return;if(!this.autoScroll&&e.autoScroll){const s=r.getSelectedBlocks(),l=We(s[0].block);this.autoScroll=new Xd({scrollElement:l,edge:{top:50,bottom:50}})}const o=this.editor.selection.range;if(t.shiftKey&&o.isSimple()){const s=o.anchor;this.editor.selection.setSelection(s,r.focus),this.startPos=r.start}else this.editor.selection.setSelection(r.anchor,r.focus),this.startPos=r.start;this.editor.selection.updateLastCaretRect(),e.autoScroll&&((i=this.autoScroll)==null||i.active())}});m(this,"handleMouseMove",t=>{if(!this.startPos||!this.mouseDownEvent||Math.abs(this.mouseDownEvent.x-t.x)<3&&Math.abs(this.mouseDownEvent.y-t.y)<3)return;const e=rh(this.editor,t.x,t.y);if(!e)return;const r=Mh(this.editor,this.startPos,e.end);if(!r)return;const{anchor:i,focus:o}=r;this.editor.selection.setSelection(i,o)});m(this,"handleMouseUp",t=>{var e;(e=this.autoScroll)==null||e.inactive(),this.startPos=null});this.editor=t,this.startPos=null,this.lastCaretRect=new DOMRect}isSelecting(){return this.startPos!==null}stopSelection(){this.startPos=null}handleDblClick(t){MU(this.editor)}handleTripleClick(t){_U(this.editor)}}function OU(n){return n.readonly||!n.isWritable()?!1:(n.undoManager.undo(),!0)}function NU(n){return n.readonly||!n.isWritable()?!1:(n.undoManager.redo(),!0)}const cT=I("delete-text");function uT(n,t,e,r){const i=r!=null?r:n.selection.range.start;i instanceof Ye||p(cT,!1,`invalid insert pos type: ${typeof i}`);const{blockId:o}=i,s=n.getBlockById(o);p(cT,nt(n,s),"block is not a text kind block");let{offset:l}=i;if(t==="backward"){if(l-e<0)return 0;if(!Un(s,l-e)){const c=Go(s,l);e=l-c}}else if(t==="forward"&&l+e>dt(n,s))return 0;return t==="backward"&&(l-=e),n.deleteTextFromBlock(s,l,e)}function fT(n,t){if(n.getBlockData(t).quoted){const e={quoted:null};return n.updateBlockData(t,e),!0}return!1}const PU=I("handle-backspace");function wp(n,t){if(!fe(n,t))return;const e=rt(t);Dr(e)!==1&&n.deleteBlock(t)}function FU(n,t){if(!n.selection.range.isCollapsed()){n.clearSelectedContents();return}const e=n.selection.range.start,r=n.getBlockById(e.blockId);if(nt(n,r))if(e.offset===0){if(fT(n,r))return;const i=dr(r);if(i){if(!n.isBlockWritable(i))return;if(nt(n,i))n.mergeTextBlock(i,r,{focus:!0});else if(Mt(n,i)){wp(n,r);const o=Aa(n,i);o?n.selection.selectBlock(o,dt(n,o)):n.selection.selectBlock(i,0,dt(n,i))}else wp(n,r),p(PU,ge(i),"prev block is not embed block"),n.selection.selectBlock(i,1)}else{const o=rt(r);if(Ur(o)){const s=A3(n,o,{visibleOnly:!0});if(s){if(!n.isBlockWritable(s))return;wp(n,r),n.selection.selectBlock(s,dt(n,s))}}}}else uT(n,"backward",1,null),n.selection.updateLastCaretRect();else{const i=vt(r),o=rt(r);n.insertTextBlock("",at(o),i),n.deleteBlock(r)}}function KU(n,t){if(!n.selection.range.isCollapsed()){n.clearSelectedContents();return}const e=n.selection.range.start,r=n.getBlockById(e.blockId);if(nt(n,r))if(e.offset===dt(n,r)){const i=Jt(r);if(i){if(!n.isBlockWritable(i))return;nt(n,i)?n.mergeTextBlock(r,i,{focus:!0}):fe(n,r)?n.deleteBlock(r,Te(n,i,0)):n.deleteBlock(i)}}else uT(n,"forward",1,null);else{const i=vt(r),o=rt(r);n.insertTextBlock("",at(o),i),n.deleteBlock(r)}}function VU(n){const{range:t}=n.selection,{start:e,end:r}=t,i=n.getBlockById(e.blockId),o=n.getBlockById(r.blockId);if(i!==o||!Mt(n,i))return!1;if(di(e))return!0;const s=Ea(n,i,e,r),l=hn(n,i);return s.length===l.length}function $U(n,t){if(VU(n)){const s=n.getFocusedBlock(),l=vt(s),c=at(rt(s));n.insertTextBlock("",c,l+1);return}const e=n.getFocusedBlock(),{start:r,end:i}=n.selection.range,o=r.blockId===i.blockId&&ge(e);if(!n.selection.range.isCollapsed()&&!o&&n.clearSelectedContents(),nt(n,e)){if(fe(n,e)&&fT(n,e))return;const s=n.selection.range.start,l=n.breakTextBlock(e,s.offset,{copyBlockAttributes:!0});s.offset!==0?n.selection.selectBlock(l,0):n.selection.scrollIntoView()}else{const s=n.insertTextBlock();n.selection.selectBlock(s,0)}}function HU(n,t){const e=n.selection.range.getSelectedBlocks()[0],{block:r}=e;if(!nt(n,r))return!1;const i=e.end;return n.insertBoxToBlock(r,i.offset,{type:"br",id:tt(),box:!0,created:Date.now()}),!0}function Sp(n,t,e,r){if(e.type==="embed"){const l=e.embedData.src;if(l&&typeof l=="string")for(const c of l.split("|"))r.add(c);return}const i=e.text;i&&i.forEach(s=>{if(s.attributes&&s.attributes.src&&typeof s.attributes.src=="string")if(zo(s)){const l=n.editorBoxes.getBoxClass(s.attributes.type);if(l.getResources){const c=l.getResources(n,s.attributes);c?c.forEach(d=>{r.add(d)}):r.add(s.attributes.src)}else r.add(s.attributes.src)}else r.add(s.attributes.src)});const o=e.children;o&&o.forEach(s=>{t.blocks[s].forEach(c=>{Sp(n,t,c,r)})})}function jU(n,t){const e=new Set;return t.blocks.root.forEach(i=>{const o=n.editorBlocks.getBlockClass(i.type);if(o.getResources){const s=o.getResources(n,i);s?s.forEach(l=>{e.add(l)}):Sp(n,t,i,e)}else Sp(n,t,i,e)}),Array.from(e)}function ku(n,t){return ce.isFirefox?`<!doctype html><html><head><meta charset="utf8" /></head><body><canvas data-editor-doc="${ai(JSON.stringify(t))}" id="ones-editor-doc">${n}</body></html>`:`<!doctype html><html><head><meta charset="utf8" />${`<meta charset="utf-8"><ones-editor-doc data-source="ones-editor-doc::${ai(JSON.stringify(t))}::ones-editor-doc" />`}</head><body>${n}</body></html>`}function Ru(n,t){var o,s,l;const e=(l=(s=(o=n.doc).getServerMeta)==null?void 0:s.call(o))!=null?l:{},r=jU(n,t),i={};r.forEach(c=>{const d=n.doc.buildResourceUrl(c,{withToken:!0});i[c]=d}),t.meta={...e,resources:i}}function zU(n,t,e){if(t.preventDefault(),t.stopPropagation(),!t.clipboardData)return;let r=La(n);const i=e==null?void 0:e(n,t,r);if(i===!0)return;typeof i=="object"&&i!==null&&(r=i),Ru(n,r);const o=xu(n,r),s=qo(n,r),l=ku(o,r);t.clipboardData.setData("text/html",l),t.clipboardData.setData("text/plain",s),t.clipboardData.setData("text/x-ones-editor-doc",JSON.stringify(r))}function Ph(n,t){Ru(n,t);const e=xu(n,t),r=ku(e,t),i=qo(n,t),o=new Blob([r],{type:"text/html"});Qc([{type:"text/plain",data:new Blob([i],{type:"text/plain"})},{type:"text/html",data:o}])}function GU(n,t){if(n.selection.range.isCollapsed())return;let e=La(n);const r=t==null?void 0:t(n,new ClipboardEvent("mock-event"),e);r!==!0&&(typeof r=="object"&&r!==null&&(e=r),Ph(n,e))}async function Lp(n,t){if(!window.isSecureContext)throw new Error("Can't copy block in insecure context.");const e=Rp(n,t);Ph(n,e)}const WU=I("input-handler-actions");function dT(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>($U(n),!0))}function hT(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(KU(n),!0))}function mT(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(FU(n),!0))}function gT(n,t){return n.readonly||!n.isWritable()?!1:n.undoManager.runInGroup(()=>(HU(n),!0))}function pT(n){return n.readonly||!n.isWritable()||!window.isSecureContext?!1:(navigator.clipboard.readText().then(t=>{n.input.handlePasteText(t,{toPlainText:!0})}).catch(t=>{WU.error(t)}),!0)}function CT(n){return n.selection.range.getSelectedBlocks().every(e=>{const r=e.block,i=rt(r);if(qt(i))return!1;const o=J(i);return o&&Dt(o)==="code"})}function ET(n,t){const e=n.selection.range.getSelectedBlocks(),r=rt(e[0].block),i=J(r);return i?`\`\`\`${n.getBlockData(i).language}
28
28
  ${t}
29
29
  \`\`\`
30
30
  `:""}function Ip(n){if(!window.isSecureContext||n.selection.range.isCollapsed())return!1;const t=La(n);Ru(n,t);const e=xu(n,t);ku(e,t);let r="";if(CT(n)){const i=n.selection.range.getSelectedBlocks()[0],o=rt(i.block);J(o)&&(r=ET(n,qo(n,t)))}else{const i=[];t.blocks.root.forEach((o,s)=>{i.push(kh(n,o,t,[{containerId:"root",blockIndex:s}]))}),i[i.length-1]=i[i.length-1].trimEnd(),r=i.join(`
@@ -948,4 +948,4 @@ ${o.mermaidText}
948
948
  ${o.flowchartText}
949
949
  \`\`\`\`\`\``}return""}const htt={embedType:"flowchart",convertFrom:utt,handleUpdateBlock:ctt,createEmbedContent:att,getBlockProperties:ftt,convertTo:dtt},mtt=I("plantuml-helper");function NS(n,t){var l;let r=((l=(n.getComponentOptions("plantuml")||{}).cdn)==null?void 0:l.plantuml)||zZ;r.endsWith("/")||(r+="/");const i=p9.default.encode(t);p(mtt,i,i),r+=i;const s=new URLSearchParams(document.location.search).get("doc");return Hg(r,{id:`${s}-${tt()}`})}async function gtt(n,t){try{const e=await wA(n,t);return(await n.doc.uploadResource(e)).resourceId}catch{return Promise.resolve(t)}}class gc extends _A{constructor(t){super(t,"plantuml","plantumlText")}static get(t,e){return t.addCustom(`plantuml-${e.id}`,()=>new gc(t))}code2ObjectUrl(t){return Promise.resolve(NS(this.editor,t))}code2ResourceId(t){const e=NS(this.editor,t);return gtt(this.editor,e)}destroy(){}}function ptt(n,t,e){gc.get(n,e).createEmbedContent(t,e)}function Ctt(n,t,e){const r=gc.get(n,e),i=Ot(t);return r.updateEmbedContent(i,e),!0}function Ett(n,t,e){const{data:r}=e,i=n.getBlockString(t).trim();if(!r||r.embedType!=="plantuml"||i!=="```plantuml"||!nt(n,t))return null;const o={src:"",plantumlText:""};return{blockData:{id:tt(),type:"embed",embedType:"plantuml",embedData:o},onConverted:(c,d)=>{gc.get(c,c.getBlockData(d)).editGraph(Ot(d))}}}function Att(n,t){return gc.get(n,n.getBlockData(t)).getBlockProperties(t)}function xtt(n,t,e,r){const{embedData:i}=t,o=i;if(r==="html")return o.src?`<img src="${n.doc.buildResourceUrl(o.src,{withToken:!0})}" />`:o.flowchartText?`<div>${o.flowchartText}</div>`:"<p>[plantuml]</p>";if(r==="markdown"){if(o.src)return`![plantuml](${n.doc.buildResourceUrl(o.src,{withToken:!0})})`;if(o.flowchartText)return`\`\`\`plantuml\`\`\`
950
950
  ${o.flowchartText}
951
- \`\`\`\`\`\``}return""}const btt={embedType:"plantuml",convertFrom:Ett,handleUpdateBlock:Ctt,createEmbedContent:ptt,getBlockProperties:Att,convertTo:xtt},vut="",vtt="hr",Btt={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},Ttt={dividingLine:{type:"Dividing-Line",abstract:"Dividing-Line"}},ytt={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};D.mergeLang({"zh-CN":Btt,"en-US":Ttt,"ja-JP":ytt});function ktt(n,t){const e=B("div",["editor-embed-container"],t);B("hr",["editor-embed-hr"],e)}function Rtt(n,t,e,r){return r==="html"?"<hr />":r==="markdown"?"---":"------------"}function wtt(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:D.t("dividingLine.type"),icon:r2,order:500,group:"common",subText:yn("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:r}=t;return n.insertEmbed(e,r,vtt,{})}}}function Stt(n,t,e){const{data:r}=e;if(!r||r.embedType!=="dividing-line"||!nt(n,t))return null;const i={};return{blockData:{id:tt(),type:"embed",embedType:"hr",embedData:i}}}function Ltt(){return{abstract:D.t("dividingLine.abstract")}}const Itt={embedType:"hr",createEmbedContent:ktt,convertTo:Rtt,getOptions:wtt,convertFrom:Stt,getBlockProperties:Ltt},But="",Tut="",Dtt={media:{upload:{failed:'<div class="line-1">{name}\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <span class="retry-upload">\u91CD\u8BD5</span></div>',maxSizeFailed:'<div class="line-1">{name}\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u9650\u5236\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6</div>'},load:{failed:'<div class="line-1">{name}\u52A0\u8F7D\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <span class="retry-upload">\u91CD\u8BD5</span></div>'},audio:{menuItem:"\u97F3\u9891",abstract:"\u97F3\u9891"},video:{menuItem:"\u89C6\u9891",abstract:"\u89C6\u9891"}}},_tt={media:{upload:{failed:'<div class="line-1">{name} upload failed</div><div class="line-2">Network error, you can <span class="retry-upload">Retry</span></div>',maxSizeFailed:'<div class="line-1">{name} upload failed</div><div class="line-2">The file size exceeds limit. Please choose another file.</div>'},load:{failed:'<div class="line-1">{name} loading failed</div><div class="line-2">Network error, you can <span class="retry-upload">Retry</span></div>'},audio:{menuItem:"Audio",abstract:"Audio"},video:{menuItem:"Video",abstract:"Video"}}},Mtt={media:{upload:{failed:'<div class="line-1">{name}\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <span class="retry-upload">\u518D\u8A66\u884C</span></div>',maxSizeFailed:'<div class="line-1">{name}\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F</div><div class="line-2">\u30D5\u30A1\u30A4\u30EB\u306E\u30B5\u30A4\u30BA\u304C\u4E0A\u9650\u3092\u8D85\u3048\u3066\u3044\u308B\u305F\u3081\u3001\u4ED6\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044</div>'},load:{failed:'<div class="line-1">{name}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <span class="retry-upload">\u518D\u8A66\u884C</span></div>'},audio:{menuItem:"\u97F3\u58F0",abstract:"\u97F3\u58F0"},video:{menuItem:"\u52D5\u753B",abstract:"\u52D5\u753B"}}};D.mergeLang({"zh-CN":Dtt,"en-US":_tt,"ja-JP":Mtt});var Yr=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(Yr||{}),Of=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(Of||{});const PS=10*1024*1024,Utt=["wav","mp3","aac","ogg","webm","flac"],Ott=["ogg","mp4","webm"],Ntt=()=>{};function FS(n){var h,C,E,A,v,k;const t=(h=n.getComponentOptions("media"))!=null?h:{},{allowedMedias:e,maxSize:r,callbacks:i}=t,o=(C=e==null?void 0:e.audio)!=null?C:Utt,s=(E=e==null?void 0:e.video)!=null?E:Ott,l=(A=r==null?void 0:r.audio)!=null?A:PS,c=(v=r==null?void 0:r.video)!=null?v:PS,d=(k=i==null?void 0:i.onError)!=null?k:Ntt;return{allowedMedias:{audio:o,video:s},maxSize:{audio:l,video:c},callbacks:{onError:d}}}function Ptt(n,t){const e=o=>o.map(s=>`.${s}`).join(","),{allowedMedias:r}=FS(n),i=r[t];return i?e(i):"*"}function Ftt(n,t,e){const{maxSize:r,callbacks:i,allowedMedias:o}=FS(t),{[e]:s}=r,{[e]:l}=o;if(s&&n.size>s){const d=new Error("media is too large");throw d.code=`MaxMediaSize-${e}`,i!=null&&i.onError&&(i==null||i.onError(t,d)),d}const c=Jc(n.name);if(l&&!l.includes(c.toLowerCase())){const d=new Error(`media file is not allowed: ${c}`);throw d.code="NotAllowedFile",i!=null&&i.onError&&(i==null||i.onError(t,d)),d}}function Ktt(n){return n===Of.Empty||n===Of.Error}const tn=I("media");class Vtt extends ve.TypedEmitter{constructor(e){super();m(this,"mediaContainer",null);m(this,"media",null);m(this,"abstract",null);m(this,"handleMediaLoadError",(e,r)=>{if(!r.target||!(r.target instanceof Node)||!(r.target instanceof Element?r.target:r.target.parentElement))return;const o=J(r.target);if(!o||!o.contains(this.mediaContainer))return;const s=this.renderError();this.updateMediaContent(s),this.emit("mediaError",e,"load_error",lt(o))});m(this,"handleUploadFile",async e=>{p(tn,this.abstract,"no abstract"),p(tn,this.mediaContainer,"The media element not exist");const{editor:r}=this.options,i=J(this.mediaContainer);p(tn,i,"The block element not exist");const o=r.getBlockData(i);try{const{resourceId:s}=await r.doc.uploadResource(e,{onProgress:C=>{this.renderProgress(C,e)}}),{name:l,type:c,size:d}=e,h={...o,embedData:{...o.embedData,src:s,fileName:l,fileSize:d,fileType:c}};r.updateBlockData(i,h)}catch(s){tn.error(s),this.emit("mediaError",r,"upload_error",o.id),this.renderRetry(e,s)}ot(i,"media-block-uploading")});m(this,"destroy",()=>{this.mediaContainer=null});this.options=e}bindMediaEvent(){const{editor:e}=this.options;this.media&&e.domEvents.addEventListener(this.media,"error",this.handleMediaLoadError)}unbindMediaEvent(){const{editor:e}=this.options;this.media&&e.domEvents.removeEventListener(this.media,"error",this.handleMediaLoadError)}updateMediaContent(e){p(tn,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){p(tn,this.abstract,"no abstract");const{editor:e,createMediaElement:r}=this.options,{mediaIcon:i,mediaName:o}=this.abstract;p(tn,this.mediaContainer,"The media element not exist");const s=J(this.mediaContainer);p(tn,s,"The block element not exist");const l=e.getBlockData(s),c=B("div",["media-error","embed-selected-content","embed-hover-content"],null),d=B("span",["media-error-icon"],c);d.innerHTML=i;const h=B("div",[],c);h.innerHTML=D.t("media.load.failed",{name:o}),c.appendChild(h);const C=h.querySelector(".retry-upload");return p(tn,C,"The element not exist"),e.domEvents.addEventListener(C,"click",(E,A)=>{const v=B("div",["media-element"],null),k=this.getResourceUrl(l),L=r(E,v,l,k);this.unbindMediaEvent(),this.media=L,this.bindMediaEvent(),this.updateMediaContent(v)}),this.setFullScreen(),c}renderRetry(e,r){var E,A;p(tn,this.abstract,"no abstract");const{editor:i}=this.options,{mediaIcon:o,mediaName:s}=this.abstract,l=B("div",["media-error","embed-selected-content","embed-hover-content"],null),c=B("span",["media-error-icon"],l);c.innerHTML=o;const d=B("div",[],l);let h=D.t("media.upload.failed",{name:s});(((E=r.response)==null?void 0:E.status)===420||((A=r.response)==null?void 0:A.status)===413)&&(h=D.t("media.upload.maxSizeFailed",{name:s})),d.innerHTML=h,l.appendChild(d);const C=d.querySelector(".retry-upload");C&&i.domEvents.addEventListener(C,"click",()=>{i.readonly||(p(tn,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(l),this.setFullScreen()}renderProgress(e,r){p(tn,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope .media-progress"),o=e===-1||e===100?100:e;if(i){const{updateProgressElement:s}=this.options;s(i,o)}else{const{createProgressElement:s}=this.options,l=J(this.mediaContainer);p(tn,l,"The element not exist"),z(l,"media-block-uploading");const c=B("div",["media-progress"],null);s(c,o,r),this.updateMediaContent(c)}this.setFullScreen()}renderMediaElement(e,r){p(tn,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope > .media-element"),{createMediaElement:o,updateMediaElement:s,editor:l}=this.options,c=this.getResourceUrl(e,r);if(i){const d=s(l,i,e,c);this.unbindMediaEvent(),this.media=d,this.bindMediaEvent()}else{const d=B("div",["media-element"],null),h=o(l,d,e,c);this.unbindMediaEvent(),this.media=h,this.bindMediaEvent(),this.updateMediaContent(d)}}renderEmpty(e){p(tn,this.abstract,"no abstract"),p(tn,this.mediaContainer,"The media element not exist");const r=B("div",["media-empty","embed-selected-content","embed-hover-content"],this.mediaContainer);r.innerHTML=this.abstract.mediaIcon,this.updateMediaContent(r);const{editor:i}=this.options;i.findBlockById(e.id)&&this.emit("mediaError",i,"empty",e.id),this.setFullScreen()}getResourceUrl(e,r){const{src:i}=e.embedData,{editor:o}=this.options;return o.doc.buildResourceUrl(i,{syncNewResources:async(s,l)=>{var d,h;if(!r)return;await o.doc.addResources([s]);const c=(h=(d=o.doc).getServerMeta)==null?void 0:h.call(d).appId;if(l!==e.embedData.src&&c&&e.embedData.src.includes(c)){const C=J(r);if(C&&!o.readonly&&o.isBlockWritable(C)){const E=mt.default(e);E.embedData.src=s,o.updateBlockData(C,E)}}}})}setFullScreen(){p(tn,this.mediaContainer,"The media element not exist"),z(this.mediaContainer,"full-screen")}removeFullScreen(){p(tn,this.mediaContainer,"The media element not exist"),ot(this.mediaContainer,"full-screen")}updateBlockAlign(e,r){const i=J(r);p(tn,i,"The block element not exist");const{align:o}=e;e.embedType==="video"&&(i.hasAttribute("data-style-align")&&i.removeAttribute("data-style-align"),i.setAttribute("data-style-align",o))}render(e,r){const{src:i}=e.embedData;(!this.mediaContainer||!r.contains(this.mediaContainer))&&(this.mediaContainer=B("div",["media"],r)),this.updateBlockAlign(e,r),Ktt(i)?i===Of.Empty&&this.renderEmpty(e):this.renderMediaElement(e,r)}setAbstract(e){this.abstract=e}}I("media-embed");const $tt="left";class KS{constructor(){m(this,"handleInsertEmptyEmbed",async(t,e)=>{var C;const{containerId:r,blockIndex:i}=e;let o;(C=e.data)!=null&&C.file&&(o=e.data.file);const s=Ptt(t,this.embedType);if(o=o!=null?o:await ga(s,{}),!o)return null;const{mediaType:l}=this.getAbstract();try{Ftt(o,t,l)}catch{return null}const c={id:tt(),type:"embed",embedType:this.embedType,embedData:{src:Of.Empty}};l==="video"&&(c.align=$tt);const d=t.insertBlock(r,i,c);return await this.getMedia(t,c.id).handleUploadFile(o),d})}getMedia(t,e){const r=t.addCustom(`media-${e}`,()=>new Vtt({editor:t,createMediaElement:this.createMediaElement,updateMediaElement:this.updateMediaElement,createProgressElement:this.createProgressElement,updateProgressElement:this.updateProgressElement}));return r.setAbstract({...this.getAbstract()}),r}getOptions(){const{menuItem:t,mediaIcon:e,mediaName:r,order:i,group:o}=this.getAbstract();return{name:r,insertEmbedCommandItems:[{id:`insert-${this.embedType}`,name:t,icon:e,order:i,group:o,subText:yn(`insert-${this.embedType}`)}],handleInsertEmptyEmbed:this.handleInsertEmptyEmbed}}createEmbedContent(t,e,r){const{id:i}=r;this.getMedia(t,i).render(r,e)}handleUpdateBlock(t,e,r){const{id:i}=r,o=this.getMedia(t,i),s=Ot(e);return o.render(r,s),!0}handleDeleteBlock(t,e){const r=e.id,i=this.getMedia(t,r);i.removeAllListeners(),i.destroy()}convertTo(t,e,r,i){const o=e.embedData,s=t.doc.buildResourceUrl(o.src,{withToken:!0});return i==="html"?`<${o.type} src="${s}" />`:i==="markdown"?`![${o.src}](${s})`:s}}function VS(n,t){const e=B("div",["uploading-progress-mask"],n),r=B("div",["uploading-progress-bar"],e),i=B("div",["uploading-progress-bar-value"],r);i.style.width=`${t}%`}function $S(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const Htt=I("media-audio");class jtt extends KS{constructor(){super(...arguments);m(this,"embedType",Yr.AUDIO);m(this,"updateProgressElement",$S);m(this,"createMediaElement",(e,r,i,o)=>{const s=B("div",["audio-container","embed-hover-content","embed-selected-content"],r),l=B("audio",[],s);return l.innerHTML="Your browser does not support the <code>audio</code> element.",l.controls=!0,l.src=o,setTimeout(()=>{this.getMedia(e,i.id).setFullScreen()}),l})}getAbstract(){return{mediaIcon:t2,mediaName:D.t(`media.${Yr.AUDIO}.menuItem`),menuItem:D.t(`media.${Yr.AUDIO}.menuItem`),order:800,mediaType:Yr.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${D.t(`media.${Yr.AUDIO}.abstract`)}`}}updateMediaElement(e,r,i,o){const s=r.querySelector(":scope .audio-container > audio");return p(Htt,s,"The media element not exist"),s.src!==o&&(s.src=o),s}createProgressElement(e,r){const i=B("audio",[],e);i.innerHTML="Your browser does not support the <code>audio</code> element.",i.controls=!0,i.src="about:blank",VS(e,r)}}const ztt=new jtt;I("video-resizer");function HS(n){return n&&ge(n)&&qe(n)==="video"}const Gtt=50;class MA{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&HS(e)&&this.disableBlockResize(e),t&&HS(t)&&this.editor.isBlockWritable(t))){const r=this.getVideoElement(t);if(!r)return;this.enableBlockResize(t,r)}});m(this,"handleResizing",(t,e)=>{if(this.resizing=!0,!this.currentResizableElement)return;const r=t.getBlock();if(!r)return;const i=r.getBoundingClientRect().width,o=Math.min(Math.max(e.width,Gtt),i);this.currentResizableElement.style.width=`${o}px`,this.currentResizableElement.style.pointerEvents="none"});m(this,"handleResized",t=>{this.resizing=!1;const e=t.getBlock();if(!this.currentResizableElement||!e)return;const r=this.editor.getBlockData(e),{width:i}=this.currentResizableElement.getBoundingClientRect();this.currentResizableElement.style.pointerEvents="auto",this.editor.updateBlockData(e,{...r,width:i})});this.editor=t,Be.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,Be.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}getVideoElement(t){return Ot(t).querySelector(":scope .video-container > video")}updateResizer(t){const e=this.editor.findCustom(`${lt(t)}-resizer`);e&&e.updateResizer()}disableBlockResize(t){const e=this.editor.findCustom(`${lt(t)}-resizer`);e&&e.disableResize()}enableBlockResize(t,e){const r=this.editor.addCustom(`${lt(t)}-resizer`,()=>new mf(this.editor,{resize:["top-left","top-right","bottom-left","bottom-right"]}));r.enableResize(t,e),r.removeListener("resizing",this.handleResizing),r.removeListener("resized",this.handleResized),r.addListener("resizing",this.handleResizing),r.addListener("resized",this.handleResized),this.currentResizableElement=e}}const Wtt=I("video");class qtt extends KS{constructor(){super(...arguments);m(this,"embedType",Yr.VIDEO);m(this,"updateProgressElement",$S);m(this,"createMediaElement",(e,r,i,o)=>{const s=B("div",["video-container","embed-selected-content","drag-preview-element"],r),l=B("video",[],s);return l.innerHTML="Your browser does not support the <code>video</code> element.",l.controls=!0,l.src=o,l.addEventListener("canplay",()=>{e.addCustom("video-resizer",()=>new MA(e)),this.getMedia(e,i.id).removeListener("mediaError",this.handleMediaError),this.getMedia(e,i.id).addListener("mediaError",this.handleMediaError),this.getMedia(e,i.id).removeFullScreen()}),i.width&&(l.style.width=`${i.width}px`),l});m(this,"createProgressElement",(e,r,i)=>{const o=B("video",["progress-video"],e);o.innerHTML="Your browser does not support the <code>audio</code> element.",o.controls=!0,VS(e,r),ma(i).then(s=>{const l=e.querySelector(".progress-video");l&&s1(e)&&(l.src=s)})})}getAbstract(){return{mediaName:D.t(`media.${Yr.VIDEO}.menuItem`),mediaIcon:e2,menuItem:D.t(`media.${Yr.VIDEO}.menuItem`),order:700,mediaType:Yr.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`${D.t(`media.${Yr.VIDEO}.abstract`)}`}}handleMediaError(e,r,i){const o=e.addCustom("video-resizer",()=>new MA(e)),s=e.getBlockById(i);o.disableBlockResize(s)}updateMediaElement(e,r,i,o){const s=r.querySelector(":scope .video-container > video");p(Wtt,s,"The media element not exist"),s.src!==o&&(s.src=o),i.width?s.style.width=`${i.width}px`:s.style.width="";const l=e.getBlockById(i.id);return setTimeout(()=>{e.addCustom("video-resizer",()=>new MA(e)).updateResizer(l)}),s}}const Xtt=new qtt,jS=[AE,kE,RE,Hk],UA=[_S,YJ,itt,htt,btt,p$,Itt,Xtt,ztt,lW,uS,$Y],zS=[nR,hS,N4];function Ytt(n,t,e){var i,o,s,l;si.level=(i=e.logLevel)!=null?i:Us.DEBUG;const r=Su(n,t,{components:{blocks:[...jS,...((o=e==null?void 0:e.components)==null?void 0:o.blocks)||[]],embeds:[...UA,...((s=e.components)==null?void 0:s.embeds)||[]],boxes:[...zS,...((l=e.components)==null?void 0:l.boxes)||[]],textRenders:[new nE],options:{...e.componentsOptions}}});return r.readonly=!0,r.addCustom("heading-collapse",()=>new AA(r)),r.addCustom("editor-tooltip",()=>new O0(r)),r.addListener("clickLink",(c,d,h)=>{var E;if((E=e==null?void 0:e.events)!=null&&E.onClickLink){e.events.onClickLink(c,d,h);return}const C=h.getAttribute("link");C&&(c.readonly||d.ctrlKey||d.metaKey)&&window.open(C,"_blank")}),r}class GS{constructor(t){this.createOptions=t,t.lang&&D.setLang(t.lang)}createHistoryEditor(t,e){return Ytt(t,e,this.createOptions)}}I("create-editor");function WS(n,{root:t,childDoc:e,doc:r}){var h,C;e.uploadResource=r.uploadResource.bind(r),e.buildResourceUrl=r.buildResourceUrl.bind(r);const i=n.getComponentOptions("comment"),o={image:{defaultAlign:"left"},table:{locatingContainer:t,hideCellMenu:!0,hideToolbar:!0},...i==null?void 0:i.componentsOptions},s=[];n.editorBlocks.forEach(E=>{E.blockType==="text"||E.blockType==="embed"||s.push(E)});const l=[];n.editorEmbeds.forEach(E=>{l.push(E)});const c=[];n.editorBoxes.forEach(E=>{E.boxType==="text"||E.boxType==="br"||E.boxType==="image"||E.boxType==="anchor"||c.push(E)});const d=Su(t,e,{shortcuts:[Fh],components:{blocks:s,commandProviders:[new p0],decorators:[new H0],embeds:l,boxes:c,options:o}});if(d.input.addHandler(new z0),d.input.addHandler(new GE(d)),d.input.addHandler(new JE(d)),d.input.addHandler(new JX(d)),d.input.addHandler(new X0),d.addCustom("image-paste-handler",()=>new zE(d)),(h=n.options.componentsOptions)!=null&&h.mention){const E=n.options.componentsOptions.mention;d.addCustom("mention",()=>new dS(d,{...E}))}if((C=n.options.componentsOptions)!=null&&C.comment){const E=n.options.componentsOptions.comment;E.onCommentEditorClick&&d.addListener("click",E.onCommentEditorClick)}return d}function Qtt(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),r=new Set;e.forEach(i=>{const o=J(i);o&&r.add(o)}),r.forEach(i=>{ZX(n,i,t)})}class Jtt{constructor(t){m(this,"listeners",new Set);m(this,"doc");this.editor=t,this.doc=this.editor.doc.externalDoc,this.doc.registerCallback(this)}getComments(){return this.doc.getComments()}getComment(t){return this.doc.getComment(t)}getCommentDoc(t){return this.doc.getCommentDoc(t)}localCreateComment(t,e){this.doc.localCreateComment(t,e)}localDeleteComment(t){const e=this.getComment(t);this.doc.localDeleteComment(t);const r=e.groupId;this.getComments().filter(o=>o.groupId===r).length===0&&Qtt(this.editor,r)}localUpdateComment(t,e){this.doc.localUpdateComment(t,e)}onCreateComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onCreateComment(t,e))}onDeleteComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onDeleteComment(t,e))}onUpdateComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onUpdateComment(t,e))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}createCommentEditor(t,e){return WS(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class Ztt{constructor(t,e){m(this,"listeners",new Set);this.editor=t,this.localDoc=e}get doc(){return this.localDoc.toJSON()}getComments(){return Object.values(this.doc.comments)}getComment(t){return this.doc.comments[t]}getCommentDoc(t){const e=this.doc.comments[t];return Zp(e)}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}localCreateComment(t,e){}localDeleteComment(t){}localUpdateComment(t,e){}createCommentEditor(t,e){return WS(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const tet={placeholder:{common:{title:"\u8BF7\u8F93\u5165\u6807\u9898",readonlyTitle:"\u8BF7\u8F93\u5165\u6807\u9898",content:"\u70B9\u51FB + \uFF0C\u6216\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6",contentInTable:"\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6"},local:{readonlyTitle:"\u672A\u547D\u540D"}},copyCutProperty:{copy:"\u590D\u5236",cut:"\u526A\u5207",unsafeEnvTips:"\u7531\u4E8E\u5F53\u524D http \u8BBF\u95EE\u73AF\u5883\u4E0B\u7684\u9650\u5236\uFF0C\u8BF7\u4F7F\u7528\u5FEB\u6377\u952E({shortCut}) {operation}",limitedEnvTips:"\u7531\u4E8E\u6D4F\u89C8\u5668\u9650\u5236\uFF0C\u8BF7\u4F7F\u7528 {shortCut} \u7C98\u8D34"}},eet={placeholder:{common:{title:"Enter a title",readonlyTitle:"Enter a title",content:'Click "+", or enter "/" to insert components quickly',contentInTable:'Enter "/" to insert components quickly'},local:{readonlyTitle:"Untitled"}},copyCutProperty:{copy:"Copy",cut:"Cut",unsafeEnvTips:"Due to the limitations of the current http access environment, please use the shortcut ({shortCut}) {operation}",limitedEnvTips:"Press {shortCut} to paste due to browser restrictions"}},net={placeholder:{common:{title:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",readonlyTitle:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",content:"\u300C+\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u304B\u3001\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059",contentInTable:"\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059"},local:{readonlyTitle:"\u7121\u984C"}},copyCutProperty:{copy:"\u8907\u88FD",cut:"\u5207\u308B",unsafeEnvTips:"HTTP\u74B0\u5883\u306E\u5236\u7D04\u306B\u3088\u308A\u3001{operation}\u3059\u308B\u306B\u306F\u3001\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8({shortCut}) \u3092\u3054\u4F7F\u7528\u304F\u3060\u3055\u3044",limitedEnvTips:"\u30D6\u30E9\u30A6\u30B6\u30FC\u306E\u5236\u9650\u306B\u3088\u308A\u3001\u300C{shortCut}\u300D\u3092\u4F7F\u7528\u3057\u3066\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044"}};D.mergeLang({"zh-CN":tet,"en-US":eet,"ja-JP":net});const ret="UEsDBBQABgAIAAAAIQBk9WPugQEAACkGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ABQABgAIAAAAIQA520VMuQUAACdaAAASAAAAAAAAAAAAAAAAADYcAAB3b3JkL251bWJlcmluZy54bWxQSwECLQAUAAYACAAAACEA+JXI7/wOAADzmQAADwAAAAAAAAAAAAAAAAAfIgAAd29yZC9zdHlsZXMueG1sUEsBAi0AFAAGAAgAAAAhAMySUFR9AQAA8QIAABEAAAAAAAAAAAAAAAAASDEAAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhACJREfHVAQAA3gMAABAAAAAAAAAAAAAAAAAA/DMAAGRvY1Byb3BzL2FwcC54bWxQSwECLQAUAAYACAAAACEAiD+lv+EAAABVAQAAGAAAAAAAAAAAAAAAAAAHNwAAY3VzdG9tWG1sL2l0ZW1Qcm9wczEueG1sUEsBAi0AFAAGAAgAAAAhAMEnywi2AAAAIQEAABMAAAAAAAAAAAAAAAAARjgAAGN1c3RvbVhtbC9pdGVtMS54bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAABVOQAAY3VzdG9tWG1sL19yZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAOuAYExTAwAAjw4AABIAAAAAAAAAAAAAAAAAWzsAAHdvcmQvZm9udFRhYmxlLnhtbFBLBQYAAAAADwAPANQDAADePgAAAAA=",iet=()=>jg(ret),oet=I("image-to-docx");async function set(n){return new Promise((t,e)=>{const r=new Image;r.onload=()=>{t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=e,r.src=n})}async function qS(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};try{const e=await ma(new File([t],"",{})),r=await set(e);return r.width===void 0||r.height===void 0?{width:345,height:230,buffer:t}:n.width||n.height?{width:n.width||r.width*n.height/r.height,height:n.height||r.height*n.width/r.width,buffer:t}:{width:r.width,height:r.height,buffer:t}}catch(e){oet.error(e);return}}function aet(n,t){let e=n.filter(s=>s!=null);const r=t-(e.length-1)*20,i=.87,o=e.reduce((s,l)=>s+l.width,0);return o>r&&(e=e.map(s=>({width:s.width*r/o,height:s.height*r/o,buffer:s.buffer}))),e.map(s=>({width:s.width*i,height:s.height*i,buffer:s.buffer}))}function cet(n,t,e){if(!e||typeof e!="object")return;const r=e,i=n.filter(s=>s!=null),o=t-(i.length-1)*20;i.forEach((s,l)=>{if(i.length===1&&r.widthPercent){const d=r.widthPercent,h=s.width;s.width=o*(d/100),s.height*=s.width/h;return}const c=`${l}_flex`;if(r[c]){const d=r[c],h=s.width;s.width=o*d,s.height*=s.width/h}})}function XS(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let r;switch(e%3){case 0:r=Ct.LevelFormat.DECIMAL;break;case 1:r=Ct.LevelFormat.LOWER_LETTER;break;default:r=Ct.LevelFormat.LOWER_ROMAN;break}return{level:e,format:r,text:`%${e+1}. `,alignment:Ct.AlignmentType.START,start:t,style:{paragraph:{indent:{left:Ct.convertInchesToTwip(.3*(e+1)),hanging:Ct.convertInchesToTwip(.2)}}}}})}function uet(){return[0,1,2,3,4,5,6,7].map(n=>{let t;switch(n%3){case 0:t="\u2022";break;case 1:t="\u25E6";break;default:t="\u25AA";break}return{level:n,format:Ct.LevelFormat.BULLET,text:t,alignment:Ct.AlignmentType.START,style:{paragraph:{indent:{left:Ct.convertInchesToTwip(.3*(n+1)),hanging:Ct.convertInchesToTwip(.2)}}}}})}function fet(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Ct.LevelFormat.BULLET,text:"\u2611",alignment:Ct.AlignmentType.START,style:{paragraph:{indent:{left:Ct.convertInchesToTwip(.3*(n+1)),hanging:Ct.convertInchesToTwip(.2)}}}}))}function det(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Ct.LevelFormat.BULLET,text:"\u2610",alignment:Ct.AlignmentType.START,style:{paragraph:{indent:{left:Ct.convertInchesToTwip(.3*(n+1)),hanging:Ct.convertInchesToTwip(.2)}}}}))}var Nf=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(Nf||{});const het=[{levels:XS(),reference:"number-numbering-reference"},{levels:uet(),reference:"number-bullet-reference"},{levels:fet(),reference:"checked-bullet-reference"},{levels:det(),reference:"unchecked-bullet-reference"}];function met(n){switch(n){case"style-color-0":return"d83931";case"style-color-1":return"de7802";case"style-color-2":return"dc9b04";case"style-color-3":return"2ea121";case"style-color-4":return"245bdb";case"style-color-5":return"6425d0";case"style-color-6":return"8f959e";default:return}}function get(n){switch(n){case"style-bg-color-1":case"style-bg-color-2":case"style-bg-color-8":case"style-bg-color-9":return"yellow";case"style-bg-color-0":case"style-bg-color-5":return"magenta";case"style-bg-color-3":return"green";case"style-bg-color-4":case"style-bg-color-11":return"blue";case"style-bg-color-6":return"lightGray";case"style-bg-color-7":return"red";case"style-bg-color-10":return"darkGreen";case"style-bg-color-12":return"darkMagenta";case"style-bg-color-13":return"darkGray";default:return}}function pet(n){switch(n){case"style-bg-color-0":return"fbbab6";case"style-bg-color-1":return"ffdcb0";case"style-bg-color-2":return"fff7a0";case"style-bg-color-3":return"ceefc5";case"style-bg-color-4":return"d1ddfb";case"style-bg-color-5":return"d9cbf8";case"style-bg-color-6":return"eaeaea";case"style-bg-color-7":return"fe837c";case"style-bg-color-8":return"ffbd6a";case"style-bg-color-9":return"ffe662";case"style-bg-color-10":return"a8f393";case"style-bg-color-11":return"98b5ff";case"style-bg-color-12":return"b394f8";case"style-bg-color-13":return"b1b1b1";default:return}}const Cet=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function YS(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(Cet);if(t){const e=s=>{let l=Number(s).toString(16);return l.length<2&&(l=`0${l}`),l},r=e(t[1]),i=e(t[2]),o=e(t[3]);return`${r}${i}${o}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function an(n,t){if(n&&n.attributes&&n.attributes[t])return n.attributes[t];if(n&&n.attributes&&n.attributes.box&&n.attributes.inputType&&t==="style-underline")return!0}function QS(n,t,e){for(let r=0;r<=e;++r){const i=`${t}${r}`;if(an(n,i))return i}}function Em(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function OA(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function JS(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function Eet(n){const t=an(n,"inlineStyle");if(t==null)return;const e=t.split(";");for(const r of e){const i=r.split(":");if(i.length!==2)continue;const o=i[0].trim().toLowerCase(),s=i[1].trim().toLowerCase();o==="font-size"&&Em(n,"inline-style-font-size",s),o==="color"&&Em(n,"inline-style-color",s),o==="background-color"&&Em(n,"inline-style-background-color",s),o==="font-family"&&Em(n,"inline-style-font-family",s)}}function Aet(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function xet(n){const t=`${an(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function bet(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` ${n.attributes.text} `;if(n.attributes&&n.attributes.box&&n.attributes.inputType)return n.attributes.value?`${n.attributes.value}`:" "}function vet(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function Bet(n){return an(n,"inline-style-font-family")}function Tet(n){const t=an(n,"inline-style-background-color");return YS(t)}function yet(n){const t=an(n,"inline-style-color");return YS(t)}function ket(n){Eet(n);const t=an(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!an(n,"style-code"),link:JS(an(n,"link")),size:xet(n),text:t?vet(n):bet(n)||n.insert,bold:!!an(n,"style-bold"),underline:!!an(n,"style-underline"),italics:!!an(n,"style-italic"),strike:!!an(n,"style-strikethrough"),superScript:!!an(n,"style-super"),subScript:!!an(n,"style-sub"),math:an(n,"type")==="math"?an(n,"src"):void 0,mention:t,fontFamily:Bet(n),background:Tet(n),color:t?"338fe5":met(QS(n,"style-color-",6))||yet(n),highlight:QS(n,"style-bg-color-",13)}}function Ret(){return[new Ct.Paragraph({border:{top:{color:"auto",style:Ct.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new Ct.Paragraph({spacing:{line:0}})]}function wet(){return new Ct.Paragraph({children:[new Ct.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Ct.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function Let(){return new Ct.Paragraph({children:[new Ct.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Ct.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function Iet(n,t){return new Ct.Paragraph({children:[new Ct.ExternalHyperlink({children:[new Ct.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function ZS(n){if(n.heading!=null)return`Heading${n.heading}`}function tL(n){if(n.alignment!=null){if(n.alignment==="center")return Ct.AlignmentType.CENTER;if(n.alignment==="right")return Ct.AlignmentType.RIGHT;if(n.alignment==="left")return Ct.AlignmentType.LEFT}}function Det(n){if(n.indent)return{left:Ct.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Ct.convertInchesToTwip(.3*n.padding)}}function _et(n){return{type:Ct.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function Met(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function eL(n,t){let e;e=n.inlineCode?"InlineCode":void 0,e=n.link?"Hyperlink":e;const r=n.size||t,i=r!=null?Math.floor(r*1.5+.5):void 0;return new Ct.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:Ct.UnderlineType.SINGLE}:void 0,italics:n.italics||void 0,strike:n.strike||void 0,superScript:n.superScript||void 0,subScript:n.subScript||void 0,size:i,style:e,font:n.fontFamily?Met(n.fontFamily):void 0,shading:n.background?_et(n.background):void 0,color:n.color,highlight:get(n.highlight)})}function Uet(n,t){if(n.link)return new Ct.ExternalHyperlink({children:[eL(n,t)],link:n.link})}async function nL(n,t,e,r,i){const[o]=await i(n,t,e);if(o==null)return;const s=await qS({width:r||0,height:0,src:e},o);return new Ct.ImageRun({data:o,transformation:{width:(s==null?void 0:s.width)||100,height:(s==null?void 0:s.height)||20}})}function Oet(n){if(n.heading||n.heading)return n.heading}function Net(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function Pet(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function Fet(n,t){var r;const e=[];if(n.text&&Array.isArray(n.text)){for(let i=0;i<n.text.length;i++){const o=n.text[i];if(((r=o.attributes)==null?void 0:r.box)===!0&&t){const s=await t(o);if(s){n.text.splice(i+1,0,...s);continue}}e.push(ket(o))}return e}}function Ket(n){if(n.type==="list"&&n.textOnly!==!0)return{checkbox:n.checkbox,groupId:n.groupId,ordered:!!n.ordered,level:n.level||1,start:n.start||0}}function Vet(n,t){if(n.type==="embed"&&n.embedType&&OA(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(r=>{const i=t(r),o=n.embedData[`${i}_width`],s=n.embedData[`${i}_height`];return{src:r,width:o,height:s}})}function $et(n){if(n.padding)return n.padding}function Het(n){return!!(n.type==="embed"&&n.embedType&&OA(n.embedType)&&n.embedData&&n.embedData.src)}async function Am(n,t,e){return{quoted:!!n.quoted,heading:Oet(n),alignment:Net(n),indent:Pet(n),padding:$et(n),texts:await Fet(n,e),list:Ket(n),images:Vet(n,t),border:Het(n)}}async function jet(n,t,e,r){const i=[];if(!n.children)return[];for(const o of n.children){const s=[];for(const l of t.blocks[o])s.push(await Am(l,e,r));i.push(s)}return i}const zet=I("to-docx");function Get(n,t){return Array(n).fill(0).map(()=>Array(t).fill(0).map(()=>({cellId:void 0,color:void 0,from:void 0,rowSpan:1,colSpan:1,width:0,originalWidth:void 0,align:void 0})))}function Wet(n,t,e,r){const i=!!n.hasColTitle,o=!!n.hasRowTitle,s=!!n.isStripeStyle,l="F5F8FB";for(let c=0;c<t;c++)for(let d=0;d<e;d++)(i&&d===0||o&&c===0||s&&c%2===1)&&(r[c][d].color=l)}function qet(n){p(zet,n.children,"no table children");const t=n.rows,e=n.cols,r=n.colsWidth;if(r)for(let s=0;s<r.length;s++)r[s]===0&&(r[s]=100);const i=Get(t,e);let o=0;for(let s=0;s<t;++s)for(let l=0;l<e;++l){if(i[s][l].originalWidth=r?r[l]:void 0,i[s][l].from!==void 0)continue;const c=n.children[o];o+=1,i[s][l].cellId=c,i[s][l].color=pet(n[`${c}_background`]),i[s][l].width=r?r[l]:100,i[s][l].align=n[`${c}_align`];const d=n[`${c}_rowSpan`]||1,h=n[`${c}_colSpan`]||1;if(i[s][l].rowSpan=d,i[s][l].colSpan=h,d>1||h>1){let C=0;for(let E=0;E<d;E++)for(let A=0;A<h;A++)E===0&&(C+=r?r[l+A]:80),!(E===0&&A===0)&&(i[s+E][l+A].from=[s,l]);i[s][l].width=C}}return Wet(n,t,e,i),i}async function Xet(n,t,e,r,i,o,s,l,c,d){async function h(A){if(l){const v=await l(i,o,A);if(v){await r.addDoc(n,v,d);return}}if(A.type==="text"||A.textOnly===!0){const v=await Am(A,s,c);await r.addTextBlock(v);return}if(A.type==="code"){const v=await jet(A,e,s,c);await r.addCodeBlockObject(v);return}if(A.type==="list"&&A.textOnly!==!0){const v=await Am(A,s,c);await r.addListBlockObject(n,v);return}if(A.type==="embed"&&A.embedType){const v=A,k=v.embedData,L=v.embedType;if(OA(L)){const M=await Am(A,s,c);await r.addImagesBlockObject(A,M,d)}else A.embedType==="hr"?r.addSeparatorBlock():A.embedType==="video"?r.addVideoPlaceholder():A.embedType==="audio"?r.addAudioPlaceholder():A.embedType==="webpage"?r.addHyperlinkParagraph(JS(k.src),k.title):r.addOtherEmbedBlock(L,A.embedData);return}if(A.type==="table"){let v=[];if(A.colsWidth)v=A.colsWidth;else{const L=A.cols;v=new Array(L);for(let M=0;M<v.length;M++)v[M]=100;A.colsWidth=v}const k=qet(A);await r.addTableMatrix(v,k,e),r.addEmptyParagraph()}}function C(A){const v=[];for(const{type:k,data:L}of A.embedData.exportSpec){if(k==="text"){const M={id:tt(),text:[{insert:L}],type:"text"};v.push(M);continue}if(k==="image"){const M={id:tt(),type:"embed",embedType:"image",align:"left",embedData:{src:L}};v.push(M);continue}if(k==="link"){const M={id:tt(),type:"embed",embedType:"webpage",embedData:{src:L.url,title:L.title}};v.push(M);continue}}return v}function E(A){var v;return(v=A==null?void 0:A.embedData)!=null&&v.exportSpec?C(A):[A]}for(const A of t)for(const v of E(A))await h(v)}function Yet(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const Qet=I("to-docx");class Jet{constructor(t,e,r,i,o,s){m(this,"paragraphs");this.appId=t,this.docId=e,this.state=r,this.readImageFunc=i,this.convertBlocksFunc=o,this.defaultFontSize=s,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new Ct.Paragraph({heading:ZS(t),alignment:tL(t),children:await this.paragraphsFromBlockTexts(t),indent:Det(t)}))}async addEmptyImagePlaceHolder(){this.paragraphs.push(new Ct.Paragraph({text:`[${D.t("docx.imageExportFailed")}]`,shading:{type:Ct.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=Aet(this.defaultFontSize,t.heading),r=[];for(const i of t.texts){if(i.link){const o=Uet(i,e);o&&r.push(o);continue}if(i.box&&i.box.type&&i.box.type==="br"){r.push(new Ct.TextRun({text:"",break:1}));continue}if(i.box&&i.box.type&&i.box.type==="image"){const o=await nL(this.appId,this.docId,i.box.src,i.box.width,this.readImageFunc);o&&r.push(o);continue}if(i.math){const o=await nL(this.appId,this.docId,i.math,0,this.readImageFunc);o&&r.push(o);continue}r.push(eL(i,e))}return r}async addCodeBlockObject(t){for(const e of t)for(const r of e){const i={style:Ct.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Ct.Paragraph({style:"Code",border:{left:{...i},right:{...i},top:{...i},bottom:{...i}},children:await this.paragraphsFromBlockTexts(r)}))}}async addListBlockObject(t,e){if(e.list==null)return;let r;const i=e.list.checkbox?`${t}-${e.list.groupId}-${e.list.checkbox}`:`${t}-${e.list.groupId}`;if(this.state.listInstMap[i])r=this.state.listInstMap[i];else if(r=this.state.listMaxInst,this.state.listMaxInst+=1,this.state.listInstMap[i]=r,e.list.start>0&&e.list.ordered){const s=`number-numbering-reference-${r}`,l=XS([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:s,inst:r}),this.state.listRefMap[i]=s}else e.list.ordered?this.state.listRefMap[i]=Nf.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[i]=Nf.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[i]=Nf.UNCHECKED:this.state.listRefMap[i]=Nf.BULLET;const o=ZS(e);e.texts&&this.paragraphs.push(new Ct.Paragraph({heading:o,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[i],level:e.list.level-1,instance:r}}))}imageDimWithBufferToImageRun(t){return new Ct.ImageRun({data:t.buffer,transformation:{width:t.width,height:t.height}})}async addImagesBlockObject(t,e,r){if(e.images==null){if(t.type==="embed"&&t.embedType==="image"){const{src:c}=t.embedData;c||this.addEmptyImagePlaceHolder()}return}const i=[],o=await Promise.all(e.images.map(async c=>{const[d,h]=await this.readImageFunc(this.appId,this.docId,c.src);if(d){const C=await qS(c,d);if(C)return C}i.push(h)}));cet(o,r,t.embedData);const s=aet(o,r),l={style:Ct.BorderStyle.SINGLE,color:"#DEDEDE"};s.length&&this.paragraphs.push(new Ct.Paragraph({border:e.border?{left:{...l},right:{...l},top:{...l},bottom:{...l}}:void 0,alignment:tL(e)||Ct.AlignmentType.CENTER,children:s.map(c=>this.imageDimWithBufferToImageRun(c)).flatMap((c,d,h)=>c==null?[]:h.length-1!==d?[c,new Ct.TextRun({text:" "})]:c)})),i.forEach(c=>{this.addHyperlinkParagraph(c)})}addSeparatorBlock(){Ret().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Ct.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(wet())}addAudioPlaceholder(){this.paragraphs.push(Let())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(Iet(t,e))}async addTableMatrix(t,e,r){const i=t.map(o=>o!==0?o*15:1500);this.paragraphs.push(new Ct.Table({rows:await this.generateTableRows(e,r),columnWidths:i}))}async generateRowCells(t,e){const r=[];for(const i of t){const o=i.cellId;if(o===void 0)continue;const s=i.width*.9;r.push(new Ct.TableCell({children:await this.convertBlocksFunc(o,e.blocks[o],e,this.appId,this.docId,this.state,s),columnSpan:i.colSpan,rowSpan:i.rowSpan,width:{type:Ct.WidthType.DXA,size:i.width*15},shading:i.color?{fill:i.color,type:Ct.ShadingType.CLEAR,color:"auto"}:void 0}))}return r}async generateTableRows(t,e){const r=[];for(const i of t)r.push(new Ct.TableRow({children:await this.generateRowCells(i,e)}));return r}async addDoc(t,e,r){const i=await this.convertBlocksFunc(t,e.blocks.root,e,this.appId,this.docId,this.state,r);i&&(this.paragraphs=this.paragraphs.concat(i))}async addOtherEmbedBlock(){}}class Zet{constructor(t,e,r,i,o,s,l,c){m(this,"convertBlocks",async(t,e,r,i,o,s,l=720)=>{const c=new Jet(i,o,s,this.readImage,this.convertBlocks,this.defaultFontSize);return await Xet(t,e,r,c,i,o,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),c.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=r,this.readImage=i,this.defaultFontSize=o,this.getDocByBlock=s,this.getTextsByBox=l,this.backgroundImageOptions=c}async convert(t,e){return this.snapshot2docx(this.docData,t,e)}async snapshot2docx(t,e,r){const i=new Ct.ImportDotx,o=this.templateData?await i.extract(this.templateData):void 0,s=t.blocks.root;p(Qet,s,"data must have blocks");const l=Yet(),c=await this.convertBlocks("blocks",s,t,e,r,l),d=this.backgroundImageOptions?{default:new Ct.Header({children:[new Ct.Paragraph({children:[new Ct.ImageRun(this.backgroundImageOptions)]})]})}:{},h=new Ct.Document({numbering:{config:[...het,...l.levelConfigs]},sections:[{headers:d,children:c,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:o});return Ct.Packer.toBlob(h)}}async function tnt(n,t,e,r){const i=n.doc.buildResourceUrl(r,{withToken:!0});let o=await xS(i);if(!o)return[void 0,i];if(o.type.indexOf("/svg")!==-1){const l=await CS(o);l&&(o=new File([l],o.name))}return[await o.arrayBuffer(),i]}async function ent(n,t,e){const r=n.editorBlocks.getBlockClass(e.type);if(r.toStandardDoc)return r.toStandardDoc(n,e,t)}async function nnt(n,t){const e=t.attributes,r=n.editorBoxes.getBoxClass(e.type);if(r.toStandardText)return r.toStandardText(n,e)}async function rnt(n,t){let{template:e,download:r,backgroundImageOptions:i}=t!=null?t:{};e||(e=iet());const o=n.doc.toJSON(),s=(C,E,A)=>tnt(n,C,E,A),l=async(C,E,A)=>ent(n,o,A),c=async C=>nnt(n,C),h=await new Zet(e,o,Md.default,s,void 0,l,c,i).convert("_appId","_docId");if(r){const C=URL.createObjectURL(h),E=document.createElement("a");E.setAttribute("download",`${AS(n)}.docx`),E.setAttribute("href",`${C}`),E.click(),E.remove()}return h}const NA=I("create-editor");async function int(n,t){var s,l,c,d,h,C,E,A,v,k,L,M,U,F;p(NA,n,"app does not exists"),t.lang&&D.setLang(t.lang),si.level=(s=t.logLevel)!=null?s:Us.DEBUG;const e=t.onReauth?async()=>{var st;const G=t.user.userId,q=t.docId,it=await((st=t.onReauth)==null?void 0:st.call(t,G,q,t.permission));return{userId:G,docId:q,permission:t.permission,appId:t.appId,token:it,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl}}:void 0,r={auth:{appId:t.appId,docId:t.docId,userId:t.user.userId,permission:t.permission,token:t.token,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl},serverUrl:t.serverUrl,reauthFunc:e,disableLogout:t.disableLogout},i=await Hu.load(r),o=Su(n,i,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,enableComments:t==null?void 0:t.enableComments,components:{blocks:[...jS,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...UA,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[...zS,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new p0,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new H0,new eC],insertions:[tp],blockHooks:[new KE,new fw,...((C=t.components)==null?void 0:C.blockHooks)||[]],textRenders:[new S4,new nE],options:{...t.componentsOptions}},shortcuts:[uY,Fj,QG,xE,t4,nV,mE,qY,Fh,XK,...t.shortcuts||[]],colors:["#0064FF","#EB3723","#F59300","#00A865","#F25A0A","#70A310","#009CAD","#0990D9","#8851ED","#D62069"]});if(o.editorCommandProviders.registerCommandProvider(new Si(o)),o.input.addHandler(new NQ),o.input.addHandler(new z0),o.input.addHandler(new b$),o.input.addHandler(new HG),o.input.addHandler(new wE(o,{hideTitle:t.hideTitle,headingLevel:1,titlePlaceholder:D.t("placeholder.common.title"),contentPlaceholder:D.t("placeholder.common.content"),readonlyTitlePlaceholder:D.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),o.input.addHandler(new U0(o,(E=t.componentsOptions)==null?void 0:E.quickMenu)),o.input.addHandler(new GE(o)),o.input.addHandler(new JE(o)),o.input.addHandler(new X0),o.doc.registerCallback(new PQ(o)),o.addCustom("remote-cursor",()=>new By(o)),o.addCustom("block-menu",G=>new mw(G)),ce.isMobile||o.addCustom("editor-tooltip",()=>new O0(o)),t!=null&&t.enableComments&&o.addCustom("editor-comments",G=>new w4(G,new Jtt(G))),t.enableContextMenu!==!1&&o.addCustom("editor-context-menu",G=>new i4(G)),o.addCustom("create-options",()=>new Fb(o,t)),o.addCustom("drop-target",()=>new Tf(o)),o.addCustom("list-to-mindmap",()=>new S0(o)),o.addCustom("list-to-mention",()=>new oJ(o)),o.addCustom("mobile-helper",()=>new wJ(o)),o.addCustom("code-caret",()=>new Uj(o)),o.addCustom("image-paste-handler",()=>new zE(o)),(A=t.componentsOptions)!=null&&A.mention){const G=t.componentsOptions.mention;o.addCustom("mention",()=>new dS(o,G))}if(o.addCustom("heading-collapse",()=>new AA(o)),o.addCustom(pm,G=>new yA(G)),Za.register(o),Tf.register(o),Es.register(o),ds.register(o),o.addListener("clickLink",(G,q,it)=>{var Et;if((Et=t==null?void 0:t.events)!=null&&Et.onClickLink){t.events.onClickLink(G,q,it);return}const st=it.getAttribute("link");st&&(G.readonly||q.ctrlKey||q.metaKey)&&window.open(st,"_blank")}),(k=(v=t.componentsOptions)==null?void 0:v.remoteCarets)!=null&&k.onUserChanged){const G=(M=(L=t.componentsOptions)==null?void 0:L.remoteCarets)==null?void 0:M.onUserChanged;o.doc.getRemoteUsers().on("change",q=>{G(o,q)})}return(F=(U=t.componentsOptions)==null?void 0:U.templates)!=null&&F.templates.length&&(o.addListener("docChanged",()=>{gm(o)}),o.addListener("resize",()=>{gm(o,{reset:!0})}),setTimeout(()=>{gm(o)},100)),o.doc.registerCallback({onError:async G=>{if(G.code==="ResetDoc"){NA.error(`reset doc: ${G.message}`);const q=await Hu.load(r);o.doc.reset(q)}}}),o.version="1.1.14",o}function ont(n){return n.toJSON!==void 0}async function snt(n,t,e){var o,s,l,c,d,h;p(NA,n,"app does not exists");const r=ont(t)?t:new _p(t,{serverUrl:e.serverUrl||""});e.lang&&D.setLang(e.lang),si.level=(o=e.logLevel)!=null?o:Us.DEBUG;const i=Su(n,r,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[AE,kE,RE,Hk],commandProviders:[new p0],decorators:[new H0,new eC],embeds:[...UA,...((s=e.components)==null?void 0:s.embeds)||[]],boxes:[nR,hS,N4,...((l=e.components)==null?void 0:l.boxes)||[]],insertions:[tp],blockHooks:[new KE,...((c=e.components)==null?void 0:c.blockHooks)||[]],textRenders:[new S4,new nE,...((d=e.components)==null?void 0:d.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[xE,t4,mE,Fh]});return i.editorCommandProviders.registerCommandProvider(new Si(i)),i.input.addHandler(new z0),i.input.addHandler(new wE(i,{hideTitle:e.hideTitle,headingLevel:1,titlePlaceholder:D.t("placeholder.common.title"),contentPlaceholder:D.t("placeholder.common.content"),readonlyTitlePlaceholder:D.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new U0(i,(h=e.componentsOptions)==null?void 0:h.quickMenu)),i.input.addHandler(new GE(i)),i.input.addHandler(new JE(i)),i.input.addHandler(new X0),i.addCustom("block-menu",C=>new mw(C)),ce.isMobile||i.addCustom("editor-tooltip",()=>new O0(i)),i.addCustom("image-paste-handler",()=>new zE(i)),e!=null&&e.enableComments&&i.addCustom("editor-comments",C=>new w4(C,new Ztt(C,r))),e.enableContextMenu!==!1&&i.addCustom("editor-context-menu",C=>new i4(C)),i.addCustom("heading-collapse",()=>new AA(i)),i.addListener("clickLink",(C,E,A)=>{var k;if((k=e==null?void 0:e.events)!=null&&k.onClickLink){e.events.onClickLink(C,E,A);return}const v=A.getAttribute("link");v&&(C.readonly||E.ctrlKey||E.metaKey)&&window.open(v,"_blank")}),i.addCustom(pm,C=>new yA(C)),Za.register(i),i.version="1.1.14",i}async function lnt(n,t,e){var h;const r=n.doc.externalDoc.client.auth,i=await Yh.load({auth:r,serverUrl:e});if(!((h=i.getVersionHelper)==null?void 0:h.call(i)))throw new Error("the editor does not support to show versions");const s=n.getCustom("create-options");if(!s)throw new Error("the editor does not support to show versions");const l=s.getData(),c=new GS(l),d=n.addCustom("version-dialog",()=>new Z4(i,c));return d.show(t),d}b.tippy=d9,b.AnchorBox=$B,b.AuthError=Vu,b.AuthHeader=ll,b.AutoScroll=Xd,b.BaseURLHeader=Oa,b.BasicCommands=HV,b.BlockExclusiveHook=fw,b.BlockLockerHook=KE,b.BlockLockerPasteHandler=X0,b.BlockResizer=mf,b.BrBox=PB,b.CodeBlock=kE,b.CodeLineBlock=RE,b.CodeTextDecorator=H0,b.DOC_RE_AUTH_KEYS=pm,b.DefaultShortcuts=Fh,b.DocIdError=PN,b.DocReAuthCallbacks=yA,b.DragDrop=rv,b.DrawioEmbed=_S,b.EditorBlocks=m3,b.EditorBoxes=KB,b.EditorCommandProviders=NT,b.EditorComplexBlockPosition=Or,b.EditorComplexSelectionRange=hi,b.EditorDecorators=GB,b.EditorEmbeds=p3,b.EditorInsertions=zB,b.EditorSimpleBlockPosition=Ye,b.EditorSimpleSelectionRange=nn,b.EmbedBlock=E3,b.EmbedBlockResizer=Df,b.EnforceWithDocumentTitleHandler=wE,b.EventCallbacks=ua,b.FILL_CHAR=cM,b.FileExtError=FN,b.GroupOrder=qk,b.HeadingBlockScrollListener=JQ,b.ImageBox=VB,b.InlineBoxCommandProvider=rR,b.InputtingInsertion=HB,b.LocalDoc=_p,b.LogLevel=Us,b.Logger=si,b.MIN_DISTANCE_THRESHOLD=ev,b.ManualCloseDialog=Gu,b.ManualMenu=ns,b.ManualToolbar=zu,b.MarkdownInputHandler=z0,b.MaxUserError=Gp,b.Mindmap=w0,b.OnesEditorAutoSuggest=BC,b.OnesEditorCustomDataWrapper=Fb,b.OnesEditorExclusiveBlock=ds,b.OnesEditorHoveringBlock=Be,b.OnesEditorIcons=TP,b.OnesEditorQuickMenu=U0,b.OnesEditorToc=Uf,b.OnesEditorTocProvider=Es,b.OnesEditorToolbar=Za,b.OnesEditorTooltip=O0,b.OnesEditorVersionsDialog=Z4,b.PermissionError=Xh,b.Popup=ju,b.ReAuthToolbar=bS,b.RemoteCarets=By,b.RemoteCaretsDecorator=eC,b.RemoteCaretsInsertion=tp,b.RemoteUsers=Lu,b.RequestReloadError=$u,b.RichText=gn,b.ShareDBDoc=Hu,b.ShareDBDocVersionsProvider=GS,b.ShareDBServer=Yh,b.SimpleCache=Wb,b.StandardEmbedBlockCommands=uA,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=_1,b.TEXT_STYLE_COLOR_PREFIX=D1,b.TableBlock=AE,b.TableBlockCommandProvider=p0,b.TableShortcuts=xE,b.TextBlock=On,b.TextBox=NB,b.TextColorItem=K2,b.TextStyleShortcuts=mE,b.TocEmbed=uS,b.ZERO_WIDTH_SPACE_CHAR=Gc,b.abbreviation=Yd,b.addAttribute=uh,b.addClass=z,b.addCommentToBlock=If,b.addDays=bI,b.addMetaToDoc=Ru,b.addMonths=xI,b.animateScrollTo=Ks,b.applyPlaceholderToBlock=df,b.assert=p,b.autoShowHideTemplates=gm,b.blockToDoc=Rp,b.blockToHtml=rp,b.blockToMarkdown=kh,b.blockToText=yh,b.blocksToDoc=sT,b.clearAllSelection=qv,b.clientType=ce,b.cloneBlock=Xo,b.cloneChildContainer=hp,b.cloneDoc=mp,b.cloneText=wB,b.commentToShareDbComment=tC,b.compareElement=Vd,b.comparePosition=g1,b.complexBlockAdjustSelectionPos=nh,b.complexBlockFindNearestChildBlock=A7,b.complexBlockGeFirstSimpleChild=C1,b.complexBlockGetAllChildContainers=hn,b.complexBlockGetBottomChildContainers=b3,b.complexBlockGetLastSimpleChild=Aa,b.complexBlockGetSelectedContainers=Ea,b.complexBlockGetTopChildContainers=x3,b.containerToDoc=lT,b.continuousScroll=Av,b.convertBlockFrom=th,b.convertImageFileToPng=CS,b.convertImageSrcToPng=vJ,b.converterIntercept=j0,b.copyBlockAttributes=i5,b.copyResourcesFromDoc=Dp,b.createBlockAnchor=Yi,b.createBlockCaretAnchor=B3,b.createBlockContentElement=qs,b.createBlockElement=Fv,b.createBlockSimpleDocRange=xh,b.createBlockSimpleRange=Te,b.createBoxContentElement=$v,b.createBoxElement=Kv,b.createBoxOp=RB,b.createChildContainer=d3,b.createComplexBlockPosition=Ee,b.createComplexDocPos=_B,b.createComplexDocRange=dM,b.createContainer=LB,b.createContainerElement=t1,b.createDeleteOps=BB,b.createEditor=Su,b.createEditorSelectionRange=Qe,b.createElement=B,b.createEmptyContainer=eo,b.createEmptyDoc=to,b.createEmptyTextBlockData=Eh,b.createExpandedRange=Fd,b.createIconButton=Ns,b.createImage=Dg,b.createInsertOps=ph,b.createInsertionContentElement=zv,b.createInsertionElement=Hv,b.createLocalEditor=snt,b.createOnesEditor=int,b.createRange=qb,b.createRichText=rl,b.createRootContainer=f3,b.createSimpleBlockPosition=ct,b.createSimpleDocPos=DB,b.createTextBlockData=Ci,b.createTextButton=pl,b.createTextOp=pr,b.createTextWithReplaceSoftReturn=z1,b.daysAfter=Xg,b.deleteText=W1,b.diffDays=vI,b.disablePageScroll=Gg,b.docToHtml=ZB,b.docToHtmlFragment=xu,b.docToMarkdown=t5,b.docToText=qo,b.downloadImageToFile=xS,b.downloadObjectToFile=wA,b.downloadSvgToString=TS,b.editLink=rf,b.editorAddComment=eY,b.editorAddTextAttribute=g5,b.editorAutoInsertBlock=o5,b.editorBreakTextBlock=wa,b.editorClearCompositionText=lp,b.editorClearSelectedContents=Ih,b.editorCopyBlock=Lp,b.editorCopyDoc=Ph,b.editorDeleteBlock=up,b.editorDeleteBlockText=ap,b.editorDeleteBlockWithoutChildren=Sh,b.editorDeleteChildContainer=cU,b.editorDeleteChildContainers=s5,b.editorFocusToBlock=dp,b.editorFocusToEnd=wU,b.editorGetBlockData=Wo,b.editorGetBlockText=Tn,b.editorGetBlockTextEx=vh,b.editorGetBoxData=UB,b.editorHandleKeyboardEvent=AT,b.editorInsertBlock=Ra,b.editorInsertBoxToBlock=n5,b.editorInsertDoc=h5,b.editorInsertDocAt=gp,b.editorInsertText=sp,b.editorInsertTextToBlock=e5,b.editorInsertTextToBlockEx=op,b.editorMergeTextBlock=l5,b.editorMoveDown=w5,b.editorMoveEnd=vp,b.editorMoveHome=P5,b.editorMoveLeft=y5,b.editorMoveLineEnd=G5,b.editorMoveLineHome=z5,b.editorMovePageDown=J5,b.editorMovePageUp=Q5,b.editorMoveRight=k5,b.editorMoveUp=R5,b.editorMoveWordEnd=U5,b.editorMoveWordLeft=M5,b.editorRangeClearColor=C5,b.editorRangeGetColor=E5,b.editorRangeSetColor=p5,b.editorRemoveTextAttribute=hU,b.editorReplaceBlockText=Dh,b.editorReplaceContainer=m5,b.editorRunOnce=Mp,b.editorSelectAll=Tp,b.editorSelectContainer=Uh,b.editorSelectDown=S5,b.editorSelectEnd=Bp,b.editorSelectHome=F5,b.editorSelectLeft=L5,b.editorSelectLineEnd=j5,b.editorSelectLineHome=H5,b.editorSelectPageDown=eT,b.editorSelectPageUp=tT,b.editorSelectRight=I5,b.editorSelectUp=D5,b.editorSelectWordEnd=N5,b.editorSelectWordLeft=O5,b.editorSetTextColor=Sa,b.editorShowFindDialog=Wq,b.editorToDocx=rnt,b.editorUpdateBlockData=_h,b.editorUpdateCompositionText=r5,b.editorUpdateEmbedData=f5,b.enablePageScroll=Wg,b.escapeHtmlText=Hd,b.escapeRegExp=Zg,b.escapeSpace=rI,b.exclusiveBlock=NE,b.executeBlockCommand=r3,b.executeEmbedBlockCommand=n3,b.executeRangeCommand=OT,b.fileToDataUrl=ma,b.findAfterOffsetNotType=Q1,b.findAllText=yp,b.findBlockByIndex=Lv,b.findEventTargetBlock=Qb,b.findInsertionById=jv,b.findNextOffset=IM,b.findNextVisibleSimpleBlock=VT,b.findPrevOffset=LM,b.findPrevOffsetNotType=Y1,b.findPrevSimpleBlockBeforeChildContainer=A3,b.findPrevVisibleSimpleBlock=KT,b.findTarget=da,b.findWordEnd=Z1,b.findWordLeft=J1,b.format=Zc,b.formatBytes=xv,b.formatDate=Qg,b.fragmentToHtml=mv,b.fromBase64=Xc,b.fromBase64ToBlob=jg,b.fromBase64ToUint8Array=mI,b.fromDocRange=Ho,b.fromNowString=Jg,b.genId=tt,b.getAllChildBlocks=b1,b.getAllQuickMenuItems=hE,b.getAllSelectedBlocks=mi,b.getAttributesAt=Ba,b.getBlockBackground=Pv,b.getBlockByIndex=Ko,b.getBlockCaretRect=Vo,b.getBlockClass=Qt,b.getBlockClassByType=js,b.getBlockClientRects=Wi,b.getBlockCommandsWithHook=c1,b.getBlockContent=Ot,b.getBlockHeading=iu,b.getBlockId=lt,b.getBlockIndex=vt,b.getBlockInfo=Af,b.getBlockKind=_r,b.getBlockMinWidth=Yv,b.getBlockNearestRangeFromPoint=A1,b.getBlockOptions=UI,b.getBlockPath=$o,b.getBlockProperties=Zv,b.getBlockRangeFromPoint=rh,b.getBlockStyles=MI,b.getBlockTextLength=dt,b.getBlockTools=ie,b.getBlockType=Dt,b.getBoxContent=i1,b.getBoxId=Vv,b.getBoxTypeFromElement=ru,b.getChildBlockCount=Dr,b.getChildBlocks=ue,b.getChildOffset=tl,b.getColorFromAttributes=U1,b.getColorFromContent=Qd,b.getComplexBlockClass=fr,b.getContainerBlockPath=a3,b.getContainerBlocks=Wv,b.getContainerBlocksElement=eu,b.getContainerById=ci,b.getContainerId=at,b.getContainerMinWidth=h1,b.getContainerToolsElement=II,b.getContainerWidth=h3,b.getDistanceSquare=Fo,b.getElementOffset=zc,b.getElementScale=ur,b.getEmbedType=qe,b.getExistsBlockTools=Jd,b.getExistsContainerById=tu,b.getFileExt=Jc,b.getFirstChildBlock=Re,b.getFirstClientRect=Kd,b.getHeadingBlockChildren=pa,b.getHeadingMenuOptions=cE,b.getHorizontalPadding=Mg,b.getInsertionContent=o1,b.getLastChildBlock=Me,b.getLastClientRect=Ps,b.getListAllNextBrothers=qa,b.getLogger=I,b.getNextBlock=Jt,b.getNextHiddenBlocks=s3,b.getNextValidOffset=el,b.getNextVisibleBlock=hr,b.getOffsetFromPoint=_g,b.getOffsetInfoAfter=Cu,b.getOffsetInfoBefore=Bh,b.getOpAt=rB,b.getOpLength=ch,b.getParentBlock=J,b.getParentBlockExcludeSelf=Ws,b.getParentBox=r1,b.getParentContainer=rt,b.getPrevBlock=Ue,b.getPrevValidOffset=Go,b.getPrevVisibleBlock=dr,b.getRangeCommands=MT,b.getReferenceClientRect=Ak,b.getRootBlock=a1,b.getScrollContainer=We,b.getSpecialBlockCommands=t3,b.getStandardEmbedBlockProperties=fA,b.getTextAfterOffset=wM,b.getTextAttributes=ip,b.getTextBeforeOffset=SM,b.getTextBlockChild=lu,b.getTextBlockClass=Dv,b.getTextBlockContentChildTextLength=gr,b.getTextBlockContentChildType=l3,b.getTextBlockContentChildren=fi,b.getTextLength=mn,b.getTextOpLength=I1,b.getTextWidth=Gd,b.getToolbar=v0,b.handleBlockElementUpdated=Qv,b.hasAltOnly=cI,b.hasClass=wt,b.hasCtrlOrCmd=cv,b.hasCtrlOrCmdOnly=aI,b.hashCode=Rv,b.hideBlock=Nv,b.htmlToFragment=zd,b.i18n=D,b.includeBigTable=tF,b.injectDocToHtmlFragment=ku,b.injectStyle=tv,b.inputActions=qU,b.insertEmptyBlock=PI,b.insertEmptyEmbedBlock=u1,b.insertText=Zi,b.intersectionCommands=RO,b.isBackspace=fv,b.isBlock=zs,b.isBlockLocked=q0,b.isBlockLockedByOthers=FE,b.isBlockLockedBySelf=xf,b.isBlockTools=Ov,b.isBox=Zd,b.isBoxOp=zo,b.isCJK=lv,b.isChildContainer=Ur,b.isChildNode=re,b.isCodeBlock=Wr,b.isCollapsedHeadingBlock=ui,b.isCollapsedRange=fM,b.isComplexBlockPosition=Ca,b.isComplexKindBlock=Mt,b.isContainer=Gi,b.isContainerSelectedAllChildBlocks=nT,b.isControlEvent=$s,b.isDelete=fI,b.isDraggingFiles=Wd,b.isElementVisible=Pg,b.isEmbedBlock=ge,b.isEmptyContainer=au,b.isEmptyDoc=q1,b.isEmptyTextBlock=fe,b.isEmptyTextBlockWithoutCompositionText=ff,b.isEnterOnly=uv,b.isEscape=$g,b.isExclusiveBlock=Ef,b.isExpandedHeadingBlock=o3,b.isFirefox=qc,b.isFirstChildBlockInComplexBlock=E7,b.isHeadingBlock=Xe,b.isHighSurrogate=Z9,b.isInBlock=s1,b.isInBlockTools=Xs,b.isLetter=sv,b.isLowSurrogate=tI,b.isMatchShortcut=li,b.isMoveForward=sI,b.isNavigationEvent=oI,b.isNavigationKey=av,b.isNodeRemoved=Ug,b.isNumber=ov,b.isPrintableKey=Vg,b.isRootBlock=mr,b.isRootContainer=qt,b.isSafari=ha,b.isSameDay=Yg,b.isSelectBoxOnly=jk,b.isShiftEnter=uI,b.isShiftTab=hI,b.isShortcutEvent=lI,b.isSimpleBlock=_I,b.isSimpleBlockPosition=di,b.isSimplePos=IB,b.isSimpleRange=Ah,b.isSpace=jd,b.isTab=dI,b.isTextBlockContentBoxChild=Yn,b.isTextBlockContentChild=ou,b.isTextBlockContentInsertionChild=Xi,b.isTextBlockContentTextChild=su,b.isTextKindBlock=nt,b.isTextKindBlockType=nu,b.isTitleBlock=zi,b.isToday=bv,b.isValidOffset=Un,b.isVisibleBlock=Gs,b.isYesterday=vv,b.loadJs=Yb,b.loadJsPromise=Fs,b.lockers=Ir,b.mergeCommands=b0,b.mergeDocs=il,b.mergeOps=G1,b.mergeText=lM,b.multiSplitText=oB,b.overflowText=Bv,b.parseShortcut=dv,b.patchNode=Yc,b.pointInRect=Vs,b.rangeAddAttribute=hu,b.rangeGetTextColor=dB,b.rangeRemoveAttribute=va,b.rangeSetTextColor=cB,b.rangeTransformText=lB,b.registerDragDrop=Fg,b.removeAttribute=M1,b.removeClass=ot,b.removeLastBr=rM,b.removePlaceholderFromBlock=NR,b.removeStyle=Zb,b.replaceAll=BI,b.replaceAllCaseInsensitive=TI,b.replaceAllText=iT,b.replaceText=Ch,b.requestDownload=qd,b.resetListStart=Ya,b.scrollIntoView=Au,b.scrollable=Ev,b.selectFile=ga,b.selectedBlockToDoc=Oh,b.selectionToDoc=La,b.setAttributes=$d,b.setClipboardData=Qc,b.setClipboardDataByEvent=CI,b.setColorToAttributes=uB,b.setDataset=Og,b.setDefaultCursor=Wc,b.setStyles=Ng,b.shareDBCommentToDocObject=Zp,b.shareDBDocCommentToComment=by,b.shortcutToDisplayText=Ge,b.showBlock=n1,b.showDocVersions=lnt,b.splitText=_n,b.splitToThree=Je,b.stringToDataUrl=zg,b.stringToObjectUrl=qg,b.subText=sB,b.textNodeOffsetFromPoint=Xb,b.titleFromEditor=AS,b.toBase64URL=ai,b.toMindmap=R0,b.toPlainText=de,b.toPlainTextKeepLength=X1,b.trimChar=Kg,b.unexclusiveBlock=PE,b.unicodeLength=eI,b.unicodeSubstr=nI,b.updateBlockSelection=Xv,b.updateOpAttributes=SB,b.updateTextBlockContent=RM,b.updateUrl=Hg;for(const n in ve)n!=="default"&&!b.hasOwnProperty(n)&&Object.defineProperty(b,n,{enumerable:!0,get:()=>ve[n]});Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
951
+ \`\`\`\`\`\``}return""}const btt={embedType:"plantuml",convertFrom:Ett,handleUpdateBlock:Ctt,createEmbedContent:ptt,getBlockProperties:Att,convertTo:xtt},vut="",vtt="hr",Btt={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},Ttt={dividingLine:{type:"Dividing-Line",abstract:"Dividing-Line"}},ytt={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};D.mergeLang({"zh-CN":Btt,"en-US":Ttt,"ja-JP":ytt});function ktt(n,t){const e=B("div",["editor-embed-container"],t);B("hr",["editor-embed-hr"],e)}function Rtt(n,t,e,r){return r==="html"?"<hr />":r==="markdown"?"---":"------------"}function wtt(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:D.t("dividingLine.type"),icon:r2,order:500,group:"common",subText:yn("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:r}=t;return n.insertEmbed(e,r,vtt,{})}}}function Stt(n,t,e){const{data:r}=e;if(!r||r.embedType!=="dividing-line"||!nt(n,t))return null;const i={};return{blockData:{id:tt(),type:"embed",embedType:"hr",embedData:i}}}function Ltt(){return{abstract:D.t("dividingLine.abstract")}}const Itt={embedType:"hr",createEmbedContent:ktt,convertTo:Rtt,getOptions:wtt,convertFrom:Stt,getBlockProperties:Ltt},But="",Tut="",Dtt={media:{upload:{failed:'<div class="line-1">{name}\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <span class="retry-upload">\u91CD\u8BD5</span></div>',maxSizeFailed:'<div class="line-1">{name}\u4E0A\u4F20\u5931\u8D25</div><div class="line-2">\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u9650\u5236\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6</div>'},load:{failed:'<div class="line-1">{name}\u52A0\u8F7D\u5931\u8D25</div><div class="line-2">\u7F51\u7EDC\u670D\u52A1\u5F02\u5E38\uFF0C\u4F60\u53EF\u4EE5 <span class="retry-upload">\u91CD\u8BD5</span></div>'},audio:{menuItem:"\u97F3\u9891",abstract:"\u97F3\u9891"},video:{menuItem:"\u89C6\u9891",abstract:"\u89C6\u9891"}}},_tt={media:{upload:{failed:'<div class="line-1">{name} upload failed</div><div class="line-2">Network error, you can <span class="retry-upload">Retry</span></div>',maxSizeFailed:'<div class="line-1">{name} upload failed</div><div class="line-2">The file size exceeds limit. Please choose another file.</div>'},load:{failed:'<div class="line-1">{name} loading failed</div><div class="line-2">Network error, you can <span class="retry-upload">Retry</span></div>'},audio:{menuItem:"Audio",abstract:"Audio"},video:{menuItem:"Video",abstract:"Video"}}},Mtt={media:{upload:{failed:'<div class="line-1">{name}\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <span class="retry-upload">\u518D\u8A66\u884C</span></div>',maxSizeFailed:'<div class="line-1">{name}\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F</div><div class="line-2">\u30D5\u30A1\u30A4\u30EB\u306E\u30B5\u30A4\u30BA\u304C\u4E0A\u9650\u3092\u8D85\u3048\u3066\u3044\u308B\u305F\u3081\u3001\u4ED6\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044</div>'},load:{failed:'<div class="line-1">{name}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F</div><div class="line-2">\u304A\u4F7F\u3044\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u6B21\u306E\u64CD\u4F5C\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002 <span class="retry-upload">\u518D\u8A66\u884C</span></div>'},audio:{menuItem:"\u97F3\u58F0",abstract:"\u97F3\u58F0"},video:{menuItem:"\u52D5\u753B",abstract:"\u52D5\u753B"}}};D.mergeLang({"zh-CN":Dtt,"en-US":_tt,"ja-JP":Mtt});var Yr=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(Yr||{}),Of=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(Of||{});const PS=10*1024*1024,Utt=["wav","mp3","aac","ogg","webm","flac"],Ott=["ogg","mp4","webm"],Ntt=()=>{};function FS(n){var h,C,E,A,v,k;const t=(h=n.getComponentOptions("media"))!=null?h:{},{allowedMedias:e,maxSize:r,callbacks:i}=t,o=(C=e==null?void 0:e.audio)!=null?C:Utt,s=(E=e==null?void 0:e.video)!=null?E:Ott,l=(A=r==null?void 0:r.audio)!=null?A:PS,c=(v=r==null?void 0:r.video)!=null?v:PS,d=(k=i==null?void 0:i.onError)!=null?k:Ntt;return{allowedMedias:{audio:o,video:s},maxSize:{audio:l,video:c},callbacks:{onError:d}}}function Ptt(n,t){const e=o=>o.map(s=>`.${s}`).join(","),{allowedMedias:r}=FS(n),i=r[t];return i?e(i):"*"}function Ftt(n,t,e){const{maxSize:r,callbacks:i,allowedMedias:o}=FS(t),{[e]:s}=r,{[e]:l}=o;if(s&&n.size>s){const d=new Error("media is too large");throw d.code=`MaxMediaSize-${e}`,i!=null&&i.onError&&(i==null||i.onError(t,d)),d}const c=Jc(n.name);if(l&&!l.includes(c.toLowerCase())){const d=new Error(`media file is not allowed: ${c}`);throw d.code="NotAllowedFile",i!=null&&i.onError&&(i==null||i.onError(t,d)),d}}function Ktt(n){return n===Of.Empty||n===Of.Error}const tn=I("media");class Vtt extends ve.TypedEmitter{constructor(e){super();m(this,"mediaContainer",null);m(this,"media",null);m(this,"abstract",null);m(this,"handleMediaLoadError",(e,r)=>{if(!r.target||!(r.target instanceof Node)||!(r.target instanceof Element?r.target:r.target.parentElement))return;const o=J(r.target);if(!o||!o.contains(this.mediaContainer))return;const s=this.renderError();this.updateMediaContent(s),this.emit("mediaError",e,"load_error",lt(o))});m(this,"handleUploadFile",async e=>{p(tn,this.abstract,"no abstract"),p(tn,this.mediaContainer,"The media element not exist");const{editor:r}=this.options,i=J(this.mediaContainer);p(tn,i,"The block element not exist");const o=r.getBlockData(i);try{const{resourceId:s}=await r.doc.uploadResource(e,{onProgress:C=>{this.renderProgress(C,e)}}),{name:l,type:c,size:d}=e,h={...o,embedData:{...o.embedData,src:s,fileName:l,fileSize:d,fileType:c}};r.updateBlockData(i,h)}catch(s){tn.error(s),this.emit("mediaError",r,"upload_error",o.id),this.renderRetry(e,s)}ot(i,"media-block-uploading")});m(this,"destroy",()=>{this.mediaContainer=null});this.options=e}bindMediaEvent(){const{editor:e}=this.options;this.media&&e.domEvents.addEventListener(this.media,"error",this.handleMediaLoadError)}unbindMediaEvent(){const{editor:e}=this.options;this.media&&e.domEvents.removeEventListener(this.media,"error",this.handleMediaLoadError)}updateMediaContent(e){p(tn,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){p(tn,this.abstract,"no abstract");const{editor:e,createMediaElement:r}=this.options,{mediaIcon:i,mediaName:o}=this.abstract;p(tn,this.mediaContainer,"The media element not exist");const s=J(this.mediaContainer);p(tn,s,"The block element not exist");const l=e.getBlockData(s),c=B("div",["media-error","embed-selected-content","embed-hover-content"],null),d=B("span",["media-error-icon"],c);d.innerHTML=i;const h=B("div",[],c);h.innerHTML=D.t("media.load.failed",{name:o}),c.appendChild(h);const C=h.querySelector(".retry-upload");return p(tn,C,"The element not exist"),e.domEvents.addEventListener(C,"click",(E,A)=>{const v=B("div",["media-element"],null),k=this.getResourceUrl(l),L=r(E,v,l,k);this.unbindMediaEvent(),this.media=L,this.bindMediaEvent(),this.updateMediaContent(v)}),this.setFullScreen(),c}renderRetry(e,r){var E,A;p(tn,this.abstract,"no abstract");const{editor:i}=this.options,{mediaIcon:o,mediaName:s}=this.abstract,l=B("div",["media-error","embed-selected-content","embed-hover-content"],null),c=B("span",["media-error-icon"],l);c.innerHTML=o;const d=B("div",[],l);let h=D.t("media.upload.failed",{name:s});(((E=r.response)==null?void 0:E.status)===420||((A=r.response)==null?void 0:A.status)===413)&&(h=D.t("media.upload.maxSizeFailed",{name:s})),d.innerHTML=h,l.appendChild(d);const C=d.querySelector(".retry-upload");C&&i.domEvents.addEventListener(C,"click",()=>{i.readonly||(p(tn,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(l),this.setFullScreen()}renderProgress(e,r){p(tn,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope .media-progress"),o=e===-1||e===100?100:e;if(i){const{updateProgressElement:s}=this.options;s(i,o)}else{const{createProgressElement:s}=this.options,l=J(this.mediaContainer);p(tn,l,"The element not exist"),z(l,"media-block-uploading");const c=B("div",["media-progress"],null);s(c,o,r),this.updateMediaContent(c)}this.setFullScreen()}renderMediaElement(e,r){p(tn,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope > .media-element"),{createMediaElement:o,updateMediaElement:s,editor:l}=this.options,c=this.getResourceUrl(e,r);if(i){const d=s(l,i,e,c);this.unbindMediaEvent(),this.media=d,this.bindMediaEvent()}else{const d=B("div",["media-element"],null),h=o(l,d,e,c);this.unbindMediaEvent(),this.media=h,this.bindMediaEvent(),this.updateMediaContent(d)}}renderEmpty(e){p(tn,this.abstract,"no abstract"),p(tn,this.mediaContainer,"The media element not exist");const r=B("div",["media-empty","embed-selected-content","embed-hover-content"],this.mediaContainer);r.innerHTML=this.abstract.mediaIcon,this.updateMediaContent(r);const{editor:i}=this.options;i.findBlockById(e.id)&&this.emit("mediaError",i,"empty",e.id),this.setFullScreen()}getResourceUrl(e,r){const{src:i}=e.embedData,{editor:o}=this.options;return o.doc.buildResourceUrl(i,{syncNewResources:async(s,l)=>{var d,h;if(!r)return;await o.doc.addResources([s]);const c=(h=(d=o.doc).getServerMeta)==null?void 0:h.call(d).appId;if(l!==e.embedData.src&&c&&e.embedData.src.includes(c)){const C=J(r);if(C&&!o.readonly&&o.isBlockWritable(C)){const E=mt.default(e);E.embedData.src=s,o.updateBlockData(C,E)}}}})}setFullScreen(){p(tn,this.mediaContainer,"The media element not exist"),z(this.mediaContainer,"full-screen")}removeFullScreen(){p(tn,this.mediaContainer,"The media element not exist"),ot(this.mediaContainer,"full-screen")}updateBlockAlign(e,r){const i=J(r);p(tn,i,"The block element not exist");const{align:o}=e;e.embedType==="video"&&(i.hasAttribute("data-style-align")&&i.removeAttribute("data-style-align"),i.setAttribute("data-style-align",o))}render(e,r){const{src:i}=e.embedData;(!this.mediaContainer||!r.contains(this.mediaContainer))&&(this.mediaContainer=B("div",["media"],r)),this.updateBlockAlign(e,r),Ktt(i)?i===Of.Empty&&this.renderEmpty(e):this.renderMediaElement(e,r)}setAbstract(e){this.abstract=e}}I("media-embed");const $tt="left";class KS{constructor(){m(this,"handleInsertEmptyEmbed",async(t,e)=>{var C;const{containerId:r,blockIndex:i}=e;let o;(C=e.data)!=null&&C.file&&(o=e.data.file);const s=Ptt(t,this.embedType);if(o=o!=null?o:await ga(s,{}),!o)return null;const{mediaType:l}=this.getAbstract();try{Ftt(o,t,l)}catch{return null}const c={id:tt(),type:"embed",embedType:this.embedType,embedData:{src:Of.Empty}};l==="video"&&(c.align=$tt);const d=t.insertBlock(r,i,c);return await this.getMedia(t,c.id).handleUploadFile(o),d})}getMedia(t,e){const r=t.addCustom(`media-${e}`,()=>new Vtt({editor:t,createMediaElement:this.createMediaElement,updateMediaElement:this.updateMediaElement,createProgressElement:this.createProgressElement,updateProgressElement:this.updateProgressElement}));return r.setAbstract({...this.getAbstract()}),r}getOptions(){const{menuItem:t,mediaIcon:e,mediaName:r,order:i,group:o}=this.getAbstract();return{name:r,insertEmbedCommandItems:[{id:`insert-${this.embedType}`,name:t,icon:e,order:i,group:o,subText:yn(`insert-${this.embedType}`)}],handleInsertEmptyEmbed:this.handleInsertEmptyEmbed}}createEmbedContent(t,e,r){const{id:i}=r;this.getMedia(t,i).render(r,e)}handleUpdateBlock(t,e,r){const{id:i}=r,o=this.getMedia(t,i),s=Ot(e);return o.render(r,s),!0}handleDeleteBlock(t,e){const r=e.id,i=this.getMedia(t,r);i.removeAllListeners(),i.destroy()}convertTo(t,e,r,i){const o=e.embedData,s=t.doc.buildResourceUrl(o.src,{withToken:!0});return i==="html"?`<${o.type} src="${s}" />`:i==="markdown"?`![${o.src}](${s})`:s}}function VS(n,t){const e=B("div",["uploading-progress-mask"],n),r=B("div",["uploading-progress-bar"],e),i=B("div",["uploading-progress-bar-value"],r);i.style.width=`${t}%`}function $S(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const Htt=I("media-audio");class jtt extends KS{constructor(){super(...arguments);m(this,"embedType",Yr.AUDIO);m(this,"updateProgressElement",$S);m(this,"createMediaElement",(e,r,i,o)=>{const s=B("div",["audio-container","embed-hover-content","embed-selected-content"],r),l=B("audio",[],s);return l.innerHTML="Your browser does not support the <code>audio</code> element.",l.controls=!0,l.src=o,setTimeout(()=>{this.getMedia(e,i.id).setFullScreen()}),l})}getAbstract(){return{mediaIcon:t2,mediaName:D.t(`media.${Yr.AUDIO}.menuItem`),menuItem:D.t(`media.${Yr.AUDIO}.menuItem`),order:800,mediaType:Yr.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${D.t(`media.${Yr.AUDIO}.abstract`)}`}}updateMediaElement(e,r,i,o){const s=r.querySelector(":scope .audio-container > audio");return p(Htt,s,"The media element not exist"),s.src!==o&&(s.src=o),s}createProgressElement(e,r){const i=B("audio",[],e);i.innerHTML="Your browser does not support the <code>audio</code> element.",i.controls=!0,i.src="about:blank",VS(e,r)}}const ztt=new jtt;I("video-resizer");function HS(n){return n&&ge(n)&&qe(n)==="video"}const Gtt=50;class MA{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&HS(e)&&this.disableBlockResize(e),t&&HS(t)&&this.editor.isBlockWritable(t))){const r=this.getVideoElement(t);if(!r)return;this.enableBlockResize(t,r)}});m(this,"handleResizing",(t,e)=>{if(this.resizing=!0,!this.currentResizableElement)return;const r=t.getBlock();if(!r)return;const i=r.getBoundingClientRect().width,o=Math.min(Math.max(e.width,Gtt),i);this.currentResizableElement.style.width=`${o}px`,this.currentResizableElement.style.pointerEvents="none"});m(this,"handleResized",t=>{this.resizing=!1;const e=t.getBlock();if(!this.currentResizableElement||!e)return;const r=this.editor.getBlockData(e),{width:i}=this.currentResizableElement.getBoundingClientRect();this.currentResizableElement.style.pointerEvents="auto",this.editor.updateBlockData(e,{...r,width:i})});this.editor=t,Be.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,Be.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}getVideoElement(t){return Ot(t).querySelector(":scope .video-container > video")}updateResizer(t){const e=this.editor.findCustom(`${lt(t)}-resizer`);e&&e.updateResizer()}disableBlockResize(t){const e=this.editor.findCustom(`${lt(t)}-resizer`);e&&e.disableResize()}enableBlockResize(t,e){const r=this.editor.addCustom(`${lt(t)}-resizer`,()=>new mf(this.editor,{resize:["top-left","top-right","bottom-left","bottom-right"]}));r.enableResize(t,e),r.removeListener("resizing",this.handleResizing),r.removeListener("resized",this.handleResized),r.addListener("resizing",this.handleResizing),r.addListener("resized",this.handleResized),this.currentResizableElement=e}}const Wtt=I("video");class qtt extends KS{constructor(){super(...arguments);m(this,"embedType",Yr.VIDEO);m(this,"updateProgressElement",$S);m(this,"createMediaElement",(e,r,i,o)=>{const s=B("div",["video-container","embed-selected-content","drag-preview-element"],r),l=B("video",[],s);return l.innerHTML="Your browser does not support the <code>video</code> element.",l.controls=!0,l.src=o,l.addEventListener("canplay",()=>{e.addCustom("video-resizer",()=>new MA(e)),this.getMedia(e,i.id).removeListener("mediaError",this.handleMediaError),this.getMedia(e,i.id).addListener("mediaError",this.handleMediaError),this.getMedia(e,i.id).removeFullScreen()}),i.width&&(l.style.width=`${i.width}px`),l});m(this,"createProgressElement",(e,r,i)=>{const o=B("video",["progress-video"],e);o.innerHTML="Your browser does not support the <code>audio</code> element.",o.controls=!0,VS(e,r),ma(i).then(s=>{const l=e.querySelector(".progress-video");l&&s1(e)&&(l.src=s)})})}getAbstract(){return{mediaName:D.t(`media.${Yr.VIDEO}.menuItem`),mediaIcon:e2,menuItem:D.t(`media.${Yr.VIDEO}.menuItem`),order:700,mediaType:Yr.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`${D.t(`media.${Yr.VIDEO}.abstract`)}`}}handleMediaError(e,r,i){const o=e.addCustom("video-resizer",()=>new MA(e)),s=e.getBlockById(i);o.disableBlockResize(s)}updateMediaElement(e,r,i,o){const s=r.querySelector(":scope .video-container > video");p(Wtt,s,"The media element not exist"),s.src!==o&&(s.src=o),i.width?s.style.width=`${i.width}px`:s.style.width="";const l=e.getBlockById(i.id);return setTimeout(()=>{e.addCustom("video-resizer",()=>new MA(e)).updateResizer(l)}),s}}const Xtt=new qtt,jS=[AE,kE,RE,Hk],UA=[_S,YJ,itt,htt,btt,p$,Itt,Xtt,ztt,lW,uS,$Y],zS=[nR,hS,N4];function Ytt(n,t,e){var i,o,s,l;si.level=(i=e.logLevel)!=null?i:Us.DEBUG;const r=Su(n,t,{components:{blocks:[...jS,...((o=e==null?void 0:e.components)==null?void 0:o.blocks)||[]],embeds:[...UA,...((s=e.components)==null?void 0:s.embeds)||[]],boxes:[...zS,...((l=e.components)==null?void 0:l.boxes)||[]],textRenders:[new nE],options:{...e.componentsOptions}}});return r.readonly=!0,r.addCustom("heading-collapse",()=>new AA(r)),r.addCustom("editor-tooltip",()=>new O0(r)),r.addListener("clickLink",(c,d,h)=>{var E;if((E=e==null?void 0:e.events)!=null&&E.onClickLink){e.events.onClickLink(c,d,h);return}const C=h.getAttribute("link");C&&(c.readonly||d.ctrlKey||d.metaKey)&&window.open(C,"_blank")}),r}class GS{constructor(t){this.createOptions=t,t.lang&&D.setLang(t.lang)}createHistoryEditor(t,e){return Ytt(t,e,this.createOptions)}}I("create-editor");function WS(n,{root:t,childDoc:e,doc:r}){var h,C;e.uploadResource=r.uploadResource.bind(r),e.buildResourceUrl=r.buildResourceUrl.bind(r);const i=n.getComponentOptions("comment"),o={image:{defaultAlign:"left"},table:{locatingContainer:t,hideCellMenu:!0,hideToolbar:!0},...i==null?void 0:i.componentsOptions},s=[];n.editorBlocks.forEach(E=>{E.blockType==="text"||E.blockType==="embed"||s.push(E)});const l=[];n.editorEmbeds.forEach(E=>{l.push(E)});const c=[];n.editorBoxes.forEach(E=>{E.boxType==="text"||E.boxType==="br"||E.boxType==="image"||E.boxType==="anchor"||c.push(E)});const d=Su(t,e,{shortcuts:[Fh],components:{blocks:s,commandProviders:[new p0],decorators:[new H0],embeds:l,boxes:c,options:o}});if(d.input.addHandler(new z0),d.input.addHandler(new GE(d)),d.input.addHandler(new JE(d)),d.input.addHandler(new JX(d)),d.input.addHandler(new X0),d.addCustom("image-paste-handler",()=>new zE(d)),(h=n.options.componentsOptions)!=null&&h.mention){const E=n.options.componentsOptions.mention;d.addCustom("mention",()=>new dS(d,{...E}))}if((C=n.options.componentsOptions)!=null&&C.comment){const E=n.options.componentsOptions.comment;E.onCommentEditorClick&&d.addListener("click",E.onCommentEditorClick)}return d}function Qtt(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),r=new Set;e.forEach(i=>{const o=J(i);o&&r.add(o)}),r.forEach(i=>{ZX(n,i,t)})}class Jtt{constructor(t){m(this,"listeners",new Set);m(this,"doc");this.editor=t,this.doc=this.editor.doc.externalDoc,this.doc.registerCallback(this)}getComments(){return this.doc.getComments()}getComment(t){return this.doc.getComment(t)}getCommentDoc(t){return this.doc.getCommentDoc(t)}localCreateComment(t,e){this.doc.localCreateComment(t,e)}localDeleteComment(t){const e=this.getComment(t);this.doc.localDeleteComment(t);const r=e.groupId;this.getComments().filter(o=>o.groupId===r).length===0&&Qtt(this.editor,r)}localUpdateComment(t,e){this.doc.localUpdateComment(t,e)}onCreateComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onCreateComment(t,e))}onDeleteComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onDeleteComment(t,e))}onUpdateComment(t,e){Array.from(this.listeners.values()).forEach(r=>r.onUpdateComment(t,e))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}createCommentEditor(t,e){return WS(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class Ztt{constructor(t,e){m(this,"listeners",new Set);this.editor=t,this.localDoc=e}get doc(){return this.localDoc.toJSON()}getComments(){return Object.values(this.doc.comments)}getComment(t){return this.doc.comments[t]}getCommentDoc(t){const e=this.doc.comments[t];return Zp(e)}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}localCreateComment(t,e){}localDeleteComment(t){}localUpdateComment(t,e){}createCommentEditor(t,e){return WS(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const tet={placeholder:{common:{title:"\u8BF7\u8F93\u5165\u6807\u9898",readonlyTitle:"\u8BF7\u8F93\u5165\u6807\u9898",content:"\u70B9\u51FB + \uFF0C\u6216\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6",contentInTable:"\u8F93\u5165 / \u5FEB\u6377\u63D2\u5165\u7EC4\u4EF6"},local:{readonlyTitle:"\u672A\u547D\u540D"}},copyCutProperty:{copy:"\u590D\u5236",cut:"\u526A\u5207",unsafeEnvTips:"\u7531\u4E8E\u5F53\u524D http \u8BBF\u95EE\u73AF\u5883\u4E0B\u7684\u9650\u5236\uFF0C\u8BF7\u4F7F\u7528\u5FEB\u6377\u952E({shortCut}) {operation}",limitedEnvTips:"\u7531\u4E8E\u6D4F\u89C8\u5668\u9650\u5236\uFF0C\u8BF7\u4F7F\u7528 {shortCut} \u7C98\u8D34"}},eet={placeholder:{common:{title:"Enter a title",readonlyTitle:"Enter a title",content:'Click "+", or enter "/" to insert components quickly',contentInTable:'Enter "/" to insert components quickly'},local:{readonlyTitle:"Untitled"}},copyCutProperty:{copy:"Copy",cut:"Cut",unsafeEnvTips:"Due to the limitations of the current http access environment, please use the shortcut ({shortCut}) {operation}",limitedEnvTips:"Press {shortCut} to paste due to browser restrictions"}},net={placeholder:{common:{title:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",readonlyTitle:"\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",content:"\u300C+\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u304B\u3001\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059",contentInTable:"\u300C/\u300D\u3092\u5165\u529B\u3059\u308B\u3068\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u7D20\u65E9\u304F\u633F\u5165\u3067\u304D\u307E\u3059"},local:{readonlyTitle:"\u7121\u984C"}},copyCutProperty:{copy:"\u8907\u88FD",cut:"\u5207\u308B",unsafeEnvTips:"HTTP\u74B0\u5883\u306E\u5236\u7D04\u306B\u3088\u308A\u3001{operation}\u3059\u308B\u306B\u306F\u3001\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8({shortCut}) \u3092\u3054\u4F7F\u7528\u304F\u3060\u3055\u3044",limitedEnvTips:"\u30D6\u30E9\u30A6\u30B6\u30FC\u306E\u5236\u9650\u306B\u3088\u308A\u3001\u300C{shortCut}\u300D\u3092\u4F7F\u7528\u3057\u3066\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044"}};D.mergeLang({"zh-CN":tet,"en-US":eet,"ja-JP":net});const ret="UEsDBBQABgAIAAAAIQBk9WPugQEAACkGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAADYcAAB3b3JkL251bWJlcmluZy54bWxQSwECLQAUAAYACAAAACEA+JXI7/wOAADzmQAADwAAAAAAAAAAAAAAAAAfIgAAd29yZC9zdHlsZXMueG1sUEsBAi0AFAAGAAgAAAAhAMySUFR9AQAA8QIAABEAAAAAAAAAAAAAAAAASDEAAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhACJREfHVAQAA3gMAABAAAAAAAAAAAAAAAAAA/DMAAGRvY1Byb3BzL2FwcC54bWxQSwECLQAUAAYACAAAACEAiD+lv+EAAABVAQAAGAAAAAAAAAAAAAAAAAAHNwAAY3VzdG9tWG1sL2l0ZW1Qcm9wczEueG1sUEsBAi0AFAAGAAgAAAAhAMEnywi2AAAAIQEAABMAAAAAAAAAAAAAAAAARjgAAGN1c3RvbVhtbC9pdGVtMS54bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAABVOQAAY3VzdG9tWG1sL19yZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAOuAYExTAwAAjw4AABIAAAAAAAAAAAAAAAAAWzsAAHdvcmQvZm9udFRhYmxlLnhtbFBLBQYAAAAADwAPANQDAADePgAAAAA=",iet=()=>jg(ret),oet=I("image-to-docx");async function set(n){return new Promise((t,e)=>{const r=new Image;r.onload=()=>{t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=e,r.src=n})}async function qS(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};try{const e=await ma(new File([t],"",{})),r=await set(e);return r.width===void 0||r.height===void 0?{width:345,height:230,buffer:t}:n.width||n.height?{width:n.width||r.width*n.height/r.height,height:n.height||r.height*n.width/r.width,buffer:t}:{width:r.width,height:r.height,buffer:t}}catch(e){oet.error(e);return}}function aet(n,t){let e=n.filter(s=>s!=null);const r=t-(e.length-1)*20,i=.87,o=e.reduce((s,l)=>s+l.width,0);return o>r&&(e=e.map(s=>({width:s.width*r/o,height:s.height*r/o,buffer:s.buffer}))),e.map(s=>({width:s.width*i,height:s.height*i,buffer:s.buffer}))}function cet(n,t,e){if(!e||typeof e!="object")return;const r=e,i=n.filter(s=>s!=null),o=t-(i.length-1)*20;i.forEach((s,l)=>{if(i.length===1&&r.widthPercent){const d=r.widthPercent,h=s.width;s.width=o*(d/100),s.height*=s.width/h;return}const c=`${l}_flex`;if(r[c]){const d=r[c],h=s.width;s.width=o*d,s.height*=s.width/h}})}function XS(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let r;switch(e%3){case 0:r=Ct.LevelFormat.DECIMAL;break;case 1:r=Ct.LevelFormat.LOWER_LETTER;break;default:r=Ct.LevelFormat.LOWER_ROMAN;break}return{level:e,format:r,text:`%${e+1}. `,alignment:Ct.AlignmentType.START,start:t,style:{paragraph:{indent:{left:Ct.convertInchesToTwip(.3*(e+1)),hanging:Ct.convertInchesToTwip(.2)}}}}})}function uet(){return[0,1,2,3,4,5,6,7].map(n=>{let t;switch(n%3){case 0:t="\u2022";break;case 1:t="\u25E6";break;default:t="\u25AA";break}return{level:n,format:Ct.LevelFormat.BULLET,text:t,alignment:Ct.AlignmentType.START,style:{paragraph:{indent:{left:Ct.convertInchesToTwip(.3*(n+1)),hanging:Ct.convertInchesToTwip(.2)}}}}})}function fet(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Ct.LevelFormat.BULLET,text:"\u2611",alignment:Ct.AlignmentType.START,style:{paragraph:{indent:{left:Ct.convertInchesToTwip(.3*(n+1)),hanging:Ct.convertInchesToTwip(.2)}}}}))}function det(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Ct.LevelFormat.BULLET,text:"\u2610",alignment:Ct.AlignmentType.START,style:{paragraph:{indent:{left:Ct.convertInchesToTwip(.3*(n+1)),hanging:Ct.convertInchesToTwip(.2)}}}}))}var Nf=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(Nf||{});const het=[{levels:XS(),reference:"number-numbering-reference"},{levels:uet(),reference:"number-bullet-reference"},{levels:fet(),reference:"checked-bullet-reference"},{levels:det(),reference:"unchecked-bullet-reference"}];function met(n){switch(n){case"style-color-0":return"d83931";case"style-color-1":return"de7802";case"style-color-2":return"dc9b04";case"style-color-3":return"2ea121";case"style-color-4":return"245bdb";case"style-color-5":return"6425d0";case"style-color-6":return"8f959e";default:return}}function get(n){switch(n){case"style-bg-color-1":case"style-bg-color-2":case"style-bg-color-8":case"style-bg-color-9":return"yellow";case"style-bg-color-0":case"style-bg-color-5":return"magenta";case"style-bg-color-3":return"green";case"style-bg-color-4":case"style-bg-color-11":return"blue";case"style-bg-color-6":return"lightGray";case"style-bg-color-7":return"red";case"style-bg-color-10":return"darkGreen";case"style-bg-color-12":return"darkMagenta";case"style-bg-color-13":return"darkGray";default:return}}function pet(n){switch(n){case"style-bg-color-0":return"fbbab6";case"style-bg-color-1":return"ffdcb0";case"style-bg-color-2":return"fff7a0";case"style-bg-color-3":return"ceefc5";case"style-bg-color-4":return"d1ddfb";case"style-bg-color-5":return"d9cbf8";case"style-bg-color-6":return"eaeaea";case"style-bg-color-7":return"fe837c";case"style-bg-color-8":return"ffbd6a";case"style-bg-color-9":return"ffe662";case"style-bg-color-10":return"a8f393";case"style-bg-color-11":return"98b5ff";case"style-bg-color-12":return"b394f8";case"style-bg-color-13":return"b1b1b1";default:return}}const Cet=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function YS(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(Cet);if(t){const e=s=>{let l=Number(s).toString(16);return l.length<2&&(l=`0${l}`),l},r=e(t[1]),i=e(t[2]),o=e(t[3]);return`${r}${i}${o}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function an(n,t){if(n&&n.attributes&&n.attributes[t])return n.attributes[t];if(n&&n.attributes&&n.attributes.box&&n.attributes.inputType&&t==="style-underline")return!0}function QS(n,t,e){for(let r=0;r<=e;++r){const i=`${t}${r}`;if(an(n,i))return i}}function Em(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function OA(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function JS(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function Eet(n){const t=an(n,"inlineStyle");if(t==null)return;const e=t.split(";");for(const r of e){const i=r.split(":");if(i.length!==2)continue;const o=i[0].trim().toLowerCase(),s=i[1].trim().toLowerCase();o==="font-size"&&Em(n,"inline-style-font-size",s),o==="color"&&Em(n,"inline-style-color",s),o==="background-color"&&Em(n,"inline-style-background-color",s),o==="font-family"&&Em(n,"inline-style-font-family",s)}}function Aet(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function xet(n){const t=`${an(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function bet(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` ${n.attributes.text} `;if(n.attributes&&n.attributes.box&&n.attributes.inputType)return n.attributes.value?`${n.attributes.value}`:" "}function vet(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function Bet(n){return an(n,"inline-style-font-family")}function Tet(n){const t=an(n,"inline-style-background-color");return YS(t)}function yet(n){const t=an(n,"inline-style-color");return YS(t)}function ket(n){Eet(n);const t=an(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!an(n,"style-code"),link:JS(an(n,"link")),size:xet(n),text:t?vet(n):bet(n)||n.insert,bold:!!an(n,"style-bold"),underline:!!an(n,"style-underline"),italics:!!an(n,"style-italic"),strike:!!an(n,"style-strikethrough"),superScript:!!an(n,"style-super"),subScript:!!an(n,"style-sub"),math:an(n,"type")==="math"?an(n,"src"):void 0,mention:t,fontFamily:Bet(n),background:Tet(n),color:t?"338fe5":met(QS(n,"style-color-",6))||yet(n),highlight:QS(n,"style-bg-color-",13)}}function Ret(){return[new Ct.Paragraph({border:{top:{color:"auto",style:Ct.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new Ct.Paragraph({spacing:{line:0}})]}function wet(){return new Ct.Paragraph({children:[new Ct.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Ct.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function Let(){return new Ct.Paragraph({children:[new Ct.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Ct.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function Iet(n,t){return new Ct.Paragraph({children:[new Ct.ExternalHyperlink({children:[new Ct.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function ZS(n){if(n.heading!=null)return`Heading${n.heading}`}function tL(n){if(n.alignment!=null){if(n.alignment==="center")return Ct.AlignmentType.CENTER;if(n.alignment==="right")return Ct.AlignmentType.RIGHT;if(n.alignment==="left")return Ct.AlignmentType.LEFT}}function Det(n){if(n.indent)return{left:Ct.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Ct.convertInchesToTwip(.3*n.padding)}}function _et(n){return{type:Ct.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function Met(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function eL(n,t){let e;e=n.inlineCode?"InlineCode":void 0,e=n.link?"Hyperlink":e;const r=n.size||t,i=r!=null?Math.floor(r*1.5+.5):void 0;return new Ct.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:Ct.UnderlineType.SINGLE}:void 0,italics:n.italics||void 0,strike:n.strike||void 0,superScript:n.superScript||void 0,subScript:n.subScript||void 0,size:i,style:e,font:n.fontFamily?Met(n.fontFamily):void 0,shading:n.background?_et(n.background):void 0,color:n.color,highlight:get(n.highlight)})}function Uet(n,t){if(n.link)return new Ct.ExternalHyperlink({children:[eL(n,t)],link:n.link})}async function nL(n,t,e,r,i){const[o]=await i(n,t,e);if(o==null)return;const s=await qS({width:r||0,height:0,src:e},o);return new Ct.ImageRun({data:o,transformation:{width:(s==null?void 0:s.width)||100,height:(s==null?void 0:s.height)||20}})}function Oet(n){if(n.heading||n.heading)return n.heading}function Net(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function Pet(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function Fet(n,t){var r;const e=[];if(n.text&&Array.isArray(n.text)){for(let i=0;i<n.text.length;i++){const o=n.text[i];if(((r=o.attributes)==null?void 0:r.box)===!0&&t){const s=await t(o);if(s){n.text.splice(i+1,0,...s);continue}}e.push(ket(o))}return e}}function Ket(n){if(n.type==="list"&&n.textOnly!==!0)return{checkbox:n.checkbox,groupId:n.groupId,ordered:!!n.ordered,level:n.level||1,start:n.start||0}}function Vet(n,t){if(n.type==="embed"&&n.embedType&&OA(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(r=>{const i=t(r),o=n.embedData[`${i}_width`],s=n.embedData[`${i}_height`];return{src:r,width:o,height:s}})}function $et(n){if(n.padding)return n.padding}function Het(n){return!!(n.type==="embed"&&n.embedType&&OA(n.embedType)&&n.embedData&&n.embedData.src)}async function Am(n,t,e){return{quoted:!!n.quoted,heading:Oet(n),alignment:Net(n),indent:Pet(n),padding:$et(n),texts:await Fet(n,e),list:Ket(n),images:Vet(n,t),border:Het(n)}}async function jet(n,t,e,r){const i=[];if(!n.children)return[];for(const o of n.children){const s=[];for(const l of t.blocks[o])s.push(await Am(l,e,r));i.push(s)}return i}const zet=I("to-docx");function Get(n,t){return Array(n).fill(0).map(()=>Array(t).fill(0).map(()=>({cellId:void 0,color:void 0,from:void 0,rowSpan:1,colSpan:1,width:0,originalWidth:void 0,align:void 0})))}function Wet(n,t,e,r){const i=!!n.hasColTitle,o=!!n.hasRowTitle,s=!!n.isStripeStyle,l="F5F8FB";for(let c=0;c<t;c++)for(let d=0;d<e;d++)(i&&d===0||o&&c===0||s&&c%2===1)&&(r[c][d].color=l)}function qet(n){p(zet,n.children,"no table children");const t=n.rows,e=n.cols,r=n.colsWidth;if(r)for(let s=0;s<r.length;s++)r[s]===0&&(r[s]=100);const i=Get(t,e);let o=0;for(let s=0;s<t;++s)for(let l=0;l<e;++l){if(i[s][l].originalWidth=r?r[l]:void 0,i[s][l].from!==void 0)continue;const c=n.children[o];o+=1,i[s][l].cellId=c,i[s][l].color=pet(n[`${c}_background`]),i[s][l].width=r?r[l]:100,i[s][l].align=n[`${c}_align`];const d=n[`${c}_rowSpan`]||1,h=n[`${c}_colSpan`]||1;if(i[s][l].rowSpan=d,i[s][l].colSpan=h,d>1||h>1){let C=0;for(let E=0;E<d;E++)for(let A=0;A<h;A++)E===0&&(C+=r?r[l+A]:80),!(E===0&&A===0)&&(i[s+E][l+A].from=[s,l]);i[s][l].width=C}}return Wet(n,t,e,i),i}async function Xet(n,t,e,r,i,o,s,l,c,d){async function h(A){if(l){const v=await l(i,o,A);if(v){await r.addDoc(n,v,d);return}}if(A.type==="text"||A.textOnly===!0){const v=await Am(A,s,c);await r.addTextBlock(v);return}if(A.type==="code"){const v=await jet(A,e,s,c);await r.addCodeBlockObject(v);return}if(A.type==="list"&&A.textOnly!==!0){const v=await Am(A,s,c);await r.addListBlockObject(n,v);return}if(A.type==="embed"&&A.embedType){const v=A,k=v.embedData,L=v.embedType;if(OA(L)){const M=await Am(A,s,c);await r.addImagesBlockObject(A,M,d)}else A.embedType==="hr"?r.addSeparatorBlock():A.embedType==="video"?r.addVideoPlaceholder():A.embedType==="audio"?r.addAudioPlaceholder():A.embedType==="webpage"?r.addHyperlinkParagraph(JS(k.src),k.title):r.addOtherEmbedBlock(L,A.embedData);return}if(A.type==="table"){let v=[];if(A.colsWidth)v=A.colsWidth;else{const L=A.cols;v=new Array(L);for(let M=0;M<v.length;M++)v[M]=100;A.colsWidth=v}const k=qet(A);await r.addTableMatrix(v,k,e),r.addEmptyParagraph()}}function C(A){const v=[];for(const{type:k,data:L}of A.embedData.exportSpec){if(k==="text"){const M={id:tt(),text:[{insert:L}],type:"text"};v.push(M);continue}if(k==="image"){const M={id:tt(),type:"embed",embedType:"image",align:"left",embedData:{src:L}};v.push(M);continue}if(k==="link"){const M={id:tt(),type:"embed",embedType:"webpage",embedData:{src:L.url,title:L.title}};v.push(M);continue}}return v}function E(A){var v;return(v=A==null?void 0:A.embedData)!=null&&v.exportSpec?C(A):[A]}for(const A of t)for(const v of E(A))await h(v)}function Yet(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const Qet=I("to-docx");class Jet{constructor(t,e,r,i,o,s){m(this,"paragraphs");this.appId=t,this.docId=e,this.state=r,this.readImageFunc=i,this.convertBlocksFunc=o,this.defaultFontSize=s,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new Ct.Paragraph({heading:ZS(t),alignment:tL(t),children:await this.paragraphsFromBlockTexts(t),indent:Det(t)}))}async addEmptyImagePlaceHolder(){this.paragraphs.push(new Ct.Paragraph({text:`[${D.t("docx.imageExportFailed")}]`,shading:{type:Ct.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=Aet(this.defaultFontSize,t.heading),r=[];for(const i of t.texts){if(i.link){const o=Uet(i,e);o&&r.push(o);continue}if(i.box&&i.box.type&&i.box.type==="br"){r.push(new Ct.TextRun({text:"",break:1}));continue}if(i.box&&i.box.type&&i.box.type==="image"){const o=await nL(this.appId,this.docId,i.box.src,i.box.width,this.readImageFunc);o&&r.push(o);continue}if(i.math){const o=await nL(this.appId,this.docId,i.math,0,this.readImageFunc);o&&r.push(o);continue}r.push(eL(i,e))}return r}async addCodeBlockObject(t){for(const e of t)for(const r of e){const i={style:Ct.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Ct.Paragraph({style:"Code",border:{left:{...i},right:{...i},top:{...i},bottom:{...i}},children:await this.paragraphsFromBlockTexts(r)}))}}async addListBlockObject(t,e){if(e.list==null)return;let r;const i=e.list.checkbox?`${t}-${e.list.groupId}-${e.list.checkbox}`:`${t}-${e.list.groupId}`;if(this.state.listInstMap[i])r=this.state.listInstMap[i];else if(r=this.state.listMaxInst,this.state.listMaxInst+=1,this.state.listInstMap[i]=r,e.list.start>0&&e.list.ordered){const s=`number-numbering-reference-${r}`,l=XS([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:s,inst:r}),this.state.listRefMap[i]=s}else e.list.ordered?this.state.listRefMap[i]=Nf.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[i]=Nf.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[i]=Nf.UNCHECKED:this.state.listRefMap[i]=Nf.BULLET;const o=ZS(e);e.texts&&this.paragraphs.push(new Ct.Paragraph({heading:o,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[i],level:e.list.level-1,instance:r}}))}imageDimWithBufferToImageRun(t){return new Ct.ImageRun({data:t.buffer,transformation:{width:t.width,height:t.height}})}async addImagesBlockObject(t,e,r){if(e.images==null){if(t.type==="embed"&&t.embedType==="image"){const{src:c}=t.embedData;c||this.addEmptyImagePlaceHolder()}return}const i=[],o=await Promise.all(e.images.map(async c=>{const[d,h]=await this.readImageFunc(this.appId,this.docId,c.src);if(d){const C=await qS(c,d);if(C)return C}i.push(h)}));cet(o,r,t.embedData);const s=aet(o,r),l={style:Ct.BorderStyle.SINGLE,color:"#DEDEDE"};s.length&&this.paragraphs.push(new Ct.Paragraph({border:e.border?{left:{...l},right:{...l},top:{...l},bottom:{...l}}:void 0,alignment:tL(e)||Ct.AlignmentType.CENTER,children:s.map(c=>this.imageDimWithBufferToImageRun(c)).flatMap((c,d,h)=>c==null?[]:h.length-1!==d?[c,new Ct.TextRun({text:" "})]:c)})),i.forEach(c=>{this.addHyperlinkParagraph(c)})}addSeparatorBlock(){Ret().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Ct.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(wet())}addAudioPlaceholder(){this.paragraphs.push(Let())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(Iet(t,e))}async addTableMatrix(t,e,r){const i=t.map(o=>o!==0?o*15:1500);this.paragraphs.push(new Ct.Table({rows:await this.generateTableRows(e,r),columnWidths:i}))}async generateRowCells(t,e){const r=[];for(const i of t){const o=i.cellId;if(o===void 0)continue;const s=i.width*.9;r.push(new Ct.TableCell({children:await this.convertBlocksFunc(o,e.blocks[o],e,this.appId,this.docId,this.state,s),columnSpan:i.colSpan,rowSpan:i.rowSpan,width:{type:Ct.WidthType.DXA,size:i.width*15},shading:i.color?{fill:i.color,type:Ct.ShadingType.CLEAR,color:"auto"}:void 0}))}return r}async generateTableRows(t,e){const r=[];for(const i of t)r.push(new Ct.TableRow({children:await this.generateRowCells(i,e)}));return r}async addDoc(t,e,r){const i=await this.convertBlocksFunc(t,e.blocks.root,e,this.appId,this.docId,this.state,r);i&&(this.paragraphs=this.paragraphs.concat(i))}async addOtherEmbedBlock(){}}class Zet{constructor(t,e,r,i,o,s,l,c){m(this,"convertBlocks",async(t,e,r,i,o,s,l=720)=>{const c=new Jet(i,o,s,this.readImage,this.convertBlocks,this.defaultFontSize);return await Xet(t,e,r,c,i,o,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),c.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=r,this.readImage=i,this.defaultFontSize=o,this.getDocByBlock=s,this.getTextsByBox=l,this.backgroundImageOptions=c}async convert(t,e){return this.snapshot2docx(this.docData,t,e)}async snapshot2docx(t,e,r){const i=new Ct.ImportDotx,o=this.templateData?await i.extract(this.templateData):void 0,s=t.blocks.root;p(Qet,s,"data must have blocks");const l=Yet(),c=await this.convertBlocks("blocks",s,t,e,r,l),d=this.backgroundImageOptions?{default:new Ct.Header({children:[new Ct.Paragraph({children:[new Ct.ImageRun(this.backgroundImageOptions)]})]})}:{},h=new Ct.Document({numbering:{config:[...het,...l.levelConfigs]},sections:[{headers:d,children:c,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:o});return Ct.Packer.toBlob(h)}}async function tnt(n,t,e,r){const i=n.doc.buildResourceUrl(r,{withToken:!0});let o=await xS(i);if(!o)return[void 0,i];if(o.type.indexOf("/svg")!==-1){const l=await CS(o);l&&(o=new File([l],o.name))}return[await o.arrayBuffer(),i]}async function ent(n,t,e){const r=n.editorBlocks.getBlockClass(e.type);if(r.toStandardDoc)return r.toStandardDoc(n,e,t)}async function nnt(n,t){const e=t.attributes,r=n.editorBoxes.getBoxClass(e.type);if(r.toStandardText)return r.toStandardText(n,e)}async function rnt(n,t){let{template:e,download:r,backgroundImageOptions:i}=t!=null?t:{};e||(e=iet());const o=n.doc.toJSON(),s=(C,E,A)=>tnt(n,C,E,A),l=async(C,E,A)=>ent(n,o,A),c=async C=>nnt(n,C),h=await new Zet(e,o,Md.default,s,void 0,l,c,i).convert("_appId","_docId");if(r){const C=URL.createObjectURL(h),E=document.createElement("a");E.setAttribute("download",`${AS(n)}.docx`),E.setAttribute("href",`${C}`),E.click(),E.remove()}return h}const NA=I("create-editor");async function int(n,t){var s,l,c,d,h,C,E,A,v,k,L,M,U,F;p(NA,n,"app does not exists"),t.lang&&D.setLang(t.lang),si.level=(s=t.logLevel)!=null?s:Us.DEBUG;const e=t.onReauth?async()=>{var st;const G=t.user.userId,q=t.docId,it=await((st=t.onReauth)==null?void 0:st.call(t,G,q,t.permission));return{userId:G,docId:q,permission:t.permission,appId:t.appId,token:it,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl}}:void 0,r={auth:{appId:t.appId,docId:t.docId,userId:t.user.userId,permission:t.permission,token:t.token,displayName:t.user.displayName,avatarUrl:t.user.avatarUrl},serverUrl:t.serverUrl,reauthFunc:e,disableLogout:t.disableLogout},i=await Hu.load(r),o=Su(n,i,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,enableComments:t==null?void 0:t.enableComments,components:{blocks:[...jS,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...UA,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[...zS,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new p0,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new H0,new eC],insertions:[tp],blockHooks:[new KE,new fw,...((C=t.components)==null?void 0:C.blockHooks)||[]],textRenders:[new S4,new nE],options:{...t.componentsOptions}},shortcuts:[uY,Fj,QG,xE,t4,nV,mE,qY,Fh,XK,...t.shortcuts||[]],colors:["#0064FF","#EB3723","#F59300","#00A865","#F25A0A","#70A310","#009CAD","#0990D9","#8851ED","#D62069"]});if(o.editorCommandProviders.registerCommandProvider(new Si(o)),o.input.addHandler(new NQ),o.input.addHandler(new z0),o.input.addHandler(new b$),o.input.addHandler(new HG),o.input.addHandler(new wE(o,{hideTitle:t.hideTitle,headingLevel:1,titlePlaceholder:D.t("placeholder.common.title"),contentPlaceholder:D.t("placeholder.common.content"),readonlyTitlePlaceholder:D.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),o.input.addHandler(new U0(o,(E=t.componentsOptions)==null?void 0:E.quickMenu)),o.input.addHandler(new GE(o)),o.input.addHandler(new JE(o)),o.input.addHandler(new X0),o.doc.registerCallback(new PQ(o)),o.addCustom("remote-cursor",()=>new By(o)),o.addCustom("block-menu",G=>new mw(G)),ce.isMobile||o.addCustom("editor-tooltip",()=>new O0(o)),t!=null&&t.enableComments&&o.addCustom("editor-comments",G=>new w4(G,new Jtt(G))),t.enableContextMenu!==!1&&o.addCustom("editor-context-menu",G=>new i4(G)),o.addCustom("create-options",()=>new Fb(o,t)),o.addCustom("drop-target",()=>new Tf(o)),o.addCustom("list-to-mindmap",()=>new S0(o)),o.addCustom("list-to-mention",()=>new oJ(o)),o.addCustom("mobile-helper",()=>new wJ(o)),o.addCustom("code-caret",()=>new Uj(o)),o.addCustom("image-paste-handler",()=>new zE(o)),(A=t.componentsOptions)!=null&&A.mention){const G=t.componentsOptions.mention;o.addCustom("mention",()=>new dS(o,G))}if(o.addCustom("heading-collapse",()=>new AA(o)),o.addCustom(pm,G=>new yA(G)),Za.register(o),Tf.register(o),Es.register(o),ds.register(o),o.addListener("clickLink",(G,q,it)=>{var Et;if((Et=t==null?void 0:t.events)!=null&&Et.onClickLink){t.events.onClickLink(G,q,it);return}const st=it.getAttribute("link");st&&(G.readonly||q.ctrlKey||q.metaKey)&&window.open(st,"_blank")}),(k=(v=t.componentsOptions)==null?void 0:v.remoteCarets)!=null&&k.onUserChanged){const G=(M=(L=t.componentsOptions)==null?void 0:L.remoteCarets)==null?void 0:M.onUserChanged;o.doc.getRemoteUsers().on("change",q=>{G(o,q)})}return(F=(U=t.componentsOptions)==null?void 0:U.templates)!=null&&F.templates.length&&(o.addListener("docChanged",()=>{gm(o)}),o.addListener("resize",()=>{gm(o,{reset:!0})}),setTimeout(()=>{gm(o)},100)),o.doc.registerCallback({onError:async G=>{if(G.code==="ResetDoc"){NA.error(`reset doc: ${G.message}`);const q=await Hu.load(r);o.doc.reset(q)}}}),o.version="1.1.15",o}function ont(n){return n.toJSON!==void 0}async function snt(n,t,e){var o,s,l,c,d,h;p(NA,n,"app does not exists");const r=ont(t)?t:new _p(t,{serverUrl:e.serverUrl||""});e.lang&&D.setLang(e.lang),si.level=(o=e.logLevel)!=null?o:Us.DEBUG;const i=Su(n,r,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[AE,kE,RE,Hk],commandProviders:[new p0],decorators:[new H0,new eC],embeds:[...UA,...((s=e.components)==null?void 0:s.embeds)||[]],boxes:[nR,hS,N4,...((l=e.components)==null?void 0:l.boxes)||[]],insertions:[tp],blockHooks:[new KE,...((c=e.components)==null?void 0:c.blockHooks)||[]],textRenders:[new S4,new nE,...((d=e.components)==null?void 0:d.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[xE,t4,mE,Fh]});return i.editorCommandProviders.registerCommandProvider(new Si(i)),i.input.addHandler(new z0),i.input.addHandler(new wE(i,{hideTitle:e.hideTitle,headingLevel:1,titlePlaceholder:D.t("placeholder.common.title"),contentPlaceholder:D.t("placeholder.common.content"),readonlyTitlePlaceholder:D.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new U0(i,(h=e.componentsOptions)==null?void 0:h.quickMenu)),i.input.addHandler(new GE(i)),i.input.addHandler(new JE(i)),i.input.addHandler(new X0),i.addCustom("block-menu",C=>new mw(C)),ce.isMobile||i.addCustom("editor-tooltip",()=>new O0(i)),i.addCustom("image-paste-handler",()=>new zE(i)),e!=null&&e.enableComments&&i.addCustom("editor-comments",C=>new w4(C,new Ztt(C,r))),e.enableContextMenu!==!1&&i.addCustom("editor-context-menu",C=>new i4(C)),i.addCustom("heading-collapse",()=>new AA(i)),i.addListener("clickLink",(C,E,A)=>{var k;if((k=e==null?void 0:e.events)!=null&&k.onClickLink){e.events.onClickLink(C,E,A);return}const v=A.getAttribute("link");v&&(C.readonly||E.ctrlKey||E.metaKey)&&window.open(v,"_blank")}),i.addCustom(pm,C=>new yA(C)),Za.register(i),i.version="1.1.15",i}async function lnt(n,t,e){var h;const r=n.doc.externalDoc.client.auth,i=await Yh.load({auth:r,serverUrl:e});if(!((h=i.getVersionHelper)==null?void 0:h.call(i)))throw new Error("the editor does not support to show versions");const s=n.getCustom("create-options");if(!s)throw new Error("the editor does not support to show versions");const l=s.getData(),c=new GS(l),d=n.addCustom("version-dialog",()=>new Z4(i,c));return d.show(t),d}b.tippy=d9,b.AnchorBox=$B,b.AuthError=Vu,b.AuthHeader=ll,b.AutoScroll=Xd,b.BaseURLHeader=Oa,b.BasicCommands=HV,b.BlockExclusiveHook=fw,b.BlockLockerHook=KE,b.BlockLockerPasteHandler=X0,b.BlockResizer=mf,b.BrBox=PB,b.CodeBlock=kE,b.CodeLineBlock=RE,b.CodeTextDecorator=H0,b.DOC_RE_AUTH_KEYS=pm,b.DefaultShortcuts=Fh,b.DocIdError=PN,b.DocReAuthCallbacks=yA,b.DragDrop=rv,b.DrawioEmbed=_S,b.EditorBlocks=m3,b.EditorBoxes=KB,b.EditorCommandProviders=NT,b.EditorComplexBlockPosition=Or,b.EditorComplexSelectionRange=hi,b.EditorDecorators=GB,b.EditorEmbeds=p3,b.EditorInsertions=zB,b.EditorSimpleBlockPosition=Ye,b.EditorSimpleSelectionRange=nn,b.EmbedBlock=E3,b.EmbedBlockResizer=Df,b.EnforceWithDocumentTitleHandler=wE,b.EventCallbacks=ua,b.FILL_CHAR=cM,b.FileExtError=FN,b.GroupOrder=qk,b.HeadingBlockScrollListener=JQ,b.ImageBox=VB,b.InlineBoxCommandProvider=rR,b.InputtingInsertion=HB,b.LocalDoc=_p,b.LogLevel=Us,b.Logger=si,b.MIN_DISTANCE_THRESHOLD=ev,b.ManualCloseDialog=Gu,b.ManualMenu=ns,b.ManualToolbar=zu,b.MarkdownInputHandler=z0,b.MaxUserError=Gp,b.Mindmap=w0,b.OnesEditorAutoSuggest=BC,b.OnesEditorCustomDataWrapper=Fb,b.OnesEditorExclusiveBlock=ds,b.OnesEditorHoveringBlock=Be,b.OnesEditorIcons=TP,b.OnesEditorQuickMenu=U0,b.OnesEditorToc=Uf,b.OnesEditorTocProvider=Es,b.OnesEditorToolbar=Za,b.OnesEditorTooltip=O0,b.OnesEditorVersionsDialog=Z4,b.PermissionError=Xh,b.Popup=ju,b.ReAuthToolbar=bS,b.RemoteCarets=By,b.RemoteCaretsDecorator=eC,b.RemoteCaretsInsertion=tp,b.RemoteUsers=Lu,b.RequestReloadError=$u,b.RichText=gn,b.ShareDBDoc=Hu,b.ShareDBDocVersionsProvider=GS,b.ShareDBServer=Yh,b.SimpleCache=Wb,b.StandardEmbedBlockCommands=uA,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=_1,b.TEXT_STYLE_COLOR_PREFIX=D1,b.TableBlock=AE,b.TableBlockCommandProvider=p0,b.TableShortcuts=xE,b.TextBlock=On,b.TextBox=NB,b.TextColorItem=K2,b.TextStyleShortcuts=mE,b.TocEmbed=uS,b.ZERO_WIDTH_SPACE_CHAR=Gc,b.abbreviation=Yd,b.addAttribute=uh,b.addClass=z,b.addCommentToBlock=If,b.addDays=bI,b.addMetaToDoc=Ru,b.addMonths=xI,b.animateScrollTo=Ks,b.applyPlaceholderToBlock=df,b.assert=p,b.autoShowHideTemplates=gm,b.blockToDoc=Rp,b.blockToHtml=rp,b.blockToMarkdown=kh,b.blockToText=yh,b.blocksToDoc=sT,b.clearAllSelection=qv,b.clientType=ce,b.cloneBlock=Xo,b.cloneChildContainer=hp,b.cloneDoc=mp,b.cloneText=wB,b.commentToShareDbComment=tC,b.compareElement=Vd,b.comparePosition=g1,b.complexBlockAdjustSelectionPos=nh,b.complexBlockFindNearestChildBlock=A7,b.complexBlockGeFirstSimpleChild=C1,b.complexBlockGetAllChildContainers=hn,b.complexBlockGetBottomChildContainers=b3,b.complexBlockGetLastSimpleChild=Aa,b.complexBlockGetSelectedContainers=Ea,b.complexBlockGetTopChildContainers=x3,b.containerToDoc=lT,b.continuousScroll=Av,b.convertBlockFrom=th,b.convertImageFileToPng=CS,b.convertImageSrcToPng=vJ,b.converterIntercept=j0,b.copyBlockAttributes=i5,b.copyResourcesFromDoc=Dp,b.createBlockAnchor=Yi,b.createBlockCaretAnchor=B3,b.createBlockContentElement=qs,b.createBlockElement=Fv,b.createBlockSimpleDocRange=xh,b.createBlockSimpleRange=Te,b.createBoxContentElement=$v,b.createBoxElement=Kv,b.createBoxOp=RB,b.createChildContainer=d3,b.createComplexBlockPosition=Ee,b.createComplexDocPos=_B,b.createComplexDocRange=dM,b.createContainer=LB,b.createContainerElement=t1,b.createDeleteOps=BB,b.createEditor=Su,b.createEditorSelectionRange=Qe,b.createElement=B,b.createEmptyContainer=eo,b.createEmptyDoc=to,b.createEmptyTextBlockData=Eh,b.createExpandedRange=Fd,b.createIconButton=Ns,b.createImage=Dg,b.createInsertOps=ph,b.createInsertionContentElement=zv,b.createInsertionElement=Hv,b.createLocalEditor=snt,b.createOnesEditor=int,b.createRange=qb,b.createRichText=rl,b.createRootContainer=f3,b.createSimpleBlockPosition=ct,b.createSimpleDocPos=DB,b.createTextBlockData=Ci,b.createTextButton=pl,b.createTextOp=pr,b.createTextWithReplaceSoftReturn=z1,b.daysAfter=Xg,b.deleteText=W1,b.diffDays=vI,b.disablePageScroll=Gg,b.docToHtml=ZB,b.docToHtmlFragment=xu,b.docToMarkdown=t5,b.docToText=qo,b.downloadImageToFile=xS,b.downloadObjectToFile=wA,b.downloadSvgToString=TS,b.editLink=rf,b.editorAddComment=eY,b.editorAddTextAttribute=g5,b.editorAutoInsertBlock=o5,b.editorBreakTextBlock=wa,b.editorClearCompositionText=lp,b.editorClearSelectedContents=Ih,b.editorCopyBlock=Lp,b.editorCopyDoc=Ph,b.editorDeleteBlock=up,b.editorDeleteBlockText=ap,b.editorDeleteBlockWithoutChildren=Sh,b.editorDeleteChildContainer=cU,b.editorDeleteChildContainers=s5,b.editorFocusToBlock=dp,b.editorFocusToEnd=wU,b.editorGetBlockData=Wo,b.editorGetBlockText=Tn,b.editorGetBlockTextEx=vh,b.editorGetBoxData=UB,b.editorHandleKeyboardEvent=AT,b.editorInsertBlock=Ra,b.editorInsertBoxToBlock=n5,b.editorInsertDoc=h5,b.editorInsertDocAt=gp,b.editorInsertText=sp,b.editorInsertTextToBlock=e5,b.editorInsertTextToBlockEx=op,b.editorMergeTextBlock=l5,b.editorMoveDown=w5,b.editorMoveEnd=vp,b.editorMoveHome=P5,b.editorMoveLeft=y5,b.editorMoveLineEnd=G5,b.editorMoveLineHome=z5,b.editorMovePageDown=J5,b.editorMovePageUp=Q5,b.editorMoveRight=k5,b.editorMoveUp=R5,b.editorMoveWordEnd=U5,b.editorMoveWordLeft=M5,b.editorRangeClearColor=C5,b.editorRangeGetColor=E5,b.editorRangeSetColor=p5,b.editorRemoveTextAttribute=hU,b.editorReplaceBlockText=Dh,b.editorReplaceContainer=m5,b.editorRunOnce=Mp,b.editorSelectAll=Tp,b.editorSelectContainer=Uh,b.editorSelectDown=S5,b.editorSelectEnd=Bp,b.editorSelectHome=F5,b.editorSelectLeft=L5,b.editorSelectLineEnd=j5,b.editorSelectLineHome=H5,b.editorSelectPageDown=eT,b.editorSelectPageUp=tT,b.editorSelectRight=I5,b.editorSelectUp=D5,b.editorSelectWordEnd=N5,b.editorSelectWordLeft=O5,b.editorSetTextColor=Sa,b.editorShowFindDialog=Wq,b.editorToDocx=rnt,b.editorUpdateBlockData=_h,b.editorUpdateCompositionText=r5,b.editorUpdateEmbedData=f5,b.enablePageScroll=Wg,b.escapeHtmlText=Hd,b.escapeRegExp=Zg,b.escapeSpace=rI,b.exclusiveBlock=NE,b.executeBlockCommand=r3,b.executeEmbedBlockCommand=n3,b.executeRangeCommand=OT,b.fileToDataUrl=ma,b.findAfterOffsetNotType=Q1,b.findAllText=yp,b.findBlockByIndex=Lv,b.findEventTargetBlock=Qb,b.findInsertionById=jv,b.findNextOffset=IM,b.findNextVisibleSimpleBlock=VT,b.findPrevOffset=LM,b.findPrevOffsetNotType=Y1,b.findPrevSimpleBlockBeforeChildContainer=A3,b.findPrevVisibleSimpleBlock=KT,b.findTarget=da,b.findWordEnd=Z1,b.findWordLeft=J1,b.format=Zc,b.formatBytes=xv,b.formatDate=Qg,b.fragmentToHtml=mv,b.fromBase64=Xc,b.fromBase64ToBlob=jg,b.fromBase64ToUint8Array=mI,b.fromDocRange=Ho,b.fromNowString=Jg,b.genId=tt,b.getAllChildBlocks=b1,b.getAllQuickMenuItems=hE,b.getAllSelectedBlocks=mi,b.getAttributesAt=Ba,b.getBlockBackground=Pv,b.getBlockByIndex=Ko,b.getBlockCaretRect=Vo,b.getBlockClass=Qt,b.getBlockClassByType=js,b.getBlockClientRects=Wi,b.getBlockCommandsWithHook=c1,b.getBlockContent=Ot,b.getBlockHeading=iu,b.getBlockId=lt,b.getBlockIndex=vt,b.getBlockInfo=Af,b.getBlockKind=_r,b.getBlockMinWidth=Yv,b.getBlockNearestRangeFromPoint=A1,b.getBlockOptions=UI,b.getBlockPath=$o,b.getBlockProperties=Zv,b.getBlockRangeFromPoint=rh,b.getBlockStyles=MI,b.getBlockTextLength=dt,b.getBlockTools=ie,b.getBlockType=Dt,b.getBoxContent=i1,b.getBoxId=Vv,b.getBoxTypeFromElement=ru,b.getChildBlockCount=Dr,b.getChildBlocks=ue,b.getChildOffset=tl,b.getColorFromAttributes=U1,b.getColorFromContent=Qd,b.getComplexBlockClass=fr,b.getContainerBlockPath=a3,b.getContainerBlocks=Wv,b.getContainerBlocksElement=eu,b.getContainerById=ci,b.getContainerId=at,b.getContainerMinWidth=h1,b.getContainerToolsElement=II,b.getContainerWidth=h3,b.getDistanceSquare=Fo,b.getElementOffset=zc,b.getElementScale=ur,b.getEmbedType=qe,b.getExistsBlockTools=Jd,b.getExistsContainerById=tu,b.getFileExt=Jc,b.getFirstChildBlock=Re,b.getFirstClientRect=Kd,b.getHeadingBlockChildren=pa,b.getHeadingMenuOptions=cE,b.getHorizontalPadding=Mg,b.getInsertionContent=o1,b.getLastChildBlock=Me,b.getLastClientRect=Ps,b.getListAllNextBrothers=qa,b.getLogger=I,b.getNextBlock=Jt,b.getNextHiddenBlocks=s3,b.getNextValidOffset=el,b.getNextVisibleBlock=hr,b.getOffsetFromPoint=_g,b.getOffsetInfoAfter=Cu,b.getOffsetInfoBefore=Bh,b.getOpAt=rB,b.getOpLength=ch,b.getParentBlock=J,b.getParentBlockExcludeSelf=Ws,b.getParentBox=r1,b.getParentContainer=rt,b.getPrevBlock=Ue,b.getPrevValidOffset=Go,b.getPrevVisibleBlock=dr,b.getRangeCommands=MT,b.getReferenceClientRect=Ak,b.getRootBlock=a1,b.getScrollContainer=We,b.getSpecialBlockCommands=t3,b.getStandardEmbedBlockProperties=fA,b.getTextAfterOffset=wM,b.getTextAttributes=ip,b.getTextBeforeOffset=SM,b.getTextBlockChild=lu,b.getTextBlockClass=Dv,b.getTextBlockContentChildTextLength=gr,b.getTextBlockContentChildType=l3,b.getTextBlockContentChildren=fi,b.getTextLength=mn,b.getTextOpLength=I1,b.getTextWidth=Gd,b.getToolbar=v0,b.handleBlockElementUpdated=Qv,b.hasAltOnly=cI,b.hasClass=wt,b.hasCtrlOrCmd=cv,b.hasCtrlOrCmdOnly=aI,b.hashCode=Rv,b.hideBlock=Nv,b.htmlToFragment=zd,b.i18n=D,b.includeBigTable=tF,b.injectDocToHtmlFragment=ku,b.injectStyle=tv,b.inputActions=qU,b.insertEmptyBlock=PI,b.insertEmptyEmbedBlock=u1,b.insertText=Zi,b.intersectionCommands=RO,b.isBackspace=fv,b.isBlock=zs,b.isBlockLocked=q0,b.isBlockLockedByOthers=FE,b.isBlockLockedBySelf=xf,b.isBlockTools=Ov,b.isBox=Zd,b.isBoxOp=zo,b.isCJK=lv,b.isChildContainer=Ur,b.isChildNode=re,b.isCodeBlock=Wr,b.isCollapsedHeadingBlock=ui,b.isCollapsedRange=fM,b.isComplexBlockPosition=Ca,b.isComplexKindBlock=Mt,b.isContainer=Gi,b.isContainerSelectedAllChildBlocks=nT,b.isControlEvent=$s,b.isDelete=fI,b.isDraggingFiles=Wd,b.isElementVisible=Pg,b.isEmbedBlock=ge,b.isEmptyContainer=au,b.isEmptyDoc=q1,b.isEmptyTextBlock=fe,b.isEmptyTextBlockWithoutCompositionText=ff,b.isEnterOnly=uv,b.isEscape=$g,b.isExclusiveBlock=Ef,b.isExpandedHeadingBlock=o3,b.isFirefox=qc,b.isFirstChildBlockInComplexBlock=E7,b.isHeadingBlock=Xe,b.isHighSurrogate=Z9,b.isInBlock=s1,b.isInBlockTools=Xs,b.isLetter=sv,b.isLowSurrogate=tI,b.isMatchShortcut=li,b.isMoveForward=sI,b.isNavigationEvent=oI,b.isNavigationKey=av,b.isNodeRemoved=Ug,b.isNumber=ov,b.isPrintableKey=Vg,b.isRootBlock=mr,b.isRootContainer=qt,b.isSafari=ha,b.isSameDay=Yg,b.isSelectBoxOnly=jk,b.isShiftEnter=uI,b.isShiftTab=hI,b.isShortcutEvent=lI,b.isSimpleBlock=_I,b.isSimpleBlockPosition=di,b.isSimplePos=IB,b.isSimpleRange=Ah,b.isSpace=jd,b.isTab=dI,b.isTextBlockContentBoxChild=Yn,b.isTextBlockContentChild=ou,b.isTextBlockContentInsertionChild=Xi,b.isTextBlockContentTextChild=su,b.isTextKindBlock=nt,b.isTextKindBlockType=nu,b.isTitleBlock=zi,b.isToday=bv,b.isValidOffset=Un,b.isVisibleBlock=Gs,b.isYesterday=vv,b.loadJs=Yb,b.loadJsPromise=Fs,b.lockers=Ir,b.mergeCommands=b0,b.mergeDocs=il,b.mergeOps=G1,b.mergeText=lM,b.multiSplitText=oB,b.overflowText=Bv,b.parseShortcut=dv,b.patchNode=Yc,b.pointInRect=Vs,b.rangeAddAttribute=hu,b.rangeGetTextColor=dB,b.rangeRemoveAttribute=va,b.rangeSetTextColor=cB,b.rangeTransformText=lB,b.registerDragDrop=Fg,b.removeAttribute=M1,b.removeClass=ot,b.removeLastBr=rM,b.removePlaceholderFromBlock=NR,b.removeStyle=Zb,b.replaceAll=BI,b.replaceAllCaseInsensitive=TI,b.replaceAllText=iT,b.replaceText=Ch,b.requestDownload=qd,b.resetListStart=Ya,b.scrollIntoView=Au,b.scrollable=Ev,b.selectFile=ga,b.selectedBlockToDoc=Oh,b.selectionToDoc=La,b.setAttributes=$d,b.setClipboardData=Qc,b.setClipboardDataByEvent=CI,b.setColorToAttributes=uB,b.setDataset=Og,b.setDefaultCursor=Wc,b.setStyles=Ng,b.shareDBCommentToDocObject=Zp,b.shareDBDocCommentToComment=by,b.shortcutToDisplayText=Ge,b.showBlock=n1,b.showDocVersions=lnt,b.splitText=_n,b.splitToThree=Je,b.stringToDataUrl=zg,b.stringToObjectUrl=qg,b.subText=sB,b.textNodeOffsetFromPoint=Xb,b.titleFromEditor=AS,b.toBase64URL=ai,b.toMindmap=R0,b.toPlainText=de,b.toPlainTextKeepLength=X1,b.trimChar=Kg,b.unexclusiveBlock=PE,b.unicodeLength=eI,b.unicodeSubstr=nI,b.updateBlockSelection=Xv,b.updateOpAttributes=SB,b.updateTextBlockContent=RM,b.updateUrl=Hg;for(const n in ve)n!=="default"&&!b.hasOwnProperty(n)&&Object.defineProperty(b,n,{enumerable:!0,get:()=>ve[n]});Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});