vdc-editor 0.1.197 → 0.1.198

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.
@@ -1,4 +1,4 @@
1
- import { A as i, r as t, q as o, s as r, E as d, p, t as u, p as E, B as l, v as n, F as S, y as m, u as w, w as x, z as f, x as g } from "./index-CT6L-cic.mjs";
1
+ import { A as i, r as t, q as o, s as r, E as d, p, t as u, p as E, B as l, v as n, F as S, y as m, u as w, w as x, z as f, x as g } from "./index-DgdZsemB.mjs";
2
2
  import "@vueuse/core";
3
3
  export {
4
4
  i as ArticleCompareEditor,
@@ -282,7 +282,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ne=L,te=q),Z===void 0&
282
282
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[kk]=this[kk]={accessors:{}}).accessors,o=this.prototype;function s(a){const l=gc(a);r[l]||(VJ(o,a),r[l]=!0)}return re.isArray(e)?e.forEach(s):s(e),this}};sr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),re.reduceDescriptors(sr.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),re.freezeMethods(sr);function $b(t,e){const n=this||mc,r=e||n,o=sr.from(r.headers);let s=r.data;return re.forEach(t,function(l){s=l.call(n,s,o.normalize(),e?e.status:void 0)}),o.normalize(),s}function Sk(t){return!!(t&&t.__CANCEL__)}function Tl(t,e,n){st.call(this,t??"canceled",st.ERR_CANCELED,e,n),this.name="CanceledError"}re.inherits(Tl,st,{__CANCEL__:!0});function _k(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new st("Request failed with status code "+n.status,[st.ERR_BAD_REQUEST,st.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function FJ(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function $J(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,s=0,a;return e=e!==void 0?e:1e3,function(u){const c=Date.now(),f=r[s];a||(a=c),n[o]=u,r[o]=c;let p=s,m=0;for(;p!==o;)m+=n[p++],p=p%t;if(o=(o+1)%t,o===s&&(s=(s+1)%t),c-a<e)return;const g=f&&c-f;return g?Math.round(m*1e3/g):void 0}}function zJ(t,e){let n=0,r=1e3/e,o,s;const a=(c,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),t.apply(null,c)};return[(...c)=>{const f=Date.now(),p=f-n;p>=r?a(c,f):(o=c,s||(s=setTimeout(()=>{s=null,a(o)},r-p)))},()=>o&&a(o)]}const Kp=(t,e,n=3)=>{let r=0;const o=$J(50,250);return zJ(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,u=a-r,c=o(u),f=a<=l;r=a;const p={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:c||void 0,estimated:c&&l&&f?(l-a)/c:void 0,event:s,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(p)},n)},Tk=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Ak=t=>(...e)=>re.asap(()=>t(...e)),HJ=zn.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,zn.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(zn.origin),zn.navigator&&/(msie|trident)/i.test(zn.navigator.userAgent)):()=>!0,UJ=zn.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const a=[t+"="+encodeURIComponent(e)];re.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),re.isString(r)&&a.push("path="+r),re.isString(o)&&a.push("domain="+o),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function WJ(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function jJ(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ok(t,e,n){let r=!WJ(e);return t&&(r||n==!1)?jJ(t,e):e}const Mk=t=>t instanceof sr?{...t}:t;function fa(t,e){e=e||{};const n={};function r(c,f,p,m){return re.isPlainObject(c)&&re.isPlainObject(f)?re.merge.call({caseless:m},c,f):re.isPlainObject(f)?re.merge({},f):re.isArray(f)?f.slice():f}function o(c,f,p,m){if(re.isUndefined(f)){if(!re.isUndefined(c))return r(void 0,c,p,m)}else return r(c,f,p,m)}function s(c,f){if(!re.isUndefined(f))return r(void 0,f)}function a(c,f){if(re.isUndefined(f)){if(!re.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function l(c,f,p){if(p in e)return r(c,f);if(p in t)return r(void 0,c)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(c,f,p)=>o(Mk(c),Mk(f),p,!0)};return re.forEach(Object.keys(Object.assign({},t,e)),function(f){const p=u[f]||o,m=p(t[f],e[f],f);re.isUndefined(m)&&p!==l||(n[f]=m)}),n}const Bk=t=>{const e=fa({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:l}=e;e.headers=a=sr.from(a),e.url=wk(Ok(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(re.isFormData(n)){if(zn.hasStandardBrowserEnv||zn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[c,...f]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...f].join("; "))}}if(zn.hasStandardBrowserEnv&&(r&&re.isFunction(r)&&(r=r(e)),r||r!==!1&&HJ(e.url))){const c=o&&s&&UJ.read(s);c&&a.set(o,c)}return e},qJ=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=Bk(t);let s=o.data;const a=sr.from(o.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:c}=o,f,p,m,g,b;function y(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function w(){if(!x)return;const k=sr.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),_={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:k,config:t,request:x};_k(function(A){n(A),y()},function(A){r(A),y()},_),x=null}"onloadend"in x?x.onloadend=w:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(w)},x.onabort=function(){x&&(r(new st("Request aborted",st.ECONNABORTED,t,x)),x=null)},x.onerror=function(){r(new st("Network Error",st.ERR_NETWORK,t,x)),x=null},x.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||Ck;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),r(new st(C,_.clarifyTimeoutError?st.ETIMEDOUT:st.ECONNABORTED,t,x)),x=null},s===void 0&&a.setContentType(null),"setRequestHeader"in x&&re.forEach(a.toJSON(),function(C,_){x.setRequestHeader(_,C)}),re.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),l&&l!=="json"&&(x.responseType=o.responseType),c&&([m,b]=Kp(c,!0),x.addEventListener("progress",m)),u&&x.upload&&([p,g]=Kp(u),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(f=k=>{x&&(r(!k||k.type?new Tl(null,t,x):k),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const E=FJ(o.url);if(E&&zn.protocols.indexOf(E)===-1){r(new st("Unsupported protocol "+E+":",st.ERR_BAD_REQUEST,t));return}x.send(s||null)})},KJ=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,l();const f=c instanceof Error?c:this.reason;r.abort(f instanceof st?f:new Tl(f instanceof Error?f.message:f))}};let a=e&&setTimeout(()=>{a=null,s(new st(`timeout ${e} of ms exceeded`,st.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),t=null)};t.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>re.asap(l),u}},GJ=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},XJ=async function*(t,e){for await(const n of YJ(t))yield*GJ(n,e)},YJ=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Ik=(t,e,n,r)=>{const o=XJ(t,e);let s=0,a,l=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){l(),u.close();return}let p=f.byteLength;if(n){let m=s+=p;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw l(c),c}},cancel(u){return l(u),o.return()}},{highWaterMark:2})},Gp=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Rk=Gp&&typeof ReadableStream=="function",JJ=Gp&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Lk=(t,...e)=>{try{return!!t(...e)}catch{return!1}},ZJ=Rk&&Lk(()=>{let t=!1;const e=new Request(zn.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Pk=64*1024,zb=Rk&&Lk(()=>re.isReadableStream(new Response("").body)),Xp={stream:zb&&(t=>t.body)};Gp&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Xp[e]&&(Xp[e]=re.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new st(`Response type '${e}' is not supported`,st.ERR_NOT_SUPPORT,r)})})})(new Response);const QJ=async t=>{if(t==null)return 0;if(re.isBlob(t))return t.size;if(re.isSpecCompliantForm(t))return(await new Request(zn.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(re.isArrayBufferView(t)||re.isArrayBuffer(t))return t.byteLength;if(re.isURLSearchParams(t)&&(t=t+""),re.isString(t))return(await JJ(t)).byteLength},NJ=async(t,e)=>{const n=re.toFiniteNumber(t.getContentLength());return n??QJ(e)},Hb={http:wJ,xhr:qJ,fetch:Gp&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:s,timeout:a,onDownloadProgress:l,onUploadProgress:u,responseType:c,headers:f,withCredentials:p="same-origin",fetchOptions:m}=Bk(t);c=c?(c+"").toLowerCase():"text";let g=KJ([o,s&&s.toAbortSignal()],a),b;const y=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let x;try{if(u&&ZJ&&n!=="get"&&n!=="head"&&(x=await NJ(f,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),T;if(re.isFormData(r)&&(T=_.headers.get("content-type"))&&f.setContentType(T),_.body){const[A,R]=Tk(x,Kp(Ak(u)));r=Ik(_.body,Pk,A,R)}}re.isString(p)||(p=p?"include":"omit");const w="credentials"in Request.prototype;b=new Request(e,{...m,signal:g,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?p:void 0});let E=await fetch(b);const k=zb&&(c==="stream"||c==="response");if(zb&&(l||k&&y)){const _={};["status","statusText","headers"].forEach(P=>{_[P]=E[P]});const T=re.toFiniteNumber(E.headers.get("content-length")),[A,R]=l&&Tk(T,Kp(Ak(l),!0))||[];E=new Response(Ik(E.body,Pk,A,()=>{R&&R(),y&&y()}),_)}c=c||"text";let C=await Xp[re.findKey(Xp,c)||"text"](E,t);return!k&&y&&y(),await new Promise((_,T)=>{_k(_,T,{data:C,headers:sr.from(E.headers),status:E.status,statusText:E.statusText,config:t,request:b})})}catch(w){throw y&&y(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new st("Network Error",st.ERR_NETWORK,t,b),{cause:w.cause||w}):st.from(w,w&&w.code,t,b)}})};re.forEach(Hb,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Dk=t=>`- ${t}`,eZ=t=>re.isFunction(t)||t===null||t===!1,Vk={getAdapter:t=>{t=re.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!eZ(n)&&(r=Hb[(a=String(n)).toLowerCase()],r===void 0))throw new st(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+s]=r}if(!r){const s=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
283
283
  `+s.map(Dk).join(`
284
284
  `):" "+Dk(s[0]):"as no adapter specified";throw new st("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Hb};function Ub(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Tl(null,t)}function Fk(t){return Ub(t),t.headers=sr.from(t.headers),t.data=$b.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Vk.getAdapter(t.adapter||mc.adapter)(t).then(function(r){return Ub(t),r.data=$b.call(t,t.transformResponse,r),r.headers=sr.from(r.headers),r},function(r){return Sk(r)||(Ub(t),r&&r.response&&(r.response.data=$b.call(t,t.transformResponse,r.response),r.response.headers=sr.from(r.response.headers))),Promise.reject(r)})}const $k="1.8.4",Yp={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Yp[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const zk={};Yp.transitional=function(e,n,r){function o(s,a){return"[Axios v"+$k+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,l)=>{if(e===!1)throw new st(o(a," has been removed"+(n?" in "+n:"")),st.ERR_DEPRECATED);return n&&!zk[a]&&(zk[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,a,l):!0}},Yp.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function tZ(t,e,n){if(typeof t!="object")throw new st("options must be an object",st.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const s=r[o],a=e[s];if(a){const l=t[s],u=l===void 0||a(l,s,t);if(u!==!0)throw new st("option "+s+" must be "+u,st.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new st("Unknown option "+s,st.ERR_BAD_OPTION)}}const Jp={assertOptions:tZ,validators:Yp},$o=Jp.validators;let pa=class{constructor(e){this.defaults=e,this.interceptors={request:new xk,response:new xk}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
285
- `+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=fa(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Jp.assertOptions(r,{silentJSONParsing:$o.transitional($o.boolean),forcedJSONParsing:$o.transitional($o.boolean),clarifyTimeoutError:$o.transitional($o.boolean)},!1),o!=null&&(re.isFunction(o)?n.paramsSerializer={serialize:o}:Jp.assertOptions(o,{encode:$o.function,serialize:$o.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Jp.assertOptions(n,{baseUrl:$o.spelling("baseURL"),withXsrfToken:$o.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&re.merge(s.common,s[n.method]);s&&re.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),n.headers=sr.concat(a,s);const l=[];let u=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(u=u&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let f,p=0,m;if(!u){const b=[Fk.bind(this),void 0];for(b.unshift.apply(b,l),b.push.apply(b,c),m=b.length,f=Promise.resolve(n);p<m;)f=f.then(b[p++],b[p++]);return f}m=l.length;let g=n;for(p=0;p<m;){const b=l[p++],y=l[p++];try{g=b(g)}catch(x){y.call(this,x);break}}try{f=Fk.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=c.length;p<m;)f=f.then(c[p++],c[p++]);return f}getUri(e){e=fa(this.defaults,e);const n=Ok(e.baseURL,e.url,e.allowAbsoluteUrls);return wk(n,e.params,e.paramsSerializer)}};re.forEach(["delete","get","head","options"],function(e){pa.prototype[e]=function(n,r){return this.request(fa(r||{},{method:e,url:n,data:(r||{}).data}))}}),re.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,l){return this.request(fa(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}pa.prototype[e]=n(),pa.prototype[e+"Form"]=n(!0)});let nZ=class I_{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(l=>{r.subscribe(l),s=l}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,l){r.reason||(r.reason=new Tl(s,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new I_(function(o){e=o}),cancel:e}}};function rZ(t){return function(n){return t.apply(null,n)}}function oZ(t){return re.isObject(t)&&t.isAxiosError===!0}const Wb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Wb).forEach(([t,e])=>{Wb[e]=t});function Hk(t){const e=new pa(t),n=sk(pa.prototype.request,e);return re.extend(n,pa.prototype,e,{allOwnKeys:!0}),re.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Hk(fa(t,o))},n}const on=Hk(mc);on.Axios=pa,on.CanceledError=Tl,on.CancelToken=nZ,on.isCancel=Sk,on.VERSION=$k,on.toFormData=jp,on.AxiosError=st,on.Cancel=on.CanceledError,on.all=function(e){return Promise.all(e)},on.spread=rZ,on.isAxiosError=oZ,on.mergeConfig=fa,on.AxiosHeaders=sr,on.formToJSON=t=>Ek(re.isHTMLForm(t)?new FormData(t):t),on.getAdapter=Vk.getAdapter,on.HttpStatusCode=Wb,on.default=on;const{Axios:Zse,AxiosError:Qse,CanceledError:Nse,isCancel:eae,CancelToken:tae,VERSION:nae,all:rae,Cancel:oae,isAxiosError:iae,spread:sae,toFormData:aae,AxiosHeaders:lae,HttpStatusCode:uae,formToJSON:cae,getAdapter:dae,mergeConfig:fae}=on,iZ=async function(t){let e=[];try{if(this.enabled===!1||t.length===0||t.trim()==="")return e;if(this.limit&&t.length>this.limit)throw new Error("Text is too long");const n=await on.post(this.getApi(),{value:t}),r=this.transfer(n.data);e=(r==null?void 0:r.map(o=>o.errorText))||[],this!=null&&this.setSuggestions&&this.setSuggestions(r)}catch(n){console.error(n)}return e};class Uk{constructor({api:e,limit:n,transfer:r,enabled:o}){Gt(this,"suggestions",[]);Gt(this,"api","");Gt(this,"enabled",!0);Gt(this,"limit");Gt(this,"transfer");this.suggestions=[],this.api=e,this.limit=n,this.transfer=r,this.enabled=o??!0}setSuggestions(e){this.suggestions=e}getSuggestions(e){var n;return Promise.resolve(((n=this.suggestions.find(r=>r.errorText.wrongWord===e))==null?void 0:n.spellData.correctWord)??[])}getApi(){return this.api}normalizeTextForLanguage(e){return e}proofreadText(e){return Promise.resolve(iZ.call(this,e))}toggleIsEnabled(){this.enabled=!this.enabled}setEnabled(e){this.enabled=e}getIsEnabled(){return this.enabled}}const sZ=Object.freeze(Object.defineProperty({__proto__:null,AI:yY,BaseKit:NE,Blockquote:dW,Bold:kC,BulletList:nW,Clear:h1,Code:iH,CodeBlock:EU,Color:o8,Columns:gb,FindAndReplace:MY,FontFamily:mE,FontSize:r8,FormatPainter:pb,Fullscreen:QW,Heading:t8,Highlight:ZU,History:H1,HorizontalRule:HW,Image:mb,ImageUpload:QE,ImportWord:CY,Indent:QX,Italic:SC,LineHeight:vE,Link:F1,MoreMark:XX,OrderedList:sW,Preview:EY,Printer:RY,Proofreader:Uk,SlashCommand:bY,SpellcheckerExtension:ik,Strike:TC,SubAndSuperScript:qX,Table:Sb,TaskList:uW,TextAlign:n8,Underline:_C,Video:YE,VideoUpload:XE},Symbol.toStringTag,{value:"Module"})),aZ='<page id="ft6nbbxs" extend="false" pagenumber="1" force="false"><h1 id="tk6n64mj" extend="&quot;false&quot;"><strong>Introduction(English)</strong></h1><p id="s864ng1o" extend="&quot;false&quot;">MyMy Editor is open-source document editor based on Vue3 and Tiptap. MyMy Editor provides comprehensive document editing capabilities, supports pagination, supports Markdown syntax, offers basic rich text editing functions, allows for the insertion of various node types in multiple formats, provides a variety of practical tools, and supports setting page styles. It also supports exporting in various formats, printing and print preview, block-level document editing, adding custom extensions, multi-language settings, and a dark theme.</p><h1 id="jm9johtz" extend="&quot;false&quot;"><strong>소개(국문)</strong></h1><p id="0qei01hl" extend="&quot;false&quot;">마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.</p><blockquote class="blockquote"><p id="nekf7yi0" extend="false"><span style="color: rgb(115, 209, 61)"><strong><em>Make by VDC</em></strong></span></p></blockquote></page>';function lZ(){const t=window.localStorage.getItem("content"),e=i.ref(t||aZ),n=i.computed(()=>[NE.configure({placeholder:{showOnlyCurrent:!0},characterCount:{limit:5e4},excludes:{}}),H1,gb,pb,h1,F1,mb,Sb]),r=pt.useEventBus(ir.RENDER_SUPER_TEXT);function o(s,a){const l={action:"status",payload:{id:s,status:a}};r.emit(l)}return{defaultExtensions:n,content:e,dispatchUpdateStatusSuperText:o}}const uZ={class:"flex items-center h-[32px] hover:bg-ed-muted rounded-md"},cZ={class:"text-sm flex items-center justify-center"},dZ={width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},fZ={id:"icon/填充色",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},pZ={id:"icon/背景颜色"},hZ=["fill"],Wk=i.defineComponent({__name:"HighlightActionButton",props:{editor:{},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0},tooltipOptions:{default:void 0}},setup(t){const e=t,n=i.ref(void 0),{state:r}=vn();function o(a){var l;(l=e.action)==null||l.call(e,a)}function s(a){var l;(l=e.action)==null||l.call(e,n.value)}return i.watchEffect(()=>{const{color:a}=e.editor.getAttributes("highlight");r.highlight=a}),(a,l)=>(i.openBlock(),i.createElementBlock("div",uZ,[i.createVNode(Ge,{id:"highlight",tooltip:a.tooltip,disabled:a.disabled,action:s,"tooltip-options":a.tooltipOptions},{icon:i.withCtx(()=>[i.createElementVNode("span",cZ,[(i.openBlock(),i.createElementBlock("svg",dZ,[i.createElementVNode("g",fZ,[i.createElementVNode("g",pZ,[l[1]||(l[1]=i.createElementVNode("g",{id:"编组",fill:"currentColor"},[i.createElementVNode("g",{id:"矩形",transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)"},[i.createElementVNode("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z","fill-rule":"nonzero"}),i.createElementVNode("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z","fill-rule":"evenodd"}),i.createElementVNode("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z","fill-rule":"nonzero"})])],-1)),i.createElementVNode("path",{id:"矩形",d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",fill:n.value||"#FBDE28"},null,8,hZ)])])]))])]),_:1},8,["tooltip","disabled","tooltip-options"]),i.createVNode(gC,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),highlight:"",disabled:a.disabled,onChange:o},{default:i.withCtx(()=>[i.createVNode(i.unref(_n),{variant:"ghost",size:"icon",class:"w-3 h-[32px] rounded-l-none hover:bg-ed-muted-foreground/20",disabled:a.disabled},{default:i.withCtx(()=>[i.createVNode(i.unref(jt),{class:"w-3 h-3 text-zinc-500",name:"MenuDown"})]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled"])]))}}),mZ={class:"h-full w-fit min-w-32 flex items-center leading-none gap-0.5 p-2 bg-ed-background rounded-lg shadow-sm border border-ed-border"},Zp=i.defineComponent({__name:"TableBubbleMenu",props:{editor:{}},setup(t){const e=t,n=()=>document.body,r=({editor:x})=>{var w;return x.isActive("table")&&(((w=x.storage.table)==null?void 0:w.isTableEditorOpen)??!1)},{t:o}=At();function s(){e.editor.chain().focus().addColumnBefore().run()}function a(){e.editor.chain().focus().addColumnAfter().run()}function l(){e.editor.chain().focus().deleteColumn().run()}function u(){e.editor.chain().focus().addRowBefore().run()}function c(){e.editor.chain().focus().addRowAfter().run()}function f(){e.editor.chain().focus().deleteRow().run()}function p(){e.editor.chain().focus().mergeCells().run()}function m(){var x;(x=e.editor)==null||x.chain().focus().splitCell().run()}function g(){e.editor.chain().focus().deleteTable().run()}function b(x){e.editor.chain().focus().setTableCellBackground(x).run()}const y=()=>{const x=document.querySelector(".vdc-editor");if(!x)return new DOMRect(-1e3,-1e3,0,0);const w=x.getBoundingClientRect();return new DOMRect(w.left,w.top+10,w.width,0)};return(x,w)=>(i.openBlock(),i.createBlock(i.unref(Od),{editor:x.editor,"plugin-key":"table","update-delay":0,"should-show":r,"tippy-options":{zIndex:9999,maxWidth:"auto",getReferenceClientRect:y,appendTo:n}},{default:i.withCtx(()=>{var E,k,C,_,T,A,R,P,M;return[i.createElementVNode("div",mZ,[i.createVNode(Ge,{icon:"TablerColumnInsertLeft","icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.insertColumnBefore"),action:s,"tooltip-options":{sideOffset:15},disabled:!((E=x.editor)!=null&&E.can().addColumnBefore())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TablerColumnInsertRight",tooltip:i.unref(o)("editor.table.menu.insertColumnAfter"),"icon-class":"w-5 h-5",action:a,"tooltip-options":{sideOffset:15},disabled:!((k=x.editor)!=null&&k.can().addColumnAfter())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TablerColumnRemove",action:l,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15},disabled:!((C=x.editor)!=null&&C.can().deleteColumn())},null,8,["tooltip","disabled"]),i.createVNode(i.unref(oi),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),i.createVNode(Ge,{icon:"TablerRowInsertTop",action:u,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15},disabled:!((_=x.editor)!=null&&_.can().addRowBefore())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TablerRowInsertBottom",action:c,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15},disabled:!((T=x.editor)!=null&&T.can().addRowAfter())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TablerRowRemove",action:f,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15},disabled:!((A=x.editor)!=null&&A.can().deleteRow())},null,8,["tooltip","disabled"]),i.createVNode(i.unref(oi),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),i.createVNode(Ge,{icon:"TableCellsMerge",action:p,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15},disabled:!((R=x.editor)!=null&&R.can().mergeCells())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TableCellsSplit",action:m,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15},disabled:!((P=x.editor)!=null&&P.can().splitCell())},null,8,["tooltip","disabled"]),i.createVNode(i.unref(oi),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),i.createVNode(Wk,{editor:x.editor,tooltip:i.unref(o)("editor.table.menu.setCellsBgColor"),action:b,"tooltip-options":{sideOffset:15}},null,8,["editor","tooltip"]),i.createVNode(Ge,{icon:"Trash2",tooltip:i.unref(o)("editor.table.menu.deleteTable"),"icon-class":"w-5 h-5",action:g,"tooltip-options":{sideOffset:15},disabled:!((M=x.editor)!=null&&M.can().deleteTable())},null,8,["tooltip","disabled"])])]}),_:1},8,["editor","tippy-options"]))}}),gZ={class:"p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},bZ={class:"flex items-center gap-1"},Qp=i.defineComponent({__name:"ColumnsBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=({editor:l})=>n0(l.view.state,"columns"),r=()=>{const l=mC(e.editor,"columns");return(l==null?void 0:l.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},o=()=>{e.editor.chain().focus().setLayout(aa.SidebarLeft).run()},s=()=>{e.editor.chain().focus().setLayout(aa.SidebarRight).run()},a=()=>{e.editor.chain().focus().setLayout(aa.TwoColumn).run()};return(l,u)=>(i.openBlock(),i.createBlock(i.unref(Od),{editor:l.editor,"plugin-key":"columns","should-show":n,"update-delay":0,"tippy-options":{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,plugins:[i.unref(SB)],sticky:"popper"}},{default:i.withCtx(()=>[i.createElementVNode("div",gZ,[i.createElementVNode("div",bZ,[i.createVNode(Ge,{id:"panel-left",title:"ok",icon:"PanelLeft",tooltip:"tooltip",action:o,"is-active":()=>l.editor.isActive("columns",{layout:i.unref(aa).SidebarLeft}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),i.createVNode(Ge,{id:"columns",title:"ok",icon:"Columns",tooltip:"tooltip",action:a,"is-active":()=>l.editor.isActive("columns",{layout:i.unref(aa).TwoColumn}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),i.createVNode(Ge,{id:"panel-right",title:"ok",icon:"PanelRight",tooltip:"tooltip",action:s,"is-active":()=>l.editor.isActive("columns",{layout:i.unref(aa).SidebarRight}),"tooltip-options":{sideOffset:15}},null,8,["is-active"])])])]),_:1},8,["editor","tippy-options"]))}}),vZ={class:"flex items-center gap-2 p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},yZ=["href"],wZ={class:"flex flex-nowrap"},xZ=i.defineComponent({__name:"LinkViewBlock",props:{editor:{},link:{default:void 0}},emits:["clear","edit"],setup(t,{emit:e}){const{t:n}=At(),r=e;function o(){r("clear")}function s(){r("edit")}return(a,l)=>(i.openBlock(),i.createElementBlock("div",vZ,[i.createElementVNode("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",class:"text-sm underline break-all"},i.toDisplayString(i.unref(it.truncate)(a.link,{length:50,omission:"…"})),9,yZ),a.link?(i.openBlock(),i.createBlock(i.unref(oi),{key:0,orientation:"vertical",class:"h-4"})):i.createCommentVNode("",!0),i.createElementVNode("div",wZ,[i.createVNode(Ge,{icon:"Pencil",tooltip:i.unref(n)("editor.link.edit.tooltip"),action:s,"tooltip-options":{sideOffset:15}},null,8,["tooltip"]),i.createVNode(Ge,{icon:"Unlink",tooltip:i.unref(n)("editor.link.unlink.tooltip"),action:o,"tooltip-options":{sideOffset:15}},null,8,["tooltip"])])]))}}),Np=i.defineComponent({__name:"LinkBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=i.ref(!1),r=i.ref(),o={width:-2,height:16},s=i.computed(()=>{const{href:f}=e.editor.getAttributes("link");return f}),a=i.computed(()=>e.editor.isActive("link")),l=i.computed(()=>{var y;if(!n.value)return{};const f=e.editor.state.selection,p=e.editor.view.coordsAtPos(f.from),m=(y=r.value)==null?void 0:y.getBoundingClientRect(),g=p.left+((m==null?void 0:m.width)??0)+o.width>window.innerWidth,b=p.top+((m==null?void 0:m.height)??0)+o.height>window.innerHeight;return g||b?{left:g?`${p.left-((m==null?void 0:m.width)??0)-o.width}px`:`${p.left}px`,top:b?`${p.top-((m==null?void 0:m.height)??0)-o.height}px`:`${p.top}px`}:{left:`${p.left}px`,top:`${p.bottom+o.height}px`}});function u(f,p,m){e.editor.chain().extendMarkRange("link").insertContent({type:"text",text:p,marks:[{type:"link",attrs:{href:f,target:m?"_blank":""}}]}).setLink({href:f}).focus().run(),n.value=!1}function c(){e.editor.chain().extendMarkRange("link").unsetLink().focus().run(),n.value=!1}return(f,p)=>i.withDirectives((i.openBlock(),i.createBlock(i.unref(Od),{editor:f.editor,"update-delay":0,"tippy-options":{popperOptions:{modifiers:[{name:"flip",enabled:!0}]},appendTo:"parent",placement:"bottom-start",offset:[o.width,o.height],zIndex:9999,onHidden:()=>{n.value=!1}}},{default:i.withCtx(()=>[n.value?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"#vdc-editor"},[i.createElementVNode("div",{ref_key:"editFormRef",ref:r,class:"fixed z-50",style:i.normalizeStyle(l.value)},[i.createVNode(T8,{class:"p-4",editor:f.editor,onOnSetLink:u},null,8,["editor"])],4)])):i.createCommentVNode("",!0),n.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(xZ,{key:1,editor:f.editor,link:s.value,onClear:c,onEdit:p[0]||(p[0]=m=>n.value=!0)},null,8,["editor","link"]))]),_:1},8,["editor","tippy-options"])),[[i.vShow,a.value]])}}),jb=i.defineComponent({__name:"Badge",props:{variant:{},class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref(Ae)(i.unref(CZ)({variant:e.variant}),e.class))},[i.renderSlot(n.$slots,"default")],2))}}),CZ=jg("inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-ed-primary text-ed-primary-foreground hover:bg-ed-primary/80",secondary:"border-transparent bg-ed-secondary text-ed-secondary-foreground hover:bg-ed-secondary/80",destructive:"border-transparent bg-ed-destructive text-ed-destructive-foreground hover:bg-ed-destructive/80",outline:"text-ed-foreground"}},defaultVariants:{variant:"default"}}),jk=(t,e,n,r,o)=>{const s=i.ref(0),a=pt.useEventBus(ir.RENDER_SUPER_TEXT),l=_=>{if(!e.value||!t)return;const T=e.value.index,A=e.value.id,{state:R}=t,{tr:P}=R;let M=!1;R.doc.descendants(($,j)=>{var X,ie;if(((X=$.attrs)==null?void 0:X[ot.ID])===A){(ie=$.attrs[ot.TEXT])!=null&&ie.trim();const W=_.trim();if(wE(W))return P.delete(j,j+1),M=!0,!1;const{[ot.ELEMENT_ID]:z,...L}=$.attrs;return P.setNodeMarkup(j,void 0,{...L,[ot.TEXT]:W}),M=!0,!1}return!0}),M&&t&&t.view.dispatch(P),T!==-1&&(n.value[T].text=_,n.value[T].textOriginal=_)},u=()=>{if(!(t!=null&&t.view.dom))return[];const _=[],T=t==null?void 0:t.view.dom.querySelectorAll("[node-id]"),A=new Map;return T.forEach(R=>{const P=R.getBoundingClientRect().top;A.set(P,R)}),_.push(...A.values()),_},c=_=>{const T=_.closest(`#${r}`);if(!T)return;const A=T.getBoundingClientRect().top,R=T==null?void 0:T.scrollTop;return _.getBoundingClientRect().top-(A-R)},f=(_,T)=>{const A=n.value.findIndex(R=>R.id===_);A>-1&&(n.value[A].status=T)},p=_=>_.replace(/<p><\/p>/g,"<p>&nbsp;</p>"),m=i.ref(new Map),g=()=>{if(!n.value||n.value.length===0){s.value=0,m.value.clear();return}if(!o.value||o.value.length===0)return;const _=o.value,T=new Set(n.value.map(P=>P.id));for(const P of m.value.keys())T.has(P)||m.value.delete(P);const A=_.map(P=>({isHidden:P.classList.contains("hidden"),isTruncated:P.classList.contains("super-text-truncate")}));_.forEach(P=>{P.classList.remove("hidden"),P.classList.remove("super-text-truncate")}),_.forEach(P=>{const M=P.getAttribute("book-mark-id");if(!M)return;const $=P.offsetTop+P.offsetHeight,j=m.value.get(M)||0;m.value.set(M,Math.max($,j))}),_.forEach((P,M)=>{A[M].isHidden&&P.classList.add("hidden"),A[M].isTruncated&&P.classList.add("super-text-truncate")});let R=0;for(const P of m.value.values())P>R&&(R=P);s.value=R},b=async()=>{await i.nextTick();const T=u().map(A=>{const R=A.getAttribute("node-id"),P=A.getAttribute("book-mark-content"),M=A.getAttribute("page-id"),$=A.getAttribute("page-number"),j=A.getBoundingClientRect(),X=A.getAttribute("line-id"),ie=A.getAttribute("element-id");return{position:j,text:p(P),id:R,pageId:M,pageNumber:$,visiblePosition:c(A),status:0,lineId:X,elementId:ie,textOriginal:p(P)}});n.value=T},y=(_,T)=>{const A=_.bottom<=T.top,R=_.top>=T.bottom;return!(A||R)};async function x(){const _=o.value;!_||_.length===0||(_.sort((T,A)=>{const R=Number(T.getAttribute("index")),P=Number(A.getAttribute("index"));return R-P}),_.forEach(T=>T.classList.remove("super-text-truncate")),_.forEach((T,A)=>{const R=T.getBoundingClientRect();_.slice(A+1).forEach(P=>{const M=P.getBoundingClientRect();y(R,M)&&T.classList.add("super-text-truncate")})}),g())}const w=async _=>{await i.nextTick();const T=t==null?void 0:t.view.dom.querySelector(`[node-id='${_.dataId}']`),A=o.value.find(M=>{const $=M.getBoundingClientRect().top,j=T==null?void 0:T.getBoundingClientRect().top;if(j==null)return!1;const X=j-$;return Math.abs(X-9)<=2});if(!A)return;const R=Number(A.getAttribute("index"));if(!_.text){A.querySelector(".super-text-lines").innerHTML=n.value[R].textOriginal,o.value.forEach(M=>M.classList.remove("hidden")),x();return}A.querySelector(".super-text-lines").innerHTML=p(_.text),A.classList.remove("super-text-truncate");const P=A.getBoundingClientRect();o.value.forEach((M,$)=>{if($!==R){const j=M.getBoundingClientRect();y(P,j)&&M.classList.add("hidden")}}),g()},E=_=>{switch(_.action){case"hover":w(_.payload);break;case"status":f(_.payload.id,_.payload.status);break;case"render":b();break;default:console.log("There is no action")}},k=(_,T)=>{const A=_.currentTarget;A.classList.remove("super-text-truncate");const R=A.getBoundingClientRect();o.value.forEach((P,M)=>{if(M!==T){const $=P.getBoundingClientRect();y(R,$)&&P.classList.add("hidden")}}),g()},C=()=>{o.value.forEach(_=>_.classList.remove("hidden")),x()};return i.onBeforeMount(()=>{a.on(E),window.addEventListener("resize",b)}),i.onBeforeUnmount(()=>{a.off(E),window.removeEventListener("resize",b)}),i.watch(()=>n,async()=>{await i.nextTick(),x()},{deep:!0}),{onUpdate:l,hanldeTruncateSuperTexts:x,eventListener:E,handleMouseOver:k,handleMouseLeave:C,wrapperMinHeight:s}},EZ=["index","book-mark-id","line-id","onMouseover"],kZ=["innerHTML"],SZ=_o(i.defineComponent({__name:"SuperTextView",props:{editor:{},superPreviewCustomClass:{},minChars:{},fontSize:{}},setup(t,{expose:e}){const n=t,r=i.ref([]),o=i.ref([]),s=i.ref(!1),a=i.ref(!1),l=i.ref(null),u=i.inject("isMobile",!1),c=i.inject("canEditSuper",i.ref(!0)),{onUpdate:f,handleMouseOver:p,handleMouseLeave:m,wrapperMinHeight:g}=jk(n.editor,l,o,"editor-container",r),b=(k,C)=>{c.value&&(l.value={id:k.id,text:k.text,elementId:k.elementId,index:C},s.value=!0,u&&(a.value=!0))},y=k=>{var C,_;return Vc(k?((C=n.superPreviewCustomClass)==null?void 0:C.completedSuper)??"bg-black":((_=n.superPreviewCustomClass)==null?void 0:_.unproducedSuper)??"bg-red-500")},x=i.computed(()=>n.fontSize??""),{contentInner:w,measuredMinWidth:E}=Dd({minChars:n.minChars,fontSize:x});return e({measuredMinWidthComment:E}),(k,C)=>{var T;const _=jt;return i.openBlock(),i.createElementBlock("div",{id:"super-text-view-wrapper",ref_key:"contentInner",ref:w,style:i.normalizeStyle({width:`${Number(i.unref(E))+25}px`,minHeight:`${i.unref(g)}px`}),class:i.normalizeClass(i.unref(Ae)("relative border border-ed-gray-400 dark:bg-black rounded-[3px] mr-2.5",((T=k.superPreviewCustomClass)==null?void 0:T.overall)??"bg-ed-gray-50"))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(A,R)=>{var P,M,$;return i.openBlock(),i.createElementBlock("div",{key:A.id,ref_for:!0,ref_key:"superTextRefs",ref:r,index:R,"book-mark-id":A.id,"line-id":A.lineId,class:i.normalizeClass(i.unref(Ae)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:i.normalizeStyle({top:`${A.visiblePosition||((P=A.position)==null?void 0:P.top)}px`}),onMouseover:j=>i.unref(p)(j,R),onMouseleave:C[0]||(C[0]=(...j)=>i.unref(m)&&i.unref(m)(...j))},[i.createVNode(i.unref(jb),{role:"text",variant:"outline",class:i.normalizeClass(i.unref(Ae)("wrap-anywhere whitespace-normal w-full !font-normal px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent cursor-pointer",A.elementId?((M=k.superPreviewCustomClass)==null?void 0:M.completedSuper)??"bg-black":(($=k.superPreviewCustomClass)==null?void 0:$.unproducedSuper)??"bg-red-500",{"cursor-default":!i.unref(c)})),onDblclick:j=>b(A,R)},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"super-text-lines",innerHTML:A.text},null,8,kZ),i.createVNode(_,{name:"triangle",class:i.normalizeClass(["absolute top-[0.4em] rotate-90 w-3 h-3 right-0",y(A.elementId)])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,EZ)}),128)),!i.unref(u)&&l.value?(i.openBlock(),i.createBlock(uc,{key:0,open:s.value,editor:n.editor,"super-text-init":l.value.text,"super-text-element-id":l.value.elementId,onClose:C[1]||(C[1]=A=>s.value=!1),onSave:i.unref(f)},null,8,["open","editor","super-text-init","super-text-element-id","onSave"])):i.createCommentVNode("",!0)],6)}}}),[["__scopeId","data-v-18e941f3"]]),_Z=["index","book-mark-id","line-id","onMouseover"],TZ=["innerHTML"],AZ=_o(i.defineComponent({__name:"SuperTextViewComment",props:{editor:{},disableSuperInput:{type:Boolean},superPreviewCustomClass:{}},setup(t){const e=t,n=i.ref([]),r=i.ref([]),o=i.ref(!1),s=i.ref(!1),a=i.ref(null),l=i.inject("isMobile",!1),u=i.inject("isEditable",i.ref(!0)),{onUpdate:c,handleMouseOver:f,handleMouseLeave:p,wrapperMinHeight:m}=jk(e.editor,a,r,"editor-container-comment",n),g=(x,w)=>{u.value&&(a.value={id:x.id,text:x.text,elementId:x.elementId,index:w},e.disableSuperInput||(o.value=!0),l&&(s.value=!0))},b=x=>{var w,E;return Vc(x?((w=e.superPreviewCustomClass)==null?void 0:w.completedSuper)??"bg-black":((E=e.superPreviewCustomClass)==null?void 0:E.unproducedSuper)??"bg-red-500")},y=i.inject("measuredMinWidthComment",0);return(x,w)=>{var k;const E=jt;return i.openBlock(),i.createElementBlock("div",{id:"super-text-view-wrapper",style:i.normalizeStyle({width:`${Number(i.unref(y))+25}px`,minHeight:`${i.unref(m)}px`}),class:i.normalizeClass(i.unref(Ae)("relative border border-ed-gray-400 dark:bg-black rounded-[3px] mr-2.5",((k=x.superPreviewCustomClass)==null?void 0:k.overall)??"bg-ed-gray-50"))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(C,_)=>{var T,A,R;return i.openBlock(),i.createElementBlock("div",{key:C.id,ref_for:!0,ref_key:"superTextRefs",ref:n,index:_,"book-mark-id":C.id,"line-id":C.lineId,class:i.normalizeClass(i.unref(Ae)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:i.normalizeStyle({top:`${C.visiblePosition||((T=C.position)==null?void 0:T.top)}px`}),onMouseover:P=>i.unref(f)(P,_),onMouseleave:w[0]||(w[0]=(...P)=>i.unref(p)&&i.unref(p)(...P))},[i.createVNode(i.unref(jb),{role:"text",variant:"outline",class:i.normalizeClass(i.unref(Ae)("wrap-anywhere whitespace-normal w-full !font-normal px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent cursor-pointer",C.elementId?((A=x.superPreviewCustomClass)==null?void 0:A.completedSuper)??"bg-black":((R=x.superPreviewCustomClass)==null?void 0:R.unproducedSuper)??"bg-red-500",{"cursor-default":!i.unref(u)})),onDblclick:P=>g(C,_)},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"super-text-lines",innerHTML:C.text},null,8,TZ),i.createVNode(E,{name:"triangle",class:i.normalizeClass(["absolute top-[0.4em] rotate-90 w-3 h-3 right-0",b(C.elementId)])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,_Z)}),128)),!i.unref(l)&&a.value&&!x.disableSuperInput?(i.openBlock(),i.createBlock(uc,{key:0,open:o.value,editor:e.editor,"super-text-init":a.value.text,"super-text-element-id":a.value.elementId,onClose:w[1]||(w[1]=C=>o.value=!1),onSave:i.unref(c)},null,8,["open","editor","super-text-init","super-text-element-id","onSave"])):i.createCommentVNode("",!0)],6)}}}),[["__scopeId","data-v-9e49a79c"]]),qk=t=>{console.log(t),t=t.replace(/\s*style="[^"]*"/g,""),t=t.replace(/<iframe\b[\s\S]*?<\/iframe\s*>/gi,"");const e=t.match(/<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/),r=(e?e[1]:t).replace(/<br\s*\/?>/gi,`
285
+ `+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=fa(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Jp.assertOptions(r,{silentJSONParsing:$o.transitional($o.boolean),forcedJSONParsing:$o.transitional($o.boolean),clarifyTimeoutError:$o.transitional($o.boolean)},!1),o!=null&&(re.isFunction(o)?n.paramsSerializer={serialize:o}:Jp.assertOptions(o,{encode:$o.function,serialize:$o.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Jp.assertOptions(n,{baseUrl:$o.spelling("baseURL"),withXsrfToken:$o.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&re.merge(s.common,s[n.method]);s&&re.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),n.headers=sr.concat(a,s);const l=[];let u=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(u=u&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let f,p=0,m;if(!u){const b=[Fk.bind(this),void 0];for(b.unshift.apply(b,l),b.push.apply(b,c),m=b.length,f=Promise.resolve(n);p<m;)f=f.then(b[p++],b[p++]);return f}m=l.length;let g=n;for(p=0;p<m;){const b=l[p++],y=l[p++];try{g=b(g)}catch(x){y.call(this,x);break}}try{f=Fk.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=c.length;p<m;)f=f.then(c[p++],c[p++]);return f}getUri(e){e=fa(this.defaults,e);const n=Ok(e.baseURL,e.url,e.allowAbsoluteUrls);return wk(n,e.params,e.paramsSerializer)}};re.forEach(["delete","get","head","options"],function(e){pa.prototype[e]=function(n,r){return this.request(fa(r||{},{method:e,url:n,data:(r||{}).data}))}}),re.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,l){return this.request(fa(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}pa.prototype[e]=n(),pa.prototype[e+"Form"]=n(!0)});let nZ=class I_{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(l=>{r.subscribe(l),s=l}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,l){r.reason||(r.reason=new Tl(s,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new I_(function(o){e=o}),cancel:e}}};function rZ(t){return function(n){return t.apply(null,n)}}function oZ(t){return re.isObject(t)&&t.isAxiosError===!0}const Wb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Wb).forEach(([t,e])=>{Wb[e]=t});function Hk(t){const e=new pa(t),n=sk(pa.prototype.request,e);return re.extend(n,pa.prototype,e,{allOwnKeys:!0}),re.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Hk(fa(t,o))},n}const on=Hk(mc);on.Axios=pa,on.CanceledError=Tl,on.CancelToken=nZ,on.isCancel=Sk,on.VERSION=$k,on.toFormData=jp,on.AxiosError=st,on.Cancel=on.CanceledError,on.all=function(e){return Promise.all(e)},on.spread=rZ,on.isAxiosError=oZ,on.mergeConfig=fa,on.AxiosHeaders=sr,on.formToJSON=t=>Ek(re.isHTMLForm(t)?new FormData(t):t),on.getAdapter=Vk.getAdapter,on.HttpStatusCode=Wb,on.default=on;const{Axios:Zse,AxiosError:Qse,CanceledError:Nse,isCancel:eae,CancelToken:tae,VERSION:nae,all:rae,Cancel:oae,isAxiosError:iae,spread:sae,toFormData:aae,AxiosHeaders:lae,HttpStatusCode:uae,formToJSON:cae,getAdapter:dae,mergeConfig:fae}=on,iZ=async function(t){let e=[];try{if(this.enabled===!1||t.length===0||t.trim()==="")return e;if(this.limit&&t.length>this.limit)throw new Error("Text is too long");const n=await on.post(this.getApi(),{value:t}),r=this.transfer(n.data);e=(r==null?void 0:r.map(o=>o.errorText))||[],this!=null&&this.setSuggestions&&this.setSuggestions(r)}catch(n){console.error(n)}return e};class Uk{constructor({api:e,limit:n,transfer:r,enabled:o}){Gt(this,"suggestions",[]);Gt(this,"api","");Gt(this,"enabled",!0);Gt(this,"limit");Gt(this,"transfer");this.suggestions=[],this.api=e,this.limit=n,this.transfer=r,this.enabled=o??!0}setSuggestions(e){this.suggestions=e}getSuggestions(e){var n;return Promise.resolve(((n=this.suggestions.find(r=>r.errorText.wrongWord===e))==null?void 0:n.spellData.correctWord)??[])}getApi(){return this.api}normalizeTextForLanguage(e){return e}proofreadText(e){return Promise.resolve(iZ.call(this,e))}toggleIsEnabled(){this.enabled=!this.enabled}setEnabled(e){this.enabled=e}getIsEnabled(){return this.enabled}}const sZ=Object.freeze(Object.defineProperty({__proto__:null,AI:yY,BaseKit:NE,Blockquote:dW,Bold:kC,BulletList:nW,Clear:h1,Code:iH,CodeBlock:EU,Color:o8,Columns:gb,FindAndReplace:MY,FontFamily:mE,FontSize:r8,FormatPainter:pb,Fullscreen:QW,Heading:t8,Highlight:ZU,History:H1,HorizontalRule:HW,Image:mb,ImageUpload:QE,ImportWord:CY,Indent:QX,Italic:SC,LineHeight:vE,Link:F1,MoreMark:XX,OrderedList:sW,Preview:EY,Printer:RY,Proofreader:Uk,SlashCommand:bY,SpellcheckerExtension:ik,Strike:TC,SubAndSuperScript:qX,Table:Sb,TaskList:uW,TextAlign:n8,Underline:_C,Video:YE,VideoUpload:XE},Symbol.toStringTag,{value:"Module"})),aZ='<page id="ft6nbbxs" extend="false" pagenumber="1" force="false"><h1 id="tk6n64mj" extend="&quot;false&quot;"><strong>Introduction(English)</strong></h1><p id="s864ng1o" extend="&quot;false&quot;">MyMy Editor is open-source document editor based on Vue3 and Tiptap. MyMy Editor provides comprehensive document editing capabilities, supports pagination, supports Markdown syntax, offers basic rich text editing functions, allows for the insertion of various node types in multiple formats, provides a variety of practical tools, and supports setting page styles. It also supports exporting in various formats, printing and print preview, block-level document editing, adding custom extensions, multi-language settings, and a dark theme.</p><h1 id="jm9johtz" extend="&quot;false&quot;"><strong>소개(국문)</strong></h1><p id="0qei01hl" extend="&quot;false&quot;">마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.</p><blockquote class="blockquote"><p id="nekf7yi0" extend="false"><span style="color: rgb(115, 209, 61)"><strong><em>Make by VDC</em></strong></span></p></blockquote></page>';function lZ(){const t=window.localStorage.getItem("content"),e=i.ref(t||aZ),n=i.computed(()=>[NE.configure({placeholder:{showOnlyCurrent:!0},characterCount:{limit:5e4},excludes:{}}),H1,gb,pb,h1,F1,mb,Sb]),r=pt.useEventBus(ir.RENDER_SUPER_TEXT);function o(s,a){const l={action:"status",payload:{id:s,status:a}};r.emit(l)}return{defaultExtensions:n,content:e,dispatchUpdateStatusSuperText:o}}const uZ={class:"flex items-center h-[32px] hover:bg-ed-muted rounded-md"},cZ={class:"text-sm flex items-center justify-center"},dZ={width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},fZ={id:"icon/填充色",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},pZ={id:"icon/背景颜色"},hZ=["fill"],Wk=i.defineComponent({__name:"HighlightActionButton",props:{editor:{},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0},tooltipOptions:{default:void 0}},setup(t){const e=t,n=i.ref(void 0),{state:r}=vn();function o(a){var l;(l=e.action)==null||l.call(e,a)}function s(a){var l;(l=e.action)==null||l.call(e,n.value)}return i.watchEffect(()=>{const{color:a}=e.editor.getAttributes("highlight");r.highlight=a}),(a,l)=>(i.openBlock(),i.createElementBlock("div",uZ,[i.createVNode(Ge,{id:"highlight",tooltip:a.tooltip,disabled:a.disabled,action:s,"tooltip-options":a.tooltipOptions},{icon:i.withCtx(()=>[i.createElementVNode("span",cZ,[(i.openBlock(),i.createElementBlock("svg",dZ,[i.createElementVNode("g",fZ,[i.createElementVNode("g",pZ,[l[1]||(l[1]=i.createElementVNode("g",{id:"编组",fill:"currentColor"},[i.createElementVNode("g",{id:"矩形",transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)"},[i.createElementVNode("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z","fill-rule":"nonzero"}),i.createElementVNode("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z","fill-rule":"evenodd"}),i.createElementVNode("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z","fill-rule":"nonzero"})])],-1)),i.createElementVNode("path",{id:"矩形",d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",fill:n.value||"#FBDE28"},null,8,hZ)])])]))])]),_:1},8,["tooltip","disabled","tooltip-options"]),i.createVNode(gC,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),highlight:"",disabled:a.disabled,onChange:o},{default:i.withCtx(()=>[i.createVNode(i.unref(_n),{variant:"ghost",size:"icon",class:"w-3 h-[32px] rounded-l-none hover:bg-ed-muted-foreground/20",disabled:a.disabled},{default:i.withCtx(()=>[i.createVNode(i.unref(jt),{class:"w-3 h-3 text-zinc-500",name:"MenuDown"})]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled"])]))}}),mZ={class:"h-full w-fit min-w-32 flex items-center leading-none gap-0.5 p-2 bg-ed-background rounded-lg shadow-sm border border-ed-border"},Zp=i.defineComponent({__name:"TableBubbleMenu",props:{editor:{}},setup(t){const e=t,n=()=>document.body,r=({editor:x})=>{var w;return x.isActive("table")&&(((w=x.storage.table)==null?void 0:w.isTableEditorOpen)??!1)},{t:o}=At();function s(){e.editor.chain().focus().addColumnBefore().run()}function a(){e.editor.chain().focus().addColumnAfter().run()}function l(){e.editor.chain().focus().deleteColumn().run()}function u(){e.editor.chain().focus().addRowBefore().run()}function c(){e.editor.chain().focus().addRowAfter().run()}function f(){e.editor.chain().focus().deleteRow().run()}function p(){e.editor.chain().focus().mergeCells().run()}function m(){var x;(x=e.editor)==null||x.chain().focus().splitCell().run()}function g(){e.editor.chain().focus().deleteTable().run()}function b(x){e.editor.chain().focus().setTableCellBackground(x).run()}const y=()=>{const x=document.querySelector(".vdc-editor");if(!x)return new DOMRect(-1e3,-1e3,0,0);const w=x.getBoundingClientRect();return new DOMRect(w.left,w.top+10,w.width,0)};return(x,w)=>(i.openBlock(),i.createBlock(i.unref(Od),{editor:x.editor,"plugin-key":"table","update-delay":0,"should-show":r,"tippy-options":{zIndex:9999,maxWidth:"auto",getReferenceClientRect:y,appendTo:n}},{default:i.withCtx(()=>{var E,k,C,_,T,A,R,P,M;return[i.createElementVNode("div",mZ,[i.createVNode(Ge,{icon:"TablerColumnInsertLeft","icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.insertColumnBefore"),action:s,"tooltip-options":{sideOffset:15},disabled:!((E=x.editor)!=null&&E.can().addColumnBefore())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TablerColumnInsertRight",tooltip:i.unref(o)("editor.table.menu.insertColumnAfter"),"icon-class":"w-5 h-5",action:a,"tooltip-options":{sideOffset:15},disabled:!((k=x.editor)!=null&&k.can().addColumnAfter())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TablerColumnRemove",action:l,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15},disabled:!((C=x.editor)!=null&&C.can().deleteColumn())},null,8,["tooltip","disabled"]),i.createVNode(i.unref(oi),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),i.createVNode(Ge,{icon:"TablerRowInsertTop",action:u,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15},disabled:!((_=x.editor)!=null&&_.can().addRowBefore())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TablerRowInsertBottom",action:c,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15},disabled:!((T=x.editor)!=null&&T.can().addRowAfter())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TablerRowRemove",action:f,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15},disabled:!((A=x.editor)!=null&&A.can().deleteRow())},null,8,["tooltip","disabled"]),i.createVNode(i.unref(oi),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),i.createVNode(Ge,{icon:"TableCellsMerge",action:p,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15},disabled:!((R=x.editor)!=null&&R.can().mergeCells())},null,8,["tooltip","disabled"]),i.createVNode(Ge,{icon:"TableCellsSplit",action:m,"icon-class":"w-5 h-5",tooltip:i.unref(o)("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15},disabled:!((P=x.editor)!=null&&P.can().splitCell())},null,8,["tooltip","disabled"]),i.createVNode(i.unref(oi),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),i.createVNode(Wk,{editor:x.editor,tooltip:i.unref(o)("editor.table.menu.setCellsBgColor"),action:b,"tooltip-options":{sideOffset:15}},null,8,["editor","tooltip"]),i.createVNode(Ge,{icon:"Trash2",tooltip:i.unref(o)("editor.table.menu.deleteTable"),"icon-class":"w-5 h-5",action:g,"tooltip-options":{sideOffset:15},disabled:!((M=x.editor)!=null&&M.can().deleteTable())},null,8,["tooltip","disabled"])])]}),_:1},8,["editor","tippy-options"]))}}),gZ={class:"p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},bZ={class:"flex items-center gap-1"},Qp=i.defineComponent({__name:"ColumnsBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=({editor:l})=>n0(l.view.state,"columns"),r=()=>{const l=mC(e.editor,"columns");return(l==null?void 0:l.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},o=()=>{e.editor.chain().focus().setLayout(aa.SidebarLeft).run()},s=()=>{e.editor.chain().focus().setLayout(aa.SidebarRight).run()},a=()=>{e.editor.chain().focus().setLayout(aa.TwoColumn).run()};return(l,u)=>(i.openBlock(),i.createBlock(i.unref(Od),{editor:l.editor,"plugin-key":"columns","should-show":n,"update-delay":0,"tippy-options":{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,plugins:[i.unref(SB)],sticky:"popper"}},{default:i.withCtx(()=>[i.createElementVNode("div",gZ,[i.createElementVNode("div",bZ,[i.createVNode(Ge,{id:"panel-left",title:"ok",icon:"PanelLeft",tooltip:"tooltip",action:o,"is-active":()=>l.editor.isActive("columns",{layout:i.unref(aa).SidebarLeft}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),i.createVNode(Ge,{id:"columns",title:"ok",icon:"Columns",tooltip:"tooltip",action:a,"is-active":()=>l.editor.isActive("columns",{layout:i.unref(aa).TwoColumn}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),i.createVNode(Ge,{id:"panel-right",title:"ok",icon:"PanelRight",tooltip:"tooltip",action:s,"is-active":()=>l.editor.isActive("columns",{layout:i.unref(aa).SidebarRight}),"tooltip-options":{sideOffset:15}},null,8,["is-active"])])])]),_:1},8,["editor","tippy-options"]))}}),vZ={class:"flex items-center gap-2 p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},yZ=["href"],wZ={class:"flex flex-nowrap"},xZ=i.defineComponent({__name:"LinkViewBlock",props:{editor:{},link:{default:void 0}},emits:["clear","edit"],setup(t,{emit:e}){const{t:n}=At(),r=e;function o(){r("clear")}function s(){r("edit")}return(a,l)=>(i.openBlock(),i.createElementBlock("div",vZ,[i.createElementVNode("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",class:"text-sm underline break-all"},i.toDisplayString(i.unref(it.truncate)(a.link,{length:50,omission:"…"})),9,yZ),a.link?(i.openBlock(),i.createBlock(i.unref(oi),{key:0,orientation:"vertical",class:"h-4"})):i.createCommentVNode("",!0),i.createElementVNode("div",wZ,[i.createVNode(Ge,{icon:"Pencil",tooltip:i.unref(n)("editor.link.edit.tooltip"),action:s,"tooltip-options":{sideOffset:15}},null,8,["tooltip"]),i.createVNode(Ge,{icon:"Unlink",tooltip:i.unref(n)("editor.link.unlink.tooltip"),action:o,"tooltip-options":{sideOffset:15}},null,8,["tooltip"])])]))}}),Np=i.defineComponent({__name:"LinkBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=i.ref(!1),r=i.ref(),o={width:-2,height:16},s=i.computed(()=>{const{href:f}=e.editor.getAttributes("link");return f}),a=i.computed(()=>e.editor.isActive("link")),l=i.computed(()=>{var y;if(!n.value)return{};const f=e.editor.state.selection,p=e.editor.view.coordsAtPos(f.from),m=(y=r.value)==null?void 0:y.getBoundingClientRect(),g=p.left+((m==null?void 0:m.width)??0)+o.width>window.innerWidth,b=p.top+((m==null?void 0:m.height)??0)+o.height>window.innerHeight;return g||b?{left:g?`${p.left-((m==null?void 0:m.width)??0)-o.width}px`:`${p.left}px`,top:b?`${p.top-((m==null?void 0:m.height)??0)-o.height}px`:`${p.top}px`}:{left:`${p.left}px`,top:`${p.bottom+o.height}px`}});function u(f,p,m){e.editor.chain().extendMarkRange("link").insertContent({type:"text",text:p,marks:[{type:"link",attrs:{href:f,target:m?"_blank":""}}]}).setLink({href:f}).focus().run(),n.value=!1}function c(){e.editor.chain().extendMarkRange("link").unsetLink().focus().run(),n.value=!1}return(f,p)=>i.withDirectives((i.openBlock(),i.createBlock(i.unref(Od),{editor:f.editor,"update-delay":0,"tippy-options":{popperOptions:{modifiers:[{name:"flip",enabled:!0}]},appendTo:"parent",placement:"bottom-start",offset:[o.width,o.height],zIndex:9999,onHidden:()=>{n.value=!1}}},{default:i.withCtx(()=>[n.value?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"#vdc-editor"},[i.createElementVNode("div",{ref_key:"editFormRef",ref:r,class:"fixed z-50",style:i.normalizeStyle(l.value)},[i.createVNode(T8,{class:"p-4",editor:f.editor,onOnSetLink:u},null,8,["editor"])],4)])):i.createCommentVNode("",!0),n.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(xZ,{key:1,editor:f.editor,link:s.value,onClear:c,onEdit:p[0]||(p[0]=m=>n.value=!0)},null,8,["editor","link"]))]),_:1},8,["editor","tippy-options"])),[[i.vShow,a.value]])}}),jb=i.defineComponent({__name:"Badge",props:{variant:{},class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref(Ae)(i.unref(CZ)({variant:e.variant}),e.class))},[i.renderSlot(n.$slots,"default")],2))}}),CZ=jg("inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-ed-primary text-ed-primary-foreground hover:bg-ed-primary/80",secondary:"border-transparent bg-ed-secondary text-ed-secondary-foreground hover:bg-ed-secondary/80",destructive:"border-transparent bg-ed-destructive text-ed-destructive-foreground hover:bg-ed-destructive/80",outline:"text-ed-foreground"}},defaultVariants:{variant:"default"}}),jk=(t,e,n,r,o)=>{const s=i.ref(0),a=pt.useEventBus(ir.RENDER_SUPER_TEXT),l=_=>{if(!e.value||!t)return;const T=e.value.index,A=e.value.id,{state:R}=t,{tr:P}=R;let M=!1;R.doc.descendants(($,j)=>{var X,ie;if(((X=$.attrs)==null?void 0:X[ot.ID])===A){(ie=$.attrs[ot.TEXT])!=null&&ie.trim();const W=_.trim();if(wE(W))return P.delete(j,j+1),M=!0,!1;const{[ot.ELEMENT_ID]:z,...L}=$.attrs;return P.setNodeMarkup(j,void 0,{...L,[ot.TEXT]:W}),M=!0,!1}return!0}),M&&t&&t.view.dispatch(P),T!==-1&&(n.value[T].text=_,n.value[T].textOriginal=_)},u=i.ref(new Map),c=()=>{if(!(t!=null&&t.view.dom))return[];const _=[],T=t==null?void 0:t.view.dom.querySelectorAll("[node-id]"),A=new Map;return u.value.clear(),T.forEach(R=>{const P=R.getBoundingClientRect().top;A.set(P,R),u.value.set(R.getAttribute("node-id")||"unknown",0)}),_.push(...A.values()),_},f=_=>{const T=_.closest(`#${r}`);if(!T)return;const A=T.getBoundingClientRect().top,R=T==null?void 0:T.scrollTop;return _.getBoundingClientRect().top-(A-R)},p=(_,T)=>{const A=n.value.findIndex(R=>R.id===_);A>-1&&(n.value[A].status=T)},m=_=>_.replace(/<p><\/p>/g,"<p>&nbsp;</p>"),g=()=>{if(!n.value||n.value.length===0){s.value=0,u.value.clear();return}if(!o.value||o.value.length===0)return;const _=o.value,T=new Set(n.value.map(P=>P.id)),A=_.map(P=>({isHidden:P.classList.contains("hidden"),isTruncated:P.classList.contains("super-text-truncate")}));_.forEach(P=>{P.classList.remove("hidden"),P.classList.remove("super-text-truncate")});for(const P of u.value.keys())T.has(P)||u.value.delete(P);_.forEach(P=>{const M=P.getAttribute("book-mark-id");if(!M)return;const $=P.offsetTop+P.offsetHeight,j=u.value.get(M)||0;u.value.set(M,Math.max($,j))}),_.forEach((P,M)=>{A[M].isHidden&&P.classList.add("hidden"),A[M].isTruncated&&P.classList.add("super-text-truncate")});let R=0;for(const P of u.value.values())P>R&&(R=P);s.value=R},b=async()=>{await i.nextTick();const T=c().map(A=>{const R=A.getAttribute("node-id"),P=A.getAttribute("book-mark-content"),M=A.getAttribute("page-id"),$=A.getAttribute("page-number"),j=A.getBoundingClientRect(),X=A.getAttribute("line-id"),ie=A.getAttribute("element-id");return{position:j,text:m(P),id:R,pageId:M,pageNumber:$,visiblePosition:f(A),status:0,lineId:X,elementId:ie,textOriginal:m(P)}});n.value=T},y=(_,T)=>{const A=_.bottom<=T.top,R=_.top>=T.bottom;return!(A||R)};async function x(){const _=o.value;if(!_||_.length===0){g();return}_.sort((T,A)=>{const R=Number(T.getAttribute("index")),P=Number(A.getAttribute("index"));return R-P}),_.forEach(T=>T.classList.remove("super-text-truncate")),_.forEach((T,A)=>{const R=T.getBoundingClientRect();_.slice(A+1).forEach(P=>{const M=P.getBoundingClientRect();y(R,M)&&T.classList.add("super-text-truncate")})}),g()}const w=async _=>{await i.nextTick();const T=t==null?void 0:t.view.dom.querySelector(`[node-id='${_.dataId}']`),A=o.value.find(M=>{const $=M.getBoundingClientRect().top,j=T==null?void 0:T.getBoundingClientRect().top;if(j==null)return!1;const X=j-$;return Math.abs(X-9)<=2});if(!A)return;const R=Number(A.getAttribute("index"));if(!_.text){A.querySelector(".super-text-lines").innerHTML=n.value[R].textOriginal,o.value.forEach(M=>M.classList.remove("hidden")),x();return}A.querySelector(".super-text-lines").innerHTML=m(_.text),A.classList.remove("super-text-truncate");const P=A.getBoundingClientRect();o.value.forEach((M,$)=>{if($!==R){const j=M.getBoundingClientRect();y(P,j)&&M.classList.add("hidden")}}),g()},E=_=>{switch(_.action){case"hover":w(_.payload);break;case"status":p(_.payload.id,_.payload.status);break;case"render":b();break;default:console.log("There is no action")}},k=(_,T)=>{const A=_.currentTarget;A.classList.remove("super-text-truncate");const R=A.getBoundingClientRect();o.value.forEach((P,M)=>{if(M!==T){const $=P.getBoundingClientRect();y(R,$)&&P.classList.add("hidden")}}),g()},C=()=>{o.value.forEach(_=>_.classList.remove("hidden")),x()};return i.onBeforeMount(()=>{a.on(E),window.addEventListener("resize",b)}),i.onBeforeUnmount(()=>{a.off(E),window.removeEventListener("resize",b)}),i.watch(()=>n,async()=>{await i.nextTick(),x()},{deep:!0}),{onUpdate:l,hanldeTruncateSuperTexts:x,eventListener:E,handleMouseOver:k,handleMouseLeave:C,wrapperMinHeight:s}},EZ=["index","book-mark-id","line-id","onMouseover"],kZ=["innerHTML"],SZ=_o(i.defineComponent({__name:"SuperTextView",props:{editor:{},superPreviewCustomClass:{},minChars:{},fontSize:{}},setup(t,{expose:e}){const n=t,r=i.ref([]),o=i.ref([]),s=i.ref(!1),a=i.ref(!1),l=i.ref(null),u=i.inject("isMobile",!1),c=i.inject("canEditSuper",i.ref(!0)),{onUpdate:f,handleMouseOver:p,handleMouseLeave:m,wrapperMinHeight:g}=jk(n.editor,l,o,"editor-container",r),b=(k,C)=>{c.value&&(l.value={id:k.id,text:k.text,elementId:k.elementId,index:C},s.value=!0,u&&(a.value=!0))},y=k=>{var C,_;return Vc(k?((C=n.superPreviewCustomClass)==null?void 0:C.completedSuper)??"bg-black":((_=n.superPreviewCustomClass)==null?void 0:_.unproducedSuper)??"bg-red-500")},x=i.computed(()=>n.fontSize??""),{contentInner:w,measuredMinWidth:E}=Dd({minChars:n.minChars,fontSize:x});return e({measuredMinWidthComment:E}),(k,C)=>{var T;const _=jt;return i.openBlock(),i.createElementBlock("div",{id:"super-text-view-wrapper",ref_key:"contentInner",ref:w,style:i.normalizeStyle({width:`${Number(i.unref(E))+25}px`,minHeight:`${i.unref(g)}px`}),class:i.normalizeClass(i.unref(Ae)("relative border border-ed-gray-400 dark:bg-black rounded-[3px] mr-2.5",((T=k.superPreviewCustomClass)==null?void 0:T.overall)??"bg-ed-gray-50"))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(A,R)=>{var P,M,$;return i.openBlock(),i.createElementBlock("div",{key:A.id,ref_for:!0,ref_key:"superTextRefs",ref:r,index:R,"book-mark-id":A.id,"line-id":A.lineId,class:i.normalizeClass(i.unref(Ae)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:i.normalizeStyle({top:`${A.visiblePosition||((P=A.position)==null?void 0:P.top)}px`}),onMouseover:j=>i.unref(p)(j,R),onMouseleave:C[0]||(C[0]=(...j)=>i.unref(m)&&i.unref(m)(...j))},[i.createVNode(i.unref(jb),{role:"text",variant:"outline",class:i.normalizeClass(i.unref(Ae)("wrap-anywhere whitespace-normal w-full !font-normal px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent cursor-pointer",A.elementId?((M=k.superPreviewCustomClass)==null?void 0:M.completedSuper)??"bg-black":(($=k.superPreviewCustomClass)==null?void 0:$.unproducedSuper)??"bg-red-500",{"cursor-default":!i.unref(c)})),onDblclick:j=>b(A,R)},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"super-text-lines",innerHTML:A.text},null,8,kZ),i.createVNode(_,{name:"triangle",class:i.normalizeClass(["absolute top-[0.4em] rotate-90 w-3 h-3 right-0",y(A.elementId)])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,EZ)}),128)),!i.unref(u)&&l.value?(i.openBlock(),i.createBlock(uc,{key:0,open:s.value,editor:n.editor,"super-text-init":l.value.text,"super-text-element-id":l.value.elementId,onClose:C[1]||(C[1]=A=>s.value=!1),onSave:i.unref(f)},null,8,["open","editor","super-text-init","super-text-element-id","onSave"])):i.createCommentVNode("",!0)],6)}}}),[["__scopeId","data-v-18e941f3"]]),_Z=["index","book-mark-id","line-id","onMouseover"],TZ=["innerHTML"],AZ=_o(i.defineComponent({__name:"SuperTextViewComment",props:{editor:{},disableSuperInput:{type:Boolean},superPreviewCustomClass:{}},setup(t){const e=t,n=i.ref([]),r=i.ref([]),o=i.ref(!1),s=i.ref(!1),a=i.ref(null),l=i.inject("isMobile",!1),u=i.inject("isEditable",i.ref(!0)),{onUpdate:c,handleMouseOver:f,handleMouseLeave:p,wrapperMinHeight:m}=jk(e.editor,a,r,"editor-container-comment",n),g=(x,w)=>{u.value&&(a.value={id:x.id,text:x.text,elementId:x.elementId,index:w},e.disableSuperInput||(o.value=!0),l&&(s.value=!0))},b=x=>{var w,E;return Vc(x?((w=e.superPreviewCustomClass)==null?void 0:w.completedSuper)??"bg-black":((E=e.superPreviewCustomClass)==null?void 0:E.unproducedSuper)??"bg-red-500")},y=i.inject("measuredMinWidthComment",0);return(x,w)=>{var k;const E=jt;return i.openBlock(),i.createElementBlock("div",{id:"super-text-view-wrapper",style:i.normalizeStyle({width:`${Number(i.unref(y))+25}px`,minHeight:`${i.unref(m)}px`}),class:i.normalizeClass(i.unref(Ae)("relative border border-ed-gray-400 dark:bg-black rounded-[3px] mr-2.5",((k=x.superPreviewCustomClass)==null?void 0:k.overall)??"bg-ed-gray-50"))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(C,_)=>{var T,A,R;return i.openBlock(),i.createElementBlock("div",{key:C.id,ref_for:!0,ref_key:"superTextRefs",ref:n,index:_,"book-mark-id":C.id,"line-id":C.lineId,class:i.normalizeClass(i.unref(Ae)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:i.normalizeStyle({top:`${C.visiblePosition||((T=C.position)==null?void 0:T.top)}px`}),onMouseover:P=>i.unref(f)(P,_),onMouseleave:w[0]||(w[0]=(...P)=>i.unref(p)&&i.unref(p)(...P))},[i.createVNode(i.unref(jb),{role:"text",variant:"outline",class:i.normalizeClass(i.unref(Ae)("wrap-anywhere whitespace-normal w-full !font-normal px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent cursor-pointer",C.elementId?((A=x.superPreviewCustomClass)==null?void 0:A.completedSuper)??"bg-black":((R=x.superPreviewCustomClass)==null?void 0:R.unproducedSuper)??"bg-red-500",{"cursor-default":!i.unref(u)})),onDblclick:P=>g(C,_)},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"super-text-lines",innerHTML:C.text},null,8,TZ),i.createVNode(E,{name:"triangle",class:i.normalizeClass(["absolute top-[0.4em] rotate-90 w-3 h-3 right-0",b(C.elementId)])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,_Z)}),128)),!i.unref(l)&&a.value&&!x.disableSuperInput?(i.openBlock(),i.createBlock(uc,{key:0,open:o.value,editor:e.editor,"super-text-init":a.value.text,"super-text-element-id":a.value.elementId,onClose:w[1]||(w[1]=C=>o.value=!1),onSave:i.unref(c)},null,8,["open","editor","super-text-init","super-text-element-id","onSave"])):i.createCommentVNode("",!0)],6)}}}),[["__scopeId","data-v-9e49a79c"]]),qk=t=>{console.log(t),t=t.replace(/\s*style="[^"]*"/g,""),t=t.replace(/<iframe\b[\s\S]*?<\/iframe\s*>/gi,"");const e=t.match(/<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/),r=(e?e[1]:t).replace(/<br\s*\/?>/gi,`
286
286
  `).split(/\r?\n/),o=[];for(const a of r){const l=a.trim();if(l==="")o.push("<p></p>");else if(/^<br\s*\/?>/i.test(l)){const u=l.replace(/^<br\s*\/?>/i,"").trim();o.push(`<p>${u}</p>`)}else if(/^<\/BR>/i.test(l)){const u=l.replace(/^<\/BR>/i,"").trim();o.push(`<p>${u}</p>`)}else/^<(?!p\b)[^>]+>/i.test(l)?o.push(`<p>${l}</p>`):o.push(l)}let s=o.join("");return s=s.replace(/<p\b[^>]*>/gi,"<p>"),s},OZ=vn(),bc=t=>{const e=i.computed(()=>OZ.state.spellCheck);i.watch(()=>e.value,n=>{t.view.dispatch(t.state.tr.setMeta($n.IS_ACTIVE_SPELLCHECK,n))},{immediate:!0})},MZ={id:"editor-container-comment",class:"flex flex-col"},BZ={class:"flex flex-1"},IZ={id:"editor-panel",class:"flex-1 p-2.5 border border-ed-gray-400 rounded-[3px] focus-within:border-ed-input-focus"},RZ=i.defineComponent({__name:"EditorComment",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean,default:!0},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{default:void 0},minChar:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=pt.useEventBus(ir.RENDER_SUPER_TEXT),a=i.useAttrs(),l=vn(),{isReady:u,editor:c,updateEditorState:f,superTextStore:p,checkSpellStore:m,setEditorContextMenuRef:g}=l,b=i.inject("isEditable",i.ref(!0)),y=new No({enablePasteRules:!1,enableInputRules:!1,content:Pn(r.modelValue,r.disabled),editorProps:{attributes:{id:nr.COMMENT,[nr.DISABLE_SUPER_INPUT]:`${r.disableSuperInput}`},handleKeyDown:it.throttle((C,_)=>_.key==="Enter"&&a.enter&&!_.shiftKey?(o("enter"),!0):!1,So),transformPastedHTML:C=>qk(C),handlePaste:(C,_)=>{const T=_.clipboardData;if(!T)return!1;const A=r.mode,R=T.getData("text/plain")||"",P=Array.from(T.items).some(M=>M.type.startsWith("image/"));return(A===De.STRAIGHT||A===De.REPORT)&&P?(_.preventDefault(),!0):A===De.PLAIN_TEXT?(_.preventDefault(),C.dispatch(C.state.tr.insertText(R,C.state.selection.from)),!0):!1},clipboardTextParser:(C,_)=>{const T=C.split(/(?:\r\n?|\n)/),A=[];T.forEach(P=>{let M={type:"paragraph"};P.length>0&&(M.content=[{type:"text",text:P}]);let $=Jr.fromJSON(_.doc.type.schema,M);A.push($)});const R=de.fromArray(A);return Ee.maxOpen(R)}},onCreate:({editor:C})=>{f(C)},onUpdate:it.throttle(({editor:C})=>{u.value=!0;const _=w(C,r.output);o("update:modelValue",_),o("change",{editor:C,output:_}),f(C),x()},So),extensions:r.extensions,editable:b.value,onFocus:()=>{g(E.value)}});i.computed(()=>r.mode===De.EDITOR);async function x(){await i.nextTick(),s.emit({action:"render"})}function w(C,_){if(!C)return"";if(C.isEmpty)return _==="json"?{}:"";switch(_){case"html":return C.getHTML();case"json":return C.getJSON();case"text":return C.getText();default:return""}}i.watch(()=>r.disableSuperInput,()=>{const C=document.getElementById(nr.COMMENT);C==null||C.setAttribute(nr.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),i.watch(()=>m.languages,()=>{y.commands.checkSpelling()}),i.watch(()=>r.modelValue,C=>{if(!y||it.isEqual(w(y,r.output),C))return;const{from:_,to:T}=y.state.selection;y.commands.setTextSelection({from:_,to:T}),y.commands.setContent(Pn(C,r.disabled),!1),x()},{deep:!0}),i.watch(()=>b.value,C=>{var _;y==null||y.setEditable(C),(_=y==null?void 0:y.commands)!=null&&_.setIsEnableSuggestion&&y.commands.setIsEnableSuggestion(C)},{immediate:!0}),i.watch(()=>c.value,()=>{c.value&&c.value.on("selectionUpdate",({editor:C})=>{o("changed:selection",{editor:C})})}),i.onUnmounted(()=>y==null?void 0:y.destroy()),Gu(Eu.SAVE,()=>{localStorage.setItem("comment",w(y,"html"))});const E=i.ref(null);function k(C){C===De.REPORT&&g(E.value)}return i.onMounted(()=>{k(r.mode)}),i.watch(()=>r.mode,C=>{k(C)}),bc(y),e({editor:y}),(C,_)=>(i.openBlock(),i.createElementBlock("div",MZ,[i.createElementVNode("div",BZ,[i.withDirectives(i.createVNode(AZ,{"disable-super-input":C.disableSuperInput,editor:i.unref(y),"super-preview-custom-class":C.superPreviewCustomClass},null,8,["disable-super-input","editor","super-preview-custom-class"]),[[i.vShow,C.isOpenSuperView]]),i.createElementVNode("div",IZ,[i.createVNode(fb,{ref_key:"selectContextMenuRef",ref:E,"disable-super-input":C.disableSuperInput,editor:i.unref(y),mode:C.mode,"super-text-store":i.unref(p)},{default:i.withCtx(()=>[i.createVNode(i.unref(Eo),{editor:i.unref(y),spellcheck:"true",class:"h-full break-all"},null,8,["editor"])]),_:1},8,["disable-super-input","editor","mode","super-text-store"])])])]))}});function LZ(t,e,n=!1,r=200){const{height:o}=pt.useElementSize(t),s=i.ref(0),a=i.ref(0),l=i.ref(r),u=i.ref(0),c=async()=>{await i.nextTick();const f=o.value-8;e.value===De.REPORT?(s.value=f/3,a.value=n?"auto":f-s.value,l.value=r/3*2,u.value=r/3):(s.value=0,a.value=n?"auto":o.value)};return n||i.watch(()=>o.value,c),i.onMounted(()=>{c()}),{commentHeight:s,contentHeight:a,minHeight:l,minHeightComment:u}}const PZ={class:"flex flex-1"},eh=i.defineComponent({__name:"CoreEditorV2",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{default:""},commentCuesheet:{default:""},hideComment:{type:Boolean,default:!1},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{default:"14px"},fontFamilyDefault:{default:""},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{default:null},fieldNameCommentCuesheet:{default:null},fieldNameContent:{default:null},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean,default:!1},textAlert:{},toolBarClass:{default:void 0},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean,default:!1},autoFocus:{type:Boolean},superPreviewCustomClass:{default:()=>({overall:"bg-ed-gray-50",unproducedSuper:"bg-red-500",completedSuper:"bg-black"})},minChar:{default:()=>({superPreview:29,content:26})}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=pt.useEventBus(ir.RENDER_SUPER_TEXT),a=pt.useEventBus(ir.INCREASE_DECREASE_FONTSIZE),l=i.useAttrs(),u=vn(),{state:c,isFullscreen:f,isReady:p,editor:m,updateEditorState:g,superTextStore:b,checkSpellStore:y,setEditorContextMenuRef:x}=u,w=i.computed(()=>!(r.disabled||r.readonly));i.provide("isEditable",w);const E=i.computed(()=>w.value?!0:r.canEditSuperReadOnly);i.provide("canEditSuper",E);const k=i.computed(()=>[...c.extensions,...it.differenceBy(r.extensions,c.extensions,"name")].map((ve,Me)=>{var He;return((He=ve.configure)==null?void 0:He.call(ve,{sort:Me}))||ve})),C=i.computed(()=>r.mode===De.EDITOR),_=i.ref(r.fontSizeDefault),T=i.ref(r.fontFamilyDefault);i.provide("fontSize",_),i.provide("fontFamily",T);const A=i.computed(()=>{const J={height:"auto",minHeight:r.minHeight?an(r.minHeight):void 0,maxHeight:r.maxHeight?an(r.maxHeight):void 0,overflowY:"auto"};return C.value&&!r.autoHeight?{}:C.value&&r.autoHeight?J:!C.value&&r.autoHeight?{...J,fontFamily:T.value,fontSize:_.value}:{fontFamily:T.value,fontSize:_.value}});i.watch(()=>[A.value,r.disabled],async()=>{L()}),i.onMounted(()=>{L()});const R=J=>{const ve=parseInt(_.value||"16px"),Me=J?ve+2:ve-2;_.value=Me+"px"};i.onBeforeMount(()=>{r.disabled||a.on(R)}),i.onBeforeUnmount(()=>{r.disabled||a.off(R)});const P=i.computed(()=>({...i.unref(f)?{height:"100%"}:{minHeight:r.minHeight?an(r.minHeight):void 0,maxHeight:r.maxHeight?an(r.maxHeight):void 0,height:r.height?an(r.height):void 0},maxWidth:an(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),M=new No({enablePasteRules:!1,enableInputRules:!1,content:Pn(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:it.throttle((J,ve)=>ve.key==="Enter"&&l.enter&&!ve.shiftKey?(o("enter"),!0):!1,So),transformPastedHTML:J=>qk(J),handlePaste:(J,ve)=>{const Me=ve.clipboardData;if(!Me)return!1;const He=r.mode,Q=Array.from(Me.items),Se=Q.some(D=>D.type.startsWith("image/")),V=Q.some(D=>D.type.startsWith("video/"));return(He===De.STRAIGHT||He===De.REPORT)&&(Se||V)?(ve.preventDefault(),!0):V?(ve.preventDefault(),Z(["video"])&&Q.forEach(async D=>{var Ue;if(!D.type.startsWith("video/"))return;const se=D.getAsFile();if(!se)return;const me=M.extensionManager.extensions.find(ee=>ee.name==="video"),Le=(Ue=me==null?void 0:me.options)==null?void 0:Ue.upload,nt=Le?await Le(se):URL.createObjectURL(se);M.commands.focus(),M.commands.setVideo({src:nt})}),!0):!1},clipboardTextParser:(J,ve)=>{const Me=J.split(/(?:\r\n?|\n)/),He=[];Me.forEach(Se=>{let V={type:"paragraph"};Se.length>0&&(V.content=[{type:"text",text:Se}]);let D=Jr.fromJSON(ve.doc.type.schema,V);He.push(D)});const Q=de.fromArray(He);return Ee.maxOpen(Q)}},onCreate:({editor:J})=>{g(J)},onUpdate:it.throttle(({editor:J})=>{p.value=!0;const ve=q(J,r.output);o("update:modelValue",ve),o("change",{editor:J,output:ve}),g(J),L(),X()},So),extensions:it.uniqBy(it.reverse(i.unref(k)),"name"),editable:w.value,onFocus:J=>{x(H.value),o("onFocus",J)},onBlur:J=>o("onBlur",J),parseOptions:{preserveWhitespace:"full"}});i.provide("minCharSuperInput",r.minChar.superPreview);const{contentInner:$,measuredMinWidth:j,measure:X}=Dd({minChars:r.minChar.content,fontSize:_,editor:M}),ie=i.ref(null),W=i.computed(()=>{var J;return(J=ie.value)==null?void 0:J.measuredMinWidthComment});i.provide("measuredMinWidthComment",W);const z=i.computed(()=>C.value?0:te.value?Number(j==null?void 0:j.value)+Number(W==null?void 0:W.value)+30:Number(j==null?void 0:j.value));async function L(){await i.nextTick(),s.emit({action:"render"})}function q(J,ve){if(!J)return"";if(J.isEmpty)return ve==="json"?{}:"";if(r.mode===De.PLAIN_TEXT)return J.getText({blockSeparator:`
287
287
  `});switch(ve){case"html":return J.getHTML();case"json":return J.getJSON();case"text":return J.getText({blockSeparator:`
288
288
  `});default:return""}}function Z(J){return J.every(ve=>M==null?void 0:M.extensionManager.extensions.find(Me=>Me.name===ve))}i.watch(()=>y.languages,()=>{M.commands.checkSpelling()}),i.watch(()=>r.modelValue,J=>{if(!M||it.isEqual(q(M,r.output),J))return;const{from:ve,to:Me}=M.state.selection;M.commands.setTextSelection({from:ve,to:Me}),M.commands.setContent(Pn(J,r.disabled,r.mode),!1,{preserveWhitespace:"full"}),L()},{deep:!0}),i.watch(()=>w.value,J=>{var ve;M==null||M.setEditable(J),(ve=M==null?void 0:M.commands)!=null&&ve.setIsEnableSuggestion&&M.commands.setIsEnableSuggestion(J)},{immediate:!0}),i.watch(()=>m.value,()=>{m.value&&m.value.on("selectionUpdate",({editor:J})=>{o("changed:selection",{editor:J})})}),i.onUnmounted(()=>M==null?void 0:M.destroy()),Gu(Eu.SAVE,()=>{localStorage.setItem("content",q(M,"html"))});const te=i.computed(()=>{var He;if(!((He=M==null?void 0:M.storage)!=null&&He.superText))return!1;const{enable:J}=M.storage.superText,ve=[De.EDITOR,De.PLAIN_TEXT].includes(r.mode),Me=r.disabled;return J&&!ve&&!Me}),ne=i.ref(null),ye=i.computed(()=>r.mode),{commentHeight:Ce,contentHeight:je,minHeight:ke,minHeightComment:We}=LZ(ne,ye,r.autoHeight,typeof r.minHeight=="string"?parseInt(r.minHeight):r.minHeight),H=i.ref(null);function Y(J){J===De.STRAIGHT&&x(H.value)}i.onMounted(()=>{Y(r.mode)}),i.watch(()=>r.mode,J=>{Y(J)});const ae=i.ref(null),ue=()=>{var ve;(ve=ae.value)!=null&&ve.editor.commands.focusInvalidChar()||M.commands.focusInvalidChar()};u.focusFirstInvalidChar.value=ue,i.onActivated(()=>{u.focusFirstInvalidChar.value=ue});const he=i.computed(()=>{var ve,Me,He;const J=((ve=r.fieldNameComment)==null?void 0:ve.label)||((Me=r.fieldNameCommentCuesheet)==null?void 0:Me.label)||((He=r.fieldNameContent)==null?void 0:He.label);return r.disabled&&J});return e({editor:M}),(J,ve)=>{var se;const Me=Np,He=Qp,Q=Zp,Se=Of,V=o$,D=GB;return i.unref(M)?(i.openBlock(),i.createElementBlock("div",{key:0,id:"vdc-editor",class:i.normalizeClass(["vdc-editor w-full flex flex-col",[J.editorClass,{"outline-ed-primary":i.unref(M).isFocused,"outline-ed-border":!i.unref(M).isFocused}]]),style:i.normalizeStyle(P.value)},[!J.hideBubble&&!J.disabled&&w.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[Z([i.unref(ac)])?(i.openBlock(),i.createBlock(Me,{key:0,editor:i.unref(M)},null,8,["editor"])):i.createCommentVNode("",!0),Z([i.unref(sa)])?(i.openBlock(),i.createBlock(He,{key:1,editor:i.unref(M)},null,8,["editor"])):i.createCommentVNode("",!0),Z([i.unref(us)])?(i.openBlock(),i.createBlock(Q,{key:2,editor:i.unref(M)},null,8,["editor"])):i.createCommentVNode("",!0),Z([i.unref(cs),i.unref(ds)])?(i.openBlock(),i.createBlock(Se,{key:3,editor:i.unref(M)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),J.hideToolbar?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(V,{key:1,editor:i.unref(M),"editor-comment":(se=ae.value)==null?void 0:se.editor,mode:J.mode,class:i.normalizeClass(["mb-2",J.toolBarClass])},null,8,["editor","editor-comment","mode","class"])),i.createElementVNode("div",{ref_key:"editorWrapRef",ref:ne,class:i.normalizeClass(["space-y-2 flex-1 flex flex-col break-keep",!C.value&&"[&_*]:!font-inherit [&_*]:!text-font-size-inherit",T.value&&!C.value?"[&_*]:!font-inherit":"",_.value&&!C.value?"[&_*]:!text-font-size-inherit":""]),style:i.normalizeStyle(A.value)},[he.value?(i.openBlock(),i.createBlock(D,{key:0,extensions:J.extensions,mode:J.mode,"hide-comment":J.hideComment,"field-name-comment":J.fieldNameComment,"field-name-comment-cuesheet":J.fieldNameCommentCuesheet,"field-name-content":J.fieldNameContent,comment:J.comment,"comment-cuesheet":J.commentCuesheet,content:J.modelValue,"min-chars":J.minChar.content,"font-size":_.value},null,8,["extensions","mode","hide-comment","field-name-comment","field-name-comment-cuesheet","field-name-content","comment","comment-cuesheet","content","min-chars","font-size"])):(i.openBlock(),i.createElementBlock("div",{key:1,class:"space-y-2 flex-1 flex flex-col",style:i.normalizeStyle({minWidth:`${z.value}px`})},[J.mode===i.unref(De).REPORT&&!J.hideComment?(i.openBlock(),i.createBlock(RZ,{key:0,ref_key:"editorCommentRef",ref:ae,mode:i.unref(De).REPORT,extensions:J.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":J.disableSuperInput,"is-open-super-view":te.value,"super-preview-custom-class":J.superPreviewCustomClass,"min-char":J.minChar,"font-size":_.value,style:i.normalizeStyle(r.autoHeight?{height:"auto",minHeight:i.unref(an)(i.unref(We))}:{height:i.unref(an)(i.unref(Ce)),minHeight:i.unref(an)(i.unref(ke))}),class:"relative overflow-y-auto","onUpdate:modelValue":ve[0]||(ve[0]=me=>o("update:comment",me))},null,8,["mode","extensions","model-value","disabled","disable-super-input","is-open-super-view","super-preview-custom-class","min-char","font-size","style"])):i.createCommentVNode("",!0),i.createElementVNode("div",{id:"editor-container",class:"relative overflow-y-auto flex flex-col",style:i.normalizeStyle(r.autoHeight?{height:"auto",minHeight:i.unref(an)(i.unref(ke))}:{height:i.unref(an)(i.unref(je))})},[i.createElementVNode("div",PZ,[i.withDirectives(i.createVNode(SZ,{ref_key:"superTextViewRef",ref:ie,editor:i.unref(M),"super-preview-custom-class":J.superPreviewCustomClass,"min-chars":J.minChar.superPreview,"font-size":_.value},null,8,["editor","super-preview-custom-class","min-chars","font-size"]),[[i.vShow,te.value]]),i.createElementVNode("div",{id:"editor-panel",ref_key:"contentInner",ref:$,class:"flex-1 p-2.5 border border-ed-gray-400 rounded-[3px] focus-within:border-ed-input-focus"},[i.createVNode(fb,{ref_key:"selectContextMenuRef",ref:H,editor:i.unref(M),mode:J.mode,"super-text-store":i.unref(b)},{default:i.withCtx(()=>[i.createVNode(i.unref(Eo),{editor:i.unref(M),spellcheck:"true",class:i.normalizeClass(i.unref(Ae)("h-full break-all",J.mode===i.unref(De).PLAIN_TEXT&&"plain-text"))},null,8,["editor","class"])]),_:1},8,["editor","mode","super-text-store"])],512)])],4)],4))],6)],6)):i.createCommentVNode("",!0)}}}),DZ={class:"flex gap-2 items-center overflow-x-auto overflow-y-hidden min-h-11 scrollbar-hide"},VZ=i.defineComponent({__name:"ToolbarFormat",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[]}},setup(t){const{t:e}=At(),n=t,r=["fontSize","fontFamily","superText","spellchecker",cE],o=i.computed(()=>{const l=[...n.editor.extensionManager.extensions];let u=[];for(const c of l){const{button:f,divider:p=!1,spacer:m=!1,toolbar:g=!0}=c.options;if(!f||!T0(f)||!g)continue;const b=f({editor:n.editor,extension:c,t:i.unref(e),isMobile:!0});if(Array.isArray(b)){const y=b.map((x,w)=>({id:`${c.name}`,button:x,divider:w===b.length-1?p:!1,spacer:w===0?m:!1}));u=[...u,...y];continue}u.push({button:b,divider:p,spacer:m,id:`${c.name}`})}return n.activeExtensions.length?u.filter(c=>c.id&&n.activeExtensions.includes(c.id)):(r.length&&(u=u.filter(c=>c.id&&!r.includes(c.id))),u)}),s=l=>l.id==="spellchecker"?"!text-ed-blue !bg-white !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":l.button.componentProps.customClass,a=l=>l.id==="spellchecker"?"Spellchecker":l.button.componentProps.icon;return(l,u)=>(i.openBlock(),i.createElementBlock("div",{id:"tool-bar-format",class:i.normalizeClass(i.unref(Ae)("bg-white border border-gray-100 dark:bg-ed-gray-500 dark:border-ed-muted rounded-full shadow-md px-2.5",!o.value.length&&"hidden"))},[i.createElementVNode("div",DZ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(c,f)=>{var p;return i.openBlock(),i.createBlock(i.resolveDynamicComponent(c.button.component),i.mergeProps({key:f,id:c.id,ref_for:!0},c.button.componentProps,{editor:l.editor,disabled:l.disabled||((p=c.button.componentProps)==null?void 0:p.disabled),"custom-class":s(c),icon:a(c)}),i.createSlots({_:2},[i.renderList(c.button.componentSlots,(m,g,b)=>({name:`${g}`,fn:i.withCtx(y=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(m),i.mergeProps({ref_for:!0},y==null?void 0:y.props,{id:c.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])}),128))])],2))}}),FZ={class:"flex gap-2 items-center overflow-x-auto"},Kk=i.defineComponent({__name:"ToolbarMobile",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[uE,lc,cb]}},setup(t){const{t:e}=At(),n=t,r=i.inject("isEditable",i.ref(!0)),o=i.computed(()=>{const u=[...n.editor.extensionManager.extensions],c=u.find(m=>m.name===cb);let f=u.sort((m,g)=>m.name==="spellchecker"?-1:g.name==="spellchecker"||m.name==="superText"?1:g.name==="superText"?-1:0);c&&(f=u.sort((m,g)=>m.name==="configPlan"?1:g.name==="configPlan"?-1:0));let p=[];for(const m of f){const{button:g,divider:b=!1,spacer:y=!1,toolbar:x=!0}=m.options;if(!g||!T0(g)||!x)continue;const w=g({editor:n.editor,extension:m,t:i.unref(e),isMobile:!0});if(Array.isArray(w)){const E=w.map((k,C)=>({id:`${m.name}`,button:k,divider:C===w.length-1?b:!1,spacer:C===0?y:!1}));p=[...p,...E];continue}p.push({button:w,divider:b,spacer:y,id:`${m.name}`})}if(!r.value){const m=p.find(g=>g.id==="superText");m&&(m.button.componentProps.disabled=!0)}return n.activeExtensions.length?p.filter(m=>m.id&&n.activeExtensions.includes(m.id)):p}),s=u=>u.id==="spellchecker"?"!text-ed-blue data-[state=off]:bg-white dark:data-[state=off]:bg-ed-accent/40 !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":u.button.componentProps.customClass,a=u=>u.id==="spellchecker"?"Spellchecker":u.button.componentProps.icon,l=i.ref(!1);return(u,c)=>{const f=dE;return i.openBlock(),i.createElementBlock("div",{id:"tool-bar",class:i.normalizeClass(i.unref(Ae)("z-10 bg-ed-gray-500 rounded-[5px] px-2.5 py-[5px] leading-none",i.unref(df)()&&"top-16",!o.value.length&&"hidden"))},[i.createElementVNode("div",FZ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(p,m)=>{var g,b,y;return i.openBlock(),i.createElementBlock(i.Fragment,{key:m},[p.spacer&&m!==0?(i.openBlock(),i.createBlock(i.unref(oi),{key:0,orientation:"vertical",class:"h-[16px] mx-[10px]"})):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(p.button.component),i.mergeProps({id:p.id,ref_for:!0},p.button.componentProps,{editor:u.editor,disabled:u.disabled||((g=p.button.componentProps)==null?void 0:g.disabled),"custom-class":s(p),icon:a(p)}),i.createSlots({_:2},[i.renderList(p.button.componentSlots,(x,w,E)=>({name:`${w}`,fn:i.withCtx(k=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(x),i.mergeProps({ref_for:!0},k==null?void 0:k.props,{id:p.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),p.id===lc&&i.unref(l)?(i.openBlock(),i.createBlock(f,{key:1,class:"bg-white border-inherit w-[26px] h-[26px] shadow-none",checked:(y=(b=p.button.componentProps).isActive)==null?void 0:y.call(b),"onUpdate:checked":x=>{var w,E;return(E=(w=p.button.componentProps).action)==null?void 0:E.call(w)}},null,8,["checked","onUpdate:checked"])):i.createCommentVNode("",!0),p.divider?(i.openBlock(),i.createBlock(i.unref(oi),{key:2,orientation:"vertical",class:"mx-2 h-auto"})):i.createCommentVNode("",!0)],64)}),128))])],2)}}}),$Z={class:"bg-ed-blue px-1"},zZ={class:"bg-ed-blue px-1"},qb=_o(i.defineComponent({__name:"SelectContextMenuMobile",props:{editor:{},mode:{},disableSuperInput:{type:Boolean}},setup(t){var g;const e=t,{t:n}=At(),r=i.ref(!1),o=i.inject("isEditable",i.ref(!0)),s=(g=e.editor.extensionManager.extensions.find(b=>b.name==="superText"))==null?void 0:g.options.specialCharModal,a=b=>{e.editor.chain().focus().insertContent(b).run()},l=()=>{e.editor.chain().focus().selectAll().run()},u=i.ref(!1),c=async b=>{var y,x;if(b){const w=await((x=(y=e.editor).hasClipboard)==null?void 0:x.call(y));u.value=!!w}},f=i.computed(()=>!o.value),p=i.computed(()=>[...e.editor.extensionManager.extensions].find(y=>y.name==="configPlan")),m=i.computed(()=>[...e.editor.extensionManager.extensions].find(y=>y.name==="superText"));return(b,y)=>{var C,_,T;const x=Sp,w=kp,E=Ep,k=Cp;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(k,{"onUpdate:open":c},{default:i.withCtx(()=>[i.createVNode(x,{as:"template",disabled:i.unref(f)},{default:i.withCtx(()=>[i.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["disabled"]),i.createVNode(E,{"avoid-collisions":!0,sticky:"always","hide-when-detached":"","prioritize-position":"",class:"flex bg-[#616161] text-white max-w-[calc(100vw-16px)] sm:max-w-[310px] overflow-x-auto whitespace-nowrap"},{default:i.withCtx(()=>[i.unref(m)&&!b.disableSuperInput&&b.mode!==i.unref(De).EDITOR?(i.openBlock(),i.createBlock(w,{key:0,onClick:y[0]||(y[0]=A=>b.editor.commands.toggleSuperInputMoblie())},{default:i.withCtx(()=>[i.createElementVNode("span",$Z,i.toDisplayString(i.unref(n)("editor.super")),1)]),_:1})):i.createCommentVNode("",!0),i.unref(p)?(i.openBlock(),i.createBlock(w,{key:1,onClick:y[1]||(y[1]=A=>b.editor.commands.toggleConfigPlanInput())},{default:i.withCtx(()=>[i.createElementVNode("span",zZ,i.toDisplayString(i.unref(n)("editor.configPlan")),1)]),_:1})):i.createCommentVNode("",!0),i.createVNode(w,{onClick:y[2]||(y[2]=A=>r.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.insertSpecial")),1)]),_:1}),i.unref(u)?(i.openBlock(),i.createBlock(w,{key:2,onClick:y[3]||(y[3]=A=>{var R;return(R=b.editor)==null?void 0:R.commands.pasteContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.paste")),1)]),_:1})):i.createCommentVNode("",!0),i.createVNode(w,{onClick:y[4]||(y[4]=A=>{var R;return(R=b.editor)==null?void 0:R.commands.cutContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.cut")),1)]),_:1}),i.createVNode(w,{onClick:y[5]||(y[5]=A=>{var R;return(R=b.editor)==null?void 0:R.commands.copyContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.copy")),1)]),_:1}),i.createVNode(w,{onClick:l},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.selectAll")),1)]),_:1})]),_:1})]),_:3}),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent((C=i.unref(s))==null?void 0:C.component),{"is-open":i.unref(r),open:i.unref(r),class:i.normalizeClass((T=(_=i.unref(s))==null?void 0:_.componentProps)==null?void 0:T.class),onSelectedChar:a,onClose:y[6]||(y[6]=A=>r.value=!1)},null,40,["is-open","open","class"]))]))],64)}}}),[["__scopeId","data-v-d47964cd"]]),HZ={class:"text-red-500 relative -top-1"},th=i.defineComponent({__name:"EditorFieldName",props:{fieldName:{},mode:{},disabled:{type:Boolean,default:!1},intent:{default:"primary"}},setup(t){const e=t,n=i.computed(()=>e.disabled&&e.mode!==De.EDITOR?`[${e.fieldName.label}]`:e.fieldName.label),r=i.computed(()=>e.mode===De.EDITOR?"":e.intent==="primary"?"border-ed-blue text-ed-blue":"border-[#FF3B30] text-[#FF3B30]");return(o,s)=>(i.openBlock(),i.createElementBlock("p",null,[i.createElementVNode("span",{class:i.normalizeClass(i.unref(Ae)("font-bold",o.mode!==i.unref(De).EDITOR&&"rounded-full border text-xs py-[2px] px-1 inline-block font-normal",o.disabled&&"!border-transparent px-0",i.unref(r)))},i.toDisplayString(i.unref(n)),3),i.withDirectives(i.createElementVNode("span",HZ," •",512),[[i.vShow,o.fieldName.isRequired]])]))}}),UZ=i.defineComponent({__name:"EditorCommentMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean,default:!0},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useAttrs(),a=vn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,p=i.inject("isEditable",i.ref(!0));i.computed(()=>r.mode===De.EDITOR);const m=new No({enablePasteRules:!1,enableInputRules:!1,content:Pn(r.modelValue,r.disabled),editorProps:{attributes:{id:nr.COMMENT,[nr.DISABLE_SUPER_INPUT]:`${r.disableSuperInput}`},handleKeyDown:it.throttle((w,E)=>E.key==="Enter"&&s.enter&&!E.shiftKey?(o("enter"),!0):!1,So),transformPastedHTML:w=>(w=w.replace(/\s*style="[^"]*"/g,""),w)},onCreate:({editor:w})=>{c(w)},onUpdate:it.throttle(({editor:w})=>{l.value=!0;const E=b(w,r.output);o("update:modelValue",E),o("change",{editor:w,output:E}),c(w)},So),extensions:it.uniqBy(it.reverse(i.unref(r.extensions)),"name"),editable:p.value,onFocus:()=>{g()},onBlur:({editor:w,event:E})=>{o("onBlurEditor",E)}});function g(){o("setEditorSelected",m)}g();function b(w,E){if(!w)return"";if(w.isEmpty)return E==="json"?{}:"";switch(E){case"html":return w.getHTML();case"json":return w.getJSON();case"text":return w.getText();default:return""}}function y(w){return w.every(E=>m==null?void 0:m.extensionManager.extensions.find(k=>k.name===E))}i.watch(()=>f.languages,()=>{m.commands.checkSpelling()}),i.watch(()=>r.modelValue,w=>{if(!m||it.isEqual(b(m,r.output),w))return;const{from:E,to:k}=m.state.selection;m.commands.setTextSelection({from:E,to:k}),m.commands.setContent(Pn(w,r.disabled),!1)},{deep:!0}),i.watch(()=>u.value,()=>{u.value&&u.value.on("selectionUpdate",({editor:w})=>{o("changed:selection",{editor:w})})}),i.watch(()=>r.disableSuperInput,()=>{const w=document.getElementById(nr.COMMENT);w==null||w.setAttribute(nr.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),i.onUnmounted(()=>m==null?void 0:m.destroy()),Gu(Eu.SAVE,()=>{localStorage.setItem("comment",b(m,"html"))});function x(w){m.commands.focus("end"),g()}return bc(m),i.onMounted(()=>{var w;r.autoFocus&&x(r.mode),(w=m==null?void 0:m.commands)!=null&&w.setIsMobile&&m.commands.setIsMobile(!0)}),i.watch(()=>r.mode,w=>{r.autoFocus&&x()}),i.watch(()=>p.value,w=>{var E;m==null||m.setEditable(w),(E=m==null?void 0:m.commands)!=null&&E.setIsEnableSuggestion&&m.commands.setIsEnableSuggestion(w)},{immediate:!0}),e({editor:m}),(w,E)=>{var R;const k=Np,C=Qp,_=Zp,T=Of,A=th;return i.openBlock(),i.createElementBlock(i.Fragment,null,[!w.hideBubble&&!w.disabled&&i.unref(p)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[y([i.unref(ac)])?(i.openBlock(),i.createBlock(k,{key:0,editor:i.unref(m)},null,8,["editor"])):i.createCommentVNode("",!0),y([i.unref(sa)])?(i.openBlock(),i.createBlock(C,{key:1,editor:i.unref(m)},null,8,["editor"])):i.createCommentVNode("",!0),y([i.unref(us)])?(i.openBlock(),i.createBlock(_,{key:2,editor:i.unref(m)},null,8,["editor"])):i.createCommentVNode("",!0),y([i.unref(cs),i.unref(ds)])?(i.openBlock(),i.createBlock(T,{key:3,editor:i.unref(m)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),(R=w.fieldNameComment)!=null&&R.label?(i.openBlock(),i.createBlock(A,{key:1,"field-name":w.fieldNameComment,mode:w.mode,disabled:w.disabled,class:"mb-1"},null,8,["field-name","mode","disabled"])):i.createCommentVNode("",!0),i.createVNode(qb,{editor:i.unref(m),mode:w.mode,"disable-super-input":w.disableSuperInput},{default:i.withCtx(()=>[i.createVNode(i.unref(Eo),{id:"editor-panel",editor:i.unref(m),spellcheck:"true",class:i.normalizeClass(["flex-1 flex-col relative"])},null,8,["editor"])]),_:1},8,["editor","mode","disable-super-input"])],64)}}}),Kb={__name:"splitpanes",props:{horizontal:{type:Boolean,default:!1},pushOtherPanes:{type:Boolean,default:!0},maximizePanes:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean,default:!1}},emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click","splitter-dblclick"],setup(t,{emit:e}){const n=e,r=t,o=i.useSlots(),s=i.ref([]),a=i.computed(()=>s.value.reduce((H,Y)=>(H[~~Y.id]=Y)&&H,{})),l=i.computed(()=>s.value.length),u=i.ref(null),c=i.ref(!1),f=i.ref({mouseDown:!1,dragging:!1,activeSplitter:null,cursorOffset:0}),p=i.ref({splitter:null,timeoutId:null}),m=i.computed(()=>({[`splitpanes splitpanes--${r.horizontal?"horizontal":"vertical"}`]:!0,"splitpanes--dragging":f.value.dragging})),g=()=>{document.addEventListener("mousemove",x,{passive:!1}),document.addEventListener("mouseup",w),"ontouchstart"in window&&(document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("touchend",w))},b=()=>{document.removeEventListener("mousemove",x,{passive:!1}),document.removeEventListener("mouseup",w),"ontouchstart"in window&&(document.removeEventListener("touchmove",x,{passive:!1}),document.removeEventListener("touchend",w))},y=(H,Y)=>{const ae=H.target.closest(".splitpanes__splitter");if(ae){const{left:ue,top:he}=ae.getBoundingClientRect(),{clientX:J,clientY:ve}="ontouchstart"in window&&H.touches?H.touches[0]:H;f.value.cursorOffset=r.horizontal?ve-he:J-ue}g(),f.value.mouseDown=!0,f.value.activeSplitter=Y},x=H=>{f.value.mouseDown&&(H.preventDefault(),f.value.dragging=!0,requestAnimationFrame(()=>{A(_(H)),ke("resize",{event:H},!0)}))},w=H=>{f.value.dragging&&(window.getSelection().removeAllRanges(),ke("resized",{event:H},!0)),f.value.mouseDown=!1,f.value.activeSplitter=null,setTimeout(()=>{f.value.dragging=!1,b()},100)},E=(H,Y)=>{"ontouchstart"in window&&(H.preventDefault(),p.value.splitter===Y?(clearTimeout(p.value.timeoutId),p.value.timeoutId=null,k(H,Y),p.value.splitter=null):(p.value.splitter=Y,p.value.timeoutId=setTimeout(()=>p.value.splitter=null,500))),f.value.dragging||ke("splitter-click",{event:H,index:Y},!0)},k=(H,Y)=>{if(ke("splitter-dblclick",{event:H,index:Y},!0),r.maximizePanes){let ae=0;s.value=s.value.map((ue,he)=>(ue.size=he===Y?ue.max:ue.min,he!==Y&&(ae+=ue.min),ue)),s.value[Y].size-=ae,ke("pane-maximize",{event:H,index:Y,pane:s.value[Y]}),ke("resized",{event:H,index:Y},!0)}},C=(H,Y)=>{ke("pane-click",{event:H,index:a.value[Y].index,pane:a.value[Y]})},_=H=>{const Y=u.value.getBoundingClientRect(),{clientX:ae,clientY:ue}="ontouchstart"in window&&H.touches?H.touches[0]:H;return{x:ae-(r.horizontal?0:f.value.cursorOffset)-Y.left,y:ue-(r.horizontal?f.value.cursorOffset:0)-Y.top}},T=H=>{H=H[r.horizontal?"y":"x"];const Y=u.value[r.horizontal?"clientHeight":"clientWidth"];return r.rtl&&!r.horizontal&&(H=Y-H),H*100/Y},A=H=>{const Y=f.value.activeSplitter;let ae={prevPanesSize:P(Y),nextPanesSize:M(Y),prevReachedMinPanes:0,nextReachedMinPanes:0};const ue=0+(r.pushOtherPanes?0:ae.prevPanesSize),he=100-(r.pushOtherPanes?0:ae.nextPanesSize),J=Math.max(Math.min(T(H),he),ue);let ve=[Y,Y+1],Me=s.value[ve[0]]||null,He=s.value[ve[1]]||null;const Q=Me.max<100&&J>=Me.max+ae.prevPanesSize,Se=He.max<100&&J<=100-(He.max+M(Y+1));if(Q||Se){Q?(Me.size=Me.max,He.size=Math.max(100-Me.max-ae.prevPanesSize-ae.nextPanesSize,0)):(Me.size=Math.max(100-He.max-ae.prevPanesSize-M(Y+1),0),He.size=He.max);return}if(r.pushOtherPanes){const V=R(ae,J);if(!V)return;({sums:ae,panesToResize:ve}=V),Me=s.value[ve[0]]||null,He=s.value[ve[1]]||null}Me!==null&&(Me.size=Math.min(Math.max(J-ae.prevPanesSize-ae.prevReachedMinPanes,Me.min),Me.max)),He!==null&&(He.size=Math.min(Math.max(100-J-ae.nextPanesSize-ae.nextReachedMinPanes,He.min),He.max))},R=(H,Y)=>{const ae=f.value.activeSplitter,ue=[ae,ae+1];return Y<H.prevPanesSize+s.value[ue[0]].min&&(ue[0]=$(ae).index,H.prevReachedMinPanes=0,ue[0]<ae&&s.value.forEach((he,J)=>{J>ue[0]&&J<=ae&&(he.size=he.min,H.prevReachedMinPanes+=he.min)}),H.prevPanesSize=P(ue[0]),ue[0]===void 0)?(H.prevReachedMinPanes=0,s.value[0].size=s.value[0].min,s.value.forEach((he,J)=>{J>0&&J<=ae&&(he.size=he.min,H.prevReachedMinPanes+=he.min)}),s.value[ue[1]].size=100-H.prevReachedMinPanes-s.value[0].min-H.prevPanesSize-H.nextPanesSize,null):Y>100-H.nextPanesSize-s.value[ue[1]].min&&(ue[1]=j(ae).index,H.nextReachedMinPanes=0,ue[1]>ae+1&&s.value.forEach((he,J)=>{J>ae&&J<ue[1]&&(he.size=he.min,H.nextReachedMinPanes+=he.min)}),H.nextPanesSize=M(ue[1]-1),ue[1]===void 0)?(H.nextReachedMinPanes=0,s.value.forEach((he,J)=>{J<l.value-1&&J>=ae+1&&(he.size=he.min,H.nextReachedMinPanes+=he.min)}),s.value[ue[0]].size=100-H.prevPanesSize-M(ue[0]-1),null):{sums:H,panesToResize:ue}},P=H=>s.value.reduce((Y,ae,ue)=>Y+(ue<H?ae.size:0),0),M=H=>s.value.reduce((Y,ae,ue)=>Y+(ue>H+1?ae.size:0),0),$=H=>[...s.value].reverse().find(Y=>Y.index<H&&Y.size>Y.min)||{},j=H=>s.value.find(Y=>Y.index>H+1&&Y.size>Y.min)||{},X=()=>{var H;const Y=Array.from(((H=u.value)==null?void 0:H.children)||[]);for(const ae of Y){const ue=ae.classList.contains("splitpanes__pane"),he=ae.classList.contains("splitpanes__splitter");!ue&&!he&&(ae.remove(),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))}},ie=(H,Y,ae=!1)=>{const ue=H-1,he=document.createElement("div");he.classList.add("splitpanes__splitter"),ae||(he.onmousedown=J=>y(J,ue),typeof window<"u"&&"ontouchstart"in window&&(he.ontouchstart=J=>y(J,ue)),he.onclick=J=>E(J,ue+1)),he.ondblclick=J=>k(J,ue+1),Y.parentNode.insertBefore(he,Y)},W=H=>{H.onmousedown=void 0,H.onclick=void 0,H.ondblclick=void 0,H.remove()},z=()=>{var H;const Y=Array.from(((H=u.value)==null?void 0:H.children)||[]);for(const ue of Y)ue.className.includes("splitpanes__splitter")&&W(ue);let ae=0;for(const ue of Y)ue.className.includes("splitpanes__pane")&&(!ae&&r.firstSplitter?ie(ae,ue,!0):ae&&ie(ae,ue),ae++)},L=({uid:H,...Y})=>{const ae=a.value[H];for(const[ue,he]of Object.entries(Y))ae[ue]=he},q=H=>{var Y;let ae=-1;Array.from(((Y=u.value)==null?void 0:Y.children)||[]).some(ue=>(ue.className.includes("splitpanes__pane")&&ae++,ue.isSameNode(H.el))),s.value.splice(ae,0,{...H,index:ae}),s.value.forEach((ue,he)=>ue.index=he),c.value&&i.nextTick(()=>{z(),te({addedPane:s.value[ae]}),ke("pane-add",{pane:s.value[ae]})})},Z=H=>{const Y=s.value.findIndex(ue=>ue.id===H);s.value[Y].el=null;const ae=s.value.splice(Y,1)[0];s.value.forEach((ue,he)=>ue.index=he),i.nextTick(()=>{z(),ke("pane-remove",{pane:ae}),te({removedPane:{...ae}})})},te=(H={})=>{!H.addedPane&&!H.removedPane?ye():s.value.some(Y=>Y.givenSize!==null||Y.min||Y.max<100)?Ce(H):ne(),c.value&&ke("resized")},ne=()=>{const H=100/l.value;let Y=0;const ae=[],ue=[];for(const he of s.value)he.size=Math.max(Math.min(H,he.max),he.min),Y-=he.size,he.size>=he.max&&ae.push(he.id),he.size<=he.min&&ue.push(he.id);Y>.1&&je(Y,ae,ue)},ye=()=>{let H=100;const Y=[],ae=[];let ue=0;for(const J of s.value)H-=J.size,J.givenSize!==null&&ue++,J.size>=J.max&&Y.push(J.id),J.size<=J.min&&ae.push(J.id);let he=100;if(H>.1){for(const J of s.value)J.givenSize===null&&(J.size=Math.max(Math.min(H/(l.value-ue),J.max),J.min)),he-=J.size;he>.1&&je(he,Y,ae)}},Ce=({addedPane:H,removedPane:Y}={})=>{let ae=100/l.value,ue=0;const he=[],J=[];((H==null?void 0:H.givenSize)??null)!==null&&(ae=(100-H.givenSize)/(l.value-1));for(const ve of s.value)ue-=ve.size,ve.size>=ve.max&&he.push(ve.id),ve.size<=ve.min&&J.push(ve.id);if(!(Math.abs(ue)<.1)){for(const ve of s.value)(H==null?void 0:H.givenSize)!==null&&(H==null?void 0:H.id)===ve.id||(ve.size=Math.max(Math.min(ae,ve.max),ve.min)),ue-=ve.size,ve.size>=ve.max&&he.push(ve.id),ve.size<=ve.min&&J.push(ve.id);ue>.1&&je(ue,he,J)}},je=(H,Y,ae)=>{let ue;H>0?ue=H/(l.value-Y.length):ue=H/(l.value-ae.length),s.value.forEach((he,J)=>{if(H>0&&!Y.includes(he.id)){const ve=Math.max(Math.min(he.size+ue,he.max),he.min),Me=ve-he.size;H-=Me,he.size=ve}else if(!ae.includes(he.id)){const ve=Math.max(Math.min(he.size+ue,he.max),he.min),Me=ve-he.size;H-=Me,he.size=ve}}),Math.abs(H)>.1&&i.nextTick(()=>{c.value&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})},ke=(H,Y=void 0,ae=!1)=>{const ue=(Y==null?void 0:Y.index)??f.value.activeSplitter??null;n(H,{...Y,...ue!==null&&{index:ue},...ae&&ue!==null&&{prevPane:s.value[ue-(r.firstSplitter?1:0)],nextPane:s.value[ue+(r.firstSplitter?0:1)]},panes:s.value.map(he=>({min:he.min,max:he.max,size:he.size}))})};i.watch(()=>r.firstSplitter,()=>z()),i.onMounted(()=>{X(),z(),te(),ke("ready"),c.value=!0}),i.onBeforeUnmount(()=>c.value=!1);const We=()=>{var H;return i.h("div",{ref:u,class:m.value},(H=o.default)==null?void 0:H.call(o))};return i.provide("panes",s),i.provide("indexedPanes",a),i.provide("horizontal",i.computed(()=>r.horizontal)),i.provide("requestUpdate",L),i.provide("onPaneAdd",q),i.provide("onPaneRemove",Z),i.provide("onPaneClick",C),(H,Y)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(We)))}},ha={__name:"pane",props:{size:{type:[Number,String]},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},setup(t){var e;const n=t,r=i.inject("requestUpdate"),o=i.inject("onPaneAdd"),s=i.inject("horizontal"),a=i.inject("onPaneRemove"),l=i.inject("onPaneClick"),u=(e=i.getCurrentInstance())==null?void 0:e.uid,c=i.inject("indexedPanes"),f=i.computed(()=>c.value[u]),p=i.ref(null),m=i.computed(()=>{const x=isNaN(n.size)||n.size===void 0?0:parseFloat(n.size);return Math.max(Math.min(x,b.value),g.value)}),g=i.computed(()=>{const x=parseFloat(n.minSize);return isNaN(x)?0:x}),b=i.computed(()=>{const x=parseFloat(n.maxSize);return isNaN(x)?100:x}),y=i.computed(()=>{var x;return`${s.value?"height":"width"}: ${(x=f.value)==null?void 0:x.size}%`});return i.watch(()=>m.value,x=>r({uid:u,size:x})),i.watch(()=>g.value,x=>r({uid:u,min:x})),i.watch(()=>b.value,x=>r({uid:u,max:x})),i.onMounted(()=>{o({id:u,el:p.value,min:g.value,max:b.value,givenSize:n.size===void 0?null:m.value,size:m.value})}),i.onBeforeUnmount(()=>a(u)),(x,w)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"paneEl",ref:p,class:"splitpanes__pane",onClick:w[0]||(w[0]=E=>i.unref(l)(E,x._.uid)),style:i.normalizeStyle(y.value)},[i.renderSlot(x.$slots,"default")],4))}},Gb=i.defineComponent({__name:"ToolbarTitle",props:{titleBar:{},customClass:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("h3",{class:i.normalizeClass(i.unref(Ae)("rounded-[5px] px-2.5 py-[5px] min-h-[32px] flex items-center bg-ed-gray-500",[e.customClass],[e.titleBar.bgClass]))},i.toDisplayString(e.titleBar.title),3))}});function nh(){let e=null,n=!1;const r=i.ref(!1),o=i.ref(0),s=i.ref(0),a=i.ref(50),l=i.ref(50);let u=[];function c(w,E){n=!1,e=setTimeout(()=>{n=!0},200);const k=E.getBoundingClientRect();o.value=k.left+k.width/2,s.value=k.top+k.height/2}function f(w){clearTimeout(e),e=null,n||(r.value=!0),n=!1}function p(){const w=document.querySelectorAll(".splitpanes__splitter");u=Array.from(w),u.forEach(E=>{E.addEventListener("mousedown",k=>c(k,E)),E.addEventListener("mouseup",f),E.addEventListener("touchstart",k=>c(k,E)),E.addEventListener("touchend",f)})}function m(){u.forEach(w=>{w.removeEventListener("mouseup",f),w.removeEventListener("touchend",f),w.removeEventListener("mousedown",E=>c(E,w)),w.removeEventListener("touchstart",E=>c(E,w))}),u=[]}const g=i.ref([{name:"paneUp",selected:!1},{name:"paneMiddle",selected:!0},{name:"paneDown",selected:!1}]),b=i.ref({name:"paneMiddle",selected:!0});function y(w){b.value=w}async function x(w){y(w),r.value=!1,await i.nextTick(),w.name==="paneUp"?(a.value=0,l.value=100):w.name==="paneDown"?(a.value=100,l.value=0):(a.value=50,l.value=50)}return{showMenuSplitter:r,menuX:o,menuY:s,commentSize:a,contentSize:l,setupSplitterListeners:p,removeSplitterListeners:m,iconSplitters:g,iconSplitSelected:b,setSelectedIconSplit:y,clickIconSplitter:x}}const Xb=i.defineComponent({__name:"ScreenSplitToastPopup",props:{menuX:{},menuY:{},iconSplitSelected:{}},emits:["on-change-split"],setup(t,{emit:e}){const{iconSplitters:n}=nh(),r=t,o=e,s=i.computed(()=>({top:`${r.menuY}px`,left:`${r.menuX}px`,transform:"translate(-50%, -50%)"}));return(a,l)=>(i.openBlock(),i.createElementBlock("div",{style:i.normalizeStyle(i.unref(s)),class:"fixed bg-[#424242]/40 text-white/40 rounded-[21px] w-[132px] h-[37px] flex items-center justify-center gap-6 [&>svg]:cursor-pointer"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(n),u=>(i.openBlock(),i.createBlock(i.unref(jt),{key:u.name,name:u.name,class:i.normalizeClass({"text-black/80":u.name===a.iconSplitSelected.name}),onClick:c=>o("on-change-split",u)},null,8,["name","class","onClick"]))),128))],4))}});class WZ{isNativeWebViewAvailable(){return window.ReactNativeWebView!==void 0}getDevicePlatform(){var r;if(!this.isNativeWebViewAvailable())return;if(typeof window.webkit=="object"&&typeof((r=window.webkit)==null?void 0:r.messageHandlers)=="object")return k0.IOS;const n=navigator.userAgent.toLowerCase();if(n.includes("android"))return k0.ANDROID;if(n.includes("iphone")||n.includes("ipad")||n.includes("ipod"))return k0.IOS}sendToNative(e,n){if(window.ReactNativeWebView){const r={type:e,data:n};window.ReactNativeWebView.postMessage(JSON.stringify(r)),console.log(`Sent message to native: ${e}`)}else console.log("ReactNativeWebView not available")}receiveDataFromNative(e,n){const r=window.receiveDriverData;window.receiveDriverData=o=>{try{const s=JSON.parse(o);s.type===e?(console.log(`Received data from native ${e}`),n(s.data)):r&&r(o)}catch(s){console.log("Error parsing data from native",s)}}}}const vc=i.defineComponent({__name:"CoreEditorMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{default:""},commentCuesheet:{},hideComment:{type:Boolean,default:!1},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{default:"12px"},fontFamilyDefault:{default:""},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean,default:!1},titleBarComment:{default:null},titleBarContent:{default:null},fieldNameComment:{default:null},fieldNameCommentCuesheet:{},fieldNameContent:{default:null},fieldNameSuper:{},isScreenSplit:{default:!1},isShowLineNumber:{type:Boolean,default:!1},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},toolBarClass:{default:void 0},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=new WZ;i.provide("isMobile",!0);const a=pt.useEventBus(ir.INCREASE_DECREASE_FONTSIZE),l=i.useAttrs(),u=vn(),{state:c,isFullscreen:f,isReady:p,editor:m,updateEditorState:g,checkSpellStore:b,setImageAttachment:y}=u,x=i.computed(()=>r.mode===De.EDITOR),w=i.ref(!r.disabled&&!r.readonly);i.provide("isEditable",w);const E=i.computed(()=>[...c.extensions,...it.differenceBy(r.extensions,c.extensions,"name")].map((Q,Se)=>Q.configure({sort:Se}))),k=i.ref(r.fontSizeDefault),C=i.ref(r.fontFamilyDefault);i.provide("fontSize",k),i.provide("fontFamily",C);const _=i.computed(()=>({fontFamily:C.value,fontSize:k.value})),T=i.ref(),{height:A}=pt.useWindowSize(),R=i.computed(()=>{var Se;if(z.value)return{bottom:"15px"};const Q=((Se=T.value)==null?void 0:Se.getBoundingClientRect().bottom)||0;return{bottom:`${A.value-Q+10}px`}}),P=Q=>{const Se=parseInt(k.value||"12px"),V=Q?Se+2:Se-2;k.value=V+"px"};i.onBeforeMount(()=>{a.on(P)}),i.onBeforeUnmount(()=>{a.off(P)});const M=i.computed(()=>({...i.unref(f)?{height:"100%"}:{minHeight:r.minHeight?an(r.minHeight):void 0,maxHeight:r.maxHeight?an(r.maxHeight):void 0,height:r.height?an(r.height):void 0},maxWidth:an(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),$=new No({enablePasteRules:!1,enableInputRules:!1,content:Pn(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:it.throttle((Q,Se)=>Se.key==="Enter"&&l.enter&&!Se.shiftKey?(o("enter"),!0):!1,So),transformPastedHTML:Q=>(Q=Q.replace(/\s*style="[^"]*"/g,""),Q),handlePaste(Q,Se){var me;if(r.mode!==De.PLAIN_TEXT)return!1;Se.preventDefault();const V=((me=Se.clipboardData)==null?void 0:me.getData("text/plain"))||"",{tr:D,selection:se}=Q.state;return Q.dispatch(D.insertText(V,se.from)),!0}},onCreate:({editor:Q})=>{g(Q)},onUpdate:it.throttle(({editor:Q})=>{p.value=!0;const Se=ne(Q,r.output);o("update:modelValue",Se),o("change",{editor:Q,output:Se}),g(Q),j(Q)},So),extensions:it.uniqBy(it.reverse(i.unref(E)),"name"),editable:w.value,onFocus:Q=>{Z(),o("onFocus",Q)},onBlur:Q=>o("onBlur",Q),parseOptions:{preserveWhitespace:"full"}});function j(Q){const Se=[];Q.state.doc.descendants(V=>{V.type.name==="image"&&Se.push({id:V.attrs.id,src:V.attrs.src})}),y(Se)}const X=i.ref(),ie=i.ref(),W=i.ref(!0),z=i.ref(!1);function L(){s.isNativeWebViewAvailable()&&(s.receiveDataFromNative("keyboardDidShow",Q=>{z.value=!0}),s.receiveDataFromNative("keyboardDidHide",Q=>{z.value=!1}))}function q(Q){const Se=document.querySelectorAll('[contenteditable="true"]:not(.tiptap), .simple-editor, input, textarea'),V=Array.from(Se).some(D=>D.contains(Q.target));if(Q.type==="focusout"){W.value=!0;return}W.value=!V}pt.useEventListener(document,"focusin",q),pt.useEventListener(document,"focusout",q),i.onMounted(()=>{X.value=$,L()});function Z(Q){X.value=Q??$}const te=i.computed(()=>{const Q=X.value.view.dom.dataset.disableSuperInput&&JSON.parse(X.value.view.dom.dataset.disableSuperInput);return X.value.storage.superText.isShowSuperInputMoblie&&!Q});function ne(Q,Se){if(!Q)return"";if(Q.isEmpty)return Se==="json"?{}:"";if(r.mode===De.PLAIN_TEXT)return Q.getText({blockSeparator:`