@ones-editor/editor 1.1.19 → 1.1.20

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
@@ -732,7 +732,7 @@ ${o}
732
732
  <path d="M2.00218 11.0005L8.00341 4.99923L14.0046 11.0005" stroke="currentColor" fill="transparent" stroke-width="1.5" stroke-linejoin="bevel"/>
733
733
  </svg>`,HW=`<svg width="17" height="16" viewBox="0 0 17 16" xmlns="http://www.w3.org/2000/svg">
734
734
  <path d="M14.0029 4.99933L8.00172 11.0006L2.00049 4.99933" stroke="currentColor" fill="transparent" stroke-width="1.5" stroke-linejoin="bevel"/>
735
- </svg>`,Aat="",Tg="reply-editor-editing",{t:YA}=_;class jW{constructor(t,e,r,i){m(this,"root");m(this,"components");m(this,"handleFocus",()=>{const{replyEditor:t,okButton:e}=this.components;t.isEmpty()&&(e.disabled=!0)});m(this,"handleDocChange",()=>{const{replyEditor:t,okButton:e}=this.components,r=t.getDoc();U1(r)?e.disabled=!0:e.disabled=!1});m(this,"getReplyEditor",()=>this.components.replyEditor);m(this,"showReplyEditor",()=>{Mt(this.root,Tg)||(q(this.root,Tg),this.components.replyEditor.edit())});m(this,"hideReplyEditor",()=>{!Mt(this.root,Tg)||ut(this.root,Tg)});m(this,"reply",()=>{const{mainEditor:t,comment:e,components:{replyEditor:r},commentsProvider:i}=this,s=r.getDoc(),o=yg({editor:t,commentGroupId:e.groupId,abstract:this.groupItem.comment.abstract});i.localCreateComment(o,s),this.hideReplyEditor(),r.clear()});m(this,"cancel",()=>{const{replyEditor:t}=this.components;this.hideReplyEditor(),t.clear()});m(this,"hide",()=>{Mt(this.root,"hidden")||q(this.root,"hidden")});m(this,"show",()=>{ut(this.root,"hidden")});this.mainEditor=t,this.commentsProvider=e,this.comment=r,this.groupItem=i,this.root=B("div",["comment-quick-reply"],null),this.components=this.createQuickReply()}createQuickReply(){const{commentsProvider:t}=this,e=Ra(this.root,he.QuickReply,YA("comment.placeholder"));so(e,he.QuickReply),e.classList.add("quick-reply-button");const r=B("div",["quick-reply-editor"],this.root),i=qs(),s=new XA(this.mainEditor,t,i);s.editor.addListener("docChanged",this.handleDocChange),s.editor.addListener("focus",this.handleFocus),s.editor.input.addHandler(new OW(this.groupItem)),r.append(s.root);const o=B("div",["reply-editor-actions"],r),l=qr(he.QuickReplyCancel,YA("common.cancel"));so(l,he.QuickReplyCancel);const c=qr(he.QuickReplyOk,YA("comment.send"),void 0,["primary","disabled"]);return so(c,he.QuickReplyOk),o.append(l,c),this.hideReplyEditor(),{replyTextButton:e,replyEditor:s,replyEditorContainer:r,okButton:c}}destroy(){this.components.replyEditor.destroy()}}const Tl=D("comment-group-item");class zW extends Ve.TypedEmitter{constructor(e,r,i,s){super();m(this,"root");m(this,"header");m(this,"mainItem");m(this,"childrenList");m(this,"resizeObserver");m(this,"quickReply");m(this,"createRoot",()=>B("div",["comment-group-item-root"],null));m(this,"createChildrenList",()=>{const e=B("div",["comment-children-list-container"],this.root);return new VW({editor:this.editor,commentsProvider:this.commentsProvider,comments:this.comment.children,parent:e,groupList:this.groupList,groupItem:this})});m(this,"updateLastCommentItem",()=>{const e=Array.from(this.root.querySelectorAll(":scope .comment-item-root"));p(Tl,e.length!==0,"current group item not exist comment-item"),e.forEach(i=>{ut(i,qw)});const r=e[e.length-1];q(r,qw)});m(this,"updateSwitchButton",()=>{const e=this.root.querySelector(':scope .editor-text-button[group-item-action="switch-up"]'),r=this.root.querySelector(':scope .editor-text-button[group-item-action="switch-down"]');p(Tl,e,"switchUpButton not exist"),p(Tl,r,"switchDownButton not exist"),ut(r,"disabled"),ut(e,"disabled"),this.root.previousElementSibling===null&&q(e,"disabled"),this.root.nextElementSibling===null&&q(r,"disabled")});m(this,"handleReadonlyChanged",e=>{e.readonly?q(this.root,"readonly"):ut(this.root,"readonly")});m(this,"getCommentEditor",()=>this.mainItem.getCommentEditor());m(this,"handleResize",()=>{this.emit("resize")});this.editor=e,this.commentsProvider=r,this.comment=i,this.groupList=s,this.root=this.createRoot(),this.header=this.createHeader(),this.mainItem=this.createItem(),this.childrenList=this.createChildrenList(),this.quickReply=this.createQuickReply(),this.editor.on("readonlyChanged",this.handleReadonlyChanged),this.resizeObserver=new Yl(this.handleResize),this.resizeObserver.observe(this.root),this.updateLastCommentItem()}get commentCount(){return Yw(this.root)}createQuickReply(){const{editor:e,commentsProvider:r,comment:i}=this,s=new jW(e,r,i,this);return this.root.append(s.root),s}createHeader(){const{comment:e}=this,r=B("div",["comment-item-head"],this.root),i=B("span",["item-head-quote"],r);i.innerText=e.abstract;const s=B("span",["item-head-switch"],r),o=Ra(s,he.SwitchUp,"up",$W),l=Ra(s,he.SwitchDown,"down",HW);return so(o,he.SwitchUp),so(l,he.SwitchDown),r}createItem(){const e=B("div",["comment-item-container"],this.root),{editor:r,commentsProvider:i,comment:s,groupList:o}=this,l=new l4({mainEditor:r,commentsProvider:i,comment:s,groupList:o,groupItem:this});return e.appendChild(l.root),l}findCommentItem(e){return e?e===this.mainItem.comment.id?this.mainItem:this.childrenList.items.find(r=>r.comment.id===e):null}handleCreateComment(e){return p(Tl,ku(e),"invalid comment, not a child comment"),p(Tl,e.groupId===this.comment.id,"invalid comment, not a child comment"),this.childrenList.createItem(e)}handleUpdateChildComment(e){const r=this.childrenList.findItem(e.id);if(!r){Tl.error(`can't find child comment item: ${e.id}`);return}r.reloadDoc()}handleUpdateMainComment(e){p(Tl,e.id===this.mainItem.comment.id,"invalid comment"),this.mainItem.reloadDoc()}deleteMainComment(e){p(Tl,e===this.mainItem.comment.id,"invalid comment"),this.mainItem.destroy()}edit(){this.mainItem.edit()}destroy(){this.quickReply.destroy(),this.mainItem.destroy(),this.childrenList.destroy(),this.root.remove(),this.resizeObserver.disconnect(),this.removeAllListeners(),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged)}}const GW=D("arrange=items"),c4=20;function u4(n,t){const e=n.rootContainer.querySelector(`[comment-${t.toLocaleLowerCase()}=${t}]`);if(!e)return-1;const r=n.scrollContainer.getBoundingClientRect(),i=n.scrollContainer.scrollTop;return e.getBoundingClientRect().top-r.top+i}function f4(n,t){return Number.parseInt(t.root.style.top,10)}function d4(n,t,e,r){let i=0;e&&(i=t.indexOf(e),i===-1&&(i=0));for(let s=i;s<t.length;s++){const o=t[s],l=o.comment,c=u4(n,l.groupId);if(o.root.setAttribute("data-target-top",c.toString()),s===i){if(r!==void 0){const C=t[0];C.root.style.top=`${r}px`}else o.root.style.top=`${c}px`;continue}const d=t[s-1],h=f4(n,d)+d.root.getBoundingClientRect().height;h>c?o.root.style.top=`${h+c4}px`:o.root.style.top=`${c}px`}for(let s=i-1;s>=0;s--){const o=t[s],l=o.comment,c=u4(n,l.groupId);o.root.setAttribute("data-target-top",c.toString());const d=o.root.getBoundingClientRect(),h=c+d.height,C=t[s+1];p(GW,C,"no next item");const E=f4(n,C);E<h?o.root.style.top=`${E-d.height-c4}px`:o.root.style.top=`${c}px`}}const kg=D("comment-group-item-handler");class WW{constructor(t,e){m(this,"handleSwitchUp",t=>{const e=Math.max(0,t-1);this.groupList.setActiveItem(e,"prev"),this.groupList.updateItemsLayout()});m(this,"handleSwitchDown",t=>{const e=Math.min(t+1,this.groupList.items.length);this.groupList.setActiveItem(e,"next"),this.groupList.updateItemsLayout()});m(this,"handleQuickReply",t=>{const{quickReply:e}=t;e.showReplyEditor()});m(this,"handleQuickReplyOk",t=>{const{quickReply:e}=t;e.reply(),t.updateLastCommentItem()});m(this,"handleQuickReplyCancel",t=>{const{quickReply:e}=t;e.cancel()});m(this,"handleCommentItemReply",(t,e)=>{const r=t.findCommentItem(e);p(kg,r,`the commentItem: ${e} not exist `);const{quickReply:i}=t;i.show(),i.showReplyEditor();const{comment:s}=r,o=i.getReplyEditor(),l=o.editor.getFocusedBlock(),c={type:"mention",id:it(),box:!0,created:Date.now(),text:s.displayName,iconUrl:s.avatarUrl,mentionId:s.userId};o.editor.insertBoxToBlock(l,0,c)});m(this,"handleCommentItemMore",t=>{const{quickReply:e}=t;e.hideReplyEditor(),e.getReplyEditor().clear()});m(this,"handleCommentItemOk",(t,e)=>{const r=t.findCommentItem(e);p(kg,r,`the commentItem: ${e} not exist `);const{quickReply:i}=t,{comment:s,getCommentEditor:o}=r,l=o(),c=l.getDoc();this.commentsProvider.localUpdateComment(s,c),l.readonly(),i.show()});m(this,"handleCommentItemCancel",(t,e)=>{var c,d;const r=t.findCommentItem(e);p(kg,r,`the commentItem: ${e} not exist `);const i=this.commentsProvider.getComment(r.comment.id);let s=!1;if((c=i.blocks)!=null&&c.length||(s=!0),((d=i.blocks)==null?void 0:d.length)===1){const h=i.blocks[0];s=!!h.text&&$n(h.text)===0}if(s){this.commentsProvider.localDeleteComment(r.comment.id);return}const{quickReply:o}=t,l=r.getCommentEditor();l.setDoc(r.doc),l.readonly(),o.show()});m(this,"handleCommentItemEdit",t=>{const e=this.groupList.findItemAsGroupId(t.comment.groupId);if(!e)return;const{quickReply:r}=e;t.getCommentEditor().edit(),r.hide()});m(this,"handleCommentItemDelete",t=>{const e=this.groupList.findItemAsGroupId(t.comment.groupId);if(!e)return;const{quickReply:r}=e,{comment:i}=t;this.commentsProvider.localDeleteComment(i.id),r.show()});m(this,"execute",(t,e,r,i)=>{const s=wW(t);if(!s||LW(s))return;const o=SW(s);switch(o){case he.SwitchUp:this.handleSwitchUp(i);break;case he.SwitchDown:this.handleSwitchDown(i);break;case he.CommentItemReply:this.handleCommentItemReply(e,r);break;case he.CommentItemMore:this.handleCommentItemMore(e);break;case he.CommentItemOk:this.handleCommentItemOk(e,r);break;case he.CommentItemCancel:this.handleCommentItemCancel(e,r);break;case he.CommentItemDelete:break;case he.CommentItemEdit:break;case he.QuickReply:this.handleQuickReply(e);break;case he.QuickReplyOk:this.handleQuickReplyOk(e);break;case he.QuickReplyCancel:this.handleQuickReplyCancel(e);break;default:const l=o;kg.debug(`not implement handler for ${l}`)}});this.groupList=t,this.commentsProvider=e}destroy(){}}const Rg=D("comment-group-list");class qW extends Zd{constructor(e,r,i){super(e,r,i,yl(e,r),{});m(this,"groupItemHandlers");m(this,"dispatchScroll",Ue.default(()=>{this.editor.scrollContainer.dispatchEvent(new Event("scroll"))},350));m(this,"closeEditing",e=>{const r=this.items.find(i=>i.comment.id===e);r&&([r,...r.childrenList.items].forEach(i=>{!i.getCommentEditor().editor.readonly&&i.getCommentEditor().isEmpty()&&this.groupItemHandlers.handleCommentItemCancel(r,i.comment.id)}),r.quickReply.getReplyEditor().isEmpty()&&r.quickReply.cancel())});m(this,"setFirstEditingCommentActive",()=>{const e=this.findFirstEditingComment();e!==-1&&this.setActiveItem(e)});m(this,"findGroupItem",e=>this.items.find(r=>r.comment.groupId===e));m(this,"handleContainerClick",e=>{if(!e.target||!(e.target instanceof Element))return;const r=e.target.closest(".comment-group-item-root");if(!r)return;const i=RW(e.target),s=this.items.findIndex(o=>o.root===r);if(s!==-1){this.activeIndex!==s&&this.setActiveItem(s);const{groupItemHandlers:o}=this;o.execute(e.target,this.items[s],i,s)}});m(this,"handleDocumentClick",e=>{if(!e.target||!(e.target instanceof Element))return;const r=e.target;if(r.closest(".comment-group-item-root.active")||r.closest(".editor-context-menu"))return;const o=this.items[this.activeIndex];!o||[o.findCommentItem(o.comment.id),...o.childrenList.items].some(c=>{var h;const d=(h=c==null?void 0:c.moreMenu.tippyInstance)==null?void 0:h.popper;return!!(d!=null&&d.contains(r))})||o!=null&&o.comment&&setTimeout(()=>{this.closeEditing(o.comment.id)})});m(this,"handleSelectionChanged",()=>{setTimeout(()=>{var r;const e=n4(this.editor);if(e.length>0){if(((r=this.activeItem)==null?void 0:r.comment.id)&&e.includes(this.activeItem.comment.id))return;const i=e[0],s=this.items.findIndex(o=>o.comment.groupId===i);this.setActiveItem(s),this.emit("selectionOnComment")}else this.setActiveItem(-1)})});m(this,"handleEditorResize",()=>{this.updateItemsLayout()});m(this,"handleDocChanged",()=>{this.updateComments()});m(this,"handleItemResize",()=>{this.updateItemsLayout()});m(this,"handleScroll",e=>{if(e.deltaY>=0||this.editor.scrollContainer.scrollTop!==0)return;const r=Oe(e.clientX,e.clientY);if(!r||!(r instanceof HTMLElement)||!this.editor.scrollContainer.contains(r))return;const i=this.container.querySelector(".comment-group-item-root");if(!i)return;const s=Number.parseFloat(i.style.top),o=Number.parseFloat(i.getAttribute("data-target-top")||"0");!Number.isNaN(s)&&!Number.isNaN(o)&&s<o&&d4(this.editor,this.items,null,Math.min(s+(0-e.deltaY)*3,o))});m(this,"updateGroupItemSwitch",()=>{const e=this.activeItem;p(Rg,e,"invalid activeItem"),e.updateSwitchButton()});m(this,"updateComments",Ue.default(()=>{const e=yl(this.editor,this.commentsProvider);let r=!1;for(let i=0;i<e.length;i++){const s=e[i];if(!this.findGroupItem(s.groupId)){this.handleCreateComment(s,!1),r=!0;continue}}for(let i=this.items.length-1;i>=0;i--){const s=this.items[i];e.findIndex(o=>o.groupId===s.comment.groupId)===-1&&(this.deleteItem(s.comment.id),r=!0)}r&&(this.updateItemsLayout(),this.emit("commentCountChanged"))},100));this.updateItemsLayout(),this.bindEvents(),this.editor.addListener("selectionChanged",this.handleSelectionChanged),this.editor.addListener("resize",this.handleEditorResize),this.editor.addListener("docChanged",this.handleDocChanged),this.editor.scrollContainer.addEventListener("wheel",this.handleScroll,{passive:!1}),this.items.forEach(s=>s.addListener("resize",this.handleItemResize)),this.groupItemHandlers=new WW(this,r),document.addEventListener("click",this.handleDocumentClick)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChanged),this.editor.removeListener("resize",this.handleEditorResize),this.editor.removeListener("docChanged",this.handleDocChanged),this.editor.scrollContainer.removeEventListener("wheel",this.handleScroll),super.destroy(),this.unbindEvents(),this.removeAllListeners(),document.removeEventListener("click",this.handleDocumentClick)}updateItemsLayout(){d4(this.editor,this.items,this.activeItem),this.dispatchScroll()}bindEvents(){this.container.addEventListener("click",this.handleContainerClick)}unbindEvents(){this.container.removeEventListener("click",this.handleContainerClick)}createItem(e,r){const i=new zW(this.editor,this.commentsProvider,e,this);return r==="insert"&&(q(i.root,"no-animation"),i.root.style.opacity="0",setTimeout(()=>{ut(i.root,"no-animation"),i.root.style.opacity="1"},150)),i}findInsertPos(e){const i=yl(this.editor,this.commentsProvider).findIndex(s=>s.id===e.id);return i===-1||i>this.items.length?-1:i}insertItem(e,r){const i=super.insertItem(e);return i?(r!=null&&r.active&&this.setActiveItem(this.items.indexOf(i)),this.updateItemsLayout(),i.addListener("resize",this.handleItemResize),i):null}findFirstEditingComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if((e||!i.quickReply.getReplyEditor().isEmpty())&&!i.quickReply.getReplyEditor().editor.readonly)return r;const s=[i,...i.childrenList.items];for(let o=0;o<s.length;o++){const l=s[o];if(!l.getCommentEditor().editor.readonly&&(e||!l.getCommentEditor().isEmpty()))return r}}return-1}isEditing(e){return this.findFirstEditingComment(e)!==-1}setActiveItem(e,r){if(p(Rg,e>=-1&&e<this.items.length,`invalid index: ${e}`),e===this.activeIndex)return;const i=this.container.querySelector(".comment-group-item-root.active");if(i){const s=this.items[this.activeIndex];setTimeout(()=>{this.closeEditing(s.comment.id)}),ut(i,"active")}if(e!==-1){const s=this.items[e];q(s.root,"active"),this.updateItemsLayout(),this.updateGroupItemSwitch()}this.emit("activeItemChanged",e,r)}get activeIndex(){const e=this.container.querySelector(".comment-group-item-root.active");return e?this.items.findIndex(r=>r.root===e):-1}get activeItem(){const e=this.activeIndex;return e===-1?null:this.items[e]}handleCreateComment(e,r){if(ku(e)){const l=this.findGroupItem(e.groupId);l&&l.childrenList.insertItem(e)}const i=this.findItem(e.id);p(Rg,!i,"comment group item has already exists");const s={children:[],...e};p(Rg,s.children,"not a comment group");const o=this.insertItem(s,{active:r});if(!!o&&r){const l=this.items.indexOf(o);this.setActiveItem(l),o.quickReply.hide(),setTimeout(()=>{o.edit()},300)}}handleDeleteComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if(i.comment.id===e){i.childrenList.items.length===0?(this.deleteItem(i.comment.id),this.updateItemsLayout()):i.deleteMainComment(e);return}if(i.childrenList.deleteItem(e)){i.commentCount===0&&(this.deleteItem(i.comment.id),this.updateItemsLayout());return}}}handleUpdateComment(e){const r=this.findItemAsGroupId(e.groupId);if(r&&r.comment.id!==e.id){r.handleUpdateChildComment(e);return}const i=this.findItem(e.id);i&&i.handleUpdateMainComment(e)}}const XW="comment-mini";D("comment-list");class YW extends Ve.TypedEmitter{constructor(e,r){super();m(this,"root");m(this,"groupsContainer");m(this,"list");m(this,"handleSelectionOnComment",()=>{this.emit("onSelectComment")});m(this,"updateCommentCount",()=>{var r,i;const e=_W(this.editor,this.commentsProvider);(i=(r=this.commentOptions)==null?void 0:r.onCommentCountChange)==null||i.call(r,e)});m(this,"handleActiveItemChanged",(e,r)=>{var s,o;const i=this.list.activeItem;i4(this.editor,(o=(s=i==null?void 0:i.comment)==null?void 0:s.groupId)!=null?o:"",r)});m(this,"handleItemLayoutUpdated",()=>{var r,i;const e=Mt(this.root,XW);(i=(r=this.commentOptions)==null?void 0:r.onUpdateLayout)==null||i.call(r,this.editor,{expand:e})});this.editor=e,this.commentsProvider=r,this.root=B("div",["editor-web-comment-root"],null),this.groupsContainer=B("div",["comment-groups-container"],this.root),this.list=this.createList(),this.commentsProvider.addListener(this),this.list.addListener("activeItemChanged",this.handleActiveItemChanged),this.list.addListener("itemLayoutUpdated",this.handleItemLayoutUpdated),this.list.addListener("selectionOnComment",this.handleSelectionOnComment),this.list.addListener("commentCountChanged",this.updateCommentCount),this.updateCommentCount()}get commentOptions(){return this.editor.getComponentOptions("comment")}destroy(){this.list.removeAllListeners(),this.commentsProvider.removeListener(this),this.list.destroy(),this.root.remove()}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r),this.updateCommentCount()}onDeleteComment(e,r){this.list.handleDeleteComment(e),this.updateCommentCount()}onUpdateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleUpdateComment(i)}createList(){return new qW(this.editor,this.commentsProvider,this.groupsContainer)}isEditing(e){return this.list.isEditing(e)}setFirstEditingCommentActive(){this.list.setFirstEditingCommentActive()}show(e){var r;if(ut(this.root,"hidden"),e){const i=this.list.findItemIndex(e);this.list.setActiveItem(i)}(r=this.commentOptions)==null||r.controller.showCommentList()}hide(){q(this.root,"hidden")}}class QW extends Zd{constructor({editor:t,parent:e,commentsProvider:r,comments:i}){super(t,r,e,i,{})}findInsertPos(){return this.items.length}createItem(t){const{editor:e,commentsProvider:r}=this;return new a4(e,r,t)}destroy(){this.items.forEach(t=>{t.destroy()})}}const wg=D("mobile-comment-group-item"),JW=20;class ZW extends Ve.TypedEmitter{constructor(e,r,i){super();m(this,"root");m(this,"childrenList");m(this,"mainItem");m(this,"scroller");m(this,"createRoot",()=>B("div",["mobile-group-item-root"],null));m(this,"createMainItem",e=>{const{editor:r,commentsProvider:i,comment:s}=this,o=new a4(r,i,s);return e.append(o.root),o});m(this,"createChildrenList",e=>{const{editor:r,commentsProvider:i,comment:s}=this,o=B("div",["mobile-comment-children-list-container"],e);return new QW({editor:r,commentsProvider:i,comments:s.children,parent:o})});m(this,"handleTouchEnd",()=>{var s;const{scroller:e}=this,{pullThreshold:r=JW}=(s=this.editor.getComponentOptions("comment"))!=null?s:{};let i=null;if(e.y>e.minScrollY+r?(i=this.root.previousElementSibling,i||this.emit("onReachTop")):e.y<e.maxScrollY-r&&(i=this.root.nextElementSibling,i||this.emit("onReachBottom")),i){const o=i.id;this.emit("onSwitchGroup",o,Xw)}});m(this,"refreshScroller",()=>{this.scroller.refresh()});this.editor=e,this.commentsProvider=r,this.comment=i,this.root=B("div",["mobile-group-item-root"],null),this.root.id=i.groupId;const s=B("div",["mobile-group-item"],this.root),o=B("div",["mobile-group-item-space"],null),l=B("div",["mobile-group-item-abstract"],null);l.textContent=i.abstract;const c=B("div",["mobile-group-item-list-container"],null);this.mainItem=this.createMainItem(c),this.childrenList=this.createChildrenList(c),s.append(o,l,c),this.scroller=new Tb.default(this.root,{stopPropagation:!0,click:!0}),this.scroller.on("touchEnd",this.handleTouchEnd)}get commentCount(){return Yw(this.root,".mobile-group-item")}handleUpdateChildComment(e){p(wg,e.groupId===this.mainItem.comment.id,"invalid child comment");const r=this.childrenList.findItem(e.id);if(!r){wg.error(`can't find child comment item: ${e.id}`);return}r.reloadDoc()}handleUpdateMainComment(e){p(wg,e.id===this.mainItem.comment.id,"invalid comment"),this.mainItem.reloadDoc()}deleteMainComment(e){p(wg,e===this.mainItem.comment.id,"invalid comment"),this.mainItem.destroy()}destroy(){this.mainItem.destroy(),this.childrenList.destroy(),this.scroller.off("touchEnd",this.handleTouchEnd),this.scroller.destroy(),this.root.remove(),this.removeAllListeners()}}const QA=D("mobile-group-list");class tq extends Zd{constructor(e,r,i,s){super(e,r,i,yl(e,r),{});m(this,"scroller");m(this,"refreshScroller",()=>{this.scroller.refresh(),this.items.forEach(e=>{e.refreshScroller()})});m(this,"deleteItem",e=>{if(this.items.length<=1)return super.deleteItem(e);const r=this.findItemIndex(e);let i=null;return r===0?i=this.items[r+1].root.id:i=this.items[r-1].root.id,super.deleteItem(e)?(this.scrollToGroup(i,Xw),!0):!1});m(this,"setupGroupItem",e=>{e.on("onSwitchGroup",this.scrollToGroup),e.on("onReachBottom",this.handleReachBottom),e.on("onReachTop",this.handleReachTop),e.refreshScroller()});m(this,"handleReachBottom",()=>{this.emit("onReachBottom")});m(this,"handleReachTop",()=>{this.emit("onReachTop")});m(this,"scrollToGroup",(e,r=0)=>{const i=this.findGroupItem(e);p(QA,i,"invalid scroll target"),this.scroller.scrollToElement(i.root,r,!1,!1),i4(this.editor,i.comment.groupId)});m(this,"findGroupItem",e=>this.items.find(r=>r.comment.groupId===e));m(this,"handleDocChanged",()=>{this.updateComments()});m(this,"updateComments",Ue.default(()=>{const e=yl(this.editor,this.commentsProvider);for(let r=0;r<e.length;r++){const i=e[r];if(!this.findGroupItem(i.groupId)){this.handleCreateComment(i,!1);continue}}for(let r=this.items.length-1;r>=0;r--){const i=this.items[r];e.findIndex(s=>s.groupId===i.comment.groupId)===-1&&this.deleteItem(i.comment.id)}},100));this.scroller=new Tb.default(s),this.scroller.disable(),this.editor.addListener("docChanged",this.handleDocChanged),this.items.forEach(this.setupGroupItem)}createItem(e){return new ZW(this.editor,this.commentsProvider,e)}insertItem(e){const r=super.insertItem(e);return r?(this.setupGroupItem(r),r):null}findInsertPos(e){const i=yl(this.editor,this.commentsProvider).findIndex(s=>s.id===e.id);return i===-1||i>this.items.length?-1:i}setActiveItem(e){this.scrollToGroup(e)}handleCreateComment(e,r){if(ku(e)){const o=this.findGroupItem(e.groupId);o&&o.childrenList.insertItem(e)}const i=this.findItem(e.id);p(QA,!i,"comment group item has already exists");const s={children:[],...e};p(QA,s.children,"not a comment group"),this.insertItem(s),this.scroller.refresh()}handleDeleteComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if(i.comment.id===e){i.childrenList.items.length===0?this.deleteItem(i.comment.id):i.deleteMainComment(e);return}if(i.childrenList.deleteItem(e)){i.commentCount===0&&this.deleteItem(i.comment.id);return}}}handleUpdateComment(e){if(ku(e)){const i=this.commentsProvider.getComment(e.groupId),s=this.findItem(i.id);s&&s.handleUpdateChildComment(e);return}const r=this.findItem(e.id);r&&r.handleUpdateMainComment(e)}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged),this.scroller.destroy(),this.items.forEach(e=>e.destroy())}}const eq=D("mobile-comment-list"),{t:h4}=_;class nq extends Ve.TypedEmitter{constructor(e,r){super();m(this,"root");m(this,"list");m(this,"mask");m(this,"pullInfoContainer");m(this,"handleRootClick",e=>{const r=e.target;p(eq,r instanceof Element,"invalid target"),!(r.closest(".mobile-group-item-abstract")||r.closest(".mobile-group-item-list-container"))&&(this.hide(),this.emit("onCommentListClose"))});m(this,"hidePullInfo",Ue.default(()=>{ut(this.pullInfoContainer,"active")},1e3*3));m(this,"handleReachBottom",()=>{this.showPullInfo("bottom")});m(this,"handleReachTop",()=>{this.showPullInfo("top")});m(this,"show",e=>{var r;ut(this.root,"hidden"),q(document.documentElement,"disabled-scroll"),(r=this.commentOptions)==null||r.controller.showCommentList(),queueMicrotask(()=>{this.list.refreshScroller(),e&&this.list.setActiveItem(e)})});m(this,"hide",()=>{q(this.root,"hidden"),ut(document.documentElement,"disabled-scroll")});this.editor=e,this.commentsProvider=r,this.root=B("div",["editor-mobile-comments-root"],null),this.mask=B("div",["mobile-comment-mask"],this.root);const i=B("div",["mobile-comment-groups-container"],this.root),s=B("div",["mobile-comment-groups-scroll-container"],i);this.list=new tq(this.editor,this.commentsProvider,s,i),this.pullInfoContainer=this.createPullInfo(),this.commentsProvider.addListener(this),this.list.on("onReachBottom",this.handleReachBottom),this.list.on("onReachTop",this.handleReachTop),this.root.onclick=this.handleRootClick}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r)}onDeleteComment(e,r){this.list.handleDeleteComment(e)}onUpdateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleUpdateComment(i)}get commentOptions(){return this.editor.getComponentOptions("comment")}createPullInfo(){const e=B("div",["mobile-comment-pull-info-container"],this.root);return B("div",["mobile-comment-pull-info"],e),e}showPullInfo(e){const r=h4(e==="bottom"?"comment.isLast":"comment.isFirst");this.pullInfoContainer.firstElementChild.textContent=r,q(this.pullInfoContainer,"active"),this.hidePullInfo()}isEditing(){return!1}destroy(){this.list.removeAllListeners(),this.list.destroy(),this.root.onclick=null}}function m4(n,t){const e=yl(n,t),r=new Map;for(const i of e){const s=Qw(n,i.groupId);if(!!s)if(r.has(s)){const o=r.get(s);e4(i).forEach(c=>{o==null||o.commentIds.add(c.id)})}else{const o=e4(i),l=new Set(o.map(c=>c.id));r.set(s,{commentIds:l,firstComment:i})}}return Array.from(r.entries()).map(([i,s])=>({blockId:i,...s}))}const rq=D("mini-group-item");class iq{constructor(t,e){m(this,"root");m(this,"blockId");m(this,"comment");m(this,"miniCommentItem");m(this,"updateCommentItemCount",()=>{this.miniCommentItem.updateCount(this.commentCount)});this.editor=t,this.commentGroup=e,this.root=B("div",["mini-group-item"],null),this.comment=e.firstComment,this.miniCommentItem=new KW(this.comment.id,this.root),this.blockId=this.getBlockId(),setTimeout(()=>{this.alignToBlock()}),this.updateCommentItemCount()}getBlockId(){return Qw(this.editor,this.comment.groupId)}get commentCount(){return this.commentGroup.commentIds.size}alignToBlock(){const t=this.getBlockId();if(!t)return;const e=this.editor.getBlockById(t);p(rq,e,`The blockId: ${t} not exist in doc`);const r=this.editor.scrollContainer.getBoundingClientRect(),i=this.editor.scrollContainer.scrollTop,o=e.getBoundingClientRect().top-r.top+i;requestAnimationFrame(()=>{this.root.style.transform=`translateY(${o}px)`})}destroy(){this.root.remove()}}class sq extends Zd{constructor(e,r,i){super(e,r,i,m4(e,r),{});m(this,"fixListOps",Ue.default(()=>{this.items.forEach(e=>{e.alignToBlock()})},100));m(this,"handleDocChanged",Ue.default(()=>{this.updateMiniCommentsGroup()},100));m(this,"updateMiniCommentsGroup",()=>{const e=m4(this.editor,this.commentsProvider);this.reloadList(e)});this.editor=e,this.commentsProvider=r,this.editor.addListener("docChanged",this.handleDocChanged),this.editor.addListener("resize",this.fixListOps)}createItem(e){return new iq(this.editor,e)}findInsertPos(){return-1}handleCreateComment(e,r){this.updateMiniCommentsGroup()}handleDeleteComment(e){this.updateMiniCommentsGroup()}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged),super.destroy(),this.removeAllListeners()}}const oq=D("mini-comments-list");class lq extends Ve.TypedEmitter{constructor(e,r){super();m(this,"list");m(this,"root");m(this,"createList",()=>{const e=B("div",["comment-groups-container"],this.root);return this.editor.domEvents.addEventListener(e,"click",this.handleListContainerClick),new sq(this.editor,this.commentsProvider,e)});m(this,"handleListContainerClick",(e,r)=>{const i=r.target;p(oq,i instanceof HTMLElement,"The target is not a valid html element");const s=i.closest(".mini-comment-item");s&&this.emit("onItemClick",s.id)});this.editor=e,this.commentsProvider=r,this.root=B("div",["editor-mini-comment-root"],null),this.list=this.createList(),this.commentsProvider.addListener(this)}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r)}onDeleteComment(e,r){this.list.handleDeleteComment(e)}onUpdateComment(e,r){}show(){ut(this.root,"hidden")}hide(){q(this.root,"hidden")}destroy(){this.list.destroy(),this.removeAllListeners()}}function g4(n,t,e){if(!t.start.isSimple()||!t.end.isSimple())return;const r=t.block,i=Pe(n,r,t.start.offset,t.end.offset),s=`comment-${e.id.toLocaleLowerCase()}`,o=e.id;YB(n,r,i,s,o)}function aq(n,t,e){const r=Ji(n).map(o=>o.block),i=jA(n,r),s=yg({editor:n,abstract:i});return n.undoManager.runInGroup(()=>{Ji(n,{simpleBlockOnly:!0}).forEach(c=>{!ot(n,c.block)||g4(n,c,s)});const l=qs();e.localCreateComment(s,l)}),s}class cq{constructor(t,e){m(this,"id","CommentsCommandProvider");this.provider=t,this.editorComments=e}getAvailableCommands(t,e,r){const i=t.selection.range;if(ot(t,e)&&!r.isCollapsed()&&i.isSimple()){const s=dt(e),o=Ot(e),l=gi(t,e);return[{id:"add-comment",name:_.t("comment.command"),blockId:s,blockType:o,blockKind:l,groupIndex:1e3,icon:Aa}]}return[]}hideToolbar(t){const e=t.findCustom("toolbar-handler");e==null||e.disableTextToolbar(),e==null||e.hide(),setTimeout(()=>{e==null||e.enableTextToolbar()},300)}executeRangeCommand(t,e,r,i,s){if(r.id==="add-comment"){this.editorComments.showCommentList();const o=aq(t,e,this.provider);return s["add-comment"]=o,this.hideToolbar(t),!0}return!1}}class p4{constructor(t,e){m(this,"commentList",null);m(this,"mobileCommentList",null);m(this,"miniCommentList");m(this,"showComment",(t,e)=>{var r,i;t==="mini"&&this.miniCommentList.show(),t==="mobile"&&((r=this.mobileCommentList)==null||r.show(e)),t==="web"&&((i=this.commentList)==null||i.show(e))});m(this,"showCommentList",t=>{this.isMobile?this.showComment("mobile",t):this.showComment("web",t)});m(this,"handleCommentListClose",()=>{this.showComment("mini")});m(this,"handleOnSelectComment",()=>{this.showComment("web")});m(this,"handleMiniCommentItemClick",t=>{this.showCommentList(t)});this.editor=t,this.provider=e,t.editorCommandProviders.registerCommandProvider(new cq(e,this)),t.blockHooks.push(new yW(this.provider,this)),this.isMobile?(this.mobileCommentList=new nq(this.editor,this.provider),this.mobileCommentList.on("onCommentListClose",this.handleCommentListClose)):(this.commentList=new YW(this.editor,this.provider),this.commentList.on("onSelectComment",this.handleOnSelectComment)),this.miniCommentList=new lq(this.editor,this.provider),this.miniCommentList.on("onItemClick",this.handleMiniCommentItemClick),this.editor.input.addHandler(new TW)}get commentProvider(){return this.provider}get isMobile(){return Ae.isMobile}destroy(){var t,e;(t=this.commentList)==null||t.destroy(),(e=this.mobileCommentList)==null||e.destroy(),this.miniCommentList.destroy()}setFirstEditingCommentActive(){var t;(t=this.commentList)==null||t.setFirstEditingCommentActive()}isEditing(t){var e,r;return((e=this.commentList)==null?void 0:e.isEditing(t))||((r=this.mobileCommentList)==null?void 0:r.isEditing())||!1}mount(t){var e;t.container&&this.commentList&&t.container.append((e=this.commentList)==null?void 0:e.root),t.miniContainer&&t.miniContainer.append(this.miniCommentList.root),t.mobileContainer&&this.mobileCommentList&&t.mobileContainer.append(this.mobileCommentList.root)}}const xat="",uq={comment:{count:"\u6279\u6CE8 ({num})",hide:"\u9690\u85CF\u6279\u6CE8",show:"\u663E\u793A\u6279\u6CE8",reply:"\u56DE\u590D",quicklyReply:"\u56DE\u590D...",send:"\u786E\u5B9A",placeholder:"\u6DFB\u52A0\u6279\u6CE8...",replyPlaceholder:"\u6DFB\u52A0\u6279\u6CE8\u6216@\u4ED6\u4EBA",edit:"\u7F16\u8F91",delete:"\u5220\u9664",image:"\u56FE\u7247",sendTitle:"\u6309Enter\u53D1\u9001\u6279\u6CE8",replyTitle:"\u6309Enter\u56DE\u590D\u6279\u6CE8",isFirst:"\u5DF2\u7ECF\u662F\u7B2C\u4E00\u6761\u6279\u6CE8",isLast:"\u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u6761\u6279\u6CE8",more:"\u66F4\u591A",comment:"\u6279\u6CE8",command:"\u6279\u6CE8",quickMenuCommand:"\u6DFB\u52A0\u6279\u6CE8"}},fq={comment:{count:"Annotations ({num})",hide:"Hide Annotations",show:"Show Annotations",reply:"Reply",quicklyReply:"Reply...",send:"Confirm",placeholder:"Add a annotation...",replyPlaceholder:"Add annotation or mention someone",edit:"Edit",delete:"Delete",image:"Image",sendTitle:"Press Enter to post annotation",replyTitle:"Press Enter to reply to annotation",isFirst:"This is already the first comment",isLast:"This is already the last comment",more:"More",comment:"Annotation",command:"Annotation",quickMenuCommand:"Add annotation"}},dq={comment:{count:"\u6CE8\u91C8 ({num})",hide:"\u6CE8\u91C8\u3092\u975E\u8868\u793A",show:"\u6CE8\u91C8\u3092\u8868\u793A",reply:"\u8FD4\u4FE1",quicklyReply:"\u8FD4\u4FE1...",send:"\u78BA\u5B9A",placeholder:"\u6CE8\u91C8\u3092\u8FFD\u52A0...",replyPlaceholder:"\u6CE8\u91C8\u3092\u8FFD\u52A0\u3059\u308B\u304B\u30E1\u30F3\u30D0\u30FC\u3092\u30E1\u30F3\u30B7\u30E7\u30F3",edit:"\u7DE8\u96C6",delete:"\u524A\u9664",image:"\u753B\u50CF",sendTitle:"Enter\u3092\u62BC\u3057\u3066\u6CE8\u91C8\u3092\u9001\u4FE1",replyTitle:"Enter\u3092\u62BC\u3057\u3066\u6CE8\u91C8\u3092\u8FD4\u4FE1",isFirst:"\u6700\u521D\u306E\u6CE8\u91C8\u3067\u3059",isLast:"\u6700\u5F8C\u306E\u6CE8\u91C8\u3067\u3059",more:"\u305D\u306E\u4ED6",comment:"\u6CE8\u91C8",command:"\u6CE8\u91C8",quickMenuCommand:"\u6CE8\u91C8\u3092\u8FFD\u52A0"}};_.mergeLang({"zh-CN":uq,"en-US":fq,"ja-JP":dq});class C4{renderText(t,e,r){const i=[],s={};return Object.entries(r).forEach(([o,l])=>{o.startsWith("comment-")&&(i.push("comment"),s[o]=l)}),{classes:i,attributes:s}}renderBox(t,e,r){const i=[],s={};return Object.entries(r).forEach(([o,l])=>{o.startsWith("comment-")&&(i.push("comment"),s[o]=l)}),{classes:i,attributes:s}}renderBlock(t,e,r){const i=r.comments;if(!i||i.length===0)return{};const s=["comment"],o={};return i.forEach(l=>{o[`comment-${l.toLocaleLowerCase()}`]=l}),{classes:s,attributes:o}}updateBlock(t,e,r,i){const s=i.comments;ut(r,"comment"),Array.from(r.attributes).forEach(o=>{o.name.startsWith("comment-")&&r.removeAttribute(o.name)}),!(!s||s.length===0)&&(q(r,"comment"),s.forEach(o=>{r.setAttribute(`comment-${o.toLocaleLowerCase()}`,o)}))}}class hq{constructor(t){m(this,"handleUpdateCompositionText",(t,e,r,i,s)=>{const o=t.getFocusedBlock(),l=t.getFirstBlock();o===l&&this.applyPlaceholder(t)});m(this,"handleSelectionChange",t=>{this.applyPlaceholder(t)});m(this,"applyPlaceholder",t=>{const e=t.getFirstBlock();Ud(t,e,_.t("comment.replyPlaceholder"))});this.applyPlaceholder(t),t.addListener("selectionChanged",this.handleSelectionChange)}}function mq(n,t,e){const r=n.getBlockData(t),i=r.comments;if((i==null?void 0:i.indexOf(e))!==-1){const o=new Set(i);o.delete(e),n.updateBlockData(t,{comments:Array.from(o)})}const s=r.text;if(!!s&&ot(n,t)){const o=b1(s,`comment-${e.toLocaleLowerCase()}`,e,{handleBox:!0,ignoreValue:!1});gf.default(s,o)||n.setBlockText(t,o)}}const gq=D("editor-comment");function pq(n){const t=n.getCustom("editor-comments");if(p(gq,t,"the editor comment not exist"),t.showCommentList(),n.selection.range.isCollapsed()){const o=n.selection.startBlock,l=Zo(o);if(l.length>=2){const{containerId:c}=l[l.length-1],d=nt(hi(n,c));if(d&&Ot(d)==="code"){zA(n,d,t.commentProvider);return}}zA(n,o,t.commentProvider);return}const e=Ji(n,{simpleBlockOnly:!0}),r=e.map(o=>o.block),i=jA(n,r),s=yg({editor:n,abstract:i});n.undoManager.runInGroup(()=>{e.forEach(l=>{ot(n,l.block)?g4(n,l,s):Ww(n,l.block,s)});const o=qs();t.commentProvider.localCreateComment(s,o)})}const JA=D("text-styles");function Cq(n){const t=r=>{if(!r.attributes)return new Map;const i=Object.entries(r.attributes).filter(([s])=>!!s.startsWith("style-"));return new Map(i)};if(n.length===0)return new Map;let e=t(n[0]);for(let r=1;r<n.length;r++){if(js(n[r]))continue;const i=t(n[r]);e=new Map(Array.from(e.entries()).filter(([s,o])=>i.get(s)===o))}return e}function Eq(n,t,e,r,i){p(JA,e.isSimple(),"invalid range");const{start:s,end:o}=e;p(JA,s.blockId===o.blockId&&s.blockId===dt(t),"invalid range"),p(JA,r.startsWith("style-"),"invalid style");let c=n.getBlockText(t);return r==="style-sub"?c=Kc(s.offset,o.offset-s.offset,c,"style-super",i,{ignoreValue:!0}):r==="style-super"&&(c=Kc(s.offset,o.offset-s.offset,c,"style-sub",i,{ignoreValue:!0})),i===!1||i===void 0||i===null?c=Kc(s.offset,o.offset-s.offset,c,r,void 0,{ignoreValue:!0}):c=Nf(s.offset,o.offset-s.offset,c,r,i),n.setBlockText(t,c),c}const Ia=D("text-commands");function E4(n){const t={id:"more",name:_.t("commands.more"),icon:jC,childrenType:"menu",childrenPlacement:"bottom-start",manualShowChildren:!0,children:[]},e={"style-bold":[_.t("commands.bold"),fn("CtrlOrCmd+B"),J2],"style-italic":[_.t("commands.italic"),fn("CtrlOrCmd+I"),Z2],"style-underline":[_.t("commands.underline"),fn("CtrlOrCmd+U"),tT],"style-strikethrough":[_.t("commands.strikethrough"),fn("CtrlOrCmd+D"),eT],"style-code":[_.t("commands.code"),void 0,nT]},r={"style-super":[_.t("commands.superscript"),void 0,iT],"style-sub":[_.t("commands.subscript"),void 0,rT]};if($n(n)===0){const l=Object.entries(e).map(([c,[d,h,C]])=>({id:c,name:d,icon:C,desc:h}));return t.children=Object.entries(r).map(([c,[d,h,C]])=>({id:c,name:d,icon:C,desc:h})),l.concat(t)}const i=Cq(n);function s([l,[c,d,h]]){const C=i.get(l);return C!==void 0?{id:l,name:c,value:C,states:C===!0?["checked"]:void 0,icon:h,desc:d}:{id:l,name:c,icon:h,desc:d}}const o=Object.entries(e).map(s);return t.children=Object.entries(r).map(s),o.concat(t)}function Aq(n,t){const e=dt(t),r=Ot(t),i=gi(n,t);return E4([]).map(s=>({blockId:e,blockType:r,blockKind:i,...s,groupIndex:500}))}function xq(n,t,e){p(Ia,e.isSimple(),"nor a simple range");const{start:r,end:i}=e;p(Ia,r.isSimple(),"is not a simple block position"),p(Ia,i.isSimple(),"is not a simple block position"),p(Ia,ot(n,t),"invalid block type, not a text kind block");const s=dt(t);p(Ia,r.blockId===s&&i.blockId===s,"invalid range");const o=n.getBlockText(t);let l=[];r.offset===i.offset?r.offset!==0&&(l=gn(o,r.offset-1,1).middle):l=gn(o,r.offset,i.offset-r.offset).middle;const c=Ot(t),d=gi(n,t);return E4(l).map((h,C)=>({blockId:s,blockType:c,blockKind:d,...h,groupIndex:500,order:C*100}))}function bq(n,t,e,r,i,s){if(!ot(n,t))return!1;if(!r.startsWith("style-"))return Ia.warn(`unknown command: ${r}`),!1;const o=i==null?void 0:i.value,l=typeof o;if(l!=="string"&&l!=="number"&&l!=="boolean"&&l!=="undefined")return Ia.warn(`invalid value type, accept string | number | boolean | undefined, current is ${l}`),!1;const c=Eq(n,t,e,r,o);return s.result=c,!0}const vq=D("text-command-provider");class ms{constructor(t){m(this,"id","TextCommandProvider");m(this,"emptyTextBlockAttributes",new Map);m(this,"colorItem");m(this,"updateButtonColor",t=>{const e=ZB(this.editor,t,this.getEmptyTextBlockColor);this.colorItem.updateButtonColor(e)});m(this,"handleChangeColor",(t,e)=>{if(t==="color"||t==="backgroundColor")QB(this.editor,t,e,this.setEmptyTextBlockColor);else{const r=["clearAll","clearColor","clearBackground"];JB(this.editor,r[e],this.setEmptyTextBlockColor)}this.colorItem.setLatestColors(t,e)});m(this,"getEmptyTextBlockColor",(t,e)=>{const r=this.getEmptyBlockTextAttributes(t,e);return v1(r)});m(this,"setEmptyTextBlockColor",(t,e,r,i)=>{var o;const s=(o=this.emptyTextBlockAttributes.get(e))!=null?o:{};z3(s,r,i),this.emptyTextBlockAttributes.set(e,s)});this.editor=t,this.colorItem=t.addCustom("text-color-item",()=>new vT(t)),this.colorItem.addListener("onClick",this.handleChangeColor)}destroy(){this.colorItem.destroy()}getAvailableCommands(t,e,r){if(!ot(t,e))return[];if(Li(t))return[];let i;Ct(t,e)===0?i=this.getCommandsOnEmptyText(t,e).map(ms.toTextCommand):i=xq(t,e,r).map(ms.toTextCommand),this.updateButtonColor(r);const o={...this.colorItem,blockId:dt(e),blockKind:gi(t,e),blockType:Ot(e),groupIndex:500,order:350};return i.push(o),i}executeCommand(t,e,r,i,s,o){if(!ot(t,e)||Li(t))return!1;let l=s.value;l===void 0&&(l=!i.value);const c=ms.fromTextCommandId(i.id);if(c.startsWith("style-")){if(c==="style-font")return this.handleChangeColor(s.type,l),!0;if(Ct(t,e)===0)return this.executeCommandOnEmptyText(e,i,{value:l})}return bq(t,e,r,c,{value:l},o)}executeCommandOnEmptyText(t,e,r){let i=this.emptyTextBlockAttributes.get(dt(t));i||(i={},this.emptyTextBlockAttributes.set(dt(t),i));const s=ms.fromTextCommandId(e.id),o=r.value;return o==null||o===!1?(delete i[s],!0):(i[s]=r.value,!0)}getCommandsOnEmptyText(t,e){const r=Aq(t,e);return this.setCommandsStates(r,e)}setCommandsStates(t,e){var s;const r=dt(e),i=(s=this.emptyTextBlockAttributes.get(r))!=null?s:{};return t.map(o=>{const l=i[o.id],c=l?["checked"]:void 0;return o.children&&(o.children=this.setCommandsStates(o.children,e)),{...o,value:l,states:c}})}getEmptyBlockTextAttributes(t,e){var i;const r=At.default((i=this.emptyTextBlockAttributes.get(e))!=null?i:{});if(Array.from(Object.entries(r)).forEach(([s,o])=>{o||delete r[s]}),Object.keys(r).length!==0)return r}static toTextCommand(t){return t.children&&(t.children=t.children.map(ms.toTextCommand)),{...t,id:`text/${t.id}`}}static fromTextCommandId(t){const e="text/";return p(vq,t.startsWith(e),`invalid item id: ${t}`),t.substring(e.length)}static fromTextCommand(t){return{...t,id:this.fromTextCommandId(t.id)}}static toTextCommands(t){return t.map(ms.toTextCommand)}static fromTextCommands(t){return t.map(ms.fromTextCommand)}}function A4(n){const t=n.findCustom("toolbar-handler");t==null||t.disableTextToolbar(),t==null||t.hide(),setTimeout(()=>{t==null||t.enableTextToolbar()},300)}function Bq(n){n.undoManager.canUndo()&&A4(n)}function yq(n){n.undoManager.canRedo()&&A4(n)}const Tq={"CtrlOrCmd+Z":Bq,"CtrlOrCmd+Shift+Z":yq},kq={commands:{bold:"\u7C97\u4F53",italic:"\u659C\u4F53",underline:"\u4E0B\u5212\u7EBF",strikethrough:"\u5220\u9664\u7EBF",code:"\u884C\u5185\u4EE3\u7801",subscript:"\u4E0B\u6807",superscript:"\u4E0A\u6807",more:"\u66F4\u591A"}},Rq={commands:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code",subscript:"Subscript",superscript:"Superscript",more:"More"}},wq={commands:{bold:"\u592A\u5B57",italic:"\u659C\u4F53",underline:"\u4E0B\u7DDA",strikethrough:"\u53D6\u308A\u6D88\u3057\u7DDA",code:"\u30A4\u30F3\u30E9\u30A4\u30F3\u30B3\u30FC\u30C9",subscript:"\u4E0B\u4ED8\u304D\u6587\u5B57",superscript:"\u4E0A\u4ED8\u304D\u6587\u5B57",more:"\u305D\u306E\u4ED6"}};_.mergeLang({"zh-CN":kq,"en-US":Rq,"ja-JP":wq});const Sq={embedProperties:{edit:"\u7F16\u8F91",addComment:"\u6DFB\u52A0\u6279\u6CE8"}},Lq={embedProperties:{edit:"Edit",addComment:"Add annotation"}},Iq={embedProperties:{edit:"\u7DE8\u96C6",addComment:"\u30B3\u30E1\u30F3\u30C8\u3092\u8FFD\u52A0"}};_.mergeLang({"zh-CN":Sq,"en-US":Lq,"ja-JP":Iq});const x4=D("embed-block-properties");function th(n,t){var e;for(const r of n.blockHooks){const i=(e=r.commands)==null?void 0:e.call(r,n,t);if(!!i&&i.group==="block-comment-actions")return i.executeCommand(n,t,i.commands[0]),!0}return!1}class ZA{constructor(t,e,r){m(this,"group","hovering-toolbar");m(this,"_commands",[{id:"edit",name:_.t("embedProperties.edit"),icon:Rm},{id:"add-comment",name:_.t("embedProperties.addComment"),icon:Aa}]);this.editor=t,this.block=e,this.properties=r}get commands(){var i,s,o;if(this.editor.readonly)return[];let t=this._commands;const{enableComments:e=!0}=this.editor.options;e||(t=t.filter(l=>l.id!=="add-comment")),t.forEach(l=>{(l.id==="add-comment"||l.id==="edit")&&(l.states=this.editor.isBlockWritable(this.block)?[]:["disabled"])});let r=(i=this.properties)!=null&&i.presetIds?t.filter(l=>{var c,d;return(d=(c=this.properties)==null?void 0:c.presetIds)==null?void 0:d.includes(l.id)}):[...t];return(o=(s=this.properties)==null?void 0:s.extCommands)!=null&&o.length&&(r.length&&r.push({id:it(),type:"separator",name:""}),r.push(...this.properties.extCommands)),r.length<=3&&(r=r.filter(l=>l.id!=="separator")),r}executeCommand(t,e,r){var i,s;if(!((s=(i=this.properties)==null?void 0:i.handleExecuteCommand)!=null&&s.call(i,t,e,r))){if(r.id==="add-comment"){th(t,e)||x4.error("failed to add comment to block");return}x4.error(`unknown command: ${JSON.stringify(r)}`)}}}function tx(n,t,e){return{blockCommands:{"hovering-toolbar":new ZA(n,t,e)}}}class eh{constructor(t){m(this,"blockResizer");m(this,"handleResizing",(t,e)=>{var i,s;const r=t.getBlock();if(r){if(((s=(i=le(this.editor,r)).notify)==null?void 0:s.call(i,this.editor,"resize",{block:r,rect:e}))===!0)return;const o=Math.max(e.height,100),d={...this.editor.getBlockData(r).embedData,height:o};this.editor.updateEmbedData(r,d)}});m(this,"handleHoveringBlockChange",(t,e)=>{e&&Le(e)&&Mt(e,"resizable")&&this.disableResizer(),t&&Le(t)&&Mt(t,"resizable")&&this.editor.isBlockWritable(t)&&this.tryEnableResizer(t)});this.editor=t,je.get(t).addListener("change",this.handleHoveringBlockChange),this.blockResizer=new Nd(this.editor,{resize:["bottom"]}),this.blockResizer.addListener("resizing",this.handleResizing)}destroy(){je.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}tryEnableResizer(t){this.blockResizer.enableResize(t)}disableResizer(){this.blockResizer.disableResize()}static get(t){return t.addCustom("EmbedBlockResizer",()=>new eh(t))}static register(t,e){return q(e,"resizable"),t.addCustom("EmbedBlockResizer",()=>new eh(t))}}var b4=(n=>(n.Card="card",n.Preview="preview",n))(b4||{});const Dq=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
735
+ </svg>`,Aat="",Tg="reply-editor-editing",{t:YA}=_;class jW{constructor(t,e,r,i){m(this,"root");m(this,"components");m(this,"handleFocus",()=>{const{replyEditor:t,okButton:e}=this.components;t.isEmpty()&&(e.disabled=!0)});m(this,"handleDocChange",()=>{const{replyEditor:t,okButton:e}=this.components,r=t.getDoc();U1(r)?e.disabled=!0:e.disabled=!1});m(this,"getReplyEditor",()=>this.components.replyEditor);m(this,"showReplyEditor",()=>{Mt(this.root,Tg)||(q(this.root,Tg),this.components.replyEditor.edit())});m(this,"hideReplyEditor",()=>{!Mt(this.root,Tg)||(ut(this.root,Tg),this.components.replyEditor.readonly())});m(this,"reply",()=>{const{mainEditor:t,comment:e,components:{replyEditor:r},commentsProvider:i}=this,s=r.getDoc(),o=yg({editor:t,commentGroupId:e.groupId,abstract:this.groupItem.comment.abstract});i.localCreateComment(o,s),this.hideReplyEditor(),r.clear()});m(this,"cancel",()=>{const{replyEditor:t}=this.components;this.hideReplyEditor(),t.clear()});m(this,"hide",()=>{Mt(this.root,"hidden")||q(this.root,"hidden")});m(this,"show",()=>{ut(this.root,"hidden")});this.mainEditor=t,this.commentsProvider=e,this.comment=r,this.groupItem=i,this.root=B("div",["comment-quick-reply"],null),this.components=this.createQuickReply()}createQuickReply(){const{commentsProvider:t}=this,e=Ra(this.root,he.QuickReply,YA("comment.placeholder"));so(e,he.QuickReply),e.classList.add("quick-reply-button");const r=B("div",["quick-reply-editor"],this.root),i=qs(),s=new XA(this.mainEditor,t,i);s.editor.addListener("docChanged",this.handleDocChange),s.editor.addListener("focus",this.handleFocus),s.editor.input.addHandler(new OW(this.groupItem)),r.append(s.root);const o=B("div",["reply-editor-actions"],r),l=qr(he.QuickReplyCancel,YA("common.cancel"));so(l,he.QuickReplyCancel);const c=qr(he.QuickReplyOk,YA("comment.send"),void 0,["primary","disabled"]);return so(c,he.QuickReplyOk),o.append(l,c),this.hideReplyEditor(),{replyTextButton:e,replyEditor:s,replyEditorContainer:r,okButton:c}}destroy(){this.components.replyEditor.destroy()}}const Tl=D("comment-group-item");class zW extends Ve.TypedEmitter{constructor(e,r,i,s){super();m(this,"root");m(this,"header");m(this,"mainItem");m(this,"childrenList");m(this,"resizeObserver");m(this,"quickReply");m(this,"createRoot",()=>B("div",["comment-group-item-root"],null));m(this,"createChildrenList",()=>{const e=B("div",["comment-children-list-container"],this.root);return new VW({editor:this.editor,commentsProvider:this.commentsProvider,comments:this.comment.children,parent:e,groupList:this.groupList,groupItem:this})});m(this,"updateLastCommentItem",()=>{const e=Array.from(this.root.querySelectorAll(":scope .comment-item-root"));p(Tl,e.length!==0,"current group item not exist comment-item"),e.forEach(i=>{ut(i,qw)});const r=e[e.length-1];q(r,qw)});m(this,"updateSwitchButton",()=>{const e=this.root.querySelector(':scope .editor-text-button[group-item-action="switch-up"]'),r=this.root.querySelector(':scope .editor-text-button[group-item-action="switch-down"]');p(Tl,e,"switchUpButton not exist"),p(Tl,r,"switchDownButton not exist"),ut(r,"disabled"),ut(e,"disabled"),this.root.previousElementSibling===null&&q(e,"disabled"),this.root.nextElementSibling===null&&q(r,"disabled")});m(this,"handleReadonlyChanged",e=>{e.readonly?q(this.root,"readonly"):ut(this.root,"readonly")});m(this,"getCommentEditor",()=>this.mainItem.getCommentEditor());m(this,"handleResize",()=>{this.emit("resize")});this.editor=e,this.commentsProvider=r,this.comment=i,this.groupList=s,this.root=this.createRoot(),this.header=this.createHeader(),this.mainItem=this.createItem(),this.childrenList=this.createChildrenList(),this.quickReply=this.createQuickReply(),this.editor.on("readonlyChanged",this.handleReadonlyChanged),this.resizeObserver=new Yl(this.handleResize),this.resizeObserver.observe(this.root),this.updateLastCommentItem()}get commentCount(){return Yw(this.root)}createQuickReply(){const{editor:e,commentsProvider:r,comment:i}=this,s=new jW(e,r,i,this);return this.root.append(s.root),s}createHeader(){const{comment:e}=this,r=B("div",["comment-item-head"],this.root),i=B("span",["item-head-quote"],r);i.innerText=e.abstract;const s=B("span",["item-head-switch"],r),o=Ra(s,he.SwitchUp,"up",$W),l=Ra(s,he.SwitchDown,"down",HW);return so(o,he.SwitchUp),so(l,he.SwitchDown),r}createItem(){const e=B("div",["comment-item-container"],this.root),{editor:r,commentsProvider:i,comment:s,groupList:o}=this,l=new l4({mainEditor:r,commentsProvider:i,comment:s,groupList:o,groupItem:this});return e.appendChild(l.root),l}findCommentItem(e){return e?e===this.mainItem.comment.id?this.mainItem:this.childrenList.items.find(r=>r.comment.id===e):null}handleCreateComment(e){return p(Tl,ku(e),"invalid comment, not a child comment"),p(Tl,e.groupId===this.comment.id,"invalid comment, not a child comment"),this.childrenList.createItem(e)}handleUpdateChildComment(e){const r=this.childrenList.findItem(e.id);if(!r){Tl.error(`can't find child comment item: ${e.id}`);return}r.reloadDoc()}handleUpdateMainComment(e){p(Tl,e.id===this.mainItem.comment.id,"invalid comment"),this.mainItem.reloadDoc()}deleteMainComment(e){p(Tl,e===this.mainItem.comment.id,"invalid comment"),this.mainItem.destroy()}edit(){this.mainItem.edit()}destroy(){this.quickReply.destroy(),this.mainItem.destroy(),this.childrenList.destroy(),this.root.remove(),this.resizeObserver.disconnect(),this.removeAllListeners(),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged)}}const GW=D("arrange=items"),c4=20;function u4(n,t){const e=n.rootContainer.querySelector(`[comment-${t.toLocaleLowerCase()}=${t}]`);if(!e)return-1;const r=n.scrollContainer.getBoundingClientRect(),i=n.scrollContainer.scrollTop;return e.getBoundingClientRect().top-r.top+i}function f4(n,t){return Number.parseInt(t.root.style.top,10)}function d4(n,t,e,r){let i=0;e&&(i=t.indexOf(e),i===-1&&(i=0));for(let s=i;s<t.length;s++){const o=t[s],l=o.comment,c=u4(n,l.groupId);if(o.root.setAttribute("data-target-top",c.toString()),s===i){if(r!==void 0){const C=t[0];C.root.style.top=`${r}px`}else o.root.style.top=`${c}px`;continue}const d=t[s-1],h=f4(n,d)+d.root.getBoundingClientRect().height;h>c?o.root.style.top=`${h+c4}px`:o.root.style.top=`${c}px`}for(let s=i-1;s>=0;s--){const o=t[s],l=o.comment,c=u4(n,l.groupId);o.root.setAttribute("data-target-top",c.toString());const d=o.root.getBoundingClientRect(),h=c+d.height,C=t[s+1];p(GW,C,"no next item");const E=f4(n,C);E<h?o.root.style.top=`${E-d.height-c4}px`:o.root.style.top=`${c}px`}}const kg=D("comment-group-item-handler");class WW{constructor(t,e){m(this,"handleSwitchUp",t=>{const e=Math.max(0,t-1);this.groupList.setActiveItem(e,"prev"),this.groupList.updateItemsLayout()});m(this,"handleSwitchDown",t=>{const e=Math.min(t+1,this.groupList.items.length);this.groupList.setActiveItem(e,"next"),this.groupList.updateItemsLayout()});m(this,"handleQuickReply",t=>{const{quickReply:e}=t;e.showReplyEditor()});m(this,"handleQuickReplyOk",t=>{const{quickReply:e}=t;e.reply(),t.updateLastCommentItem()});m(this,"handleQuickReplyCancel",t=>{const{quickReply:e}=t;e.cancel()});m(this,"handleCommentItemReply",(t,e)=>{const r=t.findCommentItem(e);p(kg,r,`the commentItem: ${e} not exist `);const{quickReply:i}=t;i.show(),i.showReplyEditor();const{comment:s}=r,o=i.getReplyEditor(),l=o.editor.getFocusedBlock(),c={type:"mention",id:it(),box:!0,created:Date.now(),text:s.displayName,iconUrl:s.avatarUrl,mentionId:s.userId};o.editor.insertBoxToBlock(l,0,c)});m(this,"handleCommentItemMore",t=>{const{quickReply:e}=t;e.hideReplyEditor(),e.getReplyEditor().clear()});m(this,"handleCommentItemOk",(t,e)=>{const r=t.findCommentItem(e);p(kg,r,`the commentItem: ${e} not exist `);const{quickReply:i}=t,{comment:s,getCommentEditor:o}=r,l=o(),c=l.getDoc();this.commentsProvider.localUpdateComment(s,c),l.readonly(),i.show()});m(this,"handleCommentItemCancel",(t,e)=>{var c,d;const r=t.findCommentItem(e);p(kg,r,`the commentItem: ${e} not exist `);const i=this.commentsProvider.getComment(r.comment.id);let s=!1;if((c=i.blocks)!=null&&c.length||(s=!0),((d=i.blocks)==null?void 0:d.length)===1){const h=i.blocks[0];s=!!h.text&&$n(h.text)===0}if(s){this.commentsProvider.localDeleteComment(r.comment.id);return}const{quickReply:o}=t,l=r.getCommentEditor();l.setDoc(r.doc),l.readonly(),o.show()});m(this,"handleCommentItemEdit",t=>{const e=this.groupList.findItemAsGroupId(t.comment.groupId);if(!e)return;const{quickReply:r}=e;t.getCommentEditor().edit(),r.hide()});m(this,"handleCommentItemDelete",t=>{const e=this.groupList.findItemAsGroupId(t.comment.groupId);if(!e)return;const{quickReply:r}=e,{comment:i}=t;this.commentsProvider.localDeleteComment(i.id),r.show()});m(this,"execute",(t,e,r,i)=>{const s=wW(t);if(!s||LW(s))return;const o=SW(s);switch(o){case he.SwitchUp:this.handleSwitchUp(i);break;case he.SwitchDown:this.handleSwitchDown(i);break;case he.CommentItemReply:this.handleCommentItemReply(e,r);break;case he.CommentItemMore:this.handleCommentItemMore(e);break;case he.CommentItemOk:this.handleCommentItemOk(e,r);break;case he.CommentItemCancel:this.handleCommentItemCancel(e,r);break;case he.CommentItemDelete:break;case he.CommentItemEdit:break;case he.QuickReply:this.handleQuickReply(e);break;case he.QuickReplyOk:this.handleQuickReplyOk(e);break;case he.QuickReplyCancel:this.handleQuickReplyCancel(e);break;default:const l=o;kg.debug(`not implement handler for ${l}`)}});this.groupList=t,this.commentsProvider=e}destroy(){}}const Rg=D("comment-group-list");class qW extends Zd{constructor(e,r,i){super(e,r,i,yl(e,r),{});m(this,"groupItemHandlers");m(this,"dispatchScroll",Ue.default(()=>{this.editor.scrollContainer.dispatchEvent(new Event("scroll"))},350));m(this,"closeEditing",e=>{const r=this.items.find(i=>i.comment.id===e);r&&([r,...r.childrenList.items].forEach(i=>{!i.getCommentEditor().editor.readonly&&i.getCommentEditor().isEmpty()&&this.groupItemHandlers.handleCommentItemCancel(r,i.comment.id)}),r.quickReply.getReplyEditor().isEmpty()&&r.quickReply.cancel())});m(this,"setFirstEditingCommentActive",()=>{const e=this.findFirstEditingComment();e!==-1&&this.setActiveItem(e)});m(this,"findGroupItem",e=>this.items.find(r=>r.comment.groupId===e));m(this,"handleContainerClick",e=>{if(!e.target||!(e.target instanceof Element))return;const r=e.target.closest(".comment-group-item-root");if(!r)return;const i=RW(e.target),s=this.items.findIndex(o=>o.root===r);if(s!==-1){this.activeIndex!==s&&this.setActiveItem(s);const{groupItemHandlers:o}=this;o.execute(e.target,this.items[s],i,s)}});m(this,"handleDocumentClick",e=>{if(!e.target||!(e.target instanceof Element))return;const r=e.target;if(r.closest(".comment-group-item-root.active")||r.closest(".editor-context-menu"))return;const o=this.items[this.activeIndex];!o||[o.findCommentItem(o.comment.id),...o.childrenList.items].some(c=>{var h;const d=(h=c==null?void 0:c.moreMenu.tippyInstance)==null?void 0:h.popper;return!!(d!=null&&d.contains(r))})||o!=null&&o.comment&&setTimeout(()=>{this.closeEditing(o.comment.id)})});m(this,"handleSelectionChanged",()=>{setTimeout(()=>{var r;const e=n4(this.editor);if(e.length>0){if(((r=this.activeItem)==null?void 0:r.comment.id)&&e.includes(this.activeItem.comment.id))return;const i=e[0],s=this.items.findIndex(o=>o.comment.groupId===i);this.setActiveItem(s),this.emit("selectionOnComment")}else this.setActiveItem(-1)})});m(this,"handleEditorResize",()=>{this.updateItemsLayout()});m(this,"handleDocChanged",()=>{this.updateComments()});m(this,"handleItemResize",()=>{this.updateItemsLayout()});m(this,"handleScroll",e=>{if(e.deltaY>=0||this.editor.scrollContainer.scrollTop!==0)return;const r=Oe(e.clientX,e.clientY);if(!r||!(r instanceof HTMLElement)||!this.editor.scrollContainer.contains(r))return;const i=this.container.querySelector(".comment-group-item-root");if(!i)return;const s=Number.parseFloat(i.style.top),o=Number.parseFloat(i.getAttribute("data-target-top")||"0");!Number.isNaN(s)&&!Number.isNaN(o)&&s<o&&d4(this.editor,this.items,null,Math.min(s+(0-e.deltaY)*3,o))});m(this,"updateGroupItemSwitch",()=>{const e=this.activeItem;p(Rg,e,"invalid activeItem"),e.updateSwitchButton()});m(this,"updateComments",Ue.default(()=>{const e=yl(this.editor,this.commentsProvider);let r=!1;for(let i=0;i<e.length;i++){const s=e[i];if(!this.findGroupItem(s.groupId)){this.handleCreateComment(s,!1),r=!0;continue}}for(let i=this.items.length-1;i>=0;i--){const s=this.items[i];e.findIndex(o=>o.groupId===s.comment.groupId)===-1&&(this.deleteItem(s.comment.id),r=!0)}r&&(this.updateItemsLayout(),this.emit("commentCountChanged"))},100));this.updateItemsLayout(),this.bindEvents(),this.editor.addListener("selectionChanged",this.handleSelectionChanged),this.editor.addListener("resize",this.handleEditorResize),this.editor.addListener("docChanged",this.handleDocChanged),this.editor.scrollContainer.addEventListener("wheel",this.handleScroll,{passive:!1}),this.items.forEach(s=>s.addListener("resize",this.handleItemResize)),this.groupItemHandlers=new WW(this,r),document.addEventListener("click",this.handleDocumentClick)}destroy(){this.editor.removeListener("selectionChanged",this.handleSelectionChanged),this.editor.removeListener("resize",this.handleEditorResize),this.editor.removeListener("docChanged",this.handleDocChanged),this.editor.scrollContainer.removeEventListener("wheel",this.handleScroll),super.destroy(),this.unbindEvents(),this.removeAllListeners(),document.removeEventListener("click",this.handleDocumentClick)}updateItemsLayout(){d4(this.editor,this.items,this.activeItem),this.dispatchScroll()}bindEvents(){this.container.addEventListener("click",this.handleContainerClick)}unbindEvents(){this.container.removeEventListener("click",this.handleContainerClick)}createItem(e,r){const i=new zW(this.editor,this.commentsProvider,e,this);return r==="insert"&&(q(i.root,"no-animation"),i.root.style.opacity="0",setTimeout(()=>{ut(i.root,"no-animation"),i.root.style.opacity="1"},150)),i}findInsertPos(e){const i=yl(this.editor,this.commentsProvider).findIndex(s=>s.id===e.id);return i===-1||i>this.items.length?-1:i}insertItem(e,r){const i=super.insertItem(e);return i?(r!=null&&r.active&&this.setActiveItem(this.items.indexOf(i)),this.updateItemsLayout(),i.addListener("resize",this.handleItemResize),i):null}findFirstEditingComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if((e||!i.quickReply.getReplyEditor().isEmpty())&&!i.quickReply.getReplyEditor().editor.readonly)return r;const s=[i,...i.childrenList.items];for(let o=0;o<s.length;o++){const l=s[o];if(!l.getCommentEditor().editor.readonly&&(e||!l.getCommentEditor().isEmpty()))return r}}return-1}isEditing(e){return this.findFirstEditingComment(e)!==-1}setActiveItem(e,r){if(p(Rg,e>=-1&&e<this.items.length,`invalid index: ${e}`),e===this.activeIndex)return;const i=this.container.querySelector(".comment-group-item-root.active");if(i){const s=this.items[this.activeIndex];setTimeout(()=>{this.closeEditing(s.comment.id)}),ut(i,"active")}if(e!==-1){const s=this.items[e];q(s.root,"active"),this.updateItemsLayout(),this.updateGroupItemSwitch()}this.emit("activeItemChanged",e,r)}get activeIndex(){const e=this.container.querySelector(".comment-group-item-root.active");return e?this.items.findIndex(r=>r.root===e):-1}get activeItem(){const e=this.activeIndex;return e===-1?null:this.items[e]}handleCreateComment(e,r){if(ku(e)){const l=this.findGroupItem(e.groupId);l&&l.childrenList.insertItem(e)}const i=this.findItem(e.id);p(Rg,!i,"comment group item has already exists");const s={children:[],...e};p(Rg,s.children,"not a comment group");const o=this.insertItem(s,{active:r});if(!!o&&r){const l=this.items.indexOf(o);this.setActiveItem(l),o.quickReply.hide(),setTimeout(()=>{o.edit()},300)}}handleDeleteComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if(i.comment.id===e){i.childrenList.items.length===0?(this.deleteItem(i.comment.id),this.updateItemsLayout()):i.deleteMainComment(e);return}if(i.childrenList.deleteItem(e)){i.commentCount===0&&(this.deleteItem(i.comment.id),this.updateItemsLayout());return}}}handleUpdateComment(e){const r=this.findItemAsGroupId(e.groupId);if(r&&r.comment.id!==e.id){r.handleUpdateChildComment(e);return}const i=this.findItem(e.id);i&&i.handleUpdateMainComment(e)}}const XW="comment-mini";D("comment-list");class YW extends Ve.TypedEmitter{constructor(e,r){super();m(this,"root");m(this,"groupsContainer");m(this,"list");m(this,"handleSelectionOnComment",()=>{this.emit("onSelectComment")});m(this,"updateCommentCount",()=>{var r,i;const e=_W(this.editor,this.commentsProvider);(i=(r=this.commentOptions)==null?void 0:r.onCommentCountChange)==null||i.call(r,e)});m(this,"handleActiveItemChanged",(e,r)=>{var s,o;const i=this.list.activeItem;i4(this.editor,(o=(s=i==null?void 0:i.comment)==null?void 0:s.groupId)!=null?o:"",r)});m(this,"handleItemLayoutUpdated",()=>{var r,i;const e=Mt(this.root,XW);(i=(r=this.commentOptions)==null?void 0:r.onUpdateLayout)==null||i.call(r,this.editor,{expand:e})});this.editor=e,this.commentsProvider=r,this.root=B("div",["editor-web-comment-root"],null),this.groupsContainer=B("div",["comment-groups-container"],this.root),this.list=this.createList(),this.commentsProvider.addListener(this),this.list.addListener("activeItemChanged",this.handleActiveItemChanged),this.list.addListener("itemLayoutUpdated",this.handleItemLayoutUpdated),this.list.addListener("selectionOnComment",this.handleSelectionOnComment),this.list.addListener("commentCountChanged",this.updateCommentCount),this.updateCommentCount()}get commentOptions(){return this.editor.getComponentOptions("comment")}destroy(){this.list.removeAllListeners(),this.commentsProvider.removeListener(this),this.list.destroy(),this.root.remove()}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r),this.updateCommentCount()}onDeleteComment(e,r){this.list.handleDeleteComment(e),this.updateCommentCount()}onUpdateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleUpdateComment(i)}createList(){return new qW(this.editor,this.commentsProvider,this.groupsContainer)}isEditing(e){return this.list.isEditing(e)}setFirstEditingCommentActive(){this.list.setFirstEditingCommentActive()}show(e){var r;if(ut(this.root,"hidden"),e){const i=this.list.findItemIndex(e);this.list.setActiveItem(i)}(r=this.commentOptions)==null||r.controller.showCommentList()}hide(){q(this.root,"hidden")}}class QW extends Zd{constructor({editor:t,parent:e,commentsProvider:r,comments:i}){super(t,r,e,i,{})}findInsertPos(){return this.items.length}createItem(t){const{editor:e,commentsProvider:r}=this;return new a4(e,r,t)}destroy(){this.items.forEach(t=>{t.destroy()})}}const wg=D("mobile-comment-group-item"),JW=20;class ZW extends Ve.TypedEmitter{constructor(e,r,i){super();m(this,"root");m(this,"childrenList");m(this,"mainItem");m(this,"scroller");m(this,"createRoot",()=>B("div",["mobile-group-item-root"],null));m(this,"createMainItem",e=>{const{editor:r,commentsProvider:i,comment:s}=this,o=new a4(r,i,s);return e.append(o.root),o});m(this,"createChildrenList",e=>{const{editor:r,commentsProvider:i,comment:s}=this,o=B("div",["mobile-comment-children-list-container"],e);return new QW({editor:r,commentsProvider:i,comments:s.children,parent:o})});m(this,"handleTouchEnd",()=>{var s;const{scroller:e}=this,{pullThreshold:r=JW}=(s=this.editor.getComponentOptions("comment"))!=null?s:{};let i=null;if(e.y>e.minScrollY+r?(i=this.root.previousElementSibling,i||this.emit("onReachTop")):e.y<e.maxScrollY-r&&(i=this.root.nextElementSibling,i||this.emit("onReachBottom")),i){const o=i.id;this.emit("onSwitchGroup",o,Xw)}});m(this,"refreshScroller",()=>{this.scroller.refresh()});this.editor=e,this.commentsProvider=r,this.comment=i,this.root=B("div",["mobile-group-item-root"],null),this.root.id=i.groupId;const s=B("div",["mobile-group-item"],this.root),o=B("div",["mobile-group-item-space"],null),l=B("div",["mobile-group-item-abstract"],null);l.textContent=i.abstract;const c=B("div",["mobile-group-item-list-container"],null);this.mainItem=this.createMainItem(c),this.childrenList=this.createChildrenList(c),s.append(o,l,c),this.scroller=new Tb.default(this.root,{stopPropagation:!0,click:!0}),this.scroller.on("touchEnd",this.handleTouchEnd)}get commentCount(){return Yw(this.root,".mobile-group-item")}handleUpdateChildComment(e){p(wg,e.groupId===this.mainItem.comment.id,"invalid child comment");const r=this.childrenList.findItem(e.id);if(!r){wg.error(`can't find child comment item: ${e.id}`);return}r.reloadDoc()}handleUpdateMainComment(e){p(wg,e.id===this.mainItem.comment.id,"invalid comment"),this.mainItem.reloadDoc()}deleteMainComment(e){p(wg,e===this.mainItem.comment.id,"invalid comment"),this.mainItem.destroy()}destroy(){this.mainItem.destroy(),this.childrenList.destroy(),this.scroller.off("touchEnd",this.handleTouchEnd),this.scroller.destroy(),this.root.remove(),this.removeAllListeners()}}const QA=D("mobile-group-list");class tq extends Zd{constructor(e,r,i,s){super(e,r,i,yl(e,r),{});m(this,"scroller");m(this,"refreshScroller",()=>{this.scroller.refresh(),this.items.forEach(e=>{e.refreshScroller()})});m(this,"deleteItem",e=>{if(this.items.length<=1)return super.deleteItem(e);const r=this.findItemIndex(e);let i=null;return r===0?i=this.items[r+1].root.id:i=this.items[r-1].root.id,super.deleteItem(e)?(this.scrollToGroup(i,Xw),!0):!1});m(this,"setupGroupItem",e=>{e.on("onSwitchGroup",this.scrollToGroup),e.on("onReachBottom",this.handleReachBottom),e.on("onReachTop",this.handleReachTop),e.refreshScroller()});m(this,"handleReachBottom",()=>{this.emit("onReachBottom")});m(this,"handleReachTop",()=>{this.emit("onReachTop")});m(this,"scrollToGroup",(e,r=0)=>{const i=this.findGroupItem(e);p(QA,i,"invalid scroll target"),this.scroller.scrollToElement(i.root,r,!1,!1),i4(this.editor,i.comment.groupId)});m(this,"findGroupItem",e=>this.items.find(r=>r.comment.groupId===e));m(this,"handleDocChanged",()=>{this.updateComments()});m(this,"updateComments",Ue.default(()=>{const e=yl(this.editor,this.commentsProvider);for(let r=0;r<e.length;r++){const i=e[r];if(!this.findGroupItem(i.groupId)){this.handleCreateComment(i,!1);continue}}for(let r=this.items.length-1;r>=0;r--){const i=this.items[r];e.findIndex(s=>s.groupId===i.comment.groupId)===-1&&this.deleteItem(i.comment.id)}},100));this.scroller=new Tb.default(s),this.scroller.disable(),this.editor.addListener("docChanged",this.handleDocChanged),this.items.forEach(this.setupGroupItem)}createItem(e){return new ZW(this.editor,this.commentsProvider,e)}insertItem(e){const r=super.insertItem(e);return r?(this.setupGroupItem(r),r):null}findInsertPos(e){const i=yl(this.editor,this.commentsProvider).findIndex(s=>s.id===e.id);return i===-1||i>this.items.length?-1:i}setActiveItem(e){this.scrollToGroup(e)}handleCreateComment(e,r){if(ku(e)){const o=this.findGroupItem(e.groupId);o&&o.childrenList.insertItem(e)}const i=this.findItem(e.id);p(QA,!i,"comment group item has already exists");const s={children:[],...e};p(QA,s.children,"not a comment group"),this.insertItem(s),this.scroller.refresh()}handleDeleteComment(e){for(let r=0;r<this.items.length;r++){const i=this.items[r];if(i.comment.id===e){i.childrenList.items.length===0?this.deleteItem(i.comment.id):i.deleteMainComment(e);return}if(i.childrenList.deleteItem(e)){i.commentCount===0&&this.deleteItem(i.comment.id);return}}}handleUpdateComment(e){if(ku(e)){const i=this.commentsProvider.getComment(e.groupId),s=this.findItem(i.id);s&&s.handleUpdateChildComment(e);return}const r=this.findItem(e.id);r&&r.handleUpdateMainComment(e)}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged),this.scroller.destroy(),this.items.forEach(e=>e.destroy())}}const eq=D("mobile-comment-list"),{t:h4}=_;class nq extends Ve.TypedEmitter{constructor(e,r){super();m(this,"root");m(this,"list");m(this,"mask");m(this,"pullInfoContainer");m(this,"handleRootClick",e=>{const r=e.target;p(eq,r instanceof Element,"invalid target"),!(r.closest(".mobile-group-item-abstract")||r.closest(".mobile-group-item-list-container"))&&(this.hide(),this.emit("onCommentListClose"))});m(this,"hidePullInfo",Ue.default(()=>{ut(this.pullInfoContainer,"active")},1e3*3));m(this,"handleReachBottom",()=>{this.showPullInfo("bottom")});m(this,"handleReachTop",()=>{this.showPullInfo("top")});m(this,"show",e=>{var r;ut(this.root,"hidden"),q(document.documentElement,"disabled-scroll"),(r=this.commentOptions)==null||r.controller.showCommentList(),queueMicrotask(()=>{this.list.refreshScroller(),e&&this.list.setActiveItem(e)})});m(this,"hide",()=>{q(this.root,"hidden"),ut(document.documentElement,"disabled-scroll")});this.editor=e,this.commentsProvider=r,this.root=B("div",["editor-mobile-comments-root"],null),this.mask=B("div",["mobile-comment-mask"],this.root);const i=B("div",["mobile-comment-groups-container"],this.root),s=B("div",["mobile-comment-groups-scroll-container"],i);this.list=new tq(this.editor,this.commentsProvider,s,i),this.pullInfoContainer=this.createPullInfo(),this.commentsProvider.addListener(this),this.list.on("onReachBottom",this.handleReachBottom),this.list.on("onReachTop",this.handleReachTop),this.root.onclick=this.handleRootClick}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r)}onDeleteComment(e,r){this.list.handleDeleteComment(e)}onUpdateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleUpdateComment(i)}get commentOptions(){return this.editor.getComponentOptions("comment")}createPullInfo(){const e=B("div",["mobile-comment-pull-info-container"],this.root);return B("div",["mobile-comment-pull-info"],e),e}showPullInfo(e){const r=h4(e==="bottom"?"comment.isLast":"comment.isFirst");this.pullInfoContainer.firstElementChild.textContent=r,q(this.pullInfoContainer,"active"),this.hidePullInfo()}isEditing(){return!1}destroy(){this.list.removeAllListeners(),this.list.destroy(),this.root.onclick=null}}function m4(n,t){const e=yl(n,t),r=new Map;for(const i of e){const s=Qw(n,i.groupId);if(!!s)if(r.has(s)){const o=r.get(s);e4(i).forEach(c=>{o==null||o.commentIds.add(c.id)})}else{const o=e4(i),l=new Set(o.map(c=>c.id));r.set(s,{commentIds:l,firstComment:i})}}return Array.from(r.entries()).map(([i,s])=>({blockId:i,...s}))}const rq=D("mini-group-item");class iq{constructor(t,e){m(this,"root");m(this,"blockId");m(this,"comment");m(this,"miniCommentItem");m(this,"updateCommentItemCount",()=>{this.miniCommentItem.updateCount(this.commentCount)});this.editor=t,this.commentGroup=e,this.root=B("div",["mini-group-item"],null),this.comment=e.firstComment,this.miniCommentItem=new KW(this.comment.id,this.root),this.blockId=this.getBlockId(),setTimeout(()=>{this.alignToBlock()}),this.updateCommentItemCount()}getBlockId(){return Qw(this.editor,this.comment.groupId)}get commentCount(){return this.commentGroup.commentIds.size}alignToBlock(){const t=this.getBlockId();if(!t)return;const e=this.editor.getBlockById(t);p(rq,e,`The blockId: ${t} not exist in doc`);const r=this.editor.scrollContainer.getBoundingClientRect(),i=this.editor.scrollContainer.scrollTop,o=e.getBoundingClientRect().top-r.top+i;requestAnimationFrame(()=>{this.root.style.transform=`translateY(${o}px)`})}destroy(){this.root.remove()}}class sq extends Zd{constructor(e,r,i){super(e,r,i,m4(e,r),{});m(this,"fixListOps",Ue.default(()=>{this.items.forEach(e=>{e.alignToBlock()})},100));m(this,"handleDocChanged",Ue.default(()=>{this.updateMiniCommentsGroup()},100));m(this,"updateMiniCommentsGroup",()=>{const e=m4(this.editor,this.commentsProvider);this.reloadList(e)});this.editor=e,this.commentsProvider=r,this.editor.addListener("docChanged",this.handleDocChanged),this.editor.addListener("resize",this.fixListOps)}createItem(e){return new iq(this.editor,e)}findInsertPos(){return-1}handleCreateComment(e,r){this.updateMiniCommentsGroup()}handleDeleteComment(e){this.updateMiniCommentsGroup()}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged),super.destroy(),this.removeAllListeners()}}const oq=D("mini-comments-list");class lq extends Ve.TypedEmitter{constructor(e,r){super();m(this,"list");m(this,"root");m(this,"createList",()=>{const e=B("div",["comment-groups-container"],this.root);return this.editor.domEvents.addEventListener(e,"click",this.handleListContainerClick),new sq(this.editor,this.commentsProvider,e)});m(this,"handleListContainerClick",(e,r)=>{const i=r.target;p(oq,i instanceof HTMLElement,"The target is not a valid html element");const s=i.closest(".mini-comment-item");s&&this.emit("onItemClick",s.id)});this.editor=e,this.commentsProvider=r,this.root=B("div",["editor-mini-comment-root"],null),this.list=this.createList(),this.commentsProvider.addListener(this)}onCreateComment(e,r){const i=this.commentsProvider.getComment(e);this.list.handleCreateComment(i,r)}onDeleteComment(e,r){this.list.handleDeleteComment(e)}onUpdateComment(e,r){}show(){ut(this.root,"hidden")}hide(){q(this.root,"hidden")}destroy(){this.list.destroy(),this.removeAllListeners()}}function g4(n,t,e){if(!t.start.isSimple()||!t.end.isSimple())return;const r=t.block,i=Pe(n,r,t.start.offset,t.end.offset),s=`comment-${e.id.toLocaleLowerCase()}`,o=e.id;YB(n,r,i,s,o)}function aq(n,t,e){const r=Ji(n).map(o=>o.block),i=jA(n,r),s=yg({editor:n,abstract:i});return n.undoManager.runInGroup(()=>{Ji(n,{simpleBlockOnly:!0}).forEach(c=>{!ot(n,c.block)||g4(n,c,s)});const l=qs();e.localCreateComment(s,l)}),s}class cq{constructor(t,e){m(this,"id","CommentsCommandProvider");this.provider=t,this.editorComments=e}getAvailableCommands(t,e,r){const i=t.selection.range;if(ot(t,e)&&!r.isCollapsed()&&i.isSimple()){const s=dt(e),o=Ot(e),l=gi(t,e);return[{id:"add-comment",name:_.t("comment.command"),blockId:s,blockType:o,blockKind:l,groupIndex:1e3,icon:Aa}]}return[]}hideToolbar(t){const e=t.findCustom("toolbar-handler");e==null||e.disableTextToolbar(),e==null||e.hide(),setTimeout(()=>{e==null||e.enableTextToolbar()},300)}executeRangeCommand(t,e,r,i,s){if(r.id==="add-comment"){this.editorComments.showCommentList();const o=aq(t,e,this.provider);return s["add-comment"]=o,this.hideToolbar(t),!0}return!1}}class p4{constructor(t,e){m(this,"commentList",null);m(this,"mobileCommentList",null);m(this,"miniCommentList");m(this,"showComment",(t,e)=>{var r,i;t==="mini"&&this.miniCommentList.show(),t==="mobile"&&((r=this.mobileCommentList)==null||r.show(e)),t==="web"&&((i=this.commentList)==null||i.show(e))});m(this,"showCommentList",t=>{this.isMobile?this.showComment("mobile",t):this.showComment("web",t)});m(this,"handleCommentListClose",()=>{this.showComment("mini")});m(this,"handleOnSelectComment",()=>{this.showComment("web")});m(this,"handleMiniCommentItemClick",t=>{this.showCommentList(t)});this.editor=t,this.provider=e,t.editorCommandProviders.registerCommandProvider(new cq(e,this)),t.blockHooks.push(new yW(this.provider,this)),this.isMobile?(this.mobileCommentList=new nq(this.editor,this.provider),this.mobileCommentList.on("onCommentListClose",this.handleCommentListClose)):(this.commentList=new YW(this.editor,this.provider),this.commentList.on("onSelectComment",this.handleOnSelectComment)),this.miniCommentList=new lq(this.editor,this.provider),this.miniCommentList.on("onItemClick",this.handleMiniCommentItemClick),this.editor.input.addHandler(new TW)}get commentProvider(){return this.provider}get isMobile(){return Ae.isMobile}destroy(){var t,e;(t=this.commentList)==null||t.destroy(),(e=this.mobileCommentList)==null||e.destroy(),this.miniCommentList.destroy()}setFirstEditingCommentActive(){var t;(t=this.commentList)==null||t.setFirstEditingCommentActive()}isEditing(t){var e,r;return((e=this.commentList)==null?void 0:e.isEditing(t))||((r=this.mobileCommentList)==null?void 0:r.isEditing())||!1}mount(t){var e;t.container&&this.commentList&&t.container.append((e=this.commentList)==null?void 0:e.root),t.miniContainer&&t.miniContainer.append(this.miniCommentList.root),t.mobileContainer&&this.mobileCommentList&&t.mobileContainer.append(this.mobileCommentList.root)}}const xat="",uq={comment:{count:"\u6279\u6CE8 ({num})",hide:"\u9690\u85CF\u6279\u6CE8",show:"\u663E\u793A\u6279\u6CE8",reply:"\u56DE\u590D",quicklyReply:"\u56DE\u590D...",send:"\u786E\u5B9A",placeholder:"\u6DFB\u52A0\u6279\u6CE8...",replyPlaceholder:"\u6DFB\u52A0\u6279\u6CE8\u6216@\u4ED6\u4EBA",edit:"\u7F16\u8F91",delete:"\u5220\u9664",image:"\u56FE\u7247",sendTitle:"\u6309Enter\u53D1\u9001\u6279\u6CE8",replyTitle:"\u6309Enter\u56DE\u590D\u6279\u6CE8",isFirst:"\u5DF2\u7ECF\u662F\u7B2C\u4E00\u6761\u6279\u6CE8",isLast:"\u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u6761\u6279\u6CE8",more:"\u66F4\u591A",comment:"\u6279\u6CE8",command:"\u6279\u6CE8",quickMenuCommand:"\u6DFB\u52A0\u6279\u6CE8"}},fq={comment:{count:"Annotations ({num})",hide:"Hide Annotations",show:"Show Annotations",reply:"Reply",quicklyReply:"Reply...",send:"Confirm",placeholder:"Add a annotation...",replyPlaceholder:"Add annotation or mention someone",edit:"Edit",delete:"Delete",image:"Image",sendTitle:"Press Enter to post annotation",replyTitle:"Press Enter to reply to annotation",isFirst:"This is already the first comment",isLast:"This is already the last comment",more:"More",comment:"Annotation",command:"Annotation",quickMenuCommand:"Add annotation"}},dq={comment:{count:"\u6CE8\u91C8 ({num})",hide:"\u6CE8\u91C8\u3092\u975E\u8868\u793A",show:"\u6CE8\u91C8\u3092\u8868\u793A",reply:"\u8FD4\u4FE1",quicklyReply:"\u8FD4\u4FE1...",send:"\u78BA\u5B9A",placeholder:"\u6CE8\u91C8\u3092\u8FFD\u52A0...",replyPlaceholder:"\u6CE8\u91C8\u3092\u8FFD\u52A0\u3059\u308B\u304B\u30E1\u30F3\u30D0\u30FC\u3092\u30E1\u30F3\u30B7\u30E7\u30F3",edit:"\u7DE8\u96C6",delete:"\u524A\u9664",image:"\u753B\u50CF",sendTitle:"Enter\u3092\u62BC\u3057\u3066\u6CE8\u91C8\u3092\u9001\u4FE1",replyTitle:"Enter\u3092\u62BC\u3057\u3066\u6CE8\u91C8\u3092\u8FD4\u4FE1",isFirst:"\u6700\u521D\u306E\u6CE8\u91C8\u3067\u3059",isLast:"\u6700\u5F8C\u306E\u6CE8\u91C8\u3067\u3059",more:"\u305D\u306E\u4ED6",comment:"\u6CE8\u91C8",command:"\u6CE8\u91C8",quickMenuCommand:"\u6CE8\u91C8\u3092\u8FFD\u52A0"}};_.mergeLang({"zh-CN":uq,"en-US":fq,"ja-JP":dq});class C4{renderText(t,e,r){const i=[],s={};return Object.entries(r).forEach(([o,l])=>{o.startsWith("comment-")&&(i.push("comment"),s[o]=l)}),{classes:i,attributes:s}}renderBox(t,e,r){const i=[],s={};return Object.entries(r).forEach(([o,l])=>{o.startsWith("comment-")&&(i.push("comment"),s[o]=l)}),{classes:i,attributes:s}}renderBlock(t,e,r){const i=r.comments;if(!i||i.length===0)return{};const s=["comment"],o={};return i.forEach(l=>{o[`comment-${l.toLocaleLowerCase()}`]=l}),{classes:s,attributes:o}}updateBlock(t,e,r,i){const s=i.comments;ut(r,"comment"),Array.from(r.attributes).forEach(o=>{o.name.startsWith("comment-")&&r.removeAttribute(o.name)}),!(!s||s.length===0)&&(q(r,"comment"),s.forEach(o=>{r.setAttribute(`comment-${o.toLocaleLowerCase()}`,o)}))}}class hq{constructor(t){m(this,"handleUpdateCompositionText",(t,e,r,i,s)=>{const o=t.getFocusedBlock(),l=t.getFirstBlock();o===l&&this.applyPlaceholder(t)});m(this,"handleSelectionChange",t=>{this.applyPlaceholder(t)});m(this,"applyPlaceholder",t=>{const e=t.getFirstBlock();Ud(t,e,_.t("comment.replyPlaceholder"))});this.applyPlaceholder(t),t.addListener("selectionChanged",this.handleSelectionChange)}}function mq(n,t,e){const r=n.getBlockData(t),i=r.comments;if((i==null?void 0:i.indexOf(e))!==-1){const o=new Set(i);o.delete(e),n.updateBlockData(t,{comments:Array.from(o)})}const s=r.text;if(!!s&&ot(n,t)){const o=b1(s,`comment-${e.toLocaleLowerCase()}`,e,{handleBox:!0,ignoreValue:!1});gf.default(s,o)||n.setBlockText(t,o)}}const gq=D("editor-comment");function pq(n){const t=n.getCustom("editor-comments");if(p(gq,t,"the editor comment not exist"),t.showCommentList(),n.selection.range.isCollapsed()){const o=n.selection.startBlock,l=Zo(o);if(l.length>=2){const{containerId:c}=l[l.length-1],d=nt(hi(n,c));if(d&&Ot(d)==="code"){zA(n,d,t.commentProvider);return}}zA(n,o,t.commentProvider);return}const e=Ji(n,{simpleBlockOnly:!0}),r=e.map(o=>o.block),i=jA(n,r),s=yg({editor:n,abstract:i});n.undoManager.runInGroup(()=>{e.forEach(l=>{ot(n,l.block)?g4(n,l,s):Ww(n,l.block,s)});const o=qs();t.commentProvider.localCreateComment(s,o)})}const JA=D("text-styles");function Cq(n){const t=r=>{if(!r.attributes)return new Map;const i=Object.entries(r.attributes).filter(([s])=>!!s.startsWith("style-"));return new Map(i)};if(n.length===0)return new Map;let e=t(n[0]);for(let r=1;r<n.length;r++){if(js(n[r]))continue;const i=t(n[r]);e=new Map(Array.from(e.entries()).filter(([s,o])=>i.get(s)===o))}return e}function Eq(n,t,e,r,i){p(JA,e.isSimple(),"invalid range");const{start:s,end:o}=e;p(JA,s.blockId===o.blockId&&s.blockId===dt(t),"invalid range"),p(JA,r.startsWith("style-"),"invalid style");let c=n.getBlockText(t);return r==="style-sub"?c=Kc(s.offset,o.offset-s.offset,c,"style-super",i,{ignoreValue:!0}):r==="style-super"&&(c=Kc(s.offset,o.offset-s.offset,c,"style-sub",i,{ignoreValue:!0})),i===!1||i===void 0||i===null?c=Kc(s.offset,o.offset-s.offset,c,r,void 0,{ignoreValue:!0}):c=Nf(s.offset,o.offset-s.offset,c,r,i),n.setBlockText(t,c),c}const Ia=D("text-commands");function E4(n){const t={id:"more",name:_.t("commands.more"),icon:jC,childrenType:"menu",childrenPlacement:"bottom-start",manualShowChildren:!0,children:[]},e={"style-bold":[_.t("commands.bold"),fn("CtrlOrCmd+B"),J2],"style-italic":[_.t("commands.italic"),fn("CtrlOrCmd+I"),Z2],"style-underline":[_.t("commands.underline"),fn("CtrlOrCmd+U"),tT],"style-strikethrough":[_.t("commands.strikethrough"),fn("CtrlOrCmd+D"),eT],"style-code":[_.t("commands.code"),void 0,nT]},r={"style-super":[_.t("commands.superscript"),void 0,iT],"style-sub":[_.t("commands.subscript"),void 0,rT]};if($n(n)===0){const l=Object.entries(e).map(([c,[d,h,C]])=>({id:c,name:d,icon:C,desc:h}));return t.children=Object.entries(r).map(([c,[d,h,C]])=>({id:c,name:d,icon:C,desc:h})),l.concat(t)}const i=Cq(n);function s([l,[c,d,h]]){const C=i.get(l);return C!==void 0?{id:l,name:c,value:C,states:C===!0?["checked"]:void 0,icon:h,desc:d}:{id:l,name:c,icon:h,desc:d}}const o=Object.entries(e).map(s);return t.children=Object.entries(r).map(s),o.concat(t)}function Aq(n,t){const e=dt(t),r=Ot(t),i=gi(n,t);return E4([]).map(s=>({blockId:e,blockType:r,blockKind:i,...s,groupIndex:500}))}function xq(n,t,e){p(Ia,e.isSimple(),"nor a simple range");const{start:r,end:i}=e;p(Ia,r.isSimple(),"is not a simple block position"),p(Ia,i.isSimple(),"is not a simple block position"),p(Ia,ot(n,t),"invalid block type, not a text kind block");const s=dt(t);p(Ia,r.blockId===s&&i.blockId===s,"invalid range");const o=n.getBlockText(t);let l=[];r.offset===i.offset?r.offset!==0&&(l=gn(o,r.offset-1,1).middle):l=gn(o,r.offset,i.offset-r.offset).middle;const c=Ot(t),d=gi(n,t);return E4(l).map((h,C)=>({blockId:s,blockType:c,blockKind:d,...h,groupIndex:500,order:C*100}))}function bq(n,t,e,r,i,s){if(!ot(n,t))return!1;if(!r.startsWith("style-"))return Ia.warn(`unknown command: ${r}`),!1;const o=i==null?void 0:i.value,l=typeof o;if(l!=="string"&&l!=="number"&&l!=="boolean"&&l!=="undefined")return Ia.warn(`invalid value type, accept string | number | boolean | undefined, current is ${l}`),!1;const c=Eq(n,t,e,r,o);return s.result=c,!0}const vq=D("text-command-provider");class ms{constructor(t){m(this,"id","TextCommandProvider");m(this,"emptyTextBlockAttributes",new Map);m(this,"colorItem");m(this,"updateButtonColor",t=>{const e=ZB(this.editor,t,this.getEmptyTextBlockColor);this.colorItem.updateButtonColor(e)});m(this,"handleChangeColor",(t,e)=>{if(t==="color"||t==="backgroundColor")QB(this.editor,t,e,this.setEmptyTextBlockColor);else{const r=["clearAll","clearColor","clearBackground"];JB(this.editor,r[e],this.setEmptyTextBlockColor)}this.colorItem.setLatestColors(t,e)});m(this,"getEmptyTextBlockColor",(t,e)=>{const r=this.getEmptyBlockTextAttributes(t,e);return v1(r)});m(this,"setEmptyTextBlockColor",(t,e,r,i)=>{var o;const s=(o=this.emptyTextBlockAttributes.get(e))!=null?o:{};z3(s,r,i),this.emptyTextBlockAttributes.set(e,s)});this.editor=t,this.colorItem=t.addCustom("text-color-item",()=>new vT(t)),this.colorItem.addListener("onClick",this.handleChangeColor)}destroy(){this.colorItem.destroy()}getAvailableCommands(t,e,r){if(!ot(t,e))return[];if(Li(t))return[];let i;Ct(t,e)===0?i=this.getCommandsOnEmptyText(t,e).map(ms.toTextCommand):i=xq(t,e,r).map(ms.toTextCommand),this.updateButtonColor(r);const o={...this.colorItem,blockId:dt(e),blockKind:gi(t,e),blockType:Ot(e),groupIndex:500,order:350};return i.push(o),i}executeCommand(t,e,r,i,s,o){if(!ot(t,e)||Li(t))return!1;let l=s.value;l===void 0&&(l=!i.value);const c=ms.fromTextCommandId(i.id);if(c.startsWith("style-")){if(c==="style-font")return this.handleChangeColor(s.type,l),!0;if(Ct(t,e)===0)return this.executeCommandOnEmptyText(e,i,{value:l})}return bq(t,e,r,c,{value:l},o)}executeCommandOnEmptyText(t,e,r){let i=this.emptyTextBlockAttributes.get(dt(t));i||(i={},this.emptyTextBlockAttributes.set(dt(t),i));const s=ms.fromTextCommandId(e.id),o=r.value;return o==null||o===!1?(delete i[s],!0):(i[s]=r.value,!0)}getCommandsOnEmptyText(t,e){const r=Aq(t,e);return this.setCommandsStates(r,e)}setCommandsStates(t,e){var s;const r=dt(e),i=(s=this.emptyTextBlockAttributes.get(r))!=null?s:{};return t.map(o=>{const l=i[o.id],c=l?["checked"]:void 0;return o.children&&(o.children=this.setCommandsStates(o.children,e)),{...o,value:l,states:c}})}getEmptyBlockTextAttributes(t,e){var i;const r=At.default((i=this.emptyTextBlockAttributes.get(e))!=null?i:{});if(Array.from(Object.entries(r)).forEach(([s,o])=>{o||delete r[s]}),Object.keys(r).length!==0)return r}static toTextCommand(t){return t.children&&(t.children=t.children.map(ms.toTextCommand)),{...t,id:`text/${t.id}`}}static fromTextCommandId(t){const e="text/";return p(vq,t.startsWith(e),`invalid item id: ${t}`),t.substring(e.length)}static fromTextCommand(t){return{...t,id:this.fromTextCommandId(t.id)}}static toTextCommands(t){return t.map(ms.toTextCommand)}static fromTextCommands(t){return t.map(ms.fromTextCommand)}}function A4(n){const t=n.findCustom("toolbar-handler");t==null||t.disableTextToolbar(),t==null||t.hide(),setTimeout(()=>{t==null||t.enableTextToolbar()},300)}function Bq(n){n.undoManager.canUndo()&&A4(n)}function yq(n){n.undoManager.canRedo()&&A4(n)}const Tq={"CtrlOrCmd+Z":Bq,"CtrlOrCmd+Shift+Z":yq},kq={commands:{bold:"\u7C97\u4F53",italic:"\u659C\u4F53",underline:"\u4E0B\u5212\u7EBF",strikethrough:"\u5220\u9664\u7EBF",code:"\u884C\u5185\u4EE3\u7801",subscript:"\u4E0B\u6807",superscript:"\u4E0A\u6807",more:"\u66F4\u591A"}},Rq={commands:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Inline code",subscript:"Subscript",superscript:"Superscript",more:"More"}},wq={commands:{bold:"\u592A\u5B57",italic:"\u659C\u4F53",underline:"\u4E0B\u7DDA",strikethrough:"\u53D6\u308A\u6D88\u3057\u7DDA",code:"\u30A4\u30F3\u30E9\u30A4\u30F3\u30B3\u30FC\u30C9",subscript:"\u4E0B\u4ED8\u304D\u6587\u5B57",superscript:"\u4E0A\u4ED8\u304D\u6587\u5B57",more:"\u305D\u306E\u4ED6"}};_.mergeLang({"zh-CN":kq,"en-US":Rq,"ja-JP":wq});const Sq={embedProperties:{edit:"\u7F16\u8F91",addComment:"\u6DFB\u52A0\u6279\u6CE8"}},Lq={embedProperties:{edit:"Edit",addComment:"Add annotation"}},Iq={embedProperties:{edit:"\u7DE8\u96C6",addComment:"\u30B3\u30E1\u30F3\u30C8\u3092\u8FFD\u52A0"}};_.mergeLang({"zh-CN":Sq,"en-US":Lq,"ja-JP":Iq});const x4=D("embed-block-properties");function th(n,t){var e;for(const r of n.blockHooks){const i=(e=r.commands)==null?void 0:e.call(r,n,t);if(!!i&&i.group==="block-comment-actions")return i.executeCommand(n,t,i.commands[0]),!0}return!1}class ZA{constructor(t,e,r){m(this,"group","hovering-toolbar");m(this,"_commands",[{id:"edit",name:_.t("embedProperties.edit"),icon:Rm},{id:"add-comment",name:_.t("embedProperties.addComment"),icon:Aa}]);this.editor=t,this.block=e,this.properties=r}get commands(){var i,s,o;if(this.editor.readonly)return[];let t=this._commands;const{enableComments:e=!0}=this.editor.options;e||(t=t.filter(l=>l.id!=="add-comment")),t.forEach(l=>{(l.id==="add-comment"||l.id==="edit")&&(l.states=this.editor.isBlockWritable(this.block)?[]:["disabled"])});let r=(i=this.properties)!=null&&i.presetIds?t.filter(l=>{var c,d;return(d=(c=this.properties)==null?void 0:c.presetIds)==null?void 0:d.includes(l.id)}):[...t];return(o=(s=this.properties)==null?void 0:s.extCommands)!=null&&o.length&&(r.length&&r.push({id:it(),type:"separator",name:""}),r.push(...this.properties.extCommands)),r.length<=3&&(r=r.filter(l=>l.id!=="separator")),r}executeCommand(t,e,r){var i,s;if(!((s=(i=this.properties)==null?void 0:i.handleExecuteCommand)!=null&&s.call(i,t,e,r))){if(r.id==="add-comment"){th(t,e)||x4.error("failed to add comment to block");return}x4.error(`unknown command: ${JSON.stringify(r)}`)}}}function tx(n,t,e){return{blockCommands:{"hovering-toolbar":new ZA(n,t,e)}}}class eh{constructor(t){m(this,"blockResizer");m(this,"handleResizing",(t,e)=>{var i,s;const r=t.getBlock();if(r){if(((s=(i=le(this.editor,r)).notify)==null?void 0:s.call(i,this.editor,"resize",{block:r,rect:e}))===!0)return;const o=Math.max(e.height,100),d={...this.editor.getBlockData(r).embedData,height:o};this.editor.updateEmbedData(r,d)}});m(this,"handleHoveringBlockChange",(t,e)=>{e&&Le(e)&&Mt(e,"resizable")&&this.disableResizer(),t&&Le(t)&&Mt(t,"resizable")&&this.editor.isBlockWritable(t)&&this.tryEnableResizer(t)});this.editor=t,je.get(t).addListener("change",this.handleHoveringBlockChange),this.blockResizer=new Nd(this.editor,{resize:["bottom"]}),this.blockResizer.addListener("resizing",this.handleResizing)}destroy(){je.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}tryEnableResizer(t){this.blockResizer.enableResize(t)}disableResizer(){this.blockResizer.disableResize()}static get(t){return t.addCustom("EmbedBlockResizer",()=>new eh(t))}static register(t,e){return q(e,"resizable"),t.addCustom("EmbedBlockResizer",()=>new eh(t))}}var b4=(n=>(n.Card="card",n.Preview="preview",n))(b4||{});const Dq=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
736
736
  <path d="M6.49669 1C4.80282 1 3.0118 2.3515 3.0118 3.76237L3 10.6206M6.49669 1C8.41943 1 10.0154 2.60058 10.0154 4.17342M6.49669 1C7.43289 1 8.28684 1.42118 8.90405 1.96796C9.50746 2.50252 10.0154 3.29036 10.0154 4.17342M10.0154 4.17342L10.0154 9.61446C10.0154 10.4166 9.23033 11.2316 8 11.2316C6.91283 11.2316 6.01026 10.5735 6.01026 9.87981L5.98457 5.04102M3 10.6206C3 13.1126 5.38055 15 8 15M3 10.6206C3 12.9301 5.13252 15 8 15M8 15C10.6194 15 13 13.1988 13 10.7068M8 15C10.8675 15 13 13.0162 13 10.7068M13 10.7068V5.04102" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>
737
737
  <path d="M13 4V10C13 12.7614 10.7614 15 8 15C5.23858 15 3 12.7614 3 10V4.5" stroke="currentColor"/>
738
738
  <path d="M10 9V4.5C10 2.567 8.433 1 6.5 1C4.567 1 3 2.567 3 4.5" stroke="currentColor"/>
@@ -959,4 +959,4 @@ ${s.mermaidText}
959
959
  ${s.flowchartText}
960
960
  \`\`\`\`\`\``}return""}const RJ={embedType:"flowchart",convertFrom:yJ,handleUpdateBlock:BJ,createEmbedContent:vJ,getBlockProperties:TJ,convertTo:kJ},wJ=D("plantuml-helper");function kS(n,t){var l;let r=((l=(n.getComponentOptions("plantuml")||{}).cdn)==null?void 0:l.plantuml)||sJ;r.endsWith("/")||(r+="/");const i=s9.default.encode(t);p(wJ,i,i),r+=i;const o=new URLSearchParams(document.location.search).get("doc");return Pp(r,{id:`${o}-${it()}`})}async function SJ(n,t){try{const e=await Cx(n,t);return(await n.doc.uploadResource(e)).resourceId}catch{return Promise.resolve(t)}}class Mu extends bx{constructor(t){super(t,"plantuml","plantumlText")}static get(t,e){return t.addCustom(`plantuml-${e.id}`,()=>new Mu(t))}code2ObjectUrl(t){return Promise.resolve(kS(this.editor,t))}code2ResourceId(t){const e=kS(this.editor,t);return SJ(this.editor,e)}destroy(){}}function LJ(n,t,e){Mu.get(n,e).createEmbedContent(t,e)}function IJ(n,t,e){const r=Mu.get(n,e),i=zt(t);return r.updateEmbedContent(i,e),!0}function DJ(n,t,e){const{data:r}=e,i=n.getBlockString(t).trim();if(!r||r.embedType!=="plantuml"||i!=="```plantuml"||!ot(n,t))return null;const s={src:"",plantumlText:""};return{blockData:{id:it(),type:"embed",embedType:"plantuml",embedData:s},onConverted:(c,d)=>{Mu.get(c,c.getBlockData(d)).editGraph(zt(d))}}}function _J(n,t){return Mu.get(n,n.getBlockData(t)).getBlockProperties(t)}function MJ(n,t,e,r){const{embedData:i}=t,s=i;if(r==="html")return s.src?`<img src="${n.doc.buildResourceUrl(s.src,{withToken:!0})}" />`:s.flowchartText?`<div>${s.flowchartText}</div>`:"<p>[plantuml]</p>";if(r==="markdown"){if(s.src)return`![plantuml](${n.doc.buildResourceUrl(s.src,{withToken:!0})})`;if(s.flowchartText)return`\`\`\`plantuml\`\`\`
961
961
  ${s.flowchartText}
962
- \`\`\`\`\`\``}return""}const UJ={embedType:"plantuml",convertFrom:DJ,handleUpdateBlock:IJ,createEmbedContent:LJ,getBlockProperties:_J,convertTo:MJ},Kat="",OJ="hr",NJ={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},PJ={dividingLine:{type:"Dividing-Line",abstract:"Dividing-Line"}},FJ={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};_.mergeLang({"zh-CN":NJ,"en-US":PJ,"ja-JP":FJ});function KJ(n,t){const e=B("div",["editor-embed-container"],t);B("hr",["editor-embed-hr"],e)}function VJ(n,t,e,r){return r==="html"?"<hr />":r==="markdown"?"---":"------------"}function $J(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:_.t("dividingLine.type"),icon:P2,order:500,group:"common",subText:Jn("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:r}=t;return n.insertEmbed(e,r,OJ,{})}}}function HJ(n,t,e){const{data:r}=e;if(!r||r.embedType!=="dividing-line"||!ot(n,t))return null;const i={};return{blockData:{id:it(),type:"embed",embedType:"hr",embedData:i}}}function jJ(){return{abstract:_.t("dividingLine.abstract")}}const zJ={embedType:"hr",createEmbedContent:KJ,convertTo:VJ,getOptions:$J,convertFrom:HJ,getBlockProperties:jJ},Vat="",$at="",GJ={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"}}},WJ={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"}}},qJ={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"}}};_.mergeLang({"zh-CN":GJ,"en-US":WJ,"ja-JP":qJ});var Ui=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(Ui||{}),sh=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(sh||{});const RS=10*1024*1024,XJ=["wav","mp3","aac","ogg","webm","flac"],YJ=["ogg","mp4","webm"],QJ=()=>{};function wS(n){var h,C,E,A,v,S;const t=(h=n.getComponentOptions("media"))!=null?h:{},{allowedMedias:e,maxSize:r,callbacks:i}=t,s=(C=e==null?void 0:e.audio)!=null?C:XJ,o=(E=e==null?void 0:e.video)!=null?E:YJ,l=(A=r==null?void 0:r.audio)!=null?A:RS,c=(v=r==null?void 0:r.video)!=null?v:RS,d=(S=i==null?void 0:i.onError)!=null?S:QJ;return{allowedMedias:{audio:s,video:o},maxSize:{audio:l,video:c},callbacks:{onError:d}}}function JJ(n,t){const e=s=>s.map(o=>`.${o}`).join(","),{allowedMedias:r}=wS(n),i=r[t];return i?e(i):"*"}function ZJ(n,t,e){const{maxSize:r,callbacks:i,allowedMedias:s}=wS(t),{[e]:o}=r,{[e]:l}=s;if(o&&n.size>o){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=yf(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 tZ(n){return n===sh.Empty||n===sh.Error}const Cn=D("media");class eZ 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 s=nt(r.target);if(!s||!s.contains(this.mediaContainer))return;const o=this.renderError();this.updateMediaContent(o),this.emit("mediaError",e,"load_error",dt(s))});m(this,"handleUploadFile",async e=>{p(Cn,this.abstract,"no abstract"),p(Cn,this.mediaContainer,"The media element not exist");const{editor:r}=this.options,i=nt(this.mediaContainer);p(Cn,i,"The block element not exist");const s=r.getBlockData(i);try{const{resourceId:o}=await r.doc.uploadResource(e,{onProgress:C=>{this.renderProgress(C,e)}}),{name:l,type:c,size:d}=e,h={...s,embedData:{...s.embedData,src:o,fileName:l,fileSize:d,fileType:c}};r.updateBlockData(i,h)}catch(o){Cn.error(o),this.emit("mediaError",r,"upload_error",s.id),this.renderRetry(e,o)}ut(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(Cn,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){p(Cn,this.abstract,"no abstract");const{editor:e,createMediaElement:r}=this.options,{mediaIcon:i,mediaName:s}=this.abstract;p(Cn,this.mediaContainer,"The media element not exist");const o=nt(this.mediaContainer);p(Cn,o,"The block element not exist");const l=e.getBlockData(o),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=_.t("media.load.failed",{name:s}),c.appendChild(h);const C=h.querySelector(".retry-upload");return p(Cn,C,"The element not exist"),e.domEvents.addEventListener(C,"click",(E,A)=>{const v=B("div",["media-element"],null),S=this.getResourceUrl(l),w=r(E,v,l,S);this.unbindMediaEvent(),this.media=w,this.bindMediaEvent(),this.updateMediaContent(v)}),this.setFullScreen(),c}renderRetry(e,r){var E,A;p(Cn,this.abstract,"no abstract");const{editor:i}=this.options,{mediaIcon:s,mediaName:o}=this.abstract,l=B("div",["media-error","embed-selected-content","embed-hover-content"],null),c=B("span",["media-error-icon"],l);c.innerHTML=s;const d=B("div",[],l);let h=_.t("media.upload.failed",{name:o});(((E=r.response)==null?void 0:E.status)===420||((A=r.response)==null?void 0:A.status)===413)&&(h=_.t("media.upload.maxSizeFailed",{name:o})),d.innerHTML=h,l.appendChild(d);const C=d.querySelector(".retry-upload");C&&i.domEvents.addEventListener(C,"click",()=>{i.readonly||(p(Cn,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(l),this.setFullScreen()}renderProgress(e,r){p(Cn,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope .media-progress"),s=e===-1||e===100?100:e;if(i){const{updateProgressElement:o}=this.options;o(i,s)}else{const{createProgressElement:o}=this.options,l=nt(this.mediaContainer);p(Cn,l,"The element not exist"),q(l,"media-block-uploading");const c=B("div",["media-progress"],null);o(c,s,r),this.updateMediaContent(c)}this.setFullScreen()}renderMediaElement(e,r){p(Cn,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope > .media-element"),{createMediaElement:s,updateMediaElement:o,editor:l}=this.options,c=this.getResourceUrl(e,r);if(i){const d=o(l,i,e,c);this.unbindMediaEvent(),this.media=d,this.bindMediaEvent()}else{const d=B("div",["media-element"],null),h=s(l,d,e,c);this.unbindMediaEvent(),this.media=h,this.bindMediaEvent(),this.updateMediaContent(d)}}renderEmpty(e){p(Cn,this.abstract,"no abstract"),p(Cn,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:s}=this.options;return s.doc.buildResourceUrl(i,{syncNewResources:async(o,l)=>{var d,h;if(!r)return;await s.doc.addResources([o]);const c=(h=(d=s.doc).getServerMeta)==null?void 0:h.call(d).appId;if(l!==e.embedData.src&&c&&e.embedData.src.includes(c)){const C=nt(r);if(C&&!s.readonly&&s.isBlockWritable(C)){const E=At.default(e);E.embedData.src=o,s.updateBlockData(C,E)}}}})}setFullScreen(){p(Cn,this.mediaContainer,"The media element not exist"),q(this.mediaContainer,"full-screen")}removeFullScreen(){p(Cn,this.mediaContainer,"The media element not exist"),ut(this.mediaContainer,"full-screen")}updateBlockAlign(e,r){const i=nt(r);p(Cn,i,"The block element not exist");const{align:s}=e;e.embedType==="video"&&(i.hasAttribute("data-style-align")&&i.removeAttribute("data-style-align"),i.setAttribute("data-style-align",s))}render(e,r){const{src:i}=e.embedData;(!this.mediaContainer||!r.contains(this.mediaContainer))&&(this.mediaContainer=B("div",["media"],r)),this.updateBlockAlign(e,r),tZ(i)?i===sh.Empty&&this.renderEmpty(e):this.renderMediaElement(e,r)}setAbstract(e){this.abstract=e}}D("media-embed");const nZ="left";class SS{constructor(){m(this,"handleInsertEmptyEmbed",async(t,e)=>{var C;const{containerId:r,blockIndex:i}=e;let s;(C=e.data)!=null&&C.file&&(s=e.data.file);const o=JJ(t,this.embedType);if(s=s!=null?s:await _c(o,{}),!s)return null;const{mediaType:l}=this.getAbstract();try{ZJ(s,t,l)}catch{return null}const c={id:it(),type:"embed",embedType:this.embedType,embedData:{src:sh.Empty}};l==="video"&&(c.align=nZ);const d=t.insertBlock(r,i,c);return await this.getMedia(t,c.id).handleUploadFile(s),d})}getMedia(t,e){const r=t.addCustom(`media-${e}`,()=>new eZ({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:s}=this.getAbstract();return{name:r,insertEmbedCommandItems:[{id:`insert-${this.embedType}`,name:t,icon:e,order:i,group:s,subText:Jn(`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,s=this.getMedia(t,i),o=zt(e);return s.render(r,o),!0}handleDeleteBlock(t,e){const r=e.id,i=this.getMedia(t,r);i.removeAllListeners(),i.destroy()}convertTo(t,e,r,i){const s=e.embedData,o=t.doc.buildResourceUrl(s.src,{withToken:!0});return i==="html"?`<${s.type} src="${o}" />`:i==="markdown"?`![${s.src}](${o})`:o}}function LS(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 IS(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const rZ=D("media-audio");class iZ extends SS{constructor(){super(...arguments);m(this,"embedType",Ui.AUDIO);m(this,"updateProgressElement",IS);m(this,"createMediaElement",(e,r,i,s)=>{const o=B("div",["audio-container","embed-hover-content","embed-selected-content"],r),l=B("audio",[],o);return l.innerHTML="Your browser does not support the <code>audio</code> element.",l.controls=!0,l.src=s,setTimeout(()=>{this.getMedia(e,i.id).setFullScreen()}),l})}getAbstract(){return{mediaIcon:U2,mediaName:_.t(`media.${Ui.AUDIO}.menuItem`),menuItem:_.t(`media.${Ui.AUDIO}.menuItem`),order:800,mediaType:Ui.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${_.t(`media.${Ui.AUDIO}.abstract`)}`}}updateMediaElement(e,r,i,s){const o=r.querySelector(":scope .audio-container > audio");return p(rZ,o,"The media element not exist"),o.src!==s&&(o.src=s),o}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",LS(e,r)}}const sZ=new iZ;D("video-resizer");function DS(n){return n&&Le(n)&&sn(n)==="video"}const oZ=50;class vx{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&DS(e)&&this.disableBlockResize(e),t&&DS(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,s=Math.min(Math.max(e.width,oZ),i);this.currentResizableElement.style.width=`${s}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,je.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,je.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}getVideoElement(t){return zt(t).querySelector(":scope .video-container > video")}updateResizer(t){const e=this.editor.findCustom(`${dt(t)}-resizer`);e&&e.updateResizer()}disableBlockResize(t){const e=this.editor.findCustom(`${dt(t)}-resizer`);e&&e.disableResize()}enableBlockResize(t,e){const r=this.editor.addCustom(`${dt(t)}-resizer`,()=>new Nd(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 lZ=D("video");class aZ extends SS{constructor(){super(...arguments);m(this,"embedType",Ui.VIDEO);m(this,"updateProgressElement",IS);m(this,"createMediaElement",(e,r,i,s)=>{const o=B("div",["video-container","embed-selected-content","drag-preview-element"],r),l=B("video",[],o);return l.innerHTML="Your browser does not support the <code>video</code> element.",l.controls=!0,l.src=s,l.addEventListener("canplay",()=>{e.addCustom("video-resizer",()=>new vx(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 s=B("video",["progress-video"],e);s.innerHTML="Your browser does not support the <code>audio</code> element.",s.controls=!0,LS(e,r),Dc(i).then(o=>{const l=e.querySelector(".progress-video");l&&n1(e)&&(l.src=o)})})}getAbstract(){return{mediaName:_.t(`media.${Ui.VIDEO}.menuItem`),mediaIcon:O2,menuItem:_.t(`media.${Ui.VIDEO}.menuItem`),order:700,mediaType:Ui.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`${_.t(`media.${Ui.VIDEO}.abstract`)}`}}handleMediaError(e,r,i){const s=e.addCustom("video-resizer",()=>new vx(e)),o=e.getBlockById(i);s.disableBlockResize(o)}updateMediaElement(e,r,i,s){const o=r.querySelector(":scope .video-container > video");p(lZ,o,"The media element not exist"),o.src!==s&&(o.src=s),i.width?o.style.width=`${i.width}px`:o.style.width="";const l=e.getBlockById(i.id);return setTimeout(()=>{e.addCustom("video-resizer",()=>new vx(e)).updateResizer(l)}),o}}const cZ=new aZ,_S=[oA,mA,gA,kk],Bx=[vS,uQ,EJ,RJ,UJ,kK,zJ,cZ,sZ,vz,Z4,rX],MS=[Pk,nS,T4];function uZ(n,t,e){var i,s,o,l;fi.level=(i=e.logLevel)!=null?i:qo.DEBUG;const r=Jf(n,t,{components:{blocks:[..._S,...((s=e==null?void 0:e.components)==null?void 0:s.blocks)||[]],embeds:[...Bx,...((o=e.components)==null?void 0:o.embeds)||[]],boxes:[...MS,...((l=e.components)==null?void 0:l.boxes)||[]],textRenders:[new HE],options:{...e.componentsOptions}}});return r.readonly=!0,r.addCustom("heading-collapse",()=>new lx(r)),r.addCustom("editor-tooltip",()=>new Sd(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 US{constructor(t){this.createOptions=t,t.lang&&_.setLang(t.lang)}createHistoryEditor(t,e){return uZ(t,e,this.createOptions)}}function OS(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"),s={image:{defaultAlign:"left"},table:{locatingContainer:t,hideCellMenu:!0,hideToolbar:!0},...i==null?void 0:i.componentsOptions},o=[];n.editorBlocks.forEach(E=>{E.blockType==="text"||E.blockType==="embed"||o.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=Jf(t,e,{shortcuts:[nm],components:{blocks:o,commandProviders:[new Um],decorators:[new lg],embeds:l,boxes:c,options:s}});if(d.input.addHandler(new cg),d.input.addHandler(new MA(d)),d.input.addHandler(new KA(d)),d.input.addHandler(new hq(d)),d.input.addHandler(new hg),d.addCustom("image-paste-handler",()=>new _A(d)),Ae.isMobile||d.addCustom("editor-tooltip",()=>new Sd(d)),n.options.enableContextMenu!==!1&&d.addCustom("editor-context-menu",E=>new HA(E)),(h=n.options.componentsOptions)!=null&&h.mention){const E=n.options.componentsOptions.mention;d.addCustom("mention",()=>new eS(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 fZ(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),r=new Set;e.forEach(i=>{const s=nt(i);s&&r.add(s)}),r.forEach(i=>{mq(n,i,t)})}class dZ{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(s=>s.groupId===r).length===0&&fZ(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 OS(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class hZ{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 KC(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 OS(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const mZ={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"}},gZ={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"}},pZ={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"}};_.mergeLang({"zh-CN":mZ,"en-US":gZ,"ja-JP":pZ});const CZ="UEsDBBQABgAIAAAAIQBk9WPugQEAACkGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIoo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AAAAhAOuAYExTAwAAjw4AABIAAAAAAAAAAAAAAAAAWzsAAHdvcmQvZm9udFRhYmxlLnhtbFBLBQYAAAAADwAPANQDAADePgAAAAA=",EZ=()=>Fp(CZ),AZ=D("image-to-docx");async function xZ(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 NS(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};try{const e=await Dc(new File([t],"",{})),r=await xZ(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){AZ.error(e);return}}function bZ(n,t){let e=n.filter(o=>o!=null);const r=t-(e.length-1)*20,i=.87,s=e.reduce((o,l)=>o+l.width,0);return s>r&&(e=e.map(o=>({width:o.width*r/s,height:o.height*r/s,buffer:o.buffer}))),e.map(o=>({width:o.width*i,height:o.height*i,buffer:o.buffer}))}function vZ(n,t,e){if(!e||typeof e!="object")return;const r=e,i=n.filter(o=>o!=null),s=t-(i.length-1)*20;i.forEach((o,l)=>{if(i.length===1&&r.widthPercent){const d=r.widthPercent,h=o.width;o.width=s*(d/100),o.height*=o.width/h;return}const c=`${l}_flex`;if(r[c]){const d=r[c],h=o.width;o.width=s*d,o.height*=o.width/h}})}function PS(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let r;switch(e%3){case 0:r=Bt.LevelFormat.DECIMAL;break;case 1:r=Bt.LevelFormat.LOWER_LETTER;break;default:r=Bt.LevelFormat.LOWER_ROMAN;break}return{level:e,format:r,text:`%${e+1}. `,alignment:Bt.AlignmentType.START,start:t,style:{paragraph:{indent:{left:Bt.convertInchesToTwip(.3*(e+1)),hanging:Bt.convertInchesToTwip(.2)}}}}})}function BZ(){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:Bt.LevelFormat.BULLET,text:t,alignment:Bt.AlignmentType.START,style:{paragraph:{indent:{left:Bt.convertInchesToTwip(.3*(n+1)),hanging:Bt.convertInchesToTwip(.2)}}}}})}function yZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Bt.LevelFormat.BULLET,text:"\u2611",alignment:Bt.AlignmentType.START,style:{paragraph:{indent:{left:Bt.convertInchesToTwip(.3*(n+1)),hanging:Bt.convertInchesToTwip(.2)}}}}))}function TZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Bt.LevelFormat.BULLET,text:"\u2610",alignment:Bt.AlignmentType.START,style:{paragraph:{indent:{left:Bt.convertInchesToTwip(.3*(n+1)),hanging:Bt.convertInchesToTwip(.2)}}}}))}var oh=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(oh||{});const kZ=[{levels:PS(),reference:"number-numbering-reference"},{levels:BZ(),reference:"number-bullet-reference"},{levels:yZ(),reference:"checked-bullet-reference"},{levels:TZ(),reference:"unchecked-bullet-reference"}];function RZ(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 wZ(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 SZ(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 LZ=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function FS(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(LZ);if(t){const e=o=>{let l=Number(o).toString(16);return l.length<2&&(l=`0${l}`),l},r=e(t[1]),i=e(t[2]),s=e(t[3]);return`${r}${i}${s}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function Mn(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 KS(n,t,e){for(let r=0;r<=e;++r){const i=`${t}${r}`;if(Mn(n,i))return i}}function Og(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function yx(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function VS(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function IZ(n){const t=Mn(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 s=i[0].trim().toLowerCase(),o=i[1].trim().toLowerCase();s==="font-size"&&Og(n,"inline-style-font-size",o),s==="color"&&Og(n,"inline-style-color",o),s==="background-color"&&Og(n,"inline-style-background-color",o),s==="font-family"&&Og(n,"inline-style-font-family",o)}}function DZ(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function _Z(n){const t=`${Mn(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function MZ(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 UZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function OZ(n){return Mn(n,"inline-style-font-family")}function NZ(n){const t=Mn(n,"inline-style-background-color");return FS(t)}function PZ(n){const t=Mn(n,"inline-style-color");return FS(t)}function FZ(n){IZ(n);const t=Mn(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!Mn(n,"style-code"),link:VS(Mn(n,"link")),size:_Z(n),text:t?UZ(n):MZ(n)||n.insert,bold:!!Mn(n,"style-bold"),underline:!!Mn(n,"style-underline"),italics:!!Mn(n,"style-italic"),strike:!!Mn(n,"style-strikethrough"),superScript:!!Mn(n,"style-super"),subScript:!!Mn(n,"style-sub"),math:Mn(n,"type")==="math"?Mn(n,"src"):void 0,mention:t,fontFamily:OZ(n),background:NZ(n),color:t?"338fe5":RZ(KS(n,"style-color-",6))||PZ(n),highlight:KS(n,"style-bg-color-",13)}}function KZ(){return[new Bt.Paragraph({border:{top:{color:"auto",style:Bt.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new Bt.Paragraph({spacing:{line:0}})]}function VZ(){return new Bt.Paragraph({children:[new Bt.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function $Z(){return new Bt.Paragraph({children:[new Bt.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function HZ(n,t){return new Bt.Paragraph({children:[new Bt.ExternalHyperlink({children:[new Bt.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function $S(n){if(n.heading!=null)return`Heading${n.heading}`}function HS(n){if(n.alignment!=null){if(n.alignment==="center")return Bt.AlignmentType.CENTER;if(n.alignment==="right")return Bt.AlignmentType.RIGHT;if(n.alignment==="left")return Bt.AlignmentType.LEFT}}function jZ(n){if(n.indent)return{left:Bt.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Bt.convertInchesToTwip(.3*n.padding)}}function zZ(n){return{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function GZ(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function jS(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 Bt.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:Bt.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?GZ(n.fontFamily):void 0,shading:n.background?zZ(n.background):void 0,color:n.color,highlight:wZ(n.highlight)})}function WZ(n,t){if(n.link)return new Bt.ExternalHyperlink({children:[jS(n,t)],link:n.link})}async function zS(n,t,e,r,i){const[s]=await i(n,t,e);if(s==null)return;const o=await NS({width:r||0,height:0,src:e},s);return new Bt.ImageRun({data:s,transformation:{width:(o==null?void 0:o.width)||100,height:(o==null?void 0:o.height)||20}})}function qZ(n){if(n.heading||n.heading)return n.heading}function XZ(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function YZ(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function QZ(n,t){var r;const e=[];if(n.text&&Array.isArray(n.text)){for(let i=0;i<n.text.length;i++){const s=n.text[i];if(((r=s.attributes)==null?void 0:r.box)===!0&&t){const o=await t(s);if(o){n.text.splice(i+1,0,...o);continue}}e.push(FZ(s))}return e}}function JZ(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 ZZ(n,t){if(n.type==="embed"&&n.embedType&&yx(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(r=>{const i=t(r),s=n.embedData[`${i}_width`],o=n.embedData[`${i}_height`];return{src:r,width:s,height:o}})}function ttt(n){if(n.padding)return n.padding}function ett(n){return!!(n.type==="embed"&&n.embedType&&yx(n.embedType)&&n.embedData&&n.embedData.src)}async function Ng(n,t,e){return{quoted:!!n.quoted,heading:qZ(n),alignment:XZ(n),indent:YZ(n),padding:ttt(n),texts:await QZ(n,e),list:JZ(n),images:ZZ(n,t),border:ett(n)}}async function ntt(n,t,e,r){const i=[];if(!n.children)return[];for(const s of n.children){const o=[];for(const l of t.blocks[s])o.push(await Ng(l,e,r));i.push(o)}return i}const rtt=D("to-docx");function itt(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 stt(n,t,e,r){const i=!!n.hasColTitle,s=!!n.hasRowTitle,o=!!n.isStripeStyle,l="F5F8FB";for(let c=0;c<t;c++)for(let d=0;d<e;d++)(i&&d===0||s&&c===0||o&&c%2===1)&&(r[c][d].color=l)}function ott(n){p(rtt,n.children,"no table children");const t=n.rows,e=n.cols,r=n.colsWidth;if(r)for(let o=0;o<r.length;o++)r[o]===0&&(r[o]=100);const i=itt(t,e);let s=0;for(let o=0;o<t;++o)for(let l=0;l<e;++l){if(i[o][l].originalWidth=r?r[l]:void 0,i[o][l].from!==void 0)continue;const c=n.children[s];s+=1,i[o][l].cellId=c,i[o][l].color=SZ(n[`${c}_background`]),i[o][l].width=r?r[l]:100,i[o][l].align=n[`${c}_align`];const d=n[`${c}_rowSpan`]||1,h=n[`${c}_colSpan`]||1;if(i[o][l].rowSpan=d,i[o][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[o+E][l+A].from=[o,l]);i[o][l].width=C}}return stt(n,t,e,i),i}async function ltt(n,t,e,r,i,s,o,l,c,d){async function h(E){if(l&&E.type!=="_exportVirtualBlock"){const A=await l(i,s,E);if(A){await r.addDoc(n,A,d);return}}if(E.type==="text"||E.textOnly===!0){const A=await Ng(E,o,c);await r.addTextBlock(A);return}if(E.type==="code"){const A=await ntt(E,e,o,c);await r.addCodeBlockObject(A);return}if(E.type==="list"&&E.textOnly!==!0){const A=await Ng(E,o,c);await r.addListBlockObject(n,A);return}if(E.type==="embed"&&E.embedType){const A=E,v=A.embedData,S=A.embedType;if(yx(S)){const w=await Ng(E,o,c);await r.addImagesBlockObject(E,w,d)}else E.embedType==="hr"?r.addSeparatorBlock():E.embedType==="video"?r.addVideoPlaceholder():E.embedType==="audio"?r.addAudioPlaceholder():E.embedType==="webpage"?r.addHyperlinkParagraph(VS(v.src),v.title):r.addOtherEmbedBlock(S,E.embedData);return}if(E.type==="table"){let A=[];if(E.colsWidth)A=E.colsWidth;else{const S=E.cols;A=new Array(S);for(let w=0;w<A.length;w++)A[w]=100;E.colsWidth=A}const v=ott(E);await r.addTableMatrix(A,v,e),r.addEmptyParagraph()}E.type==="_exportVirtualBlock"&&await r.addVirtualBlock(E.id,e,d)}function C(E){var S;const A=((S=E==null?void 0:E.embedData)==null?void 0:S.exportSpec)||(E==null?void 0:E.exportSpec);if(!A)return[E];const v=[];for(const{type:w,data:O}of A){if(w==="text"){const M={id:it(),text:[{insert:O}],type:"text"};v.push(M);continue}if(w==="image"){const M={id:it(),type:"embed",embedType:"image",align:"left",embedData:{src:O}};v.push(M);continue}if(w==="link"){const M={id:it(),type:"embed",embedType:"webpage",embedData:{src:O.url,title:O.title}};v.push(M);continue}if(w==="block")for(const M of O){if(!e.blocks[M])continue;const tt={id:M,type:"_exportVirtualBlock"};v.push(tt)}}return v}for(const E of t)for(const A of C(E))!A||await h(A)}function att(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const ctt=D("to-docx");class utt{constructor(t,e,r,i,s,o){m(this,"paragraphs");this.appId=t,this.docId=e,this.state=r,this.readImageFunc=i,this.convertBlocksFunc=s,this.defaultFontSize=o,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new Bt.Paragraph({heading:$S(t),alignment:HS(t),children:await this.paragraphsFromBlockTexts(t),indent:jZ(t)}))}async addEmptyImagePlaceHolder(){this.paragraphs.push(new Bt.Paragraph({text:`[${_.t("docx.imageExportFailed")}]`,shading:{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=DZ(this.defaultFontSize,t.heading),r=[];for(const i of t.texts){if(i.link){const s=WZ(i,e);s&&r.push(s);continue}if(i.box&&i.box.type&&i.box.type==="br"){r.push(new Bt.TextRun({text:"",break:1}));continue}if(i.box&&i.box.type&&i.box.type==="image"){const s=await zS(this.appId,this.docId,i.box.src,i.box.width,this.readImageFunc);s&&r.push(s);continue}if(i.math){const s=await zS(this.appId,this.docId,i.math,0,this.readImageFunc);s&&r.push(s);continue}r.push(jS(i,e))}return r}async addCodeBlockObject(t){for(const e of t)for(const r of e){const i={style:Bt.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Bt.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 o=`number-numbering-reference-${r}`,l=PS([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:o,inst:r}),this.state.listRefMap[i]=o}else e.list.ordered?this.state.listRefMap[i]=oh.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[i]=oh.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[i]=oh.UNCHECKED:this.state.listRefMap[i]=oh.BULLET;const s=$S(e);e.texts&&this.paragraphs.push(new Bt.Paragraph({heading:s,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[i],level:e.list.level-1,instance:r}}))}imageDimWithBufferToImageRun(t){return new Bt.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=[],s=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 NS(c,d);if(C)return C}i.push(h)}));vZ(s,r,t.embedData);const o=bZ(s,r),l={style:Bt.BorderStyle.SINGLE,color:"#DEDEDE"};o.length&&this.paragraphs.push(new Bt.Paragraph({border:e.border?{left:{...l},right:{...l},top:{...l},bottom:{...l}}:void 0,alignment:HS(e)||Bt.AlignmentType.CENTER,children:o.map(c=>this.imageDimWithBufferToImageRun(c)).flatMap((c,d,h)=>c==null?[]:h.length-1!==d?[c,new Bt.TextRun({text:" "})]:c)})),i.forEach(c=>{this.addHyperlinkParagraph(c)})}addSeparatorBlock(){KZ().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Bt.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(VZ())}addAudioPlaceholder(){this.paragraphs.push($Z())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(HZ(t,e))}async addTableMatrix(t,e,r){const i=t.map(s=>s!==0?s*15:1500);this.paragraphs.push(new Bt.Table({rows:await this.generateTableRows(e,r),columnWidths:i}))}async generateRowCells(t,e){const r=[];for(const i of t){const s=i.cellId;if(s===void 0)continue;const o=i.width*.9;r.push(new Bt.TableCell({children:await this.convertBlocksFunc(s,e.blocks[s],e,this.appId,this.docId,this.state,o),columnSpan:i.colSpan,rowSpan:i.rowSpan,width:{type:Bt.WidthType.DXA,size:i.width*15},shading:i.color?{fill:i.color,type:Bt.ShadingType.CLEAR,color:"auto"}:void 0}))}return r}async generateTableRows(t,e){const r=[];for(const i of t)r.push(new Bt.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 addVirtualBlock(t,e,r){const i=await this.convertBlocksFunc(t,e.blocks[t],e,this.appId,this.docId,this.state,r);this.paragraphs.push(...i)}async addOtherEmbedBlock(){}}class ftt{constructor(t,e,r,i,s,o,l,c){m(this,"convertBlocks",async(t,e,r,i,s,o,l=720)=>{const c=new utt(i,s,o,this.readImage,this.convertBlocks,this.defaultFontSize);return await ltt(t,e,r,c,i,s,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),c.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=r,this.readImage=i,this.defaultFontSize=s,this.getDocByBlock=o,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 Bt.ImportDotx,s=this.templateData?await i.extract(this.templateData):void 0,o=t.blocks.root;p(ctt,o,"data must have blocks");const l=att(),c=await this.convertBlocks("blocks",o,t,e,r,l),d=this.backgroundImageOptions?{default:new Bt.Header({children:[new Bt.Paragraph({children:[new Bt.ImageRun(this.backgroundImageOptions)]})]})}:{},h=new Bt.Document({numbering:{config:[...kZ,...l.levelConfigs]},sections:[{headers:d,children:c,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:s});return Bt.Packer.toBlob(h)}}async function dtt(n,t,e,r){const i=n.doc.buildResourceUrl(r,{withToken:!0});let s=await cS(i);if(!s)return[void 0,i];if(s.type.indexOf("/svg")!==-1){const l=await oS(s);l&&(s=new File([l],s.name))}return[await s.arrayBuffer(),i]}async function htt(n,t,e){const r=n.editorBlocks.getBlockClass(e.type);if(r.toStandardDoc)return r.toStandardDoc(n,e,t)}async function mtt(n,t){const e=t.attributes,r=n.editorBoxes.getBoxClass(e.type);if(r.toStandardText)return r.toStandardText(n,e)}async function gtt(n,t){let{template:e,download:r,backgroundImageOptions:i}=t!=null?t:{};e||(e=EZ());const s=n.doc.toJSON(),o=(C,E,A)=>dtt(n,C,E,A),l=async(C,E,A)=>htt(n,s,A),c=async C=>mtt(n,C),h=await new ftt(e,s,t0.default,o,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 Tx=D("create-editor");async function ptt(n,t){var o,l,c,d,h,C,E,A,v,S,w,O,M,V,tt,Y;p(Tx,n,"app does not exists"),t.lang&&_.setLang(t.lang),fi.level=(o=t.logLevel)!=null?o:qo.DEBUG;const e=t.onReauth?async()=>{var bt;const X=t.user.userId,ct=t.docId,xt=await((bt=t.onReauth)==null?void 0:bt.call(t,X,ct,t.permission));return{userId:X,docId:ct,permission:t.permission,appId:t.appId,token:xt,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,onMaxUsersError:t.onMaxUsersError},i=await dd.load(r),s=Jf(n,i,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,enableComments:t==null?void 0:t.enableComments,enableContextMenu:t==null?void 0:t.enableContextMenu,components:{blocks:[..._S,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...Bx,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[...MS,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new Um,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new lg,new $C],insertions:[V1],blockHooks:[new wA,new tw,...((C=t.components)==null?void 0:C.blockHooks)||[]],textRenders:[new C4,new HE,...((E=t.components)==null?void 0:E.textRenders)||[]],options:{...t.componentsOptions}},shortcuts:[Tq,tH,dz,lA,Hw,fF,eA,cX,nm,iF,...t.shortcuts||[]],colors:["#0064FF","#EB3723","#F59300","#00A865","#F25A0A","#70A310","#009CAD","#0990D9","#8851ED","#D62069"]});if(s.editorCommandProviders.registerCommandProvider(new ms(s)),s.input.addHandler(new JX),s.input.addHandler(new cg),s.input.addHandler(new IK),s.input.addHandler(new iz),s.input.addHandler(new pA(s,{hideTitle:t.hideTitle,headingLevel:1,titlePlaceholder:_.t("placeholder.common.title"),contentPlaceholder:_.t("placeholder.common.content"),readonlyTitlePlaceholder:_.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0,applyContentPlaceholder:(A=t.placeholder)==null?void 0:A.applyContentPlaceholder})),s.input.addHandler(new eg(s,(v=t.componentsOptions)==null?void 0:v.quickMenu)),s.input.addHandler(new MA(s)),s.input.addHandler(new KA(s)),s.input.addHandler(new hg),s.input.addHandler(new Tk),s.doc.registerCallback(new ZX(s)),s.addCustom("remote-cursor",()=>new i2(s)),s.addCustom("block-menu",X=>new rw(X)),Ae.isMobile||s.addCustom("editor-tooltip",()=>new Sd(s)),t!=null&&t.enableComments&&s.addCustom("editor-comments",X=>new p4(X,new dZ(X))),t.enableContextMenu!==!1&&s.addCustom("editor-context-menu",X=>new HA(X)),s.addCustom("create-options",()=>new wb(s,t)),s.addCustom("drop-target",()=>new Wd(s)),s.addCustom("list-to-mindmap",()=>new Xm(s)),s.addCustom("list-to-mention",()=>new xY(s)),s.addCustom("mobile-helper",()=>new $Y(s)),s.addCustom("code-caret",()=>new Y$(s)),s.addCustom("image-paste-handler",()=>new _A(s)),(S=t.componentsOptions)!=null&&S.mention){const X=t.componentsOptions.mention;s.addCustom("mention",()=>new eS(s,X))}if(s.addCustom("heading-collapse",()=>new lx(s)),s.addCustom(Mg,X=>new mx(X)),Au.register(s),Wd.register(s),wl.register(s),vl.register(s),s.addListener("clickLink",(X,ct,xt)=>{var Rt;if((Rt=t==null?void 0:t.events)!=null&&Rt.onClickLink){t.events.onClickLink(X,ct,xt);return}const bt=xt.getAttribute("link");bt&&(X.readonly||ct.ctrlKey||ct.metaKey)&&window.open(bt,"_blank")}),(O=(w=t.componentsOptions)==null?void 0:w.remoteCarets)!=null&&O.onUserChanged){const X=(V=(M=t.componentsOptions)==null?void 0:M.remoteCarets)==null?void 0:V.onUserChanged;s.doc.getRemoteUsers().on("change",ct=>{X(s,ct)})}return(Y=(tt=t.componentsOptions)==null?void 0:tt.templates)!=null&&Y.templates.length&&(s.addListener("docChanged",()=>{_g(s)}),s.addListener("resize",()=>{_g(s,{reset:!0})}),setTimeout(()=>{_g(s)},100)),s.doc.registerCallback({onError:async X=>{if(X.code==="ResetDoc"){Tx.error(`reset doc: ${X.message}`);const ct=await dd.load(r);s.doc.reset(ct)}}}),s.version="1.1.19",fi.level===qo.DEBUG&&(window.setReauthFail=X=>{window.isReauthError=X},window.reConnect=X=>s.doc.externalDoc.client.connection.reConnect(X)),s}function Ctt(n){return n.toJSON!==void 0}async function Ett(n,t,e){var s,o,l,c,d,h,C,E;p(Tx,n,"app does not exists");const r=Ctt(t)?t:new xC(t,{serverUrl:e.serverUrl||""});e.lang&&_.setLang(e.lang),fi.level=(s=e.logLevel)!=null?s:qo.DEBUG;const i=Jf(n,r,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[oA,mA,gA,kk,...(l=(o=e.components)==null?void 0:o.blocks)!=null?l:[]],commandProviders:[new Um],decorators:[new lg,new $C],embeds:[...Bx,...((c=e.components)==null?void 0:c.embeds)||[]],boxes:[Pk,nS,T4,...((d=e.components)==null?void 0:d.boxes)||[]],insertions:[V1],blockHooks:[new wA,...((h=e.components)==null?void 0:h.blockHooks)||[]],textRenders:[new C4,new HE,...((C=e.components)==null?void 0:C.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[lA,Hw,eA,nm]});return i.editorCommandProviders.registerCommandProvider(new ms(i)),i.input.addHandler(new cg),i.input.addHandler(new pA(i,{hideTitle:e.hideTitle,headingLevel:1,titlePlaceholder:_.t("placeholder.common.title"),contentPlaceholder:_.t("placeholder.common.content"),readonlyTitlePlaceholder:_.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new eg(i,(E=e.componentsOptions)==null?void 0:E.quickMenu)),i.input.addHandler(new MA(i)),i.input.addHandler(new KA(i)),i.input.addHandler(new hg),i.input.addHandler(new Tk),i.addCustom("block-menu",A=>new rw(A)),Ae.isMobile||i.addCustom("editor-tooltip",()=>new Sd(i)),i.addCustom("image-paste-handler",()=>new _A(i)),e!=null&&e.enableComments&&i.addCustom("editor-comments",A=>new p4(A,new hZ(A,r))),e.enableContextMenu!==!1&&i.addCustom("editor-context-menu",A=>new HA(A)),i.addCustom("heading-collapse",()=>new lx(i)),i.addListener("clickLink",(A,v,S)=>{var O;if((O=e==null?void 0:e.events)!=null&&O.onClickLink){e.events.onClickLink(A,v,S);return}const w=S.getAttribute("link");w&&(A.readonly||v.ctrlKey||v.metaKey)&&window.open(w,"_blank")}),i.addCustom(Mg,A=>new mx(A)),Au.register(i),i.version="1.1.19",i}async function Att(n,t,e){var h;const r=n.doc.externalDoc.client.auth,i=await mm.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 o=n.getCustom("create-options");if(!o)throw new Error("the editor does not support to show versions");const l=o.getData(),c=new US(l),d=n.addCustom("version-dialog",()=>new V4(i,c));return d.show(t),d}b.tippy=e9,b.AnchorBox=BB,b.AuthError=ud,b.AuthHeader=Ea,b.AutoScroll=C0,b.BaseURLHeader=tu,b.BasicCommands=ZF,b.BlockExclusiveHook=tw,b.BlockLockerHook=wA,b.BlockLockerPasteHandler=hg,b.BlockResizer=Nd,b.BrBox=AB,b.CodeBlock=mA,b.CodeLineBlock=gA,b.CodeTextDecorator=lg,b.DOC_RE_AUTH_KEYS=Mg,b.DefaultShortcuts=nm,b.DocIdError=GU,b.DocReAuthCallbacks=mx,b.DragDrop=Gb,b.DrawioEmbed=vS,b.EditorBlocks=n3,b.EditorBoxes=bB,b.EditorCommandProviders=Ey,b.EditorComplexBlockPosition=Ei,b.EditorComplexSelectionRange=Qi,b.EditorDecorators=RB,b.EditorEmbeds=i3,b.EditorInsertions=kB,b.EditorSimpleBlockPosition=hn,b.EditorSimpleSelectionRange=xn,b.EmbedBlock=o3,b.EmbedBlockResizer=eh,b.EnforceWithDocumentTitleHandler=pA,b.EventCallbacks=Sc,b.FILL_CHAR=p8,b.FileExtError=WU,b.GroupOrder=Lk,b.HeadingBlockScrollListener=hY,b.ImageBox=vB,b.InlineBoxCommandProvider=jk,b.InputtingInsertion=yB,b.LocalDoc=xC,b.LogLevel=qo,b.Logger=fi,b.MIN_DISTANCE_THRESHOLD=jb,b.ManualCloseDialog=md,b.ManualMenu=dl,b.ManualToolbar=hd,b.MarkdownInputHandler=cg,b.MaxUserError=_C,b.Mindmap=qm,b.OnesEditorAutoSuggest=cE,b.OnesEditorCustomDataWrapper=wb,b.OnesEditorExclusiveBlock=vl,b.OnesEditorHoveringBlock=je,b.OnesEditorIcons=DO,b.OnesEditorQuickMenu=eg,b.OnesEditorToc=ih,b.OnesEditorTocProvider=wl,b.OnesEditorToolbar=Au,b.OnesEditorTooltip=Sd,b.OnesEditorVersionsDialog=V4,b.PermissionError=hm,b.Popup=iu,b.ReAuthToolbar=uS,b.RemoteCarets=i2,b.RemoteCaretsDecorator=$C,b.RemoteCaretsInsertion=V1,b.RemoteUsers=Zf,b.RequestReloadError=fd,b.RichText=Hn,b.ShareDBDoc=dd,b.ShareDBDocVersionsProvider=US,b.ShareDBServer=mm,b.SimpleCache=Ob,b.StandardEmbedBlockCommands=ZA,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=x1,b.TEXT_STYLE_COLOR_PREFIX=A1,b.TableBlock=oA,b.TableBlockCommandProvider=Um,b.TableShortcuts=lA,b.TextBlock=lr,b.TextBox=EB,b.TextColorItem=vT,b.TextStyleShortcuts=eA,b.TocEmbed=Z4,b.ZERO_WIDTH_SPACE_CHAR=Af,b.abbreviation=E0,b.addAttribute=R0,b.addClass=q,b.addCommentToBlock=th,b.addDays=uI,b.addMetaToDoc=Yf,b.addMonths=cI,b.animateScrollTo=ea,b.applyPlaceholderToBlock=Ud,b.assert=p,b.autoShowHideTemplates=_g,b.bindKeyDownEvent=c0,b.blockToDoc=mC,b.blockToHtml=j1,b.blockToMarkdown=H0,b.blockToText=$0,b.blocksToDoc=V5,b.clearAllSelection=Ov,b.clientType=Ae,b.cloneBlock=sl,b.cloneChildContainer=tC,b.cloneDoc=eC,b.cloneText=cB,b.commentToShareDbComment=VC,b.compareElement=l0,b.comparePosition=f1,b.complexBlockAdjustSelectionPos=y0,b.complexBlockFindNearestChildBlock=a7,b.complexBlockGetAllChildContainers=In,b.complexBlockGetBottomChildContainers=u3,b.complexBlockGetDeepFirstChild=l3,b.complexBlockGetFirstSimpleChild=h1,b.complexBlockGetLastSimpleChild=Nc,b.complexBlockGetSelectedContainers=Oc,b.complexBlockGetTopChildContainers=c3,b.containerToDoc=$5,b.continuousScroll=av,b.convertBlockFrom=v0,b.convertImageFileToPng=oS,b.convertImageSrcToPng=OY,b.converterIntercept=ag,b.copyBlockAttributes=FB,b.copyResourcesFromDoc=AC,b.createBlockAnchor=Hs,b.createBlockCaretAnchor=d3,b.createBlockContentElement=aa,b.createBlockElement=Rv,b.createBlockSimpleDocRange=N0,b.createBlockSimpleRange=Pe,b.createBoxContentElement=Lv,b.createBoxElement=wv,b.createBoxOp=aB,b.createChildContainer=t3,b.createComplexBlockPosition=_e,b.createComplexDocPos=mB,b.createComplexDocRange=A8,b.createContainer=fB,b.createContainerElement=Xp,b.createDeleteOps=iB,b.createEditor=Jf,b.createEditorSelectionRange=mn,b.createElement=B,b.createEmptyContainer=Xs,b.createEmptyDoc=qs,b.createEmptyTextBlockData=U0,b.createExpandedRange=s0,b.createIconButton=Jl,b.createImage=Sp,b.createInsertOps=_0,b.createInsertionContentElement=_v,b.createInsertionElement=Iv,b.createLocalEditor=Ett,b.createOnesEditor=ptt,b.createRange=Nb,b.createRichText=ma,b.createRootContainer=Zv,b.createSimpleBlockPosition=ht,b.createSimpleDocPos=hB,b.createTextBlockData=es,b.createTextButton=Ra,b.createTextOp=zr,b.createTextWithReplaceSoftReturn=D1,b.daysAfter=jp,b.deleteText=M1,b.diffDays=fI,b.disablePageScroll=Vp,b.docToHtml=MB,b.docToHtmlFragment=Hf,b.docToMarkdown=UB,b.docToText=il,b.downloadImageToFile=cS,b.downloadObjectToFile=Cx,b.downloadSvgToString=hS,b.editLink=Td,b.editorAddComment=pq,b.editorAddTextAttribute=YB,b.editorAutoInsertBlock=KB,b.editorBreakTextBlock=Wc,b.editorClearCompositionText=q1,b.editorClearSelectedContents=q0,b.editorCopyBlock=CC,b.editorCopyDoc=em,b.editorDeleteBlock=Q1,b.editorDeleteBlockText=X1,b.editorDeleteBlockWithoutChildren=G0,b.editorDeleteChildContainer=C_,b.editorDeleteChildContainers=VB,b.editorFocusToBlock=Z1,b.editorFocusToEnd=O_,b.editorGetBlockData=rl,b.editorGetBlockText=Qn,b.editorGetBlockTextEx=F0,b.editorGetBoxData=pB,b.editorHandleKeyboardEvent=ty,b.editorInsertBlock=Gc,b.editorInsertBoxToBlock=NB,b.editorInsertDoc=qB,b.editorInsertDocAt=nC,b.editorInsertText=W1,b.editorInsertTextToBlock=OB,b.editorInsertTextToBlockEx=G1,b.editorMergeTextBlock=$B,b.editorMoveDown=c5,b.editorMoveEnd=cC,b.editorMoveHome=A5,b.editorMoveLeft=o5,b.editorMoveLineEnd=R5,b.editorMoveLineHome=k5,b.editorMovePageDown=_5,b.editorMovePageUp=D5,b.editorMoveRight=l5,b.editorMoveUp=a5,b.editorMoveWordEnd=p5,b.editorMoveWordLeft=g5,b.editorRangeClearColor=JB,b.editorRangeGetColor=ZB,b.editorRangeSetColor=QB,b.editorRemoveTextAttribute=b_,b.editorReplaceBlockText=X0,b.editorReplaceContainer=XB,b.editorRunOnce=bC,b.editorSelectAll=fC,b.editorSelectContainer=J0,b.editorSelectDown=u5,b.editorSelectEnd=uC,b.editorSelectHome=x5,b.editorSelectLeft=f5,b.editorSelectLineEnd=T5,b.editorSelectLineHome=y5,b.editorSelectPageDown=O5,b.editorSelectPageUp=U5,b.editorSelectRight=d5,b.editorSelectUp=h5,b.editorSelectWordEnd=E5,b.editorSelectWordLeft=C5,b.editorSetTextColor=qc,b.editorShowFindDialog=aW,b.editorToDocx=gtt,b.editorUpdateBlockData=Y0,b.editorUpdateCompositionText=PB,b.editorUpdateEmbedData=GB,b.enablePageScroll=$p,b.escapeHtmlText=u0,b.escapeRegExp=qp,b.escapeSpace=G9,b.exclusiveBlock=TA,b.executeBlockCommand=zv,b.executeEmbedBlockCommand=jv,b.executeRangeCommand=Cy,b.fileToDataUrl=Dc,b.findAfterOffsetNotType=P1,b.findAllText=dC,b.findBlockByIndex=Av,b.findEventTargetBlock=Kb,b.findInsertionById=Dv,b.findNextOffset=F8,b.findNextVisibleSimpleBlock=vy,b.findPrevOffset=P8,b.findPrevOffsetNotType=N1,b.findPrevSimpleBlockBeforeChildContainer=a3,b.findPrevVisibleSimpleBlock=by,b.findTarget=Ic,b.findWordEnd=K1,b.findWordLeft=F1,b.format=Tf,b.formatBytes=cv,b.formatDate=Gp,b.fragmentToHtml=rv,b.fromBase64=bf,b.fromBase64ToBlob=Fp,b.fromBase64ToUint8Array=rI,b.fromDocRange=tl,b.fromNowString=Wp,b.genId=it,b.getAllChildBlocks=C1,b.getAllQuickMenuItems=tA,b.getAllSelectedBlocks=Ji,b.getAttributesAt=Vc,b.getBlockBackground=Jp,b.getBlockByIndex=Yo,b.getBlockCaretRect=Jo,b.getBlockClass=le,b.getBlockClassByType=sa,b.getBlockClientRects=Ks,b.getBlockCommandsWithHook=s1,b.getBlockContent=zt,b.getBlockHeading=Lf,b.getBlockId=dt,b.getBlockIndex=wt,b.getBlockInfo=$d,b.getBlockKind=gi,b.getBlockMinWidth=Pv,b.getBlockNearestRangeFromPoint=g1,b.getBlockOptions=yI,b.getBlockPath=Zo,b.getBlockProperties=Vv,b.getBlockRangeFromPoint=T0,b.getBlockStyles=BI,b.getBlockTextLength=Ct,b.getBlockTools=xe,b.getBlockType=Ot,b.getBoxContent=t1,b.getBoxId=Sv,b.getBoxTypeFromElement=Sf,b.getChildBlockCount=mi,b.getChildBlocks=Te,b.getChildOffset=el,b.getColorFromAttributes=v1,b.getColorFromContent=A0,b.getComplexBlockClass=Kr,b.getContainerBlockPath=Yv,b.getContainerBlocks=Uv,b.getContainerBlocksElement=Rf,b.getContainerById=hi,b.getContainerId=pt,b.getContainerMinWidth=c1,b.getContainerToolsElement=xI,b.getContainerWidth=e3,b.getDistanceSquare=Xo,b.getElementFromPoint=Oe,b.getElementOffset=Ef,b.getElementScale=Fr,b.getEmbedType=sn,b.getExistsBlockTools=x0,b.getExistsContainerById=kf,b.getFileExt=yf,b.getFirstChildBlock=Ne,b.getFirstClientRect=o0,b.getHeadingBlockChildren=Uc,b.getHeadingMenuOptions=YE,b.getHorizontalPadding=Ip,b.getInsertionContent=e1,b.getLastChildBlock=Je,b.getLastClientRect=Zl,b.getListAllNextBrothers=hu,b.getLogger=D,b.getNextBlock=ae,b.getNextHiddenBlocks=qv,b.getNextValidOffset=da,b.getNextVisibleBlock=$r,b.getOffsetFromPoint=Lp,b.getOffsetInfoAfter=Kf,b.getOffsetInfoBefore=K0,b.getOpAt=P3,b.getOpLength=k0,b.getParentBlock=nt,b.getParentBlockExcludeSelf=la,b.getParentBox=Zp,b.getParentContainer=at,b.getPrevBlock=$e,b.getPrevValidOffset=nl,b.getPrevVisibleBlock=Vr,b.getRangeCommands=gy,b.getReferenceClientRect=ek,b.getRootBlock=i1,b.getScrollContainer=dn,b.getSpecialBlockCommands=$v,b.getStandardEmbedBlockProperties=tx,b.getTextAfterOffset=O8,b.getTextAttributes=z1,b.getTextBeforeOffset=N8,b.getTextBlockChild=_f,b.getTextBlockClass=bv,b.getTextBlockContentChildTextLength=jr,b.getTextBlockContentChildType=Xv,b.getTextBlockContentChildren=Yi,b.getTextLength=$n,b.getTextOpLength=E1,b.getTextWidth=m0,b.getToolbar=$m,b.handleBlockElementUpdated=Fv,b.hasAltOnly=J9,b.hasClass=Mt,b.hasCtrlOrCmd=Jb,b.hasCtrlOrCmdOnly=Q9,b.hashCode=pv,b.hideBlock=kv,b.hideTemplates=sS,b.htmlToFragment=h0,b.i18n=_,b.includeBigTable=aN,b.injectDocToHtmlFragment=Xf,b.injectStyle=Hb,b.inputActions=nM,b.insertEmptyBlock=RI,b.insertEmptyEmbedBlock=o1,b.insertText=Ws,b.intersectionCommands=UM,b.isBackspace=tv,b.isBlock=oa,b.isBlockLocked=dg,b.isBlockLockedByOthers=RA,b.isBlockLockedBySelf=Hd,b.isBlockTools=Tv,b.isBox=b0,b.isBoxOp=js,b.isCJK=Yb,b.isChildContainer=Ci,b.isChildNode=pe,b.isCodeBlock=Di,b.isCollapsedHeadingBlock=Xi,b.isCollapsedRange=E8,b.isComplexBlockPosition=ua,b.isComplexKindBlock=Pt,b.isContainer=Fs,b.isContainerSelectedAllChildBlocks=N5,b.isControlEvent=ra,b.isDelete=tI,b.isDraggingFiles=g0,b.isElementVisible=Mp,b.isEmbedBlock=Le,b.isEmptyContainer=Mf,b.isEmptyDoc=U1,b.isEmptyTextBlock=be,b.isEmptyTextBlockWithoutCompositionText=Md,b.isEnterOnly=Zb,b.isEscape=d0,b.isExclusiveBlock=Vd,b.isExpandedHeadingBlock=Wv,b.isFirefox=pf,b.isFirstChildBlockInComplexBlock=l7,b.isHeadingBlock=Ln,b.isHighSurrogate=$9,b.isInBlock=n1,b.isInBlockTools=Mc,b.isLetter=Xb,b.isLowSurrogate=H9,b.isMatchShortcut=Wi,b.isMoveForward=X9,b.isNavigationEvent=q9,b.isNavigationKey=Qb,b.isNodeRemoved=Cf,b.isNumber=qb,b.isPrintableKey=Np,b.isRootBlock=Hr,b.isRootContainer=re,b.isSafari=Ql,b.isSameDay=zp,b.isSelectBoxOnly=Li,b.isShiftEnter=Z9,b.isShiftTab=nI,b.isShortcutEvent=Y9,b.isSimpleBlock=vI,b.isSimpleBlockPosition=Ai,b.isSimplePos=dB,b.isSimpleRange=O0,b.isSpace=f0,b.isTab=eI,b.isTextBlockContentBoxChild=br,b.isTextBlockContentChild=If,b.isTextBlockContentInsertionChild=$s,b.isTextBlockContentTextChild=Df,b.isTextKindBlock=ot,b.isTextKindBlockType=wf,b.isTitleBlock=Ps,b.isToday=uv,b.isValidOffset=or,b.isVisibleBlock=Qo,b.isYesterday=fv,b.loadJs=Fb,b.loadJsPromise=ta,b.lockers=di,b.mergeCommands=Vm,b.mergeDocs=ga,b.mergeOps=_1,b.mergeText=m8,b.multiSplitText=K3,b.overflowText=dv,b.parseShortcut=ev,b.patchNode=vf,b.pointInRect=na,b.rangeAddAttribute=Nf,b.rangeGetTextColor=W3,b.rangeRemoveAttribute=Kc,b.rangeSetTextColor=j3,b.rangeTransformText=$3,b.registerDragDrop=Up,b.removeAttribute=b1,b.removeClass=ut,b.removeLastBr=u8,b.removePlaceholderFromBlock=kR,b.removeStyle=$b,b.replaceAll=dI,b.replaceAllCaseInsensitive=hI,b.replaceAllText=F5,b.replaceText=M0,b.requestDownload=p0,b.resetListStart=gu,b.scrollIntoView=$f,b.scrollable=lv,b.selectFile=_c,b.selectedBlockToDoc=Z0,b.selectionToDoc=Xc,b.setAttributes=a0,b.setClipboardData=Bf,b.setClipboardDataByEvent=oI,b.setColorToAttributes=z3,b.setDataset=Dp,b.setDefaultCursor=xf,b.setStyles=_p,b.shareDBCommentToDocObject=KC,b.shareDBDocCommentToComment=n2,b.shortcutToDisplayText=fn,b.showBlock=Qp,b.showDocVersions=Att,b.showTemplates=dx,b.splitText=sr,b.splitToThree=gn,b.stringToDataUrl=Kp,b.stringToObjectUrl=Hp,b.subText=V3,b.textNodeOffsetFromPoint=Pb,b.titleFromEditor=aS,b.toBase64URL=qi,b.toMindmap=Wm,b.toPlainText=ke,b.toPlainTextKeepLength=O1,b.trimChar=Op,b.unexclusiveBlock=kA,b.unicodeLength=j9,b.unicodeSubstr=z9,b.updateBlockSelection=Nv,b.updateOpAttributes=uB,b.updateTextBlockContent=U8,b.updateUrl=Pp;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"}})});
962
+ \`\`\`\`\`\``}return""}const UJ={embedType:"plantuml",convertFrom:DJ,handleUpdateBlock:IJ,createEmbedContent:LJ,getBlockProperties:_J,convertTo:MJ},Kat="",OJ="hr",NJ={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},PJ={dividingLine:{type:"Dividing-Line",abstract:"Dividing-Line"}},FJ={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};_.mergeLang({"zh-CN":NJ,"en-US":PJ,"ja-JP":FJ});function KJ(n,t){const e=B("div",["editor-embed-container"],t);B("hr",["editor-embed-hr"],e)}function VJ(n,t,e,r){return r==="html"?"<hr />":r==="markdown"?"---":"------------"}function $J(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:_.t("dividingLine.type"),icon:P2,order:500,group:"common",subText:Jn("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:r}=t;return n.insertEmbed(e,r,OJ,{})}}}function HJ(n,t,e){const{data:r}=e;if(!r||r.embedType!=="dividing-line"||!ot(n,t))return null;const i={};return{blockData:{id:it(),type:"embed",embedType:"hr",embedData:i}}}function jJ(){return{abstract:_.t("dividingLine.abstract")}}const zJ={embedType:"hr",createEmbedContent:KJ,convertTo:VJ,getOptions:$J,convertFrom:HJ,getBlockProperties:jJ},Vat="",$at="",GJ={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"}}},WJ={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"}}},qJ={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"}}};_.mergeLang({"zh-CN":GJ,"en-US":WJ,"ja-JP":qJ});var Ui=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(Ui||{}),sh=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(sh||{});const RS=10*1024*1024,XJ=["wav","mp3","aac","ogg","webm","flac"],YJ=["ogg","mp4","webm"],QJ=()=>{};function wS(n){var h,C,E,A,v,S;const t=(h=n.getComponentOptions("media"))!=null?h:{},{allowedMedias:e,maxSize:r,callbacks:i}=t,s=(C=e==null?void 0:e.audio)!=null?C:XJ,o=(E=e==null?void 0:e.video)!=null?E:YJ,l=(A=r==null?void 0:r.audio)!=null?A:RS,c=(v=r==null?void 0:r.video)!=null?v:RS,d=(S=i==null?void 0:i.onError)!=null?S:QJ;return{allowedMedias:{audio:s,video:o},maxSize:{audio:l,video:c},callbacks:{onError:d}}}function JJ(n,t){const e=s=>s.map(o=>`.${o}`).join(","),{allowedMedias:r}=wS(n),i=r[t];return i?e(i):"*"}function ZJ(n,t,e){const{maxSize:r,callbacks:i,allowedMedias:s}=wS(t),{[e]:o}=r,{[e]:l}=s;if(o&&n.size>o){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=yf(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 tZ(n){return n===sh.Empty||n===sh.Error}const Cn=D("media");class eZ 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 s=nt(r.target);if(!s||!s.contains(this.mediaContainer))return;const o=this.renderError();this.updateMediaContent(o),this.emit("mediaError",e,"load_error",dt(s))});m(this,"handleUploadFile",async e=>{p(Cn,this.abstract,"no abstract"),p(Cn,this.mediaContainer,"The media element not exist");const{editor:r}=this.options,i=nt(this.mediaContainer);p(Cn,i,"The block element not exist");const s=r.getBlockData(i);try{const{resourceId:o}=await r.doc.uploadResource(e,{onProgress:C=>{this.renderProgress(C,e)}}),{name:l,type:c,size:d}=e,h={...s,embedData:{...s.embedData,src:o,fileName:l,fileSize:d,fileType:c}};r.updateBlockData(i,h)}catch(o){Cn.error(o),this.emit("mediaError",r,"upload_error",s.id),this.renderRetry(e,o)}ut(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(Cn,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){p(Cn,this.abstract,"no abstract");const{editor:e,createMediaElement:r}=this.options,{mediaIcon:i,mediaName:s}=this.abstract;p(Cn,this.mediaContainer,"The media element not exist");const o=nt(this.mediaContainer);p(Cn,o,"The block element not exist");const l=e.getBlockData(o),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=_.t("media.load.failed",{name:s}),c.appendChild(h);const C=h.querySelector(".retry-upload");return p(Cn,C,"The element not exist"),e.domEvents.addEventListener(C,"click",(E,A)=>{const v=B("div",["media-element"],null),S=this.getResourceUrl(l),w=r(E,v,l,S);this.unbindMediaEvent(),this.media=w,this.bindMediaEvent(),this.updateMediaContent(v)}),this.setFullScreen(),c}renderRetry(e,r){var E,A;p(Cn,this.abstract,"no abstract");const{editor:i}=this.options,{mediaIcon:s,mediaName:o}=this.abstract,l=B("div",["media-error","embed-selected-content","embed-hover-content"],null),c=B("span",["media-error-icon"],l);c.innerHTML=s;const d=B("div",[],l);let h=_.t("media.upload.failed",{name:o});(((E=r.response)==null?void 0:E.status)===420||((A=r.response)==null?void 0:A.status)===413)&&(h=_.t("media.upload.maxSizeFailed",{name:o})),d.innerHTML=h,l.appendChild(d);const C=d.querySelector(".retry-upload");C&&i.domEvents.addEventListener(C,"click",()=>{i.readonly||(p(Cn,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(l),this.setFullScreen()}renderProgress(e,r){p(Cn,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope .media-progress"),s=e===-1||e===100?100:e;if(i){const{updateProgressElement:o}=this.options;o(i,s)}else{const{createProgressElement:o}=this.options,l=nt(this.mediaContainer);p(Cn,l,"The element not exist"),q(l,"media-block-uploading");const c=B("div",["media-progress"],null);o(c,s,r),this.updateMediaContent(c)}this.setFullScreen()}renderMediaElement(e,r){p(Cn,this.mediaContainer,"The media element not exist");const i=this.mediaContainer.querySelector(":scope > .media-element"),{createMediaElement:s,updateMediaElement:o,editor:l}=this.options,c=this.getResourceUrl(e,r);if(i){const d=o(l,i,e,c);this.unbindMediaEvent(),this.media=d,this.bindMediaEvent()}else{const d=B("div",["media-element"],null),h=s(l,d,e,c);this.unbindMediaEvent(),this.media=h,this.bindMediaEvent(),this.updateMediaContent(d)}}renderEmpty(e){p(Cn,this.abstract,"no abstract"),p(Cn,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:s}=this.options;return s.doc.buildResourceUrl(i,{syncNewResources:async(o,l)=>{var d,h;if(!r)return;await s.doc.addResources([o]);const c=(h=(d=s.doc).getServerMeta)==null?void 0:h.call(d).appId;if(l!==e.embedData.src&&c&&e.embedData.src.includes(c)){const C=nt(r);if(C&&!s.readonly&&s.isBlockWritable(C)){const E=At.default(e);E.embedData.src=o,s.updateBlockData(C,E)}}}})}setFullScreen(){p(Cn,this.mediaContainer,"The media element not exist"),q(this.mediaContainer,"full-screen")}removeFullScreen(){p(Cn,this.mediaContainer,"The media element not exist"),ut(this.mediaContainer,"full-screen")}updateBlockAlign(e,r){const i=nt(r);p(Cn,i,"The block element not exist");const{align:s}=e;e.embedType==="video"&&(i.hasAttribute("data-style-align")&&i.removeAttribute("data-style-align"),i.setAttribute("data-style-align",s))}render(e,r){const{src:i}=e.embedData;(!this.mediaContainer||!r.contains(this.mediaContainer))&&(this.mediaContainer=B("div",["media"],r)),this.updateBlockAlign(e,r),tZ(i)?i===sh.Empty&&this.renderEmpty(e):this.renderMediaElement(e,r)}setAbstract(e){this.abstract=e}}D("media-embed");const nZ="left";class SS{constructor(){m(this,"handleInsertEmptyEmbed",async(t,e)=>{var C;const{containerId:r,blockIndex:i}=e;let s;(C=e.data)!=null&&C.file&&(s=e.data.file);const o=JJ(t,this.embedType);if(s=s!=null?s:await _c(o,{}),!s)return null;const{mediaType:l}=this.getAbstract();try{ZJ(s,t,l)}catch{return null}const c={id:it(),type:"embed",embedType:this.embedType,embedData:{src:sh.Empty}};l==="video"&&(c.align=nZ);const d=t.insertBlock(r,i,c);return await this.getMedia(t,c.id).handleUploadFile(s),d})}getMedia(t,e){const r=t.addCustom(`media-${e}`,()=>new eZ({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:s}=this.getAbstract();return{name:r,insertEmbedCommandItems:[{id:`insert-${this.embedType}`,name:t,icon:e,order:i,group:s,subText:Jn(`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,s=this.getMedia(t,i),o=zt(e);return s.render(r,o),!0}handleDeleteBlock(t,e){const r=e.id,i=this.getMedia(t,r);i.removeAllListeners(),i.destroy()}convertTo(t,e,r,i){const s=e.embedData,o=t.doc.buildResourceUrl(s.src,{withToken:!0});return i==="html"?`<${s.type} src="${o}" />`:i==="markdown"?`![${s.src}](${o})`:o}}function LS(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 IS(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const rZ=D("media-audio");class iZ extends SS{constructor(){super(...arguments);m(this,"embedType",Ui.AUDIO);m(this,"updateProgressElement",IS);m(this,"createMediaElement",(e,r,i,s)=>{const o=B("div",["audio-container","embed-hover-content","embed-selected-content"],r),l=B("audio",[],o);return l.innerHTML="Your browser does not support the <code>audio</code> element.",l.controls=!0,l.src=s,setTimeout(()=>{this.getMedia(e,i.id).setFullScreen()}),l})}getAbstract(){return{mediaIcon:U2,mediaName:_.t(`media.${Ui.AUDIO}.menuItem`),menuItem:_.t(`media.${Ui.AUDIO}.menuItem`),order:800,mediaType:Ui.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${_.t(`media.${Ui.AUDIO}.abstract`)}`}}updateMediaElement(e,r,i,s){const o=r.querySelector(":scope .audio-container > audio");return p(rZ,o,"The media element not exist"),o.src!==s&&(o.src=s),o}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",LS(e,r)}}const sZ=new iZ;D("video-resizer");function DS(n){return n&&Le(n)&&sn(n)==="video"}const oZ=50;class vx{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&DS(e)&&this.disableBlockResize(e),t&&DS(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,s=Math.min(Math.max(e.width,oZ),i);this.currentResizableElement.style.width=`${s}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,je.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,je.get(this.editor).removeListener("change",this.handleHoveringBlockChange)}getVideoElement(t){return zt(t).querySelector(":scope .video-container > video")}updateResizer(t){const e=this.editor.findCustom(`${dt(t)}-resizer`);e&&e.updateResizer()}disableBlockResize(t){const e=this.editor.findCustom(`${dt(t)}-resizer`);e&&e.disableResize()}enableBlockResize(t,e){const r=this.editor.addCustom(`${dt(t)}-resizer`,()=>new Nd(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 lZ=D("video");class aZ extends SS{constructor(){super(...arguments);m(this,"embedType",Ui.VIDEO);m(this,"updateProgressElement",IS);m(this,"createMediaElement",(e,r,i,s)=>{const o=B("div",["video-container","embed-selected-content","drag-preview-element"],r),l=B("video",[],o);return l.innerHTML="Your browser does not support the <code>video</code> element.",l.controls=!0,l.src=s,l.addEventListener("canplay",()=>{e.addCustom("video-resizer",()=>new vx(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 s=B("video",["progress-video"],e);s.innerHTML="Your browser does not support the <code>audio</code> element.",s.controls=!0,LS(e,r),Dc(i).then(o=>{const l=e.querySelector(".progress-video");l&&n1(e)&&(l.src=o)})})}getAbstract(){return{mediaName:_.t(`media.${Ui.VIDEO}.menuItem`),mediaIcon:O2,menuItem:_.t(`media.${Ui.VIDEO}.menuItem`),order:700,mediaType:Ui.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`${_.t(`media.${Ui.VIDEO}.abstract`)}`}}handleMediaError(e,r,i){const s=e.addCustom("video-resizer",()=>new vx(e)),o=e.getBlockById(i);s.disableBlockResize(o)}updateMediaElement(e,r,i,s){const o=r.querySelector(":scope .video-container > video");p(lZ,o,"The media element not exist"),o.src!==s&&(o.src=s),i.width?o.style.width=`${i.width}px`:o.style.width="";const l=e.getBlockById(i.id);return setTimeout(()=>{e.addCustom("video-resizer",()=>new vx(e)).updateResizer(l)}),o}}const cZ=new aZ,_S=[oA,mA,gA,kk],Bx=[vS,uQ,EJ,RJ,UJ,kK,zJ,cZ,sZ,vz,Z4,rX],MS=[Pk,nS,T4];function uZ(n,t,e){var i,s,o,l;fi.level=(i=e.logLevel)!=null?i:qo.DEBUG;const r=Jf(n,t,{components:{blocks:[..._S,...((s=e==null?void 0:e.components)==null?void 0:s.blocks)||[]],embeds:[...Bx,...((o=e.components)==null?void 0:o.embeds)||[]],boxes:[...MS,...((l=e.components)==null?void 0:l.boxes)||[]],textRenders:[new HE],options:{...e.componentsOptions}}});return r.readonly=!0,r.addCustom("heading-collapse",()=>new lx(r)),r.addCustom("editor-tooltip",()=>new Sd(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 US{constructor(t){this.createOptions=t,t.lang&&_.setLang(t.lang)}createHistoryEditor(t,e){return uZ(t,e,this.createOptions)}}function OS(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"),s={image:{defaultAlign:"left"},table:{locatingContainer:t,hideCellMenu:!0,hideToolbar:!0},...i==null?void 0:i.componentsOptions},o=[];n.editorBlocks.forEach(E=>{E.blockType==="text"||E.blockType==="embed"||o.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=Jf(t,e,{shortcuts:[nm],components:{blocks:o,commandProviders:[new Um],decorators:[new lg],embeds:l,boxes:c,options:s}});if(d.input.addHandler(new cg),d.input.addHandler(new MA(d)),d.input.addHandler(new KA(d)),d.input.addHandler(new hq(d)),d.input.addHandler(new hg),d.addCustom("image-paste-handler",()=>new _A(d)),Ae.isMobile||d.addCustom("editor-tooltip",()=>new Sd(d)),n.options.enableContextMenu!==!1&&d.addCustom("editor-context-menu",E=>new HA(E)),(h=n.options.componentsOptions)!=null&&h.mention){const E=n.options.componentsOptions.mention;d.addCustom("mention",()=>new eS(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 fZ(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),r=new Set;e.forEach(i=>{const s=nt(i);s&&r.add(s)}),r.forEach(i=>{mq(n,i,t)})}class dZ{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(s=>s.groupId===r).length===0&&fZ(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 OS(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class hZ{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 KC(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 OS(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const mZ={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"}},gZ={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"}},pZ={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"}};_.mergeLang({"zh-CN":mZ,"en-US":gZ,"ja-JP":pZ});const CZ="UEsDBBQABgAIAAAAIQBk9WPugQEAACkGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAKcWAAB3b3JkL3NldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQBAwf/xOQEAACMDAAAUAAAAAAAAAAAAAAAAAMsaAAB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQA520VMuQUAACdaAAASAAAAAAAAAAAAAAAAADYcAAB3b3JkL251bWJlcmluZy54bWxQSwECLQAUAAYACAAAACEA+JXI7/wOAADzmQAADwAAAAAAAAAAAAAAAAAfIgAAd29yZC9zdHlsZXMueG1sUEsBAi0AFAAGAAgAAAAhAMySUFR9AQAA8QIAABEAAAAAAAAAAAAAAAAASDEAAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhACJREfHVAQAA3gMAABAAAAAAAAAAAAAAAAAA/DMAAGRvY1Byb3BzL2FwcC54bWxQSwECLQAUAAYACAAAACEAiD+lv+EAAABVAQAAGAAAAAAAAAAAAAAAAAAHNwAAY3VzdG9tWG1sL2l0ZW1Qcm9wczEueG1sUEsBAi0AFAAGAAgAAAAhAMEnywi2AAAAIQEAABMAAAAAAAAAAAAAAAAARjgAAGN1c3RvbVhtbC9pdGVtMS54bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAABVOQAAY3VzdG9tWG1sL19yZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAOuAYExTAwAAjw4AABIAAAAAAAAAAAAAAAAAWzsAAHdvcmQvZm9udFRhYmxlLnhtbFBLBQYAAAAADwAPANQDAADePgAAAAA=",EZ=()=>Fp(CZ),AZ=D("image-to-docx");async function xZ(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 NS(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};try{const e=await Dc(new File([t],"",{})),r=await xZ(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){AZ.error(e);return}}function bZ(n,t){let e=n.filter(o=>o!=null);const r=t-(e.length-1)*20,i=.87,s=e.reduce((o,l)=>o+l.width,0);return s>r&&(e=e.map(o=>({width:o.width*r/s,height:o.height*r/s,buffer:o.buffer}))),e.map(o=>({width:o.width*i,height:o.height*i,buffer:o.buffer}))}function vZ(n,t,e){if(!e||typeof e!="object")return;const r=e,i=n.filter(o=>o!=null),s=t-(i.length-1)*20;i.forEach((o,l)=>{if(i.length===1&&r.widthPercent){const d=r.widthPercent,h=o.width;o.width=s*(d/100),o.height*=o.width/h;return}const c=`${l}_flex`;if(r[c]){const d=r[c],h=o.width;o.width=s*d,o.height*=o.width/h}})}function PS(n=[0,1,2,3,4,5,6,7],t=1){return n.map(e=>{let r;switch(e%3){case 0:r=Bt.LevelFormat.DECIMAL;break;case 1:r=Bt.LevelFormat.LOWER_LETTER;break;default:r=Bt.LevelFormat.LOWER_ROMAN;break}return{level:e,format:r,text:`%${e+1}. `,alignment:Bt.AlignmentType.START,start:t,style:{paragraph:{indent:{left:Bt.convertInchesToTwip(.3*(e+1)),hanging:Bt.convertInchesToTwip(.2)}}}}})}function BZ(){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:Bt.LevelFormat.BULLET,text:t,alignment:Bt.AlignmentType.START,style:{paragraph:{indent:{left:Bt.convertInchesToTwip(.3*(n+1)),hanging:Bt.convertInchesToTwip(.2)}}}}})}function yZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Bt.LevelFormat.BULLET,text:"\u2611",alignment:Bt.AlignmentType.START,style:{paragraph:{indent:{left:Bt.convertInchesToTwip(.3*(n+1)),hanging:Bt.convertInchesToTwip(.2)}}}}))}function TZ(){return[0,1,2,3,4,5,6,7].map(n=>({level:n,format:Bt.LevelFormat.BULLET,text:"\u2610",alignment:Bt.AlignmentType.START,style:{paragraph:{indent:{left:Bt.convertInchesToTwip(.3*(n+1)),hanging:Bt.convertInchesToTwip(.2)}}}}))}var oh=(n=>(n.NUMBERING="number-numbering-reference",n.BULLET="number-bullet-reference",n.CHECKED="checked-bullet-reference",n.UNCHECKED="unchecked-bullet-reference",n))(oh||{});const kZ=[{levels:PS(),reference:"number-numbering-reference"},{levels:BZ(),reference:"number-bullet-reference"},{levels:yZ(),reference:"checked-bullet-reference"},{levels:TZ(),reference:"unchecked-bullet-reference"}];function RZ(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 wZ(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 SZ(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 LZ=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function FS(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(LZ);if(t){const e=o=>{let l=Number(o).toString(16);return l.length<2&&(l=`0${l}`),l},r=e(t[1]),i=e(t[2]),s=e(t[3]);return`${r}${i}${s}`}if(n==="red")return"FF0000";if(n==="green")return"00FF00";if(n==="blue")return"0000FF"}}function Mn(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 KS(n,t,e){for(let r=0;r<=e;++r){const i=`${t}${r}`;if(Mn(n,i))return i}}function Og(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function yx(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function VS(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function IZ(n){const t=Mn(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 s=i[0].trim().toLowerCase(),o=i[1].trim().toLowerCase();s==="font-size"&&Og(n,"inline-style-font-size",o),s==="color"&&Og(n,"inline-style-color",o),s==="background-color"&&Og(n,"inline-style-background-color",o),s==="font-family"&&Og(n,"inline-style-font-family",o)}}function DZ(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function _Z(n){const t=`${Mn(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function MZ(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 UZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function OZ(n){return Mn(n,"inline-style-font-family")}function NZ(n){const t=Mn(n,"inline-style-background-color");return FS(t)}function PZ(n){const t=Mn(n,"inline-style-color");return FS(t)}function FZ(n){IZ(n);const t=Mn(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!Mn(n,"style-code"),link:VS(Mn(n,"link")),size:_Z(n),text:t?UZ(n):MZ(n)||n.insert,bold:!!Mn(n,"style-bold"),underline:!!Mn(n,"style-underline"),italics:!!Mn(n,"style-italic"),strike:!!Mn(n,"style-strikethrough"),superScript:!!Mn(n,"style-super"),subScript:!!Mn(n,"style-sub"),math:Mn(n,"type")==="math"?Mn(n,"src"):void 0,mention:t,fontFamily:OZ(n),background:NZ(n),color:t?"338fe5":RZ(KS(n,"style-color-",6))||PZ(n),highlight:KS(n,"style-bg-color-",13)}}function KZ(){return[new Bt.Paragraph({border:{top:{color:"auto",style:Bt.BorderStyle.DASHED,size:4,space:1}},spacing:{before:300}}),new Bt.Paragraph({spacing:{line:0}})]}function VZ(){return new Bt.Paragraph({children:[new Bt.TextRun({text:"[\u89C6\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function $Z(){return new Bt.Paragraph({children:[new Bt.TextRun({text:"[\u97F3\u9891\u6682\u4E0D\u652F\u6301\u5BFC\u51FA]",shading:{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}})]})}function HZ(n,t){return new Bt.Paragraph({children:[new Bt.ExternalHyperlink({children:[new Bt.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function $S(n){if(n.heading!=null)return`Heading${n.heading}`}function HS(n){if(n.alignment!=null){if(n.alignment==="center")return Bt.AlignmentType.CENTER;if(n.alignment==="right")return Bt.AlignmentType.RIGHT;if(n.alignment==="left")return Bt.AlignmentType.LEFT}}function jZ(n){if(n.indent)return{left:Bt.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Bt.convertInchesToTwip(.3*n.padding)}}function zZ(n){return{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function GZ(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function jS(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 Bt.TextRun({text:n.text,bold:n.bold||void 0,underline:n.underline?{type:Bt.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?GZ(n.fontFamily):void 0,shading:n.background?zZ(n.background):void 0,color:n.color,highlight:wZ(n.highlight)})}function WZ(n,t){if(n.link)return new Bt.ExternalHyperlink({children:[jS(n,t)],link:n.link})}async function zS(n,t,e,r,i){const[s]=await i(n,t,e);if(s==null)return;const o=await NS({width:r||0,height:0,src:e},s);return new Bt.ImageRun({data:s,transformation:{width:(o==null?void 0:o.width)||100,height:(o==null?void 0:o.height)||20}})}function qZ(n){if(n.heading||n.heading)return n.heading}function XZ(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function YZ(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function QZ(n,t){var r;const e=[];if(n.text&&Array.isArray(n.text)){for(let i=0;i<n.text.length;i++){const s=n.text[i];if(((r=s.attributes)==null?void 0:r.box)===!0&&t){const o=await t(s);if(o){n.text.splice(i+1,0,...o);continue}}e.push(FZ(s))}return e}}function JZ(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 ZZ(n,t){if(n.type==="embed"&&n.embedType&&yx(n.embedType)&&n.embedData&&n.embedData.src)return n.embedData.src.split("|").map(r=>{const i=t(r),s=n.embedData[`${i}_width`],o=n.embedData[`${i}_height`];return{src:r,width:s,height:o}})}function ttt(n){if(n.padding)return n.padding}function ett(n){return!!(n.type==="embed"&&n.embedType&&yx(n.embedType)&&n.embedData&&n.embedData.src)}async function Ng(n,t,e){return{quoted:!!n.quoted,heading:qZ(n),alignment:XZ(n),indent:YZ(n),padding:ttt(n),texts:await QZ(n,e),list:JZ(n),images:ZZ(n,t),border:ett(n)}}async function ntt(n,t,e,r){const i=[];if(!n.children)return[];for(const s of n.children){const o=[];for(const l of t.blocks[s])o.push(await Ng(l,e,r));i.push(o)}return i}const rtt=D("to-docx");function itt(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 stt(n,t,e,r){const i=!!n.hasColTitle,s=!!n.hasRowTitle,o=!!n.isStripeStyle,l="F5F8FB";for(let c=0;c<t;c++)for(let d=0;d<e;d++)(i&&d===0||s&&c===0||o&&c%2===1)&&(r[c][d].color=l)}function ott(n){p(rtt,n.children,"no table children");const t=n.rows,e=n.cols,r=n.colsWidth;if(r)for(let o=0;o<r.length;o++)r[o]===0&&(r[o]=100);const i=itt(t,e);let s=0;for(let o=0;o<t;++o)for(let l=0;l<e;++l){if(i[o][l].originalWidth=r?r[l]:void 0,i[o][l].from!==void 0)continue;const c=n.children[s];s+=1,i[o][l].cellId=c,i[o][l].color=SZ(n[`${c}_background`]),i[o][l].width=r?r[l]:100,i[o][l].align=n[`${c}_align`];const d=n[`${c}_rowSpan`]||1,h=n[`${c}_colSpan`]||1;if(i[o][l].rowSpan=d,i[o][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[o+E][l+A].from=[o,l]);i[o][l].width=C}}return stt(n,t,e,i),i}async function ltt(n,t,e,r,i,s,o,l,c,d){async function h(E){if(l&&E.type!=="_exportVirtualBlock"){const A=await l(i,s,E);if(A){await r.addDoc(n,A,d);return}}if(E.type==="text"||E.textOnly===!0){const A=await Ng(E,o,c);await r.addTextBlock(A);return}if(E.type==="code"){const A=await ntt(E,e,o,c);await r.addCodeBlockObject(A);return}if(E.type==="list"&&E.textOnly!==!0){const A=await Ng(E,o,c);await r.addListBlockObject(n,A);return}if(E.type==="embed"&&E.embedType){const A=E,v=A.embedData,S=A.embedType;if(yx(S)){const w=await Ng(E,o,c);await r.addImagesBlockObject(E,w,d)}else E.embedType==="hr"?r.addSeparatorBlock():E.embedType==="video"?r.addVideoPlaceholder():E.embedType==="audio"?r.addAudioPlaceholder():E.embedType==="webpage"?r.addHyperlinkParagraph(VS(v.src),v.title):r.addOtherEmbedBlock(S,E.embedData);return}if(E.type==="table"){let A=[];if(E.colsWidth)A=E.colsWidth;else{const S=E.cols;A=new Array(S);for(let w=0;w<A.length;w++)A[w]=100;E.colsWidth=A}const v=ott(E);await r.addTableMatrix(A,v,e),r.addEmptyParagraph()}E.type==="_exportVirtualBlock"&&await r.addVirtualBlock(E.id,e,d)}function C(E){var S;const A=((S=E==null?void 0:E.embedData)==null?void 0:S.exportSpec)||(E==null?void 0:E.exportSpec);if(!A)return[E];const v=[];for(const{type:w,data:O}of A){if(w==="text"){const M={id:it(),text:[{insert:O}],type:"text"};v.push(M);continue}if(w==="image"){const M={id:it(),type:"embed",embedType:"image",align:"left",embedData:{src:O}};v.push(M);continue}if(w==="link"){const M={id:it(),type:"embed",embedType:"webpage",embedData:{src:O.url,title:O.title}};v.push(M);continue}if(w==="block")for(const M of O){if(!e.blocks[M])continue;const tt={id:M,type:"_exportVirtualBlock"};v.push(tt)}}return v}for(const E of t)for(const A of C(E))!A||await h(A)}function att(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const ctt=D("to-docx");class utt{constructor(t,e,r,i,s,o){m(this,"paragraphs");this.appId=t,this.docId=e,this.state=r,this.readImageFunc=i,this.convertBlocksFunc=s,this.defaultFontSize=o,this.paragraphs=[]}async addTextBlock(t){this.paragraphs.push(new Bt.Paragraph({heading:$S(t),alignment:HS(t),children:await this.paragraphsFromBlockTexts(t),indent:jZ(t)}))}async addEmptyImagePlaceHolder(){this.paragraphs.push(new Bt.Paragraph({text:`[${_.t("docx.imageExportFailed")}]`,shading:{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:"CCCCCC"}}))}async paragraphsFromBlockTexts(t){if(t.texts==null)return;const e=DZ(this.defaultFontSize,t.heading),r=[];for(const i of t.texts){if(i.link){const s=WZ(i,e);s&&r.push(s);continue}if(i.box&&i.box.type&&i.box.type==="br"){r.push(new Bt.TextRun({text:"",break:1}));continue}if(i.box&&i.box.type&&i.box.type==="image"){const s=await zS(this.appId,this.docId,i.box.src,i.box.width,this.readImageFunc);s&&r.push(s);continue}if(i.math){const s=await zS(this.appId,this.docId,i.math,0,this.readImageFunc);s&&r.push(s);continue}r.push(jS(i,e))}return r}async addCodeBlockObject(t){for(const e of t)for(const r of e){const i={style:Bt.BorderStyle.SINGLE,color:"#DEDEDE"};this.paragraphs.push(new Bt.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 o=`number-numbering-reference-${r}`,l=PS([e.list.level-1],e.list.start);this.state.levelConfigs.push({levels:l,reference:o,inst:r}),this.state.listRefMap[i]=o}else e.list.ordered?this.state.listRefMap[i]=oh.NUMBERING:e.list.checkbox&&e.list.checkbox==="checked"?this.state.listRefMap[i]=oh.CHECKED:e.list.checkbox&&e.list.checkbox==="unchecked"?this.state.listRefMap[i]=oh.UNCHECKED:this.state.listRefMap[i]=oh.BULLET;const s=$S(e);e.texts&&this.paragraphs.push(new Bt.Paragraph({heading:s,children:await this.paragraphsFromBlockTexts(e),numbering:{reference:this.state.listRefMap[i],level:e.list.level-1,instance:r}}))}imageDimWithBufferToImageRun(t){return new Bt.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=[],s=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 NS(c,d);if(C)return C}i.push(h)}));vZ(s,r,t.embedData);const o=bZ(s,r),l={style:Bt.BorderStyle.SINGLE,color:"#DEDEDE"};o.length&&this.paragraphs.push(new Bt.Paragraph({border:e.border?{left:{...l},right:{...l},top:{...l},bottom:{...l}}:void 0,alignment:HS(e)||Bt.AlignmentType.CENTER,children:o.map(c=>this.imageDimWithBufferToImageRun(c)).flatMap((c,d,h)=>c==null?[]:h.length-1!==d?[c,new Bt.TextRun({text:" "})]:c)})),i.forEach(c=>{this.addHyperlinkParagraph(c)})}addSeparatorBlock(){KZ().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Bt.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push(VZ())}addAudioPlaceholder(){this.paragraphs.push($Z())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(HZ(t,e))}async addTableMatrix(t,e,r){const i=t.map(s=>s!==0?s*15:1500);this.paragraphs.push(new Bt.Table({rows:await this.generateTableRows(e,r),columnWidths:i}))}async generateRowCells(t,e){const r=[];for(const i of t){const s=i.cellId;if(s===void 0)continue;const o=i.width*.9;r.push(new Bt.TableCell({children:await this.convertBlocksFunc(s,e.blocks[s],e,this.appId,this.docId,this.state,o),columnSpan:i.colSpan,rowSpan:i.rowSpan,width:{type:Bt.WidthType.DXA,size:i.width*15},shading:i.color?{fill:i.color,type:Bt.ShadingType.CLEAR,color:"auto"}:void 0}))}return r}async generateTableRows(t,e){const r=[];for(const i of t)r.push(new Bt.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 addVirtualBlock(t,e,r){const i=await this.convertBlocksFunc(t,e.blocks[t],e,this.appId,this.docId,this.state,r);this.paragraphs.push(...i)}async addOtherEmbedBlock(){}}class ftt{constructor(t,e,r,i,s,o,l,c){m(this,"convertBlocks",async(t,e,r,i,s,o,l=720)=>{const c=new utt(i,s,o,this.readImage,this.convertBlocks,this.defaultFontSize);return await ltt(t,e,r,c,i,s,this.md5HexFunc,this.getDocByBlock,this.getTextsByBox,l||720),c.paragraphs});this.templateData=t,this.docData=e,this.md5HexFunc=r,this.readImage=i,this.defaultFontSize=s,this.getDocByBlock=o,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 Bt.ImportDotx,s=this.templateData?await i.extract(this.templateData):void 0,o=t.blocks.root;p(ctt,o,"data must have blocks");const l=att(),c=await this.convertBlocks("blocks",o,t,e,r,l),d=this.backgroundImageOptions?{default:new Bt.Header({children:[new Bt.Paragraph({children:[new Bt.ImageRun(this.backgroundImageOptions)]})]})}:{},h=new Bt.Document({numbering:{config:[...kZ,...l.levelConfigs]},sections:[{headers:d,children:c,properties:{page:{size:{width:12240,height:15840},margin:{top:1440,bottom:1440,left:1440,right:1440}}}}]},{template:s});return Bt.Packer.toBlob(h)}}async function dtt(n,t,e,r){const i=n.doc.buildResourceUrl(r,{withToken:!0});let s=await cS(i);if(!s)return[void 0,i];if(s.type.indexOf("/svg")!==-1){const l=await oS(s);l&&(s=new File([l],s.name))}return[await s.arrayBuffer(),i]}async function htt(n,t,e){const r=n.editorBlocks.getBlockClass(e.type);if(r.toStandardDoc)return r.toStandardDoc(n,e,t)}async function mtt(n,t){const e=t.attributes,r=n.editorBoxes.getBoxClass(e.type);if(r.toStandardText)return r.toStandardText(n,e)}async function gtt(n,t){let{template:e,download:r,backgroundImageOptions:i}=t!=null?t:{};e||(e=EZ());const s=n.doc.toJSON(),o=(C,E,A)=>dtt(n,C,E,A),l=async(C,E,A)=>htt(n,s,A),c=async C=>mtt(n,C),h=await new ftt(e,s,t0.default,o,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 Tx=D("create-editor");async function ptt(n,t){var o,l,c,d,h,C,E,A,v,S,w,O,M,V,tt,Y;p(Tx,n,"app does not exists"),t.lang&&_.setLang(t.lang),fi.level=(o=t.logLevel)!=null?o:qo.DEBUG;const e=t.onReauth?async()=>{var bt;const X=t.user.userId,ct=t.docId,xt=await((bt=t.onReauth)==null?void 0:bt.call(t,X,ct,t.permission));return{userId:X,docId:ct,permission:t.permission,appId:t.appId,token:xt,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,onMaxUsersError:t.onMaxUsersError},i=await dd.load(r),s=Jf(n,i,{id:t.id,scrollContainer:t==null?void 0:t.scrollContainer,enableComments:t==null?void 0:t.enableComments,enableContextMenu:t==null?void 0:t.enableContextMenu,components:{blocks:[..._S,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...Bx,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[...MS,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new Um,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new lg,new $C],insertions:[V1],blockHooks:[new wA,new tw,...((C=t.components)==null?void 0:C.blockHooks)||[]],textRenders:[new C4,new HE,...((E=t.components)==null?void 0:E.textRenders)||[]],options:{...t.componentsOptions}},shortcuts:[Tq,tH,dz,lA,Hw,fF,eA,cX,nm,iF,...t.shortcuts||[]],colors:["#0064FF","#EB3723","#F59300","#00A865","#F25A0A","#70A310","#009CAD","#0990D9","#8851ED","#D62069"]});if(s.editorCommandProviders.registerCommandProvider(new ms(s)),s.input.addHandler(new JX),s.input.addHandler(new cg),s.input.addHandler(new IK),s.input.addHandler(new iz),s.input.addHandler(new pA(s,{hideTitle:t.hideTitle,headingLevel:1,titlePlaceholder:_.t("placeholder.common.title"),contentPlaceholder:_.t("placeholder.common.content"),readonlyTitlePlaceholder:_.t("placeholder.common.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0,applyContentPlaceholder:(A=t.placeholder)==null?void 0:A.applyContentPlaceholder})),s.input.addHandler(new eg(s,(v=t.componentsOptions)==null?void 0:v.quickMenu)),s.input.addHandler(new MA(s)),s.input.addHandler(new KA(s)),s.input.addHandler(new hg),s.input.addHandler(new Tk),s.doc.registerCallback(new ZX(s)),s.addCustom("remote-cursor",()=>new i2(s)),s.addCustom("block-menu",X=>new rw(X)),Ae.isMobile||s.addCustom("editor-tooltip",()=>new Sd(s)),t!=null&&t.enableComments&&s.addCustom("editor-comments",X=>new p4(X,new dZ(X))),t.enableContextMenu!==!1&&s.addCustom("editor-context-menu",X=>new HA(X)),s.addCustom("create-options",()=>new wb(s,t)),s.addCustom("drop-target",()=>new Wd(s)),s.addCustom("list-to-mindmap",()=>new Xm(s)),s.addCustom("list-to-mention",()=>new xY(s)),s.addCustom("mobile-helper",()=>new $Y(s)),s.addCustom("code-caret",()=>new Y$(s)),s.addCustom("image-paste-handler",()=>new _A(s)),(S=t.componentsOptions)!=null&&S.mention){const X=t.componentsOptions.mention;s.addCustom("mention",()=>new eS(s,X))}if(s.addCustom("heading-collapse",()=>new lx(s)),s.addCustom(Mg,X=>new mx(X)),Au.register(s),Wd.register(s),wl.register(s),vl.register(s),s.addListener("clickLink",(X,ct,xt)=>{var Rt;if((Rt=t==null?void 0:t.events)!=null&&Rt.onClickLink){t.events.onClickLink(X,ct,xt);return}const bt=xt.getAttribute("link");bt&&(X.readonly||ct.ctrlKey||ct.metaKey)&&window.open(bt,"_blank")}),(O=(w=t.componentsOptions)==null?void 0:w.remoteCarets)!=null&&O.onUserChanged){const X=(V=(M=t.componentsOptions)==null?void 0:M.remoteCarets)==null?void 0:V.onUserChanged;s.doc.getRemoteUsers().on("change",ct=>{X(s,ct)})}return(Y=(tt=t.componentsOptions)==null?void 0:tt.templates)!=null&&Y.templates.length&&(s.addListener("docChanged",()=>{_g(s)}),s.addListener("resize",()=>{_g(s,{reset:!0})}),setTimeout(()=>{_g(s)},100)),s.doc.registerCallback({onError:async X=>{if(X.code==="ResetDoc"){Tx.error(`reset doc: ${X.message}`);const ct=await dd.load(r);s.doc.reset(ct)}}}),s.version="1.1.20",fi.level===qo.DEBUG&&(window.setReauthFail=X=>{window.isReauthError=X},window.reConnect=X=>s.doc.externalDoc.client.connection.reConnect(X)),s}function Ctt(n){return n.toJSON!==void 0}async function Ett(n,t,e){var s,o,l,c,d,h,C,E;p(Tx,n,"app does not exists");const r=Ctt(t)?t:new xC(t,{serverUrl:e.serverUrl||""});e.lang&&_.setLang(e.lang),fi.level=(s=e.logLevel)!=null?s:qo.DEBUG;const i=Jf(n,r,{id:e.id,scrollContainer:e==null?void 0:e.scrollContainer,components:{blocks:[oA,mA,gA,kk,...(l=(o=e.components)==null?void 0:o.blocks)!=null?l:[]],commandProviders:[new Um],decorators:[new lg,new $C],embeds:[...Bx,...((c=e.components)==null?void 0:c.embeds)||[]],boxes:[Pk,nS,T4,...((d=e.components)==null?void 0:d.boxes)||[]],insertions:[V1],blockHooks:[new wA,...((h=e.components)==null?void 0:h.blockHooks)||[]],textRenders:[new C4,new HE,...((C=e.components)==null?void 0:C.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[lA,Hw,eA,nm]});return i.editorCommandProviders.registerCommandProvider(new ms(i)),i.input.addHandler(new cg),i.input.addHandler(new pA(i,{hideTitle:e.hideTitle,headingLevel:1,titlePlaceholder:_.t("placeholder.common.title"),contentPlaceholder:_.t("placeholder.common.content"),readonlyTitlePlaceholder:_.t("placeholder.local.readonlyTitle"),addPlaceholderToAllCurrentEmptyBlock:!0})),i.input.addHandler(new eg(i,(E=e.componentsOptions)==null?void 0:E.quickMenu)),i.input.addHandler(new MA(i)),i.input.addHandler(new KA(i)),i.input.addHandler(new hg),i.input.addHandler(new Tk),i.addCustom("block-menu",A=>new rw(A)),Ae.isMobile||i.addCustom("editor-tooltip",()=>new Sd(i)),i.addCustom("image-paste-handler",()=>new _A(i)),e!=null&&e.enableComments&&i.addCustom("editor-comments",A=>new p4(A,new hZ(A,r))),e.enableContextMenu!==!1&&i.addCustom("editor-context-menu",A=>new HA(A)),i.addCustom("heading-collapse",()=>new lx(i)),i.addListener("clickLink",(A,v,S)=>{var O;if((O=e==null?void 0:e.events)!=null&&O.onClickLink){e.events.onClickLink(A,v,S);return}const w=S.getAttribute("link");w&&(A.readonly||v.ctrlKey||v.metaKey)&&window.open(w,"_blank")}),i.addCustom(Mg,A=>new mx(A)),Au.register(i),i.version="1.1.20",i}async function Att(n,t,e){var h;const r=n.doc.externalDoc.client.auth,i=await mm.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 o=n.getCustom("create-options");if(!o)throw new Error("the editor does not support to show versions");const l=o.getData(),c=new US(l),d=n.addCustom("version-dialog",()=>new V4(i,c));return d.show(t),d}b.tippy=e9,b.AnchorBox=BB,b.AuthError=ud,b.AuthHeader=Ea,b.AutoScroll=C0,b.BaseURLHeader=tu,b.BasicCommands=ZF,b.BlockExclusiveHook=tw,b.BlockLockerHook=wA,b.BlockLockerPasteHandler=hg,b.BlockResizer=Nd,b.BrBox=AB,b.CodeBlock=mA,b.CodeLineBlock=gA,b.CodeTextDecorator=lg,b.DOC_RE_AUTH_KEYS=Mg,b.DefaultShortcuts=nm,b.DocIdError=GU,b.DocReAuthCallbacks=mx,b.DragDrop=Gb,b.DrawioEmbed=vS,b.EditorBlocks=n3,b.EditorBoxes=bB,b.EditorCommandProviders=Ey,b.EditorComplexBlockPosition=Ei,b.EditorComplexSelectionRange=Qi,b.EditorDecorators=RB,b.EditorEmbeds=i3,b.EditorInsertions=kB,b.EditorSimpleBlockPosition=hn,b.EditorSimpleSelectionRange=xn,b.EmbedBlock=o3,b.EmbedBlockResizer=eh,b.EnforceWithDocumentTitleHandler=pA,b.EventCallbacks=Sc,b.FILL_CHAR=p8,b.FileExtError=WU,b.GroupOrder=Lk,b.HeadingBlockScrollListener=hY,b.ImageBox=vB,b.InlineBoxCommandProvider=jk,b.InputtingInsertion=yB,b.LocalDoc=xC,b.LogLevel=qo,b.Logger=fi,b.MIN_DISTANCE_THRESHOLD=jb,b.ManualCloseDialog=md,b.ManualMenu=dl,b.ManualToolbar=hd,b.MarkdownInputHandler=cg,b.MaxUserError=_C,b.Mindmap=qm,b.OnesEditorAutoSuggest=cE,b.OnesEditorCustomDataWrapper=wb,b.OnesEditorExclusiveBlock=vl,b.OnesEditorHoveringBlock=je,b.OnesEditorIcons=DO,b.OnesEditorQuickMenu=eg,b.OnesEditorToc=ih,b.OnesEditorTocProvider=wl,b.OnesEditorToolbar=Au,b.OnesEditorTooltip=Sd,b.OnesEditorVersionsDialog=V4,b.PermissionError=hm,b.Popup=iu,b.ReAuthToolbar=uS,b.RemoteCarets=i2,b.RemoteCaretsDecorator=$C,b.RemoteCaretsInsertion=V1,b.RemoteUsers=Zf,b.RequestReloadError=fd,b.RichText=Hn,b.ShareDBDoc=dd,b.ShareDBDocVersionsProvider=US,b.ShareDBServer=mm,b.SimpleCache=Ob,b.StandardEmbedBlockCommands=ZA,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=x1,b.TEXT_STYLE_COLOR_PREFIX=A1,b.TableBlock=oA,b.TableBlockCommandProvider=Um,b.TableShortcuts=lA,b.TextBlock=lr,b.TextBox=EB,b.TextColorItem=vT,b.TextStyleShortcuts=eA,b.TocEmbed=Z4,b.ZERO_WIDTH_SPACE_CHAR=Af,b.abbreviation=E0,b.addAttribute=R0,b.addClass=q,b.addCommentToBlock=th,b.addDays=uI,b.addMetaToDoc=Yf,b.addMonths=cI,b.animateScrollTo=ea,b.applyPlaceholderToBlock=Ud,b.assert=p,b.autoShowHideTemplates=_g,b.bindKeyDownEvent=c0,b.blockToDoc=mC,b.blockToHtml=j1,b.blockToMarkdown=H0,b.blockToText=$0,b.blocksToDoc=V5,b.clearAllSelection=Ov,b.clientType=Ae,b.cloneBlock=sl,b.cloneChildContainer=tC,b.cloneDoc=eC,b.cloneText=cB,b.commentToShareDbComment=VC,b.compareElement=l0,b.comparePosition=f1,b.complexBlockAdjustSelectionPos=y0,b.complexBlockFindNearestChildBlock=a7,b.complexBlockGetAllChildContainers=In,b.complexBlockGetBottomChildContainers=u3,b.complexBlockGetDeepFirstChild=l3,b.complexBlockGetFirstSimpleChild=h1,b.complexBlockGetLastSimpleChild=Nc,b.complexBlockGetSelectedContainers=Oc,b.complexBlockGetTopChildContainers=c3,b.containerToDoc=$5,b.continuousScroll=av,b.convertBlockFrom=v0,b.convertImageFileToPng=oS,b.convertImageSrcToPng=OY,b.converterIntercept=ag,b.copyBlockAttributes=FB,b.copyResourcesFromDoc=AC,b.createBlockAnchor=Hs,b.createBlockCaretAnchor=d3,b.createBlockContentElement=aa,b.createBlockElement=Rv,b.createBlockSimpleDocRange=N0,b.createBlockSimpleRange=Pe,b.createBoxContentElement=Lv,b.createBoxElement=wv,b.createBoxOp=aB,b.createChildContainer=t3,b.createComplexBlockPosition=_e,b.createComplexDocPos=mB,b.createComplexDocRange=A8,b.createContainer=fB,b.createContainerElement=Xp,b.createDeleteOps=iB,b.createEditor=Jf,b.createEditorSelectionRange=mn,b.createElement=B,b.createEmptyContainer=Xs,b.createEmptyDoc=qs,b.createEmptyTextBlockData=U0,b.createExpandedRange=s0,b.createIconButton=Jl,b.createImage=Sp,b.createInsertOps=_0,b.createInsertionContentElement=_v,b.createInsertionElement=Iv,b.createLocalEditor=Ett,b.createOnesEditor=ptt,b.createRange=Nb,b.createRichText=ma,b.createRootContainer=Zv,b.createSimpleBlockPosition=ht,b.createSimpleDocPos=hB,b.createTextBlockData=es,b.createTextButton=Ra,b.createTextOp=zr,b.createTextWithReplaceSoftReturn=D1,b.daysAfter=jp,b.deleteText=M1,b.diffDays=fI,b.disablePageScroll=Vp,b.docToHtml=MB,b.docToHtmlFragment=Hf,b.docToMarkdown=UB,b.docToText=il,b.downloadImageToFile=cS,b.downloadObjectToFile=Cx,b.downloadSvgToString=hS,b.editLink=Td,b.editorAddComment=pq,b.editorAddTextAttribute=YB,b.editorAutoInsertBlock=KB,b.editorBreakTextBlock=Wc,b.editorClearCompositionText=q1,b.editorClearSelectedContents=q0,b.editorCopyBlock=CC,b.editorCopyDoc=em,b.editorDeleteBlock=Q1,b.editorDeleteBlockText=X1,b.editorDeleteBlockWithoutChildren=G0,b.editorDeleteChildContainer=C_,b.editorDeleteChildContainers=VB,b.editorFocusToBlock=Z1,b.editorFocusToEnd=O_,b.editorGetBlockData=rl,b.editorGetBlockText=Qn,b.editorGetBlockTextEx=F0,b.editorGetBoxData=pB,b.editorHandleKeyboardEvent=ty,b.editorInsertBlock=Gc,b.editorInsertBoxToBlock=NB,b.editorInsertDoc=qB,b.editorInsertDocAt=nC,b.editorInsertText=W1,b.editorInsertTextToBlock=OB,b.editorInsertTextToBlockEx=G1,b.editorMergeTextBlock=$B,b.editorMoveDown=c5,b.editorMoveEnd=cC,b.editorMoveHome=A5,b.editorMoveLeft=o5,b.editorMoveLineEnd=R5,b.editorMoveLineHome=k5,b.editorMovePageDown=_5,b.editorMovePageUp=D5,b.editorMoveRight=l5,b.editorMoveUp=a5,b.editorMoveWordEnd=p5,b.editorMoveWordLeft=g5,b.editorRangeClearColor=JB,b.editorRangeGetColor=ZB,b.editorRangeSetColor=QB,b.editorRemoveTextAttribute=b_,b.editorReplaceBlockText=X0,b.editorReplaceContainer=XB,b.editorRunOnce=bC,b.editorSelectAll=fC,b.editorSelectContainer=J0,b.editorSelectDown=u5,b.editorSelectEnd=uC,b.editorSelectHome=x5,b.editorSelectLeft=f5,b.editorSelectLineEnd=T5,b.editorSelectLineHome=y5,b.editorSelectPageDown=O5,b.editorSelectPageUp=U5,b.editorSelectRight=d5,b.editorSelectUp=h5,b.editorSelectWordEnd=E5,b.editorSelectWordLeft=C5,b.editorSetTextColor=qc,b.editorShowFindDialog=aW,b.editorToDocx=gtt,b.editorUpdateBlockData=Y0,b.editorUpdateCompositionText=PB,b.editorUpdateEmbedData=GB,b.enablePageScroll=$p,b.escapeHtmlText=u0,b.escapeRegExp=qp,b.escapeSpace=G9,b.exclusiveBlock=TA,b.executeBlockCommand=zv,b.executeEmbedBlockCommand=jv,b.executeRangeCommand=Cy,b.fileToDataUrl=Dc,b.findAfterOffsetNotType=P1,b.findAllText=dC,b.findBlockByIndex=Av,b.findEventTargetBlock=Kb,b.findInsertionById=Dv,b.findNextOffset=F8,b.findNextVisibleSimpleBlock=vy,b.findPrevOffset=P8,b.findPrevOffsetNotType=N1,b.findPrevSimpleBlockBeforeChildContainer=a3,b.findPrevVisibleSimpleBlock=by,b.findTarget=Ic,b.findWordEnd=K1,b.findWordLeft=F1,b.format=Tf,b.formatBytes=cv,b.formatDate=Gp,b.fragmentToHtml=rv,b.fromBase64=bf,b.fromBase64ToBlob=Fp,b.fromBase64ToUint8Array=rI,b.fromDocRange=tl,b.fromNowString=Wp,b.genId=it,b.getAllChildBlocks=C1,b.getAllQuickMenuItems=tA,b.getAllSelectedBlocks=Ji,b.getAttributesAt=Vc,b.getBlockBackground=Jp,b.getBlockByIndex=Yo,b.getBlockCaretRect=Jo,b.getBlockClass=le,b.getBlockClassByType=sa,b.getBlockClientRects=Ks,b.getBlockCommandsWithHook=s1,b.getBlockContent=zt,b.getBlockHeading=Lf,b.getBlockId=dt,b.getBlockIndex=wt,b.getBlockInfo=$d,b.getBlockKind=gi,b.getBlockMinWidth=Pv,b.getBlockNearestRangeFromPoint=g1,b.getBlockOptions=yI,b.getBlockPath=Zo,b.getBlockProperties=Vv,b.getBlockRangeFromPoint=T0,b.getBlockStyles=BI,b.getBlockTextLength=Ct,b.getBlockTools=xe,b.getBlockType=Ot,b.getBoxContent=t1,b.getBoxId=Sv,b.getBoxTypeFromElement=Sf,b.getChildBlockCount=mi,b.getChildBlocks=Te,b.getChildOffset=el,b.getColorFromAttributes=v1,b.getColorFromContent=A0,b.getComplexBlockClass=Kr,b.getContainerBlockPath=Yv,b.getContainerBlocks=Uv,b.getContainerBlocksElement=Rf,b.getContainerById=hi,b.getContainerId=pt,b.getContainerMinWidth=c1,b.getContainerToolsElement=xI,b.getContainerWidth=e3,b.getDistanceSquare=Xo,b.getElementFromPoint=Oe,b.getElementOffset=Ef,b.getElementScale=Fr,b.getEmbedType=sn,b.getExistsBlockTools=x0,b.getExistsContainerById=kf,b.getFileExt=yf,b.getFirstChildBlock=Ne,b.getFirstClientRect=o0,b.getHeadingBlockChildren=Uc,b.getHeadingMenuOptions=YE,b.getHorizontalPadding=Ip,b.getInsertionContent=e1,b.getLastChildBlock=Je,b.getLastClientRect=Zl,b.getListAllNextBrothers=hu,b.getLogger=D,b.getNextBlock=ae,b.getNextHiddenBlocks=qv,b.getNextValidOffset=da,b.getNextVisibleBlock=$r,b.getOffsetFromPoint=Lp,b.getOffsetInfoAfter=Kf,b.getOffsetInfoBefore=K0,b.getOpAt=P3,b.getOpLength=k0,b.getParentBlock=nt,b.getParentBlockExcludeSelf=la,b.getParentBox=Zp,b.getParentContainer=at,b.getPrevBlock=$e,b.getPrevValidOffset=nl,b.getPrevVisibleBlock=Vr,b.getRangeCommands=gy,b.getReferenceClientRect=ek,b.getRootBlock=i1,b.getScrollContainer=dn,b.getSpecialBlockCommands=$v,b.getStandardEmbedBlockProperties=tx,b.getTextAfterOffset=O8,b.getTextAttributes=z1,b.getTextBeforeOffset=N8,b.getTextBlockChild=_f,b.getTextBlockClass=bv,b.getTextBlockContentChildTextLength=jr,b.getTextBlockContentChildType=Xv,b.getTextBlockContentChildren=Yi,b.getTextLength=$n,b.getTextOpLength=E1,b.getTextWidth=m0,b.getToolbar=$m,b.handleBlockElementUpdated=Fv,b.hasAltOnly=J9,b.hasClass=Mt,b.hasCtrlOrCmd=Jb,b.hasCtrlOrCmdOnly=Q9,b.hashCode=pv,b.hideBlock=kv,b.hideTemplates=sS,b.htmlToFragment=h0,b.i18n=_,b.includeBigTable=aN,b.injectDocToHtmlFragment=Xf,b.injectStyle=Hb,b.inputActions=nM,b.insertEmptyBlock=RI,b.insertEmptyEmbedBlock=o1,b.insertText=Ws,b.intersectionCommands=UM,b.isBackspace=tv,b.isBlock=oa,b.isBlockLocked=dg,b.isBlockLockedByOthers=RA,b.isBlockLockedBySelf=Hd,b.isBlockTools=Tv,b.isBox=b0,b.isBoxOp=js,b.isCJK=Yb,b.isChildContainer=Ci,b.isChildNode=pe,b.isCodeBlock=Di,b.isCollapsedHeadingBlock=Xi,b.isCollapsedRange=E8,b.isComplexBlockPosition=ua,b.isComplexKindBlock=Pt,b.isContainer=Fs,b.isContainerSelectedAllChildBlocks=N5,b.isControlEvent=ra,b.isDelete=tI,b.isDraggingFiles=g0,b.isElementVisible=Mp,b.isEmbedBlock=Le,b.isEmptyContainer=Mf,b.isEmptyDoc=U1,b.isEmptyTextBlock=be,b.isEmptyTextBlockWithoutCompositionText=Md,b.isEnterOnly=Zb,b.isEscape=d0,b.isExclusiveBlock=Vd,b.isExpandedHeadingBlock=Wv,b.isFirefox=pf,b.isFirstChildBlockInComplexBlock=l7,b.isHeadingBlock=Ln,b.isHighSurrogate=$9,b.isInBlock=n1,b.isInBlockTools=Mc,b.isLetter=Xb,b.isLowSurrogate=H9,b.isMatchShortcut=Wi,b.isMoveForward=X9,b.isNavigationEvent=q9,b.isNavigationKey=Qb,b.isNodeRemoved=Cf,b.isNumber=qb,b.isPrintableKey=Np,b.isRootBlock=Hr,b.isRootContainer=re,b.isSafari=Ql,b.isSameDay=zp,b.isSelectBoxOnly=Li,b.isShiftEnter=Z9,b.isShiftTab=nI,b.isShortcutEvent=Y9,b.isSimpleBlock=vI,b.isSimpleBlockPosition=Ai,b.isSimplePos=dB,b.isSimpleRange=O0,b.isSpace=f0,b.isTab=eI,b.isTextBlockContentBoxChild=br,b.isTextBlockContentChild=If,b.isTextBlockContentInsertionChild=$s,b.isTextBlockContentTextChild=Df,b.isTextKindBlock=ot,b.isTextKindBlockType=wf,b.isTitleBlock=Ps,b.isToday=uv,b.isValidOffset=or,b.isVisibleBlock=Qo,b.isYesterday=fv,b.loadJs=Fb,b.loadJsPromise=ta,b.lockers=di,b.mergeCommands=Vm,b.mergeDocs=ga,b.mergeOps=_1,b.mergeText=m8,b.multiSplitText=K3,b.overflowText=dv,b.parseShortcut=ev,b.patchNode=vf,b.pointInRect=na,b.rangeAddAttribute=Nf,b.rangeGetTextColor=W3,b.rangeRemoveAttribute=Kc,b.rangeSetTextColor=j3,b.rangeTransformText=$3,b.registerDragDrop=Up,b.removeAttribute=b1,b.removeClass=ut,b.removeLastBr=u8,b.removePlaceholderFromBlock=kR,b.removeStyle=$b,b.replaceAll=dI,b.replaceAllCaseInsensitive=hI,b.replaceAllText=F5,b.replaceText=M0,b.requestDownload=p0,b.resetListStart=gu,b.scrollIntoView=$f,b.scrollable=lv,b.selectFile=_c,b.selectedBlockToDoc=Z0,b.selectionToDoc=Xc,b.setAttributes=a0,b.setClipboardData=Bf,b.setClipboardDataByEvent=oI,b.setColorToAttributes=z3,b.setDataset=Dp,b.setDefaultCursor=xf,b.setStyles=_p,b.shareDBCommentToDocObject=KC,b.shareDBDocCommentToComment=n2,b.shortcutToDisplayText=fn,b.showBlock=Qp,b.showDocVersions=Att,b.showTemplates=dx,b.splitText=sr,b.splitToThree=gn,b.stringToDataUrl=Kp,b.stringToObjectUrl=Hp,b.subText=V3,b.textNodeOffsetFromPoint=Pb,b.titleFromEditor=aS,b.toBase64URL=qi,b.toMindmap=Wm,b.toPlainText=ke,b.toPlainTextKeepLength=O1,b.trimChar=Op,b.unexclusiveBlock=kA,b.unicodeLength=j9,b.unicodeSubstr=z9,b.updateBlockSelection=Nv,b.updateOpAttributes=uB,b.updateTextBlockContent=U8,b.updateUrl=Pp;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"}})});