vue-editify 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).editify={},e.Vue)}(this,(function(e,t){"use strict";var i=Object.defineProperty,n=(e,t,n)=>(((e,t,n)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const o={formatNumber(e){return this.isNumber(e)?e.toString().replace(/(\d)(?=(?:\d{3})+$)/g,"$1,"):e},isNumber:e=>"number"==typeof e&&!isNaN(e),add:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=0;try{i=e.toString().split(".")[1].length}catch(r){}try{n=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(i,n)),(e*o+t*o)/o})),subtract:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=0;try{i=e.toString().split(".")[1].length}catch(r){}try{n=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(i,n)),(e*o-t*o)/o})),mutiply:(...e)=>e.reduce(((e,t)=>{let i=0,n=e.toString(),o=t.toString();try{i+=n.split(".")[1].length}catch(r){}try{i+=o.split(".")[1].length}catch(r){}return Number(n.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,i)})),divide:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=e.toString(),r=t.toString();try{i=o.split(".")[1].length}catch(s){}try{n=r.split(".")[1].length}catch(s){}return o=Number(o.replace(".","")),r=Number(r.replace(".","")),o/r*Math.pow(10,n-i)}))},r={insert(e,t,i){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if("string"!=typeof t)throw new TypeError("The second argument must be a string");if(!o.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,i)+t+e.substring(i,e.length)},delete(e,t,i){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!o.isNumber(t))throw new TypeError("The second argument must be a number");if(t<0)throw new Error("The second argument cannot be less than 0");if(!o.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,t)+e.substring(t+i,e.length)},replace(e,t,i,n){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!o.isNumber(t))throw new TypeError("The second argument must be a number");if(t<0)throw new Error("The second argument cannot be less than 0");if(!o.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");if("string"!=typeof n)throw new TypeError("The fourth argument must be a string");return e.substring(0,t)+n+e.substring(i,e.length)},trim(e,t=!1){if("string"!=typeof e)throw new TypeError("The first argument must be a string");let i=e.replace(/(^\s+)|(\s+$)/g,"");return t&&(i=i.replace(/\s/g,"")),i}},s={isWindow:e=>e&&e instanceof Window,getElementPoint(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(this.isElement(t)||(t=document.body),!this.isContains(t,e))throw new Error("The second argument and the first argument have no hierarchical relationship");let i=e,n=0,o=0;for(;this.isElement(e)&&this.isContains(t,e)&&t!==e;)n+=e.offsetTop,o+=e.offsetLeft,e=e.offsetParent;return{top:n,left:o,right:t.offsetWidth-o-i.offsetWidth,bottom:t.offsetHeight-n-i.offsetHeight}},isContains(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!this.isElement(t))throw new TypeError("The second argument must be an element");return e===t||(e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):void 0)},isParentNode(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!this.isElement(t))throw new TypeError("The second argument must be an element");return e!==t&&t.parentNode===e},children(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(t&&"string"!=typeof t)throw new TypeError("The second argument must be a string");return[...e.querySelectorAll(t||"*")].filter((t=>t.parentNode===e))},siblings(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(t&&"string"!=typeof t)throw new TypeError("The second argument must be a string");if(!e.parentNode)return[];return[...e.parentNode.querySelectorAll(t||"*")].filter((t=>t.parentNode===e.parentNode&&t!=e))},rem2px(e){if(!o.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return o.mutiply(e,parseFloat(t))},px2rem(e){if(!o.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return o.divide(e,parseFloat(t))},width(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientWidth,i=parseFloat(this.getCssStyle(e,"padding-left")),n=parseFloat(this.getCssStyle(e,"padding-right"));return o.subtract(t,i,n)},height(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientHeight,i=parseFloat(this.getCssStyle(e,"padding-top")),n=parseFloat(this.getCssStyle(e,"padding-bottom"));return o.subtract(t,i,n)},removeClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;r.trim(t).split(/\s+/).forEach((e=>{i.remove(e)}))},addClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;r.trim(t).split(/\s+/).forEach((e=>{i.add(e)}))},hasClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;return r.trim(t).split(/\s+/).every((e=>i.contains(e)))},scrollTopBottomTrigger(e,t){"string"==typeof e&&e&&(e=document.body.querySelector(e));let i=window;this.isElement(e)&&e!=document.body&&e!=document.documentElement&&(i=e),"function"==typeof e&&(t=e);let n=!0;i.addEventListener("scroll",(e=>{if(this.getScrollTop(i)<=0){if(!n)return;"function"==typeof t&&(n=!1,t({state:"top",target:i}))}else{let e={state:"bottom",target:i},r=0;if(r=i==window?window.innerHeight:i.clientHeight,o.add(this.getScrollTop(i),r)+1>=this.getScrollHeight(i)&&r!=this.getScrollHeight(i)){if(!n)return;"function"==typeof t&&(n=!1,t(e))}else n=!0}}))},getScrollWidth(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.documentElement&&e!=document.body?e.scrollWidth:0==document.documentElement.scrollWidth||0==document.body.scrollWidth?document.documentElement.scrollWidth||document.body.scrollWidth:document.documentElement.scrollWidth>document.body.scrollWidth?document.documentElement.scrollWidth:document.body.scrollWidth,t},getScrollHeight(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.documentElement&&e!=document.body?e.scrollHeight:0==document.documentElement.scrollHeight||0==document.body.scrollHeight?document.documentElement.scrollHeight||document.body.scrollHeight:document.documentElement.scrollHeight>document.body.scrollHeight?document.documentElement.scrollHeight:document.body.scrollHeight,t},setScrollTop(e){let t=!1,i=e.el;"string"==typeof i&&i&&(i=document.body.querySelector(i));let n=e.number||0,r=e.time||0;return this.isElement(i)&&i!=document.body&&i!=document.documentElement&&i!=window||(t=!0),new Promise(((e,s)=>{if(r<=0)t?document.documentElement.scrollTop=document.body.scrollTop=n:i.scrollTop=n,e();else{let s=10,a=o.divide(r,s),l=this.getScrollTop(i),d=o.divide(o.subtract(n,l),a),c=setInterval((()=>{a>0?(a--,t?document.documentElement.scrollTop=document.body.scrollTop=l=o.add(l,d):i.scrollTop=l=o.add(l,d)):(clearInterval(c),e())}),s)}}))},getScrollTop(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.body&&e!=document.documentElement&&e!=window?e.scrollTop:0==document.documentElement.scrollTop||0==document.body.scrollTop?document.documentElement.scrollTop||document.body.scrollTop:document.documentElement.scrollTop>document.body.scrollTop?document.documentElement.scrollTop:document.body.scrollTop,t},getScrollLeft(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.body&&e!=document.documentElement&&e!=window?e.scrollLeft:0==document.documentElement.scrollLeft||0==document.body.scrollLeft?document.documentElement.scrollLeft||document.body.scrollLeft:document.documentElement.scrollLeft>document.body.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,t},setScrollLeft(e){let t=!1,i=e.el;"string"==typeof i&&i&&(i=document.body.querySelector(i));let n=e.number||0,r=e.time||0;return this.isElement(i)&&i!=document.body&&i!=document.documentElement&&i!=window||(t=!0),new Promise(((e,s)=>{if(r<=0)t?document.documentElement.scrollLeft=document.body.scrollLeft=n:i.scrollLeft=n,e();else{let s=10,a=o.divide(r,s),l=this.getScrollLeft(i),d=o.divide(o.subtract(n,l),a),c=setInterval((()=>{a>0?(a--,t?document.documentElement.scrollLeft=document.body.scrollLeft=l=o.add(l,d):i.scrollLeft=l=o.add(l,d)):(clearInterval(c),e())}),s)}}))},getCssStyle(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i="";return i=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(e)[t]:e.currentStyle[t],i},getCssSelector(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a selector string");if(/^#{1}/.test(e))return{type:"id",value:e.substr(1)};if(/^\./.test(e))return{type:"class",value:e.substr(1)};if(/^\[(.+)\]$/.test(e)){let t="attribute",i="",n=r.trim(e,!0).substring(1,r.trim(e,!0).length-1).split("=");return 1==n.length&&(i=n[0]),2==n.length&&(i={attributeName:n[0],attributeValue:n[1].replace(/\'/g,"").replace(/\"/g,"")}),{type:t,value:i}}return{type:"tag",value:e}},getElementBounding(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.getBoundingClientRect();return{top:t.top,bottom:o.subtract(document.documentElement.clientHeight||window.innerHeight,t.bottom),left:t.left,right:o.subtract(document.documentElement.clientWidth||window.innerWidth,t.right)}},isElement:e=>e&&e instanceof Node&&1===e.nodeType,string2dom(e,t="div"){if(!e||"string"!=typeof e)throw new TypeError("The argument must be an HTML string");let i=document.createElement(t);return i.innerHTML=e,1==i.children.length?i.children[0]:Array.from(i.children)}},a="_dap-datas",l={remove(e,t){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=e[a]||{};null==t||""===t?e[a]={}:(delete i[t],e[a]=i)},has(e,t){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(null==t||""===t)throw new TypeError("The second parameter must be a unique key");return(e[a]||{}).hasOwnProperty(t)},get(e,t){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=e[a]||{};return null==t||""===t?i:i[t]},set(e,t,i){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(null==t||""===t)throw new TypeError("The second parameter must be a unique key");let n=e[a]||{};n[t]=i,e[a]=n}},d={matchingText(e,t){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=null;if("Chinese"==t&&(i=/^[\u4e00-\u9fa5]+$/),"chinese"==t&&(i=/[\u4e00-\u9fa5]/),"email"==t&&(i=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/),"username"==t&&(i=/^[a-zA-Z0-9_]{4,16}$/),"int+"==t&&(i=/^\d+$/),"int-"==t&&(i=/^-\d+$/),"int"==t&&(i=/^-?\d+$/),"pos"==t&&(i=/^\d*\.?\d+$/),"neg"==t&&(i=/^-\d*\.?\d+$/),"number"==t&&(i=/^-?\d*\.?\d+$/),"phone"==t&&(i=/^1[0-9]\d{9}$/),"idCard"==t&&(i=/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/),"url"==t&&(i=/^((https?|ftp|file):\/\/)?([\da-z\.-]+)\.([\da-z\.]{2,6})([\/\w \.-]*)*\/?$/),"IPv4"==t&&(i=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/),"hex"==t&&(i=/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/),"rgb"==t&&(i=/^rgb\((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\)$/),"rgba"==t&&(i=/^rgba\((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(0?\.\d|1(\.0)?|0)\)$/),"QQ"==t&&(i=/^[1-9][0-9]{4,10}$/),"weixin"==t&&(i=/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/),"plate"==t&&(i=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/),!i)throw new Error("The second parameter is out of scope");return i.test(e)},getUrlParams(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),i=window.location.search.substr(1);if(!i){let e=window.location.hash.split("?");2==e.length&&(i=e[1])}let n=i.match(t);return n?decodeURIComponent(n[2]):null},isEmptyObject(e){return!!this.isObject(e)&&0==Object.keys(e).length},equal(e,t){if(typeof e!=typeof t)return!1;if(this.isObject(e)&&this.isObject(t)){let i=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);if(i.length!=n.length)return!1;let o=i.length,r=!0;for(let s=0;s<o;s++){let n=i[s],o=e[n],a=t[n];if(!this.equal(o,a)){r=!1;break}}return r}return e===t},isObject:e=>!("object"!=typeof e||!e),copyText(e){if(!e||"string"!=typeof e)throw new TypeError("No text to copy is defined");if(!navigator.clipboard)throw new Error("navigator.clipboard must be obtained in a secure environment, such as localhost, 127.0.0.1, or https, so the method won't work");return navigator.clipboard.writeText(e)},clone(e){if(this.isObject(e)){if(Array.isArray(e))return e.map((e=>this.clone(e)));let t={};for(let i in e)t[i]=this.clone(e[i]);return t}return e}},c=e=>{let t=e.split(/[\s]+/g),i=[];return t.forEach((e=>{let t=e.split("."),n={eventName:t[0]};t.length>1&&(n.guid=t[1]),i.push(n)})),i},h=(e,t,i)=>{let n=l.get(e,"dap-defined-events")||{},o=Object.keys(n),r=o.length;for(let s=0;s<r;s++){let r=o[s];n[r].type==t&&(i?r==t+"."+i&&(e.removeEventListener(n[r].type,n[r].fn,n[r].options),n[r]=void 0):(e.removeEventListener(n[r].type,n[r].fn,n[r].options),n[r]=void 0))}n=(e=>{let t={};return Object.keys(e).forEach((i=>{e[i]&&(t[i]=e[i])})),t})(n),l.set(e,"dap-defined-events",n)},u={on(e,t,i,n){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");if(!i||"function"!=typeof i)throw new TypeError("The third argument must be a function");d.isObject(n)||(n={});c(t).forEach((t=>{((e,t,i,n,o)=>{let r=l.get(e,"dap-defined-events")||{};i||(i=l.get(e,"dap-event-guid")||0,l.set(e,"dap-event-guid",i+1)),r[i=t+"."+i]&&r[i].type==t&&e.removeEventListener(t,r[i].fn,r[i].options),e.addEventListener(t,n,o),r[i]={type:t,fn:n,options:o},l.set(e,"dap-defined-events",r)})(e,t.eventName,t.guid,i.bind(e),n)}))},off(e,t){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=l.get(e,"dap-defined-events");if(!i)return;if(!t){let t=Object.keys(i),n=t.length;for(let o=0;o<n;o++){let n=t[o];e.removeEventListener(i[n].type,i[n].fn,i[n].options)}return l.remove(e,"dap-defined-events"),void l.remove(e,"dap-event-guid")}c(t).forEach((t=>{h(e,t.eventName,t.guid)}))},get(e){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let t=l.get(e,"dap-defined-events");if(t)return t}},f={rgb2hsv(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=0,i=0,n=0,o=e[0]>=255?255:e[0],r=e[1]>=255?255:e[1],s=e[2]>=255?255:e[2];o=o<=0?0:o,r=r<=0?0:r,s=s<=0?0:s;let a=Math.max(o,r,s),l=Math.min(o,r,s);return n=a/255,i=0===a?0:1-l/a,a===l?t=0:a===o&&r>=s?t=(r-s)/(a-l)*60+0:a===o&&r<s?t=(r-s)/(a-l)*60+360:a===r?t=(s-o)/(a-l)*60+120:a===s&&(t=(o-r)/(a-l)*60+240),[t,100*i,100*n]},hsv2rgb(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=e[0]>=360||e[0]<=0?0:e[0],i=e[1]>=100?100:e[1];i=i<=0?0:i;let n=e[2]>=100?100:e[2];n=n<=0?0:n,i/=100,n/=100;let o=0,r=0,s=0,a=parseInt(t/60%6),l=t/60-a,d=n*(1-i),c=n*(1-l*i),h=n*(1-(1-l)*i);switch(a){case 0:o=n,r=h,s=d;break;case 1:o=c,r=n,s=d;break;case 2:o=d,r=n,s=h;break;case 3:o=d,r=c,s=n;break;case 4:o=h,r=d,s=n;break;case 5:o=n,r=d,s=c}return o=parseInt(255*o),r=parseInt(255*r),s=parseInt(255*s),[o,r,s]},rgb2hex(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+e[2]).toString(16).slice(1)},hex2rgb(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=e.toLowerCase();if(!d.matchingText(t,"hex"))throw new TypeError("The argument must be a hexadecimal color value");if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}let i=[];for(let n=1;n<7;n+=2)i.push(parseInt("0x"+t.slice(n,n+2)));return i}},g={getImageUrl(e){if(!(e&&e instanceof File))throw new TypeError("The argument must be a File object");return window.URL.createObjectURL(e)},dataFileToBase64:e=>new Promise(((t,i)=>{e&&e instanceof File||i(new TypeError("The argument must be a File object"));let n=new FileReader;n.readAsDataURL(e),n.onloadend=()=>{let e=n.result;t(e)}})),dataBase64toFile(e,t){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.split(","),n=i[0].match(/:(.*?);/)[1],o=atob(i[1]),r=o.length,s=new Uint8Array(r);for(;r--;)s[r]=o.charCodeAt(r);return new File([s],t,{type:n})},compressImage(e,t){const i={width:null,quality:.8,mimeType:"jpeg",maxSize:0,minSize:0};d.isObject(t)&&(o.isNumber(t.width)&&(i.width=t.width),o.isNumber(t.quality)&&t.quality>=0&&t.quality<=1&&(i.quality=t.quality),"jpeg"!=t.mimeType&&"webp"!=t.mimeType||(i.mimeType=t.mimeType),o.isNumber(t.maxSize)&&(i.maxSize=t.maxSize),o.isNumber(t.minSize)&&(i.minSize=t.minSize));const n=(e,t,o)=>{let r=e.toDataURL("image/"+i.mimeType,o),s=this.dataBase64toFile(r,t);if(i.maxSize>0&&s.size>1024*i.maxSize){o=o<=0?0:Number((o-.01).toFixed(2));const i=n(e,t,o);r=i.url,s=i.file,o=i.quality}return{file:s,url:r,quality:o}};return new Promise(((t,o)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>{let s=r.result,a=new Image;a.src=s,a.onload=()=>{if(i.minSize>0&&e.size<=1024*i.minSize)return void t({file:e,url:s,quality:1,width:a.width,height:a.height});let o=document.createElement("canvas"),r=o.getContext("2d");o.width=i.width||a.width,o.height=i.width?i.width/(a.width/a.height):a.height,r.drawImage(a,0,0,o.width,o.height);let l=e.name.lastIndexOf(".");const d=e.name.substring(0,l)+"."+i.mimeType;let c=n(o,d,i.quality);t({...c,width:o.width,height:o.height})},a.onerror=()=>{o(new Error("Failed to load image file"))}},r.onerror=()=>{o(new Error("Failed to load image file"))}}))}},m={start(e,t){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");let i={pitch:.8,rate:1,volume:1,start:function(){},end:function(){},pause:function(){},resume:function(){},error:function(){}};d.isObject(t)||(t={}),o.isNumber(t.pitch)&&(i.pitch=t.pitch),o.isNumber(t.rate)&&(i.rate=t.rate),o.isNumber(t.volume)&&(i.volume=t.volume),"function"==typeof t.start&&(i.start=t.start),"function"==typeof t.end&&(i.end=t.end),"function"==typeof t.pause&&(i.pause=t.pause),"function"==typeof t.resume&&(i.resume=t.resume),"function"==typeof t.error&&(i.error=t.error);const n=new SpeechSynthesisUtterance;n.text=e,n.pitch=i.pitch,n.rate=i.rate,n.volume=i.volume,n.lang="zh-CN",n.onstart=t=>{i.start.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onend=t=>{i.end.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onpause=t=>{i.pause.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onresume=t=>{i.resume.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onerror=t=>{i.error.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},window.speechSynthesis.speak(n)},stop(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.cancel()},pause(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.pause()},resume(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.resume()}},p={number:o,data:l,element:s,event:u,common:d,color:f,file:g,string:r,platform:{language:()=>window.navigator.browserLanguage||window.navigator.language,device(){const e=window.navigator.userAgent;return{PC:!e.match(/AppleWebKit.*Mobile.*/),Mobile:!!e.match(/AppleWebKit.*Mobile.*/),iPhone:e.includes("iPhone"),Phone:e.includes("Android")&&/(?:Mobile)/.test(e)||e.includes("iPhone")||/(?:Windows Phone)/.test(e),iPad:e.includes("iPad"),Tablet:e.includes("iPad")||e.includes("Android")&&!/(?:Mobile)/.test(e)||e.includes("Firefox")&&/(?:Tablet)/.test(e),WindowsPhone:/(?:Windows Phone)/.test(e)}},browser(){const e=window.navigator.userAgent;return{Edge:!!e.match(/Edg\/([\d.]+)/),weixin:e.includes("MicroMessenger"),QQ:e.includes("QQ"),QQBrowser:e.includes("MQQBrowser"),UC:e.includes("UCBrowser"),Chrome:e.includes("Chrome"),Firefox:e.includes("Firefox"),sougou:e.toLocaleLowerCase().includes("se 2.x")||e.toLocaleLowerCase().includes("metasr")||e.toLocaleLowerCase().includes("sogou"),Safari:e.includes("Safari")&&!e.includes("Chrome")}},browserKernel(){const e=window.navigator.userAgent;return e.includes("Presto")?"opera":e.includes("AppleWebKit")?"webkit":e.includes("Gecko")&&!e.includes("KHTML")?"gecko":""},os(){const e=window.navigator.userAgent;return{Windows:e.includes("Windows"),Windows_CPU:e.toLocaleLowerCase().includes("win64")||e.toLocaleLowerCase().includes("wow64")?"x64":e.toLocaleLowerCase().includes("win32")||e.toLocaleLowerCase().includes("wow32")?"x32":"",Windows_Version:e.includes("Windows NT 6.1")||e.includes("Windows 7")?"Win7":e.includes("Windows NT 6.3")||e.includes("Windows NT 6.2")||e.includes("Windows NT 8")?"Win8":e.includes("Windows NT 10")||e.includes("Windows NT 6.4")?"Win10":"",Mac:e.includes("Macintosh"),Mac_Version:function(){if(e.includes("Macintosh")){const t=e.match(/Mac OS X ([^\s]+)\)/);if(t&&t[1])return t[1].split(/_|\./).join(".")}return""}(),ios:!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),ios_Version:function(){if(e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)){const t=e.match(/CPU.+OS ([^\s]+) like Mac OS X/);if(t&&t[1])return t[1].split(/_|\./).join(".")}return""}(),Android:e.includes("Android"),Android_Version:function(){const t=e.match(/Android ([^\s]+);/);return t&&t[1]?t[1].split(/_|\./).join("."):""}(),Linux:e.includes("Linux"),HarmonyOS:e.includes("HarmonyOS"),Ubuntu:e.includes("Ubuntu")}}},speech:m},b=e=>/^[\uFEFF]+$/g.test(e),y=e=>p.common.isObject(e)||Array.isArray(e)?JSON.parse(JSON.stringify(e)):e,w=(e,t)=>3==t.nodeType?p.element.isContains(e,t.parentNode):p.element.isContains(e,t),E=e=>new Promise((t=>{const i=new FileReader;i.onload=e=>{t(e.target.result)},i.readAsDataURL(e)})),C=(e,t,i)=>{if(null==i||null==i)return e.hasOwnProperty(t);let n=e[t];if(null==n||null==n)return!1;if("string"==typeof i&&(i=i.toLocaleLowerCase()),"string"==typeof n&&(n=n.toLocaleLowerCase()),"string"==typeof i&&i&&(p.common.matchingText(i,"rgb")||p.common.matchingText(i,"rgba"))&&(i=p.string.trim(i,!0)),"string"==typeof n&&n&&(p.common.matchingText(n,"rgb")||p.common.matchingText(n,"rgba"))&&(n=p.string.trim(n,!0)),"string"==typeof i&&i&&p.common.matchingText(i,"hex")){const e=p.color.hex2rgb(i);i=`rgb(${e[0]},${e[1]},${e[2]})`}if("string"==typeof n&&n&&p.common.matchingText(n,"hex")){const e=p.color.hex2rgb(n);n=`rgb(${e[0]},${e[1]},${e[2]})`}return n==i},v=class e{constructor(e,t,i,n,o){this.key=(()=>{let e=p.data.get(window,"data-alex-editor-key")||0;return e++,p.data.set(window,"data-alex-editor-key",e),e})(),this.type=e,this.parsedom=t,this.marks=i,this.styles=n,this.textContent=o,this.children=null,this.parent=null,this.behavior="default",this.elm=null}isBlock(){return"block"==this.type}isInblock(){return"inblock"==this.type}isInline(){return"inline"==this.type}isClosed(){return"closed"==this.type}isText(){return"text"==this.type}isBreak(){return this.isClosed()&&"br"==this.parsedom}isEmpty(){if(this.isText())return!this.textContent;if(this.isBlock()||this.isInblock()||this.isInline()){if(!this.hasChildren())return!0;return this.children.every((e=>!e||e.isEmpty()))}return!1}isSpaceText(){return this.isText()&&!this.isEmpty()&&b(this.textContent)}getUneditableElement(){return this.hasMarks()&&"false"==this.marks.contenteditable?this:this.isBlock()?null:this.parent.getUneditableElement()}isEqual(t){return!!e.isElement(t)&&this.key==t.key}isContains(e){return!!this.isEqual(e)||!e.isBlock()&&this.isContains(e.parent)}isOnlyHasBreak(){return!!this.hasChildren()&&this.children.every((e=>e.isBreak()||e.isEmpty()))}isPreStyle(){const e=this.getBlock(),t=this.getInblock();return t?"pre"==t.parsedom||(!(!t.hasStyles()||"pre"!=t.styles["white-space"]&&"pre-wrap"!=t.styles["white-space"])||t.parent.isPreStyle()):"pre"==e.parsedom||!(!e.hasStyles()||"pre"!=e.styles["white-space"]&&"pre-wrap"!=e.styles["white-space"])}hasMarks(){return!!this.marks&&(!!p.common.isObject&&!p.common.isEmptyObject(this.marks))}hasStyles(){return!!this.styles&&(!!p.common.isObject(this.styles)&&!p.common.isEmptyObject(this.styles))}hasChildren(){return!this.isClosed()&&!this.isText()&&(!!Array.isArray(this.children)&&!!this.children.length)}hasContains(e){return this.isContains(e)||e.isContains(this)}clone(t=!0){if("boolean"!=typeof t)throw new Error("The parameter must be a Boolean");let i=new e(this.type,this.parsedom,y(this.marks),y(this.styles),this.textContent);return i.behavior=this.behavior,t&&this.hasChildren()&&this.children.forEach((e=>{let n=e.clone(t);i.hasChildren()?i.children.push(n):i.children=[n],n.parent=i})),i}convertToBlock(){if(this.isBlock())return;let t=this.clone();this.type="block",this.parsedom=e.BLOCK_NODE,this.marks=null,this.styles=null,this.textContent=null,this.children=[t],t.parent=this}toEmpty(){if(!this.isEmpty())return this.isText()?(this.marks=null,this.styles=null,this.textContent=null,void(this.elm=null)):this.isClosed()?(this.type="text",this.parsedom=null,this.marks=null,this.styles=null,this.textContent=null,void(this.elm=null)):void(this.hasChildren()&&this.children.forEach((e=>{e.toEmpty()})))}getBlock(){return this.isBlock()?this:this.parent.getBlock()}getInblock(){return this.isInblock()?this:this.isBlock()?null:this.parent.getInblock()}getInline(){return this.isInline()?this:this.isBlock()?null:this.parent.getInline()}isEqualStyles(e){return!this.hasStyles()&&!e.hasStyles()||!!(this.hasStyles()&&e.hasStyles()&&p.common.equal(this.styles,e.styles))}isEqualMarks(e){return!this.hasMarks()&&!e.hasMarks()||!!(this.hasMarks()&&e.hasMarks()&&p.common.equal(this.marks,e.marks))}__render(){let t=null;if(this.isText()){t=document.createElement(e.TEXT_NODE);const i=document.createTextNode(this.textContent);t.appendChild(i)}else t=document.createElement(this.parsedom),this.hasChildren()&&this.children.forEach((e=>{e.__render(),t.appendChild(e.elm)}));this.hasMarks()&&Object.keys(this.marks).forEach((e=>{/(^on)|(^style$)|(^face$)/g.test(e)||t.setAttribute(e,this.marks[e])})),this.hasStyles()&&Object.keys(this.styles).forEach((e=>{t.style.setProperty(e,this.styles[e])})),p.data.set(t,"data-alex-editor-key",this.key),this.elm=t}__fullClone(){let t=new e(this.type,this.parsedom,y(this.marks),y(this.styles),this.textContent);return t.behavior=this.behavior,t.key=this.key,t.elm=this.elm,this.hasChildren()&&this.children.forEach((e=>{let i=e.__fullClone();t.hasChildren()?t.children.push(i):t.children=[i],i.parent=t})),t}static isElement(t){return t instanceof e}static flatElements(e){const t=e=>{let i=[],n=0;const o=e.length;for(;n<o;)i.push(e[n]),e[n].hasChildren()&&i.push(...t(e[n].children)),n++;return i};return t(e)}static getSpaceElement(){return new e("text",null,null,null,"\ufeff")}};n(v,"BLOCK_NODE","p"),n(v,"TEXT_NODE","span"),n(v,"VOID_NODES",["colgroup","col"]);let k=v;class ${constructor(e,t){this.anchor=e,this.focus=t}}class x{constructor(e,t){if(this.element=e,this.offset=t,this.element.isText()||this.element.isClosed()){if(k.VOID_NODES.includes(this.element.parsedom))throw new Error("Invisible element cannot be set as focal point")}else 0==this.offset?this.moveToStart(this.element):this.moveToEnd(this.element)}static isPoint(e){return e instanceof x}isEqual(e){return!!x.isPoint(e)&&(this.element.isEqual(e.element)&&this.offset==e.offset)}moveToEnd(e){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(e.isEmpty())throw new Error("The argument cannot be an empty element");if(e.isText())this.element=e,this.offset=e.textContent.length;else if(e.isClosed()){if(k.VOID_NODES.includes(e.parsedom))throw new Error("Invisible element cannot be set as focal point");this.element=e,this.offset=1}else if(e.hasChildren()){const t=k.flatElements(e.children).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom))),i=t.length;if(0==i)throw new Error("There is no element to set the focus");this.moveToEnd(t[i-1])}}moveToStart(e){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(e.isEmpty())throw new Error("The argument cannot be an empty element");if(e.isText())this.element=e,this.offset=0;else if(e.isClosed()){if(k.VOID_NODES.includes(e.parsedom))throw new Error("Invisible element cannot be set as focal point");this.element=e,this.offset=0}else if(e.hasChildren()){const t=k.flatElements(e.children).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom)));if(0==t.length)throw new Error("There is no element to set the focus");this.moveToStart(t[0])}}}class T{constructor(){this.records=[],this.current=-1}push(e,t){this.current<this.records.length-1&&(this.records.length=this.current+1);const i=e.map((e=>e.__fullClone())),n=this.__cloneRange(i,t);this.records.push({stack:i,range:n}),this.current+=1}get(e){let t=this.current;if(-1==e){if(t<=0)return null;t-=1}else if(1==e){if(t>=this.records.length-1)return null;t+=1}const{stack:i,range:n}=this.records[t],o=i.map((e=>e.__fullClone()));return{current:t,stack:o,range:this.__cloneRange(o,n)}}updateCurrentRange(e){const t=this.records[this.current],i=this.__cloneRange(t.stack,e);this.records[this.current].range=i}__cloneRange(e,t){if(t){const i=k.flatElements(e).find((e=>e.key==t.anchor.element.key)),n=k.flatElements(e).find((e=>e.key==t.focus.element.key)),o=new x(i,t.anchor.offset),r=new x(n,t.focus.offset);return new $(o,r)}return null}}const B=[{parsedom:"p"},{parsedom:"div"},{parsedom:"table"},{parsedom:"ul"},{parsedom:"ol"},{parsedom:"h1"},{parsedom:"h2"},{parsedom:"h3"},{parsedom:"h4"},{parsedom:"h5"},{parsedom:"h6"},{parsedom:"blockquote"},{parsedom:"pre"},{parsedom:"address",parse:!0},{parsedom:"article",parse:!0},{parsedom:"aside",parse:!0},{parsedom:"nav",parse:!0},{parsedom:"section",parse:!0}],S=[{parsedom:"br"},{parsedom:"col"},{parsedom:"img"},{parsedom:"hr"},{parsedom:"video"},{parsedom:"audio"}],_=[{parsedom:"li",block:!0},{parsedom:"tfoot"},{parsedom:"tbody"},{parsedom:"thead"},{parsedom:"tr"},{parsedom:"th"},{parsedom:"td"},{parsedom:"colgroup"}],N=[{parsedom:"span"},{parsedom:"a"},{parsedom:"label"},{parsedom:"code"},{parsedom:"b",parse:{"font-weight":"bold"}},{parsedom:"strong",parse:{"font-weight":"bold"}},{parsedom:"sup",parse:{"vertical-align":"super"}},{parsedom:"sub",parse:{"vertical-align":"sub"}},{parsedom:"i",parse:{"font-style":"italic"}},{parsedom:"u",parse:{"text-decoration-line":"underline"}},{parsedom:"del",parse:{"text-decoration-line":"line-through"}},{parsedom:"abbr",parse:!0},{parsedom:"acronym",parse:!0},{parsedom:"bdo",parse:!0},{parsedom:"font",parse:!0,parse:{"font-family":function(e){return e.getAttribute("face")||""}}}],O=function(e){if(e.hasChildren()){e.children.filter((e=>!e.isEmpty())).filter((e=>e.isBlock())).forEach((t=>{t.type="inline"==e.type?"inline":"inblock"}))}},A=function(e){if(e.hasChildren()){const t=e.children.filter((e=>!e.isEmpty()));t.every((e=>e.isInblock()))||t.forEach((e=>{e.isInblock()&&(e.type="inline")}))}},I=function(e){if(e.isInline()&&e.hasChildren()){e.children.filter((e=>!e.isEmpty())).filter((e=>e.isInblock())).forEach((e=>{e.isInblock()&&(e.type="inline")}))}},R=function(e){if(e.hasChildren()){const t=e.children.filter((e=>!e.isEmpty()));if(t.every((e=>e.isBreak()))&&t.length){const i=t[0];this.range&&e.isContains(this.range.anchor.element)&&this.range.anchor.moveToStart(i),this.range&&e.isContains(this.range.focus.element)&&this.range.focus.moveToStart(i),e.children=[i]}else e.children.forEach((e=>{e.isBreak()&&e.toEmpty()}))}},L=function(e){const t=(e,t)=>{if(e.isEmpty()||t.isEmpty()){if(t.isEmpty()){this.range&&t.isContains(this.range.anchor.element)&&(e.isEmpty()?(this.range.anchor.element=e,this.range.anchor.offset=0):this.range.anchor.moveToEnd(e)),this.range&&t.isContains(this.range.focus.element)&&(e.isEmpty()?(this.range.focus.element=e,this.range.focus.offset=0):this.range.focus.moveToEnd(e));const i=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(i,1)}else if(e.isEmpty()){this.range&&e.isContains(this.range.anchor.element)&&(t.isEmpty()?(this.range.anchor.element=t,this.range.anchor.offset=0):this.range.anchor.moveToStart(t)),this.range&&e.isContains(this.range.focus.element)&&(t.isEmpty()?(this.range.focus.element=t,this.range.focus.offset=0):this.range.focus.moveToStart(t));const i=e.parent.children.findIndex((t=>e.isEqual(t)));e.parent.children.splice(i,1)}}else if(e.isText()){this.range&&t.isEqual(this.range.anchor.element)&&(this.range.anchor.element=e,this.range.anchor.offset=e.textContent.length+this.range.anchor.offset),this.range&&t.isEqual(this.range.focus.element)&&(this.range.focus.element=e,this.range.focus.offset=e.textContent.length+this.range.focus.offset),e.textContent+=t.textContent;const i=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(i,1)}else if(e.isInline()){e.children.push(...t.children),e.children.forEach((t=>{t.parent=e})),i(e);const n=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(n,1)}},i=e=>{if(e.hasChildren()&&e.children.length>1){let o=0;for(;o<=e.children.length-2;)i=e.children[o],n=e.children[o+1],i.isEmpty()||n.isEmpty()||(i.isText()&&n.isText()?i.isEqualStyles(n)&&i.isEqualMarks(n):i.isInline()&&n.isInline()&&i.parsedom==n.parsedom&&i.isEqualMarks(n)&&i.isEqualStyles(n))?t(e.children[o],e.children[o+1]):o++}var i,n};i(e)},M=function(e){const t=(e,t)=>{t.isText()?(e.type="text",e.parsedom=null,t.hasMarks()&&(e.hasMarks()?Object.assign(e.marks,y(t.marks)):e.marks=y(t.marks)),t.hasStyles()&&(e.hasStyles()?Object.assign(e.styles,y(t.styles)):e.styles=y(t.styles)),e.textContent=t.textContent,e.children=null,this.range&&t.isContains(this.range.anchor.element)&&(this.range.anchor.element=e),this.range&&t.isContains(this.range.focus.element)&&(this.range.focus.element=e)):(t.hasMarks()&&(e.hasMarks()?Object.assign(e.marks,y(t.marks)):e.marks=y(t.marks)),t.hasStyles()&&(e.hasStyles()?Object.assign(e.styles,y(t.styles)):e.styles=y(t.styles)),t.hasChildren()&&(e.children=[...t.children],e.children.forEach((t=>{t.parent=e}))))};var i,n;e.hasChildren()&&1==e.children.length&&(i=e,(n=e.children[0]).isText()&&i.isInline()?i.parsedom==k.TEXT_NODE:(i.isInline()&&n.isInline()||i.isInblock()&&n.isInblock())&&i.parsedom==n.parsedom)&&t(e,e.children[0])},{Mac:P}=p.platform.os(),F=function(){if(0==k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom))).length){const e=new k("block",k.BLOCK_NODE,null,null,null),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.stack=[e]}},D=function(e){const t=this.getPreviousElementOfPoint(e),i=this.getNextElementOfPoint(e),n=e.element.getBlock(),o=e.element.getInblock();t&&o&&o.isContains(t)?e.moveToEnd(t):i&&o&&o.isContains(i)?e.moveToStart(i):t&&n.isContains(t)?e.moveToEnd(t):i&&n.isContains(i)?e.moveToStart(i):t?e.moveToEnd(t):i&&e.moveToStart(i)},z=function(e){e.isInblock()&&"default"==e.behavior&&e.hasChildren()&&e.children.forEach((e=>{if(e.isInblock())z.apply(this,[e]);else if(e.toEmpty(),e.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.parent)}}))},H=function(){const e=async e=>{const t=p.element.getScrollHeight(e);if(e.clientHeight<t){const t=window.getSelection();if(0==t.rangeCount)return;const i=t.getRangeAt(0),n=i.getClientRects();let o=i;0==n.length&&(o=this.range.focus.element.elm);const r=o.getBoundingClientRect(),s=e.getBoundingClientRect();if(r.top<s.top){await p.element.setScrollTop({el:e,number:0});const t=o.getBoundingClientRect(),i=e.getBoundingClientRect();p.element.setScrollTop({el:e,number:t.top-i.top-2*t.height})}else if(r.bottom>s.bottom){await p.element.setScrollTop({el:e,number:0});const t=o.getBoundingClientRect(),i=e.getBoundingClientRect();p.element.setScrollTop({el:e,number:t.bottom-i.bottom+2*t.height})}}};let t=this.$el;for(;p.element.isElement(t)&&t!=document.documentElement;)e(t),t=t.parentNode},V=function(){if(0==k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom))).length){const e=new k("block",k.BLOCK_NODE,null,null,null),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.stack=[e],this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t)}},W=function(){if(this.__isInputChinese)return;if(this.__innerSelectionChange)return;const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0);if(w(this.$el,t.startContainer)&&w(this.$el,t.endContainer)){let e=null,i=null,n=null,o=null;if(3==t.startContainer.nodeType)e=t.startContainer.parentNode,n=t.startOffset;else if(1==t.startContainer.nodeType){const i=Array.from(t.startContainer.childNodes);i.length?(e=i[t.startOffset]?i[t.startOffset]:i[t.startOffset-1],n=i[t.startOffset]?0:1,3==e.nodeType&&(n=0==n?0:e.textContent.length,e=e.parentNode)):(e=t.startContainer,n=0)}if(3==t.endContainer.nodeType)i=t.endContainer.parentNode,o=t.endOffset;else if(1==t.endContainer.nodeType){const e=Array.from(t.endContainer.childNodes);e.length?(i=e[t.endOffset]?e[t.endOffset]:e[t.endOffset-1],o=e[t.endOffset]?0:1,3==i.nodeType&&(o=0==o?0:i.textContent.length,i=i.parentNode)):(i=t.endContainer,o=1)}const r=p.data.get(e,"data-alex-editor-key"),s=p.data.get(i,"data-alex-editor-key"),a=this.getElementByKey(r),l=this.getElementByKey(s),d=new x(a,n),c=new x(l,o);this.range?(this.range.anchor=d,this.range.focus=c):this.range=new $(d,c),this.emit("rangeUpdate",this.range)}}},j=function(e){this.disabled||"deleteByCut"!=e.inputType&&"insertFromPaste"!=e.inputType&&"deleteByDrag"!=e.inputType&&"insertFromDrop"!=e.inputType&&(e.preventDefault(),"insertText"==e.inputType&&e.data?(this.insertText(e.data),this.formatElementStack(),this.domRender(),this.rangeRender()):"insertParagraph"==e.inputType||"insertLineBreak"==e.inputType?(this.insertParagraph(),this.formatElementStack(),this.domRender(),this.rangeRender()):"deleteContentBackward"==e.inputType&&(this.delete(),this.formatElementStack(),this.domRender(),this.rangeRender()))},U=function(e){this.disabled||(e.preventDefault(),"compositionstart"==e.type?(this.__chineseInputTimer&&(clearTimeout(this.__chineseInputTimer),this.__chineseInputTimer=null),this.__isInputChinese=!0):"compositionend"==e.type&&(e.data&&(this.insertText(e.data),this.formatElementStack(),this.domRender(),this.rangeRender()),this.__chineseInputTimer=setTimeout((()=>{this.__isInputChinese=!1}),0)))},q=function(e){if(!this.disabled&&!this.__isInputChinese)if(function(e){return P?90==e.keyCode&&e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:90==e.keyCode&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}(e)){e.preventDefault();const t=this.history.get(-1);t&&(this.history.current=t.current,this.stack=t.stack,this.range=t.range,this.formatElementStack(),this.domRender(!0),this.rangeRender())}else if(function(e){return P?90==e.keyCode&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey:89==e.keyCode&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}(e)){e.preventDefault();const t=this.history.get(1);t&&(this.history.current=t.current,this.stack=t.stack,this.range=t.range,this.formatElementStack(),this.domRender(!0),this.rangeRender())}},K=async function(e){e.preventDefault(),await this.copy()},Z=async function(e){e.preventDefault();await this.cut()&&!this.disabled&&(this.formatElementStack(),this.domRender(),this.rangeRender())},G=async function(e){e.preventDefault(),this.disabled||(await this.paste(),this.formatElementStack(),this.domRender(),this.rangeRender())},X=function(e){e.preventDefault()},Q=function(e){this.disabled||this.emit("focus",this.value)},J=function(e){this.disabled||this.emit("blur",this.value)};class Y{constructor(e,t){this.$el=(e=>{if("string"==typeof e&&e&&(e=document.body.querySelector(e)),!p.element.isElement(e))throw new Error("You must specify a dom container to initialize the editor");if(p.data.get(e,"data-alex-editor-init"))throw new Error("The element node has been initialized to the editor");return p.data.set(e,"data-alex-editor-init",!0),e})(e);const i=(e=>{let t={disabled:!1,renderRules:[],value:"",allowCopy:!0,allowPaste:!0,allowCut:!0,allowPasteHtml:!1,customTextPaste:null,customHtmlPaste:null,customImagePaste:null,customVideoPaste:null,customMerge:null};return p.common.isObject(e)&&("boolean"==typeof e.disabled&&(t.disabled=e.disabled),Array.isArray(e.renderRules)&&(t.renderRules=e.renderRules),"string"==typeof e.value&&e.value&&(t.value=e.value),"boolean"==typeof e.allowCopy&&(t.allowCopy=e.allowCopy),"boolean"==typeof e.allowPaste&&(t.allowPaste=e.allowPaste),"boolean"==typeof e.allowCut&&(t.allowCut=e.allowCut),"boolean"==typeof e.allowPasteHtml&&(t.allowPasteHtml=e.allowPasteHtml),"function"==typeof e.customTextPaste&&(t.customTextPaste=e.customTextPaste),"function"==typeof e.customHtmlPaste&&(t.customHtmlPaste=e.customHtmlPaste),"function"==typeof e.customImagePaste&&(t.customImagePaste=e.customImagePaste),"function"==typeof e.customVideoPaste&&(t.customVideoPaste=e.customVideoPaste),"function"==typeof e.customMerge&&(t.customMerge=e.customMerge)),t})(t);this.disabled=i.disabled,this.value=i.value,this.renderRules=i.renderRules,this.allowCopy=i.allowCopy,this.allowPaste=i.allowPaste,this.allowCut=i.allowCut,this.allowPasteHtml=i.allowPasteHtml,this.customTextPaste=i.customTextPaste,this.customHtmlPaste=i.customHtmlPaste,this.customImagePaste=i.customImagePaste,this.customVideoPaste=i.customVideoPaste,this.customMerge=i.customMerge,this.useClipboard=window.ClipboardItem?!!navigator.clipboard||(console.warn("navigator.clipboard must be obtained in a secure environment, such as localhost, 127.0.0.1, or https, so the editor's copy, paste, and cut functions cannot be used"),!1):(console.warn("window.ClipboardItem must be obtained in a secure environment, such as localhost, 127.0.0.1, or https, so the editor's copy, paste, and cut functions cannot be used"),!1),this.history=new T,this.stack=this.parseHtml(this.value),this.range=null,F.apply(this),this.__guid=(()=>{let e=p.data.get(window,"data-alex-editor-guid")||0;return e++,p.data.set(window,"data-alex-editor-guid",e),e})(),this.__events={},this.__firstRender=!0,this.__isInputChinese=!1,this.__innerSelectionChange=!1,this.__chineseInputTimer=null,this.__dataCaches={},this.disabled?this.setDisabled():this.setEnabled(),p.event.on(document,`selectionchange.alex_editor_${this.__guid}`,W.bind(this)),p.event.on(this.$el,"beforeinput.alex_editor",j.bind(this)),p.event.on(this.$el,"compositionstart.alex_editor compositionupdate.alex_editor compositionend.alex_editor",U.bind(this)),p.event.on(this.$el,"keydown.alex_editor",q.bind(this)),p.event.on(this.$el,"cut.alex_editor",Z.bind(this)),p.event.on(this.$el,"paste.alex_editor",G.bind(this)),p.event.on(this.$el,"copy.alex_editor",K.bind(this)),p.event.on(this.$el,"dragstart.alex_editor drop.alex_editor ",X.bind(this)),p.event.on(this.$el,"focus.alex_editor",Q.bind(this)),p.event.on(this.$el,"blur.alex_editor",J.bind(this))}initRange(){const e=k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom)))[0],t=new x(e,0),i=new x(e,0);this.range=new $(t,i)}async paste(){if(this.disabled)return;if(!this.range)return;if(!this.useClipboard)return;if(!this.allowPaste)return;const e=(await navigator.clipboard.read())[0],t=[];e.types.forEach((i=>{t.push(e.getType(i))}));const i=await Promise.all(t),n=i.length;if(i.some((e=>"text/html"==e.type)))for(let o=0;o<n;o++){const e=i[o];if("text/plain"!=e.type||this.allowPasteHtml){if("text/html"==e.type&&this.allowPasteHtml){const t=await e.text();if(t){const e=this.parseHtml(t).filter((e=>!e.isEmpty()));if("function"==typeof this.customHtmlPaste)await this.customHtmlPaste.apply(this,[e,t]);else{for(let t=0;t<e.length;t++)this.formatElement(e[t]),this.insertElement(e[t],!1);this.emit("pasteHtml",e,t)}}}}else{const t=await e.text();t&&("function"==typeof this.customTextPaste?await this.customTextPaste.apply(this,[t]):(this.insertText(t),this.emit("pasteText",t)))}}else for(let o=0;o<n;o++){const e=i[o];if(e.type.startsWith("image/")){const t=await E(e);if("function"==typeof this.customImagePaste)await this.customImagePaste.apply(this,[t]);else{const e=new k("closed","img",{src:t},null,null);this.insertElement(e),this.emit("pasteImage",t)}}else if(e.type.startsWith("video/")){const t=await E(e);if("function"==typeof this.customVideoPaste)await this.customVideoPaste.apply(this,[t]);else{const e=new k("closed","video",{src:t},null,null);this.insertElement(e),this.emit("pasteVideo",t)}}else if("text/plain"==e.type){const t=await e.text();t&&("function"==typeof this.customTextPaste?await this.customTextPaste.apply(this,[t]):(this.insertText(t),this.emit("pasteText",t)))}}}async cut(){if(!this.useClipboard)return;if(!this.range)return;if(!this.allowCut)return;const e=await this.copy(!0);return e&&(this.disabled||this.delete(),this.emit("cut",e.text,e.html)),e}async copy(e=!1){if(!this.useClipboard)return;if(!this.range)return;if(!this.allowCopy)return;let t=this.getElementsByRange(!0,!1);if(0==t.length)return;let i="",n="";t.forEach((e=>{const t=e.element.clone();e.offset&&(t.textContent=t.textContent.substring(e.offset[0],e.offset[1])),t.__render(),i+=t.elm.outerHTML,n+=t.elm.innerText}));const o=new window.ClipboardItem({"text/html":new Blob([i],{type:"text/html"}),"text/plain":new Blob([n],{type:"text/plain"})});return await navigator.clipboard.write([o]),e||this.emit("copy",n,i),{text:n,html:i}}delete(){if(!this.disabled&&this.range){if(this.range.anchor.isEqual(this.range.focus)){const e=this.getPreviousElementOfPoint(this.range.anchor),t=this.range.anchor.element.getBlock(),i=this.range.anchor.element.getInblock();if(i)if(0==this.range.anchor.offset)if(e){if(i.isContains(e))return this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),void this.delete();if("block"==i.behavior){const t=e.getBlock(),n=e.getInblock();n?"block"==n.behavior&&this.merge(i,n):this.merge(i,t)}}else this.emit("deleteInStart",i);else if(this.range.anchor.element.isSpaceText()){if(this.range.anchor.element.toEmpty(),!i.isEmpty())return this.range.anchor.offset=0,this.range.focus.offset=0,void this.delete();{const e=new k("closed","br",null,null,null);this.addElementTo(e,i),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else if(this.range.anchor.element.isText()){const e=this.range.anchor.element.textContent;this.range.anchor.offset-=1;const t=b(e[this.range.anchor.offset]);if(this.range.anchor.element.textContent=e.substring(0,this.range.anchor.offset)+e.substring(this.range.focus.offset),this.range.focus.offset=this.range.anchor.offset,t)return void this.delete();if(i.isEmpty()){const e=new k("closed","br",null,null,null);this.addElementTo(e,i),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const t=this.range.anchor.element.isBreak();if(this.range.anchor.element.toEmpty(),i.isEmpty())if(t&&"default"!=i.behavior){if(!e){const e=new k("closed","br",null,null,null);this.addElementTo(e,i),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const e=new k("closed","br",null,null,null);this.addElementTo(e,i),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else if(0==this.range.anchor.offset)if(e){if(t.isContains(e))return this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),void this.delete();{const i=e.getInblock(),n=e.getBlock();i?"block"==i.behavior&&this.merge(t,i):this.merge(t,n)}}else this.emit("deleteInStart",t);else if(this.range.anchor.element.isSpaceText()){if(this.range.anchor.element.toEmpty(),!t.isEmpty())return this.range.anchor.offset=0,this.range.focus.offset=0,void this.delete();{const e=new k("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else if(this.range.anchor.element.isText()){const e=this.range.anchor.element.textContent;this.range.anchor.offset-=1;const i=b(e[this.range.anchor.offset]);if(this.range.anchor.element.textContent=e.substring(0,this.range.anchor.offset)+e.substring(this.range.focus.offset),this.range.focus.offset=this.range.anchor.offset,i)return void this.delete();if(t.isEmpty()){const e=new k("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const i=this.range.anchor.element.isBreak();if(this.range.anchor.element.toEmpty(),t.isEmpty()&&(!i||!e)){const e=new k("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}}else{const e=this.getElementsByRange(!0,!1).filter((e=>!k.VOID_NODES.includes(e.element.parsedom))),t=this.range.anchor.element.getInblock(),i=this.range.focus.element.getInblock(),n=this.range.anchor.element.getBlock(),o=this.range.focus.element.getBlock();t&&i&&t.isEqual(i)?e.forEach((e=>{if(e.offset?e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]):e.element.toEmpty(),t.isEmpty()){const e=new k("closed","br",null,null,null);this.addElementTo(e,t)}})):t&&i?(e.forEach((e=>{if(e.offset)e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]);else if(e.element.isInblock()&&"default"==e.element.behavior)z.apply(this,[e.element]);else if(e.element.toEmpty(),e.element.parent&&(e.element.parent.isInblock()||e.element.parent.isBlock())&&e.element.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==t.behavior&&"block"==i.behavior&&this.merge(i,t)):t?(e.forEach((e=>{if(e.offset)e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]);else if(e.element.isInblock()&&"default"==e.element.behavior)z.apply(this,[e.element]);else if(e.element.toEmpty(),e.element.parent&&(e.element.parent.isInblock()||e.element.parent.isBlock())&&e.element.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==t.behavior&&this.merge(o,t)):i?(e.forEach((e=>{if(e.offset)e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]);else if(e.element.isInblock()&&"default"==e.element.behavior)z.apply(this,[e.element]);else if(e.element.toEmpty(),e.element.parent&&(e.element.parent.isInblock()||e.element.parent.isBlock())&&e.element.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==i.behavior&&this.merge(i,n)):n.isEqual(o)?e.forEach((e=>{if(e.offset?e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]):e.element.toEmpty(),n.isEmpty()){const e=new k("closed","br",null,null,null);this.addElementTo(e,n)}})):(e.forEach((e=>{if(e.offset)e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]);else if(e.element.isInblock()&&"default"==e.element.behavior)z.apply(this,[e.element]);else if(e.element.toEmpty(),e.element.parent&&(e.element.parent.isInblock()||e.element.parent.isBlock())&&e.element.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),this.merge(o,n))}this.range.anchor.element.isEmpty()&&D.apply(this,[this.range.anchor]),this.range.focus.element=this.range.anchor.element,this.range.focus.offset=this.range.anchor.offset,V.apply(this),this.emit("deleteComplete")}}insertText(e){if(!this.disabled){if(!e||"string"!=typeof e)throw new Error("The argument must be a string");if(this.range)if(this.range.anchor.isEqual(this.range.focus))if(this.range.anchor.element.isPreStyle()||(e=e.replace(/\s/g,(()=>{const e=document.createElement("span");return e.innerHTML="&nbsp;",e.innerText}))),this.range.anchor.element.isText()){let t=this.range.anchor.element.textContent;this.range.anchor.element.textContent=t.substring(0,this.range.anchor.offset)+e+t.substring(this.range.anchor.offset),this.range.anchor.offset=this.range.anchor.offset+e.length,this.range.focus.offset=this.range.anchor.offset}else{const t=new k("text",null,null,null,e);0==this.range.anchor.offset?this.addElementBefore(t,this.range.anchor.element):this.addElementAfter(t,this.range.anchor.element),this.range.anchor.moveToEnd(t),this.range.focus.moveToEnd(t)}else this.delete(),this.insertText(e)}}insertParagraph(){if(!this.disabled&&this.range)if(this.range.anchor.isEqual(this.range.focus)){const e=this.getPreviousElementOfPoint(this.range.anchor),t=this.getNextElementOfPoint(this.range.anchor),i=this.range.anchor.element.getBlock(),n=this.range.anchor.element.getInblock(),o=this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1;if(n){if(this.range.anchor.element.isPreStyle()){this.insertText("\n");const e=k.getSpaceElement();this.insertElement(e),this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),this.emit("insertParagraph",null,n)}else if("block"==n.behavior)if(0!=this.range.anchor.offset||e&&n.isContains(e))if(this.range.anchor.offset!=o||t&&n.isContains(t)){const e=n.clone();this.addElementAfter(e,n);const t=k.flatElements(n.children).findIndex((e=>this.range.anchor.element.isEqual(e)));this.range.focus.moveToEnd(n),this.delete();const i=k.flatElements(e.children);this.range.focus.element=i[t],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(e),this.delete(),this.emit("insertParagraph",e,n)}else{const e=n.clone(!1),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.addElementAfter(e,n),this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t),this.emit("insertParagraph",e,n)}else{const e=n.clone(!1),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.addElementBefore(e,n),this.emit("insertParagraph",n,e)}}else if(this.range.anchor.element.isPreStyle()){this.insertText("\n");const e=k.getSpaceElement();this.insertElement(e),this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),this.emit("insertParagraph",null,i)}else if(0!=this.range.anchor.offset||e&&i.isContains(e))if(this.range.anchor.offset!=o||t&&i.isContains(t)){const e=i.clone();this.addElementAfter(e,i);const t=k.flatElements(i.children).findIndex((e=>this.range.anchor.element.isEqual(e)));this.range.focus.moveToEnd(i),this.delete();const n=k.flatElements(e.children);this.range.focus.element=n[t],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(e),this.delete(),this.emit("insertParagraph",e,i)}else{const e=i.clone(!1),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.addElementAfter(e,i),this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t),this.emit("insertParagraph",e,i)}else{const e=i.clone(!1),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.addElementBefore(e,i),this.emit("insertParagraph",i,e)}}else this.delete(),this.insertParagraph()}insertElement(e,t=!0){if(!this.disabled&&this.range){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(!e.isEmpty())if(this.range.anchor.isEqual(this.range.focus)){const i=this.getPreviousElementOfPoint(this.range.anchor),n=this.getNextElementOfPoint(this.range.anchor),o=this.range.anchor.element.getBlock(),r=this.range.anchor.element.getInblock(),s=this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1;if(e.isInblock()&&"block"==e.behavior&&r&&"block"==r.behavior)if(r.isOnlyHasBreak()&&t)this.addElementBefore(e,r),r.toEmpty();else if(0!=this.range.anchor.offset||i&&r.isContains(i))if(this.range.anchor.offset!=s||n&&r.isContains(n)){const t=r.clone();this.addElementAfter(t,r),this.range.focus.moveToEnd(r),this.delete();const i=k.flatElements(r.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=k.flatElements(t.children);this.range.focus.element=n[i],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementBefore(e,t)}else this.addElementAfter(e,r);else this.addElementBefore(e,r);else if(e.isInblock()&&r)if(r.isOnlyHasBreak())this.addElementTo(e,r,0);else if(0!=this.range.anchor.offset||i&&r.isContains(i))if(this.range.anchor.offset!=s||n&&r.isContains(n)){const t=r.clone();this.addElementAfter(t,r),this.range.focus.moveToEnd(r),this.delete();const i=k.flatElements(r.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=k.flatElements(t.children);this.range.focus.element=n[i],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementTo(e,t),this.merge(t,r)}else this.addElementTo(e,r,r.children.length);else this.addElementTo(e,r,0);else if(e.isInblock())if(o.isOnlyHasBreak())this.addElementTo(e,o,0);else if(0!=this.range.anchor.offset||i&&o.isContains(i))if(this.range.anchor.offset!=s||n&&o.isContains(n)){const t=o.clone();this.addElementAfter(t,o),this.range.focus.moveToEnd(o),this.delete();const i=k.flatElements(o.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=k.flatElements(t.children);this.range.focus.element=n[i],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementTo(e,t),this.merge(t,o)}else this.addElementTo(e,o,o.children.length);else this.addElementTo(e,o,0);else if(e.isBlock())if(o.isOnlyHasBreak()&&t)this.addElementBefore(e,o),o.toEmpty();else if(0!=this.range.anchor.offset||i&&o.isContains(i))if(this.range.anchor.offset!=s||n&&o.isContains(n)){const t=o.clone();this.addElementAfter(t,o),this.range.focus.moveToEnd(o),this.delete();const i=k.flatElements(o.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=k.flatElements(t.children);this.range.focus.element=n[i],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementBefore(e,t)}else this.addElementAfter(e,o);else this.addElementBefore(e,o);else if(this.range.anchor.element.isText()){let t=this.range.anchor.element.textContent,i=this.range.anchor.element.clone();this.range.anchor.element.textContent=t.substring(0,this.range.anchor.offset),i.textContent=t.substring(this.range.anchor.offset),this.addElementAfter(i,this.range.anchor.element),this.addElementBefore(e,i)}else 0==this.range.anchor.offset?this.addElementBefore(e,this.range.anchor.element):this.addElementAfter(e,this.range.anchor.element);this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e)}else this.delete(),this.insertElement(e,t)}}formatElement(e){let t=this.renderRules.filter((e=>"function"==typeof e));if([O,A,I,R,L,M,...t].forEach((t=>{t.apply(this,[e])})),e.hasChildren()){let t=0;for(;t<e.children.length;){const i=e.children[t];i.isEmpty()?(this.range&&i.isContains(this.range.anchor.element)&&D.apply(this,[this.range.anchor]),this.range&&i.isContains(this.range.focus.element)&&D.apply(this,[this.range.focus]),e.children.splice(t,1)):(this.formatElement(i),i.isEmpty()?(i.isContains(this.range.anchor.element)&&D.apply(this,[this.range.anchor]),i.isContains(this.range.focus.element)&&D.apply(this,[this.range.focus]),e.children.splice(t,1)):t++)}}}formatElementStack(){let e=0;for(;e<this.stack.length;){const t=this.stack[e];t.isEmpty()?(this.range&&t.isContains(this.range.anchor.element)&&D.apply(this,[this.range.anchor]),this.range&&t.isContains(this.range.focus.element)&&D.apply(this,[this.range.focus]),this.stack.splice(e,1)):(t.isBlock()||t.convertToBlock(),this.formatElement(t),t.isEmpty()?(this.range&&t.isContains(this.range.anchor.element)&&D.apply(this,[this.range.anchor]),this.range&&t.isContains(this.range.focus.element)&&D.apply(this,[this.range.focus]),this.stack.splice(e,1)):e++)}V.apply(this)}domRender(e=!1){this.emit("beforeRender");const t=document.createDocumentFragment();this.stack.forEach((e=>{e.__render(),t.appendChild(e.elm)})),this.$el.innerHTML="",this.$el.appendChild(t);const i=this.value;this.value=this.$el.innerHTML,(this.__firstRender||i!=this.value)&&(this.__firstRender||this.emit("change",this.value,i),e||this.history.push(this.stack,this.range)),this.__firstRender&&(this.__firstRender=!1),this.emit("afterRender")}rangeRender(){if(this.disabled)return;if(!this.range){return void window.getSelection().removeAllRanges()}const e=e=>{let t=null,i=null;if(e.element.isText())t=e.element.elm.childNodes[0],i=e.offset;else{t=e.element.parent.elm;const n=e.element.parent.children.findIndex((t=>e.element.isEqual(t)));i=e.offset+n}return{node:t,offset:i}};this.__innerSelectionChange=!0;const t=e(this.range.anchor),i=e(this.range.focus),n=window.getSelection();n.removeAllRanges();const o=document.createRange();o.setStart(t.node,t.offset),o.setEnd(i.node,i.offset),n.addRange(o),setTimeout((()=>{H.apply(this),this.__innerSelectionChange=!1,this.emit("rangeUpdate",this.range)}),0)}parseHtml(e){if(!e)throw new Error("You need to give an html content to convert");const t=document.createElement("div");t.innerHTML=e;let i=[];return Array.from(t.childNodes).forEach((e=>{if(1==e.nodeType||3==e.nodeType){const t=this.parseNode(e);i.push(t)}})),i}parseNode(e){if(!(e instanceof Node))throw new Error("The argument must be an node");if(1!=e.nodeType&&3!=e.nodeType)throw new Error("The argument must be an element node or text node");if(3==e.nodeType)return new k("text",null,null,null,e.textContent);const t=(e=>{let t={};const i=e.attributes.length;for(let n=0;n<i;n++){const i=e.attributes[n];/(^on)|(^style$)|(^face$)/g.test(i.nodeName)||(t[i.nodeName]=i.nodeValue)}return t})(e),i=(e=>{let t={};if(e.getAttribute("style")){const i=e.getAttribute("style");let n=0,o=0,r=[];for(;n<i.length;)";"==i[n]&&"base64,"!=i.substring(n+1,n+8)&&(r.push(i.substring(o,n)),o=n+1),n==i.length-1&&o<n&&r.push(i.substring(o,n)),n++;r.forEach((e=>{const i=e.indexOf(":"),n=e.substring(0,i).trim(),o=e.substring(i+1).trim();t[n]=o}))}return t})(e),n=e.nodeName.toLocaleLowerCase(),o=B.find((e=>e.parsedom==n)),r=_.find((e=>e.parsedom==n)),s=N.find((e=>e.parsedom==n)),a=S.find((e=>e.parsedom==n));let l=null,d={type:"inblock",parsedom:n,marks:t,styles:i,behavior:"default"};if(o)d.type="block",o.parse&&(d.parsedom=k.BLOCK_NODE);else if(r)d.type="inblock",r.block&&(d.behavior="block");else if(s){if(d.type="inline",s.parse&&(d.parsedom=k.TEXT_NODE,p.common.isObject(s.parse)))for(let c in s.parse)"function"==typeof s.parse[c]?d.styles[c]=s.parse[c].apply(this,[e]):d.styles[c]=s.parse[c]}else a?d.type="closed":(d.type="inline",d.parsedom="span");return l=new k(d.type,d.parsedom,d.marks,d.styles,null),l.behavior=d.behavior,a||Array.from(e.childNodes).forEach((e=>{if(1==e.nodeType||3==e.nodeType){const t=this.parseNode(e);t.parent=l,l.hasChildren()?l.children.push(t):l.children=[t]}})),l}merge(e,t){if(!k.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!k.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(!e.isBlock()&&!e.isInblock()||!t.isBlock()&&!t.isInblock())throw new Error('Elements that are not "block" or "inblock" cannot be merged');"function"==typeof this.customMerge?this.customMerge.apply(this,[e,t]):(t.children.push(...e.children),t.children.forEach((e=>{e.parent=t})),e.children=null)}getElementByKey(e){if(!e)throw new Error("You need to specify a key to do the query");const t=i=>{let n=null,o=0,r=i.length;for(;o<r;){if(i[o].key==e){n=i[o];break}if(i[o].hasChildren()){const e=t(i[o].children);if(e){n=e;break}}o++}return n};return t(this.stack)}getPreviousElement(e){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(e.isBlock()){const t=this.stack.findIndex((t=>e.isEqual(t)));return t<=0?null:this.stack[t-1].isEmpty()?this.getPreviousElement(this.stack[t-1]):this.stack[t-1]}{const t=e.parent.children.findIndex((t=>e.isEqual(t)));return t<=0?null:e.parent.children[t-1].isEmpty()?this.getPreviousElement(e.parent.children[t-1]):e.parent.children[t-1]}}getNextElement(e){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(e.isBlock()){const t=this.stack.findIndex((t=>e.isEqual(t)));return t>=this.stack.length-1?null:this.stack[t+1].isEmpty()?this.getNextElement(this.stack[t+1]):this.stack[t+1]}{const t=e.parent.children.findIndex((t=>e.isEqual(t)));return t>=e.parent.children.length-1?null:e.parent.children[t+1].isEmpty()?this.getNextElement(e.parent.children[t+1]):e.parent.children[t+1]}}getPreviousElementOfPoint(e){if(!x.isPoint(e))throw new Error("The argument must be an AlexPoint instance");const t=k.flatElements(this.stack),i=e=>{const n=t.findIndex((t=>e.isEqual(t)));if(n<=0)return null;let o=t[n-1];return!o.isText()&&!o.isClosed()||o.isEmpty()?i(o):o};return i(e.element)}getNextElementOfPoint(e){if(!x.isPoint(e))throw new Error("The argument must be an AlexPoint instance");const t=k.flatElements(this.stack),i=e=>{const n=t.findIndex((t=>e.isEqual(t)));if(n==t.length-1)return null;let o=t[n+1];return!o.isText()&&!o.isClosed()||o.isEmpty()?i(o):o};return i(e.element)}getElementsByRange(e=!1,t=!1){if(!this.range)return;if(this.range.anchor.isEqual(this.range.focus))return[];if(this.range.anchor.element.isEqual(this.range.focus.element)){if(e){const e=0==this.range.anchor.offset&&this.range.focus.offset==(this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1);return[{element:this.range.anchor.element,offset:!e&&[this.range.anchor.offset,this.range.focus.offset]}]}return[]}let i=[];e&&(0==this.range.anchor.offset?i.push({element:this.range.anchor.element,offset:!1}):this.range.anchor.offset<(this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1)&&i.push({element:this.range.anchor.element,offset:[this.range.anchor.offset,this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1]}));const n=k.flatElements(this.stack),o=n.findIndex((e=>e.isEqual(this.range.anchor.element))),r=n.findIndex((e=>e.isEqual(this.range.focus.element)));for(let c=o+1;c<r;c++)i.push({element:n[c],offset:!1});e&&(this.range.focus.offset==(this.range.focus.element.isText()?this.range.focus.element.textContent.length:1)?i.push({element:this.range.focus.element,offset:!1}):this.range.focus.offset>0&&i.push({element:this.range.focus.element,offset:[0,this.range.focus.offset]}));const s=i.length;let a=[];for(let c=s-1;c>=0;c--)if(i[c].element.hasChildren()){i[c].element.children.every((e=>a.some((t=>t.element.isEqual(e)&&!t.offset))))&&a.unshift(i[c])}else a.unshift(i[c]);for(let c=0;c<a.length;c++){const e=a[c].element;if(!e.offset&&e.parent){const t=a.some((t=>t.element.isEqual(e.parent)));e.parent.children.every((e=>a.some((t=>t.element.isEqual(e)&&!t.offset))))&&!t&&(a.splice(c,0,{element:e.parent,offset:!1}),c++)}}if(t)return a;let l=[];const d=a.length;for(let c=0;c<d;c++)if(a[c].element.isBlock())l.push(a[c]);else{a.some((e=>e.element.isEqual(a[c].element.parent)))||l.push(a[c])}return l}splitElementsByRange(e=!1,t=!1){if(!this.range)return;const i=this.getElementsByRange(e,t);let n=[];return i.forEach(((e,t)=>{if(e.offset){let o=null;if(0==e.offset[0]){const t=e.element.clone();e.element.textContent=e.element.textContent.substring(0,e.offset[1]),t.textContent=t.textContent.substring(e.offset[1]),this.addElementAfter(t,e.element),o=e.element}else if(e.offset[1]==e.element.textContent.length){const t=e.element.clone();e.element.textContent=e.element.textContent.substring(0,e.offset[0]),t.textContent=t.textContent.substring(e.offset[0]),this.addElementAfter(t,e.element),o=t}else{const t=e.element.clone(),i=e.element.clone();e.element.textContent=e.element.textContent.substring(0,e.offset[0]),t.textContent=t.textContent.substring(e.offset[0],e.offset[1]),i.textContent=i.textContent.substring(e.offset[1]),this.addElementAfter(t,e.element),this.addElementAfter(i,t),o=t}0==t&&this.range.anchor.moveToStart(o),t==i.length-1&&this.range.focus.moveToEnd(o),n.push(o)}else n.push(e.element)})),n}addElementTo(e,t,i=0){if(!k.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!k.isElement(t))throw new Error("The second argument must be an AlexElement instance");if("number"!=typeof i||isNaN(i)||i<0)throw new Error("The third argument must be an integer not less than 0");t.hasChildren()?i>=t.children.length?t.children.push(e):t.children.splice(i,0,e):t.children=[e],e.parent=t}addElementBefore(e,t){if(!k.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!k.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(t.isBlock()){const i=this.stack.findIndex((e=>t.isEqual(e)));this.stack.splice(i,0,e),e.parent=null}else{const i=t.parent.children.findIndex((e=>t.isEqual(e)));this.addElementTo(e,t.parent,i)}}addElementAfter(e,t){if(!k.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!k.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(t.isBlock()){const i=this.stack.findIndex((e=>t.isEqual(e)));i>=this.stack.length-1?this.stack.push(e):this.stack.splice(i+1,0,e),e.parent=null}else{const i=t.parent.children.findIndex((e=>t.isEqual(e)));this.addElementTo(e,t.parent,i+1)}}collapseToStart(e){if(this.disabled)return;let t=!1;if(this.range||(this.initRange(),t=!0),k.isElement(e))this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e);else{const e=k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom)));if(0==e.length)throw new Error("There is no element to set the focus");this.range.anchor.moveToStart(e[0]),this.range.focus.moveToStart(e[0])}t&&this.history.updateCurrentRange(this.range)}collapseToEnd(e){if(this.disabled)return;let t=!1;if(this.range||(this.initRange(),t=!0),k.isElement(e))this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e);else{const e=k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom))),t=e.length;if(0==t)throw new Error("There is no element to set the focus");this.range.anchor.moveToEnd(e[t-1]),this.range.focus.moveToEnd(e[t-1])}t&&this.history.updateCurrentRange(this.range)}setDisabled(){this.disabled=!0,this.$el.removeAttribute("contenteditable")}setEnabled(){this.disabled=!1,this.$el.setAttribute("contenteditable",!0)}setTextStyle(e){if(!this.disabled&&this.range){if(!p.common.isObject(e))throw new Error("The argument must be an object");if(this.range.anchor.isEqual(this.range.focus))if(this.range.anchor.element.isSpaceText())this.range.anchor.element.hasStyles()?Object.assign(this.range.anchor.element.styles,y(e)):this.range.anchor.element.styles=y(e);else if(this.range.anchor.element.isText()){const t=k.getSpaceElement();t.styles=y(this.range.anchor.element.styles),t.marks=y(this.range.anchor.element.marks),t.hasStyles()?Object.assign(t.styles,y(e)):t.styles=y(e),this.insertElement(t)}else{const t=k.getSpaceElement();t.styles=y(e),this.insertElement(t)}else{this.splitElementsByRange(!0,!0).forEach((t=>{t.isText()&&(t.hasStyles()?Object.assign(t.styles,y(e)):t.styles=y(e))}))}}}removeTextStyle(e){if(this.disabled)return;if(!this.range)return;const t=t=>{if(Array.isArray(e)){if(t.hasStyles()){let i={};Object.keys(t.styles).forEach((n=>{e.includes(n)||(i[n]=t.styles[n])})),t.styles=i}}else t.styles=null};if(this.range.anchor.isEqual(this.range.focus)){if(this.range.anchor.element.isSpaceText())t(this.range.anchor.element);else if(this.range.anchor.element.isText()){const e=k.getSpaceElement();e.styles=y(this.range.anchor.element.styles),e.marks=y(this.range.anchor.element.marks),t(e),this.insertElement(e)}}else{this.splitElementsByRange(!0,!0).forEach((e=>{e.isText()&&t(e)}))}}queryTextStyle(e,t,i){if(!e)throw new Error("The first argument cannot be null");if(!this.range)return!1;if(this.range.anchor.isEqual(this.range.focus))return!(!this.range.anchor.element.isText()||!this.range.anchor.element.hasStyles())&&C(this.range.anchor.element.styles,e,t);let n=null;return n=i?this.__dataCaches.queryTextStyle||[]:this.getElementsByRange(!0,!0).filter((e=>e.element.isText())),i||(this.__dataCaches.queryTextStyle=n),0!=n.length&&n.every((i=>!!i.element.hasStyles()&&C(i.element.styles,e,t)))}setTextMark(e){if(!this.disabled&&this.range){if(!p.common.isObject(e))throw new Error("The argument must be an object");if(this.range.anchor.isEqual(this.range.focus))if(this.range.anchor.element.isSpaceText())this.range.anchor.element.hasMarks()?Object.assign(this.range.anchor.element.marks,y(e)):this.range.anchor.element.marks=y(e);else if(this.range.anchor.element.isText()){const t=k.getSpaceElement();t.styles=y(this.range.anchor.element.styles),t.marks=y(this.range.anchor.element.marks),t.hasMarks()?Object.assign(t.marks,y(e)):t.marks=y(e),this.insertElement(t)}else{const t=k.getSpaceElement();t.marks=UcloneData(e),this.insertElement(t)}else{this.splitElementsByRange(!0,!0).forEach((t=>{t.isText()&&(t.hasMarks()?Object.assign(t.marks,y(e)):t.marks=y(e))}))}}}removeTextMark(e){if(this.disabled)return;if(!this.range)return;const t=t=>{if(Array.isArray(e)){if(t.hasMarks()){let i={};Object.keys(t.marks).forEach((n=>{e.includes(n)||(i[n]=t.marks[n])})),t.marks=i}}else t.marks=null};if(this.range.anchor.isEqual(this.range.focus)){if(this.range.anchor.element.isSpaceText())t(this.range.anchor.element);else if(this.range.anchor.element.isText()){const e=k.getSpaceElement();e.styles=y(this.range.anchor.element.styles),e.marks=y(this.range.anchor.element.marks),t(e),this.insertElement(e)}}else{this.splitElementsByRange(!0,!0).forEach((e=>{e.isText()&&t(e)}))}}queryTextMark(e,t,i){if(!e)throw new Error("The first argument cannot be null");if(!this.range)return!1;if(this.range.anchor.isEqual(this.range.focus))return!(!this.range.anchor.element.isText()||!this.range.anchor.element.hasMarks())&&C(this.range.anchor.element.marks,e,t);let n=null;return n=i?this.__dataCaches.queryTextMark||[]:this.getElementsByRange(!0,!0).filter((e=>e.element.isText())),i||(this.__dataCaches.queryTextMark=n),0!=n.length&&n.every((i=>!!i.element.hasMarks()&&C(i.element.marks,e,t)))}emit(e,...t){return!!Array.isArray(this.__events[e])&&(this.__events[e].forEach((e=>{e.apply(this,[...t])})),!0)}on(e,t){this.__events[e]||(this.__events[e]=[]),this.__events[e].push(t)}destroy(){this.setDisabled(),p.event.off(document,`selectionchange.alex_editor_${this.__guid}`),p.event.off(this.$el,"beforeinput.alex_editor compositionstart.alex_editor compositionupdate.alex_editor compositionend.alex_editor keydown.alex_editor cut.alex_editor paste.alex_editor copy.alex_editor dragstart.alex_editor drop.alex_editor focus.alex_editor blur.alex_editor")}}const ee={formatNumber(e){return this.isNumber(e)?e.toString().replace(/(\d)(?=(?:\d{3})+$)/g,"$1,"):e},isNumber:e=>"number"==typeof e&&!isNaN(e),add:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=0;try{i=e.toString().split(".")[1].length}catch(r){}try{n=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(i,n)),(e*o+t*o)/o})),subtract:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=0;try{i=e.toString().split(".")[1].length}catch(r){}try{n=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(i,n)),(e*o-t*o)/o})),mutiply:(...e)=>e.reduce(((e,t)=>{let i=0,n=e.toString(),o=t.toString();try{i+=n.split(".")[1].length}catch(r){}try{i+=o.split(".")[1].length}catch(r){}return Number(n.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,i)})),divide:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=e.toString(),r=t.toString();try{i=o.split(".")[1].length}catch(s){}try{n=r.split(".")[1].length}catch(s){}return o=Number(o.replace(".","")),r=Number(r.replace(".","")),o/r*Math.pow(10,n-i)}))},te={insert(e,t,i){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if("string"!=typeof t)throw new TypeError("The second argument must be a string");if(!ee.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,i)+t+e.substring(i,e.length)},delete(e,t,i){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!ee.isNumber(t))throw new TypeError("The second argument must be a number");if(t<0)throw new Error("The second argument cannot be less than 0");if(!ee.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,t)+e.substring(t+i,e.length)},replace(e,t,i,n){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!ee.isNumber(t))throw new TypeError("The second argument must be a number");if(t<0)throw new Error("The second argument cannot be less than 0");if(!ee.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");if("string"!=typeof n)throw new TypeError("The fourth argument must be a string");return e.substring(0,t)+n+e.substring(i,e.length)},trim(e,t=!1){if("string"!=typeof e)throw new TypeError("The first argument must be a string");let i=e.replace(/(^\s+)|(\s+$)/g,"");return t&&(i=i.replace(/\s/g,"")),i}},ie={isWindow:e=>e&&e instanceof Window,getElementPoint(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(this.isElement(t)||(t=document.body),!this.isContains(t,e))throw new Error("The second argument and the first argument have no hierarchical relationship");let i=e,n=0,o=0;for(;this.isElement(e)&&this.isContains(t,e)&&t!==e;)n+=e.offsetTop,o+=e.offsetLeft,e=e.offsetParent;return{top:n,left:o,right:t.offsetWidth-o-i.offsetWidth,bottom:t.offsetHeight-n-i.offsetHeight}},isContains(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!this.isElement(t))throw new TypeError("The second argument must be an element");return e===t||(e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):void 0)},isParentNode(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!this.isElement(t))throw new TypeError("The second argument must be an element");return e!==t&&t.parentNode===e},children(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(t&&"string"!=typeof t)throw new TypeError("The second argument must be a string");return[...e.querySelectorAll(t||"*")].filter((t=>t.parentNode===e))},siblings(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(t&&"string"!=typeof t)throw new TypeError("The second argument must be a string");if(!e.parentNode)return[];return[...e.parentNode.querySelectorAll(t||"*")].filter((t=>t.parentNode===e.parentNode&&t!=e))},rem2px(e){if(!ee.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return ee.mutiply(e,parseFloat(t))},px2rem(e){if(!ee.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return ee.divide(e,parseFloat(t))},width(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientWidth,i=parseFloat(this.getCssStyle(e,"padding-left")),n=parseFloat(this.getCssStyle(e,"padding-right"));return ee.subtract(t,i,n)},height(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientHeight,i=parseFloat(this.getCssStyle(e,"padding-top")),n=parseFloat(this.getCssStyle(e,"padding-bottom"));return ee.subtract(t,i,n)},removeClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;te.trim(t).split(/\s+/).forEach((e=>{i.remove(e)}))},addClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;te.trim(t).split(/\s+/).forEach((e=>{i.add(e)}))},hasClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;return te.trim(t).split(/\s+/).every((e=>i.contains(e)))},scrollTopBottomTrigger(e,t){"string"==typeof e&&e&&(e=document.body.querySelector(e));let i=window;this.isElement(e)&&e!=document.body&&e!=document.documentElement&&(i=e),"function"==typeof e&&(t=e);let n=!0;i.addEventListener("scroll",(e=>{if(this.getScrollTop(i)<=0){if(!n)return;"function"==typeof t&&(n=!1,t({state:"top",target:i}))}else{let e={state:"bottom",target:i},o=0;if(o=i==window?window.innerHeight:i.clientHeight,ee.add(this.getScrollTop(i),o)+1>=this.getScrollHeight(i)&&o!=this.getScrollHeight(i)){if(!n)return;"function"==typeof t&&(n=!1,t(e))}else n=!0}}))},getScrollWidth(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.documentElement&&e!=document.body?e.scrollWidth:0==document.documentElement.scrollWidth||0==document.body.scrollWidth?document.documentElement.scrollWidth||document.body.scrollWidth:document.documentElement.scrollWidth>document.body.scrollWidth?document.documentElement.scrollWidth:document.body.scrollWidth,t},getScrollHeight(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.documentElement&&e!=document.body?e.scrollHeight:0==document.documentElement.scrollHeight||0==document.body.scrollHeight?document.documentElement.scrollHeight||document.body.scrollHeight:document.documentElement.scrollHeight>document.body.scrollHeight?document.documentElement.scrollHeight:document.body.scrollHeight,t},setScrollTop(e){let t=!1,i=e.el;"string"==typeof i&&i&&(i=document.body.querySelector(i));let n=e.number||0,o=e.time||0;return this.isElement(i)&&i!=document.body&&i!=document.documentElement&&i!=window||(t=!0),new Promise(((e,r)=>{if(o<=0)t?document.documentElement.scrollTop=document.body.scrollTop=n:i.scrollTop=n,e();else{let r=10,s=ee.divide(o,r),a=this.getScrollTop(i),l=ee.divide(ee.subtract(n,a),s),d=setInterval((()=>{s>0?(s--,t?document.documentElement.scrollTop=document.body.scrollTop=a=ee.add(a,l):i.scrollTop=a=ee.add(a,l)):(clearInterval(d),e())}),r)}}))},getScrollTop(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.body&&e!=document.documentElement&&e!=window?e.scrollTop:0==document.documentElement.scrollTop||0==document.body.scrollTop?document.documentElement.scrollTop||document.body.scrollTop:document.documentElement.scrollTop>document.body.scrollTop?document.documentElement.scrollTop:document.body.scrollTop,t},getScrollLeft(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.body&&e!=document.documentElement&&e!=window?e.scrollLeft:0==document.documentElement.scrollLeft||0==document.body.scrollLeft?document.documentElement.scrollLeft||document.body.scrollLeft:document.documentElement.scrollLeft>document.body.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,t},setScrollLeft(e){let t=!1,i=e.el;"string"==typeof i&&i&&(i=document.body.querySelector(i));let n=e.number||0,o=e.time||0;return this.isElement(i)&&i!=document.body&&i!=document.documentElement&&i!=window||(t=!0),new Promise(((e,r)=>{if(o<=0)t?document.documentElement.scrollLeft=document.body.scrollLeft=n:i.scrollLeft=n,e();else{let r=10,s=ee.divide(o,r),a=this.getScrollLeft(i),l=ee.divide(ee.subtract(n,a),s),d=setInterval((()=>{s>0?(s--,t?document.documentElement.scrollLeft=document.body.scrollLeft=a=ee.add(a,l):i.scrollLeft=a=ee.add(a,l)):(clearInterval(d),e())}),r)}}))},getCssStyle(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i="";return i=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(e)[t]:e.currentStyle[t],i},getCssSelector(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a selector string");if(/^#{1}/.test(e))return{type:"id",value:e.substr(1)};if(/^\./.test(e))return{type:"class",value:e.substr(1)};if(/^\[(.+)\]$/.test(e)){let t="attribute",i="",n=te.trim(e,!0).substring(1,te.trim(e,!0).length-1).split("=");return 1==n.length&&(i=n[0]),2==n.length&&(i={attributeName:n[0],attributeValue:n[1].replace(/\'/g,"").replace(/\"/g,"")}),{type:t,value:i}}return{type:"tag",value:e}},getElementBounding(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.getBoundingClientRect();return{top:t.top,bottom:ee.subtract(document.documentElement.clientHeight||window.innerHeight,t.bottom),left:t.left,right:ee.subtract(document.documentElement.clientWidth||window.innerWidth,t.right)}},isElement:e=>e&&e instanceof Node&&1===e.nodeType,string2dom(e,t="div"){if(!e||"string"!=typeof e)throw new TypeError("The argument must be an HTML string");let i=document.createElement(t);return i.innerHTML=e,1==i.children.length?i.children[0]:Array.from(i.children)}},ne="_dap-datas",oe={remove(e,t){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=e[ne]||{};null==t||""===t?e[ne]={}:(delete i[t],e[ne]=i)},has(e,t){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(null==t||""===t)throw new TypeError("The second parameter must be a unique key");return(e[ne]||{}).hasOwnProperty(t)},get(e,t){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=e[ne]||{};return null==t||""===t?i:i[t]},set(e,t,i){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(null==t||""===t)throw new TypeError("The second parameter must be a unique key");let n=e[ne]||{};n[t]=i,e[ne]=n}},re={matchingText(e,t){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=null;if("Chinese"==t&&(i=/^[\u4e00-\u9fa5]+$/),"chinese"==t&&(i=/[\u4e00-\u9fa5]/),"email"==t&&(i=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/),"username"==t&&(i=/^[a-zA-Z0-9_]{4,16}$/),"int+"==t&&(i=/^\d+$/),"int-"==t&&(i=/^-\d+$/),"int"==t&&(i=/^-?\d+$/),"pos"==t&&(i=/^\d*\.?\d+$/),"neg"==t&&(i=/^-\d*\.?\d+$/),"number"==t&&(i=/^-?\d*\.?\d+$/),"phone"==t&&(i=/^1[0-9]\d{9}$/),"idCard"==t&&(i=/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/),"url"==t&&(i=/^((https?|ftp|file):\/\/)?([\da-z\.-]+)\.([\da-z\.]{2,6})([\/\w \.-]*)*\/?$/),"IPv4"==t&&(i=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/),"hex"==t&&(i=/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/),"rgb"==t&&(i=/^rgb\((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\)$/),"rgba"==t&&(i=/^rgba\((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(0?\.\d|1(\.0)?|0)\)$/),"QQ"==t&&(i=/^[1-9][0-9]{4,10}$/),"weixin"==t&&(i=/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/),"plate"==t&&(i=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/),!i)throw new Error("The second parameter is out of scope");return i.test(e)},getUrlParams(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),i=window.location.search.substr(1);if(!i){let e=window.location.hash.split("?");2==e.length&&(i=e[1])}let n=i.match(t);return n?decodeURIComponent(n[2]):null},isEmptyObject(e){return!!this.isObject(e)&&0==Object.keys(e).length},equal(e,t){if(typeof e!=typeof t)return!1;if(this.isObject(e)&&this.isObject(t)){let i=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);if(i.length!=n.length)return!1;let o=i.length,r=!0;for(let s=0;s<o;s++){let n=i[s],o=e[n],a=t[n];if(!this.equal(o,a)){r=!1;break}}return r}return e===t},isObject:e=>!("object"!=typeof e||!e),copyText(e){if(!e||"string"!=typeof e)throw new TypeError("No text to copy is defined");if(!navigator.clipboard)throw new Error("navigator.clipboard must be obtained in a secure environment, such as localhost, 127.0.0.1, or https, so the method won't work");return navigator.clipboard.writeText(e)},clone(e){if(this.isObject(e)){if(Array.isArray(e))return e.map((e=>this.clone(e)));let t={};for(let i in e)t[i]=this.clone(e[i]);return t}return e}},se=e=>{let t=e.split(/[\s]+/g),i=[];return t.forEach((e=>{let t=e.split("."),n={eventName:t[0]};t.length>1&&(n.guid=t[1]),i.push(n)})),i},ae=(e,t,i)=>{let n=oe.get(e,"dap-defined-events")||{},o=Object.keys(n),r=o.length;for(let s=0;s<r;s++){let r=o[s];n[r].type==t&&(i?r==t+"."+i&&(e.removeEventListener(n[r].type,n[r].fn,n[r].options),n[r]=void 0):(e.removeEventListener(n[r].type,n[r].fn,n[r].options),n[r]=void 0))}n=(e=>{let t={};return Object.keys(e).forEach((i=>{e[i]&&(t[i]=e[i])})),t})(n),oe.set(e,"dap-defined-events",n)},le={on(e,t,i,n){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");if(!i||"function"!=typeof i)throw new TypeError("The third argument must be a function");re.isObject(n)||(n={});se(t).forEach((t=>{((e,t,i,n,o)=>{let r=oe.get(e,"dap-defined-events")||{};i||(i=oe.get(e,"dap-event-guid")||0,oe.set(e,"dap-event-guid",i+1)),r[i=t+"."+i]&&r[i].type==t&&e.removeEventListener(t,r[i].fn,r[i].options),e.addEventListener(t,n,o),r[i]={type:t,fn:n,options:o},oe.set(e,"dap-defined-events",r)})(e,t.eventName,t.guid,i.bind(e),n)}))},off(e,t){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=oe.get(e,"dap-defined-events");if(!i)return;if(!t){let t=Object.keys(i),n=t.length;for(let o=0;o<n;o++){let n=t[o];e.removeEventListener(i[n].type,i[n].fn,i[n].options)}return oe.remove(e,"dap-defined-events"),void oe.remove(e,"dap-event-guid")}se(t).forEach((t=>{ae(e,t.eventName,t.guid)}))},get(e){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let t=oe.get(e,"dap-defined-events");if(t)return t}},de={rgb2hsv(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=0,i=0,n=0,o=e[0]>=255?255:e[0],r=e[1]>=255?255:e[1],s=e[2]>=255?255:e[2];o=o<=0?0:o,r=r<=0?0:r,s=s<=0?0:s;let a=Math.max(o,r,s),l=Math.min(o,r,s);return n=a/255,i=0===a?0:1-l/a,a===l?t=0:a===o&&r>=s?t=(r-s)/(a-l)*60+0:a===o&&r<s?t=(r-s)/(a-l)*60+360:a===r?t=(s-o)/(a-l)*60+120:a===s&&(t=(o-r)/(a-l)*60+240),[t,100*i,100*n]},hsv2rgb(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=e[0]>=360||e[0]<=0?0:e[0],i=e[1]>=100?100:e[1];i=i<=0?0:i;let n=e[2]>=100?100:e[2];n=n<=0?0:n,i/=100,n/=100;let o=0,r=0,s=0,a=parseInt(t/60%6),l=t/60-a,d=n*(1-i),c=n*(1-l*i),h=n*(1-(1-l)*i);switch(a){case 0:o=n,r=h,s=d;break;case 1:o=c,r=n,s=d;break;case 2:o=d,r=n,s=h;break;case 3:o=d,r=c,s=n;break;case 4:o=h,r=d,s=n;break;case 5:o=n,r=d,s=c}return o=parseInt(255*o),r=parseInt(255*r),s=parseInt(255*s),[o,r,s]},rgb2hex(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+e[2]).toString(16).slice(1)},hex2rgb(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=e.toLowerCase();if(!re.matchingText(t,"hex"))throw new TypeError("The argument must be a hexadecimal color value");if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}let i=[];for(let n=1;n<7;n+=2)i.push(parseInt("0x"+t.slice(n,n+2)));return i}},ce={getImageUrl(e){if(!(e&&e instanceof File))throw new TypeError("The argument must be a File object");return window.URL.createObjectURL(e)},dataFileToBase64:e=>new Promise(((t,i)=>{e&&e instanceof File||i(new TypeError("The argument must be a File object"));let n=new FileReader;n.readAsDataURL(e),n.onloadend=()=>{let e=n.result;t(e)}})),dataBase64toFile(e,t){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.split(","),n=i[0].match(/:(.*?);/)[1],o=atob(i[1]),r=o.length,s=new Uint8Array(r);for(;r--;)s[r]=o.charCodeAt(r);return new File([s],t,{type:n})},compressImage(e,t){const i={width:null,quality:.8,mimeType:"jpeg",maxSize:0,minSize:0};re.isObject(t)&&(ee.isNumber(t.width)&&(i.width=t.width),ee.isNumber(t.quality)&&t.quality>=0&&t.quality<=1&&(i.quality=t.quality),"jpeg"!=t.mimeType&&"webp"!=t.mimeType||(i.mimeType=t.mimeType),ee.isNumber(t.maxSize)&&(i.maxSize=t.maxSize),ee.isNumber(t.minSize)&&(i.minSize=t.minSize));const n=(e,t,o)=>{let r=e.toDataURL("image/"+i.mimeType,o),s=this.dataBase64toFile(r,t);if(i.maxSize>0&&s.size>1024*i.maxSize){o=o<=0?0:Number((o-.01).toFixed(2));const i=n(e,t,o);r=i.url,s=i.file,o=i.quality}return{file:s,url:r,quality:o}};return new Promise(((t,o)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>{let s=r.result,a=new Image;a.src=s,a.onload=()=>{if(i.minSize>0&&e.size<=1024*i.minSize)return void t({file:e,url:s,quality:1,width:a.width,height:a.height});let o=document.createElement("canvas"),r=o.getContext("2d");o.width=i.width||a.width,o.height=i.width?i.width/(a.width/a.height):a.height,r.drawImage(a,0,0,o.width,o.height);let l=e.name.lastIndexOf(".");const d=e.name.substring(0,l)+"."+i.mimeType;let c=n(o,d,i.quality);t({...c,width:o.width,height:o.height})},a.onerror=()=>{o(new Error("Failed to load image file"))}},r.onerror=()=>{o(new Error("Failed to load image file"))}}))}},he={start(e,t){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");let i={pitch:.8,rate:1,volume:1,start:function(){},end:function(){},pause:function(){},resume:function(){},error:function(){}};re.isObject(t)||(t={}),ee.isNumber(t.pitch)&&(i.pitch=t.pitch),ee.isNumber(t.rate)&&(i.rate=t.rate),ee.isNumber(t.volume)&&(i.volume=t.volume),"function"==typeof t.start&&(i.start=t.start),"function"==typeof t.end&&(i.end=t.end),"function"==typeof t.pause&&(i.pause=t.pause),"function"==typeof t.resume&&(i.resume=t.resume),"function"==typeof t.error&&(i.error=t.error);const n=new SpeechSynthesisUtterance;n.text=e,n.pitch=i.pitch,n.rate=i.rate,n.volume=i.volume,n.lang="zh-CN",n.onstart=t=>{i.start.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onend=t=>{i.end.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onpause=t=>{i.pause.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onresume=t=>{i.resume.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onerror=t=>{i.error.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},window.speechSynthesis.speak(n)},stop(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.cancel()},pause(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.pause()},resume(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.resume()}},ue={number:ee,data:oe,element:ie,event:le,common:re,color:de,file:ce,string:te,platform:{language:()=>window.navigator.browserLanguage||window.navigator.language,device(){const e=window.navigator.userAgent;return{PC:!e.match(/AppleWebKit.*Mobile.*/),Mobile:!!e.match(/AppleWebKit.*Mobile.*/),iPhone:e.includes("iPhone"),Phone:e.includes("Android")&&/(?:Mobile)/.test(e)||e.includes("iPhone")||/(?:Windows Phone)/.test(e),iPad:e.includes("iPad"),Tablet:e.includes("iPad")||e.includes("Android")&&!/(?:Mobile)/.test(e)||e.includes("Firefox")&&/(?:Tablet)/.test(e),WindowsPhone:/(?:Windows Phone)/.test(e)}},browser(){const e=window.navigator.userAgent;return{Edge:!!e.match(/Edg\/([\d.]+)/),weixin:e.includes("MicroMessenger"),QQ:e.includes("QQ"),QQBrowser:e.includes("MQQBrowser"),UC:e.includes("UCBrowser"),Chrome:e.includes("Chrome"),Firefox:e.includes("Firefox"),sougou:e.toLocaleLowerCase().includes("se 2.x")||e.toLocaleLowerCase().includes("metasr")||e.toLocaleLowerCase().includes("sogou"),Safari:e.includes("Safari")&&!e.includes("Chrome")}},browserKernel(){const e=window.navigator.userAgent;return e.includes("Presto")?"opera":e.includes("AppleWebKit")?"webkit":e.includes("Gecko")&&!e.includes("KHTML")?"gecko":""},os(){const e=window.navigator.userAgent;return{Windows:e.includes("Windows"),Windows_CPU:e.toLocaleLowerCase().includes("win64")||e.toLocaleLowerCase().includes("wow64")?"x64":e.toLocaleLowerCase().includes("win32")||e.toLocaleLowerCase().includes("wow32")?"x32":"",Windows_Version:e.includes("Windows NT 6.1")||e.includes("Windows 7")?"Win7":e.includes("Windows NT 6.3")||e.includes("Windows NT 6.2")||e.includes("Windows NT 8")?"Win8":e.includes("Windows NT 10")||e.includes("Windows NT 6.4")?"Win10":"",Mac:e.includes("Macintosh"),Mac_Version:function(){if(e.includes("Macintosh")){const t=e.match(/Mac OS X ([^\s]+)\)/);if(t&&t[1])return t[1].split(/_|\./).join(".")}return""}(),ios:!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),ios_Version:function(){if(e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)){const t=e.match(/CPU.+OS ([^\s]+) like Mac OS X/);if(t&&t[1])return t[1].split(/_|\./).join(".")}return""}(),Android:e.includes("Android"),Android_Version:function(){const t=e.match(/Android ([^\s]+);/);return t&&t[1]?t[1].split(/_|\./).join("."):""}(),Linux:e.includes("Linux"),HarmonyOS:e.includes("HarmonyOS"),Ubuntu:e.includes("Ubuntu")}}},speech:he};function fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ge(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{const i=e[t],n=typeof i;"object"!==n&&"function"!==n||Object.isFrozen(i)||ge(i)})),e}class me{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function pe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function be(e,...t){const i=Object.create(null);for(const n in e)i[n]=e[n];return t.forEach((function(e){for(const t in e)i[t]=e[t]})),i}const ye=e=>!!e.scope;class we{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=pe(e)}openNode(e){if(!ye(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const i=e.split(".");return[`${t}${i.shift()}`,...i.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){ye(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const Ee=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Ce{constructor(){this.rootNode=Ee(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=Ee({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{Ce._collapse(e)})))}}class ve extends Ce{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const i=e.root;t&&(i.scope=`language:${t}`),this.add(i)}toHTML(){return new we(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ke(e){return e?"string"==typeof e?e:e.source:null}function $e(e){return Be("(?=",e,")")}function xe(e){return Be("(?:",e,")*")}function Te(e){return Be("(?:",e,")?")}function Be(...e){return e.map((e=>ke(e))).join("")}function Se(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map((e=>ke(e))).join("|")+")"}function _e(e){return new RegExp(e.toString()+"|").exec("").length-1}const Ne=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Oe(e,{joinWith:t}){let i=0;return e.map((e=>{i+=1;const t=i;let n=ke(e),o="";for(;n.length>0;){const e=Ne.exec(n);if(!e){o+=n;break}o+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?o+="\\"+String(Number(e[1])+t):(o+=e[0],"("===e[0]&&i++)}return o})).map((e=>`(${e})`)).join(t)}const Ae="[a-zA-Z]\\w*",Ie="[a-zA-Z_]\\w*",Re="\\b\\d+(\\.\\d+)?",Le="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Me="\\b(0b[01]+)",Pe={begin:"\\\\[\\s\\S]",relevance:0},Fe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Pe]},De={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Pe]},ze=function(e,t,i={}){const n=be({scope:"comment",begin:e,end:t,contains:[]},i);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=Se("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:Be(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},He=ze("//","$"),Ve=ze("/\\*","\\*/"),We=ze("#","$"),je={scope:"number",begin:Re,relevance:0},Ue={scope:"number",begin:Le,relevance:0},qe={scope:"number",begin:Me,relevance:0},Ke={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Pe,{begin:/\[/,end:/\]/,relevance:0,contains:[Pe]}]},Ze={scope:"title",begin:Ae,relevance:0},Ge={scope:"title",begin:Ie,relevance:0},Xe={begin:"\\.\\s*"+Ie,relevance:0};var Qe=Object.freeze({__proto__:null,APOS_STRING_MODE:Fe,BACKSLASH_ESCAPE:Pe,BINARY_NUMBER_MODE:qe,BINARY_NUMBER_RE:Me,COMMENT:ze,C_BLOCK_COMMENT_MODE:Ve,C_LINE_COMMENT_MODE:He,C_NUMBER_MODE:Ue,C_NUMBER_RE:Le,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:We,IDENT_RE:Ae,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Xe,NUMBER_MODE:je,NUMBER_RE:Re,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:De,REGEXP_MODE:Ke,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Be(t,/.*\b/,e.binary,/\b.*/)),be({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:Ze,UNDERSCORE_IDENT_RE:Ie,UNDERSCORE_TITLE_MODE:Ge});function Je(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Ye(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function et(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Je,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function tt(e,t){Array.isArray(e.illegal)&&(e.illegal=Se(...e.illegal))}function it(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function nt(e,t){void 0===e.relevance&&(e.relevance=1)}const ot=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const i=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=i.keywords,e.begin=Be(i.beforeMatch,$e(i.begin)),e.starts={relevance:0,contains:[Object.assign(i,{endsParent:!0})]},e.relevance=0,delete i.beforeMatch},rt=["of","and","for","in","not","or","if","then","parent","list","value"],st="keyword";function at(e,t,i=st){const n=Object.create(null);return"string"==typeof e?o(i,e.split(" ")):Array.isArray(e)?o(i,e):Object.keys(e).forEach((function(i){Object.assign(n,at(e[i],t,i))})),n;function o(e,i){t&&(i=i.map((e=>e.toLowerCase()))),i.forEach((function(t){const i=t.split("|");n[i[0]]=[e,lt(i[0],i[1])]}))}}function lt(e,t){return t?Number(t):function(e){return rt.includes(e.toLowerCase())}(e)?0:1}const dt={},ct=e=>{console.error(e)},ht=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ut=(e,t)=>{dt[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),dt[`${e}/${t}`]=!0)},ft=new Error;function gt(e,t,{key:i}){let n=0;const o=e[i],r={},s={};for(let a=1;a<=t.length;a++)s[a+n]=o[a],r[a+n]=!0,n+=_e(t[a-1]);e[i]=s,e[i]._emit=r,e[i]._multi=!0}function mt(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ct("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ft;if("object"!=typeof e.beginScope||null===e.beginScope)throw ct("beginScope must be object"),ft;gt(e,e.begin,{key:"beginScope"}),e.begin=Oe(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ct("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ft;if("object"!=typeof e.endScope||null===e.endScope)throw ct("endScope must be object"),ft;gt(e,e.end,{key:"endScope"}),e.end=Oe(e.end,{joinWith:""})}}(e)}function pt(e){function t(t,i){return new RegExp(ke(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(i?"g":""))}class i{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=_e(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(Oe(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex(((e,t)=>t>0&&void 0!==e)),n=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,n)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new i;return this.rules.slice(e).forEach((([e,i])=>t.addRule(e,i))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=be(e.classNameAliases||{}),function i(o,r){const s=o;if(o.isCompiled)return s;[Ye,it,mt,ot].forEach((e=>e(o,r))),e.compilerExtensions.forEach((e=>e(o,r))),o.__beforeBegin=null,[et,tt,nt].forEach((e=>e(o,r))),o.isCompiled=!0;let a=null;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),a=o.keywords.$pattern,delete o.keywords.$pattern),a=a||/\w+/,o.keywords&&(o.keywords=at(o.keywords,e.case_insensitive)),s.keywordPatternRe=t(a,!0),r&&(o.begin||(o.begin=/\B|\b/),s.beginRe=t(s.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(s.endRe=t(s.end)),s.terminatorEnd=ke(s.end)||"",o.endsWithParent&&r.terminatorEnd&&(s.terminatorEnd+=(o.end?"|":"")+r.terminatorEnd)),o.illegal&&(s.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return be(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(bt(e))return be(e,{starts:e.starts?be(e.starts):null});if(Object.isFrozen(e))return be(e);return e}("self"===e?o:e)}))),o.contains.forEach((function(e){i(e,s)})),o.starts&&i(o.starts,r),s.matcher=function(e){const t=new n;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function bt(e){return!!e&&(e.endsWithParent||bt(e.starts))}class yt extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const wt=pe,Et=be,Ct=Symbol("nomatch"),vt=function(e){const t=Object.create(null),i=Object.create(null),n=[];let o=!0;const r="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ve};function l(e){return a.noHighlightRe.test(e)}function d(e,t,i){let n="",o="";"object"==typeof t?(n=e,i=t.ignoreIllegals,o=t.language):(ut("10.7.0","highlight(lang, code, ...args) has been deprecated."),ut("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,n=t),void 0===i&&(i=!0);const r={code:n,language:o};y("before:highlight",r);const s=r.result?r.result:c(r.language,r.code,i);return s.code=r.code,y("after:highlight",s),s}function c(e,i,n,s){const l=Object.create(null);function d(){if(!x.keywords)return void B.addText(S);let e=0;x.keywordPatternRe.lastIndex=0;let t=x.keywordPatternRe.exec(S),i="";for(;t;){i+=S.substring(e,t.index);const o=v.case_insensitive?t[0].toLowerCase():t[0],r=(n=o,x.keywords[n]);if(r){const[e,n]=r;if(B.addText(i),i="",l[o]=(l[o]||0)+1,l[o]<=7&&(_+=n),e.startsWith("_"))i+=t[0];else{const i=v.classNameAliases[e]||e;f(t[0],i)}}else i+=t[0];e=x.keywordPatternRe.lastIndex,t=x.keywordPatternRe.exec(S)}var n;i+=S.substring(e),B.addText(i)}function u(){null!=x.subLanguage?function(){if(""===S)return;let e=null;if("string"==typeof x.subLanguage){if(!t[x.subLanguage])return void B.addText(S);e=c(x.subLanguage,S,!0,T[x.subLanguage]),T[x.subLanguage]=e._top}else e=h(S,x.subLanguage.length?x.subLanguage:null);x.relevance>0&&(_+=e.relevance),B.__addSublanguage(e._emitter,e.language)}():d(),S=""}function f(e,t){""!==e&&(B.startScope(t),B.addText(e),B.endScope())}function g(e,t){let i=1;const n=t.length-1;for(;i<=n;){if(!e._emit[i]){i++;continue}const n=v.classNameAliases[e[i]]||e[i],o=t[i];n?f(o,n):(S=o,d(),S=""),i++}}function p(e,t){return e.scope&&"string"==typeof e.scope&&B.openNode(v.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(S,v.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),S=""):e.beginScope._multi&&(g(e.beginScope,t),S="")),x=Object.create(e,{parent:{value:x}}),x}function b(e,t,i){let n=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(e.endRe,i);if(n){if(e["on:end"]){const i=new me(e);e["on:end"](t,i),i.isMatchIgnored&&(n=!1)}if(n){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return b(e.parent,t,i)}function y(e){return 0===x.matcher.regexIndex?(S+=e[0],1):(A=!0,0)}function w(e){const t=e[0],n=i.substring(e.index),o=b(x,e,n);if(!o)return Ct;const r=x;x.endScope&&x.endScope._wrap?(u(),f(t,x.endScope._wrap)):x.endScope&&x.endScope._multi?(u(),g(x.endScope,e)):r.skip?S+=t:(r.returnEnd||r.excludeEnd||(S+=t),u(),r.excludeEnd&&(S=t));do{x.scope&&B.closeNode(),x.skip||x.subLanguage||(_+=x.relevance),x=x.parent}while(x!==o.parent);return o.starts&&p(o.starts,e),r.returnEnd?0:t.length}let E={};function C(t,r){const s=r&&r[0];if(S+=t,null==s)return u(),0;if("begin"===E.type&&"end"===r.type&&E.index===r.index&&""===s){if(S+=i.slice(r.index,r.index+1),!o){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=E.rule,t}return 1}if(E=r,"begin"===r.type)return function(e){const t=e[0],i=e.rule,n=new me(i),o=[i.__beforeBegin,i["on:begin"]];for(const r of o)if(r&&(r(e,n),n.isMatchIgnored))return y(t);return i.skip?S+=t:(i.excludeBegin&&(S+=t),u(),i.returnBegin||i.excludeBegin||(S=t)),p(i,e),i.returnBegin?0:t.length}(r);if("illegal"===r.type&&!n){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(x.scope||"<unnamed>")+'"');throw e.mode=x,e}if("end"===r.type){const e=w(r);if(e!==Ct)return e}if("illegal"===r.type&&""===s)return 1;if(O>1e5&&O>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return S+=s,s.length}const v=m(e);if(!v)throw ct(r.replace("{}",e)),new Error('Unknown language: "'+e+'"');const k=pt(v);let $="",x=s||k;const T={},B=new a.__emitter(a);!function(){const e=[];for(let t=x;t!==v;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>B.openNode(e)))}();let S="",_=0,N=0,O=0,A=!1;try{if(v.__emitTokens)v.__emitTokens(i,B);else{for(x.matcher.considerAll();;){O++,A?A=!1:x.matcher.considerAll(),x.matcher.lastIndex=N;const e=x.matcher.exec(i);if(!e)break;const t=C(i.substring(N,e.index),e);N=e.index+t}C(i.substring(N))}return B.finalize(),$=B.toHTML(),{language:e,value:$,relevance:_,illegal:!1,_emitter:B,_top:x}}catch(I){if(I.message&&I.message.includes("Illegal"))return{language:e,value:wt(i),illegal:!0,relevance:0,_illegalBy:{message:I.message,index:N,context:i.slice(N-100,N+100),mode:I.mode,resultSoFar:$},_emitter:B};if(o)return{language:e,value:wt(i),illegal:!1,relevance:0,errorRaised:I,_emitter:B,_top:x};throw I}}function h(e,i){i=i||a.languages||Object.keys(t);const n=function(e){const t={value:wt(e),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t}(e),o=i.filter(m).filter(b).map((t=>c(t,e,!1)));o.unshift(n);const r=o.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(m(e.language).supersetOf===t.language)return 1;if(m(t.language).supersetOf===e.language)return-1}return 0})),[l,d]=r,h=l;return h.secondBest=d,h}function u(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=a.languageDetectRe.exec(t);if(i){const t=m(i[1]);return t||(ht(r.replace("{}",i[1])),ht("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find((e=>l(e)||m(e)))}(e);if(l(n))return;if(y("before:highlightElement",{el:e,language:n}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML)){throw new yt("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const o=t.textContent,s=n?d(o,{language:n,ignoreIllegals:!0}):h(o);e.innerHTML=s.value,e.dataset.highlighted="yes",function(e,t,n){const o=t&&i[t]||n;e.classList.add("hljs"),e.classList.add(`language-${o}`)}(e,n,s.language),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:e,result:s,text:o})}let f=!1;function g(){if("loading"===document.readyState)return void(f=!0);document.querySelectorAll(a.cssSelector).forEach(u)}function m(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function p(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{i[e.toLowerCase()]=t}))}function b(e){const t=m(e);return t&&!t.disableAutodetect}function y(e,t){const i=e;n.forEach((function(e){e[i]&&e[i](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){f&&g()}),!1),Object.assign(e,{highlight:d,highlightAuto:h,highlightAll:g,highlightElement:u,highlightBlock:function(e){return ut("10.7.0","highlightBlock will be removed entirely in v12.0"),ut("10.7.0","Please use highlightElement now."),u(e)},configure:function(e){a=Et(a,e)},initHighlighting:()=>{g(),ut("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){g(),ut("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(i,n){let r=null;try{r=n(e)}catch(a){if(ct("Language definition for '{}' could not be registered.".replace("{}",i)),!o)throw a;ct(a),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=n.bind(null,e),r.aliases&&p(r.aliases,{languageName:i})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(i))i[t]===e&&delete i[t]},listLanguages:function(){return Object.keys(t)},getLanguage:m,registerAliases:p,autoDetection:b,inherit:Et,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),n.push(e)},removePlugin:function(e){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString="11.9.0",e.regex={concat:Be,lookahead:$e,either:Se,optional:Te,anyNumberOfTimes:xe};for(const w in Qe)"object"==typeof Qe[w]&&ge(Qe[w]);return Object.assign(e,Qe),e},kt=vt({});kt.newInstance=()=>vt({});var $t=kt;kt.HighlightJS=kt,kt.default=kt;const xt=fe($t);const Tt="[A-Za-z$_][0-9A-Za-z$_]*",Bt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],St=["true","false","null","undefined","NaN","Infinity"],_t=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Nt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ot=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],At=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],It=[].concat(Ot,_t,Nt);var Rt="[0-9](_*[0-9])*",Lt=`\\.(${Rt})`,Mt="[0-9a-fA-F](_*[0-9a-fA-F])*",Pt={className:"number",variants:[{begin:`(\\b(${Rt})((${Lt})|\\.)?|(${Lt}))[eE][+-]?(${Rt})[fFdD]?\\b`},{begin:`\\b(${Rt})((${Lt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Lt})[fFdD]?\\b`},{begin:`\\b(${Rt})[fFdD]\\b`},{begin:`\\b0[xX]((${Mt})\\.?|(${Mt})?\\.(${Mt}))[pP][+-]?(${Rt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Mt})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ft(e,t,i){return-1===i?"":e.replace(t,(n=>Ft(e,t,i-1)))}const Dt="[A-Za-z$_][0-9A-Za-z$_]*",zt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Ht=["true","false","null","undefined","NaN","Infinity"],Vt=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Wt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ut=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qt=[].concat(jt,Vt,Wt);const Kt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Zt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Gt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Xt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Qt=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();const Jt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Yt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],ei=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],ti=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ii=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),ni=ei.concat(ti);const oi=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ri=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],si=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],ai=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],li=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function di(e){return e?"string"==typeof e?e:e.source:null}function ci(e){return hi("(?=",e,")")}function hi(...e){return e.map((e=>di(e))).join("")}function ui(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map((e=>di(e))).join("|")+")"}const fi=e=>hi(/\b/,e,/\w$/.test(e)?/\b/:/\B/),gi=["Protocol","Type"].map(fi),mi=["init","self"].map(fi),pi=["Any","Self"],bi=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],yi=["false","nil","true"],wi=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ei=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Ci=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],vi=ui(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),ki=ui(vi,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),$i=hi(vi,ki,"*"),xi=ui(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Ti=ui(xi,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Bi=hi(xi,Ti,"*"),Si=hi(/[A-Z]/,Ti,"*"),_i=["attached","autoclosure",hi(/convention\(/,ui("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",hi(/objc\(/,Bi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Ni=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];xt.registerLanguage("plaintext",(function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),xt.registerLanguage("json",(function(e){const t=["true","false","null"],i={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),xt.registerLanguage("javascript",(function(e){const t=e.regex,i=Tt,n="<>",o="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const i=e[0].length+e.index,n=e.input[i];if("<"===n||","===n)return void t.ignoreMatch();let o;">"===n&&(((e,{after:t})=>{const i="</"+e[0].slice(1);return-1!==e.input.indexOf(i,t)})(e,{after:i})||t.ignoreMatch());const r=e.input.substring(i);((o=r.match(/^\s*=/))||(o=r.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},s={$pattern:Tt,keyword:Bt,literal:St,built_in:It,"variable.language":At},a="[0-9](_?[0-9])*",l=`\\.(${a})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",c={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},u={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},f={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},g={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},p={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,f,g,m,{match:/\$\d+/},c];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});const y=[].concat(p,h.contains),w=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:w},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._t,...Nt]}},k={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},$={match:t.concat(/\b/,(x=[...Ot,"super","import"],t.concat("(?!",x.join("|"),")")),i,t.lookahead(/\(/)),className:"title.function",relevance:0};var x;const T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,f,g,m,p,{match:/\$\d+/},c,v,{className:"attr",begin:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},$,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},C,B,{match:/\$[(.]/}]}})),xt.registerLanguage("java",(function(e){const t=e.regex,i="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=i+Ft("(?:<"+i+"~~~(?:\\s*,\\s*"+i+"~~~)*>)?",/~~~/g,2),o={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},r={className:"meta",begin:"@"+i,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:o,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,i),/\s+/,i,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,i],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:o,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Pt,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Pt,r]}})),xt.registerLanguage("typescript",(function(e){const t=function(e){const t=e.regex,i=Dt,n="<>",o="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const i=e[0].length+e.index,n=e.input[i];if("<"===n||","===n)return void t.ignoreMatch();let o;">"===n&&(((e,{after:t})=>{const i="</"+e[0].slice(1);return-1!==e.input.indexOf(i,t)})(e,{after:i})||t.ignoreMatch());const r=e.input.substring(i);((o=r.match(/^\s*=/))||(o=r.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},s={$pattern:Dt,keyword:zt,literal:Ht,built_in:qt,"variable.language":Ut},a="[0-9](_?[0-9])*",l=`\\.(${a})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",c={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},u={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},f={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},g={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},p={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,f,g,m,{match:/\$\d+/},c];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});const y=[].concat(p,h.contains),w=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:w},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Vt,...Wt]}},k={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},$={match:t.concat(/\b/,(x=[...jt,"super","import"],t.concat("(?!",x.join("|"),")")),i,t.lookahead(/\(/)),className:"title.function",relevance:0};var x;const T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,f,g,m,p,{match:/\$\d+/},c,v,{className:"attr",begin:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},$,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},C,B,{match:/\$[(.]/}]}}(e),i=Dt,n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},r={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[t.exports.CLASS_REFERENCE]},s={$pattern:Dt,keyword:zt.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:Ht,built_in:qt.concat(n),"variable.language":Ut},a={className:"meta",begin:"@"+i},l=(e,t,i)=>{const n=e.contains.findIndex((e=>e.label===t));if(-1===n)throw new Error("can not find mode to replace");e.contains.splice(n,1,i)};return Object.assign(t.keywords,s),t.exports.PARAMS_CONTAINS.push(a),t.contains=t.contains.concat([a,o,r]),l(t,"shebang",e.SHEBANG()),l(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),t.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t})),xt.registerLanguage("html",(function(e){const t=e.regex,i=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(o,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[n]},{begin:/'/,end:/'/,contains:[n]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,a,s,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,r,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},n,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(i,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),xt.registerLanguage("markdown",(function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},n={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},r=e.inherit(n,{contains:[]}),s=e.inherit(o,{contains:[]});n.contains.push(s),o.contains.push(r);let a=[t,i];return[n,o,r,s].forEach((e=>{e.contains=e.contains.concat(a)})),a=a.concat(n,o),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},n,o,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},i,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}})),xt.registerLanguage("css",(function(e){const t=e.regex,i=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[i.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Gt.join("|")+")"},{begin:":(:)?("+Xt.join("|")+")"}]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Qt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[i.BLOCK_COMMENT,i.HEXCOLOR,i.IMPORTANT,i.CSS_NUMBER_MODE,...n,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...n,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},i.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Zt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...n,i.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Kt.join("|")+")\\b"}]}})),xt.registerLanguage("less",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),i=ni,n="[\\w-]+",o="("+n+"|@\\{"+n+"\\})",r=[],s=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,i){return{className:e,begin:t,relevance:i}},d={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Yt.join(" ")},c={begin:"\\(",end:"\\)",contains:s,keywords:d,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,c,l("variable","@@?"+n,10),l("variable","@\\{"+n+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:n+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=s.concat({begin:/\{/,end:/\}/,contains:r}),u={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},f={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ii.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:s,relevance:0}},m={className:"variable",variants:[{begin:"@"+n+"\\s*:",relevance:15},{begin:"@"+n}],starts:{end:"[;}]",returnEnd:!0,contains:h}},p={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,l("keyword","all\\b"),l("variable","@\\{"+n+"\\}"),{begin:"\\b("+Jt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",o,0),l("selector-id","#"+o),l("selector-class","\\."+o,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+ei.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ti.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:n+`:(:)?(${i.join("|")})`,returnBegin:!0,contains:[p]};return r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,m,b,f,p,u,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:r}})),xt.registerLanguage("scss",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),i=ai,n=si,o="@[a-z-]+",r={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+oi.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+i.join("|")+")"},r,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+li.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,r,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ri.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},r,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}})),xt.registerLanguage("objectivec",(function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,i={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+i.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}})),xt.registerLanguage("swift",(function(e){const t={match:/\s+/,relevance:0},i=e.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[e.C_LINE_COMMENT_MODE,i],o={match:[/\./,ui(...gi,...mi)],className:{2:"keyword"}},r={match:hi(/\./,ui(...bi)),relevance:0},s=bi.filter((e=>"string"==typeof e)).concat(["_|0"]),a={variants:[{className:"keyword",match:ui(...bi.filter((e=>"string"!=typeof e)).concat(pi).map(fi),...mi)}]},l={$pattern:ui(/\b\w+/,/#\w+/),keyword:s.concat(Ei),literal:yi},d=[o,r,a],c=[{match:hi(/\./,ui(...Ci)),relevance:0},{className:"built_in",match:hi(/\b/,ui(...Ci),/(?=\()/)}],h={match:/->/,relevance:0},u=[h,{className:"operator",relevance:0,variants:[{match:$i},{match:`\\.(\\.|${ki})+`}]}],f="([0-9]_*)+",g="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${f})(\\.(${f}))?([eE][+-]?(${f}))?\\b`},{match:`\\b0x(${g})(\\.(${g}))?([pP][+-]?(${f}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},p=(e="")=>({className:"subst",variants:[{match:hi(/\\/,e,/[0\\tnr"']/)},{match:hi(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:hi(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst",label:"interpol",begin:hi(/\\/,e,/\(/),end:/\)/}),w=(e="")=>({begin:hi(e,/"""/),end:hi(/"""/,e),contains:[p(e),b(e),y(e)]}),E=(e="")=>({begin:hi(e,/"/),end:hi(/"/,e),contains:[p(e),y(e)]}),C={className:"string",variants:[w(),w("#"),w("##"),w("###"),E(),E("#"),E("##"),E("###")]},v=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],k={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:v},$=e=>{const t=hi(e,/\//),i=hi(/\//,e);return{begin:t,end:i,contains:[...v,{scope:"comment",begin:`#(?!.*${i})`,end:/$/}]}},x={scope:"regexp",variants:[$("###"),$("##"),$("#"),k]},T={match:hi(/`/,Bi,/`/)},B=[T,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${Ti}+`}],S=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Ni,contains:[...u,m,C]}]}},{scope:"keyword",match:hi(/@/,ui(..._i))},{scope:"meta",match:hi(/@/,Bi)}],_={match:ci(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:hi(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Ti,"+")},{className:"type",match:Si,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:hi(/\s+&\s+/,ci(Si)),relevance:0}]},N={begin:/</,end:/>/,keywords:l,contains:[...n,...d,...S,h,_]};_.contains.push(N);const O={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:hi(Bi,/\s*:/),keywords:"_|0",relevance:0},...n,x,...d,...c,...u,m,C,...B,...S,_]},A={begin:/</,end:/>/,keywords:"repeat each",contains:[...n,_]},I={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:ui(ci(hi(Bi,/\s*:/)),ci(hi(Bi,/\s+/,Bi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Bi}]},...n,...d,...u,m,C,...S,_,O],endsParent:!0,illegal:/["']/},R={match:[/(func|macro)/,/\s+/,ui(T.match,Bi,$i)],className:{1:"keyword",3:"title.function"},contains:[A,I,t],illegal:[/\[/,/%/]},L={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[A,I,t],illegal:/\[|%/},M={match:[/operator/,/\s+/,$i],className:{1:"keyword",3:"title"}},P={begin:[/precedencegroup/,/\s+/,Si],className:{1:"keyword",3:"title"},contains:[_],keywords:[...wi,...yi],end:/}/};for(const F of C.variants){const e=F.contains.find((e=>"interpol"===e.label));e.keywords=l;const t=[...d,...c,...u,m,C,...B];e.contains=[...t,{begin:/\(/,end:/\)/,contains:["self",...t]}]}return{name:"Swift",keywords:l,contains:[...n,R,L,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...d]},M,P,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},x,...d,...c,...u,m,C,...B,...S,_,O]}})),xt.registerLanguage("dart",(function(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},i={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},n={className:"string",variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",contains:[e.BACKSLASH_ESCAPE,t,i]},{begin:'"""',end:'"""',contains:[e.BACKSLASH_ESCAPE,t,i]},{begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,i]},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,i]}]};i.contains=[e.C_NUMBER_MODE,n];const o=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],r=o.map((e=>`${e}?`));return{name:"Dart",keywords:{keyword:["abstract","as","assert","async","await","base","break","case","catch","class","const","continue","covariant","default","deferred","do","dynamic","else","enum","export","extends","extension","external","factory","false","final","finally","for","Function","get","hide","if","implements","import","in","interface","is","late","library","mixin","new","null","on","operator","part","required","rethrow","return","sealed","set","show","static","super","switch","sync","this","throw","true","try","typedef","var","void","when","while","with","yield"],built_in:o.concat(r).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),$pattern:/[A-Za-z][A-Za-z0-9_]*\??/},contains:[n,e.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0}),e.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",end:"$",relevance:0}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},e.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}})),xt.registerLanguage("nginx",(function(e){const t=e.regex,i={className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{\w+\}/},{begin:t.concat(/[$@]/,e.UNDERSCORE_IDENT_RE)}]},n={endsWithParent:!0,keywords:{$pattern:/[a-z_]{2,}|\/dev\/poll/,literal:["on","off","yes","no","true","false","none","blocked","debug","info","notice","warn","error","crit","select","break","last","permanent","redirect","kqueue","rtsig","epoll","poll","/dev/poll"]},relevance:0,illegal:"=>",contains:[e.HASH_COMMENT_MODE,{className:"string",contains:[e.BACKSLASH_ESCAPE,i],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[i]},{className:"regexp",contains:[e.BACKSLASH_ESCAPE,i],variants:[{begin:"\\s\\^",end:"\\s|\\{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|\\{|;",returnEnd:!0},{begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number",begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{className:"number",begin:"\\b\\d+[kKmMgGdshdwy]?\\b",relevance:0},i]};return{name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{beginKeywords:"upstream location",end:/;|\{/,contains:n.contains,keywords:{section:"upstream location"}},{className:"section",begin:t.concat(e.UNDERSCORE_IDENT_RE+t.lookahead(/\s+\{/)),relevance:0},{begin:t.lookahead(e.UNDERSCORE_IDENT_RE+"\\s"),end:";|\\{",contains:[{className:"attribute",begin:e.UNDERSCORE_IDENT_RE,starts:n}],relevance:0}],illegal:"[^\\s\\}\\{]"}})),xt.registerLanguage("php",(function(e){const t=e.regex,i=/(?![A-Za-z0-9])(?![$])/,n=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,i),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,i),r={scope:"variable",match:"\\$+"+n},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",d={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),a,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},c={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},h=["false","null","true"],u=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],f=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],g={keyword:u,literal:(e=>{const t=[];return e.forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(h),built_in:f},m=e=>e.map((e=>e.replace(/\|\d+$/,""))),p={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",m(f).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},b=t.concat(n,"\\b(?!\\()"),y={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},w={scope:"attr",match:t.concat(n,t.lookahead(":"),t.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:g,contains:[w,r,y,e.C_BLOCK_COMMENT_MODE,d,c,p]},C={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",m(u).join("\\b|"),"|",m(f).join("\\b|"),"\\b)"),n,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[E]};E.contains.push(C);const v=[w,y,e.C_BLOCK_COMMENT_MODE,d,c,p];return{case_insensitive:!1,keywords:g,contains:[{begin:t.concat(/#\[\s*/,o),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:h,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:h,keyword:["new","array"]},contains:["self",...v]},...v,{scope:"meta",match:o}]},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},r,C,y,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},p,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:g,contains:["self",r,y,e.C_BLOCK_COMMENT_MODE,d,c]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},d,c]}})),xt.registerLanguage("python",(function(e){const t=e.regex,i=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},r={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,r,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,r,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",c=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,h=`\\b|${n.join("|")}`,u={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${c}))[eE][+-]?(${d})[jJ]?(?=${h})`},{begin:`(${c})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${d})[jJ](?=${h})`}]},f={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",r,u,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,u,r],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[r,u,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,f,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[u,g,l]}]}})),xt.configure({cssSelector:"pre",classPrefix:"editify-hljs-",ignoreUnescapedHTML:!0});const Oi=["plaintext","json","javascript","html","css","less","scss","java","markdown","swift","objectivec","typescript","dart","nginx","php","python"],Ai={marks:{"data-editify-list":["div"],"data-editify-value":["div"],"data-editify-code":["span"],"data-editify-task":["div"],contenteditable:"*",src:["img","video"],autoplay:["video"],loop:["video"],muted:["video"],href:["a"],target:["a"],alt:["img"],controls:["video"],name:"*",disabled:"*",colspan:["td"]},styles:{"text-indent":"*","text-align":"*"}},Ii={modelValue:{type:String,default:"<p><br></p>"},placeholder:{type:String,default:""},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},allowCopy:{type:Boolean,default:!0},allowPaste:{type:Boolean,default:!0},allowCut:{type:Boolean,default:!0},allowPasteHtml:{type:Boolean,default:!1},height:{type:String,default:"600px"},autoheight:{type:Boolean,default:!1},border:{type:Boolean,default:!1},color:{type:String,default:"#03a8f3",validator:e=>ue.common.matchingText(e,"hex")},videoRatio:{type:Number,default:16/9},toolbar:{type:Object,default:null},showWordLength:{type:Boolean,default:!1},customImagePaste:{type:Function,default:null},customVideoPaste:{type:Function,default:null},menu:{type:Object,default:null}},Ri=(e,t)=>{if(!ue.common.isObject(e)&&ue.common.isObject(t))return null;for(let i in t)ue.common.isObject(t[i])&&!Array.isArray(t[i])&&ue.common.isObject(e[i])&&!Array.isArray(e[i])?e[i]=Ri(e[i],t[i]):e[i]=t[i];return e},Li=(e,t=!1)=>"block"==e.type&&"div"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-list"]==(t?"ol":"ul"),Mi=e=>"block"==e.type&&"div"==e.parsedom&&e.hasMarks()&&e.marks.hasOwnProperty("data-editify-task"),Pi=e=>{e.marks=null,e.styles=null,e.parsedom=k.BLOCK_NODE},Fi=(e,t=!1)=>{Li(e,t)||(Pi(e),e.parsedom="div",e.hasMarks()||(e.marks={}),e.marks["data-editify-list"]=t?"ol":"ul")},Di=e=>{Mi(e)||(Pi(e),e.parsedom="div",e.hasMarks()||(e.marks={}),e.marks["data-editify-task"]="uncheck")},zi=function(e){if("ol"!=e.parsedom&&"ul"!=e.parsedom||(e.hasChildren()&&e.children.forEach(((t,i)=>{const n=t.clone();n.parsedom="div",n.type="block",n.hasMarks()||(n.marks={}),n.marks["data-editify-list"]=e.parsedom,"ol"==e.parsedom&&(n.marks["data-editify-value"]=i+1),this.addElementAfter(n,e)})),e.toEmpty()),"block"==e.type&&e.hasMarks()&&"ol"==e.marks["data-editify-list"]){const t=this.getPreviousElement(e);if(t&&t.hasMarks()&&"ol"==t.marks["data-editify-list"]){const i=Number(t.marks["data-editify-value"]);e.marks["data-editify-value"]=i+1}else e.marks["data-editify-value"]=1}},Hi=function(e){if("code"==e.parsedom){e.parsedom="span";const t={"data-editify-code":!0};e.hasMarks()?Object.assign(e.marks,t):e.marks=t}},Vi=function(e){if("img"==e.parsedom||"video"==e.parsedom||"a"==e.parsedom){const t={"data-editify-element":e.key};e.hasMarks()?Object.assign(e.marks,t):e.marks=t}if("video"==e.parsedom){const t=this.getPreviousElement(e),i=this.getNextElement(e);if(!t||t.isEmpty()){const t=k.getSpaceElement();this.addElementBefore(t,e)}if(!i||i.isEmpty()){const t=k.getSpaceElement();this.addElementAfter(t,e)}}},Wi=function(e){if("table"==e.parsedom){const t={"data-editify-element":e.key};e.hasMarks()?Object.assign(e.marks,t):e.marks=t;const i=k.flatElements(e.children),n=i.filter((e=>"tr"==e.parsedom));let o=i.find((e=>"colgroup"==e.parsedom));if(o)o.children.forEach((e=>{e.hasMarks()?e.marks.width||(e.marks.width="auto"):e.marks={width:"auto"}}));else{o=new k("inblock","colgroup",null,null,null);for(let e=(e=>{const t=(null==e?void 0:e.children)||[];let i=0;return t.forEach((e=>{if(e.hasMarks()&&e.marks.hasOwnProperty("colspan")){const t=Number(e.marks.colspan);isNaN(t)||(i+=t)}else i+=1})),i})(n[0])-1;e>=0;e--){const e=new k("closed","col",{width:"auto"},null,null);this.addElementTo(e,o)}}e.children=[];const r=new k("inblock","tbody",null,null,null);n.reverse().forEach((e=>{this.addElementTo(e,r)})),this.addElementTo(r,e),this.addElementTo(o,e)}else"th"==e.parsedom&&(e.parsedom="td")},ji=function(e,t,i){if(this.range){if(this.range.anchor.element.getBlock().isEqual(e)){const e=t.findIndex((e=>this.range.anchor.element.isEqual(e))),n=t.filter(((t,i)=>i<e)).reduce(((e,t,i)=>e+t.textContent.length),0)+this.range.anchor.offset,o=k.flatElements(i).filter((e=>e.isText()&&!e.isEmpty()));let r=0,s=0;for(;r<o.length;){let e=s+o[r].textContent.length;if(n>=s&&n<=e){this.range.anchor.element=o[r],this.range.anchor.offset=n-s;break}r++,s=e}}if(this.range.focus.element.getBlock().isEqual(e)){const e=t.findIndex((e=>this.range.focus.element.isEqual(e))),n=t.filter(((t,i)=>i<e)).reduce(((e,t,i)=>e+t.textContent.length),0)+this.range.focus.offset,o=k.flatElements(i).filter((e=>e.isText()&&!e.isEmpty()));let r=0,s=0;for(;r<o.length;){let e=s+o[r].textContent.length;if(n>=s&&n<=e){this.range.focus.element=o[r],this.range.focus.offset=n-s;break}r++,s=e}}}},Ui=function(e,t,i){if((e.isBlock()||e.isInblock())&&e.isPreStyle()){const n={"data-editify-element":e.key};if(e.hasMarks()?Object.assign(e.marks,n):e.marks=n,t&&e.hasChildren()){let t=e.marks["data-editify-hljs"]||"";t&&i&&!i.includes(t)&&(t="");const n=k.flatElements(e.children).filter((e=>e.isText()&&!e.isEmpty())),o=function(e,t){return t?xt.highlight(e,{language:t,ignoreIllegals:!0}).value:xt.highlightAuto(e).value}(n.reduce(((e,t)=>e+t.textContent),""),t);if(o){const t=this.parseHtml(o);ji.apply(this,[e,n,t]),e.children=t,t.forEach((t=>{t.parent=e}))}}}},qi=function(e,t){return{heading:[{label:e("text"),value:"p"},{label:e("h1"),value:"h1",style:{fontSize:"26px",fontWeight:"bold"}},{label:e("h2"),value:"h2",style:{fontSize:"24px",fontWeight:"bold"}},{label:e("h3"),value:"h3",style:{fontSize:"22px",fontWeight:"bold"}},{label:e("h4"),value:"h4",style:{fontSize:"20px",fontWeight:"bold"}},{label:e("h5"),value:"h5",style:{fontSize:"18px",fontWeight:"bold"}},{label:e("h6"),value:"h6",style:{fontSize:"16px",fontWeight:"bold"}}],indent:[{label:e("indentIncrease"),value:"indent-increase",icon:"indent-increase"},{label:e("indentDecrease"),value:"indent-decrease",icon:"indent-decrease"}],align:[{label:e("alignLeft"),value:"left",icon:"align-left"},{label:e("alignRight"),value:"right",icon:"align-right"},{label:e("alignCenter"),value:"center",icon:"align-center"},{label:e("alignJustify"),value:"justify",icon:"align-justify"}],fontSize:[{label:e("defaultSize"),value:""},{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"},{label:"36px",value:"36px"},{label:"40px",value:"40px"}],fontFamily:[{label:e("defaultFontFamily"),value:""},{label:"黑体",value:"黑体,黑体-简"},{label:"华文仿宋",value:"华文仿宋"},{label:"楷体",value:"楷体,楷体-简"},{label:"华文楷体",value:"华文楷体"},{label:"宋体",value:"宋体,宋体-简"},{label:"Arial",value:"Arial"},{label:"Consolas",value:"Consolas,monospace"}],lineHeight:[{label:e("defaultLineHeight"),value:""},1,1.15,1.5,2,2.5,3],foreColor:["#000000","#505050","#808080","#BBBBBB","#CCCCCC","#EEEEEE","#F7F7F7","#FFFFFF","#EC1A0A","#FF9900","#FFFF00","#07C160","#00FFFF","#0B73DE","#9C00FF","#FF00FF","#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE","#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD","#e45649","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5","#CE0000","#E79439","#EFC631","#50a14f","#4A7B8C","#03A8F3","#634AA5","#A54A7B","#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842","#630000","#7B3900","#986801","#295218","#083139","#003163","#21104A","#4A1031"],backColor:["#000000","#505050","#808080","#BBBBBB","#CCCCCC","#EEEEEE","#F7F7F7","#FFFFFF","#EC1A0A","#FF9900","#FFFF00","#07C160","#00FFFF","#0B73DE","#9C00FF","#FF00FF","#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE","#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD","#e45649","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5","#CE0000","#E79439","#EFC631","#50a14f","#4A7B8C","#03A8F3","#634AA5","#A54A7B","#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842","#630000","#7B3900","#986801","#295218","#083139","#003163","#21104A","#4A1031"]}},Ki=(e,t)=>{const i=e.__vccOpts||e;for(const[n,o]of t)i[n]=o;return i},Zi=["data-editify-placement"];const Gi={name:"Layer",emits:["update:modelValue","show","shown","hidden"],props:{modelValue:{type:Boolean,default:!1},node:{type:[String,Node],default:null},border:{type:Boolean,default:!1},borderColor:{type:String,default:null},background:{type:String,default:null},color:{type:String,default:null},placement:{type:String,default:"bottom",validator:e=>["top","bottom","top-start","top-end","bottom-start","bottom-end"].includes(e)},showTriangle:{type:Boolean,default:!1},zIndex:{type:Number,default:10},animation:{type:String,default:null,validator:e=>["translate","fade",null].includes(e)},useRange:{type:Boolean,default:!1}},setup:()=>({uid:t.getCurrentInstance().uid}),data:()=>({realPlacement:null,triangleSize:6}),components:{Triangle:Ki({name:"Triangle",props:{placement:{type:String,default:"top",validator:e=>["top","left","right","bottom"].includes(e)},color:{type:String,default:null},background:{type:String,default:null}},computed:{style(){return"top"==this.placement?{borderBottomColor:this.color?this.color:""}:"bottom"==this.placement?{borderTopColor:this.color?this.color:""}:"left"==this.placement?{borderRightColor:this.color?this.color:""}:"right"==this.placement?{borderLeftColor:this.color?this.color:""}:void 0},elStyle(){return"top"==this.placement?{borderBottomColor:this.background?this.background:""}:"bottom"==this.placement?{borderTopColor:this.background?this.background:""}:"left"==this.placement?{borderRightColor:this.background?this.background:""}:"right"==this.placement?{borderLeftColor:this.background?this.background:""}:void 0}}},[["render",function(e,i,n,o,r,s){return t.openBlock(),t.createElementBlock("div",{class:"editify-triangle",style:t.normalizeStyle(s.style),"data-editify-placement":n.placement},[t.createElementVNode("div",{class:"editify-triangle-el",style:t.normalizeStyle(s.elStyle)},null,4)],12,Zi)}],["__scopeId","data-v-70b6f344"]])},computed:{triPlacement(){return"bottom-start"==this.realPlacement||"bottom"==this.realPlacement||"bottom-end"==this.realPlacement?"top":"top-start"==this.realPlacement||"top"==this.realPlacement||"top-end"==this.realPlacement?"bottom":"left-start"==this.realPlacement||"left"==this.realPlacement||"left-end"==this.realPlacement?"right":"right-start"==this.realPlacement||"right"==this.realPlacement||"right-end"==this.realPlacement?"left":"top"},wrapStyle(){return{borderColor:this.border&&this.borderColor||"",background:this.background||"",color:this.color||""}}},mounted(){this.modelValue&&this.setPosition(),ue.event.on(window,`click.editify_layer_${this.uid}`,this.handleClick),ue.event.on(window,`resize.editify_layer_${this.uid}`,this.handleResize)},methods:{handleEnter(e){this.setPosition(),this.$emit("show",e)},handleAfterEnter(e){this.$emit("shown",e)},handleAfterLeave(e){this.$emit("hidden",e)},handleResize(){this.modelValue&&this.$emit("update:modelValue",!1)},handleClick(e){ue.element.isElement(this.$el)&&(ue.element.isContains(this.$el.offsetParent,e.target)||this.modelValue&&this.$emit("update:modelValue",!1))},setTrianglePositionByRange(){const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0).getClientRects();if(t.length){const e=t[0],i=t[t.length-1];"top"==this.realPlacement?(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"top-start"==this.realPlacement?(this.$refs.triangle.$el.style.left=(this.$refs.wrap.offsetWidth>e.width?e.width:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"top-end"==this.realPlacement?(this.$refs.triangle.$el.style.left="auto",this.$refs.triangle.$el.style.right=(this.$refs.wrap.offsetWidth>e.width?e.width:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"bottom"==this.realPlacement?(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):"bottom-start"==this.realPlacement?(this.$refs.triangle.$el.style.left=(this.$refs.wrap.offsetWidth>i.width?i.width:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):"bottom-end"==this.realPlacement?(this.$refs.triangle.$el.style.left="auto",this.$refs.triangle.$el.style.right=(this.$refs.wrap.offsetWidth>i.width?i.width:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=1-this.$refs.triangle.$el.offsetHeight+"px",this.$refs.triangle.$el.style.bottom="auto")}}},setTrianglePositionByNode(){const e=this.getNode();ue.element.isElement(e)&&("top"==this.realPlacement?(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"top-start"==this.realPlacement?(this.$refs.triangle.$el.style.left=(this.$refs.wrap.offsetWidth>e.offsetWidth?e.offsetWidth:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"top-end"==this.realPlacement?(this.$refs.triangle.$el.style.left="auto",this.$refs.triangle.$el.style.right=(this.$refs.wrap.offsetWidth>e.offsetWidth?e.offsetWidth:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"bottom"==this.realPlacement?(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):"bottom-start"==this.realPlacement?(this.$refs.triangle.$el.style.left=(this.$refs.wrap.offsetWidth>e.offsetWidth?e.offsetWidth:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):"bottom-end"==this.realPlacement?(this.$refs.triangle.$el.style.left="auto",this.$refs.triangle.$el.style.right=(this.$refs.wrap.offsetWidth>e.offsetWidth?e.offsetWidth:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=1-this.$refs.triangle.$el.offsetHeight+"px",this.$refs.triangle.$el.style.bottom="auto"))},setPositionByRange(){this.realPlacement=null;const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0).getClientRects();if(t.length){const e=t[0],i=t[t.length-1],n=ue.element.getElementBounding(this.$el.offsetParent),o=document.documentElement.clientHeight||window.innerHeight,r=document.documentElement.clientWidth||window.innerWidth;"top"==this.placement||"top-start"==this.placement||"top-end"==this.placement?e.top>=0&&e.top>=n.top&&e.top>=this.$el.offsetHeight?this.realPlacement=this.placement:o-e.bottom>=0&&o-e.bottom>=n.bottom&&o-e.bottom>=this.$el.offsetHeight&&(this.realPlacement="top"==this.placement?"bottom":"top-start"==this.placement?"bottom-start":"bottom-end"):"bottom"!=this.placement&&"bottom-start"!=this.placement&&"bottom-end"!=this.placement||(o-i.bottom>=0&&o-i.bottom>=n.bottom&&o-i.bottom>=this.$el.offsetHeight?this.realPlacement=this.placement:i.top>=0&&i.top>=n.top&&i.top>=this.$el.offsetHeight&&(this.realPlacement="bottom"==this.placement?"top":"bottom-start"==this.placement?"top-start":"top-end")),"top"==this.realPlacement?r-e.right+e.width/2<this.$el.offsetWidth/2?this.realPlacement="top-end":e.left+e.width/2<this.$el.offsetWidth/2&&(this.realPlacement="top-start"):"bottom"==this.realPlacement?r-i.right+i.width/2<this.$el.offsetWidth/2?this.realPlacement="bottom-end":i.left+i.width/2<this.$el.offsetWidth/2&&(this.realPlacement="bottom-start"):"top-start"==this.realPlacement?r-e.right+e.width<this.$el.offsetWidth&&(r-e.right+e.width/2>=this.$el.offsetWidth/2?this.realPlacement="top":this.realPlacement="top-end"):"bottom-start"==this.realPlacement?r-i.right+i.width<this.$el.offsetWidth&&(r-i.right+i.width/2>=this.$el.offsetWidth/2?this.realPlacement="bottom":this.realPlacement="bottom-end"):"top-end"==this.realPlacement?e.left+e.width<this.$el.offsetWidth&&(e.left+e.width/2>=this.$el.offsetWidth/2?this.realPlacement="top":this.realPlacement="top-start"):"bottom-end"==this.realPlacement&&i.left+i.width<this.$el.offsetWidth&&(i.left+i.width/2>=this.$el.offsetWidth/2?this.realPlacement="bottom":this.realPlacement="bottom-start"),this.$nextTick((()=>{"top"==this.realPlacement?(this.$el.style.left=e.left-n.left+e.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto",this.$el.style.top=e.top-n.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"top-start"==this.realPlacement?(this.$el.style.left=e.left-n.left+"px",this.$el.style.right="auto",this.$el.style.top=e.top-n.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"top-end"==this.realPlacement?(this.$el.style.left="auto",this.$el.style.right=r-e.right-n.right+"px",this.$el.style.top=e.top-n.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"bottom"==this.realPlacement?(this.$el.style.left=i.left-n.left+i.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto",this.$el.style.top="auto",this.$el.style.bottom=o-i.bottom-n.bottom-this.$el.offsetHeight+"px"):"bottom-start"==this.realPlacement?(this.$el.style.left=i.left-n.left+"px",this.$el.style.right="auto",this.$el.style.top="auto",this.$el.style.bottom=o-i.bottom-n.bottom-this.$el.offsetHeight+"px"):"bottom-end"==this.realPlacement?(this.$el.style.left="auto",this.$el.style.right=r-i.right-n.right+"px",this.$el.style.top="auto",this.$el.style.bottom=o-i.bottom-n.bottom-this.$el.offsetHeight+"px"):(this.$el.style.top="auto",this.$el.style.bottom=(n.bottom<0?-n.bottom:0)+"px","top"==this.placement?r-e.right+e.width/2<this.$el.offsetWidth/2?(this.$el.style.left="auto",this.$el.style.right=r-e.right-n.right+"px"):e.left+e.width/2<this.$el.offsetWidth/2?(this.$el.style.left=e.left-n.left+"px",this.$el.style.right="auto"):(this.$el.style.left=e.left-n.left+e.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):"bottom"==this.placement?r-i.right+i.width/2<this.$el.offsetWidth/2?(this.$el.style.left="auto",this.$el.style.right=r-i.right-n.right+"px"):i.left+i.width/2<this.$el.offsetWidth/2?(this.$el.style.left=i.left-n.left+"px",this.$el.style.right="auto"):(this.$el.style.left=i.left-n.left+i.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):"top-start"==this.placement?r-e.right+e.width<this.$el.offsetWidth?r-e.right+e.width/2>=this.$el.offsetWidth/2?(this.$el.style.left=e.left-n.left+e.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=r-e.right-n.right+"px"):(this.$el.style.left=e.left-n.left+"px",this.$el.style.right="auto"):"bottom-start"==this.placement?r-i.right+i.width<this.$el.offsetWidth?r-i.right+i.width/2>=this.$el.offsetWidth/2?(this.$el.style.left=i.left-n.left+i.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=r-i.right-n.right+"px"):(this.$el.style.left=i.left-n.left+"px",this.$el.style.right="auto"):"top-end"==this.placement?e.left+e.width<this.$el.offsetWidth?e.left+e.width/2>=this.$el.offsetWidth/2?(this.$el.style.left=e.left-n.left+e.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left=e.left-n.left+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=r-e.right-n.right+"px"):"bottom-end"==this.placement&&(i.left+i.width<this.$el.offsetWidth?i.left+i.width/2>=this.$el.offsetWidth/2?(this.$el.style.left=i.left-n.left+i.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left=i.left-n.left+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=r-i.right-n.right+"px"))),this.showTriangle&&this.setTrianglePositionByRange()}))}}},setPositionByNode(){const e=this.getNode();if(!ue.element.isElement(e))return;this.realPlacement=null;const t=ue.element.getElementBounding(e),i=ue.element.getElementBounding(this.$el.offsetParent);"top"==this.placement||"top-start"==this.placement||"top-end"==this.placement?t.top>=0&&t.top>=i.top&&t.top>=this.$el.offsetHeight?this.realPlacement=this.placement:t.bottom>=0&&t.bottom>=i.bottom&&t.bottom>=this.$el.offsetHeight&&(this.realPlacement="top"==this.placement?"bottom":"top-start"==this.placement?"bottom-start":"bottom-end"):"bottom"!=this.placement&&"bottom-start"!=this.placement&&"bottom-end"!=this.placement||(t.bottom>=0&&t.bottom>=i.bottom&&t.bottom>=this.$el.offsetHeight?this.realPlacement=this.placement:t.top>=0&&t.top>=i.top&&t.top>=this.$el.offsetHeight&&(this.realPlacement="bottom"==this.placement?"top":"bottom-start"==this.placement?"top-start":"top-end")),"top"==this.realPlacement?t.right+e.offsetWidth/2<this.$el.offsetWidth/2?this.realPlacement="top-end":t.left+e.offsetWidth/2<this.$el.offsetWidth/2&&(this.realPlacement="top-start"):"top-start"==this.realPlacement?t.right+e.offsetWidth<this.$el.offsetWidth&&(t.right+e.offsetWidth/2>=this.$el.offsetWidth/2?this.realPlacement="top":this.realPlacement="top-end"):"top-end"==this.realPlacement?t.left+e.offsetWidth<this.$el.offsetWidth&&(t.left+e.offsetWidth/2>=this.$el.offsetWidth/2?this.realPlacement="top":this.realPlacement="top-start"):"bottom"==this.realPlacement?t.right+e.offsetWidth/2<this.$el.offsetWidth/2?this.realPlacement="bottom-end":t.left+e.offsetWidth/2<this.$el.offsetWidth/2&&(this.realPlacement="bottom-start"):"bottom-start"==this.realPlacement?t.right+e.offsetWidth<this.$el.offsetWidth&&(t.right+e.offsetWidth/2>=this.$el.offsetWidth/2?this.realPlacement="bottom":this.realPlacement="bottom-end"):"bottom-end"==this.realPlacement&&t.left+e.offsetWidth<this.$el.offsetWidth&&(t.left+e.offsetWidth/2>=this.$el.offsetWidth/2?this.realPlacement="bottom":this.realPlacement="bottom-start"),this.$nextTick((()=>{"top"==this.realPlacement?(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto",this.$el.style.top=t.top-i.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"top-start"==this.realPlacement?(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto",this.$el.style.top=t.top-i.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"top-end"==this.realPlacement?(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px",this.$el.style.top=t.top-i.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"bottom"==this.realPlacement?(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto",this.$el.style.top="auto",this.$el.style.bottom=t.bottom-i.bottom-this.$el.offsetHeight+"px"):"bottom-start"==this.realPlacement?(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto",this.$el.style.top="auto",this.$el.style.bottom=t.bottom-i.bottom-this.$el.offsetHeight+"px"):"bottom-end"==this.realPlacement?(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px",this.$el.style.top="auto",this.$el.style.bottom=t.bottom-i.bottom-this.$el.offsetHeight+"px"):(this.$el.style.top="auto",this.$el.style.bottom=(i.bottom<0?-i.bottom:0)+"px","top"==this.placement||"bottom"==this.placement?t.right+e.offsetWidth/2<this.$el.offsetWidth/2?(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px"):t.left+e.offsetWidth/2<this.$el.offsetWidth/2?(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto"):(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):"top-start"==this.placement||"bottom-start"==this.placement?t.right+e.offsetWidth<this.$el.offsetWidth?t.right+e.offsetWidth/2>=this.$el.offsetWidth/2?(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px"):(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto"):"top-end"!=this.placement&&"bottom-end"!=this.placement||(t.left+e.offsetWidth<this.$el.offsetWidth?t.left+e.offsetWidth/2>=this.$el.offsetWidth/2?(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px"))),this.showTriangle&&this.setTrianglePositionByNode()}))},setPosition(){this.useRange?this.setPositionByRange():this.setPositionByNode()},getNode(){return this.node?ue.element.isElement(this.node)?this.node:document.body.querySelector(this.node):null}},beforeUnmount(){ue.event.off(window,`click.editify_layer_${this.uid} resize.editify_layer_${this.uid}`)}},Xi=["data-editify-placement"];const Qi=Ki(Gi,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Triangle");return t.openBlock(),t.createBlock(t.Transition,{name:n.animation?"editify-layer-"+n.animation:"editify-layer",onEnter:s.handleEnter,onAfterEnter:s.handleAfterEnter,onAfterLeave:s.handleAfterLeave},{default:t.withCtx((()=>[n.modelValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:"editify-layer","data-editify-placement":r.realPlacement||null,style:t.normalizeStyle({zIndex:n.zIndex})},[n.showTriangle?(t.openBlock(),t.createBlock(a,{key:0,color:n.border&&n.borderColor?n.borderColor:n.background,background:n.background,placement:s.triPlacement,ref:"triangle"},null,8,["color","background","placement"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"wrap",class:t.normalizeClass(["editify-layer-wrap",{border:n.border}]),style:t.normalizeStyle(s.wrapStyle)},[t.renderSlot(e.$slots,"default",{},void 0,!0)],6)],12,Xi)):t.createCommentVNode("",!0)])),_:3},8,["name","onEnter","onAfterEnter","onAfterLeave"])}],["__scopeId","data-v-503cf323"]]),Ji={name:"Tooltip",props:{content:{type:String,default:""},disabled:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},data:()=>({show:!1,node:null}),components:{Layer:Qi},methods:{showContent(){this.disabled||(this.node=this.$refs.target,this.show=!0)},hideContent(){this.disabled||(this.show=!1)}}},Yi={ref:"target",class:"editify-tooltip-target"},en={class:"editify-tooltip-content"};const tn=Ki(Ji,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Layer");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-tooltip",{block:n.block}]),onMouseenter:i[1]||(i[1]=(...e)=>s.showContent&&s.showContent(...e)),onMouseleave:i[2]||(i[2]=(...e)=>s.hideContent&&s.hideContent(...e))},[t.createElementVNode("div",Yi,[t.renderSlot(e.$slots,"default",{},void 0,!0)],512),t.createVNode(a,{modelValue:r.show,"onUpdate:modelValue":i[0]||(i[0]=e=>r.show=e),node:r.node,border:"","border-color":"#000",background:"#000","show-triangle":"",color:"#fff",placement:"bottom",animation:"fade"},{default:t.withCtx((()=>[t.createElementVNode("div",en,t.toDisplayString(n.content),1)])),_:1},8,["modelValue","node"])],34)}],["__scopeId","data-v-5293a020"]]);const nn=Ki({name:"Icon",props:{value:{type:String,default:""}}},[["render",function(e,i,n,o,r,s){return t.openBlock(),t.createElementBlock("i",{class:t.normalizeClass(["editify-icon","editify-icon-"+n.value])},null,2)}],["__scopeId","data-v-5ed6cd4d"]]),on={name:"Button",emits:["operate","layerShow","layerShown","layerHidden"],props:{type:{type:String,default:"default",validator:e=>["default","select","display"].includes(e)},name:{type:String,default:""},title:{type:String,default:""},tooltip:{type:Boolean,default:!1},rightBorder:{type:Boolean,default:!1},leftBorder:{type:Boolean,default:!1},color:{type:String,default:""},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},selectConfig:{type:Object,default:null},displayConfig:{type:Object,default:null},hideScroll:{type:Boolean,default:!1}},data:()=>({layerConfig:{show:!1,node:null},status:null}),computed:{displayLabel(){const e=this.parseDisplayConfig.options.find((e=>e.value==this.parseDisplayConfig.value));return e?e.label:""},cmpOptions(){return"select"==this.type?this.parseSelectConfig.options:this.parseDisplayConfig.options},parseSelectConfig(){let e=[],t="",i="";return ue.common.isObject(this.selectConfig)&&(Array.isArray(this.selectConfig.options)&&(e=this.selectConfig.options.map((e=>ue.common.isObject(e)?{label:e.label,value:e.value,icon:e.icon,style:e.style}:{label:e,value:e}))),"number"==typeof this.selectConfig.width&&(t=this.selectConfig.width),"number"==typeof this.selectConfig.maxHeight&&(i=this.selectConfig.maxHeight)),{options:e,width:t,maxHeight:i}},parseDisplayConfig(){let e=[],t="",i="",n="";if(ue.common.isObject(this.displayConfig)){if("string"!=typeof this.displayConfig.value&&"number"!=typeof this.displayConfig.value||(n=this.displayConfig.value),Array.isArray(this.displayConfig.options)){e=this.displayConfig.options.map((e=>ue.common.isObject(e)?{label:e.label,value:e.value,icon:e.icon,style:e.style}:{label:e,value:e})),!e.find((e=>e.value==n))&&e[0]&&(n=e[0].value)}"number"==typeof this.displayConfig.width&&(t=this.displayConfig.width),"number"==typeof this.displayConfig.maxHeight&&(i=this.displayConfig.maxHeight)}return{options:e,width:t,maxHeight:i,value:n}},parseColor(){return ue.color.hex2rgb(this.color)},btnStyle(){if(this.disabled)return{};if(this.color){if(this.active||"down"==this.status)return{color:this.color,backgroundColor:`rgba(${this.parseColor[0]},${this.parseColor[1]},${this.parseColor[2]},0.15)`};if("hover"==this.status)return{color:`rgba(${this.parseColor[0]},${this.parseColor[1]},${this.parseColor[2]},0.9)`,backgroundColor:`rgba(${this.parseColor[0]},${this.parseColor[1]},${this.parseColor[2]},0.05)`}}return{}}},components:{Tooltip:tn,Layer:Qi,Icon:nn},methods:{hideLayer(){this.layerConfig.show=!1,this.layerConfig.node=null},layerShow(){this.$emit("layerShow")},layerShown(){this.$emit("layerShown")},layerHidden(){this.$emit("layerHidden")},select(e){this.disabled||(this.$emit("operate",this.name,e.value),this.hideLayer())},handleClick(){this.disabled||("default"==this.type?this.$emit("operate",this.name):this.layerConfig.show?this.hideLayer():(this.layerConfig.node=this.$refs.btn,this.layerConfig.show=!0))},handleMouseEnter(){this.status="hover"},handleMouseLeave(){this.status=null},handleMouseDown(){this.status="down"},handleMouseUp(){this.status="hover"}}},rn={class:"editify-button"},sn={key:0,class:"editify-button-slot"},an={key:1},ln={key:1,class:"editify-button-options"},dn=["onClick"],cn={key:1,class:"editify-button-option-flex"};const hn=Ki(on,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon"),l=t.resolveComponent("Tooltip"),d=t.resolveComponent("Layer");return t.openBlock(),t.createElementBlock("div",rn,[t.createElementVNode("div",{class:t.normalizeClass(["editify-button-wrap",{"right-border":n.rightBorder,"left-border":n.leftBorder}])},[t.createVNode(l,{content:n.title,disabled:!n.tooltip},{default:t.withCtx((()=>[t.createElementVNode("div",{ref:"btn",style:t.normalizeStyle(s.btnStyle),class:t.normalizeClass(["editify-button-el",{disabled:n.disabled,active:n.active}]),onMouseenter:i[0]||(i[0]=(...e)=>s.handleMouseEnter&&s.handleMouseEnter(...e)),onMouseleave:i[1]||(i[1]=(...e)=>s.handleMouseLeave&&s.handleMouseLeave(...e)),onMousedown:i[2]||(i[2]=(...e)=>s.handleMouseDown&&s.handleMouseDown(...e)),onMouseup:i[3]||(i[3]=(...e)=>s.handleMouseUp&&s.handleMouseUp(...e)),onClick:i[4]||(i[4]=(...e)=>s.handleClick&&s.handleClick(...e))},["default"==n.type||"select"==n.type?(t.openBlock(),t.createElementBlock("div",sn,[t.renderSlot(e.$slots,"default",{},void 0,!0)])):"display"==n.type?(t.openBlock(),t.createElementBlock("div",an,t.toDisplayString(s.displayLabel),1)):t.createCommentVNode("",!0),"select"==n.type||"display"==n.type?(t.openBlock(),t.createBlock(a,{key:2,value:"caret-down",class:t.normalizeClass(["editify-button-caret",{rotate:r.layerConfig.show}])},null,8,["class"])):t.createCommentVNode("",!0)],38)])),_:3},8,["content","disabled"]),t.createVNode(d,{ref:"layer",modelValue:r.layerConfig.show,"onUpdate:modelValue":i[5]||(i[5]=e=>r.layerConfig.show=e),node:r.layerConfig.node,border:"",fade:"",placement:"bottom-start","z-index":20,animation:"translate",onShow:s.layerShow,onShown:s.layerShown,onHidden:s.layerHidden},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"editify-button-layer",style:t.normalizeStyle({width:("select"==n.type?s.parseSelectConfig.width:s.parseDisplayConfig.width)+"px",maxHeight:("select"==n.type?s.parseSelectConfig.maxHeight:s.parseDisplayConfig.maxHeight)+"px",overflow:n.hideScroll?"visible":""})},[e.$slots.layer?t.renderSlot(e.$slots,"layer",{key:0,options:s.cmpOptions},void 0,!0):(t.openBlock(),t.createElementBlock("div",ln,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.cmpOptions,(i=>(t.openBlock(),t.createElementBlock("div",{onClick:e=>s.select(i),class:t.normalizeClass(["editify-button-option",{active:"display"==n.type&&i.value==s.parseDisplayConfig.value}]),style:t.normalizeStyle(i.style||"")},[e.$slots.option?t.renderSlot(e.$slots,"option",{key:0,item:i},void 0,!0):(t.openBlock(),t.createElementBlock("div",cn,[i.icon?(t.openBlock(),t.createBlock(a,{key:0,value:i.icon},null,8,["value"])):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(i.label),1)]))],14,dn)))),256))]))],4)])),_:3},8,["modelValue","node","onShow","onShown","onHidden"])],2)])}],["__scopeId","data-v-f88c4b88"]]),un={name:"Checkbox",emits:["update:modelValue","change"],props:{disabled:{type:Boolean,default:!1},modelValue:{type:[Boolean,Array],default:!1},label:{type:String,default:null},value:{type:[Object,Number,String,Array],default:""},round:{type:Boolean,default:!1},placement:{type:String,default:"right",validator:e=>["left","right"].includes(e)},color:{type:String,default:"",validator:e=>ue.common.matchingText(e,"hex")}},computed:{check(){return"boolean"==typeof this.modelValue?this.modelValue:!!Array.isArray(this.modelValue)&&this.modelValue.some((e=>ue.common.equal(e,this.value)))},itemStyle(){let e={};return this.color&&this.check&&!this.disabled&&(e.backgroundColor=this.color,e.borderColor=this.color),e}},components:{Icon:nn},methods:{change(e){if(Array.isArray(this.modelValue)){let t=[...this.modelValue];e.target.checked&&!this.check?t.push(this.value):this.check&&(t=t.filter((e=>!ue.common.equal(e,this.value)))),this.$emit("update:modelValue",t),this.$emit("change",t)}else"boolean"==typeof this.modelValue&&(this.$emit("update:modelValue",e.target.checked),this.$emit("change",e.target.checked))}}},fn=["data-editify-placement","textContent"],gn=["value","disabled","checked"],mn=["data-editify-placement","textContent"];const pn=Ki(un,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["editify-checkbox",{disabled:n.disabled}])},["left"==n.placement&&n.label?(t.openBlock(),t.createElementBlock("span",{key:0,class:"editify-checkbox-label","data-editify-placement":n.placement,textContent:t.toDisplayString(n.label)},null,8,fn)):t.createCommentVNode("",!0),t.createElementVNode("input",{onChange:i[0]||(i[0]=(...e)=>s.change&&s.change(...e)),value:n.value,disabled:n.disabled,checked:s.check,type:"checkbox"},null,40,gn),t.createElementVNode("span",{class:t.normalizeClass(["editify-checkbox-item",{reverse:!n.color,round:n.round,checked:s.check&&!n.disabled}]),style:t.normalizeStyle(s.itemStyle)},[t.createVNode(a,{value:"check",style:t.normalizeStyle({opacity:s.check?"":0})},null,8,["style"])],6),"right"==n.placement&&n.label?(t.openBlock(),t.createElementBlock("span",{key:1,class:"editify-checkbox-label","data-editify-placement":n.placement,textContent:t.toDisplayString(n.label)},null,8,mn)):t.createCommentVNode("",!0)],2)}],["__scopeId","data-v-50cd9e6c"]]),bn={name:"Colors",emits:["change"],props:{data:{type:Array,default:function(){return[]}},value:{type:String,default:null},color:{type:String,default:""},tooltip:{type:Boolean,default:!1}},data:()=>({}),inject:["$editTrans"],components:{Icon:nn,Tooltip:tn},methods:{selectColor(e){this.$emit("change",e.value)}}},yn={class:"editify-colors"},wn={class:"editify-colors-list"},En=["onClick"];const Cn=Ki(bn,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon"),l=t.resolveComponent("Tooltip");return t.openBlock(),t.createElementBlock("div",yn,[t.createElementVNode("div",{class:"editify-colors-header",onClick:i[0]||(i[0]=e=>s.selectColor({value:""}))},[t.createVNode(a,{value:"remove"}),t.createElementVNode("span",null,t.toDisplayString(s.$editTrans("defaultColor")),1)]),t.createElementVNode("div",wn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.data,(e=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-color",{active:n.value==e.value}]),style:t.normalizeStyle({borderColor:n.value==e.value?n.color:""})},[t.createVNode(l,{block:"",content:e.label,disabled:!n.tooltip},{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:t=>s.selectColor(e),class:"editify-color-el",style:t.normalizeStyle({background:e.value})},null,12,En)])),_:2},1032,["content","disabled"])],6)))),256))])])}],["__scopeId","data-v-dc6d3d68"]]),vn={name:"Toolbar",emits:["update:modelValue"],props:{modelValue:{type:Boolean,default:!1},node:{type:[String,Node],default:null},type:{type:String,default:"text",validator:e=>["text","table","link","codeBlock","image","video"].includes(e)},config:{type:Object,default:null}},data(){return{linkConfig:{url:"",newOpen:!1},videoConfig:{controls:!1,loop:!1,autoplay:!1,muted:!1},languageConfig:{show:this.config.codeBlock.languages.show,displayConfig:{options:this.config.codeBlock.languages.options,value:"",width:this.config.codeBlock.languages.width,maxHeight:this.config.codeBlock.languages.maxHeight},leftBorder:this.config.codeBlock.languages.leftBorder,rightBorder:this.config.codeBlock.languages.rightBorder,active:!1,disabled:!1},headingConfig:{show:this.config.text.heading.show,displayConfig:{options:this.config.text.heading.options,value:"",width:this.config.text.heading.width,maxHeight:this.config.text.heading.maxHeight},defaultValue:this.config.text.heading.defaultValue,leftBorder:this.config.text.heading.leftBorder,rightBorder:this.config.text.heading.rightBorder,active:!1,disabled:!1},alignConfig:{show:this.config.text.align.show,selectConfig:{options:this.config.text.align.options,width:this.config.text.align.width,maxHeight:this.config.text.align.maxHeight},leftBorder:this.config.text.align.leftBorder,rightBorder:this.config.text.align.rightBorder,active:!1,disabled:!1},orderListConfig:{show:this.config.text.orderList.show,leftBorder:this.config.text.orderList.leftBorder,rightBorder:this.config.text.orderList.rightBorder,active:!1,disabled:!1},unorderListConfig:{show:this.config.text.unorderList.show,leftBorder:this.config.text.unorderList.leftBorder,rightBorder:this.config.text.unorderList.rightBorder,active:!1,disabled:!1},taskConfig:{show:this.config.text.task.show,leftBorder:this.config.text.task.leftBorder,rightBorder:this.config.text.task.rightBorder,active:!1,disabled:!1},boldConfig:{show:this.config.text.bold.show,leftBorder:this.config.text.bold.leftBorder,rightBorder:this.config.text.bold.rightBorder,active:!1,disabled:!1},italicConfig:{show:this.config.text.italic.show,leftBorder:this.config.text.italic.leftBorder,rightBorder:this.config.text.italic.rightBorder,active:!1,disabled:!1},strikethroughConfig:{show:this.config.text.strikethrough.show,leftBorder:this.config.text.strikethrough.leftBorder,rightBorder:this.config.text.strikethrough.rightBorder,active:!1,disabled:!1},underlineConfig:{show:this.config.text.underline.show,leftBorder:this.config.text.underline.leftBorder,rightBorder:this.config.text.underline.rightBorder,active:!1,disabled:!1},codeConfig:{show:this.config.text.code.show,leftBorder:this.config.text.code.leftBorder,rightBorder:this.config.text.code.rightBorder,active:!1,disabled:!1},superConfig:{show:this.config.text.super.show,leftBorder:this.config.text.super.leftBorder,rightBorder:this.config.text.super.rightBorder,active:!1,disabled:!1},subConfig:{show:this.config.text.sub.show,leftBorder:this.config.text.sub.leftBorder,rightBorder:this.config.text.sub.rightBorder,active:!1,disabled:!1},fontSizeConfig:{show:this.config.text.fontSize.show,displayConfig:{options:this.config.text.fontSize.options,value:"",width:this.config.text.fontSize.width,maxHeight:this.config.text.fontSize.maxHeight},defaultValue:this.config.text.fontSize.defaultValue,leftBorder:this.config.text.fontSize.leftBorder,rightBorder:this.config.text.fontSize.rightBorder,active:!1,disabled:!1},fontFamilyConfig:{show:this.config.text.fontFamily.show,displayConfig:{options:this.config.text.fontFamily.options,value:"",width:this.config.text.fontFamily.width,maxHeight:this.config.text.fontFamily.maxHeight},defaultValue:this.config.text.fontFamily.defaultValue,leftBorder:this.config.text.fontFamily.leftBorder,rightBorder:this.config.text.fontFamily.rightBorder,active:!1,disabled:!1},lineHeightConfig:{show:this.config.text.lineHeight.show,displayConfig:{options:this.config.text.lineHeight.options,value:"",width:this.config.text.lineHeight.width,maxHeight:this.config.text.lineHeight.maxHeight},defaultValue:this.config.text.lineHeight.defaultValue,leftBorder:this.config.text.lineHeight.leftBorder,rightBorder:this.config.text.lineHeight.rightBorder,active:!1,disabled:!1},foreColorConfig:{show:this.config.text.foreColor.show,selectConfig:{options:this.config.text.foreColor.options},leftBorder:this.config.text.foreColor.leftBorder,rightBorder:this.config.text.foreColor.rightBorder,value:"",active:!1,disabled:!1},backColorConfig:{show:this.config.text.backColor.show,selectConfig:{options:this.config.text.backColor.options},leftBorder:this.config.text.backColor.leftBorder,rightBorder:this.config.text.backColor.rightBorder,value:"",active:!1,disabled:!1},formatClearConfig:{show:this.config.text.formatClear.show,leftBorder:this.config.text.formatClear.leftBorder,rightBorder:this.config.text.formatClear.rightBorder,active:!1,disabled:!1}}},computed:{show:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}},components:{Layer:Qi,Tooltip:tn,Button:hn,Icon:nn,Checkbox:pn,Colors:Cn},inject:["$editTrans"],methods:{clearFormat(){this.$parent.formatText()},setBackColor(e){this.$parent.setTextStyle("background-color",e),this.$refs.backColor.hideLayer()},setForeColor(e){this.$parent.setTextStyle("color",e),this.$refs.foreColor.hideLayer()},setLineHeight(e,t){this.$parent.setLineHeight(t)},setFontFamily(e,t){this.$parent.setTextStyle("font-family",t)},setFontSize(e,t){this.$parent.setTextStyle("font-size",t)},setSuperscript(){this.$parent.setTextStyle("vertical-align","super")},setSubscript(){this.$parent.setTextStyle("vertical-align","sub")},setCodeStyle(){this.$parent.setTextMark("data-editify-code",!0)},setUnderline(){this.$parent.setTextStyle("text-decoration","underline")},setStrikethrough(){this.$parent.setTextStyle("text-decoration","line-through")},setList(e){this.$parent.setList("orderList"==e)},setTask(){this.$parent.setTask()},setItalic(){this.$parent.setTextStyle("font-style","italic")},setBold(){this.$parent.setTextStyle("font-weight","bold")},setHeading(e,t){this.$parent.setHeading(t)},setAlign(e,t){this.$parent.setAlign(t)},setVideo(e){if(this.$parent.disabled)return;const t=this.$parent.getCurrentParsedomElement("video");t&&(this.videoConfig[e]?delete t.marks[e]:t.marks[e]=!0,this.videoConfig[e]=!this.videoConfig[e],this.$parent.editor.domRender(),this.$parent.editor.rangeRender())},setWidth(e){if(this.$parent.disabled)return;const t=this.$parent.getCurrentParsedomElement("img")||this.$parent.getCurrentParsedomElement("video");if(t){const i={width:e};t.hasStyles()?t.styles=Object.assign(t.styles,i):t.styles=i,this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender(),setTimeout((()=>{this.$refs.layer.setPosition()}),0)}},modifyLink(){if(this.$parent.disabled)return;if(!this.linkConfig.url)return;const e=this.$parent.getCurrentParsedomElement("a");e&&(e.marks.href=this.linkConfig.url,this.linkConfig.newOpen?e.marks.target="_blank":delete e.marks.target),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender()},handleInputFocus(e){this.$parent.disabled||this.$parent.color&&(e.currentTarget.style.borderColor=this.$parent.color)},handleInputBlur(e){this.$parent.disabled||(e.currentTarget.style.borderColor="")},selectLanguage(e,t){if(this.$parent.disabled)return;const i=this.$parent.getCurrentParsedomElement("pre");i&&(Object.assign(i.marks,{"data-editify-hljs":t}),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender())},insertParagraphWithPre(e="up"){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const t=this.$parent.getCurrentParsedomElement("pre");if(t){const i=new k("block",k.BLOCK_NODE,null,null,null),n=new k("closed","br",null,null,null);this.$parent.editor.addElementTo(n,i),"up"==e?this.$parent.editor.addElementBefore(i,t):this.$parent.editor.addElementAfter(i,t),this.$parent.editor.range.anchor.moveToEnd(i),this.$parent.editor.range.focus.moveToEnd(i),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}},insertTableColumn(e="left"){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const t=this.$parent.getCurrentParsedomElement("table"),i=this.$parent.getCurrentParsedomElement("td"),n=this.$parent.getCurrentParsedomElement("tbody");if(i&&t&&n){const o=n.children,r=i.parent.children.findIndex((e=>e.isEqual(i)));o.forEach((t=>{const n=i.clone(!1),o=new k("closed","br",null,null,null);this.$parent.editor.addElementTo(o,n),"left"==e?this.$parent.editor.addElementTo(n,t,r):this.$parent.editor.addElementTo(n,t,r+1)}));const s=t.children.find((e=>"colgroup"==e.parsedom)),a=new k("closed","col",null,null,null);if("left"==e?this.$parent.editor.addElementTo(a,s,r):this.$parent.editor.addElementTo(a,s,r+1),this.$parent.editor.formatElementStack(),"left"==e){const e=this.$parent.editor.getPreviousElement(i);this.$parent.editor.range.anchor.moveToStart(e),this.$parent.editor.range.focus.moveToStart(e)}else{const e=this.$parent.editor.getNextElement(i);this.$parent.editor.range.anchor.moveToStart(e),this.$parent.editor.range.focus.moveToStart(e)}this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}},insertTableRow(e="up"){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const t=this.$parent.getCurrentParsedomElement("table"),i=this.$parent.getCurrentParsedomElement("tr");if(t&&i){const t=i.clone();t.children.forEach((e=>{e.children=[];const t=new k("closed","br",null,null,null);this.$parent.editor.addElementTo(t,e)})),"up"==e?this.$parent.editor.addElementBefore(t,i):this.$parent.editor.addElementAfter(t,i),this.$parent.editor.formatElementStack(),this.$parent.editor.range.anchor.moveToStart(t),this.$parent.editor.range.focus.moveToStart(t),this.$parent.editor.domRender(),this.$parent.editor.rangeRender(),setTimeout((()=>{this.$refs.layer.setPosition()}),0)}},insertParagraphWithTable(e="up"){if(this.$parent.disabled)return;const t=this.$parent.getCurrentParsedomElement("table");if(t){const i=new k("block",k.BLOCK_NODE,null,null,null),n=new k("closed","br",null,null,null);this.$parent.editor.addElementTo(n,i),"up"==e?this.$parent.editor.addElementBefore(i,t):this.$parent.editor.addElementAfter(i,t),this.$parent.editor.range.anchor.moveToEnd(i),this.$parent.editor.range.focus.moveToEnd(i),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}},deleteTableRow(){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const e=this.$parent.getCurrentParsedomElement("table"),t=this.$parent.getCurrentParsedomElement("tr");if(e&&t){if(1==t.parent.children.length)return void this.$parent.deleteByParsedom("table");const e=this.$parent.editor.getPreviousElement(t),i=this.$parent.editor.getNextElement(t);t.toEmpty(),this.$parent.editor.formatElementStack(),e?(this.$parent.editor.range.anchor.moveToEnd(e.children[0]),this.$parent.editor.range.focus.moveToEnd(e.children[0])):(this.$parent.editor.range.anchor.moveToEnd(i.children[0]),this.$parent.editor.range.focus.moveToEnd(i.children[0])),this.$parent.editor.domRender(),this.$parent.editor.rangeRender(),setTimeout((()=>{this.$refs.layer.setPosition()}),0)}},deleteTableColumn(){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const e=this.$parent.getCurrentParsedomElement("td"),t=this.$parent.getCurrentParsedomElement("tbody"),i=this.$parent.getCurrentParsedomElement("table");if(e&&i&&t){const n=t.children;if(1==e.parent.children.length)return void this.$parent.deleteByParsedom("table");const o=this.$parent.editor.getPreviousElement(e),r=this.$parent.editor.getNextElement(e),s=e.parent.children.findIndex((t=>t.isEqual(e)));n.forEach((e=>{e.children[s].toEmpty()}));i.children.find((e=>"colgroup"==e.parsedom)).children[s].toEmpty(),this.$parent.editor.formatElementStack(),o?(this.$parent.editor.range.anchor.moveToEnd(o),this.$parent.editor.range.focus.moveToEnd(o)):(this.$parent.editor.range.anchor.moveToEnd(r),this.$parent.editor.range.focus.moveToEnd(r)),this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}},layerShow(){if("codeBlock"==this.type){const e=this.$parent.getCurrentParsedomElement("pre");e&&(this.languageConfig.displayConfig.value=e.marks["data-editify-hljs"]||"")}else if("link"==this.type){const e=this.$parent.getCurrentParsedomElement("a");e&&(this.linkConfig.url=e.marks.href,this.linkConfig.newOpen="_blank"==e.marks.target)}else if("video"==this.type){const e=this.$parent.getCurrentParsedomElement("video");e&&(this.videoConfig.autoplay=!!e.marks.autoplay,this.videoConfig.loop=!!e.marks.loop,this.videoConfig.controls=!!e.marks.controls,this.videoConfig.muted=!!e.marks.muted)}else if("text"==this.type){const e=e=>"function"==typeof this.config.extraDisabled&&this.config.extraDisabled.apply(this.$parent,[e])||!1,t=this.$parent.editor.getElementsByRange(!0,!1),i=this.headingConfig.displayConfig.options.find((e=>{let i=e;return ue.common.isObject(e)&&(i=e.value),t.every((e=>e.element.isBlock()?e.element.parsedom==i:e.element.getBlock().parsedom==i))}));this.headingConfig.displayConfig.value=i?ue.common.isObject(i)?i.value:i:this.headingConfig.defaultValue,this.headingConfig.disabled=e("heading"),this.alignConfig.disabled=e("align"),this.orderListConfig.active=this.$parent.inList(!0),this.orderListConfig.disabled=e("orderList"),this.unorderListConfig.active=this.$parent.inList(!1),this.unorderListConfig.disabled=e("unorderList"),this.taskConfig.active=this.$parent.inTask(),this.taskConfig.disabled=e("task"),this.boldConfig.active=this.$parent.queryTextStyle("font-weight","bold"),this.boldConfig.disabled=e("bold"),this.italicConfig.active=this.$parent.queryTextStyle("font-style","italic",!0),this.italicConfig.disabled=e("italic"),this.strikethroughConfig.active=this.$parent.queryTextStyle("text-decoration","line-through",!0),this.strikethroughConfig.disabled=e("strikethrough"),this.underlineConfig.active=this.$parent.queryTextStyle("text-decoration","underline",!0),this.underlineConfig.disabled=e("underline"),this.codeConfig.active=this.$parent.queryTextMark("data-editify-code"),this.codeConfig.disabled=e("code"),this.superConfig.active=this.$parent.queryTextStyle("vertical-align","super",!0),this.superConfig.disabled=e("super"),this.subConfig.active=this.$parent.queryTextStyle("vertical-align","sub",!0),this.subConfig.disabled=e("sub");const n=this.fontSizeConfig.displayConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("font-size",e.value,!0):this.$parent.queryTextStyle("font-size",e,!0)));this.fontSizeConfig.displayConfig.value=n?ue.common.isObject(n)?n.value:n:this.fontSizeConfig.defaultValue,this.fontSizeConfig.disabled=e("fontSize");const o=this.fontFamilyConfig.displayConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("font-family",e.value,!0):this.$parent.queryTextStyle("font-family",e,!0)));this.fontFamilyConfig.displayConfig.value=o?ue.common.isObject(o)?o.value:o:this.fontFamilyConfig.defaultValue,this.fontFamilyConfig.disabled=e("fontFamily");const r=this.lineHeightConfig.displayConfig.options.find((e=>{let i=e;return ue.common.isObject(e)&&(i=e.value),t.every((e=>{if(e.element.isBlock()||e.element.isInblock())return e.element.hasStyles()&&e.element.styles["line-height"]==i;const t=e.element.getBlock(),n=e.element.getInblock();return n?n.hasStyles()&&n.styles["line-height"]==i:t.hasStyles()&&t.styles["line-height"]==i}))}));this.lineHeightConfig.displayConfig.value=r?ue.common.isObject(r)?r.value:r:this.lineHeightConfig.defaultValue,this.lineHeightConfig.disabled=e("lineHeight");const s=this.foreColorConfig.selectConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("color",e.value,!0):this.$parent.queryTextStyle("color",e,!0)));this.foreColorConfig.value=s?ue.common.isObject(s)?s.value:s:"",this.foreColorConfig.disabled=e("foreColor");const a=this.backColorConfig.selectConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("background-color",e.value,!0):this.$parent.queryTextStyle("background-color",e,!0)));this.backColorConfig.value=a?ue.common.isObject(a)?a.value:a:"",this.backColorConfig.disabled=e("backColor"),this.formatClearConfig.disabled=e("formatClear")}}}},kn={key:0,class:"editify-toolbar-link"},$n={class:"editify-toolbar-link-label"},xn=["placeholder"],Tn={class:"editify-toolbar-link-footer"},Bn={class:"editify-toolbar-link-operations"},Sn=["href"];const _n=Ki(vn,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Checkbox"),l=t.resolveComponent("Button"),d=t.resolveComponent("Icon"),c=t.resolveComponent("Colors"),h=t.resolveComponent("Layer");return t.openBlock(),t.createBlock(h,{modelValue:s.show,"onUpdate:modelValue":i[23]||(i[23]=e=>s.show=e),ref:"layer",node:n.node,border:"",placement:"bottom-start",onShow:s.layerShow,useRange:"text"==n.type},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"editify-toolbar",ref:"toolbar",style:t.normalizeStyle(n.config.style)},["link"==n.type?(t.openBlock(),t.createElementBlock("div",kn,[t.createElementVNode("div",$n,t.toDisplayString(s.$editTrans("linkAddress")),1),t.withDirectives(t.createElementVNode("input",{onInput:i[0]||(i[0]=(...e)=>s.modifyLink&&s.modifyLink(...e)),onFocus:i[1]||(i[1]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e)),onBlur:i[2]||(i[2]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),placeholder:s.$editTrans("linkUrlEnterPlaceholder"),"onUpdate:modelValue":i[3]||(i[3]=e=>r.linkConfig.url=e),type:"url"},null,40,xn),[[t.vModelText,r.linkConfig.url,void 0,{trim:!0}]]),t.createElementVNode("div",Tn,[t.createVNode(a,{onChange:s.modifyLink,modelValue:r.linkConfig.newOpen,"onUpdate:modelValue":i[4]||(i[4]=e=>r.linkConfig.newOpen=e),label:s.$editTrans("newWindowOpen"),color:e.$parent.color,size:10},null,8,["onChange","modelValue","label","color"]),t.createElementVNode("div",Bn,[t.createElementVNode("span",{onClick:i[5]||(i[5]=(...t)=>e.$parent.removeLink&&e.$parent.removeLink(...t))},t.toDisplayString(s.$editTrans("removeLink")),1),t.createElementVNode("a",{href:r.linkConfig.url,target:"_blank",style:t.normalizeStyle({color:e.$parent.color})},t.toDisplayString(s.$editTrans("viewLink")),13,Sn)])])])):"image"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(l,{onOperate:i[6]||(i[6]=e=>s.setWidth("30%")),name:"set30Width",title:s.$editTrans("width30"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 30% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[7]||(i[7]=e=>s.setWidth("50%")),name:"set50Width",title:s.$editTrans("width50"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 50% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{rightBorder:"",onOperate:i[8]||(i[8]=e=>s.setWidth("100%")),name:"set100Width",title:s.$editTrans("width100"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 100% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[9]||(i[9]=t=>e.$parent.deleteByParsedom("img")),name:"deleteImage",title:s.$editTrans("deleteImage"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete"})])),_:1},8,["title","tooltip","color"])],64)):"video"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createVNode(l,{onOperate:i[10]||(i[10]=e=>s.setWidth("30%")),name:"set30Width",title:s.$editTrans("width30"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 30% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[11]||(i[11]=e=>s.setWidth("50%")),name:"set50Width",title:s.$editTrans("width50"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 50% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{rightBorder:"",onOperate:i[12]||(i[12]=e=>s.setWidth("100%")),name:"set100Width",title:s.$editTrans("width100"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 100% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:s.setVideo,name:"autoplay",title:r.videoConfig.autoplay?s.$editTrans("disabledAutoplay"):s.$editTrans("autoplay"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:r.videoConfig.autoplay?"autoplay":"stop"},null,8,["value"])])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:s.setVideo,name:"loop",title:r.videoConfig.loop?s.$editTrans("disabledLoop"):s.$editTrans("loop"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:r.videoConfig.loop?"loop":"single"},null,8,["value"])])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:s.setVideo,name:"muted",title:r.videoConfig.muted?s.$editTrans("unmuted"):s.$editTrans("muted"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:r.videoConfig.muted?"muted":"unmuted"},null,8,["value"])])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{leftBorder:"",onOperate:s.setVideo,name:"controls",title:s.$editTrans("controls"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"controls"})])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:i[13]||(i[13]=t=>e.$parent.deleteByParsedom("video")),name:"deleteVideo",title:s.$editTrans("deleteVideo"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete"})])),_:1},8,["title","tooltip","color"])],64)):"table"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createVNode(l,{onOperate:i[14]||(i[14]=e=>s.insertParagraphWithTable("up")),name:"textWrapUp",title:s.$editTrans("textWrapUp"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"text-wrap",class:"editify-icon-rotate"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[15]||(i[15]=e=>s.insertParagraphWithTable("down")),rightBorder:"",name:"textWrapDown",title:s.$editTrans("textWrapDown"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"text-wrap"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[16]||(i[16]=e=>s.insertTableRow("up")),name:"insertRowTop",title:s.$editTrans("insertRowTop"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"insert-row-top"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[17]||(i[17]=e=>s.insertTableRow("down")),name:"insertRowBottom",title:s.$editTrans("insertRowBottom"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"insert-row-bottom"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:s.deleteTableRow,rightBorder:"",name:"deleteRow",title:s.$editTrans("deleteRow"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete-row"})])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:i[18]||(i[18]=e=>s.insertTableColumn("left")),name:"insertColumnLeft",title:s.$editTrans("insertColumnLeft"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"insert-column-left"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[19]||(i[19]=e=>s.insertTableColumn("right")),name:"insertColumnRight",title:s.$editTrans("insertColumnRight"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"insert-column-right"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:s.deleteTableColumn,rightBorder:"",name:"deleteColumn",title:s.$editTrans("deleteColumn"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete-column"})])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:i[20]||(i[20]=t=>e.$parent.deleteByParsedom("table")),name:"deleteTable",title:s.$editTrans("deleteTable"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete-table"})])),_:1},8,["title","tooltip","color"])],64)):t.createCommentVNode("",!0),"codeBlock"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createVNode(l,{onOperate:i[21]||(i[21]=e=>s.insertParagraphWithPre("up")),name:"textWrapUp",title:s.$editTrans("textWrapUp"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"text-wrap",class:"editify-icon-rotate"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[22]||(i[22]=e=>s.insertParagraphWithPre("down")),name:"textWrapDown",title:s.$editTrans("textWrapDown"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"text-wrap"})])),_:1},8,["title","tooltip","color"]),r.languageConfig.show?(t.openBlock(),t.createBlock(l,{key:0,name:"languages",type:"display",title:s.$editTrans("selectLanguages"),tooltip:n.config.tooltip,leftBorder:r.languageConfig.leftBorder,rightBorder:r.languageConfig.rightBorder,"display-config":r.languageConfig.displayConfig,color:e.$parent.color,active:r.languageConfig.active,disabled:r.languageConfig.disabled,onOperate:s.selectLanguage},null,8,["title","tooltip","leftBorder","rightBorder","display-config","color","active","disabled","onOperate"])):t.createCommentVNode("",!0)],64)):"text"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[r.headingConfig.show?(t.openBlock(),t.createBlock(l,{key:0,name:"heading",type:"display",title:s.$editTrans("heading"),tooltip:n.config.tooltip,"display-config":r.headingConfig.displayConfig,leftBorder:r.headingConfig.leftBorder,rightBorder:r.headingConfig.rightBorder,color:e.$parent.color,active:r.headingConfig.active,disabled:r.headingConfig.disabled,onOperate:s.setHeading},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.alignConfig.show?(t.openBlock(),t.createBlock(l,{key:1,name:"align",type:"select",title:s.$editTrans("align"),tooltip:n.config.tooltip,"select-config":r.alignConfig.selectConfig,leftBorder:r.alignConfig.leftBorder,rightBorder:r.alignConfig.rightBorder,color:e.$parent.color,active:r.alignConfig.active,disabled:r.alignConfig.disabled,onOperate:s.setAlign},{default:t.withCtx((()=>[t.createVNode(d,{value:"align-left"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.orderListConfig.show?(t.openBlock(),t.createBlock(l,{key:2,name:"orderList",title:s.$editTrans("orderList"),tooltip:n.config.tooltip,leftBorder:r.orderListConfig.leftBorder,rightBorder:r.orderListConfig.rightBorder,color:e.$parent.color,active:r.orderListConfig.active,disabled:r.orderListConfig.disabled,onOperate:s.setList},{default:t.withCtx((()=>[t.createVNode(d,{value:"list-ordered"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.unorderListConfig.show?(t.openBlock(),t.createBlock(l,{key:3,name:"unorderList",title:s.$editTrans("unorderList"),tooltip:n.config.tooltip,leftBorder:r.unorderListConfig.leftBorder,rightBorder:r.unorderListConfig.rightBorder,color:e.$parent.color,active:r.unorderListConfig.active,disabled:r.unorderListConfig.disabled,onOperate:s.setList},{default:t.withCtx((()=>[t.createVNode(d,{value:"list-unordered"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.taskConfig.show?(t.openBlock(),t.createBlock(l,{key:4,name:"task",title:s.$editTrans("task"),tooltip:n.config.tooltip,leftBorder:r.taskConfig.leftBorder,rightBorder:r.taskConfig.rightBorder,color:e.$parent.color,active:r.taskConfig.active,disabled:r.taskConfig.disabled,onOperate:s.setTask},{default:t.withCtx((()=>[t.createVNode(d,{value:"task"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.boldConfig.show?(t.openBlock(),t.createBlock(l,{key:5,name:"bold",title:s.$editTrans("bold"),tooltip:n.config.tooltip,leftBorder:r.boldConfig.leftBorder,rightBorder:r.boldConfig.rightBorder,color:e.$parent.color,active:r.boldConfig.active,disabled:r.boldConfig.disabled,onOperate:s.setBold},{default:t.withCtx((()=>[t.createVNode(d,{value:"bold"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.italicConfig.show?(t.openBlock(),t.createBlock(l,{key:6,name:"italic",title:s.$editTrans("italic"),tooltip:n.config.tooltip,leftBorder:r.italicConfig.leftBorder,rightBorder:r.italicConfig.rightBorder,color:e.$parent.color,active:r.italicConfig.active,disabled:r.italicConfig.disabled,onOperate:s.setItalic},{default:t.withCtx((()=>[t.createVNode(d,{value:"italic"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.strikethroughConfig.show?(t.openBlock(),t.createBlock(l,{key:7,name:"strikethrough",title:s.$editTrans("strikethrough"),tooltip:n.config.tooltip,leftBorder:r.strikethroughConfig.leftBorder,rightBorder:r.strikethroughConfig.rightBorder,color:e.$parent.color,active:r.strikethroughConfig.active,disabled:r.strikethroughConfig.disabled,onOperate:s.setStrikethrough},{default:t.withCtx((()=>[t.createVNode(d,{value:"strikethrough"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.underlineConfig.show?(t.openBlock(),t.createBlock(l,{key:8,name:"underline",title:s.$editTrans("underline"),tooltip:n.config.tooltip,leftBorder:r.underlineConfig.leftBorder,rightBorder:r.underlineConfig.rightBorder,color:e.$parent.color,active:r.underlineConfig.active,disabled:r.underlineConfig.disabled,onOperate:s.setUnderline},{default:t.withCtx((()=>[t.createVNode(d,{value:"underline"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.codeConfig.show?(t.openBlock(),t.createBlock(l,{key:9,name:"code",title:s.$editTrans("code"),tooltip:n.config.tooltip,leftBorder:r.codeConfig.leftBorder,rightBorder:r.codeConfig.rightBorder,color:e.$parent.color,active:r.codeConfig.active,disabled:r.codeConfig.disabled,onOperate:s.setCodeStyle},{default:t.withCtx((()=>[t.createVNode(d,{value:"code"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.superConfig.show?(t.openBlock(),t.createBlock(l,{key:10,name:"superscript",title:s.$editTrans("superscript"),tooltip:n.config.tooltip,leftBorder:r.superConfig.leftBorder,rightBorder:r.superConfig.rightBorder,color:e.$parent.color,active:r.superConfig.active,disabled:r.superConfig.disabled,onOperate:s.setSuperscript},{default:t.withCtx((()=>[t.createVNode(d,{value:"superscript"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.subConfig.show?(t.openBlock(),t.createBlock(l,{key:11,name:"subscript",title:s.$editTrans("subscript"),tooltip:n.config.tooltip,leftBorder:r.subConfig.leftBorder,rightBorder:r.subConfig.rightBorder,color:e.$parent.color,active:r.subConfig.active,disabled:r.subConfig.disabled,onOperate:s.setSubscript},{default:t.withCtx((()=>[t.createVNode(d,{value:"subscript"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.fontSizeConfig.show?(t.openBlock(),t.createBlock(l,{key:12,name:"fontSize",type:"display",title:s.$editTrans("fontSize"),tooltip:n.config.tooltip,"display-config":r.fontSizeConfig.displayConfig,leftBorder:r.fontSizeConfig.leftBorder,rightBorder:r.fontSizeConfig.rightBorder,color:e.$parent.color,active:r.fontSizeConfig.active,disabled:r.fontSizeConfig.disabled,onOperate:s.setFontSize},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.fontFamilyConfig.show?(t.openBlock(),t.createBlock(l,{key:13,name:"fontFamily",type:"display",title:s.$editTrans("fontFamily"),tooltip:n.config.tooltip,"display-config":r.fontFamilyConfig.displayConfig,leftBorder:r.fontFamilyConfig.leftBorder,rightBorder:r.fontFamilyConfig.rightBorder,color:e.$parent.color,active:r.fontFamilyConfig.active,disabled:r.fontFamilyConfig.disabled,onOperate:s.setFontFamily},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.lineHeightConfig.show?(t.openBlock(),t.createBlock(l,{key:14,name:"lineHeight",type:"display",title:s.$editTrans("lineHeight"),tooltip:n.config.tooltip,"display-config":r.lineHeightConfig.displayConfig,leftBorder:r.lineHeightConfig.leftBorder,rightBorder:r.lineHeightConfig.rightBorder,color:e.$parent.color,active:r.lineHeightConfig.active,disabled:r.lineHeightConfig.disabled,onOperate:s.setLineHeight},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.foreColorConfig.show?(t.openBlock(),t.createBlock(l,{key:15,name:"foreColor",type:"select",title:s.$editTrans("foreColor"),tooltip:n.config.tooltip,"select-config":r.foreColorConfig.selectConfig,leftBorder:r.foreColorConfig.leftBorder,rightBorder:r.foreColorConfig.rightBorder,color:e.$parent.color,active:r.foreColorConfig.active,disabled:r.foreColorConfig.disabled,hideScroll:"",ref:"foreColor"},{layer:t.withCtx((({options:i})=>[t.createVNode(c,{tooltip:n.config.tooltip,color:e.$parent.color,value:r.foreColorConfig.value,onChange:s.setForeColor,data:i},null,8,["tooltip","color","value","onChange","data"])])),default:t.withCtx((()=>[t.createVNode(d,{value:"font-color"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),r.backColorConfig.show?(t.openBlock(),t.createBlock(l,{key:16,name:"backColor",type:"select",title:s.$editTrans("backColor"),tooltip:n.config.tooltip,"select-config":r.backColorConfig.selectConfig,leftBorder:r.backColorConfig.leftBorder,rightBorder:r.backColorConfig.rightBorder,color:e.$parent.color,active:r.backColorConfig.active,disabled:r.backColorConfig.disabled,hideScroll:"",ref:"backColor"},{layer:t.withCtx((({options:i})=>[t.createVNode(c,{tooltip:n.config.tooltip,color:e.$parent.color,value:r.backColorConfig.value,onChange:s.setBackColor,data:i},null,8,["tooltip","color","value","onChange","data"])])),default:t.withCtx((()=>[t.createVNode(d,{value:"brush"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),r.formatClearConfig.show?(t.openBlock(),t.createBlock(l,{key:17,name:"formatClear",title:s.$editTrans("formatClear"),tooltip:n.config.tooltip,leftBorder:r.formatClearConfig.leftBorder,rightBorder:r.formatClearConfig.rightBorder,color:e.$parent.color,active:r.formatClearConfig.active,disabled:r.formatClearConfig.disabled,onOperate:s.clearFormat},{default:t.withCtx((()=>[t.createVNode(d,{value:"format-clear"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],4)])),_:1},8,["modelValue","node","onShow","useRange"])}],["__scopeId","data-v-6b9cdbc6"]]),Nn={class:"editify-link"},On={class:"editify-link-label"},An=["placeholder"],In=["placeholder"],Rn={class:"editify-link-footer"},Ln={class:"editify-link-operations"};const Mn=Ki({name:"InsertLink",emits:["insert"],inject:["$editTrans"],props:{color:{type:String,default:""},text:{type:String,default:""}},data:()=>({linkUrl:"",linkText:"",newOpen:!1}),watch:{text:{immediate:!0,handler:function(e){this.linkText=e}}},components:{Checkbox:pn},methods:{handleInputFocus(e){this.color&&(e.currentTarget.style.borderColor=this.color)},handleInputBlur(e){e.currentTarget.style.borderColor=""},insertLink(){this.$emit("insert",this.linkText,this.linkUrl,this.newOpen)}}},[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Checkbox");return t.openBlock(),t.createElementBlock("div",Nn,[t.createElementVNode("div",On,t.toDisplayString(s.$editTrans("linkAddress")),1),t.withDirectives(t.createElementVNode("input",{onFocus:i[0]||(i[0]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e)),onBlur:i[1]||(i[1]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),placeholder:s.$editTrans("linkTextEnterPlaceholder"),"onUpdate:modelValue":i[2]||(i[2]=e=>r.linkText=e),type:"text"},null,40,An),[[t.vModelText,r.linkText,void 0,{trim:!0}]]),t.withDirectives(t.createElementVNode("input",{onFocus:i[3]||(i[3]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e)),onBlur:i[4]||(i[4]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),placeholder:s.$editTrans("linkUrlEnterPlaceholder"),"onUpdate:modelValue":i[5]||(i[5]=e=>r.linkUrl=e),type:"url"},null,40,In),[[t.vModelText,r.linkUrl,void 0,{trim:!0}]]),t.createElementVNode("div",Rn,[t.createVNode(a,{modelValue:r.newOpen,"onUpdate:modelValue":i[6]||(i[6]=e=>r.newOpen=e),label:s.$editTrans("newWindowOpen"),color:n.color,size:10},null,8,["modelValue","label","color"]),t.createElementVNode("div",Ln,[t.createElementVNode("span",{style:t.normalizeStyle({color:n.color}),onClick:i[7]||(i[7]=(...e)=>s.insertLink&&s.insertLink(...e))},t.toDisplayString(s.$editTrans("insertLink")),5)])])])}],["__scopeId","data-v-e6c3c2ee"]]),Pn={name:"InsertImage",emits:["change","insert"],props:{color:{type:String,default:""},accept:{type:Array,default:null},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:null},minSize:{type:Number,default:null},customUpload:{type:Function,default:null},handleError:{type:Function,default:null}},inject:["$editTrans"],data:()=>({current:"upload",remoteUrl:""}),computed:{activeStyle(){return e=>this.current==e?{color:this.color}:{}}},components:{Icon:nn},watch:{current(){this.$emit("change")}},methods:{async selectFile(e){const t=e.currentTarget,i=t.files;if(!i.length)return;let n=[];for(let o=0;o<i.length;o++){const e=i[o],t=this.getSuffix(e);this.accept.some((e=>e.toLocaleLowerCase()==t.toLocaleLowerCase()))?this.maxSize&&e.size/1024>this.maxSize?"function"==typeof this.handleError&&this.handleError.apply(this,["maxSizeError",e]):this.minSize&&e.size/1024<this.minSize?"function"==typeof this.handleError&&this.handleError.apply(this,["minSizeError",e]):n.push(e):"function"==typeof this.handleError&&this.handleError.apply(this,["suffixError",e])}if(n.length)if("function"==typeof this.customUpload)this.customUpload.apply(this,[n]);else{let e=[];for(let t=0;t<n.length;t++){const i=await ue.file.dataFileToBase64(n[t]);e.push(i)}e.forEach((e=>{this.$emit("insert",e)}))}t.value=""},getSuffix(e){const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},handleInputFocus(e){this.color&&(e.currentTarget.style.borderColor=this.color)},handleInputBlur(e){e.currentTarget.style.borderColor=""},insertRemoteImage(){this.$emit("insert",this.remoteUrl)}}},Fn={class:"editify-image"},Dn={class:"editify-image-header"},zn={key:0,class:"editify-image-remote"},Hn=["placeholder"],Vn={key:1,class:"editify-image-upload"},Wn=["multiple"];const jn=Ki(Pn,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("div",Fn,[t.createElementVNode("div",Dn,[t.createElementVNode("div",{onClick:i[0]||(i[0]=e=>r.current="upload"),class:t.normalizeClass(["editify-image-header-item",{active:"upload"==r.current}]),style:t.normalizeStyle(s.activeStyle("upload"))},t.toDisplayString(s.$editTrans("uploadImage")),7),t.createElementVNode("div",{onClick:i[1]||(i[1]=e=>r.current="remote"),class:t.normalizeClass(["editify-image-header-item",{active:"remote"==r.current}]),style:t.normalizeStyle(s.activeStyle("remote"))},t.toDisplayString(s.$editTrans("remoteImage")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-image-header-slider",r.current]),style:t.normalizeStyle({backgroundColor:n.color||""})},null,6)]),"remote"==r.current?(t.openBlock(),t.createElementBlock("div",zn,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":i[2]||(i[2]=e=>r.remoteUrl=e),placeholder:s.$editTrans("imageUrlPlaceholder"),onBlur:i[3]||(i[3]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),onFocus:i[4]||(i[4]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e))},null,40,Hn),[[t.vModelText,r.remoteUrl,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-image-remote-footer",style:t.normalizeStyle({color:n.color})},[t.createElementVNode("span",{onClick:i[5]||(i[5]=(...e)=>s.insertRemoteImage&&s.insertRemoteImage(...e))},t.toDisplayString(s.$editTrans("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",Vn,[t.createVNode(a,{value:"upload"}),t.createElementVNode("input",{multiple:n.multiple,accept:"image/*",onChange:i[6]||(i[6]=(...e)=>s.selectFile&&s.selectFile(...e)),type:"file"},null,40,Wn)]))])}],["__scopeId","data-v-d4e3209e"]]),Un={name:"InsertVideo",emits:["change","insert"],props:{color:{type:String,default:""},accept:{type:Array,default:null},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:null},minSize:{type:Number,default:null},customUpload:{type:Function,default:null},handleError:{type:Function,default:null}},inject:["$editTrans"],data:()=>({current:"upload",remoteUrl:""}),computed:{activeStyle(){return e=>this.current==e?{color:this.color}:{}}},components:{Icon:nn},watch:{current(){this.$emit("change")}},methods:{async selectFile(e){const t=e.currentTarget,i=t.files;if(!i.length)return;let n=[];for(let o=0;o<i.length;o++){const e=i[o],t=this.getSuffix(e);this.accept.some((e=>e.toLocaleLowerCase()==t.toLocaleLowerCase()))?this.maxSize&&e.size/1024>this.maxSize?"function"==typeof this.handleError&&this.handleError.apply(this,["maxSizeError",e]):this.minSize&&e.size/1024<this.minSize?"function"==typeof this.handleError&&this.handleError.apply(this,["minSizeError",e]):n.push(e):"function"==typeof this.handleError&&this.handleError.apply(this,["suffixError",e])}if(n.length)if("function"==typeof this.customUpload)this.customUpload.apply(this,[n]);else{let e=[];for(let t=0;t<n.length;t++){const i=await ue.file.dataFileToBase64(n[t]);e.push(i)}e.forEach((e=>{this.$emit("insert",e)}))}t.value=""},getSuffix(e){const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},handleInputFocus(e){this.color&&(e.currentTarget.style.borderColor=this.color)},handleInputBlur(e){e.currentTarget.style.borderColor=""},insertRemoteVideo(){this.$emit("insert",this.remoteUrl)}}},qn={class:"editify-video"},Kn={class:"editify-video-header"},Zn={key:0,class:"editify-video-remote"},Gn=["placeholder"],Xn={key:1,class:"editify-video-upload"},Qn=["multiple"];const Jn=Ki(Un,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("div",qn,[t.createElementVNode("div",Kn,[t.createElementVNode("div",{onClick:i[0]||(i[0]=e=>r.current="upload"),class:t.normalizeClass(["editify-video-header-item",{active:"upload"==r.current}]),style:t.normalizeStyle(s.activeStyle("upload"))},t.toDisplayString(s.$editTrans("uploadVideo")),7),t.createElementVNode("div",{onClick:i[1]||(i[1]=e=>r.current="remote"),class:t.normalizeClass(["editify-video-header-item",{active:"remote"==r.current}]),style:t.normalizeStyle(s.activeStyle("remote"))},t.toDisplayString(s.$editTrans("remoteVideo")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-video-header-slider",r.current]),style:t.normalizeStyle({backgroundColor:n.color||""})},null,6)]),"remote"==r.current?(t.openBlock(),t.createElementBlock("div",Zn,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":i[2]||(i[2]=e=>r.remoteUrl=e),placeholder:s.$editTrans("videoUrlPlaceholder"),onBlur:i[3]||(i[3]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),onFocus:i[4]||(i[4]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e))},null,40,Gn),[[t.vModelText,r.remoteUrl,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-video-remote-footer",style:t.normalizeStyle({color:n.color})},[t.createElementVNode("span",{onClick:i[5]||(i[5]=(...e)=>s.insertRemoteVideo&&s.insertRemoteVideo(...e))},t.toDisplayString(s.$editTrans("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",Xn,[t.createVNode(a,{value:"upload"}),t.createElementVNode("input",{multiple:n.multiple,accept:"video/*",onChange:i[6]||(i[6]=(...e)=>s.selectFile&&s.selectFile(...e)),type:"file"},null,40,Qn)]))])}],["__scopeId","data-v-cbc84525"]]),Yn={name:"InsertTable",emits:["insert"],inject:["$editTrans"],props:{color:{type:String,default:""},maxRows:{type:Number,default:10},maxColumns:{type:Number,default:10}},data(){return{tableGrids:this.getTableGrids()}},computed:{specification(){return this.tableGrids.flat().filter((e=>e.inside)).sort(((e,t)=>e.x>t.x&&e.y>t.y||e.x>t.x||e.y>t.y?-1:1))[0]}},methods:{createTable(e){this.$emit("insert",e.x,e.y)},changeTableSize(e){for(let t in this.tableGrids){const i=this.tableGrids[t];for(let n in i)i[n].x<=e.x&&i[n].y<=e.y?this.tableGrids[t][n].inside=!0:this.tableGrids[t][n].inside=!1}},getTableGrids(){const e=[];for(let t=1;t<=this.maxRows;t++){let i=[];for(let e=1;e<=this.maxColumns;e++)i.push({x:t,y:e,inside:!1});e.push(i)}return e}}},eo={class:"editify-table"},to=["onMouseenter","onClick"],io=[(e=>(t.pushScopeId("data-v-cd5ad93c"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("span",null,null,-1)))],no={class:"editify-table-footer"},oo={key:0},ro={key:1};const so=Ki(Yn,[["render",function(e,i,n,o,r,s){return t.openBlock(),t.createElementBlock("div",eo,[t.createElementVNode("table",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.tableGrids,(e=>(t.openBlock(),t.createElementBlock("tr",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e,(e=>(t.openBlock(),t.createElementBlock("td",{class:t.normalizeClass({inside:e.inside}),onMouseenter:t=>s.changeTableSize(e),onClick:t=>s.createTable(e)},io,42,to)))),256))])))),256))]),t.createElementVNode("div",no,[s.specification?(t.openBlock(),t.createElementBlock("span",oo,t.toDisplayString(s.specification.x)+" x "+t.toDisplayString(s.specification.y),1)):(t.openBlock(),t.createElementBlock("span",ro,t.toDisplayString(s.$editTrans("insertTable")),1))])])}],["__scopeId","data-v-cd5ad93c"]]),ao={name:"Menu",props:{config:{type:Object,default:null},disabled:{type:Boolean,default:!1},color:{type:String,default:""}},setup:()=>({uid:t.getCurrentInstance().uid}),data(){return{undoConfig:{show:this.config.undo.show,leftBorder:this.config.undo.leftBorder,rightBorder:this.config.undo.rightBorder,active:!1,disabled:!1},redoConfig:{show:this.config.redo.show,leftBorder:this.config.redo.leftBorder,rightBorder:this.config.redo.rightBorder,active:!1,disabled:!1},headingConfig:{show:this.config.heading.show,displayConfig:{options:this.config.heading.options,value:"",width:this.config.heading.width,maxHeight:this.config.heading.maxHeight},defaultValue:this.config.heading.defaultValue,leftBorder:this.config.heading.leftBorder,rightBorder:this.config.heading.rightBorder,active:!1,disabled:!1},indentConfig:{show:this.config.indent.show,selectConfig:{options:this.config.indent.options,value:"",width:this.config.indent.width,maxHeight:this.config.indent.maxHeight},leftBorder:this.config.indent.leftBorder,rightBorder:this.config.indent.rightBorder,active:!1,disabled:!1},quoteConfig:{show:this.config.quote.show,leftBorder:this.config.quote.leftBorder,rightBorder:this.config.quote.rightBorder,active:!1,disabled:!1},alignConfig:{show:this.config.align.show,selectConfig:{options:this.config.align.options,width:this.config.align.width,maxHeight:this.config.align.maxHeight},leftBorder:this.config.align.leftBorder,rightBorder:this.config.align.rightBorder,active:!1,disabled:!1},orderListConfig:{show:this.config.orderList.show,leftBorder:this.config.orderList.leftBorder,rightBorder:this.config.orderList.rightBorder,active:!1,disabled:!1},unorderListConfig:{show:this.config.unorderList.show,leftBorder:this.config.unorderList.leftBorder,rightBorder:this.config.unorderList.rightBorder,active:!1,disabled:!1},taskConfig:{show:this.config.task.show,leftBorder:this.config.task.leftBorder,rightBorder:this.config.task.rightBorder,active:!1,disabled:!1},boldConfig:{show:this.config.bold.show,leftBorder:this.config.bold.leftBorder,rightBorder:this.config.bold.rightBorder,active:!1,disabled:!1},underlineConfig:{show:this.config.underline.show,leftBorder:this.config.underline.leftBorder,rightBorder:this.config.underline.rightBorder,active:!1,disabled:!1},italicConfig:{show:this.config.italic.show,leftBorder:this.config.italic.leftBorder,rightBorder:this.config.italic.rightBorder,active:!1,disabled:!1},strikethroughConfig:{show:this.config.strikethrough.show,leftBorder:this.config.strikethrough.leftBorder,rightBorder:this.config.strikethrough.rightBorder,active:!1,disabled:!1},codeConfig:{show:this.config.code.show,leftBorder:this.config.code.leftBorder,rightBorder:this.config.code.rightBorder,active:!1,disabled:!1},superConfig:{show:this.config.super.show,leftBorder:this.config.super.leftBorder,rightBorder:this.config.super.rightBorder,active:!1,disabled:!1},subConfig:{show:this.config.sub.show,leftBorder:this.config.sub.leftBorder,rightBorder:this.config.sub.rightBorder,active:!1,disabled:!1},formatClearConfig:{show:this.config.formatClear.show,leftBorder:this.config.formatClear.leftBorder,rightBorder:this.config.formatClear.rightBorder,active:!1,disabled:!1},fontSizeConfig:{show:this.config.fontSize.show,displayConfig:{options:this.config.fontSize.options,value:"",width:this.config.fontSize.width,maxHeight:this.config.fontSize.maxHeight},defaultValue:this.config.fontSize.defaultValue,leftBorder:this.config.fontSize.leftBorder,rightBorder:this.config.fontSize.rightBorder,active:!1,disabled:!1},fontFamilyConfig:{show:this.config.fontFamily.show,displayConfig:{options:this.config.fontFamily.options,value:"",width:this.config.fontFamily.width,maxHeight:this.config.fontFamily.maxHeight},defaultValue:this.config.fontFamily.defaultValue,leftBorder:this.config.fontFamily.leftBorder,rightBorder:this.config.fontFamily.rightBorder,active:!1,disabled:!1},lineHeightConfig:{show:this.config.lineHeight.show,displayConfig:{options:this.config.lineHeight.options,value:"",width:this.config.lineHeight.width,maxHeight:this.config.lineHeight.maxHeight},defaultValue:this.config.lineHeight.defaultValue,leftBorder:this.config.lineHeight.leftBorder,rightBorder:this.config.lineHeight.rightBorder,active:!1,disabled:!1},foreColorConfig:{show:this.config.foreColor.show,selectConfig:{options:this.config.foreColor.options},leftBorder:this.config.foreColor.leftBorder,rightBorder:this.config.foreColor.rightBorder,value:"",active:!1,disabled:!1},backColorConfig:{show:this.config.backColor.show,selectConfig:{options:this.config.backColor.options},leftBorder:this.config.backColor.leftBorder,rightBorder:this.config.backColor.rightBorder,value:"",active:!1,disabled:!1},linkConfig:{show:this.config.link.show,leftBorder:this.config.link.leftBorder,rightBorder:this.config.link.rightBorder,active:!1,disabled:!1,text:""},imageConfig:{show:this.config.image.show,leftBorder:this.config.image.leftBorder,rightBorder:this.config.image.rightBorder,active:!1,disabled:!1,accept:this.config.image.accept,multiple:this.config.image.multiple,maxSize:this.config.image.maxSize,minSize:this.config.image.minSize,handleError:this.config.image.handleError,customUpload:this.config.image.customUpload},videoConfig:{show:this.config.video.show,leftBorder:this.config.video.leftBorder,rightBorder:this.config.video.rightBorder,active:!1,disabled:!1,accept:this.config.video.accept,multiple:this.config.video.multiple,maxSize:this.config.video.maxSize,minSize:this.config.video.minSize,handleError:this.config.video.handleError,customUpload:this.config.video.customUpload},tableConfig:{show:this.config.table.show,leftBorder:this.config.table.leftBorder,rightBorder:this.config.table.rightBorder,active:!1,disabled:!1,maxRows:this.config.table.maxRows,maxColumns:this.config.table.maxColumns},codeBlockConfig:{show:this.config.codeBlock.show,leftBorder:this.config.codeBlock.leftBorder,rightBorder:this.config.codeBlock.rightBorder,active:!1,disabled:!1},sourceViewConfig:{show:this.config.sourceView.show,leftBorder:this.config.sourceView.leftBorder,rightBorder:this.config.sourceView.rightBorder,active:!1,disabled:!1}}},computed:{menuNames(){return Object.keys(this.config.sequence).sort(((e,t)=>this.config.sequence[e]>this.config.sequence[t]?1:-1))},menuDisabled(){return e=>"sourceView"!=e&&this.$parent.isSourceView}},components:{MenuItem:{props:{name:String,disabled:Boolean},inject:["$editTrans"],render:function(){const e={tooltip:this.$parent.config.tooltip,name:this.name};if("undo"==this.name&&this.$parent.undoConfig.show)return t.h(hn,{...e,title:this.$editTrans("undo"),leftBorder:this.$parent.undoConfig.leftBorder,rightBorder:this.$parent.undoConfig.rightBorder,disabled:this.$parent.undoConfig.disabled||this.disabled||this.$parent.disabled,color:this.$parent.color,active:this.$parent.undoConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"undo"})));if("redo"==this.name&&this.$parent.redoConfig.show)return t.h(hn,{...e,title:this.$editTrans("redo"),leftBorder:this.$parent.redoConfig.leftBorder,rightBorder:this.$parent.redoConfig.rightBorder,disabled:this.$parent.redoConfig.disabled||this.disabled||this.$parent.disabled,color:this.$parent.color,active:this.$parent.redoConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"redo"})));if("heading"==this.name&&this.$parent.headingConfig.show)return t.h(hn,{...e,type:"display",displayConfig:this.$parent.headingConfig.displayConfig,title:this.$editTrans("heading"),leftBorder:this.$parent.headingConfig.leftBorder,rightBorder:this.$parent.headingConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.headingConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.headingConfig.active,onOperate:this.$parent.handleOperate});if("indent"==this.name&&this.$parent.indentConfig.show)return t.h(hn,{...e,type:"select",selectConfig:this.$parent.indentConfig.selectConfig,title:this.$editTrans("indent"),leftBorder:this.$parent.indentConfig.leftBorder,rightBorder:this.$parent.indentConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.indentConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.indentConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"indent-increase"})));if("quote"==this.name&&this.$parent.quoteConfig.show)return t.h(hn,{...e,title:this.$editTrans("quote"),leftBorder:this.$parent.quoteConfig.leftBorder,rightBorder:this.$parent.quoteConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.quoteConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.quoteConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"quote"})));if("align"==this.name&&this.$parent.alignConfig.show)return t.h(hn,{...e,type:"select",selectConfig:this.$parent.alignConfig.selectConfig,title:this.$editTrans("align"),leftBorder:this.$parent.alignConfig.leftBorder,rightBorder:this.$parent.alignConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.alignConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.alignConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"align-left"})));if("orderList"==this.name&&this.$parent.orderListConfig.show)return t.h(hn,{...e,title:this.$editTrans("orderList"),leftBorder:this.$parent.orderListConfig.leftBorder,rightBorder:this.$parent.orderListConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.orderListConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.orderListConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"list-ordered"})));if("unorderList"==this.name&&this.$parent.unorderListConfig.show)return t.h(hn,{...e,title:this.$editTrans("unorderList"),leftBorder:this.$parent.unorderListConfig.leftBorder,rightBorder:this.$parent.unorderListConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.unorderListConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.unorderListConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"list-unordered"})));if("task"==this.name&&this.$parent.taskConfig.show)return t.h(hn,{...e,title:this.$editTrans("task"),leftBorder:this.$parent.taskConfig.leftBorder,rightBorder:this.$parent.taskConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.taskConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.taskConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"task"})));if("bold"==this.name&&this.$parent.boldConfig.show)return t.h(hn,{...e,title:this.$editTrans("bold"),leftBorder:this.$parent.boldConfig.leftBorder,rightBorder:this.$parent.boldConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.boldConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.boldConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"bold"})));if("underline"==this.name&&this.$parent.underlineConfig.show)return t.h(hn,{...e,title:this.$editTrans("underline"),leftBorder:this.$parent.underlineConfig.leftBorder,rightBorder:this.$parent.underlineConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.underlineConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.underlineConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"underline"})));if("italic"==this.name&&this.$parent.italicConfig.show)return t.h(hn,{...e,title:this.$editTrans("italic"),leftBorder:this.$parent.italicConfig.leftBorder,rightBorder:this.$parent.italicConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.italicConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.italicConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"italic"})));if("strikethrough"==this.name&&this.$parent.strikethroughConfig.show)return t.h(hn,{...e,title:this.$editTrans("strikethrough"),leftBorder:this.$parent.strikethroughConfig.leftBorder,rightBorder:this.$parent.strikethroughConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.strikethroughConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.strikethroughConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"strikethrough"})));if("code"==this.name&&this.$parent.codeConfig.show)return t.h(hn,{...e,title:this.$editTrans("code"),leftBorder:this.$parent.codeConfig.leftBorder,rightBorder:this.$parent.codeConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.codeConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.codeConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"code"})));if("super"==this.name&&this.$parent.superConfig.show)return t.h(hn,{...e,title:this.$editTrans("superscript"),leftBorder:this.$parent.superConfig.leftBorder,rightBorder:this.$parent.superConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.superConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.superConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"superscript"})));if("sub"==this.name&&this.$parent.subConfig.show)return t.h(hn,{...e,title:this.$editTrans("subscript"),leftBorder:this.$parent.subConfig.leftBorder,rightBorder:this.$parent.subConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.subConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.subConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"subscript"})));if("formatClear"==this.name&&this.$parent.formatClearConfig.show)return t.h(hn,{...e,title:this.$editTrans("formatClear"),leftBorder:this.$parent.formatClearConfig.leftBorder,rightBorder:this.$parent.formatClearConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.formatClearConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.formatClearConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"format-clear"})));if("fontSize"==this.name&&this.$parent.fontSizeConfig.show)return t.h(hn,{...e,type:"display",displayConfig:this.$parent.fontSizeConfig.displayConfig,title:this.$editTrans("fontSize"),leftBorder:this.$parent.fontSizeConfig.leftBorder,rightBorder:this.$parent.fontSizeConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.fontSizeConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.fontSizeConfig.active,onOperate:this.$parent.handleOperate});if("fontFamily"==this.name&&this.$parent.fontFamilyConfig.show)return t.h(hn,{...e,type:"display",displayConfig:this.$parent.fontFamilyConfig.displayConfig,title:this.$editTrans("fontFamily"),leftBorder:this.$parent.fontFamilyConfig.leftBorder,rightBorder:this.$parent.fontFamilyConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.fontFamilyConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.fontFamilyConfig.active,onOperate:this.$parent.handleOperate});if("lineHeight"==this.name&&this.$parent.lineHeightConfig.show)return t.h(hn,{...e,type:"display",displayConfig:this.$parent.lineHeightConfig.displayConfig,title:this.$editTrans("lineHeight"),leftBorder:this.$parent.lineHeightConfig.leftBorder,rightBorder:this.$parent.lineHeightConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.lineHeightConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.lineHeightConfig.active,onOperate:this.$parent.handleOperate});if("foreColor"==this.name&&this.$parent.foreColorConfig.show)return t.h(hn,{...e,ref:"btn",type:"select",selectConfig:this.$parent.foreColorConfig.selectConfig,title:this.$editTrans("foreColor"),leftBorder:this.$parent.foreColorConfig.leftBorder,rightBorder:this.$parent.foreColorConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.foreColorConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.foreColorConfig.active,hideScroll:!0},{default:()=>t.h(nn,{value:"font-color"}),layer:e=>t.h(Cn,{tooltip:this.$parent.config.tooltip,value:this.$parent.foreColorConfig.value,data:e.options,color:this.$parent.color,onChange:e=>{this.$parent.handleOperate.apply(this.$parent,["foreColor",e]),this.$refs.btn.hideLayer()}})});if("backColor"==this.name&&this.$parent.backColorConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",selectConfig:this.$parent.backColorConfig.selectConfig,title:this.$editTrans("backColor"),leftBorder:this.$parent.backColorConfig.leftBorder,rightBorder:this.$parent.backColorConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.backColorConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.backColorConfig.active,onOperate:this.$parent.handleOperate,hideScroll:!0},{default:()=>t.h(nn,{value:"brush"}),layer:e=>t.h(Cn,{tooltip:this.$parent.config.tooltip,value:this.$parent.backColorConfig.value,data:e.options,color:this.$parent.color,onChange:e=>{this.$parent.handleOperate.apply(this.$parent,["backColor",e]),this.$refs.btn.hideLayer()}})});if("link"==this.name&&this.$parent.linkConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",title:this.$editTrans("insertLink"),leftBorder:this.$parent.linkConfig.leftBorder,rightBorder:this.$parent.linkConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.linkConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.linkConfig.active,hideScroll:!0,onLayerShow:()=>{let e="";this.$parent.$parent.editor.getElementsByRange(!0,!0).forEach((t=>{t.element.isText()&&(t.offset?e+=t.element.textContent.substring(t.offset[0],t.offset[1]):e+=t.element.textContent||"")})),this.$parent.linkConfig.text=e}},{default:()=>t.h(nn,{value:"link"}),layer:()=>t.h(Mn,{color:this.$parent.color,text:this.$parent.linkConfig.text,onInsert:(e,t,i)=>{this.$parent.handleOperate.apply(this.$parent,["link",{text:e,url:t,newOpen:i}]),this.$refs.btn.hideLayer()}})});if("image"==this.name&&this.$parent.imageConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",title:this.$editTrans("insertImage"),leftBorder:this.$parent.imageConfig.leftBorder,rightBorder:this.$parent.imageConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.imageConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.imageConfig.active,hideScroll:!0},{default:()=>t.h(nn,{value:"image"}),layer:()=>t.h(jn,{color:this.$parent.color,accept:this.$parent.imageConfig.accept,multiple:this.$parent.imageConfig.multiple,maxSize:this.$parent.imageConfig.maxSize,minSize:this.$parent.imageConfig.minSize,customUpload:this.$parent.imageConfig.customUpload,handleError:this.$parent.imageConfig.handleError,onChange:()=>{this.$refs.btn.$refs.layer.setPosition()},onInsert:e=>{this.$parent.handleOperate.apply(this.$parent,["image",e]),this.$refs.btn.hideLayer()}})});if("video"==this.name&&this.$parent.videoConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",title:this.$editTrans("insertVideo"),leftBorder:this.$parent.videoConfig.leftBorder,rightBorder:this.$parent.videoConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.videoConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.videoConfig.active,hideScroll:!0},{default:()=>t.h(nn,{value:"video"}),layer:()=>t.h(Jn,{color:this.$parent.color,accept:this.$parent.videoConfig.accept,multiple:this.$parent.videoConfig.multiple,maxSize:this.$parent.videoConfig.maxSize,minSize:this.$parent.videoConfig.minSize,customUpload:this.$parent.videoConfig.customUpload,handleError:this.$parent.videoConfig.handleError,onChange:()=>{this.$refs.btn.$refs.layer.setPosition()},onInsert:e=>{this.$parent.handleOperate.apply(this.$parent,["video",e]),this.$refs.btn.hideLayer()}})});if("table"==this.name&&this.$parent.tableConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",title:this.$editTrans("insertTable"),leftBorder:this.$parent.tableConfig.leftBorder,rightBorder:this.$parent.tableConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.tableConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.tableConfig.active,hideScroll:!0},{default:()=>t.h(nn,{value:"table"}),layer:()=>t.h(so,{color:this.$parent.color,maxRows:this.$parent.tableConfig.maxRows,maxColumns:this.$parent.tableConfig.maxColumns,onInsert:(e,t)=>{this.$parent.handleOperate.apply(this.$parent,["table",{row:e,column:t}]),this.$refs.btn.hideLayer()}})});if("codeBlock"==this.name&&this.$parent.codeBlockConfig.show)return t.h(hn,{...e,title:this.$editTrans("inserCodeBlock"),leftBorder:this.$parent.codeBlockConfig.leftBorder,rightBorder:this.$parent.codeBlockConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.codeBlockConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.codeBlockConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"code-block"})));if("sourceView"==this.name&&this.$parent.sourceViewConfig.show)return t.h(hn,{...e,title:this.$editTrans("sourceView"),leftBorder:this.$parent.sourceViewConfig.leftBorder,rightBorder:this.$parent.sourceViewConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.sourceViewConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.sourceViewConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"source-view"})));if(ue.common.isObject(this.$parent.config.extends)){const i=this.$parent.config.extends[this.name];if(i)return t.h(hn,{...e,ref:"btn",type:i.type||"default",title:i.title||"",leftBorder:i.leftBorder||!1,rightBorder:i.rightBorder||!1,disabled:i.disabled||this.disabled||this.$parent.disabled,hideScroll:i.hideScroll||!1,active:i.active||!1,selectConfig:{width:i.width,maxHeight:i.maxHeight,options:i.options},displayConfig:{width:i.width,maxHeight:i.maxHeight,value:i.value,options:i.options},color:this.$parent.color,onLayerShow:()=>{"function"==typeof i.onLayerShow&&i.onLayerShow.apply(this.$parent.$parent,[this.name,this.$refs.btn])},onLayerShown:()=>{"function"==typeof i.onLayerShown&&i.onLayerShown.apply(this.$parent.$parent,[this.name,this.$refs.btn])},onLayerHidden:()=>{"function"==typeof i.onLayerHidden&&i.onLayerHidden.apply(this.$parent.$parent,[this.name,this.$refs.btn])},onOperate:(e,t)=>{"function"==typeof i.onOperate&&i.onOperate.apply(this.$parent.$parent,[e,t,this.$refs.btn])}},{default:i.default||null,layer:i.layer||null,option:i.option||null})}return null}}},methods:{handleOperate(e,t){if(!this.disabled)if("undo"==e)this.$parent.undo();else if("redo"==e)this.$parent.redo();else if("heading"==e)this.$parent.setHeading(t);else if("indent"==e)"indent-increase"==t?this.$parent.setIndentIncrease():"indent-decrease"==t&&this.$parent.setIndentDecrease();else if("quote"==e)this.$parent.setQuote();else if("align"==e)this.$parent.setAlign(t);else if("orderList"==e)this.$parent.setList(!0);else if("unorderList"==e)this.$parent.setList(!1);else if("task"==e)this.$parent.setTask();else if("bold"==e)this.$parent.setTextStyle("font-weight","bold");else if("underline"==e)this.$parent.setTextStyle("text-decoration","underline");else if("italic"==e)this.$parent.setTextStyle("font-style","italic");else if("strikethrough"==e)this.$parent.setTextStyle("text-decoration","line-through");else if("code"==e)this.$parent.setTextMark("data-editify-code",!0);else if("super"==e)this.$parent.setTextStyle("vertical-align","super");else if("sub"==e)this.$parent.setTextStyle("vertical-align","sub");else if("formatClear"==e)this.$parent.formatText();else if("fontSize"==e)this.$parent.setTextStyle("font-size",t);else if("fontFamily"==e)this.$parent.setTextStyle("font-family",t);else if("lineHeight"==e)this.$parent.setLineHeight(t);else if("foreColor"==e)this.$parent.setTextStyle("color",t);else if("backColor"==e)this.$parent.setTextStyle("background-color",t);else if("link"==e){if(!t.url)return;t.text||(text=url);const e={href:t.url};t.newOpen&&(e.target="_blank");const i=new k("inline","a",e,null,null),n=new k("text",null,null,null,t.text);this.$parent.editor.addElementTo(n,i),this.$parent.editor.insertElement(i),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}else if("image"==e){if(!t)return;this.$parent.insertImage(t)}else if("video"==e){if(!t)return;this.$parent.insertVideo(t)}else"table"==e?this.$parent.insertTable(t.row,t.column):"codeBlock"==e?this.$parent.insertCodeBlock():"sourceView"==e&&(this.$parent.isSourceView=!this.$parent.isSourceView,this.sourceViewConfig.active=this.$parent.isSourceView,this.$parent.isSourceView||this.$parent.editor.rangeRender())},handleRangeUpdate(){if(this.disabled)return;const e=this.$parent.editor.getElementsByRange(!0,!1),t=this.$parent.hasPreStyle(),i=this.$parent.hasTable(),n=this.$parent.hasQuote(),o=this.$parent.inQuote(),r=this.$parent.hasLink(),s=this.$parent.inList(!0),a=this.$parent.inList(!1),l=this.$parent.inTask(),d=e=>"function"==typeof this.config.extraDisabled&&this.config.extraDisabled.apply(this.$parent,[e])||!1;this.undoConfig.disabled=!this.$parent.editor.history.get(-1)||d("undo"),this.redoConfig.disabled=!this.$parent.editor.history.get(1)||d("redo");const c=this.headingConfig.displayConfig.options.find((t=>{let i=t;return ue.common.isObject(t)&&(i=t.value),this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)?this.$parent.editor.range.anchor.element.getBlock().parsedom==i:e.every((e=>e.element.isBlock()?e.element.parsedom==i:e.element.getBlock().parsedom==i))}));this.headingConfig.displayConfig.value=c?ue.common.isObject(c)?c.value:c:this.headingConfig.defaultValue,this.headingConfig.disabled=t||i||d("heading"),this.indentConfig.disabled=t||i||n||d("indent"),this.quoteConfig.active=o,this.quoteConfig.disabled=t||i||d("quote"),this.alignConfig.disabled=t||d("align"),this.orderListConfig.active=s,this.orderListConfig.disabled=t||i||d("orderList"),this.unorderListConfig.active=a,this.unorderListConfig.disabled=t||i||d("unorderList"),this.taskConfig.active=l,this.taskConfig.disabled=t||i||d("task"),this.boldConfig.active=this.$parent.queryTextStyle("font-weight","bold"),this.boldConfig.disabled=t||d("bold"),this.underlineConfig.active=this.$parent.queryTextStyle("text-decoration","underline",!0),this.underlineConfig.disabled=t||d("underline"),this.italicConfig.active=this.$parent.queryTextStyle("font-style","italic",!0),this.italicConfig.disabled=t||d("italic"),this.strikethroughConfig.active=this.$parent.queryTextStyle("text-decoration","line-through",!0),this.strikethroughConfig.disabled=t||d("strikethrough"),this.codeConfig.active=this.$parent.queryTextMark("data-editify-code"),this.codeConfig.disabled=t||d("code"),this.superConfig.active=this.$parent.queryTextStyle("vertical-align","super",!0),this.superConfig.disabled=t||d("super"),this.subConfig.active=this.$parent.queryTextStyle("vertical-align","sub",!0),this.subConfig.disabled=t||d("sub"),this.formatClearConfig.disabled=t||d("formatClear");const h=this.fontSizeConfig.displayConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("font-size",e.value,!0):this.$parent.queryTextStyle("font-size",e,!0)));this.fontSizeConfig.displayConfig.value=h?ue.common.isObject(h)?h.value:h:this.fontSizeConfig.defaultValue,this.fontSizeConfig.disabled=t||d("fontSize");const u=this.fontFamilyConfig.displayConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("font-family",e.value,!0):this.$parent.queryTextStyle("font-family",e,!0)));this.fontFamilyConfig.displayConfig.value=u?ue.common.isObject(u)?u.value:u:this.fontFamilyConfig.defaultValue,this.fontFamilyConfig.disabled=t||d("fontFamily");const f=this.lineHeightConfig.displayConfig.options.find((t=>{let i=t;if(ue.common.isObject(t)&&(i=t.value),this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)){const e=this.$parent.editor.range.anchor.element.getBlock();return e.hasStyles()&&e.styles["line-height"]==i}return e.every((e=>{if(e.element.isBlock()||e.element.isInblock())return e.element.hasStyles()&&e.element.styles["line-height"]==i;const t=e.element.getBlock(),n=e.element.getInblock();return n?n.hasStyles()&&n.styles["line-height"]==i:t.hasStyles()&&t.styles["line-height"]==i}))}));this.lineHeightConfig.displayConfig.value=f?ue.common.isObject(f)?f.value:f:this.lineHeightConfig.defaultValue,this.lineHeightConfig.disabled=t||d("lineHeight");const g=this.foreColorConfig.selectConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("color",e.value,!0):this.$parent.queryTextStyle("color",e,!0)));this.foreColorConfig.value=g?ue.common.isObject(g)?g.value:g:"",this.foreColorConfig.disabled=t||d("foreColor");const m=this.backColorConfig.selectConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("background-color",e.value,!0):this.$parent.queryTextStyle("background-color",e,!0)));this.backColorConfig.value=m?ue.common.isObject(m)?m.value:m:"",this.backColorConfig.disabled=t||d("backColor"),this.linkConfig.disabled=r||t||d("link"),this.imageConfig.disabled=t||d("image"),this.videoConfig.disabled=t||d("video"),this.tableConfig.disabled=t||i||n||d("table"),this.codeBlockConfig.active=!!this.$parent.getCurrentParsedomElement("pre"),this.codeBlockConfig.disabled=i||n||d("codeBlock"),this.sourceViewConfig.active=this.$parent.isSourceView}}},lo=["data-editify-mode"];const co={name:"editify",props:{...Ii},emits:["update:modelValue","focus","blur","change","keydown","insertparagraph","rangeupdate","copy","cut","paste-text","paste-html","paste-image","paste-video","before-render","after-render"],setup:()=>({uid:t.getCurrentInstance().uid}),data:()=>({editor:null,isModelChange:!1,isSourceView:!1,isInputChinese:!1,tableColumnResizeParams:{element:null,start:0},toolbarOptions:{show:!1,node:null,type:"text"},toolbarTime:null,canUseMenu:!1}),computed:{value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue||"<p><br></p>"}},textValue(){return ue.element.string2dom(`<div>${this.value}</div>`).innerText},showPlaceholder(){if(this.editor){const e=this.editor.parseHtml(this.value);if(1==e.length&&"block"==e[0].type&&e[0].parsedom==k.BLOCK_NODE&&e[0].isOnlyHasBreak())return!this.isInputChinese}return!1},contentStyle(){return this.autoheight?{minHeight:this.height}:{height:this.height}},toolbarConfig(){return Ri((e=this.$editTrans,t=this.$editLocale,{use:!0,style:null,tooltip:!0,codeBlock:{languages:{show:!0,options:[{label:e("autoRecognize"),value:""},...Oi],width:100,maxHeight:180,leftBorder:!0,rightBorder:!1}},text:{heading:{show:!0,options:qi(e).heading,defaultValue:"p",width:"en_US"==t?150:130,maxHeight:"",leftBorder:!1,rightBorder:!0},align:{show:!1,options:qi(e).align,width:"zh_CN"==t?100:130,maxHeight:"",leftBorder:!1,rightBorder:!1},orderList:{show:!1,leftBorder:!1,rightBorder:!1},unorderList:{show:!1,leftBorder:!1,rightBorder:!1},task:{show:!1,leftBorder:!1,rightBorder:!1},bold:{show:!0,leftBorder:!1,rightBorder:!1},italic:{show:!0,leftBorder:!1,rightBorder:!1},strikethrough:{show:!0,leftBorder:!1,rightBorder:!1},underline:{show:!1,leftBorder:!1,rightBorder:!1},code:{show:!0,leftBorder:!1,rightBorder:!1},super:{show:!1,leftBorder:!1,rightBorder:!1},sub:{show:!1,leftBorder:!1,rightBorder:!1},fontSize:{show:!0,options:qi(e).fontSize,defaultValue:"",width:90,maxHeight:200,leftBorder:!0,rightBorder:!1},fontFamily:{show:!1,options:qi(e).fontFamily,defaultValue:"",width:100,maxHeight:200,leftBorder:!1,rightBorder:!1},lineHeight:{show:!1,options:qi(e).lineHeight,defaultValue:"",width:90,maxHeight:"",leftBorder:!1,rightBorder:!1},foreColor:{show:!0,options:qi(e).foreColor,leftBorder:!1,rightBorder:!1},backColor:{show:!0,options:qi(e).backColor,leftBorder:!1,rightBorder:!1},formatClear:{show:!0,leftBorder:!0,rightBorder:!1}},extraDisabled:null}),this.toolbar||{});var e,t},menuConfig(){return Ri((e=this.$editTrans,t=this.$editLocale,{use:!0,tooltip:!0,mode:"default",extraDisabled:null,style:null,sequence:{undo:0,redo:1,heading:2,indent:3,quote:4,align:5,orderList:6,unorderList:7,task:8,bold:9,underline:10,italic:11,strikethrough:12,code:13,super:14,sub:15,formatClear:16,fontSize:17,fontFamily:18,lineHeight:19,foreColor:20,backColor:21,link:22,image:23,video:24,table:25,codeBlock:26,sourceView:27},undo:{show:!0,leftBorder:!1,rightBorder:!1},redo:{show:!0,leftBorder:!1,rightBorder:!1},heading:{show:!0,options:qi(e).heading,defaultValue:"p",width:"en_US"==t?150:130,maxHeight:"",leftBorder:!0,rightBorder:!1},indent:{show:!0,options:qi(e).indent,width:"en_US"==t?150:110,maxHeight:"",leftBorder:!1,rightBorder:!1},quote:{show:!0,leftBorder:!1,rightBorder:!1},align:{show:!0,options:qi(e).align,width:"zh_CN"==t?100:130,maxHeight:"",leftBorder:!0,rightBorder:!1},orderList:{show:!0,leftBorder:!1,rightBorder:!1},unorderList:{show:!0,leftBorder:!1,rightBorder:!1},task:{show:!0,leftBorder:!1,rightBorder:!1},bold:{show:!0,leftBorder:!0,rightBorder:!1},underline:{show:!0,leftBorder:!1,rightBorder:!1},italic:{show:!0,leftBorder:!1,rightBorder:!1},strikethrough:{show:!0,leftBorder:!1,rightBorder:!1},code:{show:!0,leftBorder:!1,rightBorder:!1},super:{show:!0,leftBorder:!1,rightBorder:!1},sub:{show:!0,leftBorder:!1,rightBorder:!1},formatClear:{show:!0,leftBorder:!1,rightBorder:!1},fontSize:{show:!0,options:qi(e).fontSize,defaultValue:"",width:90,maxHeight:200,leftBorder:!0,rightBorder:!1},fontFamily:{show:!0,options:qi(e).fontFamily,defaultValue:"",width:100,maxHeight:200,leftBorder:!1,rightBorder:!1},lineHeight:{show:!0,options:qi(e).lineHeight,defaultValue:"",width:90,maxHeight:"",leftBorder:!1,rightBorder:!1},foreColor:{show:!0,options:qi(e).foreColor,leftBorder:!0,rightBorder:!1},backColor:{show:!0,options:qi(e).backColor,leftBorder:!1,rightBorder:!1},link:{show:!0,leftBorder:!0,rightBorder:!1},image:{show:!0,leftBorder:!1,rightBorder:!1,accept:["jpg","png","jpeg","webp","jfif","ico","gif","svg","psd"],multiple:!1,maxSize:null,minSize:null,customUpload:null,handleError:null},video:{show:!0,leftBorder:!1,rightBorder:!1,accept:["mp4","avi","mpg","wmv","mov","rm","swf","flv"],multiple:!1,maxSize:null,minSize:null,customUpload:null,handleError:null},table:{show:!0,leftBorder:!1,rightBorder:!1,maxRows:10,maxColumns:10},codeBlock:{show:!0,leftBorder:!1,rightBorder:!1},sourceView:{show:!0,leftBorder:!0,rightBorder:!1},extends:{}}),this.menu||{});var e,t}},components:{Toolbar:_n,Tooltip:tn,Menu:Ki(ao,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("MenuItem");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-menu",{border:e.$parent.border}]),"data-editify-mode":n.config.mode,style:t.normalizeStyle(n.config.style||"")},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.menuNames,(e=>(t.openBlock(),t.createBlock(a,{name:e,disabled:s.menuDisabled(e)},null,8,["name","disabled"])))),256))],14,lo)}],["__scopeId","data-v-3fc2d533"]])},inject:["$editTrans","$editLocale"],watch:{value(e){this.isModelChange||(this.editor.stack=this.editor.parseHtml(e),this.editor.range=null,this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},isSourceView(e){this.toolbarConfig.use&&(e?this.hideToolbar():this.handleToolbar())}},mounted(){this.createEditor(),this.handleScroll(),ue.event.on(document.documentElement,`mousedown.editify_${this.uid}`,this.documentMouseDown),ue.event.on(document.documentElement,`mousemove.editify_${this.uid}`,this.documentMouseMove),ue.event.on(document.documentElement,`mouseup.editify_${this.uid}`,this.documentMouseUp),ue.event.on(document.documentElement,`click.editify_${this.uid}`,this.documentClick),ue.event.on(window,`resize.editify_${this.uid}`,this.setVideoHeight)},methods:{createEditor(){this.editor=new Y(this.$refs.content,{value:this.value,disabled:this.disabled,renderRules:[zi,Hi,Vi,Wi,e=>{var t,i,n,o,r,s;Ui.apply(this.editor,[e,(null==(t=this.toolbarConfig)?void 0:t.use)&&(null==(o=null==(n=null==(i=this.toolbarConfig)?void 0:i.codeBlock)?void 0:n.languages)?void 0:o.show),null==(s=null==(r=this.toolbarConfig)?void 0:r.codeBlock)?void 0:s.languages.options])}],allowCopy:this.allowCopy,allowPaste:this.allowPaste,allowCut:this.allowCut,allowPasteHtml:this.allowPasteHtml,allowPasteHtml:this.allowPasteHtml,customImagePaste:this.customImagePaste,customVideoPaste:this.customVideoPaste,customMerge:this.handleCustomMerge}),this.internalModify(this.editor.value),this.editor.on("change",this.handleEditorChange),this.editor.on("focus",this.handleEditorFocus),this.editor.on("blur",this.handleEditorBlur),this.editor.on("insertParagraph",this.handleInsertParagraph),this.editor.on("rangeUpdate",this.handleRangeUpdate),this.editor.on("copy",this.handleCopy),this.editor.on("cut",this.handleCut),this.editor.on("pasteText",this.handlePasteText),this.editor.on("pasteHtml",this.handlePasteHtml),this.editor.on("pasteImage",this.handlePasteImage),this.editor.on("pasteVideo",this.handlePasteVideo),this.editor.on("deleteInStart",this.handleDeleteInStart),this.editor.on("deleteComplete",this.handleDeleteComplete),this.editor.on("beforeRender",this.handleBeforeRender),this.editor.on("afterRender",this.handleAfterRender),this.editor.formatElementStack(),this.editor.domRender(),!this.autofocus||this.isSourceView||this.disabled||this.collapseToEnd()},internalModify(e){this.isModelChange=!0,this.value=e,this.$nextTick((()=>{this.isModelChange=!1}))},handleScroll(){const e=t=>{ue.event.on(t,`scroll.editify_${this.uid}`,(()=>{this.toolbarConfig.use&&this.toolbarOptions.show&&this.hideToolbar()})),t.parentNode&&e(t.parentNode)};e(this.$refs.content)},removeScrollHandle(){const e=t=>{ue.event.off(t,`scroll.editify_${this.uid}`),t.parentNode&&e(t.parentNode)};e(this.$refs.content)},handleToolbar(){this.disabled||this.isSourceView||(this.toolbarTime&&clearTimeout(this.toolbarTime),this.toolbarTime=setTimeout((()=>{this.hideToolbar(),this.$nextTick((()=>{const e=this.getCurrentParsedomElement("table"),t=this.getCurrentParsedomElement("pre"),i=this.getCurrentParsedomElement("a"),n=this.getCurrentParsedomElement("img"),o=this.getCurrentParsedomElement("video");if(i)this.toolbarOptions.type="link",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${i.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else if(n)this.toolbarOptions.type="image",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${n.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else if(o)this.toolbarOptions.type="video",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${o.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else if(e)this.toolbarOptions.type="table",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${e.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else if(t)this.toolbarOptions.type="codeBlock",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${t.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else{!this.editor.getElementsByRange(!0,!0).filter((e=>e.element.isText())).length||this.hasTable()||this.hasPreStyle()||this.hasLink()||this.hasImage()||this.hasVideo()||(this.toolbarOptions.type="text",this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0)}}))}),200))},handleCustomMerge(e,t){const i=t.getUneditableElement();i?i.toEmpty():(t.children.push(...e.children),t.children.forEach((e=>{e.parent=t})),e.children=null)},hideToolbar(){this.toolbarOptions.show=!1,this.toolbarOptions.node=null},documentMouseDown(e){if(!this.disabled){if(ue.element.isContains(this.$refs.content,e.target)){const t=e.target,i=ue.data.get(t,"data-alex-editor-key");if(i){const n=this.editor.getElementByKey(i);if(n&&"td"==n.parsedom){const i=n.parent.children.length;if(n.parent.children[i-1].isEqual(n))return;const o=ue.element.getElementBounding(t);e.pageX>=Math.abs(o.left+t.offsetWidth-5)&&e.pageX<=Math.abs(o.left+t.offsetWidth+5)&&(this.tableColumnResizeParams.element=n,this.tableColumnResizeParams.start=e.pageX)}}}ue.element.isContains(this.$el,e.target)||(this.canUseMenu=!1)}},documentMouseMove(e){if(this.disabled)return;if(!this.tableColumnResizeParams.element)return;const t=this.getCurrentParsedomElement("table");if(!t)return;const i=t.children.find((e=>"colgroup"==e.parsedom)),n=this.tableColumnResizeParams.element.parent.children.findIndex((e=>e.isEqual(this.tableColumnResizeParams.element))),o=""+(this.tableColumnResizeParams.element.elm.offsetWidth+e.pageX-this.tableColumnResizeParams.start);i.children[n].marks.width=o,i.children[n].elm.setAttribute("width",o),this.tableColumnResizeParams.start=e.pageX},documentMouseUp(e){if(this.disabled)return;if(!this.tableColumnResizeParams.element)return;const t=this.getCurrentParsedomElement("table");if(!t)return;const i=t.children.find((e=>"colgroup"==e.parsedom)),n=this.tableColumnResizeParams.element.parent.children.findIndex((e=>e.isEqual(this.tableColumnResizeParams.element))),o=Number(i.children[n].marks.width);isNaN(o)||(i.children[n].marks.width=`${Number((o/this.tableColumnResizeParams.element.parent.elm.offsetWidth*100).toFixed(2))}%`,this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()),this.tableColumnResizeParams.element=null,this.tableColumnResizeParams.start=0},documentClick(e){if(!this.disabled&&ue.element.isContains(this.$refs.content,e.target)){const t=e.target,i=ue.data.get(t,"data-alex-editor-key");if(i){const n=this.editor.getElementByKey(i);if(Mi(n)){const i=ue.element.getElementBounding(t);e.pageX>=Math.abs(i.left)&&e.pageX<=Math.abs(i.left+16)&&e.pageY>=Math.abs(i.top+t.offsetHeight/2-8)&&e.pageY<=Math.abs(i.top+t.offsetHeight/2+8)&&("checked"==n.marks["data-editify-task"]?n.marks["data-editify-task"]="uncheck":n.marks["data-editify-task"]="checked",this.editor.range||this.editor.initRange(),this.editor.range.anchor.moveToEnd(n),this.editor.range.focus.moveToEnd(n),this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())}}}},handleEditorChange(e,t){this.disabled||(this.internalModify(e),this.$emit("change",e,t))},handleEditorBlur(e){this.disabled||(this.border&&this.color&&(this.$refs.body.style.borderColor="",this.$refs.body.style.boxShadow="",this.menuConfig.use&&(this.$refs.menu.$el.style.borderColor="",this.$refs.menu.$el.style.boxShadow="")),this.$emit("blur",e))},handleEditorFocus(e){if(!this.disabled){if(this.border&&this.color){this.$refs.body.style.borderColor=this.color;const e=ue.color.hex2rgb(this.color);this.menuConfig.use&&"inner"==this.menuConfig.mode?(this.$refs.body.style.boxShadow=`0 8px 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5),8px 0 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5), -8px 0 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5)`,this.$refs.menu.$el.style.borderColor=this.color,this.$refs.menu.$el.style.boxShadow=`0 -8px 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5),8px 0 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5), -8px 0 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5)`):(this.menuConfig.use,this.$refs.body.style.boxShadow=`0 0 8px rgba(${e[0]},${e[1]},${e[2]},0.5)`)}setTimeout((()=>{this.canUseMenu=!0}),0),this.$emit("focus",e)}},handleEditorKeydown(e){this.disabled||(9!=e.keyCode||e.metaKey||e.shiftKey||e.ctrlKey||e.altKey?9!=e.keyCode||e.metaKey||!e.shiftKey||e.ctrlKey||e.altKey||(e.preventDefault(),this.setIndentDecrease()):(e.preventDefault(),this.setIndentIncrease()),this.$emit("keydown",e))},handleEditorClick(e){if(this.disabled||this.isSourceView)return;const t=e.target;if("img"==t.nodeName.toLocaleLowerCase()||"video"==t.nodeName.toLocaleLowerCase()){const e=t.getAttribute("data-editify-element");if(e){const t=this.editor.getElementByKey(e);this.editor.range||this.editor.initRange(),this.editor.range.anchor.moveToStart(t),this.editor.range.focus.moveToEnd(t),this.editor.rangeRender()}}},handleInsertParagraph(e,t){t.isOnlyHasBreak()&&e.isOnlyHasBreak()&&(t.isBlock()||t.convertToBlock(),t.parsedom!=k.BLOCK_NODE&&(Pi(t),this.editor.range.anchor.moveToStart(t),this.editor.range.focus.moveToStart(t),e.toEmpty())),this.$emit("insertparagraph",this.value)},handleRangeUpdate(e){this.disabled||(this.toolbarConfig.use&&this.handleToolbar(),this.menuConfig.use&&this.$refs.menu.handleRangeUpdate(),this.$emit("rangeupdate",this.value,e))},handleCopy(e,t){this.$emit("copy",e,t)},handleCut(e,t){this.$emit("cut",e,t)},handlePasteText(e){this.$emit("paste-text",e)},handlePasteHtml(e,t){k.flatElements(e).forEach((e=>{let t={},i={};if(e.hasMarks()){for(let i in Ai.marks)e.marks.hasOwnProperty(i)&&(Array.isArray(Ai.marks[i])&&Ai.marks[i].includes(e.parsedom)||"*"==Ai.marks[i])&&(t[i]=e.marks[i]);e.marks=t}if(e.hasStyles()&&!e.isText()){for(let t in Ai.styles)e.styles.hasOwnProperty(t)&&(Array.isArray(Ai.styles[t])&&Ai.styles[t].includes(e.parsedom)||"*"==Ai.styles[t])&&(i[t]=e.styles[t]);e.styles=i}})),this.$emit("paste-html",e)},handlePasteImage(e){this.$emit("paste-image",e)},handlePasteVideo(e){this.$emit("paste-video",e)},handleDeleteInStart(e){e.isBlock()&&Pi(e)},handleDeleteComplete(){const e=this.editor.range.anchor.element.getUneditableElement();e&&e.toEmpty()},handleBeforeRender(){this.$emit("before-render")},handleAfterRender(){this.setVideoHeight(),this.$emit("after-render")},setVideoHeight(){this.$refs.content.querySelectorAll("video").forEach((e=>{e.style.height=e.offsetWidth/this.videoRatio+"px"}))},collapseToEnd(){this.disabled||(this.editor.collapseToEnd(),this.editor.rangeRender(),ue.element.setScrollTop({el:this.$refs.content,number:1e6,time:0}))},collapseToStart(){this.disabled||(this.editor.collapseToStart(),this.editor.rangeRender(),this.$nextTick((()=>{ue.element.setScrollTop({el:this.$refs.content,number:0,time:0})})))},getParsedomElementByElement(e,t){return e.isBlock()?e.parsedom==t?e:null:e.isText()||e.parsedom!=t?this.getParsedomElementByElement(e.parent,t):e},getCurrentParsedomElement(e){if(this.disabled)return null;if(!this.editor.range)return null;if(this.editor.range.anchor.element.isEqual(this.editor.range.focus.element))return this.getParsedomElementByElement(this.editor.range.anchor.element,e);const t=this.editor.getElementsByRange(!0,!1).map((t=>this.getParsedomElementByElement(t.element,e)));if(t.some((e=>null==e)))return null;if(1==t.length)return t[0];let i=!0;for(let n=1;n<t.length;n++)if(!t[n].isEqual(t[0])){i=!1;break}return i?t[0]:null},deleteByParsedom(e){if(this.disabled)return;if(!this.editor.range)return;const t=this.getCurrentParsedomElement(e);t&&(t.toEmpty(),this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},removeLink(){if(this.disabled)return;if(!this.editor.range)return;const e=this.getCurrentParsedomElement("a");e&&(e.parsedom=k.TEXT_NODE,delete e.marks.target,delete e.marks.href,this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},setHeading(e){if(this.disabled)return;if(!this.editor.range)return;if(!qi(this.$editTrans,this.$editLocale).heading.map((e=>e.value)).includes(e))throw new Error("The parameter supports only h1-h6 and p");if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock();Pi(t),t.parsedom=e}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{if(t.element.isBlock())Pi(t.element),t.element.parsedom=e;else{const i=t.element.getBlock();Pi(i),i.parsedom=e}}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},setList(e){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock();Li(t,e)?Pi(t):Fi(t,e)}else{let t=[];this.editor.getElementsByRange(!0,!1).forEach((e=>{const i=e.element.getBlock();t.some((e=>i.isEqual(e)))||t.push(i)})),t.forEach((t=>{Li(t,e)?Pi(t):Fi(t,e)}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},setTask(){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock();Mi(e)?Pi(e):Di(e)}else{let e=[];this.editor.getElementsByRange(!0,!1).forEach((t=>{const i=t.element.getBlock();e.some((e=>i.isEqual(e)))||e.push(i)})),e.forEach((e=>{Mi(e)?Pi(e):Di(e)}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},setTextStyle(e,t){if(this.disabled)return;if(!this.editor.range)return;if(this.queryTextStyle(e,t))this.editor.removeTextStyle([e]);else{let i={};i[e]=t,this.editor.setTextStyle(i)}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},queryTextStyle(e,t,i){return this.editor.queryTextStyle(e,t,i)},setTextMark(e,t){if(this.disabled)return;if(!this.editor.range)return;if(this.queryTextMark(e,t))this.editor.removeTextMark([e]);else{let i={};i[e]=t,this.editor.setTextMark(i)}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},queryTextMark(e,t,i){return this.editor.queryTextMark(e,t,i)},formatText(){this.disabled||this.editor.range&&(this.editor.removeTextStyle(),this.editor.removeTextMark(),this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},setAlign(e){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock(),i=this.editor.range.anchor.element.getInblock();i?i.hasStyles()?i.styles["text-align"]=e:i.styles={"text-align":e}:t.hasStyles()?t.styles["text-align"]=e:t.styles={"text-align":e}}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{if(t.element.isBlock()||t.element.isInblock())t.element.hasStyles()?t.element.styles["text-align"]=e:t.element.styles={"text-align":e};else{const i=t.element.getBlock(),n=t.element.getInblock();n?n.hasStyles()?n.styles["text-align"]=e:n.styles={"text-align":e}:i.hasStyles()?i.styles["text-align"]=e:i.styles={"text-align":e}}}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},undo(){if(this.disabled)return;const e=this.editor.history.get(-1);e&&(this.editor.history.current=e.current,this.editor.stack=e.stack,this.editor.range=e.range,this.editor.formatElementStack(),this.editor.domRender(!0),this.editor.rangeRender())},redo(){if(this.disabled)return;const e=this.editor.history.get(1);e&&(this.editor.history.current=e.current,this.editor.stack=e.stack,this.editor.range=e.range,this.editor.formatElementStack(),this.editor.domRender(!0),this.editor.rangeRender())},setQuote(){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock(),t=e.parsedom;Pi(e),"blockquote"!=t&&(e.parsedom="blockquote")}else{let e=[];this.editor.getElementsByRange(!0,!1).forEach((t=>{const i=t.element.getBlock();e.some((e=>i.isEqual(e)))||e.push(i)})),e.forEach((e=>{const t=e.parsedom;Pi(e),"blockquote"!=t&&(e.parsedom="blockquote")}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},setLineHeight(e){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock(),i=this.editor.range.anchor.element.getInblock();i?i.hasStyles()?i.styles["line-height"]=e:i.styles={"line-height":e}:t.hasStyles()?t.styles["line-height"]=e:t.styles={"line-height":e}}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{if(t.element.isBlock()||t.element.isInblock())t.element.hasStyles()?t.element.styles["line-height"]=e:t.element.styles={"line-height":e};else{const i=t.element.getBlock(),n=t.element.getInblock();n?n.hasStyles()?n.styles["line-height"]=e:n.styles={"line-height":e}:i.hasStyles()?i.styles["line-height"]=e:i.styles={"line-height":e}}}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},setIndentIncrease(){if(this.disabled)return;if(!this.editor.range)return;const e=e=>{if(e.hasStyles())if(e.styles.hasOwnProperty("text-indent")){let t=e.styles["text-indent"];t=t.endsWith("em")?parseFloat(t):0,e.styles["text-indent"]=`${t+2}em`}else e.styles["text-indent"]="2em";else e.styles={"text-indent":"2em"}};if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock(),i=this.editor.range.anchor.element.getInblock();i&&"block"==i.behavior&&!i.isPreStyle()?e(i):t.isPreStyle()||e(t)}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{const i=t.element.getBlock(),n=t.element.getInblock();n&&"block"==n.behavior&&!n.isPreStyle()?e(n):i.isPreStyle()||e(i)}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},setIndentDecrease(){if(this.disabled)return;if(!this.editor.range)return;const e=e=>{if(e.hasStyles()&&e.styles.hasOwnProperty("text-indent")){let t=e.styles["text-indent"];t=t.endsWith("em")?parseFloat(t):0,e.styles["text-indent"]=(t-2>=0?t-2:0)+"em"}};if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock(),i=this.editor.range.anchor.element.getInblock();i&&"block"==i.behavior&&!i.isPreStyle()?e(i):t.isPreStyle()||e(t)}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{const i=t.element.getBlock(),n=t.element.getInblock();n&&"block"==n.behavior&&!n.isPreStyle()?e(n):i.isPreStyle()||e(i)}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},insertImage(e,t=!0){if(this.disabled)return;if(!this.editor.range)return;if(!e||"string"!=typeof e)throw new Error("An image address must be given");const i=new k("closed","img",{src:e},null,null);this.editor.insertElement(i),t&&(this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},insertVideo(e,t=!0){if(this.disabled)return;if(!this.editor.range)return;if(!e||"string"!=typeof e)throw new Error("A video address must be given");const i=new k("closed","video",{src:e},null,null);this.editor.insertElement(i);const n=k.getSpaceElement(),o=k.getSpaceElement();this.editor.addElementAfter(o,i),this.editor.addElementBefore(n,i),this.editor.range.anchor.moveToEnd(o),this.editor.range.focus.moveToEnd(o),t&&(this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},hasPreStyle(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus))return this.editor.range.anchor.element.isPreStyle();return this.editor.getElementsByRange(!0,!1).some((e=>e.element.isPreStyle()))},hasQuote(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){return"blockquote"==this.editor.range.anchor.element.getBlock().parsedom}return this.editor.getElementsByRange(!0,!1).some((e=>{if(e.element.isBlock())return"blockquote"==e.element.parsedom;return"blockquote"==e.element.getBlock().parsedom}))},hasList(e=!1){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock();return Li(t,e)}return this.editor.getElementsByRange(!0,!1).some((t=>{if(t.element.isBlock())return Li(t.element,e);{const i=t.element.getBlock();return Li(i,e)}}))},hasLink(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus))return!!this.getParsedomElementByElement(this.editor.range.anchor.element,"a");return this.editor.getElementsByRange(!0,!0).filter((e=>e.element.isText())).some((e=>!!this.getParsedomElementByElement(e.element,"a")))},hasTable(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){return"table"==this.editor.range.anchor.element.getBlock().parsedom}return this.editor.getElementsByRange(!0,!1).some((e=>{if(e.element.isBlock())return"table"==e.element.parsedom;return"table"==e.element.getBlock().parsedom}))},hasTask(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock();return Mi(e)}return this.editor.getElementsByRange(!0,!1).some((e=>{if(e.element.isBlock())return Mi(e.element);{const t=e.element.getBlock();return Mi(t)}}))},hasImage(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus))return this.editor.range.anchor.element.isClosed()&&"img"==this.editor.range.anchor.element.parsedom;return this.editor.getElementsByRange(!0,!0).some((e=>e.element.isClosed()&&"img"==e.element.parsedom))},hasVideo(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus))return this.editor.range.anchor.element.isClosed()&&"video"==this.editor.range.anchor.element.parsedom;return this.editor.getElementsByRange(!0,!0).some((e=>e.element.isClosed()&&"video"==e.element.parsedom))},inQuote(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){return"blockquote"==this.editor.range.anchor.element.getBlock().parsedom}return this.editor.getElementsByRange(!0,!1).every((e=>{if(e.element.isBlock())return"blockquote"==e.element.parsedom;return"blockquote"==e.element.getBlock().parsedom}))},inList(e=!1){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock();return Li(t,e)}return this.editor.getElementsByRange(!0,!1).every((t=>{if(t.element.isBlock())return Li(t.element,e);{const i=t.element.getBlock();return Li(i,e)}}))},inTask(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock();return Mi(e)}return this.editor.getElementsByRange(!0,!1).every((e=>{if(e.element.isBlock())return Mi(e.element);{const t=e.element.getBlock();return Mi(t)}}))},insertTable(e,t){if(this.disabled)return;if(!this.editor.range)return;const i=new k("block","table",null,null,null),n=new k("inblock","tbody",null,null,null);this.editor.addElementTo(n,i);for(let s=0;s<e;s++){const e=new k("inblock","tr",null,null,null);for(let i=0;i<t;i++){const t=new k("inblock","td",null,null,null),i=new k("closed","br",null,null,null);this.editor.addElementTo(i,t),this.editor.addElementTo(t,e)}this.editor.addElementTo(e,n)}this.editor.insertElement(i);const o=new k("block",k.BLOCK_NODE,null,null,null),r=new k("closed","br",null,null,null);this.editor.addElementTo(r,o),this.editor.addElementAfter(o,i),this.editor.formatElementStack(),this.editor.range.anchor.moveToStart(n),this.editor.range.focus.moveToStart(n),this.editor.domRender(),this.editor.rangeRender()},insertCodeBlock(){if(this.disabled)return;if(!this.editor.range)return;const e=this.getCurrentParsedomElement("pre");if(e){let t="";k.flatElements(e.children).filter((e=>e.isText())).forEach((e=>{t+=e.textContent}));t.split("\n").forEach((t=>{const i=new k("block",k.BLOCK_NODE,null,null,null),n=new k("text",null,null,null,t);this.editor.addElementTo(n,i),this.editor.addElementBefore(i,e)})),e.toEmpty()}else if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock();Pi(e),e.parsedom="pre";const t=new k("block",k.BLOCK_NODE,null,null,null),i=new k("closed","br",null,null,null);this.editor.addElementTo(i,t),this.editor.addElementAfter(t,e)}else{let e=this.editor.getElementsByRange(!0,!1);this.editor.range.anchor.moveToStart(e[0].element.getBlock()),this.editor.range.focus.moveToEnd(e[e.length-1].element.getBlock());const t=this.editor.getElementsByRange(!0,!0).filter((e=>e.element.isText())),i={};t.forEach((e=>{i[e.element.getBlock().key]?i[e.element.getBlock().key].push(e.element.clone()):i[e.element.getBlock().key]=[e.element.clone()]}));const n=new k("block","pre",null,null,null);Object.keys(i).forEach(((e,t)=>{if(t>0){const e=new k("text",null,null,null,"\n");n.hasChildren()?this.editor.addElementTo(e,n,n.children.length):this.editor.addElementTo(e,n)}i[e].forEach((e=>{n.hasChildren()?this.editor.addElementTo(e,n,n.children.length):this.editor.addElementTo(e,n)}))})),this.editor.delete(),this.editor.insertElement(n);const o=new k("block",k.BLOCK_NODE,null,null,null),r=new k("closed","br",null,null,null);this.editor.addElementTo(r,o),this.editor.addElementAfter(o,n)}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},insertText(e){this.disabled||this.editor.range&&(this.editor.insertText(e),this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},insertHtml(e){if(this.disabled)return;if(!this.editor.range)return;const t=this.editor.parseHtml(e);for(let i=0;i<t.length;i++)this.editor.insertElement(t[i],!1);this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},beforeUnmount(){this.removeScrollHandle(),ue.event.off(document.documentElement,`mousedown.editify_${this.uid} mousemove.editify_${this.uid} mouseup.editify_${this.uid} click.editify_${this.uid}`),ue.event.off(window,`resize.editify_${this.uid}`),this.editor.destroy()}},ho={class:"editify"},uo=["data-editify-uid"],fo=["data-editify-placeholder"],go=["value"],mo={key:1,class:"editify-footer"},po={class:"editify-footer-words"};const bo=Ki(co,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Menu"),l=t.resolveComponent("Toolbar");return t.openBlock(),t.createElementBlock("div",ho,[s.menuConfig.use?(t.openBlock(),t.createBlock(a,{key:0,config:s.menuConfig,disabled:e.disabled||!r.canUseMenu,color:e.color,ref:"menu"},null,8,["config","disabled","color"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"body",class:t.normalizeClass(["editify-body",{border:e.border,menu_inner:s.menuConfig.use&&"inner"==s.menuConfig.mode}]),"data-editify-uid":o.uid},[t.createElementVNode("div",{ref:"content",class:t.normalizeClass(["editify-content",{placeholder:s.showPlaceholder,disabled:e.disabled}]),style:t.normalizeStyle(s.contentStyle),onKeydown:i[0]||(i[0]=(...e)=>s.handleEditorKeydown&&s.handleEditorKeydown(...e)),onClick:i[1]||(i[1]=(...e)=>s.handleEditorClick&&s.handleEditorClick(...e)),onCompositionstart:i[2]||(i[2]=e=>r.isInputChinese=!0),onCompositionend:i[3]||(i[3]=e=>r.isInputChinese=!1),"data-editify-placeholder":e.placeholder},null,46,fo),r.isSourceView?(t.openBlock(),t.createElementBlock("textarea",{key:0,value:s.value,readonly:"",class:"editify-source"},null,8,go)):t.createCommentVNode("",!0),t.createVNode(l,{ref:"toolbar",modelValue:r.toolbarOptions.show,"onUpdate:modelValue":i[4]||(i[4]=e=>r.toolbarOptions.show=e),node:r.toolbarOptions.node,type:r.toolbarOptions.type,config:s.toolbarConfig},null,8,["modelValue","node","type","config"])],10,uo),e.showWordLength?(t.openBlock(),t.createElementBlock("div",mo,[t.createElementVNode("div",po,t.toDisplayString(s.$editTrans("totalWordCount"))+t.toDisplayString(s.textValue.length),1)])):t.createCommentVNode("",!0)])}],["__scopeId","data-v-e9c5b94e"]]),yo={zh_CN:{textWrapUp:"向上换行",textWrapDown:"向下换行",insertRowTop:"向前插入行",insertRowBottom:"向后插入行",insertColumnLeft:"向前插入列",insertColumnRight:"向后插入列",deleteRow:"删除行",deleteColumn:"删除列",deleteTable:"删除表格",selectLanguages:"选择语言",autoRecognize:"自动识别",linkAddress:"链接地址",newWindowOpen:"新窗口打开",removeLink:"移除链接",viewLink:"查看链接",linkUrlEnterPlaceholder:"请输入链接地址",linkTextEnterPlaceholder:"请输入链接文本",width30:"30%宽度",width50:"50%宽度",width100:"100%宽度",deleteImage:"删除图片",autoplay:"自动播放",disabledAutoplay:"关闭自动播放",loop:"循环播放",disabledLoop:"关闭循环播放",muted:"静音",unmuted:"播放声音",controls:"播放控制",deleteVideo:"删除视频",heading:"标题",bold:"粗体",h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",h6:"六级标题",text:"正文",italic:"斜体",orderList:"有序列表",unorderList:"无序列表",strikethrough:"删除线",underline:"下划线",code:"行内代码",superscript:"上标",subscript:"下标",fontSize:"字号",fontFamily:"字体",defaultFontFamily:"默认字体",foreColor:"前景色",defaultColor:"默认颜色",backColor:"背景色",formatClear:"清除格式",defaultSize:"默认字号",totalWordCount:"总字数:",align:"对齐方式",undo:"撤销",redo:"重做",quote:"引用",lineHeight:"行高",indent:"缩进",insertLink:"插入链接",insertImage:"插入图片",remoteImage:"网络图片",uploadImage:"上传图片",imageUrlPlaceholder:"请输入图片地址",insert:"插入",insertVideo:"插入视频",remoteVideo:"网络视频",uploadVideo:"上传视频",videoUrlPlaceholder:"请输入视频地址",insertTable:"插入表格",inserCodeBlock:"插入代码块",sourceView:"代码视图",task:"待办",indentIncrease:"增加缩进",indentDecrease:"减少缩进",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",alignJustify:"两端对齐",defaultLineHeight:"默认行高"},en_US:{textWrapUp:"Up feed",textWrapDown:"Down feed",insertRowTop:"Insert row forward",insertRowBottom:"Insert row backward",insertColumnLeft:"Insert column forward",insertColumnRight:"Insert column backward",deleteRow:"Delete rows",deleteColumn:"Delete column",deleteTable:"Delete table",selectLanguages:"Select language",autoRecognize:"Auto",linkAddress:"Link address",newWindowOpen:"Open in new window",removeLink:"Remove",viewLink:"View",linkUrlEnterPlaceholder:"Please enter the link address",linkTextEnterPlaceholder:"Please enter the link text",width30:"Set the width to 30%",width50:"Set the width to 50%",width100:"Set the width to 100%",deleteImage:"Delete image",autoplay:"Autoplay",disabledAutoplay:"Turn off autoplay",loop:"Loop",disabledLoop:"Close loop",muted:"Mute",unmuted:"Unmute",controls:"Play control",deleteVideo:"Delete video",heading:"Heading",bold:"Bold",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",text:"Paragraph",italic:"Italic",orderList:"Ordered list",unorderList:"Unordered list",strikethrough:"Strikethrough",underline:"Underline",code:"Inline code",superscript:"Superscript",subscript:"Subscript",fontSize:"Font size",fontFamily:"Font family",defaultFontFamily:"Default",foreColor:"Forecolor",defaultColor:"Default color",backColor:"Backcolor",formatClear:"Clear format",defaultSize:"Default",totalWordCount:"Total word count: ",align:"Alignment mode",undo:"Undo",redo:"Redo",quote:"Quote",lineHeight:"Line height",indent:"Indent",insertLink:"Insert",insertImage:"Insert",remoteImage:"Remote",uploadImage:"Upload",imageUrlPlaceholder:"Please enter the image address",insert:"Insert",insertVideo:"Insert",remoteVideo:"Remote",uploadVideo:"Upload",videoUrlPlaceholder:"Please enter the video address",insertTable:"Insert table",inserCodeBlock:"Insert code block",sourceView:"Code view",task:"Task",indentIncrease:"Increase indent",indentDecrease:"Reduce indent",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignJustify:"Align justify",defaultLineHeight:"Default"}},wo="0.0.22",Eo=(e,t)=>{const i=(t?t.locale:"zh_CN")||"zh_CN";e.provide("$editTrans",(e=>t=>yo[e][t])(i)),e.provide("$editLocale",i),e.component(bo.name,bo)},Co={install:Eo,version:wo};e.AlexElement=Y,e.default=Co,e.install=Eo,e.version=wo,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).editify={},e.Vue)}(this,(function(e,t){"use strict";var i=Object.defineProperty,n=(e,t,n)=>(((e,t,n)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const o={formatNumber(e){return this.isNumber(e)?e.toString().replace(/(\d)(?=(?:\d{3})+$)/g,"$1,"):e},isNumber:e=>"number"==typeof e&&!isNaN(e),add:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=0;try{i=e.toString().split(".")[1].length}catch(r){}try{n=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(i,n)),(e*o+t*o)/o})),subtract:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=0;try{i=e.toString().split(".")[1].length}catch(r){}try{n=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(i,n)),(e*o-t*o)/o})),mutiply:(...e)=>e.reduce(((e,t)=>{let i=0,n=e.toString(),o=t.toString();try{i+=n.split(".")[1].length}catch(r){}try{i+=o.split(".")[1].length}catch(r){}return Number(n.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,i)})),divide:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=e.toString(),r=t.toString();try{i=o.split(".")[1].length}catch(s){}try{n=r.split(".")[1].length}catch(s){}return o=Number(o.replace(".","")),r=Number(r.replace(".","")),o/r*Math.pow(10,n-i)}))},r={insert(e,t,i){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if("string"!=typeof t)throw new TypeError("The second argument must be a string");if(!o.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,i)+t+e.substring(i,e.length)},delete(e,t,i){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!o.isNumber(t))throw new TypeError("The second argument must be a number");if(t<0)throw new Error("The second argument cannot be less than 0");if(!o.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,t)+e.substring(t+i,e.length)},replace(e,t,i,n){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!o.isNumber(t))throw new TypeError("The second argument must be a number");if(t<0)throw new Error("The second argument cannot be less than 0");if(!o.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");if("string"!=typeof n)throw new TypeError("The fourth argument must be a string");return e.substring(0,t)+n+e.substring(i,e.length)},trim(e,t=!1){if("string"!=typeof e)throw new TypeError("The first argument must be a string");let i=e.replace(/(^\s+)|(\s+$)/g,"");return t&&(i=i.replace(/\s/g,"")),i}},s={isWindow:e=>e&&e instanceof Window,getElementPoint(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(this.isElement(t)||(t=document.body),!this.isContains(t,e))throw new Error("The second argument and the first argument have no hierarchical relationship");let i=e,n=0,o=0;for(;this.isElement(e)&&this.isContains(t,e)&&t!==e;)n+=e.offsetTop,o+=e.offsetLeft,e=e.offsetParent;return{top:n,left:o,right:t.offsetWidth-o-i.offsetWidth,bottom:t.offsetHeight-n-i.offsetHeight}},isContains(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!this.isElement(t))throw new TypeError("The second argument must be an element");return e===t||(e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):void 0)},isParentNode(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!this.isElement(t))throw new TypeError("The second argument must be an element");return e!==t&&t.parentNode===e},children(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(t&&"string"!=typeof t)throw new TypeError("The second argument must be a string");return[...e.querySelectorAll(t||"*")].filter((t=>t.parentNode===e))},siblings(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(t&&"string"!=typeof t)throw new TypeError("The second argument must be a string");if(!e.parentNode)return[];return[...e.parentNode.querySelectorAll(t||"*")].filter((t=>t.parentNode===e.parentNode&&t!=e))},rem2px(e){if(!o.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return o.mutiply(e,parseFloat(t))},px2rem(e){if(!o.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return o.divide(e,parseFloat(t))},width(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientWidth,i=parseFloat(this.getCssStyle(e,"padding-left")),n=parseFloat(this.getCssStyle(e,"padding-right"));return o.subtract(t,i,n)},height(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientHeight,i=parseFloat(this.getCssStyle(e,"padding-top")),n=parseFloat(this.getCssStyle(e,"padding-bottom"));return o.subtract(t,i,n)},removeClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;r.trim(t).split(/\s+/).forEach((e=>{i.remove(e)}))},addClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;r.trim(t).split(/\s+/).forEach((e=>{i.add(e)}))},hasClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;return r.trim(t).split(/\s+/).every((e=>i.contains(e)))},scrollTopBottomTrigger(e,t){"string"==typeof e&&e&&(e=document.body.querySelector(e));let i=window;this.isElement(e)&&e!=document.body&&e!=document.documentElement&&(i=e),"function"==typeof e&&(t=e);let n=!0;i.addEventListener("scroll",(e=>{if(this.getScrollTop(i)<=0){if(!n)return;"function"==typeof t&&(n=!1,t({state:"top",target:i}))}else{let e={state:"bottom",target:i},r=0;if(r=i==window?window.innerHeight:i.clientHeight,o.add(this.getScrollTop(i),r)+1>=this.getScrollHeight(i)&&r!=this.getScrollHeight(i)){if(!n)return;"function"==typeof t&&(n=!1,t(e))}else n=!0}}))},getScrollWidth(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.documentElement&&e!=document.body?e.scrollWidth:0==document.documentElement.scrollWidth||0==document.body.scrollWidth?document.documentElement.scrollWidth||document.body.scrollWidth:document.documentElement.scrollWidth>document.body.scrollWidth?document.documentElement.scrollWidth:document.body.scrollWidth,t},getScrollHeight(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.documentElement&&e!=document.body?e.scrollHeight:0==document.documentElement.scrollHeight||0==document.body.scrollHeight?document.documentElement.scrollHeight||document.body.scrollHeight:document.documentElement.scrollHeight>document.body.scrollHeight?document.documentElement.scrollHeight:document.body.scrollHeight,t},setScrollTop(e){let t=!1,i=e.el;"string"==typeof i&&i&&(i=document.body.querySelector(i));let n=e.number||0,r=e.time||0;return this.isElement(i)&&i!=document.body&&i!=document.documentElement&&i!=window||(t=!0),new Promise(((e,s)=>{if(r<=0)t?document.documentElement.scrollTop=document.body.scrollTop=n:i.scrollTop=n,e();else{let s=10,a=o.divide(r,s),l=this.getScrollTop(i),d=o.divide(o.subtract(n,l),a),c=setInterval((()=>{a>0?(a--,t?document.documentElement.scrollTop=document.body.scrollTop=l=o.add(l,d):i.scrollTop=l=o.add(l,d)):(clearInterval(c),e())}),s)}}))},getScrollTop(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.body&&e!=document.documentElement&&e!=window?e.scrollTop:0==document.documentElement.scrollTop||0==document.body.scrollTop?document.documentElement.scrollTop||document.body.scrollTop:document.documentElement.scrollTop>document.body.scrollTop?document.documentElement.scrollTop:document.body.scrollTop,t},getScrollLeft(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.body&&e!=document.documentElement&&e!=window?e.scrollLeft:0==document.documentElement.scrollLeft||0==document.body.scrollLeft?document.documentElement.scrollLeft||document.body.scrollLeft:document.documentElement.scrollLeft>document.body.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,t},setScrollLeft(e){let t=!1,i=e.el;"string"==typeof i&&i&&(i=document.body.querySelector(i));let n=e.number||0,r=e.time||0;return this.isElement(i)&&i!=document.body&&i!=document.documentElement&&i!=window||(t=!0),new Promise(((e,s)=>{if(r<=0)t?document.documentElement.scrollLeft=document.body.scrollLeft=n:i.scrollLeft=n,e();else{let s=10,a=o.divide(r,s),l=this.getScrollLeft(i),d=o.divide(o.subtract(n,l),a),c=setInterval((()=>{a>0?(a--,t?document.documentElement.scrollLeft=document.body.scrollLeft=l=o.add(l,d):i.scrollLeft=l=o.add(l,d)):(clearInterval(c),e())}),s)}}))},getCssStyle(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i="";return i=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(e)[t]:e.currentStyle[t],i},getCssSelector(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a selector string");if(/^#{1}/.test(e))return{type:"id",value:e.substr(1)};if(/^\./.test(e))return{type:"class",value:e.substr(1)};if(/^\[(.+)\]$/.test(e)){let t="attribute",i="",n=r.trim(e,!0).substring(1,r.trim(e,!0).length-1).split("=");return 1==n.length&&(i=n[0]),2==n.length&&(i={attributeName:n[0],attributeValue:n[1].replace(/\'/g,"").replace(/\"/g,"")}),{type:t,value:i}}return{type:"tag",value:e}},getElementBounding(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.getBoundingClientRect();return{top:t.top,bottom:o.subtract(document.documentElement.clientHeight||window.innerHeight,t.bottom),left:t.left,right:o.subtract(document.documentElement.clientWidth||window.innerWidth,t.right)}},isElement:e=>e&&e instanceof Node&&1===e.nodeType,string2dom(e,t="div"){if(!e||"string"!=typeof e)throw new TypeError("The argument must be an HTML string");let i=document.createElement(t);return i.innerHTML=e,1==i.children.length?i.children[0]:Array.from(i.children)}},a="_dap-datas",l={remove(e,t){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=e[a]||{};null==t||""===t?e[a]={}:(delete i[t],e[a]=i)},has(e,t){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(null==t||""===t)throw new TypeError("The second parameter must be a unique key");return(e[a]||{}).hasOwnProperty(t)},get(e,t){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=e[a]||{};return null==t||""===t?i:i[t]},set(e,t,i){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(null==t||""===t)throw new TypeError("The second parameter must be a unique key");let n=e[a]||{};n[t]=i,e[a]=n}},d={matchingText(e,t){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=null;if("Chinese"==t&&(i=/^[\u4e00-\u9fa5]+$/),"chinese"==t&&(i=/[\u4e00-\u9fa5]/),"email"==t&&(i=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/),"username"==t&&(i=/^[a-zA-Z0-9_]{4,16}$/),"int+"==t&&(i=/^\d+$/),"int-"==t&&(i=/^-\d+$/),"int"==t&&(i=/^-?\d+$/),"pos"==t&&(i=/^\d*\.?\d+$/),"neg"==t&&(i=/^-\d*\.?\d+$/),"number"==t&&(i=/^-?\d*\.?\d+$/),"phone"==t&&(i=/^1[0-9]\d{9}$/),"idCard"==t&&(i=/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/),"url"==t&&(i=/^((https?|ftp|file):\/\/)?([\da-z\.-]+)\.([\da-z\.]{2,6})([\/\w \.-]*)*\/?$/),"IPv4"==t&&(i=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/),"hex"==t&&(i=/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/),"rgb"==t&&(i=/^rgb\((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\)$/),"rgba"==t&&(i=/^rgba\((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(0?\.\d|1(\.0)?|0)\)$/),"QQ"==t&&(i=/^[1-9][0-9]{4,10}$/),"weixin"==t&&(i=/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/),"plate"==t&&(i=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/),!i)throw new Error("The second parameter is out of scope");return i.test(e)},getUrlParams(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),i=window.location.search.substr(1);if(!i){let e=window.location.hash.split("?");2==e.length&&(i=e[1])}let n=i.match(t);return n?decodeURIComponent(n[2]):null},isEmptyObject(e){return!!this.isObject(e)&&0==Object.keys(e).length},equal(e,t){if(typeof e!=typeof t)return!1;if(this.isObject(e)&&this.isObject(t)){let i=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);if(i.length!=n.length)return!1;let o=i.length,r=!0;for(let s=0;s<o;s++){let n=i[s],o=e[n],a=t[n];if(!this.equal(o,a)){r=!1;break}}return r}return e===t},isObject:e=>!("object"!=typeof e||!e),copyText(e){if(!e||"string"!=typeof e)throw new TypeError("No text to copy is defined");if(!navigator.clipboard)throw new Error("navigator.clipboard must be obtained in a secure environment, such as localhost, 127.0.0.1, or https, so the method won't work");return navigator.clipboard.writeText(e)},clone(e){if(this.isObject(e)){if(Array.isArray(e))return e.map((e=>this.clone(e)));let t={};for(let i in e)t[i]=this.clone(e[i]);return t}return e}},c=e=>{let t=e.split(/[\s]+/g),i=[];return t.forEach((e=>{let t=e.split("."),n={eventName:t[0]};t.length>1&&(n.guid=t[1]),i.push(n)})),i},h=(e,t,i)=>{let n=l.get(e,"dap-defined-events")||{},o=Object.keys(n),r=o.length;for(let s=0;s<r;s++){let r=o[s];n[r].type==t&&(i?r==t+"."+i&&(e.removeEventListener(n[r].type,n[r].fn,n[r].options),n[r]=void 0):(e.removeEventListener(n[r].type,n[r].fn,n[r].options),n[r]=void 0))}n=(e=>{let t={};return Object.keys(e).forEach((i=>{e[i]&&(t[i]=e[i])})),t})(n),l.set(e,"dap-defined-events",n)},u={on(e,t,i,n){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");if(!i||"function"!=typeof i)throw new TypeError("The third argument must be a function");d.isObject(n)||(n={});c(t).forEach((t=>{((e,t,i,n,o)=>{let r=l.get(e,"dap-defined-events")||{};i||(i=l.get(e,"dap-event-guid")||0,l.set(e,"dap-event-guid",i+1)),r[i=t+"."+i]&&r[i].type==t&&e.removeEventListener(t,r[i].fn,r[i].options),e.addEventListener(t,n,o),r[i]={type:t,fn:n,options:o},l.set(e,"dap-defined-events",r)})(e,t.eventName,t.guid,i.bind(e),n)}))},off(e,t){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=l.get(e,"dap-defined-events");if(!i)return;if(!t){let t=Object.keys(i),n=t.length;for(let o=0;o<n;o++){let n=t[o];e.removeEventListener(i[n].type,i[n].fn,i[n].options)}return l.remove(e,"dap-defined-events"),void l.remove(e,"dap-event-guid")}c(t).forEach((t=>{h(e,t.eventName,t.guid)}))},get(e){if(!(e instanceof Document||s.isElement(e)||s.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let t=l.get(e,"dap-defined-events");if(t)return t}},f={rgb2hsv(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=0,i=0,n=0,o=e[0]>=255?255:e[0],r=e[1]>=255?255:e[1],s=e[2]>=255?255:e[2];o=o<=0?0:o,r=r<=0?0:r,s=s<=0?0:s;let a=Math.max(o,r,s),l=Math.min(o,r,s);return n=a/255,i=0===a?0:1-l/a,a===l?t=0:a===o&&r>=s?t=(r-s)/(a-l)*60+0:a===o&&r<s?t=(r-s)/(a-l)*60+360:a===r?t=(s-o)/(a-l)*60+120:a===s&&(t=(o-r)/(a-l)*60+240),[t,100*i,100*n]},hsv2rgb(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=e[0]>=360||e[0]<=0?0:e[0],i=e[1]>=100?100:e[1];i=i<=0?0:i;let n=e[2]>=100?100:e[2];n=n<=0?0:n,i/=100,n/=100;let o=0,r=0,s=0,a=parseInt(t/60%6),l=t/60-a,d=n*(1-i),c=n*(1-l*i),h=n*(1-(1-l)*i);switch(a){case 0:o=n,r=h,s=d;break;case 1:o=c,r=n,s=d;break;case 2:o=d,r=n,s=h;break;case 3:o=d,r=c,s=n;break;case 4:o=h,r=d,s=n;break;case 5:o=n,r=d,s=c}return o=parseInt(255*o),r=parseInt(255*r),s=parseInt(255*s),[o,r,s]},rgb2hex(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+e[2]).toString(16).slice(1)},hex2rgb(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=e.toLowerCase();if(!d.matchingText(t,"hex"))throw new TypeError("The argument must be a hexadecimal color value");if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}let i=[];for(let n=1;n<7;n+=2)i.push(parseInt("0x"+t.slice(n,n+2)));return i}},g={getImageUrl(e){if(!(e&&e instanceof File))throw new TypeError("The argument must be a File object");return window.URL.createObjectURL(e)},dataFileToBase64:e=>new Promise(((t,i)=>{e&&e instanceof File||i(new TypeError("The argument must be a File object"));let n=new FileReader;n.readAsDataURL(e),n.onloadend=()=>{let e=n.result;t(e)}})),dataBase64toFile(e,t){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.split(","),n=i[0].match(/:(.*?);/)[1],o=atob(i[1]),r=o.length,s=new Uint8Array(r);for(;r--;)s[r]=o.charCodeAt(r);return new File([s],t,{type:n})},compressImage(e,t){const i={width:null,quality:.8,mimeType:"jpeg",maxSize:0,minSize:0};d.isObject(t)&&(o.isNumber(t.width)&&(i.width=t.width),o.isNumber(t.quality)&&t.quality>=0&&t.quality<=1&&(i.quality=t.quality),"jpeg"!=t.mimeType&&"webp"!=t.mimeType||(i.mimeType=t.mimeType),o.isNumber(t.maxSize)&&(i.maxSize=t.maxSize),o.isNumber(t.minSize)&&(i.minSize=t.minSize));const n=(e,t,o)=>{let r=e.toDataURL("image/"+i.mimeType,o),s=this.dataBase64toFile(r,t);if(i.maxSize>0&&s.size>1024*i.maxSize){o=o<=0?0:Number((o-.01).toFixed(2));const i=n(e,t,o);r=i.url,s=i.file,o=i.quality}return{file:s,url:r,quality:o}};return new Promise(((t,o)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>{let s=r.result,a=new Image;a.src=s,a.onload=()=>{if(i.minSize>0&&e.size<=1024*i.minSize)return void t({file:e,url:s,quality:1,width:a.width,height:a.height});let o=document.createElement("canvas"),r=o.getContext("2d");o.width=i.width||a.width,o.height=i.width?i.width/(a.width/a.height):a.height,r.drawImage(a,0,0,o.width,o.height);let l=e.name.lastIndexOf(".");const d=e.name.substring(0,l)+"."+i.mimeType;let c=n(o,d,i.quality);t({...c,width:o.width,height:o.height})},a.onerror=()=>{o(new Error("Failed to load image file"))}},r.onerror=()=>{o(new Error("Failed to load image file"))}}))}},m={start(e,t){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");let i={pitch:.8,rate:1,volume:1,start:function(){},end:function(){},pause:function(){},resume:function(){},error:function(){}};d.isObject(t)||(t={}),o.isNumber(t.pitch)&&(i.pitch=t.pitch),o.isNumber(t.rate)&&(i.rate=t.rate),o.isNumber(t.volume)&&(i.volume=t.volume),"function"==typeof t.start&&(i.start=t.start),"function"==typeof t.end&&(i.end=t.end),"function"==typeof t.pause&&(i.pause=t.pause),"function"==typeof t.resume&&(i.resume=t.resume),"function"==typeof t.error&&(i.error=t.error);const n=new SpeechSynthesisUtterance;n.text=e,n.pitch=i.pitch,n.rate=i.rate,n.volume=i.volume,n.lang="zh-CN",n.onstart=t=>{i.start.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onend=t=>{i.end.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onpause=t=>{i.pause.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onresume=t=>{i.resume.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onerror=t=>{i.error.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},window.speechSynthesis.speak(n)},stop(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.cancel()},pause(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.pause()},resume(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.resume()}},p={number:o,data:l,element:s,event:u,common:d,color:f,file:g,string:r,platform:{language:()=>window.navigator.browserLanguage||window.navigator.language,device(){const e=window.navigator.userAgent;return{PC:!e.match(/AppleWebKit.*Mobile.*/),Mobile:!!e.match(/AppleWebKit.*Mobile.*/),iPhone:e.includes("iPhone"),Phone:e.includes("Android")&&/(?:Mobile)/.test(e)||e.includes("iPhone")||/(?:Windows Phone)/.test(e),iPad:e.includes("iPad"),Tablet:e.includes("iPad")||e.includes("Android")&&!/(?:Mobile)/.test(e)||e.includes("Firefox")&&/(?:Tablet)/.test(e),WindowsPhone:/(?:Windows Phone)/.test(e)}},browser(){const e=window.navigator.userAgent;return{Edge:!!e.match(/Edg\/([\d.]+)/),weixin:e.includes("MicroMessenger"),QQ:e.includes("QQ"),QQBrowser:e.includes("MQQBrowser"),UC:e.includes("UCBrowser"),Chrome:e.includes("Chrome"),Firefox:e.includes("Firefox"),sougou:e.toLocaleLowerCase().includes("se 2.x")||e.toLocaleLowerCase().includes("metasr")||e.toLocaleLowerCase().includes("sogou"),Safari:e.includes("Safari")&&!e.includes("Chrome")}},browserKernel(){const e=window.navigator.userAgent;return e.includes("Presto")?"opera":e.includes("AppleWebKit")?"webkit":e.includes("Gecko")&&!e.includes("KHTML")?"gecko":""},os(){const e=window.navigator.userAgent;return{Windows:e.includes("Windows"),Windows_CPU:e.toLocaleLowerCase().includes("win64")||e.toLocaleLowerCase().includes("wow64")?"x64":e.toLocaleLowerCase().includes("win32")||e.toLocaleLowerCase().includes("wow32")?"x32":"",Windows_Version:e.includes("Windows NT 6.1")||e.includes("Windows 7")?"Win7":e.includes("Windows NT 6.3")||e.includes("Windows NT 6.2")||e.includes("Windows NT 8")?"Win8":e.includes("Windows NT 10")||e.includes("Windows NT 6.4")?"Win10":"",Mac:e.includes("Macintosh"),Mac_Version:function(){if(e.includes("Macintosh")){const t=e.match(/Mac OS X ([^\s]+)\)/);if(t&&t[1])return t[1].split(/_|\./).join(".")}return""}(),ios:!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),ios_Version:function(){if(e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)){const t=e.match(/CPU.+OS ([^\s]+) like Mac OS X/);if(t&&t[1])return t[1].split(/_|\./).join(".")}return""}(),Android:e.includes("Android"),Android_Version:function(){const t=e.match(/Android ([^\s]+);/);return t&&t[1]?t[1].split(/_|\./).join("."):""}(),Linux:e.includes("Linux"),HarmonyOS:e.includes("HarmonyOS"),Ubuntu:e.includes("Ubuntu")}}},speech:m},b=e=>/^[\uFEFF]+$/g.test(e),y=e=>p.common.isObject(e)||Array.isArray(e)?JSON.parse(JSON.stringify(e)):e,w=(e,t)=>3==t.nodeType?p.element.isContains(e,t.parentNode):p.element.isContains(e,t),E=e=>new Promise((t=>{const i=new FileReader;i.onload=e=>{t(e.target.result)},i.readAsDataURL(e)})),C=(e,t,i)=>{if(null==i||null==i)return e.hasOwnProperty(t);let n=e[t];if(null==n||null==n)return!1;if("string"==typeof i&&(i=i.toLocaleLowerCase()),"string"==typeof n&&(n=n.toLocaleLowerCase()),"string"==typeof i&&i&&(p.common.matchingText(i,"rgb")||p.common.matchingText(i,"rgba"))&&(i=p.string.trim(i,!0)),"string"==typeof n&&n&&(p.common.matchingText(n,"rgb")||p.common.matchingText(n,"rgba"))&&(n=p.string.trim(n,!0)),"string"==typeof i&&i&&p.common.matchingText(i,"hex")){const e=p.color.hex2rgb(i);i=`rgb(${e[0]},${e[1]},${e[2]})`}if("string"==typeof n&&n&&p.common.matchingText(n,"hex")){const e=p.color.hex2rgb(n);n=`rgb(${e[0]},${e[1]},${e[2]})`}return n==i},v=class e{constructor(e,t,i,n,o){this.key=(()=>{let e=p.data.get(window,"data-alex-editor-key")||0;return e++,p.data.set(window,"data-alex-editor-key",e),e})(),this.type=e,this.parsedom=t,this.marks=i,this.styles=n,this.textContent=o,this.children=null,this.parent=null,this.behavior="default",this.elm=null}isBlock(){return"block"==this.type}isInblock(){return"inblock"==this.type}isInline(){return"inline"==this.type}isClosed(){return"closed"==this.type}isText(){return"text"==this.type}isBreak(){return this.isClosed()&&"br"==this.parsedom}isEmpty(){if(this.isText())return!this.textContent;if(this.isBlock()||this.isInblock()||this.isInline()){if(!this.hasChildren())return!0;return this.children.every((e=>!e||e.isEmpty()))}return!1}isSpaceText(){return this.isText()&&!this.isEmpty()&&b(this.textContent)}getUneditableElement(){return this.hasMarks()&&"false"==this.marks.contenteditable?this:this.isBlock()?null:this.parent.getUneditableElement()}isEqual(t){return!!e.isElement(t)&&this.key==t.key}isContains(e){return!!this.isEqual(e)||!e.isBlock()&&this.isContains(e.parent)}isOnlyHasBreak(){return!!this.hasChildren()&&this.children.every((e=>e.isBreak()||e.isEmpty()))}isPreStyle(){const e=this.getBlock(),t=this.getInblock();return t?"pre"==t.parsedom||(!(!t.hasStyles()||"pre"!=t.styles["white-space"]&&"pre-wrap"!=t.styles["white-space"])||t.parent.isPreStyle()):"pre"==e.parsedom||!(!e.hasStyles()||"pre"!=e.styles["white-space"]&&"pre-wrap"!=e.styles["white-space"])}hasMarks(){return!!this.marks&&(!!p.common.isObject&&!p.common.isEmptyObject(this.marks))}hasStyles(){return!!this.styles&&(!!p.common.isObject(this.styles)&&!p.common.isEmptyObject(this.styles))}hasChildren(){return!this.isClosed()&&!this.isText()&&(!!Array.isArray(this.children)&&!!this.children.length)}hasContains(e){return this.isContains(e)||e.isContains(this)}clone(t=!0){if("boolean"!=typeof t)throw new Error("The parameter must be a Boolean");let i=new e(this.type,this.parsedom,y(this.marks),y(this.styles),this.textContent);return i.behavior=this.behavior,t&&this.hasChildren()&&this.children.forEach((e=>{let n=e.clone(t);i.hasChildren()?i.children.push(n):i.children=[n],n.parent=i})),i}convertToBlock(){if(this.isBlock())return;let t=this.clone();this.type="block",this.parsedom=e.BLOCK_NODE,this.marks=null,this.styles=null,this.textContent=null,this.children=[t],t.parent=this}toEmpty(){if(!this.isEmpty())return this.isText()?(this.marks=null,this.styles=null,this.textContent=null,void(this.elm=null)):this.isClosed()?(this.type="text",this.parsedom=null,this.marks=null,this.styles=null,this.textContent=null,void(this.elm=null)):void(this.hasChildren()&&this.children.forEach((e=>{e.toEmpty()})))}getBlock(){return this.isBlock()?this:this.parent.getBlock()}getInblock(){return this.isInblock()?this:this.isBlock()?null:this.parent.getInblock()}getInline(){return this.isInline()?this:this.isBlock()?null:this.parent.getInline()}isEqualStyles(e){return!this.hasStyles()&&!e.hasStyles()||!!(this.hasStyles()&&e.hasStyles()&&p.common.equal(this.styles,e.styles))}isEqualMarks(e){return!this.hasMarks()&&!e.hasMarks()||!!(this.hasMarks()&&e.hasMarks()&&p.common.equal(this.marks,e.marks))}__render(){let t=null;if(this.isText()){t=document.createElement(e.TEXT_NODE);const i=document.createTextNode(this.textContent);t.appendChild(i)}else t=document.createElement(this.parsedom),this.hasChildren()&&this.children.forEach((e=>{e.__render(),t.appendChild(e.elm)}));this.hasMarks()&&Object.keys(this.marks).forEach((e=>{/(^on)|(^style$)|(^face$)/g.test(e)||t.setAttribute(e,this.marks[e])})),this.hasStyles()&&Object.keys(this.styles).forEach((e=>{t.style.setProperty(e,this.styles[e])})),p.data.set(t,"data-alex-editor-key",this.key),this.elm=t}__fullClone(){let t=new e(this.type,this.parsedom,y(this.marks),y(this.styles),this.textContent);return t.behavior=this.behavior,t.key=this.key,t.elm=this.elm,this.hasChildren()&&this.children.forEach((e=>{let i=e.__fullClone();t.hasChildren()?t.children.push(i):t.children=[i],i.parent=t})),t}static isElement(t){return t instanceof e}static flatElements(e){const t=e=>{let i=[],n=0;const o=e.length;for(;n<o;)i.push(e[n]),e[n].hasChildren()&&i.push(...t(e[n].children)),n++;return i};return t(e)}static getSpaceElement(){return new e("text",null,null,null,"\ufeff")}};n(v,"BLOCK_NODE","p"),n(v,"TEXT_NODE","span"),n(v,"VOID_NODES",["colgroup","col"]);let k=v;class ${constructor(e,t){this.anchor=e,this.focus=t}}class x{constructor(e,t){if(this.element=e,this.offset=t,this.element.isText()||this.element.isClosed()){if(k.VOID_NODES.includes(this.element.parsedom))throw new Error("Invisible element cannot be set as focal point")}else 0==this.offset?this.moveToStart(this.element):this.moveToEnd(this.element)}static isPoint(e){return e instanceof x}isEqual(e){return!!x.isPoint(e)&&(this.element.isEqual(e.element)&&this.offset==e.offset)}moveToEnd(e){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(e.isEmpty())throw new Error("The argument cannot be an empty element");if(e.isText())this.element=e,this.offset=e.textContent.length;else if(e.isClosed()){if(k.VOID_NODES.includes(e.parsedom))throw new Error("Invisible element cannot be set as focal point");this.element=e,this.offset=1}else if(e.hasChildren()){const t=k.flatElements(e.children).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom))),i=t.length;if(0==i)throw new Error("There is no element to set the focus");this.moveToEnd(t[i-1])}}moveToStart(e){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(e.isEmpty())throw new Error("The argument cannot be an empty element");if(e.isText())this.element=e,this.offset=0;else if(e.isClosed()){if(k.VOID_NODES.includes(e.parsedom))throw new Error("Invisible element cannot be set as focal point");this.element=e,this.offset=0}else if(e.hasChildren()){const t=k.flatElements(e.children).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom)));if(0==t.length)throw new Error("There is no element to set the focus");this.moveToStart(t[0])}}}class T{constructor(){this.records=[],this.current=-1}push(e,t){this.current<this.records.length-1&&(this.records.length=this.current+1);const i=e.map((e=>e.__fullClone())),n=this.__cloneRange(i,t);this.records.push({stack:i,range:n}),this.current+=1}get(e){let t=this.current;if(-1==e){if(t<=0)return null;t-=1}else if(1==e){if(t>=this.records.length-1)return null;t+=1}const{stack:i,range:n}=this.records[t],o=i.map((e=>e.__fullClone()));return{current:t,stack:o,range:this.__cloneRange(o,n)}}updateCurrentRange(e){const t=this.records[this.current],i=this.__cloneRange(t.stack,e);this.records[this.current].range=i}__cloneRange(e,t){if(t){const i=k.flatElements(e).find((e=>e.key==t.anchor.element.key)),n=k.flatElements(e).find((e=>e.key==t.focus.element.key)),o=new x(i,t.anchor.offset),r=new x(n,t.focus.offset);return new $(o,r)}return null}}const B=[{parsedom:"p"},{parsedom:"div"},{parsedom:"table"},{parsedom:"ul"},{parsedom:"ol"},{parsedom:"h1"},{parsedom:"h2"},{parsedom:"h3"},{parsedom:"h4"},{parsedom:"h5"},{parsedom:"h6"},{parsedom:"blockquote"},{parsedom:"pre"},{parsedom:"address",parse:!0},{parsedom:"article",parse:!0},{parsedom:"aside",parse:!0},{parsedom:"nav",parse:!0},{parsedom:"section",parse:!0}],S=[{parsedom:"br"},{parsedom:"col"},{parsedom:"img"},{parsedom:"hr"},{parsedom:"video"},{parsedom:"audio"}],_=[{parsedom:"li",block:!0},{parsedom:"tfoot"},{parsedom:"tbody"},{parsedom:"thead"},{parsedom:"tr"},{parsedom:"th"},{parsedom:"td"},{parsedom:"colgroup"}],N=[{parsedom:"span"},{parsedom:"a"},{parsedom:"label"},{parsedom:"code"},{parsedom:"b",parse:{"font-weight":"bold"}},{parsedom:"strong",parse:{"font-weight":"bold"}},{parsedom:"sup",parse:{"vertical-align":"super"}},{parsedom:"sub",parse:{"vertical-align":"sub"}},{parsedom:"i",parse:{"font-style":"italic"}},{parsedom:"u",parse:{"text-decoration-line":"underline"}},{parsedom:"del",parse:{"text-decoration-line":"line-through"}},{parsedom:"abbr",parse:!0},{parsedom:"acronym",parse:!0},{parsedom:"bdo",parse:!0},{parsedom:"font",parse:!0,parse:{"font-family":function(e){return e.getAttribute("face")||""}}}],O=function(e){if(e.hasChildren()){e.children.filter((e=>!e.isEmpty())).filter((e=>e.isBlock())).forEach((t=>{t.type="inline"==e.type?"inline":"inblock"}))}},A=function(e){if(e.hasChildren()){const t=e.children.filter((e=>!e.isEmpty()));t.every((e=>e.isInblock()))||t.forEach((e=>{e.isInblock()&&(e.type="inline")}))}},I=function(e){if(e.isInline()&&e.hasChildren()){e.children.filter((e=>!e.isEmpty())).filter((e=>e.isInblock())).forEach((e=>{e.isInblock()&&(e.type="inline")}))}},R=function(e){if(e.hasChildren()){const t=e.children.filter((e=>!e.isEmpty()));if(t.every((e=>e.isBreak()))&&t.length){const i=t[0];this.range&&e.isContains(this.range.anchor.element)&&this.range.anchor.moveToStart(i),this.range&&e.isContains(this.range.focus.element)&&this.range.focus.moveToStart(i),e.children=[i]}else e.children.forEach((e=>{e.isBreak()&&e.toEmpty()}))}},L=function(e){const t=(e,t)=>{if(e.isEmpty()||t.isEmpty()){if(t.isEmpty()){this.range&&t.isContains(this.range.anchor.element)&&(e.isEmpty()?(this.range.anchor.element=e,this.range.anchor.offset=0):this.range.anchor.moveToEnd(e)),this.range&&t.isContains(this.range.focus.element)&&(e.isEmpty()?(this.range.focus.element=e,this.range.focus.offset=0):this.range.focus.moveToEnd(e));const i=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(i,1)}else if(e.isEmpty()){this.range&&e.isContains(this.range.anchor.element)&&(t.isEmpty()?(this.range.anchor.element=t,this.range.anchor.offset=0):this.range.anchor.moveToStart(t)),this.range&&e.isContains(this.range.focus.element)&&(t.isEmpty()?(this.range.focus.element=t,this.range.focus.offset=0):this.range.focus.moveToStart(t));const i=e.parent.children.findIndex((t=>e.isEqual(t)));e.parent.children.splice(i,1)}}else if(e.isText()){this.range&&t.isEqual(this.range.anchor.element)&&(this.range.anchor.element=e,this.range.anchor.offset=e.textContent.length+this.range.anchor.offset),this.range&&t.isEqual(this.range.focus.element)&&(this.range.focus.element=e,this.range.focus.offset=e.textContent.length+this.range.focus.offset),e.textContent+=t.textContent;const i=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(i,1)}else if(e.isInline()){e.children.push(...t.children),e.children.forEach((t=>{t.parent=e})),i(e);const n=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(n,1)}},i=e=>{if(e.hasChildren()&&e.children.length>1){let o=0;for(;o<=e.children.length-2;)i=e.children[o],n=e.children[o+1],i.isEmpty()||n.isEmpty()||(i.isText()&&n.isText()?i.isEqualStyles(n)&&i.isEqualMarks(n):i.isInline()&&n.isInline()&&i.parsedom==n.parsedom&&i.isEqualMarks(n)&&i.isEqualStyles(n))?t(e.children[o],e.children[o+1]):o++}var i,n};i(e)},M=function(e){const t=(e,t)=>{t.isText()?(e.type="text",e.parsedom=null,t.hasMarks()&&(e.hasMarks()?Object.assign(e.marks,y(t.marks)):e.marks=y(t.marks)),t.hasStyles()&&(e.hasStyles()?Object.assign(e.styles,y(t.styles)):e.styles=y(t.styles)),e.textContent=t.textContent,e.children=null,this.range&&t.isContains(this.range.anchor.element)&&(this.range.anchor.element=e),this.range&&t.isContains(this.range.focus.element)&&(this.range.focus.element=e)):(t.hasMarks()&&(e.hasMarks()?Object.assign(e.marks,y(t.marks)):e.marks=y(t.marks)),t.hasStyles()&&(e.hasStyles()?Object.assign(e.styles,y(t.styles)):e.styles=y(t.styles)),t.hasChildren()&&(e.children=[...t.children],e.children.forEach((t=>{t.parent=e}))))};var i,n;e.hasChildren()&&1==e.children.length&&(i=e,(n=e.children[0]).isText()&&i.isInline()?i.parsedom==k.TEXT_NODE:(i.isInline()&&n.isInline()||i.isInblock()&&n.isInblock())&&i.parsedom==n.parsedom)&&t(e,e.children[0])},{Mac:P}=p.platform.os(),F=function(){if(0==k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom))).length){const e=new k("block",k.BLOCK_NODE,null,null,null),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.stack=[e]}},D=function(e){const t=this.getPreviousElementOfPoint(e),i=this.getNextElementOfPoint(e),n=e.element.getBlock(),o=e.element.getInblock();t&&o&&o.isContains(t)?e.moveToEnd(t):i&&o&&o.isContains(i)?e.moveToStart(i):t&&n.isContains(t)?e.moveToEnd(t):i&&n.isContains(i)?e.moveToStart(i):t?e.moveToEnd(t):i&&e.moveToStart(i)},z=function(e){e.isInblock()&&"default"==e.behavior&&e.hasChildren()&&e.children.forEach((e=>{if(e.isInblock())z.apply(this,[e]);else if(e.toEmpty(),e.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.parent)}}))},H=function(){const e=async e=>{const t=p.element.getScrollHeight(e);if(e.clientHeight<t){const t=window.getSelection();if(0==t.rangeCount)return;const i=t.getRangeAt(0),n=i.getClientRects();let o=i;0==n.length&&(o=this.range.focus.element.elm);const r=o.getBoundingClientRect(),s=e.getBoundingClientRect();if(r.top<s.top){await p.element.setScrollTop({el:e,number:0});const t=o.getBoundingClientRect(),i=e.getBoundingClientRect();p.element.setScrollTop({el:e,number:t.top-i.top-2*t.height})}else if(r.bottom>s.bottom){await p.element.setScrollTop({el:e,number:0});const t=o.getBoundingClientRect(),i=e.getBoundingClientRect();p.element.setScrollTop({el:e,number:t.bottom-i.bottom+2*t.height})}}};let t=this.$el;for(;p.element.isElement(t)&&t!=document.documentElement;)e(t),t=t.parentNode},V=function(){if(0==k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom))).length){const e=new k("block",k.BLOCK_NODE,null,null,null),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.stack=[e],this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t)}},W=function(){if(this.__isInputChinese)return;if(this.__innerSelectionChange)return;const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0);if(w(this.$el,t.startContainer)&&w(this.$el,t.endContainer)){let e=null,i=null,n=null,o=null;if(3==t.startContainer.nodeType)e=t.startContainer.parentNode,n=t.startOffset;else if(1==t.startContainer.nodeType){const i=Array.from(t.startContainer.childNodes);i.length?(e=i[t.startOffset]?i[t.startOffset]:i[t.startOffset-1],n=i[t.startOffset]?0:1,3==e.nodeType&&(n=0==n?0:e.textContent.length,e=e.parentNode)):(e=t.startContainer,n=0)}if(3==t.endContainer.nodeType)i=t.endContainer.parentNode,o=t.endOffset;else if(1==t.endContainer.nodeType){const e=Array.from(t.endContainer.childNodes);e.length?(i=e[t.endOffset]?e[t.endOffset]:e[t.endOffset-1],o=e[t.endOffset]?0:1,3==i.nodeType&&(o=0==o?0:i.textContent.length,i=i.parentNode)):(i=t.endContainer,o=1)}const r=p.data.get(e,"data-alex-editor-key"),s=p.data.get(i,"data-alex-editor-key"),a=this.getElementByKey(r),l=this.getElementByKey(s),d=new x(a,n),c=new x(l,o);this.range?(this.range.anchor=d,this.range.focus=c):this.range=new $(d,c),this.emit("rangeUpdate",this.range)}}},j=function(e){this.disabled||"deleteByCut"!=e.inputType&&"insertFromPaste"!=e.inputType&&"deleteByDrag"!=e.inputType&&"insertFromDrop"!=e.inputType&&(e.preventDefault(),"insertText"==e.inputType&&e.data?(this.insertText(e.data),this.formatElementStack(),this.domRender(),this.rangeRender()):"insertParagraph"==e.inputType||"insertLineBreak"==e.inputType?(this.insertParagraph(),this.formatElementStack(),this.domRender(),this.rangeRender()):"deleteContentBackward"==e.inputType&&(this.delete(),this.formatElementStack(),this.domRender(),this.rangeRender()))},U=function(e){this.disabled||(e.preventDefault(),"compositionstart"==e.type?(this.__chineseInputTimer&&(clearTimeout(this.__chineseInputTimer),this.__chineseInputTimer=null),this.__isInputChinese=!0):"compositionend"==e.type&&(e.data&&(this.insertText(e.data),this.formatElementStack(),this.domRender(),this.rangeRender()),this.__chineseInputTimer=setTimeout((()=>{this.__isInputChinese=!1}),0)))},q=function(e){if(!this.disabled&&!this.__isInputChinese)if(function(e){return P?90==e.keyCode&&e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:90==e.keyCode&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}(e)){e.preventDefault();const t=this.history.get(-1);t&&(this.history.current=t.current,this.stack=t.stack,this.range=t.range,this.formatElementStack(),this.domRender(!0),this.rangeRender())}else if(function(e){return P?90==e.keyCode&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey:89==e.keyCode&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}(e)){e.preventDefault();const t=this.history.get(1);t&&(this.history.current=t.current,this.stack=t.stack,this.range=t.range,this.formatElementStack(),this.domRender(!0),this.rangeRender())}},K=async function(e){e.preventDefault(),await this.copy()},Z=async function(e){e.preventDefault();await this.cut()&&!this.disabled&&(this.formatElementStack(),this.domRender(),this.rangeRender())},G=async function(e){e.preventDefault(),this.disabled||(await this.paste(),this.formatElementStack(),this.domRender(),this.rangeRender())},X=function(e){e.preventDefault()},Q=function(e){this.disabled||this.emit("focus",this.value)},J=function(e){this.disabled||this.emit("blur",this.value)};class Y{constructor(e,t){this.$el=(e=>{if("string"==typeof e&&e&&(e=document.body.querySelector(e)),!p.element.isElement(e))throw new Error("You must specify a dom container to initialize the editor");if(p.data.get(e,"data-alex-editor-init"))throw new Error("The element node has been initialized to the editor");return p.data.set(e,"data-alex-editor-init",!0),e})(e);const i=(e=>{let t={disabled:!1,renderRules:[],value:"",allowCopy:!0,allowPaste:!0,allowCut:!0,allowPasteHtml:!1,customTextPaste:null,customHtmlPaste:null,customImagePaste:null,customVideoPaste:null,customMerge:null};return p.common.isObject(e)&&("boolean"==typeof e.disabled&&(t.disabled=e.disabled),Array.isArray(e.renderRules)&&(t.renderRules=e.renderRules),"string"==typeof e.value&&e.value&&(t.value=e.value),"boolean"==typeof e.allowCopy&&(t.allowCopy=e.allowCopy),"boolean"==typeof e.allowPaste&&(t.allowPaste=e.allowPaste),"boolean"==typeof e.allowCut&&(t.allowCut=e.allowCut),"boolean"==typeof e.allowPasteHtml&&(t.allowPasteHtml=e.allowPasteHtml),"function"==typeof e.customTextPaste&&(t.customTextPaste=e.customTextPaste),"function"==typeof e.customHtmlPaste&&(t.customHtmlPaste=e.customHtmlPaste),"function"==typeof e.customImagePaste&&(t.customImagePaste=e.customImagePaste),"function"==typeof e.customVideoPaste&&(t.customVideoPaste=e.customVideoPaste),"function"==typeof e.customMerge&&(t.customMerge=e.customMerge)),t})(t);this.disabled=i.disabled,this.value=i.value,this.renderRules=i.renderRules,this.allowCopy=i.allowCopy,this.allowPaste=i.allowPaste,this.allowCut=i.allowCut,this.allowPasteHtml=i.allowPasteHtml,this.customTextPaste=i.customTextPaste,this.customHtmlPaste=i.customHtmlPaste,this.customImagePaste=i.customImagePaste,this.customVideoPaste=i.customVideoPaste,this.customMerge=i.customMerge,this.useClipboard=window.ClipboardItem?!!navigator.clipboard||(console.warn("navigator.clipboard must be obtained in a secure environment, such as localhost, 127.0.0.1, or https, so the editor's copy, paste, and cut functions cannot be used"),!1):(console.warn("window.ClipboardItem must be obtained in a secure environment, such as localhost, 127.0.0.1, or https, so the editor's copy, paste, and cut functions cannot be used"),!1),this.history=new T,this.stack=this.parseHtml(this.value),this.range=null,F.apply(this),this.__guid=(()=>{let e=p.data.get(window,"data-alex-editor-guid")||0;return e++,p.data.set(window,"data-alex-editor-guid",e),e})(),this.__events={},this.__firstRender=!0,this.__isInputChinese=!1,this.__innerSelectionChange=!1,this.__chineseInputTimer=null,this.__dataCaches={},this.disabled?this.setDisabled():this.setEnabled(),p.event.on(document,`selectionchange.alex_editor_${this.__guid}`,W.bind(this)),p.event.on(this.$el,"beforeinput.alex_editor",j.bind(this)),p.event.on(this.$el,"compositionstart.alex_editor compositionupdate.alex_editor compositionend.alex_editor",U.bind(this)),p.event.on(this.$el,"keydown.alex_editor",q.bind(this)),p.event.on(this.$el,"cut.alex_editor",Z.bind(this)),p.event.on(this.$el,"paste.alex_editor",G.bind(this)),p.event.on(this.$el,"copy.alex_editor",K.bind(this)),p.event.on(this.$el,"dragstart.alex_editor drop.alex_editor ",X.bind(this)),p.event.on(this.$el,"focus.alex_editor",Q.bind(this)),p.event.on(this.$el,"blur.alex_editor",J.bind(this))}initRange(){const e=k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom)))[0],t=new x(e,0),i=new x(e,0);this.range=new $(t,i)}async paste(){if(this.disabled)return;if(!this.range)return;if(!this.useClipboard)return;if(!this.allowPaste)return;const e=(await navigator.clipboard.read())[0],t=[];e.types.forEach((i=>{t.push(e.getType(i))}));const i=await Promise.all(t),n=i.length;if(i.some((e=>"text/html"==e.type)))for(let o=0;o<n;o++){const e=i[o];if("text/plain"!=e.type||this.allowPasteHtml){if("text/html"==e.type&&this.allowPasteHtml){const t=await e.text();if(t){const e=this.parseHtml(t).filter((e=>!e.isEmpty()));if("function"==typeof this.customHtmlPaste)await this.customHtmlPaste.apply(this,[e,t]);else{for(let t=0;t<e.length;t++)this.formatElement(e[t]),this.insertElement(e[t],!1);this.emit("pasteHtml",e,t)}}}}else{const t=await e.text();t&&("function"==typeof this.customTextPaste?await this.customTextPaste.apply(this,[t]):(this.insertText(t),this.emit("pasteText",t)))}}else for(let o=0;o<n;o++){const e=i[o];if(e.type.startsWith("image/")){const t=await E(e);if("function"==typeof this.customImagePaste)await this.customImagePaste.apply(this,[t]);else{const e=new k("closed","img",{src:t},null,null);this.insertElement(e),this.emit("pasteImage",t)}}else if(e.type.startsWith("video/")){const t=await E(e);if("function"==typeof this.customVideoPaste)await this.customVideoPaste.apply(this,[t]);else{const e=new k("closed","video",{src:t},null,null);this.insertElement(e),this.emit("pasteVideo",t)}}else if("text/plain"==e.type){const t=await e.text();t&&("function"==typeof this.customTextPaste?await this.customTextPaste.apply(this,[t]):(this.insertText(t),this.emit("pasteText",t)))}}}async cut(){if(!this.useClipboard)return;if(!this.range)return;if(!this.allowCut)return;const e=await this.copy(!0);return e&&(this.disabled||this.delete(),this.emit("cut",e.text,e.html)),e}async copy(e=!1){if(!this.useClipboard)return;if(!this.range)return;if(!this.allowCopy)return;let t=this.getElementsByRange(!0,!1);if(0==t.length)return;let i="",n="";t.forEach((e=>{const t=e.element.clone();e.offset&&(t.textContent=t.textContent.substring(e.offset[0],e.offset[1])),t.__render(),i+=t.elm.outerHTML,n+=t.elm.innerText}));const o=new window.ClipboardItem({"text/html":new Blob([i],{type:"text/html"}),"text/plain":new Blob([n],{type:"text/plain"})});return await navigator.clipboard.write([o]),e||this.emit("copy",n,i),{text:n,html:i}}delete(){if(!this.disabled&&this.range){if(this.range.anchor.isEqual(this.range.focus)){const e=this.getPreviousElementOfPoint(this.range.anchor),t=this.range.anchor.element.getBlock(),i=this.range.anchor.element.getInblock();if(i)if(0==this.range.anchor.offset)if(e){if(i.isContains(e))return this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),void this.delete();if("block"==i.behavior){const t=e.getBlock(),n=e.getInblock();n?"block"==n.behavior&&this.merge(i,n):this.merge(i,t)}}else this.emit("deleteInStart",i);else if(this.range.anchor.element.isSpaceText()){if(this.range.anchor.element.toEmpty(),!i.isEmpty())return this.range.anchor.offset=0,this.range.focus.offset=0,void this.delete();{const e=new k("closed","br",null,null,null);this.addElementTo(e,i),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else if(this.range.anchor.element.isText()){const e=this.range.anchor.element.textContent;this.range.anchor.offset-=1;const t=b(e[this.range.anchor.offset]);if(this.range.anchor.element.textContent=e.substring(0,this.range.anchor.offset)+e.substring(this.range.focus.offset),this.range.focus.offset=this.range.anchor.offset,t)return void this.delete();if(i.isEmpty()){const e=new k("closed","br",null,null,null);this.addElementTo(e,i),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const t=this.range.anchor.element.isBreak();if(this.range.anchor.element.toEmpty(),i.isEmpty())if(t&&"default"!=i.behavior){if(!e){const e=new k("closed","br",null,null,null);this.addElementTo(e,i),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const e=new k("closed","br",null,null,null);this.addElementTo(e,i),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else if(0==this.range.anchor.offset)if(e){if(t.isContains(e))return this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),void this.delete();{const i=e.getInblock(),n=e.getBlock();i?"block"==i.behavior&&this.merge(t,i):this.merge(t,n)}}else this.emit("deleteInStart",t);else if(this.range.anchor.element.isSpaceText()){if(this.range.anchor.element.toEmpty(),!t.isEmpty())return this.range.anchor.offset=0,this.range.focus.offset=0,void this.delete();{const e=new k("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else if(this.range.anchor.element.isText()){const e=this.range.anchor.element.textContent;this.range.anchor.offset-=1;const i=b(e[this.range.anchor.offset]);if(this.range.anchor.element.textContent=e.substring(0,this.range.anchor.offset)+e.substring(this.range.focus.offset),this.range.focus.offset=this.range.anchor.offset,i)return void this.delete();if(t.isEmpty()){const e=new k("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const i=this.range.anchor.element.isBreak();if(this.range.anchor.element.toEmpty(),t.isEmpty()&&(!i||!e)){const e=new k("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}}else{const e=this.getElementsByRange(!0,!1).filter((e=>!k.VOID_NODES.includes(e.element.parsedom))),t=this.range.anchor.element.getInblock(),i=this.range.focus.element.getInblock(),n=this.range.anchor.element.getBlock(),o=this.range.focus.element.getBlock();t&&i&&t.isEqual(i)?e.forEach((e=>{if(e.offset?e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]):e.element.toEmpty(),t.isEmpty()){const e=new k("closed","br",null,null,null);this.addElementTo(e,t)}})):t&&i?(e.forEach((e=>{if(e.offset)e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]);else if(e.element.isInblock()&&"default"==e.element.behavior)z.apply(this,[e.element]);else if(e.element.toEmpty(),e.element.parent&&(e.element.parent.isInblock()||e.element.parent.isBlock())&&e.element.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==t.behavior&&"block"==i.behavior&&this.merge(i,t)):t?(e.forEach((e=>{if(e.offset)e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]);else if(e.element.isInblock()&&"default"==e.element.behavior)z.apply(this,[e.element]);else if(e.element.toEmpty(),e.element.parent&&(e.element.parent.isInblock()||e.element.parent.isBlock())&&e.element.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==t.behavior&&this.merge(o,t)):i?(e.forEach((e=>{if(e.offset)e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]);else if(e.element.isInblock()&&"default"==e.element.behavior)z.apply(this,[e.element]);else if(e.element.toEmpty(),e.element.parent&&(e.element.parent.isInblock()||e.element.parent.isBlock())&&e.element.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==i.behavior&&this.merge(i,n)):n.isEqual(o)?e.forEach((e=>{if(e.offset?e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]):e.element.toEmpty(),n.isEmpty()){const e=new k("closed","br",null,null,null);this.addElementTo(e,n)}})):(e.forEach((e=>{if(e.offset)e.element.textContent=e.element.textContent.substring(0,e.offset[0])+e.element.textContent.substring(e.offset[1]);else if(e.element.isInblock()&&"default"==e.element.behavior)z.apply(this,[e.element]);else if(e.element.toEmpty(),e.element.parent&&(e.element.parent.isInblock()||e.element.parent.isBlock())&&e.element.parent.isEmpty()){const t=new k("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),this.merge(o,n))}this.range.anchor.element.isEmpty()&&D.apply(this,[this.range.anchor]),this.range.focus.element=this.range.anchor.element,this.range.focus.offset=this.range.anchor.offset,V.apply(this),this.emit("deleteComplete")}}insertText(e){if(!this.disabled){if(!e||"string"!=typeof e)throw new Error("The argument must be a string");if(this.range)if(this.range.anchor.isEqual(this.range.focus))if(this.range.anchor.element.isPreStyle()||(e=e.replace(/\s/g,(()=>{const e=document.createElement("span");return e.innerHTML="&nbsp;",e.innerText}))),this.range.anchor.element.isText()){let t=this.range.anchor.element.textContent;this.range.anchor.element.textContent=t.substring(0,this.range.anchor.offset)+e+t.substring(this.range.anchor.offset),this.range.anchor.offset=this.range.anchor.offset+e.length,this.range.focus.offset=this.range.anchor.offset}else{const t=new k("text",null,null,null,e);0==this.range.anchor.offset?this.addElementBefore(t,this.range.anchor.element):this.addElementAfter(t,this.range.anchor.element),this.range.anchor.moveToEnd(t),this.range.focus.moveToEnd(t)}else this.delete(),this.insertText(e)}}insertParagraph(){if(!this.disabled&&this.range)if(this.range.anchor.isEqual(this.range.focus)){const e=this.getPreviousElementOfPoint(this.range.anchor),t=this.getNextElementOfPoint(this.range.anchor),i=this.range.anchor.element.getBlock(),n=this.range.anchor.element.getInblock(),o=this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1;if(n){if(this.range.anchor.element.isPreStyle()){this.insertText("\n");const e=k.getSpaceElement();this.insertElement(e),this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),this.emit("insertParagraph",null,n)}else if("block"==n.behavior)if(0!=this.range.anchor.offset||e&&n.isContains(e))if(this.range.anchor.offset!=o||t&&n.isContains(t)){const e=n.clone();this.addElementAfter(e,n);const t=k.flatElements(n.children).findIndex((e=>this.range.anchor.element.isEqual(e)));this.range.focus.moveToEnd(n),this.delete();const i=k.flatElements(e.children);this.range.focus.element=i[t],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(e),this.delete(),this.emit("insertParagraph",e,n)}else{const e=n.clone(!1),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.addElementAfter(e,n),this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t),this.emit("insertParagraph",e,n)}else{const e=n.clone(!1),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.addElementBefore(e,n),this.emit("insertParagraph",n,e)}}else if(this.range.anchor.element.isPreStyle()){this.insertText("\n");const e=k.getSpaceElement();this.insertElement(e),this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),this.emit("insertParagraph",null,i)}else if(0!=this.range.anchor.offset||e&&i.isContains(e))if(this.range.anchor.offset!=o||t&&i.isContains(t)){const e=i.clone();this.addElementAfter(e,i);const t=k.flatElements(i.children).findIndex((e=>this.range.anchor.element.isEqual(e)));this.range.focus.moveToEnd(i),this.delete();const n=k.flatElements(e.children);this.range.focus.element=n[t],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(e),this.delete(),this.emit("insertParagraph",e,i)}else{const e=i.clone(!1),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.addElementAfter(e,i),this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t),this.emit("insertParagraph",e,i)}else{const e=i.clone(!1),t=new k("closed","br",null,null,null);this.addElementTo(t,e),this.addElementBefore(e,i),this.emit("insertParagraph",i,e)}}else this.delete(),this.insertParagraph()}insertElement(e,t=!0){if(!this.disabled&&this.range){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(!e.isEmpty())if(this.range.anchor.isEqual(this.range.focus)){const i=this.getPreviousElementOfPoint(this.range.anchor),n=this.getNextElementOfPoint(this.range.anchor),o=this.range.anchor.element.getBlock(),r=this.range.anchor.element.getInblock(),s=this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1;if(e.isInblock()&&"block"==e.behavior&&r&&"block"==r.behavior)if(r.isOnlyHasBreak()&&t)this.addElementBefore(e,r),r.toEmpty();else if(0!=this.range.anchor.offset||i&&r.isContains(i))if(this.range.anchor.offset!=s||n&&r.isContains(n)){const t=r.clone();this.addElementAfter(t,r),this.range.focus.moveToEnd(r),this.delete();const i=k.flatElements(r.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=k.flatElements(t.children);this.range.focus.element=n[i],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementBefore(e,t)}else this.addElementAfter(e,r);else this.addElementBefore(e,r);else if(e.isInblock()&&r)if(r.isOnlyHasBreak())this.addElementTo(e,r,0);else if(0!=this.range.anchor.offset||i&&r.isContains(i))if(this.range.anchor.offset!=s||n&&r.isContains(n)){const t=r.clone();this.addElementAfter(t,r),this.range.focus.moveToEnd(r),this.delete();const i=k.flatElements(r.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=k.flatElements(t.children);this.range.focus.element=n[i],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementTo(e,t),this.merge(t,r)}else this.addElementTo(e,r,r.children.length);else this.addElementTo(e,r,0);else if(e.isInblock())if(o.isOnlyHasBreak())this.addElementTo(e,o,0);else if(0!=this.range.anchor.offset||i&&o.isContains(i))if(this.range.anchor.offset!=s||n&&o.isContains(n)){const t=o.clone();this.addElementAfter(t,o),this.range.focus.moveToEnd(o),this.delete();const i=k.flatElements(o.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=k.flatElements(t.children);this.range.focus.element=n[i],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementTo(e,t),this.merge(t,o)}else this.addElementTo(e,o,o.children.length);else this.addElementTo(e,o,0);else if(e.isBlock())if(o.isOnlyHasBreak()&&t)this.addElementBefore(e,o),o.toEmpty();else if(0!=this.range.anchor.offset||i&&o.isContains(i))if(this.range.anchor.offset!=s||n&&o.isContains(n)){const t=o.clone();this.addElementAfter(t,o),this.range.focus.moveToEnd(o),this.delete();const i=k.flatElements(o.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=k.flatElements(t.children);this.range.focus.element=n[i],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementBefore(e,t)}else this.addElementAfter(e,o);else this.addElementBefore(e,o);else if(this.range.anchor.element.isText()){let t=this.range.anchor.element.textContent,i=this.range.anchor.element.clone();this.range.anchor.element.textContent=t.substring(0,this.range.anchor.offset),i.textContent=t.substring(this.range.anchor.offset),this.addElementAfter(i,this.range.anchor.element),this.addElementBefore(e,i)}else 0==this.range.anchor.offset?this.addElementBefore(e,this.range.anchor.element):this.addElementAfter(e,this.range.anchor.element);this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e)}else this.delete(),this.insertElement(e,t)}}formatElement(e){let t=this.renderRules.filter((e=>"function"==typeof e));if([O,A,I,R,L,M,...t].forEach((t=>{t.apply(this,[e])})),e.hasChildren()){let t=0;for(;t<e.children.length;){const i=e.children[t];i.isEmpty()?(this.range&&i.isContains(this.range.anchor.element)&&D.apply(this,[this.range.anchor]),this.range&&i.isContains(this.range.focus.element)&&D.apply(this,[this.range.focus]),e.children.splice(t,1)):(this.formatElement(i),i.isEmpty()?(i.isContains(this.range.anchor.element)&&D.apply(this,[this.range.anchor]),i.isContains(this.range.focus.element)&&D.apply(this,[this.range.focus]),e.children.splice(t,1)):t++)}}}formatElementStack(){let e=0;for(;e<this.stack.length;){const t=this.stack[e];t.isEmpty()?(this.range&&t.isContains(this.range.anchor.element)&&D.apply(this,[this.range.anchor]),this.range&&t.isContains(this.range.focus.element)&&D.apply(this,[this.range.focus]),this.stack.splice(e,1)):(t.isBlock()||t.convertToBlock(),this.formatElement(t),t.isEmpty()?(this.range&&t.isContains(this.range.anchor.element)&&D.apply(this,[this.range.anchor]),this.range&&t.isContains(this.range.focus.element)&&D.apply(this,[this.range.focus]),this.stack.splice(e,1)):e++)}V.apply(this)}domRender(e=!1){this.emit("beforeRender");const t=document.createDocumentFragment();this.stack.forEach((e=>{e.__render(),t.appendChild(e.elm)})),this.$el.innerHTML="",this.$el.appendChild(t);const i=this.value;this.value=this.$el.innerHTML,(this.__firstRender||i!=this.value)&&(this.__firstRender||this.emit("change",this.value,i),e||this.history.push(this.stack,this.range)),this.__firstRender&&(this.__firstRender=!1),this.emit("afterRender")}rangeRender(){if(this.disabled)return;if(!this.range){return void window.getSelection().removeAllRanges()}const e=e=>{let t=null,i=null;if(e.element.isText())t=e.element.elm.childNodes[0],i=e.offset;else{t=e.element.parent.elm;const n=e.element.parent.children.findIndex((t=>e.element.isEqual(t)));i=e.offset+n}return{node:t,offset:i}};this.__innerSelectionChange=!0;const t=e(this.range.anchor),i=e(this.range.focus),n=window.getSelection();n.removeAllRanges();const o=document.createRange();o.setStart(t.node,t.offset),o.setEnd(i.node,i.offset),n.addRange(o),setTimeout((()=>{H.apply(this),this.__innerSelectionChange=!1,this.emit("rangeUpdate",this.range)}),0)}parseHtml(e){if(!e)throw new Error("You need to give an html content to convert");const t=document.createElement("div");t.innerHTML=e;let i=[];return Array.from(t.childNodes).forEach((e=>{if(1==e.nodeType||3==e.nodeType){const t=this.parseNode(e);i.push(t)}})),i}parseNode(e){if(!(e instanceof Node))throw new Error("The argument must be an node");if(1!=e.nodeType&&3!=e.nodeType)throw new Error("The argument must be an element node or text node");if(3==e.nodeType)return new k("text",null,null,null,e.textContent);const t=(e=>{let t={};const i=e.attributes.length;for(let n=0;n<i;n++){const i=e.attributes[n];/(^on)|(^style$)|(^face$)/g.test(i.nodeName)||(t[i.nodeName]=i.nodeValue)}return t})(e),i=(e=>{let t={};if(e.getAttribute("style")){const i=e.getAttribute("style");let n=0,o=0,r=[];for(;n<i.length;)";"==i[n]&&"base64,"!=i.substring(n+1,n+8)&&(r.push(i.substring(o,n)),o=n+1),n==i.length-1&&o<n&&r.push(i.substring(o,n)),n++;r.forEach((e=>{const i=e.indexOf(":"),n=e.substring(0,i).trim(),o=e.substring(i+1).trim();t[n]=o}))}return t})(e),n=e.nodeName.toLocaleLowerCase(),o=B.find((e=>e.parsedom==n)),r=_.find((e=>e.parsedom==n)),s=N.find((e=>e.parsedom==n)),a=S.find((e=>e.parsedom==n));let l=null,d={type:"inblock",parsedom:n,marks:t,styles:i,behavior:"default"};if(o)d.type="block",o.parse&&(d.parsedom=k.BLOCK_NODE);else if(r)d.type="inblock",r.block&&(d.behavior="block");else if(s){if(d.type="inline",s.parse&&(d.parsedom=k.TEXT_NODE,p.common.isObject(s.parse)))for(let c in s.parse)"function"==typeof s.parse[c]?d.styles[c]=s.parse[c].apply(this,[e]):d.styles[c]=s.parse[c]}else a?d.type="closed":(d.type="inline",d.parsedom="span");return l=new k(d.type,d.parsedom,d.marks,d.styles,null),l.behavior=d.behavior,a||Array.from(e.childNodes).forEach((e=>{if(1==e.nodeType||3==e.nodeType){const t=this.parseNode(e);t.parent=l,l.hasChildren()?l.children.push(t):l.children=[t]}})),l}merge(e,t){if(!k.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!k.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(!e.isBlock()&&!e.isInblock()||!t.isBlock()&&!t.isInblock())throw new Error('Elements that are not "block" or "inblock" cannot be merged');"function"==typeof this.customMerge?this.customMerge.apply(this,[e,t]):(t.children.push(...e.children),t.children.forEach((e=>{e.parent=t})),e.children=null)}getElementByKey(e){if(!e)throw new Error("You need to specify a key to do the query");const t=i=>{let n=null,o=0,r=i.length;for(;o<r;){if(i[o].key==e){n=i[o];break}if(i[o].hasChildren()){const e=t(i[o].children);if(e){n=e;break}}o++}return n};return t(this.stack)}getPreviousElement(e){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(e.isBlock()){const t=this.stack.findIndex((t=>e.isEqual(t)));return t<=0?null:this.stack[t-1].isEmpty()?this.getPreviousElement(this.stack[t-1]):this.stack[t-1]}{const t=e.parent.children.findIndex((t=>e.isEqual(t)));return t<=0?null:e.parent.children[t-1].isEmpty()?this.getPreviousElement(e.parent.children[t-1]):e.parent.children[t-1]}}getNextElement(e){if(!k.isElement(e))throw new Error("The argument must be an AlexElement instance");if(e.isBlock()){const t=this.stack.findIndex((t=>e.isEqual(t)));return t>=this.stack.length-1?null:this.stack[t+1].isEmpty()?this.getNextElement(this.stack[t+1]):this.stack[t+1]}{const t=e.parent.children.findIndex((t=>e.isEqual(t)));return t>=e.parent.children.length-1?null:e.parent.children[t+1].isEmpty()?this.getNextElement(e.parent.children[t+1]):e.parent.children[t+1]}}getPreviousElementOfPoint(e){if(!x.isPoint(e))throw new Error("The argument must be an AlexPoint instance");const t=k.flatElements(this.stack),i=e=>{const n=t.findIndex((t=>e.isEqual(t)));if(n<=0)return null;let o=t[n-1];return!o.isText()&&!o.isClosed()||o.isEmpty()?i(o):o};return i(e.element)}getNextElementOfPoint(e){if(!x.isPoint(e))throw new Error("The argument must be an AlexPoint instance");const t=k.flatElements(this.stack),i=e=>{const n=t.findIndex((t=>e.isEqual(t)));if(n==t.length-1)return null;let o=t[n+1];return!o.isText()&&!o.isClosed()||o.isEmpty()?i(o):o};return i(e.element)}getElementsByRange(e=!1,t=!1){if(!this.range)return;if(this.range.anchor.isEqual(this.range.focus))return[];if(this.range.anchor.element.isEqual(this.range.focus.element)){if(e){const e=0==this.range.anchor.offset&&this.range.focus.offset==(this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1);return[{element:this.range.anchor.element,offset:!e&&[this.range.anchor.offset,this.range.focus.offset]}]}return[]}let i=[];e&&(0==this.range.anchor.offset?i.push({element:this.range.anchor.element,offset:!1}):this.range.anchor.offset<(this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1)&&i.push({element:this.range.anchor.element,offset:[this.range.anchor.offset,this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1]}));const n=k.flatElements(this.stack),o=n.findIndex((e=>e.isEqual(this.range.anchor.element))),r=n.findIndex((e=>e.isEqual(this.range.focus.element)));for(let c=o+1;c<r;c++)i.push({element:n[c],offset:!1});e&&(this.range.focus.offset==(this.range.focus.element.isText()?this.range.focus.element.textContent.length:1)?i.push({element:this.range.focus.element,offset:!1}):this.range.focus.offset>0&&i.push({element:this.range.focus.element,offset:[0,this.range.focus.offset]}));const s=i.length;let a=[];for(let c=s-1;c>=0;c--)if(i[c].element.hasChildren()){i[c].element.children.every((e=>a.some((t=>t.element.isEqual(e)&&!t.offset))))&&a.unshift(i[c])}else a.unshift(i[c]);for(let c=0;c<a.length;c++){const e=a[c].element;if(!e.offset&&e.parent){const t=a.some((t=>t.element.isEqual(e.parent)));e.parent.children.every((e=>a.some((t=>t.element.isEqual(e)&&!t.offset))))&&!t&&(a.splice(c,0,{element:e.parent,offset:!1}),c++)}}if(t)return a;let l=[];const d=a.length;for(let c=0;c<d;c++)if(a[c].element.isBlock())l.push(a[c]);else{a.some((e=>e.element.isEqual(a[c].element.parent)))||l.push(a[c])}return l}splitElementsByRange(e=!1,t=!1){if(!this.range)return;const i=this.getElementsByRange(e,t);let n=[];return i.forEach(((e,t)=>{if(e.offset){let o=null;if(0==e.offset[0]){const t=e.element.clone();e.element.textContent=e.element.textContent.substring(0,e.offset[1]),t.textContent=t.textContent.substring(e.offset[1]),this.addElementAfter(t,e.element),o=e.element}else if(e.offset[1]==e.element.textContent.length){const t=e.element.clone();e.element.textContent=e.element.textContent.substring(0,e.offset[0]),t.textContent=t.textContent.substring(e.offset[0]),this.addElementAfter(t,e.element),o=t}else{const t=e.element.clone(),i=e.element.clone();e.element.textContent=e.element.textContent.substring(0,e.offset[0]),t.textContent=t.textContent.substring(e.offset[0],e.offset[1]),i.textContent=i.textContent.substring(e.offset[1]),this.addElementAfter(t,e.element),this.addElementAfter(i,t),o=t}0==t&&this.range.anchor.moveToStart(o),t==i.length-1&&this.range.focus.moveToEnd(o),n.push(o)}else n.push(e.element)})),n}addElementTo(e,t,i=0){if(!k.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!k.isElement(t))throw new Error("The second argument must be an AlexElement instance");if("number"!=typeof i||isNaN(i)||i<0)throw new Error("The third argument must be an integer not less than 0");t.hasChildren()?i>=t.children.length?t.children.push(e):t.children.splice(i,0,e):t.children=[e],e.parent=t}addElementBefore(e,t){if(!k.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!k.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(t.isBlock()){const i=this.stack.findIndex((e=>t.isEqual(e)));this.stack.splice(i,0,e),e.parent=null}else{const i=t.parent.children.findIndex((e=>t.isEqual(e)));this.addElementTo(e,t.parent,i)}}addElementAfter(e,t){if(!k.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!k.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(t.isBlock()){const i=this.stack.findIndex((e=>t.isEqual(e)));i>=this.stack.length-1?this.stack.push(e):this.stack.splice(i+1,0,e),e.parent=null}else{const i=t.parent.children.findIndex((e=>t.isEqual(e)));this.addElementTo(e,t.parent,i+1)}}collapseToStart(e){if(this.disabled)return;let t=!1;if(this.range||(this.initRange(),t=!0),k.isElement(e))this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e);else{const e=k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom)));if(0==e.length)throw new Error("There is no element to set the focus");this.range.anchor.moveToStart(e[0]),this.range.focus.moveToStart(e[0])}t&&this.history.updateCurrentRange(this.range)}collapseToEnd(e){if(this.disabled)return;let t=!1;if(this.range||(this.initRange(),t=!0),k.isElement(e))this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e);else{const e=k.flatElements(this.stack).filter((e=>!e.isEmpty()&&!k.VOID_NODES.includes(e.parsedom))),t=e.length;if(0==t)throw new Error("There is no element to set the focus");this.range.anchor.moveToEnd(e[t-1]),this.range.focus.moveToEnd(e[t-1])}t&&this.history.updateCurrentRange(this.range)}setDisabled(){this.disabled=!0,this.$el.removeAttribute("contenteditable")}setEnabled(){this.disabled=!1,this.$el.setAttribute("contenteditable",!0)}setTextStyle(e){if(!this.disabled&&this.range){if(!p.common.isObject(e))throw new Error("The argument must be an object");if(this.range.anchor.isEqual(this.range.focus))if(this.range.anchor.element.isSpaceText())this.range.anchor.element.hasStyles()?Object.assign(this.range.anchor.element.styles,y(e)):this.range.anchor.element.styles=y(e);else if(this.range.anchor.element.isText()){const t=k.getSpaceElement();t.styles=y(this.range.anchor.element.styles),t.marks=y(this.range.anchor.element.marks),t.hasStyles()?Object.assign(t.styles,y(e)):t.styles=y(e),this.insertElement(t)}else{const t=k.getSpaceElement();t.styles=y(e),this.insertElement(t)}else{this.splitElementsByRange(!0,!0).forEach((t=>{t.isText()&&(t.hasStyles()?Object.assign(t.styles,y(e)):t.styles=y(e))}))}}}removeTextStyle(e){if(this.disabled)return;if(!this.range)return;const t=t=>{if(Array.isArray(e)){if(t.hasStyles()){let i={};Object.keys(t.styles).forEach((n=>{e.includes(n)||(i[n]=t.styles[n])})),t.styles=i}}else t.styles=null};if(this.range.anchor.isEqual(this.range.focus)){if(this.range.anchor.element.isSpaceText())t(this.range.anchor.element);else if(this.range.anchor.element.isText()){const e=k.getSpaceElement();e.styles=y(this.range.anchor.element.styles),e.marks=y(this.range.anchor.element.marks),t(e),this.insertElement(e)}}else{this.splitElementsByRange(!0,!0).forEach((e=>{e.isText()&&t(e)}))}}queryTextStyle(e,t,i){if(!e)throw new Error("The first argument cannot be null");if(!this.range)return!1;if(this.range.anchor.isEqual(this.range.focus))return!(!this.range.anchor.element.isText()||!this.range.anchor.element.hasStyles())&&C(this.range.anchor.element.styles,e,t);let n=null;return n=i?this.__dataCaches.queryTextStyle||[]:this.getElementsByRange(!0,!0).filter((e=>e.element.isText())),i||(this.__dataCaches.queryTextStyle=n),0!=n.length&&n.every((i=>!!i.element.hasStyles()&&C(i.element.styles,e,t)))}setTextMark(e){if(!this.disabled&&this.range){if(!p.common.isObject(e))throw new Error("The argument must be an object");if(this.range.anchor.isEqual(this.range.focus))if(this.range.anchor.element.isSpaceText())this.range.anchor.element.hasMarks()?Object.assign(this.range.anchor.element.marks,y(e)):this.range.anchor.element.marks=y(e);else if(this.range.anchor.element.isText()){const t=k.getSpaceElement();t.styles=y(this.range.anchor.element.styles),t.marks=y(this.range.anchor.element.marks),t.hasMarks()?Object.assign(t.marks,y(e)):t.marks=y(e),this.insertElement(t)}else{const t=k.getSpaceElement();t.marks=UcloneData(e),this.insertElement(t)}else{this.splitElementsByRange(!0,!0).forEach((t=>{t.isText()&&(t.hasMarks()?Object.assign(t.marks,y(e)):t.marks=y(e))}))}}}removeTextMark(e){if(this.disabled)return;if(!this.range)return;const t=t=>{if(Array.isArray(e)){if(t.hasMarks()){let i={};Object.keys(t.marks).forEach((n=>{e.includes(n)||(i[n]=t.marks[n])})),t.marks=i}}else t.marks=null};if(this.range.anchor.isEqual(this.range.focus)){if(this.range.anchor.element.isSpaceText())t(this.range.anchor.element);else if(this.range.anchor.element.isText()){const e=k.getSpaceElement();e.styles=y(this.range.anchor.element.styles),e.marks=y(this.range.anchor.element.marks),t(e),this.insertElement(e)}}else{this.splitElementsByRange(!0,!0).forEach((e=>{e.isText()&&t(e)}))}}queryTextMark(e,t,i){if(!e)throw new Error("The first argument cannot be null");if(!this.range)return!1;if(this.range.anchor.isEqual(this.range.focus))return!(!this.range.anchor.element.isText()||!this.range.anchor.element.hasMarks())&&C(this.range.anchor.element.marks,e,t);let n=null;return n=i?this.__dataCaches.queryTextMark||[]:this.getElementsByRange(!0,!0).filter((e=>e.element.isText())),i||(this.__dataCaches.queryTextMark=n),0!=n.length&&n.every((i=>!!i.element.hasMarks()&&C(i.element.marks,e,t)))}emit(e,...t){return!!Array.isArray(this.__events[e])&&(this.__events[e].forEach((e=>{e.apply(this,[...t])})),!0)}on(e,t){this.__events[e]||(this.__events[e]=[]),this.__events[e].push(t)}destroy(){this.setDisabled(),p.event.off(document,`selectionchange.alex_editor_${this.__guid}`),p.event.off(this.$el,"beforeinput.alex_editor compositionstart.alex_editor compositionupdate.alex_editor compositionend.alex_editor keydown.alex_editor cut.alex_editor paste.alex_editor copy.alex_editor dragstart.alex_editor drop.alex_editor focus.alex_editor blur.alex_editor")}}const ee={formatNumber(e){return this.isNumber(e)?e.toString().replace(/(\d)(?=(?:\d{3})+$)/g,"$1,"):e},isNumber:e=>"number"==typeof e&&!isNaN(e),add:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=0;try{i=e.toString().split(".")[1].length}catch(r){}try{n=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(i,n)),(e*o+t*o)/o})),subtract:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=0;try{i=e.toString().split(".")[1].length}catch(r){}try{n=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(i,n)),(e*o-t*o)/o})),mutiply:(...e)=>e.reduce(((e,t)=>{let i=0,n=e.toString(),o=t.toString();try{i+=n.split(".")[1].length}catch(r){}try{i+=o.split(".")[1].length}catch(r){}return Number(n.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,i)})),divide:(...e)=>e.reduce(((e,t)=>{let i=0,n=0,o=e.toString(),r=t.toString();try{i=o.split(".")[1].length}catch(s){}try{n=r.split(".")[1].length}catch(s){}return o=Number(o.replace(".","")),r=Number(r.replace(".","")),o/r*Math.pow(10,n-i)}))},te={insert(e,t,i){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if("string"!=typeof t)throw new TypeError("The second argument must be a string");if(!ee.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,i)+t+e.substring(i,e.length)},delete(e,t,i){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!ee.isNumber(t))throw new TypeError("The second argument must be a number");if(t<0)throw new Error("The second argument cannot be less than 0");if(!ee.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,t)+e.substring(t+i,e.length)},replace(e,t,i,n){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!ee.isNumber(t))throw new TypeError("The second argument must be a number");if(t<0)throw new Error("The second argument cannot be less than 0");if(!ee.isNumber(i))throw new TypeError("The third argument must be a number");if(i<0)throw new Error("The third argument cannot be less than 0");if("string"!=typeof n)throw new TypeError("The fourth argument must be a string");return e.substring(0,t)+n+e.substring(i,e.length)},trim(e,t=!1){if("string"!=typeof e)throw new TypeError("The first argument must be a string");let i=e.replace(/(^\s+)|(\s+$)/g,"");return t&&(i=i.replace(/\s/g,"")),i}},ie={isWindow:e=>e&&e instanceof Window,getElementPoint(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(this.isElement(t)||(t=document.body),!this.isContains(t,e))throw new Error("The second argument and the first argument have no hierarchical relationship");let i=e,n=0,o=0;for(;this.isElement(e)&&this.isContains(t,e)&&t!==e;)n+=e.offsetTop,o+=e.offsetLeft,e=e.offsetParent;return{top:n,left:o,right:t.offsetWidth-o-i.offsetWidth,bottom:t.offsetHeight-n-i.offsetHeight}},isContains(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!this.isElement(t))throw new TypeError("The second argument must be an element");return e===t||(e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):void 0)},isParentNode(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!this.isElement(t))throw new TypeError("The second argument must be an element");return e!==t&&t.parentNode===e},children(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(t&&"string"!=typeof t)throw new TypeError("The second argument must be a string");return[...e.querySelectorAll(t||"*")].filter((t=>t.parentNode===e))},siblings(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(t&&"string"!=typeof t)throw new TypeError("The second argument must be a string");if(!e.parentNode)return[];return[...e.parentNode.querySelectorAll(t||"*")].filter((t=>t.parentNode===e.parentNode&&t!=e))},rem2px(e){if(!ee.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return ee.mutiply(e,parseFloat(t))},px2rem(e){if(!ee.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return ee.divide(e,parseFloat(t))},width(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientWidth,i=parseFloat(this.getCssStyle(e,"padding-left")),n=parseFloat(this.getCssStyle(e,"padding-right"));return ee.subtract(t,i,n)},height(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientHeight,i=parseFloat(this.getCssStyle(e,"padding-top")),n=parseFloat(this.getCssStyle(e,"padding-bottom"));return ee.subtract(t,i,n)},removeClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;te.trim(t).split(/\s+/).forEach((e=>{i.remove(e)}))},addClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;te.trim(t).split(/\s+/).forEach((e=>{i.add(e)}))},hasClass(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.classList;return te.trim(t).split(/\s+/).every((e=>i.contains(e)))},scrollTopBottomTrigger(e,t){"string"==typeof e&&e&&(e=document.body.querySelector(e));let i=window;this.isElement(e)&&e!=document.body&&e!=document.documentElement&&(i=e),"function"==typeof e&&(t=e);let n=!0;i.addEventListener("scroll",(e=>{if(this.getScrollTop(i)<=0){if(!n)return;"function"==typeof t&&(n=!1,t({state:"top",target:i}))}else{let e={state:"bottom",target:i},o=0;if(o=i==window?window.innerHeight:i.clientHeight,ee.add(this.getScrollTop(i),o)+1>=this.getScrollHeight(i)&&o!=this.getScrollHeight(i)){if(!n)return;"function"==typeof t&&(n=!1,t(e))}else n=!0}}))},getScrollWidth(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.documentElement&&e!=document.body?e.scrollWidth:0==document.documentElement.scrollWidth||0==document.body.scrollWidth?document.documentElement.scrollWidth||document.body.scrollWidth:document.documentElement.scrollWidth>document.body.scrollWidth?document.documentElement.scrollWidth:document.body.scrollWidth,t},getScrollHeight(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.documentElement&&e!=document.body?e.scrollHeight:0==document.documentElement.scrollHeight||0==document.body.scrollHeight?document.documentElement.scrollHeight||document.body.scrollHeight:document.documentElement.scrollHeight>document.body.scrollHeight?document.documentElement.scrollHeight:document.body.scrollHeight,t},setScrollTop(e){let t=!1,i=e.el;"string"==typeof i&&i&&(i=document.body.querySelector(i));let n=e.number||0,o=e.time||0;return this.isElement(i)&&i!=document.body&&i!=document.documentElement&&i!=window||(t=!0),new Promise(((e,r)=>{if(o<=0)t?document.documentElement.scrollTop=document.body.scrollTop=n:i.scrollTop=n,e();else{let r=10,s=ee.divide(o,r),a=this.getScrollTop(i),l=ee.divide(ee.subtract(n,a),s),d=setInterval((()=>{s>0?(s--,t?document.documentElement.scrollTop=document.body.scrollTop=a=ee.add(a,l):i.scrollTop=a=ee.add(a,l)):(clearInterval(d),e())}),r)}}))},getScrollTop(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.body&&e!=document.documentElement&&e!=window?e.scrollTop:0==document.documentElement.scrollTop||0==document.body.scrollTop?document.documentElement.scrollTop||document.body.scrollTop:document.documentElement.scrollTop>document.body.scrollTop?document.documentElement.scrollTop:document.body.scrollTop,t},getScrollLeft(e){"string"==typeof e&&e&&(e=document.body.querySelector(e));let t=0;return t=this.isElement(e)&&e!=document.body&&e!=document.documentElement&&e!=window?e.scrollLeft:0==document.documentElement.scrollLeft||0==document.body.scrollLeft?document.documentElement.scrollLeft||document.body.scrollLeft:document.documentElement.scrollLeft>document.body.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,t},setScrollLeft(e){let t=!1,i=e.el;"string"==typeof i&&i&&(i=document.body.querySelector(i));let n=e.number||0,o=e.time||0;return this.isElement(i)&&i!=document.body&&i!=document.documentElement&&i!=window||(t=!0),new Promise(((e,r)=>{if(o<=0)t?document.documentElement.scrollLeft=document.body.scrollLeft=n:i.scrollLeft=n,e();else{let r=10,s=ee.divide(o,r),a=this.getScrollLeft(i),l=ee.divide(ee.subtract(n,a),s),d=setInterval((()=>{s>0?(s--,t?document.documentElement.scrollLeft=document.body.scrollLeft=a=ee.add(a,l):i.scrollLeft=a=ee.add(a,l)):(clearInterval(d),e())}),r)}}))},getCssStyle(e,t){if(!this.isElement(e))throw new TypeError("The first argument must be an element");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i="";return i=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(e)[t]:e.currentStyle[t],i},getCssSelector(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a selector string");if(/^#{1}/.test(e))return{type:"id",value:e.substr(1)};if(/^\./.test(e))return{type:"class",value:e.substr(1)};if(/^\[(.+)\]$/.test(e)){let t="attribute",i="",n=te.trim(e,!0).substring(1,te.trim(e,!0).length-1).split("=");return 1==n.length&&(i=n[0]),2==n.length&&(i={attributeName:n[0],attributeValue:n[1].replace(/\'/g,"").replace(/\"/g,"")}),{type:t,value:i}}return{type:"tag",value:e}},getElementBounding(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.getBoundingClientRect();return{top:t.top,bottom:ee.subtract(document.documentElement.clientHeight||window.innerHeight,t.bottom),left:t.left,right:ee.subtract(document.documentElement.clientWidth||window.innerWidth,t.right)}},isElement:e=>e&&e instanceof Node&&1===e.nodeType,string2dom(e,t="div"){if(!e||"string"!=typeof e)throw new TypeError("The argument must be an HTML string");let i=document.createElement(t);return i.innerHTML=e,1==i.children.length?i.children[0]:Array.from(i.children)}},ne="_dap-datas",oe={remove(e,t){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=e[ne]||{};null==t||""===t?e[ne]={}:(delete i[t],e[ne]=i)},has(e,t){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(null==t||""===t)throw new TypeError("The second parameter must be a unique key");return(e[ne]||{}).hasOwnProperty(t)},get(e,t){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=e[ne]||{};return null==t||""===t?i:i[t]},set(e,t,i){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(null==t||""===t)throw new TypeError("The second parameter must be a unique key");let n=e[ne]||{};n[t]=i,e[ne]=n}},re={matchingText(e,t){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=null;if("Chinese"==t&&(i=/^[\u4e00-\u9fa5]+$/),"chinese"==t&&(i=/[\u4e00-\u9fa5]/),"email"==t&&(i=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/),"username"==t&&(i=/^[a-zA-Z0-9_]{4,16}$/),"int+"==t&&(i=/^\d+$/),"int-"==t&&(i=/^-\d+$/),"int"==t&&(i=/^-?\d+$/),"pos"==t&&(i=/^\d*\.?\d+$/),"neg"==t&&(i=/^-\d*\.?\d+$/),"number"==t&&(i=/^-?\d*\.?\d+$/),"phone"==t&&(i=/^1[0-9]\d{9}$/),"idCard"==t&&(i=/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/),"url"==t&&(i=/^((https?|ftp|file):\/\/)?([\da-z\.-]+)\.([\da-z\.]{2,6})([\/\w \.-]*)*\/?$/),"IPv4"==t&&(i=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/),"hex"==t&&(i=/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/),"rgb"==t&&(i=/^rgb\((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\)$/),"rgba"==t&&(i=/^rgba\((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d),\s?(0?\.\d|1(\.0)?|0)\)$/),"QQ"==t&&(i=/^[1-9][0-9]{4,10}$/),"weixin"==t&&(i=/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/),"plate"==t&&(i=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/),!i)throw new Error("The second parameter is out of scope");return i.test(e)},getUrlParams(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),i=window.location.search.substr(1);if(!i){let e=window.location.hash.split("?");2==e.length&&(i=e[1])}let n=i.match(t);return n?decodeURIComponent(n[2]):null},isEmptyObject(e){return!!this.isObject(e)&&0==Object.keys(e).length},equal(e,t){if(typeof e!=typeof t)return!1;if(this.isObject(e)&&this.isObject(t)){let i=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);if(i.length!=n.length)return!1;let o=i.length,r=!0;for(let s=0;s<o;s++){let n=i[s],o=e[n],a=t[n];if(!this.equal(o,a)){r=!1;break}}return r}return e===t},isObject:e=>!("object"!=typeof e||!e),copyText(e){if(!e||"string"!=typeof e)throw new TypeError("No text to copy is defined");if(!navigator.clipboard)throw new Error("navigator.clipboard must be obtained in a secure environment, such as localhost, 127.0.0.1, or https, so the method won't work");return navigator.clipboard.writeText(e)},clone(e){if(this.isObject(e)){if(Array.isArray(e))return e.map((e=>this.clone(e)));let t={};for(let i in e)t[i]=this.clone(e[i]);return t}return e}},se=e=>{let t=e.split(/[\s]+/g),i=[];return t.forEach((e=>{let t=e.split("."),n={eventName:t[0]};t.length>1&&(n.guid=t[1]),i.push(n)})),i},ae=(e,t,i)=>{let n=oe.get(e,"dap-defined-events")||{},o=Object.keys(n),r=o.length;for(let s=0;s<r;s++){let r=o[s];n[r].type==t&&(i?r==t+"."+i&&(e.removeEventListener(n[r].type,n[r].fn,n[r].options),n[r]=void 0):(e.removeEventListener(n[r].type,n[r].fn,n[r].options),n[r]=void 0))}n=(e=>{let t={};return Object.keys(e).forEach((i=>{e[i]&&(t[i]=e[i])})),t})(n),oe.set(e,"dap-defined-events",n)},le={on(e,t,i,n){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");if(!i||"function"!=typeof i)throw new TypeError("The third argument must be a function");re.isObject(n)||(n={});se(t).forEach((t=>{((e,t,i,n,o)=>{let r=oe.get(e,"dap-defined-events")||{};i||(i=oe.get(e,"dap-event-guid")||0,oe.set(e,"dap-event-guid",i+1)),r[i=t+"."+i]&&r[i].type==t&&e.removeEventListener(t,r[i].fn,r[i].options),e.addEventListener(t,n,o),r[i]={type:t,fn:n,options:o},oe.set(e,"dap-defined-events",r)})(e,t.eventName,t.guid,i.bind(e),n)}))},off(e,t){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let i=oe.get(e,"dap-defined-events");if(!i)return;if(!t){let t=Object.keys(i),n=t.length;for(let o=0;o<n;o++){let n=t[o];e.removeEventListener(i[n].type,i[n].fn,i[n].options)}return oe.remove(e,"dap-defined-events"),void oe.remove(e,"dap-event-guid")}se(t).forEach((t=>{ae(e,t.eventName,t.guid)}))},get(e){if(!(e instanceof Document||ie.isElement(e)||ie.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let t=oe.get(e,"dap-defined-events");if(t)return t}},de={rgb2hsv(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=0,i=0,n=0,o=e[0]>=255?255:e[0],r=e[1]>=255?255:e[1],s=e[2]>=255?255:e[2];o=o<=0?0:o,r=r<=0?0:r,s=s<=0?0:s;let a=Math.max(o,r,s),l=Math.min(o,r,s);return n=a/255,i=0===a?0:1-l/a,a===l?t=0:a===o&&r>=s?t=(r-s)/(a-l)*60+0:a===o&&r<s?t=(r-s)/(a-l)*60+360:a===r?t=(s-o)/(a-l)*60+120:a===s&&(t=(o-r)/(a-l)*60+240),[t,100*i,100*n]},hsv2rgb(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=e[0]>=360||e[0]<=0?0:e[0],i=e[1]>=100?100:e[1];i=i<=0?0:i;let n=e[2]>=100?100:e[2];n=n<=0?0:n,i/=100,n/=100;let o=0,r=0,s=0,a=parseInt(t/60%6),l=t/60-a,d=n*(1-i),c=n*(1-l*i),h=n*(1-(1-l)*i);switch(a){case 0:o=n,r=h,s=d;break;case 1:o=c,r=n,s=d;break;case 2:o=d,r=n,s=h;break;case 3:o=d,r=c,s=n;break;case 4:o=h,r=d,s=n;break;case 5:o=n,r=d,s=c}return o=parseInt(255*o),r=parseInt(255*r),s=parseInt(255*s),[o,r,s]},rgb2hex(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+e[2]).toString(16).slice(1)},hex2rgb(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=e.toLowerCase();if(!re.matchingText(t,"hex"))throw new TypeError("The argument must be a hexadecimal color value");if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}let i=[];for(let n=1;n<7;n+=2)i.push(parseInt("0x"+t.slice(n,n+2)));return i}},ce={getImageUrl(e){if(!(e&&e instanceof File))throw new TypeError("The argument must be a File object");return window.URL.createObjectURL(e)},dataFileToBase64:e=>new Promise(((t,i)=>{e&&e instanceof File||i(new TypeError("The argument must be a File object"));let n=new FileReader;n.readAsDataURL(e),n.onloadend=()=>{let e=n.result;t(e)}})),dataBase64toFile(e,t){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!t||"string"!=typeof t)throw new TypeError("The second argument must be a string");let i=e.split(","),n=i[0].match(/:(.*?);/)[1],o=atob(i[1]),r=o.length,s=new Uint8Array(r);for(;r--;)s[r]=o.charCodeAt(r);return new File([s],t,{type:n})},compressImage(e,t){const i={width:null,quality:.8,mimeType:"jpeg",maxSize:0,minSize:0};re.isObject(t)&&(ee.isNumber(t.width)&&(i.width=t.width),ee.isNumber(t.quality)&&t.quality>=0&&t.quality<=1&&(i.quality=t.quality),"jpeg"!=t.mimeType&&"webp"!=t.mimeType||(i.mimeType=t.mimeType),ee.isNumber(t.maxSize)&&(i.maxSize=t.maxSize),ee.isNumber(t.minSize)&&(i.minSize=t.minSize));const n=(e,t,o)=>{let r=e.toDataURL("image/"+i.mimeType,o),s=this.dataBase64toFile(r,t);if(i.maxSize>0&&s.size>1024*i.maxSize){o=o<=0?0:Number((o-.01).toFixed(2));const i=n(e,t,o);r=i.url,s=i.file,o=i.quality}return{file:s,url:r,quality:o}};return new Promise(((t,o)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>{let s=r.result,a=new Image;a.src=s,a.onload=()=>{if(i.minSize>0&&e.size<=1024*i.minSize)return void t({file:e,url:s,quality:1,width:a.width,height:a.height});let o=document.createElement("canvas"),r=o.getContext("2d");o.width=i.width||a.width,o.height=i.width?i.width/(a.width/a.height):a.height,r.drawImage(a,0,0,o.width,o.height);let l=e.name.lastIndexOf(".");const d=e.name.substring(0,l)+"."+i.mimeType;let c=n(o,d,i.quality);t({...c,width:o.width,height:o.height})},a.onerror=()=>{o(new Error("Failed to load image file"))}},r.onerror=()=>{o(new Error("Failed to load image file"))}}))}},he={start(e,t){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");let i={pitch:.8,rate:1,volume:1,start:function(){},end:function(){},pause:function(){},resume:function(){},error:function(){}};re.isObject(t)||(t={}),ee.isNumber(t.pitch)&&(i.pitch=t.pitch),ee.isNumber(t.rate)&&(i.rate=t.rate),ee.isNumber(t.volume)&&(i.volume=t.volume),"function"==typeof t.start&&(i.start=t.start),"function"==typeof t.end&&(i.end=t.end),"function"==typeof t.pause&&(i.pause=t.pause),"function"==typeof t.resume&&(i.resume=t.resume),"function"==typeof t.error&&(i.error=t.error);const n=new SpeechSynthesisUtterance;n.text=e,n.pitch=i.pitch,n.rate=i.rate,n.volume=i.volume,n.lang="zh-CN",n.onstart=t=>{i.start.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onend=t=>{i.end.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onpause=t=>{i.pause.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onresume=t=>{i.resume.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},n.onerror=t=>{i.error.apply(n,[t,{text:e,pitch:i.pitch,rate:i.rate,volume:i.volume}])},window.speechSynthesis.speak(n)},stop(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.cancel()},pause(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.pause()},resume(){if(!window.SpeechSynthesisUtterance||!window.speechSynthesis)throw new Error("The current browser does not support this syntax");window.speechSynthesis.resume()}},ue={number:ee,data:oe,element:ie,event:le,common:re,color:de,file:ce,string:te,platform:{language:()=>window.navigator.browserLanguage||window.navigator.language,device(){const e=window.navigator.userAgent;return{PC:!e.match(/AppleWebKit.*Mobile.*/),Mobile:!!e.match(/AppleWebKit.*Mobile.*/),iPhone:e.includes("iPhone"),Phone:e.includes("Android")&&/(?:Mobile)/.test(e)||e.includes("iPhone")||/(?:Windows Phone)/.test(e),iPad:e.includes("iPad"),Tablet:e.includes("iPad")||e.includes("Android")&&!/(?:Mobile)/.test(e)||e.includes("Firefox")&&/(?:Tablet)/.test(e),WindowsPhone:/(?:Windows Phone)/.test(e)}},browser(){const e=window.navigator.userAgent;return{Edge:!!e.match(/Edg\/([\d.]+)/),weixin:e.includes("MicroMessenger"),QQ:e.includes("QQ"),QQBrowser:e.includes("MQQBrowser"),UC:e.includes("UCBrowser"),Chrome:e.includes("Chrome"),Firefox:e.includes("Firefox"),sougou:e.toLocaleLowerCase().includes("se 2.x")||e.toLocaleLowerCase().includes("metasr")||e.toLocaleLowerCase().includes("sogou"),Safari:e.includes("Safari")&&!e.includes("Chrome")}},browserKernel(){const e=window.navigator.userAgent;return e.includes("Presto")?"opera":e.includes("AppleWebKit")?"webkit":e.includes("Gecko")&&!e.includes("KHTML")?"gecko":""},os(){const e=window.navigator.userAgent;return{Windows:e.includes("Windows"),Windows_CPU:e.toLocaleLowerCase().includes("win64")||e.toLocaleLowerCase().includes("wow64")?"x64":e.toLocaleLowerCase().includes("win32")||e.toLocaleLowerCase().includes("wow32")?"x32":"",Windows_Version:e.includes("Windows NT 6.1")||e.includes("Windows 7")?"Win7":e.includes("Windows NT 6.3")||e.includes("Windows NT 6.2")||e.includes("Windows NT 8")?"Win8":e.includes("Windows NT 10")||e.includes("Windows NT 6.4")?"Win10":"",Mac:e.includes("Macintosh"),Mac_Version:function(){if(e.includes("Macintosh")){const t=e.match(/Mac OS X ([^\s]+)\)/);if(t&&t[1])return t[1].split(/_|\./).join(".")}return""}(),ios:!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),ios_Version:function(){if(e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)){const t=e.match(/CPU.+OS ([^\s]+) like Mac OS X/);if(t&&t[1])return t[1].split(/_|\./).join(".")}return""}(),Android:e.includes("Android"),Android_Version:function(){const t=e.match(/Android ([^\s]+);/);return t&&t[1]?t[1].split(/_|\./).join("."):""}(),Linux:e.includes("Linux"),HarmonyOS:e.includes("HarmonyOS"),Ubuntu:e.includes("Ubuntu")}}},speech:he};function fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ge(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{const i=e[t],n=typeof i;"object"!==n&&"function"!==n||Object.isFrozen(i)||ge(i)})),e}class me{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function pe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function be(e,...t){const i=Object.create(null);for(const n in e)i[n]=e[n];return t.forEach((function(e){for(const t in e)i[t]=e[t]})),i}const ye=e=>!!e.scope;class we{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=pe(e)}openNode(e){if(!ye(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const i=e.split(".");return[`${t}${i.shift()}`,...i.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){ye(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const Ee=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Ce{constructor(){this.rootNode=Ee(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=Ee({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{Ce._collapse(e)})))}}class ve extends Ce{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const i=e.root;t&&(i.scope=`language:${t}`),this.add(i)}toHTML(){return new we(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ke(e){return e?"string"==typeof e?e:e.source:null}function $e(e){return Be("(?=",e,")")}function xe(e){return Be("(?:",e,")*")}function Te(e){return Be("(?:",e,")?")}function Be(...e){return e.map((e=>ke(e))).join("")}function Se(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map((e=>ke(e))).join("|")+")"}function _e(e){return new RegExp(e.toString()+"|").exec("").length-1}const Ne=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Oe(e,{joinWith:t}){let i=0;return e.map((e=>{i+=1;const t=i;let n=ke(e),o="";for(;n.length>0;){const e=Ne.exec(n);if(!e){o+=n;break}o+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?o+="\\"+String(Number(e[1])+t):(o+=e[0],"("===e[0]&&i++)}return o})).map((e=>`(${e})`)).join(t)}const Ae="[a-zA-Z]\\w*",Ie="[a-zA-Z_]\\w*",Re="\\b\\d+(\\.\\d+)?",Le="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Me="\\b(0b[01]+)",Pe={begin:"\\\\[\\s\\S]",relevance:0},Fe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Pe]},De={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Pe]},ze=function(e,t,i={}){const n=be({scope:"comment",begin:e,end:t,contains:[]},i);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=Se("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:Be(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},He=ze("//","$"),Ve=ze("/\\*","\\*/"),We=ze("#","$"),je={scope:"number",begin:Re,relevance:0},Ue={scope:"number",begin:Le,relevance:0},qe={scope:"number",begin:Me,relevance:0},Ke={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Pe,{begin:/\[/,end:/\]/,relevance:0,contains:[Pe]}]},Ze={scope:"title",begin:Ae,relevance:0},Ge={scope:"title",begin:Ie,relevance:0},Xe={begin:"\\.\\s*"+Ie,relevance:0};var Qe=Object.freeze({__proto__:null,APOS_STRING_MODE:Fe,BACKSLASH_ESCAPE:Pe,BINARY_NUMBER_MODE:qe,BINARY_NUMBER_RE:Me,COMMENT:ze,C_BLOCK_COMMENT_MODE:Ve,C_LINE_COMMENT_MODE:He,C_NUMBER_MODE:Ue,C_NUMBER_RE:Le,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:We,IDENT_RE:Ae,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Xe,NUMBER_MODE:je,NUMBER_RE:Re,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:De,REGEXP_MODE:Ke,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Be(t,/.*\b/,e.binary,/\b.*/)),be({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:Ze,UNDERSCORE_IDENT_RE:Ie,UNDERSCORE_TITLE_MODE:Ge});function Je(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Ye(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function et(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Je,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function tt(e,t){Array.isArray(e.illegal)&&(e.illegal=Se(...e.illegal))}function it(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function nt(e,t){void 0===e.relevance&&(e.relevance=1)}const ot=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const i=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=i.keywords,e.begin=Be(i.beforeMatch,$e(i.begin)),e.starts={relevance:0,contains:[Object.assign(i,{endsParent:!0})]},e.relevance=0,delete i.beforeMatch},rt=["of","and","for","in","not","or","if","then","parent","list","value"],st="keyword";function at(e,t,i=st){const n=Object.create(null);return"string"==typeof e?o(i,e.split(" ")):Array.isArray(e)?o(i,e):Object.keys(e).forEach((function(i){Object.assign(n,at(e[i],t,i))})),n;function o(e,i){t&&(i=i.map((e=>e.toLowerCase()))),i.forEach((function(t){const i=t.split("|");n[i[0]]=[e,lt(i[0],i[1])]}))}}function lt(e,t){return t?Number(t):function(e){return rt.includes(e.toLowerCase())}(e)?0:1}const dt={},ct=e=>{console.error(e)},ht=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ut=(e,t)=>{dt[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),dt[`${e}/${t}`]=!0)},ft=new Error;function gt(e,t,{key:i}){let n=0;const o=e[i],r={},s={};for(let a=1;a<=t.length;a++)s[a+n]=o[a],r[a+n]=!0,n+=_e(t[a-1]);e[i]=s,e[i]._emit=r,e[i]._multi=!0}function mt(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ct("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ft;if("object"!=typeof e.beginScope||null===e.beginScope)throw ct("beginScope must be object"),ft;gt(e,e.begin,{key:"beginScope"}),e.begin=Oe(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ct("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ft;if("object"!=typeof e.endScope||null===e.endScope)throw ct("endScope must be object"),ft;gt(e,e.end,{key:"endScope"}),e.end=Oe(e.end,{joinWith:""})}}(e)}function pt(e){function t(t,i){return new RegExp(ke(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(i?"g":""))}class i{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=_e(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(Oe(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex(((e,t)=>t>0&&void 0!==e)),n=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,n)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new i;return this.rules.slice(e).forEach((([e,i])=>t.addRule(e,i))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=be(e.classNameAliases||{}),function i(o,r){const s=o;if(o.isCompiled)return s;[Ye,it,mt,ot].forEach((e=>e(o,r))),e.compilerExtensions.forEach((e=>e(o,r))),o.__beforeBegin=null,[et,tt,nt].forEach((e=>e(o,r))),o.isCompiled=!0;let a=null;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),a=o.keywords.$pattern,delete o.keywords.$pattern),a=a||/\w+/,o.keywords&&(o.keywords=at(o.keywords,e.case_insensitive)),s.keywordPatternRe=t(a,!0),r&&(o.begin||(o.begin=/\B|\b/),s.beginRe=t(s.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(s.endRe=t(s.end)),s.terminatorEnd=ke(s.end)||"",o.endsWithParent&&r.terminatorEnd&&(s.terminatorEnd+=(o.end?"|":"")+r.terminatorEnd)),o.illegal&&(s.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return be(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(bt(e))return be(e,{starts:e.starts?be(e.starts):null});if(Object.isFrozen(e))return be(e);return e}("self"===e?o:e)}))),o.contains.forEach((function(e){i(e,s)})),o.starts&&i(o.starts,r),s.matcher=function(e){const t=new n;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function bt(e){return!!e&&(e.endsWithParent||bt(e.starts))}class yt extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const wt=pe,Et=be,Ct=Symbol("nomatch"),vt=function(e){const t=Object.create(null),i=Object.create(null),n=[];let o=!0;const r="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ve};function l(e){return a.noHighlightRe.test(e)}function d(e,t,i){let n="",o="";"object"==typeof t?(n=e,i=t.ignoreIllegals,o=t.language):(ut("10.7.0","highlight(lang, code, ...args) has been deprecated."),ut("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,n=t),void 0===i&&(i=!0);const r={code:n,language:o};y("before:highlight",r);const s=r.result?r.result:c(r.language,r.code,i);return s.code=r.code,y("after:highlight",s),s}function c(e,i,n,s){const l=Object.create(null);function d(){if(!x.keywords)return void B.addText(S);let e=0;x.keywordPatternRe.lastIndex=0;let t=x.keywordPatternRe.exec(S),i="";for(;t;){i+=S.substring(e,t.index);const o=v.case_insensitive?t[0].toLowerCase():t[0],r=(n=o,x.keywords[n]);if(r){const[e,n]=r;if(B.addText(i),i="",l[o]=(l[o]||0)+1,l[o]<=7&&(_+=n),e.startsWith("_"))i+=t[0];else{const i=v.classNameAliases[e]||e;f(t[0],i)}}else i+=t[0];e=x.keywordPatternRe.lastIndex,t=x.keywordPatternRe.exec(S)}var n;i+=S.substring(e),B.addText(i)}function u(){null!=x.subLanguage?function(){if(""===S)return;let e=null;if("string"==typeof x.subLanguage){if(!t[x.subLanguage])return void B.addText(S);e=c(x.subLanguage,S,!0,T[x.subLanguage]),T[x.subLanguage]=e._top}else e=h(S,x.subLanguage.length?x.subLanguage:null);x.relevance>0&&(_+=e.relevance),B.__addSublanguage(e._emitter,e.language)}():d(),S=""}function f(e,t){""!==e&&(B.startScope(t),B.addText(e),B.endScope())}function g(e,t){let i=1;const n=t.length-1;for(;i<=n;){if(!e._emit[i]){i++;continue}const n=v.classNameAliases[e[i]]||e[i],o=t[i];n?f(o,n):(S=o,d(),S=""),i++}}function p(e,t){return e.scope&&"string"==typeof e.scope&&B.openNode(v.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(S,v.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),S=""):e.beginScope._multi&&(g(e.beginScope,t),S="")),x=Object.create(e,{parent:{value:x}}),x}function b(e,t,i){let n=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(e.endRe,i);if(n){if(e["on:end"]){const i=new me(e);e["on:end"](t,i),i.isMatchIgnored&&(n=!1)}if(n){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return b(e.parent,t,i)}function y(e){return 0===x.matcher.regexIndex?(S+=e[0],1):(A=!0,0)}function w(e){const t=e[0],n=i.substring(e.index),o=b(x,e,n);if(!o)return Ct;const r=x;x.endScope&&x.endScope._wrap?(u(),f(t,x.endScope._wrap)):x.endScope&&x.endScope._multi?(u(),g(x.endScope,e)):r.skip?S+=t:(r.returnEnd||r.excludeEnd||(S+=t),u(),r.excludeEnd&&(S=t));do{x.scope&&B.closeNode(),x.skip||x.subLanguage||(_+=x.relevance),x=x.parent}while(x!==o.parent);return o.starts&&p(o.starts,e),r.returnEnd?0:t.length}let E={};function C(t,r){const s=r&&r[0];if(S+=t,null==s)return u(),0;if("begin"===E.type&&"end"===r.type&&E.index===r.index&&""===s){if(S+=i.slice(r.index,r.index+1),!o){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=E.rule,t}return 1}if(E=r,"begin"===r.type)return function(e){const t=e[0],i=e.rule,n=new me(i),o=[i.__beforeBegin,i["on:begin"]];for(const r of o)if(r&&(r(e,n),n.isMatchIgnored))return y(t);return i.skip?S+=t:(i.excludeBegin&&(S+=t),u(),i.returnBegin||i.excludeBegin||(S=t)),p(i,e),i.returnBegin?0:t.length}(r);if("illegal"===r.type&&!n){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(x.scope||"<unnamed>")+'"');throw e.mode=x,e}if("end"===r.type){const e=w(r);if(e!==Ct)return e}if("illegal"===r.type&&""===s)return 1;if(O>1e5&&O>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return S+=s,s.length}const v=m(e);if(!v)throw ct(r.replace("{}",e)),new Error('Unknown language: "'+e+'"');const k=pt(v);let $="",x=s||k;const T={},B=new a.__emitter(a);!function(){const e=[];for(let t=x;t!==v;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>B.openNode(e)))}();let S="",_=0,N=0,O=0,A=!1;try{if(v.__emitTokens)v.__emitTokens(i,B);else{for(x.matcher.considerAll();;){O++,A?A=!1:x.matcher.considerAll(),x.matcher.lastIndex=N;const e=x.matcher.exec(i);if(!e)break;const t=C(i.substring(N,e.index),e);N=e.index+t}C(i.substring(N))}return B.finalize(),$=B.toHTML(),{language:e,value:$,relevance:_,illegal:!1,_emitter:B,_top:x}}catch(I){if(I.message&&I.message.includes("Illegal"))return{language:e,value:wt(i),illegal:!0,relevance:0,_illegalBy:{message:I.message,index:N,context:i.slice(N-100,N+100),mode:I.mode,resultSoFar:$},_emitter:B};if(o)return{language:e,value:wt(i),illegal:!1,relevance:0,errorRaised:I,_emitter:B,_top:x};throw I}}function h(e,i){i=i||a.languages||Object.keys(t);const n=function(e){const t={value:wt(e),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t}(e),o=i.filter(m).filter(b).map((t=>c(t,e,!1)));o.unshift(n);const r=o.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(m(e.language).supersetOf===t.language)return 1;if(m(t.language).supersetOf===e.language)return-1}return 0})),[l,d]=r,h=l;return h.secondBest=d,h}function u(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=a.languageDetectRe.exec(t);if(i){const t=m(i[1]);return t||(ht(r.replace("{}",i[1])),ht("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find((e=>l(e)||m(e)))}(e);if(l(n))return;if(y("before:highlightElement",{el:e,language:n}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML)){throw new yt("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const o=t.textContent,s=n?d(o,{language:n,ignoreIllegals:!0}):h(o);e.innerHTML=s.value,e.dataset.highlighted="yes",function(e,t,n){const o=t&&i[t]||n;e.classList.add("hljs"),e.classList.add(`language-${o}`)}(e,n,s.language),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:e,result:s,text:o})}let f=!1;function g(){if("loading"===document.readyState)return void(f=!0);document.querySelectorAll(a.cssSelector).forEach(u)}function m(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function p(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{i[e.toLowerCase()]=t}))}function b(e){const t=m(e);return t&&!t.disableAutodetect}function y(e,t){const i=e;n.forEach((function(e){e[i]&&e[i](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){f&&g()}),!1),Object.assign(e,{highlight:d,highlightAuto:h,highlightAll:g,highlightElement:u,highlightBlock:function(e){return ut("10.7.0","highlightBlock will be removed entirely in v12.0"),ut("10.7.0","Please use highlightElement now."),u(e)},configure:function(e){a=Et(a,e)},initHighlighting:()=>{g(),ut("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){g(),ut("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(i,n){let r=null;try{r=n(e)}catch(a){if(ct("Language definition for '{}' could not be registered.".replace("{}",i)),!o)throw a;ct(a),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=n.bind(null,e),r.aliases&&p(r.aliases,{languageName:i})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(i))i[t]===e&&delete i[t]},listLanguages:function(){return Object.keys(t)},getLanguage:m,registerAliases:p,autoDetection:b,inherit:Et,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),n.push(e)},removePlugin:function(e){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString="11.9.0",e.regex={concat:Be,lookahead:$e,either:Se,optional:Te,anyNumberOfTimes:xe};for(const w in Qe)"object"==typeof Qe[w]&&ge(Qe[w]);return Object.assign(e,Qe),e},kt=vt({});kt.newInstance=()=>vt({});var $t=kt;kt.HighlightJS=kt,kt.default=kt;const xt=fe($t);const Tt="[A-Za-z$_][0-9A-Za-z$_]*",Bt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],St=["true","false","null","undefined","NaN","Infinity"],_t=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Nt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ot=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],At=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],It=[].concat(Ot,_t,Nt);var Rt="[0-9](_*[0-9])*",Lt=`\\.(${Rt})`,Mt="[0-9a-fA-F](_*[0-9a-fA-F])*",Pt={className:"number",variants:[{begin:`(\\b(${Rt})((${Lt})|\\.)?|(${Lt}))[eE][+-]?(${Rt})[fFdD]?\\b`},{begin:`\\b(${Rt})((${Lt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Lt})[fFdD]?\\b`},{begin:`\\b(${Rt})[fFdD]\\b`},{begin:`\\b0[xX]((${Mt})\\.?|(${Mt})?\\.(${Mt}))[pP][+-]?(${Rt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Mt})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ft(e,t,i){return-1===i?"":e.replace(t,(n=>Ft(e,t,i-1)))}const Dt="[A-Za-z$_][0-9A-Za-z$_]*",zt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Ht=["true","false","null","undefined","NaN","Infinity"],Vt=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Wt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ut=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qt=[].concat(jt,Vt,Wt);const Kt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Zt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Gt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Xt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Qt=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();const Jt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Yt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],ei=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],ti=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ii=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),ni=ei.concat(ti);const oi=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ri=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],si=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],ai=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],li=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function di(e){return e?"string"==typeof e?e:e.source:null}function ci(e){return hi("(?=",e,")")}function hi(...e){return e.map((e=>di(e))).join("")}function ui(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map((e=>di(e))).join("|")+")"}const fi=e=>hi(/\b/,e,/\w$/.test(e)?/\b/:/\B/),gi=["Protocol","Type"].map(fi),mi=["init","self"].map(fi),pi=["Any","Self"],bi=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],yi=["false","nil","true"],wi=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ei=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Ci=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],vi=ui(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),ki=ui(vi,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),$i=hi(vi,ki,"*"),xi=ui(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Ti=ui(xi,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Bi=hi(xi,Ti,"*"),Si=hi(/[A-Z]/,Ti,"*"),_i=["attached","autoclosure",hi(/convention\(/,ui("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",hi(/objc\(/,Bi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Ni=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];xt.registerLanguage("plaintext",(function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),xt.registerLanguage("json",(function(e){const t=["true","false","null"],i={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),xt.registerLanguage("javascript",(function(e){const t=e.regex,i=Tt,n="<>",o="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const i=e[0].length+e.index,n=e.input[i];if("<"===n||","===n)return void t.ignoreMatch();let o;">"===n&&(((e,{after:t})=>{const i="</"+e[0].slice(1);return-1!==e.input.indexOf(i,t)})(e,{after:i})||t.ignoreMatch());const r=e.input.substring(i);((o=r.match(/^\s*=/))||(o=r.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},s={$pattern:Tt,keyword:Bt,literal:St,built_in:It,"variable.language":At},a="[0-9](_?[0-9])*",l=`\\.(${a})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",c={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},u={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},f={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},g={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},p={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,f,g,m,{match:/\$\d+/},c];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});const y=[].concat(p,h.contains),w=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:w},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._t,...Nt]}},k={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},$={match:t.concat(/\b/,(x=[...Ot,"super","import"],t.concat("(?!",x.join("|"),")")),i,t.lookahead(/\(/)),className:"title.function",relevance:0};var x;const T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,f,g,m,p,{match:/\$\d+/},c,v,{className:"attr",begin:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},$,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},C,B,{match:/\$[(.]/}]}})),xt.registerLanguage("java",(function(e){const t=e.regex,i="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=i+Ft("(?:<"+i+"~~~(?:\\s*,\\s*"+i+"~~~)*>)?",/~~~/g,2),o={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},r={className:"meta",begin:"@"+i,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:o,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,i),/\s+/,i,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,i],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:o,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Pt,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Pt,r]}})),xt.registerLanguage("typescript",(function(e){const t=function(e){const t=e.regex,i=Dt,n="<>",o="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const i=e[0].length+e.index,n=e.input[i];if("<"===n||","===n)return void t.ignoreMatch();let o;">"===n&&(((e,{after:t})=>{const i="</"+e[0].slice(1);return-1!==e.input.indexOf(i,t)})(e,{after:i})||t.ignoreMatch());const r=e.input.substring(i);((o=r.match(/^\s*=/))||(o=r.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},s={$pattern:Dt,keyword:zt,literal:Ht,built_in:qt,"variable.language":Ut},a="[0-9](_?[0-9])*",l=`\\.(${a})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",c={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},u={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},f={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},g={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},p={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,f,g,m,{match:/\$\d+/},c];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});const y=[].concat(p,h.contains),w=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:w},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Vt,...Wt]}},k={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},$={match:t.concat(/\b/,(x=[...jt,"super","import"],t.concat("(?!",x.join("|"),")")),i,t.lookahead(/\(/)),className:"title.function",relevance:0};var x;const T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,f,g,m,p,{match:/\$\d+/},c,v,{className:"attr",begin:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},$,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},C,B,{match:/\$[(.]/}]}}(e),i=Dt,n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},r={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[t.exports.CLASS_REFERENCE]},s={$pattern:Dt,keyword:zt.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:Ht,built_in:qt.concat(n),"variable.language":Ut},a={className:"meta",begin:"@"+i},l=(e,t,i)=>{const n=e.contains.findIndex((e=>e.label===t));if(-1===n)throw new Error("can not find mode to replace");e.contains.splice(n,1,i)};return Object.assign(t.keywords,s),t.exports.PARAMS_CONTAINS.push(a),t.contains=t.contains.concat([a,o,r]),l(t,"shebang",e.SHEBANG()),l(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),t.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t})),xt.registerLanguage("html",(function(e){const t=e.regex,i=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(o,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[n]},{begin:/'/,end:/'/,contains:[n]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,a,s,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,r,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},n,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(i,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),xt.registerLanguage("markdown",(function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},n={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},r=e.inherit(n,{contains:[]}),s=e.inherit(o,{contains:[]});n.contains.push(s),o.contains.push(r);let a=[t,i];return[n,o,r,s].forEach((e=>{e.contains=e.contains.concat(a)})),a=a.concat(n,o),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},n,o,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},i,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}})),xt.registerLanguage("css",(function(e){const t=e.regex,i=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),n=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[i.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Gt.join("|")+")"},{begin:":(:)?("+Xt.join("|")+")"}]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Qt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[i.BLOCK_COMMENT,i.HEXCOLOR,i.IMPORTANT,i.CSS_NUMBER_MODE,...n,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...n,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},i.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Zt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...n,i.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Kt.join("|")+")\\b"}]}})),xt.registerLanguage("less",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),i=ni,n="[\\w-]+",o="("+n+"|@\\{"+n+"\\})",r=[],s=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,i){return{className:e,begin:t,relevance:i}},d={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Yt.join(" ")},c={begin:"\\(",end:"\\)",contains:s,keywords:d,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,c,l("variable","@@?"+n,10),l("variable","@\\{"+n+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:n+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=s.concat({begin:/\{/,end:/\}/,contains:r}),u={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},f={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ii.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:s,relevance:0}},m={className:"variable",variants:[{begin:"@"+n+"\\s*:",relevance:15},{begin:"@"+n}],starts:{end:"[;}]",returnEnd:!0,contains:h}},p={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,l("keyword","all\\b"),l("variable","@\\{"+n+"\\}"),{begin:"\\b("+Jt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",o,0),l("selector-id","#"+o),l("selector-class","\\."+o,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+ei.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ti.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:n+`:(:)?(${i.join("|")})`,returnBegin:!0,contains:[p]};return r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,m,b,f,p,u,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:r}})),xt.registerLanguage("scss",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(e),i=ai,n=si,o="@[a-z-]+",r={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+oi.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+i.join("|")+")"},r,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+li.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,r,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ri.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},r,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}})),xt.registerLanguage("objectivec",(function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,i={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+i.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}})),xt.registerLanguage("swift",(function(e){const t={match:/\s+/,relevance:0},i=e.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[e.C_LINE_COMMENT_MODE,i],o={match:[/\./,ui(...gi,...mi)],className:{2:"keyword"}},r={match:hi(/\./,ui(...bi)),relevance:0},s=bi.filter((e=>"string"==typeof e)).concat(["_|0"]),a={variants:[{className:"keyword",match:ui(...bi.filter((e=>"string"!=typeof e)).concat(pi).map(fi),...mi)}]},l={$pattern:ui(/\b\w+/,/#\w+/),keyword:s.concat(Ei),literal:yi},d=[o,r,a],c=[{match:hi(/\./,ui(...Ci)),relevance:0},{className:"built_in",match:hi(/\b/,ui(...Ci),/(?=\()/)}],h={match:/->/,relevance:0},u=[h,{className:"operator",relevance:0,variants:[{match:$i},{match:`\\.(\\.|${ki})+`}]}],f="([0-9]_*)+",g="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${f})(\\.(${f}))?([eE][+-]?(${f}))?\\b`},{match:`\\b0x(${g})(\\.(${g}))?([pP][+-]?(${f}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},p=(e="")=>({className:"subst",variants:[{match:hi(/\\/,e,/[0\\tnr"']/)},{match:hi(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:hi(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst",label:"interpol",begin:hi(/\\/,e,/\(/),end:/\)/}),w=(e="")=>({begin:hi(e,/"""/),end:hi(/"""/,e),contains:[p(e),b(e),y(e)]}),E=(e="")=>({begin:hi(e,/"/),end:hi(/"/,e),contains:[p(e),y(e)]}),C={className:"string",variants:[w(),w("#"),w("##"),w("###"),E(),E("#"),E("##"),E("###")]},v=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],k={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:v},$=e=>{const t=hi(e,/\//),i=hi(/\//,e);return{begin:t,end:i,contains:[...v,{scope:"comment",begin:`#(?!.*${i})`,end:/$/}]}},x={scope:"regexp",variants:[$("###"),$("##"),$("#"),k]},T={match:hi(/`/,Bi,/`/)},B=[T,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${Ti}+`}],S=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Ni,contains:[...u,m,C]}]}},{scope:"keyword",match:hi(/@/,ui(..._i))},{scope:"meta",match:hi(/@/,Bi)}],_={match:ci(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:hi(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Ti,"+")},{className:"type",match:Si,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:hi(/\s+&\s+/,ci(Si)),relevance:0}]},N={begin:/</,end:/>/,keywords:l,contains:[...n,...d,...S,h,_]};_.contains.push(N);const O={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:hi(Bi,/\s*:/),keywords:"_|0",relevance:0},...n,x,...d,...c,...u,m,C,...B,...S,_]},A={begin:/</,end:/>/,keywords:"repeat each",contains:[...n,_]},I={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:ui(ci(hi(Bi,/\s*:/)),ci(hi(Bi,/\s+/,Bi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Bi}]},...n,...d,...u,m,C,...S,_,O],endsParent:!0,illegal:/["']/},R={match:[/(func|macro)/,/\s+/,ui(T.match,Bi,$i)],className:{1:"keyword",3:"title.function"},contains:[A,I,t],illegal:[/\[/,/%/]},L={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[A,I,t],illegal:/\[|%/},M={match:[/operator/,/\s+/,$i],className:{1:"keyword",3:"title"}},P={begin:[/precedencegroup/,/\s+/,Si],className:{1:"keyword",3:"title"},contains:[_],keywords:[...wi,...yi],end:/}/};for(const F of C.variants){const e=F.contains.find((e=>"interpol"===e.label));e.keywords=l;const t=[...d,...c,...u,m,C,...B];e.contains=[...t,{begin:/\(/,end:/\)/,contains:["self",...t]}]}return{name:"Swift",keywords:l,contains:[...n,R,L,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...d]},M,P,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},x,...d,...c,...u,m,C,...B,...S,_,O]}})),xt.registerLanguage("dart",(function(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},i={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},n={className:"string",variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",contains:[e.BACKSLASH_ESCAPE,t,i]},{begin:'"""',end:'"""',contains:[e.BACKSLASH_ESCAPE,t,i]},{begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,i]},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,i]}]};i.contains=[e.C_NUMBER_MODE,n];const o=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],r=o.map((e=>`${e}?`));return{name:"Dart",keywords:{keyword:["abstract","as","assert","async","await","base","break","case","catch","class","const","continue","covariant","default","deferred","do","dynamic","else","enum","export","extends","extension","external","factory","false","final","finally","for","Function","get","hide","if","implements","import","in","interface","is","late","library","mixin","new","null","on","operator","part","required","rethrow","return","sealed","set","show","static","super","switch","sync","this","throw","true","try","typedef","var","void","when","while","with","yield"],built_in:o.concat(r).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),$pattern:/[A-Za-z][A-Za-z0-9_]*\??/},contains:[n,e.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0}),e.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",end:"$",relevance:0}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},e.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}})),xt.registerLanguage("nginx",(function(e){const t=e.regex,i={className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{\w+\}/},{begin:t.concat(/[$@]/,e.UNDERSCORE_IDENT_RE)}]},n={endsWithParent:!0,keywords:{$pattern:/[a-z_]{2,}|\/dev\/poll/,literal:["on","off","yes","no","true","false","none","blocked","debug","info","notice","warn","error","crit","select","break","last","permanent","redirect","kqueue","rtsig","epoll","poll","/dev/poll"]},relevance:0,illegal:"=>",contains:[e.HASH_COMMENT_MODE,{className:"string",contains:[e.BACKSLASH_ESCAPE,i],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[i]},{className:"regexp",contains:[e.BACKSLASH_ESCAPE,i],variants:[{begin:"\\s\\^",end:"\\s|\\{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|\\{|;",returnEnd:!0},{begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number",begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{className:"number",begin:"\\b\\d+[kKmMgGdshdwy]?\\b",relevance:0},i]};return{name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{beginKeywords:"upstream location",end:/;|\{/,contains:n.contains,keywords:{section:"upstream location"}},{className:"section",begin:t.concat(e.UNDERSCORE_IDENT_RE+t.lookahead(/\s+\{/)),relevance:0},{begin:t.lookahead(e.UNDERSCORE_IDENT_RE+"\\s"),end:";|\\{",contains:[{className:"attribute",begin:e.UNDERSCORE_IDENT_RE,starts:n}],relevance:0}],illegal:"[^\\s\\}\\{]"}})),xt.registerLanguage("php",(function(e){const t=e.regex,i=/(?![A-Za-z0-9])(?![$])/,n=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,i),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,i),r={scope:"variable",match:"\\$+"+n},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",d={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),a,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},c={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},h=["false","null","true"],u=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],f=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],g={keyword:u,literal:(e=>{const t=[];return e.forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(h),built_in:f},m=e=>e.map((e=>e.replace(/\|\d+$/,""))),p={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",m(f).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},b=t.concat(n,"\\b(?!\\()"),y={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},w={scope:"attr",match:t.concat(n,t.lookahead(":"),t.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:g,contains:[w,r,y,e.C_BLOCK_COMMENT_MODE,d,c,p]},C={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",m(u).join("\\b|"),"|",m(f).join("\\b|"),"\\b)"),n,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[E]};E.contains.push(C);const v=[w,y,e.C_BLOCK_COMMENT_MODE,d,c,p];return{case_insensitive:!1,keywords:g,contains:[{begin:t.concat(/#\[\s*/,o),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:h,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:h,keyword:["new","array"]},contains:["self",...v]},...v,{scope:"meta",match:o}]},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},r,C,y,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},p,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:g,contains:["self",r,y,e.C_BLOCK_COMMENT_MODE,d,c]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},d,c]}})),xt.registerLanguage("python",(function(e){const t=e.regex,i=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},r={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,r,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,r,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",c=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,h=`\\b|${n.join("|")}`,u={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${c}))[eE][+-]?(${d})[jJ]?(?=${h})`},{begin:`(${c})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${d})[jJ](?=${h})`}]},f={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",r,u,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,u,r],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[r,u,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,f,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[u,g,l]}]}})),xt.configure({cssSelector:"pre",classPrefix:"editify-hljs-",ignoreUnescapedHTML:!0});const Oi=["plaintext","json","javascript","html","css","less","scss","java","markdown","swift","objectivec","typescript","dart","nginx","php","python"],Ai={marks:{"data-editify-list":["div"],"data-editify-value":["div"],"data-editify-code":["span"],"data-editify-task":["div"],contenteditable:"*",src:["img","video"],autoplay:["video"],loop:["video"],muted:["video"],href:["a"],target:["a"],alt:["img"],controls:["video"],name:"*",disabled:"*",colspan:["td"]},styles:{"text-indent":"*","text-align":"*"}},Ii={modelValue:{type:String,default:"<p><br></p>"},placeholder:{type:String,default:""},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},allowCopy:{type:Boolean,default:!0},allowPaste:{type:Boolean,default:!0},allowCut:{type:Boolean,default:!0},allowPasteHtml:{type:Boolean,default:!1},height:{type:String,default:"600px"},autoheight:{type:Boolean,default:!1},border:{type:Boolean,default:!1},color:{type:String,default:"#03a8f3",validator:e=>ue.common.matchingText(e,"hex")},videoRatio:{type:Number,default:16/9},toolbar:{type:Object,default:null},showWordLength:{type:Boolean,default:!1},customImagePaste:{type:Function,default:null},customVideoPaste:{type:Function,default:null},menu:{type:Object,default:null}},Ri=(e,t)=>{if(!ue.common.isObject(e)&&ue.common.isObject(t))return null;for(let i in t)ue.common.isObject(t[i])&&!Array.isArray(t[i])&&ue.common.isObject(e[i])&&!Array.isArray(e[i])?e[i]=Ri(e[i],t[i]):e[i]=t[i];return e},Li=(e,t=!1)=>"block"==e.type&&"div"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-list"]==(t?"ol":"ul"),Mi=e=>"block"==e.type&&"div"==e.parsedom&&e.hasMarks()&&e.marks.hasOwnProperty("data-editify-task"),Pi=e=>{e.marks=null,e.styles=null,e.parsedom=k.BLOCK_NODE},Fi=(e,t=!1)=>{Li(e,t)||(Pi(e),e.parsedom="div",e.hasMarks()||(e.marks={}),e.marks["data-editify-list"]=t?"ol":"ul")},Di=e=>{Mi(e)||(Pi(e),e.parsedom="div",e.hasMarks()||(e.marks={}),e.marks["data-editify-task"]="uncheck")},zi=function(e){if("ol"!=e.parsedom&&"ul"!=e.parsedom||(e.hasChildren()&&e.children.forEach(((t,i)=>{const n=t.clone();n.parsedom="div",n.type="block",n.hasMarks()||(n.marks={}),n.marks["data-editify-list"]=e.parsedom,"ol"==e.parsedom&&(n.marks["data-editify-value"]=i+1),this.addElementAfter(n,e)})),e.toEmpty()),"block"==e.type&&e.hasMarks()&&"ol"==e.marks["data-editify-list"]){const t=this.getPreviousElement(e);if(t&&t.hasMarks()&&"ol"==t.marks["data-editify-list"]){const i=Number(t.marks["data-editify-value"]);e.marks["data-editify-value"]=i+1}else e.marks["data-editify-value"]=1}},Hi=function(e){if("code"==e.parsedom){e.parsedom="span";const t={"data-editify-code":!0};e.hasMarks()?Object.assign(e.marks,t):e.marks=t}},Vi=function(e){if("img"==e.parsedom||"video"==e.parsedom||"a"==e.parsedom){const t={"data-editify-element":e.key};e.hasMarks()?Object.assign(e.marks,t):e.marks=t}if("video"==e.parsedom){const t=this.getPreviousElement(e),i=this.getNextElement(e);if(!t||t.isEmpty()){const t=k.getSpaceElement();this.addElementBefore(t,e)}if(!i||i.isEmpty()){const t=k.getSpaceElement();this.addElementAfter(t,e)}}},Wi=function(e){if("table"==e.parsedom){const t={"data-editify-element":e.key};e.hasMarks()?Object.assign(e.marks,t):e.marks=t;const i=k.flatElements(e.children),n=i.filter((e=>"tr"==e.parsedom));let o=i.find((e=>"colgroup"==e.parsedom));if(o)o.children.forEach((e=>{e.hasMarks()?e.marks.width||(e.marks.width="auto"):e.marks={width:"auto"}}));else{o=new k("inblock","colgroup",null,null,null);for(let e=(e=>{const t=(null==e?void 0:e.children)||[];let i=0;return t.forEach((e=>{if(e.hasMarks()&&e.marks.hasOwnProperty("colspan")){const t=Number(e.marks.colspan);isNaN(t)||(i+=t)}else i+=1})),i})(n[0])-1;e>=0;e--){const e=new k("closed","col",{width:"auto"},null,null);this.addElementTo(e,o)}}e.children=[];const r=new k("inblock","tbody",null,null,null);n.reverse().forEach((e=>{this.addElementTo(e,r)})),this.addElementTo(r,e),this.addElementTo(o,e)}else"th"==e.parsedom&&(e.parsedom="td")},ji=function(e,t,i){if(this.range){if(this.range.anchor.element.getBlock().isEqual(e)){const e=t.findIndex((e=>this.range.anchor.element.isEqual(e))),n=t.filter(((t,i)=>i<e)).reduce(((e,t,i)=>e+t.textContent.length),0)+this.range.anchor.offset,o=k.flatElements(i).filter((e=>e.isText()&&!e.isEmpty()));let r=0,s=0;for(;r<o.length;){let e=s+o[r].textContent.length;if(n>=s&&n<=e){this.range.anchor.element=o[r],this.range.anchor.offset=n-s;break}r++,s=e}}if(this.range.focus.element.getBlock().isEqual(e)){const e=t.findIndex((e=>this.range.focus.element.isEqual(e))),n=t.filter(((t,i)=>i<e)).reduce(((e,t,i)=>e+t.textContent.length),0)+this.range.focus.offset,o=k.flatElements(i).filter((e=>e.isText()&&!e.isEmpty()));let r=0,s=0;for(;r<o.length;){let e=s+o[r].textContent.length;if(n>=s&&n<=e){this.range.focus.element=o[r],this.range.focus.offset=n-s;break}r++,s=e}}}},Ui=function(e,t,i){if((e.isBlock()||e.isInblock())&&e.isPreStyle()){const n={"data-editify-element":e.key};if(e.hasMarks()?Object.assign(e.marks,n):e.marks=n,t&&e.hasChildren()){let t=e.marks["data-editify-hljs"]||"";t&&i&&!i.includes(t)&&(t="");const n=k.flatElements(e.children).filter((e=>e.isText()&&!e.isEmpty())),o=function(e,t){return t?xt.highlight(e,{language:t,ignoreIllegals:!0}).value:xt.highlightAuto(e).value}(n.reduce(((e,t)=>e+t.textContent),""),t);if(o){const t=this.parseHtml(o);ji.apply(this,[e,n,t]),e.children=t,t.forEach((t=>{t.parent=e}))}}}},qi=function(e,t){return{heading:[{label:e("text"),value:"p"},{label:e("h1"),value:"h1",style:{fontSize:"26px",fontWeight:"bold"}},{label:e("h2"),value:"h2",style:{fontSize:"24px",fontWeight:"bold"}},{label:e("h3"),value:"h3",style:{fontSize:"22px",fontWeight:"bold"}},{label:e("h4"),value:"h4",style:{fontSize:"20px",fontWeight:"bold"}},{label:e("h5"),value:"h5",style:{fontSize:"18px",fontWeight:"bold"}},{label:e("h6"),value:"h6",style:{fontSize:"16px",fontWeight:"bold"}}],indent:[{label:e("indentIncrease"),value:"indent-increase",icon:"indent-increase"},{label:e("indentDecrease"),value:"indent-decrease",icon:"indent-decrease"}],align:[{label:e("alignLeft"),value:"left",icon:"align-left"},{label:e("alignRight"),value:"right",icon:"align-right"},{label:e("alignCenter"),value:"center",icon:"align-center"},{label:e("alignJustify"),value:"justify",icon:"align-justify"}],fontSize:[{label:e("defaultSize"),value:""},{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"},{label:"36px",value:"36px"},{label:"40px",value:"40px"}],fontFamily:[{label:e("defaultFontFamily"),value:""},{label:"黑体",value:"黑体,黑体-简"},{label:"华文仿宋",value:"华文仿宋"},{label:"楷体",value:"楷体,楷体-简"},{label:"华文楷体",value:"华文楷体"},{label:"宋体",value:"宋体,宋体-简"},{label:"Arial",value:"Arial"},{label:"Consolas",value:"Consolas,monospace"}],lineHeight:[{label:e("defaultLineHeight"),value:""},1,1.15,1.5,2,2.5,3],foreColor:["#000000","#505050","#808080","#BBBBBB","#CCCCCC","#EEEEEE","#F7F7F7","#FFFFFF","#EC1A0A","#FF9900","#FFFF00","#07C160","#00FFFF","#0B73DE","#9C00FF","#FF00FF","#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE","#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD","#e45649","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5","#CE0000","#E79439","#EFC631","#50a14f","#4A7B8C","#03A8F3","#634AA5","#A54A7B","#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842","#630000","#7B3900","#986801","#295218","#083139","#003163","#21104A","#4A1031"],backColor:["#000000","#505050","#808080","#BBBBBB","#CCCCCC","#EEEEEE","#F7F7F7","#FFFFFF","#EC1A0A","#FF9900","#FFFF00","#07C160","#00FFFF","#0B73DE","#9C00FF","#FF00FF","#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE","#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD","#e45649","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5","#CE0000","#E79439","#EFC631","#50a14f","#4A7B8C","#03A8F3","#634AA5","#A54A7B","#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842","#630000","#7B3900","#986801","#295218","#083139","#003163","#21104A","#4A1031"]}},Ki=(e,t)=>{const i=e.__vccOpts||e;for(const[n,o]of t)i[n]=o;return i},Zi=["data-editify-placement"];const Gi={name:"Layer",emits:["update:modelValue","show","shown","hidden"],props:{modelValue:{type:Boolean,default:!1},node:{type:[String,Node],default:null},border:{type:Boolean,default:!1},borderColor:{type:String,default:null},background:{type:String,default:null},color:{type:String,default:null},placement:{type:String,default:"bottom",validator:e=>["top","bottom","top-start","top-end","bottom-start","bottom-end"].includes(e)},showTriangle:{type:Boolean,default:!1},zIndex:{type:Number,default:10},animation:{type:String,default:null,validator:e=>["translate","fade",null].includes(e)},useRange:{type:Boolean,default:!1}},setup:()=>({uid:t.getCurrentInstance().uid}),data:()=>({realPlacement:null,triangleSize:6}),components:{Triangle:Ki({name:"Triangle",props:{placement:{type:String,default:"top",validator:e=>["top","left","right","bottom"].includes(e)},color:{type:String,default:null},background:{type:String,default:null}},computed:{style(){return"top"==this.placement?{borderBottomColor:this.color?this.color:""}:"bottom"==this.placement?{borderTopColor:this.color?this.color:""}:"left"==this.placement?{borderRightColor:this.color?this.color:""}:"right"==this.placement?{borderLeftColor:this.color?this.color:""}:void 0},elStyle(){return"top"==this.placement?{borderBottomColor:this.background?this.background:""}:"bottom"==this.placement?{borderTopColor:this.background?this.background:""}:"left"==this.placement?{borderRightColor:this.background?this.background:""}:"right"==this.placement?{borderLeftColor:this.background?this.background:""}:void 0}}},[["render",function(e,i,n,o,r,s){return t.openBlock(),t.createElementBlock("div",{class:"editify-triangle",style:t.normalizeStyle(s.style),"data-editify-placement":n.placement},[t.createElementVNode("div",{class:"editify-triangle-el",style:t.normalizeStyle(s.elStyle)},null,4)],12,Zi)}],["__scopeId","data-v-70b6f344"]])},computed:{triPlacement(){return"bottom-start"==this.realPlacement||"bottom"==this.realPlacement||"bottom-end"==this.realPlacement?"top":"top-start"==this.realPlacement||"top"==this.realPlacement||"top-end"==this.realPlacement?"bottom":"left-start"==this.realPlacement||"left"==this.realPlacement||"left-end"==this.realPlacement?"right":"right-start"==this.realPlacement||"right"==this.realPlacement||"right-end"==this.realPlacement?"left":"top"},wrapStyle(){return{borderColor:this.border&&this.borderColor||"",background:this.background||"",color:this.color||""}}},mounted(){this.modelValue&&this.setPosition(),ue.event.on(window,`click.editify_layer_${this.uid}`,this.handleClick),ue.event.on(window,`resize.editify_layer_${this.uid}`,this.handleResize)},methods:{handleEnter(e){this.setPosition(),this.$emit("show",e)},handleAfterEnter(e){this.$emit("shown",e)},handleAfterLeave(e){this.$emit("hidden",e)},handleResize(){this.modelValue&&this.$emit("update:modelValue",!1)},handleClick(e){ue.element.isElement(this.$el)&&(ue.element.isContains(this.$el.offsetParent,e.target)||this.modelValue&&this.$emit("update:modelValue",!1))},setTrianglePositionByRange(){const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0).getClientRects();if(t.length){const e=t[0],i=t[t.length-1];"top"==this.realPlacement?(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"top-start"==this.realPlacement?(this.$refs.triangle.$el.style.left=(this.$refs.wrap.offsetWidth>e.width?e.width:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"top-end"==this.realPlacement?(this.$refs.triangle.$el.style.left="auto",this.$refs.triangle.$el.style.right=(this.$refs.wrap.offsetWidth>e.width?e.width:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"bottom"==this.realPlacement?(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):"bottom-start"==this.realPlacement?(this.$refs.triangle.$el.style.left=(this.$refs.wrap.offsetWidth>i.width?i.width:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):"bottom-end"==this.realPlacement?(this.$refs.triangle.$el.style.left="auto",this.$refs.triangle.$el.style.right=(this.$refs.wrap.offsetWidth>i.width?i.width:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=1-this.$refs.triangle.$el.offsetHeight+"px",this.$refs.triangle.$el.style.bottom="auto")}}},setTrianglePositionByNode(){const e=this.getNode();ue.element.isElement(e)&&("top"==this.realPlacement?(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"top-start"==this.realPlacement?(this.$refs.triangle.$el.style.left=(this.$refs.wrap.offsetWidth>e.offsetWidth?e.offsetWidth:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"top-end"==this.realPlacement?(this.$refs.triangle.$el.style.left="auto",this.$refs.triangle.$el.style.right=(this.$refs.wrap.offsetWidth>e.offsetWidth?e.offsetWidth:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.top=this.$refs.wrap.offsetHeight-1+"px",this.$refs.triangle.$el.style.bottom="auto"):"bottom"==this.realPlacement?(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):"bottom-start"==this.realPlacement?(this.$refs.triangle.$el.style.left=(this.$refs.wrap.offsetWidth>e.offsetWidth?e.offsetWidth:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):"bottom-end"==this.realPlacement?(this.$refs.triangle.$el.style.left="auto",this.$refs.triangle.$el.style.right=(this.$refs.wrap.offsetWidth>e.offsetWidth?e.offsetWidth:this.$refs.wrap.offsetWidth)/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.top="auto",this.$refs.triangle.$el.style.bottom=this.$refs.wrap.offsetHeight-1+"px"):(this.$refs.triangle.$el.style.left=this.$refs.wrap.offsetWidth/2-this.$refs.triangle.$el.offsetWidth/2+"px",this.$refs.triangle.$el.style.right="auto",this.$refs.triangle.$el.style.top=1-this.$refs.triangle.$el.offsetHeight+"px",this.$refs.triangle.$el.style.bottom="auto"))},setPositionByRange(){this.realPlacement=null;const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0).getClientRects();if(t.length){const e=t[0],i=t[t.length-1],n=ue.element.getElementBounding(this.$el.offsetParent),o=document.documentElement.clientHeight||window.innerHeight,r=document.documentElement.clientWidth||window.innerWidth;"top"==this.placement||"top-start"==this.placement||"top-end"==this.placement?e.top>=0&&e.top>=n.top&&e.top>=this.$el.offsetHeight?this.realPlacement=this.placement:o-e.bottom>=0&&o-e.bottom>=n.bottom&&o-e.bottom>=this.$el.offsetHeight&&(this.realPlacement="top"==this.placement?"bottom":"top-start"==this.placement?"bottom-start":"bottom-end"):"bottom"!=this.placement&&"bottom-start"!=this.placement&&"bottom-end"!=this.placement||(o-i.bottom>=0&&o-i.bottom>=n.bottom&&o-i.bottom>=this.$el.offsetHeight?this.realPlacement=this.placement:i.top>=0&&i.top>=n.top&&i.top>=this.$el.offsetHeight&&(this.realPlacement="bottom"==this.placement?"top":"bottom-start"==this.placement?"top-start":"top-end")),"top"==this.realPlacement?r-e.right+e.width/2<this.$el.offsetWidth/2?this.realPlacement="top-end":e.left+e.width/2<this.$el.offsetWidth/2&&(this.realPlacement="top-start"):"bottom"==this.realPlacement?r-i.right+i.width/2<this.$el.offsetWidth/2?this.realPlacement="bottom-end":i.left+i.width/2<this.$el.offsetWidth/2&&(this.realPlacement="bottom-start"):"top-start"==this.realPlacement?r-e.right+e.width<this.$el.offsetWidth&&(r-e.right+e.width/2>=this.$el.offsetWidth/2?this.realPlacement="top":this.realPlacement="top-end"):"bottom-start"==this.realPlacement?r-i.right+i.width<this.$el.offsetWidth&&(r-i.right+i.width/2>=this.$el.offsetWidth/2?this.realPlacement="bottom":this.realPlacement="bottom-end"):"top-end"==this.realPlacement?e.left+e.width<this.$el.offsetWidth&&(e.left+e.width/2>=this.$el.offsetWidth/2?this.realPlacement="top":this.realPlacement="top-start"):"bottom-end"==this.realPlacement&&i.left+i.width<this.$el.offsetWidth&&(i.left+i.width/2>=this.$el.offsetWidth/2?this.realPlacement="bottom":this.realPlacement="bottom-start"),this.$nextTick((()=>{"top"==this.realPlacement?(this.$el.style.left=e.left-n.left+e.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto",this.$el.style.top=e.top-n.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"top-start"==this.realPlacement?(this.$el.style.left=e.left-n.left+"px",this.$el.style.right="auto",this.$el.style.top=e.top-n.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"top-end"==this.realPlacement?(this.$el.style.left="auto",this.$el.style.right=r-e.right-n.right+"px",this.$el.style.top=e.top-n.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"bottom"==this.realPlacement?(this.$el.style.left=i.left-n.left+i.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto",this.$el.style.top="auto",this.$el.style.bottom=o-i.bottom-n.bottom-this.$el.offsetHeight+"px"):"bottom-start"==this.realPlacement?(this.$el.style.left=i.left-n.left+"px",this.$el.style.right="auto",this.$el.style.top="auto",this.$el.style.bottom=o-i.bottom-n.bottom-this.$el.offsetHeight+"px"):"bottom-end"==this.realPlacement?(this.$el.style.left="auto",this.$el.style.right=r-i.right-n.right+"px",this.$el.style.top="auto",this.$el.style.bottom=o-i.bottom-n.bottom-this.$el.offsetHeight+"px"):(this.$el.style.top="auto",this.$el.style.bottom=(n.bottom<0?-n.bottom:0)+"px","top"==this.placement?r-e.right+e.width/2<this.$el.offsetWidth/2?(this.$el.style.left="auto",this.$el.style.right=r-e.right-n.right+"px"):e.left+e.width/2<this.$el.offsetWidth/2?(this.$el.style.left=e.left-n.left+"px",this.$el.style.right="auto"):(this.$el.style.left=e.left-n.left+e.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):"bottom"==this.placement?r-i.right+i.width/2<this.$el.offsetWidth/2?(this.$el.style.left="auto",this.$el.style.right=r-i.right-n.right+"px"):i.left+i.width/2<this.$el.offsetWidth/2?(this.$el.style.left=i.left-n.left+"px",this.$el.style.right="auto"):(this.$el.style.left=i.left-n.left+i.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):"top-start"==this.placement?r-e.right+e.width<this.$el.offsetWidth?r-e.right+e.width/2>=this.$el.offsetWidth/2?(this.$el.style.left=e.left-n.left+e.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=r-e.right-n.right+"px"):(this.$el.style.left=e.left-n.left+"px",this.$el.style.right="auto"):"bottom-start"==this.placement?r-i.right+i.width<this.$el.offsetWidth?r-i.right+i.width/2>=this.$el.offsetWidth/2?(this.$el.style.left=i.left-n.left+i.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=r-i.right-n.right+"px"):(this.$el.style.left=i.left-n.left+"px",this.$el.style.right="auto"):"top-end"==this.placement?e.left+e.width<this.$el.offsetWidth?e.left+e.width/2>=this.$el.offsetWidth/2?(this.$el.style.left=e.left-n.left+e.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left=e.left-n.left+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=r-e.right-n.right+"px"):"bottom-end"==this.placement&&(i.left+i.width<this.$el.offsetWidth?i.left+i.width/2>=this.$el.offsetWidth/2?(this.$el.style.left=i.left-n.left+i.width/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left=i.left-n.left+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=r-i.right-n.right+"px"))),this.showTriangle&&this.setTrianglePositionByRange()}))}}},setPositionByNode(){const e=this.getNode();if(!ue.element.isElement(e))return;this.realPlacement=null;const t=ue.element.getElementBounding(e),i=ue.element.getElementBounding(this.$el.offsetParent);"top"==this.placement||"top-start"==this.placement||"top-end"==this.placement?t.top>=0&&t.top>=i.top&&t.top>=this.$el.offsetHeight?this.realPlacement=this.placement:t.bottom>=0&&t.bottom>=i.bottom&&t.bottom>=this.$el.offsetHeight&&(this.realPlacement="top"==this.placement?"bottom":"top-start"==this.placement?"bottom-start":"bottom-end"):"bottom"!=this.placement&&"bottom-start"!=this.placement&&"bottom-end"!=this.placement||(t.bottom>=0&&t.bottom>=i.bottom&&t.bottom>=this.$el.offsetHeight?this.realPlacement=this.placement:t.top>=0&&t.top>=i.top&&t.top>=this.$el.offsetHeight&&(this.realPlacement="bottom"==this.placement?"top":"bottom-start"==this.placement?"top-start":"top-end")),"top"==this.realPlacement?t.right+e.offsetWidth/2<this.$el.offsetWidth/2?this.realPlacement="top-end":t.left+e.offsetWidth/2<this.$el.offsetWidth/2&&(this.realPlacement="top-start"):"top-start"==this.realPlacement?t.right+e.offsetWidth<this.$el.offsetWidth&&(t.right+e.offsetWidth/2>=this.$el.offsetWidth/2?this.realPlacement="top":this.realPlacement="top-end"):"top-end"==this.realPlacement?t.left+e.offsetWidth<this.$el.offsetWidth&&(t.left+e.offsetWidth/2>=this.$el.offsetWidth/2?this.realPlacement="top":this.realPlacement="top-start"):"bottom"==this.realPlacement?t.right+e.offsetWidth/2<this.$el.offsetWidth/2?this.realPlacement="bottom-end":t.left+e.offsetWidth/2<this.$el.offsetWidth/2&&(this.realPlacement="bottom-start"):"bottom-start"==this.realPlacement?t.right+e.offsetWidth<this.$el.offsetWidth&&(t.right+e.offsetWidth/2>=this.$el.offsetWidth/2?this.realPlacement="bottom":this.realPlacement="bottom-end"):"bottom-end"==this.realPlacement&&t.left+e.offsetWidth<this.$el.offsetWidth&&(t.left+e.offsetWidth/2>=this.$el.offsetWidth/2?this.realPlacement="bottom":this.realPlacement="bottom-start"),this.$nextTick((()=>{"top"==this.realPlacement?(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto",this.$el.style.top=t.top-i.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"top-start"==this.realPlacement?(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto",this.$el.style.top=t.top-i.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"top-end"==this.realPlacement?(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px",this.$el.style.top=t.top-i.top-this.$el.offsetHeight+"px",this.$el.style.bottom="auto"):"bottom"==this.realPlacement?(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto",this.$el.style.top="auto",this.$el.style.bottom=t.bottom-i.bottom-this.$el.offsetHeight+"px"):"bottom-start"==this.realPlacement?(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto",this.$el.style.top="auto",this.$el.style.bottom=t.bottom-i.bottom-this.$el.offsetHeight+"px"):"bottom-end"==this.realPlacement?(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px",this.$el.style.top="auto",this.$el.style.bottom=t.bottom-i.bottom-this.$el.offsetHeight+"px"):(this.$el.style.top="auto",this.$el.style.bottom=(i.bottom<0?-i.bottom:0)+"px","top"==this.placement||"bottom"==this.placement?t.right+e.offsetWidth/2<this.$el.offsetWidth/2?(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px"):t.left+e.offsetWidth/2<this.$el.offsetWidth/2?(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto"):(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):"top-start"==this.placement||"bottom-start"==this.placement?t.right+e.offsetWidth<this.$el.offsetWidth?t.right+e.offsetWidth/2>=this.$el.offsetWidth/2?(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px"):(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto"):"top-end"!=this.placement&&"bottom-end"!=this.placement||(t.left+e.offsetWidth<this.$el.offsetWidth?t.left+e.offsetWidth/2>=this.$el.offsetWidth/2?(this.$el.style.left=t.left-i.left+e.offsetWidth/2-this.$el.offsetWidth/2+"px",this.$el.style.right="auto"):(this.$el.style.left=t.left-i.left+"px",this.$el.style.right="auto"):(this.$el.style.left="auto",this.$el.style.right=t.right-i.right+"px"))),this.showTriangle&&this.setTrianglePositionByNode()}))},setPosition(){this.useRange?this.setPositionByRange():this.setPositionByNode()},getNode(){return this.node?ue.element.isElement(this.node)?this.node:document.body.querySelector(this.node):null}},beforeUnmount(){ue.event.off(window,`click.editify_layer_${this.uid} resize.editify_layer_${this.uid}`)}},Xi=["data-editify-placement"];const Qi=Ki(Gi,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Triangle");return t.openBlock(),t.createBlock(t.Transition,{name:n.animation?"editify-layer-"+n.animation:"editify-layer",onEnter:s.handleEnter,onAfterEnter:s.handleAfterEnter,onAfterLeave:s.handleAfterLeave},{default:t.withCtx((()=>[n.modelValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:"editify-layer","data-editify-placement":r.realPlacement||null,style:t.normalizeStyle({zIndex:n.zIndex})},[n.showTriangle?(t.openBlock(),t.createBlock(a,{key:0,color:n.border&&n.borderColor?n.borderColor:n.background,background:n.background,placement:s.triPlacement,ref:"triangle"},null,8,["color","background","placement"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"wrap",class:t.normalizeClass(["editify-layer-wrap",{border:n.border}]),style:t.normalizeStyle(s.wrapStyle)},[t.renderSlot(e.$slots,"default",{},void 0,!0)],6)],12,Xi)):t.createCommentVNode("",!0)])),_:3},8,["name","onEnter","onAfterEnter","onAfterLeave"])}],["__scopeId","data-v-503cf323"]]),Ji={name:"Tooltip",props:{content:{type:String,default:""},disabled:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},data:()=>({show:!1,node:null}),components:{Layer:Qi},methods:{showContent(){this.disabled||(this.node=this.$refs.target,this.show=!0)},hideContent(){this.disabled||(this.show=!1)}}},Yi={ref:"target",class:"editify-tooltip-target"},en={class:"editify-tooltip-content"};const tn=Ki(Ji,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Layer");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-tooltip",{block:n.block}]),onMouseenter:i[1]||(i[1]=(...e)=>s.showContent&&s.showContent(...e)),onMouseleave:i[2]||(i[2]=(...e)=>s.hideContent&&s.hideContent(...e))},[t.createElementVNode("div",Yi,[t.renderSlot(e.$slots,"default",{},void 0,!0)],512),t.createVNode(a,{modelValue:r.show,"onUpdate:modelValue":i[0]||(i[0]=e=>r.show=e),node:r.node,border:"","border-color":"#000",background:"#000","show-triangle":"",color:"#fff",placement:"bottom",animation:"fade"},{default:t.withCtx((()=>[t.createElementVNode("div",en,t.toDisplayString(n.content),1)])),_:1},8,["modelValue","node"])],34)}],["__scopeId","data-v-5293a020"]]);const nn=Ki({name:"Icon",props:{value:{type:String,default:""}}},[["render",function(e,i,n,o,r,s){return t.openBlock(),t.createElementBlock("i",{class:t.normalizeClass(["editify-icon","editify-icon-"+n.value])},null,2)}],["__scopeId","data-v-5ed6cd4d"]]),on={name:"Button",emits:["operate","layerShow","layerShown","layerHidden"],props:{type:{type:String,default:"default",validator:e=>["default","select","display"].includes(e)},name:{type:String,default:""},title:{type:String,default:""},tooltip:{type:Boolean,default:!1},rightBorder:{type:Boolean,default:!1},leftBorder:{type:Boolean,default:!1},color:{type:String,default:""},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},selectConfig:{type:Object,default:null},displayConfig:{type:Object,default:null},hideScroll:{type:Boolean,default:!1}},data:()=>({layerConfig:{show:!1,node:null},status:null}),computed:{displayLabel(){const e=this.parseDisplayConfig.options.find((e=>e.value==this.parseDisplayConfig.value));return e?e.label:""},cmpOptions(){return"select"==this.type?this.parseSelectConfig.options:this.parseDisplayConfig.options},parseSelectConfig(){let e=[],t="",i="";return ue.common.isObject(this.selectConfig)&&(Array.isArray(this.selectConfig.options)&&(e=this.selectConfig.options.map((e=>ue.common.isObject(e)?{label:e.label,value:e.value,icon:e.icon,style:e.style}:{label:e,value:e}))),"number"==typeof this.selectConfig.width&&(t=this.selectConfig.width),"number"==typeof this.selectConfig.maxHeight&&(i=this.selectConfig.maxHeight)),{options:e,width:t,maxHeight:i}},parseDisplayConfig(){let e=[],t="",i="",n="";if(ue.common.isObject(this.displayConfig)){if("string"!=typeof this.displayConfig.value&&"number"!=typeof this.displayConfig.value||(n=this.displayConfig.value),Array.isArray(this.displayConfig.options)){e=this.displayConfig.options.map((e=>ue.common.isObject(e)?{label:e.label,value:e.value,icon:e.icon,style:e.style}:{label:e,value:e})),!e.find((e=>e.value==n))&&e[0]&&(n=e[0].value)}"number"==typeof this.displayConfig.width&&(t=this.displayConfig.width),"number"==typeof this.displayConfig.maxHeight&&(i=this.displayConfig.maxHeight)}return{options:e,width:t,maxHeight:i,value:n}},parseColor(){return ue.color.hex2rgb(this.color)},btnStyle(){if(this.disabled)return{};if(this.color){if(this.active||"down"==this.status)return{color:this.color,backgroundColor:`rgba(${this.parseColor[0]},${this.parseColor[1]},${this.parseColor[2]},0.15)`};if("hover"==this.status)return{color:`rgba(${this.parseColor[0]},${this.parseColor[1]},${this.parseColor[2]},0.9)`,backgroundColor:`rgba(${this.parseColor[0]},${this.parseColor[1]},${this.parseColor[2]},0.05)`}}return{}}},components:{Tooltip:tn,Layer:Qi,Icon:nn},methods:{hideLayer(){this.layerConfig.show=!1,this.layerConfig.node=null},layerShow(){this.$emit("layerShow")},layerShown(){this.$emit("layerShown")},layerHidden(){this.$emit("layerHidden")},select(e){this.disabled||(this.$emit("operate",this.name,e.value),this.hideLayer())},handleClick(){this.disabled||("default"==this.type?this.$emit("operate",this.name):this.layerConfig.show?this.hideLayer():(this.layerConfig.node=this.$refs.btn,this.layerConfig.show=!0))},handleMouseEnter(){this.status="hover"},handleMouseLeave(){this.status=null},handleMouseDown(){this.status="down"},handleMouseUp(){this.status="hover"}}},rn={class:"editify-button"},sn={key:0,class:"editify-button-slot"},an={key:1},ln={key:1,class:"editify-button-options"},dn=["onClick"],cn={key:1,class:"editify-button-option-flex"};const hn=Ki(on,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon"),l=t.resolveComponent("Tooltip"),d=t.resolveComponent("Layer");return t.openBlock(),t.createElementBlock("div",rn,[t.createElementVNode("div",{class:t.normalizeClass(["editify-button-wrap",{"right-border":n.rightBorder,"left-border":n.leftBorder}])},[t.createVNode(l,{content:n.title,disabled:!n.tooltip},{default:t.withCtx((()=>[t.createElementVNode("div",{ref:"btn",style:t.normalizeStyle(s.btnStyle),class:t.normalizeClass(["editify-button-el",{disabled:n.disabled,active:n.active}]),onMouseenter:i[0]||(i[0]=(...e)=>s.handleMouseEnter&&s.handleMouseEnter(...e)),onMouseleave:i[1]||(i[1]=(...e)=>s.handleMouseLeave&&s.handleMouseLeave(...e)),onMousedown:i[2]||(i[2]=(...e)=>s.handleMouseDown&&s.handleMouseDown(...e)),onMouseup:i[3]||(i[3]=(...e)=>s.handleMouseUp&&s.handleMouseUp(...e)),onClick:i[4]||(i[4]=(...e)=>s.handleClick&&s.handleClick(...e))},["default"==n.type||"select"==n.type?(t.openBlock(),t.createElementBlock("div",sn,[t.renderSlot(e.$slots,"default",{},void 0,!0)])):"display"==n.type?(t.openBlock(),t.createElementBlock("div",an,t.toDisplayString(s.displayLabel),1)):t.createCommentVNode("",!0),"select"==n.type||"display"==n.type?(t.openBlock(),t.createBlock(a,{key:2,value:"caret-down",class:t.normalizeClass(["editify-button-caret",{rotate:r.layerConfig.show}])},null,8,["class"])):t.createCommentVNode("",!0)],38)])),_:3},8,["content","disabled"]),t.createVNode(d,{ref:"layer",modelValue:r.layerConfig.show,"onUpdate:modelValue":i[5]||(i[5]=e=>r.layerConfig.show=e),node:r.layerConfig.node,border:"",fade:"",placement:"bottom-start","z-index":20,animation:"translate",onShow:s.layerShow,onShown:s.layerShown,onHidden:s.layerHidden},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"editify-button-layer",style:t.normalizeStyle({width:("select"==n.type?s.parseSelectConfig.width:s.parseDisplayConfig.width)+"px",maxHeight:("select"==n.type?s.parseSelectConfig.maxHeight:s.parseDisplayConfig.maxHeight)+"px",overflow:n.hideScroll?"visible":""})},[e.$slots.layer?t.renderSlot(e.$slots,"layer",{key:0,options:s.cmpOptions},void 0,!0):(t.openBlock(),t.createElementBlock("div",ln,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.cmpOptions,(i=>(t.openBlock(),t.createElementBlock("div",{onClick:e=>s.select(i),class:t.normalizeClass(["editify-button-option",{active:"display"==n.type&&i.value==s.parseDisplayConfig.value}]),style:t.normalizeStyle(i.style||"")},[e.$slots.option?t.renderSlot(e.$slots,"option",{key:0,item:i},void 0,!0):(t.openBlock(),t.createElementBlock("div",cn,[i.icon?(t.openBlock(),t.createBlock(a,{key:0,value:i.icon},null,8,["value"])):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(i.label),1)]))],14,dn)))),256))]))],4)])),_:3},8,["modelValue","node","onShow","onShown","onHidden"])],2)])}],["__scopeId","data-v-f88c4b88"]]),un={name:"Checkbox",emits:["update:modelValue","change"],props:{disabled:{type:Boolean,default:!1},modelValue:{type:[Boolean,Array],default:!1},label:{type:String,default:null},value:{type:[Object,Number,String,Array],default:""},round:{type:Boolean,default:!1},placement:{type:String,default:"right",validator:e=>["left","right"].includes(e)},color:{type:String,default:"",validator:e=>ue.common.matchingText(e,"hex")}},computed:{check(){return"boolean"==typeof this.modelValue?this.modelValue:!!Array.isArray(this.modelValue)&&this.modelValue.some((e=>ue.common.equal(e,this.value)))},itemStyle(){let e={};return this.color&&this.check&&!this.disabled&&(e.backgroundColor=this.color,e.borderColor=this.color),e}},components:{Icon:nn},methods:{change(e){if(Array.isArray(this.modelValue)){let t=[...this.modelValue];e.target.checked&&!this.check?t.push(this.value):this.check&&(t=t.filter((e=>!ue.common.equal(e,this.value)))),this.$emit("update:modelValue",t),this.$emit("change",t)}else"boolean"==typeof this.modelValue&&(this.$emit("update:modelValue",e.target.checked),this.$emit("change",e.target.checked))}}},fn=["data-editify-placement","textContent"],gn=["value","disabled","checked"],mn=["data-editify-placement","textContent"];const pn=Ki(un,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["editify-checkbox",{disabled:n.disabled}])},["left"==n.placement&&n.label?(t.openBlock(),t.createElementBlock("span",{key:0,class:"editify-checkbox-label","data-editify-placement":n.placement,textContent:t.toDisplayString(n.label)},null,8,fn)):t.createCommentVNode("",!0),t.createElementVNode("input",{onChange:i[0]||(i[0]=(...e)=>s.change&&s.change(...e)),value:n.value,disabled:n.disabled,checked:s.check,type:"checkbox"},null,40,gn),t.createElementVNode("span",{class:t.normalizeClass(["editify-checkbox-item",{reverse:!n.color,round:n.round,checked:s.check&&!n.disabled}]),style:t.normalizeStyle(s.itemStyle)},[t.createVNode(a,{value:"check",style:t.normalizeStyle({opacity:s.check?"":0})},null,8,["style"])],6),"right"==n.placement&&n.label?(t.openBlock(),t.createElementBlock("span",{key:1,class:"editify-checkbox-label","data-editify-placement":n.placement,textContent:t.toDisplayString(n.label)},null,8,mn)):t.createCommentVNode("",!0)],2)}],["__scopeId","data-v-50cd9e6c"]]),bn={name:"Colors",emits:["change"],props:{data:{type:Array,default:function(){return[]}},value:{type:String,default:null},color:{type:String,default:""},tooltip:{type:Boolean,default:!1}},data:()=>({}),inject:["$editTrans"],components:{Icon:nn,Tooltip:tn},methods:{selectColor(e){this.$emit("change",e.value)}}},yn={class:"editify-colors"},wn={class:"editify-colors-list"},En=["onClick"];const Cn=Ki(bn,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon"),l=t.resolveComponent("Tooltip");return t.openBlock(),t.createElementBlock("div",yn,[t.createElementVNode("div",{class:"editify-colors-header",onClick:i[0]||(i[0]=e=>s.selectColor({value:""}))},[t.createVNode(a,{value:"remove"}),t.createElementVNode("span",null,t.toDisplayString(s.$editTrans("defaultColor")),1)]),t.createElementVNode("div",wn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.data,(e=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-color",{active:n.value==e.value}]),style:t.normalizeStyle({borderColor:n.value==e.value?n.color:""})},[t.createVNode(l,{block:"",content:e.label,disabled:!n.tooltip},{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:t=>s.selectColor(e),class:"editify-color-el",style:t.normalizeStyle({background:e.value})},null,12,En)])),_:2},1032,["content","disabled"])],6)))),256))])])}],["__scopeId","data-v-dc6d3d68"]]),vn={name:"Toolbar",emits:["update:modelValue"],props:{modelValue:{type:Boolean,default:!1},node:{type:[String,Node],default:null},type:{type:String,default:"text",validator:e=>["text","table","link","codeBlock","image","video"].includes(e)},config:{type:Object,default:null}},data(){return{linkConfig:{url:"",newOpen:!1},videoConfig:{controls:!1,loop:!1,autoplay:!1,muted:!1},languageConfig:{show:this.config.codeBlock.languages.show,displayConfig:{options:this.config.codeBlock.languages.options,value:"",width:this.config.codeBlock.languages.width,maxHeight:this.config.codeBlock.languages.maxHeight},leftBorder:this.config.codeBlock.languages.leftBorder,rightBorder:this.config.codeBlock.languages.rightBorder,active:!1,disabled:!1},headingConfig:{show:this.config.text.heading.show,displayConfig:{options:this.config.text.heading.options,value:"",width:this.config.text.heading.width,maxHeight:this.config.text.heading.maxHeight},defaultValue:this.config.text.heading.defaultValue,leftBorder:this.config.text.heading.leftBorder,rightBorder:this.config.text.heading.rightBorder,active:!1,disabled:!1},alignConfig:{show:this.config.text.align.show,selectConfig:{options:this.config.text.align.options,width:this.config.text.align.width,maxHeight:this.config.text.align.maxHeight},leftBorder:this.config.text.align.leftBorder,rightBorder:this.config.text.align.rightBorder,active:!1,disabled:!1},orderListConfig:{show:this.config.text.orderList.show,leftBorder:this.config.text.orderList.leftBorder,rightBorder:this.config.text.orderList.rightBorder,active:!1,disabled:!1},unorderListConfig:{show:this.config.text.unorderList.show,leftBorder:this.config.text.unorderList.leftBorder,rightBorder:this.config.text.unorderList.rightBorder,active:!1,disabled:!1},taskConfig:{show:this.config.text.task.show,leftBorder:this.config.text.task.leftBorder,rightBorder:this.config.text.task.rightBorder,active:!1,disabled:!1},boldConfig:{show:this.config.text.bold.show,leftBorder:this.config.text.bold.leftBorder,rightBorder:this.config.text.bold.rightBorder,active:!1,disabled:!1},italicConfig:{show:this.config.text.italic.show,leftBorder:this.config.text.italic.leftBorder,rightBorder:this.config.text.italic.rightBorder,active:!1,disabled:!1},strikethroughConfig:{show:this.config.text.strikethrough.show,leftBorder:this.config.text.strikethrough.leftBorder,rightBorder:this.config.text.strikethrough.rightBorder,active:!1,disabled:!1},underlineConfig:{show:this.config.text.underline.show,leftBorder:this.config.text.underline.leftBorder,rightBorder:this.config.text.underline.rightBorder,active:!1,disabled:!1},codeConfig:{show:this.config.text.code.show,leftBorder:this.config.text.code.leftBorder,rightBorder:this.config.text.code.rightBorder,active:!1,disabled:!1},superConfig:{show:this.config.text.super.show,leftBorder:this.config.text.super.leftBorder,rightBorder:this.config.text.super.rightBorder,active:!1,disabled:!1},subConfig:{show:this.config.text.sub.show,leftBorder:this.config.text.sub.leftBorder,rightBorder:this.config.text.sub.rightBorder,active:!1,disabled:!1},fontSizeConfig:{show:this.config.text.fontSize.show,displayConfig:{options:this.config.text.fontSize.options,value:"",width:this.config.text.fontSize.width,maxHeight:this.config.text.fontSize.maxHeight},defaultValue:this.config.text.fontSize.defaultValue,leftBorder:this.config.text.fontSize.leftBorder,rightBorder:this.config.text.fontSize.rightBorder,active:!1,disabled:!1},fontFamilyConfig:{show:this.config.text.fontFamily.show,displayConfig:{options:this.config.text.fontFamily.options,value:"",width:this.config.text.fontFamily.width,maxHeight:this.config.text.fontFamily.maxHeight},defaultValue:this.config.text.fontFamily.defaultValue,leftBorder:this.config.text.fontFamily.leftBorder,rightBorder:this.config.text.fontFamily.rightBorder,active:!1,disabled:!1},lineHeightConfig:{show:this.config.text.lineHeight.show,displayConfig:{options:this.config.text.lineHeight.options,value:"",width:this.config.text.lineHeight.width,maxHeight:this.config.text.lineHeight.maxHeight},defaultValue:this.config.text.lineHeight.defaultValue,leftBorder:this.config.text.lineHeight.leftBorder,rightBorder:this.config.text.lineHeight.rightBorder,active:!1,disabled:!1},foreColorConfig:{show:this.config.text.foreColor.show,selectConfig:{options:this.config.text.foreColor.options},leftBorder:this.config.text.foreColor.leftBorder,rightBorder:this.config.text.foreColor.rightBorder,value:"",active:!1,disabled:!1},backColorConfig:{show:this.config.text.backColor.show,selectConfig:{options:this.config.text.backColor.options},leftBorder:this.config.text.backColor.leftBorder,rightBorder:this.config.text.backColor.rightBorder,value:"",active:!1,disabled:!1},formatClearConfig:{show:this.config.text.formatClear.show,leftBorder:this.config.text.formatClear.leftBorder,rightBorder:this.config.text.formatClear.rightBorder,active:!1,disabled:!1}}},computed:{show:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}},components:{Layer:Qi,Tooltip:tn,Button:hn,Icon:nn,Checkbox:pn,Colors:Cn},inject:["$editTrans"],methods:{clearFormat(){this.$parent.formatText()},setBackColor(e){this.$parent.setTextStyle("background-color",e),this.$refs.backColor.hideLayer()},setForeColor(e){this.$parent.setTextStyle("color",e),this.$refs.foreColor.hideLayer()},setLineHeight(e,t){this.$parent.setLineHeight(t)},setFontFamily(e,t){this.$parent.setTextStyle("font-family",t)},setFontSize(e,t){this.$parent.setTextStyle("font-size",t)},setSuperscript(){this.$parent.setTextStyle("vertical-align","super")},setSubscript(){this.$parent.setTextStyle("vertical-align","sub")},setCodeStyle(){this.$parent.setTextMark("data-editify-code",!0)},setUnderline(){this.$parent.setTextStyle("text-decoration","underline")},setStrikethrough(){this.$parent.setTextStyle("text-decoration","line-through")},setList(e){this.$parent.setList("orderList"==e)},setTask(){this.$parent.setTask()},setItalic(){this.$parent.setTextStyle("font-style","italic")},setBold(){this.$parent.setTextStyle("font-weight","bold")},setHeading(e,t){this.$parent.setHeading(t)},setAlign(e,t){this.$parent.setAlign(t)},setVideo(e){if(this.$parent.disabled)return;const t=this.$parent.getCurrentParsedomElement("video");t&&(this.videoConfig[e]?delete t.marks[e]:t.marks[e]=!0,this.videoConfig[e]=!this.videoConfig[e],this.$parent.editor.domRender(),this.$parent.editor.rangeRender())},setWidth(e){if(this.$parent.disabled)return;const t=this.$parent.getCurrentParsedomElement("img")||this.$parent.getCurrentParsedomElement("video");if(t){const i={width:e};t.hasStyles()?t.styles=Object.assign(t.styles,i):t.styles=i,this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender(),setTimeout((()=>{this.$refs.layer.setPosition()}),0)}},modifyLink(){if(this.$parent.disabled)return;if(!this.linkConfig.url)return;const e=this.$parent.getCurrentParsedomElement("a");e&&(e.marks.href=this.linkConfig.url,this.linkConfig.newOpen?e.marks.target="_blank":delete e.marks.target),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender()},handleInputFocus(e){this.$parent.disabled||this.$parent.color&&(e.currentTarget.style.borderColor=this.$parent.color)},handleInputBlur(e){this.$parent.disabled||(e.currentTarget.style.borderColor="")},selectLanguage(e,t){if(this.$parent.disabled)return;const i=this.$parent.getCurrentParsedomElement("pre");i&&(Object.assign(i.marks,{"data-editify-hljs":t}),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender())},insertParagraphWithPre(e="up"){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const t=this.$parent.getCurrentParsedomElement("pre");if(t){const i=new k("block",k.BLOCK_NODE,null,null,null),n=new k("closed","br",null,null,null);this.$parent.editor.addElementTo(n,i),"up"==e?this.$parent.editor.addElementBefore(i,t):this.$parent.editor.addElementAfter(i,t),this.$parent.editor.range.anchor.moveToEnd(i),this.$parent.editor.range.focus.moveToEnd(i),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}},insertTableColumn(e="left"){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const t=this.$parent.getCurrentParsedomElement("table"),i=this.$parent.getCurrentParsedomElement("td"),n=this.$parent.getCurrentParsedomElement("tbody");if(i&&t&&n){const o=n.children,r=i.parent.children.findIndex((e=>e.isEqual(i)));o.forEach((t=>{const n=i.clone(!1),o=new k("closed","br",null,null,null);this.$parent.editor.addElementTo(o,n),"left"==e?this.$parent.editor.addElementTo(n,t,r):this.$parent.editor.addElementTo(n,t,r+1)}));const s=t.children.find((e=>"colgroup"==e.parsedom)),a=new k("closed","col",null,null,null);if("left"==e?this.$parent.editor.addElementTo(a,s,r):this.$parent.editor.addElementTo(a,s,r+1),this.$parent.editor.formatElementStack(),"left"==e){const e=this.$parent.editor.getPreviousElement(i);this.$parent.editor.range.anchor.moveToStart(e),this.$parent.editor.range.focus.moveToStart(e)}else{const e=this.$parent.editor.getNextElement(i);this.$parent.editor.range.anchor.moveToStart(e),this.$parent.editor.range.focus.moveToStart(e)}this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}},insertTableRow(e="up"){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const t=this.$parent.getCurrentParsedomElement("table"),i=this.$parent.getCurrentParsedomElement("tr");if(t&&i){const t=i.clone();t.children.forEach((e=>{e.children=[];const t=new k("closed","br",null,null,null);this.$parent.editor.addElementTo(t,e)})),"up"==e?this.$parent.editor.addElementBefore(t,i):this.$parent.editor.addElementAfter(t,i),this.$parent.editor.formatElementStack(),this.$parent.editor.range.anchor.moveToStart(t),this.$parent.editor.range.focus.moveToStart(t),this.$parent.editor.domRender(),this.$parent.editor.rangeRender(),setTimeout((()=>{this.$refs.layer.setPosition()}),0)}},insertParagraphWithTable(e="up"){if(this.$parent.disabled)return;const t=this.$parent.getCurrentParsedomElement("table");if(t){const i=new k("block",k.BLOCK_NODE,null,null,null),n=new k("closed","br",null,null,null);this.$parent.editor.addElementTo(n,i),"up"==e?this.$parent.editor.addElementBefore(i,t):this.$parent.editor.addElementAfter(i,t),this.$parent.editor.range.anchor.moveToEnd(i),this.$parent.editor.range.focus.moveToEnd(i),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}},deleteTableRow(){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const e=this.$parent.getCurrentParsedomElement("table"),t=this.$parent.getCurrentParsedomElement("tr");if(e&&t){if(1==t.parent.children.length)return void this.$parent.deleteByParsedom("table");const e=this.$parent.editor.getPreviousElement(t),i=this.$parent.editor.getNextElement(t);t.toEmpty(),this.$parent.editor.formatElementStack(),e?(this.$parent.editor.range.anchor.moveToEnd(e.children[0]),this.$parent.editor.range.focus.moveToEnd(e.children[0])):(this.$parent.editor.range.anchor.moveToEnd(i.children[0]),this.$parent.editor.range.focus.moveToEnd(i.children[0])),this.$parent.editor.domRender(),this.$parent.editor.rangeRender(),setTimeout((()=>{this.$refs.layer.setPosition()}),0)}},deleteTableColumn(){if(this.$parent.disabled)return;this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)||(this.$parent.editor.range.anchor.element=this.$parent.editor.range.focus.element,this.$parent.editor.range.anchor.offset=this.$parent.editor.range.focus.offset);const e=this.$parent.getCurrentParsedomElement("td"),t=this.$parent.getCurrentParsedomElement("tbody"),i=this.$parent.getCurrentParsedomElement("table");if(e&&i&&t){const n=t.children;if(1==e.parent.children.length)return void this.$parent.deleteByParsedom("table");const o=this.$parent.editor.getPreviousElement(e),r=this.$parent.editor.getNextElement(e),s=e.parent.children.findIndex((t=>t.isEqual(e)));n.forEach((e=>{e.children[s].toEmpty()}));i.children.find((e=>"colgroup"==e.parsedom)).children[s].toEmpty(),this.$parent.editor.formatElementStack(),o?(this.$parent.editor.range.anchor.moveToEnd(o),this.$parent.editor.range.focus.moveToEnd(o)):(this.$parent.editor.range.anchor.moveToEnd(r),this.$parent.editor.range.focus.moveToEnd(r)),this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}},layerShow(){if("codeBlock"==this.type){const e=this.$parent.getCurrentParsedomElement("pre");e&&(this.languageConfig.displayConfig.value=e.marks["data-editify-hljs"]||"")}else if("link"==this.type){const e=this.$parent.getCurrentParsedomElement("a");e&&(this.linkConfig.url=e.marks.href,this.linkConfig.newOpen="_blank"==e.marks.target)}else if("video"==this.type){const e=this.$parent.getCurrentParsedomElement("video");e&&(this.videoConfig.autoplay=!!e.marks.autoplay,this.videoConfig.loop=!!e.marks.loop,this.videoConfig.controls=!!e.marks.controls,this.videoConfig.muted=!!e.marks.muted)}else if("text"==this.type){const e=e=>"function"==typeof this.config.extraDisabled&&this.config.extraDisabled.apply(this.$parent,[e])||!1,t=this.$parent.editor.getElementsByRange(!0,!1),i=this.headingConfig.displayConfig.options.find((e=>{let i=e;return ue.common.isObject(e)&&(i=e.value),t.every((e=>e.element.isBlock()?e.element.parsedom==i:e.element.getBlock().parsedom==i))}));this.headingConfig.displayConfig.value=i?ue.common.isObject(i)?i.value:i:this.headingConfig.defaultValue,this.headingConfig.disabled=e("heading"),this.alignConfig.disabled=e("align"),this.orderListConfig.active=this.$parent.inList(!0),this.orderListConfig.disabled=e("orderList"),this.unorderListConfig.active=this.$parent.inList(!1),this.unorderListConfig.disabled=e("unorderList"),this.taskConfig.active=this.$parent.inTask(),this.taskConfig.disabled=e("task"),this.boldConfig.active=this.$parent.queryTextStyle("font-weight","bold"),this.boldConfig.disabled=e("bold"),this.italicConfig.active=this.$parent.queryTextStyle("font-style","italic",!0),this.italicConfig.disabled=e("italic"),this.strikethroughConfig.active=this.$parent.queryTextStyle("text-decoration","line-through",!0),this.strikethroughConfig.disabled=e("strikethrough"),this.underlineConfig.active=this.$parent.queryTextStyle("text-decoration","underline",!0),this.underlineConfig.disabled=e("underline"),this.codeConfig.active=this.$parent.queryTextMark("data-editify-code"),this.codeConfig.disabled=e("code"),this.superConfig.active=this.$parent.queryTextStyle("vertical-align","super",!0),this.superConfig.disabled=e("super"),this.subConfig.active=this.$parent.queryTextStyle("vertical-align","sub",!0),this.subConfig.disabled=e("sub");const n=this.fontSizeConfig.displayConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("font-size",e.value,!0):this.$parent.queryTextStyle("font-size",e,!0)));this.fontSizeConfig.displayConfig.value=n?ue.common.isObject(n)?n.value:n:this.fontSizeConfig.defaultValue,this.fontSizeConfig.disabled=e("fontSize");const o=this.fontFamilyConfig.displayConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("font-family",e.value,!0):this.$parent.queryTextStyle("font-family",e,!0)));this.fontFamilyConfig.displayConfig.value=o?ue.common.isObject(o)?o.value:o:this.fontFamilyConfig.defaultValue,this.fontFamilyConfig.disabled=e("fontFamily");const r=this.lineHeightConfig.displayConfig.options.find((e=>{let i=e;return ue.common.isObject(e)&&(i=e.value),t.every((e=>{if(e.element.isBlock()||e.element.isInblock())return e.element.hasStyles()&&e.element.styles["line-height"]==i;const t=e.element.getBlock(),n=e.element.getInblock();return n?n.hasStyles()&&n.styles["line-height"]==i:t.hasStyles()&&t.styles["line-height"]==i}))}));this.lineHeightConfig.displayConfig.value=r?ue.common.isObject(r)?r.value:r:this.lineHeightConfig.defaultValue,this.lineHeightConfig.disabled=e("lineHeight");const s=this.foreColorConfig.selectConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("color",e.value,!0):this.$parent.queryTextStyle("color",e,!0)));this.foreColorConfig.value=s?ue.common.isObject(s)?s.value:s:"",this.foreColorConfig.disabled=e("foreColor");const a=this.backColorConfig.selectConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("background-color",e.value,!0):this.$parent.queryTextStyle("background-color",e,!0)));this.backColorConfig.value=a?ue.common.isObject(a)?a.value:a:"",this.backColorConfig.disabled=e("backColor"),this.formatClearConfig.disabled=e("formatClear")}}}},kn={key:0,class:"editify-toolbar-link"},$n={class:"editify-toolbar-link-label"},xn=["placeholder"],Tn={class:"editify-toolbar-link-footer"},Bn={class:"editify-toolbar-link-operations"},Sn=["href"];const _n=Ki(vn,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Checkbox"),l=t.resolveComponent("Button"),d=t.resolveComponent("Icon"),c=t.resolveComponent("Colors"),h=t.resolveComponent("Layer");return t.openBlock(),t.createBlock(h,{modelValue:s.show,"onUpdate:modelValue":i[23]||(i[23]=e=>s.show=e),ref:"layer",node:n.node,border:"",placement:"bottom-start",onShow:s.layerShow,useRange:"text"==n.type},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"editify-toolbar",ref:"toolbar",style:t.normalizeStyle(n.config.style)},["link"==n.type?(t.openBlock(),t.createElementBlock("div",kn,[t.createElementVNode("div",$n,t.toDisplayString(s.$editTrans("linkAddress")),1),t.withDirectives(t.createElementVNode("input",{onInput:i[0]||(i[0]=(...e)=>s.modifyLink&&s.modifyLink(...e)),onFocus:i[1]||(i[1]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e)),onBlur:i[2]||(i[2]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),placeholder:s.$editTrans("linkUrlEnterPlaceholder"),"onUpdate:modelValue":i[3]||(i[3]=e=>r.linkConfig.url=e),type:"url"},null,40,xn),[[t.vModelText,r.linkConfig.url,void 0,{trim:!0}]]),t.createElementVNode("div",Tn,[t.createVNode(a,{onChange:s.modifyLink,modelValue:r.linkConfig.newOpen,"onUpdate:modelValue":i[4]||(i[4]=e=>r.linkConfig.newOpen=e),label:s.$editTrans("newWindowOpen"),color:e.$parent.color,size:10},null,8,["onChange","modelValue","label","color"]),t.createElementVNode("div",Bn,[t.createElementVNode("span",{onClick:i[5]||(i[5]=(...t)=>e.$parent.removeLink&&e.$parent.removeLink(...t))},t.toDisplayString(s.$editTrans("removeLink")),1),t.createElementVNode("a",{href:r.linkConfig.url,target:"_blank",style:t.normalizeStyle({color:e.$parent.color})},t.toDisplayString(s.$editTrans("viewLink")),13,Sn)])])])):"image"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(l,{onOperate:i[6]||(i[6]=e=>s.setWidth("30%")),name:"set30Width",title:s.$editTrans("width30"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 30% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[7]||(i[7]=e=>s.setWidth("50%")),name:"set50Width",title:s.$editTrans("width50"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 50% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{rightBorder:"",onOperate:i[8]||(i[8]=e=>s.setWidth("100%")),name:"set100Width",title:s.$editTrans("width100"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 100% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[9]||(i[9]=t=>e.$parent.deleteByParsedom("img")),name:"deleteImage",title:s.$editTrans("deleteImage"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete"})])),_:1},8,["title","tooltip","color"])],64)):"video"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createVNode(l,{onOperate:i[10]||(i[10]=e=>s.setWidth("30%")),name:"set30Width",title:s.$editTrans("width30"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 30% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[11]||(i[11]=e=>s.setWidth("50%")),name:"set50Width",title:s.$editTrans("width50"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 50% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{rightBorder:"",onOperate:i[12]||(i[12]=e=>s.setWidth("100%")),name:"set100Width",title:s.$editTrans("width100"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createTextVNode(" 100% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:s.setVideo,name:"autoplay",title:r.videoConfig.autoplay?s.$editTrans("disabledAutoplay"):s.$editTrans("autoplay"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:r.videoConfig.autoplay?"autoplay":"stop"},null,8,["value"])])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:s.setVideo,name:"loop",title:r.videoConfig.loop?s.$editTrans("disabledLoop"):s.$editTrans("loop"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:r.videoConfig.loop?"loop":"single"},null,8,["value"])])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:s.setVideo,name:"muted",title:r.videoConfig.muted?s.$editTrans("unmuted"):s.$editTrans("muted"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:r.videoConfig.muted?"muted":"unmuted"},null,8,["value"])])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{leftBorder:"",onOperate:s.setVideo,name:"controls",title:s.$editTrans("controls"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"controls"})])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:i[13]||(i[13]=t=>e.$parent.deleteByParsedom("video")),name:"deleteVideo",title:s.$editTrans("deleteVideo"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete"})])),_:1},8,["title","tooltip","color"])],64)):"table"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createVNode(l,{onOperate:i[14]||(i[14]=e=>s.insertParagraphWithTable("up")),name:"textWrapUp",title:s.$editTrans("textWrapUp"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"text-wrap",class:"editify-icon-rotate"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[15]||(i[15]=e=>s.insertParagraphWithTable("down")),rightBorder:"",name:"textWrapDown",title:s.$editTrans("textWrapDown"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"text-wrap"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[16]||(i[16]=e=>s.insertTableRow("up")),name:"insertRowTop",title:s.$editTrans("insertRowTop"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"insert-row-top"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[17]||(i[17]=e=>s.insertTableRow("down")),name:"insertRowBottom",title:s.$editTrans("insertRowBottom"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"insert-row-bottom"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:s.deleteTableRow,rightBorder:"",name:"deleteRow",title:s.$editTrans("deleteRow"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete-row"})])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:i[18]||(i[18]=e=>s.insertTableColumn("left")),name:"insertColumnLeft",title:s.$editTrans("insertColumnLeft"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"insert-column-left"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[19]||(i[19]=e=>s.insertTableColumn("right")),name:"insertColumnRight",title:s.$editTrans("insertColumnRight"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"insert-column-right"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:s.deleteTableColumn,rightBorder:"",name:"deleteColumn",title:s.$editTrans("deleteColumn"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete-column"})])),_:1},8,["onOperate","title","tooltip","color"]),t.createVNode(l,{onOperate:i[20]||(i[20]=t=>e.$parent.deleteByParsedom("table")),name:"deleteTable",title:s.$editTrans("deleteTable"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"delete-table"})])),_:1},8,["title","tooltip","color"])],64)):t.createCommentVNode("",!0),"codeBlock"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createVNode(l,{onOperate:i[21]||(i[21]=e=>s.insertParagraphWithPre("up")),name:"textWrapUp",title:s.$editTrans("textWrapUp"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"text-wrap",class:"editify-icon-rotate"})])),_:1},8,["title","tooltip","color"]),t.createVNode(l,{onOperate:i[22]||(i[22]=e=>s.insertParagraphWithPre("down")),name:"textWrapDown",title:s.$editTrans("textWrapDown"),tooltip:n.config.tooltip,color:e.$parent.color},{default:t.withCtx((()=>[t.createVNode(d,{value:"text-wrap"})])),_:1},8,["title","tooltip","color"]),r.languageConfig.show?(t.openBlock(),t.createBlock(l,{key:0,name:"languages",type:"display",title:s.$editTrans("selectLanguages"),tooltip:n.config.tooltip,leftBorder:r.languageConfig.leftBorder,rightBorder:r.languageConfig.rightBorder,"display-config":r.languageConfig.displayConfig,color:e.$parent.color,active:r.languageConfig.active,disabled:r.languageConfig.disabled,onOperate:s.selectLanguage},null,8,["title","tooltip","leftBorder","rightBorder","display-config","color","active","disabled","onOperate"])):t.createCommentVNode("",!0)],64)):"text"==n.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[r.headingConfig.show?(t.openBlock(),t.createBlock(l,{key:0,name:"heading",type:"display",title:s.$editTrans("heading"),tooltip:n.config.tooltip,"display-config":r.headingConfig.displayConfig,leftBorder:r.headingConfig.leftBorder,rightBorder:r.headingConfig.rightBorder,color:e.$parent.color,active:r.headingConfig.active,disabled:r.headingConfig.disabled,onOperate:s.setHeading},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.alignConfig.show?(t.openBlock(),t.createBlock(l,{key:1,name:"align",type:"select",title:s.$editTrans("align"),tooltip:n.config.tooltip,"select-config":r.alignConfig.selectConfig,leftBorder:r.alignConfig.leftBorder,rightBorder:r.alignConfig.rightBorder,color:e.$parent.color,active:r.alignConfig.active,disabled:r.alignConfig.disabled,onOperate:s.setAlign},{default:t.withCtx((()=>[t.createVNode(d,{value:"align-left"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.orderListConfig.show?(t.openBlock(),t.createBlock(l,{key:2,name:"orderList",title:s.$editTrans("orderList"),tooltip:n.config.tooltip,leftBorder:r.orderListConfig.leftBorder,rightBorder:r.orderListConfig.rightBorder,color:e.$parent.color,active:r.orderListConfig.active,disabled:r.orderListConfig.disabled,onOperate:s.setList},{default:t.withCtx((()=>[t.createVNode(d,{value:"list-ordered"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.unorderListConfig.show?(t.openBlock(),t.createBlock(l,{key:3,name:"unorderList",title:s.$editTrans("unorderList"),tooltip:n.config.tooltip,leftBorder:r.unorderListConfig.leftBorder,rightBorder:r.unorderListConfig.rightBorder,color:e.$parent.color,active:r.unorderListConfig.active,disabled:r.unorderListConfig.disabled,onOperate:s.setList},{default:t.withCtx((()=>[t.createVNode(d,{value:"list-unordered"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.taskConfig.show?(t.openBlock(),t.createBlock(l,{key:4,name:"task",title:s.$editTrans("task"),tooltip:n.config.tooltip,leftBorder:r.taskConfig.leftBorder,rightBorder:r.taskConfig.rightBorder,color:e.$parent.color,active:r.taskConfig.active,disabled:r.taskConfig.disabled,onOperate:s.setTask},{default:t.withCtx((()=>[t.createVNode(d,{value:"task"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.boldConfig.show?(t.openBlock(),t.createBlock(l,{key:5,name:"bold",title:s.$editTrans("bold"),tooltip:n.config.tooltip,leftBorder:r.boldConfig.leftBorder,rightBorder:r.boldConfig.rightBorder,color:e.$parent.color,active:r.boldConfig.active,disabled:r.boldConfig.disabled,onOperate:s.setBold},{default:t.withCtx((()=>[t.createVNode(d,{value:"bold"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.italicConfig.show?(t.openBlock(),t.createBlock(l,{key:6,name:"italic",title:s.$editTrans("italic"),tooltip:n.config.tooltip,leftBorder:r.italicConfig.leftBorder,rightBorder:r.italicConfig.rightBorder,color:e.$parent.color,active:r.italicConfig.active,disabled:r.italicConfig.disabled,onOperate:s.setItalic},{default:t.withCtx((()=>[t.createVNode(d,{value:"italic"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.strikethroughConfig.show?(t.openBlock(),t.createBlock(l,{key:7,name:"strikethrough",title:s.$editTrans("strikethrough"),tooltip:n.config.tooltip,leftBorder:r.strikethroughConfig.leftBorder,rightBorder:r.strikethroughConfig.rightBorder,color:e.$parent.color,active:r.strikethroughConfig.active,disabled:r.strikethroughConfig.disabled,onOperate:s.setStrikethrough},{default:t.withCtx((()=>[t.createVNode(d,{value:"strikethrough"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.underlineConfig.show?(t.openBlock(),t.createBlock(l,{key:8,name:"underline",title:s.$editTrans("underline"),tooltip:n.config.tooltip,leftBorder:r.underlineConfig.leftBorder,rightBorder:r.underlineConfig.rightBorder,color:e.$parent.color,active:r.underlineConfig.active,disabled:r.underlineConfig.disabled,onOperate:s.setUnderline},{default:t.withCtx((()=>[t.createVNode(d,{value:"underline"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.codeConfig.show?(t.openBlock(),t.createBlock(l,{key:9,name:"code",title:s.$editTrans("code"),tooltip:n.config.tooltip,leftBorder:r.codeConfig.leftBorder,rightBorder:r.codeConfig.rightBorder,color:e.$parent.color,active:r.codeConfig.active,disabled:r.codeConfig.disabled,onOperate:s.setCodeStyle},{default:t.withCtx((()=>[t.createVNode(d,{value:"code"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.superConfig.show?(t.openBlock(),t.createBlock(l,{key:10,name:"superscript",title:s.$editTrans("superscript"),tooltip:n.config.tooltip,leftBorder:r.superConfig.leftBorder,rightBorder:r.superConfig.rightBorder,color:e.$parent.color,active:r.superConfig.active,disabled:r.superConfig.disabled,onOperate:s.setSuperscript},{default:t.withCtx((()=>[t.createVNode(d,{value:"superscript"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.subConfig.show?(t.openBlock(),t.createBlock(l,{key:11,name:"subscript",title:s.$editTrans("subscript"),tooltip:n.config.tooltip,leftBorder:r.subConfig.leftBorder,rightBorder:r.subConfig.rightBorder,color:e.$parent.color,active:r.subConfig.active,disabled:r.subConfig.disabled,onOperate:s.setSubscript},{default:t.withCtx((()=>[t.createVNode(d,{value:"subscript"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.fontSizeConfig.show?(t.openBlock(),t.createBlock(l,{key:12,name:"fontSize",type:"display",title:s.$editTrans("fontSize"),tooltip:n.config.tooltip,"display-config":r.fontSizeConfig.displayConfig,leftBorder:r.fontSizeConfig.leftBorder,rightBorder:r.fontSizeConfig.rightBorder,color:e.$parent.color,active:r.fontSizeConfig.active,disabled:r.fontSizeConfig.disabled,onOperate:s.setFontSize},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.fontFamilyConfig.show?(t.openBlock(),t.createBlock(l,{key:13,name:"fontFamily",type:"display",title:s.$editTrans("fontFamily"),tooltip:n.config.tooltip,"display-config":r.fontFamilyConfig.displayConfig,leftBorder:r.fontFamilyConfig.leftBorder,rightBorder:r.fontFamilyConfig.rightBorder,color:e.$parent.color,active:r.fontFamilyConfig.active,disabled:r.fontFamilyConfig.disabled,onOperate:s.setFontFamily},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.lineHeightConfig.show?(t.openBlock(),t.createBlock(l,{key:14,name:"lineHeight",type:"display",title:s.$editTrans("lineHeight"),tooltip:n.config.tooltip,"display-config":r.lineHeightConfig.displayConfig,leftBorder:r.lineHeightConfig.leftBorder,rightBorder:r.lineHeightConfig.rightBorder,color:e.$parent.color,active:r.lineHeightConfig.active,disabled:r.lineHeightConfig.disabled,onOperate:s.setLineHeight},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0),r.foreColorConfig.show?(t.openBlock(),t.createBlock(l,{key:15,name:"foreColor",type:"select",title:s.$editTrans("foreColor"),tooltip:n.config.tooltip,"select-config":r.foreColorConfig.selectConfig,leftBorder:r.foreColorConfig.leftBorder,rightBorder:r.foreColorConfig.rightBorder,color:e.$parent.color,active:r.foreColorConfig.active,disabled:r.foreColorConfig.disabled,hideScroll:"",ref:"foreColor"},{layer:t.withCtx((({options:i})=>[t.createVNode(c,{tooltip:n.config.tooltip,color:e.$parent.color,value:r.foreColorConfig.value,onChange:s.setForeColor,data:i},null,8,["tooltip","color","value","onChange","data"])])),default:t.withCtx((()=>[t.createVNode(d,{value:"font-color"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),r.backColorConfig.show?(t.openBlock(),t.createBlock(l,{key:16,name:"backColor",type:"select",title:s.$editTrans("backColor"),tooltip:n.config.tooltip,"select-config":r.backColorConfig.selectConfig,leftBorder:r.backColorConfig.leftBorder,rightBorder:r.backColorConfig.rightBorder,color:e.$parent.color,active:r.backColorConfig.active,disabled:r.backColorConfig.disabled,hideScroll:"",ref:"backColor"},{layer:t.withCtx((({options:i})=>[t.createVNode(c,{tooltip:n.config.tooltip,color:e.$parent.color,value:r.backColorConfig.value,onChange:s.setBackColor,data:i},null,8,["tooltip","color","value","onChange","data"])])),default:t.withCtx((()=>[t.createVNode(d,{value:"brush"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),r.formatClearConfig.show?(t.openBlock(),t.createBlock(l,{key:17,name:"formatClear",title:s.$editTrans("formatClear"),tooltip:n.config.tooltip,leftBorder:r.formatClearConfig.leftBorder,rightBorder:r.formatClearConfig.rightBorder,color:e.$parent.color,active:r.formatClearConfig.active,disabled:r.formatClearConfig.disabled,onOperate:s.clearFormat},{default:t.withCtx((()=>[t.createVNode(d,{value:"format-clear"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled","onOperate"])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],4)])),_:1},8,["modelValue","node","onShow","useRange"])}],["__scopeId","data-v-6b9cdbc6"]]),Nn={class:"editify-link"},On={class:"editify-link-label"},An=["placeholder"],In=["placeholder"],Rn={class:"editify-link-footer"},Ln={class:"editify-link-operations"};const Mn=Ki({name:"InsertLink",emits:["insert"],inject:["$editTrans"],props:{color:{type:String,default:""},text:{type:String,default:""}},data:()=>({linkUrl:"",linkText:"",newOpen:!1}),watch:{text:{immediate:!0,handler:function(e){this.linkText=e}}},components:{Checkbox:pn},methods:{handleInputFocus(e){this.color&&(e.currentTarget.style.borderColor=this.color)},handleInputBlur(e){e.currentTarget.style.borderColor=""},insertLink(){this.$emit("insert",this.linkText,this.linkUrl,this.newOpen)}}},[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Checkbox");return t.openBlock(),t.createElementBlock("div",Nn,[t.createElementVNode("div",On,t.toDisplayString(s.$editTrans("linkAddress")),1),t.withDirectives(t.createElementVNode("input",{onFocus:i[0]||(i[0]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e)),onBlur:i[1]||(i[1]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),placeholder:s.$editTrans("linkTextEnterPlaceholder"),"onUpdate:modelValue":i[2]||(i[2]=e=>r.linkText=e),type:"text"},null,40,An),[[t.vModelText,r.linkText,void 0,{trim:!0}]]),t.withDirectives(t.createElementVNode("input",{onFocus:i[3]||(i[3]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e)),onBlur:i[4]||(i[4]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),placeholder:s.$editTrans("linkUrlEnterPlaceholder"),"onUpdate:modelValue":i[5]||(i[5]=e=>r.linkUrl=e),type:"url"},null,40,In),[[t.vModelText,r.linkUrl,void 0,{trim:!0}]]),t.createElementVNode("div",Rn,[t.createVNode(a,{modelValue:r.newOpen,"onUpdate:modelValue":i[6]||(i[6]=e=>r.newOpen=e),label:s.$editTrans("newWindowOpen"),color:n.color,size:10},null,8,["modelValue","label","color"]),t.createElementVNode("div",Ln,[t.createElementVNode("span",{style:t.normalizeStyle({color:n.color}),onClick:i[7]||(i[7]=(...e)=>s.insertLink&&s.insertLink(...e))},t.toDisplayString(s.$editTrans("insertLink")),5)])])])}],["__scopeId","data-v-e6c3c2ee"]]),Pn={name:"InsertImage",emits:["change","insert"],props:{color:{type:String,default:""},accept:{type:Array,default:null},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:null},minSize:{type:Number,default:null},customUpload:{type:Function,default:null},handleError:{type:Function,default:null}},inject:["$editTrans"],data:()=>({current:"upload",remoteUrl:""}),computed:{activeStyle(){return e=>this.current==e?{color:this.color}:{}}},components:{Icon:nn},watch:{current(){this.$emit("change")}},methods:{async selectFile(e){const t=e.currentTarget,i=t.files;if(!i.length)return;let n=[];for(let o=0;o<i.length;o++){const e=i[o],t=this.getSuffix(e);this.accept.some((e=>e.toLocaleLowerCase()==t.toLocaleLowerCase()))?this.maxSize&&e.size/1024>this.maxSize?"function"==typeof this.handleError&&this.handleError.apply(this,["maxSizeError",e]):this.minSize&&e.size/1024<this.minSize?"function"==typeof this.handleError&&this.handleError.apply(this,["minSizeError",e]):n.push(e):"function"==typeof this.handleError&&this.handleError.apply(this,["suffixError",e])}if(n.length)if("function"==typeof this.customUpload)this.customUpload.apply(this,[n]);else{let e=[];for(let t=0;t<n.length;t++){const i=await ue.file.dataFileToBase64(n[t]);e.push(i)}e.forEach((e=>{this.$emit("insert",e)}))}t.value=""},getSuffix(e){const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},handleInputFocus(e){this.color&&(e.currentTarget.style.borderColor=this.color)},handleInputBlur(e){e.currentTarget.style.borderColor=""},insertRemoteImage(){this.$emit("insert",this.remoteUrl)}}},Fn={class:"editify-image"},Dn={class:"editify-image-header"},zn={key:0,class:"editify-image-remote"},Hn=["placeholder"],Vn={key:1,class:"editify-image-upload"},Wn=["multiple"];const jn=Ki(Pn,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("div",Fn,[t.createElementVNode("div",Dn,[t.createElementVNode("div",{onClick:i[0]||(i[0]=e=>r.current="upload"),class:t.normalizeClass(["editify-image-header-item",{active:"upload"==r.current}]),style:t.normalizeStyle(s.activeStyle("upload"))},t.toDisplayString(s.$editTrans("uploadImage")),7),t.createElementVNode("div",{onClick:i[1]||(i[1]=e=>r.current="remote"),class:t.normalizeClass(["editify-image-header-item",{active:"remote"==r.current}]),style:t.normalizeStyle(s.activeStyle("remote"))},t.toDisplayString(s.$editTrans("remoteImage")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-image-header-slider",r.current]),style:t.normalizeStyle({backgroundColor:n.color||""})},null,6)]),"remote"==r.current?(t.openBlock(),t.createElementBlock("div",zn,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":i[2]||(i[2]=e=>r.remoteUrl=e),placeholder:s.$editTrans("imageUrlPlaceholder"),onBlur:i[3]||(i[3]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),onFocus:i[4]||(i[4]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e))},null,40,Hn),[[t.vModelText,r.remoteUrl,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-image-remote-footer",style:t.normalizeStyle({color:n.color})},[t.createElementVNode("span",{onClick:i[5]||(i[5]=(...e)=>s.insertRemoteImage&&s.insertRemoteImage(...e))},t.toDisplayString(s.$editTrans("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",Vn,[t.createVNode(a,{value:"upload"}),t.createElementVNode("input",{multiple:n.multiple,accept:"image/*",onChange:i[6]||(i[6]=(...e)=>s.selectFile&&s.selectFile(...e)),type:"file"},null,40,Wn)]))])}],["__scopeId","data-v-d4e3209e"]]),Un={name:"InsertVideo",emits:["change","insert"],props:{color:{type:String,default:""},accept:{type:Array,default:null},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:null},minSize:{type:Number,default:null},customUpload:{type:Function,default:null},handleError:{type:Function,default:null}},inject:["$editTrans"],data:()=>({current:"upload",remoteUrl:""}),computed:{activeStyle(){return e=>this.current==e?{color:this.color}:{}}},components:{Icon:nn},watch:{current(){this.$emit("change")}},methods:{async selectFile(e){const t=e.currentTarget,i=t.files;if(!i.length)return;let n=[];for(let o=0;o<i.length;o++){const e=i[o],t=this.getSuffix(e);this.accept.some((e=>e.toLocaleLowerCase()==t.toLocaleLowerCase()))?this.maxSize&&e.size/1024>this.maxSize?"function"==typeof this.handleError&&this.handleError.apply(this,["maxSizeError",e]):this.minSize&&e.size/1024<this.minSize?"function"==typeof this.handleError&&this.handleError.apply(this,["minSizeError",e]):n.push(e):"function"==typeof this.handleError&&this.handleError.apply(this,["suffixError",e])}if(n.length)if("function"==typeof this.customUpload)this.customUpload.apply(this,[n]);else{let e=[];for(let t=0;t<n.length;t++){const i=await ue.file.dataFileToBase64(n[t]);e.push(i)}e.forEach((e=>{this.$emit("insert",e)}))}t.value=""},getSuffix(e){const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},handleInputFocus(e){this.color&&(e.currentTarget.style.borderColor=this.color)},handleInputBlur(e){e.currentTarget.style.borderColor=""},insertRemoteVideo(){this.$emit("insert",this.remoteUrl)}}},qn={class:"editify-video"},Kn={class:"editify-video-header"},Zn={key:0,class:"editify-video-remote"},Gn=["placeholder"],Xn={key:1,class:"editify-video-upload"},Qn=["multiple"];const Jn=Ki(Un,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("div",qn,[t.createElementVNode("div",Kn,[t.createElementVNode("div",{onClick:i[0]||(i[0]=e=>r.current="upload"),class:t.normalizeClass(["editify-video-header-item",{active:"upload"==r.current}]),style:t.normalizeStyle(s.activeStyle("upload"))},t.toDisplayString(s.$editTrans("uploadVideo")),7),t.createElementVNode("div",{onClick:i[1]||(i[1]=e=>r.current="remote"),class:t.normalizeClass(["editify-video-header-item",{active:"remote"==r.current}]),style:t.normalizeStyle(s.activeStyle("remote"))},t.toDisplayString(s.$editTrans("remoteVideo")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-video-header-slider",r.current]),style:t.normalizeStyle({backgroundColor:n.color||""})},null,6)]),"remote"==r.current?(t.openBlock(),t.createElementBlock("div",Zn,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":i[2]||(i[2]=e=>r.remoteUrl=e),placeholder:s.$editTrans("videoUrlPlaceholder"),onBlur:i[3]||(i[3]=(...e)=>s.handleInputBlur&&s.handleInputBlur(...e)),onFocus:i[4]||(i[4]=(...e)=>s.handleInputFocus&&s.handleInputFocus(...e))},null,40,Gn),[[t.vModelText,r.remoteUrl,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-video-remote-footer",style:t.normalizeStyle({color:n.color})},[t.createElementVNode("span",{onClick:i[5]||(i[5]=(...e)=>s.insertRemoteVideo&&s.insertRemoteVideo(...e))},t.toDisplayString(s.$editTrans("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",Xn,[t.createVNode(a,{value:"upload"}),t.createElementVNode("input",{multiple:n.multiple,accept:"video/*",onChange:i[6]||(i[6]=(...e)=>s.selectFile&&s.selectFile(...e)),type:"file"},null,40,Qn)]))])}],["__scopeId","data-v-cbc84525"]]),Yn={name:"InsertTable",emits:["insert"],inject:["$editTrans"],props:{color:{type:String,default:""},maxRows:{type:Number,default:10},maxColumns:{type:Number,default:10}},data(){return{tableGrids:this.getTableGrids()}},computed:{specification(){return this.tableGrids.flat().filter((e=>e.inside)).sort(((e,t)=>e.x>t.x&&e.y>t.y||e.x>t.x||e.y>t.y?-1:1))[0]}},methods:{createTable(e){this.$emit("insert",e.x,e.y)},changeTableSize(e){for(let t in this.tableGrids){const i=this.tableGrids[t];for(let n in i)i[n].x<=e.x&&i[n].y<=e.y?this.tableGrids[t][n].inside=!0:this.tableGrids[t][n].inside=!1}},getTableGrids(){const e=[];for(let t=1;t<=this.maxRows;t++){let i=[];for(let e=1;e<=this.maxColumns;e++)i.push({x:t,y:e,inside:!1});e.push(i)}return e}}},eo={class:"editify-table"},to=["onMouseenter","onClick"],io=[(e=>(t.pushScopeId("data-v-227ede65"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("span",null,null,-1)))],no={class:"editify-table-footer"},oo={key:0},ro={key:1};const so=Ki(Yn,[["render",function(e,i,n,o,r,s){return t.openBlock(),t.createElementBlock("div",eo,[t.createElementVNode("table",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.tableGrids,(e=>(t.openBlock(),t.createElementBlock("tr",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e,(e=>(t.openBlock(),t.createElementBlock("td",{class:t.normalizeClass({inside:e.inside}),onMouseenter:t=>s.changeTableSize(e),onClick:t=>s.createTable(e)},io,42,to)))),256))])))),256))]),t.createElementVNode("div",no,[s.specification?(t.openBlock(),t.createElementBlock("span",oo,t.toDisplayString(s.specification.x)+" x "+t.toDisplayString(s.specification.y),1)):(t.openBlock(),t.createElementBlock("span",ro,t.toDisplayString(s.$editTrans("insertTable")),1))])])}],["__scopeId","data-v-227ede65"]]),ao={name:"Menu",props:{config:{type:Object,default:null},disabled:{type:Boolean,default:!1},color:{type:String,default:""}},setup:()=>({uid:t.getCurrentInstance().uid}),data(){return{undoConfig:{show:this.config.undo.show,leftBorder:this.config.undo.leftBorder,rightBorder:this.config.undo.rightBorder,active:!1,disabled:!1},redoConfig:{show:this.config.redo.show,leftBorder:this.config.redo.leftBorder,rightBorder:this.config.redo.rightBorder,active:!1,disabled:!1},headingConfig:{show:this.config.heading.show,displayConfig:{options:this.config.heading.options,value:"",width:this.config.heading.width,maxHeight:this.config.heading.maxHeight},defaultValue:this.config.heading.defaultValue,leftBorder:this.config.heading.leftBorder,rightBorder:this.config.heading.rightBorder,active:!1,disabled:!1},indentConfig:{show:this.config.indent.show,selectConfig:{options:this.config.indent.options,value:"",width:this.config.indent.width,maxHeight:this.config.indent.maxHeight},leftBorder:this.config.indent.leftBorder,rightBorder:this.config.indent.rightBorder,active:!1,disabled:!1},quoteConfig:{show:this.config.quote.show,leftBorder:this.config.quote.leftBorder,rightBorder:this.config.quote.rightBorder,active:!1,disabled:!1},alignConfig:{show:this.config.align.show,selectConfig:{options:this.config.align.options,width:this.config.align.width,maxHeight:this.config.align.maxHeight},leftBorder:this.config.align.leftBorder,rightBorder:this.config.align.rightBorder,active:!1,disabled:!1},orderListConfig:{show:this.config.orderList.show,leftBorder:this.config.orderList.leftBorder,rightBorder:this.config.orderList.rightBorder,active:!1,disabled:!1},unorderListConfig:{show:this.config.unorderList.show,leftBorder:this.config.unorderList.leftBorder,rightBorder:this.config.unorderList.rightBorder,active:!1,disabled:!1},taskConfig:{show:this.config.task.show,leftBorder:this.config.task.leftBorder,rightBorder:this.config.task.rightBorder,active:!1,disabled:!1},boldConfig:{show:this.config.bold.show,leftBorder:this.config.bold.leftBorder,rightBorder:this.config.bold.rightBorder,active:!1,disabled:!1},underlineConfig:{show:this.config.underline.show,leftBorder:this.config.underline.leftBorder,rightBorder:this.config.underline.rightBorder,active:!1,disabled:!1},italicConfig:{show:this.config.italic.show,leftBorder:this.config.italic.leftBorder,rightBorder:this.config.italic.rightBorder,active:!1,disabled:!1},strikethroughConfig:{show:this.config.strikethrough.show,leftBorder:this.config.strikethrough.leftBorder,rightBorder:this.config.strikethrough.rightBorder,active:!1,disabled:!1},codeConfig:{show:this.config.code.show,leftBorder:this.config.code.leftBorder,rightBorder:this.config.code.rightBorder,active:!1,disabled:!1},superConfig:{show:this.config.super.show,leftBorder:this.config.super.leftBorder,rightBorder:this.config.super.rightBorder,active:!1,disabled:!1},subConfig:{show:this.config.sub.show,leftBorder:this.config.sub.leftBorder,rightBorder:this.config.sub.rightBorder,active:!1,disabled:!1},formatClearConfig:{show:this.config.formatClear.show,leftBorder:this.config.formatClear.leftBorder,rightBorder:this.config.formatClear.rightBorder,active:!1,disabled:!1},fontSizeConfig:{show:this.config.fontSize.show,displayConfig:{options:this.config.fontSize.options,value:"",width:this.config.fontSize.width,maxHeight:this.config.fontSize.maxHeight},defaultValue:this.config.fontSize.defaultValue,leftBorder:this.config.fontSize.leftBorder,rightBorder:this.config.fontSize.rightBorder,active:!1,disabled:!1},fontFamilyConfig:{show:this.config.fontFamily.show,displayConfig:{options:this.config.fontFamily.options,value:"",width:this.config.fontFamily.width,maxHeight:this.config.fontFamily.maxHeight},defaultValue:this.config.fontFamily.defaultValue,leftBorder:this.config.fontFamily.leftBorder,rightBorder:this.config.fontFamily.rightBorder,active:!1,disabled:!1},lineHeightConfig:{show:this.config.lineHeight.show,displayConfig:{options:this.config.lineHeight.options,value:"",width:this.config.lineHeight.width,maxHeight:this.config.lineHeight.maxHeight},defaultValue:this.config.lineHeight.defaultValue,leftBorder:this.config.lineHeight.leftBorder,rightBorder:this.config.lineHeight.rightBorder,active:!1,disabled:!1},foreColorConfig:{show:this.config.foreColor.show,selectConfig:{options:this.config.foreColor.options},leftBorder:this.config.foreColor.leftBorder,rightBorder:this.config.foreColor.rightBorder,value:"",active:!1,disabled:!1},backColorConfig:{show:this.config.backColor.show,selectConfig:{options:this.config.backColor.options},leftBorder:this.config.backColor.leftBorder,rightBorder:this.config.backColor.rightBorder,value:"",active:!1,disabled:!1},linkConfig:{show:this.config.link.show,leftBorder:this.config.link.leftBorder,rightBorder:this.config.link.rightBorder,active:!1,disabled:!1,text:""},imageConfig:{show:this.config.image.show,leftBorder:this.config.image.leftBorder,rightBorder:this.config.image.rightBorder,active:!1,disabled:!1,accept:this.config.image.accept,multiple:this.config.image.multiple,maxSize:this.config.image.maxSize,minSize:this.config.image.minSize,handleError:this.config.image.handleError,customUpload:this.config.image.customUpload},videoConfig:{show:this.config.video.show,leftBorder:this.config.video.leftBorder,rightBorder:this.config.video.rightBorder,active:!1,disabled:!1,accept:this.config.video.accept,multiple:this.config.video.multiple,maxSize:this.config.video.maxSize,minSize:this.config.video.minSize,handleError:this.config.video.handleError,customUpload:this.config.video.customUpload},tableConfig:{show:this.config.table.show,leftBorder:this.config.table.leftBorder,rightBorder:this.config.table.rightBorder,active:!1,disabled:!1,maxRows:this.config.table.maxRows,maxColumns:this.config.table.maxColumns},codeBlockConfig:{show:this.config.codeBlock.show,leftBorder:this.config.codeBlock.leftBorder,rightBorder:this.config.codeBlock.rightBorder,active:!1,disabled:!1},sourceViewConfig:{show:this.config.sourceView.show,leftBorder:this.config.sourceView.leftBorder,rightBorder:this.config.sourceView.rightBorder,active:!1,disabled:!1}}},computed:{menuNames(){return Object.keys(this.config.sequence).sort(((e,t)=>this.config.sequence[e]>this.config.sequence[t]?1:-1))},menuDisabled(){return e=>"sourceView"!=e&&this.$parent.isSourceView}},components:{MenuItem:{props:{name:String,disabled:Boolean},inject:["$editTrans"],render:function(){const e={tooltip:this.$parent.config.tooltip,name:this.name};if("undo"==this.name&&this.$parent.undoConfig.show)return t.h(hn,{...e,title:this.$editTrans("undo"),leftBorder:this.$parent.undoConfig.leftBorder,rightBorder:this.$parent.undoConfig.rightBorder,disabled:this.$parent.undoConfig.disabled||this.disabled||this.$parent.disabled,color:this.$parent.color,active:this.$parent.undoConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"undo"})));if("redo"==this.name&&this.$parent.redoConfig.show)return t.h(hn,{...e,title:this.$editTrans("redo"),leftBorder:this.$parent.redoConfig.leftBorder,rightBorder:this.$parent.redoConfig.rightBorder,disabled:this.$parent.redoConfig.disabled||this.disabled||this.$parent.disabled,color:this.$parent.color,active:this.$parent.redoConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"redo"})));if("heading"==this.name&&this.$parent.headingConfig.show)return t.h(hn,{...e,type:"display",displayConfig:this.$parent.headingConfig.displayConfig,title:this.$editTrans("heading"),leftBorder:this.$parent.headingConfig.leftBorder,rightBorder:this.$parent.headingConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.headingConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.headingConfig.active,onOperate:this.$parent.handleOperate});if("indent"==this.name&&this.$parent.indentConfig.show)return t.h(hn,{...e,type:"select",selectConfig:this.$parent.indentConfig.selectConfig,title:this.$editTrans("indent"),leftBorder:this.$parent.indentConfig.leftBorder,rightBorder:this.$parent.indentConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.indentConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.indentConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"indent-increase"})));if("quote"==this.name&&this.$parent.quoteConfig.show)return t.h(hn,{...e,title:this.$editTrans("quote"),leftBorder:this.$parent.quoteConfig.leftBorder,rightBorder:this.$parent.quoteConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.quoteConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.quoteConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"quote"})));if("align"==this.name&&this.$parent.alignConfig.show)return t.h(hn,{...e,type:"select",selectConfig:this.$parent.alignConfig.selectConfig,title:this.$editTrans("align"),leftBorder:this.$parent.alignConfig.leftBorder,rightBorder:this.$parent.alignConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.alignConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.alignConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"align-left"})));if("orderList"==this.name&&this.$parent.orderListConfig.show)return t.h(hn,{...e,title:this.$editTrans("orderList"),leftBorder:this.$parent.orderListConfig.leftBorder,rightBorder:this.$parent.orderListConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.orderListConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.orderListConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"list-ordered"})));if("unorderList"==this.name&&this.$parent.unorderListConfig.show)return t.h(hn,{...e,title:this.$editTrans("unorderList"),leftBorder:this.$parent.unorderListConfig.leftBorder,rightBorder:this.$parent.unorderListConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.unorderListConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.unorderListConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"list-unordered"})));if("task"==this.name&&this.$parent.taskConfig.show)return t.h(hn,{...e,title:this.$editTrans("task"),leftBorder:this.$parent.taskConfig.leftBorder,rightBorder:this.$parent.taskConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.taskConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.taskConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"task"})));if("bold"==this.name&&this.$parent.boldConfig.show)return t.h(hn,{...e,title:this.$editTrans("bold"),leftBorder:this.$parent.boldConfig.leftBorder,rightBorder:this.$parent.boldConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.boldConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.boldConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"bold"})));if("underline"==this.name&&this.$parent.underlineConfig.show)return t.h(hn,{...e,title:this.$editTrans("underline"),leftBorder:this.$parent.underlineConfig.leftBorder,rightBorder:this.$parent.underlineConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.underlineConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.underlineConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"underline"})));if("italic"==this.name&&this.$parent.italicConfig.show)return t.h(hn,{...e,title:this.$editTrans("italic"),leftBorder:this.$parent.italicConfig.leftBorder,rightBorder:this.$parent.italicConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.italicConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.italicConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"italic"})));if("strikethrough"==this.name&&this.$parent.strikethroughConfig.show)return t.h(hn,{...e,title:this.$editTrans("strikethrough"),leftBorder:this.$parent.strikethroughConfig.leftBorder,rightBorder:this.$parent.strikethroughConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.strikethroughConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.strikethroughConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"strikethrough"})));if("code"==this.name&&this.$parent.codeConfig.show)return t.h(hn,{...e,title:this.$editTrans("code"),leftBorder:this.$parent.codeConfig.leftBorder,rightBorder:this.$parent.codeConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.codeConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.codeConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"code"})));if("super"==this.name&&this.$parent.superConfig.show)return t.h(hn,{...e,title:this.$editTrans("superscript"),leftBorder:this.$parent.superConfig.leftBorder,rightBorder:this.$parent.superConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.superConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.superConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"superscript"})));if("sub"==this.name&&this.$parent.subConfig.show)return t.h(hn,{...e,title:this.$editTrans("subscript"),leftBorder:this.$parent.subConfig.leftBorder,rightBorder:this.$parent.subConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.subConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.subConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"subscript"})));if("formatClear"==this.name&&this.$parent.formatClearConfig.show)return t.h(hn,{...e,title:this.$editTrans("formatClear"),leftBorder:this.$parent.formatClearConfig.leftBorder,rightBorder:this.$parent.formatClearConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.formatClearConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.formatClearConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"format-clear"})));if("fontSize"==this.name&&this.$parent.fontSizeConfig.show)return t.h(hn,{...e,type:"display",displayConfig:this.$parent.fontSizeConfig.displayConfig,title:this.$editTrans("fontSize"),leftBorder:this.$parent.fontSizeConfig.leftBorder,rightBorder:this.$parent.fontSizeConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.fontSizeConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.fontSizeConfig.active,onOperate:this.$parent.handleOperate});if("fontFamily"==this.name&&this.$parent.fontFamilyConfig.show)return t.h(hn,{...e,type:"display",displayConfig:this.$parent.fontFamilyConfig.displayConfig,title:this.$editTrans("fontFamily"),leftBorder:this.$parent.fontFamilyConfig.leftBorder,rightBorder:this.$parent.fontFamilyConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.fontFamilyConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.fontFamilyConfig.active,onOperate:this.$parent.handleOperate});if("lineHeight"==this.name&&this.$parent.lineHeightConfig.show)return t.h(hn,{...e,type:"display",displayConfig:this.$parent.lineHeightConfig.displayConfig,title:this.$editTrans("lineHeight"),leftBorder:this.$parent.lineHeightConfig.leftBorder,rightBorder:this.$parent.lineHeightConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.lineHeightConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.lineHeightConfig.active,onOperate:this.$parent.handleOperate});if("foreColor"==this.name&&this.$parent.foreColorConfig.show)return t.h(hn,{...e,ref:"btn",type:"select",selectConfig:this.$parent.foreColorConfig.selectConfig,title:this.$editTrans("foreColor"),leftBorder:this.$parent.foreColorConfig.leftBorder,rightBorder:this.$parent.foreColorConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.foreColorConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.foreColorConfig.active,hideScroll:!0},{default:()=>t.h(nn,{value:"font-color"}),layer:e=>t.h(Cn,{tooltip:this.$parent.config.tooltip,value:this.$parent.foreColorConfig.value,data:e.options,color:this.$parent.color,onChange:e=>{this.$parent.handleOperate.apply(this.$parent,["foreColor",e]),this.$refs.btn.hideLayer()}})});if("backColor"==this.name&&this.$parent.backColorConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",selectConfig:this.$parent.backColorConfig.selectConfig,title:this.$editTrans("backColor"),leftBorder:this.$parent.backColorConfig.leftBorder,rightBorder:this.$parent.backColorConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.backColorConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.backColorConfig.active,onOperate:this.$parent.handleOperate,hideScroll:!0},{default:()=>t.h(nn,{value:"brush"}),layer:e=>t.h(Cn,{tooltip:this.$parent.config.tooltip,value:this.$parent.backColorConfig.value,data:e.options,color:this.$parent.color,onChange:e=>{this.$parent.handleOperate.apply(this.$parent,["backColor",e]),this.$refs.btn.hideLayer()}})});if("link"==this.name&&this.$parent.linkConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",title:this.$editTrans("insertLink"),leftBorder:this.$parent.linkConfig.leftBorder,rightBorder:this.$parent.linkConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.linkConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.linkConfig.active,hideScroll:!0,onLayerShow:()=>{let e="";this.$parent.$parent.editor.getElementsByRange(!0,!0).forEach((t=>{t.element.isText()&&(t.offset?e+=t.element.textContent.substring(t.offset[0],t.offset[1]):e+=t.element.textContent||"")})),this.$parent.linkConfig.text=e}},{default:()=>t.h(nn,{value:"link"}),layer:()=>t.h(Mn,{color:this.$parent.color,text:this.$parent.linkConfig.text,onInsert:(e,t,i)=>{this.$parent.handleOperate.apply(this.$parent,["link",{text:e,url:t,newOpen:i}]),this.$refs.btn.hideLayer()}})});if("image"==this.name&&this.$parent.imageConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",title:this.$editTrans("insertImage"),leftBorder:this.$parent.imageConfig.leftBorder,rightBorder:this.$parent.imageConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.imageConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.imageConfig.active,hideScroll:!0},{default:()=>t.h(nn,{value:"image"}),layer:()=>t.h(jn,{color:this.$parent.color,accept:this.$parent.imageConfig.accept,multiple:this.$parent.imageConfig.multiple,maxSize:this.$parent.imageConfig.maxSize,minSize:this.$parent.imageConfig.minSize,customUpload:this.$parent.imageConfig.customUpload,handleError:this.$parent.imageConfig.handleError,onChange:()=>{this.$refs.btn.$refs.layer.setPosition()},onInsert:e=>{this.$parent.handleOperate.apply(this.$parent,["image",e]),this.$refs.btn.hideLayer()}})});if("video"==this.name&&this.$parent.videoConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",title:this.$editTrans("insertVideo"),leftBorder:this.$parent.videoConfig.leftBorder,rightBorder:this.$parent.videoConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.videoConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.videoConfig.active,hideScroll:!0},{default:()=>t.h(nn,{value:"video"}),layer:()=>t.h(Jn,{color:this.$parent.color,accept:this.$parent.videoConfig.accept,multiple:this.$parent.videoConfig.multiple,maxSize:this.$parent.videoConfig.maxSize,minSize:this.$parent.videoConfig.minSize,customUpload:this.$parent.videoConfig.customUpload,handleError:this.$parent.videoConfig.handleError,onChange:()=>{this.$refs.btn.$refs.layer.setPosition()},onInsert:e=>{this.$parent.handleOperate.apply(this.$parent,["video",e]),this.$refs.btn.hideLayer()}})});if("table"==this.name&&this.$parent.tableConfig.show)return t.h(hn,{...e,type:"select",ref:"btn",title:this.$editTrans("insertTable"),leftBorder:this.$parent.tableConfig.leftBorder,rightBorder:this.$parent.tableConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.tableConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.tableConfig.active,hideScroll:!0},{default:()=>t.h(nn,{value:"table"}),layer:()=>t.h(so,{color:this.$parent.color,maxRows:this.$parent.tableConfig.maxRows,maxColumns:this.$parent.tableConfig.maxColumns,onInsert:(e,t)=>{this.$parent.handleOperate.apply(this.$parent,["table",{row:e,column:t}]),this.$refs.btn.hideLayer()}})});if("codeBlock"==this.name&&this.$parent.codeBlockConfig.show)return t.h(hn,{...e,title:this.$editTrans("inserCodeBlock"),leftBorder:this.$parent.codeBlockConfig.leftBorder,rightBorder:this.$parent.codeBlockConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.codeBlockConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.codeBlockConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"code-block"})));if("sourceView"==this.name&&this.$parent.sourceViewConfig.show)return t.h(hn,{...e,title:this.$editTrans("sourceView"),leftBorder:this.$parent.sourceViewConfig.leftBorder,rightBorder:this.$parent.sourceViewConfig.rightBorder,color:this.$parent.color,disabled:this.$parent.sourceViewConfig.disabled||this.disabled||this.$parent.disabled,active:this.$parent.sourceViewConfig.active,onOperate:this.$parent.handleOperate},(()=>t.h(nn,{value:"source-view"})));if(ue.common.isObject(this.$parent.config.extends)){const i=this.$parent.config.extends[this.name];if(i)return t.h(hn,{...e,ref:"btn",type:i.type||"default",title:i.title||"",leftBorder:i.leftBorder||!1,rightBorder:i.rightBorder||!1,disabled:i.disabled||this.disabled||this.$parent.disabled,hideScroll:i.hideScroll||!1,active:i.active||!1,selectConfig:{width:i.width,maxHeight:i.maxHeight,options:i.options},displayConfig:{width:i.width,maxHeight:i.maxHeight,value:i.value,options:i.options},color:this.$parent.color,onLayerShow:()=>{"function"==typeof i.onLayerShow&&i.onLayerShow.apply(this.$parent.$parent,[this.name,this.$refs.btn])},onLayerShown:()=>{"function"==typeof i.onLayerShown&&i.onLayerShown.apply(this.$parent.$parent,[this.name,this.$refs.btn])},onLayerHidden:()=>{"function"==typeof i.onLayerHidden&&i.onLayerHidden.apply(this.$parent.$parent,[this.name,this.$refs.btn])},onOperate:(e,t)=>{"function"==typeof i.onOperate&&i.onOperate.apply(this.$parent.$parent,[e,t,this.$refs.btn])}},{default:i.default||null,layer:i.layer||null,option:i.option||null})}return null}}},methods:{handleOperate(e,t){if(!this.disabled)if("undo"==e)this.$parent.undo();else if("redo"==e)this.$parent.redo();else if("heading"==e)this.$parent.setHeading(t);else if("indent"==e)"indent-increase"==t?this.$parent.setIndentIncrease():"indent-decrease"==t&&this.$parent.setIndentDecrease();else if("quote"==e)this.$parent.setQuote();else if("align"==e)this.$parent.setAlign(t);else if("orderList"==e)this.$parent.setList(!0);else if("unorderList"==e)this.$parent.setList(!1);else if("task"==e)this.$parent.setTask();else if("bold"==e)this.$parent.setTextStyle("font-weight","bold");else if("underline"==e)this.$parent.setTextStyle("text-decoration","underline");else if("italic"==e)this.$parent.setTextStyle("font-style","italic");else if("strikethrough"==e)this.$parent.setTextStyle("text-decoration","line-through");else if("code"==e)this.$parent.setTextMark("data-editify-code",!0);else if("super"==e)this.$parent.setTextStyle("vertical-align","super");else if("sub"==e)this.$parent.setTextStyle("vertical-align","sub");else if("formatClear"==e)this.$parent.formatText();else if("fontSize"==e)this.$parent.setTextStyle("font-size",t);else if("fontFamily"==e)this.$parent.setTextStyle("font-family",t);else if("lineHeight"==e)this.$parent.setLineHeight(t);else if("foreColor"==e)this.$parent.setTextStyle("color",t);else if("backColor"==e)this.$parent.setTextStyle("background-color",t);else if("link"==e){if(!t.url)return;t.text||(text=url);const e={href:t.url};t.newOpen&&(e.target="_blank");const i=new k("inline","a",e,null,null),n=new k("text",null,null,null,t.text);this.$parent.editor.addElementTo(n,i),this.$parent.editor.insertElement(i),this.$parent.editor.formatElementStack(),this.$parent.editor.domRender(),this.$parent.editor.rangeRender()}else if("image"==e){if(!t)return;this.$parent.insertImage(t)}else if("video"==e){if(!t)return;this.$parent.insertVideo(t)}else"table"==e?this.$parent.insertTable(t.row,t.column):"codeBlock"==e?this.$parent.insertCodeBlock():"sourceView"==e&&(this.$parent.isSourceView=!this.$parent.isSourceView,this.sourceViewConfig.active=this.$parent.isSourceView,this.$parent.isSourceView||this.$parent.editor.rangeRender())},handleRangeUpdate(){if(this.disabled)return;const e=this.$parent.editor.getElementsByRange(!0,!1),t=this.$parent.hasPreStyle(),i=this.$parent.hasTable(),n=this.$parent.hasQuote(),o=this.$parent.inQuote(),r=this.$parent.hasLink(),s=this.$parent.inList(!0),a=this.$parent.inList(!1),l=this.$parent.inTask(),d=e=>"function"==typeof this.config.extraDisabled&&this.config.extraDisabled.apply(this.$parent,[e])||!1;this.undoConfig.disabled=!this.$parent.editor.history.get(-1)||d("undo"),this.redoConfig.disabled=!this.$parent.editor.history.get(1)||d("redo");const c=this.headingConfig.displayConfig.options.find((t=>{let i=t;return ue.common.isObject(t)&&(i=t.value),this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)?this.$parent.editor.range.anchor.element.getBlock().parsedom==i:e.every((e=>e.element.isBlock()?e.element.parsedom==i:e.element.getBlock().parsedom==i))}));this.headingConfig.displayConfig.value=c?ue.common.isObject(c)?c.value:c:this.headingConfig.defaultValue,this.headingConfig.disabled=t||i||d("heading"),this.indentConfig.disabled=t||i||n||d("indent"),this.quoteConfig.active=o,this.quoteConfig.disabled=t||i||d("quote"),this.alignConfig.disabled=t||d("align"),this.orderListConfig.active=s,this.orderListConfig.disabled=t||i||d("orderList"),this.unorderListConfig.active=a,this.unorderListConfig.disabled=t||i||d("unorderList"),this.taskConfig.active=l,this.taskConfig.disabled=t||i||d("task"),this.boldConfig.active=this.$parent.queryTextStyle("font-weight","bold"),this.boldConfig.disabled=t||d("bold"),this.underlineConfig.active=this.$parent.queryTextStyle("text-decoration","underline",!0),this.underlineConfig.disabled=t||d("underline"),this.italicConfig.active=this.$parent.queryTextStyle("font-style","italic",!0),this.italicConfig.disabled=t||d("italic"),this.strikethroughConfig.active=this.$parent.queryTextStyle("text-decoration","line-through",!0),this.strikethroughConfig.disabled=t||d("strikethrough"),this.codeConfig.active=this.$parent.queryTextMark("data-editify-code"),this.codeConfig.disabled=t||d("code"),this.superConfig.active=this.$parent.queryTextStyle("vertical-align","super",!0),this.superConfig.disabled=t||d("super"),this.subConfig.active=this.$parent.queryTextStyle("vertical-align","sub",!0),this.subConfig.disabled=t||d("sub"),this.formatClearConfig.disabled=t||d("formatClear");const h=this.fontSizeConfig.displayConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("font-size",e.value,!0):this.$parent.queryTextStyle("font-size",e,!0)));this.fontSizeConfig.displayConfig.value=h?ue.common.isObject(h)?h.value:h:this.fontSizeConfig.defaultValue,this.fontSizeConfig.disabled=t||d("fontSize");const u=this.fontFamilyConfig.displayConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("font-family",e.value,!0):this.$parent.queryTextStyle("font-family",e,!0)));this.fontFamilyConfig.displayConfig.value=u?ue.common.isObject(u)?u.value:u:this.fontFamilyConfig.defaultValue,this.fontFamilyConfig.disabled=t||d("fontFamily");const f=this.lineHeightConfig.displayConfig.options.find((t=>{let i=t;if(ue.common.isObject(t)&&(i=t.value),this.$parent.editor.range.anchor.isEqual(this.$parent.editor.range.focus)){const e=this.$parent.editor.range.anchor.element.getBlock();return e.hasStyles()&&e.styles["line-height"]==i}return e.every((e=>{if(e.element.isBlock()||e.element.isInblock())return e.element.hasStyles()&&e.element.styles["line-height"]==i;const t=e.element.getBlock(),n=e.element.getInblock();return n?n.hasStyles()&&n.styles["line-height"]==i:t.hasStyles()&&t.styles["line-height"]==i}))}));this.lineHeightConfig.displayConfig.value=f?ue.common.isObject(f)?f.value:f:this.lineHeightConfig.defaultValue,this.lineHeightConfig.disabled=t||d("lineHeight");const g=this.foreColorConfig.selectConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("color",e.value,!0):this.$parent.queryTextStyle("color",e,!0)));this.foreColorConfig.value=g?ue.common.isObject(g)?g.value:g:"",this.foreColorConfig.disabled=t||d("foreColor");const m=this.backColorConfig.selectConfig.options.find((e=>ue.common.isObject(e)?this.$parent.queryTextStyle("background-color",e.value,!0):this.$parent.queryTextStyle("background-color",e,!0)));this.backColorConfig.value=m?ue.common.isObject(m)?m.value:m:"",this.backColorConfig.disabled=t||d("backColor"),this.linkConfig.disabled=r||t||d("link"),this.imageConfig.disabled=t||d("image"),this.videoConfig.disabled=t||d("video"),this.tableConfig.disabled=t||i||n||d("table"),this.codeBlockConfig.active=!!this.$parent.getCurrentParsedomElement("pre"),this.codeBlockConfig.disabled=i||n||d("codeBlock"),this.sourceViewConfig.active=this.$parent.isSourceView}}},lo=["data-editify-mode"];const co={name:"editify",props:{...Ii},emits:["update:modelValue","focus","blur","change","keydown","insertparagraph","rangeupdate","copy","cut","paste-text","paste-html","paste-image","paste-video","before-render","after-render"],setup:()=>({uid:t.getCurrentInstance().uid}),data:()=>({editor:null,isModelChange:!1,isSourceView:!1,isInputChinese:!1,tableColumnResizeParams:{element:null,start:0},toolbarOptions:{show:!1,node:null,type:"text"},toolbarTime:null,canUseMenu:!1}),computed:{value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue||"<p><br></p>"}},textValue(){return ue.element.string2dom(`<div>${this.value}</div>`).innerText},showPlaceholder(){if(this.editor){const e=this.editor.parseHtml(this.value);if(1==e.length&&"block"==e[0].type&&e[0].parsedom==k.BLOCK_NODE&&e[0].isOnlyHasBreak())return!this.isInputChinese}return!1},contentStyle(){return this.autoheight?{minHeight:this.height}:{height:this.height}},toolbarConfig(){return Ri((e=this.$editTrans,t=this.$editLocale,{use:!0,style:null,tooltip:!0,codeBlock:{languages:{show:!0,options:[{label:e("autoRecognize"),value:""},...Oi],width:100,maxHeight:180,leftBorder:!0,rightBorder:!1}},text:{heading:{show:!0,options:qi(e).heading,defaultValue:"p",width:"en_US"==t?150:130,maxHeight:"",leftBorder:!1,rightBorder:!0},align:{show:!1,options:qi(e).align,width:"zh_CN"==t?100:130,maxHeight:"",leftBorder:!1,rightBorder:!1},orderList:{show:!1,leftBorder:!1,rightBorder:!1},unorderList:{show:!1,leftBorder:!1,rightBorder:!1},task:{show:!1,leftBorder:!1,rightBorder:!1},bold:{show:!0,leftBorder:!1,rightBorder:!1},italic:{show:!0,leftBorder:!1,rightBorder:!1},strikethrough:{show:!0,leftBorder:!1,rightBorder:!1},underline:{show:!1,leftBorder:!1,rightBorder:!1},code:{show:!0,leftBorder:!1,rightBorder:!1},super:{show:!1,leftBorder:!1,rightBorder:!1},sub:{show:!1,leftBorder:!1,rightBorder:!1},fontSize:{show:!0,options:qi(e).fontSize,defaultValue:"",width:90,maxHeight:200,leftBorder:!0,rightBorder:!1},fontFamily:{show:!1,options:qi(e).fontFamily,defaultValue:"",width:100,maxHeight:200,leftBorder:!1,rightBorder:!1},lineHeight:{show:!1,options:qi(e).lineHeight,defaultValue:"",width:90,maxHeight:"",leftBorder:!1,rightBorder:!1},foreColor:{show:!0,options:qi(e).foreColor,leftBorder:!1,rightBorder:!1},backColor:{show:!0,options:qi(e).backColor,leftBorder:!1,rightBorder:!1},formatClear:{show:!0,leftBorder:!0,rightBorder:!1}},extraDisabled:null}),this.toolbar||{});var e,t},menuConfig(){return Ri((e=this.$editTrans,t=this.$editLocale,{use:!0,tooltip:!0,mode:"default",extraDisabled:null,style:null,sequence:{undo:0,redo:1,heading:2,indent:3,quote:4,align:5,orderList:6,unorderList:7,task:8,bold:9,underline:10,italic:11,strikethrough:12,code:13,super:14,sub:15,formatClear:16,fontSize:17,fontFamily:18,lineHeight:19,foreColor:20,backColor:21,link:22,image:23,video:24,table:25,codeBlock:26,sourceView:27},undo:{show:!0,leftBorder:!1,rightBorder:!1},redo:{show:!0,leftBorder:!1,rightBorder:!1},heading:{show:!0,options:qi(e).heading,defaultValue:"p",width:"en_US"==t?150:130,maxHeight:"",leftBorder:!0,rightBorder:!1},indent:{show:!0,options:qi(e).indent,width:"en_US"==t?150:110,maxHeight:"",leftBorder:!1,rightBorder:!1},quote:{show:!0,leftBorder:!1,rightBorder:!1},align:{show:!0,options:qi(e).align,width:"zh_CN"==t?100:130,maxHeight:"",leftBorder:!0,rightBorder:!1},orderList:{show:!0,leftBorder:!1,rightBorder:!1},unorderList:{show:!0,leftBorder:!1,rightBorder:!1},task:{show:!0,leftBorder:!1,rightBorder:!1},bold:{show:!0,leftBorder:!0,rightBorder:!1},underline:{show:!0,leftBorder:!1,rightBorder:!1},italic:{show:!0,leftBorder:!1,rightBorder:!1},strikethrough:{show:!0,leftBorder:!1,rightBorder:!1},code:{show:!0,leftBorder:!1,rightBorder:!1},super:{show:!0,leftBorder:!1,rightBorder:!1},sub:{show:!0,leftBorder:!1,rightBorder:!1},formatClear:{show:!0,leftBorder:!1,rightBorder:!1},fontSize:{show:!0,options:qi(e).fontSize,defaultValue:"",width:90,maxHeight:200,leftBorder:!0,rightBorder:!1},fontFamily:{show:!0,options:qi(e).fontFamily,defaultValue:"",width:100,maxHeight:200,leftBorder:!1,rightBorder:!1},lineHeight:{show:!0,options:qi(e).lineHeight,defaultValue:"",width:90,maxHeight:"",leftBorder:!1,rightBorder:!1},foreColor:{show:!0,options:qi(e).foreColor,leftBorder:!0,rightBorder:!1},backColor:{show:!0,options:qi(e).backColor,leftBorder:!1,rightBorder:!1},link:{show:!0,leftBorder:!0,rightBorder:!1},image:{show:!0,leftBorder:!1,rightBorder:!1,accept:["jpg","png","jpeg","webp","jfif","ico","gif","svg","psd"],multiple:!1,maxSize:null,minSize:null,customUpload:null,handleError:null},video:{show:!0,leftBorder:!1,rightBorder:!1,accept:["mp4","avi","mpg","wmv","mov","rm","swf","flv"],multiple:!1,maxSize:null,minSize:null,customUpload:null,handleError:null},table:{show:!0,leftBorder:!1,rightBorder:!1,maxRows:10,maxColumns:10},codeBlock:{show:!0,leftBorder:!1,rightBorder:!1},sourceView:{show:!1,leftBorder:!1,rightBorder:!1},extends:{}}),this.menu||{});var e,t}},components:{Toolbar:_n,Tooltip:tn,Menu:Ki(ao,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("MenuItem");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-menu",{border:e.$parent.border}]),"data-editify-mode":n.config.mode,style:t.normalizeStyle(n.config.style||"")},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.menuNames,(e=>(t.openBlock(),t.createBlock(a,{name:e,disabled:s.menuDisabled(e)},null,8,["name","disabled"])))),256))],14,lo)}],["__scopeId","data-v-3fc2d533"]])},inject:["$editTrans","$editLocale"],watch:{value(e){this.isModelChange||(this.editor.stack=this.editor.parseHtml(e),this.editor.range=null,this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},isSourceView(e){this.toolbarConfig.use&&(e?this.hideToolbar():this.handleToolbar())}},mounted(){this.createEditor(),this.handleScroll(),ue.event.on(document.documentElement,`mousedown.editify_${this.uid}`,this.documentMouseDown),ue.event.on(document.documentElement,`mousemove.editify_${this.uid}`,this.documentMouseMove),ue.event.on(document.documentElement,`mouseup.editify_${this.uid}`,this.documentMouseUp),ue.event.on(document.documentElement,`click.editify_${this.uid}`,this.documentClick),ue.event.on(window,`resize.editify_${this.uid}`,this.setVideoHeight)},methods:{createEditor(){this.editor=new Y(this.$refs.content,{value:this.value,disabled:this.disabled,renderRules:[zi,Hi,Vi,Wi,e=>{var t,i,n,o,r,s;Ui.apply(this.editor,[e,(null==(t=this.toolbarConfig)?void 0:t.use)&&(null==(o=null==(n=null==(i=this.toolbarConfig)?void 0:i.codeBlock)?void 0:n.languages)?void 0:o.show),null==(s=null==(r=this.toolbarConfig)?void 0:r.codeBlock)?void 0:s.languages.options])}],allowCopy:this.allowCopy,allowPaste:this.allowPaste,allowCut:this.allowCut,allowPasteHtml:this.allowPasteHtml,allowPasteHtml:this.allowPasteHtml,customImagePaste:this.customImagePaste,customVideoPaste:this.customVideoPaste,customMerge:this.handleCustomMerge}),this.internalModify(this.editor.value),this.editor.on("change",this.handleEditorChange),this.editor.on("focus",this.handleEditorFocus),this.editor.on("blur",this.handleEditorBlur),this.editor.on("insertParagraph",this.handleInsertParagraph),this.editor.on("rangeUpdate",this.handleRangeUpdate),this.editor.on("copy",this.handleCopy),this.editor.on("cut",this.handleCut),this.editor.on("pasteText",this.handlePasteText),this.editor.on("pasteHtml",this.handlePasteHtml),this.editor.on("pasteImage",this.handlePasteImage),this.editor.on("pasteVideo",this.handlePasteVideo),this.editor.on("deleteInStart",this.handleDeleteInStart),this.editor.on("deleteComplete",this.handleDeleteComplete),this.editor.on("beforeRender",this.handleBeforeRender),this.editor.on("afterRender",this.handleAfterRender),this.editor.formatElementStack(),this.editor.domRender(),!this.autofocus||this.isSourceView||this.disabled||this.collapseToEnd()},internalModify(e){this.isModelChange=!0,this.value=e,this.$nextTick((()=>{this.isModelChange=!1}))},handleScroll(){const e=t=>{ue.event.on(t,`scroll.editify_${this.uid}`,(()=>{this.toolbarConfig.use&&this.toolbarOptions.show&&this.hideToolbar()})),t.parentNode&&e(t.parentNode)};e(this.$refs.content)},removeScrollHandle(){const e=t=>{ue.event.off(t,`scroll.editify_${this.uid}`),t.parentNode&&e(t.parentNode)};e(this.$refs.content)},handleToolbar(){this.disabled||this.isSourceView||(this.toolbarTime&&clearTimeout(this.toolbarTime),this.toolbarTime=setTimeout((()=>{this.hideToolbar(),this.$nextTick((()=>{const e=this.getCurrentParsedomElement("table"),t=this.getCurrentParsedomElement("pre"),i=this.getCurrentParsedomElement("a"),n=this.getCurrentParsedomElement("img"),o=this.getCurrentParsedomElement("video");if(i)this.toolbarOptions.type="link",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${i.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else if(n)this.toolbarOptions.type="image",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${n.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else if(o)this.toolbarOptions.type="video",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${o.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else if(e)this.toolbarOptions.type="table",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${e.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else if(t)this.toolbarOptions.type="codeBlock",this.toolbarOptions.node=`[data-editify-uid="${this.uid}"] [data-editify-element="${t.key}"]`,this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0;else{!this.editor.getElementsByRange(!0,!0).filter((e=>e.element.isText())).length||this.hasTable()||this.hasPreStyle()||this.hasLink()||this.hasImage()||this.hasVideo()||(this.toolbarOptions.type="text",this.toolbarOptions.show?this.$refs.toolbar.$refs.layer.setPosition():this.toolbarOptions.show=!0)}}))}),200))},handleCustomMerge(e,t){const i=t.getUneditableElement();i?i.toEmpty():(t.children.push(...e.children),t.children.forEach((e=>{e.parent=t})),e.children=null)},hideToolbar(){this.toolbarOptions.show=!1,this.toolbarOptions.node=null},documentMouseDown(e){if(!this.disabled){if(ue.element.isContains(this.$refs.content,e.target)){const t=e.target,i=ue.data.get(t,"data-alex-editor-key");if(i){const n=this.editor.getElementByKey(i);if(n&&"td"==n.parsedom){const i=n.parent.children.length;if(n.parent.children[i-1].isEqual(n))return;const o=ue.element.getElementBounding(t);e.pageX>=Math.abs(o.left+t.offsetWidth-5)&&e.pageX<=Math.abs(o.left+t.offsetWidth+5)&&(this.tableColumnResizeParams.element=n,this.tableColumnResizeParams.start=e.pageX)}}}ue.element.isContains(this.$el,e.target)||(this.canUseMenu=!1)}},documentMouseMove(e){if(this.disabled)return;if(!this.tableColumnResizeParams.element)return;const t=this.getCurrentParsedomElement("table");if(!t)return;const i=t.children.find((e=>"colgroup"==e.parsedom)),n=this.tableColumnResizeParams.element.parent.children.findIndex((e=>e.isEqual(this.tableColumnResizeParams.element))),o=""+(this.tableColumnResizeParams.element.elm.offsetWidth+e.pageX-this.tableColumnResizeParams.start);i.children[n].marks.width=o,i.children[n].elm.setAttribute("width",o),this.tableColumnResizeParams.start=e.pageX},documentMouseUp(e){if(this.disabled)return;if(!this.tableColumnResizeParams.element)return;const t=this.getCurrentParsedomElement("table");if(!t)return;const i=t.children.find((e=>"colgroup"==e.parsedom)),n=this.tableColumnResizeParams.element.parent.children.findIndex((e=>e.isEqual(this.tableColumnResizeParams.element))),o=Number(i.children[n].marks.width);isNaN(o)||(i.children[n].marks.width=`${Number((o/this.tableColumnResizeParams.element.parent.elm.offsetWidth*100).toFixed(2))}%`,this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()),this.tableColumnResizeParams.element=null,this.tableColumnResizeParams.start=0},documentClick(e){if(!this.disabled&&ue.element.isContains(this.$refs.content,e.target)){const t=e.target,i=ue.data.get(t,"data-alex-editor-key");if(i){const n=this.editor.getElementByKey(i);if(Mi(n)){const i=ue.element.getElementBounding(t);e.pageX>=Math.abs(i.left)&&e.pageX<=Math.abs(i.left+16)&&e.pageY>=Math.abs(i.top+t.offsetHeight/2-8)&&e.pageY<=Math.abs(i.top+t.offsetHeight/2+8)&&("checked"==n.marks["data-editify-task"]?n.marks["data-editify-task"]="uncheck":n.marks["data-editify-task"]="checked",this.editor.range||this.editor.initRange(),this.editor.range.anchor.moveToEnd(n),this.editor.range.focus.moveToEnd(n),this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())}}}},handleEditorChange(e,t){this.disabled||(this.internalModify(e),this.$emit("change",e,t))},handleEditorBlur(e){this.disabled||(this.border&&this.color&&(this.$refs.body.style.borderColor="",this.$refs.body.style.boxShadow="",this.menuConfig.use&&(this.$refs.menu.$el.style.borderColor="",this.$refs.menu.$el.style.boxShadow="")),this.$emit("blur",e))},handleEditorFocus(e){if(!this.disabled){if(this.border&&this.color){this.$refs.body.style.borderColor=this.color;const e=ue.color.hex2rgb(this.color);this.menuConfig.use&&"inner"==this.menuConfig.mode?(this.$refs.body.style.boxShadow=`0 8px 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5),8px 0 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5), -8px 0 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5)`,this.$refs.menu.$el.style.borderColor=this.color,this.$refs.menu.$el.style.boxShadow=`0 -8px 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5),8px 0 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5), -8px 0 8px -8px rgba(${e[0]},${e[1]},${e[2]},0.5)`):(this.menuConfig.use,this.$refs.body.style.boxShadow=`0 0 8px rgba(${e[0]},${e[1]},${e[2]},0.5)`)}setTimeout((()=>{this.canUseMenu=!0}),0),this.$emit("focus",e)}},handleEditorKeydown(e){this.disabled||(9!=e.keyCode||e.metaKey||e.shiftKey||e.ctrlKey||e.altKey?9!=e.keyCode||e.metaKey||!e.shiftKey||e.ctrlKey||e.altKey||(e.preventDefault(),this.setIndentDecrease()):(e.preventDefault(),this.setIndentIncrease()),this.$emit("keydown",e))},handleEditorClick(e){if(this.disabled||this.isSourceView)return;const t=e.target;if("img"==t.nodeName.toLocaleLowerCase()||"video"==t.nodeName.toLocaleLowerCase()){const e=t.getAttribute("data-editify-element");if(e){const t=this.editor.getElementByKey(e);this.editor.range||this.editor.initRange(),this.editor.range.anchor.moveToStart(t),this.editor.range.focus.moveToEnd(t),this.editor.rangeRender()}}},handleInsertParagraph(e,t){t.isOnlyHasBreak()&&e.isOnlyHasBreak()&&(t.isBlock()||t.convertToBlock(),t.parsedom!=k.BLOCK_NODE&&(Pi(t),this.editor.range.anchor.moveToStart(t),this.editor.range.focus.moveToStart(t),e.toEmpty())),this.$emit("insertparagraph",this.value)},handleRangeUpdate(e){this.disabled||(this.toolbarConfig.use&&this.handleToolbar(),this.menuConfig.use&&this.$refs.menu.handleRangeUpdate(),this.$emit("rangeupdate",this.value,e))},handleCopy(e,t){this.$emit("copy",e,t)},handleCut(e,t){this.$emit("cut",e,t)},handlePasteText(e){this.$emit("paste-text",e)},handlePasteHtml(e,t){k.flatElements(e).forEach((e=>{let t={},i={};if(e.hasMarks()){for(let i in Ai.marks)e.marks.hasOwnProperty(i)&&(Array.isArray(Ai.marks[i])&&Ai.marks[i].includes(e.parsedom)||"*"==Ai.marks[i])&&(t[i]=e.marks[i]);e.marks=t}if(e.hasStyles()&&!e.isText()){for(let t in Ai.styles)e.styles.hasOwnProperty(t)&&(Array.isArray(Ai.styles[t])&&Ai.styles[t].includes(e.parsedom)||"*"==Ai.styles[t])&&(i[t]=e.styles[t]);e.styles=i}})),this.$emit("paste-html",e)},handlePasteImage(e){this.$emit("paste-image",e)},handlePasteVideo(e){this.$emit("paste-video",e)},handleDeleteInStart(e){e.isBlock()&&Pi(e)},handleDeleteComplete(){const e=this.editor.range.anchor.element.getUneditableElement();e&&e.toEmpty()},handleBeforeRender(){this.$emit("before-render")},handleAfterRender(){this.setVideoHeight(),this.$emit("after-render")},setVideoHeight(){this.$refs.content.querySelectorAll("video").forEach((e=>{e.style.height=e.offsetWidth/this.videoRatio+"px"}))},collapseToEnd(){this.disabled||(this.editor.collapseToEnd(),this.editor.rangeRender(),ue.element.setScrollTop({el:this.$refs.content,number:1e6,time:0}))},collapseToStart(){this.disabled||(this.editor.collapseToStart(),this.editor.rangeRender(),this.$nextTick((()=>{ue.element.setScrollTop({el:this.$refs.content,number:0,time:0})})))},getParsedomElementByElement(e,t){return e.isBlock()?e.parsedom==t?e:null:e.isText()||e.parsedom!=t?this.getParsedomElementByElement(e.parent,t):e},getCurrentParsedomElement(e){if(this.disabled)return null;if(!this.editor.range)return null;if(this.editor.range.anchor.element.isEqual(this.editor.range.focus.element))return this.getParsedomElementByElement(this.editor.range.anchor.element,e);const t=this.editor.getElementsByRange(!0,!1).map((t=>this.getParsedomElementByElement(t.element,e)));if(t.some((e=>null==e)))return null;if(1==t.length)return t[0];let i=!0;for(let n=1;n<t.length;n++)if(!t[n].isEqual(t[0])){i=!1;break}return i?t[0]:null},deleteByParsedom(e){if(this.disabled)return;if(!this.editor.range)return;const t=this.getCurrentParsedomElement(e);t&&(t.toEmpty(),this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},removeLink(){if(this.disabled)return;if(!this.editor.range)return;const e=this.getCurrentParsedomElement("a");e&&(e.parsedom=k.TEXT_NODE,delete e.marks.target,delete e.marks.href,this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},setHeading(e){if(this.disabled)return;if(!this.editor.range)return;if(!qi(this.$editTrans,this.$editLocale).heading.map((e=>e.value)).includes(e))throw new Error("The parameter supports only h1-h6 and p");if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock();Pi(t),t.parsedom=e}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{if(t.element.isBlock())Pi(t.element),t.element.parsedom=e;else{const i=t.element.getBlock();Pi(i),i.parsedom=e}}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},setList(e){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock();Li(t,e)?Pi(t):Fi(t,e)}else{let t=[];this.editor.getElementsByRange(!0,!1).forEach((e=>{const i=e.element.getBlock();t.some((e=>i.isEqual(e)))||t.push(i)})),t.forEach((t=>{Li(t,e)?Pi(t):Fi(t,e)}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},setTask(){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock();Mi(e)?Pi(e):Di(e)}else{let e=[];this.editor.getElementsByRange(!0,!1).forEach((t=>{const i=t.element.getBlock();e.some((e=>i.isEqual(e)))||e.push(i)})),e.forEach((e=>{Mi(e)?Pi(e):Di(e)}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},setTextStyle(e,t){if(this.disabled)return;if(!this.editor.range)return;if(this.queryTextStyle(e,t))this.editor.removeTextStyle([e]);else{let i={};i[e]=t,this.editor.setTextStyle(i)}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},queryTextStyle(e,t,i){return this.editor.queryTextStyle(e,t,i)},setTextMark(e,t){if(this.disabled)return;if(!this.editor.range)return;if(this.queryTextMark(e,t))this.editor.removeTextMark([e]);else{let i={};i[e]=t,this.editor.setTextMark(i)}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},queryTextMark(e,t,i){return this.editor.queryTextMark(e,t,i)},formatText(){this.disabled||this.editor.range&&(this.editor.removeTextStyle(),this.editor.removeTextMark(),this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},setAlign(e){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock(),i=this.editor.range.anchor.element.getInblock();i?i.hasStyles()?i.styles["text-align"]=e:i.styles={"text-align":e}:t.hasStyles()?t.styles["text-align"]=e:t.styles={"text-align":e}}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{if(t.element.isBlock()||t.element.isInblock())t.element.hasStyles()?t.element.styles["text-align"]=e:t.element.styles={"text-align":e};else{const i=t.element.getBlock(),n=t.element.getInblock();n?n.hasStyles()?n.styles["text-align"]=e:n.styles={"text-align":e}:i.hasStyles()?i.styles["text-align"]=e:i.styles={"text-align":e}}}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},undo(){if(this.disabled)return;const e=this.editor.history.get(-1);e&&(this.editor.history.current=e.current,this.editor.stack=e.stack,this.editor.range=e.range,this.editor.formatElementStack(),this.editor.domRender(!0),this.editor.rangeRender())},redo(){if(this.disabled)return;const e=this.editor.history.get(1);e&&(this.editor.history.current=e.current,this.editor.stack=e.stack,this.editor.range=e.range,this.editor.formatElementStack(),this.editor.domRender(!0),this.editor.rangeRender())},setQuote(){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock(),t=e.parsedom;Pi(e),"blockquote"!=t&&(e.parsedom="blockquote")}else{let e=[];this.editor.getElementsByRange(!0,!1).forEach((t=>{const i=t.element.getBlock();e.some((e=>i.isEqual(e)))||e.push(i)})),e.forEach((e=>{const t=e.parsedom;Pi(e),"blockquote"!=t&&(e.parsedom="blockquote")}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},setLineHeight(e){if(!this.disabled&&this.editor.range){if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock(),i=this.editor.range.anchor.element.getInblock();i?i.hasStyles()?i.styles["line-height"]=e:i.styles={"line-height":e}:t.hasStyles()?t.styles["line-height"]=e:t.styles={"line-height":e}}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{if(t.element.isBlock()||t.element.isInblock())t.element.hasStyles()?t.element.styles["line-height"]=e:t.element.styles={"line-height":e};else{const i=t.element.getBlock(),n=t.element.getInblock();n?n.hasStyles()?n.styles["line-height"]=e:n.styles={"line-height":e}:i.hasStyles()?i.styles["line-height"]=e:i.styles={"line-height":e}}}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},setIndentIncrease(){if(this.disabled)return;if(!this.editor.range)return;const e=e=>{if(e.hasStyles())if(e.styles.hasOwnProperty("text-indent")){let t=e.styles["text-indent"];t=t.endsWith("em")?parseFloat(t):0,e.styles["text-indent"]=`${t+2}em`}else e.styles["text-indent"]="2em";else e.styles={"text-indent":"2em"}};if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock(),i=this.editor.range.anchor.element.getInblock();i&&"block"==i.behavior&&!i.isPreStyle()?e(i):t.isPreStyle()||e(t)}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{const i=t.element.getBlock(),n=t.element.getInblock();n&&"block"==n.behavior&&!n.isPreStyle()?e(n):i.isPreStyle()||e(i)}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},setIndentDecrease(){if(this.disabled)return;if(!this.editor.range)return;const e=e=>{if(e.hasStyles()&&e.styles.hasOwnProperty("text-indent")){let t=e.styles["text-indent"];t=t.endsWith("em")?parseFloat(t):0,e.styles["text-indent"]=(t-2>=0?t-2:0)+"em"}};if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock(),i=this.editor.range.anchor.element.getInblock();i&&"block"==i.behavior&&!i.isPreStyle()?e(i):t.isPreStyle()||e(t)}else{this.editor.getElementsByRange(!0,!1).forEach((t=>{const i=t.element.getBlock(),n=t.element.getInblock();n&&"block"==n.behavior&&!n.isPreStyle()?e(n):i.isPreStyle()||e(i)}))}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},insertImage(e,t=!0){if(this.disabled)return;if(!this.editor.range)return;if(!e||"string"!=typeof e)throw new Error("An image address must be given");const i=new k("closed","img",{src:e},null,null);this.editor.insertElement(i),t&&(this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},insertVideo(e,t=!0){if(this.disabled)return;if(!this.editor.range)return;if(!e||"string"!=typeof e)throw new Error("A video address must be given");const i=new k("closed","video",{src:e},null,null);this.editor.insertElement(i);const n=k.getSpaceElement(),o=k.getSpaceElement();this.editor.addElementAfter(o,i),this.editor.addElementBefore(n,i),this.editor.range.anchor.moveToEnd(o),this.editor.range.focus.moveToEnd(o),t&&(this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},hasPreStyle(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus))return this.editor.range.anchor.element.isPreStyle();return this.editor.getElementsByRange(!0,!1).some((e=>e.element.isPreStyle()))},hasQuote(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){return"blockquote"==this.editor.range.anchor.element.getBlock().parsedom}return this.editor.getElementsByRange(!0,!1).some((e=>{if(e.element.isBlock())return"blockquote"==e.element.parsedom;return"blockquote"==e.element.getBlock().parsedom}))},hasList(e=!1){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock();return Li(t,e)}return this.editor.getElementsByRange(!0,!1).some((t=>{if(t.element.isBlock())return Li(t.element,e);{const i=t.element.getBlock();return Li(i,e)}}))},hasLink(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus))return!!this.getParsedomElementByElement(this.editor.range.anchor.element,"a");return this.editor.getElementsByRange(!0,!0).filter((e=>e.element.isText())).some((e=>!!this.getParsedomElementByElement(e.element,"a")))},hasTable(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){return"table"==this.editor.range.anchor.element.getBlock().parsedom}return this.editor.getElementsByRange(!0,!1).some((e=>{if(e.element.isBlock())return"table"==e.element.parsedom;return"table"==e.element.getBlock().parsedom}))},hasTask(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock();return Mi(e)}return this.editor.getElementsByRange(!0,!1).some((e=>{if(e.element.isBlock())return Mi(e.element);{const t=e.element.getBlock();return Mi(t)}}))},hasImage(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus))return this.editor.range.anchor.element.isClosed()&&"img"==this.editor.range.anchor.element.parsedom;return this.editor.getElementsByRange(!0,!0).some((e=>e.element.isClosed()&&"img"==e.element.parsedom))},hasVideo(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus))return this.editor.range.anchor.element.isClosed()&&"video"==this.editor.range.anchor.element.parsedom;return this.editor.getElementsByRange(!0,!0).some((e=>e.element.isClosed()&&"video"==e.element.parsedom))},inQuote(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){return"blockquote"==this.editor.range.anchor.element.getBlock().parsedom}return this.editor.getElementsByRange(!0,!1).every((e=>{if(e.element.isBlock())return"blockquote"==e.element.parsedom;return"blockquote"==e.element.getBlock().parsedom}))},inList(e=!1){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const t=this.editor.range.anchor.element.getBlock();return Li(t,e)}return this.editor.getElementsByRange(!0,!1).every((t=>{if(t.element.isBlock())return Li(t.element,e);{const i=t.element.getBlock();return Li(i,e)}}))},inTask(){if(!this.editor.range)return!1;if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock();return Mi(e)}return this.editor.getElementsByRange(!0,!1).every((e=>{if(e.element.isBlock())return Mi(e.element);{const t=e.element.getBlock();return Mi(t)}}))},insertTable(e,t){if(this.disabled)return;if(!this.editor.range)return;const i=new k("block","table",null,null,null),n=new k("inblock","tbody",null,null,null);this.editor.addElementTo(n,i);for(let s=0;s<e;s++){const e=new k("inblock","tr",null,null,null);for(let i=0;i<t;i++){const t=new k("inblock","td",null,null,null),i=new k("closed","br",null,null,null);this.editor.addElementTo(i,t),this.editor.addElementTo(t,e)}this.editor.addElementTo(e,n)}this.editor.insertElement(i);const o=new k("block",k.BLOCK_NODE,null,null,null),r=new k("closed","br",null,null,null);this.editor.addElementTo(r,o),this.editor.addElementAfter(o,i),this.editor.formatElementStack(),this.editor.range.anchor.moveToStart(n),this.editor.range.focus.moveToStart(n),this.editor.domRender(),this.editor.rangeRender()},insertCodeBlock(){if(this.disabled)return;if(!this.editor.range)return;const e=this.getCurrentParsedomElement("pre");if(e){let t="";k.flatElements(e.children).filter((e=>e.isText())).forEach((e=>{t+=e.textContent}));t.split("\n").forEach((t=>{const i=new k("block",k.BLOCK_NODE,null,null,null),n=new k("text",null,null,null,t);this.editor.addElementTo(n,i),this.editor.addElementBefore(i,e)})),e.toEmpty()}else if(this.editor.range.anchor.isEqual(this.editor.range.focus)){const e=this.editor.range.anchor.element.getBlock();Pi(e),e.parsedom="pre";const t=new k("block",k.BLOCK_NODE,null,null,null),i=new k("closed","br",null,null,null);this.editor.addElementTo(i,t),this.editor.addElementAfter(t,e)}else{let e=this.editor.getElementsByRange(!0,!1);this.editor.range.anchor.moveToStart(e[0].element.getBlock()),this.editor.range.focus.moveToEnd(e[e.length-1].element.getBlock());const t=this.editor.getElementsByRange(!0,!0).filter((e=>e.element.isText())),i={};t.forEach((e=>{i[e.element.getBlock().key]?i[e.element.getBlock().key].push(e.element.clone()):i[e.element.getBlock().key]=[e.element.clone()]}));const n=new k("block","pre",null,null,null);Object.keys(i).forEach(((e,t)=>{if(t>0){const e=new k("text",null,null,null,"\n");n.hasChildren()?this.editor.addElementTo(e,n,n.children.length):this.editor.addElementTo(e,n)}i[e].forEach((e=>{n.hasChildren()?this.editor.addElementTo(e,n,n.children.length):this.editor.addElementTo(e,n)}))})),this.editor.delete(),this.editor.insertElement(n);const o=new k("block",k.BLOCK_NODE,null,null,null),r=new k("closed","br",null,null,null);this.editor.addElementTo(r,o),this.editor.addElementAfter(o,n)}this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()},insertText(e){this.disabled||this.editor.range&&(this.editor.insertText(e),this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender())},insertHtml(e){if(this.disabled)return;if(!this.editor.range)return;const t=this.editor.parseHtml(e);for(let i=0;i<t.length;i++)this.editor.insertElement(t[i],!1);this.editor.formatElementStack(),this.editor.domRender(),this.editor.rangeRender()}},beforeUnmount(){this.removeScrollHandle(),ue.event.off(document.documentElement,`mousedown.editify_${this.uid} mousemove.editify_${this.uid} mouseup.editify_${this.uid} click.editify_${this.uid}`),ue.event.off(window,`resize.editify_${this.uid}`),this.editor.destroy()}},ho={class:"editify"},uo=["data-editify-uid"],fo=["data-editify-placeholder"],go=["value"],mo={key:1,class:"editify-footer"},po={class:"editify-footer-words"};const bo=Ki(co,[["render",function(e,i,n,o,r,s){const a=t.resolveComponent("Menu"),l=t.resolveComponent("Toolbar");return t.openBlock(),t.createElementBlock("div",ho,[s.menuConfig.use?(t.openBlock(),t.createBlock(a,{key:0,config:s.menuConfig,disabled:e.disabled||!r.canUseMenu,color:e.color,ref:"menu"},null,8,["config","disabled","color"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"body",class:t.normalizeClass(["editify-body",{border:e.border,menu_inner:s.menuConfig.use&&"inner"==s.menuConfig.mode}]),"data-editify-uid":o.uid},[t.createElementVNode("div",{ref:"content",class:t.normalizeClass(["editify-content",{placeholder:s.showPlaceholder,disabled:e.disabled}]),style:t.normalizeStyle(s.contentStyle),onKeydown:i[0]||(i[0]=(...e)=>s.handleEditorKeydown&&s.handleEditorKeydown(...e)),onClick:i[1]||(i[1]=(...e)=>s.handleEditorClick&&s.handleEditorClick(...e)),onCompositionstart:i[2]||(i[2]=e=>r.isInputChinese=!0),onCompositionend:i[3]||(i[3]=e=>r.isInputChinese=!1),"data-editify-placeholder":e.placeholder},null,46,fo),r.isSourceView?(t.openBlock(),t.createElementBlock("textarea",{key:0,value:s.value,readonly:"",class:"editify-source"},null,8,go)):t.createCommentVNode("",!0),t.createVNode(l,{ref:"toolbar",modelValue:r.toolbarOptions.show,"onUpdate:modelValue":i[4]||(i[4]=e=>r.toolbarOptions.show=e),node:r.toolbarOptions.node,type:r.toolbarOptions.type,config:s.toolbarConfig},null,8,["modelValue","node","type","config"])],10,uo),e.showWordLength?(t.openBlock(),t.createElementBlock("div",mo,[t.createElementVNode("div",po,t.toDisplayString(s.$editTrans("totalWordCount"))+t.toDisplayString(s.textValue.length),1)])):t.createCommentVNode("",!0)])}],["__scopeId","data-v-e9c5b94e"]]),yo={zh_CN:{textWrapUp:"向上换行",textWrapDown:"向下换行",insertRowTop:"向前插入行",insertRowBottom:"向后插入行",insertColumnLeft:"向前插入列",insertColumnRight:"向后插入列",deleteRow:"删除行",deleteColumn:"删除列",deleteTable:"删除表格",selectLanguages:"选择语言",autoRecognize:"自动识别",linkAddress:"链接地址",newWindowOpen:"新窗口打开",removeLink:"移除链接",viewLink:"查看链接",linkUrlEnterPlaceholder:"请输入链接地址",linkTextEnterPlaceholder:"请输入链接文本",width30:"30%宽度",width50:"50%宽度",width100:"100%宽度",deleteImage:"删除图片",autoplay:"自动播放",disabledAutoplay:"关闭自动播放",loop:"循环播放",disabledLoop:"关闭循环播放",muted:"静音",unmuted:"播放声音",controls:"播放控制",deleteVideo:"删除视频",heading:"标题",bold:"粗体",h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",h6:"六级标题",text:"正文",italic:"斜体",orderList:"有序列表",unorderList:"无序列表",strikethrough:"删除线",underline:"下划线",code:"行内代码",superscript:"上标",subscript:"下标",fontSize:"字号",fontFamily:"字体",defaultFontFamily:"默认字体",foreColor:"前景色",defaultColor:"默认颜色",backColor:"背景色",formatClear:"清除格式",defaultSize:"默认字号",totalWordCount:"总字数:",align:"对齐方式",undo:"撤销",redo:"重做",quote:"引用",lineHeight:"行高",indent:"缩进",insertLink:"插入链接",insertImage:"插入图片",remoteImage:"网络图片",uploadImage:"上传图片",imageUrlPlaceholder:"请输入图片地址",insert:"插入",insertVideo:"插入视频",remoteVideo:"网络视频",uploadVideo:"上传视频",videoUrlPlaceholder:"请输入视频地址",insertTable:"插入表格",inserCodeBlock:"插入代码块",sourceView:"代码视图",task:"待办",indentIncrease:"增加缩进",indentDecrease:"减少缩进",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",alignJustify:"两端对齐",defaultLineHeight:"默认行高"},en_US:{textWrapUp:"Up feed",textWrapDown:"Down feed",insertRowTop:"Insert row forward",insertRowBottom:"Insert row backward",insertColumnLeft:"Insert column forward",insertColumnRight:"Insert column backward",deleteRow:"Delete rows",deleteColumn:"Delete column",deleteTable:"Delete table",selectLanguages:"Select language",autoRecognize:"Auto",linkAddress:"Link address",newWindowOpen:"Open in new window",removeLink:"Remove",viewLink:"View",linkUrlEnterPlaceholder:"Please enter the link address",linkTextEnterPlaceholder:"Please enter the link text",width30:"Set the width to 30%",width50:"Set the width to 50%",width100:"Set the width to 100%",deleteImage:"Delete image",autoplay:"Autoplay",disabledAutoplay:"Turn off autoplay",loop:"Loop",disabledLoop:"Close loop",muted:"Mute",unmuted:"Unmute",controls:"Play control",deleteVideo:"Delete video",heading:"Heading",bold:"Bold",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",text:"Paragraph",italic:"Italic",orderList:"Ordered list",unorderList:"Unordered list",strikethrough:"Strikethrough",underline:"Underline",code:"Inline code",superscript:"Superscript",subscript:"Subscript",fontSize:"Font size",fontFamily:"Font family",defaultFontFamily:"Default",foreColor:"Forecolor",defaultColor:"Default color",backColor:"Backcolor",formatClear:"Clear format",defaultSize:"Default",totalWordCount:"Total word count: ",align:"Alignment mode",undo:"Undo",redo:"Redo",quote:"Quote",lineHeight:"Line height",indent:"Indent",insertLink:"Insert",insertImage:"Insert",remoteImage:"Remote",uploadImage:"Upload",imageUrlPlaceholder:"Please enter the image address",insert:"Insert",insertVideo:"Insert",remoteVideo:"Remote",uploadVideo:"Upload",videoUrlPlaceholder:"Please enter the video address",insertTable:"Insert table",inserCodeBlock:"Insert code block",sourceView:"Code view",task:"Task",indentIncrease:"Increase indent",indentDecrease:"Reduce indent",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignJustify:"Align justify",defaultLineHeight:"Default"}},wo="0.0.23",Eo=(e,t)=>{const i=(t?t.locale:"zh_CN")||"zh_CN";e.provide("$editTrans",(e=>t=>yo[e][t])(i)),e.provide("$editLocale",i),e.component(bo.name,bo)},Co={install:Eo,version:wo};e.AlexElement=Y,e.default=Co,e.install=Eo,e.version=wo,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));