@ones-editor/editor 1.1.22-beta.1 → 1.1.22-beta.2
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
|
@@ -639,7 +639,7 @@ __p += '`),ne&&(st+=`' +
|
|
|
639
639
|
function print() { __p += __j.call(arguments, '') }
|
|
640
640
|
`:`;
|
|
641
641
|
`)+st+`return __p
|
|
642
|
-
}`;var Wt=T6(function(){return se(L,kt+"return "+st).apply(e,P)});if(Wt.source=st,fb(Wt))throw Wt;return Wt}function Est(a){return pe(a).toLowerCase()}function Ast(a){return pe(a).toUpperCase()}function xst(a,u,g){if(a=pe(a),a&&(g||u===e))return wo(a);if(!a||!(u=Pr(u)))return a;var x=Nr(a),y=Nr(u),L=oc(x,y),P=Uh(x,y)+1;return ql(x,L,P).join("")}function bst(a,u,g){if(a=pe(a),a&&(g||u===e))return a.slice(0,rf(a)+1);if(!a||!(u=Pr(u)))return a;var x=Nr(a),y=Uh(x,Nr(u))+1;return ql(x,0,y).join("")}function vst(a,u,g){if(a=pe(a),a&&(g||u===e))return a.replace(ja,"");if(!a||!(u=Pr(u)))return a;var x=Nr(a),y=oc(x,Nr(u));return ql(x,y).join("")}function Bst(a,u){var g=wt,x=Tt;if(je(u)){var y="separator"in u?u.separator:y;g="length"in u?jt(u.length):g,x="omission"in u?Pr(u.omission):x}a=pe(a);var L=a.length;if(So(a)){var P=Nr(a);L=P.length}if(g>=L)return a;var K=g-Hl(x);if(K<1)return x;var H=P?ql(P,0,K).join(""):a.slice(0,K);if(y===e)return H+x;if(P&&(K+=H.length-K),db(y)){if(a.slice(K).search(y)){var Z,tt=H;for(y.global||(y=af(y.source,pe(Ml.exec(y))+"g")),y.lastIndex=0;Z=y.exec(tt);)var st=Z.index;H=H.slice(0,st===e?K:st)}}else if(a.indexOf(Pr(y),K)!=K){var Et=H.lastIndexOf(y);Et>-1&&(H=H.slice(0,Et))}return H+x}function yst(a){return a=pe(a),a&&Vu.test(a)?a.replace(Ku,sf):a}var Tst=uf(function(a,u,g){return a+(g?" ":"")+u.toUpperCase()}),gb=kL("toUpperCase");function y6(a,u,g){return a=pe(a),u=g?e:u,u===e?tf(a)?Gg(a):ee(a):a.match(u)||[]}var T6=qt(function(a,u){try{return Nn(a,e,u)}catch(g){return fb(g)?g:new Nt(g)}}),kst=$o(function(a,u){return Gn(u,function(g){g=Us(g),Ko(a,g,cb(a[g],a))}),a});function Rst(a){var u=a==null?0:a.length,g=It();return a=u?ft(a,function(x){if(typeof x[1]!="function")throw new er(o);return[g(x[0]),x[1]]}):[],qt(function(x){for(var y=-1;++y<u;){var L=a[y];if(Nn(L[0],this,x))return Nn(L[1],this,x)}})}function wst(a){return Qtt(ai(a,C))}function pb(a){return function(){return a}}function Sst(a,u){return a==null||a!==a?u:a}var Lst=wL(),Ist=wL(!0);function br(a){return a}function Cb(a){return iL(typeof a=="function"?a:ai(a,C))}function Dst(a){return oL(ai(a,C))}function _st(a,u){return lL(a,ai(u,C))}var Mst=qt(function(a,u){return function(g){return zh(g,a,u)}}),Ust=qt(function(a,u){return function(g){return zh(a,g,u)}});function Eb(a,u,g){var x=Sn(u),y=rp(u,x);g==null&&!(je(u)&&(y.length||!x.length))&&(g=u,u=a,a=this,y=rp(u,Sn(u)));var L=!(je(g)&&"chain"in g)||!!g.chain,P=jo(a);return Gn(y,function(K){var H=u[K];a[K]=H,P&&(a.prototype[K]=function(){var Z=this.__chain__;if(L||Z){var tt=a(this.__wrapped__),st=tt.__actions__=Er(this.__actions__);return st.push({func:H,args:arguments,thisArg:a}),tt.__chain__=Z,tt}return H.apply(a,$t([this.value()],arguments))})}),a}function Ost(){return Xe._===this&&(Xe._=qg),this}function Ab(){}function Nst(a){return a=jt(a),qt(function(u){return aL(u,a)})}var Pst=Yx(ft),Fst=Yx(N),Kst=Yx(we);function k6(a){return rb(a)?Vi(Us(a)):get(a)}function Vst(a){return function(u){return a==null?e:yc(a,u)}}var $st=LL(),Hst=LL(!0);function xb(){return[]}function bb(){return!1}function jst(){return{}}function zst(){return""}function Gst(){return!0}function Wst(a,u){if(a=jt(a),a<1||a>yn)return[];var g=hr,x=U(a,hr);u=It(u),a-=hr;for(var y=Zu(x,u);++g<a;)u(g);return y}function qst(a){return Vt(a)?ft(a,Us):Fr(a)?[a]:Er(GL(pe(a)))}function Xst(a){var u=++Wg;return pe(a)+u}var Yst=cp(function(a,u){return a+u},0),Qst=Qx("ceil"),Jst=cp(function(a,u){return a/u},1),Zst=Qx("floor");function tot(a){return a&&a.length?np(a,br,Ox):e}function eot(a,u){return a&&a.length?np(a,It(u,2),Ox):e}function not(a){return Ro(a,br)}function rot(a,u){return Ro(a,It(u,2))}function iot(a){return a&&a.length?np(a,br,Kx):e}function sot(a,u){return a&&a.length?np(a,It(u,2),Kx):e}var oot=cp(function(a,u){return a*u},1),lot=Qx("round"),aot=cp(function(a,u){return a-u},0);function cot(a){return a&&a.length?Ju(a,br):0}function uot(a,u){return a&&a.length?Ju(a,It(u,2)):0}return R.after=Drt,R.ary=r6,R.assign=Ait,R.assignIn=C6,R.assignInWith=vp,R.assignWith=xit,R.at=bit,R.before=i6,R.bind=cb,R.bindAll=kst,R.bindKey=s6,R.castArray=jrt,R.chain=t6,R.chunk=Zet,R.compact=tnt,R.concat=ent,R.cond=Rst,R.conforms=wst,R.constant=pb,R.countBy=crt,R.create=vit,R.curry=o6,R.curryRight=l6,R.debounce=a6,R.defaults=Bit,R.defaultsDeep=yit,R.defer=_rt,R.delay=Mrt,R.difference=nnt,R.differenceBy=rnt,R.differenceWith=int,R.drop=snt,R.dropRight=ont,R.dropRightWhile=lnt,R.dropWhile=ant,R.fill=cnt,R.filter=frt,R.flatMap=mrt,R.flatMapDeep=grt,R.flatMapDepth=prt,R.flatten=YL,R.flattenDeep=unt,R.flattenDepth=fnt,R.flip=Urt,R.flow=Lst,R.flowRight=Ist,R.fromPairs=dnt,R.functions=Iit,R.functionsIn=Dit,R.groupBy=Crt,R.initial=mnt,R.intersection=gnt,R.intersectionBy=pnt,R.intersectionWith=Cnt,R.invert=Mit,R.invertBy=Uit,R.invokeMap=Art,R.iteratee=Cb,R.keyBy=xrt,R.keys=Sn,R.keysIn=xr,R.map=pp,R.mapKeys=Nit,R.mapValues=Pit,R.matches=Dst,R.matchesProperty=_st,R.memoize=Ep,R.merge=Fit,R.mergeWith=E6,R.method=Mst,R.methodOf=Ust,R.mixin=Eb,R.negate=Ap,R.nthArg=Nst,R.omit=Kit,R.omitBy=Vit,R.once=Ort,R.orderBy=brt,R.over=Pst,R.overArgs=Nrt,R.overEvery=Fst,R.overSome=Kst,R.partial=ub,R.partialRight=c6,R.partition=vrt,R.pick=$it,R.pickBy=A6,R.property=k6,R.propertyOf=Vst,R.pull=bnt,R.pullAll=JL,R.pullAllBy=vnt,R.pullAllWith=Bnt,R.pullAt=ynt,R.range=$st,R.rangeRight=Hst,R.rearg=Prt,R.reject=Trt,R.remove=Tnt,R.rest=Frt,R.reverse=lb,R.sampleSize=Rrt,R.set=jit,R.setWith=zit,R.shuffle=wrt,R.slice=knt,R.sortBy=Irt,R.sortedUniq=_nt,R.sortedUniqBy=Mnt,R.split=mst,R.spread=Krt,R.tail=Unt,R.take=Ont,R.takeRight=Nnt,R.takeRightWhile=Pnt,R.takeWhile=Fnt,R.tap=trt,R.throttle=Vrt,R.thru=gp,R.toArray=m6,R.toPairs=x6,R.toPairsIn=b6,R.toPath=qst,R.toPlainObject=p6,R.transform=Git,R.unary=$rt,R.union=Knt,R.unionBy=Vnt,R.unionWith=$nt,R.uniq=Hnt,R.uniqBy=jnt,R.uniqWith=znt,R.unset=Wit,R.unzip=ab,R.unzipWith=ZL,R.update=qit,R.updateWith=Xit,R.values=hf,R.valuesIn=Yit,R.without=Gnt,R.words=y6,R.wrap=Hrt,R.xor=Wnt,R.xorBy=qnt,R.xorWith=Xnt,R.zip=Ynt,R.zipObject=Qnt,R.zipObjectDeep=Jnt,R.zipWith=Znt,R.entries=x6,R.entriesIn=b6,R.extend=C6,R.extendWith=vp,Eb(R,R),R.add=Yst,R.attempt=T6,R.camelCase=tst,R.capitalize=v6,R.ceil=Qst,R.clamp=Qit,R.clone=zrt,R.cloneDeep=Wrt,R.cloneDeepWith=qrt,R.cloneWith=Grt,R.conformsTo=Xrt,R.deburr=B6,R.defaultTo=Sst,R.divide=Jst,R.endsWith=est,R.eq=zi,R.escape=nst,R.escapeRegExp=rst,R.every=urt,R.find=drt,R.findIndex=qL,R.findKey=Tit,R.findLast=hrt,R.findLastIndex=XL,R.findLastKey=kit,R.floor=Zst,R.forEach=e6,R.forEachRight=n6,R.forIn=Rit,R.forInRight=wit,R.forOwn=Sit,R.forOwnRight=Lit,R.get=hb,R.gt=Yrt,R.gte=Qrt,R.has=_it,R.hasIn=mb,R.head=QL,R.identity=br,R.includes=Ert,R.indexOf=hnt,R.inRange=Jit,R.invoke=Oit,R.isArguments=Rc,R.isArray=Vt,R.isArrayBuffer=Jrt,R.isArrayLike=Ar,R.isArrayLikeObject=rn,R.isBoolean=Zrt,R.isBuffer=Xl,R.isDate=tit,R.isElement=eit,R.isEmpty=nit,R.isEqual=rit,R.isEqualWith=iit,R.isError=fb,R.isFinite=sit,R.isFunction=jo,R.isInteger=u6,R.isLength=xp,R.isMap=f6,R.isMatch=oit,R.isMatchWith=lit,R.isNaN=ait,R.isNative=cit,R.isNil=fit,R.isNull=uit,R.isNumber=d6,R.isObject=je,R.isObjectLike=Qe,R.isPlainObject=Qh,R.isRegExp=db,R.isSafeInteger=dit,R.isSet=h6,R.isString=bp,R.isSymbol=Fr,R.isTypedArray=df,R.isUndefined=hit,R.isWeakMap=mit,R.isWeakSet=git,R.join=Ent,R.kebabCase=ist,R.last=ui,R.lastIndexOf=Ant,R.lowerCase=sst,R.lowerFirst=ost,R.lt=pit,R.lte=Cit,R.max=tot,R.maxBy=eot,R.mean=not,R.meanBy=rot,R.min=iot,R.minBy=sot,R.stubArray=xb,R.stubFalse=bb,R.stubObject=jst,R.stubString=zst,R.stubTrue=Gst,R.multiply=oot,R.nth=xnt,R.noConflict=Ost,R.noop=Ab,R.now=Cp,R.pad=lst,R.padEnd=ast,R.padStart=cst,R.parseInt=ust,R.random=Zit,R.reduce=Brt,R.reduceRight=yrt,R.repeat=fst,R.replace=dst,R.result=Hit,R.round=lot,R.runInContext=$,R.sample=krt,R.size=Srt,R.snakeCase=hst,R.some=Lrt,R.sortedIndex=Rnt,R.sortedIndexBy=wnt,R.sortedIndexOf=Snt,R.sortedLastIndex=Lnt,R.sortedLastIndexBy=Int,R.sortedLastIndexOf=Dnt,R.startCase=gst,R.startsWith=pst,R.subtract=aot,R.sum=cot,R.sumBy=uot,R.template=Cst,R.times=Wst,R.toFinite=zo,R.toInteger=jt,R.toLength=g6,R.toLower=Est,R.toNumber=fi,R.toSafeInteger=Eit,R.toString=pe,R.toUpper=Ast,R.trim=xst,R.trimEnd=bst,R.trimStart=vst,R.truncate=Bst,R.unescape=yst,R.uniqueId=Xst,R.upperCase=Tst,R.upperFirst=gb,R.each=e6,R.eachRight=n6,R.first=QL,Eb(R,function(){var a={};return _s(R,function(u,g){oe.call(R.prototype,g)||(a[g]=u)}),a}(),{chain:!1}),R.VERSION=r,Gn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){R[a].placeholder=R}),Gn(["drop","take"],function(a,u){Yt.prototype[a]=function(g){g=g===e?1:I(jt(g),0);var x=this.__filtered__&&!u?new Yt(this):this.clone();return x.__filtered__?x.__takeCount__=U(g,x.__takeCount__):x.__views__.push({size:U(g,hr),type:a+(x.__dir__<0?"Right":"")}),x},Yt.prototype[a+"Right"]=function(g){return this.reverse()[a](g).reverse()}}),Gn(["filter","map","takeWhile"],function(a,u){var g=u+1,x=g==fe||g==fr;Yt.prototype[a]=function(y){var L=this.clone();return L.__iteratees__.push({iteratee:It(y,3),type:g}),L.__filtered__=L.__filtered__||x,L}}),Gn(["head","last"],function(a,u){var g="take"+(u?"Right":"");Yt.prototype[a]=function(){return this[g](1).value()[0]}}),Gn(["initial","tail"],function(a,u){var g="drop"+(u?"":"Right");Yt.prototype[a]=function(){return this.__filtered__?new Yt(this):this[g](1)}}),Yt.prototype.compact=function(){return this.filter(br)},Yt.prototype.find=function(a){return this.filter(a).head()},Yt.prototype.findLast=function(a){return this.reverse().find(a)},Yt.prototype.invokeMap=qt(function(a,u){return typeof a=="function"?new Yt(this):this.map(function(g){return zh(g,a,u)})}),Yt.prototype.reject=function(a){return this.filter(Ap(It(a)))},Yt.prototype.slice=function(a,u){a=jt(a);var g=this;return g.__filtered__&&(a>0||u<0)?new Yt(g):(a<0?g=g.takeRight(-a):a&&(g=g.drop(a)),u!==e&&(u=jt(u),g=u<0?g.dropRight(-u):g.take(u-a)),g)},Yt.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Yt.prototype.toArray=function(){return this.take(hr)},_s(Yt.prototype,function(a,u){var g=/^(?:filter|find|map|reject)|While$/.test(u),x=/^(?:head|last)$/.test(u),y=R[x?"take"+(u=="last"?"Right":""):u],L=x||/^find/.test(u);!y||(R.prototype[u]=function(){var P=this.__wrapped__,K=x?[1]:arguments,H=P instanceof Yt,Z=K[0],tt=H||Vt(P),st=function(Jt){var ne=y.apply(R,$t([Jt],K));return x&&Et?ne[0]:ne};tt&&g&&typeof Z=="function"&&Z.length!=1&&(H=tt=!1);var Et=this.__chain__,kt=!!this.__actions__.length,Dt=L&&!Et,Wt=H&&!kt;if(!L&&tt){P=Wt?P:new Yt(this);var _t=a.apply(P,K);return _t.__actions__.push({func:gp,args:[st],thisArg:e}),new Cr(_t,Et)}return Dt&&Wt?a.apply(this,K):(_t=this.thru(st),Dt?x?_t.value()[0]:_t.value():_t)})}),Gn(["pop","push","shift","sort","splice","unshift"],function(a){var u=uc[a],g=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",x=/^(?:pop|shift)$/.test(a);R.prototype[a]=function(){var y=arguments;if(x&&!this.__chain__){var L=this.value();return u.apply(Vt(L)?L:[],y)}return this[g](function(P){return u.apply(Vt(P)?P:[],y)})}}),_s(Yt.prototype,function(a,u){var g=R[u];if(g){var x=g.name+"";oe.call(Pn,x)||(Pn[x]=[]),Pn[x].push({name:u,func:g})}}),Pn[ap(e,O).name]=[{name:"wrapper",func:e}],Yt.prototype.clone=vtt,Yt.prototype.reverse=Btt,Yt.prototype.value=ytt,R.prototype.at=ert,R.prototype.chain=nrt,R.prototype.commit=rrt,R.prototype.next=irt,R.prototype.plant=ort,R.prototype.reverse=lrt,R.prototype.toJSON=R.prototype.valueOf=R.prototype.value=art,R.prototype.first=R.prototype.head,Cc&&(R.prototype[Cc]=srt),R},Do=lf();ii?((ii.exports=Do)._=Do,tc._=Do):Xe._=Do}).call(Bn)})(Di,Di.exports);function _K(n,t,e,r){Im(n,{className:"status-input",defaultValue:t,onChange:e,onKeyDown:r,maxLength:32})}const Kk=["Blue","Grey","Yellow","Red","Green","Purple"];function MK(){const n=B("div",["status-color-palette"],null);for(const t of Kk){const e=B("button",["status-box-button"],null);e.setAttribute("data-color",Di.exports.lowerCase(t)),e.setAttribute("title",_.t(`status.color.${Di.exports.lowerCase(t)}`)),n.appendChild(e)}return n}class UK{constructor(){m(this,"root",MK());m(this,"changeColor",t=>{for(const r of Array.from(this.root.querySelectorAll(":scope > button")))r.classList.remove("selected");const e=this.root.querySelector(`button[data-color="${Di.exports.lowerCase(t)}"]`);e==null||e.classList.add("selected")})}}function Vk(n){localStorage.setItem(`statusBox.lastColor.${Di.exports.lowerCase(n.color)}`,n.title)}function $k(n){var t;return(t=localStorage.getItem(`statusBox.lastColor.${Di.exports.lowerCase(n)}`))!=null?t:_.t(`status.colorDefaultTitle.${Di.exports.lowerCase(n)}`)}function Hk(){var i;const n=Kk[0],t=(i=$k(n))!=null?i:_.t(`status.colorDefaultTitle.${Di.exports.lowerCase(n)}`);return{insert:" ",attributes:{id:it(),type:"status",box:!0,title:t,subtle:!0,created:Date.now(),color:n}}}const ng=D("StatusBoxEditor");class jk{constructor(t){m(this,"linkPopup",null);m(this,"boxElement");m(this,"statusPalette",new UK);m(this,"isEditing",!1);m(this,"editorStatus",t=>{if(!this.editor.isWritable())return;const e=this.editor.getBoxData(t);this.linkPopup=new su(this.createPopupContent(e.title,e.color,e.subtle),{id:"status-box-popup"}),this.linkPopup.on("show",this.handleShow),this.linkPopup.on("close",this.handClose),this.linkPopup.manualShow(t,{theme:"light",placement:"bottom-start",offset:[5,5]}),this.boxElement=t});m(this,"handleShow",()=>{this.focus()});m(this,"handClose",()=>{var r;p(ng,this.boxElement,"boxElement not found");const t=this.editor.getBoxData(this.boxElement),e=et(this.boxElement);if(p(ng,e,"block not found"),t.title)if(t.title.length>32){const i=t.title.slice(0,32),s={...t,title:i};this.editor.updateBoxData(s,{noFocus:!0}),Vk(s)}else Vk(t);else{const i=el(e,this.boxElement);this.editor.deleteTextFromBlock(e,i.start,1)}this.editor.focus(),(r=this.linkPopup)==null||r.destroy(),this.linkPopup=null,this.boxElement=void 0,this.isEditing=!1});m(this,"handleKeyDown",(t,e)=>{var r;e||t.key==="Enter"&&((r=this.linkPopup)==null||r.close(null))});m(this,"onColorChange",t=>{var s,o;if(!(t.target instanceof HTMLElement)||t.target.closest("[data-color]")===null)return;const e=Di.exports.capitalize(t.target.getAttribute("data-color"));p(ng,this.boxElement,"boxElement not found");const r=this.editor.getBoxData(this.boxElement);this.statusPalette.changeColor(e);const i={...r,color:e};if(!this.isEditing){const l=(o=(s=this.linkPopup)==null?void 0:s.popper)==null?void 0:o.querySelector("input"),c=$k(e);l&&(l.value=c),i.title=c}this.editor.updateBoxData(i,{noFocus:!0}),this.focus()});m(this,"onTitleChange",t=>{const e=t.target.value;p(ng,this.boxElement,"boxElement not found");const i={...this.editor.getBoxData(this.boxElement),title:e.trim()};this.editor.updateBoxData(i,{noFocus:!0}),this.isEditing=!0});this.editor=t,this.statusPalette.root.addEventListener("click",this.onColorChange)}focus(){setTimeout(()=>{var t,e,r,i,s,o;(r=(e=(t=this.linkPopup)==null?void 0:t.popper)==null?void 0:e.querySelector("input"))==null||r.focus(),(o=(s=(i=this.linkPopup)==null?void 0:i.popper)==null?void 0:s.querySelector("input"))==null||o.select()},100)}createPopupContent(t,e,r){const i=B("div",["status-box-editor-popup"],null);return _K(i,t,this.onTitleChange,this.handleKeyDown),this.isEditing=!1,i.appendChild(this.statusPalette.root),this.statusPalette.changeColor(e),i}destroy(){var t;(t=this.linkPopup)==null||t.destroy()}}const Xlt="",OK=D("status-box-command");class wd{static get commands(){return[{id:this.id,name:_.t("status.command.name"),icon:uT,order:650,group:"common",subText:"/status"}]}static insertStatus(t,e,r){var c;const i=t.getBlockByIndex(e,r),s=Hk(),{start:o}=t.selection.range;p(OK,xi(o),"invalid block position"),t.insertBoxToBlock(i,o.offset,s.attributes);const l=t.getBoxById((c=s.attributes)==null?void 0:c.id);t.addCustom("status-box",d=>new jk(d)).editorStatus(l)}static insertEmptyBlockStatus(t,e,r){var l;let i=t.getBlockByIndex(e,r);(!i||!ve(t,i))&&(i=t.insertTextBlock([],e,r));const s=Hk();t.setBlockText(i,[s]);const o=t.getBoxById((l=s.attributes)==null?void 0:l.id);return t.addCustom("status-box",c=>new jk(c)).editorStatus(o),i}}m(wd,"id","insert-status");const NK={"en-US":{status:{empty:"Set status",command:{name:"Status"},color:{red:"Red",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",grey:"Gray"},colorDefaultTitle:{red:"Delayed",yellow:"In progress",green:"Done",blue:"Not started",purple:"To be confirmed",grey:"Paused"}}},"zh-CN":{status:{empty:"\u8BBE\u7F6E\u72B6\u6001",command:{name:"\u72B6\u6001"},color:{red:"\u7EA2\u8272",yellow:"\u9EC4\u8272",green:"\u7EFF\u8272",blue:"\u84DD\u8272",purple:"\u7D2B\u8272",grey:"\u7070\u8272"},colorDefaultTitle:{red:"\u5DF2\u5EF6\u671F",yellow:"\u8FDB\u884C\u4E2D",green:"\u5DF2\u5B8C\u6210",blue:"\u672A\u5F00\u59CB",purple:"\u5F85\u786E\u8BA4",grey:"\u5DF2\u6682\u505C"}}},"ja-JP":{status:{empty:"\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u8A2D\u5B9A",command:{name:"\u30B9\u30C6\u30FC\u30BF\u30B9"},color:{red:"\u8D64",yellow:"\u9EC4",green:"\u7EFF",blue:"\u9752",purple:"\u7D2B",grey:"\u7070"},colorDefaultTitle:{red:"\u9045\u5EF6",yellow:"\u9032\u884C\u4E2D",green:"\u5B8C\u4E86",blue:"\u672A\u7740\u624B",purple:"\u672A\u78BA\u8A8D",grey:"\u4E00\u6642\u505C\u6B62"}}}};_.mergeLang(NK);const Ra=D("inline-box-items");function PK(n,t,e){return n.undoManager.runInGroup(()=>{var o;let r=n.findBlockByIndex(t,e);(!r||!ve(n,r))&&(r=n.insertTextBlock([],t,e));const i=Nk();n.setBlockText(r,[i]);const s=(o=i.attributes)==null?void 0:o.id;return p(Ra,s,"mathjax box id is empty"),setTimeout(()=>{const l=n.getBoxById(s);eg(n,l)},100),r})}function FK(n,t,e){let r=n.findBlockByIndex(t,e),i="bottom-start";return(!r||!ve(n,r))&&(i="top-start",r=n.insertTextBlock([],t,e)),Td(n,{target:r,linkText:"",linkUrl:"",onFinished:(l,c)=>{n.undoManager.runInGroup(()=>{try{p(Ra,r,"block not found"),ve(n,r)||(r=n.insertTextBlock([],t,e));const d=qr(l,{link:c}),h=qr(" ",null),C=[d,h];n.insertTextToBlock(r,0,C),n.selection.selectBlock(r,Vn(C)),n.focus()}catch(d){Ra.error(d)}})},onClose:()=>{n.focus()},placement:i}),r}function KK(n,t,e){return n.undoManager.runInGroup(()=>{var l;const r=n.getBlockByIndex(t,e),i=n.selection.range;p(Ra,xi(i.start),"invalid block position");const s=Nk();n.insertBoxToBlock(r,i.start.offset,s.attributes);const o=(l=s.attributes)==null?void 0:l.id;return p(Ra,o,"mathjax box id is empty"),setTimeout(()=>{const c=n.getBoxById(o);eg(n,c)},100),r})}function VK(n,t,e){const r=n.getBlockByIndex(t,e),i=n.selection.range;p(Ra,xi(i.start),"invalid block position");const s=Ks(n,r,i);if(s.length===0)return;const o=s[0],l=Hs(n,r,"quick-menu-inline-link",o);Td(n,{target:l,linkText:"",linkUrl:"",onFinished:(h,C)=>{n.undoManager.runInGroup(()=>{try{const E=n.getBlockText(r),A=Ws(E,i.start.offset,h,{link:C});n.setBlockText(r,A),n.selection.selectBlock(r,i.start.offset+h.length),n.focus()}catch(E){Ra.error(E)}})},onClose:()=>{n.focus()},placement:"bottom-start"})}class zk{getCommands(){return[{id:"insert-math",name:_.t("quickMenu.inlineBox.math"),icon:R2,order:900,group:"common",subText:Qn("insert-math")},{id:"insert-link",name:_.t("quickMenu.inlineBox.link"),icon:tE,order:400,group:"common",subText:Qn("insert-link")}]}async handleUpdateBlockCore(t,e){switch(e.item.id){case"insert-math":return KK(t,e.containerId,e.blockIndex);case"insert-link":return VK(t,e.containerId,e.blockIndex);case wd.id:return wd.insertStatus(t,e.containerId,e.blockIndex);default:return null}}async handleInsertEmptyBlockCore(t,e){switch(e.item.id){case"insert-math":return PK(t,e.containerId,e.blockIndex);case"insert-link":return FK(t,e.containerId,e.blockIndex);case wd.id:return wd.insertEmptyBlockStatus(t,e.containerId,e.blockIndex);default:return null}}async executeCommand(t,e,r){if(r.from==="quick-menu"||r.from==="add-block-menu"){const i=t.getBlockById(r.blockId),s=t.getParentContainer(i),o=pt(s),l=t.getBlockIndex(i);t.undoManager.runInGroup(()=>this.handleUpdateBlockCore(t,{item:e,containerId:o,blockIndex:l}))}else r.from==="block-menu"&&t.undoManager.runInGroup(()=>this.handleInsertEmptyBlockCore(t,{item:e,containerId:r.containerId,blockIndex:r.blockIndex}));return null}}const Gk=(n,t)=>{var e;return(e=n.children)==null?void 0:e.map(r=>({...r,itemType:"insert-block",commandProvider:t,children:Gk(r,t)}))};function $K(n,t){var s,o;const{withPlainText:e}=t,r=(o=(s=n.options.componentsOptions)==null?void 0:s.quickMenu)==null?void 0:o.commandProviders;if(!r)return[];const i=[];return[...r,new Lk(e),new zk].forEach(l=>{const c=l.getCommands(n,t);i.push(...c.map(d=>({...d,itemType:"insert-block",commandProvider:l,children:Gk(d,l)})))}),i}function HK(n,t){const e=[];return n.editorBlocks.forEach(r=>{if(!r.getOptions)return;const i=r.getOptions(n);!i.insertBlockCommandItems||(i.insertBlockCommandItems.forEach(s=>{Sk(s,i)}),e.push(...i.insertBlockCommandItems))}),e.push(...$K(n,t)),e}function eA(n,t={withPlainText:!1,from:"block-menu"}){const e=HK(n,t),r=new Map;e.forEach(o=>{var d,h;const l=(d=o.group)!=null?d:"";let c=r.get(l);c?c.items.push(o):(c={group:l,order:o.groupOrder||Ik[l]||1e3,items:[o],hide:(h=o.hideGroupItem)!=null?h:!1},r.set(l,c))});const i=Array.from(r.values());i.sort((o,l)=>o.order-l.order),i.forEach(o=>{o.items.sort((l,c)=>{var d,h;return((d=l.order)!=null?d:0)-((h=c.order)!=null?h:0)})});const s=[];return i.forEach((o,l)=>{const c=`blockMenu.section.${o.group||"common"}`,d=_.t(c),h=d===c?o.group:d;o.hide||s.push({id:`section-${l}`,name:h,type:"section",group:o.group,itemType:"insert-block"}),s.push(...o.items.map(C=>({...C})))}),s}function jK(n,t,e){const r=n.getFocusedBlock();if(!r)return;const i=n.getParentContainer(r),s=pt(i);let l=n.getBlockIndex(r);ve(n,r)||(l+=1);const c=e.trigger?"quick-menu":"add-block-menu";if(t.commandProvider){n.emit("beforeExecCommand",n,t,{source:c}),t.commandProvider.executeCommand(n,t,{from:c,...e});return}!t.blockOptions||!t.blockOptions.handleInsertEmptyBlock||(n.emit("beforeExecCommand",n,t,{source:c}),t.blockOptions.handleInsertEmptyBlock(n,{containerId:s,blockIndex:l,item:t,from:c}))}const Wk=D("quick-menu"),zK={id:"quick-menu",trigger:["/"]},GK=5;class rg{constructor(t,e=zK){m(this,"suggest");m(this,"items");m(this,"maxHeading");m(this,"firstEmptyOffset",-1);m(this,"queryItems",async(t,e)=>{if(this.items.length===0?this.initMenuItems():this.refreshMenuItems(),e){const r=new Set,i=e.toLocaleLowerCase().replace(/^\s+|\s+$/g,""),s=this.items.filter(o=>{if(o.type==="section")return!0;if(o.name.toLocaleLowerCase().indexOf(i)!==-1||iN(o).toLocaleLowerCase().indexOf(i)!==-1)return r.add(o.group),!0;const l=`blockMenu.section.${o.group||"common"}`,c=_.t(l),d=c===l?o.group:c;return(d==null?void 0:d.toLocaleLowerCase().indexOf(i))!==-1?(r.add(o.group),!0):!1}).filter(o=>o.type==="section"?r.has(o.group):!0);return s.length?this.firstEmptyOffset=-1:this.handleEmptySearch(),s}return this.items});m(this,"onClose",()=>{this.firstEmptyOffset=-1});m(this,"onShow",(t,e,r,i)=>{const s=this.editor.getBlockByIndex(e,r);if(!Gr(s)){const o=et(at(s));if(o&&Ot(o)==="code")return!1}return!0});m(this,"onClickItem",(t,e)=>{const r=e;r.itemType==="insert-block"&&(p(Wk,r.blockOptions||r.commandProvider,"invalid quick item, no block options or command provider"),p(Wk,this.suggest.anchor,"invalid suggest, no anchor"),this.options.id==="empty-block-menu"&&this.editor.focus(),jK(this.editor,r,this.suggest.anchor))});this.editor=t,this.options=e,this.items=[],this.maxHeading=jm(),this.suggest=new fE(t,{id:e.id||"quick-menu",trigger:e.trigger,needSpaceBeforeTrigger:!0,autoDeleteTrigger:!0,highlight:!0,onClose:this.onClose,onShow:this.onShow,onClickItem:this.onClickItem,queryItems:this.queryItems})}get menu(){return this.suggest.menu.menu}destroy(){this.suggest.destroy()}initMenuItems(){var r;const t=((r=this.suggest.anchor)==null?void 0:r.trigger)==="/"?"quick-menu":"block-menu",e=eA(this.editor,{withPlainText:!1,from:t});this.items=e}refreshMenuItems(){let t=null,e=0;const r=jm();if(r!==this.maxHeading){const i=new Lk,o=i.getCommands().map(l=>({...l,itemType:"insert-block",commandProvider:i}));for(let l=0;l<this.items.length;l++)this.items[l].group==="basics"&&(t||(t=l),t&&e++);t&&e&&this.items.splice(t,e,...o),this.maxHeading=r}}handleEmptySearch(){const t=this.editor.selection.getFocusedPos();if(this.firstEmptyOffset===-1){if(t.isSimple()){const{offset:e}=t;this.firstEmptyOffset=e-1}}else if(t.isSimple()){const{offset:e}=t;e-this.firstEmptyOffset>GK&&(this.suggest.close(),this.firstEmptyOffset=-1)}}}class Sd{constructor(t){m(this,"instance");m(this,"mousedown",!1);m(this,"currentInstance",null);m(this,"attributeName",[]);m(this,"attributeDesc","");m(this,"_lastClickButtonId","");m(this,"observer",null);m(this,"observerCallback",null);m(this,"createContent",t=>{let e="",r=0;for(;r<this.attributeName.length&&!e;)t.hasAttribute(this.attributeName[r])&&(e=t.getAttribute(this.attributeName[r])||""),r++;const i=t.getAttribute(this.attributeDesc);if(!i)return e;const s=B("div",[],null);return B("span",[],s,e),i&&B("span",["editor-tooltip-desc"],s,i),s});m(this,"handleDocumentMouseDown",()=>{this.mousedown=!0,this.editor.domEvents.addEventListener(document,"mouseup",this.handleDocumentMouseUp)});m(this,"handleDocumentMouseUp",()=>{this.mousedown=!1,this.editor.domEvents.removeEventListener(document,"mouseup",this.handleDocumentMouseUp)});m(this,"handleShown",t=>{this.currentInstance&&this.hide(),this.currentInstance=t,this.createObserver()});m(this,"handleHidden",()=>{this.destroyObserver(),this.currentInstance=null});m(this,"handleShow",t=>{var i;const e=t.reference;if(!e||!Ce(document.body,e)||window.isDragging||this.mousedown)return!1;const r=Number.parseInt((i=e.getAttribute("data-tooltip-hide-at"))!=null?i:"",10);if(r&&Date.now()-r<1e3)return!1;if(this._lastClickButtonId===e.getAttribute("data-button-id"))return this._lastClickButtonId="",!1;if(this.attributeName.every(s=>!e.hasAttribute(s)))return!1;if(t.reference){const s={};if(t.reference.hasAttribute("data-editor-tooltip-placement")&&(s.placement=t.reference.getAttribute("data-editor-tooltip-placement")||"top"),t.reference.hasAttribute("data-editor-tooltip-offset-x")||t.reference.hasAttribute("data-editor-tooltip-offset-y")){const l=t.reference.getAttribute("data-editor-tooltip-offset-x"),c=t.reference.getAttribute("data-editor-tooltip-offset-y");s.offset=[l?Number.parseInt(l,10):0,c?Number.parseInt(c,10):0]}t.reference.hasAttribute("data-editor-tooltip-maxwidth")&&(s.maxWidth=Number.parseInt(t.reference.getAttribute("data-editor-tooltip-maxwidth")||"350",10)),t.reference.hasAttribute("data-editor-tooltip-allow-markdown")&&(s.allowHTML=!0);const o=document.body;if(s.appendTo=this.fixContainerForFullscreen(o),Object.keys(s).length&&t.setProps(s),t.reference.hasAttribute(`data-editor-tooltip-${this.editor.clientId}-dynamic`)){const l=t.reference.getAttribute(`data-editor-tooltip-${this.editor.clientId}-dynamic`);t.setContent(l||"")}}return!0});this.editor=t;const e=t.clientId;this.attributeName=[`data-editor-tooltip-${e}`,`data-editor-tooltip-${e}-dynamic`,"data-editor-tooltip-common"],this.attributeDesc=`data-editor-tooltip-desc-${e}`,this.instance=Bp.delegate(document.body,{theme:"editor-tooltip",maxWidth:400,delay:200,target:this.attributeName.map(r=>`[${r}]`).join(","),content:this.createContent,onShow:this.handleShow,onShown:this.handleShown,onHide:this.handleHidden,hideOnClick:!1}),t.domEvents.addEventListener(document,"mousedown",this.handleDocumentMouseDown)}set lastClickButtonId(t){this._lastClickButtonId=t,t&&setTimeout(()=>{this._lastClickButtonId===t&&(this._lastClickButtonId="")},500)}visible(){var t;return(t=this.currentInstance)==null?void 0:t.state.isVisible}hide(){var t;(t=this.currentInstance)!=null&&t.state.isVisible&&this.currentInstance.hide()}destroy(){this.destroyObserver(),this.instance.destroy(),this.editor.domEvents.removeEventListener(document,"mousedown",this.handleDocumentMouseDown),this.editor.domEvents.removeEventListener(document,"mouseup",this.handleDocumentMouseUp)}createObserver(){this.destroyObserver();const t=this.currentInstance;if(!t||!t.reference)return;this.observerCallback=Ue.default(()=>{t.reference.closest("body")||(t.hide(),this.destroyObserver())},200),this.observer=new MutationObserver(this.observerCallback);const e=document.body,r={childList:!0,attributes:!1,subtree:!0};this.observer.observe(e,r)}destroyObserver(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observerCallback&&(this.observerCallback.cancel(),this.observerCallback=null)}fixContainerForFullscreen(t){return t.closest("body")&&document.fullscreenElement&&!document.fullscreenElement.contains(t)?document.fullscreenElement:t}}const WK={"text/style-bold":"bold","text/style-italic":"italic","text/style-underline":"underline","text/style-strikethrough":"line-through","text/style-code":"code","text/style-sub":"subscript","text/style-super":"superscript",link:"link"};function qK(n,t){const e=new Set(Object.keys(WK)),r=t.filter(s=>e.has(s.id));return $m(r)}function Ld(n,t){if(!n.isWritable()||Ii(n))return!1;const e=n.selection.range,r=n.editorCommandProviders.getCommands(e,"shortcut"),s=qK(n,r).find(o=>o.id===`text/${t}`||o.id==="link");return s?(n.editorCommandProviders.executeCommand(e,s,{}),Au.get(n).update("selectionChange"),!0):!1}function XK(n,t){const e=n.selection.focusedBlock;if(!n.isWritable()||!ot(n,e))return!1;const r=n.getBlockData(e).heading,i={id:`heading-${t}`,source:"BlockTurnIntoCommandProvider",value:String(t)};return Number(r)===t&&(i.id="text",i.value=null),n.editorCommandProviders.executeCommand(n.selection.range,i,{}),!0}const nA={"CtrlOrCmd+B":n=>Ld(n,"style-bold"),"CtrlOrCmd+I":n=>Ld(n,"style-italic"),"CtrlOrCmd+U":n=>Ld(n,"style-underline"),"CtrlOrCmd+D":n=>Ld(n,"style-strikethrough"),"CtrlOrCmd+K":n=>Ld(n,"link"),...(()=>{const n={};for(let t=1;t<=8;t++)n[`CtrlOrCmd+${t}`]=e=>XK(e,t);return n})()},YK={quickMenu:{basic:{heading:{title:"\u6807\u9898 {heading}",space:"{markdown}\u7A7A\u683C"},unordered:"\u65E0\u5E8F\u5217\u8868",ordered:"\u6709\u5E8F\u5217\u8868",checkbox:"\u5F85\u529E\u5217\u8868",quote:"\u5F15\u7528"},inlineBox:{math:"\u516C\u5F0F",link:"\u94FE\u63A5"}},link:{textLabel:"\u6587\u672C",urlLabel:"\u94FE\u63A5\u5730\u5740",textPlaceholder:"\u8BF7\u8F93\u5165\u6587\u672C",urlPlaceholder:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740",submitText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",edit:"\u7F16\u8F91",remove:"\u53D6\u6D88\u94FE\u63A5"},commands:{unordered:"\u65E0\u5E8F\u5217\u8868",ordered:"\u6709\u5E8F\u5217\u8868",check:"\u5F85\u529E\u5217\u8868",link:"\u94FE\u63A5",quote:"\u5F15\u7528",alignLeft:"\u5DE6\u5BF9\u9F50",alignRight:"\u53F3\u5BF9\u9F50",alignCenter:"\u5C45\u4E2D\u5BF9\u9F50",alignGroup:"\u5BF9\u9F50\u65B9\u5F0F",heading:"\u6807\u9898 {name}",headingGroup:"\u6807\u9898\u6837\u5F0F",text:"\u6B63\u6587"}},QK={quickMenu:{basic:{heading:{title:"Heading {heading}",space:"{markdown}space"},unordered:"Bulleted list",ordered:"Numbered list",checkbox:"To-do list",quote:"Quote"},inlineBox:{math:"Formula",link:"Link"}},link:{textLabel:"Text",urlLabel:"Link address",textPlaceholder:"Please enter text",urlPlaceholder:"Please enter link",submitText:"Confirm",cancelText:"Cancel",edit:"Edit",remove:"Remove link"},commands:{unordered:"Bulleted list",ordered:"Numberer list",check:"To-do list",link:"Link",quote:"Quote",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Center text",alignGroup:"Alignment",heading:"Heading {name}",headingGroup:"Text style",text:"Text"}},JK={quickMenu:{basic:{heading:{title:"\u898B\u51FA\u3057{heading}",space:"{markdown}\u30B9\u30DA\u30FC\u30B9"},unordered:"\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",ordered:"\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",checkbox:"\u30D0\u30C3\u30AF\u30ED\u30B0",quote:"\u5F15\u7528"},inlineBox:{math:"\u6570\u5F0F",link:"URL"}},link:{textLabel:"\u30C6\u30AD\u30B9\u30C8",urlLabel:"URL",textPlaceholder:"\u30C6\u30AD\u30B9\u30C8\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",urlPlaceholder:"URL \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",submitText:"OK",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB",edit:"\u7DE8\u96C6",remove:"\u30EA\u30F3\u30AF\u3092\u89E3\u9664"},commands:{unordered:"\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",ordered:"\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",check:"\u30D0\u30C3\u30AF\u30ED\u30B0",link:"URL",quote:"\u5F15\u7528",alignLeft:"\u5DE6\u63C3\u3048",alignRight:"\u53F3\u63C3\u3048",alignCenter:"\u4E2D\u592E\u63C3\u3048",alignGroup:"\u5BF9\u9F50\u65B9\u5F0F",heading:"\u898B\u51FA\u3057{name}",headingGroup:"\u30BF\u30A4\u30C8\u30EB\u30B9\u30BF\u30A4\u30EB",text:"\u672C\u6587"}};_.mergeLang({"zh-CN":YK,"en-US":QK,"ja-JP":JK});const tat="";function wa(n,...t){const e=Qr(...t);return e.classList.remove("editor-button"),e.classList.add("editor-text-button"),n.append(e),e}function qk(n){const t=Hm(n);t==null||t.hide();const e=n.findCustom("table-border-bar");e==null||e.closeToolbar()}function ZK(n){return B("div",["insert-column-button","drop-marker"],n)}const tV=D("row-height");function Xk(n){const t=Kt.fromTable(n),e=n.rows;p(tV,e.length===t.rowCount,"row count mismatch");const r=Array(t.rowCount).fill(0);for(let i=0;i<e.length;){let s=1,l=e[i].getBoundingClientRect().height,c=i+1;for(;c<e.length;){const d=e[c];if(d.cells.length!==0)break;s++,c++,l+=d.getBoundingClientRect().height}for(let d=0;d<s;d++)r[i+d]=l/s;i=c}return r}const eV=D("table-border-bar-dom");function Yk(n){var c;const t=et(n.contentElement);p(eV,t,"no block");const r=be(t).querySelector(".table-border-bar-container.left"),s=zt(t).offsetLeft-cu,o=((c=n.scrollOptions.paddingLeft)!=null?c:0)+s,l=Math.min(n.contentElement.offsetLeft-s,n.rootElement.scrollLeft-o);r&&(r.style.left=`${-l}px`)}const Al=D("table-border-bar-dom");function xu(n,t){p(Al,un(t),"invalid table block");const e=cn(t),r=as(n,t),i=be(t),s=(C,E,A)=>{const v=B("div",["button-root",E],C),S=B("div",["button-container",E],v);v.setAttribute(`data-${E}-index`,`${A}`),S.setAttribute(`data-editor-tooltip-${n.clientId}`,E==="left"?_.t("table.insertRow"):_.t("table.insertCol")),B("span",["insert-indicator"],S),ZK(S)},{selectedRows:o,selectedColumns:l}=mE(n,t),c=()=>{const C=r.querySelector(".table-border-bar-container.top");p(Al,C,"no top border bar container");const E=B("div",["table-border-bar-container","top"],null),A=B("div",["table-border-bar","top"],E),v=rP(e),w=Kt.fromTable(e).colCount;n.selection.range.isSimple()&&s(A,"top",0);for(let O=0;O<w;O++){const M=O===w-1?v[O]+2:v[O],V=B("span",["table-border-bar-cell","top"],A);l.has(O)&&V.classList.add("selected"),V.setAttribute("data-top-index",`${O}`),V.style.width=`${M}px`,n.selection.range.isSimple()&&s(A,"top",O+1)}vf(C,E)},d=()=>{const C=i.querySelector(".table-border-bar-container.left");p(Al,C,"no left border bar container");const E=B("div",["table-border-bar-container","left"],null),A=B("div",["table-border-bar","left"],E);B("span",["table-border-bar-cell","corner"],A);const v=Xk(e);n.selection.range.isSimple()&&s(A,"left",0),Array.from(e.rows).forEach((S,w,O)=>{const M=B("span",["table-border-bar-cell","left"],A);o.has(w)&&M.classList.add("selected"),M.setAttribute("data-left-index",`${w}`);const V=w===O.length-1?v[w]+2:v[w];M.style.height=`${V}px`,n.selection.range.isSimple()&&s(A,"left",w+1)}),vf(C,E)};c(),d();const h=n.findCustom(ls(t));h&&Yk(h)}function Qk(n,t){const e=t.target;if(!(e instanceof Element))return;const r=et(e);p(Al,r&&un(r),"invalid table block"),xu(n,r),n.selection.caret.update()}function ig(n,t){const e=t.target;if(!(e instanceof Element))return;const r=et(e);p(Al,r&&un(r),"invalid table block");const i=e.closest(".button-root");if(i){if(i.classList.contains("top")){const s=parseInt(i.getAttribute("data-top-index")||"0",10);ZT(n,r,s),xu(n,r)}else if(i.classList.contains("left")){const s=parseInt(i.getAttribute("data-left-index")||"0",10);IE(n,r,s),xu(n,r)}}}function sg(n,t){var o;qk(n),t.preventDefault(),t.stopPropagation();let e=null,r,i;const s=l=>{var c;if(l.target instanceof HTMLElement&&r&&e&&i!==void 0){const d=et(l.target),h=l.target.closest(".table-border-bar");if(d===e&&h){const C=parseInt((c=l.target.getAttribute(`data-${r}-index`))!=null?c:"0",10),E=Math.min(i,C),A=Math.abs(i-C)+1;Mt(l.target,"top")&&r==="top"?CP(n,d,E,A,{reverse:!0}):Mt(l.target,"left")&&r==="left"&&EP(n,d,E,A,{reverse:!0})}}l.type==="mouseup"&&(e=null,i=void 0,r=void 0,document.body.removeEventListener("mousemove",s),document.body.removeEventListener("mouseup",s))};t.target instanceof HTMLElement&&Mt(t.target,"table-border-bar-cell")&&(e=et(t.target),Mt(t.target,"top")?r="top":Mt(t.target,"left")&&(r="left"),r&&e&&(i=parseInt((o=t.target.getAttribute(`data-${r}-index`))!=null?o:"0",10),document.body.addEventListener("mousemove",s),document.body.addEventListener("mouseup",s)))}function Jk(n){const t=n.selection.range,e=pd(n,t);e&&xu(n,e)}function nV(n,t){p(Al,un(t),"invalid table block");const e=as(n,t),r=be(t),i=B("div",["table-border-bar-container","top"],e),s=B("div",["table-border-bar-container","left"],r);xu(n,t),n.domEvents.addEventListener(zt(t),"scroll",Qk),n.domEvents.addEventListener(i,"click",ig),n.domEvents.addEventListener(s,"click",ig),n.domEvents.addEventListener(i,"mousedown",sg),n.domEvents.addEventListener(s,"mousedown",sg),n.addListener("afterClearSelection",Jk)}function Zk(n,t){if(!n.isWritable())return;if(as(n,t).querySelector(".table-border-bar-container")){xu(n,t);return}nV(n,t)}function tR(n,t){p(Al,un(t),"invalid table block");const e=as(n,t),r=be(t),i=e.querySelectorAll(".table-border-bar-container"),s=r.querySelectorAll(".table-border-bar-container");i.forEach(o=>{n.domEvents.removeEventListener(o,"click",ig),n.domEvents.removeEventListener(o,"mousedown",sg),o.remove()}),s.forEach(o=>{n.domEvents.removeEventListener(o,"click",ig),n.domEvents.removeEventListener(o,"mousedown",sg),o.remove()}),n.domEvents.removeEventListener(zt(t),"scroll",Qk),n.addListener("afterClearSelection",Jk)}function rV(n,t){p(Al,un(t),"invalid table block");const r=as(n,t).querySelector(".table-border-bar-container.top");return r?r.getBoundingClientRect().height:0}class iV{constructor(t,e){m(this,"toolbar");m(this,"handleSelectionChange",(t,e)=>{!t.isVisible||(e==="delete-columns"?(ml(this.editor,this.tableBlock,!0,!0),gl(this.editor,this.tableBlock,!0,!0)):e==="delete-rows"?(ml(this.editor,this.tableBlock,!0,!1),gl(this.editor,this.tableBlock,!0,!1)):(ml(this.editor,this.tableBlock,!1),gl(this.editor,this.tableBlock,!1)))});m(this,"handleClick",(t,e,r)=>{e.id==="delete-columns"?gE(this.editor.selection.range):e.id==="delete-rows"&&pE(this.editor.selection.range)});m(this,"handleToolbarClose",()=>{this.tableBlock&&pd(this.editor,this.editor.selection.range)===this.tableBlock&&(ml(this.editor,this.tableBlock,!1),gl(this.editor,this.tableBlock,!1))});this.editor=t,this.tableBlock=e;const r=t.options.componentsOptions.popover;this.toolbar=new hd([],void 0,{id:"table-row-column-toolbar",overflowBoundary:r==null?void 0:r.overflowBoundary,refuseOverflow:!0,tooltipId:this.editor.clientId}),this.toolbar.addListener("selectionChange",this.handleSelectionChange),this.toolbar.addListener("click",this.handleClick),this.toolbar.addListener("close",this.handleToolbarClose)}close(){this.toolbar.close("cancelBar")}update(){var i,s,o;const{selectedColumns:t,selectedRows:e}=mE(this.editor,this.tableBlock);if(!this.editor.isWritable())return;if(t.size>0&&e.size>0){this.toolbar.close("cancelBar");return}if(t.size===0&&e.size===0){this.toolbar.close("cancelBar");return}const r=Ks(this.editor,this.tableBlock,this.editor.selection.range)[0];if(!r){this.toolbar.close("cancelBar");return}if(t.size>0){const l={id:"delete-columns",name:_.t("table.deleteSelectCol"),icon:m2};this.toolbar.updateItems([l]);const c=Hs(this.editor,this.tableBlock,"table-row-column-delete",r);this.toolbar.manualShow(c,{placement:"top",offset:[0,5]})}else{const l={id:"delete-rows",name:_.t("table.deleteSelectRow"),icon:h2};this.toolbar.updateItems([l]);const h=be(this.tableBlock).querySelector(".table-border-bar-container.left").getBoundingClientRect(),C=new DOMRect(Math.max(h.left,r.left-cu),r.top,cu,r.height),E=Hs(this.editor,this.tableBlock,"table-row-column-delete",C);this.toolbar.manualShow(E,{placement:"left",offset:[0,5]});const A=this.editor.options.componentsOptions.popover;(i=this.toolbar.tippyInstance)==null||i.setProps({popperOptions:{modifiers:[{name:"flip",options:{boundary:A==null?void 0:A.overflowBoundary,fallbackPlacements:["left","right"]}}]}})}(o=(s=this.toolbar.tippyInstance)==null?void 0:s.popperInstance)==null||o.update()}destroy(){this.toolbar.destroy(),this.toolbar.removeAllListeners()}}const rA=D("table-border-bar");class sV{constructor(t,e){m(this,"toolbar");m(this,"resizeObserver",null);m(this,"handleReadonlyChanged",t=>{t.isWritable()?this.update():tR(this.editor,this.tableBlock)});m(this,"handleBlockUpdated",()=>{var t;(t=this.resizeObserver)==null||t.disconnect(),setTimeout(()=>{var r;const e=this.editor.getBlockById(dt(this.tableBlock));(r=this.resizeObserver)==null||r.observe(cn(e))})});m(this,"handleScroll",()=>{var t;(t=this.toolbar)==null||t.update()});m(this,"handleTableResize",()=>{!this.editor.isWritable()||this.update()});this.editor=t,this.tableBlock=e,p(rA,this.tableBlock,"no table block"),rA.debug("create table border bar"),Zk(this.editor,this.tableBlock),this.resizeObserver=new Ql(this.handleTableResize),this.resizeObserver.observe(cn(this.tableBlock));const r=t.getComponentOptions("table");r!=null&&r.hideToolbar||(this.toolbar=new iV(this.editor,this.tableBlock)),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged)}close(){var t;(t=this.toolbar)==null||t.close()}destroy(){var t,e;rA.debug("destroy table border bar"),(t=this.resizeObserver)==null||t.disconnect(),this.resizeObserver=null,tR(this.editor,this.tableBlock),(e=this.toolbar)==null||e.destroy(),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged)}update(){var t;Zk(this.editor,this.tableBlock),(t=this.toolbar)==null||t.update()}}const oV=D("table-border-bar");class lV{constructor(t){m(this,"activeTableBar",null);m(this,"handleBlockDeleted",(t,e)=>{!this.activeTableBar||(e===this.activeTableBar.tableBlock||Ce(e,this.activeTableBar.tableBlock))&&(this.activeTableBar.destroy(),this.activeTableBar=null)});m(this,"handleSelectionChanged",t=>{setTimeout(()=>{var i;const e=t.selection.range,r=pd(t,e);((i=this.activeTableBar)==null?void 0:i.tableBlock)!==r&&this.activeTableBar&&this.hide(),r&&this.show(r)})});m(this,"handleScroll",()=>{var t;(t=this.activeTableBar)==null||t.handleScroll()});this.editor=t,this.editor.addListener("blockDeleted",this.handleBlockDeleted),this.editor.addListener("selectionChanged",this.handleSelectionChanged)}destroy(){var t;this.editor.removeListener("blockDeleted",this.handleBlockDeleted),this.editor.removeListener("selectionChanged",this.handleSelectionChanged),(t=this.activeTableBar)==null||t.destroy()}show(t){this.activeTableBar?(this.activeTableBar.tableBlock!==t&&this.hide(),this.activeTableBar.update()):this.activeTableBar=new sV(this.editor,t)}update(){var t;(t=this.activeTableBar)==null||t.handleBlockUpdated()}closeToolbar(){var t;(t=this.activeTableBar)==null||t.close()}hide(){!this.activeTableBar||(p(oV,this.activeTableBar,"no active table bar"),this.activeTableBar.destroy(),this.activeTableBar=null)}}function eR(n,t){const e=n.addCustom("table-border-bar",r=>new lV(r));t==="update"&&e.update()}const ur=D("table-cell-menu"),aV="style-bg-color-";class cV{constructor(t){m(this,"activeTableBlock",null);m(this,"targetButton",null);m(this,"manualMenu",null);m(this,"colorPaletteItem",null);m(this,"markedRowAsDanger",!1);m(this,"markedColAsDanger",!1);m(this,"resetAsDangerMarked",()=>{this.markedColAsDanger=!1,this.markedRowAsDanger=!1});m(this,"handlePrevent",(t,e)=>{e.stopPropagation()});m(this,"handleReadonlyChanged",t=>{t.isWritable()||this.hide()});m(this,"handleSelectionChanged",t=>{const e=t.selection.range,r=pd(t,e);if(this.hide(),this.activeTableBlock!==r&&(this.activeTableBlock=r),this.activeTableBlock){const i=Kt.fromBlock(this.activeTableBlock),s=e.isReverse()?e.start:e.end;let o=null;s instanceof Ai?t.getBlockById(s.blockId)===this.activeTableBlock?o=i.getCellByContainerId(s.childContainerId):o=this.getCellByChildBlockId(i,s.blockId):s.blockId!==this.activeTableBlock.id&&(o=this.getCellByChildBlockId(i,s.blockId)),o&&this.editor.isWritable()&&this.showCellMenuButton(o)}});m(this,"handleBeforePopupPalette",()=>{var e;const t=this.getSelectedBkgColorIndex();(e=this.colorPaletteItem)==null||e.palette.setColor("backgroundColor",t)});m(this,"createBkgColorItem",()=>{const t=B("div",["cell-background-color-item"],null);B("span",[],t,_.t("table.cellBackground"));const e=this.getSelectedBkgColorIndex();B("button",["item-button"],t).setAttribute("data-color-index",`${e}`);const i=B("span",["item-sub-indicator"],t);return i.innerHTML=qC,t});m(this,"handleCommand",t=>{var i;p(ur,this.activeTableBlock,"no target table block");const e=((i=t.states)==null?void 0:i.includes("checked"))||!1,r=t.value;switch(t.id){case"delete-select-row":pE(MT(this.editor,this.activeTableBlock,!1));break;case"delete-select-col":gE(MT(this.editor,this.activeTableBlock,!0));break;case"merge-cell":IT(this.editor.selection.range);break;case"split-cell":this.handleSplitCell();break;case"row-title":this.handleRowTitle(e);break;case"col-title":this.handleColTitle(e);break;case"stripe-style":this.handleStripeStyle(e);break;case"hide-border":RN(this.editor,this.activeTableBlock,r==="show-border");break;case"show-chart":LN(this.editor,this.activeTableBlock,r==="show-chart"),BE(this.editor,this.activeTableBlock,{updateNow:!0});break}});m(this,"handleToolbarClose",()=>{this.targetButton&&ct(this.targetButton,"active"),(this.markedRowAsDanger||this.markedColAsDanger)&&this.activeTableBlock&&pd(this.editor,this.editor.selection.range)===this.activeTableBlock&&(ml(this.editor,this.activeTableBlock,!1),gl(this.editor,this.activeTableBlock,!1),this.resetAsDangerMarked()),this.editor.focus()});m(this,"handleSelectionChange",(t,e)=>{if(!!t.isVisible)if(p(ur,this.activeTableBlock,"no target table block"),e==="cell-background-color"&&this.handleBeforePopupPalette(),e==="delete-select-row"){if(this.markedRowAsDanger)return;ml(this.editor,this.activeTableBlock,!0,!1),gl(this.editor,this.activeTableBlock,!0,!1),this.resetAsDangerMarked(),this.markedRowAsDanger=!0}else if(e==="delete-select-col"){if(this.markedColAsDanger)return;ml(this.editor,this.activeTableBlock,!0,!0),gl(this.editor,this.activeTableBlock,!0,!0),this.resetAsDangerMarked(),this.markedColAsDanger=!0}else ml(this.editor,this.activeTableBlock,!1),gl(this.editor,this.activeTableBlock,!1),this.resetAsDangerMarked()});m(this,"handleClick",(t,e)=>{var r;p(ur,this.activeTableBlock,"no target table block"),p(ur,this.targetButton,"no target button"),qk(this.editor),Mt(this.targetButton,"active")?(ct(this.targetButton,"active"),(r=this.manualMenu)==null||r.close("clickItem")):(q(this.targetButton,"active"),this.manualMenu?this.manualMenu.updateItems(this.createCommandMenu()):(this.manualMenu=new dl(this.createCommandMenu(),void 0,{id:"table-cell-menu"}),this.manualMenu.on("click",(i,s)=>{var o;this.handleCommand(s),(o=this.manualMenu)==null||o.close("clickItem")}),this.manualMenu.on("selectionChange",this.handleSelectionChange),this.manualMenu.on("close",this.handleToolbarClose)),this.manualMenu.manualShow(this.targetButton,{placement:"right-start"})),e.stopPropagation()});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChanged),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged)}destroy(){var t,e;this.activeTableBlock=null,this.targetButton=null,this.editor.removeListener("selectionChanged",this.handleSelectionChanged),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged),(t=this.manualMenu)==null||t.destroy(),(e=this.colorPaletteItem)==null||e.destroy()}hide(){var t;(t=this.manualMenu)==null||t.close("cancelBar"),this.targetButton&&(ct(this.targetButton,"active"),this.targetButton.style.display="none")}getCellByChildBlockId(t,e){let r=this.editor.getBlockById(e);for(;r;){const i=r.closest("td");p(ur,i,"no parent cell");const s=et(i);if(p(ur,s,"no parent block"),cn(s)===t.table)return t.getCellByCellElement(i);r=s}return p(ur,!1,"filed to get cell by child block id"),null}createTargetButton(t){this.targetButton?t.querySelector(`:scope > .${bE}`)||t.appendChild(this.targetButton):(this.targetButton=B("button",[bE],t),this.targetButton.innerHTML=Cm,this.editor.domEvents.addEventListener(this.targetButton,"click",this.handleClick),this.editor.domEvents.addEventListener(this.targetButton,"mousedown",this.handlePrevent),this.editor.domEvents.addEventListener(this.targetButton,"dblclick",this.handlePrevent))}showCellMenuButton(t){this.createTargetButton(t.cell),p(ur,this.targetButton,"no target button"),this.targetButton.style.display="inline-block"}handleSplitCell(){if(this.activeTableBlock){const t=Kt.fromBlock(this.activeTableBlock),e=this.editor.selection.range;if(e.isSimple()){const{col:r,row:i}=this.getCellByChildBlockId(t,e.start.blockId);EE(this.editor,this.activeTableBlock,{col:r,row:i})}else AE(this.editor.selection.range)}}getSelectedBkgColorIndex(){var o;p(ur,this.activeTableBlock,"no target table block");const t=this.editor.selection.range,e=hl(this.editor,this.activeTableBlock,t.focus),r=this.editor.getBlockData(this.activeTableBlock),i=e.childContainerId,s=r[`${i}_background`];return s?Number.parseInt((o=s.substring(aV.length))!=null?o:"0",10):-1}createCommandMenu(){p(ur,this.activeTableBlock,"no target table block");const t=this.editor.getBlockData(this.activeTableBlock),e=LT(this.editor,this.activeTableBlock,this.editor.selection.range);let r=this.editor.selection.range;if(r.isSimple()){const h=hl(this.editor,this.activeTableBlock,r.start);r=gn(this.editor,{anchor:h,focus:h})}const i=ST(this.editor,this.activeTableBlock,r),s=t.hasRowTitle,o=t.hasColTitle,l=t.isStripeStyle,c=t.noBorder,d=t.chart;return this.colorPaletteItem=new vT("cell-background-color",{color:!1}),this.colorPaletteItem.palette.on("onClick",(h,C)=>{var E;switch(p(ur,this.activeTableBlock,"no target table block"),h){case"clearColor":NT(this.editor,this.activeTableBlock,-1);break;case"backgroundColor":NT(this.editor,this.activeTableBlock,C);break}(E=this.manualMenu)==null||E.close("clickItem")}),[{id:"cell-background-color",name:_.t("table.cellBackground"),element:this.createBkgColorItem(),children:[this.colorPaletteItem]},{id:"separator",name:"",type:"separator"},{id:"merge-cell",name:_.t("table.mergeCell"),states:e?[]:["disabled"]},{id:"split-cell",name:_.t("table.splitCell"),states:i?[]:["disabled"]},{id:"separator",name:"",type:"separator"},{id:"delete-select-row",name:_.t("table.deleteSelectRow")},{id:"delete-select-col",name:_.t("table.deleteSelectCol")},{id:"separator",name:"",type:"separator"},{id:"table-config",name:_.t("table.tableConfigKey"),children:[{id:"row-title",name:_.t("table.tableConfig.rowTitle"),states:s?["checked"]:[]},{id:"col-title",name:_.t("table.tableConfig.colTitle"),states:o?["checked"]:[]},{id:"stripe-style",name:_.t("table.tableConfig.stripeStyle"),states:l?["checked"]:[]},{id:"hide-border",name:c?_.t("table.tableConfig.showBorder"):_.t("table.tableConfig.hideBorder"),value:c?"show-border":"hide-border"},{id:"show-chart",name:d?_.t("table.tableConfig.hideChart"):_.t("table.tableConfig.showChart"),value:d?"hide-chart":"show-chart"}]}]}handleRowTitle(t){p(ur,this.activeTableBlock,"no target table block"),t?yN(this.editor,this.activeTableBlock):BN(this.editor,this.activeTableBlock)}handleColTitle(t){p(ur,this.activeTableBlock,"no target table block"),t?vN(this.editor,this.activeTableBlock):bN(this.editor,this.activeTableBlock)}handleStripeStyle(t){p(ur,this.activeTableBlock,"no target table block"),t?kN(this.editor,this.activeTableBlock):TN(this.editor,this.activeTableBlock)}}function nR(n){n.addCustom("table-cell-menu",t=>new cV(t))}const rR=D("table-container");function iA(n){const t=n.closest("td");return p(rR,t,"no parent cell for a table cell container"),t}function iR(n){const t=cn(n);return Array.from(t.querySelectorAll(':scope > tbody > tr > td > [data-type="editor-container"].child'))}function sA(n,t,e,r){const i=Kt.fromBlock(n),s=i.getCellByContainerId(pt(t));if(e==="ArrowDown"){const o=i.getBottomCell(s);return o?o.container:null}if(e==="ArrowUp"){const o=i.getTopCell(s);return o?o.container:null}if(e==="ArrowLeft"){const o=i.getLeftCell(s);if(!o)return null;const l=o.container;return r!=null&&r.noWrap&&o.row!==s.row?null:l}if(e==="ArrowRight"){const o=i.getRightCell(s);if(!o)return null;const l=o.container;return r!=null&&r.noWrap&&o.row!==s.row?null:l}p(rR,!1,`invalid navigation type: ${e}`)}const uV=12,fV=90,og=23,sR=2;class dV{constructor(t){m(this,"scrollTableBlock",null);m(this,"autoScrollDir",null);m(this,"autoScrollTimer",null);m(this,"handleMouseDown",t=>{const e=Oe(t.clientX,t.clientY,{noFilter:!0});if(e&&e instanceof HTMLElement){const r=et(e);if(r&&Ce(this.editor.rootContainer,r)){const i=no(r);i&&(this.scrollTableBlock=i,document.addEventListener("mousemove",this.handleAutoScroll))}}});m(this,"handleAutoScroll",i9.default(t=>{if(this.scrollTableBlock){const e=this.editor.getCustom(ls(this.scrollTableBlock)),r=e.rootElement,i=e.scrollOptions.parentContainer,s=r.getBoundingClientRect(),o=window.innerHeight-this.getBarFloatWindowBottom(e),l=i.getBoundingClientRect(),c=Math.min(l.bottom,o),d=Math.max(l.top,0);s.bottom>c&&t.clientY>=c?this.setAutoScroll("bottom"):s.top<d&&t.clientY<=d?this.setAutoScroll("top"):r.scrollLeft>0&&t.clientX<s.left?this.setAutoScroll("left"):r.scrollLeft<r.scrollWidth-r.offsetWidth&&t.clientX>s.right?this.setAutoScroll("right"):this.clearAutoScroll()}},15));m(this,"handleMouseUp",()=>{document.removeEventListener("mousemove",this.handleAutoScroll),setTimeout(()=>{this.scrollTableBlock=null})});m(this,"handleSelectionChanged",t=>{const e=t.selection.range;if(e.isCollapsed()&&e.isSimple()){const r=t.getBlockById(e.start.blockId),i=no(r);if(i){const s=t.getCustom(ls(i)),o=s.rootElement.getBoundingClientRect(),l=Jo(t,r,e.start);if(o.left>l.left){const c=e.start.offset===0?uV:sR;s.rootElement.scrollLeft-=o.left-l.left+c}else if(l.right>o.right){const c=e.start.offset===0?fV:sR;s.rootElement.scrollLeft+=l.right-o.right+c}}}else{const r=t.getBlockById(e.start.blockId),i=no(r),s=t.getBlockById(e.end.blockId),o=no(s);if(i&&i===o){const l=t.getCustom(ls(i)),c=l.rootElement.getBoundingClientRect();let d=null;if(e.isSimple())d=e.isReverse()?Jo(t,r,e.start):Jo(t,s,e.end);else{const h=iA(gi(t,e.start.childContainerId)),C=iA(gi(t,e.end.childContainerId));d=e.isReverse()?h.getBoundingClientRect():C.getBoundingClientRect()}c.left>d.left&&e.isReverse()?l.rootElement.scrollLeft-=c.left-d.left:c.right<d.right&&!e.isReverse()&&(l.rootElement.scrollLeft+=d.right-c.right)}}});m(this,"handleScroll",t=>{kT(t),this.editor.selection.caret.update()});m(this,"handleReset",t=>{kT(t),this.editor.selection.caret.update();const e=this.editor.findCustom("table-border-bar");e&&e.handleScroll(),Yk(t)});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChanged),document.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mouseup",this.handleMouseUp)}getBarFloatWindowBottom(t){return t.scrollOptions.barFloatWindowBottom?typeof t.scrollOptions.barFloatWindowBottom=="number"?t.scrollOptions.barFloatWindowBottom:t.scrollOptions.barFloatWindowBottom():0}clearAutoScroll(){this.autoScrollTimer&&(clearInterval(this.autoScrollTimer),this.autoScrollTimer=null,this.autoScrollDir=null)}setAutoScroll(t){this.autoScrollDir&&this.autoScrollDir!==t&&this.clearAutoScroll(),this.autoScrollTimer||(this.autoScrollDir=t,this.autoScrollTimer=window.setInterval(()=>{if(this.scrollTableBlock){const e=this.editor.getCustom(ls(this.scrollTableBlock)),r=e.rootElement,i=e.scrollOptions.parentContainer,s=r.getBoundingClientRect(),o=i===document.documentElement?window.innerHeight:i.offsetHeight,l=window.innerHeight-this.getBarFloatWindowBottom(e),c=i.getBoundingClientRect(),d=Math.min(c.bottom,l),h=Math.max(c.top,0);this.autoScrollDir==="left"&&(r.scrollLeft-=og,r.scrollLeft<=0&&this.clearAutoScroll()),this.autoScrollDir==="right"&&(r.scrollLeft+=og,r.scrollLeft>=r.scrollWidth-r.offsetWidth&&this.clearAutoScroll()),this.autoScrollDir==="bottom"&&(i.scrollTop+=og,(i.scrollTop>=i.scrollHeight-o||s.bottom<=d)&&this.clearAutoScroll()),this.autoScrollDir==="top"&&(i.scrollTop-=og,(i.scrollTop<=0||s.top>=h)&&this.clearAutoScroll())}},100))}destroy(){document.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mouseup",this.handleMouseUp),this.editor.removeListener("selectionChanged",this.handleSelectionChanged)}}function oR(n){return n.addCustom("table-scroll-events",t=>new dV(t))}const hV=D("table-doc-change-handler");class mV{constructor(t){this.editor=t,this.editor.addListener("docChanged",this.handleDocChanged)}handleDocChanged(t,e){if(!e){const{start:r,end:i}=t.selection.range;if(!t.findBlockById(r.blockId)||!t.findBlockById(i.blockId)){t.selection.selectBlock(t.getBlockByIndex("root",0),0);return}if(fa(r)){const s=t.getBlockById(r.blockId);if(!un(s))return;if(p(hV,fa(i),"invalid range"),!kf(t,r.childContainerId)||!kf(t,i.childContainerId)){t.selection.selectBlock(s,0);return}let o=null,l=null;const c=(d,h)=>{const C=h.getCellById(d.childContainerId),{colIndex:E=0,rowIndex:A=0}=d.custom;let v=-1,S=-1;return(C.col>E||C.col+C.colSpan-1<E)&&(v=C.col),(C.row>A||C.row+C.rowSpan-1<A)&&(S=C.row),v!==-1||S!==-1?_e(s,d.childContainerId,{colIndex:v===-1?E:v,rowIndex:S===-1?A:S}):null};if(r.custom){const d=Kt.fromBlock(s);o=c(r,d),l=c(i,d)}(o!==null||l!==null)&&(t.selection.range.isReverse()?t.selection.setSelection(l!=null?l:i,o!=null?o:r):t.selection.setSelection(o!=null?o:r,l!=null?l:i))}}}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged)}}function lR(n){n.addCustom("table-doc-change-handler",t=>new mV(t))}const us=D("create-content");function aR(n,t,e){var C;const r=new Dm(e),i=e.rows,s=e.cols;p(us,i>=1,`invalid rows: ${i}`),p(us,s>=1,`invalid cols: ${s}`),p(us,e.children,"no table children");const o=B("table",[],null),l=(C=e.colsWidth)!=null?C:new Array(e.cols).fill(0),c=B("colgroup",[],o);for(let E=0;E<r.colCount;E++){const A=B("col",[],c);l[E]&&(A.style.width=`${l[E]}px`,A.style.minWidth=`${l[E]}px`)}const d=B("tbody",[],o);let h=0;for(let E=0;E<i;E++){const A=B("tr",[],d);for(let v=0;v<s;v++){const S=r.getCell({col:v,row:E});if(S.virtual)p(us,S.colSpan>1||S.rowSpan>1,"virtual cell should have colSpan or rowSpan");else{const w=e.children[h],O=B("td",[],A);S.colSpan>1&&(O.colSpan=S.colSpan),S.rowSpan>1&&(O.rowSpan=S.rowSpan);const M=e[Ad(w)];M&&q(O,M),v===0&&e.hasColTitle&&q(O,DT.COL_TITLE_ITEM),n.createChildContainer(t,O,w),h+=1}}}return p(us,h===e.children.length,"container count mismatch"),o.style.minWidth=`${l.reduce((E,A)=>A+E,0)}px`,e.noBorder&&q(o,"no-border"),e.chart&&q(o,"editor-table-chart"),e.isStripeStyle&&q(o,"stripe"),e.hasRowTitle&&q(o,"row-title"),e.hasColTitle&&q(o,"col-title"),o}function gV(n,t,e,r,i){p(us,i.type==="table","not table data"),p(us,pt(e)===t[t.length-1].containerId,"invalid path");const s=i,o=ca(r,"div");try{const l=B("div",[],null);l.setAttribute("data-type","table-content");const c=aR(n,t,s);c.classList.add("drag-preview-element"),l.appendChild(c);const d=n.getComponentOptions("table");QT(n),tk(n),eR(n,"create"),lR(n),d!=null&&d.hideCellMenu||nR(n),c2(n,yE);const h=n.addCustom(ls(r),()=>eP());h.init({parentElement:o,childElement:l,safeRightSpace:50,safeLeftSpace:40,parentContainer:re(e)?n.scrollContainer:e,locatingContainer:re(e)?(d==null?void 0:d.locatingContainer)||n.parent:e,paddingLeft:cu+Ed,paddingTop:cu+Ed,paddingBottom:Ed/2,paddingRight:Ed/2,barFloatWindowBottom:d==null?void 0:d.barFloatWindowBottom,allowScrollBarFixed:d==null?void 0:d.allowScrollBarFixed,isSetScale:d==null?void 0:d.isSetScale});const C=oR(n);h.on("scroll",C.handleReset),h.on("resize",C.handleReset),setTimeout(()=>{_N(n,r)})}catch{const c=`invalid table data: ${JSON.stringify(s)}`;us.error(c);const d=B("div",["error"],o);d.innerText=c}return o}function pV(n,t,e){p(us,e.type==="table","not table data");const r=e,i=zt(t);try{const s=cn(t),o=Zo(t),l=aR(n,o,r);l.classList.add("drag-preview-element"),s.insertAdjacentElement("afterend",l),s.remove();const c=n.getComponentOptions("table");QT(n),tk(n),eR(n,"update"),lR(n),c!=null&&c.hideCellMenu||nR(n),yE(n,void 0,t)}catch{const o=`invalid table data: ${JSON.stringify(r)}`;us.error(o);const l=B("div",["error"],i);l.innerText=o}}function CV(n,t){let e,r,i=!1;if([...t].every(E=>E==="|")?(r=t.length,e=Array(r).fill(""),i=!0):(e=Np(t,"|").split("|"),r=e.length),r<2)return null;const s=3,o=r,l=[];for(let E=0;E<3;E++)e.forEach(A=>{l.push(Xs(n.doc,E===0?A:""))});const c=Array(o).fill(RE),d=l[i?0:o],h=n.doc.getContainerBlocks(d)[0].id;return{blockData:{id:it(),type:"table",rows:s,cols:o,children:l,colsWidth:c},focusBlockId:h}}function EV(n,t){const e=t.rows,r=t.cols;if(e<1||r<1)return null;const i=[];for(let d=0;d<e;d++)for(let h=0;h<r;h++)i.push(Xs(n.doc));const s=Array(r).fill(RE),o=i[0],l=n.doc.getContainerBlocks(o)[0].id;return{blockData:{id:it(),type:"table",rows:e,cols:r,children:i,colsWidth:s},focusBlockId:l}}const oA=D("get-selected-containers");function cR(n,t,e,r){p(oA,e.blockId===r.blockId,"only allow select in single table block"),p(oA,dt(t)===e.blockId,"only allow select in single table block");const i=Kt.fromBlock(t),s=i.getCellByContainerId(e.childContainerId),o=i.getCellByContainerId(r.childContainerId);if(e.custom===void 0||r.custom===void 0)return i.getCells(s,o).map(w=>i.getCellContainer(w));const{fromCol:l,toCol:c,fromRow:d,toRow:h}=Si(t,e,r),C=new Set,E=[];return i.sub({row:d,col:l},{row:h,col:c}).forEach(v=>{v.forEach(S=>{const w=i.getCellByContainerId(S.containerId);w.col<l||w.row<d||w.col+w.colSpan-1>c||w.row+w.rowSpan-1>h||C.has(S.containerId)||(C.add(S.containerId),E.push(w.container))})}),E}function AV(n,t,e){p(oA,t.blockId===e.blockId,"only allow select in single table block");const r=n.getBlockById(t.blockId);return cR(n,r,t,e)}const uR=D("table-selection-to-doc");function xV(n,t){const{start:e,end:r,block:i}=t,s=Ot(i);p(uR,s==="table",`invalid block type: ${s}`);const o=n.getBlockData(i);if(e.isSimple()&&r.isSimple())return sl(n.editorBlocks,n.doc.toJSON(),o);p(uR,!e.isSimple()&&!r.isSimple(),"invalid block pos type");const l=Kt.fromBlock(i),{fromCol:c,toCol:d,fromRow:h,toRow:C}=Si(i,e,r),E={},A=[],v=n.doc.toJSON();let S={};l.sub({row:h,col:c},{row:C,col:d}).forEach((X,ut)=>{X.forEach((xt,bt)=>{const wt=xt.containerId;if(A.indexOf(wt)!==-1)return;A.push(wt);let Tt;if(xt.virtual){const fe=l.getCellByContainerId(xt.containerId),Lr=c+bt;let fr=fe.col+fe.colSpan-1;fr>d&&(fr=d);const He=fr-Lr+1;He>1&&(E[`${wt}_colSpan`]=He);const yn=h+ut;let Zn=fe.row+fe.rowSpan-1;Zn>C&&(Zn=C);const dr=Zn-yn+1;dr>1&&(E[`${wt}_rowSpan`]=dr),Tt=qs()}else{if(Tt=nC(n.editorBlocks,v,wt),xt.col+xt.colSpan>d+1){const fe=d-xt.col+1;fe>1&&(E[`${wt}_colSpan`]=fe)}else xt.colSpan>1&&(E[`${wt}_colSpan`]=xt.colSpan);if(xt.row+xt.rowSpan>C+1){const fe=C-xt.row+1;fe>1&&(E[`${wt}_rowSpan`]=fe)}else xt.rowSpan>1&&(E[`${wt}_rowSpan`]=xt.rowSpan)}const{root:ie,...Ee}=Tt.blocks;S={...S,...Ee,[wt]:ie}})});const O=yd(cn(i)).slice(c,d+1);return{blocks:{root:[{id:it(),type:s,children:A,colsWidth:O,rows:C-h+1,cols:d-c+1,...E}],...S},meta:{},comments:{}}}const bV=D("ajust-selection-pos");function vV(n,t){if(t.top===0)return!0;for(let e=t.left;e<=t.right;e++)if(n[t.top-1][e]===n[t.top][e])return!1;return!0}function BV(n,t){if(t.left===0)return!0;for(let e=t.top;e<=t.bottom;e++)if(n[e][t.left-1]===n[e][t.left])return!1;return!0}function yV(n,t){if(t.bottom===n.length-1)return!0;for(let e=t.left;e<=t.right;e++)if(n[t.bottom][e]===n[t.bottom+1][e])return!1;return!0}function TV(n,t){if(t.right===n[0].length-1)return!0;for(let e=t.top;e<=t.bottom;e++)if(n[e][t.right]===n[e][t.right+1])return!1;return!0}function kV(n,t,e){const r=t.col,i=t.row,s=e.col,o=e.row,l={left:r,top:i,right:s,bottom:o};let c=!1;do{if(c=!1,!vV(n,l)){l.top--,c=!0;continue}if(!BV(n,l)){l.left--,c=!0;continue}if(!yV(n,l)){l.bottom++,c=!0;continue}if(!TV(n,l)){l.right++,c=!0;continue}}while(c);return l}function RV(n,t,e,r){if(e.custom!==void 0||r.custom!==void 0)return{anchor:e,focus:r};const i=Kt.fromBlock(t),s=i.map(V=>V.containerId),o=i.getCellByContainerId(e.childContainerId),l=i.getCellByContainerId(r.childContainerId),c=Math.min(o.row,l.row),d=Math.max(o.row,l.row),h=Math.min(o.col,l.col),C=Math.max(o.col,l.col),E=kV(s,{row:c,col:h},{row:d,col:C}),A=i.getCell({row:E.top,col:E.left}),v=i.getCell({row:E.bottom,col:E.right}),S=i.getCell({row:E.top,col:E.right}),w=i.getCell({row:E.bottom,col:E.left});let O,M;return o.row<=l.row?o.col<=l.col?(O=A,M=v):(O=S,M=w):o.col<l.col?(O=w,M=S):(O=v,M=A),bV.debug(`move ${O.col}, ${O.row}, -> ${M.col}, ${M.row}`),{anchor:_e(t,O.containerId),focus:_e(t,M.containerId)}}function fR(n,t,e){if(e.isSimple())return[cn(t).getBoundingClientRect()];const r=cn(t),i=r.getBoundingClientRect(),{fromCol:s,fromRow:o,toCol:l,toRow:c}=Si(t,e.start,e.end),d=yd(r),h=d.slice(0,s).reduce((S,w)=>S+w,0),C=h+d.slice(s,l+1).reduce((S,w)=>S+w,0),E=Xk(r);let A=E.slice(0,o).reduce((S,w)=>S+w,0);const v=A+E.slice(o,c+1).reduce((S,w)=>S+w,0);if(o===0){const S=rV(n,t);A-=S}return[new DOMRect(i.left+h,i.top+A,C-h,v-A)]}D("table-size");const wV=40;function lg(n){const t=n.querySelector("td");if(!t)return 0;const e=window.getComputedStyle(t),r=Number.parseInt(e.borderLeft,10),i=Number.parseInt(e.borderRight,10);return(r+i)/2}function SV(n,t,e){const r=f1(n,e.container);return r!==void 0?r+lg(t):wV*e.colSpan-lg(t)}function LV(n,t,e,r){let i=0;const s=e.colCount;for(let o=0;o<s;o++){const l=e.getCell({col:o,row:r});if(l.virtual)continue;let c=SV(n,t,l);const d=n3(l.container,{withPadding:!0});d&&d>c&&(c=d),i+=c+lg(t)}return i}function IV(n,t){const e=cn(t),r=Kt.fromTable(e);let i=0;for(let o=0;o<r.rowCount;o++)i=Math.max(i,LV(n,e,r,o));const s=lg(e);return i+=s,i}const ro=D("table-creator");async function DV(n,t){return n.undoManager.runInGroup(()=>{var c,d;const e=t.item,r=(c=e.colCount)!=null?c:5,i=(d=e.rowCount)!=null?d:3,s=EV(n,{cols:r,rows:i});if(!s)return null;const{blockData:o,focusBlockId:l}=s;return n.insertBlock(t.containerId,t.blockIndex,o,Pe(n,l,0))})}class _V{constructor(){m(this,"id","insert-table");m(this,"name","Create table");m(this,"element");m(this,"closeable",null);m(this,"colCount");m(this,"rowCount");m(this,"setCloseable",t=>{this.closeable=t});m(this,"destroy",()=>{this.closeable=null});m(this,"getTableCreatorCellId",(t,e)=>`table-creator-cell-${t}-${e}`);m(this,"handleTableCreatorClick",t=>{var E,A;t.preventDefault(),t.stopPropagation();const e=t.target;p(ro,e instanceof HTMLElement,"invalid event target");const r=e.closest(".table-creator");p(ro,r,"no table creator");const i=r.querySelectorAll(".active");if(i.length===0)return;const o=i[i.length-1].id;p(ro,o,"no cell id");const l="table-creator-cell-";if(!o.startsWith(l))return;const d=o.substring(l.length).split("-");p(ro,d.length===2,"invalid cell id");const h=Number.parseInt(d[0],10)+1,C=Number.parseInt(d[1],10)+1;ro.debug(`${h}, ${C}`),this.colCount=C,this.rowCount=h,(E=this.closeable)==null||E.click(this,this.element),(A=this.closeable)==null||A.close("clickItem"),this.handleTableCreatorLeave()});m(this,"handleTableCreatorLeave",()=>{for(let t=0;t<9;t++)for(let e=0;e<9;e++){const r=this.getTableCreatorCellId(t,e),i=document.getElementById(r);i&&ct(i,"active")}});m(this,"handleTableCreatorCellEnter",t=>{const e=t.target;p(ro,e instanceof HTMLElement,"invalid event target");const r=e.id,i="table-creator-cell-";p(ro,r.startsWith(i),"invalid cell id");const o=r.substring(i.length).split("-");p(ro,o.length===2,"invalid cell id");let l=Number.parseInt(o[0],10),c=Number.parseInt(o[1],10);l===0&&c===0&&(l=-1,c=-1);for(let d=0;d<9;d++)for(let h=0;h<9;h++){const C=this.getTableCreatorCellId(d,h),E=document.getElementById(C);p(ro,E,"no cell"),d<=l&&h<=c?q(E,"active"):ct(E,"active")}});this.element=this.createTableCreatorElement()}createTableCreatorElement(){const t=B("div",["table-creator"],null),e=(r,i,s)=>{const o=B("div",["table-creator-cell"],r);return o.id=this.getTableCreatorCellId(i,s),o};t.addEventListener("click",this.handleTableCreatorClick),t.addEventListener("mouseleave",this.handleTableCreatorLeave);for(let r=0;r<9;r++){const i=B("div",["table-creator-row"],t);for(let s=0;s<9;s++)e(i,r,s).addEventListener("mouseenter",this.handleTableCreatorCellEnter)}return t}}function MV(){return new _V}function UV(n){const t=/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/g,e=n.match(t);return e?e.length:0}function dR(n){const t=UV(n);return n.length+t}function OV(n,t,e=[]){let r=0;if(!e||e.length===0)return r;for(let i=n;i<n+t;i+=1)r+=e[i]||0;return r}function NV(n,t){const e=dR(n),r=t-e;return r>0?n+" ".repeat(r):n}function PV(n,t,e,r,i){var l;const s=t,o=new Dm(s);if(r==="markdown"||r==="text"){const c=O=>e.blocks[O].map((nt,Y)=>r==="markdown"?j0(n,nt,e,[...i,{containerId:O,blockIndex:Y}]):H0(n,nt,e,[...i,{containerId:O,blockIndex:Y}])),d=O=>c(O).join(" ").replace(/\n/g," ").trim(),h=new Map,C=new Map;for(let O=0;O<o.colCount;O++){let M=0;for(let V=0;V<o.rowCount;V++){const nt=o.getCell({row:V,col:O});let Y="";nt.virtual||(Y=d(nt.containerId)),h.set(`${V},${O}`,Y),M=Math.max(M,dR(Y))}C.set(O,M)}const E=O=>{const M=h.get(`${O.row},${O.col}`)||"",V=C.get(O.col)||0;return NV(M,V)};if(r==="text"){const O=[];for(let M=0;M<o.colCount;M++){const V=E({row:0,col:M});O.push(V)}for(let M=1;M<o.rowCount;M++)for(let V=0;V<o.colCount;V++){const nt=E({row:M,col:V});O.push(nt)}return O.join(`
|
|
642
|
+
}`;var Wt=T6(function(){return se(L,kt+"return "+st).apply(e,P)});if(Wt.source=st,fb(Wt))throw Wt;return Wt}function Est(a){return pe(a).toLowerCase()}function Ast(a){return pe(a).toUpperCase()}function xst(a,u,g){if(a=pe(a),a&&(g||u===e))return wo(a);if(!a||!(u=Pr(u)))return a;var x=Nr(a),y=Nr(u),L=oc(x,y),P=Uh(x,y)+1;return ql(x,L,P).join("")}function bst(a,u,g){if(a=pe(a),a&&(g||u===e))return a.slice(0,rf(a)+1);if(!a||!(u=Pr(u)))return a;var x=Nr(a),y=Uh(x,Nr(u))+1;return ql(x,0,y).join("")}function vst(a,u,g){if(a=pe(a),a&&(g||u===e))return a.replace(ja,"");if(!a||!(u=Pr(u)))return a;var x=Nr(a),y=oc(x,Nr(u));return ql(x,y).join("")}function Bst(a,u){var g=wt,x=Tt;if(je(u)){var y="separator"in u?u.separator:y;g="length"in u?jt(u.length):g,x="omission"in u?Pr(u.omission):x}a=pe(a);var L=a.length;if(So(a)){var P=Nr(a);L=P.length}if(g>=L)return a;var K=g-Hl(x);if(K<1)return x;var H=P?ql(P,0,K).join(""):a.slice(0,K);if(y===e)return H+x;if(P&&(K+=H.length-K),db(y)){if(a.slice(K).search(y)){var Z,tt=H;for(y.global||(y=af(y.source,pe(Ml.exec(y))+"g")),y.lastIndex=0;Z=y.exec(tt);)var st=Z.index;H=H.slice(0,st===e?K:st)}}else if(a.indexOf(Pr(y),K)!=K){var Et=H.lastIndexOf(y);Et>-1&&(H=H.slice(0,Et))}return H+x}function yst(a){return a=pe(a),a&&Vu.test(a)?a.replace(Ku,sf):a}var Tst=uf(function(a,u,g){return a+(g?" ":"")+u.toUpperCase()}),gb=kL("toUpperCase");function y6(a,u,g){return a=pe(a),u=g?e:u,u===e?tf(a)?Gg(a):ee(a):a.match(u)||[]}var T6=qt(function(a,u){try{return Nn(a,e,u)}catch(g){return fb(g)?g:new Nt(g)}}),kst=$o(function(a,u){return Gn(u,function(g){g=Us(g),Ko(a,g,cb(a[g],a))}),a});function Rst(a){var u=a==null?0:a.length,g=It();return a=u?ft(a,function(x){if(typeof x[1]!="function")throw new er(o);return[g(x[0]),x[1]]}):[],qt(function(x){for(var y=-1;++y<u;){var L=a[y];if(Nn(L[0],this,x))return Nn(L[1],this,x)}})}function wst(a){return Qtt(ai(a,C))}function pb(a){return function(){return a}}function Sst(a,u){return a==null||a!==a?u:a}var Lst=wL(),Ist=wL(!0);function br(a){return a}function Cb(a){return iL(typeof a=="function"?a:ai(a,C))}function Dst(a){return oL(ai(a,C))}function _st(a,u){return lL(a,ai(u,C))}var Mst=qt(function(a,u){return function(g){return zh(g,a,u)}}),Ust=qt(function(a,u){return function(g){return zh(a,g,u)}});function Eb(a,u,g){var x=Sn(u),y=rp(u,x);g==null&&!(je(u)&&(y.length||!x.length))&&(g=u,u=a,a=this,y=rp(u,Sn(u)));var L=!(je(g)&&"chain"in g)||!!g.chain,P=jo(a);return Gn(y,function(K){var H=u[K];a[K]=H,P&&(a.prototype[K]=function(){var Z=this.__chain__;if(L||Z){var tt=a(this.__wrapped__),st=tt.__actions__=Er(this.__actions__);return st.push({func:H,args:arguments,thisArg:a}),tt.__chain__=Z,tt}return H.apply(a,$t([this.value()],arguments))})}),a}function Ost(){return Xe._===this&&(Xe._=qg),this}function Ab(){}function Nst(a){return a=jt(a),qt(function(u){return aL(u,a)})}var Pst=Yx(ft),Fst=Yx(N),Kst=Yx(we);function k6(a){return rb(a)?Vi(Us(a)):get(a)}function Vst(a){return function(u){return a==null?e:yc(a,u)}}var $st=LL(),Hst=LL(!0);function xb(){return[]}function bb(){return!1}function jst(){return{}}function zst(){return""}function Gst(){return!0}function Wst(a,u){if(a=jt(a),a<1||a>yn)return[];var g=hr,x=U(a,hr);u=It(u),a-=hr;for(var y=Zu(x,u);++g<a;)u(g);return y}function qst(a){return Vt(a)?ft(a,Us):Fr(a)?[a]:Er(GL(pe(a)))}function Xst(a){var u=++Wg;return pe(a)+u}var Yst=cp(function(a,u){return a+u},0),Qst=Qx("ceil"),Jst=cp(function(a,u){return a/u},1),Zst=Qx("floor");function tot(a){return a&&a.length?np(a,br,Ox):e}function eot(a,u){return a&&a.length?np(a,It(u,2),Ox):e}function not(a){return Ro(a,br)}function rot(a,u){return Ro(a,It(u,2))}function iot(a){return a&&a.length?np(a,br,Kx):e}function sot(a,u){return a&&a.length?np(a,It(u,2),Kx):e}var oot=cp(function(a,u){return a*u},1),lot=Qx("round"),aot=cp(function(a,u){return a-u},0);function cot(a){return a&&a.length?Ju(a,br):0}function uot(a,u){return a&&a.length?Ju(a,It(u,2)):0}return R.after=Drt,R.ary=r6,R.assign=Ait,R.assignIn=C6,R.assignInWith=vp,R.assignWith=xit,R.at=bit,R.before=i6,R.bind=cb,R.bindAll=kst,R.bindKey=s6,R.castArray=jrt,R.chain=t6,R.chunk=Zet,R.compact=tnt,R.concat=ent,R.cond=Rst,R.conforms=wst,R.constant=pb,R.countBy=crt,R.create=vit,R.curry=o6,R.curryRight=l6,R.debounce=a6,R.defaults=Bit,R.defaultsDeep=yit,R.defer=_rt,R.delay=Mrt,R.difference=nnt,R.differenceBy=rnt,R.differenceWith=int,R.drop=snt,R.dropRight=ont,R.dropRightWhile=lnt,R.dropWhile=ant,R.fill=cnt,R.filter=frt,R.flatMap=mrt,R.flatMapDeep=grt,R.flatMapDepth=prt,R.flatten=YL,R.flattenDeep=unt,R.flattenDepth=fnt,R.flip=Urt,R.flow=Lst,R.flowRight=Ist,R.fromPairs=dnt,R.functions=Iit,R.functionsIn=Dit,R.groupBy=Crt,R.initial=mnt,R.intersection=gnt,R.intersectionBy=pnt,R.intersectionWith=Cnt,R.invert=Mit,R.invertBy=Uit,R.invokeMap=Art,R.iteratee=Cb,R.keyBy=xrt,R.keys=Sn,R.keysIn=xr,R.map=pp,R.mapKeys=Nit,R.mapValues=Pit,R.matches=Dst,R.matchesProperty=_st,R.memoize=Ep,R.merge=Fit,R.mergeWith=E6,R.method=Mst,R.methodOf=Ust,R.mixin=Eb,R.negate=Ap,R.nthArg=Nst,R.omit=Kit,R.omitBy=Vit,R.once=Ort,R.orderBy=brt,R.over=Pst,R.overArgs=Nrt,R.overEvery=Fst,R.overSome=Kst,R.partial=ub,R.partialRight=c6,R.partition=vrt,R.pick=$it,R.pickBy=A6,R.property=k6,R.propertyOf=Vst,R.pull=bnt,R.pullAll=JL,R.pullAllBy=vnt,R.pullAllWith=Bnt,R.pullAt=ynt,R.range=$st,R.rangeRight=Hst,R.rearg=Prt,R.reject=Trt,R.remove=Tnt,R.rest=Frt,R.reverse=lb,R.sampleSize=Rrt,R.set=jit,R.setWith=zit,R.shuffle=wrt,R.slice=knt,R.sortBy=Irt,R.sortedUniq=_nt,R.sortedUniqBy=Mnt,R.split=mst,R.spread=Krt,R.tail=Unt,R.take=Ont,R.takeRight=Nnt,R.takeRightWhile=Pnt,R.takeWhile=Fnt,R.tap=trt,R.throttle=Vrt,R.thru=gp,R.toArray=m6,R.toPairs=x6,R.toPairsIn=b6,R.toPath=qst,R.toPlainObject=p6,R.transform=Git,R.unary=$rt,R.union=Knt,R.unionBy=Vnt,R.unionWith=$nt,R.uniq=Hnt,R.uniqBy=jnt,R.uniqWith=znt,R.unset=Wit,R.unzip=ab,R.unzipWith=ZL,R.update=qit,R.updateWith=Xit,R.values=hf,R.valuesIn=Yit,R.without=Gnt,R.words=y6,R.wrap=Hrt,R.xor=Wnt,R.xorBy=qnt,R.xorWith=Xnt,R.zip=Ynt,R.zipObject=Qnt,R.zipObjectDeep=Jnt,R.zipWith=Znt,R.entries=x6,R.entriesIn=b6,R.extend=C6,R.extendWith=vp,Eb(R,R),R.add=Yst,R.attempt=T6,R.camelCase=tst,R.capitalize=v6,R.ceil=Qst,R.clamp=Qit,R.clone=zrt,R.cloneDeep=Wrt,R.cloneDeepWith=qrt,R.cloneWith=Grt,R.conformsTo=Xrt,R.deburr=B6,R.defaultTo=Sst,R.divide=Jst,R.endsWith=est,R.eq=zi,R.escape=nst,R.escapeRegExp=rst,R.every=urt,R.find=drt,R.findIndex=qL,R.findKey=Tit,R.findLast=hrt,R.findLastIndex=XL,R.findLastKey=kit,R.floor=Zst,R.forEach=e6,R.forEachRight=n6,R.forIn=Rit,R.forInRight=wit,R.forOwn=Sit,R.forOwnRight=Lit,R.get=hb,R.gt=Yrt,R.gte=Qrt,R.has=_it,R.hasIn=mb,R.head=QL,R.identity=br,R.includes=Ert,R.indexOf=hnt,R.inRange=Jit,R.invoke=Oit,R.isArguments=Rc,R.isArray=Vt,R.isArrayBuffer=Jrt,R.isArrayLike=Ar,R.isArrayLikeObject=rn,R.isBoolean=Zrt,R.isBuffer=Xl,R.isDate=tit,R.isElement=eit,R.isEmpty=nit,R.isEqual=rit,R.isEqualWith=iit,R.isError=fb,R.isFinite=sit,R.isFunction=jo,R.isInteger=u6,R.isLength=xp,R.isMap=f6,R.isMatch=oit,R.isMatchWith=lit,R.isNaN=ait,R.isNative=cit,R.isNil=fit,R.isNull=uit,R.isNumber=d6,R.isObject=je,R.isObjectLike=Qe,R.isPlainObject=Qh,R.isRegExp=db,R.isSafeInteger=dit,R.isSet=h6,R.isString=bp,R.isSymbol=Fr,R.isTypedArray=df,R.isUndefined=hit,R.isWeakMap=mit,R.isWeakSet=git,R.join=Ent,R.kebabCase=ist,R.last=ui,R.lastIndexOf=Ant,R.lowerCase=sst,R.lowerFirst=ost,R.lt=pit,R.lte=Cit,R.max=tot,R.maxBy=eot,R.mean=not,R.meanBy=rot,R.min=iot,R.minBy=sot,R.stubArray=xb,R.stubFalse=bb,R.stubObject=jst,R.stubString=zst,R.stubTrue=Gst,R.multiply=oot,R.nth=xnt,R.noConflict=Ost,R.noop=Ab,R.now=Cp,R.pad=lst,R.padEnd=ast,R.padStart=cst,R.parseInt=ust,R.random=Zit,R.reduce=Brt,R.reduceRight=yrt,R.repeat=fst,R.replace=dst,R.result=Hit,R.round=lot,R.runInContext=$,R.sample=krt,R.size=Srt,R.snakeCase=hst,R.some=Lrt,R.sortedIndex=Rnt,R.sortedIndexBy=wnt,R.sortedIndexOf=Snt,R.sortedLastIndex=Lnt,R.sortedLastIndexBy=Int,R.sortedLastIndexOf=Dnt,R.startCase=gst,R.startsWith=pst,R.subtract=aot,R.sum=cot,R.sumBy=uot,R.template=Cst,R.times=Wst,R.toFinite=zo,R.toInteger=jt,R.toLength=g6,R.toLower=Est,R.toNumber=fi,R.toSafeInteger=Eit,R.toString=pe,R.toUpper=Ast,R.trim=xst,R.trimEnd=bst,R.trimStart=vst,R.truncate=Bst,R.unescape=yst,R.uniqueId=Xst,R.upperCase=Tst,R.upperFirst=gb,R.each=e6,R.eachRight=n6,R.first=QL,Eb(R,function(){var a={};return _s(R,function(u,g){oe.call(R.prototype,g)||(a[g]=u)}),a}(),{chain:!1}),R.VERSION=r,Gn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){R[a].placeholder=R}),Gn(["drop","take"],function(a,u){Yt.prototype[a]=function(g){g=g===e?1:I(jt(g),0);var x=this.__filtered__&&!u?new Yt(this):this.clone();return x.__filtered__?x.__takeCount__=U(g,x.__takeCount__):x.__views__.push({size:U(g,hr),type:a+(x.__dir__<0?"Right":"")}),x},Yt.prototype[a+"Right"]=function(g){return this.reverse()[a](g).reverse()}}),Gn(["filter","map","takeWhile"],function(a,u){var g=u+1,x=g==fe||g==fr;Yt.prototype[a]=function(y){var L=this.clone();return L.__iteratees__.push({iteratee:It(y,3),type:g}),L.__filtered__=L.__filtered__||x,L}}),Gn(["head","last"],function(a,u){var g="take"+(u?"Right":"");Yt.prototype[a]=function(){return this[g](1).value()[0]}}),Gn(["initial","tail"],function(a,u){var g="drop"+(u?"":"Right");Yt.prototype[a]=function(){return this.__filtered__?new Yt(this):this[g](1)}}),Yt.prototype.compact=function(){return this.filter(br)},Yt.prototype.find=function(a){return this.filter(a).head()},Yt.prototype.findLast=function(a){return this.reverse().find(a)},Yt.prototype.invokeMap=qt(function(a,u){return typeof a=="function"?new Yt(this):this.map(function(g){return zh(g,a,u)})}),Yt.prototype.reject=function(a){return this.filter(Ap(It(a)))},Yt.prototype.slice=function(a,u){a=jt(a);var g=this;return g.__filtered__&&(a>0||u<0)?new Yt(g):(a<0?g=g.takeRight(-a):a&&(g=g.drop(a)),u!==e&&(u=jt(u),g=u<0?g.dropRight(-u):g.take(u-a)),g)},Yt.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Yt.prototype.toArray=function(){return this.take(hr)},_s(Yt.prototype,function(a,u){var g=/^(?:filter|find|map|reject)|While$/.test(u),x=/^(?:head|last)$/.test(u),y=R[x?"take"+(u=="last"?"Right":""):u],L=x||/^find/.test(u);!y||(R.prototype[u]=function(){var P=this.__wrapped__,K=x?[1]:arguments,H=P instanceof Yt,Z=K[0],tt=H||Vt(P),st=function(Jt){var ne=y.apply(R,$t([Jt],K));return x&&Et?ne[0]:ne};tt&&g&&typeof Z=="function"&&Z.length!=1&&(H=tt=!1);var Et=this.__chain__,kt=!!this.__actions__.length,Dt=L&&!Et,Wt=H&&!kt;if(!L&&tt){P=Wt?P:new Yt(this);var _t=a.apply(P,K);return _t.__actions__.push({func:gp,args:[st],thisArg:e}),new Cr(_t,Et)}return Dt&&Wt?a.apply(this,K):(_t=this.thru(st),Dt?x?_t.value()[0]:_t.value():_t)})}),Gn(["pop","push","shift","sort","splice","unshift"],function(a){var u=uc[a],g=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",x=/^(?:pop|shift)$/.test(a);R.prototype[a]=function(){var y=arguments;if(x&&!this.__chain__){var L=this.value();return u.apply(Vt(L)?L:[],y)}return this[g](function(P){return u.apply(Vt(P)?P:[],y)})}}),_s(Yt.prototype,function(a,u){var g=R[u];if(g){var x=g.name+"";oe.call(Pn,x)||(Pn[x]=[]),Pn[x].push({name:u,func:g})}}),Pn[ap(e,O).name]=[{name:"wrapper",func:e}],Yt.prototype.clone=vtt,Yt.prototype.reverse=Btt,Yt.prototype.value=ytt,R.prototype.at=ert,R.prototype.chain=nrt,R.prototype.commit=rrt,R.prototype.next=irt,R.prototype.plant=ort,R.prototype.reverse=lrt,R.prototype.toJSON=R.prototype.valueOf=R.prototype.value=art,R.prototype.first=R.prototype.head,Cc&&(R.prototype[Cc]=srt),R},Do=lf();ii?((ii.exports=Do)._=Do,tc._=Do):Xe._=Do}).call(Bn)})(Di,Di.exports);function _K(n,t,e,r){Im(n,{className:"status-input",defaultValue:t,onChange:e,onKeyDown:r,maxLength:32})}const Kk=["Blue","Grey","Yellow","Red","Green","Purple"];function MK(){const n=B("div",["status-color-palette"],null);for(const t of Kk){const e=B("button",["status-box-button"],null);e.setAttribute("data-color",Di.exports.lowerCase(t)),e.setAttribute("title",_.t(`status.color.${Di.exports.lowerCase(t)}`)),n.appendChild(e)}return n}class UK{constructor(){m(this,"root",MK());m(this,"changeColor",t=>{for(const r of Array.from(this.root.querySelectorAll(":scope > button")))r.classList.remove("selected");const e=this.root.querySelector(`button[data-color="${Di.exports.lowerCase(t)}"]`);e==null||e.classList.add("selected")})}}function Vk(n){localStorage.setItem(`statusBox.lastColor.${Di.exports.lowerCase(n.color)}`,n.title)}function $k(n){var t;return(t=localStorage.getItem(`statusBox.lastColor.${Di.exports.lowerCase(n)}`))!=null?t:_.t(`status.colorDefaultTitle.${Di.exports.lowerCase(n)}`)}function Hk(){var i;const n=Kk[0],t=(i=$k(n))!=null?i:_.t(`status.colorDefaultTitle.${Di.exports.lowerCase(n)}`);return{insert:" ",attributes:{id:it(),type:"status",box:!0,title:t,subtle:!0,created:Date.now(),color:n}}}const ng=D("StatusBoxEditor");class jk{constructor(t){m(this,"linkPopup",null);m(this,"boxElement");m(this,"statusPalette",new UK);m(this,"isEditing",!1);m(this,"editorStatus",t=>{if(!this.editor.isWritable())return;const e=this.editor.getBoxData(t);this.linkPopup=new su(this.createPopupContent(e.title,e.color,e.subtle),{id:"status-box-popup"}),this.linkPopup.on("show",this.handleShow),this.linkPopup.on("close",this.handClose),this.linkPopup.manualShow(t,{theme:"light",placement:"bottom-start",offset:[5,5]}),this.boxElement=t});m(this,"handleShow",()=>{this.focus()});m(this,"handClose",()=>{var r;p(ng,this.boxElement,"boxElement not found");const t=this.editor.getBoxData(this.boxElement),e=et(this.boxElement);if(p(ng,e,"block not found"),t.title)if(t.title.length>32){const i=t.title.slice(0,32),s={...t,title:i};this.editor.updateBoxData(s,{noFocus:!0}),Vk(s)}else Vk(t);else{const i=el(e,this.boxElement);this.editor.deleteTextFromBlock(e,i.start,1)}this.editor.focus(),(r=this.linkPopup)==null||r.destroy(),this.linkPopup=null,this.boxElement=void 0,this.isEditing=!1});m(this,"handleKeyDown",(t,e)=>{var r;e||t.key==="Enter"&&((r=this.linkPopup)==null||r.close(null))});m(this,"onColorChange",t=>{var s,o;if(!(t.target instanceof HTMLElement)||t.target.closest("[data-color]")===null)return;const e=Di.exports.capitalize(t.target.getAttribute("data-color"));p(ng,this.boxElement,"boxElement not found");const r=this.editor.getBoxData(this.boxElement);this.statusPalette.changeColor(e);const i={...r,color:e};if(!this.isEditing){const l=(o=(s=this.linkPopup)==null?void 0:s.popper)==null?void 0:o.querySelector("input"),c=$k(e);l&&(l.value=c),i.title=c}this.editor.updateBoxData(i,{noFocus:!0}),this.focus()});m(this,"onTitleChange",t=>{const e=t.target.value;p(ng,this.boxElement,"boxElement not found");const i={...this.editor.getBoxData(this.boxElement),title:e.trim()};this.editor.updateBoxData(i,{noFocus:!0}),this.isEditing=!0});this.editor=t,this.statusPalette.root.addEventListener("click",this.onColorChange)}focus(){setTimeout(()=>{var t,e,r,i,s,o;(r=(e=(t=this.linkPopup)==null?void 0:t.popper)==null?void 0:e.querySelector("input"))==null||r.focus(),(o=(s=(i=this.linkPopup)==null?void 0:i.popper)==null?void 0:s.querySelector("input"))==null||o.select()},100)}createPopupContent(t,e,r){const i=B("div",["status-box-editor-popup"],null);return _K(i,t,this.onTitleChange,this.handleKeyDown),this.isEditing=!1,i.appendChild(this.statusPalette.root),this.statusPalette.changeColor(e),i}destroy(){var t;(t=this.linkPopup)==null||t.destroy()}}const Xlt="",OK=D("status-box-command");class wd{static get commands(){return[{id:this.id,name:_.t("status.command.name"),icon:uT,order:650,group:"common",subText:"/status"}]}static insertStatus(t,e,r){var c;const i=t.getBlockByIndex(e,r),s=Hk(),{start:o}=t.selection.range;p(OK,xi(o),"invalid block position"),t.insertBoxToBlock(i,o.offset,s.attributes);const l=t.getBoxById((c=s.attributes)==null?void 0:c.id);t.addCustom("status-box",d=>new jk(d)).editorStatus(l)}static insertEmptyBlockStatus(t,e,r){var l;let i=t.getBlockByIndex(e,r);(!i||!ve(t,i))&&(i=t.insertTextBlock([],e,r));const s=Hk();t.setBlockText(i,[s]);const o=t.getBoxById((l=s.attributes)==null?void 0:l.id);return t.addCustom("status-box",c=>new jk(c)).editorStatus(o),i}}m(wd,"id","insert-status");const NK={"en-US":{status:{empty:"Set status",command:{name:"Status"},color:{red:"Red",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",grey:"Gray"},colorDefaultTitle:{red:"Delayed",yellow:"In progress",green:"Done",blue:"Not started",purple:"To be confirmed",grey:"Paused"}}},"zh-CN":{status:{empty:"\u8BBE\u7F6E\u72B6\u6001",command:{name:"\u72B6\u6001"},color:{red:"\u7EA2\u8272",yellow:"\u9EC4\u8272",green:"\u7EFF\u8272",blue:"\u84DD\u8272",purple:"\u7D2B\u8272",grey:"\u7070\u8272"},colorDefaultTitle:{red:"\u5DF2\u5EF6\u671F",yellow:"\u8FDB\u884C\u4E2D",green:"\u5DF2\u5B8C\u6210",blue:"\u672A\u5F00\u59CB",purple:"\u5F85\u786E\u8BA4",grey:"\u5DF2\u6682\u505C"}}},"ja-JP":{status:{empty:"\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u8A2D\u5B9A",command:{name:"\u30B9\u30C6\u30FC\u30BF\u30B9"},color:{red:"\u8D64",yellow:"\u9EC4",green:"\u7EFF",blue:"\u9752",purple:"\u7D2B",grey:"\u7070"},colorDefaultTitle:{red:"\u9045\u5EF6",yellow:"\u9032\u884C\u4E2D",green:"\u5B8C\u4E86",blue:"\u672A\u7740\u624B",purple:"\u672A\u78BA\u8A8D",grey:"\u4E00\u6642\u505C\u6B62"}}}};_.mergeLang(NK);const Ra=D("inline-box-items");function PK(n,t,e){return n.undoManager.runInGroup(()=>{var o;let r=n.findBlockByIndex(t,e);(!r||!ve(n,r))&&(r=n.insertTextBlock([],t,e));const i=Nk();n.setBlockText(r,[i]);const s=(o=i.attributes)==null?void 0:o.id;return p(Ra,s,"mathjax box id is empty"),setTimeout(()=>{const l=n.getBoxById(s);eg(n,l)},100),r})}function FK(n,t,e){let r=n.findBlockByIndex(t,e),i="bottom-start";return(!r||!ve(n,r))&&(i="top-start",r=n.insertTextBlock([],t,e)),Td(n,{target:r,linkText:"",linkUrl:"",onFinished:(l,c)=>{n.undoManager.runInGroup(()=>{try{p(Ra,r,"block not found"),ve(n,r)||(r=n.insertTextBlock([],t,e));const d=qr(l,{link:c}),h=qr(" ",null),C=[d,h];n.insertTextToBlock(r,0,C),n.selection.selectBlock(r,Vn(C)),n.focus()}catch(d){Ra.error(d)}})},onClose:()=>{n.focus()},placement:i}),r}function KK(n,t,e){return n.undoManager.runInGroup(()=>{var l;const r=n.getBlockByIndex(t,e),i=n.selection.range;p(Ra,xi(i.start),"invalid block position");const s=Nk();n.insertBoxToBlock(r,i.start.offset,s.attributes);const o=(l=s.attributes)==null?void 0:l.id;return p(Ra,o,"mathjax box id is empty"),setTimeout(()=>{const c=n.getBoxById(o);eg(n,c)},100),r})}function VK(n,t,e){const r=n.getBlockByIndex(t,e),i=n.selection.range;p(Ra,xi(i.start),"invalid block position");const s=Ks(n,r,i);if(s.length===0)return;const o=s[0],l=Hs(n,r,"quick-menu-inline-link",o);Td(n,{target:l,linkText:"",linkUrl:"",onFinished:(h,C)=>{n.undoManager.runInGroup(()=>{try{const E=n.getBlockText(r),A=Ws(E,i.start.offset,h,{link:C});n.setBlockText(r,A),n.selection.selectBlock(r,i.start.offset+h.length),n.focus()}catch(E){Ra.error(E)}})},onClose:()=>{n.focus()},placement:"bottom-start"})}class zk{getCommands(){return[{id:"insert-math",name:_.t("quickMenu.inlineBox.math"),icon:R2,order:900,group:"common",subText:Qn("insert-math")},{id:"insert-link",name:_.t("quickMenu.inlineBox.link"),icon:tE,order:400,group:"common",subText:Qn("insert-link")}]}async handleUpdateBlockCore(t,e){switch(e.item.id){case"insert-math":return KK(t,e.containerId,e.blockIndex);case"insert-link":return VK(t,e.containerId,e.blockIndex);case wd.id:return wd.insertStatus(t,e.containerId,e.blockIndex);default:return null}}async handleInsertEmptyBlockCore(t,e){switch(e.item.id){case"insert-math":return PK(t,e.containerId,e.blockIndex);case"insert-link":return FK(t,e.containerId,e.blockIndex);case wd.id:return wd.insertEmptyBlockStatus(t,e.containerId,e.blockIndex);default:return null}}async executeCommand(t,e,r){if(r.from==="quick-menu"||r.from==="add-block-menu"){const i=t.getBlockById(r.blockId),s=t.getParentContainer(i),o=pt(s),l=t.getBlockIndex(i);t.undoManager.runInGroup(()=>this.handleUpdateBlockCore(t,{item:e,containerId:o,blockIndex:l}))}else r.from==="block-menu"&&t.undoManager.runInGroup(()=>this.handleInsertEmptyBlockCore(t,{item:e,containerId:r.containerId,blockIndex:r.blockIndex}));return null}}const Gk=(n,t)=>{var e;return(e=n.children)==null?void 0:e.map(r=>({...r,itemType:"insert-block",commandProvider:t,children:Gk(r,t)}))};function $K(n,t){var s,o;const{withPlainText:e}=t,r=(o=(s=n.options.componentsOptions)==null?void 0:s.quickMenu)==null?void 0:o.commandProviders;if(!r)return[];const i=[];return[...r,new Lk(e),new zk].forEach(l=>{const c=l.getCommands(n,t);i.push(...c.map(d=>({...d,itemType:"insert-block",commandProvider:l,children:Gk(d,l)})))}),i}function HK(n,t){const e=[];return n.editorBlocks.forEach(r=>{if(!r.getOptions)return;const i=r.getOptions(n);!i.insertBlockCommandItems||(i.insertBlockCommandItems.forEach(s=>{Sk(s,i)}),e.push(...i.insertBlockCommandItems))}),e.push(...$K(n,t)),e}function eA(n,t={withPlainText:!1,from:"block-menu"}){const e=HK(n,t),r=new Map;e.forEach(o=>{var d,h;const l=(d=o.group)!=null?d:"";let c=r.get(l);c?c.items.push(o):(c={group:l,order:o.groupOrder||Ik[l]||1e3,items:[o],hide:(h=o.hideGroupItem)!=null?h:!1},r.set(l,c))});const i=Array.from(r.values());i.sort((o,l)=>o.order-l.order),i.forEach(o=>{o.items.sort((l,c)=>{var d,h;return((d=l.order)!=null?d:0)-((h=c.order)!=null?h:0)})});const s=[];return i.forEach((o,l)=>{const c=`blockMenu.section.${o.group||"common"}`,d=_.t(c),h=d===c?o.group:d;o.hide||s.push({id:`section-${l}`,name:h,type:"section",group:o.group,itemType:"insert-block"}),s.push(...o.items.map(C=>({...C})))}),s}function jK(n,t,e){const r=n.getFocusedBlock();if(!r)return;const i=n.getParentContainer(r),s=pt(i);let l=n.getBlockIndex(r);ve(n,r)||(l+=1);const c=e.trigger?"quick-menu":"add-block-menu";if(t.commandProvider){n.emit("beforeExecCommand",n,t,{source:c}),t.commandProvider.executeCommand(n,t,{from:c,...e});return}!t.blockOptions||!t.blockOptions.handleInsertEmptyBlock||(n.emit("beforeExecCommand",n,t,{source:c}),t.blockOptions.handleInsertEmptyBlock(n,{containerId:s,blockIndex:l,item:t,from:c}))}const Wk=D("quick-menu"),zK={id:"quick-menu",trigger:["/"]},GK=5;class rg{constructor(t,e=zK){m(this,"suggest");m(this,"items");m(this,"maxHeading");m(this,"firstEmptyOffset",-1);m(this,"queryItems",async(t,e)=>{if(this.initMenuItems(),this.refreshMenuItems(),e){const r=new Set,i=e.toLocaleLowerCase().replace(/^\s+|\s+$/g,""),s=this.items.filter(o=>{if(o.type==="section")return!0;if(o.name.toLocaleLowerCase().indexOf(i)!==-1||iN(o).toLocaleLowerCase().indexOf(i)!==-1)return r.add(o.group),!0;const l=`blockMenu.section.${o.group||"common"}`,c=_.t(l),d=c===l?o.group:c;return(d==null?void 0:d.toLocaleLowerCase().indexOf(i))!==-1?(r.add(o.group),!0):!1}).filter(o=>o.type==="section"?r.has(o.group):!0);return s.length?this.firstEmptyOffset=-1:this.handleEmptySearch(),s}return this.items});m(this,"onClose",()=>{this.firstEmptyOffset=-1});m(this,"onShow",(t,e,r,i)=>{const s=this.editor.getBlockByIndex(e,r);if(!Gr(s)){const o=et(at(s));if(o&&Ot(o)==="code")return!1}return!0});m(this,"onClickItem",(t,e)=>{const r=e;r.itemType==="insert-block"&&(p(Wk,r.blockOptions||r.commandProvider,"invalid quick item, no block options or command provider"),p(Wk,this.suggest.anchor,"invalid suggest, no anchor"),this.options.id==="empty-block-menu"&&this.editor.focus(),jK(this.editor,r,this.suggest.anchor))});this.editor=t,this.options=e,this.items=[],this.maxHeading=jm(),this.suggest=new fE(t,{id:e.id||"quick-menu",trigger:e.trigger,needSpaceBeforeTrigger:!0,autoDeleteTrigger:!0,highlight:!0,onClose:this.onClose,onShow:this.onShow,onClickItem:this.onClickItem,queryItems:this.queryItems})}get menu(){return this.suggest.menu.menu}destroy(){this.suggest.destroy()}initMenuItems(){var r;const t=((r=this.suggest.anchor)==null?void 0:r.trigger)==="/"?"quick-menu":"block-menu",e=eA(this.editor,{withPlainText:!1,from:t});this.items=e}refreshMenuItems(){let t=null,e=0;const r=jm();if(r!==this.maxHeading){const i=new Lk,o=i.getCommands().map(l=>({...l,itemType:"insert-block",commandProvider:i}));for(let l=0;l<this.items.length;l++)this.items[l].group==="basics"&&(t||(t=l),t&&e++);t&&e&&this.items.splice(t,e,...o),this.maxHeading=r}}handleEmptySearch(){const t=this.editor.selection.getFocusedPos();if(this.firstEmptyOffset===-1){if(t.isSimple()){const{offset:e}=t;this.firstEmptyOffset=e-1}}else if(t.isSimple()){const{offset:e}=t;e-this.firstEmptyOffset>GK&&(this.suggest.close(),this.firstEmptyOffset=-1)}}}class Sd{constructor(t){m(this,"instance");m(this,"mousedown",!1);m(this,"currentInstance",null);m(this,"attributeName",[]);m(this,"attributeDesc","");m(this,"_lastClickButtonId","");m(this,"observer",null);m(this,"observerCallback",null);m(this,"createContent",t=>{let e="",r=0;for(;r<this.attributeName.length&&!e;)t.hasAttribute(this.attributeName[r])&&(e=t.getAttribute(this.attributeName[r])||""),r++;const i=t.getAttribute(this.attributeDesc);if(!i)return e;const s=B("div",[],null);return B("span",[],s,e),i&&B("span",["editor-tooltip-desc"],s,i),s});m(this,"handleDocumentMouseDown",()=>{this.mousedown=!0,this.editor.domEvents.addEventListener(document,"mouseup",this.handleDocumentMouseUp)});m(this,"handleDocumentMouseUp",()=>{this.mousedown=!1,this.editor.domEvents.removeEventListener(document,"mouseup",this.handleDocumentMouseUp)});m(this,"handleShown",t=>{this.currentInstance&&this.hide(),this.currentInstance=t,this.createObserver()});m(this,"handleHidden",()=>{this.destroyObserver(),this.currentInstance=null});m(this,"handleShow",t=>{var i;const e=t.reference;if(!e||!Ce(document.body,e)||window.isDragging||this.mousedown)return!1;const r=Number.parseInt((i=e.getAttribute("data-tooltip-hide-at"))!=null?i:"",10);if(r&&Date.now()-r<1e3)return!1;if(this._lastClickButtonId===e.getAttribute("data-button-id"))return this._lastClickButtonId="",!1;if(this.attributeName.every(s=>!e.hasAttribute(s)))return!1;if(t.reference){const s={};if(t.reference.hasAttribute("data-editor-tooltip-placement")&&(s.placement=t.reference.getAttribute("data-editor-tooltip-placement")||"top"),t.reference.hasAttribute("data-editor-tooltip-offset-x")||t.reference.hasAttribute("data-editor-tooltip-offset-y")){const l=t.reference.getAttribute("data-editor-tooltip-offset-x"),c=t.reference.getAttribute("data-editor-tooltip-offset-y");s.offset=[l?Number.parseInt(l,10):0,c?Number.parseInt(c,10):0]}t.reference.hasAttribute("data-editor-tooltip-maxwidth")&&(s.maxWidth=Number.parseInt(t.reference.getAttribute("data-editor-tooltip-maxwidth")||"350",10)),t.reference.hasAttribute("data-editor-tooltip-allow-markdown")&&(s.allowHTML=!0);const o=document.body;if(s.appendTo=this.fixContainerForFullscreen(o),Object.keys(s).length&&t.setProps(s),t.reference.hasAttribute(`data-editor-tooltip-${this.editor.clientId}-dynamic`)){const l=t.reference.getAttribute(`data-editor-tooltip-${this.editor.clientId}-dynamic`);t.setContent(l||"")}}return!0});this.editor=t;const e=t.clientId;this.attributeName=[`data-editor-tooltip-${e}`,`data-editor-tooltip-${e}-dynamic`,"data-editor-tooltip-common"],this.attributeDesc=`data-editor-tooltip-desc-${e}`,this.instance=Bp.delegate(document.body,{theme:"editor-tooltip",maxWidth:400,delay:200,target:this.attributeName.map(r=>`[${r}]`).join(","),content:this.createContent,onShow:this.handleShow,onShown:this.handleShown,onHide:this.handleHidden,hideOnClick:!1}),t.domEvents.addEventListener(document,"mousedown",this.handleDocumentMouseDown)}set lastClickButtonId(t){this._lastClickButtonId=t,t&&setTimeout(()=>{this._lastClickButtonId===t&&(this._lastClickButtonId="")},500)}visible(){var t;return(t=this.currentInstance)==null?void 0:t.state.isVisible}hide(){var t;(t=this.currentInstance)!=null&&t.state.isVisible&&this.currentInstance.hide()}destroy(){this.destroyObserver(),this.instance.destroy(),this.editor.domEvents.removeEventListener(document,"mousedown",this.handleDocumentMouseDown),this.editor.domEvents.removeEventListener(document,"mouseup",this.handleDocumentMouseUp)}createObserver(){this.destroyObserver();const t=this.currentInstance;if(!t||!t.reference)return;this.observerCallback=Ue.default(()=>{t.reference.closest("body")||(t.hide(),this.destroyObserver())},200),this.observer=new MutationObserver(this.observerCallback);const e=document.body,r={childList:!0,attributes:!1,subtree:!0};this.observer.observe(e,r)}destroyObserver(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observerCallback&&(this.observerCallback.cancel(),this.observerCallback=null)}fixContainerForFullscreen(t){return t.closest("body")&&document.fullscreenElement&&!document.fullscreenElement.contains(t)?document.fullscreenElement:t}}const WK={"text/style-bold":"bold","text/style-italic":"italic","text/style-underline":"underline","text/style-strikethrough":"line-through","text/style-code":"code","text/style-sub":"subscript","text/style-super":"superscript",link:"link"};function qK(n,t){const e=new Set(Object.keys(WK)),r=t.filter(s=>e.has(s.id));return $m(r)}function Ld(n,t){if(!n.isWritable()||Ii(n))return!1;const e=n.selection.range,r=n.editorCommandProviders.getCommands(e,"shortcut"),s=qK(n,r).find(o=>o.id===`text/${t}`||o.id==="link");return s?(n.editorCommandProviders.executeCommand(e,s,{}),Au.get(n).update("selectionChange"),!0):!1}function XK(n,t){const e=n.selection.focusedBlock;if(!n.isWritable()||!ot(n,e))return!1;const r=n.getBlockData(e).heading,i={id:`heading-${t}`,source:"BlockTurnIntoCommandProvider",value:String(t)};return Number(r)===t&&(i.id="text",i.value=null),n.editorCommandProviders.executeCommand(n.selection.range,i,{}),!0}const nA={"CtrlOrCmd+B":n=>Ld(n,"style-bold"),"CtrlOrCmd+I":n=>Ld(n,"style-italic"),"CtrlOrCmd+U":n=>Ld(n,"style-underline"),"CtrlOrCmd+D":n=>Ld(n,"style-strikethrough"),"CtrlOrCmd+K":n=>Ld(n,"link"),...(()=>{const n={};for(let t=1;t<=8;t++)n[`CtrlOrCmd+${t}`]=e=>XK(e,t);return n})()},YK={quickMenu:{basic:{heading:{title:"\u6807\u9898 {heading}",space:"{markdown}\u7A7A\u683C"},unordered:"\u65E0\u5E8F\u5217\u8868",ordered:"\u6709\u5E8F\u5217\u8868",checkbox:"\u5F85\u529E\u5217\u8868",quote:"\u5F15\u7528"},inlineBox:{math:"\u516C\u5F0F",link:"\u94FE\u63A5"}},link:{textLabel:"\u6587\u672C",urlLabel:"\u94FE\u63A5\u5730\u5740",textPlaceholder:"\u8BF7\u8F93\u5165\u6587\u672C",urlPlaceholder:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740",submitText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",edit:"\u7F16\u8F91",remove:"\u53D6\u6D88\u94FE\u63A5"},commands:{unordered:"\u65E0\u5E8F\u5217\u8868",ordered:"\u6709\u5E8F\u5217\u8868",check:"\u5F85\u529E\u5217\u8868",link:"\u94FE\u63A5",quote:"\u5F15\u7528",alignLeft:"\u5DE6\u5BF9\u9F50",alignRight:"\u53F3\u5BF9\u9F50",alignCenter:"\u5C45\u4E2D\u5BF9\u9F50",alignGroup:"\u5BF9\u9F50\u65B9\u5F0F",heading:"\u6807\u9898 {name}",headingGroup:"\u6807\u9898\u6837\u5F0F",text:"\u6B63\u6587"}},QK={quickMenu:{basic:{heading:{title:"Heading {heading}",space:"{markdown}space"},unordered:"Bulleted list",ordered:"Numbered list",checkbox:"To-do list",quote:"Quote"},inlineBox:{math:"Formula",link:"Link"}},link:{textLabel:"Text",urlLabel:"Link address",textPlaceholder:"Please enter text",urlPlaceholder:"Please enter link",submitText:"Confirm",cancelText:"Cancel",edit:"Edit",remove:"Remove link"},commands:{unordered:"Bulleted list",ordered:"Numberer list",check:"To-do list",link:"Link",quote:"Quote",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Center text",alignGroup:"Alignment",heading:"Heading {name}",headingGroup:"Text style",text:"Text"}},JK={quickMenu:{basic:{heading:{title:"\u898B\u51FA\u3057{heading}",space:"{markdown}\u30B9\u30DA\u30FC\u30B9"},unordered:"\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",ordered:"\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",checkbox:"\u30D0\u30C3\u30AF\u30ED\u30B0",quote:"\u5F15\u7528"},inlineBox:{math:"\u6570\u5F0F",link:"URL"}},link:{textLabel:"\u30C6\u30AD\u30B9\u30C8",urlLabel:"URL",textPlaceholder:"\u30C6\u30AD\u30B9\u30C8\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",urlPlaceholder:"URL \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",submitText:"OK",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB",edit:"\u7DE8\u96C6",remove:"\u30EA\u30F3\u30AF\u3092\u89E3\u9664"},commands:{unordered:"\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",ordered:"\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",check:"\u30D0\u30C3\u30AF\u30ED\u30B0",link:"URL",quote:"\u5F15\u7528",alignLeft:"\u5DE6\u63C3\u3048",alignRight:"\u53F3\u63C3\u3048",alignCenter:"\u4E2D\u592E\u63C3\u3048",alignGroup:"\u5BF9\u9F50\u65B9\u5F0F",heading:"\u898B\u51FA\u3057{name}",headingGroup:"\u30BF\u30A4\u30C8\u30EB\u30B9\u30BF\u30A4\u30EB",text:"\u672C\u6587"}};_.mergeLang({"zh-CN":YK,"en-US":QK,"ja-JP":JK});const tat="";function wa(n,...t){const e=Qr(...t);return e.classList.remove("editor-button"),e.classList.add("editor-text-button"),n.append(e),e}function qk(n){const t=Hm(n);t==null||t.hide();const e=n.findCustom("table-border-bar");e==null||e.closeToolbar()}function ZK(n){return B("div",["insert-column-button","drop-marker"],n)}const tV=D("row-height");function Xk(n){const t=Kt.fromTable(n),e=n.rows;p(tV,e.length===t.rowCount,"row count mismatch");const r=Array(t.rowCount).fill(0);for(let i=0;i<e.length;){let s=1,l=e[i].getBoundingClientRect().height,c=i+1;for(;c<e.length;){const d=e[c];if(d.cells.length!==0)break;s++,c++,l+=d.getBoundingClientRect().height}for(let d=0;d<s;d++)r[i+d]=l/s;i=c}return r}const eV=D("table-border-bar-dom");function Yk(n){var c;const t=et(n.contentElement);p(eV,t,"no block");const r=be(t).querySelector(".table-border-bar-container.left"),s=zt(t).offsetLeft-cu,o=((c=n.scrollOptions.paddingLeft)!=null?c:0)+s,l=Math.min(n.contentElement.offsetLeft-s,n.rootElement.scrollLeft-o);r&&(r.style.left=`${-l}px`)}const Al=D("table-border-bar-dom");function xu(n,t){p(Al,un(t),"invalid table block");const e=cn(t),r=as(n,t),i=be(t),s=(C,E,A)=>{const v=B("div",["button-root",E],C),S=B("div",["button-container",E],v);v.setAttribute(`data-${E}-index`,`${A}`),S.setAttribute(`data-editor-tooltip-${n.clientId}`,E==="left"?_.t("table.insertRow"):_.t("table.insertCol")),B("span",["insert-indicator"],S),ZK(S)},{selectedRows:o,selectedColumns:l}=mE(n,t),c=()=>{const C=r.querySelector(".table-border-bar-container.top");p(Al,C,"no top border bar container");const E=B("div",["table-border-bar-container","top"],null),A=B("div",["table-border-bar","top"],E),v=rP(e),w=Kt.fromTable(e).colCount;n.selection.range.isSimple()&&s(A,"top",0);for(let O=0;O<w;O++){const M=O===w-1?v[O]+2:v[O],V=B("span",["table-border-bar-cell","top"],A);l.has(O)&&V.classList.add("selected"),V.setAttribute("data-top-index",`${O}`),V.style.width=`${M}px`,n.selection.range.isSimple()&&s(A,"top",O+1)}vf(C,E)},d=()=>{const C=i.querySelector(".table-border-bar-container.left");p(Al,C,"no left border bar container");const E=B("div",["table-border-bar-container","left"],null),A=B("div",["table-border-bar","left"],E);B("span",["table-border-bar-cell","corner"],A);const v=Xk(e);n.selection.range.isSimple()&&s(A,"left",0),Array.from(e.rows).forEach((S,w,O)=>{const M=B("span",["table-border-bar-cell","left"],A);o.has(w)&&M.classList.add("selected"),M.setAttribute("data-left-index",`${w}`);const V=w===O.length-1?v[w]+2:v[w];M.style.height=`${V}px`,n.selection.range.isSimple()&&s(A,"left",w+1)}),vf(C,E)};c(),d();const h=n.findCustom(ls(t));h&&Yk(h)}function Qk(n,t){const e=t.target;if(!(e instanceof Element))return;const r=et(e);p(Al,r&&un(r),"invalid table block"),xu(n,r),n.selection.caret.update()}function ig(n,t){const e=t.target;if(!(e instanceof Element))return;const r=et(e);p(Al,r&&un(r),"invalid table block");const i=e.closest(".button-root");if(i){if(i.classList.contains("top")){const s=parseInt(i.getAttribute("data-top-index")||"0",10);ZT(n,r,s),xu(n,r)}else if(i.classList.contains("left")){const s=parseInt(i.getAttribute("data-left-index")||"0",10);IE(n,r,s),xu(n,r)}}}function sg(n,t){var o;qk(n),t.preventDefault(),t.stopPropagation();let e=null,r,i;const s=l=>{var c;if(l.target instanceof HTMLElement&&r&&e&&i!==void 0){const d=et(l.target),h=l.target.closest(".table-border-bar");if(d===e&&h){const C=parseInt((c=l.target.getAttribute(`data-${r}-index`))!=null?c:"0",10),E=Math.min(i,C),A=Math.abs(i-C)+1;Mt(l.target,"top")&&r==="top"?CP(n,d,E,A,{reverse:!0}):Mt(l.target,"left")&&r==="left"&&EP(n,d,E,A,{reverse:!0})}}l.type==="mouseup"&&(e=null,i=void 0,r=void 0,document.body.removeEventListener("mousemove",s),document.body.removeEventListener("mouseup",s))};t.target instanceof HTMLElement&&Mt(t.target,"table-border-bar-cell")&&(e=et(t.target),Mt(t.target,"top")?r="top":Mt(t.target,"left")&&(r="left"),r&&e&&(i=parseInt((o=t.target.getAttribute(`data-${r}-index`))!=null?o:"0",10),document.body.addEventListener("mousemove",s),document.body.addEventListener("mouseup",s)))}function Jk(n){const t=n.selection.range,e=pd(n,t);e&&xu(n,e)}function nV(n,t){p(Al,un(t),"invalid table block");const e=as(n,t),r=be(t),i=B("div",["table-border-bar-container","top"],e),s=B("div",["table-border-bar-container","left"],r);xu(n,t),n.domEvents.addEventListener(zt(t),"scroll",Qk),n.domEvents.addEventListener(i,"click",ig),n.domEvents.addEventListener(s,"click",ig),n.domEvents.addEventListener(i,"mousedown",sg),n.domEvents.addEventListener(s,"mousedown",sg),n.addListener("afterClearSelection",Jk)}function Zk(n,t){if(!n.isWritable())return;if(as(n,t).querySelector(".table-border-bar-container")){xu(n,t);return}nV(n,t)}function tR(n,t){p(Al,un(t),"invalid table block");const e=as(n,t),r=be(t),i=e.querySelectorAll(".table-border-bar-container"),s=r.querySelectorAll(".table-border-bar-container");i.forEach(o=>{n.domEvents.removeEventListener(o,"click",ig),n.domEvents.removeEventListener(o,"mousedown",sg),o.remove()}),s.forEach(o=>{n.domEvents.removeEventListener(o,"click",ig),n.domEvents.removeEventListener(o,"mousedown",sg),o.remove()}),n.domEvents.removeEventListener(zt(t),"scroll",Qk),n.addListener("afterClearSelection",Jk)}function rV(n,t){p(Al,un(t),"invalid table block");const r=as(n,t).querySelector(".table-border-bar-container.top");return r?r.getBoundingClientRect().height:0}class iV{constructor(t,e){m(this,"toolbar");m(this,"handleSelectionChange",(t,e)=>{!t.isVisible||(e==="delete-columns"?(ml(this.editor,this.tableBlock,!0,!0),gl(this.editor,this.tableBlock,!0,!0)):e==="delete-rows"?(ml(this.editor,this.tableBlock,!0,!1),gl(this.editor,this.tableBlock,!0,!1)):(ml(this.editor,this.tableBlock,!1),gl(this.editor,this.tableBlock,!1)))});m(this,"handleClick",(t,e,r)=>{e.id==="delete-columns"?gE(this.editor.selection.range):e.id==="delete-rows"&&pE(this.editor.selection.range)});m(this,"handleToolbarClose",()=>{this.tableBlock&&pd(this.editor,this.editor.selection.range)===this.tableBlock&&(ml(this.editor,this.tableBlock,!1),gl(this.editor,this.tableBlock,!1))});this.editor=t,this.tableBlock=e;const r=t.options.componentsOptions.popover;this.toolbar=new hd([],void 0,{id:"table-row-column-toolbar",overflowBoundary:r==null?void 0:r.overflowBoundary,refuseOverflow:!0,tooltipId:this.editor.clientId}),this.toolbar.addListener("selectionChange",this.handleSelectionChange),this.toolbar.addListener("click",this.handleClick),this.toolbar.addListener("close",this.handleToolbarClose)}close(){this.toolbar.close("cancelBar")}update(){var i,s,o;const{selectedColumns:t,selectedRows:e}=mE(this.editor,this.tableBlock);if(!this.editor.isWritable())return;if(t.size>0&&e.size>0){this.toolbar.close("cancelBar");return}if(t.size===0&&e.size===0){this.toolbar.close("cancelBar");return}const r=Ks(this.editor,this.tableBlock,this.editor.selection.range)[0];if(!r){this.toolbar.close("cancelBar");return}if(t.size>0){const l={id:"delete-columns",name:_.t("table.deleteSelectCol"),icon:m2};this.toolbar.updateItems([l]);const c=Hs(this.editor,this.tableBlock,"table-row-column-delete",r);this.toolbar.manualShow(c,{placement:"top",offset:[0,5]})}else{const l={id:"delete-rows",name:_.t("table.deleteSelectRow"),icon:h2};this.toolbar.updateItems([l]);const h=be(this.tableBlock).querySelector(".table-border-bar-container.left").getBoundingClientRect(),C=new DOMRect(Math.max(h.left,r.left-cu),r.top,cu,r.height),E=Hs(this.editor,this.tableBlock,"table-row-column-delete",C);this.toolbar.manualShow(E,{placement:"left",offset:[0,5]});const A=this.editor.options.componentsOptions.popover;(i=this.toolbar.tippyInstance)==null||i.setProps({popperOptions:{modifiers:[{name:"flip",options:{boundary:A==null?void 0:A.overflowBoundary,fallbackPlacements:["left","right"]}}]}})}(o=(s=this.toolbar.tippyInstance)==null?void 0:s.popperInstance)==null||o.update()}destroy(){this.toolbar.destroy(),this.toolbar.removeAllListeners()}}const rA=D("table-border-bar");class sV{constructor(t,e){m(this,"toolbar");m(this,"resizeObserver",null);m(this,"handleReadonlyChanged",t=>{t.isWritable()?this.update():tR(this.editor,this.tableBlock)});m(this,"handleBlockUpdated",()=>{var t;(t=this.resizeObserver)==null||t.disconnect(),setTimeout(()=>{var r;const e=this.editor.getBlockById(dt(this.tableBlock));(r=this.resizeObserver)==null||r.observe(cn(e))})});m(this,"handleScroll",()=>{var t;(t=this.toolbar)==null||t.update()});m(this,"handleTableResize",()=>{!this.editor.isWritable()||this.update()});this.editor=t,this.tableBlock=e,p(rA,this.tableBlock,"no table block"),rA.debug("create table border bar"),Zk(this.editor,this.tableBlock),this.resizeObserver=new Ql(this.handleTableResize),this.resizeObserver.observe(cn(this.tableBlock));const r=t.getComponentOptions("table");r!=null&&r.hideToolbar||(this.toolbar=new iV(this.editor,this.tableBlock)),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged)}close(){var t;(t=this.toolbar)==null||t.close()}destroy(){var t,e;rA.debug("destroy table border bar"),(t=this.resizeObserver)==null||t.disconnect(),this.resizeObserver=null,tR(this.editor,this.tableBlock),(e=this.toolbar)==null||e.destroy(),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged)}update(){var t;Zk(this.editor,this.tableBlock),(t=this.toolbar)==null||t.update()}}const oV=D("table-border-bar");class lV{constructor(t){m(this,"activeTableBar",null);m(this,"handleBlockDeleted",(t,e)=>{!this.activeTableBar||(e===this.activeTableBar.tableBlock||Ce(e,this.activeTableBar.tableBlock))&&(this.activeTableBar.destroy(),this.activeTableBar=null)});m(this,"handleSelectionChanged",t=>{setTimeout(()=>{var i;const e=t.selection.range,r=pd(t,e);((i=this.activeTableBar)==null?void 0:i.tableBlock)!==r&&this.activeTableBar&&this.hide(),r&&this.show(r)})});m(this,"handleScroll",()=>{var t;(t=this.activeTableBar)==null||t.handleScroll()});this.editor=t,this.editor.addListener("blockDeleted",this.handleBlockDeleted),this.editor.addListener("selectionChanged",this.handleSelectionChanged)}destroy(){var t;this.editor.removeListener("blockDeleted",this.handleBlockDeleted),this.editor.removeListener("selectionChanged",this.handleSelectionChanged),(t=this.activeTableBar)==null||t.destroy()}show(t){this.activeTableBar?(this.activeTableBar.tableBlock!==t&&this.hide(),this.activeTableBar.update()):this.activeTableBar=new sV(this.editor,t)}update(){var t;(t=this.activeTableBar)==null||t.handleBlockUpdated()}closeToolbar(){var t;(t=this.activeTableBar)==null||t.close()}hide(){!this.activeTableBar||(p(oV,this.activeTableBar,"no active table bar"),this.activeTableBar.destroy(),this.activeTableBar=null)}}function eR(n,t){const e=n.addCustom("table-border-bar",r=>new lV(r));t==="update"&&e.update()}const ur=D("table-cell-menu"),aV="style-bg-color-";class cV{constructor(t){m(this,"activeTableBlock",null);m(this,"targetButton",null);m(this,"manualMenu",null);m(this,"colorPaletteItem",null);m(this,"markedRowAsDanger",!1);m(this,"markedColAsDanger",!1);m(this,"resetAsDangerMarked",()=>{this.markedColAsDanger=!1,this.markedRowAsDanger=!1});m(this,"handlePrevent",(t,e)=>{e.stopPropagation()});m(this,"handleReadonlyChanged",t=>{t.isWritable()||this.hide()});m(this,"handleSelectionChanged",t=>{const e=t.selection.range,r=pd(t,e);if(this.hide(),this.activeTableBlock!==r&&(this.activeTableBlock=r),this.activeTableBlock){const i=Kt.fromBlock(this.activeTableBlock),s=e.isReverse()?e.start:e.end;let o=null;s instanceof Ai?t.getBlockById(s.blockId)===this.activeTableBlock?o=i.getCellByContainerId(s.childContainerId):o=this.getCellByChildBlockId(i,s.blockId):s.blockId!==this.activeTableBlock.id&&(o=this.getCellByChildBlockId(i,s.blockId)),o&&this.editor.isWritable()&&this.showCellMenuButton(o)}});m(this,"handleBeforePopupPalette",()=>{var e;const t=this.getSelectedBkgColorIndex();(e=this.colorPaletteItem)==null||e.palette.setColor("backgroundColor",t)});m(this,"createBkgColorItem",()=>{const t=B("div",["cell-background-color-item"],null);B("span",[],t,_.t("table.cellBackground"));const e=this.getSelectedBkgColorIndex();B("button",["item-button"],t).setAttribute("data-color-index",`${e}`);const i=B("span",["item-sub-indicator"],t);return i.innerHTML=qC,t});m(this,"handleCommand",t=>{var i;p(ur,this.activeTableBlock,"no target table block");const e=((i=t.states)==null?void 0:i.includes("checked"))||!1,r=t.value;switch(t.id){case"delete-select-row":pE(MT(this.editor,this.activeTableBlock,!1));break;case"delete-select-col":gE(MT(this.editor,this.activeTableBlock,!0));break;case"merge-cell":IT(this.editor.selection.range);break;case"split-cell":this.handleSplitCell();break;case"row-title":this.handleRowTitle(e);break;case"col-title":this.handleColTitle(e);break;case"stripe-style":this.handleStripeStyle(e);break;case"hide-border":RN(this.editor,this.activeTableBlock,r==="show-border");break;case"show-chart":LN(this.editor,this.activeTableBlock,r==="show-chart"),BE(this.editor,this.activeTableBlock,{updateNow:!0});break}});m(this,"handleToolbarClose",()=>{this.targetButton&&ct(this.targetButton,"active"),(this.markedRowAsDanger||this.markedColAsDanger)&&this.activeTableBlock&&pd(this.editor,this.editor.selection.range)===this.activeTableBlock&&(ml(this.editor,this.activeTableBlock,!1),gl(this.editor,this.activeTableBlock,!1),this.resetAsDangerMarked()),this.editor.focus()});m(this,"handleSelectionChange",(t,e)=>{if(!!t.isVisible)if(p(ur,this.activeTableBlock,"no target table block"),e==="cell-background-color"&&this.handleBeforePopupPalette(),e==="delete-select-row"){if(this.markedRowAsDanger)return;ml(this.editor,this.activeTableBlock,!0,!1),gl(this.editor,this.activeTableBlock,!0,!1),this.resetAsDangerMarked(),this.markedRowAsDanger=!0}else if(e==="delete-select-col"){if(this.markedColAsDanger)return;ml(this.editor,this.activeTableBlock,!0,!0),gl(this.editor,this.activeTableBlock,!0,!0),this.resetAsDangerMarked(),this.markedColAsDanger=!0}else ml(this.editor,this.activeTableBlock,!1),gl(this.editor,this.activeTableBlock,!1),this.resetAsDangerMarked()});m(this,"handleClick",(t,e)=>{var r;p(ur,this.activeTableBlock,"no target table block"),p(ur,this.targetButton,"no target button"),qk(this.editor),Mt(this.targetButton,"active")?(ct(this.targetButton,"active"),(r=this.manualMenu)==null||r.close("clickItem")):(q(this.targetButton,"active"),this.manualMenu?this.manualMenu.updateItems(this.createCommandMenu()):(this.manualMenu=new dl(this.createCommandMenu(),void 0,{id:"table-cell-menu"}),this.manualMenu.on("click",(i,s)=>{var o;this.handleCommand(s),(o=this.manualMenu)==null||o.close("clickItem")}),this.manualMenu.on("selectionChange",this.handleSelectionChange),this.manualMenu.on("close",this.handleToolbarClose)),this.manualMenu.manualShow(this.targetButton,{placement:"right-start"})),e.stopPropagation()});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChanged),this.editor.addListener("readonlyChanged",this.handleReadonlyChanged)}destroy(){var t,e;this.activeTableBlock=null,this.targetButton=null,this.editor.removeListener("selectionChanged",this.handleSelectionChanged),this.editor.removeListener("readonlyChanged",this.handleReadonlyChanged),(t=this.manualMenu)==null||t.destroy(),(e=this.colorPaletteItem)==null||e.destroy()}hide(){var t;(t=this.manualMenu)==null||t.close("cancelBar"),this.targetButton&&(ct(this.targetButton,"active"),this.targetButton.style.display="none")}getCellByChildBlockId(t,e){let r=this.editor.getBlockById(e);for(;r;){const i=r.closest("td");p(ur,i,"no parent cell");const s=et(i);if(p(ur,s,"no parent block"),cn(s)===t.table)return t.getCellByCellElement(i);r=s}return p(ur,!1,"filed to get cell by child block id"),null}createTargetButton(t){this.targetButton?t.querySelector(`:scope > .${bE}`)||t.appendChild(this.targetButton):(this.targetButton=B("button",[bE],t),this.targetButton.innerHTML=Cm,this.editor.domEvents.addEventListener(this.targetButton,"click",this.handleClick),this.editor.domEvents.addEventListener(this.targetButton,"mousedown",this.handlePrevent),this.editor.domEvents.addEventListener(this.targetButton,"dblclick",this.handlePrevent))}showCellMenuButton(t){this.createTargetButton(t.cell),p(ur,this.targetButton,"no target button"),this.targetButton.style.display="inline-block"}handleSplitCell(){if(this.activeTableBlock){const t=Kt.fromBlock(this.activeTableBlock),e=this.editor.selection.range;if(e.isSimple()){const{col:r,row:i}=this.getCellByChildBlockId(t,e.start.blockId);EE(this.editor,this.activeTableBlock,{col:r,row:i})}else AE(this.editor.selection.range)}}getSelectedBkgColorIndex(){var o;p(ur,this.activeTableBlock,"no target table block");const t=this.editor.selection.range,e=hl(this.editor,this.activeTableBlock,t.focus),r=this.editor.getBlockData(this.activeTableBlock),i=e.childContainerId,s=r[`${i}_background`];return s?Number.parseInt((o=s.substring(aV.length))!=null?o:"0",10):-1}createCommandMenu(){p(ur,this.activeTableBlock,"no target table block");const t=this.editor.getBlockData(this.activeTableBlock),e=LT(this.editor,this.activeTableBlock,this.editor.selection.range);let r=this.editor.selection.range;if(r.isSimple()){const h=hl(this.editor,this.activeTableBlock,r.start);r=gn(this.editor,{anchor:h,focus:h})}const i=ST(this.editor,this.activeTableBlock,r),s=t.hasRowTitle,o=t.hasColTitle,l=t.isStripeStyle,c=t.noBorder,d=t.chart;return this.colorPaletteItem=new vT("cell-background-color",{color:!1}),this.colorPaletteItem.palette.on("onClick",(h,C)=>{var E;switch(p(ur,this.activeTableBlock,"no target table block"),h){case"clearColor":NT(this.editor,this.activeTableBlock,-1);break;case"backgroundColor":NT(this.editor,this.activeTableBlock,C);break}(E=this.manualMenu)==null||E.close("clickItem")}),[{id:"cell-background-color",name:_.t("table.cellBackground"),element:this.createBkgColorItem(),children:[this.colorPaletteItem]},{id:"separator",name:"",type:"separator"},{id:"merge-cell",name:_.t("table.mergeCell"),states:e?[]:["disabled"]},{id:"split-cell",name:_.t("table.splitCell"),states:i?[]:["disabled"]},{id:"separator",name:"",type:"separator"},{id:"delete-select-row",name:_.t("table.deleteSelectRow")},{id:"delete-select-col",name:_.t("table.deleteSelectCol")},{id:"separator",name:"",type:"separator"},{id:"table-config",name:_.t("table.tableConfigKey"),children:[{id:"row-title",name:_.t("table.tableConfig.rowTitle"),states:s?["checked"]:[]},{id:"col-title",name:_.t("table.tableConfig.colTitle"),states:o?["checked"]:[]},{id:"stripe-style",name:_.t("table.tableConfig.stripeStyle"),states:l?["checked"]:[]},{id:"hide-border",name:c?_.t("table.tableConfig.showBorder"):_.t("table.tableConfig.hideBorder"),value:c?"show-border":"hide-border"},{id:"show-chart",name:d?_.t("table.tableConfig.hideChart"):_.t("table.tableConfig.showChart"),value:d?"hide-chart":"show-chart"}]}]}handleRowTitle(t){p(ur,this.activeTableBlock,"no target table block"),t?yN(this.editor,this.activeTableBlock):BN(this.editor,this.activeTableBlock)}handleColTitle(t){p(ur,this.activeTableBlock,"no target table block"),t?vN(this.editor,this.activeTableBlock):bN(this.editor,this.activeTableBlock)}handleStripeStyle(t){p(ur,this.activeTableBlock,"no target table block"),t?kN(this.editor,this.activeTableBlock):TN(this.editor,this.activeTableBlock)}}function nR(n){n.addCustom("table-cell-menu",t=>new cV(t))}const rR=D("table-container");function iA(n){const t=n.closest("td");return p(rR,t,"no parent cell for a table cell container"),t}function iR(n){const t=cn(n);return Array.from(t.querySelectorAll(':scope > tbody > tr > td > [data-type="editor-container"].child'))}function sA(n,t,e,r){const i=Kt.fromBlock(n),s=i.getCellByContainerId(pt(t));if(e==="ArrowDown"){const o=i.getBottomCell(s);return o?o.container:null}if(e==="ArrowUp"){const o=i.getTopCell(s);return o?o.container:null}if(e==="ArrowLeft"){const o=i.getLeftCell(s);if(!o)return null;const l=o.container;return r!=null&&r.noWrap&&o.row!==s.row?null:l}if(e==="ArrowRight"){const o=i.getRightCell(s);if(!o)return null;const l=o.container;return r!=null&&r.noWrap&&o.row!==s.row?null:l}p(rR,!1,`invalid navigation type: ${e}`)}const uV=12,fV=90,og=23,sR=2;class dV{constructor(t){m(this,"scrollTableBlock",null);m(this,"autoScrollDir",null);m(this,"autoScrollTimer",null);m(this,"handleMouseDown",t=>{const e=Oe(t.clientX,t.clientY,{noFilter:!0});if(e&&e instanceof HTMLElement){const r=et(e);if(r&&Ce(this.editor.rootContainer,r)){const i=no(r);i&&(this.scrollTableBlock=i,document.addEventListener("mousemove",this.handleAutoScroll))}}});m(this,"handleAutoScroll",i9.default(t=>{if(this.scrollTableBlock){const e=this.editor.getCustom(ls(this.scrollTableBlock)),r=e.rootElement,i=e.scrollOptions.parentContainer,s=r.getBoundingClientRect(),o=window.innerHeight-this.getBarFloatWindowBottom(e),l=i.getBoundingClientRect(),c=Math.min(l.bottom,o),d=Math.max(l.top,0);s.bottom>c&&t.clientY>=c?this.setAutoScroll("bottom"):s.top<d&&t.clientY<=d?this.setAutoScroll("top"):r.scrollLeft>0&&t.clientX<s.left?this.setAutoScroll("left"):r.scrollLeft<r.scrollWidth-r.offsetWidth&&t.clientX>s.right?this.setAutoScroll("right"):this.clearAutoScroll()}},15));m(this,"handleMouseUp",()=>{document.removeEventListener("mousemove",this.handleAutoScroll),setTimeout(()=>{this.scrollTableBlock=null})});m(this,"handleSelectionChanged",t=>{const e=t.selection.range;if(e.isCollapsed()&&e.isSimple()){const r=t.getBlockById(e.start.blockId),i=no(r);if(i){const s=t.getCustom(ls(i)),o=s.rootElement.getBoundingClientRect(),l=Jo(t,r,e.start);if(o.left>l.left){const c=e.start.offset===0?uV:sR;s.rootElement.scrollLeft-=o.left-l.left+c}else if(l.right>o.right){const c=e.start.offset===0?fV:sR;s.rootElement.scrollLeft+=l.right-o.right+c}}}else{const r=t.getBlockById(e.start.blockId),i=no(r),s=t.getBlockById(e.end.blockId),o=no(s);if(i&&i===o){const l=t.getCustom(ls(i)),c=l.rootElement.getBoundingClientRect();let d=null;if(e.isSimple())d=e.isReverse()?Jo(t,r,e.start):Jo(t,s,e.end);else{const h=iA(gi(t,e.start.childContainerId)),C=iA(gi(t,e.end.childContainerId));d=e.isReverse()?h.getBoundingClientRect():C.getBoundingClientRect()}c.left>d.left&&e.isReverse()?l.rootElement.scrollLeft-=c.left-d.left:c.right<d.right&&!e.isReverse()&&(l.rootElement.scrollLeft+=d.right-c.right)}}});m(this,"handleScroll",t=>{kT(t),this.editor.selection.caret.update()});m(this,"handleReset",t=>{kT(t),this.editor.selection.caret.update();const e=this.editor.findCustom("table-border-bar");e&&e.handleScroll(),Yk(t)});this.editor=t,this.editor.addListener("selectionChanged",this.handleSelectionChanged),document.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mouseup",this.handleMouseUp)}getBarFloatWindowBottom(t){return t.scrollOptions.barFloatWindowBottom?typeof t.scrollOptions.barFloatWindowBottom=="number"?t.scrollOptions.barFloatWindowBottom:t.scrollOptions.barFloatWindowBottom():0}clearAutoScroll(){this.autoScrollTimer&&(clearInterval(this.autoScrollTimer),this.autoScrollTimer=null,this.autoScrollDir=null)}setAutoScroll(t){this.autoScrollDir&&this.autoScrollDir!==t&&this.clearAutoScroll(),this.autoScrollTimer||(this.autoScrollDir=t,this.autoScrollTimer=window.setInterval(()=>{if(this.scrollTableBlock){const e=this.editor.getCustom(ls(this.scrollTableBlock)),r=e.rootElement,i=e.scrollOptions.parentContainer,s=r.getBoundingClientRect(),o=i===document.documentElement?window.innerHeight:i.offsetHeight,l=window.innerHeight-this.getBarFloatWindowBottom(e),c=i.getBoundingClientRect(),d=Math.min(c.bottom,l),h=Math.max(c.top,0);this.autoScrollDir==="left"&&(r.scrollLeft-=og,r.scrollLeft<=0&&this.clearAutoScroll()),this.autoScrollDir==="right"&&(r.scrollLeft+=og,r.scrollLeft>=r.scrollWidth-r.offsetWidth&&this.clearAutoScroll()),this.autoScrollDir==="bottom"&&(i.scrollTop+=og,(i.scrollTop>=i.scrollHeight-o||s.bottom<=d)&&this.clearAutoScroll()),this.autoScrollDir==="top"&&(i.scrollTop-=og,(i.scrollTop<=0||s.top>=h)&&this.clearAutoScroll())}},100))}destroy(){document.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mouseup",this.handleMouseUp),this.editor.removeListener("selectionChanged",this.handleSelectionChanged)}}function oR(n){return n.addCustom("table-scroll-events",t=>new dV(t))}const hV=D("table-doc-change-handler");class mV{constructor(t){this.editor=t,this.editor.addListener("docChanged",this.handleDocChanged)}handleDocChanged(t,e){if(!e){const{start:r,end:i}=t.selection.range;if(!t.findBlockById(r.blockId)||!t.findBlockById(i.blockId)){t.selection.selectBlock(t.getBlockByIndex("root",0),0);return}if(fa(r)){const s=t.getBlockById(r.blockId);if(!un(s))return;if(p(hV,fa(i),"invalid range"),!kf(t,r.childContainerId)||!kf(t,i.childContainerId)){t.selection.selectBlock(s,0);return}let o=null,l=null;const c=(d,h)=>{const C=h.getCellById(d.childContainerId),{colIndex:E=0,rowIndex:A=0}=d.custom;let v=-1,S=-1;return(C.col>E||C.col+C.colSpan-1<E)&&(v=C.col),(C.row>A||C.row+C.rowSpan-1<A)&&(S=C.row),v!==-1||S!==-1?_e(s,d.childContainerId,{colIndex:v===-1?E:v,rowIndex:S===-1?A:S}):null};if(r.custom){const d=Kt.fromBlock(s);o=c(r,d),l=c(i,d)}(o!==null||l!==null)&&(t.selection.range.isReverse()?t.selection.setSelection(l!=null?l:i,o!=null?o:r):t.selection.setSelection(o!=null?o:r,l!=null?l:i))}}}destroy(){this.editor.removeListener("docChanged",this.handleDocChanged)}}function lR(n){n.addCustom("table-doc-change-handler",t=>new mV(t))}const us=D("create-content");function aR(n,t,e){var C;const r=new Dm(e),i=e.rows,s=e.cols;p(us,i>=1,`invalid rows: ${i}`),p(us,s>=1,`invalid cols: ${s}`),p(us,e.children,"no table children");const o=B("table",[],null),l=(C=e.colsWidth)!=null?C:new Array(e.cols).fill(0),c=B("colgroup",[],o);for(let E=0;E<r.colCount;E++){const A=B("col",[],c);l[E]&&(A.style.width=`${l[E]}px`,A.style.minWidth=`${l[E]}px`)}const d=B("tbody",[],o);let h=0;for(let E=0;E<i;E++){const A=B("tr",[],d);for(let v=0;v<s;v++){const S=r.getCell({col:v,row:E});if(S.virtual)p(us,S.colSpan>1||S.rowSpan>1,"virtual cell should have colSpan or rowSpan");else{const w=e.children[h],O=B("td",[],A);S.colSpan>1&&(O.colSpan=S.colSpan),S.rowSpan>1&&(O.rowSpan=S.rowSpan);const M=e[Ad(w)];M&&q(O,M),v===0&&e.hasColTitle&&q(O,DT.COL_TITLE_ITEM),n.createChildContainer(t,O,w),h+=1}}}return p(us,h===e.children.length,"container count mismatch"),o.style.minWidth=`${l.reduce((E,A)=>A+E,0)}px`,e.noBorder&&q(o,"no-border"),e.chart&&q(o,"editor-table-chart"),e.isStripeStyle&&q(o,"stripe"),e.hasRowTitle&&q(o,"row-title"),e.hasColTitle&&q(o,"col-title"),o}function gV(n,t,e,r,i){p(us,i.type==="table","not table data"),p(us,pt(e)===t[t.length-1].containerId,"invalid path");const s=i,o=ca(r,"div");try{const l=B("div",[],null);l.setAttribute("data-type","table-content");const c=aR(n,t,s);c.classList.add("drag-preview-element"),l.appendChild(c);const d=n.getComponentOptions("table");QT(n),tk(n),eR(n,"create"),lR(n),d!=null&&d.hideCellMenu||nR(n),c2(n,yE);const h=n.addCustom(ls(r),()=>eP());h.init({parentElement:o,childElement:l,safeRightSpace:50,safeLeftSpace:40,parentContainer:re(e)?n.scrollContainer:e,locatingContainer:re(e)?(d==null?void 0:d.locatingContainer)||n.parent:e,paddingLeft:cu+Ed,paddingTop:cu+Ed,paddingBottom:Ed/2,paddingRight:Ed/2,barFloatWindowBottom:d==null?void 0:d.barFloatWindowBottom,allowScrollBarFixed:d==null?void 0:d.allowScrollBarFixed,isSetScale:d==null?void 0:d.isSetScale});const C=oR(n);h.on("scroll",C.handleReset),h.on("resize",C.handleReset),setTimeout(()=>{_N(n,r)})}catch{const c=`invalid table data: ${JSON.stringify(s)}`;us.error(c);const d=B("div",["error"],o);d.innerText=c}return o}function pV(n,t,e){p(us,e.type==="table","not table data");const r=e,i=zt(t);try{const s=cn(t),o=Zo(t),l=aR(n,o,r);l.classList.add("drag-preview-element"),s.insertAdjacentElement("afterend",l),s.remove();const c=n.getComponentOptions("table");QT(n),tk(n),eR(n,"update"),lR(n),c!=null&&c.hideCellMenu||nR(n),yE(n,void 0,t)}catch{const o=`invalid table data: ${JSON.stringify(r)}`;us.error(o);const l=B("div",["error"],i);l.innerText=o}}function CV(n,t){let e,r,i=!1;if([...t].every(E=>E==="|")?(r=t.length,e=Array(r).fill(""),i=!0):(e=Np(t,"|").split("|"),r=e.length),r<2)return null;const s=3,o=r,l=[];for(let E=0;E<3;E++)e.forEach(A=>{l.push(Xs(n.doc,E===0?A:""))});const c=Array(o).fill(RE),d=l[i?0:o],h=n.doc.getContainerBlocks(d)[0].id;return{blockData:{id:it(),type:"table",rows:s,cols:o,children:l,colsWidth:c},focusBlockId:h}}function EV(n,t){const e=t.rows,r=t.cols;if(e<1||r<1)return null;const i=[];for(let d=0;d<e;d++)for(let h=0;h<r;h++)i.push(Xs(n.doc));const s=Array(r).fill(RE),o=i[0],l=n.doc.getContainerBlocks(o)[0].id;return{blockData:{id:it(),type:"table",rows:e,cols:r,children:i,colsWidth:s},focusBlockId:l}}const oA=D("get-selected-containers");function cR(n,t,e,r){p(oA,e.blockId===r.blockId,"only allow select in single table block"),p(oA,dt(t)===e.blockId,"only allow select in single table block");const i=Kt.fromBlock(t),s=i.getCellByContainerId(e.childContainerId),o=i.getCellByContainerId(r.childContainerId);if(e.custom===void 0||r.custom===void 0)return i.getCells(s,o).map(w=>i.getCellContainer(w));const{fromCol:l,toCol:c,fromRow:d,toRow:h}=Si(t,e,r),C=new Set,E=[];return i.sub({row:d,col:l},{row:h,col:c}).forEach(v=>{v.forEach(S=>{const w=i.getCellByContainerId(S.containerId);w.col<l||w.row<d||w.col+w.colSpan-1>c||w.row+w.rowSpan-1>h||C.has(S.containerId)||(C.add(S.containerId),E.push(w.container))})}),E}function AV(n,t,e){p(oA,t.blockId===e.blockId,"only allow select in single table block");const r=n.getBlockById(t.blockId);return cR(n,r,t,e)}const uR=D("table-selection-to-doc");function xV(n,t){const{start:e,end:r,block:i}=t,s=Ot(i);p(uR,s==="table",`invalid block type: ${s}`);const o=n.getBlockData(i);if(e.isSimple()&&r.isSimple())return sl(n.editorBlocks,n.doc.toJSON(),o);p(uR,!e.isSimple()&&!r.isSimple(),"invalid block pos type");const l=Kt.fromBlock(i),{fromCol:c,toCol:d,fromRow:h,toRow:C}=Si(i,e,r),E={},A=[],v=n.doc.toJSON();let S={};l.sub({row:h,col:c},{row:C,col:d}).forEach((X,ut)=>{X.forEach((xt,bt)=>{const wt=xt.containerId;if(A.indexOf(wt)!==-1)return;A.push(wt);let Tt;if(xt.virtual){const fe=l.getCellByContainerId(xt.containerId),Lr=c+bt;let fr=fe.col+fe.colSpan-1;fr>d&&(fr=d);const He=fr-Lr+1;He>1&&(E[`${wt}_colSpan`]=He);const yn=h+ut;let Zn=fe.row+fe.rowSpan-1;Zn>C&&(Zn=C);const dr=Zn-yn+1;dr>1&&(E[`${wt}_rowSpan`]=dr),Tt=qs()}else{if(Tt=nC(n.editorBlocks,v,wt),xt.col+xt.colSpan>d+1){const fe=d-xt.col+1;fe>1&&(E[`${wt}_colSpan`]=fe)}else xt.colSpan>1&&(E[`${wt}_colSpan`]=xt.colSpan);if(xt.row+xt.rowSpan>C+1){const fe=C-xt.row+1;fe>1&&(E[`${wt}_rowSpan`]=fe)}else xt.rowSpan>1&&(E[`${wt}_rowSpan`]=xt.rowSpan)}const{root:ie,...Ee}=Tt.blocks;S={...S,...Ee,[wt]:ie}})});const O=yd(cn(i)).slice(c,d+1);return{blocks:{root:[{id:it(),type:s,children:A,colsWidth:O,rows:C-h+1,cols:d-c+1,...E}],...S},meta:{},comments:{}}}const bV=D("ajust-selection-pos");function vV(n,t){if(t.top===0)return!0;for(let e=t.left;e<=t.right;e++)if(n[t.top-1][e]===n[t.top][e])return!1;return!0}function BV(n,t){if(t.left===0)return!0;for(let e=t.top;e<=t.bottom;e++)if(n[e][t.left-1]===n[e][t.left])return!1;return!0}function yV(n,t){if(t.bottom===n.length-1)return!0;for(let e=t.left;e<=t.right;e++)if(n[t.bottom][e]===n[t.bottom+1][e])return!1;return!0}function TV(n,t){if(t.right===n[0].length-1)return!0;for(let e=t.top;e<=t.bottom;e++)if(n[e][t.right]===n[e][t.right+1])return!1;return!0}function kV(n,t,e){const r=t.col,i=t.row,s=e.col,o=e.row,l={left:r,top:i,right:s,bottom:o};let c=!1;do{if(c=!1,!vV(n,l)){l.top--,c=!0;continue}if(!BV(n,l)){l.left--,c=!0;continue}if(!yV(n,l)){l.bottom++,c=!0;continue}if(!TV(n,l)){l.right++,c=!0;continue}}while(c);return l}function RV(n,t,e,r){if(e.custom!==void 0||r.custom!==void 0)return{anchor:e,focus:r};const i=Kt.fromBlock(t),s=i.map(V=>V.containerId),o=i.getCellByContainerId(e.childContainerId),l=i.getCellByContainerId(r.childContainerId),c=Math.min(o.row,l.row),d=Math.max(o.row,l.row),h=Math.min(o.col,l.col),C=Math.max(o.col,l.col),E=kV(s,{row:c,col:h},{row:d,col:C}),A=i.getCell({row:E.top,col:E.left}),v=i.getCell({row:E.bottom,col:E.right}),S=i.getCell({row:E.top,col:E.right}),w=i.getCell({row:E.bottom,col:E.left});let O,M;return o.row<=l.row?o.col<=l.col?(O=A,M=v):(O=S,M=w):o.col<l.col?(O=w,M=S):(O=v,M=A),bV.debug(`move ${O.col}, ${O.row}, -> ${M.col}, ${M.row}`),{anchor:_e(t,O.containerId),focus:_e(t,M.containerId)}}function fR(n,t,e){if(e.isSimple())return[cn(t).getBoundingClientRect()];const r=cn(t),i=r.getBoundingClientRect(),{fromCol:s,fromRow:o,toCol:l,toRow:c}=Si(t,e.start,e.end),d=yd(r),h=d.slice(0,s).reduce((S,w)=>S+w,0),C=h+d.slice(s,l+1).reduce((S,w)=>S+w,0),E=Xk(r);let A=E.slice(0,o).reduce((S,w)=>S+w,0);const v=A+E.slice(o,c+1).reduce((S,w)=>S+w,0);if(o===0){const S=rV(n,t);A-=S}return[new DOMRect(i.left+h,i.top+A,C-h,v-A)]}D("table-size");const wV=40;function lg(n){const t=n.querySelector("td");if(!t)return 0;const e=window.getComputedStyle(t),r=Number.parseInt(e.borderLeft,10),i=Number.parseInt(e.borderRight,10);return(r+i)/2}function SV(n,t,e){const r=f1(n,e.container);return r!==void 0?r+lg(t):wV*e.colSpan-lg(t)}function LV(n,t,e,r){let i=0;const s=e.colCount;for(let o=0;o<s;o++){const l=e.getCell({col:o,row:r});if(l.virtual)continue;let c=SV(n,t,l);const d=n3(l.container,{withPadding:!0});d&&d>c&&(c=d),i+=c+lg(t)}return i}function IV(n,t){const e=cn(t),r=Kt.fromTable(e);let i=0;for(let o=0;o<r.rowCount;o++)i=Math.max(i,LV(n,e,r,o));const s=lg(e);return i+=s,i}const ro=D("table-creator");async function DV(n,t){return n.undoManager.runInGroup(()=>{var c,d;const e=t.item,r=(c=e.colCount)!=null?c:5,i=(d=e.rowCount)!=null?d:3,s=EV(n,{cols:r,rows:i});if(!s)return null;const{blockData:o,focusBlockId:l}=s;return n.insertBlock(t.containerId,t.blockIndex,o,Pe(n,l,0))})}class _V{constructor(){m(this,"id","insert-table");m(this,"name","Create table");m(this,"element");m(this,"closeable",null);m(this,"colCount");m(this,"rowCount");m(this,"setCloseable",t=>{this.closeable=t});m(this,"destroy",()=>{this.closeable=null});m(this,"getTableCreatorCellId",(t,e)=>`table-creator-cell-${t}-${e}`);m(this,"handleTableCreatorClick",t=>{var E,A;t.preventDefault(),t.stopPropagation();const e=t.target;p(ro,e instanceof HTMLElement,"invalid event target");const r=e.closest(".table-creator");p(ro,r,"no table creator");const i=r.querySelectorAll(".active");if(i.length===0)return;const o=i[i.length-1].id;p(ro,o,"no cell id");const l="table-creator-cell-";if(!o.startsWith(l))return;const d=o.substring(l.length).split("-");p(ro,d.length===2,"invalid cell id");const h=Number.parseInt(d[0],10)+1,C=Number.parseInt(d[1],10)+1;ro.debug(`${h}, ${C}`),this.colCount=C,this.rowCount=h,(E=this.closeable)==null||E.click(this,this.element),(A=this.closeable)==null||A.close("clickItem"),this.handleTableCreatorLeave()});m(this,"handleTableCreatorLeave",()=>{for(let t=0;t<9;t++)for(let e=0;e<9;e++){const r=this.getTableCreatorCellId(t,e),i=document.getElementById(r);i&&ct(i,"active")}});m(this,"handleTableCreatorCellEnter",t=>{const e=t.target;p(ro,e instanceof HTMLElement,"invalid event target");const r=e.id,i="table-creator-cell-";p(ro,r.startsWith(i),"invalid cell id");const o=r.substring(i.length).split("-");p(ro,o.length===2,"invalid cell id");let l=Number.parseInt(o[0],10),c=Number.parseInt(o[1],10);l===0&&c===0&&(l=-1,c=-1);for(let d=0;d<9;d++)for(let h=0;h<9;h++){const C=this.getTableCreatorCellId(d,h),E=document.getElementById(C);p(ro,E,"no cell"),d<=l&&h<=c?q(E,"active"):ct(E,"active")}});this.element=this.createTableCreatorElement()}createTableCreatorElement(){const t=B("div",["table-creator"],null),e=(r,i,s)=>{const o=B("div",["table-creator-cell"],r);return o.id=this.getTableCreatorCellId(i,s),o};t.addEventListener("click",this.handleTableCreatorClick),t.addEventListener("mouseleave",this.handleTableCreatorLeave);for(let r=0;r<9;r++){const i=B("div",["table-creator-row"],t);for(let s=0;s<9;s++)e(i,r,s).addEventListener("mouseenter",this.handleTableCreatorCellEnter)}return t}}function MV(){return new _V}function UV(n){const t=/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/g,e=n.match(t);return e?e.length:0}function dR(n){const t=UV(n);return n.length+t}function OV(n,t,e=[]){let r=0;if(!e||e.length===0)return r;for(let i=n;i<n+t;i+=1)r+=e[i]||0;return r}function NV(n,t){const e=dR(n),r=t-e;return r>0?n+" ".repeat(r):n}function PV(n,t,e,r,i){var l;const s=t,o=new Dm(s);if(r==="markdown"||r==="text"){const c=O=>e.blocks[O].map((nt,Y)=>r==="markdown"?j0(n,nt,e,[...i,{containerId:O,blockIndex:Y}]):H0(n,nt,e,[...i,{containerId:O,blockIndex:Y}])),d=O=>c(O).join(" ").replace(/\n/g," ").trim(),h=new Map,C=new Map;for(let O=0;O<o.colCount;O++){let M=0;for(let V=0;V<o.rowCount;V++){const nt=o.getCell({row:V,col:O});let Y="";nt.virtual||(Y=d(nt.containerId)),h.set(`${V},${O}`,Y),M=Math.max(M,dR(Y))}C.set(O,M)}const E=O=>{const M=h.get(`${O.row},${O.col}`)||"",V=C.get(O.col)||0;return NV(M,V)};if(r==="text"){const O=[];for(let M=0;M<o.colCount;M++){const V=E({row:0,col:M});O.push(V)}for(let M=1;M<o.rowCount;M++)for(let V=0;V<o.colCount;V++){const nt=E({row:M,col:V});O.push(nt)}return O.join(`
|
|
643
643
|
`)}const A=[];let v="|",S="|";for(let O=0;O<o.colCount;O++){const M=E({row:0,col:O});v+=` ${M} |`;const V="-".repeat((C.get(O)||0)+2);S+=`${V}|`}A.push(v),A.push(S);for(let O=1;O<o.rowCount;O++){let M="|";for(let V=0;V<o.colCount;V++){const nt=E({row:O,col:V});M+=` ${nt} |`}A.push(M)}return`${A.join(`
|
|
644
644
|
`)}
|
|
645
645
|
`}if(r==="html"){const c=C=>e.blocks[C].map((v,S)=>G1(n,v,e,[...i,{containerId:C,blockIndex:S}])).join(`
|
|
@@ -960,4 +960,4 @@ ${s.mermaidText}
|
|
|
960
960
|
${s.flowchartText}
|
|
961
961
|
\`\`\`\`\`\``}return""}const wJ={embedType:"flowchart",convertFrom:TJ,handleUpdateBlock:yJ,createEmbedContent:BJ,getBlockProperties:kJ,convertTo:RJ},SJ=D("plantuml-helper");function RS(n,t){var l;let r=((l=(n.getComponentOptions("plantuml")||{}).cdn)==null?void 0:l.plantuml)||oJ;r.endsWith("/")||(r+="/");const i=o9.default.encode(t);p(SJ,i,i),r+=i;const o=new URLSearchParams(document.location.search).get("doc");return Fp(r,{id:`${o}-${it()}`})}async function LJ(n,t){try{const e=await Ex(n,t);return(await n.doc.uploadResource(e)).resourceId}catch{return Promise.resolve(t)}}class Mu extends vx{constructor(t){super(t,"plantuml","plantumlText")}static get(t,e){return t.addCustom(`plantuml-${e.id}`,()=>new Mu(t))}code2ObjectUrl(t){return Promise.resolve(RS(this.editor,t))}code2ResourceId(t){const e=RS(this.editor,t);return LJ(this.editor,e)}destroy(){}}function IJ(n,t,e){Mu.get(n,e).createEmbedContent(t,e)}function DJ(n,t,e){const r=Mu.get(n,e),i=zt(t);return r.updateEmbedContent(i,e),!0}function _J(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 MJ(n,t){return Mu.get(n,n.getBlockData(t)).getBlockProperties(t)}function UJ(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`})`;if(s.flowchartText)return`\`\`\`plantuml\`\`\`
|
|
962
962
|
${s.flowchartText}
|
|
963
|
-
\`\`\`\`\`\``}return""}const OJ={embedType:"plantuml",convertFrom:_J,handleUpdateBlock:DJ,createEmbedContent:IJ,getBlockProperties:MJ,convertTo:UJ},$at="",NJ="hr",PJ={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},FJ={dividingLine:{type:"Dividing-Line",abstract:"Dividing-Line"}},KJ={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};_.mergeLang({"zh-CN":PJ,"en-US":FJ,"ja-JP":KJ});function VJ(n,t){const e=B("div",["editor-embed-container"],t);B("hr",["editor-embed-hr"],e)}function $J(n,t,e,r){return r==="html"?"<hr />":r==="markdown"?"---":"------------"}function HJ(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:_.t("dividingLine.type"),icon:F2,order:500,group:"common",subText:Qn("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:r}=t;return n.insertEmbed(e,r,NJ,{})}}}function jJ(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 zJ(){return{abstract:_.t("dividingLine.abstract")}}const GJ={embedType:"hr",createEmbedContent:VJ,convertTo:$J,getOptions:HJ,convertFrom:jJ,getBlockProperties:zJ},Hat="",jat="",WJ={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"}}},qJ={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"}}},XJ={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":WJ,"en-US":qJ,"ja-JP":XJ});var Oi=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(Oi||{}),sh=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(sh||{});const wS=10*1024*1024,YJ=["wav","mp3","aac","ogg","webm","flac"],QJ=["ogg","mp4","webm"],JJ=()=>{};function SS(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:YJ,o=(E=e==null?void 0:e.video)!=null?E:QJ,l=(A=r==null?void 0:r.audio)!=null?A:wS,c=(v=r==null?void 0:r.video)!=null?v:wS,d=(S=i==null?void 0:i.onError)!=null?S:JJ;return{allowedMedias:{audio:s,video:o},maxSize:{audio:l,video:c},callbacks:{onError:d}}}function ZJ(n,t){const e=s=>s.map(o=>`.${o}`).join(","),{allowedMedias:r}=SS(n),i=r[t];return i?e(i):"*"}function tZ(n,t,e){const{maxSize:r,callbacks:i,allowedMedias:s}=SS(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 eZ(n){return n===sh.Empty||n===sh.Error}const En=D("media");class nZ 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=et(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(En,this.abstract,"no abstract"),p(En,this.mediaContainer,"The media element not exist");const{editor:r}=this.options,i=et(this.mediaContainer);p(En,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){En.error(o),this.emit("mediaError",r,"upload_error",s.id),this.renderRetry(e,o)}ct(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(En,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){p(En,this.abstract,"no abstract");const{editor:e,createMediaElement:r}=this.options,{mediaIcon:i,mediaName:s}=this.abstract;p(En,this.mediaContainer,"The media element not exist");const o=et(this.mediaContainer);p(En,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(En,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(En,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(En,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(l),this.setFullScreen()}renderProgress(e,r){p(En,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=et(this.mediaContainer);p(En,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(En,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(En,this.abstract,"no abstract"),p(En,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=et(r);if(C&&!s.readonly&&s.isBlockWritable(C)){const E=At.default(e);E.embedData.src=o,s.updateBlockData(C,E)}}}})}setFullScreen(){p(En,this.mediaContainer,"The media element not exist"),q(this.mediaContainer,"full-screen")}removeFullScreen(){p(En,this.mediaContainer,"The media element not exist"),ct(this.mediaContainer,"full-screen")}updateBlockAlign(e,r){const i=et(r);p(En,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),eZ(i)?i===sh.Empty&&this.renderEmpty(e):this.renderMediaElement(e,r)}setAbstract(e){this.abstract=e}}D("media-embed");const rZ="left";class LS{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=ZJ(t,this.embedType);if(s=s!=null?s:await Mc(o,{}),!s)return null;const{mediaType:l}=this.getAbstract();try{tZ(s,t,l)}catch{return null}const c={id:it(),type:"embed",embedType:this.embedType,embedData:{src:sh.Empty}};l==="video"&&(c.align=rZ);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 nZ({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:Qn(`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"?``:o}}function IS(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 DS(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const iZ=D("media-audio");class sZ extends LS{constructor(){super(...arguments);m(this,"embedType",Oi.AUDIO);m(this,"updateProgressElement",DS);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:O2,mediaName:_.t(`media.${Oi.AUDIO}.menuItem`),menuItem:_.t(`media.${Oi.AUDIO}.menuItem`),order:800,mediaType:Oi.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${_.t(`media.${Oi.AUDIO}.abstract`)}`}}updateMediaElement(e,r,i,s){const o=r.querySelector(":scope .audio-container > audio");return p(iZ,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",IS(e,r)}}const oZ=new sZ;D("video-resizer");function _S(n){return n&&Le(n)&&on(n)==="video"}const lZ=50;class Bx{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&_S(e)&&this.disableBlockResize(e),t&&_S(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,lZ),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,ze.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,ze.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 aZ=D("video");class cZ extends LS{constructor(){super(...arguments);m(this,"embedType",Oi.VIDEO);m(this,"updateProgressElement",DS);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 Bx(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,IS(e,r),_c(i).then(o=>{const l=e.querySelector(".progress-video");l&&i1(e)&&(l.src=o)})})}getAbstract(){return{mediaName:_.t(`media.${Oi.VIDEO}.menuItem`),mediaIcon:N2,menuItem:_.t(`media.${Oi.VIDEO}.menuItem`),order:700,mediaType:Oi.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`${_.t(`media.${Oi.VIDEO}.abstract`)}`}}handleMediaError(e,r,i){const s=e.addCustom("video-resizer",()=>new Bx(e)),o=e.getBlockById(i);s.disableBlockResize(o)}updateMediaElement(e,r,i,s){const o=r.querySelector(":scope .video-container > video");p(aZ,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 Bx(e)).updateResizer(l)}),o}}const uZ=new cZ,MS=[lA,gA,pA,Rk],yx=[BS,fQ,AJ,wJ,OJ,RK,GJ,uZ,oZ,Bz,tS,iX],US=[Fk,rS,k4];function fZ(n,t,e){var i,s,o,l;di.level=(i=e.logLevel)!=null?i:qo.DEBUG;const r=Jf(n,t,{components:{blocks:[...MS,...((s=e==null?void 0:e.components)==null?void 0:s.blocks)||[]],embeds:[...yx,...((o=e.components)==null?void 0:o.embeds)||[]],boxes:[...US,...((l=e.components)==null?void 0:l.boxes)||[]],textRenders:[new jE],options:{...e.componentsOptions}}});return r.readonly=!0,r.addCustom("heading-collapse",()=>new ax(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 OS{constructor(t){this.createOptions=t,t.lang&&_.setLang(t.lang)}createHistoryEditor(t,e){return fZ(t,e,this.createOptions)}}function NS(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:[rm],components:{blocks:o,commandProviders:[new Om],decorators:[new cg],embeds:l,boxes:c,options:s}});if(d.input.addHandler(new fg),d.input.addHandler(new UA(d)),d.input.addHandler(new VA(d)),d.input.addHandler(new mq(d)),d.input.addHandler(new gg),d.addCustom("image-paste-handler",()=>new MA(d)),xe.isMobile||d.addCustom("editor-tooltip",()=>new Sd(d)),n.options.enableContextMenu!==!1&&d.addCustom("editor-context-menu",E=>new jA(E)),(h=n.options.componentsOptions)!=null&&h.mention){const E=n.options.componentsOptions.mention;d.addCustom("mention",()=>new nS(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 dZ(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),r=new Set;e.forEach(i=>{const s=et(i);s&&r.add(s)}),r.forEach(i=>{gq(n,i,t)})}class hZ{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&&dZ(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 NS(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class mZ{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 $C(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 NS(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const gZ={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"}},pZ={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"}},CZ={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\u306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G1sL2l0ZW1Qcm9wczEueG1sUEsBAi0AFAAGAAgAAAAhAMEnywi2AAAAIQEAABMAAAAAAAAAAAAAAAAARjgAAGN1c3RvbVhtbC9pdGVtMS54bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAABVOQAAY3VzdG9tWG1sL19yZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAOuAYExTAwAAjw4AABIAAAAAAAAAAAAAAAAAWzsAAHdvcmQvZm9udFRhYmxlLnhtbFBLBQYAAAAADwAPANQDAADePgAAAAA=",AZ=()=>Kp(EZ),xZ=D("image-to-docx");async function bZ(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 PS(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};try{const e=await _c(new File([t],"",{})),r=await bZ(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){xZ.error(e);return}}function vZ(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 BZ(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 FS(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 yZ(){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 TZ(){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 kZ(){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 RZ=[{levels:FS(),reference:"number-numbering-reference"},{levels:yZ(),reference:"number-bullet-reference"},{levels:TZ(),reference:"checked-bullet-reference"},{levels:kZ(),reference:"unchecked-bullet-reference"}];function wZ(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 SZ(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 LZ(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 IZ=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function KS(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(IZ);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 VS(n,t,e){for(let r=0;r<=e;++r){const i=`${t}${r}`;if(Mn(n,i))return i}}function Pg(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function Tx(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function $S(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function DZ(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"&&Pg(n,"inline-style-font-size",o),s==="color"&&Pg(n,"inline-style-color",o),s==="background-color"&&Pg(n,"inline-style-background-color",o),s==="font-family"&&Pg(n,"inline-style-font-family",o)}}function _Z(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function MZ(n){const t=`${Mn(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function UZ(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 OZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function NZ(n){return Mn(n,"inline-style-font-family")}function PZ(n){const t=Mn(n,"inline-style-background-color");return KS(t)}function FZ(n){const t=Mn(n,"inline-style-color");return KS(t)}function KZ(n){DZ(n);const t=Mn(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!Mn(n,"style-code"),link:$S(Mn(n,"link")),size:MZ(n),text:t?OZ(n):UZ(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:NZ(n),background:PZ(n),color:t?"338fe5":wZ(VS(n,"style-color-",6))||FZ(n),highlight:VS(n,"style-bg-color-",13)}}function VZ(){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 $Z(){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 HZ(){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 jZ(n,t){return new Bt.Paragraph({children:[new Bt.ExternalHyperlink({children:[new Bt.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function HS(n){if(n.heading!=null)return`Heading${n.heading}`}function jS(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 zZ(n){if(n.indent)return{left:Bt.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Bt.convertInchesToTwip(.3*n.padding)}}function GZ(n){return{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function WZ(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function zS(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?WZ(n.fontFamily):void 0,shading:n.background?GZ(n.background):void 0,color:n.color,highlight:SZ(n.highlight)})}function qZ(n,t){if(n.link)return new Bt.ExternalHyperlink({children:[zS(n,t)],link:n.link})}async function GS(n,t,e,r,i){const[s]=await i(n,t,e);if(s==null)return;const o=await PS({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 XZ(n){if(n.heading||n.heading)return n.heading}function YZ(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function QZ(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function JZ(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(KZ(s))}return e}}function ZZ(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 ttt(n,t){if(n.type==="embed"&&n.embedType&&Tx(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 ett(n){if(n.padding)return n.padding}function ntt(n){return!!(n.type==="embed"&&n.embedType&&Tx(n.embedType)&&n.embedData&&n.embedData.src)}async function Fg(n,t,e){return{quoted:!!n.quoted,heading:XZ(n),alignment:YZ(n),indent:QZ(n),padding:ett(n),texts:await JZ(n,e),list:ZZ(n),images:ttt(n,t),border:ntt(n)}}async function rtt(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 Fg(l,e,r));i.push(o)}return i}const itt=D("to-docx");function stt(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 ott(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 ltt(n){p(itt,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=stt(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=LZ(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 ott(n,t,e,i),i}async function att(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 Fg(E,o,c);await r.addTextBlock(A);return}if(E.type==="code"){const A=await rtt(E,e,o,c);await r.addCodeBlockObject(A);return}if(E.type==="list"&&E.textOnly!==!0){const A=await Fg(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(Tx(S)){const w=await Fg(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($S(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=ltt(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 nt={id:M,type:"_exportVirtualBlock"};v.push(nt)}}return v}for(const E of t)for(const A of C(E))!A||await h(A)}function ctt(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const utt=D("to-docx");class ftt{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:HS(t),alignment:jS(t),children:await this.paragraphsFromBlockTexts(t),indent:zZ(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=_Z(this.defaultFontSize,t.heading),r=[];for(const i of t.texts){if(i.link){const s=qZ(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 GS(this.appId,this.docId,i.box.src,i.box.width,this.readImageFunc);s&&r.push(s);continue}if(i.math){const s=await GS(this.appId,this.docId,i.math,0,this.readImageFunc);s&&r.push(s);continue}r.push(zS(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=FS([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=HS(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 PS(c,d);if(C)return C}i.push(h)}));BZ(s,r,t.embedData);const o=vZ(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:jS(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(){VZ().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Bt.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push($Z())}addAudioPlaceholder(){this.paragraphs.push(HZ())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(jZ(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 dtt{constructor(t,e,r,i,s,o,l,c){m(this,"convertBlocks",async(t,e,r,i,s,o,l=720)=>{const c=new ftt(i,s,o,this.readImage,this.convertBlocks,this.defaultFontSize);return await att(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(utt,o,"data must have blocks");const l=ctt(),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:[...RZ,...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)}}const htt=D("editor-to-docx");async function mtt(n,t,e,r){const i=n.doc.buildResourceUrl(r,{withToken:!0});let s=await uS(i);if(!s)return[void 0,i];if(s.type.indexOf("/svg")!==-1){const l=await lS(s);l&&(s=new File([l],s.name))}return[await s.arrayBuffer(),i]}async function gtt(n,t,e){const r=n.editorBlocks.getBlockClass(e.type);if(r.toStandardDoc)try{return await r.toStandardDoc(n,e,t)}catch(i){htt.error(`toStandardDoc error: ${JSON.stringify(i)}`);return}}async function ptt(n,t){const e=t.attributes,r=n.editorBoxes.getBoxClass(e.type);if(r.toStandardText)return r.toStandardText(n,e)}async function Ctt(n,t){let{template:e,download:r,backgroundImageOptions:i}=t!=null?t:{};e||(e=AZ());const s=n.doc.toJSON(),o=(C,E,A)=>mtt(n,C,E,A),l=async(C,E,A)=>gtt(n,s,A),c=async C=>ptt(n,C),h=await new dtt(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",`${cS(n)}.docx`),E.setAttribute("href",`${C}`),E.click(),E.remove()}return h}const kx=D("create-editor");async function Ett(n,t){var o,l,c,d,h,C,E,A,v,S,w,O,M,V,nt,Y;p(kx,n,"app does not exists"),t.lang&&_.setLang(t.lang),di.level=(o=t.logLevel)!=null?o:qo.DEBUG;const e=t.onReauth?async()=>{var bt;const X=t.user.userId,ut=t.docId,xt=await((bt=t.onReauth)==null?void 0:bt.call(t,X,ut,t.permission));return{userId:X,docId:ut,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:[...MS,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...yx,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[...US,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new Om,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new cg,new jC],insertions:[H1],blockHooks:[new SA,new ew,...((C=t.components)==null?void 0:C.blockHooks)||[]],textRenders:[new E4,new jE,...((E=t.components)==null?void 0:E.textRenders)||[]],options:{...t.componentsOptions}},shortcuts:[kq,eH,hz,aA,jw,dF,nA,uX,rm,sF,...t.shortcuts||[]],colors:["#0064FF","#EB3723","#F59300","#00A865","#F25A0A","#70A310","#009CAD","#0990D9","#8851ED","#D62069"]});if(s.editorCommandProviders.registerCommandProvider(new ms(s)),s.input.addHandler(new ZX),s.input.addHandler(new fg),s.input.addHandler(new DK),s.input.addHandler(new sz),s.input.addHandler(new CA(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 rg(s,(v=t.componentsOptions)==null?void 0:v.quickMenu)),s.input.addHandler(new UA(s)),s.input.addHandler(new VA(s)),s.input.addHandler(new gg),s.input.addHandler(new kk),s.doc.registerCallback(new tY(s)),s.addCustom("remote-cursor",()=>new s2(s)),s.addCustom("block-menu",X=>new iw(X)),xe.isMobile||s.addCustom("editor-tooltip",()=>new Sd(s)),t!=null&&t.enableComments&&s.addCustom("editor-comments",X=>new C4(X,new hZ(X))),t.enableContextMenu!==!1&&s.addCustom("editor-context-menu",X=>new jA(X)),s.addCustom("create-options",()=>new Sb(s,t)),s.addCustom("drop-target",()=>new Wd(s)),s.addCustom("list-to-mindmap",()=>new Qm(s)),s.addCustom("list-to-mention",()=>new bY(s)),s.addCustom("mobile-helper",()=>new HY(s)),s.addCustom("code-caret",()=>new Q$(s)),s.addCustom("image-paste-handler",()=>new MA(s)),(S=t.componentsOptions)!=null&&S.mention){const X=t.componentsOptions.mention;s.addCustom("mention",()=>new nS(s,X))}if(s.addCustom("heading-collapse",()=>new ax(s)),s.addCustom(Og,X=>new gx(X)),Au.register(s),Wd.register(s),Sl.register(s),Bl.register(s),s.addListener("clickLink",(X,ut,xt)=>{var wt;if((wt=t==null?void 0:t.events)!=null&&wt.onClickLink){t.events.onClickLink(X,ut,xt);return}const bt=xt.getAttribute("link");bt&&(X.readonly||ut.ctrlKey||ut.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",ut=>{X(s,ut)})}return(Y=(nt=t.componentsOptions)==null?void 0:nt.templates)!=null&&Y.templates.length&&(s.addListener("docChanged",()=>{Ug(s)}),s.addListener("resize",()=>{Ug(s,{reset:!0})}),setTimeout(()=>{Ug(s)},100)),s.doc.registerCallback({onError:async X=>{if(X.code==="ResetDoc"){kx.error(`reset doc: ${X.message}`);const ut=await dd.load(r);s.doc.reset(ut)}}}),s.version="1.1.22-beta.1",di.level===qo.DEBUG&&(window.setReauthFail=X=>{window.isReauthError=X},window.reConnect=X=>s.doc.externalDoc.client.connection.reConnect(X)),s}function Att(n){return n.toJSON!==void 0}async function xtt(n,t,e){var s,o,l,c,d,h,C,E;p(kx,n,"app does not exists");const r=Att(t)?t:new vC(t,{serverUrl:e.serverUrl||""});e.lang&&_.setLang(e.lang),di.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:[lA,gA,pA,Rk,...(l=(o=e.components)==null?void 0:o.blocks)!=null?l:[]],commandProviders:[new Om],decorators:[new cg,new jC],embeds:[...yx,...((c=e.components)==null?void 0:c.embeds)||[]],boxes:[Fk,rS,k4,...((d=e.components)==null?void 0:d.boxes)||[]],insertions:[H1],blockHooks:[new SA,...((h=e.components)==null?void 0:h.blockHooks)||[]],textRenders:[new E4,new jE,...((C=e.components)==null?void 0:C.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[aA,jw,nA,rm]});return i.editorCommandProviders.registerCommandProvider(new ms(i)),i.input.addHandler(new fg),i.input.addHandler(new CA(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 rg(i,(E=e.componentsOptions)==null?void 0:E.quickMenu)),i.input.addHandler(new UA(i)),i.input.addHandler(new VA(i)),i.input.addHandler(new gg),i.input.addHandler(new kk),i.addCustom("block-menu",A=>new iw(A)),xe.isMobile||i.addCustom("editor-tooltip",()=>new Sd(i)),i.addCustom("image-paste-handler",()=>new MA(i)),e!=null&&e.enableComments&&i.addCustom("editor-comments",A=>new C4(A,new mZ(A,r))),e.enableContextMenu!==!1&&i.addCustom("editor-context-menu",A=>new jA(A)),i.addCustom("heading-collapse",()=>new ax(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(Og,A=>new gx(A)),Au.register(i),i.version="1.1.22-beta.1",i}async function btt(n,t,e){var h;const r=n.doc.externalDoc.client.auth,i=await gm.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 OS(l),d=n.addCustom("version-dialog",()=>new $4(i,c));return d.show(t),d}b.tippy=n9,b.AnchorBox=yB,b.AuthError=ud,b.AuthHeader=Aa,b.AutoScroll=E0,b.BaseURLHeader=eu,b.BasicCommands=tK,b.BlockExclusiveHook=ew,b.BlockLockerHook=SA,b.BlockLockerPasteHandler=gg,b.BlockResizer=Nd,b.BrBox=xB,b.CodeBlock=gA,b.CodeLineBlock=pA,b.CodeTextDecorator=cg,b.DOC_RE_AUTH_KEYS=Og,b.DefaultShortcuts=rm,b.DocIdError=WU,b.DocReAuthCallbacks=gx,b.DragDrop=Wb,b.DrawioEmbed=BS,b.EditorBlocks=r3,b.EditorBoxes=vB,b.EditorCommandProviders=Ay,b.EditorComplexBlockPosition=Ai,b.EditorComplexSelectionRange=Qi,b.EditorDecorators=wB,b.EditorEmbeds=s3,b.EditorInsertions=RB,b.EditorSimpleBlockPosition=mn,b.EditorSimpleSelectionRange=bn,b.EmbedBlock=l3,b.EmbedBlockResizer=eh,b.EnforceWithDocumentTitleHandler=CA,b.EventCallbacks=Lc,b.FILL_CHAR=C8,b.FileExtError=qU,b.GroupOrder=Ik,b.HeadingBlockScrollListener=mY,b.ImageBox=BB,b.InlineBoxCommandProvider=zk,b.InputtingInsertion=TB,b.LocalDoc=vC,b.LogLevel=qo,b.Logger=di,b.MIN_DISTANCE_THRESHOLD=zb,b.ManualCloseDialog=md,b.ManualMenu=dl,b.ManualToolbar=hd,b.MarkdownInputHandler=fg,b.MaxUserError=UC,b.Mindmap=Ym,b.OnesEditorAutoSuggest=fE,b.OnesEditorCustomDataWrapper=Sb,b.OnesEditorExclusiveBlock=Bl,b.OnesEditorHoveringBlock=ze,b.OnesEditorIcons=_O,b.OnesEditorQuickMenu=rg,b.OnesEditorToc=ih,b.OnesEditorTocProvider=Sl,b.OnesEditorToolbar=Au,b.OnesEditorTooltip=Sd,b.OnesEditorVersionsDialog=$4,b.PermissionError=mm,b.Popup=su,b.ReAuthToolbar=fS,b.RemoteCarets=s2,b.RemoteCaretsDecorator=jC,b.RemoteCaretsInsertion=H1,b.RemoteUsers=Zf,b.RequestReloadError=fd,b.RichText=$n,b.ShareDBDoc=dd,b.ShareDBDocVersionsProvider=OS,b.ShareDBServer=gm,b.SimpleCache=Nb,b.StandardEmbedBlockCommands=tx,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=v1,b.TEXT_STYLE_COLOR_PREFIX=b1,b.TableBlock=lA,b.TableBlockCommandProvider=Om,b.TableShortcuts=aA,b.TextBlock=lr,b.TextBox=AB,b.TextColorItem=BT,b.TextStyleShortcuts=nA,b.TocEmbed=tS,b.ZERO_WIDTH_SPACE_CHAR=Af,b.abbreviation=A0,b.addAttribute=w0,b.addClass=q,b.addCommentToBlock=th,b.addDays=fI,b.addMetaToDoc=Yf,b.addMonths=uI,b.animateScrollTo=na,b.applyPlaceholderToBlock=Ud,b.assert=p,b.autoShowHideTemplates=Ug,b.bindKeyDownEvent=u0,b.blockToDoc=pC,b.blockToHtml=G1,b.blockToMarkdown=j0,b.blockToText=H0,b.blocksToDoc=$5,b.clearAllSelection=Nv,b.clientType=xe,b.cloneBlock=sl,b.cloneChildContainer=nC,b.cloneDoc=rC,b.cloneText=uB,b.commentToShareDbComment=HC,b.compareElement=l0,b.comparePosition=h1,b.complexBlockAdjustSelectionPos=T0,b.complexBlockFindNearestChildBlock=c7,b.complexBlockGetAllChildContainers=In,b.complexBlockGetBottomChildContainers=f3,b.complexBlockGetDeepFirstChild=a3,b.complexBlockGetFirstSimpleChild=g1,b.complexBlockGetLastSimpleChild=Pc,b.complexBlockGetSelectedContainers=Nc,b.complexBlockGetTopChildContainers=u3,b.containerToDoc=H5,b.continuousScroll=cv,b.convertBlockFrom=B0,b.convertImageFileToPng=lS,b.convertImageSrcToPng=NY,b.converterIntercept=ug,b.copyBlockAttributes=KB,b.copyResourcesFromDoc=bC,b.createBlockAnchor=Hs,b.createBlockCaretAnchor=h3,b.createBlockContentElement=ca,b.createBlockElement=Lv,b.createBlockSimpleDocRange=P0,b.createBlockSimpleRange=Pe,b.createBoxContentElement=_v,b.createBoxElement=Iv,b.createBoxOp=cB,b.createChildContainer=e3,b.createComplexBlockPosition=_e,b.createComplexDocPos=gB,b.createComplexDocRange=x8,b.createContainer=dB,b.createContainerElement=Qp,b.createDeleteOps=sB,b.createEditor=Jf,b.createEditorSelectionRange=gn,b.createElement=B,b.createEmptyContainer=Xs,b.createEmptyDoc=qs,b.createEmptyTextBlockData=O0,b.createExpandedRange=s0,b.createIconButton=Zl,b.createImage=Ip,b.createInsertOps=M0,b.createInsertionContentElement=Ov,b.createInsertionElement=Mv,b.createLocalEditor=xtt,b.createOnesEditor=Ett,b.createRange=Pb,b.createRichText=ga,b.createRootContainer=t3,b.createSimpleBlockPosition=ht,b.createSimpleDocPos=mB,b.createTextBlockData=es,b.createTextButton=wa,b.createTextOp=qr,b.createTextWithReplaceSoftReturn=M1,b.daysAfter=zp,b.deleteText=O1,b.diffDays=dI,b.disablePageScroll=$p,b.docToHtml=UB,b.docToHtmlFragment=Hf,b.docToMarkdown=OB,b.docToText=il,b.downloadImageToFile=uS,b.downloadObjectToFile=Ex,b.downloadSvgToString=mS,b.editLink=Td,b.editorAddComment=Cq,b.editorAddTextAttribute=QB,b.editorAutoInsertBlock=VB,b.editorBreakTextBlock=qc,b.editorClearCompositionText=Y1,b.editorClearSelectedContents=X0,b.editorCopyBlock=AC,b.editorCopyDoc=nm,b.editorDeleteBlock=Z1,b.editorDeleteBlockText=Q1,b.editorDeleteBlockWithoutChildren=W0,b.editorDeleteChildContainer=E_,b.editorDeleteChildContainers=$B,b.editorFocusToBlock=eC,b.editorFocusToEnd=N_,b.editorGetBlockData=rl,b.editorGetBlockText=Yn,b.editorGetBlockTextEx=K0,b.editorGetBoxData=CB,b.editorHandleKeyboardEvent=ey,b.editorInsertBlock=Wc,b.editorInsertBoxToBlock=PB,b.editorInsertDoc=XB,b.editorInsertDocAt=iC,b.editorInsertText=X1,b.editorInsertTextToBlock=NB,b.editorInsertTextToBlockEx=q1,b.editorMergeTextBlock=HB,b.editorMoveDown=u5,b.editorMoveEnd=fC,b.editorMoveHome=x5,b.editorMoveLeft=l5,b.editorMoveLineEnd=w5,b.editorMoveLineHome=R5,b.editorMovePageDown=M5,b.editorMovePageUp=_5,b.editorMoveRight=a5,b.editorMoveUp=c5,b.editorMoveWordEnd=C5,b.editorMoveWordLeft=p5,b.editorRangeClearColor=ZB,b.editorRangeGetColor=t5,b.editorRangeSetColor=JB,b.editorRemoveTextAttribute=v_,b.editorReplaceBlockText=Y0,b.editorReplaceContainer=YB,b.editorRunOnce=BC,b.editorSelectAll=hC,b.editorSelectContainer=Z0,b.editorSelectDown=f5,b.editorSelectEnd=dC,b.editorSelectHome=b5,b.editorSelectLeft=d5,b.editorSelectLineEnd=k5,b.editorSelectLineHome=T5,b.editorSelectPageDown=N5,b.editorSelectPageUp=O5,b.editorSelectRight=h5,b.editorSelectUp=m5,b.editorSelectWordEnd=A5,b.editorSelectWordLeft=E5,b.editorSetTextColor=Xc,b.editorShowFindDialog=cW,b.editorToDocx=Ctt,b.editorUpdateBlockData=Q0,b.editorUpdateCompositionText=FB,b.editorUpdateEmbedData=WB,b.enablePageScroll=Hp,b.escapeHtmlText=f0,b.escapeRegExp=Xp,b.escapeSpace=W9,b.exclusiveBlock=kA,b.executeBlockCommand=Gv,b.executeEmbedBlockCommand=zv,b.executeRangeCommand=Ey,b.fileToDataUrl=_c,b.findAfterOffsetNotType=K1,b.findAllText=mC,b.findBlockByIndex=vv,b.findEventTargetBlock=Vb,b.findInsertionById=Uv,b.findNextOffset=K8,b.findNextVisibleSimpleBlock=By,b.findPrevOffset=F8,b.findPrevOffsetNotType=F1,b.findPrevSimpleBlockBeforeChildContainer=c3,b.findPrevVisibleSimpleBlock=vy,b.findTarget=Dc,b.findWordEnd=$1,b.findWordLeft=V1,b.format=Tf,b.formatBytes=uv,b.formatDate=Wp,b.fragmentToHtml=iv,b.fromBase64=bf,b.fromBase64ToBlob=Kp,b.fromBase64ToUint8Array=iI,b.fromDocRange=tl,b.fromNowString=qp,b.genId=it,b.generateEditorContainerId=Yp,b.getAllChildBlocks=A1,b.getAllQuickMenuItems=eA,b.getAllSelectedBlocks=Ji,b.getAttributesAt=$c,b.getBlockBackground=t1,b.getBlockByIndex=Yo,b.getBlockCaretRect=Jo,b.getBlockClass=le,b.getBlockClassByType=oa,b.getBlockClientRects=Ks,b.getBlockCommandsWithHook=l1,b.getBlockContent=zt,b.getBlockHeading=Lf,b.getBlockId=dt,b.getBlockIndex=Rt,b.getBlockInfo=$d,b.getBlockKind=Ci,b.getBlockMinWidth=Fv,b.getBlockNearestRangeFromPoint=C1,b.getBlockOptions=TI,b.getBlockPath=Zo,b.getBlockProperties=$v,b.getBlockRangeFromPoint=k0,b.getBlockStyles=yI,b.getBlockTextLength=Ct,b.getBlockTools=be,b.getBlockType=Ot,b.getBoxContent=n1,b.getBoxId=Dv,b.getBoxTypeFromElement=Sf,b.getChildBlockCount=pi,b.getChildBlocks=ke,b.getChildOffset=el,b.getColorFromAttributes=y1,b.getColorFromContent=x0,b.getComplexBlockClass=Hr,b.getContainerBlockPath=Qv,b.getContainerBlocks=xv,b.getContainerBlocksElement=Rf,b.getContainerById=gi,b.getContainerId=pt,b.getContainerMinWidth=f1,b.getContainerToolsElement=bI,b.getContainerWidth=n3,b.getDistanceSquare=Xo,b.getElementFromPoint=Oe,b.getElementOffset=Ef,b.getElementScale=$r,b.getEmbedType=on,b.getExistsBlockTools=b0,b.getExistsContainerById=kf,b.getFileExt=yf,b.getFirstChildBlock=Ne,b.getFirstClientRect=o0,b.getHeadingBlockChildren=Oc,b.getHeadingMenuOptions=QE,b.getHorizontalPadding=_p,b.getInsertionContent=r1,b.getLastChildBlock=Ze,b.getLastClientRect=ta,b.getListAllNextBrothers=mu,b.getLogger=D,b.getNextBlock=ae,b.getNextHiddenBlocks=Xv,b.getNextValidOffset=ha,b.getNextVisibleBlock=zr,b.getOffsetFromPoint=Dp,b.getOffsetInfoAfter=Kf,b.getOffsetInfoBefore=V0,b.getOpAt=F3,b.getOpLength=R0,b.getParentBlock=et,b.getParentBlockExcludeSelf=aa,b.getParentBox=e1,b.getParentContainer=at,b.getPrevBlock=$e,b.getPrevValidOffset=nl,b.getPrevVisibleBlock=jr,b.getRangeCommands=py,b.getReferenceClientRect=nk,b.getRootBlock=o1,b.getScrollContainer=hn,b.getSpecialBlockCommands=Hv,b.getStandardEmbedBlockProperties=ex,b.getTextAfterOffset=N8,b.getTextAttributes=W1,b.getTextBeforeOffset=P8,b.getTextBlockChild=_f,b.getTextBlockClass=yv,b.getTextBlockContentChildTextLength=Wr,b.getTextBlockContentChildType=Yv,b.getTextBlockContentChildren=Yi,b.getTextLength=Vn,b.getTextOpLength=x1,b.getTextWidth=g0,b.getToolbar=Hm,b.handleBlockElementUpdated=Kv,b.hasAltOnly=Z9,b.hasClass=Mt,b.hasCtrlOrCmd=Zb,b.hasCtrlOrCmdOnly=J9,b.hashCode=Cv,b.hideBlock=Sv,b.hideTemplates=oS,b.htmlToFragment=m0,b.i18n=_,b.includeBigTable=cN,b.injectDocToHtmlFragment=Xf,b.injectStyle=jb,b.inputActions=rM,b.insertEmptyBlock=wI,b.insertEmptyEmbedBlock=a1,b.insertText=Ws,b.intersectionCommands=OM,b.isBackspace=ev,b.isBlock=la,b.isBlockLocked=mg,b.isBlockLockedByOthers=wA,b.isBlockLockedBySelf=Hd,b.isBlockTools=wv,b.isBox=v0,b.isBoxOp=js,b.isCJK=Qb,b.isChildContainer=mi,b.isChildNode=Ce,b.isCodeBlock=_i,b.isCollapsedHeadingBlock=Xi,b.isCollapsedRange=A8,b.isComplexBlockPosition=fa,b.isComplexKindBlock=Pt,b.isContainer=Ps,b.isContainerSelectedAllChildBlocks=P5,b.isControlEvent=ia,b.isDelete=eI,b.isDraggingFiles=p0,b.isElementVisible=c0,b.isEmbedBlock=Le,b.isEmptyContainer=Mf,b.isEmptyDoc=N1,b.isEmptyTextBlock=ve,b.isEmptyTextBlockWithoutCompositionText=Md,b.isEnterOnly=tv,b.isEscape=h0,b.isExclusiveBlock=Vd,b.isExpandedHeadingBlock=qv,b.isFirefox=pf,b.isFirstChildBlockInComplexBlock=a7,b.isHeadingBlock=Ln,b.isHighSurrogate=H9,b.isInBlock=i1,b.isInBlockTools=Uc,b.isLetter=Yb,b.isLowSurrogate=j9,b.isMatchShortcut=Wi,b.isMoveForward=Y9,b.isNavigationEvent=X9,b.isNavigationKey=Jb,b.isNodeRemoved=Cf,b.isNumber=Xb,b.isPrintableKey=Pp,b.isRootBlock=Gr,b.isRootContainer=re,b.isSafari=Jl,b.isSameDay=Gp,b.isSelectBoxOnly=Ii,b.isShiftEnter=tI,b.isShiftTab=rI,b.isShortcutEvent=Q9,b.isSimpleBlock=BI,b.isSimpleBlockPosition=xi,b.isSimplePos=hB,b.isSimpleRange=N0,b.isSpace=d0,b.isTab=nI,b.isTextBlockContentBoxChild=Br,b.isTextBlockContentChild=If,b.isTextBlockContentInsertionChild=$s,b.isTextBlockContentTextChild=Df,b.isTextKindBlock=ot,b.isTextKindBlockType=wf,b.isTitleBlock=Fs,b.isToday=fv,b.isValidOffset=or,b.isVisibleBlock=Qo,b.isYesterday=dv,b.loadJs=Kb,b.loadJsPromise=ea,b.lockers=hi,b.mergeCommands=$m,b.mergeDocs=pa,b.mergeOps=U1,b.mergeText=g8,b.multiSplitText=V3,b.overflowText=hv,b.parseShortcut=nv,b.patchNode=vf,b.pointInRect=ra,b.rangeAddAttribute=Nf,b.rangeGetTextColor=q3,b.rangeRemoveAttribute=Vc,b.rangeSetTextColor=z3,b.rangeTransformText=H3,b.registerDragDrop=Op,b.removeAttribute=B1,b.removeClass=ct,b.removeLastBr=f8,b.removePlaceholderFromBlock=RR,b.removeStyle=Hb,b.replaceAll=hI,b.replaceAllCaseInsensitive=mI,b.replaceAllText=K5,b.replaceText=U0,b.requestDownload=C0,b.resetListStart=pu,b.scrollIntoView=$f,b.scrollable=av,b.selectFile=Mc,b.selectedBlockToDoc=tm,b.selectionToDoc=Yc,b.setAttributes=a0,b.setClipboardData=Bf,b.setClipboardDataByEvent=lI,b.setColorToAttributes=G3,b.setDataset=Mp,b.setDefaultCursor=xf,b.setStyles=Up,b.shareDBCommentToDocObject=$C,b.shareDBDocCommentToComment=r2,b.shortcutToDisplayText=dn,b.showBlock=Zp,b.showDocVersions=btt,b.showTemplates=hx,b.splitText=sr,b.splitToThree=pn,b.stringToDataUrl=Vp,b.stringToObjectUrl=jp,b.subText=$3,b.textNodeOffsetFromPoint=Fb,b.titleFromEditor=cS,b.toBase64URL=qi,b.toMindmap=Xm,b.toPlainText=Re,b.toPlainTextKeepLength=P1,b.trimChar=Np,b.unexclusiveBlock=RA,b.unicodeLength=z9,b.unicodeSubstr=G9,b.updateBlockSelection=Pv,b.updateOpAttributes=fB,b.updateTextBlockContent=O8,b.updateUrl=Fp;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"}})});
|
|
963
|
+
\`\`\`\`\`\``}return""}const OJ={embedType:"plantuml",convertFrom:_J,handleUpdateBlock:DJ,createEmbedContent:IJ,getBlockProperties:MJ,convertTo:UJ},$at="",NJ="hr",PJ={dividingLine:{type:"\u5206\u5272\u7EBF",abstract:"\u5206\u5272\u7EBF"}},FJ={dividingLine:{type:"Dividing-Line",abstract:"Dividing-Line"}},KJ={dividingLine:{type:"\u533A\u5207\u308A\u7DDA",abstract:"\u533A\u5207\u308A\u7DDA"}};_.mergeLang({"zh-CN":PJ,"en-US":FJ,"ja-JP":KJ});function VJ(n,t){const e=B("div",["editor-embed-container"],t);B("hr",["editor-embed-hr"],e)}function $J(n,t,e,r){return r==="html"?"<hr />":r==="markdown"?"---":"------------"}function HJ(){return{name:"hr",insertEmbedCommandItems:[{id:"insert-hr",name:_.t("dividingLine.type"),icon:F2,order:500,group:"common",subText:Qn("insert-hr")}],handleInsertEmptyEmbed:async(n,t)=>{const{containerId:e,blockIndex:r}=t;return n.insertEmbed(e,r,NJ,{})}}}function jJ(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 zJ(){return{abstract:_.t("dividingLine.abstract")}}const GJ={embedType:"hr",createEmbedContent:VJ,convertTo:$J,getOptions:HJ,convertFrom:jJ,getBlockProperties:zJ},Hat="",jat="",WJ={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"}}},qJ={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"}}},XJ={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":WJ,"en-US":qJ,"ja-JP":XJ});var Oi=(n=>(n.AUDIO="audio",n.VIDEO="video",n))(Oi||{}),sh=(n=>(n.Empty="empty",n.Progress="progress",n.Error="error",n))(sh||{});const wS=10*1024*1024,YJ=["wav","mp3","aac","ogg","webm","flac"],QJ=["ogg","mp4","webm"],JJ=()=>{};function SS(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:YJ,o=(E=e==null?void 0:e.video)!=null?E:QJ,l=(A=r==null?void 0:r.audio)!=null?A:wS,c=(v=r==null?void 0:r.video)!=null?v:wS,d=(S=i==null?void 0:i.onError)!=null?S:JJ;return{allowedMedias:{audio:s,video:o},maxSize:{audio:l,video:c},callbacks:{onError:d}}}function ZJ(n,t){const e=s=>s.map(o=>`.${o}`).join(","),{allowedMedias:r}=SS(n),i=r[t];return i?e(i):"*"}function tZ(n,t,e){const{maxSize:r,callbacks:i,allowedMedias:s}=SS(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 eZ(n){return n===sh.Empty||n===sh.Error}const En=D("media");class nZ 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=et(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(En,this.abstract,"no abstract"),p(En,this.mediaContainer,"The media element not exist");const{editor:r}=this.options,i=et(this.mediaContainer);p(En,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){En.error(o),this.emit("mediaError",r,"upload_error",s.id),this.renderRetry(e,o)}ct(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(En,this.mediaContainer,"The media element not exist"),this.mediaContainer.innerHTML="",this.mediaContainer.append(e)}renderError(){p(En,this.abstract,"no abstract");const{editor:e,createMediaElement:r}=this.options,{mediaIcon:i,mediaName:s}=this.abstract;p(En,this.mediaContainer,"The media element not exist");const o=et(this.mediaContainer);p(En,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(En,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(En,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(En,this.abstract,"no abstract"),this.handleUploadFile(e))}),this.updateMediaContent(l),this.setFullScreen()}renderProgress(e,r){p(En,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=et(this.mediaContainer);p(En,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(En,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(En,this.abstract,"no abstract"),p(En,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=et(r);if(C&&!s.readonly&&s.isBlockWritable(C)){const E=At.default(e);E.embedData.src=o,s.updateBlockData(C,E)}}}})}setFullScreen(){p(En,this.mediaContainer,"The media element not exist"),q(this.mediaContainer,"full-screen")}removeFullScreen(){p(En,this.mediaContainer,"The media element not exist"),ct(this.mediaContainer,"full-screen")}updateBlockAlign(e,r){const i=et(r);p(En,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),eZ(i)?i===sh.Empty&&this.renderEmpty(e):this.renderMediaElement(e,r)}setAbstract(e){this.abstract=e}}D("media-embed");const rZ="left";class LS{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=ZJ(t,this.embedType);if(s=s!=null?s:await Mc(o,{}),!s)return null;const{mediaType:l}=this.getAbstract();try{tZ(s,t,l)}catch{return null}const c={id:it(),type:"embed",embedType:this.embedType,embedData:{src:sh.Empty}};l==="video"&&(c.align=rZ);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 nZ({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:Qn(`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"?``:o}}function IS(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 DS(n,t){const e=n.querySelector(".uploading-progress-bar-value");e&&(e.style.width=`${t}%`)}const iZ=D("media-audio");class sZ extends LS{constructor(){super(...arguments);m(this,"embedType",Oi.AUDIO);m(this,"updateProgressElement",DS);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:O2,mediaName:_.t(`media.${Oi.AUDIO}.menuItem`),menuItem:_.t(`media.${Oi.AUDIO}.menuItem`),order:800,mediaType:Oi.AUDIO,group:"common"}}getBlockProperties(){return{abstract:`${_.t(`media.${Oi.AUDIO}.abstract`)}`}}updateMediaElement(e,r,i,s){const o=r.querySelector(":scope .audio-container > audio");return p(iZ,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",IS(e,r)}}const oZ=new sZ;D("video-resizer");function _S(n){return n&&Le(n)&&on(n)==="video"}const lZ=50;class Bx{constructor(t){m(this,"currentResizableElement",null);m(this,"resizing",!1);m(this,"handleHoveringBlockChange",(t,e)=>{if(!this.resizing&&!window.isDragging&&(e&&_S(e)&&this.disableBlockResize(e),t&&_S(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,lZ),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,ze.get(t).addListener("change",this.handleHoveringBlockChange)}destroy(){this.currentResizableElement=null,ze.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 aZ=D("video");class cZ extends LS{constructor(){super(...arguments);m(this,"embedType",Oi.VIDEO);m(this,"updateProgressElement",DS);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 Bx(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,IS(e,r),_c(i).then(o=>{const l=e.querySelector(".progress-video");l&&i1(e)&&(l.src=o)})})}getAbstract(){return{mediaName:_.t(`media.${Oi.VIDEO}.menuItem`),mediaIcon:N2,menuItem:_.t(`media.${Oi.VIDEO}.menuItem`),order:700,mediaType:Oi.VIDEO,group:"common"}}getBlockProperties(){return{abstract:`${_.t(`media.${Oi.VIDEO}.abstract`)}`}}handleMediaError(e,r,i){const s=e.addCustom("video-resizer",()=>new Bx(e)),o=e.getBlockById(i);s.disableBlockResize(o)}updateMediaElement(e,r,i,s){const o=r.querySelector(":scope .video-container > video");p(aZ,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 Bx(e)).updateResizer(l)}),o}}const uZ=new cZ,MS=[lA,gA,pA,Rk],yx=[BS,fQ,AJ,wJ,OJ,RK,GJ,uZ,oZ,Bz,tS,iX],US=[Fk,rS,k4];function fZ(n,t,e){var i,s,o,l;di.level=(i=e.logLevel)!=null?i:qo.DEBUG;const r=Jf(n,t,{components:{blocks:[...MS,...((s=e==null?void 0:e.components)==null?void 0:s.blocks)||[]],embeds:[...yx,...((o=e.components)==null?void 0:o.embeds)||[]],boxes:[...US,...((l=e.components)==null?void 0:l.boxes)||[]],textRenders:[new jE],options:{...e.componentsOptions}}});return r.readonly=!0,r.addCustom("heading-collapse",()=>new ax(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 OS{constructor(t){this.createOptions=t,t.lang&&_.setLang(t.lang)}createHistoryEditor(t,e){return fZ(t,e,this.createOptions)}}function NS(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:[rm],components:{blocks:o,commandProviders:[new Om],decorators:[new cg],embeds:l,boxes:c,options:s}});if(d.input.addHandler(new fg),d.input.addHandler(new UA(d)),d.input.addHandler(new VA(d)),d.input.addHandler(new mq(d)),d.input.addHandler(new gg),d.addCustom("image-paste-handler",()=>new MA(d)),xe.isMobile||d.addCustom("editor-tooltip",()=>new Sd(d)),n.options.enableContextMenu!==!1&&d.addCustom("editor-context-menu",E=>new jA(E)),(h=n.options.componentsOptions)!=null&&h.mention){const E=n.options.componentsOptions.mention;d.addCustom("mention",()=>new nS(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 dZ(n,t){const e=Array.from(n.rootContainer.querySelectorAll(`[comment-${t.toLocaleLowerCase()}="${t}"]`)),r=new Set;e.forEach(i=>{const s=et(i);s&&r.add(s)}),r.forEach(i=>{gq(n,i,t)})}class hZ{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&&dZ(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 NS(this.editor,{root:t,childDoc:e,doc:this.doc})}allowEdit(t){return t.userId===this.doc.getUser().userId}}class mZ{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 $C(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 NS(this.editor,{root:t,childDoc:e,doc:this.localDoc})}allowEdit(t){return t.userId===this.localDoc.getUser().userId}}const gZ={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"}},pZ={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"}},CZ={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":gZ,"en-US":pZ,"ja-JP":CZ});const EZ="UEsDBBQABgAIAAAAIQBk9WPugQEAACkGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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PANQDAADePgAAAAA=",AZ=()=>Kp(EZ),xZ=D("image-to-docx");async function bZ(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 PS(n,t){if(n.width&&n.height)return{width:n.width,height:n.height,buffer:t};try{const e=await _c(new File([t],"",{})),r=await bZ(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){xZ.error(e);return}}function vZ(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 BZ(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 FS(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 yZ(){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 TZ(){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 kZ(){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 RZ=[{levels:FS(),reference:"number-numbering-reference"},{levels:yZ(),reference:"number-bullet-reference"},{levels:TZ(),reference:"checked-bullet-reference"},{levels:kZ(),reference:"unchecked-bullet-reference"}];function wZ(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 SZ(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 LZ(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 IZ=/rgb\((\d+),\s*(\d+),\s*(\d+)\)/;function KS(n){if(typeof n=="string"&&n.length>0){if(n[0]==="#")return n.substring(1);const t=n.match(IZ);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 VS(n,t,e){for(let r=0;r<=e;++r){const i=`${t}${r}`;if(Mn(n,i))return i}}function Pg(n,t,e){n.attributes=n.attributes||{},n.attributes[t]=e}function Tx(n){return n==="image"||n==="drawio"||n==="plantuml"||n==="mermaid"||n==="flowchart"}function $S(n){return n&&n.startsWith("//")?`https:${n}`:n&&!n.startsWith("http://")&&!n.startsWith("https://")?`https://${n}`:n}function DZ(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"&&Pg(n,"inline-style-font-size",o),s==="color"&&Pg(n,"inline-style-color",o),s==="background-color"&&Pg(n,"inline-style-background-color",o),s==="font-family"&&Pg(n,"inline-style-font-family",o)}}function _Z(n,t){if(t==null)return n==null?void 0:n.normal;if(n)return n[`heading${t}`]}function MZ(n){const t=`${Mn(n,"inline-style-font-size")}`;if(t&&t.indexOf("px")>0)return+t.replace(/px/g,"")}function UZ(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 OZ(n){if(n.attributes&&n.attributes.box&&n.attributes.text)return` @${n.attributes.text} `}function NZ(n){return Mn(n,"inline-style-font-family")}function PZ(n){const t=Mn(n,"inline-style-background-color");return KS(t)}function FZ(n){const t=Mn(n,"inline-style-color");return KS(t)}function KZ(n){DZ(n);const t=Mn(n,"type")==="mention";return{box:n.attributes&&n.attributes.box?n.attributes:void 0,inlineCode:!!Mn(n,"style-code"),link:$S(Mn(n,"link")),size:MZ(n),text:t?OZ(n):UZ(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:NZ(n),background:PZ(n),color:t?"338fe5":wZ(VS(n,"style-color-",6))||FZ(n),highlight:VS(n,"style-bg-color-",13)}}function VZ(){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 $Z(){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 HZ(){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 jZ(n,t){return new Bt.Paragraph({children:[new Bt.ExternalHyperlink({children:[new Bt.TextRun({style:"Hyperlink",text:t||n})],link:n})]})}function HS(n){if(n.heading!=null)return`Heading${n.heading}`}function jS(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 zZ(n){if(n.indent)return{left:Bt.convertInchesToTwip(.3*n.indent-.2)};if(n.padding)return{left:Bt.convertInchesToTwip(.3*n.padding)}}function GZ(n){return{type:Bt.ShadingType.CLEAR,color:"FFFFFF",fill:n}}function WZ(n){const t=n.split(",");if(t.length!==0)return t[0].trim()}function zS(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?WZ(n.fontFamily):void 0,shading:n.background?GZ(n.background):void 0,color:n.color,highlight:SZ(n.highlight)})}function qZ(n,t){if(n.link)return new Bt.ExternalHyperlink({children:[zS(n,t)],link:n.link})}async function GS(n,t,e,r,i){const[s]=await i(n,t,e);if(s==null)return;const o=await PS({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 XZ(n){if(n.heading||n.heading)return n.heading}function YZ(n){if(n.align&&(n.align==="center"||n.align==="right"||n.align==="left"))return n.align}function QZ(n){if(n.textOnly===!0&&n.level!=null)return n.level}async function JZ(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(KZ(s))}return e}}function ZZ(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 ttt(n,t){if(n.type==="embed"&&n.embedType&&Tx(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 ett(n){if(n.padding)return n.padding}function ntt(n){return!!(n.type==="embed"&&n.embedType&&Tx(n.embedType)&&n.embedData&&n.embedData.src)}async function Fg(n,t,e){return{quoted:!!n.quoted,heading:XZ(n),alignment:YZ(n),indent:QZ(n),padding:ett(n),texts:await JZ(n,e),list:ZZ(n),images:ttt(n,t),border:ntt(n)}}async function rtt(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 Fg(l,e,r));i.push(o)}return i}const itt=D("to-docx");function stt(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 ott(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 ltt(n){p(itt,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=stt(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=LZ(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 ott(n,t,e,i),i}async function att(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 Fg(E,o,c);await r.addTextBlock(A);return}if(E.type==="code"){const A=await rtt(E,e,o,c);await r.addCodeBlockObject(A);return}if(E.type==="list"&&E.textOnly!==!0){const A=await Fg(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(Tx(S)){const w=await Fg(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($S(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=ltt(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 nt={id:M,type:"_exportVirtualBlock"};v.push(nt)}}return v}for(const E of t)for(const A of C(E))!A||await h(A)}function ctt(){return{listMaxInst:1,listInstMap:{},listRefMap:{},levelConfigs:[]}}const utt=D("to-docx");class ftt{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:HS(t),alignment:jS(t),children:await this.paragraphsFromBlockTexts(t),indent:zZ(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=_Z(this.defaultFontSize,t.heading),r=[];for(const i of t.texts){if(i.link){const s=qZ(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 GS(this.appId,this.docId,i.box.src,i.box.width,this.readImageFunc);s&&r.push(s);continue}if(i.math){const s=await GS(this.appId,this.docId,i.math,0,this.readImageFunc);s&&r.push(s);continue}r.push(zS(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=FS([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=HS(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 PS(c,d);if(C)return C}i.push(h)}));BZ(s,r,t.embedData);const o=vZ(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:jS(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(){VZ().forEach(t=>this.paragraphs.push(t))}addEmptyParagraph(){this.paragraphs.push(new Bt.Paragraph(""))}addVideoPlaceholder(){this.paragraphs.push($Z())}addAudioPlaceholder(){this.paragraphs.push(HZ())}addHyperlinkParagraph(t,e){t!=null&&this.paragraphs.push(jZ(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 dtt{constructor(t,e,r,i,s,o,l,c){m(this,"convertBlocks",async(t,e,r,i,s,o,l=720)=>{const c=new ftt(i,s,o,this.readImage,this.convertBlocks,this.defaultFontSize);return await att(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(utt,o,"data must have blocks");const l=ctt(),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:[...RZ,...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)}}const htt=D("editor-to-docx");async function mtt(n,t,e,r){const i=n.doc.buildResourceUrl(r,{withToken:!0});let s=await uS(i);if(!s)return[void 0,i];if(s.type.indexOf("/svg")!==-1){const l=await lS(s);l&&(s=new File([l],s.name))}return[await s.arrayBuffer(),i]}async function gtt(n,t,e){const r=n.editorBlocks.getBlockClass(e.type);if(r.toStandardDoc)try{return await r.toStandardDoc(n,e,t)}catch(i){htt.error(`toStandardDoc error: ${JSON.stringify(i)}`);return}}async function ptt(n,t){const e=t.attributes,r=n.editorBoxes.getBoxClass(e.type);if(r.toStandardText)return r.toStandardText(n,e)}async function Ctt(n,t){let{template:e,download:r,backgroundImageOptions:i}=t!=null?t:{};e||(e=AZ());const s=n.doc.toJSON(),o=(C,E,A)=>mtt(n,C,E,A),l=async(C,E,A)=>gtt(n,s,A),c=async C=>ptt(n,C),h=await new dtt(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",`${cS(n)}.docx`),E.setAttribute("href",`${C}`),E.click(),E.remove()}return h}const kx=D("create-editor");async function Ett(n,t){var o,l,c,d,h,C,E,A,v,S,w,O,M,V,nt,Y;p(kx,n,"app does not exists"),t.lang&&_.setLang(t.lang),di.level=(o=t.logLevel)!=null?o:qo.DEBUG;const e=t.onReauth?async()=>{var bt;const X=t.user.userId,ut=t.docId,xt=await((bt=t.onReauth)==null?void 0:bt.call(t,X,ut,t.permission));return{userId:X,docId:ut,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:[...MS,...((l=t==null?void 0:t.components)==null?void 0:l.blocks)||[]],embeds:[...yx,...((c=t.components)==null?void 0:c.embeds)||[]],boxes:[...US,...((d=t.components)==null?void 0:d.boxes)||[]],commandProviders:[new Om,...((h=t.components)==null?void 0:h.commandProviders)||[]],decorators:[new cg,new jC],insertions:[H1],blockHooks:[new SA,new ew,...((C=t.components)==null?void 0:C.blockHooks)||[]],textRenders:[new E4,new jE,...((E=t.components)==null?void 0:E.textRenders)||[]],options:{...t.componentsOptions}},shortcuts:[kq,eH,hz,aA,jw,dF,nA,uX,rm,sF,...t.shortcuts||[]],colors:["#0064FF","#EB3723","#F59300","#00A865","#F25A0A","#70A310","#009CAD","#0990D9","#8851ED","#D62069"]});if(s.editorCommandProviders.registerCommandProvider(new ms(s)),s.input.addHandler(new ZX),s.input.addHandler(new fg),s.input.addHandler(new DK),s.input.addHandler(new sz),s.input.addHandler(new CA(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 rg(s,(v=t.componentsOptions)==null?void 0:v.quickMenu)),s.input.addHandler(new UA(s)),s.input.addHandler(new VA(s)),s.input.addHandler(new gg),s.input.addHandler(new kk),s.doc.registerCallback(new tY(s)),s.addCustom("remote-cursor",()=>new s2(s)),s.addCustom("block-menu",X=>new iw(X)),xe.isMobile||s.addCustom("editor-tooltip",()=>new Sd(s)),t!=null&&t.enableComments&&s.addCustom("editor-comments",X=>new C4(X,new hZ(X))),t.enableContextMenu!==!1&&s.addCustom("editor-context-menu",X=>new jA(X)),s.addCustom("create-options",()=>new Sb(s,t)),s.addCustom("drop-target",()=>new Wd(s)),s.addCustom("list-to-mindmap",()=>new Qm(s)),s.addCustom("list-to-mention",()=>new bY(s)),s.addCustom("mobile-helper",()=>new HY(s)),s.addCustom("code-caret",()=>new Q$(s)),s.addCustom("image-paste-handler",()=>new MA(s)),(S=t.componentsOptions)!=null&&S.mention){const X=t.componentsOptions.mention;s.addCustom("mention",()=>new nS(s,X))}if(s.addCustom("heading-collapse",()=>new ax(s)),s.addCustom(Og,X=>new gx(X)),Au.register(s),Wd.register(s),Sl.register(s),Bl.register(s),s.addListener("clickLink",(X,ut,xt)=>{var wt;if((wt=t==null?void 0:t.events)!=null&&wt.onClickLink){t.events.onClickLink(X,ut,xt);return}const bt=xt.getAttribute("link");bt&&(X.readonly||ut.ctrlKey||ut.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",ut=>{X(s,ut)})}return(Y=(nt=t.componentsOptions)==null?void 0:nt.templates)!=null&&Y.templates.length&&(s.addListener("docChanged",()=>{Ug(s)}),s.addListener("resize",()=>{Ug(s,{reset:!0})}),setTimeout(()=>{Ug(s)},100)),s.doc.registerCallback({onError:async X=>{if(X.code==="ResetDoc"){kx.error(`reset doc: ${X.message}`);const ut=await dd.load(r);s.doc.reset(ut)}}}),s.version="1.1.22-beta.2",di.level===qo.DEBUG&&(window.setReauthFail=X=>{window.isReauthError=X},window.reConnect=X=>s.doc.externalDoc.client.connection.reConnect(X)),s}function Att(n){return n.toJSON!==void 0}async function xtt(n,t,e){var s,o,l,c,d,h,C,E;p(kx,n,"app does not exists");const r=Att(t)?t:new vC(t,{serverUrl:e.serverUrl||""});e.lang&&_.setLang(e.lang),di.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:[lA,gA,pA,Rk,...(l=(o=e.components)==null?void 0:o.blocks)!=null?l:[]],commandProviders:[new Om],decorators:[new cg,new jC],embeds:[...yx,...((c=e.components)==null?void 0:c.embeds)||[]],boxes:[Fk,rS,k4,...((d=e.components)==null?void 0:d.boxes)||[]],insertions:[H1],blockHooks:[new SA,...((h=e.components)==null?void 0:h.blockHooks)||[]],textRenders:[new E4,new jE,...((C=e.components)==null?void 0:C.textRenders)||[]],options:{...e.componentsOptions}},shortcuts:[aA,jw,nA,rm]});return i.editorCommandProviders.registerCommandProvider(new ms(i)),i.input.addHandler(new fg),i.input.addHandler(new CA(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 rg(i,(E=e.componentsOptions)==null?void 0:E.quickMenu)),i.input.addHandler(new UA(i)),i.input.addHandler(new VA(i)),i.input.addHandler(new gg),i.input.addHandler(new kk),i.addCustom("block-menu",A=>new iw(A)),xe.isMobile||i.addCustom("editor-tooltip",()=>new Sd(i)),i.addCustom("image-paste-handler",()=>new MA(i)),e!=null&&e.enableComments&&i.addCustom("editor-comments",A=>new C4(A,new mZ(A,r))),e.enableContextMenu!==!1&&i.addCustom("editor-context-menu",A=>new jA(A)),i.addCustom("heading-collapse",()=>new ax(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(Og,A=>new gx(A)),Au.register(i),i.version="1.1.22-beta.2",i}async function btt(n,t,e){var h;const r=n.doc.externalDoc.client.auth,i=await gm.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 OS(l),d=n.addCustom("version-dialog",()=>new $4(i,c));return d.show(t),d}b.tippy=n9,b.AnchorBox=yB,b.AuthError=ud,b.AuthHeader=Aa,b.AutoScroll=E0,b.BaseURLHeader=eu,b.BasicCommands=tK,b.BlockExclusiveHook=ew,b.BlockLockerHook=SA,b.BlockLockerPasteHandler=gg,b.BlockResizer=Nd,b.BrBox=xB,b.CodeBlock=gA,b.CodeLineBlock=pA,b.CodeTextDecorator=cg,b.DOC_RE_AUTH_KEYS=Og,b.DefaultShortcuts=rm,b.DocIdError=WU,b.DocReAuthCallbacks=gx,b.DragDrop=Wb,b.DrawioEmbed=BS,b.EditorBlocks=r3,b.EditorBoxes=vB,b.EditorCommandProviders=Ay,b.EditorComplexBlockPosition=Ai,b.EditorComplexSelectionRange=Qi,b.EditorDecorators=wB,b.EditorEmbeds=s3,b.EditorInsertions=RB,b.EditorSimpleBlockPosition=mn,b.EditorSimpleSelectionRange=bn,b.EmbedBlock=l3,b.EmbedBlockResizer=eh,b.EnforceWithDocumentTitleHandler=CA,b.EventCallbacks=Lc,b.FILL_CHAR=C8,b.FileExtError=qU,b.GroupOrder=Ik,b.HeadingBlockScrollListener=mY,b.ImageBox=BB,b.InlineBoxCommandProvider=zk,b.InputtingInsertion=TB,b.LocalDoc=vC,b.LogLevel=qo,b.Logger=di,b.MIN_DISTANCE_THRESHOLD=zb,b.ManualCloseDialog=md,b.ManualMenu=dl,b.ManualToolbar=hd,b.MarkdownInputHandler=fg,b.MaxUserError=UC,b.Mindmap=Ym,b.OnesEditorAutoSuggest=fE,b.OnesEditorCustomDataWrapper=Sb,b.OnesEditorExclusiveBlock=Bl,b.OnesEditorHoveringBlock=ze,b.OnesEditorIcons=_O,b.OnesEditorQuickMenu=rg,b.OnesEditorToc=ih,b.OnesEditorTocProvider=Sl,b.OnesEditorToolbar=Au,b.OnesEditorTooltip=Sd,b.OnesEditorVersionsDialog=$4,b.PermissionError=mm,b.Popup=su,b.ReAuthToolbar=fS,b.RemoteCarets=s2,b.RemoteCaretsDecorator=jC,b.RemoteCaretsInsertion=H1,b.RemoteUsers=Zf,b.RequestReloadError=fd,b.RichText=$n,b.ShareDBDoc=dd,b.ShareDBDocVersionsProvider=OS,b.ShareDBServer=gm,b.SimpleCache=Nb,b.StandardEmbedBlockCommands=tx,b.TEXT_STYLE_BACKGROUND_COLOR_PREFIX=v1,b.TEXT_STYLE_COLOR_PREFIX=b1,b.TableBlock=lA,b.TableBlockCommandProvider=Om,b.TableShortcuts=aA,b.TextBlock=lr,b.TextBox=AB,b.TextColorItem=BT,b.TextStyleShortcuts=nA,b.TocEmbed=tS,b.ZERO_WIDTH_SPACE_CHAR=Af,b.abbreviation=A0,b.addAttribute=w0,b.addClass=q,b.addCommentToBlock=th,b.addDays=fI,b.addMetaToDoc=Yf,b.addMonths=uI,b.animateScrollTo=na,b.applyPlaceholderToBlock=Ud,b.assert=p,b.autoShowHideTemplates=Ug,b.bindKeyDownEvent=u0,b.blockToDoc=pC,b.blockToHtml=G1,b.blockToMarkdown=j0,b.blockToText=H0,b.blocksToDoc=$5,b.clearAllSelection=Nv,b.clientType=xe,b.cloneBlock=sl,b.cloneChildContainer=nC,b.cloneDoc=rC,b.cloneText=uB,b.commentToShareDbComment=HC,b.compareElement=l0,b.comparePosition=h1,b.complexBlockAdjustSelectionPos=T0,b.complexBlockFindNearestChildBlock=c7,b.complexBlockGetAllChildContainers=In,b.complexBlockGetBottomChildContainers=f3,b.complexBlockGetDeepFirstChild=a3,b.complexBlockGetFirstSimpleChild=g1,b.complexBlockGetLastSimpleChild=Pc,b.complexBlockGetSelectedContainers=Nc,b.complexBlockGetTopChildContainers=u3,b.containerToDoc=H5,b.continuousScroll=cv,b.convertBlockFrom=B0,b.convertImageFileToPng=lS,b.convertImageSrcToPng=NY,b.converterIntercept=ug,b.copyBlockAttributes=KB,b.copyResourcesFromDoc=bC,b.createBlockAnchor=Hs,b.createBlockCaretAnchor=h3,b.createBlockContentElement=ca,b.createBlockElement=Lv,b.createBlockSimpleDocRange=P0,b.createBlockSimpleRange=Pe,b.createBoxContentElement=_v,b.createBoxElement=Iv,b.createBoxOp=cB,b.createChildContainer=e3,b.createComplexBlockPosition=_e,b.createComplexDocPos=gB,b.createComplexDocRange=x8,b.createContainer=dB,b.createContainerElement=Qp,b.createDeleteOps=sB,b.createEditor=Jf,b.createEditorSelectionRange=gn,b.createElement=B,b.createEmptyContainer=Xs,b.createEmptyDoc=qs,b.createEmptyTextBlockData=O0,b.createExpandedRange=s0,b.createIconButton=Zl,b.createImage=Ip,b.createInsertOps=M0,b.createInsertionContentElement=Ov,b.createInsertionElement=Mv,b.createLocalEditor=xtt,b.createOnesEditor=Ett,b.createRange=Pb,b.createRichText=ga,b.createRootContainer=t3,b.createSimpleBlockPosition=ht,b.createSimpleDocPos=mB,b.createTextBlockData=es,b.createTextButton=wa,b.createTextOp=qr,b.createTextWithReplaceSoftReturn=M1,b.daysAfter=zp,b.deleteText=O1,b.diffDays=dI,b.disablePageScroll=$p,b.docToHtml=UB,b.docToHtmlFragment=Hf,b.docToMarkdown=OB,b.docToText=il,b.downloadImageToFile=uS,b.downloadObjectToFile=Ex,b.downloadSvgToString=mS,b.editLink=Td,b.editorAddComment=Cq,b.editorAddTextAttribute=QB,b.editorAutoInsertBlock=VB,b.editorBreakTextBlock=qc,b.editorClearCompositionText=Y1,b.editorClearSelectedContents=X0,b.editorCopyBlock=AC,b.editorCopyDoc=nm,b.editorDeleteBlock=Z1,b.editorDeleteBlockText=Q1,b.editorDeleteBlockWithoutChildren=W0,b.editorDeleteChildContainer=E_,b.editorDeleteChildContainers=$B,b.editorFocusToBlock=eC,b.editorFocusToEnd=N_,b.editorGetBlockData=rl,b.editorGetBlockText=Yn,b.editorGetBlockTextEx=K0,b.editorGetBoxData=CB,b.editorHandleKeyboardEvent=ey,b.editorInsertBlock=Wc,b.editorInsertBoxToBlock=PB,b.editorInsertDoc=XB,b.editorInsertDocAt=iC,b.editorInsertText=X1,b.editorInsertTextToBlock=NB,b.editorInsertTextToBlockEx=q1,b.editorMergeTextBlock=HB,b.editorMoveDown=u5,b.editorMoveEnd=fC,b.editorMoveHome=x5,b.editorMoveLeft=l5,b.editorMoveLineEnd=w5,b.editorMoveLineHome=R5,b.editorMovePageDown=M5,b.editorMovePageUp=_5,b.editorMoveRight=a5,b.editorMoveUp=c5,b.editorMoveWordEnd=C5,b.editorMoveWordLeft=p5,b.editorRangeClearColor=ZB,b.editorRangeGetColor=t5,b.editorRangeSetColor=JB,b.editorRemoveTextAttribute=v_,b.editorReplaceBlockText=Y0,b.editorReplaceContainer=YB,b.editorRunOnce=BC,b.editorSelectAll=hC,b.editorSelectContainer=Z0,b.editorSelectDown=f5,b.editorSelectEnd=dC,b.editorSelectHome=b5,b.editorSelectLeft=d5,b.editorSelectLineEnd=k5,b.editorSelectLineHome=T5,b.editorSelectPageDown=N5,b.editorSelectPageUp=O5,b.editorSelectRight=h5,b.editorSelectUp=m5,b.editorSelectWordEnd=A5,b.editorSelectWordLeft=E5,b.editorSetTextColor=Xc,b.editorShowFindDialog=cW,b.editorToDocx=Ctt,b.editorUpdateBlockData=Q0,b.editorUpdateCompositionText=FB,b.editorUpdateEmbedData=WB,b.enablePageScroll=Hp,b.escapeHtmlText=f0,b.escapeRegExp=Xp,b.escapeSpace=W9,b.exclusiveBlock=kA,b.executeBlockCommand=Gv,b.executeEmbedBlockCommand=zv,b.executeRangeCommand=Ey,b.fileToDataUrl=_c,b.findAfterOffsetNotType=K1,b.findAllText=mC,b.findBlockByIndex=vv,b.findEventTargetBlock=Vb,b.findInsertionById=Uv,b.findNextOffset=K8,b.findNextVisibleSimpleBlock=By,b.findPrevOffset=F8,b.findPrevOffsetNotType=F1,b.findPrevSimpleBlockBeforeChildContainer=c3,b.findPrevVisibleSimpleBlock=vy,b.findTarget=Dc,b.findWordEnd=$1,b.findWordLeft=V1,b.format=Tf,b.formatBytes=uv,b.formatDate=Wp,b.fragmentToHtml=iv,b.fromBase64=bf,b.fromBase64ToBlob=Kp,b.fromBase64ToUint8Array=iI,b.fromDocRange=tl,b.fromNowString=qp,b.genId=it,b.generateEditorContainerId=Yp,b.getAllChildBlocks=A1,b.getAllQuickMenuItems=eA,b.getAllSelectedBlocks=Ji,b.getAttributesAt=$c,b.getBlockBackground=t1,b.getBlockByIndex=Yo,b.getBlockCaretRect=Jo,b.getBlockClass=le,b.getBlockClassByType=oa,b.getBlockClientRects=Ks,b.getBlockCommandsWithHook=l1,b.getBlockContent=zt,b.getBlockHeading=Lf,b.getBlockId=dt,b.getBlockIndex=Rt,b.getBlockInfo=$d,b.getBlockKind=Ci,b.getBlockMinWidth=Fv,b.getBlockNearestRangeFromPoint=C1,b.getBlockOptions=TI,b.getBlockPath=Zo,b.getBlockProperties=$v,b.getBlockRangeFromPoint=k0,b.getBlockStyles=yI,b.getBlockTextLength=Ct,b.getBlockTools=be,b.getBlockType=Ot,b.getBoxContent=n1,b.getBoxId=Dv,b.getBoxTypeFromElement=Sf,b.getChildBlockCount=pi,b.getChildBlocks=ke,b.getChildOffset=el,b.getColorFromAttributes=y1,b.getColorFromContent=x0,b.getComplexBlockClass=Hr,b.getContainerBlockPath=Qv,b.getContainerBlocks=xv,b.getContainerBlocksElement=Rf,b.getContainerById=gi,b.getContainerId=pt,b.getContainerMinWidth=f1,b.getContainerToolsElement=bI,b.getContainerWidth=n3,b.getDistanceSquare=Xo,b.getElementFromPoint=Oe,b.getElementOffset=Ef,b.getElementScale=$r,b.getEmbedType=on,b.getExistsBlockTools=b0,b.getExistsContainerById=kf,b.getFileExt=yf,b.getFirstChildBlock=Ne,b.getFirstClientRect=o0,b.getHeadingBlockChildren=Oc,b.getHeadingMenuOptions=QE,b.getHorizontalPadding=_p,b.getInsertionContent=r1,b.getLastChildBlock=Ze,b.getLastClientRect=ta,b.getListAllNextBrothers=mu,b.getLogger=D,b.getNextBlock=ae,b.getNextHiddenBlocks=Xv,b.getNextValidOffset=ha,b.getNextVisibleBlock=zr,b.getOffsetFromPoint=Dp,b.getOffsetInfoAfter=Kf,b.getOffsetInfoBefore=V0,b.getOpAt=F3,b.getOpLength=R0,b.getParentBlock=et,b.getParentBlockExcludeSelf=aa,b.getParentBox=e1,b.getParentContainer=at,b.getPrevBlock=$e,b.getPrevValidOffset=nl,b.getPrevVisibleBlock=jr,b.getRangeCommands=py,b.getReferenceClientRect=nk,b.getRootBlock=o1,b.getScrollContainer=hn,b.getSpecialBlockCommands=Hv,b.getStandardEmbedBlockProperties=ex,b.getTextAfterOffset=N8,b.getTextAttributes=W1,b.getTextBeforeOffset=P8,b.getTextBlockChild=_f,b.getTextBlockClass=yv,b.getTextBlockContentChildTextLength=Wr,b.getTextBlockContentChildType=Yv,b.getTextBlockContentChildren=Yi,b.getTextLength=Vn,b.getTextOpLength=x1,b.getTextWidth=g0,b.getToolbar=Hm,b.handleBlockElementUpdated=Kv,b.hasAltOnly=Z9,b.hasClass=Mt,b.hasCtrlOrCmd=Zb,b.hasCtrlOrCmdOnly=J9,b.hashCode=Cv,b.hideBlock=Sv,b.hideTemplates=oS,b.htmlToFragment=m0,b.i18n=_,b.includeBigTable=cN,b.injectDocToHtmlFragment=Xf,b.injectStyle=jb,b.inputActions=rM,b.insertEmptyBlock=wI,b.insertEmptyEmbedBlock=a1,b.insertText=Ws,b.intersectionCommands=OM,b.isBackspace=ev,b.isBlock=la,b.isBlockLocked=mg,b.isBlockLockedByOthers=wA,b.isBlockLockedBySelf=Hd,b.isBlockTools=wv,b.isBox=v0,b.isBoxOp=js,b.isCJK=Qb,b.isChildContainer=mi,b.isChildNode=Ce,b.isCodeBlock=_i,b.isCollapsedHeadingBlock=Xi,b.isCollapsedRange=A8,b.isComplexBlockPosition=fa,b.isComplexKindBlock=Pt,b.isContainer=Ps,b.isContainerSelectedAllChildBlocks=P5,b.isControlEvent=ia,b.isDelete=eI,b.isDraggingFiles=p0,b.isElementVisible=c0,b.isEmbedBlock=Le,b.isEmptyContainer=Mf,b.isEmptyDoc=N1,b.isEmptyTextBlock=ve,b.isEmptyTextBlockWithoutCompositionText=Md,b.isEnterOnly=tv,b.isEscape=h0,b.isExclusiveBlock=Vd,b.isExpandedHeadingBlock=qv,b.isFirefox=pf,b.isFirstChildBlockInComplexBlock=a7,b.isHeadingBlock=Ln,b.isHighSurrogate=H9,b.isInBlock=i1,b.isInBlockTools=Uc,b.isLetter=Yb,b.isLowSurrogate=j9,b.isMatchShortcut=Wi,b.isMoveForward=Y9,b.isNavigationEvent=X9,b.isNavigationKey=Jb,b.isNodeRemoved=Cf,b.isNumber=Xb,b.isPrintableKey=Pp,b.isRootBlock=Gr,b.isRootContainer=re,b.isSafari=Jl,b.isSameDay=Gp,b.isSelectBoxOnly=Ii,b.isShiftEnter=tI,b.isShiftTab=rI,b.isShortcutEvent=Q9,b.isSimpleBlock=BI,b.isSimpleBlockPosition=xi,b.isSimplePos=hB,b.isSimpleRange=N0,b.isSpace=d0,b.isTab=nI,b.isTextBlockContentBoxChild=Br,b.isTextBlockContentChild=If,b.isTextBlockContentInsertionChild=$s,b.isTextBlockContentTextChild=Df,b.isTextKindBlock=ot,b.isTextKindBlockType=wf,b.isTitleBlock=Fs,b.isToday=fv,b.isValidOffset=or,b.isVisibleBlock=Qo,b.isYesterday=dv,b.loadJs=Kb,b.loadJsPromise=ea,b.lockers=hi,b.mergeCommands=$m,b.mergeDocs=pa,b.mergeOps=U1,b.mergeText=g8,b.multiSplitText=V3,b.overflowText=hv,b.parseShortcut=nv,b.patchNode=vf,b.pointInRect=ra,b.rangeAddAttribute=Nf,b.rangeGetTextColor=q3,b.rangeRemoveAttribute=Vc,b.rangeSetTextColor=z3,b.rangeTransformText=H3,b.registerDragDrop=Op,b.removeAttribute=B1,b.removeClass=ct,b.removeLastBr=f8,b.removePlaceholderFromBlock=RR,b.removeStyle=Hb,b.replaceAll=hI,b.replaceAllCaseInsensitive=mI,b.replaceAllText=K5,b.replaceText=U0,b.requestDownload=C0,b.resetListStart=pu,b.scrollIntoView=$f,b.scrollable=av,b.selectFile=Mc,b.selectedBlockToDoc=tm,b.selectionToDoc=Yc,b.setAttributes=a0,b.setClipboardData=Bf,b.setClipboardDataByEvent=lI,b.setColorToAttributes=G3,b.setDataset=Mp,b.setDefaultCursor=xf,b.setStyles=Up,b.shareDBCommentToDocObject=$C,b.shareDBDocCommentToComment=r2,b.shortcutToDisplayText=dn,b.showBlock=Zp,b.showDocVersions=btt,b.showTemplates=hx,b.splitText=sr,b.splitToThree=pn,b.stringToDataUrl=Vp,b.stringToObjectUrl=jp,b.subText=$3,b.textNodeOffsetFromPoint=Fb,b.titleFromEditor=cS,b.toBase64URL=qi,b.toMindmap=Xm,b.toPlainText=Re,b.toPlainTextKeepLength=P1,b.trimChar=Np,b.unexclusiveBlock=RA,b.unicodeLength=z9,b.unicodeSubstr=G9,b.updateBlockSelection=Pv,b.updateOpAttributes=fB,b.updateTextBlockContent=O8,b.updateUrl=Fp;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"}})});
|