vue-editify 0.1.37 → 0.1.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/examples/App.vue +6 -10
  2. package/lib/components/button/button.vue.d.ts +13 -13
  3. package/lib/components/button/props.d.ts +1 -1
  4. package/lib/components/checkbox/checkbox.vue.d.ts +10 -10
  5. package/lib/components/checkbox/props.d.ts +1 -1
  6. package/lib/components/colors/colors.vue.d.ts +6 -6
  7. package/lib/components/colors/props.d.ts +1 -1
  8. package/lib/components/icon/icon.vue.d.ts +1 -1
  9. package/lib/components/insertImage/insertImage.vue.d.ts +11 -11
  10. package/lib/components/insertLink/insertLink.vue.d.ts +4 -4
  11. package/lib/components/insertTable/insertTable.vue.d.ts +4 -4
  12. package/lib/components/insertVideo/insertVideo.vue.d.ts +11 -11
  13. package/lib/components/layer/layer.vue.d.ts +9 -9
  14. package/lib/components/menu/menu.vue.d.ts +6 -6
  15. package/lib/components/menu/props.d.ts +1 -1
  16. package/lib/components/toolbar/props.d.ts +1 -1
  17. package/lib/components/toolbar/toolbar.vue.d.ts +11 -11
  18. package/lib/components/tooltip/tooltip.vue.d.ts +1 -1
  19. package/lib/components/triangle/triangle.vue.d.ts +4 -4
  20. package/lib/core/function.d.ts +1 -1
  21. package/lib/core/rule.d.ts +1 -1
  22. package/lib/core/tool.d.ts +8 -11
  23. package/lib/editify/editify.vue.d.ts +110 -84
  24. package/lib/editify/props.d.ts +9 -5
  25. package/lib/editify.es.js +15225 -404
  26. package/lib/editify.umd.js +1 -1
  27. package/lib/index.d.ts +4 -2
  28. package/lib/plugins/attachment/index.d.ts +3 -2
  29. package/lib/plugins/attachment/insertAttachment/insertAttachment.vue.d.ts +11 -11
  30. package/lib/plugins/mathformula/index.d.ts +49 -0
  31. package/lib/plugins/mathformula/insertMathformula/insertMathformula.vue.d.ts +27 -0
  32. package/lib/plugins/mathformula/insertMathformula/props.d.ts +13 -0
  33. package/lib/style.css +1 -1
  34. package/package.json +4 -2
  35. package/src/components/insertImage/insertImage.less +1 -0
  36. package/src/components/insertLink/insertLink.less +1 -0
  37. package/src/components/insertVideo/insertVideo.less +1 -0
  38. package/src/core/function.ts +4 -12
  39. package/src/core/rule.ts +7 -0
  40. package/src/core/tool.ts +3 -33
  41. package/src/editify/editify.less +28 -3
  42. package/src/editify/editify.vue +111 -26
  43. package/src/editify/props.ts +11 -4
  44. package/src/icon/iconfont.css +4 -0
  45. package/src/icon/iconfont.ttf +0 -0
  46. package/src/icon/iconfont.woff +0 -0
  47. package/src/index.ts +4 -1
  48. package/src/locale/en_US.ts +6 -1
  49. package/src/locale/zh_CN.ts +7 -2
  50. package/src/plugins/attachment/index.ts +26 -15
  51. package/src/plugins/attachment/insertAttachment/insertAttachment.less +1 -0
  52. package/src/plugins/mathformula/index.ts +298 -0
  53. package/src/plugins/mathformula/insertMathformula/insertMathformula.less +64 -0
  54. package/src/plugins/mathformula/insertMathformula/insertMathformula.vue +50 -0
  55. package/src/plugins/mathformula/insertMathformula/props.ts +16 -0
@@ -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 n=Object.defineProperty,a=(e,t,a)=>(((e,t,a)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);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 n=0,a=0,o=0;try{n=e.toString().split(".")[1].length}catch(r){}try{a=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(n,a)),(e*o+t*o)/o})),subtract:(...e)=>e.reduce(((e,t)=>{let n=0,a=0,o=0;try{n=e.toString().split(".")[1].length}catch(r){}try{a=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(n,a)),(e*o-t*o)/o})),mutiply:(...e)=>e.reduce(((e,t)=>{let n=0,a=e.toString(),o=t.toString();try{n+=a.split(".")[1].length}catch(r){}try{n+=o.split(".")[1].length}catch(r){}return Number(a.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)})),divide:(...e)=>e.reduce(((e,t)=>{let n=0,a=0,o=e.toString(),r=t.toString();try{n=o.split(".")[1].length}catch(l){}try{a=r.split(".")[1].length}catch(l){}return Number(o.replace(".",""))/Number(r.replace(".",""))*Math.pow(10,a-n)}))},r={insert(e,t,n){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(n))throw new TypeError("The third argument must be a number");if(n<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,n)+t+e.substring(n,e.length)},delete(e,t,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(n))throw new TypeError("The third argument must be a number");if(n<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,t)+e.substring(t+n,e.length)},replace(e,t,n,a){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(n))throw new TypeError("The third argument must be a number");if(n<0)throw new Error("The third argument cannot be less than 0");if("string"!=typeof a)throw new TypeError("The fourth argument must be a string");return e.substring(0,t)+a+e.substring(n,e.length)},trim(e,t){if("string"!=typeof e)throw new TypeError("The first argument must be a string");let n=e.replace(/(^\s+)|(\s+$)/g,"");return t&&(n=n.replace(/\s/g,"")),n}},l={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 n=e,a=0,o=0;for(;this.isElement(e)&&this.isContains(t,e)&&t!==e;)a+=e.offsetTop,o+=e.offsetLeft,e=e.offsetParent;return{top:a,left:o,right:t.offsetWidth-o-n.offsetWidth,bottom:t.offsetHeight-a-n.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)))},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,n=parseFloat(this.getCssStyle(e,"padding-left")),a=parseFloat(this.getCssStyle(e,"padding-right"));return o.subtract(t,n,a)},height(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientHeight,n=parseFloat(this.getCssStyle(e,"padding-top")),a=parseFloat(this.getCssStyle(e,"padding-bottom"));return o.subtract(t,n,a)},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 n=e.classList;r.trim(t).split(/\s+/).forEach((e=>{n.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 n=e.classList;r.trim(t).split(/\s+/).forEach((e=>{n.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 n=e.classList;return r.trim(t).split(/\s+/).every((e=>n.contains(e)))},scrollTopBottomTrigger(e,t){"string"==typeof e&&e&&(e=document.body.querySelector(e));let n=window;this.isElement(e)&&e!=document.body&&e!=document.documentElement&&(n=e),"function"==typeof e&&(t=e);let a=!0;n.addEventListener("scroll",(()=>{if(this.getScrollTop(n)<=0){if(!a)return;"function"==typeof t&&(a=!1,t({state:"top",target:n}))}else{let e={state:"bottom",target:n},r=0;if(r=n==window?window.innerHeight:n.clientHeight,o.add(this.getScrollTop(n),r)+1>=this.getScrollHeight(n)&&r!=this.getScrollHeight(n)){if(!a)return;"function"==typeof t&&(a=!1,t(e))}else a=!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,n=e.el;"string"==typeof n&&n&&(n=document.body.querySelector(n));let a=e.number||0,r=e.time||0;return this.isElement(n)&&n!=document.body&&n!=document.documentElement&&n!=window||(t=!0),new Promise((e=>{if(r<=0)t?document.documentElement.scrollTop=document.body.scrollTop=a:n.scrollTop=a,e();else{let l=10,i=o.divide(r,l),s=this.getScrollTop(n),c=o.divide(o.subtract(a,s),i),d=setInterval((()=>{i>0?(i--,t?document.documentElement.scrollTop=document.body.scrollTop=s=o.add(s,c):n.scrollTop=s=o.add(s,c)):(clearInterval(d),e())}),l)}}))},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,n=e.el;"string"==typeof n&&n&&(n=document.body.querySelector(n));let a=e.number||0,r=e.time||0;return this.isElement(n)&&n!=document.body&&n!=document.documentElement&&n!=window||(t=!0),new Promise((e=>{if(r<=0)t?document.documentElement.scrollLeft=document.body.scrollLeft=a:n.scrollLeft=a,e();else{let l=10,i=o.divide(r,l),s=this.getScrollLeft(n),c=o.divide(o.subtract(a,s),i),d=setInterval((()=>{i>0?(i--,t?document.documentElement.scrollLeft=document.body.scrollLeft=s=o.add(s,c):n.scrollLeft=s=o.add(s,c)):(clearInterval(d),e())}),l)}}))},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 n="";return n=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(e)[t]:e.currentStyle[t],n},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",n="",a=r.trim(e,!0).substring(1,r.trim(e,!0).length-1).split("=");return 1==a.length&&(n=a[0]),2==a.length&&(n={attributeName:a[0],attributeValue:a[1].replace(/\'/g,"").replace(/\"/g,"")}),{type:t,value:n}}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){if(!e||"string"!=typeof e)throw new TypeError("The argument must be an HTML string");let n=document.createElement(t||"div");return n.innerHTML=e,1==n.children.length?n.children[0]:Array.from(n.children)}},i="_dap-datas",s={remove(e,t){if(!(e instanceof Document||l.isElement(e)||l.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let n=e[i]||{};null==t||""===t?e[i]={}:(delete n[t],e[i]=n)},has(e,t){if(!(e instanceof Document||l.isElement(e)||l.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[i]||{}).hasOwnProperty(t)},get(e,t){if(!(e instanceof Document||l.isElement(e)||l.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let n=e[i]||{};return null==t||""===t?n:n[t]},set(e,t,n){if(!(e instanceof Document||l.isElement(e)||l.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 a=e[i]||{};a[t]=n,e[i]=a}},c={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 n=null;if("Chinese"==t&&(n=/^[\u4e00-\u9fa5]+$/),"chinese"==t&&(n=/[\u4e00-\u9fa5]/),"email"==t&&(n=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/),"username"==t&&(n=/^[a-zA-Z0-9_]{4,16}$/),"int+"==t&&(n=/^\d+$/),"int-"==t&&(n=/^-\d+$/),"int"==t&&(n=/^-?\d+$/),"pos"==t&&(n=/^\d*\.?\d+$/),"neg"==t&&(n=/^-\d*\.?\d+$/),"number"==t&&(n=/^-?\d*\.?\d+$/),"phone"==t&&(n=/^1[0-9]\d{9}$/),"idCard"==t&&(n=/^[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&&(n=/^(https?|ftp):\/\/(-\.)?([^\s\/?\.#-]+\.?)+(\/[^\s]*)?$/),"IPv4"==t&&(n=/^(?:(?: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&&(n=/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/),"rgb"==t&&(n=/^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&&(n=/^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&&(n=/^[1-9][0-9]{4,10}$/),"weixin"==t&&(n=/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/),"plate"==t&&(n=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/),!n)throw new Error("The second parameter is out of scope");return n.test(e)},getUrlParams(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1);if(!n){let e=window.location.hash.split("?");2==e.length&&(n=e[1])}let a=n.match(t);return a?decodeURIComponent(a[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 n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertyNames(t);if(n.length!=a.length)return!1;let o=n.length,r=!0;for(let l=0;l<o;l++){let a=n[l],o=e[a],i=t[a];if(!this.equal(o,i)){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 n in e)t[n]=this.clone(e[n]);return t}return e}},d=e=>{let t=e.split(/[\s]+/g),n=[];return t.forEach((e=>{let t=e.split("."),a={eventName:t[0]};t.length>1&&(a.guid=t[1]),n.push(a)})),n},u=(e,t,n)=>{let a=s.get(e,"dap-defined-events")||{},o=Object.keys(a),r=o.length;for(let l=0;l<r;l++){let r=o[l];a[r].type==t&&(n?r==t+"."+n&&(e.removeEventListener(a[r].type,a[r].fn,a[r].options),a[r]=void 0):(e.removeEventListener(a[r].type,a[r].fn,a[r].options),a[r]=void 0))}a=(e=>{let t={};return Object.keys(e).forEach((n=>{e[n]&&(t[n]=e[n])})),t})(a),s.set(e,"dap-defined-events",a)},m={on(e,t,n,a){if(!(e instanceof Document||l.isElement(e)||l.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(!n||"function"!=typeof n)throw new TypeError("The third argument must be a function");c.isObject(a)||(a={});d(t).forEach((t=>{((e,t,n,a,o)=>{let r=s.get(e,"dap-defined-events")||{};n||(n=s.get(e,"dap-event-guid")||0,s.set(e,"dap-event-guid",n+1)),r[n=t+"."+n]&&r[n].type==t&&e.removeEventListener(t,r[n].fn,r[n].options),e.addEventListener(t,a,o),r[n]={type:t,fn:a,options:o},s.set(e,"dap-defined-events",r)})(e,t.eventName,t.guid,n.bind(e),a)}))},off(e,t){if(!(e instanceof Document||l.isElement(e)||l.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let n=s.get(e,"dap-defined-events");if(!n)return;if(!t){let t=Object.keys(n),a=t.length;for(let o=0;o<a;o++){let a=t[o];e.removeEventListener(n[a].type,n[a].fn,n[a].options)}return s.remove(e,"dap-defined-events"),void s.remove(e,"dap-event-guid")}d(t).forEach((t=>{u(e,t.eventName,t.guid)}))},get(e){if(!(e instanceof Document||l.isElement(e)||l.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let t=s.get(e,"dap-defined-events");if(t)return t}},h={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,n)=>{e&&e instanceof File||n(new TypeError("The argument must be a File object"));let a=new FileReader;a.readAsDataURL(e),a.onloadend=()=>{let e=a.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 n=e.split(","),a=n[0].match(/:(.*?);/)[1],o=atob(n[1]),r=o.length,l=new Uint8Array(r);for(;r--;)l[r]=o.charCodeAt(r);return new File([l],t,{type:a})},compressImage(e,t){const n={width:void 0,quality:.8,mimeType:"jpeg",maxSize:0,minSize:0};c.isObject(t)&&(o.isNumber(t.width)&&(n.width=t.width),o.isNumber(t.quality)&&t.quality>=0&&t.quality<=1&&(n.quality=t.quality),"jpeg"!=t.mimeType&&"webp"!=t.mimeType||(n.mimeType=t.mimeType),o.isNumber(t.maxSize)&&(n.maxSize=t.maxSize),o.isNumber(t.minSize)&&(n.minSize=t.minSize));const a=(e,t,o)=>{let r=e.toDataURL("image/"+n.mimeType,o),l=this.dataBase64toFile(r,t);if(n.maxSize>0&&l.size>1024*n.maxSize){o=o<=0?0:Number((o-.01).toFixed(2));const n=a(e,t,o);r=n.url,l=n.file,o=n.quality}return{file:l,url:r,quality:o}};return new Promise(((t,o)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>{let l=r.result,i=new Image;i.src=l,i.onload=()=>{if(n.minSize>0&&e.size<=1024*n.minSize)return void t({file:e,url:l,quality:1,width:i.width,height:i.height});let o=document.createElement("canvas"),r=o.getContext("2d");o.width=n.width||i.width,o.height=n.width?n.width/(i.width/i.height):i.height,r.drawImage(i,0,0,o.width,o.height);let s=e.name.lastIndexOf(".");const c=e.name.substring(0,s)+"."+n.mimeType;let d=a(o,c,n.quality);t({...d,width:o.width,height:o.height})},i.onerror=()=>{o(new Error("Failed to load image file"))}},r.onerror=()=>{o(new Error("Failed to load image file"))}}))}},f={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")}}},g=function(e){return/^[\uFEFF]+$/g.test(e)},p=function(e){return c.isObject(e)||Array.isArray(e)?JSON.parse(JSON.stringify(e)):e},b=function(e,t){return 3==t.nodeType?l.isContains(e,t.parentNode):l.isContains(e,t)},v=class e{constructor(e,t,n,o,r){a(this,"key",function(){let e=s.get(window,"data-alex-editor-key")||0;return e++,s.set(window,"data-alex-editor-key",e),e}()),a(this,"type"),a(this,"parsedom"),a(this,"marks"),a(this,"styles"),a(this,"textContent"),a(this,"children",null),a(this,"parent",null),a(this,"behavior","default"),a(this,"elm",null),this.type=e,this.parsedom=t,this.marks=n,this.styles=o,this.textContent=r}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.isEmpty()))}return!1}isSpaceText(){return this.isText()&&!this.isEmpty()&&g(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(){if(this.hasChildren()){const e=this.children.some((e=>e.isBreak())),t=this.children.every((e=>e.isBreak()||e.isEmpty()));return e&&t}return!1}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&&(!!c.isObject(this.marks)&&!c.isEmptyObject(this.marks))}hasStyles(){return!!this.styles&&(!!c.isObject(this.styles)&&!c.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 n=new e(this.type,this.parsedom,p(this.marks),p(this.styles),this.textContent);return n.behavior=this.behavior,t&&this.hasChildren()&&this.children.forEach((e=>{let a=e.clone(t);n.hasChildren()?n.children.push(a):n.children=[a],a.parent=n})),n}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()&&c.equal(this.styles,e.styles))}isEqualMarks(e){return!this.hasMarks()&&!e.hasMarks()||!!(this.hasMarks()&&e.hasMarks()&&c.equal(this.marks,e.marks))}isFirst(t){if(!this.isText()&&!this.isClosed())return!1;if(t.isEqual(this))return!1;if(t.isContains(this)){const n=e.flatElements(t.children).filter((e=>e.isText()||e.isClosed()));return this.isEqual(n[0])}return!1}isLast(t){if(!this.isText()&&!this.isClosed())return!1;if(t.isEqual(this))return!1;if(t.isContains(this)){const n=e.flatElements(t.children).filter((e=>e.isText()||e.isClosed())),a=n.length;return this.isEqual(n[a-1])}return!1}__render(){let t=null;if(this.isText()){t=document.createElement(e.TEXT_NODE);const n=document.createTextNode(this.textContent);t.appendChild(n)}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])})),s.set(t,"data-alex-editor-key",this.key),this.elm=t}__fullClone(){let t=new e(this.type,this.parsedom,p(this.marks),p(this.styles),this.textContent);return t.behavior=this.behavior,t.key=this.key,t.elm=this.elm,this.hasChildren()&&this.children.forEach((e=>{let n=e.__fullClone();t.hasChildren()?t.children.push(n):t.children=[n],n.parent=t})),t}static isElement(t){return t instanceof e}static flatElements(e){const t=e=>{let n=[];const a=e.length;for(let o=0;o<a;o++)if(e[o]&&(n.push(e[o]),e[o].hasChildren())){const a=t(e[o].children);n.push(...a)}return n};return t(e)}static getSpaceElement(){return new e("text",null,null,null,"\ufeff")}};a(v,"BLOCK_NODE","p"),a(v,"TEXT_NODE","span"),a(v,"VOID_NODES",["colgroup","col"]);let y=v;class E{constructor(e,t){a(this,"anchor"),a(this,"focus"),this.anchor=e,this.focus=t}}class w{constructor(e,t){if(a(this,"element"),a(this,"offset"),this.element=e,this.offset=t,this.element.isText()||this.element.isClosed()){if(y.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 w}isEqual(e){return!!w.isPoint(e)&&(this.element.isEqual(e.element)&&this.offset==e.offset)}moveToEnd(e){if(!y.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(y.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=y.flatElements(e.children).filter((e=>!e.isEmpty()&&!y.VOID_NODES.includes(e.parsedom))),n=t.length;if(0==n)throw new Error("There is no element to set the focus");this.moveToEnd(t[n-1])}}moveToStart(e){if(!y.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(y.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=y.flatElements(e.children).filter((e=>!e.isEmpty()&&!y.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 k{constructor(){a(this,"records",[]),a(this,"current",-1)}push(e,t){this.current<this.records.length-1&&(this.records.length=this.current+1);const n=e.map((e=>e.__fullClone())),a=this.__cloneRange(n,t);this.records.push({stack:n,range:a}),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:n,range:a}=this.records[t],o=n.map((e=>e.__fullClone()));return{current:t,stack:o,range:this.__cloneRange(o,a)}}updateCurrentRange(e){const t=this.records[this.current],n=this.__cloneRange(t.stack,e);this.records[this.current].range=n}__cloneRange(e,t){if(t){const n=y.flatElements(e).find((e=>e.key==t.anchor.element.key)),a=y.flatElements(e).find((e=>e.key==t.focus.element.key));if(n&&a){const e=new w(n,t.anchor.offset),o=new w(a,t.focus.offset);return new E(e,o)}}return null}}const _=[{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}],x=[{parsedom:"br"},{parsedom:"col"},{parsedom:"img"},{parsedom:"hr"},{parsedom:"video"},{parsedom:"audio"},{parsedom:"svg"},{parsedom:"canvas"}],C=[{parsedom:"li",block:!0},{parsedom:"tfoot"},{parsedom:"tbody"},{parsedom:"thead"},{parsedom:"tr"},{parsedom:"th"},{parsedom:"td"},{parsedom:"colgroup"}],B=[{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:{"font-family":e=>e.getAttribute("face")||""}}],T=function(e){if(e.hasChildren()){e.children.filter((e=>!e.isEmpty()&&e.isBlock())).forEach((t=>{t.type="inline"==e.type?"inline":"inblock","inblock"==t.type&&(t.behavior="block")}))}},S=function(e){if(e.hasChildren()){const t=e.children.filter((e=>!e.isEmpty())),n=t.filter((e=>e.isInblock()));n.length&&n.length!=t.length&&n.forEach((e=>{e.type="inline"}))}},N=function(e){if(e.isInline()&&e.hasChildren()){e.children.filter((e=>!e.isEmpty()&&e.isInblock())).forEach((e=>{e.type="inline"}))}},O=function(e){if(e.hasChildren()){const t=e.children.filter((e=>!e.isEmpty())),n=t.filter((e=>e.isBreak()));n.length&&n.length==t.length?(this.range&&e.isContains(this.range.anchor.element)&&this.range.anchor.moveToStart(n[0]),this.range&&e.isContains(this.range.focus.element)&&this.range.focus.moveToStart(n[0]),e.children=[n[0]]):n.length&&n.forEach((e=>{e.toEmpty()}))}},A=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 n=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(n,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 n=e.parent.children.findIndex((t=>e.isEqual(t)));e.parent.children.splice(n,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 n=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(n,1)}else if(e.isInline()){e.children.push(...t.children),e.children.forEach((t=>{t.parent=e})),n(e);const a=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(a,1)}},n=e=>{if(e.hasChildren()&&e.children.length>1){let o=0;for(;o<=e.children.length-2;)n=e.children[o],a=e.children[o+1],n.isEmpty()||a.isEmpty()||(n.isText()&&a.isText()?n.isEqualStyles(a)&&n.isEqualMarks(a):n.isInline()&&a.isInline()&&n.parsedom==a.parsedom&&n.isEqualMarks(a)&&n.isEqualStyles(a))?t(e.children[o],e.children[o+1]):o++}var n,a};n(e)},R=function(e){const t=(e,t)=>{t.isText()?(e.type="text",e.parsedom=null,t.hasMarks()&&(e.hasMarks()?Object.assign(e.marks,p(t.marks)):e.marks=p(t.marks)),t.hasStyles()&&(e.hasStyles()?Object.assign(e.styles,p(t.styles)):e.styles=p(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,p(t.marks)):e.marks=p(t.marks)),t.hasStyles()&&(e.hasStyles()?Object.assign(e.styles,p(t.styles)):e.styles=p(t.styles)),t.hasChildren()&&(e.children=[...t.children],e.children.forEach((t=>{t.parent=e}))),n(e))},n=e=>{var n,a;e.hasChildren()&&1==e.children.length&&e.children[0]&&(n=e,(a=e.children[0]).isText()&&n.isInline()?n.parsedom==y.TEXT_NODE:(n.isInline()&&a.isInline()||n.isInblock()&&a.isInblock())&&n.parsedom==a.parsedom)&&t(e,e.children[0])};n(e)},M=function(e){if(e.isText()){let t=e.textContent,n=0;for(;n<t.length;){const a=t.charAt(n);g(a)&&n>0&&g(t.charAt(n-1))?(this.range&&this.range.anchor.element.isEqual(e)&&this.range.anchor.offset>=n+1&&(this.range.anchor.offset-=1),this.range&&this.range.focus.element.isEqual(e)&&this.range.focus.offset>=n+1&&(this.range.focus.offset-=1),t=r.delete(t,n,1)):n++}e.textContent=t}},{Mac:I}=f.os(),L=function(e,t){let n="",a="";return t.forEach((e=>{const t=e.element.clone();e.offset&&(t.textContent=t.textContent.substring(e.offset[0],e.offset[1])),t.__render(),n+=t.elm.outerHTML,a+=t.elm.innerText})),e.setData("text/plain",a),e.setData("text/html",n),{html:n,text:a}},D=async function(e,t,n){if(e)if(this.allowPasteHtml){const t=this.parseHtml(e).filter((e=>!e.isEmpty()));if("function"==typeof this.customHtmlPaste)await this.customHtmlPaste.apply(this,[t,e]);else{for(let e=0;e<t.length;e++)0==e?this.insertElement(t[e]):this.insertElement(t[e],!1);this.emit("pasteHtml",t,e)}}else t&&("function"==typeof this.customTextPaste?await this.customTextPaste.apply(this,[t]):(this.insertText(t),this.emit("pasteText",t)));else if(t)"function"==typeof this.customTextPaste?await this.customTextPaste.apply(this,[t]):(this.insertText(t),this.emit("pasteText",t));else{let e=n.length;for(let t=0;t<e;t++)if(n[t].type.startsWith("image/"))if("function"==typeof this.customImagePaste)await this.customImagePaste.apply(this,[n[t]]);else{const e=await h.dataFileToBase64(n[t]),a=new y("closed","img",{src:e},null,null);this.insertElement(a),this.emit("pasteImage",e)}else if(n[t].type.startsWith("video/"))if("function"==typeof this.customVideoPaste)await this.customVideoPaste.apply(this,[n[t]]);else{const e=await h.dataFileToBase64(n[t]),a=new y("closed","video",{src:e},null,null);this.insertElement(a),this.emit("pasteVideo",e)}else"function"==typeof this.customFilePaste&&await this.customFilePaste.apply(this,[n[t]])}},$=function(){if(0==y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.VOID_NODES.includes(e.parsedom))).length){const e=new y("block",y.BLOCK_NODE,null,null,null),t=new y("closed","br",null,null,null);this.addElementTo(t,e),this.stack=[e]}},F=function(e){const t=this.getPreviousElementOfPoint(e),n=this.getNextElementOfPoint(e),a=e.element.getBlock(),o=e.element.getInblock();t&&!y.VOID_NODES.includes(t.parsedom)&&o&&o.isContains(t)?e.moveToEnd(t):n&&!y.VOID_NODES.includes(n.parsedom)&&o&&o.isContains(n)?e.moveToStart(n):t&&!y.VOID_NODES.includes(t.parsedom)&&a.isContains(t)?e.moveToEnd(t):n&&!y.VOID_NODES.includes(n.parsedom)&&a.isContains(n)?e.moveToStart(n):t&&!y.VOID_NODES.includes(t.parsedom)?e.moveToEnd(t):n&&!y.VOID_NODES.includes(n.parsedom)&&e.moveToStart(n)},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 y("closed","br",null,null,null);this.addElementTo(t,e.parent)}}))},P=function(){const e=async e=>{const t=l.getScrollHeight(e),n=l.getScrollWidth(e);if(e.clientHeight<t||e.clientWidth<n){const a=window.getSelection();if(0==a.rangeCount)return;const o=a.getRangeAt(0),r=o.getClientRects();let i=o;0==r.length&&(i=this.range.focus.element.elm);const s=i.getBoundingClientRect(),c=e.getBoundingClientRect();if(e.clientHeight<t)if(s.top<c.top){await l.setScrollTop({el:e,number:0});const t=i.getBoundingClientRect(),n=e.getBoundingClientRect();l.setScrollTop({el:e,number:t.top-n.top})}else if(s.bottom>c.bottom){await l.setScrollTop({el:e,number:0});const t=i.getBoundingClientRect(),n=e.getBoundingClientRect();l.setScrollTop({el:e,number:t.bottom-n.bottom})}if(e.clientWidth<n)if(s.left<c.left){await l.setScrollLeft({el:e,number:0});const t=i.getBoundingClientRect(),n=e.getBoundingClientRect();l.setScrollLeft({el:e,number:t.left-n.left+20})}else if(s.right>c.right){await l.setScrollLeft({el:e,number:0});const t=i.getBoundingClientRect(),n=e.getBoundingClientRect();l.setScrollLeft({el:e,number:t.right-n.right+20})}}};if(this.range&&this.range.focus.element.elm){let t=this.range.focus.element.elm;for(;l.isElement(t)&&t!=document.documentElement;)e(t),t=t.parentNode}},V=function(){if(0==y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.VOID_NODES.includes(e.parsedom))).length){const e=new y("block",y.BLOCK_NODE,null,null,null),t=new y("closed","br",null,null,null);this.addElementTo(t,e),this.stack=[e],this.range&&(this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t))}},H=function(){if(this.__isInputChinese)return;if(this.__innerSelectionChange)return;const e=window.getSelection();if(e&&e.rangeCount){const t=e.getRangeAt(0);if(b(this.$el,t.startContainer)&&b(this.$el,t.endContainer)){let e=null,n=null,a=null,o=null;if(3==t.startContainer.nodeType)e=t.startContainer.parentNode,a=t.startOffset;else if(1==t.startContainer.nodeType){const n=Array.from(t.startContainer.childNodes);n.length?(e=n[t.startOffset]?n[t.startOffset]:n[t.startOffset-1],a=n[t.startOffset]?0:1,3==e.nodeType&&(a=0==a?0:e.textContent.length,e=e.parentNode)):(e=t.startContainer,a=0)}if(3==t.endContainer.nodeType)n=t.endContainer.parentNode,o=t.endOffset;else if(1==t.endContainer.nodeType){const e=Array.from(t.endContainer.childNodes);e.length?(n=e[t.endOffset]?e[t.endOffset]:e[t.endOffset-1],o=e[t.endOffset]?0:1,3==n.nodeType&&(o=0==o?0:n.textContent.length,n=n.parentNode)):(n=t.endContainer,o=1)}const r=s.get(e,"data-alex-editor-key"),l=s.get(n,"data-alex-editor-key"),i=this.getElementByKey(r),c=this.getElementByKey(l),d=new w(i,a),u=new w(c,o);this.range?(this.range.anchor=d,this.range.focus=u):this.range=new E(d,u),this.history.updateCurrentRange(this.range),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)))},W=function(e){if(!this.disabled&&!this.__isInputChinese)if("keydown"==e.type){if(function(e){return I?"z"==e.key&&e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:"z"==e.key&&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 I?"z"==e.key&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey:"z"==e.key&&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())}this.emit("keydown",this.value,e)}else"keyup"==e.type&&this.emit("keyup",this.value,e)},q=async function(e){if(e.preventDefault(),!this.range)return;if(!this.allowCopy)return;const t=e,n=this.getElementsByRange().list;if(t.clipboardData&&n.length){const{text:e,html:a}=L.apply(this,[t.clipboardData,n]);this.emit("copy",e,a)}},K=async function(e){if(e.preventDefault(),!this.range)return;if(!this.allowCut)return;const t=e,n=this.getElementsByRange().list;if(t.clipboardData&&n.length){const{text:e,html:a}=L.apply(this,[t.clipboardData,n]);this.disabled||(this.delete(),this.formatElementStack(),this.domRender(),this.rangeRender()),this.emit("cut",e,a)}},Z=async function(e){if(e.preventDefault(),this.disabled)return;if(!this.range)return;if(!this.allowPaste)return;const t=e;if(t.clipboardData){const e=t.clipboardData.getData("text/html"),n=t.clipboardData.getData("text/plain"),a=t.clipboardData.files;await D.apply(this,[e,n,a]),this.formatElementStack(),this.domRender(),this.rangeRender()}},G=async function(e){if(e.preventDefault(),"drop"==e.type){if(this.disabled)return;if(!this.range)return;if(!this.allowPaste)return;const t=e;if(t.dataTransfer){const e=t.dataTransfer.getData("text/html"),n=t.dataTransfer.getData("text/plain"),a=t.dataTransfer.files;await D.apply(this,[e,n,a]),this.formatElementStack(),this.domRender(),this.rangeRender()}}},X=function(e){this.disabled||this.emit("focus",this.value,e)},Q=function(e){this.disabled||this.emit("blur",this.value,e)};class J{constructor(e,t){a(this,"$el"),a(this,"disabled"),a(this,"value"),a(this,"renderRules"),a(this,"allowCopy"),a(this,"allowPaste"),a(this,"allowCut"),a(this,"allowPasteHtml"),a(this,"customTextPaste"),a(this,"customHtmlPaste"),a(this,"customImagePaste"),a(this,"customVideoPaste"),a(this,"customFilePaste"),a(this,"customMerge"),a(this,"customParseNode"),a(this,"history",new k),a(this,"stack"),a(this,"range",null),a(this,"__guid",function(){let e=s.get(window,"data-alex-editor-guid")||0;return e++,s.set(window,"data-alex-editor-guid",e),e}()),a(this,"__events",{}),a(this,"__firstRender",!0),a(this,"__isInputChinese",!1),a(this,"__innerSelectionChange",!1),a(this,"__chineseInputTimer",null),this.$el=function(e){if("string"==typeof e&&e&&(e=document.body.querySelector(e)),!l.isElement(e))throw new Error("You must specify a dom container to initialize the editor");if(s.get(e,"data-alex-editor-init"))throw new Error("The element node has been initialized to the editor");return s.set(e,"data-alex-editor-init",!0),e}(e);const n=function(e){let t={disabled:!1,renderRules:[],value:"",allowCopy:!0,allowPaste:!0,allowCut:!0,allowPasteHtml:!1,customTextPaste:null,customHtmlPaste:null,customImagePaste:null,customVideoPaste:null,customFilePaste:null,customMerge:null,customParseNode:null};return c.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.customFilePaste&&(t.customFilePaste=e.customFilePaste),"function"==typeof e.customMerge&&(t.customMerge=e.customMerge),"function"==typeof e.customParseNode&&(t.customParseNode=e.customParseNode)),t}(t);this.disabled=n.disabled,this.value=n.value,this.renderRules=n.renderRules,this.allowCopy=n.allowCopy,this.allowPaste=n.allowPaste,this.allowCut=n.allowCut,this.allowPasteHtml=n.allowPasteHtml,this.customTextPaste=n.customTextPaste,this.customHtmlPaste=n.customHtmlPaste,this.customImagePaste=n.customImagePaste,this.customVideoPaste=n.customVideoPaste,this.customFilePaste=n.customFilePaste,this.customMerge=n.customMerge,this.customParseNode=n.customParseNode,this.stack=this.parseHtml(this.value),$.apply(this),this.disabled?this.setDisabled():this.setEnabled(),m.on(document,`selectionchange.alex_editor_${this.__guid}`,H.bind(this)),m.on(this.$el,"beforeinput.alex_editor",j.bind(this)),m.on(this.$el,"compositionstart.alex_editor compositionupdate.alex_editor compositionend.alex_editor",U.bind(this)),m.on(this.$el,"keydown.alex_editor keyup.alex_editor",W.bind(this)),m.on(this.$el,"cut.alex_editor",K.bind(this)),m.on(this.$el,"paste.alex_editor",Z.bind(this)),m.on(this.$el,"copy.alex_editor",q.bind(this)),m.on(this.$el,"dragstart.alex_editor drop.alex_editor",G.bind(this)),m.on(this.$el,"focus.alex_editor",X.bind(this)),m.on(this.$el,"blur.alex_editor",Q.bind(this))}initRange(){const e=y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.VOID_NODES.includes(e.parsedom)))[0],t=new w(e,0),n=new w(e,0);this.range=new E(t,n)}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(),n=this.range.anchor.element.getInblock();if(n)if(0==this.range.anchor.offset)if(e){if(n.isContains(e))return this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),void this.delete();if("block"==n.behavior){const t=e.getBlock(),a=e.getInblock();a?"block"==a.behavior&&this.merge(n,a):this.merge(n,t)}}else this.emit("deleteInStart",n);else if(this.range.anchor.element.isSpaceText()){if(this.range.anchor.element.toEmpty(),!n.isEmpty())return this.range.anchor.offset=0,this.range.focus.offset=0,void this.delete();{const e=new y("closed","br",null,null,null);this.addElementTo(e,n),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=g(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(n.isEmpty()){const e=new y("closed","br",null,null,null);this.addElementTo(e,n),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const t=this.range.anchor.element.isBreak();if(this.range.anchor.element.toEmpty(),n.isEmpty())if(t&&"default"!=n.behavior){if(!e){const e=new y("closed","br",null,null,null);this.addElementTo(e,n),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const e=new y("closed","br",null,null,null);this.addElementTo(e,n),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 n=e.getInblock(),a=e.getBlock();n?"block"==n.behavior&&this.merge(t,n):this.merge(t,a)}}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 y("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 n=g(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,n)return void this.delete();if(t.isEmpty()){const e=new y("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const n=this.range.anchor.element.isBreak();if(this.range.anchor.element.toEmpty(),t.isEmpty()&&(!n||!e)){const e=new y("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}}else{const e=this.getElementsByRange().list.filter((e=>!y.VOID_NODES.includes(e.element.parsedom))),t=this.range.anchor.element.getInblock(),n=this.range.focus.element.getInblock(),a=this.range.anchor.element.getBlock(),o=this.range.focus.element.getBlock();t&&n&&t.isEqual(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]):e.element.toEmpty(),t.isEmpty()){const e=new y("closed","br",null,null,null);this.addElementTo(e,t)}})):t&&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 y("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==t.behavior&&"block"==n.behavior&&this.merge(n,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 y("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==t.behavior&&this.merge(o,t)):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 y("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==n.behavior&&this.merge(n,a)):a.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(),a.isEmpty()){const e=new y("closed","br",null,null,null);this.addElementTo(e,a)}})):(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 y("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),this.merge(o,a))}this.range.anchor.element.isEmpty()&&F.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&&this.range){if(!e||"string"!=typeof e)throw new Error("The argument must be a string");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 y("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),n=this.range.anchor.element.getBlock(),a=this.range.anchor.element.getInblock(),o=this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1;if(a){if(this.range.anchor.element.isPreStyle()){this.insertText("\n");const e=y.getSpaceElement();this.insertElement(e),this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),this.emit("insertParagraph",a,a)}else if("block"==a.behavior)if(0!=this.range.anchor.offset||e&&a.isContains(e))if(this.range.anchor.offset!=o||t&&a.isContains(t)){const e=a.clone();this.addElementAfter(e,a);const t=y.flatElements(a.children).findIndex((e=>this.range.anchor.element.isEqual(e)));this.range.focus.moveToEnd(a),this.delete();const n=y.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,a)}else{const e=a.clone(!1),t=new y("closed","br",null,null,null);this.addElementTo(t,e),this.addElementAfter(e,a),this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t),this.emit("insertParagraph",e,a)}else{const e=a.clone(!1),t=new y("closed","br",null,null,null);this.addElementTo(t,e),this.addElementBefore(e,a),this.emit("insertParagraph",a,e)}}else if(this.range.anchor.element.isPreStyle()){this.insertText("\n");const e=y.getSpaceElement();this.insertElement(e),this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),this.emit("insertParagraph",n,n)}else 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=y.flatElements(n.children).findIndex((e=>this.range.anchor.element.isEqual(e))),a=this.range.anchor.offset;this.range.focus.moveToEnd(n),this.delete();const o=y.flatElements(e.children);this.range.focus.element=o[t],this.range.focus.offset=a,this.range.anchor.moveToStart(e),this.delete(),this.emit("insertParagraph",e,n)}else{const e=n.clone(!1),t=new y("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 y("closed","br",null,null,null);this.addElementTo(t,e),this.addElementBefore(e,n),this.emit("insertParagraph",n,e)}}else this.delete(),this.insertParagraph()}insertElement(e,t=!0){if(!this.disabled&&this.range){if(!y.isElement(e))throw new Error("The argument must be an AlexElement instance");if(!e.isEmpty())if(this.range.anchor.isEqual(this.range.focus)){const n=this.getPreviousElementOfPoint(this.range.anchor),a=this.getNextElementOfPoint(this.range.anchor),o=this.range.anchor.element.getBlock(),r=this.range.anchor.element.getInblock(),l=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||n&&r.isContains(n))if(this.range.anchor.offset!=l||a&&r.isContains(a)){const t=r.clone();this.addElementAfter(t,r),this.range.focus.moveToEnd(r),this.delete();const n=y.flatElements(r.children).findIndex((e=>this.range.anchor.element.isEqual(e))),a=y.flatElements(t.children);this.range.focus.element=a[n],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||n&&r.isContains(n))if(this.range.anchor.offset!=l||a&&r.isContains(a)){const t=r.clone();this.addElementAfter(t,r),this.range.focus.moveToEnd(r),this.delete();const n=y.flatElements(r.children).findIndex((e=>this.range.anchor.element.isEqual(e))),a=y.flatElements(t.children);this.range.focus.element=a[n],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||n&&o.isContains(n))if(this.range.anchor.offset!=l||a&&o.isContains(a)){const t=o.clone();this.addElementAfter(t,o),this.range.focus.moveToEnd(o),this.delete();const n=y.flatElements(o.children).findIndex((e=>this.range.anchor.element.isEqual(e))),a=y.flatElements(t.children);this.range.focus.element=a[n],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||n&&o.isContains(n))if(this.range.anchor.offset!=l||a&&o.isContains(a)){const t=o.clone();this.addElementAfter(t,o),this.range.focus.moveToEnd(o),this.delete();const n=y.flatElements(o.children).findIndex((e=>this.range.anchor.element.isEqual(e))),a=y.flatElements(t.children);this.range.focus.element=a[n],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,n=this.range.anchor.element.clone();this.range.anchor.element.textContent=t.substring(0,this.range.anchor.offset),n.textContent=t.substring(this.range.anchor.offset),this.addElementAfter(n,this.range.anchor.element),this.addElementBefore(e,n)}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)}}formatElementStack(){const e=(t,n,a)=>{"boolean"!=typeof a&&(a=!1);let o=0;for(;o<t.length;)t[o]?t[o].isEmpty()?(this.range&&t[o].isContains(this.range.anchor.element)&&F.apply(this,[this.range.anchor]),this.range&&t[o].isContains(this.range.focus.element)&&F.apply(this,[this.range.focus]),t.splice(o,1)):(n.apply(this,[t[o]]),t[o].isEmpty()?(this.range&&t[o].isContains(this.range.anchor.element)&&F.apply(this,[this.range.anchor]),this.range&&t[o].isContains(this.range.focus.element)&&F.apply(this,[this.range.focus]),t.splice(o,1)):(!t[o].isBlock()&&a&&t[o].convertToBlock(),t[o].hasChildren()&&e(t[o].children,n),t[o].isEmpty()?(this.range&&t[o].isContains(this.range.anchor.element)&&F.apply(this,[this.range.anchor]),this.range&&t[o].isContains(this.range.focus.element)&&F.apply(this,[this.range.focus]),t.splice(o,1)):o++)):t.splice(o,1)};let t=this.renderRules.filter((e=>"function"==typeof e));[T,S,N,O,R,A,R,M,...t].forEach((t=>{e(this.stack,t,!0)})),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 n=this.value;this.value=this.$el.innerHTML,(this.__firstRender||n!=this.value)&&(this.__firstRender||this.emit("change",this.value,n),e||this.history.push(this.stack,this.range)),this.__firstRender&&(this.__firstRender=!1),this.emit("afterRender")}rangeRender(){if(!this.disabled){if(this.range){const e=e=>{let t=null,n=null;if(e.element.isText())t=e.element.elm.childNodes[0],n=e.offset;else{t=e.element.parent.elm;const a=e.element.parent.children.findIndex((t=>e.element.isEqual(t)));n=e.offset+a}return{node:t,offset:n}};this.__innerSelectionChange=!0;const t=e(this.range.anchor),n=e(this.range.focus),a=window.getSelection();if(a){a.removeAllRanges();const e=document.createRange();e.setStart(t.node,t.offset),e.setEnd(n.node,n.offset),a.addRange(e)}}else{const e=window.getSelection();e&&e.removeAllRanges()}setTimeout((()=>{P.apply(this),this.__innerSelectionChange=!1,this.history.updateCurrentRange(this.range),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 n=[];return Array.from(t.childNodes).forEach((e=>{if(1==e.nodeType||3==e.nodeType){const t=this.parseNode(e);n.push(t)}})),n}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 y("text",null,null,null,e.textContent);const t=function(e){let t={};const n=e.attributes.length;for(let a=0;a<n;a++){const n=e.attributes[a];/(^on)|(^style$)|(^face$)/g.test(n.nodeName)||(t[n.nodeName]=n.nodeValue)}return t}(e),n=function(e){let t={};const n=e.getAttribute("style");if(n){let e=0,a=0,o=[];for(;e<n.length;)";"==n[e]&&"base64,"!=n.substring(e+1,e+8)&&(o.push(n.substring(a,e)),a=e+1),e==n.length-1&&a<e&&o.push(n.substring(a,e)),e++;o.forEach((e=>{const n=e.indexOf(":"),a=e.substring(0,n).trim(),o=e.substring(n+1).trim();t[a]=o}))}return t}(e),a=e.nodeName.toLocaleLowerCase();if("style"==a||"meta"==a||"script"==a||"link"==a)return new y("text",null,null,null,null);if(a==y.TEXT_NODE&&e.childNodes.length&&Array.from(e.childNodes).every((e=>3==e.nodeType)))return new y("text",null,t,n,e.textContent);const o=_.find((e=>e.parsedom==a)),r=C.find((e=>e.parsedom==a)),l=B.find((e=>e.parsedom==a)),i=x.find((e=>e.parsedom==a));let s=null,d={type:"inblock",parsedom:a,marks:t,styles:n,behavior:"default"};if(o)d.type="block",o.parse&&(d.parsedom=y.BLOCK_NODE);else if(r)d.type="inblock",r.block&&(d.behavior="block");else if(l){if(d.type="inline",l.parse&&(d.parsedom=y.TEXT_NODE,c.isObject(l.parse)))for(let c in l.parse)"function"==typeof l.parse[c]?d.styles[c]=l.parse[c].apply(this,[e]):d.styles[c]=l.parse[c]}else i?d.type="closed":(d.type="inline",d.parsedom="span");return s=new y(d.type,d.parsedom,d.marks,d.styles,null),s.behavior=d.behavior,i||Array.from(e.childNodes).forEach((e=>{if(1==e.nodeType||3==e.nodeType){const t=this.parseNode(e);t.parent=s,s.hasChildren()?s.children.push(t):s.children=[t]}})),"function"==typeof this.customParseNode&&(s=this.customParseNode.apply(this,[s])),s}merge(e,t){if(!y.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!y.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=n=>{let a=null;const o=n.length;for(let r=0;r<o;r++){const o=n[r];if(o&&o.key===e){a=o;break}if(o&&o.hasChildren()){const e=t(o.children);if(e){a=e;break}}}return a};return t(this.stack)}getPreviousElement(e){if(!y.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(!y.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(!w.isPoint(e))throw new Error("The argument must be an AlexPoint instance");const t=e=>{let n=null;for(let a=e.length-1;a>=0;a--){const o=e[a];if(!o.isEmpty()){if(o.isText()||o.isClosed()){n=o;break}if(n=t(o.children),n)break}}return n},n=e=>{const a=this.getPreviousElement(e);return a?a.isEmpty()?n(a):a.isText()||a.isClosed()?a:t(a.children):e.parent?n(e.parent):null};return n(e.element)}getNextElementOfPoint(e){if(!w.isPoint(e))throw new Error("The argument must be an AlexPoint instance");const t=e=>{let n=null;const a=e.length;for(let o=0;o<a;o++){const a=e[o];if(!a.isEmpty()){if(a.isText()||a.isClosed()){n=a;break}if(n=t(a.children),n)break}}return n},n=e=>{const a=this.getNextElement(e);return a?a.isEmpty()?n(a):a.isText()||a.isClosed()?a:t(a.children):e.parent?n(e.parent):null};return n(e.element)}getElementsByRange(){if(!this.range)return{list:[],flatList:[]};if(this.range.anchor.isEqual(this.range.focus))return{list:[],flatList:[]};const e=(()=>{let e=[];const t=0==this.range.anchor.offset,n=this.range.focus.offset==(this.range.focus.element.isText()?this.range.focus.element.textContent.length:1),a=this.range.anchor.element.getBlock(),o=this.range.focus.element.getBlock(),r=this.stack.findIndex((e=>a.isEqual(e))),l=this.stack.findIndex((e=>o.isEqual(e)));let i=y.flatElements(this.stack.slice(r,l+1));const s=function(e){let t=e.element;for(;t.parent&&e.element.isFirst(t.parent);)t=t.parent;return t}(this.range.anchor),c=i.findIndex((e=>e.isEqual(s||this.range.anchor.element))),d=i.findIndex((e=>e.isEqual(this.range.focus.element)));if((c>0||d<i.length-1)&&(i=i.slice(c,d+1)),this.range.anchor.element.isEqual(this.range.focus.element))e=t&&n?i.map((e=>({element:e,offset:!1}))):[{element:this.range.anchor.element,offset:[this.range.anchor.offset,this.range.focus.offset]}];else{const a=i.length;for(let o=0;o<a;o++)if(this.range.anchor.element.isEqual(i[o]))t?e.push({element:this.range.anchor.element,offset:!1}):this.range.anchor.element.isText()&&this.range.anchor.offset<this.range.anchor.element.textContent.length&&e.push({element:this.range.anchor.element,offset:[this.range.anchor.offset,this.range.anchor.element.textContent.length]});else if(i[o].isContains(this.range.anchor.element)){const a=this.range.anchor.element.isFirst(i[o]),r=i[o].isContains(this.range.focus.element),l=this.range.focus.element.isLast(i[o]);(t&&a&&r&&l&&n||t&&a&&!r)&&e.push({element:i[o],offset:!1})}else if(this.range.focus.element.isEqual(i[o]))n?e.push({element:this.range.focus.element,offset:!1}):this.range.focus.offset>0&&e.push({element:this.range.focus.element,offset:[0,this.range.focus.offset]});else if(i[o].isContains(this.range.focus.element)){this.range.focus.element.isLast(i[o])&&n&&e.push({element:i[o],offset:!1})}else e.push({element:i[o],offset:!1})}return e})();return{list:(e=>{let t=[],n=[],a=[];const o=e.length;for(let r=0;r<o;r++)if(e[r].element.isBlock())t.push(e[r]),n.push(e[r].element);else{const o=e[r].element.getBlock();let l=!1;for(let e=n.length-1;e>=0;e--)if(n[e].isEqual(o)){l=!0;break}if(!l){a.some((t=>t.isContains(e[r].element)))||(t.push(e[r]),(e[r].element.isInblock()||e[r].element.isInline())&&a.push(e[r].element))}}return t})(e),flatList:e}}addElementTo(e,t,n=0){if(!y.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!y.isElement(t))throw new Error("The second argument must be an AlexElement instance");if("number"!=typeof n||isNaN(n)||n<0)throw new Error("The third argument must be an integer not less than 0");t.hasChildren()?n>=t.children.length?t.children.push(e):t.children.splice(n,0,e):t.children=[e],e.parent=t}addElementBefore(e,t){if(!y.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!y.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(t.isBlock()){const n=this.stack.findIndex((e=>t.isEqual(e)));this.stack.splice(n,0,e),e.parent=null}else{const n=t.parent.children.findIndex((e=>t.isEqual(e)));this.addElementTo(e,t.parent,n)}}addElementAfter(e,t){if(!y.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!y.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(t.isBlock()){const n=this.stack.findIndex((e=>t.isEqual(e)));n>=this.stack.length-1?this.stack.push(e):this.stack.splice(n+1,0,e),e.parent=null}else{const n=t.parent.children.findIndex((e=>t.isEqual(e)));this.addElementTo(e,t.parent,n+1)}}collapseToStart(e){if(this.disabled)return;let t=!1;if(this.range||(this.initRange(),t=!0),y.isElement(e))this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e);else{const e=y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.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),y.isElement(e))this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e);else{const e=y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.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","true")}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(),m.off(document,`selectionchange.alex_editor_${this.__guid}`),m.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")}}console.log("%c alex-editor %c v1.3.37 ","padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;","padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;");const Y={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 n=0,a=0,o=0;try{n=e.toString().split(".")[1].length}catch(r){}try{a=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(n,a)),(e*o+t*o)/o})),subtract:(...e)=>e.reduce(((e,t)=>{let n=0,a=0,o=0;try{n=e.toString().split(".")[1].length}catch(r){}try{a=t.toString().split(".")[1].length}catch(r){}return o=Math.pow(10,Math.max(n,a)),(e*o-t*o)/o})),mutiply:(...e)=>e.reduce(((e,t)=>{let n=0,a=e.toString(),o=t.toString();try{n+=a.split(".")[1].length}catch(r){}try{n+=o.split(".")[1].length}catch(r){}return Number(a.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)})),divide:(...e)=>e.reduce(((e,t)=>{let n=0,a=0,o=e.toString(),r=t.toString();try{n=o.split(".")[1].length}catch(l){}try{a=r.split(".")[1].length}catch(l){}return Number(o.replace(".",""))/Number(r.replace(".",""))*Math.pow(10,a-n)}))},ee={insert(e,t,n){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(!Y.isNumber(n))throw new TypeError("The third argument must be a number");if(n<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,n)+t+e.substring(n,e.length)},delete(e,t,n){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!Y.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(!Y.isNumber(n))throw new TypeError("The third argument must be a number");if(n<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,t)+e.substring(t+n,e.length)},replace(e,t,n,a){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!Y.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(!Y.isNumber(n))throw new TypeError("The third argument must be a number");if(n<0)throw new Error("The third argument cannot be less than 0");if("string"!=typeof a)throw new TypeError("The fourth argument must be a string");return e.substring(0,t)+a+e.substring(n,e.length)},trim(e,t){if("string"!=typeof e)throw new TypeError("The first argument must be a string");let n=e.replace(/(^\s+)|(\s+$)/g,"");return t&&(n=n.replace(/\s/g,"")),n}},te={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 n=e,a=0,o=0;for(;this.isElement(e)&&this.isContains(t,e)&&t!==e;)a+=e.offsetTop,o+=e.offsetLeft,e=e.offsetParent;return{top:a,left:o,right:t.offsetWidth-o-n.offsetWidth,bottom:t.offsetHeight-a-n.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)))},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(!Y.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return Y.mutiply(e,parseFloat(t))},px2rem(e){if(!Y.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return Y.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,n=parseFloat(this.getCssStyle(e,"padding-left")),a=parseFloat(this.getCssStyle(e,"padding-right"));return Y.subtract(t,n,a)},height(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientHeight,n=parseFloat(this.getCssStyle(e,"padding-top")),a=parseFloat(this.getCssStyle(e,"padding-bottom"));return Y.subtract(t,n,a)},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 n=e.classList;ee.trim(t).split(/\s+/).forEach((e=>{n.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 n=e.classList;ee.trim(t).split(/\s+/).forEach((e=>{n.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 n=e.classList;return ee.trim(t).split(/\s+/).every((e=>n.contains(e)))},scrollTopBottomTrigger(e,t){"string"==typeof e&&e&&(e=document.body.querySelector(e));let n=window;this.isElement(e)&&e!=document.body&&e!=document.documentElement&&(n=e),"function"==typeof e&&(t=e);let a=!0;n.addEventListener("scroll",(()=>{if(this.getScrollTop(n)<=0){if(!a)return;"function"==typeof t&&(a=!1,t({state:"top",target:n}))}else{let e={state:"bottom",target:n},o=0;if(o=n==window?window.innerHeight:n.clientHeight,Y.add(this.getScrollTop(n),o)+1>=this.getScrollHeight(n)&&o!=this.getScrollHeight(n)){if(!a)return;"function"==typeof t&&(a=!1,t(e))}else a=!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,n=e.el;"string"==typeof n&&n&&(n=document.body.querySelector(n));let a=e.number||0,o=e.time||0;return this.isElement(n)&&n!=document.body&&n!=document.documentElement&&n!=window||(t=!0),new Promise((e=>{if(o<=0)t?document.documentElement.scrollTop=document.body.scrollTop=a:n.scrollTop=a,e();else{let r=10,l=Y.divide(o,r),i=this.getScrollTop(n),s=Y.divide(Y.subtract(a,i),l),c=setInterval((()=>{l>0?(l--,t?document.documentElement.scrollTop=document.body.scrollTop=i=Y.add(i,s):n.scrollTop=i=Y.add(i,s)):(clearInterval(c),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,n=e.el;"string"==typeof n&&n&&(n=document.body.querySelector(n));let a=e.number||0,o=e.time||0;return this.isElement(n)&&n!=document.body&&n!=document.documentElement&&n!=window||(t=!0),new Promise((e=>{if(o<=0)t?document.documentElement.scrollLeft=document.body.scrollLeft=a:n.scrollLeft=a,e();else{let r=10,l=Y.divide(o,r),i=this.getScrollLeft(n),s=Y.divide(Y.subtract(a,i),l),c=setInterval((()=>{l>0?(l--,t?document.documentElement.scrollLeft=document.body.scrollLeft=i=Y.add(i,s):n.scrollLeft=i=Y.add(i,s)):(clearInterval(c),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 n="";return n=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(e)[t]:e.currentStyle[t],n},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",n="",a=ee.trim(e,!0).substring(1,ee.trim(e,!0).length-1).split("=");return 1==a.length&&(n=a[0]),2==a.length&&(n={attributeName:a[0],attributeValue:a[1].replace(/\'/g,"").replace(/\"/g,"")}),{type:t,value:n}}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:Y.subtract(document.documentElement.clientHeight||window.innerHeight,t.bottom),left:t.left,right:Y.subtract(document.documentElement.clientWidth||window.innerWidth,t.right)}},isElement:e=>e&&e instanceof Node&&1===e.nodeType,string2dom(e,t){if(!e||"string"!=typeof e)throw new TypeError("The argument must be an HTML string");let n=document.createElement(t||"div");return n.innerHTML=e,1==n.children.length?n.children[0]:Array.from(n.children)}},ne="_dap-datas",ae={remove(e,t){if(!(e instanceof Document||te.isElement(e)||te.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let n=e[ne]||{};null==t||""===t?e[ne]={}:(delete n[t],e[ne]=n)},has(e,t){if(!(e instanceof Document||te.isElement(e)||te.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||te.isElement(e)||te.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let n=e[ne]||{};return null==t||""===t?n:n[t]},set(e,t,n){if(!(e instanceof Document||te.isElement(e)||te.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 a=e[ne]||{};a[t]=n,e[ne]=a}},oe={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 n=null;if("Chinese"==t&&(n=/^[\u4e00-\u9fa5]+$/),"chinese"==t&&(n=/[\u4e00-\u9fa5]/),"email"==t&&(n=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/),"username"==t&&(n=/^[a-zA-Z0-9_]{4,16}$/),"int+"==t&&(n=/^\d+$/),"int-"==t&&(n=/^-\d+$/),"int"==t&&(n=/^-?\d+$/),"pos"==t&&(n=/^\d*\.?\d+$/),"neg"==t&&(n=/^-\d*\.?\d+$/),"number"==t&&(n=/^-?\d*\.?\d+$/),"phone"==t&&(n=/^1[0-9]\d{9}$/),"idCard"==t&&(n=/^[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&&(n=/^(https?|ftp):\/\/(-\.)?([^\s\/?\.#-]+\.?)+(\/[^\s]*)?$/),"IPv4"==t&&(n=/^(?:(?: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&&(n=/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/),"rgb"==t&&(n=/^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&&(n=/^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&&(n=/^[1-9][0-9]{4,10}$/),"weixin"==t&&(n=/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/),"plate"==t&&(n=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/),!n)throw new Error("The second parameter is out of scope");return n.test(e)},getUrlParams(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1);if(!n){let e=window.location.hash.split("?");2==e.length&&(n=e[1])}let a=n.match(t);return a?decodeURIComponent(a[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 n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertyNames(t);if(n.length!=a.length)return!1;let o=n.length,r=!0;for(let l=0;l<o;l++){let a=n[l],o=e[a],i=t[a];if(!this.equal(o,i)){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 n in e)t[n]=this.clone(e[n]);return t}return e}},re=e=>{let t=e.split(/[\s]+/g),n=[];return t.forEach((e=>{let t=e.split("."),a={eventName:t[0]};t.length>1&&(a.guid=t[1]),n.push(a)})),n},le=(e,t,n)=>{let a=ae.get(e,"dap-defined-events")||{},o=Object.keys(a),r=o.length;for(let l=0;l<r;l++){let r=o[l];a[r].type==t&&(n?r==t+"."+n&&(e.removeEventListener(a[r].type,a[r].fn,a[r].options),a[r]=void 0):(e.removeEventListener(a[r].type,a[r].fn,a[r].options),a[r]=void 0))}a=(e=>{let t={};return Object.keys(e).forEach((n=>{e[n]&&(t[n]=e[n])})),t})(a),ae.set(e,"dap-defined-events",a)},ie={on(e,t,n,a){if(!(e instanceof Document||te.isElement(e)||te.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(!n||"function"!=typeof n)throw new TypeError("The third argument must be a function");oe.isObject(a)||(a={});re(t).forEach((t=>{((e,t,n,a,o)=>{let r=ae.get(e,"dap-defined-events")||{};n||(n=ae.get(e,"dap-event-guid")||0,ae.set(e,"dap-event-guid",n+1)),r[n=t+"."+n]&&r[n].type==t&&e.removeEventListener(t,r[n].fn,r[n].options),e.addEventListener(t,a,o),r[n]={type:t,fn:a,options:o},ae.set(e,"dap-defined-events",r)})(e,t.eventName,t.guid,n.bind(e),a)}))},off(e,t){if(!(e instanceof Document||te.isElement(e)||te.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let n=ae.get(e,"dap-defined-events");if(!n)return;if(!t){let t=Object.keys(n),a=t.length;for(let o=0;o<a;o++){let a=t[o];e.removeEventListener(n[a].type,n[a].fn,n[a].options)}return ae.remove(e,"dap-defined-events"),void ae.remove(e,"dap-event-guid")}re(t).forEach((t=>{le(e,t.eventName,t.guid)}))},get(e){if(!(e instanceof Document||te.isElement(e)||te.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let t=ae.get(e,"dap-defined-events");if(t)return t}},se={rgb2hsv(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=0,n=0,a=0,o=e[0]>=255?255:e[0],r=e[1]>=255?255:e[1],l=e[2]>=255?255:e[2];o=o<=0?0:o,r=r<=0?0:r,l=l<=0?0:l;let i=Math.max(o,r,l),s=Math.min(o,r,l);return a=i/255,n=0===i?0:1-s/i,i===s?t=0:i===o&&r>=l?t=(r-l)/(i-s)*60+0:i===o&&r<l?t=(r-l)/(i-s)*60+360:i===r?t=(l-o)/(i-s)*60+120:i===l&&(t=(o-r)/(i-s)*60+240),[t,100*n,100*a]},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],n=e[1]>=100?100:e[1];n=n<=0?0:n;let a=e[2]>=100?100:e[2];a=a<=0?0:a,n/=100,a/=100;let o=0,r=0,l=0,i=parseInt(t/60%6+""),s=t/60-i,c=a*(1-n),d=a*(1-s*n),u=a*(1-(1-s)*n);switch(i){case 0:o=a,r=u,l=c;break;case 1:o=d,r=a,l=c;break;case 2:o=c,r=a,l=u;break;case 3:o=c,r=d,l=a;break;case 4:o=u,r=c,l=a;break;case 5:o=a,r=c,l=d}return o=parseInt(255*o+""),r=parseInt(255*r+""),l=parseInt(255*l+""),[o,r,l]},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(!oe.matchingText(t,"hex"))throw new TypeError("The argument must be a hexadecimal color value");if(4===t.length){let e="#";for(let n=1;n<4;n+=1)e+=t.slice(n,n+1).concat(t.slice(n,n+1));t=e}let n=[];for(let a=1;a<7;a+=2)n.push(parseInt("0x"+t.slice(a,a+2)));return n}},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,n)=>{e&&e instanceof File||n(new TypeError("The argument must be a File object"));let a=new FileReader;a.readAsDataURL(e),a.onloadend=()=>{let e=a.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 n=e.split(","),a=n[0].match(/:(.*?);/)[1],o=atob(n[1]),r=o.length,l=new Uint8Array(r);for(;r--;)l[r]=o.charCodeAt(r);return new File([l],t,{type:a})},compressImage(e,t){const n={width:void 0,quality:.8,mimeType:"jpeg",maxSize:0,minSize:0};oe.isObject(t)&&(Y.isNumber(t.width)&&(n.width=t.width),Y.isNumber(t.quality)&&t.quality>=0&&t.quality<=1&&(n.quality=t.quality),"jpeg"!=t.mimeType&&"webp"!=t.mimeType||(n.mimeType=t.mimeType),Y.isNumber(t.maxSize)&&(n.maxSize=t.maxSize),Y.isNumber(t.minSize)&&(n.minSize=t.minSize));const a=(e,t,o)=>{let r=e.toDataURL("image/"+n.mimeType,o),l=this.dataBase64toFile(r,t);if(n.maxSize>0&&l.size>1024*n.maxSize){o=o<=0?0:Number((o-.01).toFixed(2));const n=a(e,t,o);r=n.url,l=n.file,o=n.quality}return{file:l,url:r,quality:o}};return new Promise(((t,o)=>{let r=new FileReader;r.readAsDataURL(e),r.onload=()=>{let l=r.result,i=new Image;i.src=l,i.onload=()=>{if(n.minSize>0&&e.size<=1024*n.minSize)return void t({file:e,url:l,quality:1,width:i.width,height:i.height});let o=document.createElement("canvas"),r=o.getContext("2d");o.width=n.width||i.width,o.height=n.width?n.width/(i.width/i.height):i.height,r.drawImage(i,0,0,o.width,o.height);let s=e.name.lastIndexOf(".");const c=e.name.substring(0,s)+"."+n.mimeType;let d=a(o,c,n.quality);t({...d,width:o.width,height:o.height})},i.onerror=()=>{o(new Error("Failed to load image file"))}},r.onerror=()=>{o(new Error("Failed to load image file"))}}))}};function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ue(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 n=e[t],a=typeof n;"object"!==a&&"function"!==a||Object.isFrozen(n)||ue(n)})),e}class me{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function he(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function fe(e,...t){const n=Object.create(null);for(const a in e)n[a]=e[a];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const ge=e=>!!e.scope;class pe{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=he(e)}openNode(e){if(!ge(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){ge(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const be=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class ve{constructor(){this.rootNode=be(),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=be({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=>{ve._collapse(e)})))}}class ye extends ve{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new pe(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ee(e){return e?"string"==typeof e?e:e.source:null}function we(e){return xe("(?=",e,")")}function ke(e){return xe("(?:",e,")*")}function _e(e){return xe("(?:",e,")?")}function xe(...e){return e.map((e=>Ee(e))).join("")}function Ce(...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=>Ee(e))).join("|")+")"}function Be(e){return new RegExp(e.toString()+"|").exec("").length-1}const Te=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Se(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let a=Ee(e),o="";for(;a.length>0;){const e=Te.exec(a);if(!e){o+=a;break}o+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?o+="\\"+String(Number(e[1])+t):(o+=e[0],"("===e[0]&&n++)}return o})).map((e=>`(${e})`)).join(t)}const Ne="[a-zA-Z]\\w*",Oe="[a-zA-Z_]\\w*",Ae="\\b\\d+(\\.\\d+)?",Re="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Me="\\b(0b[01]+)",Ie={begin:"\\\\[\\s\\S]",relevance:0},Le={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ie]},De={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ie]},$e=function(e,t,n={}){const a=fe({scope:"comment",begin:e,end:t,contains:[]},n);a.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=Ce("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 a.contains.push({begin:xe(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),a},Fe=$e("//","$"),ze=$e("/\\*","\\*/"),Pe=$e("#","$"),Ve={scope:"number",begin:Ae,relevance:0},He={scope:"number",begin:Re,relevance:0},je={scope:"number",begin:Me,relevance:0},Ue={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ie,{begin:/\[/,end:/\]/,relevance:0,contains:[Ie]}]},We={scope:"title",begin:Ne,relevance:0},qe={scope:"title",begin:Oe,relevance:0},Ke={begin:"\\.\\s*"+Oe,relevance:0};var Ze=Object.freeze({__proto__:null,APOS_STRING_MODE:Le,BACKSLASH_ESCAPE:Ie,BINARY_NUMBER_MODE:je,BINARY_NUMBER_RE:Me,COMMENT:$e,C_BLOCK_COMMENT_MODE:ze,C_LINE_COMMENT_MODE:Fe,C_NUMBER_MODE:He,C_NUMBER_RE:Re,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:Pe,IDENT_RE:Ne,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Ke,NUMBER_MODE:Ve,NUMBER_RE:Ae,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:Ue,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=xe(t,/.*\b/,e.binary,/\b.*/)),fe({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:We,UNDERSCORE_IDENT_RE:Oe,UNDERSCORE_TITLE_MODE:qe});function Ge(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Xe(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function Qe(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ge,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Je(e,t){Array.isArray(e.illegal)&&(e.illegal=Ce(...e.illegal))}function Ye(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 et(e,t){void 0===e.relevance&&(e.relevance=1)}const tt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=xe(n.beforeMatch,we(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},nt=["of","and","for","in","not","or","if","then","parent","list","value"],at="keyword";function ot(e,t,n=at){const a=Object.create(null);return"string"==typeof e?o(n,e.split(" ")):Array.isArray(e)?o(n,e):Object.keys(e).forEach((function(n){Object.assign(a,ot(e[n],t,n))})),a;function o(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");a[n[0]]=[e,rt(n[0],n[1])]}))}}function rt(e,t){return t?Number(t):function(e){return nt.includes(e.toLowerCase())}(e)?0:1}const lt={},it=e=>{console.error(e)},st=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ct=(e,t)=>{lt[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),lt[`${e}/${t}`]=!0)},dt=new Error;function ut(e,t,{key:n}){let a=0;const o=e[n],r={},l={};for(let i=1;i<=t.length;i++)l[i+a]=o[i],r[i+a]=!0,a+=Be(t[i-1]);e[n]=l,e[n]._emit=r,e[n]._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 it("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),dt;if("object"!=typeof e.beginScope||null===e.beginScope)throw it("beginScope must be object"),dt;ut(e,e.begin,{key:"beginScope"}),e.begin=Se(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw it("skip, excludeEnd, returnEnd not compatible with endScope: {}"),dt;if("object"!=typeof e.endScope||null===e.endScope)throw it("endScope must be object"),dt;ut(e,e.end,{key:"endScope"}),e.end=Se(e.end,{joinWith:""})}}(e)}function ht(e){function t(t,n){return new RegExp(Ee(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{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+=Be(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(Se(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),a=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,a)}}class a{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 n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),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 n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}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=fe(e.classNameAliases||{}),function n(o,r){const l=o;if(o.isCompiled)return l;[Xe,Ye,mt,tt].forEach((e=>e(o,r))),e.compilerExtensions.forEach((e=>e(o,r))),o.__beforeBegin=null,[Qe,Je,et].forEach((e=>e(o,r))),o.isCompiled=!0;let i=null;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),i=o.keywords.$pattern,delete o.keywords.$pattern),i=i||/\w+/,o.keywords&&(o.keywords=ot(o.keywords,e.case_insensitive)),l.keywordPatternRe=t(i,!0),r&&(o.begin||(o.begin=/\B|\b/),l.beginRe=t(l.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(l.endRe=t(l.end)),l.terminatorEnd=Ee(l.end)||"",o.endsWithParent&&r.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+r.terminatorEnd)),o.illegal&&(l.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 fe(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(ft(e))return fe(e,{starts:e.starts?fe(e.starts):null});if(Object.isFrozen(e))return fe(e);return e}("self"===e?o:e)}))),o.contains.forEach((function(e){n(e,l)})),o.starts&&n(o.starts,r),l.matcher=function(e){const t=new a;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}(l),l}(e)}function ft(e){return!!e&&(e.endsWithParent||ft(e.starts))}class gt extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const pt=he,bt=fe,vt=Symbol("nomatch"),yt=function(e){const t=Object.create(null),n=Object.create(null),a=[];let o=!0;const r="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let i={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ye};function s(e){return i.noHighlightRe.test(e)}function c(e,t,n){let a="",o="";"object"==typeof t?(a=e,n=t.ignoreIllegals,o=t.language):(ct("10.7.0","highlight(lang, code, ...args) has been deprecated."),ct("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,a=t),void 0===n&&(n=!0);const r={code:a,language:o};v("before:highlight",r);const l=r.result?r.result:d(r.language,r.code,n);return l.code=r.code,v("after:highlight",l),l}function d(e,n,a,l){const s=Object.create(null);function c(){if(!C.keywords)return void T.addText(S);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(S),n="";for(;t;){n+=S.substring(e,t.index);const o=k.case_insensitive?t[0].toLowerCase():t[0],r=(a=o,C.keywords[a]);if(r){const[e,a]=r;if(T.addText(n),n="",s[o]=(s[o]||0)+1,s[o]<=7&&(N+=a),e.startsWith("_"))n+=t[0];else{const n=k.classNameAliases[e]||e;h(t[0],n)}}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(S)}var a;n+=S.substring(e),T.addText(n)}function m(){null!=C.subLanguage?function(){if(""===S)return;let e=null;if("string"==typeof C.subLanguage){if(!t[C.subLanguage])return void T.addText(S);e=d(C.subLanguage,S,!0,B[C.subLanguage]),B[C.subLanguage]=e._top}else e=u(S,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(N+=e.relevance),T.__addSublanguage(e._emitter,e.language)}():c(),S=""}function h(e,t){""!==e&&(T.startScope(t),T.addText(e),T.endScope())}function f(e,t){let n=1;const a=t.length-1;for(;n<=a;){if(!e._emit[n]){n++;continue}const a=k.classNameAliases[e[n]]||e[n],o=t[n];a?h(o,a):(S=o,c(),S=""),n++}}function p(e,t){return e.scope&&"string"==typeof e.scope&&T.openNode(k.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(h(S,k.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),S=""):e.beginScope._multi&&(f(e.beginScope,t),S="")),C=Object.create(e,{parent:{value:C}}),C}function b(e,t,n){let a=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(a){if(e["on:end"]){const n=new me(e);e["on:end"](t,n),n.isMatchIgnored&&(a=!1)}if(a){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return b(e.parent,t,n)}function v(e){return 0===C.matcher.regexIndex?(S+=e[0],1):(R=!0,0)}function y(e){const t=e[0],a=n.substring(e.index),o=b(C,e,a);if(!o)return vt;const r=C;C.endScope&&C.endScope._wrap?(m(),h(t,C.endScope._wrap)):C.endScope&&C.endScope._multi?(m(),f(C.endScope,e)):r.skip?S+=t:(r.returnEnd||r.excludeEnd||(S+=t),m(),r.excludeEnd&&(S=t));do{C.scope&&T.closeNode(),C.skip||C.subLanguage||(N+=C.relevance),C=C.parent}while(C!==o.parent);return o.starts&&p(o.starts,e),r.returnEnd?0:t.length}let E={};function w(t,r){const l=r&&r[0];if(S+=t,null==l)return m(),0;if("begin"===E.type&&"end"===r.type&&E.index===r.index&&""===l){if(S+=n.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],n=e.rule,a=new me(n),o=[n.__beforeBegin,n["on:begin"]];for(const r of o)if(r&&(r(e,a),a.isMatchIgnored))return v(t);return n.skip?S+=t:(n.excludeBegin&&(S+=t),m(),n.returnBegin||n.excludeBegin||(S=t)),p(n,e),n.returnBegin?0:t.length}(r);if("illegal"===r.type&&!a){const e=new Error('Illegal lexeme "'+l+'" for mode "'+(C.scope||"<unnamed>")+'"');throw e.mode=C,e}if("end"===r.type){const e=y(r);if(e!==vt)return e}if("illegal"===r.type&&""===l)return 1;if(A>1e5&&A>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return S+=l,l.length}const k=g(e);if(!k)throw it(r.replace("{}",e)),new Error('Unknown language: "'+e+'"');const _=ht(k);let x="",C=l||_;const B={},T=new i.__emitter(i);!function(){const e=[];for(let t=C;t!==k;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>T.openNode(e)))}();let S="",N=0,O=0,A=0,R=!1;try{if(k.__emitTokens)k.__emitTokens(n,T);else{for(C.matcher.considerAll();;){A++,R?R=!1:C.matcher.considerAll(),C.matcher.lastIndex=O;const e=C.matcher.exec(n);if(!e)break;const t=w(n.substring(O,e.index),e);O=e.index+t}w(n.substring(O))}return T.finalize(),x=T.toHTML(),{language:e,value:x,relevance:N,illegal:!1,_emitter:T,_top:C}}catch(M){if(M.message&&M.message.includes("Illegal"))return{language:e,value:pt(n),illegal:!0,relevance:0,_illegalBy:{message:M.message,index:O,context:n.slice(O-100,O+100),mode:M.mode,resultSoFar:x},_emitter:T};if(o)return{language:e,value:pt(n),illegal:!1,relevance:0,errorRaised:M,_emitter:T,_top:C};throw M}}function u(e,n){n=n||i.languages||Object.keys(t);const a=function(e){const t={value:pt(e),illegal:!1,relevance:0,_top:l,_emitter:new i.__emitter(i)};return t._emitter.addText(e),t}(e),o=n.filter(g).filter(b).map((t=>d(t,e,!1)));o.unshift(a);const r=o.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(g(e.language).supersetOf===t.language)return 1;if(g(t.language).supersetOf===e.language)return-1}return 0})),[s,c]=r,u=s;return u.secondBest=c,u}function m(e){let t=null;const a=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=i.languageDetectRe.exec(t);if(n){const t=g(n[1]);return t||(st(r.replace("{}",n[1])),st("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>s(e)||g(e)))}(e);if(s(a))return;if(v("before:highlightElement",{el:e,language:a}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(i.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)),i.throwUnescapedHTML)){throw new gt("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const o=t.textContent,l=a?c(o,{language:a,ignoreIllegals:!0}):u(o);e.innerHTML=l.value,e.dataset.highlighted="yes",function(e,t,a){const o=t&&n[t]||a;e.classList.add("hljs"),e.classList.add(`language-${o}`)}(e,a,l.language),e.result={language:l.language,re:l.relevance,relevance:l.relevance},l.secondBest&&(e.secondBest={language:l.secondBest.language,relevance:l.secondBest.relevance}),v("after:highlightElement",{el:e,result:l,text:o})}let h=!1;function f(){if("loading"===document.readyState)return void(h=!0);document.querySelectorAll(i.cssSelector).forEach(m)}function g(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function p(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function b(e){const t=g(e);return t&&!t.disableAutodetect}function v(e,t){const n=e;a.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){h&&f()}),!1),Object.assign(e,{highlight:c,highlightAuto:u,highlightAll:f,highlightElement:m,highlightBlock:function(e){return ct("10.7.0","highlightBlock will be removed entirely in v12.0"),ct("10.7.0","Please use highlightElement now."),m(e)},configure:function(e){i=bt(i,e)},initHighlighting:()=>{f(),ct("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),ct("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,a){let r=null;try{r=a(e)}catch(i){if(it("Language definition for '{}' could not be registered.".replace("{}",n)),!o)throw i;it(i),r=l}r.name||(r.name=n),t[n]=r,r.rawDefinition=a.bind(null,e),r.aliases&&p(r.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:g,registerAliases:p,autoDetection:b,inherit:bt,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),a.push(e)},removePlugin:function(e){const t=a.indexOf(e);-1!==t&&a.splice(t,1)}}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString="11.9.0",e.regex={concat:xe,lookahead:we,either:Ce,optional:_e,anyNumberOfTimes:ke};for(const y in Ze)"object"==typeof Ze[y]&&ue(Ze[y]);return Object.assign(e,Ze),e},Et=yt({});Et.newInstance=()=>yt({});var wt=Et;Et.HighlightJS=Et,Et.default=Et;const kt=de(wt);const _t="[A-Za-z$_][0-9A-Za-z$_]*",xt=["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"],Ct=["true","false","null","undefined","NaN","Infinity"],Bt=["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"],Tt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],St=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Nt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ot=[].concat(St,Bt,Tt);var At="[0-9](_*[0-9])*",Rt=`\\.(${At})`,Mt="[0-9a-fA-F](_*[0-9a-fA-F])*",It={className:"number",variants:[{begin:`(\\b(${At})((${Rt})|\\.)?|(${Rt}))[eE][+-]?(${At})[fFdD]?\\b`},{begin:`\\b(${At})((${Rt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Rt})[fFdD]?\\b`},{begin:`\\b(${At})[fFdD]\\b`},{begin:`\\b0[xX]((${Mt})\\.?|(${Mt})?\\.(${Mt}))[pP][+-]?(${At})[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 Lt(e,t,n){return-1===n?"":e.replace(t,(a=>Lt(e,t,n-1)))}const Dt="[A-Za-z$_][0-9A-Za-z$_]*",$t=["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"],Ft=["true","false","null","undefined","NaN","Infinity"],zt=["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"],Pt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ht=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jt=[].concat(Vt,zt,Pt);const Ut=["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"],Wt=["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"],qt=["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"],Kt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Zt=["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 Gt=["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"],Xt=["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"],Qt=["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"],Jt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Yt=["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(),en=Qt.concat(Jt);const tn=["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"],nn=["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"],an=["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"],on=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],rn=["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 ln(e){return e?"string"==typeof e?e:e.source:null}function sn(e){return cn("(?=",e,")")}function cn(...e){return e.map((e=>ln(e))).join("")}function dn(...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=>ln(e))).join("|")+")"}const un=e=>cn(/\b/,e,/\w$/.test(e)?/\b/:/\B/),mn=["Protocol","Type"].map(un),hn=["init","self"].map(un),fn=["Any","Self"],gn=["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"],pn=["false","nil","true"],bn=["assignment","associativity","higherThan","left","lowerThan","none","right"],vn=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],yn=["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"],En=dn(/[/=\-+!*%<>&|^~?]/,/[\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]/),wn=dn(En,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),kn=cn(En,wn,"*"),_n=dn(/[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]/),xn=dn(_n,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Cn=cn(_n,xn,"*"),Bn=cn(/[A-Z]/,xn,"*"),Tn=["attached","autoclosure",cn(/convention\(/,dn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",cn(/objc\(/,Cn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Sn=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];var Nn="[0-9](_*[0-9])*",On=`\\.(${Nn})`,An="[0-9a-fA-F](_*[0-9a-fA-F])*",Rn={className:"number",variants:[{begin:`(\\b(${Nn})((${On})|\\.)?|(${On}))[eE][+-]?(${Nn})[fFdD]?\\b`},{begin:`\\b(${Nn})((${On})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${On})[fFdD]?\\b`},{begin:`\\b(${Nn})[fFdD]\\b`},{begin:`\\b0[xX]((${An})\\.?|(${An})?\\.(${An}))[pP][+-]?(${Nn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${An})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};kt.registerLanguage("plaintext",(function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),kt.registerLanguage("json",(function(e){const t=["true","false","null"],n={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,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),kt.registerLanguage("javascript",(function(e){const t=e.regex,n=_t,a="<>",o="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,a=e.input[n];if("<"===a||","===a)return void t.ignoreMatch();let o;">"===a&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const r=e.input.substring(n);((o=r.match(/^\s*=/))||(o=r.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},l={$pattern:_t,keyword:xt,literal:Ct,built_in:Ot,"variable.language":Nt},i="[0-9](_?[0-9])*",s=`\\.(${i})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${s})|\\.)?|(${s}))[eE][+-]?(${i})\\b`},{begin:`\\b(${c})\\b((${s})\\b|\\.)?|(${s})\\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},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},f={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},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:n+"(?=\\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,m,h,f,g,{match:/\$\d+/},d];u.contains=b.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(b)});const v=[].concat(p,u.contains),y=v.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(v)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},k={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:{_:[...Bt,...Tt]}},_={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},x={match:t.concat(/\b/,(C=[...St,"super","import"],t.concat("(?!",C.join("|"),")")),n,t.lookahead(/\(/)),className:"title.function",relevance:0};var C;const B={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},T={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,n,/\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:l,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:k},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,m,h,f,g,p,{match:/\$\d+/},d,k,{className:"attr",begin:n+t.lookahead(":"),relevance:0},N,{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:l,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a,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"]}]}]},_,{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:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},B,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,T,{match:/\$[(.]/}]}})),kt.registerLanguage("java",(function(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",a=n+Lt("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/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:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},l={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+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+a+"\\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,It,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},It,r]}})),kt.registerLanguage("typescript",(function(e){const t=function(e){const t=e.regex,n=Dt,a="<>",o="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,a=e.input[n];if("<"===a||","===a)return void t.ignoreMatch();let o;">"===a&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const r=e.input.substring(n);((o=r.match(/^\s*=/))||(o=r.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},l={$pattern:Dt,keyword:$t,literal:Ft,built_in:jt,"variable.language":Ht},i="[0-9](_?[0-9])*",s=`\\.(${i})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${s})|\\.)?|(${s}))[eE][+-]?(${i})\\b`},{begin:`\\b(${c})\\b((${s})\\b|\\.)?|(${s})\\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},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},f={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},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:n+"(?=\\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,m,h,f,g,{match:/\$\d+/},d];u.contains=b.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(b)});const v=[].concat(p,u.contains),y=v.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(v)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},k={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:{_:[...zt,...Pt]}},_={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},x={match:t.concat(/\b/,(C=[...Vt,"super","import"],t.concat("(?!",C.join("|"),")")),n,t.lookahead(/\(/)),className:"title.function",relevance:0};var C;const B={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},T={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,n,/\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:l,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:k},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,m,h,f,g,p,{match:/\$\d+/},d,k,{className:"attr",begin:n+t.lookahead(":"),relevance:0},N,{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:l,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a,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"]}]}]},_,{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:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},B,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,T,{match:/\$[(.]/}]}}(e),n=Dt,a=["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:a},contains:[t.exports.CLASS_REFERENCE]},l={$pattern:Dt,keyword:$t.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:Ft,built_in:jt.concat(a),"variable.language":Ht},i={className:"meta",begin:"@"+n},s=(e,t,n)=>{const a=e.contains.findIndex((e=>e.label===t));if(-1===a)throw new Error("can not find mode to replace");e.contains.splice(a,1,n)};return Object.assign(t.keywords,l),t.exports.PARAMS_CONTAINS.push(i),t.contains=t.contains.concat([i,o,r]),s(t,"shebang",e.SHEBANG()),s(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})),kt.registerLanguage("python",(function(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["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:a,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:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},i={begin:/\{\{/,relevance:0},s={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,i,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,r,i,l]},{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,i,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,l]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,u=`\\b|${a.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${u})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${u})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${u})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${u})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${u})`},{begin:`\\b(${c})[jJ](?=${u})`}]},h={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",r,m,s,e.HASH_COMMENT_MODE]}]};return l.contains=[s,m,r],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[r,m,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},s,h,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,f,s]}]}})),kt.registerLanguage("php",(function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,a=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),r={scope:"variable",match:"\\$+"+a},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},i=e.inherit(e.APOS_STRING_MODE,{illegal:null}),s="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),i,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"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/})]},d={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},u=["false","null","true"],m=["__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"],h=["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"],f={keyword:m,literal:(e=>{const t=[];return e.forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(u),built_in:h},g=e=>e.map((e=>e.replace(/\|\d+$/,""))),p={variants:[{match:[/new/,t.concat(s,"+"),t.concat("(?!",g(h).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},b=t.concat(a,"\\b(?!\\()"),v={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"}}]},y={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:f,contains:[y,r,v,e.C_BLOCK_COMMENT_MODE,c,d,p]},w={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",g(m).join("\\b|"),"|",g(h).join("\\b|"),"\\b)"),a,t.concat(s,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[E]};E.contains.push(w);const k=[y,v,e.C_BLOCK_COMMENT_MODE,c,d,p];return{case_insensitive:!1,keywords:f,contains:[{begin:t.concat(/#\[\s*/,o),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:u,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:u,keyword:["new","array"]},contains:["self",...k]},...k,{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,w,v,{match:[/const/,/\s/,a],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:f,contains:["self",r,v,e.C_BLOCK_COMMENT_MODE,c,d]}]},{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]},c,d]}})),kt.registerLanguage("css",(function(e){const t=e.regex,n=(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),a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.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},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+qt.join("|")+")"},{begin:":(:)?("+Kt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Zt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.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:Wt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ut.join("|")+")\\b"}]}})),kt.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),n=en,a="[\\w-]+",o="("+a+"|@\\{"+a+"\\})",r=[],l=[],i=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},s=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Xt.join(" ")},d={begin:"\\(",end:"\\)",contains:l,keywords:c,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i("'"),i('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,s("variable","@@?"+a,10),s("variable","@\\{"+a+"\\}"),s("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const u=l.concat({begin:/\{/,end:/\}/,contains:r}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Yt.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},f={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:l,relevance:0}},g={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:u}},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,m,s("keyword","all\\b"),s("variable","@\\{"+a+"\\}"),{begin:"\\b("+Gt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,s("selector-tag",o,0),s("selector-id","#"+o),s("selector-class","\\."+o,0),s("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Qt.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Jt.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:u},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:a+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[p]};return r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,g,b,h,p,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:r}})),kt.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),n=on,a=an,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("+tn.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+a.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},r,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rn.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:nn.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]}})),kt.registerLanguage("html",(function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a={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:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),i=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),s={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:[a]},{begin:/'/,end:/'/,contains:[a]},{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,i,l,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,r,i,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[i]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[s],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[s],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:s}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),kt.registerLanguage("markdown",(function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={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}]},a={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(a,{contains:[]}),l=e.inherit(o,{contains:[]});a.contains.push(l),o.contains.push(r);let i=[t,n];return[a,o,r,l].forEach((e=>{e.contains=e.contains.concat(i)})),i=i.concat(a,o),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:i},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:i}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a,o,{className:"quote",begin:"^>\\s+",contains:i,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:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}})),kt.registerLanguage("objectivec",(function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$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:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}})),kt.registerLanguage("swift",(function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,n],o={match:[/\./,dn(...mn,...hn)],className:{2:"keyword"}},r={match:cn(/\./,dn(...gn)),relevance:0},l=gn.filter((e=>"string"==typeof e)).concat(["_|0"]),i={variants:[{className:"keyword",match:dn(...gn.filter((e=>"string"!=typeof e)).concat(fn).map(un),...hn)}]},s={$pattern:dn(/\b\w+/,/#\w+/),keyword:l.concat(vn),literal:pn},c=[o,r,i],d=[{match:cn(/\./,dn(...yn)),relevance:0},{className:"built_in",match:cn(/\b/,dn(...yn),/(?=\()/)}],u={match:/->/,relevance:0},m=[u,{className:"operator",relevance:0,variants:[{match:kn},{match:`\\.(\\.|${wn})+`}]}],h="([0-9]_*)+",f="([0-9a-fA-F]_*)+",g={className:"number",relevance:0,variants:[{match:`\\b(${h})(\\.(${h}))?([eE][+-]?(${h}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?([pP][+-]?(${h}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},p=(e="")=>({className:"subst",variants:[{match:cn(/\\/,e,/[0\\tnr"']/)},{match:cn(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:cn(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e="")=>({className:"subst",label:"interpol",begin:cn(/\\/,e,/\(/),end:/\)/}),y=(e="")=>({begin:cn(e,/"""/),end:cn(/"""/,e),contains:[p(e),b(e),v(e)]}),E=(e="")=>({begin:cn(e,/"/),end:cn(/"/,e),contains:[p(e),v(e)]}),w={className:"string",variants:[y(),y("#"),y("##"),y("###"),E(),E("#"),E("##"),E("###")]},k=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],_={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:k},x=e=>{const t=cn(e,/\//),n=cn(/\//,e);return{begin:t,end:n,contains:[...k,{scope:"comment",begin:`#(?!.*${n})`,end:/$/}]}},C={scope:"regexp",variants:[x("###"),x("##"),x("#"),_]},B={match:cn(/`/,Cn,/`/)},T=[B,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${xn}+`}],S=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Sn,contains:[...m,g,w]}]}},{scope:"keyword",match:cn(/@/,dn(...Tn))},{scope:"meta",match:cn(/@/,Cn)}],N={match:sn(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:cn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,xn,"+")},{className:"type",match:Bn,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:cn(/\s+&\s+/,sn(Bn)),relevance:0}]},O={begin:/</,end:/>/,keywords:s,contains:[...a,...c,...S,u,N]};N.contains.push(O);const A={begin:/\(/,end:/\)/,relevance:0,keywords:s,contains:["self",{match:cn(Cn,/\s*:/),keywords:"_|0",relevance:0},...a,C,...c,...d,...m,g,w,...T,...S,N]},R={begin:/</,end:/>/,keywords:"repeat each",contains:[...a,N]},M={begin:/\(/,end:/\)/,keywords:s,contains:[{begin:dn(sn(cn(Cn,/\s*:/)),sn(cn(Cn,/\s+/,Cn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Cn}]},...a,...c,...m,g,w,...S,N,A],endsParent:!0,illegal:/["']/},I={match:[/(func|macro)/,/\s+/,dn(B.match,Cn,kn)],className:{1:"keyword",3:"title.function"},contains:[R,M,t],illegal:[/\[/,/%/]},L={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[R,M,t],illegal:/\[|%/},D={match:[/operator/,/\s+/,kn],className:{1:"keyword",3:"title"}},$={begin:[/precedencegroup/,/\s+/,Bn],className:{1:"keyword",3:"title"},contains:[N],keywords:[...bn,...pn],end:/}/};for(const F of w.variants){const e=F.contains.find((e=>"interpol"===e.label));e.keywords=s;const t=[...c,...d,...m,g,w,...T];e.contains=[...t,{begin:/\(/,end:/\)/,contains:["self",...t]}]}return{name:"Swift",keywords:s,contains:[...a,I,L,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:s,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},D,$,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0},C,...c,...d,...m,g,w,...T,...S,N,A]}})),kt.registerLanguage("dart",(function(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},n={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},a={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,n]},{begin:'"""',end:'"""',contains:[e.BACKSLASH_ESCAPE,t,n]},{begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,n]},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,n]}]};n.contains=[e.C_NUMBER_MODE,a];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:[a,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:"=>"}]}})),kt.registerLanguage("nginx",(function(e){const t=e.regex,n={className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{\w+\}/},{begin:t.concat(/[$@]/,e.UNDERSCORE_IDENT_RE)}]},a={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,n],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[n]},{className:"regexp",contains:[e.BACKSLASH_ESCAPE,n],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},n]};return{name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{beginKeywords:"upstream location",end:/;|\{/,contains:a.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:a}],relevance:0}],illegal:"[^\\s\\}\\{]"}})),kt.registerLanguage("go",(function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}})),kt.registerLanguage("http",(function(e){const t="HTTP/([32]|1\\.[01])",n={className:"attribute",begin:e.regex.concat("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},a=[n,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+t+" \\d{3})",end:/$/,contains:[{className:"meta",begin:t},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:a}},{begin:"(?=^[A-Z]+ (.*?) "+t+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:t},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:a}},e.inherit(n,{relevance:0})]}})),kt.registerLanguage("ruby",(function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(a,/(::\w+)*/),r={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},s=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:r},d={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},u="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${u}))?([eE][+-]?(${u})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:r}]},f=[d,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:r},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:r},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:r},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(i,s),relevance:0}].concat(i,s);c.contains=f,h.contains=f;const g=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:r,contains:f}}];return s.unshift(i),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:r,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(g).concat(s).concat(f)}})),kt.registerLanguage("c",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",r="("+a+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},i={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(i,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},u=t.optional(o)+e.IDENT_RE+"\\s*\\(",m={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},h=[c,l,n,e.C_BLOCK_COMMENT_MODE,s,i],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:m,contains:h.concat([{begin:/\(/,end:/\)/,keywords:m,contains:h.concat(["self"]),relevance:0}]),relevance:0},g={begin:"("+r+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:m,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:m,relevance:0},{begin:u,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,i,s,l,{begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,i,s,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:m,disableAutodetect:!0,illegal:"</",contains:[].concat(f,g,h,[c,{begin:e.IDENT_RE+"::",keywords:m},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:i,keywords:m}}})),kt.registerLanguage("cpp",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",r="(?!struct)("+a+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},i={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(i,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},u=t.optional(o)+e.IDENT_RE+"\\s*\\(",m={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[h,c,l,n,e.C_BLOCK_COMMENT_MODE,s,i],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:m,contains:f.concat([{begin:/\(/,end:/\)/,keywords:m,contains:f.concat(["self"]),relevance:0}]),relevance:0},p={className:"function",begin:"("+r+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:m,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:m,relevance:0},{begin:u,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[i,s]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,i,s,l,{begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,i,s,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:m,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(g,p,h,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:m,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:m},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}})),kt.registerLanguage("csharp",(function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},o={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},r=e.inherit(o,{illegal:/\n/}),l={className:"subst",begin:/\{/,end:/\}/,keywords:t},i=e.inherit(l,{illegal:/\n/}),s={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,i]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]},d=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},i]});l.contains=[c,s,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],i.contains=[d,s,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const u={variants:[c,s,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},h=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},u,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,m,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,m,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+h+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,m],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[u,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}})),kt.registerLanguage("sql",(function(e){const t=e.regex,n=e.COMMENT("--","$"),a=["true","false","unknown"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],l=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],i=r,s=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!r.includes(e))),c={begin:t.concat(/\b/,t.either(...i),/\s*\(/),relevance:0,keywords:{built_in:i}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const a=n;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:a(e)?`${e}|0`:e))}(s,{when:e=>e.length<3}),literal:a,type:o,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...l),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:s.concat(l),literal:a,type:o}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}})),kt.registerLanguage("shell",(function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}})),kt.registerLanguage("r",(function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[r,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}})),kt.registerLanguage("kotlin",(function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,a]}]};a.contains.push(r);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},i={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(r,{className:"string"}),"self"]}]},s=Rn,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},u=d;return u.variants[1].contains=[d],d.variants[1].contains=[u],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,l,i,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,l,i,r,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,i]},r,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},s]}})),kt.registerLanguage("rust",(function(e){const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",o=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],r=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:r,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:o},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:o,type:r}},{className:"punctuation",begin:"->"},n]}})),kt.configure({cssSelector:"pre",classPrefix:"editify-hljs-",ignoreUnescapedHTML:!0});const Mn=[{label:"Plain Text",value:"plaintext"},{label:"JSON",value:"json"},{label:"JavaScript",value:"javascript"},{label:"Java",value:"java"},{label:"TypeScript",value:"typescript"},{label:"Python",value:"python"},{label:"PHP",value:"php"},{label:"CSS",value:"css"},{label:"Less",value:"less"},{label:"Scss",value:"scss"},{label:"HTML",value:"html"},{label:"Markdown",value:"markdown"},{label:"Objective-C",value:"objectivec"},{label:"Swift",value:"swift"},{label:"Dart",value:"dart"},{label:"Nginx",value:"nginx"},{label:"HTTP",value:"http"},{label:"Go",value:"go"},{label:"Ruby",value:"ruby"},{label:"C",value:"c"},{label:"C++",value:"cpp"},{label:"C#",value:"csharp"},{label:"SQL",value:"sql"},{label:"Shell",value:"shell"},{label:"R",value:"r"},{label:"Kotlin",value:"kotlin"},{label:"Rust",value:"rust"}],In={"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"]},Ln={"text-indent":"*","text-align":"*","line-height":"*"},Dn=function(e,t){if(!oe.isObject(e)&&oe.isObject(t))return null;for(let n in t)oe.isObject(t[n])&&!Array.isArray(t[n])&&oe.isObject(e[n])&&!Array.isArray(e[n])?e[n]=Dn(e[n],t[n]):e[n]=t[n];return e},$n=function(e,t,n){if(null==n||null==n)return e.hasOwnProperty(t);let a=e[t];if(null==a||null==a)return!1;if("string"==typeof n&&(n=n.toLocaleLowerCase()),"string"==typeof a&&(a=a.toLocaleLowerCase()),"string"==typeof n&&n&&(oe.matchingText(n,"rgb")||oe.matchingText(n,"rgba"))&&(n=ee.trim(n,!0)),"string"==typeof a&&a&&(oe.matchingText(a,"rgb")||oe.matchingText(a,"rgba"))&&(a=ee.trim(a,!0)),"string"==typeof n&&n&&oe.matchingText(n,"hex")){const e=se.hex2rgb(n);n=`rgb(${e[0]},${e[1]},${e[2]})`}if("string"==typeof a&&a&&oe.matchingText(a,"hex")){const e=se.hex2rgb(a);a=`rgb(${e[0]},${e[1]},${e[2]})`}return a==n},Fn=function(e){return oe.isObject(e)||Array.isArray(e)?JSON.parse(JSON.stringify(e)):e},zn=function(e){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"]}},Pn=(e,t)=>e.isBlock()?e.parsedom==t?e:null:e.isText()||e.parsedom!=t?Pn(e.parent,t):e,Vn=(e,t,n)=>{if(!e.range)return null;if(e.range.anchor.element.isEqual(e.range.focus.element))return Pn(e.range.anchor.element,n);const a=t.list.map((e=>Pn(e.element,n)));if(a.some((e=>null==e)))return null;if(1==a.length)return a[0];let o=!0;for(let r=1;r<a.length;r++)if(!a[r].isEqual(a[0])){o=!1;break}return o?a[0]:null},Hn=(e,t)=>!!Un(e,t)||!!e.parent&&Hn(e.parent,t),jn=e=>!!Wn(e)||!!e.parent&&jn(e.parent),Un=(e,t=!1)=>!e.isEmpty()&&("div"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-list"]==(t?"ol":"ul")),Wn=e=>!e.isEmpty()&&("div"==e.parsedom&&e.hasMarks()&&e.marks.hasOwnProperty("data-editify-task")),qn=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Pn(e.range.anchor.element,"pre"):t.flatList.some((e=>!!Pn(e.element,"pre")))),Kn=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Pn(e.range.anchor.element,"blockquote"):t.flatList.some((e=>!!Pn(e.element,"blockquote")))),Zn=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Pn(e.range.anchor.element,"blockquote"):t.list.every((e=>!!Pn(e.element,"blockquote")))),Gn=(e,t,n=!1)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?Hn(e.range.anchor.element,n):t.list.every((e=>Hn(e.element,n)))),Xn=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?jn(e.range.anchor.element):t.list.every((e=>jn(e.element)))),Qn=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Pn(e.range.anchor.element,"a"):t.flatList.some((e=>!!Pn(e.element,"a")))),Jn=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Pn(e.range.anchor.element,"table"):t.flatList.some((e=>!!Pn(e.element,"table")))),Yn=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Pn(e.range.anchor.element,"img"):t.flatList.some((e=>!!Pn(e.element,"img")))),ea=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Pn(e.range.anchor.element,"video"):t.flatList.some((e=>!!Pn(e.element,"video")))),ta=(e,t,n,a)=>{if(!e.range)return!1;if(e.range.anchor.isEqual(e.range.focus))return!(!e.range.anchor.element.isText()||!e.range.anchor.element.hasStyles())&&$n(e.range.anchor.element.styles,n,a);let o=t.flatList.filter((e=>e.element.isText()));return 0!=o.length&&o.every((e=>!!e.element.hasStyles()&&$n(e.element.styles,n,a)))},na=(e,t,n,a)=>{if(!e.range)return!1;if(e.range.anchor.isEqual(e.range.focus))return!(!e.range.anchor.element.isText()||!e.range.anchor.element.hasMarks())&&$n(e.range.anchor.element.marks,n,a);let o=t.flatList.filter((e=>e.element.isText()));return 0!=o.length&&o.every((e=>!!e.element.hasMarks()&&$n(e.element.marks,n,a)))},aa=e=>{let t="";return e.flatList.forEach((e=>{e.element.isText()&&(e.offset?t+=e.element.textContent.substring(e.offset[0],e.offset[1]):t+=e.element.textContent||"")})),t},oa=(e,t)=>{if(!e.range)return[];let n=t.flatList.length,a=[];for(let o=0;o<n;o++){const r=t.flatList[o];if(r.offset){let t=null;if(0==r.offset[0]&&r.offset[1]<r.element.textContent.length){const n=r.element.clone();r.element.textContent=r.element.textContent.substring(0,r.offset[1]),n.textContent=n.textContent.substring(r.offset[1]),e.addElementAfter(n,r.element),t=r.element}else if(r.offset[1]==r.element.textContent.length&&r.offset[0]>0){const n=r.element.clone();r.element.textContent=r.element.textContent.substring(0,r.offset[0]),n.textContent=n.textContent.substring(r.offset[0]),e.addElementAfter(n,r.element),t=n}else if(r.offset[0]>0&&r.offset[1]<r.element.textContent.length){const n=r.element.clone(),a=r.element.clone();r.element.textContent=r.element.textContent.substring(0,r.offset[0]),n.textContent=n.textContent.substring(r.offset[0],r.offset[1]),a.textContent=a.textContent.substring(r.offset[1]),e.addElementAfter(n,r.element),e.addElementAfter(a,n),t=n}t&&(0==o&&e.range.anchor.moveToStart(t),o==n-1&&e.range.focus.moveToEnd(t),a.push(t))}else a.push(r.element)}return a},ra=e=>{e.marks=null,e.styles=null,e.parsedom=y.BLOCK_NODE},la=(e,t=!1)=>{Un(e,t)||(ra(e),e.parsedom="div",e.hasMarks()||(e.marks={}),e.marks["data-editify-list"]=t?"ol":"ul")},ia=e=>{Wn(e)||(ra(e),e.parsedom="div",e.hasMarks()||(e.marks={}),e.marks["data-editify-task"]="uncheck")},sa=(e,t,n,a)=>{if(!e.range)return;if(!zn(n).heading.map((e=>e.value)).includes(a))throw new Error("The parameter supports only h1-h6 and p");if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();ra(t),t.parsedom=a}else t.list.forEach((e=>{if(e.element.isBlock())ra(e.element),e.element.parsedom=a;else{const t=e.element.getBlock();ra(t),t.parsedom=a}}))},ca=(e,t)=>{if(!e.range)return;const n=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(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock(),a=e.range.anchor.element.getInblock();a&&"block"==a.behavior&&!a.isPreStyle()?n(a):t.isPreStyle()||n(t)}else t.list.forEach((e=>{const t=e.element.getBlock(),a=e.element.getInblock();a&&"block"==a.behavior&&!a.isPreStyle()?n(a):t.isPreStyle()||n(t)}))},da=(e,t)=>{if(!e.range)return;const n=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(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock(),a=e.range.anchor.element.getInblock();a&&"block"==a.behavior&&!a.isPreStyle()?n(a):t.isPreStyle()||n(t)}else t.list.forEach((e=>{const t=e.element.getBlock(),a=e.element.getInblock();a&&"block"==a.behavior&&!a.isPreStyle()?n(a):t.isPreStyle()||n(t)}))},ua=(e,t)=>{if(!e.range)return;const n=Zn(e,t);if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();ra(t),n||(t.parsedom="blockquote")}else{let e=[];t.list.forEach((t=>{const n=t.element.getBlock();e.some((e=>n.isEqual(e)))||e.push(n)})),e.forEach((e=>{ra(e),n||(e.parsedom="blockquote")}))}},ma=(e,t,n)=>{if(e.range)if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock(),a=e.range.anchor.element.getInblock();a?a.hasStyles()?a.styles["text-align"]=n:a.styles={"text-align":n}:t.hasStyles()?t.styles["text-align"]=n:t.styles={"text-align":n}}else t.list.forEach((e=>{if(e.element.isBlock()||e.element.isInblock())e.element.hasStyles()?e.element.styles["text-align"]=n:e.element.styles={"text-align":n};else{const t=e.element.getBlock(),a=e.element.getInblock();a?a.hasStyles()?a.styles["text-align"]=n:a.styles={"text-align":n}:t.hasStyles()?t.styles["text-align"]=n:t.styles={"text-align":n}}}))},ha=(e,t,n)=>{if(!e.range)return;const a=Gn(e,t,n);if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();a?ra(t):la(t,n)}else{let e=[];t.list.forEach((t=>{const n=t.element.getBlock();e.some((e=>n.isEqual(e)))||e.push(n)})),e.forEach((e=>{a?ra(e):la(e,n)}))}},fa=(e,t)=>{if(!e.range)return;const n=Xn(e,t);if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();n?ra(t):ia(t)}else{let e=[];t.list.forEach((t=>{const n=t.element.getBlock();e.some((e=>n.isEqual(e)))||e.push(n)})),e.forEach((e=>{n?ra(e):ia(e)}))}},ga=(e,t,n)=>{if(e.range)if(e.range.anchor.isEqual(e.range.focus))if(e.range.anchor.element.isSpaceText())e.range.anchor.element.hasStyles()?Object.assign(e.range.anchor.element.styles,Fn(n)):e.range.anchor.element.styles=Fn(n);else if(e.range.anchor.element.isText()){const t=y.getSpaceElement();t.styles=Fn(e.range.anchor.element.styles),t.marks=Fn(e.range.anchor.element.marks),t.hasStyles()?Object.assign(t.styles,Fn(n)):t.styles=Fn(n),e.insertElement(t)}else{const t=y.getSpaceElement();t.styles=Fn(n),e.insertElement(t)}else{oa(e,t).forEach((e=>{e.isText()&&(e.hasStyles()?Object.assign(e.styles,Fn(n)):e.styles=Fn(n))}))}},pa=(e,t,n)=>{if(e.range){if(!oe.isObject(n))throw new Error("The argument must be an object");if(e.range.anchor.isEqual(e.range.focus))if(e.range.anchor.element.isSpaceText())e.range.anchor.element.hasMarks()?Object.assign(e.range.anchor.element.marks,Fn(n)):e.range.anchor.element.marks=Fn(n);else if(e.range.anchor.element.isText()){const t=y.getSpaceElement();t.styles=Fn(e.range.anchor.element.styles),t.marks=Fn(e.range.anchor.element.marks),t.hasMarks()?Object.assign(t.marks,Fn(n)):t.marks=Fn(n),e.insertElement(t)}else{const t=y.getSpaceElement();t.marks=Fn(n),e.insertElement(t)}else{oa(e,t).forEach((e=>{e.isText()&&(e.hasMarks()?Object.assign(e.marks,Fn(n)):e.marks=Fn(n))}))}}},ba=(e,t,n)=>{if(!e.range)return;const a=e=>{if(Array.isArray(n)){if(e.hasStyles()){let t={};Object.keys(e.styles).forEach((a=>{n.includes(a)||(t[a]=e.styles[a])})),e.styles=t}}else e.styles=null};if(e.range.anchor.isEqual(e.range.focus)){if(e.range.anchor.element.isSpaceText())a(e.range.anchor.element);else if(e.range.anchor.element.isText()){const t=y.getSpaceElement();t.styles=Fn(e.range.anchor.element.styles),t.marks=Fn(e.range.anchor.element.marks),a(t),e.insertElement(t)}}else{oa(e,t).forEach((e=>{e.isText()&&a(e)}))}},va=(e,t,n)=>{if(!e.range)return;const a=e=>{if(Array.isArray(n)){if(e.hasMarks()){let t={};Object.keys(e.marks).forEach((a=>{n.includes(a)||(t[a]=e.marks[a])})),e.marks=t}}else e.marks=null};if(e.range.anchor.isEqual(e.range.focus)){if(e.range.anchor.element.isSpaceText())a(e.range.anchor.element);else if(e.range.anchor.element.isText()){const t=y.getSpaceElement();t.styles=Fn(e.range.anchor.element.styles),t.marks=Fn(e.range.anchor.element.marks),a(t),e.insertElement(t)}}else{oa(e,t).forEach((e=>{e.isText()&&a(e)}))}},ya=(e,t,n)=>{if(e.range)if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock(),a=e.range.anchor.element.getInblock();a?a.hasStyles()?a.styles["line-height"]=n:a.styles={"line-height":n}:t.hasStyles()?t.styles["line-height"]=n:t.styles={"line-height":n}}else t.list.forEach((e=>{if(e.element.isBlock()||e.element.isInblock())e.element.hasStyles()?e.element.styles["line-height"]=n:e.element.styles={"line-height":n};else{const t=e.element.getBlock(),a=e.element.getInblock();a?a.hasStyles()?a.styles["line-height"]=n:a.styles={"line-height":n}:t.hasStyles()?t.styles["line-height"]=n:t.styles={"line-height":n}}}))},Ea=(e,t,n,a)=>{if(!e.range)return;t||(t=n);const o={href:n};a&&(o.target="_blank");const r=new y("inline","a",o,null,null),l=new y("text",null,null,null,t);e.addElementTo(l,r),e.insertElement(r)},wa=(e,t)=>{if(!e.range)return;const n=new y("closed","img",{src:t},null,null);e.insertElement(n)},ka=(e,t)=>{if(!e.range)return;const n=new y("closed","video",{src:t},null,null);e.insertElement(n);const a=y.getSpaceElement(),o=y.getSpaceElement();e.addElementAfter(o,n),e.addElementBefore(a,n),e.range.anchor.moveToEnd(o),e.range.focus.moveToEnd(o)},_a=(e,t,n)=>{if(!e.range)return;const a=new y("block","table",null,null,null),o=new y("inblock","tbody",null,null,null);e.addElementTo(o,a);for(let i=0;i<t;i++){const t=new y("inblock","tr",null,null,null);for(let a=0;a<n;a++){const n=new y("inblock","td",null,null,null),a=new y("closed","br",null,null,null);e.addElementTo(a,n),e.addElementTo(n,t)}e.addElementTo(t,o)}e.insertElement(a);const r=new y("block",y.BLOCK_NODE,null,null,null),l=new y("closed","br",null,null,null);e.addElementTo(l,r),e.addElementAfter(r,a),e.range.anchor.moveToStart(o),e.range.focus.moveToStart(o)},xa=(e,t)=>{if(!e.range)return;const n=Vn(e,t,"pre");if(n){let t="";y.flatElements(n.children).filter((e=>e.isText())).forEach((e=>{t+=e.textContent}));t.split("\n").forEach((t=>{const a=new y("block",y.BLOCK_NODE,null,null,null),o=new y("text",null,null,null,t);e.addElementTo(o,a),e.addElementBefore(a,n)})),n.toEmpty()}else if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();ra(t),t.parsedom="pre";const n=new y("block",y.BLOCK_NODE,null,null,null),a=new y("closed","br",null,null,null);e.addElementTo(a,n),e.addElementAfter(n,t)}else{e.range.anchor.moveToStart(t.list[0].element.getBlock()),e.range.focus.moveToEnd(t.list[t.list.length-1].element.getBlock());const n=t.flatList.filter((e=>e.element.isText())),a={};n.forEach((e=>{a[e.element.getBlock().key]?a[e.element.getBlock().key].push(e.element.clone()):a[e.element.getBlock().key]=[e.element.clone()]}));const o=new y("block","pre",null,null,null);Object.keys(a).forEach(((t,n)=>{if(n>0){const t=new y("text",null,null,null,"\n");o.hasChildren()?e.addElementTo(t,o,o.children.length):e.addElementTo(t,o)}a[t].forEach((t=>{o.hasChildren()?e.addElementTo(t,o,o.children.length):e.addElementTo(t,o)}))})),e.delete(),e.insertElement(o);const r=new y("block",y.BLOCK_NODE,null,null,null),l=new y("closed","br",null,null,null);e.addElementTo(l,r),e.addElementAfter(r,o)}},Ca=function(e,t){if("table"==t.parsedom){const n={"data-editify-element":t.key};t.hasMarks()?Object.assign(t.marks,n):t.marks=n;const a={"white-space":"pre-wrap","word-break":"break-word"};t.hasStyles()?Object.assign(t.styles,a):t.styles=a;const o=y.flatElements(t.children),r=o.filter((e=>"tr"==e.parsedom));let l=o.find((e=>"colgroup"==e.parsedom));if(l)l.children.forEach((e=>{e.hasMarks()?e.marks.width||(e.marks.width="auto"):e.marks={width:"auto"}}));else{l=new y("inblock","colgroup",null,null,null);for(let t=function(e){const t=e.children||[];let n=0;return t.forEach((e=>{if(e.hasMarks()&&e.marks.hasOwnProperty("colspan")){const t=Number(e.marks.colspan);isNaN(t)||(n+=t)}else n+=1})),n}(r[0])-1;t>=0;t--){const t=new y("closed","col",{width:"auto"},null,null);e.addElementTo(t,l)}}t.children=[];const i=new y("inblock","tbody",null,null,null);r.reverse().forEach((t=>{e.addElementTo(t,i)})),e.addElementTo(i,t),e.addElementTo(l,t)}"th"==t.parsedom&&(t.parsedom="td")},Ba=function(e,t,n,a){if("pre"==t.parsedom){const o={"data-editify-element":t.key};if(t.hasMarks()?Object.assign(t.marks,o):t.marks=o,n&&t.hasChildren()){let n=t.marks["data-editify-hljs"]||"";if(n&&a){a.some((e=>oe.isObject(e)?e.value==n:e==n))||(n="")}const o=y.flatElements(t.children).filter((e=>e.isText()&&!e.isEmpty())),r=function(e,t){return t?kt.highlight(e,{language:t,ignoreIllegals:!0}).value:kt.highlightAuto(e).value}(o.reduce(((e,t)=>e+t.textContent),""),n);if(r){const n=e.parseHtml(r);t.children=n,n.forEach((e=>{e.parent=t})),((e,t,n,a)=>{if(e.range){if(e.range.anchor.element.getBlock().isEqual(t)){const t=n.findIndex((t=>e.range.anchor.element.isEqual(t))),o=n.filter(((e,n)=>n<t)).reduce(((e,t)=>e+t.textContent.length),0)+e.range.anchor.offset,r=y.flatElements(a).filter((e=>e.isText()&&!e.isEmpty()));let l=0,i=0;for(;l<r.length;){let t=i+r[l].textContent.length;if(o>=i&&o<=t){e.range.anchor.element=r[l],e.range.anchor.offset=o-i;break}l++,i=t}}if(e.range.focus.element.getBlock().isEqual(t)){const t=n.findIndex((t=>e.range.focus.element.isEqual(t))),o=n.filter(((e,n)=>n<t)).reduce(((e,t)=>e+t.textContent.length),0)+e.range.focus.offset,r=y.flatElements(a).filter((e=>e.isText()&&!e.isEmpty()));let l=0,i=0;for(;l<r.length;){let t=i+r[l].textContent.length;if(o>=i&&o<=t){e.range.focus.element=r[l],e.range.focus.offset=o-i;break}l++,i=t}}}})(e,t,o,n)}else{const n=new y("closed","br",null,null,null);t.children=[n],n.parent=t,e.range&&(e.range.anchor.moveToStart(n),e.range.focus.moveToStart(n))}}}},Ta={placement:{type:String,default:"top",validator:e=>["top","left","right","bottom"].includes(e)},color:{type:String,default:null},background:{type:String,default:null}},Sa=["data-editify-placement"],Na=(e,t)=>{const n=e.__vccOpts||e;for(const[a,o]of t)n[a]=o;return n},Oa=Na(t.defineComponent({name:"Triangle",__name:"triangle",props:Ta,setup(e){const n=e,a=t.computed((()=>"top"==n.placement?{borderBottomColor:n.color||""}:"bottom"==n.placement?{borderTopColor:n.color||""}:"left"==n.placement?{borderRightColor:n.color||""}:"right"==n.placement?{borderLeftColor:n.color||""}:{})),o=t.computed((()=>"top"==n.placement?{borderBottomColor:n.background||""}:"bottom"==n.placement?{borderTopColor:n.background||""}:"left"==n.placement?{borderRightColor:n.background||""}:"right"==n.placement?{borderLeftColor:n.background||""}:{}));return(e,n)=>(t.openBlock(),t.createElementBlock("div",{class:"editify-triangle",style:t.normalizeStyle(a.value),"data-editify-placement":e.placement},[t.createElementVNode("div",{class:"editify-triangle-el",style:t.normalizeStyle(o.value)},null,4)],12,Sa))}}),[["__scopeId","data-v-e1abc967"]]),Aa={modelValue:{type:Boolean,default:!1},node:{type:[String,HTMLElement],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}},Ra=["data-editify-placement"],Ma=Na(t.defineComponent({name:"Layer",__name:"layer",props:Aa,emits:["update:modelValue","show","shown","hidden"],setup(e,{expose:n,emit:a}){const o=t.getCurrentInstance(),r=e,l=a,i=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.ref(null),u=t.computed((()=>"bottom-start"==i.value||"bottom"==i.value||"bottom-end"==i.value?"top":"top-start"==i.value||"top"==i.value||"top-end"==i.value?"bottom":"left-start"==i.value||"left"==i.value||"left-end"==i.value?"right":"right-start"==i.value||"right"==i.value||"right-end"==i.value?"left":"top")),m=t.computed((()=>({borderColor:r.border&&r.borderColor||"",background:r.background||"",color:r.color||""}))),h=()=>r.node?te.isElement(r.node)?r.node:document.body.querySelector(r.node):null,f=()=>{i.value=null;const e=window.getSelection();if(e&&e.rangeCount){const n=e.getRangeAt(0).getClientRects();if(n.length){const e=n[0],a=n[n.length-1],o=te.getElementBounding(c.value.offsetParent),l=document.documentElement.clientHeight||window.innerHeight,u=document.documentElement.clientWidth||window.innerWidth;"top"==r.placement||"top-start"==r.placement||"top-end"==r.placement?e.top>=0&&e.top>=o.top&&e.top>=c.value.offsetHeight?i.value=r.placement:l-a.bottom>=0&&l-a.bottom>=o.bottom&&l-a.bottom>=c.value.offsetHeight&&(i.value="top"==r.placement?"bottom":"top-start"==r.placement?"bottom-start":"bottom-end"):"bottom"!=r.placement&&"bottom-start"!=r.placement&&"bottom-end"!=r.placement||(l-a.bottom>=0&&l-a.bottom>=o.bottom&&l-a.bottom>=c.value.offsetHeight?i.value=r.placement:e.top>=0&&e.top>=o.top&&e.top>=c.value.offsetHeight&&(i.value="bottom"==r.placement?"top":"bottom-start"==r.placement?"top-start":"top-end")),"top"==i.value?u-e.right+e.width/2<c.value.offsetWidth/2?i.value="top-end":e.left+e.width/2<c.value.offsetWidth/2&&(i.value="top-start"):"bottom"==i.value?u-a.right+a.width/2<c.value.offsetWidth/2?i.value="bottom-end":a.left+a.width/2<c.value.offsetWidth/2&&(i.value="bottom-start"):"top-start"==i.value?u-e.right+e.width<c.value.offsetWidth&&(u-e.right+e.width/2>=c.value.offsetWidth/2?i.value="top":i.value="top-end"):"bottom-start"==i.value?u-a.right+a.width<c.value.offsetWidth&&(u-a.right+a.width/2>=c.value.offsetWidth/2?i.value="bottom":i.value="bottom-end"):"top-end"==i.value?e.left+e.width<c.value.offsetWidth&&(e.left+e.width/2>=c.value.offsetWidth/2?i.value="top":i.value="top-start"):"bottom-end"==i.value&&a.left+a.width<c.value.offsetWidth&&(a.left+a.width/2>=c.value.offsetWidth/2?i.value="bottom":i.value="bottom-start"),t.nextTick((()=>{"top"==i.value?(c.value.style.left=e.left-o.left+e.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto",c.value.style.top=e.top-o.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"top-start"==i.value?(c.value.style.left=e.left-o.left+"px",c.value.style.right="auto",c.value.style.top=e.top-o.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"top-end"==i.value?(c.value.style.left="auto",c.value.style.right=u-e.right-o.right+"px",c.value.style.top=e.top-o.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"bottom"==i.value?(c.value.style.left=a.left-o.left+a.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto",c.value.style.top="auto",c.value.style.bottom=l-a.bottom-o.bottom-c.value.offsetHeight+"px"):"bottom-start"==i.value?(c.value.style.left=a.left-o.left+"px",c.value.style.right="auto",c.value.style.top="auto",c.value.style.bottom=l-a.bottom-o.bottom-c.value.offsetHeight+"px"):"bottom-end"==i.value?(c.value.style.left="auto",c.value.style.right=u-a.right-o.right+"px",c.value.style.top="auto",c.value.style.bottom=l-a.bottom-o.bottom-c.value.offsetHeight+"px"):(c.value.style.top="auto",c.value.style.bottom=(o.bottom<0?-o.bottom:0)+"px","top"==r.placement?u-e.right+e.width/2<c.value.offsetWidth/2?(c.value.style.left="auto",c.value.style.right=u-e.right-o.right+"px"):e.left+e.width/2<c.value.offsetWidth/2?(c.value.style.left=e.left-o.left+"px",c.value.style.right="auto"):(c.value.style.left=e.left-o.left+e.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):"bottom"==r.placement?u-a.right+a.width/2<c.value.offsetWidth/2?(c.value.style.left="auto",c.value.style.right=u-a.right-o.right+"px"):a.left+a.width/2<c.value.offsetWidth/2?(c.value.style.left=a.left-o.left+"px",c.value.style.right="auto"):(c.value.style.left=a.left-o.left+a.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):"top-start"==r.placement?u-e.right+e.width<c.value.offsetWidth?u-e.right+e.width/2>=c.value.offsetWidth/2?(c.value.style.left=e.left-o.left+e.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=u-e.right-o.right+"px"):(c.value.style.left=e.left-o.left+"px",c.value.style.right="auto"):"bottom-start"==r.placement?u-a.right+a.width<c.value.offsetWidth?u-a.right+a.width/2>=c.value.offsetWidth/2?(c.value.style.left=a.left-o.left+a.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=u-a.right-o.right+"px"):(c.value.style.left=a.left-o.left+"px",c.value.style.right="auto"):"top-end"==r.placement?e.left+e.width<c.value.offsetWidth?e.left+e.width/2>=c.value.offsetWidth/2?(c.value.style.left=e.left-o.left+e.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left=e.left-o.left+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=u-e.right-o.right+"px"):"bottom-end"==r.placement&&(a.left+a.width<c.value.offsetWidth?a.left+a.width/2>=c.value.offsetWidth/2?(c.value.style.left=a.left-o.left+a.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left=a.left-o.left+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=u-a.right-o.right+"px"))),r.showTriangle&&(()=>{const e=window.getSelection();if(e&&e.rangeCount){const t=e.getRangeAt(0).getClientRects();if(t.length){const e=t[0],n=t[t.length-1];"top"==i.value?(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"top-start"==i.value?(d.value.$el.style.left=(s.value.offsetWidth>e.width?e.width:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"top-end"==i.value?(d.value.$el.style.left="auto",d.value.$el.style.right=(s.value.offsetWidth>e.width?e.width:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"bottom"==i.value?(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):"bottom-start"==i.value?(d.value.$el.style.left=(s.value.offsetWidth>n.width?n.width:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):"bottom-end"==i.value?(d.value.$el.style.left="auto",d.value.$el.style.right=(s.value.offsetWidth>n.width?n.width:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=1-d.value.$el.offsetHeight+"px",d.value.$el.style.bottom="auto")}}})()}))}}},g=()=>{const e=h();if(!te.isElement(e))return;i.value=null;const n=te.getElementBounding(e),a=te.getElementBounding(c.value.offsetParent);"top"==r.placement||"top-start"==r.placement||"top-end"==r.placement?n.top>=0&&n.top>=a.top&&n.top>=c.value.offsetHeight?i.value=r.placement:n.bottom>=0&&n.bottom>=a.bottom&&n.bottom>=c.value.offsetHeight&&(i.value="top"==r.placement?"bottom":"top-start"==r.placement?"bottom-start":"bottom-end"):"bottom"!=r.placement&&"bottom-start"!=r.placement&&"bottom-end"!=r.placement||(n.bottom>=0&&n.bottom>=a.bottom&&n.bottom>=c.value.offsetHeight?i.value=r.placement:n.top>=0&&n.top>=a.top&&n.top>=c.value.offsetHeight&&(i.value="bottom"==r.placement?"top":"bottom-start"==r.placement?"top-start":"top-end")),"top"==i.value?n.right+e.offsetWidth/2<c.value.offsetWidth/2?i.value="top-end":n.left+e.offsetWidth/2<c.value.offsetWidth/2&&(i.value="top-start"):"top-start"==i.value?n.right+e.offsetWidth<c.value.offsetWidth&&(n.right+e.offsetWidth/2>=c.value.offsetWidth/2?i.value="top":i.value="top-end"):"top-end"==i.value?n.left+e.offsetWidth<c.value.offsetWidth&&(n.left+e.offsetWidth/2>=c.value.offsetWidth/2?i.value="top":i.value="top-start"):"bottom"==i.value?n.right+e.offsetWidth/2<c.value.offsetWidth/2?i.value="bottom-end":n.left+e.offsetWidth/2<c.value.offsetWidth/2&&(i.value="bottom-start"):"bottom-start"==i.value?n.right+e.offsetWidth<c.value.offsetWidth&&(n.right+e.offsetWidth/2>=c.value.offsetWidth/2?i.value="bottom":i.value="bottom-end"):"bottom-end"==i.value&&n.left+e.offsetWidth<c.value.offsetWidth&&(n.left+e.offsetWidth/2>=c.value.offsetWidth/2?i.value="bottom":i.value="bottom-start"),t.nextTick((()=>{"top"==i.value?(c.value.style.left=n.left-a.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto",c.value.style.top=n.top-a.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"top-start"==i.value?(c.value.style.left=n.left-a.left+"px",c.value.style.right="auto",c.value.style.top=n.top-a.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"top-end"==i.value?(c.value.style.left="auto",c.value.style.right=n.right-a.right+"px",c.value.style.top=n.top-a.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"bottom"==i.value?(c.value.style.left=n.left-a.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto",c.value.style.top="auto",c.value.style.bottom=n.bottom-a.bottom-c.value.offsetHeight+"px"):"bottom-start"==i.value?(c.value.style.left=n.left-a.left+"px",c.value.style.right="auto",c.value.style.top="auto",c.value.style.bottom=n.bottom-a.bottom-c.value.offsetHeight+"px"):"bottom-end"==i.value?(c.value.style.left="auto",c.value.style.right=n.right-a.right+"px",c.value.style.top="auto",c.value.style.bottom=n.bottom-a.bottom-c.value.offsetHeight+"px"):(c.value.style.top="auto",c.value.style.bottom=(a.bottom<0?-a.bottom:0)+"px","top"==r.placement||"bottom"==r.placement?n.right+e.offsetWidth/2<c.value.offsetWidth/2?(c.value.style.left="auto",c.value.style.right=n.right-a.right+"px"):n.left+e.offsetWidth/2<c.value.offsetWidth/2?(c.value.style.left=n.left-a.left+"px",c.value.style.right="auto"):(c.value.style.left=n.left-a.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):"top-start"==r.placement||"bottom-start"==r.placement?n.right+e.offsetWidth<c.value.offsetWidth?n.right+e.offsetWidth/2>=c.value.offsetWidth/2?(c.value.style.left=n.left-a.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=n.right-a.right+"px"):(c.value.style.left=n.left-a.left+"px",c.value.style.right="auto"):"top-end"!=r.placement&&"bottom-end"!=r.placement||(n.left+e.offsetWidth<c.value.offsetWidth?n.left+e.offsetWidth/2>=c.value.offsetWidth/2?(c.value.style.left=n.left-a.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left=n.left-a.left+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=n.right-a.right+"px"))),r.showTriangle&&(()=>{const e=h();te.isElement(e)&&("top"==i.value?(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"top-start"==i.value?(d.value.$el.style.left=(s.value.offsetWidth>e.offsetWidth?e.offsetWidth:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"top-end"==i.value?(d.value.$el.style.left="auto",d.value.$el.style.right=(s.value.offsetWidth>e.offsetWidth?e.offsetWidth:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"bottom"==i.value?(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):"bottom-start"==i.value?(d.value.$el.style.left=(s.value.offsetWidth>e.offsetWidth?e.offsetWidth:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):"bottom-end"==i.value?(d.value.$el.style.left="auto",d.value.$el.style.right=(s.value.offsetWidth>e.offsetWidth?e.offsetWidth:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=1-d.value.$el.offsetHeight+"px",d.value.$el.style.bottom="auto"))})()}))},p=()=>{r.useRange?f():g()},b=e=>{p(),l("show",e)},v=e=>{l("shown",e)},y=e=>{l("hidden",e)},E=()=>{r.modelValue&&l("update:modelValue",!1)},w=e=>{te.isElement(c.value)&&(te.isContains(c.value.offsetParent,e.target)||r.modelValue&&l("update:modelValue",!1))};return t.onMounted((()=>{r.modelValue&&p(),ie.on(window,`click.editify_layer_${o.uid}`,w),ie.on(window,`resize.editify_layer_${o.uid}`,E)})),t.onBeforeUnmount((()=>{ie.off(window,`click.editify_layer_${o.uid} resize.editify_layer_${o.uid}`)})),n({setPosition:p}),(e,n)=>(t.openBlock(),t.createBlock(t.Transition,{name:e.animation?"editify-layer-"+e.animation:"editify-layer",onEnter:b,onAfterEnter:v,onAfterLeave:y},{default:t.withCtx((()=>[e.modelValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:"editify-layer","data-editify-placement":i.value||null,style:t.normalizeStyle({zIndex:e.zIndex}),ref_key:"elRef",ref:c},[e.showTriangle?(t.openBlock(),t.createBlock(Oa,{key:0,color:e.border&&e.borderColor?e.borderColor:e.background,background:e.background,placement:u.value,ref_key:"triangleRef",ref:d},null,8,["color","background","placement"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"wrapRef",ref:s,class:t.normalizeClass(["editify-layer-wrap",{"editify-border":e.border}]),style:t.normalizeStyle(m.value)},[t.renderSlot(e.$slots,"default",{},void 0,!0)],6)],12,Ra)):t.createCommentVNode("",!0)])),_:3},8,["name"]))}}),[["__scopeId","data-v-09578d83"]]),Ia={content:{type:String,default:""},disabled:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},La={class:"editify-tooltip-content"},Da=Na(t.defineComponent({name:"Tooltip",__name:"tooltip",props:Ia,setup(e){const n=e,a=t.ref(!1),o=t.ref(null),r=()=>{n.disabled||(a.value=!0)},l=()=>{n.disabled||(a.value=!1)};return(e,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-tooltip",{"editify-block":e.block}])},[t.createElementVNode("div",{ref_key:"targetRef",ref:o,class:"editify-tooltip-target",onMouseenter:r,onMouseleave:l},[t.renderSlot(e.$slots,"default",{},void 0,!0)],544),t.createVNode(Ma,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=e=>a.value=e),node:o.value,border:"","border-color":"#000",background:"#000","show-triangle":"",color:"#fff",placement:"bottom",animation:"fade","z-index":10},{default:t.withCtx((()=>[t.createElementVNode("div",La,t.toDisplayString(e.content),1)])),_:1},8,["modelValue","node"])],2))}}),[["__scopeId","data-v-7b5e30d1"]]),$a={value:{type:String,default:""}},Fa=Na(t.defineComponent({name:"Icon",__name:"icon",props:$a,setup:e=>(e,n)=>(t.openBlock(),t.createElementBlock("i",{class:t.normalizeClass(["editify-icon","editify-icon-"+e.value])},null,2))}),[["__scopeId","data-v-6e00035b"]]),za={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}},Pa={class:"editify-button"},Va={key:0,class:"editify-button-slot"},Ha={key:1},ja={key:1,class:"editify-button-options"},Ua=["onClick"],Wa={key:1,class:"editify-button-option-flex"},qa=Na(t.defineComponent({name:"Button",__name:"button",props:za,emits:["operate","layerShow","layerShown","layerHidden"],setup(e,{expose:n,emit:a}){const o=e,r=a,l=t.ref(!1),i=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.computed((()=>{let e=[],t="",n="";return oe.isObject(o.selectConfig)&&(Array.isArray(o.selectConfig.options)&&(e=o.selectConfig.options.map((e=>oe.isObject(e)?{label:e.label,value:e.value,icon:e.icon,style:e.style}:{label:e,value:e}))),"number"==typeof o.selectConfig.width&&(t=o.selectConfig.width),"number"==typeof o.selectConfig.maxHeight&&(n=o.selectConfig.maxHeight)),{options:e,width:t,maxHeight:n}})),u=t.computed((()=>{let e=[],t="",n="",a="";if(oe.isObject(o.displayConfig)){if("string"!=typeof o.displayConfig.value&&"number"!=typeof o.displayConfig.value||(a=o.displayConfig.value),Array.isArray(o.displayConfig.options)){e=o.displayConfig.options.map((e=>oe.isObject(e)?{label:e.label,value:e.value,icon:e.icon,style:e.style}:{label:e,value:e})),!e.find((e=>e.value==a))&&e[0]&&(a=e[0].value)}"number"==typeof o.displayConfig.width&&(t=o.displayConfig.width),"number"==typeof o.displayConfig.maxHeight&&(n=o.displayConfig.maxHeight)}return{options:e,width:t,maxHeight:n,value:a}})),m=t.computed((()=>"select"==o.type?d.value.options:u.value.options)),h=t.computed((()=>{const e=u.value.options.find((e=>e.value==u.value.value));return e?e.label:""})),f=t.computed((()=>o.color?se.hex2rgb(o.color):[])),g=t.computed((()=>{if(o.disabled)return{};if(o.color){if(o.active||"down"==i.value)return{color:o.color,backgroundColor:`rgba(${f.value[0]},${f.value[1]},${f.value[2]},0.15)`};if("hover"==i.value)return{color:`rgba(${f.value[0]},${f.value[1]},${f.value[2]},0.9)`,backgroundColor:`rgba(${f.value[0]},${f.value[1]},${f.value[2]},0.05)`}}return{}})),p=()=>{o.disabled||("default"==o.type?r("operate",o.name):l.value=!l.value)};return n({show:l,status:i}),(e,n)=>(t.openBlock(),t.createElementBlock("div",Pa,[t.createElementVNode("div",{class:t.normalizeClass(["editify-button-wrap",{"editify-right-border":e.rightBorder,"editify-left-border":e.leftBorder}])},[t.createVNode(Da,{content:e.title,disabled:!e.tooltip},{default:t.withCtx((()=>[t.createElementVNode("div",{ref_key:"btnRef",ref:s,style:t.normalizeStyle(g.value),class:t.normalizeClass(["editify-button-el",{"editify-disabled":e.disabled,"editify-active":e.active}]),onMouseenter:n[0]||(n[0]=e=>i.value="hover"),onMouseleave:n[1]||(n[1]=e=>i.value=null),onMousedown:n[2]||(n[2]=e=>i.value="down"),onMouseup:n[3]||(n[3]=e=>i.value="hover"),onClick:p},["default"==e.type||"select"==e.type?(t.openBlock(),t.createElementBlock("div",Va,[t.renderSlot(e.$slots,"default",{},void 0,!0)])):"display"==e.type?(t.openBlock(),t.createElementBlock("div",Ha,t.toDisplayString(h.value),1)):t.createCommentVNode("",!0),"select"==e.type||"display"==e.type?(t.openBlock(),t.createBlock(Fa,{key:2,value:"caret-down",class:t.normalizeClass(["editify-button-caret",{"editify-rotate":l.value}])},null,8,["class"])):t.createCommentVNode("",!0)],38)])),_:3},8,["content","disabled"]),t.createVNode(Ma,{ref_key:"layerRef",ref:c,modelValue:l.value,"onUpdate:modelValue":n[4]||(n[4]=e=>l.value=e),node:s.value,border:"",fade:"",placement:"bottom-start","z-index":12,animation:"translate",onShow:n[5]||(n[5]=e=>r("layerShow")),onShown:n[6]||(n[6]=e=>r("layerShown")),onHidden:n[7]||(n[7]=e=>r("layerHidden"))},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"editify-button-layer",style:t.normalizeStyle({width:("select"==e.type?d.value.width:u.value.width)+"px",maxHeight:("select"==e.type?d.value.maxHeight:u.value.maxHeight)+"px",overflow:e.hideScroll?"visible":""})},[e.$slots.layer?t.renderSlot(e.$slots,"layer",{key:0,options:m.value},void 0,!0):(t.openBlock(),t.createElementBlock("div",ja,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.value,(n=>(t.openBlock(),t.createElementBlock("div",{onClick:e=>(e=>{o.disabled||(r("operate",o.name,e.value),l.value=!1)})(n),class:t.normalizeClass(["editify-button-option",{"editify-active":"display"==e.type&&n.value==u.value.value}]),style:t.normalizeStyle(n.style||"")},[e.$slots.option?t.renderSlot(e.$slots,"option",{key:0,item:n},void 0,!0):(t.openBlock(),t.createElementBlock("div",Wa,[n.icon?(t.openBlock(),t.createBlock(Fa,{key:0,value:n.icon},null,8,["value"])):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(n.label),1)]))],14,Ua)))),256))]))],4)])),_:3},8,["modelValue","node"])],2)]))}}),[["__scopeId","data-v-14398008"]]),Ka={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=>oe.matchingText(e,"hex")}},Za=["data-editify-placement","textContent"],Ga=["value","disabled","checked"],Xa=["data-editify-placement","textContent"],Qa=Na(t.defineComponent({name:"Checkbox",__name:"checkbox",props:Ka,emits:["update:modelValue","change"],setup(e,{emit:n}){const a=e,o=n,r=t.computed((()=>"boolean"==typeof a.modelValue?a.modelValue:!!Array.isArray(a.modelValue)&&a.modelValue.some((e=>oe.equal(e,a.value))))),l=t.computed((()=>{let e={};return a.color&&r.value&&!a.disabled&&(e.backgroundColor=a.color,e.borderColor=a.color),e})),i=e=>{if(Array.isArray(a.modelValue)){let t=[...a.modelValue];e.target.checked&&!r.value?t.push(a.value):r.value&&(t=t.filter((e=>!oe.equal(e,a.value)))),o("update:modelValue",t),o("change",t)}else"boolean"==typeof a.modelValue&&(o("update:modelValue",e.target.checked),o("change",e.target.checked))};return(e,n)=>(t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["editify-checkbox",{"editify-disabled":e.disabled}])},["left"==e.placement&&e.label?(t.openBlock(),t.createElementBlock("span",{key:0,class:"editify-checkbox-label","data-editify-placement":e.placement,textContent:t.toDisplayString(e.label)},null,8,Za)):t.createCommentVNode("",!0),t.createElementVNode("input",{onChange:i,value:e.value,disabled:e.disabled,checked:r.value,type:"checkbox"},null,40,Ga),t.createElementVNode("span",{class:t.normalizeClass(["editify-checkbox-item",{"editify-reverse":!e.color,"editify-round":e.round,"editify-checked":r.value&&!e.disabled}]),style:t.normalizeStyle(l.value)},[t.createVNode(Fa,{value:"check",style:t.normalizeStyle({opacity:r.value?"":0})},null,8,["style"])],6),"right"==e.placement&&e.label?(t.openBlock(),t.createElementBlock("span",{key:1,class:"editify-checkbox-label","data-editify-placement":e.placement,textContent:t.toDisplayString(e.label)},null,8,Xa)):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d99c609b"]]),Ja={data:{type:Array,default:function(){return[]}},value:{type:String,default:null},color:{type:String,default:""},tooltip:{type:Boolean,default:!1}},Ya={class:"editify-colors"},eo={class:"editify-colors-list"},to=["onClick"],no=Na(t.defineComponent({name:"Colors",__name:"colors",props:Ja,emits:["change"],setup(e,{emit:n}){const a=n,o=t.inject("$editTrans"),r=e=>{a("change",e.value)};return(e,n)=>(t.openBlock(),t.createElementBlock("div",Ya,[t.createElementVNode("div",{class:"editify-colors-header",onClick:n[0]||(n[0]=e=>r({value:""}))},[t.createVNode(Fa,{value:"remove"}),t.createElementVNode("span",null,t.toDisplayString(t.unref(o)("defaultColor")),1)]),t.createElementVNode("div",eo,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.data,(n=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-color",{"editify-active":e.value==n.value}]),style:t.normalizeStyle({borderColor:e.value==n.value&&e.color||""})},[t.createVNode(Da,{block:"",content:n.label,disabled:!e.tooltip},{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:e=>r(n),class:"editify-color-el",style:t.normalizeStyle({background:n.value})},null,12,to)])),_:2},1032,["content","disabled"])],6)))),256))])]))}}),[["__scopeId","data-v-dec8d117"]]),ao={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},color:{type:String,default:""}},oo={key:0,class:"editify-toolbar-link"},ro={class:"editify-toolbar-link-label"},lo=["placeholder"],io={class:"editify-toolbar-link-footer"},so={class:"editify-toolbar-link-operations"},co=["href"],uo=Na(t.defineComponent({name:"Toolbar",__name:"toolbar",props:ao,emits:["update:modelValue"],setup(e,{emit:n}){const a=e,o=n,r=t.inject("editor"),l=t.inject("dataRangeCaches"),i=t.inject("$editTrans"),s=t.ref(null),c=t.ref(null),d=t.ref(null),u=t.ref(null),m=t.ref({url:"",newOpen:!1}),h=t.ref({controls:!1,loop:!1,autoplay:!1,muted:!1}),f=t.ref({show:a.config.codeBlock.languages.show,displayConfig:{options:a.config.codeBlock.languages.options,value:"",width:a.config.codeBlock.languages.width,maxHeight:a.config.codeBlock.languages.maxHeight},leftBorder:a.config.codeBlock.languages.leftBorder,rightBorder:a.config.codeBlock.languages.rightBorder,active:!1,disabled:!1}),g=t.ref({show:a.config.text.heading.show,displayConfig:{options:a.config.text.heading.options,value:"",width:a.config.text.heading.width,maxHeight:a.config.text.heading.maxHeight},defaultValue:a.config.text.heading.defaultValue,leftBorder:a.config.text.heading.leftBorder,rightBorder:a.config.text.heading.rightBorder,active:!1,disabled:!1}),p=t.ref({show:a.config.text.align.show,selectConfig:{options:a.config.text.align.options,width:a.config.text.align.width,maxHeight:a.config.text.align.maxHeight},leftBorder:a.config.text.align.leftBorder,rightBorder:a.config.text.align.rightBorder,active:!1,disabled:!1}),b=t.ref({show:a.config.text.orderList.show,leftBorder:a.config.text.orderList.leftBorder,rightBorder:a.config.text.orderList.rightBorder,active:!1,disabled:!1}),v=t.ref({show:a.config.text.unorderList.show,leftBorder:a.config.text.unorderList.leftBorder,rightBorder:a.config.text.unorderList.rightBorder,active:!1,disabled:!1}),E=t.ref({show:a.config.text.task.show,leftBorder:a.config.text.task.leftBorder,rightBorder:a.config.text.task.rightBorder,active:!1,disabled:!1}),w=t.ref({show:a.config.text.bold.show,leftBorder:a.config.text.bold.leftBorder,rightBorder:a.config.text.bold.rightBorder,active:!1,disabled:!1}),k=t.ref({show:a.config.text.italic.show,leftBorder:a.config.text.italic.leftBorder,rightBorder:a.config.text.italic.rightBorder,active:!1,disabled:!1}),_=t.ref({show:a.config.text.strikethrough.show,leftBorder:a.config.text.strikethrough.leftBorder,rightBorder:a.config.text.strikethrough.rightBorder,active:!1,disabled:!1}),x=t.ref({show:a.config.text.underline.show,leftBorder:a.config.text.underline.leftBorder,rightBorder:a.config.text.underline.rightBorder,active:!1,disabled:!1}),C=t.ref({show:a.config.text.code.show,leftBorder:a.config.text.code.leftBorder,rightBorder:a.config.text.code.rightBorder,active:!1,disabled:!1}),B=t.ref({show:a.config.text.super.show,leftBorder:a.config.text.super.leftBorder,rightBorder:a.config.text.super.rightBorder,active:!1,disabled:!1}),T=t.ref({show:a.config.text.sub.show,leftBorder:a.config.text.sub.leftBorder,rightBorder:a.config.text.sub.rightBorder,active:!1,disabled:!1}),S=t.ref({show:a.config.text.fontSize.show,displayConfig:{options:a.config.text.fontSize.options,value:"",width:a.config.text.fontSize.width,maxHeight:a.config.text.fontSize.maxHeight},defaultValue:a.config.text.fontSize.defaultValue,leftBorder:a.config.text.fontSize.leftBorder,rightBorder:a.config.text.fontSize.rightBorder,active:!1,disabled:!1}),N=t.ref({show:a.config.text.fontFamily.show,displayConfig:{options:a.config.text.fontFamily.options,value:"",width:a.config.text.fontFamily.width,maxHeight:a.config.text.fontFamily.maxHeight},defaultValue:a.config.text.fontFamily.defaultValue,leftBorder:a.config.text.fontFamily.leftBorder,rightBorder:a.config.text.fontFamily.rightBorder,active:!1,disabled:!1}),O=t.ref({show:a.config.text.lineHeight.show,displayConfig:{options:a.config.text.lineHeight.options,value:"",width:a.config.text.lineHeight.width,maxHeight:a.config.text.lineHeight.maxHeight},defaultValue:a.config.text.lineHeight.defaultValue,leftBorder:a.config.text.lineHeight.leftBorder,rightBorder:a.config.text.lineHeight.rightBorder,active:!1,disabled:!1}),A=t.ref({show:a.config.text.foreColor.show,selectConfig:{options:a.config.text.foreColor.options},leftBorder:a.config.text.foreColor.leftBorder,rightBorder:a.config.text.foreColor.rightBorder,value:"",active:!1,disabled:!1}),R=t.ref({show:a.config.text.backColor.show,selectConfig:{options:a.config.text.backColor.options},leftBorder:a.config.text.backColor.leftBorder,rightBorder:a.config.text.backColor.rightBorder,value:"",active:!1,disabled:!1}),M=t.ref({show:a.config.text.formatClear.show,leftBorder:a.config.text.formatClear.leftBorder,rightBorder:a.config.text.formatClear.rightBorder,active:!1,disabled:!1}),I=t.computed({get:()=>a.modelValue,set(e){o("update:modelValue",e)}}),L=e=>{a.color&&(e.currentTarget.style.borderColor=a.color)},D=e=>{e.currentTarget.style.borderColor=""},$=()=>{ba(r.value,l.value),va(r.value,l.value),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},F=e=>{ga(r.value,l.value,{"background-color":e}),u.value.show=!1,r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},z=e=>{ga(r.value,l.value,{color:e}),d.value.show=!1,r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},P=(e,t)=>{ya(r.value,l.value,t),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},V=(e,t)=>{ga(r.value,l.value,{"font-family":t}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},H=(e,t)=>{ga(r.value,l.value,{"font-size":t}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},j=()=>{ta(r.value,l.value,"vertical-align","super")?ba(r.value,l.value,["vertical-align"]):ga(r.value,l.value,{"vertical-align":"super"}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},U=()=>{ta(r.value,l.value,"vertical-align","sub")?ba(r.value,l.value,["vertical-align"]):ga(r.value,l.value,{"vertical-align":"sub"}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},W=()=>{na(r.value,l.value,"data-editify-code")?va(r.value,l.value,["data-editify-code"]):pa(r.value,l.value,{"data-editify-code":!0}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},q=()=>{ta(r.value,l.value,"text-decoration","underline")||ta(r.value,l.value,"text-decoration-line","underline")?ba(r.value,l.value,["text-decoration","text-decoration-line"]):ga(r.value,l.value,{"text-decoration":"underline"}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},K=()=>{ta(r.value,l.value,"text-decoration","line-through")||ta(r.value,l.value,"text-decoration-line","line-through")?ba(r.value,l.value,["text-decoration","text-decoration-line"]):ga(r.value,l.value,{"text-decoration":"line-through"}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},Z=e=>{ha(r.value,l.value,"orderList"==e),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},G=()=>{fa(r.value,l.value),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},X=()=>{ta(r.value,l.value,"font-style","italic")?ba(r.value,l.value,["font-style"]):ga(r.value,l.value,{"font-style":"italic"}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},Q=()=>{ta(r.value,l.value,"font-weight","bold")||ta(r.value,l.value,"font-weight","700")?ba(r.value,l.value,["font-weight"]):ga(r.value,l.value,{"font-weight":"bold"}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},J=(e,t)=>{sa(r.value,l.value,i,t),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},Y=(e,t)=>{ma(r.value,l.value,t),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},ee=e=>{const t=r.value.range.anchor.element;h.value[e]?delete t.marks[e]:t.marks[e]=!0,h.value[e]=!h.value[e],r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},te=e=>{const t=r.value.range.anchor.element;if(t){const n={width:e};t.hasStyles()?t.styles=Object.assign(t.styles,n):t.styles=n,r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender(),setTimeout((()=>{s.value.setPosition()}),0)}},ne=()=>{if(!m.value.url)return;const e=Vn(r.value,l.value,"a");e&&(e.marks.href=m.value.url,m.value.newOpen?e.marks.target="_blank":delete e.marks.target),r.value.formatElementStack(),r.value.domRender()},ae=()=>{const e=Vn(r.value,l.value,"a");e&&(e.parsedom=y.TEXT_NODE,delete e.marks.target,delete e.marks.href,delete e.marks["data-editify-element"]),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()},re=(e,t)=>{const n=Vn(r.value,l.value,"pre");n&&(Object.assign(n.marks,{"data-editify-hljs":t}),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender())},le=(e="up")=>{r.value.range.anchor.isEqual(r.value.range.focus)||(r.value.range.anchor.element=r.value.range.focus.element,r.value.range.anchor.offset=r.value.range.focus.offset);const t=Vn(r.value,l.value,"pre");if(t){const n=new y("block",y.BLOCK_NODE,null,null,null),a=new y("closed","br",null,null,null);r.value.addElementTo(a,n),"up"==e?r.value.addElementBefore(n,t):r.value.addElementAfter(n,t),r.value.range.anchor.moveToEnd(n),r.value.range.focus.moveToEnd(n),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()}},ie=(e="left")=>{r.value.range.anchor.isEqual(r.value.range.focus)||(r.value.range.anchor.element=r.value.range.focus.element,r.value.range.anchor.offset=r.value.range.focus.offset);const t=Vn(r.value,l.value,"table"),n=Vn(r.value,l.value,"td"),a=Vn(r.value,l.value,"tbody");if(n&&t&&a){const o=a.children,l=n.parent.children.findIndex((e=>e.isEqual(n)));o.forEach((t=>{const a=n.clone(!1),o=new y("closed","br",null,null,null);r.value.addElementTo(o,a),"left"==e?r.value.addElementTo(a,t,l):r.value.addElementTo(a,t,l+1)}));const i=t.children.find((e=>"colgroup"==e.parsedom)),s=new y("closed","col",null,null,null);if("left"==e?r.value.addElementTo(s,i,l):r.value.addElementTo(s,i,l+1),r.value.formatElementStack(),"left"==e){const e=r.value.getPreviousElement(n);r.value.range.anchor.moveToStart(e),r.value.range.focus.moveToStart(e)}else{const e=r.value.getNextElement(n);r.value.range.anchor.moveToStart(e),r.value.range.focus.moveToStart(e)}r.value.domRender(),r.value.rangeRender()}},se=(e="up")=>{r.value.range.anchor.isEqual(r.value.range.focus)||(r.value.range.anchor.element=r.value.range.focus.element,r.value.range.anchor.offset=r.value.range.focus.offset);const t=Vn(r.value,l.value,"table"),n=Vn(r.value,l.value,"tr");if(t&&n){const t=n.clone();t.children.forEach((e=>{e.children=[];const t=new y("closed","br",null,null,null);r.value.addElementTo(t,e)})),"up"==e?r.value.addElementBefore(t,n):r.value.addElementAfter(t,n),r.value.formatElementStack(),r.value.range.anchor.moveToStart(t),r.value.range.focus.moveToStart(t),r.value.domRender(),r.value.rangeRender(),setTimeout((()=>{s.value.setPosition()}),0)}},ce=(e="up")=>{const t=Vn(r.value,l.value,"table");if(t){const n=new y("block",y.BLOCK_NODE,null,null,null),a=new y("closed","br",null,null,null);r.value.addElementTo(a,n),"up"==e?r.value.addElementBefore(n,t):r.value.addElementAfter(n,t),r.value.range.anchor.moveToEnd(n),r.value.range.focus.moveToEnd(n),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender()}},de=e=>{const t=Vn(r.value,l.value,e);t&&(t.toEmpty(),r.value.formatElementStack(),r.value.domRender(),r.value.rangeRender())},ue=()=>{r.value.range.anchor.isEqual(r.value.range.focus)||(r.value.range.anchor.element=r.value.range.focus.element,r.value.range.anchor.offset=r.value.range.focus.offset);const e=Vn(r.value,l.value,"table"),t=Vn(r.value,l.value,"tr");if(e&&t){if(1==t.parent.children.length)return void de("table");const e=r.value.getPreviousElement(t),n=r.value.getNextElement(t);t.toEmpty(),r.value.formatElementStack(),e?(r.value.range.anchor.moveToEnd(e.children[0]),r.value.range.focus.moveToEnd(e.children[0])):(r.value.range.anchor.moveToEnd(n.children[0]),r.value.range.focus.moveToEnd(n.children[0])),r.value.domRender(),r.value.rangeRender(),setTimeout((()=>{s.value.setPosition()}),0)}},me=()=>{r.value.range.anchor.isEqual(r.value.range.focus)||(r.value.range.anchor.element=r.value.range.focus.element,r.value.range.anchor.offset=r.value.range.focus.offset);const e=Vn(r.value,l.value,"td"),t=Vn(r.value,l.value,"tbody"),n=Vn(r.value,l.value,"table");if(e&&n&&t){const a=t.children;if(1==e.parent.children.length)return void de("table");const o=r.value.getPreviousElement(e),l=r.value.getNextElement(e),i=e.parent.children.findIndex((t=>t.isEqual(e)));a.forEach((e=>{e.children[i].toEmpty()}));n.children.find((e=>"colgroup"==e.parsedom)).children[i].toEmpty(),r.value.formatElementStack(),o?(r.value.range.anchor.moveToEnd(o),r.value.range.focus.moveToEnd(o)):(r.value.range.anchor.moveToEnd(l),r.value.range.focus.moveToEnd(l)),r.value.domRender(),r.value.rangeRender()}},he=()=>{if("codeBlock"==a.type){const e=Vn(r.value,l.value,"pre");e&&(f.value.displayConfig.value=e.marks["data-editify-hljs"]||"")}else if("link"==a.type){const e=Vn(r.value,l.value,"a");e&&(m.value.url=e.marks.href,m.value.newOpen="_blank"==e.marks.target)}else if("video"==a.type){const e=Vn(r.value,l.value,"video");e&&(h.value.autoplay=!!e.marks.autoplay,h.value.loop=!!e.marks.loop,h.value.controls=!!e.marks.controls,h.value.muted=!!e.marks.muted)}else if("text"==a.type){const e=e=>"function"==typeof a.config.extraDisabled&&a.config.extraDisabled(e)||!1,t=g.value.displayConfig.options.find((e=>{let t=e;return oe.isObject(e)&&(t=e.value),l.value.list.every((e=>e.element.isBlock()?e.element.parsedom==t:e.element.getBlock().parsedom==t))}));g.value.displayConfig.value=t?oe.isObject(t)?t.value:t:g.value.defaultValue,g.value.disabled=e("heading"),p.value.disabled=e("align"),b.value.active=Gn(r.value,l.value,!0),b.value.disabled=e("orderList"),v.value.active=Gn(r.value,l.value,!1),v.value.disabled=e("unorderList"),E.value.active=Xn(r.value,l.value),E.value.disabled=e("task"),w.value.active=ta(r.value,l.value,"font-weight","bold")||ta(r.value,l.value,"font-weight","700"),w.value.disabled=e("bold"),k.value.active=ta(r.value,l.value,"font-style","italic"),k.value.disabled=e("italic"),_.value.active=ta(r.value,l.value,"text-decoration","line-through")||ta(r.value,l.value,"text-decoration-line","line-through"),_.value.disabled=e("strikethrough"),x.value.active=ta(r.value,l.value,"text-decoration","underline")||ta(r.value,l.value,"text-decoration-line","underline"),x.value.disabled=e("underline"),C.value.active=na(r.value,l.value,"data-editify-code"),C.value.disabled=e("code"),B.value.active=ta(r.value,l.value,"vertical-align","super"),B.value.disabled=e("super"),T.value.active=ta(r.value,l.value,"vertical-align","sub"),T.value.disabled=e("sub");const n=S.value.displayConfig.options.find((e=>oe.isObject(e)?ta(r.value,l.value,"font-size",e.value):ta(r.value,l.value,"font-size",e)));S.value.displayConfig.value=n?oe.isObject(n)?n.value:n:S.value.defaultValue,S.value.disabled=e("fontSize");const o=N.value.displayConfig.options.find((e=>oe.isObject(e)?ta(r.value,l.value,"font-family",e.value):ta(r.value,l.value,"font-family",e)));N.value.displayConfig.value=o?oe.isObject(o)?o.value:o:N.value.defaultValue,N.value.disabled=e("fontFamily");const i=O.value.displayConfig.options.find((e=>{let t=e;return oe.isObject(e)&&(t=e.value),l.value.list.every((e=>{if(e.element.isBlock()||e.element.isInblock())return e.element.hasStyles()&&e.element.styles["line-height"]==t;const n=e.element.getBlock(),a=e.element.getInblock();return a?a.hasStyles()&&a.styles["line-height"]==t:n.hasStyles()&&n.styles["line-height"]==t}))}));O.value.displayConfig.value=i?oe.isObject(i)?i.value:i:O.value.defaultValue,O.value.disabled=e("lineHeight");const s=A.value.selectConfig.options.find((e=>oe.isObject(e)?ta(r.value,l.value,"color",e.value):ta(r.value,l.value,"color",e)));A.value.value=s?oe.isObject(s)?s.value:s:"",A.value.disabled=e("foreColor");const c=R.value.selectConfig.options.find((e=>oe.isObject(e)?ta(r.value,l.value,"background-color",e.value):ta(r.value,l.value,"background-color",e)));R.value.value=c?oe.isObject(c)?c.value:c:"",R.value.disabled=e("backColor"),M.value.disabled=e("formatClear")}};return(e,n)=>(t.openBlock(),t.createBlock(Ma,{modelValue:I.value,"onUpdate:modelValue":n[21]||(n[21]=e=>I.value=e),ref_key:"layerRef",ref:s,node:e.node,border:"",placement:"bottom-start",onShow:he,useRange:"text"==e.type,"z-index":10},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"editify-toolbar",ref_key:"toolbarRef",ref:c,style:t.normalizeStyle(e.config.style)},["link"==e.type?(t.openBlock(),t.createElementBlock("div",oo,[t.createElementVNode("div",ro,t.toDisplayString(t.unref(i)("linkAddress")),1),t.withDirectives(t.createElementVNode("input",{onChange:ne,onFocus:L,onBlur:D,placeholder:t.unref(i)("linkUrlEnterPlaceholder"),"onUpdate:modelValue":n[0]||(n[0]=e=>m.value.url=e),type:"url"},null,40,lo),[[t.vModelText,m.value.url,void 0,{trim:!0}]]),t.createElementVNode("div",io,[t.createVNode(Qa,{onChange:ne,modelValue:m.value.newOpen,"onUpdate:modelValue":n[1]||(n[1]=e=>m.value.newOpen=e),label:t.unref(i)("newWindowOpen"),color:e.color,size:10},null,8,["modelValue","label","color"]),t.createElementVNode("div",so,[t.createElementVNode("span",{onClick:ae},t.toDisplayString(t.unref(i)("removeLink")),1),t.createElementVNode("a",{href:m.value.url,target:"_blank",style:t.normalizeStyle({color:e.color||""})},t.toDisplayString(t.unref(i)("viewLink")),13,co)])])])):"image"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(qa,{onOperate:n[2]||(n[2]=e=>te("30%")),name:"set30Width",title:t.unref(i)("width30"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 30% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[3]||(n[3]=e=>te("50%")),name:"set50Width",title:t.unref(i)("width50"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 50% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{rightBorder:"",onOperate:n[4]||(n[4]=e=>te("100%")),name:"set100Width",title:t.unref(i)("width100"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 100% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[5]||(n[5]=e=>te("auto")),name:"setAutoWidth",title:t.unref(i)("auto"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"auto-width"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[6]||(n[6]=e=>de("img")),name:"deleteImage",title:t.unref(i)("deleteImage"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"delete"})])),_:1},8,["title","tooltip","color"])],64)):"video"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createVNode(qa,{onOperate:n[7]||(n[7]=e=>te("30%")),name:"set30Width",title:t.unref(i)("width30"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 30% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[8]||(n[8]=e=>te("50%")),name:"set50Width",title:t.unref(i)("width50"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 50% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[9]||(n[9]=e=>te("100%")),name:"set100Width",title:t.unref(i)("width100"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 100% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{rightBorder:"",onOperate:n[10]||(n[10]=e=>te("auto")),name:"setAutoWidth",title:t.unref(i)("auto"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"auto-width"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:ee,name:"autoplay",title:h.value.autoplay?t.unref(i)("disabledAutoplay"):t.unref(i)("autoplay"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:h.value.autoplay?"autoplay":"stop"},null,8,["value"])])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:ee,name:"loop",title:h.value.loop?t.unref(i)("disabledLoop"):t.unref(i)("loop"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:h.value.loop?"loop":"single"},null,8,["value"])])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:ee,name:"muted",title:h.value.muted?t.unref(i)("unmuted"):t.unref(i)("muted"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:h.value.muted?"muted":"unmuted"},null,8,["value"])])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{leftBorder:"",onOperate:ee,name:"controls",title:t.unref(i)("controls"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"controls"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[11]||(n[11]=e=>de("video")),name:"deleteVideo",title:t.unref(i)("deleteVideo"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"delete"})])),_:1},8,["title","tooltip","color"])],64)):"table"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createVNode(qa,{onOperate:n[12]||(n[12]=e=>ce("up")),name:"textWrapUp",title:t.unref(i)("textWrapUp"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"text-wrap",class:"editify-icon-rotate"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[13]||(n[13]=e=>ce("down")),rightBorder:"",name:"textWrapDown",title:t.unref(i)("textWrapDown"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"text-wrap"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[14]||(n[14]=e=>se("up")),name:"insertRowTop",title:t.unref(i)("insertRowTop"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"insert-row-top"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[15]||(n[15]=e=>se("down")),name:"insertRowBottom",title:t.unref(i)("insertRowBottom"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"insert-row-bottom"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:ue,rightBorder:"",name:"deleteRow",title:t.unref(i)("deleteRow"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"delete-row"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[16]||(n[16]=e=>ie("left")),name:"insertColumnLeft",title:t.unref(i)("insertColumnLeft"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"insert-column-left"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[17]||(n[17]=e=>ie("right")),name:"insertColumnRight",title:t.unref(i)("insertColumnRight"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"insert-column-right"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:me,rightBorder:"",name:"deleteColumn",title:t.unref(i)("deleteColumn"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"delete-column"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[18]||(n[18]=e=>de("table")),name:"deleteTable",title:t.unref(i)("deleteTable"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"delete-table"})])),_:1},8,["title","tooltip","color"])],64)):t.createCommentVNode("",!0),"codeBlock"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createVNode(qa,{onOperate:n[19]||(n[19]=e=>le("up")),name:"textWrapUp",title:t.unref(i)("textWrapUp"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"text-wrap",class:"editify-icon-rotate"})])),_:1},8,["title","tooltip","color"]),t.createVNode(qa,{onOperate:n[20]||(n[20]=e=>le("down")),name:"textWrapDown",title:t.unref(i)("textWrapDown"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"text-wrap"})])),_:1},8,["title","tooltip","color"]),f.value.show?(t.openBlock(),t.createBlock(qa,{key:0,name:"languages",type:"display",title:t.unref(i)("selectLanguages"),tooltip:e.config.tooltip,leftBorder:f.value.leftBorder,rightBorder:f.value.rightBorder,"display-config":f.value.displayConfig,color:e.color,active:f.value.active,disabled:f.value.disabled,onOperate:re},null,8,["title","tooltip","leftBorder","rightBorder","display-config","color","active","disabled"])):t.createCommentVNode("",!0)],64)):"text"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[g.value.show?(t.openBlock(),t.createBlock(qa,{key:0,name:"heading",type:"display",title:t.unref(i)("heading"),tooltip:e.config.tooltip,"display-config":g.value.displayConfig,leftBorder:g.value.leftBorder,rightBorder:g.value.rightBorder,color:e.color,active:g.value.active,disabled:g.value.disabled,onOperate:J},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),p.value.show?(t.openBlock(),t.createBlock(qa,{key:1,name:"align",type:"select",title:t.unref(i)("align"),tooltip:e.config.tooltip,"select-config":p.value.selectConfig,leftBorder:p.value.leftBorder,rightBorder:p.value.rightBorder,color:e.color,active:p.value.active,disabled:p.value.disabled,onOperate:Y},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"align-left"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),b.value.show?(t.openBlock(),t.createBlock(qa,{key:2,name:"orderList",title:t.unref(i)("orderList"),tooltip:e.config.tooltip,leftBorder:b.value.leftBorder,rightBorder:b.value.rightBorder,color:e.color,active:b.value.active,disabled:b.value.disabled,onOperate:Z},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"list-ordered"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),v.value.show?(t.openBlock(),t.createBlock(qa,{key:3,name:"unorderList",title:t.unref(i)("unorderList"),tooltip:e.config.tooltip,leftBorder:v.value.leftBorder,rightBorder:v.value.rightBorder,color:e.color,active:v.value.active,disabled:v.value.disabled,onOperate:Z},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"list-unordered"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),E.value.show?(t.openBlock(),t.createBlock(qa,{key:4,name:"task",title:t.unref(i)("task"),tooltip:e.config.tooltip,leftBorder:E.value.leftBorder,rightBorder:E.value.rightBorder,color:e.color,active:E.value.active,disabled:E.value.disabled,onOperate:G},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"task"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),w.value.show?(t.openBlock(),t.createBlock(qa,{key:5,name:"bold",title:t.unref(i)("bold"),tooltip:e.config.tooltip,leftBorder:w.value.leftBorder,rightBorder:w.value.rightBorder,color:e.color,active:w.value.active,disabled:w.value.disabled,onOperate:Q},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"bold"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),k.value.show?(t.openBlock(),t.createBlock(qa,{key:6,name:"italic",title:t.unref(i)("italic"),tooltip:e.config.tooltip,leftBorder:k.value.leftBorder,rightBorder:k.value.rightBorder,color:e.color,active:k.value.active,disabled:k.value.disabled,onOperate:X},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"italic"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),_.value.show?(t.openBlock(),t.createBlock(qa,{key:7,name:"strikethrough",title:t.unref(i)("strikethrough"),tooltip:e.config.tooltip,leftBorder:_.value.leftBorder,rightBorder:_.value.rightBorder,color:e.color,active:_.value.active,disabled:_.value.disabled,onOperate:K},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"strikethrough"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),x.value.show?(t.openBlock(),t.createBlock(qa,{key:8,name:"underline",title:t.unref(i)("underline"),tooltip:e.config.tooltip,leftBorder:x.value.leftBorder,rightBorder:x.value.rightBorder,color:e.color,active:x.value.active,disabled:x.value.disabled,onOperate:q},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"underline"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),C.value.show?(t.openBlock(),t.createBlock(qa,{key:9,name:"code",title:t.unref(i)("code"),tooltip:e.config.tooltip,leftBorder:C.value.leftBorder,rightBorder:C.value.rightBorder,color:e.color,active:C.value.active,disabled:C.value.disabled,onOperate:W},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"code"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),B.value.show?(t.openBlock(),t.createBlock(qa,{key:10,name:"superscript",title:t.unref(i)("superscript"),tooltip:e.config.tooltip,leftBorder:B.value.leftBorder,rightBorder:B.value.rightBorder,color:e.color,active:B.value.active,disabled:B.value.disabled,onOperate:j},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"superscript"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),T.value.show?(t.openBlock(),t.createBlock(qa,{key:11,name:"subscript",title:t.unref(i)("subscript"),tooltip:e.config.tooltip,leftBorder:T.value.leftBorder,rightBorder:T.value.rightBorder,color:e.color,active:T.value.active,disabled:T.value.disabled,onOperate:U},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"subscript"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),S.value.show?(t.openBlock(),t.createBlock(qa,{key:12,name:"fontSize",type:"display",title:t.unref(i)("fontSize"),tooltip:e.config.tooltip,"display-config":S.value.displayConfig,leftBorder:S.value.leftBorder,rightBorder:S.value.rightBorder,color:e.color,active:S.value.active,disabled:S.value.disabled,onOperate:H},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),N.value.show?(t.openBlock(),t.createBlock(qa,{key:13,name:"fontFamily",type:"display",title:t.unref(i)("fontFamily"),tooltip:e.config.tooltip,"display-config":N.value.displayConfig,leftBorder:N.value.leftBorder,rightBorder:N.value.rightBorder,color:e.color,active:N.value.active,disabled:N.value.disabled,onOperate:V},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),O.value.show?(t.openBlock(),t.createBlock(qa,{key:14,name:"lineHeight",type:"display",title:t.unref(i)("lineHeight"),tooltip:e.config.tooltip,"display-config":O.value.displayConfig,leftBorder:O.value.leftBorder,rightBorder:O.value.rightBorder,color:e.color,active:O.value.active,disabled:O.value.disabled,onOperate:P},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),A.value.show?(t.openBlock(),t.createBlock(qa,{key:15,name:"foreColor",type:"select",title:t.unref(i)("foreColor"),tooltip:e.config.tooltip,"select-config":A.value.selectConfig,leftBorder:A.value.leftBorder,rightBorder:A.value.rightBorder,color:e.color,active:A.value.active,disabled:A.value.disabled,hideScroll:"",ref_key:"foreColorRef",ref:d},{layer:t.withCtx((({options:n})=>[t.createVNode(no,{tooltip:e.config.tooltip,color:e.color,value:A.value.value,onChange:z,data:n},null,8,["tooltip","color","value","data"])])),default:t.withCtx((()=>[t.createVNode(Fa,{value:"font-color"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),R.value.show?(t.openBlock(),t.createBlock(qa,{key:16,name:"backColor",type:"select",title:t.unref(i)("backColor"),tooltip:e.config.tooltip,"select-config":R.value.selectConfig,leftBorder:R.value.leftBorder,rightBorder:R.value.rightBorder,color:e.color,active:R.value.active,disabled:R.value.disabled,hideScroll:"",ref_key:"backColorRef",ref:u},{layer:t.withCtx((({options:n})=>[t.createVNode(no,{tooltip:e.config.tooltip,color:e.color,value:R.value.value,onChange:F,data:n},null,8,["tooltip","color","value","data"])])),default:t.withCtx((()=>[t.createVNode(Fa,{value:"brush"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),M.value.show?(t.openBlock(),t.createBlock(qa,{key:17,name:"formatClear",title:t.unref(i)("formatClear"),tooltip:e.config.tooltip,leftBorder:M.value.leftBorder,rightBorder:M.value.rightBorder,color:e.color,active:M.value.active,disabled:M.value.disabled,onOperate:$},{default:t.withCtx((()=>[t.createVNode(Fa,{value:"format-clear"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],4)])),_:1},8,["modelValue","node","useRange"]))}}),[["__scopeId","data-v-357be052"]]),mo={color:{type:String,default:""},text:{type:String,default:""}},ho={class:"editify-link"},fo={class:"editify-link-label"},go=["placeholder"],po=["placeholder"],bo={class:"editify-link-footer"},vo={class:"editify-link-operations"},yo=Na(t.defineComponent({name:"InsertLink",__name:"insertLink",props:mo,emits:["insert"],setup(e,{emit:n}){const a=e,o=n,r=t.inject("$editTrans"),l=t.ref(""),i=t.ref(""),s=t.ref(!1);t.watch((()=>a.text),(e=>{i.value=e}),{immediate:!0});const c=e=>{a.color&&(e.currentTarget.style.borderColor=a.color)},d=e=>{e.currentTarget.style.borderColor=""},u=()=>{o("insert",i.value,l.value,s.value)};return(e,n)=>(t.openBlock(),t.createElementBlock("div",ho,[t.createElementVNode("div",fo,t.toDisplayString(t.unref(r)("linkAddress")),1),t.withDirectives(t.createElementVNode("input",{onFocus:c,onBlur:d,placeholder:t.unref(r)("linkTextEnterPlaceholder"),"onUpdate:modelValue":n[0]||(n[0]=e=>i.value=e),type:"text"},null,40,go),[[t.vModelText,i.value,void 0,{trim:!0}]]),t.withDirectives(t.createElementVNode("input",{onFocus:c,onBlur:d,placeholder:t.unref(r)("linkUrlEnterPlaceholder"),"onUpdate:modelValue":n[1]||(n[1]=e=>l.value=e),type:"url"},null,40,po),[[t.vModelText,l.value,void 0,{trim:!0}]]),t.createElementVNode("div",bo,[t.createVNode(Qa,{modelValue:s.value,"onUpdate:modelValue":n[2]||(n[2]=e=>s.value=e),label:t.unref(r)("newWindowOpen"),color:e.color,size:10},null,8,["modelValue","label","color"]),t.createElementVNode("div",vo,[t.createElementVNode("span",{style:t.normalizeStyle({color:e.color||""}),onClick:u},t.toDisplayString(t.unref(r)("insertLink")),5)])])]))}}),[["__scopeId","data-v-9f80e392"]]),Eo={color:{type:String,default:""},allowedFileType:{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}},wo={class:"editify-image"},ko={class:"editify-image-header"},_o={key:0,class:"editify-image-remote"},xo=["placeholder"],Co={key:1,class:"editify-image-upload"},Bo=["multiple"],To=Na(t.defineComponent({name:"InsertImage",__name:"insertImage",props:Eo,emits:["change","insert"],setup(e,{emit:n}){const a=e,o=n,r=t.inject("$editTrans"),l=t.ref("upload"),i=t.ref(""),s=t.computed((()=>e=>l.value==e?{color:a.color}:{})),c=e=>{const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},d=e=>{a.color&&(e.currentTarget.style.borderColor=a.color)},u=e=>{e.currentTarget.style.borderColor=""},m=()=>{o("insert",[i.value])},h=async e=>{const t=e.currentTarget,n=t.files;if(!n||!n.length)return;let r=[];for(let o=0;o<n.length;o++){const e=n[o],t=c(e);!(a.allowedFileType&&Array.isArray(a.allowedFileType)&&a.allowedFileType.length)||a.allowedFileType.some((e=>e.toLocaleLowerCase()==t.toLocaleLowerCase()))?a.maxSize&&e.size/1024>a.maxSize?"function"==typeof a.handleError&&a.handleError("maxSizeError",e):a.minSize&&e.size/1024<a.minSize?"function"==typeof a.handleError&&a.handleError("minSizeError",e):r.push(e):"function"==typeof a.handleError&&a.handleError("suffixError",e)}if(r.length){let e=[];if("function"==typeof a.customUpload)e=await a.customUpload(r)||[];else for(let t=0;t<r.length;t++){const n=await ce.dataFileToBase64(r[t]);e.push(n)}o("insert",e)}t.value=""};return t.watch((()=>l.value),(()=>{o("change")})),(e,n)=>(t.openBlock(),t.createElementBlock("div",wo,[t.createElementVNode("div",ko,[t.createElementVNode("div",{onClick:n[0]||(n[0]=e=>l.value="upload"),class:t.normalizeClass(["editify-image-header-item",{"editify-active":"upload"==l.value}]),style:t.normalizeStyle(s.value("upload"))},t.toDisplayString(t.unref(r)("uploadImage")),7),t.createElementVNode("div",{onClick:n[1]||(n[1]=e=>l.value="remote"),class:t.normalizeClass(["editify-image-header-item",{"editify-active":"remote"==l.value}]),style:t.normalizeStyle(s.value("remote"))},t.toDisplayString(t.unref(r)("remoteImage")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-image-header-slider","editify-"+l.value]),style:t.normalizeStyle({backgroundColor:e.color||""})},null,6)]),"remote"==l.value?(t.openBlock(),t.createElementBlock("div",_o,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e),placeholder:t.unref(r)("imageUrlPlaceholder"),onBlur:u,onFocus:d},null,40,xo),[[t.vModelText,i.value,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-image-remote-footer",style:t.normalizeStyle({color:e.color||""})},[t.createElementVNode("span",{onClick:m},t.toDisplayString(t.unref(r)("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",Co,[t.createVNode(Fa,{value:"upload"}),t.createElementVNode("input",{multiple:e.multiple,accept:"image/*",onChange:h,type:"file"},null,40,Bo)]))]))}}),[["__scopeId","data-v-b63a5bff"]]),So={color:{type:String,default:""},allowedFileType:{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}},No={class:"editify-video"},Oo={class:"editify-video-header"},Ao={key:0,class:"editify-video-remote"},Ro=["placeholder"],Mo={key:1,class:"editify-video-upload"},Io=["multiple"],Lo=Na(t.defineComponent({name:"InsertVideo",__name:"insertVideo",props:So,emits:["change","insert"],setup(e,{emit:n}){const a=e,o=n,r=t.inject("$editTrans"),l=t.ref("upload"),i=t.ref(""),s=t.computed((()=>e=>l.value==e?{color:a.color}:{})),c=e=>{const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},d=e=>{a.color&&(e.currentTarget.style.borderColor=a.color)},u=e=>{e.currentTarget.style.borderColor=""},m=()=>{o("insert",[i.value])},h=async e=>{const t=e.currentTarget,n=t.files;if(!n||!n.length)return;let r=[];for(let o=0;o<n.length;o++){const e=n[o],t=c(e);!(a.allowedFileType&&Array.isArray(a.allowedFileType)&&a.allowedFileType.length)||a.allowedFileType.some((e=>e.toLocaleLowerCase()==t.toLocaleLowerCase()))?a.maxSize&&e.size/1024>a.maxSize?"function"==typeof a.handleError&&a.handleError("maxSizeError",e):a.minSize&&e.size/1024<a.minSize?"function"==typeof a.handleError&&a.handleError("minSizeError",e):r.push(e):"function"==typeof a.handleError&&a.handleError("suffixError",e)}if(r.length){let e=[];if("function"==typeof a.customUpload)e=await a.customUpload(r)||[];else for(let t=0;t<r.length;t++){const n=await ce.dataFileToBase64(r[t]);e.push(n)}o("insert",e)}t.value=""};return t.watch((()=>l.value),(()=>{o("change")})),(e,n)=>(t.openBlock(),t.createElementBlock("div",No,[t.createElementVNode("div",Oo,[t.createElementVNode("div",{onClick:n[0]||(n[0]=e=>l.value="upload"),class:t.normalizeClass(["editify-video-header-item",{"editify-active":"upload"==l.value}]),style:t.normalizeStyle(s.value("upload"))},t.toDisplayString(t.unref(r)("uploadVideo")),7),t.createElementVNode("div",{onClick:n[1]||(n[1]=e=>l.value="remote"),class:t.normalizeClass(["editify-video-header-item",{"editify-active":"remote"==l.value}]),style:t.normalizeStyle(s.value("remote"))},t.toDisplayString(t.unref(r)("remoteVideo")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-video-header-slider","editify-"+l.value]),style:t.normalizeStyle({backgroundColor:e.color||""})},null,6)]),"remote"==l.value?(t.openBlock(),t.createElementBlock("div",Ao,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e),placeholder:t.unref(r)("videoUrlPlaceholder"),onBlur:u,onFocus:d},null,40,Ro),[[t.vModelText,i.value,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-video-remote-footer",style:t.normalizeStyle({color:e.color||""})},[t.createElementVNode("span",{onClick:m},t.toDisplayString(t.unref(r)("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",Mo,[t.createVNode(Fa,{value:"upload"}),t.createElementVNode("input",{multiple:e.multiple,accept:"video/*",onChange:h,type:"file"},null,40,Io)]))]))}}),[["__scopeId","data-v-4383bae9"]]),Do={color:{type:String,default:""},maxRows:{type:Number,default:10},maxColumns:{type:Number,default:10}},$o={class:"editify-table"},Fo=["onMouseenter","onClick"],zo=[(e=>(t.pushScopeId("data-v-9a40c4f5"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("span",null,null,-1)))],Po={class:"editify-table-footer"},Vo={key:0},Ho={key:1},jo=Na(t.defineComponent({name:"InsertTable",__name:"insertTable",props:Do,emits:["insert"],setup(e,{emit:n}){const a=e,o=n,r=t.inject("$editTrans"),l=t.ref((()=>{const e=[];for(let t=1;t<=a.maxRows;t++){let n=[];for(let e=1;e<=a.maxColumns;e++)n.push({x:t,y:e,inside:!1});e.push(n)}return e})()),i=t.computed((()=>l.value.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]));return(e,n)=>(t.openBlock(),t.createElementBlock("div",$o,[t.createElementVNode("table",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(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({"editify-inside":e.inside}),onMouseenter:t=>(e=>{for(let t in l.value){const n=l.value[t];for(let a in n)n[a].x<=e.x&&n[a].y<=e.y?l.value[t][a].inside=!0:l.value[t][a].inside=!1}})(e),onClick:t=>{var n;o("insert",(n=e).x,n.y)}},zo,42,Fo)))),256))])))),256))]),t.createElementVNode("div",Po,[i.value?(t.openBlock(),t.createElementBlock("span",Vo,t.toDisplayString(i.value.x)+" x "+t.toDisplayString(i.value.y),1)):(t.openBlock(),t.createElementBlock("span",Ho,t.toDisplayString(t.unref(r)("insertTable")),1))])]))}}),[["__scopeId","data-v-9a40c4f5"]]),Uo={config:{type:Object,default:null},color:{type:String,default:""}},Wo=["data-editify-mode"],qo=Na(t.defineComponent({name:"Menu",__name:"menu",props:Uo,setup(e,{expose:n}){const a=e,o=t.inject("$editTrans"),r=t.inject("editify"),l=t.inject("isSourceView"),i=t.inject("isFullScreen"),s=t.inject("canUseMenu"),c=t.inject("editor"),d=t.inject("dataRangeCaches"),u=t.inject("showBorder"),m=t.inject("pluginResultList"),h=t.ref({show:a.config.undo.show,leftBorder:a.config.undo.leftBorder,rightBorder:a.config.undo.rightBorder,active:!1,disabled:!1}),f=t.ref({show:a.config.redo.show,leftBorder:a.config.redo.leftBorder,rightBorder:a.config.redo.rightBorder,active:!1,disabled:!1}),g=t.ref({show:a.config.heading.show,displayConfig:{options:a.config.heading.options,value:"",width:a.config.heading.width,maxHeight:a.config.heading.maxHeight},defaultValue:a.config.heading.defaultValue,leftBorder:a.config.heading.leftBorder,rightBorder:a.config.heading.rightBorder,active:!1,disabled:!1}),p=t.ref({show:a.config.indent.show,selectConfig:{options:a.config.indent.options,value:"",width:a.config.indent.width,maxHeight:a.config.indent.maxHeight},leftBorder:a.config.indent.leftBorder,rightBorder:a.config.indent.rightBorder,active:!1,disabled:!1}),b=t.ref({show:a.config.quote.show,leftBorder:a.config.quote.leftBorder,rightBorder:a.config.quote.rightBorder,active:!1,disabled:!1}),v=t.ref({show:a.config.separator.show,leftBorder:a.config.separator.leftBorder,rightBorder:a.config.separator.rightBorder,active:!1,disabled:!1}),E=t.ref({show:a.config.align.show,selectConfig:{options:a.config.align.options,width:a.config.align.width,maxHeight:a.config.align.maxHeight},leftBorder:a.config.align.leftBorder,rightBorder:a.config.align.rightBorder,active:!1,disabled:!1}),w=t.ref({show:a.config.orderList.show,leftBorder:a.config.orderList.leftBorder,rightBorder:a.config.orderList.rightBorder,active:!1,disabled:!1}),k=t.ref({show:a.config.unorderList.show,leftBorder:a.config.unorderList.leftBorder,rightBorder:a.config.unorderList.rightBorder,active:!1,disabled:!1}),_=t.ref({show:a.config.task.show,leftBorder:a.config.task.leftBorder,rightBorder:a.config.task.rightBorder,active:!1,disabled:!1}),x=t.ref({show:a.config.bold.show,leftBorder:a.config.bold.leftBorder,rightBorder:a.config.bold.rightBorder,active:!1,disabled:!1}),C=t.ref({show:a.config.underline.show,leftBorder:a.config.underline.leftBorder,rightBorder:a.config.underline.rightBorder,active:!1,disabled:!1}),B=t.ref({show:a.config.italic.show,leftBorder:a.config.italic.leftBorder,rightBorder:a.config.italic.rightBorder,active:!1,disabled:!1}),T=t.ref({show:a.config.strikethrough.show,leftBorder:a.config.strikethrough.leftBorder,rightBorder:a.config.strikethrough.rightBorder,active:!1,disabled:!1}),S=t.ref({show:a.config.code.show,leftBorder:a.config.code.leftBorder,rightBorder:a.config.code.rightBorder,active:!1,disabled:!1}),N=t.ref({show:a.config.super.show,leftBorder:a.config.super.leftBorder,rightBorder:a.config.super.rightBorder,active:!1,disabled:!1}),O=t.ref({show:a.config.sub.show,leftBorder:a.config.sub.leftBorder,rightBorder:a.config.sub.rightBorder,active:!1,disabled:!1}),A=t.ref({show:a.config.formatClear.show,leftBorder:a.config.formatClear.leftBorder,rightBorder:a.config.formatClear.rightBorder,active:!1,disabled:!1}),R=t.ref({show:a.config.fontSize.show,displayConfig:{options:a.config.fontSize.options,value:"",width:a.config.fontSize.width,maxHeight:a.config.fontSize.maxHeight},defaultValue:a.config.fontSize.defaultValue,leftBorder:a.config.fontSize.leftBorder,rightBorder:a.config.fontSize.rightBorder,active:!1,disabled:!1}),M=t.ref({show:a.config.fontFamily.show,displayConfig:{options:a.config.fontFamily.options,value:"",width:a.config.fontFamily.width,maxHeight:a.config.fontFamily.maxHeight},defaultValue:a.config.fontFamily.defaultValue,leftBorder:a.config.fontFamily.leftBorder,rightBorder:a.config.fontFamily.rightBorder,active:!1,disabled:!1}),I=t.ref({show:a.config.lineHeight.show,displayConfig:{options:a.config.lineHeight.options,value:"",width:a.config.lineHeight.width,maxHeight:a.config.lineHeight.maxHeight},defaultValue:a.config.lineHeight.defaultValue,leftBorder:a.config.lineHeight.leftBorder,rightBorder:a.config.lineHeight.rightBorder,active:!1,disabled:!1}),L=t.ref({show:a.config.foreColor.show,selectConfig:{options:a.config.foreColor.options},leftBorder:a.config.foreColor.leftBorder,rightBorder:a.config.foreColor.rightBorder,value:"",active:!1,disabled:!1}),D=t.ref({show:a.config.backColor.show,selectConfig:{options:a.config.backColor.options},leftBorder:a.config.backColor.leftBorder,rightBorder:a.config.backColor.rightBorder,value:"",active:!1,disabled:!1}),$=t.ref({show:a.config.link.show,leftBorder:a.config.link.leftBorder,rightBorder:a.config.link.rightBorder,active:!1,disabled:!1,text:""}),F=t.ref({show:a.config.image.show,leftBorder:a.config.image.leftBorder,rightBorder:a.config.image.rightBorder,active:!1,disabled:!1,allowedFileType:a.config.image.allowedFileType,multiple:a.config.image.multiple,maxSize:a.config.image.maxSize,minSize:a.config.image.minSize,handleError:a.config.image.handleError,customUpload:a.config.image.customUpload}),z=t.ref({show:a.config.video.show,leftBorder:a.config.video.leftBorder,rightBorder:a.config.video.rightBorder,active:!1,disabled:!1,allowedFileType:a.config.video.allowedFileType,multiple:a.config.video.multiple,maxSize:a.config.video.maxSize,minSize:a.config.video.minSize,handleError:a.config.video.handleError,customUpload:a.config.video.customUpload}),P=t.ref({show:a.config.table.show,leftBorder:a.config.table.leftBorder,rightBorder:a.config.table.rightBorder,active:!1,disabled:!1,maxRows:a.config.table.maxRows,maxColumns:a.config.table.maxColumns}),V=t.ref({show:a.config.codeBlock.show,leftBorder:a.config.codeBlock.leftBorder,rightBorder:a.config.codeBlock.rightBorder,active:!1,disabled:!1}),H=t.ref({show:a.config.sourceView.show,leftBorder:a.config.sourceView.leftBorder,rightBorder:a.config.sourceView.rightBorder,active:!1,disabled:!1}),j=t.ref({show:a.config.fullScreen.show,leftBorder:a.config.fullScreen.leftBorder,rightBorder:a.config.fullScreen.rightBorder,active:!1,disabled:!1}),U=t.computed((()=>r.props.disabled||!s.value)),W=t.computed((()=>{let e={};return m.value.forEach((t=>{t.menu&&(e[t.name]=t.menu.sequence)})),e=Dn(e,a.config.sequence),Object.keys(e).sort(((t,n)=>e[t]>e[n]?1:-1))})),q=t.computed((()=>e=>"sourceView"!=e&&"fullScreen"!=e&&l.value)),K=t.computed((()=>(i.value||r.props.autoheight)&&"fixed"==a.config.mode?"default":a.config.mode)),Z=t.computed((()=>"fixed"!=K.value&&u.value)),G=t.computed((()=>{let e={};return m.value.forEach((t=>{t.menu&&(e[t.name]=t.menu.extend)})),Dn(e,a.config.extends)})),X=(e,t)=>{if(!U.value&&c.value.range)if("undo"==e)r.exposed.undo();else if("redo"==e)r.exposed.redo();else if("heading"==e)sa(c.value,d.value,o,t),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("indent"==e)"indent-increase"==t?ca(c.value,d.value):"indent-decrease"==t&&da(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("quote"==e)ua(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("separator"==e)(e=>{if(!e.range)return;const t=new y("closed","hr",null,null,null);e.insertElement(t);const n=y.getSpaceElement(),a=y.getSpaceElement();e.addElementAfter(a,t),e.addElementBefore(n,t),e.range.anchor.moveToEnd(a),e.range.focus.moveToEnd(a)})(c.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("align"==e)ma(c.value,d.value,t),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("orderList"==e)ha(c.value,d.value,!0),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("unorderList"==e)ha(c.value,d.value,!1),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("task"==e)fa(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("bold"==e)ta(c.value,d.value,"font-weight","bold")||ta(c.value,d.value,"font-weight","700")?ba(c.value,d.value,["font-weight"]):ga(c.value,d.value,{"font-weight":"bold"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("underline"==e)ta(c.value,d.value,"text-decoration","underline")||ta(c.value,d.value,"text-decoration-line","underline")?ba(c.value,d.value,["text-decoration","text-decoration-line"]):ga(c.value,d.value,{"text-decoration":"underline"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("italic"==e)ta(c.value,d.value,"font-style","italic")?ba(c.value,d.value,["font-style"]):ga(c.value,d.value,{"font-style":"italic"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("strikethrough"==e)ta(c.value,d.value,"text-decoration","line-through")||ta(c.value,d.value,"text-decoration-line","line-through")?ba(c.value,d.value,["text-decoration","text-decoration-line"]):ga(c.value,d.value,{"text-decoration":"line-through"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("code"==e)na(c.value,d.value,"data-editify-code")?va(c.value,d.value,["data-editify-code"]):pa(c.value,d.value,{"data-editify-code":!0}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("super"==e)ta(c.value,d.value,"vertical-align","super")?ba(c.value,d.value,["vertical-align"]):ga(c.value,d.value,{"vertical-align":"super"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("sub"==e)ta(c.value,d.value,"vertical-align","sub")?ba(c.value,d.value,["vertical-align"]):ga(c.value,d.value,{"vertical-align":"sub"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("formatClear"==e)ba(c.value,d.value),va(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("fontSize"==e)ga(c.value,d.value,{"font-size":t}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("fontFamily"==e)ga(c.value,d.value,{"font-family":t}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("lineHeight"==e)ya(c.value,d.value,t),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("foreColor"==e)ga(c.value,d.value,{color:t}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("backColor"==e)ga(c.value,d.value,{"background-color":t}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("link"==e){if(!t.url)return;Ea(c.value,t.text,t.url,t.newOpen),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()}else if("image"==e){if(!t)return;const e=t.filter((e=>!!e));if(0==e.length)return;e.forEach((e=>{wa(c.value,e)})),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()}else if("video"==e){if(!t)return;const e=t.filter((e=>!!e));if(0==e.length)return;e.forEach((e=>{ka(c.value,e)})),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()}else"table"==e?(_a(c.value,t.row,t.column),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()):"codeBlock"==e?(xa(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()):"sourceView"==e?(l.value=!l.value,H.value.active=l.value,l.value||c.value.rangeRender()):"fullScreen"==e&&(i.value=!i.value,j.value.active=i.value,c.value.rangeRender())},Q=t.defineComponent((e=>{const n=t.getCurrentInstance(),r={tooltip:a.config.tooltip,name:e.name};return()=>{if("undo"==r.name&&h.value.show)return t.h(qa,{...r,title:o("undo"),leftBorder:h.value.leftBorder,rightBorder:h.value.rightBorder,disabled:h.value.disabled||e.disabled||U.value,color:a.color,active:h.value.active,onOperate:X},(()=>t.h(Fa,{value:"undo"})));if("redo"==r.name&&f.value.show)return t.h(qa,{...r,title:o("redo"),leftBorder:f.value.leftBorder,rightBorder:f.value.rightBorder,disabled:f.value.disabled||e.disabled||U.value,color:a.color,active:f.value.active,onOperate:X},(()=>t.h(Fa,{value:"redo"})));if("heading"==r.name&&g.value.show)return t.h(qa,{...r,type:"display",displayConfig:g.value.displayConfig,title:o("heading"),leftBorder:g.value.leftBorder,rightBorder:g.value.rightBorder,color:a.color,disabled:g.value.disabled||e.disabled||U.value,active:g.value.active,onOperate:X});if("indent"==r.name&&p.value.show)return t.h(qa,{...r,type:"select",selectConfig:p.value.selectConfig,title:o("indent"),leftBorder:p.value.leftBorder,rightBorder:p.value.rightBorder,color:a.color,disabled:p.value.disabled||e.disabled||U.value,active:p.value.active,onOperate:X},(()=>t.h(Fa,{value:"indent-increase"})));if("quote"==r.name&&b.value.show)return t.h(qa,{...r,title:o("quote"),leftBorder:b.value.leftBorder,rightBorder:b.value.rightBorder,color:a.color,disabled:b.value.disabled||e.disabled||U.value,active:b.value.active,onOperate:X},(()=>t.h(Fa,{value:"quote"})));if("separator"==r.name&&v.value.show)return t.h(qa,{...r,title:o("separator"),leftBorder:v.value.leftBorder,rightBorder:v.value.rightBorder,color:a.color,disabled:v.value.disabled||e.disabled||U.value,active:v.value.active,onOperate:X},(()=>t.h(Fa,{value:"separator"})));if("align"==r.name&&E.value.show)return t.h(qa,{...r,type:"select",selectConfig:E.value.selectConfig,title:o("align"),leftBorder:E.value.leftBorder,rightBorder:E.value.rightBorder,color:a.color,disabled:E.value.disabled||e.disabled||U.value,active:E.value.active,onOperate:X},(()=>t.h(Fa,{value:"align-left"})));if("orderList"==r.name&&w.value.show)return t.h(qa,{...r,title:o("orderList"),leftBorder:w.value.leftBorder,rightBorder:w.value.rightBorder,color:a.color,disabled:w.value.disabled||e.disabled||U.value,active:w.value.active,onOperate:X},(()=>t.h(Fa,{value:"list-ordered"})));if("unorderList"==r.name&&k.value.show)return t.h(qa,{...r,title:o("unorderList"),leftBorder:k.value.leftBorder,rightBorder:k.value.rightBorder,color:a.color,disabled:k.value.disabled||e.disabled||U.value,active:k.value.active,onOperate:X},(()=>t.h(Fa,{value:"list-unordered"})));if("task"==r.name&&_.value.show)return t.h(qa,{...r,title:o("task"),leftBorder:_.value.leftBorder,rightBorder:_.value.rightBorder,color:a.color,disabled:_.value.disabled||e.disabled||U.value,active:_.value.active,onOperate:X},(()=>t.h(Fa,{value:"task"})));if("bold"==r.name&&x.value.show)return t.h(qa,{...r,title:o("bold"),leftBorder:x.value.leftBorder,rightBorder:x.value.rightBorder,color:a.color,disabled:x.value.disabled||e.disabled||U.value,active:x.value.active,onOperate:X},(()=>t.h(Fa,{value:"bold"})));if("underline"==r.name&&C.value.show)return t.h(qa,{...r,title:o("underline"),leftBorder:C.value.leftBorder,rightBorder:C.value.rightBorder,color:a.color,disabled:C.value.disabled||e.disabled||U.value,active:C.value.active,onOperate:X},(()=>t.h(Fa,{value:"underline"})));if("italic"==r.name&&B.value.show)return t.h(qa,{...r,title:o("italic"),leftBorder:B.value.leftBorder,rightBorder:B.value.rightBorder,color:a.color,disabled:B.value.disabled||e.disabled||U.value,active:B.value.active,onOperate:X},(()=>t.h(Fa,{value:"italic"})));if("strikethrough"==r.name&&T.value.show)return t.h(qa,{...r,title:o("strikethrough"),leftBorder:T.value.leftBorder,rightBorder:T.value.rightBorder,color:a.color,disabled:T.value.disabled||e.disabled||U.value,active:T.value.active,onOperate:X},(()=>t.h(Fa,{value:"strikethrough"})));if("code"==r.name&&S.value.show)return t.h(qa,{...r,title:o("code"),leftBorder:S.value.leftBorder,rightBorder:S.value.rightBorder,color:a.color,disabled:S.value.disabled||e.disabled||U.value,active:S.value.active,onOperate:X},(()=>t.h(Fa,{value:"code"})));if("super"==r.name&&N.value.show)return t.h(qa,{...r,title:o("superscript"),leftBorder:N.value.leftBorder,rightBorder:N.value.rightBorder,color:a.color,disabled:N.value.disabled||e.disabled||U.value,active:N.value.active,onOperate:X},(()=>t.h(Fa,{value:"superscript"})));if("sub"==r.name&&O.value.show)return t.h(qa,{...r,title:o("subscript"),leftBorder:O.value.leftBorder,rightBorder:O.value.rightBorder,color:a.color,disabled:O.value.disabled||e.disabled||U.value,active:O.value.active,onOperate:X},(()=>t.h(Fa,{value:"subscript"})));if("formatClear"==r.name&&A.value.show)return t.h(qa,{...r,title:o("formatClear"),leftBorder:A.value.leftBorder,rightBorder:A.value.rightBorder,color:a.color,disabled:A.value.disabled||e.disabled||U.value,active:A.value.active,onOperate:X},(()=>t.h(Fa,{value:"format-clear"})));if("fontSize"==r.name&&R.value.show)return t.h(qa,{...r,type:"display",displayConfig:R.value.displayConfig,title:o("fontSize"),leftBorder:R.value.leftBorder,rightBorder:R.value.rightBorder,color:a.color,disabled:R.value.disabled||e.disabled||U.value,active:R.value.active,onOperate:X});if("fontFamily"==r.name&&M.value.show)return t.h(qa,{...r,type:"display",displayConfig:M.value.displayConfig,title:o("fontFamily"),leftBorder:M.value.leftBorder,rightBorder:M.value.rightBorder,color:a.color,disabled:M.value.disabled||e.disabled||U.value,active:M.value.active,onOperate:X});if("lineHeight"==r.name&&I.value.show)return t.h(qa,{...r,type:"display",displayConfig:I.value.displayConfig,title:o("lineHeight"),leftBorder:I.value.leftBorder,rightBorder:I.value.rightBorder,color:a.color,disabled:I.value.disabled||e.disabled||U.value,active:I.value.active,onOperate:X});if("foreColor"==r.name&&L.value.show)return t.h(qa,{...r,ref:"btnRef",type:"select",selectConfig:L.value.selectConfig,title:o("foreColor"),leftBorder:L.value.leftBorder,rightBorder:L.value.rightBorder,color:a.color,disabled:L.value.disabled||e.disabled||U.value,active:L.value.active,hideScroll:!0},{default:()=>t.h(Fa,{value:"font-color"}),layer:e=>t.h(no,{tooltip:a.config.tooltip,value:L.value.value,data:e.options,color:a.color,onChange:e=>{X("foreColor",e);n.proxy.$refs.btnRef.show=!1}})});if("backColor"==r.name&&D.value.show)return t.h(qa,{...r,type:"select",ref:"btnRef",selectConfig:D.value.selectConfig,title:o("backColor"),leftBorder:D.value.leftBorder,rightBorder:D.value.rightBorder,color:a.color,disabled:D.value.disabled||e.disabled||U.value,active:D.value.active,onOperate:X,hideScroll:!0},{default:()=>t.h(Fa,{value:"brush"}),layer:e=>t.h(no,{tooltip:a.config.tooltip,value:D.value.value,data:e.options,color:a.color,onChange:e=>{X("backColor",e);n.proxy.$refs.btnRef.show=!1}})});if("link"==r.name&&$.value.show)return t.h(qa,{...r,type:"select",ref:"btnRef",title:o("insertLink"),leftBorder:$.value.leftBorder,rightBorder:$.value.rightBorder,color:a.color,disabled:$.value.disabled||e.disabled||U.value,active:$.value.active,hideScroll:!0,onLayerShow:()=>{$.value.text=aa(d.value)}},{default:()=>t.h(Fa,{value:"link"}),layer:()=>t.h(yo,{color:a.color,text:$.value.text,onInsert:(e,t,a)=>{X("link",{text:e,url:t,newOpen:a});n.proxy.$refs.btnRef.show=!1}})});if("image"==r.name&&F.value.show)return t.h(qa,{...r,type:"select",ref:"btnRef",title:o("insertImage"),leftBorder:F.value.leftBorder,rightBorder:F.value.rightBorder,color:a.color,disabled:F.value.disabled||e.disabled||U.value,active:F.value.active,hideScroll:!0},{default:()=>t.h(Fa,{value:"image"}),layer:()=>t.h(To,{color:a.color,allowedFileType:F.value.allowedFileType,multiple:F.value.multiple,maxSize:F.value.maxSize,minSize:F.value.minSize,customUpload:F.value.customUpload,handleError:F.value.handleError,onChange:()=>{n.proxy.$refs.btnRef.$refs.layerRef.setPosition()},onInsert:e=>{X("image",e);n.proxy.$refs.btnRef.show=!1}})});if("video"==r.name&&z.value.show)return t.h(qa,{...r,type:"select",ref:"btnRef",title:o("insertVideo"),leftBorder:z.value.leftBorder,rightBorder:z.value.rightBorder,color:a.color,disabled:z.value.disabled||e.disabled||U.value,active:z.value.active,hideScroll:!0},{default:()=>t.h(Fa,{value:"video"}),layer:()=>t.h(Lo,{color:a.color,allowedFileType:z.value.allowedFileType,multiple:z.value.multiple,maxSize:z.value.maxSize,minSize:z.value.minSize,customUpload:z.value.customUpload,handleError:z.value.handleError,onChange:()=>{n.proxy.$refs.btnRef.$refs.layerRef.setPosition()},onInsert:e=>{X("video",e);n.proxy.$refs.btnRef.show=!1}})});if("table"==r.name&&P.value.show)return t.h(qa,{...r,type:"select",ref:"btnRef",title:o("insertTable"),leftBorder:P.value.leftBorder,rightBorder:P.value.rightBorder,color:a.color,disabled:P.value.disabled||e.disabled||U.value,active:P.value.active,hideScroll:!0},{default:()=>t.h(Fa,{value:"table"}),layer:()=>t.h(jo,{color:a.color,maxRows:P.value.maxRows,maxColumns:P.value.maxColumns,onInsert:(e,t)=>{X("table",{row:e,column:t});n.proxy.$refs.btnRef.show=!1}})});if("codeBlock"==r.name&&V.value.show)return t.h(qa,{...r,title:o("inserCodeBlock"),leftBorder:V.value.leftBorder,rightBorder:V.value.rightBorder,color:a.color,disabled:V.value.disabled||e.disabled||U.value,active:V.value.active,onOperate:X},(()=>t.h(Fa,{value:"code-block"})));if("sourceView"==r.name&&H.value.show)return t.h(qa,{...r,title:o("sourceView"),leftBorder:H.value.leftBorder,rightBorder:H.value.rightBorder,color:a.color,disabled:H.value.disabled||e.disabled||U.value,active:H.value.active,onOperate:X},(()=>t.h(Fa,{value:"source-view"})));if("fullScreen"==r.name&&j.value.show)return t.h(qa,{...r,title:o("fullScreen"),leftBorder:j.value.leftBorder,rightBorder:j.value.rightBorder,color:a.color,disabled:j.value.disabled||e.disabled||U.value,active:j.value.active,onOperate:X},(()=>t.h(Fa,{value:"full-screen"})));if(oe.isObject(G.value)){const o=G.value[r.name];if(o)return t.h(qa,{...r,ref:"btnRef",type:o.type||"default",title:o.title||"",leftBorder:o.leftBorder||!1,rightBorder:o.rightBorder||!1,disabled:o.disabled||e.disabled||U.value,hideScroll:o.hideScroll||!1,active:o.active||!1,selectConfig:{width:o.width,maxHeight:o.maxHeight,options:o.options},displayConfig:{width:o.width,maxHeight:o.maxHeight,value:o.value,options:o.options},color:a.color,onLayerShow:()=>{"function"==typeof o.onLayerShow&&o.onLayerShow(r.name,n.proxy.$refs.btnRef)},onLayerShown:()=>{"function"==typeof o.onLayerShown&&o.onLayerShown(r.name,n.proxy.$refs.btnRef)},onLayerHidden:()=>{"function"==typeof o.onLayerHidden&&o.onLayerHidden(r.name,n.proxy.$refs.btnRef)},onOperate:(e,t)=>{"function"==typeof o.onOperate&&o.onOperate(e,t,n.proxy.$refs.btnRef)}},{default:()=>o.default?o.default(r.name,n.proxy.$refs.btnRef):null,layer:()=>o.layer?o.layer(r.name,n.proxy.$refs.btnRef):null,option:()=>o.option?o.option(r.name,n.proxy.$refs.btnRef):null})}return null}}),{props:{name:String,disabled:Boolean}});return n({handleRangeUpdate:()=>{const e=qn(c.value,d.value),t=Jn(c.value,d.value),n=Kn(c.value,d.value),o=Zn(c.value,d.value),r=Qn(c.value,d.value),s=Gn(c.value,d.value,!0),u=Gn(c.value,d.value,!1),v=Xn(c.value,d.value),y=Yn(c.value,d.value),U=ea(c.value,d.value),W=e=>{let t=!1,n=m.value.length;for(let a=0;a<n;a++){const n=m.value[a];if(n.menu&&"function"==typeof n.menu.extraDisabled&&(t=n.menu.extraDisabled(e),t))break}return"function"==typeof a.config.extraDisabled?a.config.extraDisabled(e)||t||!1:t||!1};h.value.disabled=!c.value.history.get(-1)||W("undo"),f.value.disabled=!c.value.history.get(1)||W("redo");const q=g.value.displayConfig.options.find((e=>{let t=e;return oe.isObject(e)&&(t=e.value),c.value.range.anchor.isEqual(c.value.range.focus)?c.value.range.anchor.element.getBlock().parsedom==t:d.value.list.every((e=>e.element.isBlock()?e.element.parsedom==t:e.element.getBlock().parsedom==t))}));g.value.displayConfig.value=q?oe.isObject(q)?q.value:q:g.value.defaultValue,g.value.disabled=e||t||W("heading"),p.value.disabled=e||t||W("indent"),b.value.active=o,b.value.disabled=e||t||W("quote"),E.value.disabled=e||W("align"),w.value.active=s,w.value.disabled=e||t||W("orderList"),k.value.active=u,k.value.disabled=e||t||W("unorderList"),_.value.active=v,_.value.disabled=e||t||W("task"),x.value.active=ta(c.value,d.value,"font-weight","bold")||ta(c.value,d.value,"font-weight","700"),x.value.disabled=e||W("bold"),C.value.active=ta(c.value,d.value,"text-decoration","underline")||ta(c.value,d.value,"text-decoration-line","underline"),C.value.disabled=e||W("underline"),B.value.active=ta(c.value,d.value,"font-style","italic"),B.value.disabled=e||W("italic"),T.value.active=ta(c.value,d.value,"text-decoration","line-through")||ta(c.value,d.value,"text-decoration-line","line-through"),T.value.disabled=e||W("strikethrough"),S.value.active=na(c.value,d.value,"data-editify-code"),S.value.disabled=e||W("code"),N.value.active=ta(c.value,d.value,"vertical-align","super"),N.value.disabled=e||W("super"),O.value.active=ta(c.value,d.value,"vertical-align","sub"),O.value.disabled=e||W("sub"),A.value.disabled=e||W("formatClear");const K=R.value.displayConfig.options.find((e=>oe.isObject(e)?ta(c.value,d.value,"font-size",e.value):ta(c.value,d.value,"font-size",e)));R.value.displayConfig.value=K?oe.isObject(K)?K.value:K:R.value.defaultValue,R.value.disabled=e||W("fontSize");const Z=M.value.displayConfig.options.find((e=>oe.isObject(e)?ta(c.value,d.value,"font-family",e.value):ta(c.value,d.value,"font-family",e)));M.value.displayConfig.value=Z?oe.isObject(Z)?Z.value:Z:M.value.defaultValue,M.value.disabled=e||W("fontFamily");const G=I.value.displayConfig.options.find((e=>{let t=e;if(oe.isObject(e)&&(t=e.value),c.value.range.anchor.isEqual(c.value.range.focus)){const e=c.value.range.anchor.element.getBlock();return e.hasStyles()&&e.styles["line-height"]==t}return d.value.list.every((e=>{if(e.element.isBlock()||e.element.isInblock())return e.element.hasStyles()&&e.element.styles["line-height"]==t;const n=e.element.getBlock(),a=e.element.getInblock();return a?a.hasStyles()&&a.styles["line-height"]==t:n.hasStyles()&&n.styles["line-height"]==t}))}));I.value.displayConfig.value=G?oe.isObject(G)?G.value:G:I.value.defaultValue,I.value.disabled=e||W("lineHeight");const X=L.value.selectConfig.options.find((e=>oe.isObject(e)?ta(c.value,d.value,"color",e.value):ta(c.value,d.value,"color",e)));L.value.value=X?oe.isObject(X)?X.value:X:"",L.value.disabled=e||W("foreColor");const Q=D.value.selectConfig.options.find((e=>oe.isObject(e)?ta(c.value,d.value,"background-color",e.value):ta(c.value,d.value,"background-color",e)));D.value.value=Q?oe.isObject(Q)?Q.value:Q:"",D.value.disabled=e||W("backColor"),$.value.disabled=r||e||W("link"),F.value.disabled=e||W("image"),z.value.disabled=e||W("video"),P.value.disabled=e||t||n||W("table"),V.value.active=!!Vn(c.value,d.value,"pre"),V.value.disabled=t||n||y||U||W("codeBlock"),H.value.active=l.value,j.value.active=i.value}}),(e,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-menu",{"editify-border":Z.value,"editify-source":t.unref(l)&&"inner"==K.value,"editify-fullscreen":t.unref(i)}]),"data-editify-mode":K.value,style:t.normalizeStyle(e.config.style||"")},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(W.value,(e=>(t.openBlock(),t.createBlock(t.unref(Q),{name:e,disabled:q.value(e)},null,8,["name","disabled"])))),256))],14,Wo))}}),[["__scopeId","data-v-13b11735"]]),Ko={locale:{type:String,default:"zh_CN"},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},border:{type:Boolean,default:!1},color:{type:String,default:"#03a8f3",validator:e=>oe.matchingText(e,"hex")},videoRatio:{type:Number,default:16/9},toolbar:{type:Object,default:null},showWordLength:{type:Boolean,default:!1},customTextPaste:{type:Function,default:null},customHtmlPaste:{type:Function,default:null},customImagePaste:{type:Function,default:null},customVideoPaste:{type:Function,default:null},customFilePaste:{type:Function,default:null},menu:{type:Object,default:null},pasteKeepMarks:{type:Object,default:null},pasteKeepStyles:{type:Object,default:null},customParseNode:{type:Function,default:null},renderRules:{type:Array,default:function(){return[]}},autoheight:{type:Boolean,default:!1},tab:{type:Boolean,default:!0},plugins:{type:Array,default:function(){return[]}}},Zo={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",separator:"Separator",lineHeight:"Line height",indent:"Indent",insertLink:"Insert Link",insertImage:"Insert Image",remoteImage:"Remote",uploadImage:"Upload",imageUrlPlaceholder:"Please enter the image address",insert:"Insert",insertVideo:"Insert Video",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",auto:"auto",fullScreen:"Full screen",insertAttachment:"Insert attachment",uploadAttachment:"Upload",remoteAttachment:"Remote",attachmentNamePlaceholder:"Please enter the attachment name",attachmentUrlPlaceholder:"Please enter the attachment address",attachmentDownloadTitle:"Click to download attachment",attachmentDefaultName:"attachment"},Go={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:"引用",separator:"分隔线",lineHeight:"行高",indent:"缩进",insertLink:"插入链接",insertImage:"插入图片",remoteImage:"网络图片",uploadImage:"上传图片",imageUrlPlaceholder:"请输入图片地址",insert:"插入",insertVideo:"插入视频",remoteVideo:"网络视频",uploadVideo:"上传视频",videoUrlPlaceholder:"请输入视频地址",insertTable:"插入表格",inserCodeBlock:"插入代码块",sourceView:"代码视图",task:"待办",indentIncrease:"增加缩进",indentDecrease:"减少缩进",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",alignJustify:"两端对齐",defaultLineHeight:"默认行高",auto:"自适应",fullScreen:"全屏",insertAttachment:"插入附件",uploadAttachment:"上传附件",remoteAttachment:"远程地址",attachmentNamePlaceholder:"请输入附件名称",attachmentUrlPlaceholder:"请输入附件地址",attachmentDownloadTitle:"点击下载附件",attachmentDefaultName:"附件"},Xo=["data-editify-uid"],Qo=["data-editify-placeholder"],Jo=["value"],Yo={class:"editify-footer-words"},er=Na(t.defineComponent({name:"editify",__name:"editify",props:Ko,emits:["update:modelValue","focus","blur","change","keydown","keyup","insertparagraph","rangeupdate","updateview"],setup(e,{expose:n,emit:a}){const o=t.getCurrentInstance(),r=e,l=a,i=(s=r.locale||"zh_CN",e=>({zh_CN:Go,en_US:Zo}[s][e]));var s;const c=t.ref(!1),d=t.ref(!1),u=t.ref(null),m=t.ref({element:null,start:0}),h=t.ref({show:!1,node:null,type:"text"}),f=t.ref(null),g=t.ref(null),p=t.ref(null),b=t.ref(null),v=t.ref(null),E=t.ref(null),w=t.ref(null),k=t.ref(!1),_=t.ref(!1),x=t.ref(!1),C=t.ref({flatList:[],list:[]}),B=t.computed({set(e){l("update:modelValue",e)},get:()=>r.modelValue||"<p><br></p>"}),T=t.computed((()=>te.string2dom(`<div>${B.value}</div>`).innerText)),S=t.computed((()=>!(!(w.value&&B.value&&1==w.value.stack.length&&"block"==w.value.stack[0].type&&w.value.stack[0].parsedom==y.BLOCK_NODE&&w.value.stack[0].isOnlyHasBreak())||w.value.stack[0].hasStyles()||w.value.stack[0].hasMarks())&&!d.value)),N=t.computed((()=>!_.value&&r.border)),O=t.computed((()=>{return Dn((e=i,t=r.locale,{use:!0,style:null,tooltip:!0,codeBlock:{languages:{show:!0,options:[{label:e("autoRecognize"),value:""},...Mn],width:120,maxHeight:180,leftBorder:!0,rightBorder:!1}},text:{heading:{show:!0,options:zn(e).heading,defaultValue:"p",width:"en_US"==t?150:130,maxHeight:"",leftBorder:!1,rightBorder:!0},align:{show:!1,options:zn(e).align,width:"zh_CN"==t?110: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:!0,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:zn(e).fontSize,defaultValue:"",width:100,maxHeight:200,leftBorder:!0,rightBorder:!1},fontFamily:{show:!1,options:zn(e).fontFamily,defaultValue:"",width:100,maxHeight:200,leftBorder:!1,rightBorder:!1},lineHeight:{show:!1,options:zn(e).lineHeight,defaultValue:"",width:90,maxHeight:"",leftBorder:!1,rightBorder:!1},foreColor:{show:!0,options:zn(e).foreColor,leftBorder:!1,rightBorder:!1},backColor:{show:!0,options:zn(e).backColor,leftBorder:!1,rightBorder:!1},formatClear:{show:!0,leftBorder:!0,rightBorder:!1}},extraDisabled:null}),r.toolbar||{});var e,t})),A=t.computed((()=>{const e=[];return r.plugins.forEach((t=>{let n=t(o,i);e.push(n)})),e})),R=t.computed((()=>{return Dn((e=i,t=r.locale,{use:!0,tooltip:!0,mode:"default",extraDisabled:null,style:null,sequence:{undo:0,redo:1,heading:2,indent:3,quote:4,separator:5,align:6,orderList:7,unorderList:8,task:9,bold:10,underline:11,italic:12,strikethrough:13,code:14,super:15,sub:16,formatClear:17,fontSize:18,fontFamily:19,lineHeight:20,foreColor:21,backColor:22,link:23,image:24,video:25,table:26,codeBlock:27,sourceView:28,fullScreen:29},undo:{show:!0,leftBorder:!1,rightBorder:!1},redo:{show:!0,leftBorder:!1,rightBorder:!1},heading:{show:!0,options:zn(e).heading,defaultValue:"p",width:"en_US"==t?150:130,maxHeight:"",leftBorder:!0,rightBorder:!1},indent:{show:!0,options:zn(e).indent,width:"en_US"==t?150:110,maxHeight:"",leftBorder:!1,rightBorder:!1},quote:{show:!0,leftBorder:!1,rightBorder:!1},separator:{show:!0,leftBorder:!1,rightBorder:!1},align:{show:!0,options:zn(e).align,width:"zh_CN"==t?110: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:zn(e).fontSize,defaultValue:"",width:100,maxHeight:200,leftBorder:!0,rightBorder:!1},fontFamily:{show:!0,options:zn(e).fontFamily,defaultValue:"",width:100,maxHeight:200,leftBorder:!1,rightBorder:!1},lineHeight:{show:!0,options:zn(e).lineHeight,defaultValue:"",width:90,maxHeight:"",leftBorder:!1,rightBorder:!1},foreColor:{show:!0,options:zn(e).foreColor,leftBorder:!0,rightBorder:!1},backColor:{show:!0,options:zn(e).backColor,leftBorder:!1,rightBorder:!1},link:{show:!0,leftBorder:!0,rightBorder:!1},image:{show:!0,leftBorder:!1,rightBorder:!1,allowedFileType:["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,allowedFileType:["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:!0,rightBorder:!1},fullScreen:{show:!1,leftBorder:!1,rightBorder:!1},extends:{}}),r.menu||{});var e,t})),M=e=>{c.value=!0,B.value=e,t.nextTick((()=>{c.value=!1}))},I=()=>{h.value.show=!1,h.value.node=null},L=()=>{r.disabled||k.value||(I(),t.nextTick((()=>{const e=Vn(w.value,C.value,"table"),t=Vn(w.value,C.value,"pre"),n=Vn(w.value,C.value,"a"),a=Vn(w.value,C.value,"img"),r=Vn(w.value,C.value,"video");if(n)h.value.type="link",h.value.node=`[data-editify-uid="${o.uid}"] [data-editify-element="${n.key}"]`,h.value.show?b.value.$refs.layerRef.setPosition():h.value.show=!0;else if(a)h.value.type="image",h.value.node=`[data-editify-uid="${o.uid}"] [data-editify-element="${a.key}"]`,h.value.show?b.value.$refs.layerRef.setPosition():h.value.show=!0;else if(r)h.value.type="video",h.value.node=`[data-editify-uid="${o.uid}"] [data-editify-element="${r.key}"]`,h.value.show?b.value.$refs.layerRef.setPosition():h.value.show=!0;else if(e)h.value.type="table",h.value.node=`[data-editify-uid="${o.uid}"] [data-editify-element="${e.key}"]`,h.value.show?b.value.$refs.layerRef.setPosition():h.value.show=!0;else if(t)h.value.type="codeBlock",h.value.node=`[data-editify-uid="${o.uid}"] [data-editify-element="${t.key}"]`,h.value.show?b.value.$refs.layerRef.setPosition():h.value.show=!0;else{!C.value.flatList.filter((e=>e.element.isText())).length||Jn(w.value,C.value)||qn(w.value,C.value)||Qn(w.value,C.value)||Yn(w.value,C.value)||ea(w.value,C.value)||(h.value.type="text",h.value.show?b.value.$refs.layerRef.setPosition():h.value.show=!0)}})))},D=()=>{let e=[];A.value.forEach((t=>{t.renderRule&&e.push(t.renderRule)})),w.value=new J(p.value,{value:B.value,disabled:r.disabled,renderRules:[e=>{((e,t)=>{"ol"!=t.parsedom&&"ul"!=t.parsedom||(t.hasChildren()&&t.children.forEach((n=>{const a=n.clone();a.parsedom="div",a.type=t.type,a.hasMarks()?a.marks["data-editify-list"]=t.parsedom:a.marks={"data-editify-list":t.parsedom},e.addElementBefore(a,t)})),t.toEmpty())})(w.value,e)},e=>{!function(e,t){if(Un(t,!0)){const n=e.getPreviousElement(t);if(n&&Un(n,!0)){const e=Number(n.marks["data-editify-value"]);t.marks["data-editify-value"]=e+1}else t.marks["data-editify-value"]=1}}(w.value,e)},e=>{!function(e,t){if("img"==t.parsedom||"video"==t.parsedom||"a"==t.parsedom){const e={"data-editify-element":t.key};t.hasMarks()?Object.assign(t.marks,e):t.marks=e}if("video"==t.parsedom||"hr"==t.parsedom){const n=e.getPreviousElement(t),a=e.getNextElement(t);if(!n||!n.isSpaceText()){const n=y.getSpaceElement();e.addElementBefore(n,t)}if(!a||!a.isSpaceText()){const n=y.getSpaceElement();e.addElementAfter(n,t)}}if("code"==t.parsedom){t.parsedom="span";const e={"data-editify-code":!0};t.hasMarks()?Object.assign(t.marks,e):t.marks=e}}(w.value,e)},e=>{Ca(w.value,e)},e=>{var t,n,a,o,r,l,i;Ba(w.value,e,!(!(null==(t=O.value)?void 0:t.use)||!(null==(o=null==(a=null==(n=O.value)?void 0:n.codeBlock)?void 0:a.languages)?void 0:o.show)),null==(i=null==(l=null==(r=O.value)?void 0:r.codeBlock)?void 0:l.languages)?void 0:i.options)},e=>{!function(e,t){t.hasChildren()&&t.children.forEach((n=>{if(Un(n,!0)||Un(n,!1)||Wn(n)||["blockquote","pre","table","h1","h2","h3","h4","h5","h6","p"].includes(n.parsedom)){const a=n.clone();a.type="block";const o=t.getBlock();e.addElementAfter(a,o),n.toEmpty()}}))}(w.value,e)},...e,...r.renderRules],allowCopy:r.allowCopy,allowPaste:r.allowPaste,allowCut:r.allowCut,allowPasteHtml:r.allowPasteHtml,customTextPaste:r.customTextPaste,customImagePaste:r.customImagePaste,customVideoPaste:r.customVideoPaste,customFilePaste:r.customFilePaste,customHtmlPaste:H,customMerge:j,customParseNode:U}),M(w.value.value),w.value.on("change",Z),w.value.on("focus",X),w.value.on("blur",G),w.value.on("keydown",W),w.value.on("keyup",q),w.value.on("insertParagraph",Q),w.value.on("rangeUpdate",ee),w.value.on("deleteInStart",ne),w.value.on("deleteComplete",oe),w.value.on("afterRender",re),w.value.formatElementStack(),w.value.domRender(),!r.autofocus||k.value||r.disabled||le()},$=()=>{p.value.querySelectorAll("video").forEach((e=>{e.style.height=e.offsetWidth/r.videoRatio+"px"}))},F=e=>{if(!r.disabled){if(te.isContains(p.value,e.target)){const t=e.target,n=ae.get(t,"data-alex-editor-key");if(n){const a=w.value.getElementByKey(n);if(a&&"td"==a.parsedom){const n=a.parent.children.length;if(a.parent.children[n-1].isEqual(a))return;const o=te.getElementBounding(t);e.pageX>=Math.abs(o.left+t.offsetWidth-5)&&e.pageX<=Math.abs(o.left+t.offsetWidth+5)&&(m.value.element=a,m.value.start=e.pageX)}}}te.isContains(E.value,e.target)||k.value||(x.value=!1)}},z=e=>{if(r.disabled)return;if(!m.value.element)return;const t=Vn(w.value,C.value,"table");if(!t)return;const n=t.children.find((e=>"colgroup"==e.parsedom)),a=m.value.element.parent.children.findIndex((e=>e.isEqual(m.value.element))),o=""+(m.value.element.elm.offsetWidth+e.pageX-m.value.start);n.children[a].marks.width=o,n.children[a].elm.setAttribute("width",o),m.value.start=e.pageX},P=()=>{if(r.disabled)return;if(!m.value.element)return;const e=Vn(w.value,C.value,"table");if(!e)return;const t=e.children.find((e=>"colgroup"==e.parsedom)),n=m.value.element.parent.children.findIndex((e=>e.isEqual(m.value.element))),a=Number(t.children[n].marks.width);isNaN(a)||(t.children[n].marks.width=`${Number((a/m.value.element.parent.elm.offsetWidth*100).toFixed(2))}%`,w.value.formatElementStack(),w.value.domRender(),w.value.rangeRender()),m.value.element=null,m.value.start=0},V=e=>{if(!r.disabled&&te.isContains(p.value,e.target)){const t=e.target,n=ae.get(t,"data-alex-editor-key");if(n){const a=w.value.getElementByKey(n);if(Wn(a)){const n=te.getElementBounding(t);e.pageX>=Math.abs(n.left)&&e.pageX<=Math.abs(n.left+16)&&e.pageY>=Math.abs(n.top+t.offsetHeight/2-8)&&e.pageY<=Math.abs(n.top+t.offsetHeight/2+8)&&("checked"==a.marks["data-editify-task"]?a.marks["data-editify-task"]="uncheck":a.marks["data-editify-task"]="checked",w.value.range||w.value.initRange(),w.value.range.anchor.moveToEnd(a),w.value.range.focus.moveToEnd(a),w.value.formatElementStack(),w.value.domRender(),w.value.rangeRender())}}}},H=async e=>{let t=Ln,n=In;if(A.value.forEach((e=>{t=Object.assign(t,e.pasteKeepStyles||{}),n=Object.assign(n,e.pasteKeepMarks||{})})),t=Object.assign(t,r.pasteKeepStyles||{}),n=Object.assign(n,r.pasteKeepMarks||{}),y.flatElements(e).forEach((e=>{let a={},o={};if(!e.isText()){if(e.hasMarks()){for(let t in n)e.marks.hasOwnProperty(t)&&(Array.isArray(n[t])&&n[t].includes(e.parsedom)||"*"==n[t])&&(a[t]=e.marks[t]);e.marks=a}if(e.hasStyles()){for(let n in t)e.styles.hasOwnProperty(n)&&(Array.isArray(t[n])&&t[n].includes(e.parsedom)||"*"==t[n])&&(o[n]=e.styles[n]);e.styles=o}}})),"function"==typeof r.customHtmlPaste)await r.customHtmlPaste(e);else for(let a=0;a<e.length;a++)0==a?w.value.insertElement(e[a]):w.value.insertElement(e[a],!1)},j=(e,t)=>{const n=t.getUneditableElement();n?n.toEmpty():(t.children.push(...e.children),t.children.forEach((e=>{e.parent=t})),e.children=null)},U=e=>(A.value.forEach((t=>{t.customParseNode&&(e=t.customParseNode(e))})),"function"==typeof r.customParseNode&&(e=r.customParseNode(e)),e),W=(e,t)=>{r.disabled||("tab"!=t.key.toLocaleLowerCase()||t.metaKey||t.shiftKey||t.ctrlKey||t.altKey||!r.tab||(t.preventDefault(),w.value.insertText(" "),w.value.formatElementStack(),w.value.domRender(),w.value.rangeRender()),l("keydown",e,t))},q=(e,t)=>{r.disabled||l("keyup",e,t)},K=e=>{if(r.disabled||k.value)return;const t=e.target;if("img"==t.nodeName.toLocaleLowerCase()||"video"==t.nodeName.toLocaleLowerCase()){const e=Number(t.getAttribute("data-editify-element"));if(Y.isNumber(e)){const t=w.value.getElementByKey(e);w.value.range||w.value.initRange(),w.value.range.anchor.moveToStart(t),w.value.range.focus.moveToEnd(t),w.value.rangeRender()}}},Z=(e,t)=>{r.disabled||(M(e),l("change",e,t))},G=e=>{r.disabled||(r.border&&r.color&&!_.value&&(g.value.style.borderColor="",g.value.style.boxShadow="",R.value.use&&(f.value.$el.style.borderColor="",f.value.$el.style.boxShadow="")),l("blur",e))},X=e=>{if(!r.disabled){if(r.border&&r.color&&!_.value){g.value.style.borderColor=r.color;const e=se.hex2rgb(r.color);R.value.use&&"inner"==R.value.mode?(g.value.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)`,f.value.$el.style.borderColor=r.color,f.value.$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)`):(R.value.use,g.value.style.boxShadow=`0 0 8px rgba(${e[0]},${e[1]},${e[2]},0.5)`)}setTimeout((()=>{x.value=!0,l("focus",e)}),0)}},Q=(e,t)=>{e.isEqual(t)||(t.isBlock()&&e.isBlock()&&t.isOnlyHasBreak()&&e.isOnlyHasBreak()&&t.parsedom!=y.BLOCK_NODE&&(ra(t),w.value.range.anchor.moveToStart(t),w.value.range.focus.moveToStart(t),e.toEmpty()),Wn(e)&&(e.marks["data-editify-task"]="uncheck")),l("insertparagraph",B.value)},ee=()=>{r.disabled||(x.value=!!w.value.range,w.value.range&&(C.value=w.value.getElementsByRange(),u.value&&(clearTimeout(u.value),u.value=null),u.value=setTimeout((()=>{(O.value.use||R.value.use)&&(O.value.use&&L(),R.value.use&&f.value.handleRangeUpdate())}),200),l("rangeupdate")))},ne=e=>{e.isBlock()&&ra(e)},oe=()=>{const e=w.value.range.anchor.element.getUneditableElement();e&&e.toEmpty()},re=()=>{$(),A.value.forEach((e=>{e.updateView&&e.updateView()})),l("updateview")},le=()=>{r.disabled||(w.value.collapseToEnd(),w.value.rangeRender(),te.setScrollTop({el:p.value,number:1e6,time:0}))};return t.watch((()=>B.value),(e=>{c.value||(w.value.stack=w.value.parseHtml(e),w.value.range=null,w.value.formatElementStack(),w.value.domRender(),w.value.rangeRender(),p.value.blur())})),t.watch((()=>k.value),(e=>{O.value.use&&(e?I():L())})),t.watch((()=>r.disabled),(e=>{e?w.value.setDisabled():w.value.setEnabled()})),t.onMounted((()=>{D(),(()=>{const e=t=>{ie.on(t,`scroll.editify_${o.uid}`,(()=>{O.value.use&&h.value.show&&I()})),t.parentNode&&e(t.parentNode)};e(p.value)})(),ie.on(document.documentElement,`mousedown.editify_${o.uid}`,F),ie.on(document.documentElement,`mousemove.editify_${o.uid}`,z),ie.on(document.documentElement,`mouseup.editify_${o.uid}`,P),ie.on(document.documentElement,`click.editify_${o.uid}`,V),ie.on(window,`resize.editify_${o.uid}`,$)})),t.onBeforeUnmount((()=>{(()=>{const e=t=>{ie.off(t,`scroll.editify_${o.uid}`),t.parentNode&&e(t.parentNode)};e(p.value)})(),ie.off(document.documentElement,`mousedown.editify_${o.uid} mousemove.editify_${o.uid} mouseup.editify_${o.uid} click.editify_${o.uid}`),ie.off(window,`resize.editify_${o.uid}`),w.value.destroy()})),t.provide("$editTrans",i),t.provide("editify",o),t.provide("isSourceView",k),t.provide("isFullScreen",_),t.provide("canUseMenu",x),t.provide("editor",w),t.provide("dataRangeCaches",C),t.provide("showBorder",N),t.provide("pluginResultList",A),n({editor:w,isSourceView:k,isFullScreen:_,canUseMenu:x,dataRangeCaches:C,textValue:T,collapseToEnd:le,collapseToStart:()=>{r.disabled||(w.value.collapseToStart(),w.value.rangeRender(),t.nextTick((()=>{te.setScrollTop({el:p.value,number:0,time:0})})))},undo:()=>{if(r.disabled)return;const e=w.value.history.get(-1);e&&(w.value.history.current=e.current,w.value.stack=e.stack,w.value.range=e.range,w.value.formatElementStack(),w.value.domRender(!0),w.value.rangeRender())},redo:()=>{if(r.disabled)return;const e=w.value.history.get(1);e&&(w.value.history.current=e.current,w.value.stack=e.stack,w.value.range=e.range,w.value.formatElementStack(),w.value.domRender(!0),w.value.rangeRender())}}),(e,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify",{"editify-fullscreen":_.value,"editify-autoheight":!_.value&&e.autoheight}]),ref_key:"elRef",ref:E},[R.value.use?(t.openBlock(),t.createBlock(qo,{key:0,config:R.value,color:e.color,ref_key:"menuRef",ref:f},null,8,["config","color"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"bodyRef",ref:g,class:t.normalizeClass(["editify-body",{"editify-border":N.value,"editify-menu_inner":R.value.use&&"inner"==R.value.mode}]),"data-editify-uid":t.unref(o).uid},[t.createElementVNode("div",{ref_key:"contentRef",ref:p,class:t.normalizeClass(["editify-content",{"editify-placeholder":S.value,"editify-disabled":e.disabled}]),onClick:K,onCompositionstart:n[0]||(n[0]=e=>d.value=!0),onCompositionend:n[1]||(n[1]=e=>d.value=!1),"data-editify-placeholder":e.placeholder},null,42,Qo),k.value?(t.openBlock(),t.createElementBlock("textarea",{key:0,value:B.value,readonly:"",class:"editify-sourceview"},null,8,Jo)):t.createCommentVNode("",!0),t.createVNode(uo,{ref_key:"toolbarRef",ref:b,modelValue:h.value.show,"onUpdate:modelValue":n[2]||(n[2]=e=>h.value.show=e),node:h.value.node,type:h.value.type,config:O.value,color:e.color},null,8,["modelValue","node","type","config","color"])],10,Xo),e.showWordLength?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["editify-footer",{"editify-fullscreen":_.value&&!k.value}]),ref_key:"footerRef",ref:v},[t.createElementVNode("div",Yo,t.toDisplayString(t.unref(i)("totalWordCount"))+t.toDisplayString(T.value.length),1)],2)):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-21167e28"]]),tr={color:{type:String,default:""},accept:{type:String,default:null},allowedFileType:{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}},nr={class:"editify-attachment"},ar={class:"editify-attachment-header"},or={key:0,class:"editify-attachment-remote"},rr=["placeholder"],lr=["placeholder"],ir={key:1,class:"editify-attachment-upload"},sr=["placeholder"],cr=["multiple","accept"],dr=Na(t.defineComponent({name:"InsertAttachment",__name:"insertAttachment",props:tr,emits:["change","insert"],setup(e,{emit:n}){const a=e,o=n,r=t.inject("$editTrans"),l=t.ref("upload"),i=t.ref(""),s=t.ref(""),c=t.ref(null),d=t.computed((()=>e=>l.value==e?{color:a.color}:{})),u=e=>{const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},m=e=>{a.color&&(e.currentTarget.style.borderColor=a.color)},h=e=>{e.currentTarget.style.borderColor=""},f=()=>{o("insert",i.value,[s.value])},g=()=>{c.value.click()},p=async()=>{const e=c.value.files;if(!e||!e.length)return;let t=[];for(let n=0;n<e.length;n++){const o=e[n],r=u(o);!(a.allowedFileType&&Array.isArray(a.allowedFileType)&&a.allowedFileType.length)||a.allowedFileType.some((e=>e.toLocaleLowerCase()==r.toLocaleLowerCase()))?a.maxSize&&o.size/1024>a.maxSize?"function"==typeof a.handleError&&a.handleError("maxSizeError",o):a.minSize&&o.size/1024<a.minSize?"function"==typeof a.handleError&&a.handleError("minSizeError",o):t.push(o):"function"==typeof a.handleError&&a.handleError("suffixError",o)}if(t.length){let e=[];if("function"==typeof a.customUpload)e=await a.customUpload(t)||[];else for(let n=0;n<t.length;n++){const a=await ce.dataFileToBase64(t[n]);e.push(a)}o("insert",i.value,e)}c.value.value=""};return t.watch((()=>l.value),(()=>{o("change")})),(e,n)=>(t.openBlock(),t.createElementBlock("div",nr,[t.createElementVNode("div",ar,[t.createElementVNode("div",{onClick:n[0]||(n[0]=e=>l.value="upload"),class:t.normalizeClass(["editify-attachment-header-item",{"editify-active":"upload"==l.value}]),style:t.normalizeStyle(d.value("upload"))},t.toDisplayString(t.unref(r)("uploadAttachment")),7),t.createElementVNode("div",{onClick:n[1]||(n[1]=e=>l.value="remote"),class:t.normalizeClass(["editify-attachment-header-item",{"editify-active":"remote"==l.value}]),style:t.normalizeStyle(d.value("remote"))},t.toDisplayString(t.unref(r)("remoteAttachment")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-attachment-header-slider","editify-"+l.value]),style:t.normalizeStyle({backgroundColor:e.color||""})},null,6)]),"remote"==l.value?(t.openBlock(),t.createElementBlock("div",or,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e),placeholder:t.unref(r)("attachmentNamePlaceholder"),onBlur:h,onFocus:m,type:"text"},null,40,rr),[[t.vModelText,i.value,void 0,{trim:!0}]]),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[3]||(n[3]=e=>s.value=e),placeholder:t.unref(r)("attachmentUrlPlaceholder"),onBlur:h,onFocus:m,type:"url"},null,40,lr),[[t.vModelText,s.value,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-attachment-remote-footer",style:t.normalizeStyle({color:e.color||""})},[t.createElementVNode("span",{onClick:f},t.toDisplayString(t.unref(r)("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",ir,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[4]||(n[4]=e=>i.value=e),placeholder:t.unref(r)("attachmentNamePlaceholder"),onBlur:h,onFocus:m,type:"text"},null,40,sr),[[t.vModelText,i.value,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-attachment-btn",onClick:g},[t.createVNode(Fa,{value:"upload"}),t.createElementVNode("input",{ref_key:"fileInputRef",ref:c,multiple:e.multiple,accept:e.accept,onChange:p,type:"file"},null,40,cr)])]))]))}}),[["__scopeId","data-v-52b1e545"]]),ur=e=>!e.isEmpty()&&("span"==e.parsedom&&"closed"==e.type&&e.hasMarks()&&e.marks["data-editify-attachment"]),mr=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?ur(e.range.anchor.element):t.flatList.some((e=>ur(e.element)))),hr=e=>{e.component(er.name,er)},fr="0.1.37";console.log(`%c vue-editify %c v${fr} `,"padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;","padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;"),e.AlexElement=y,e.Editify=er,e.attachment=e=>{oe.isObject(e)||(e={});return(n,a)=>{let o=!1;return n.exposed.editor.value&&(o=qn(n.exposed.editor.value,n.exposed.dataRangeCaches.value)||Qn(n.exposed.editor.value,n.exposed.dataRangeCaches.value)||Kn(n.exposed.editor.value,n.exposed.dataRangeCaches.value)),{name:"attachment",menu:{sequence:e.sequence||100,extraDisabled:e=>("link"==e||"quote"==e||"codeBlock"==e)&&mr(n.exposed.editor.value,n.exposed.dataRangeCaches.value),extend:{type:"select",title:e.title||a("insertAttachment"),leftBorder:e.leftBorder,rightBorder:e.rightBorder,hideScroll:!0,disabled:o,default:()=>t.h(Fa,{value:"attachment"}),layer:(o,r)=>t.h(dr,{color:n.props.color,accept:e.accept,allowedFileType:e.allowedFileType||[],multiple:!!e.multiple,maxSize:e.maxSize,minSize:e.minSize,customUpload:e.customUpload,handleError:e.handleError,onChange:()=>{r.$refs.layerRef.setPosition()},onInsert:(e,t)=>{if((t=t.filter((e=>!!e))).length){const o=n.exposed.editor.value;t.forEach((t=>{const n={"data-editify-attachment":t,"data-editify-attachment-name":e||a("attachmentDefaultName")},r=new y("closed","span",n,null,null);o.insertElement(r);const l=y.getSpaceElement(),i=y.getSpaceElement();o.addElementBefore(l,r),o.addElementAfter(i,r),o.range.anchor.moveToEnd(i),o.range.focus.moveToEnd(i)})),o.formatElementStack(),o.domRender(),o.rangeRender()}r.show=!1}})}},updateView:()=>{const e=n.exposed.editor.value;y.flatElements(e.stack).forEach((e=>{"span"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-attachment"]&&(ie.off(e.elm,"click"),ie.on(e.elm,"click",(async()=>{const t=e.marks["data-editify-attachment"],n=await fetch(t,{method:"GET"}),a=await n.blob(),o=document.createElement("a");o.setAttribute("target","_blank"),o.setAttribute("href",URL.createObjectURL(a)),o.setAttribute("download",e.marks["data-editify-attachment-name"]),o.click()})))}))},customParseNode:e=>(e.hasMarks()&&e.marks["data-editify-attachment"]&&"span"==e.parsedom&&(e.type="closed"),e),pasteKeepMarks:{"data-editify-attachment":["span"],"data-editify-attachment-name":["span"]},renderRule:e=>{if(e.hasMarks()&&e.marks["data-editify-attachment"]){e.marks.title=a("attachmentDownloadTitle"),e.marks["data-editify-attachment-name"]||(e.marks["data-editify-attachment-name"]=a("attachmentDefaultName"));const t=n.exposed.editor.value,o=t.getPreviousElement(e),r=t.getNextElement(e);if(!o||!o.isSpaceText()){const n=y.getSpaceElement();t.addElementBefore(n,e)}if(!r||!r.isSpaceText()){const n=y.getSpaceElement();t.addElementAfter(n,e)}}}}}},e.default=hr,e.elementIsInList=Hn,e.elementIsInTask=jn,e.getCurrentParsedomElement=Vn,e.getParsedomElementByElement=Pn,e.getRangeText=aa,e.hasAttachmentInRange=mr,e.hasImageInRange=Yn,e.hasLinkInRange=Qn,e.hasListInRange=(e,t,n=!1)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?Hn(e.range.anchor.element,n):t.flatList.some((e=>Hn(e.element,n)))),e.hasPreInRange=qn,e.hasQuoteInRange=Kn,e.hasTableInRange=Jn,e.hasTaskInRange=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?jn(e.range.anchor.element):t.flatList.some((e=>jn(e.element)))),e.hasVideoInRange=ea,e.insertCodeBlock=xa,e.insertImage=wa,e.insertLink=Ea,e.insertTable=_a,e.insertVideo=ka,e.install=hr,e.isAttachment=ur,e.isList=Un,e.isRangeInList=Gn,e.isRangeInPre=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Pn(e.range.anchor.element,"pre"):t.list.every((e=>!!Pn(e.element,"pre")))),e.isRangeInQuote=Zn,e.isRangeInTask=Xn,e.isTask=Wn,e.queryTextMark=na,e.queryTextStyle=ta,e.removeTextMark=va,e.removeTextStyle=ba,e.setAlign=ma,e.setIndentDecrease=da,e.setIndentIncrease=ca,e.setLineHeight=ya,e.setList=ha,e.setQuote=ua,e.setTask=fa,e.setTextMark=pa,e.setTextStyle=ga,e.version=fr,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 r=Object.defineProperty,n=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const a={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 r=0,n=0,a=0;try{r=e.toString().split(".")[1].length}catch(o){}try{n=t.toString().split(".")[1].length}catch(o){}return a=Math.pow(10,Math.max(r,n)),(e*a+t*a)/a})),subtract:(...e)=>e.reduce(((e,t)=>{let r=0,n=0,a=0;try{r=e.toString().split(".")[1].length}catch(o){}try{n=t.toString().split(".")[1].length}catch(o){}return a=Math.pow(10,Math.max(r,n)),(e*a-t*a)/a})),mutiply:(...e)=>e.reduce(((e,t)=>{let r=0,n=e.toString(),a=t.toString();try{r+=n.split(".")[1].length}catch(o){}try{r+=a.split(".")[1].length}catch(o){}return Number(n.replace(".",""))*Number(a.replace(".",""))/Math.pow(10,r)})),divide:(...e)=>e.reduce(((e,t)=>{let r=0,n=0,a=e.toString(),o=t.toString();try{r=a.split(".")[1].length}catch(i){}try{n=o.split(".")[1].length}catch(i){}return Number(a.replace(".",""))/Number(o.replace(".",""))*Math.pow(10,n-r)}))},o={insert(e,t,r){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(!a.isNumber(r))throw new TypeError("The third argument must be a number");if(r<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,r)+t+e.substring(r,e.length)},delete(e,t,r){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!a.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(!a.isNumber(r))throw new TypeError("The third argument must be a number");if(r<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,t)+e.substring(t+r,e.length)},replace(e,t,r,n){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!a.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(!a.isNumber(r))throw new TypeError("The third argument must be a number");if(r<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(r,e.length)},trim(e,t){if("string"!=typeof e)throw new TypeError("The first argument must be a string");let r=e.replace(/(^\s+)|(\s+$)/g,"");return t&&(r=r.replace(/\s/g,"")),r}},i={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 r=e,n=0,a=0;for(;this.isElement(e)&&this.isContains(t,e)&&t!==e;)n+=e.offsetTop,a+=e.offsetLeft,e=e.offsetParent;return{top:n,left:a,right:t.offsetWidth-a-r.offsetWidth,bottom:t.offsetHeight-n-r.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)))},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(!a.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return a.mutiply(e,parseFloat(t))},px2rem(e){if(!a.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return a.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,r=parseFloat(this.getCssStyle(e,"padding-left")),n=parseFloat(this.getCssStyle(e,"padding-right"));return a.subtract(t,r,n)},height(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientHeight,r=parseFloat(this.getCssStyle(e,"padding-top")),n=parseFloat(this.getCssStyle(e,"padding-bottom"));return a.subtract(t,r,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 r=e.classList;o.trim(t).split(/\s+/).forEach((e=>{r.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 r=e.classList;o.trim(t).split(/\s+/).forEach((e=>{r.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 r=e.classList;return o.trim(t).split(/\s+/).every((e=>r.contains(e)))},scrollTopBottomTrigger(e,t){"string"==typeof e&&e&&(e=document.body.querySelector(e));let r=window;this.isElement(e)&&e!=document.body&&e!=document.documentElement&&(r=e),"function"==typeof e&&(t=e);let n=!0;r.addEventListener("scroll",(()=>{if(this.getScrollTop(r)<=0){if(!n)return;"function"==typeof t&&(n=!1,t({state:"top",target:r}))}else{let e={state:"bottom",target:r},o=0;if(o=r==window?window.innerHeight:r.clientHeight,a.add(this.getScrollTop(r),o)+1>=this.getScrollHeight(r)&&o!=this.getScrollHeight(r)){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,r=e.el;"string"==typeof r&&r&&(r=document.body.querySelector(r));let n=e.number||0,o=e.time||0;return this.isElement(r)&&r!=document.body&&r!=document.documentElement&&r!=window||(t=!0),new Promise((e=>{if(o<=0)t?document.documentElement.scrollTop=document.body.scrollTop=n:r.scrollTop=n,e();else{let i=10,l=a.divide(o,i),s=this.getScrollTop(r),c=a.divide(a.subtract(n,s),l),d=setInterval((()=>{l>0?(l--,t?document.documentElement.scrollTop=document.body.scrollTop=s=a.add(s,c):r.scrollTop=s=a.add(s,c)):(clearInterval(d),e())}),i)}}))},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,r=e.el;"string"==typeof r&&r&&(r=document.body.querySelector(r));let n=e.number||0,o=e.time||0;return this.isElement(r)&&r!=document.body&&r!=document.documentElement&&r!=window||(t=!0),new Promise((e=>{if(o<=0)t?document.documentElement.scrollLeft=document.body.scrollLeft=n:r.scrollLeft=n,e();else{let i=10,l=a.divide(o,i),s=this.getScrollLeft(r),c=a.divide(a.subtract(n,s),l),d=setInterval((()=>{l>0?(l--,t?document.documentElement.scrollLeft=document.body.scrollLeft=s=a.add(s,c):r.scrollLeft=s=a.add(s,c)):(clearInterval(d),e())}),i)}}))},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 r="";return r=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(e)[t]:e.currentStyle[t],r},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",r="",n=o.trim(e,!0).substring(1,o.trim(e,!0).length-1).split("=");return 1==n.length&&(r=n[0]),2==n.length&&(r={attributeName:n[0],attributeValue:n[1].replace(/\'/g,"").replace(/\"/g,"")}),{type:t,value:r}}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:a.subtract(document.documentElement.clientHeight||window.innerHeight,t.bottom),left:t.left,right:a.subtract(document.documentElement.clientWidth||window.innerWidth,t.right)}},isElement:e=>e&&e instanceof Node&&1===e.nodeType,string2dom(e,t){if(!e||"string"!=typeof e)throw new TypeError("The argument must be an HTML string");let r=document.createElement(t||"div");return r.innerHTML=e,1==r.children.length?r.children[0]:Array.from(r.children)}},l="_dap-datas",s={remove(e,t){if(!(e instanceof Document||i.isElement(e)||i.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let r=e[l]||{};null==t||""===t?e[l]={}:(delete r[t],e[l]=r)},has(e,t){if(!(e instanceof Document||i.isElement(e)||i.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[l]||{}).hasOwnProperty(t)},get(e,t){if(!(e instanceof Document||i.isElement(e)||i.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let r=e[l]||{};return null==t||""===t?r:r[t]},set(e,t,r){if(!(e instanceof Document||i.isElement(e)||i.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[l]||{};n[t]=r,e[l]=n}},c={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 r=null;if("Chinese"==t&&(r=/^[\u4e00-\u9fa5]+$/),"chinese"==t&&(r=/[\u4e00-\u9fa5]/),"email"==t&&(r=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/),"username"==t&&(r=/^[a-zA-Z0-9_]{4,16}$/),"int+"==t&&(r=/^\d+$/),"int-"==t&&(r=/^-\d+$/),"int"==t&&(r=/^-?\d+$/),"pos"==t&&(r=/^\d*\.?\d+$/),"neg"==t&&(r=/^-\d*\.?\d+$/),"number"==t&&(r=/^-?\d*\.?\d+$/),"phone"==t&&(r=/^1[0-9]\d{9}$/),"idCard"==t&&(r=/^[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&&(r=/^(https?|ftp):\/\/(-\.)?([^\s\/?\.#-]+\.?)+(\/[^\s]*)?$/),"IPv4"==t&&(r=/^(?:(?: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&&(r=/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/),"rgb"==t&&(r=/^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&&(r=/^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&&(r=/^[1-9][0-9]{4,10}$/),"weixin"==t&&(r=/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/),"plate"==t&&(r=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/),!r)throw new Error("The second parameter is out of scope");return r.test(e)},getUrlParams(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),r=window.location.search.substr(1);if(!r){let e=window.location.hash.split("?");2==e.length&&(r=e[1])}let n=r.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 r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);if(r.length!=n.length)return!1;let a=r.length,o=!0;for(let i=0;i<a;i++){let n=r[i],a=e[n],l=t[n];if(!this.equal(a,l)){o=!1;break}}return o}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 r in e)t[r]=this.clone(e[r]);return t}return e}},d=e=>{let t=e.split(/[\s]+/g),r=[];return t.forEach((e=>{let t=e.split("."),n={eventName:t[0]};t.length>1&&(n.guid=t[1]),r.push(n)})),r},u=(e,t,r)=>{let n=s.get(e,"dap-defined-events")||{},a=Object.keys(n),o=a.length;for(let i=0;i<o;i++){let o=a[i];n[o].type==t&&(r?o==t+"."+r&&(e.removeEventListener(n[o].type,n[o].fn,n[o].options),n[o]=void 0):(e.removeEventListener(n[o].type,n[o].fn,n[o].options),n[o]=void 0))}n=(e=>{let t={};return Object.keys(e).forEach((r=>{e[r]&&(t[r]=e[r])})),t})(n),s.set(e,"dap-defined-events",n)},h={on(e,t,r,n){if(!(e instanceof Document||i.isElement(e)||i.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(!r||"function"!=typeof r)throw new TypeError("The third argument must be a function");c.isObject(n)||(n={});d(t).forEach((t=>{((e,t,r,n,a)=>{let o=s.get(e,"dap-defined-events")||{};r||(r=s.get(e,"dap-event-guid")||0,s.set(e,"dap-event-guid",r+1)),o[r=t+"."+r]&&o[r].type==t&&e.removeEventListener(t,o[r].fn,o[r].options),e.addEventListener(t,n,a),o[r]={type:t,fn:n,options:a},s.set(e,"dap-defined-events",o)})(e,t.eventName,t.guid,r.bind(e),n)}))},off(e,t){if(!(e instanceof Document||i.isElement(e)||i.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let r=s.get(e,"dap-defined-events");if(!r)return;if(!t){let t=Object.keys(r),n=t.length;for(let a=0;a<n;a++){let n=t[a];e.removeEventListener(r[n].type,r[n].fn,r[n].options)}return s.remove(e,"dap-defined-events"),void s.remove(e,"dap-event-guid")}d(t).forEach((t=>{u(e,t.eventName,t.guid)}))},get(e){if(!(e instanceof Document||i.isElement(e)||i.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let t=s.get(e,"dap-defined-events");if(t)return t}},m={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,r)=>{e&&e instanceof File||r(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 r=e.split(","),n=r[0].match(/:(.*?);/)[1],a=atob(r[1]),o=a.length,i=new Uint8Array(o);for(;o--;)i[o]=a.charCodeAt(o);return new File([i],t,{type:n})},compressImage(e,t){const r={width:void 0,quality:.8,mimeType:"jpeg",maxSize:0,minSize:0};c.isObject(t)&&(a.isNumber(t.width)&&(r.width=t.width),a.isNumber(t.quality)&&t.quality>=0&&t.quality<=1&&(r.quality=t.quality),"jpeg"!=t.mimeType&&"webp"!=t.mimeType||(r.mimeType=t.mimeType),a.isNumber(t.maxSize)&&(r.maxSize=t.maxSize),a.isNumber(t.minSize)&&(r.minSize=t.minSize));const n=(e,t,a)=>{let o=e.toDataURL("image/"+r.mimeType,a),i=this.dataBase64toFile(o,t);if(r.maxSize>0&&i.size>1024*r.maxSize){a=a<=0?0:Number((a-.01).toFixed(2));const r=n(e,t,a);o=r.url,i=r.file,a=r.quality}return{file:i,url:o,quality:a}};return new Promise(((t,a)=>{let o=new FileReader;o.readAsDataURL(e),o.onload=()=>{let i=o.result,l=new Image;l.src=i,l.onload=()=>{if(r.minSize>0&&e.size<=1024*r.minSize)return void t({file:e,url:i,quality:1,width:l.width,height:l.height});let a=document.createElement("canvas"),o=a.getContext("2d");a.width=r.width||l.width,a.height=r.width?r.width/(l.width/l.height):l.height,o.drawImage(l,0,0,a.width,a.height);let s=e.name.lastIndexOf(".");const c=e.name.substring(0,s)+"."+r.mimeType;let d=n(a,c,r.quality);t({...d,width:a.width,height:a.height})},l.onerror=()=>{a(new Error("Failed to load image file"))}},o.onerror=()=>{a(new Error("Failed to load image file"))}}))}},p={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")}}},g=function(e){return/^[\uFEFF]+$/g.test(e)},f=function(e){return c.isObject(e)||Array.isArray(e)?JSON.parse(JSON.stringify(e)):e},v=function(e,t){return 3==t.nodeType?i.isContains(e,t.parentNode):i.isContains(e,t)},b=class e{constructor(e,t,r,a,o){n(this,"key",function(){let e=s.get(window,"data-alex-editor-key")||0;return e++,s.set(window,"data-alex-editor-key",e),e}()),n(this,"type"),n(this,"parsedom"),n(this,"marks"),n(this,"styles"),n(this,"textContent"),n(this,"children",null),n(this,"parent",null),n(this,"behavior","default"),n(this,"namespace",null),n(this,"locked",!1),n(this,"elm",null),this.type=e,this.parsedom=t,this.marks=r,this.styles=a,this.textContent=o}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.isEmpty()))}return!1}isSpaceText(){return this.isText()&&!this.isEmpty()&&g(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(){if(this.hasChildren()){const e=this.children.some((e=>e.isBreak())),t=this.children.every((e=>e.isBreak()||e.isEmpty()));return e&&t}return!1}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&&(!!c.isObject(this.marks)&&!c.isEmptyObject(this.marks))}hasStyles(){return!!this.styles&&(!!c.isObject(this.styles)&&!c.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 r=new e(this.type,this.parsedom,f(this.marks),f(this.styles),this.textContent);return r.behavior=this.behavior,r.namespace=this.namespace,r.locked=this.locked,t&&this.hasChildren()&&this.children.forEach((e=>{let n=e.clone(t);r.hasChildren()?r.children.push(n):r.children=[n],n.parent=r})),r}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,this.elm=null,this.namespace=null,void(this.locked=!1)):this.isClosed()?(this.type="text",this.parsedom=null,this.marks=null,this.styles=null,this.textContent=null,this.elm=null,this.namespace=null,void(this.locked=!1)):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()&&c.equal(this.styles,e.styles))}isEqualMarks(e){return!this.hasMarks()&&!e.hasMarks()||!!(this.hasMarks()&&e.hasMarks()&&c.equal(this.marks,e.marks))}isFirst(t){if(!this.isText()&&!this.isClosed())return!1;if(t.isEqual(this))return!1;if(t.isContains(this)){const r=e.flatElements(t.children).filter((e=>e.isText()||e.isClosed()));return this.isEqual(r[0])}return!1}isLast(t){if(!this.isText()&&!this.isClosed())return!1;if(t.isEqual(this))return!1;if(t.isContains(this)){const r=e.flatElements(t.children).filter((e=>e.isText()||e.isClosed())),n=r.length;return this.isEqual(r[n-1])}return!1}__render(){let t=null;if(this.isText()){t=this.namespace?document.createElementNS(this.namespace,e.TEXT_NODE):document.createElement(e.TEXT_NODE);const r=document.createTextNode(this.textContent);t.appendChild(r)}else t=this.namespace?document.createElementNS(this.namespace,this.parsedom):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])})),s.set(t,"data-alex-editor-key",this.key),this.elm=t}__fullClone(){let t=new e(this.type,this.parsedom,f(this.marks),f(this.styles),this.textContent);return t.behavior=this.behavior,t.namespace=this.namespace,t.locked=this.locked,t.key=this.key,t.elm=this.elm,this.hasChildren()&&this.children.forEach((e=>{let r=e.__fullClone();t.hasChildren()?t.children.push(r):t.children=[r],r.parent=t})),t}static isElement(t){return t instanceof e}static flatElements(e){const t=e=>{let r=[];const n=e.length;for(let a=0;a<n;a++)if(e[a]&&(r.push(e[a]),e[a].hasChildren())){const n=t(e[a].children);r.push(...n)}return r};return t(e)}static getSpaceElement(){return new e("text",null,null,null,"\ufeff")}};n(b,"BLOCK_NODE","p"),n(b,"TEXT_NODE","span"),n(b,"VOID_NODES",["colgroup","col"]),n(b,"EMPTY_NODES",["meta","link","style","script","title","base","noscript","template","annotation"]);let y=b;class w{constructor(e,t){n(this,"anchor"),n(this,"focus"),this.anchor=e,this.focus=t}}class x{constructor(e,t){if(n(this,"element"),n(this,"offset"),this.element=e,this.offset=t,this.element.isText()||this.element.isClosed()){if(y.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(!y.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(y.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=y.flatElements(e.children).filter((e=>!e.isEmpty()&&!y.VOID_NODES.includes(e.parsedom))),r=t.length;if(0==r)throw new Error("There is no element to set the focus");this.moveToEnd(t[r-1])}}moveToStart(e){if(!y.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(y.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=y.flatElements(e.children).filter((e=>!e.isEmpty()&&!y.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 E{constructor(){n(this,"records",[]),n(this,"current",-1)}push(e,t){this.current<this.records.length-1&&(this.records.length=this.current+1);const r=e.map((e=>e.__fullClone())),n=this.__cloneRange(r,t);this.records.push({stack:r,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:r,range:n}=this.records[t],a=r.map((e=>e.__fullClone()));return{current:t,stack:a,range:this.__cloneRange(a,n)}}updateCurrentRange(e){const t=this.records[this.current],r=this.__cloneRange(t.stack,e);this.records[this.current].range=r}__cloneRange(e,t){if(t){const r=y.flatElements(e).find((e=>e.key==t.anchor.element.key)),n=y.flatElements(e).find((e=>e.key==t.focus.element.key));if(r&&n){const e=new x(r,t.anchor.offset),a=new x(n,t.focus.offset);return new w(e,a)}}return null}}const k=[{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"}],T=[{parsedom:"li",block:!0},{parsedom:"tfoot"},{parsedom:"tbody"},{parsedom:"thead"},{parsedom:"tr"},{parsedom:"th"},{parsedom:"td"},{parsedom:"colgroup"}],B=[{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:{"font-family":e=>e.getAttribute("face")||""}}],_=function(e){if(e.hasChildren()){e.children.filter((e=>!e.isEmpty()&&e.isBlock())).forEach((t=>{t.type="inline"==e.type?"inline":"inblock","inblock"==t.type&&(t.behavior="block")}))}},C=function(e){if(e.hasChildren()){const t=e.children.filter((e=>!e.isEmpty())),r=t.filter((e=>e.isInblock()));r.length&&r.length!=t.length&&r.forEach((e=>{e.type="inline"}))}},N=function(e){if(e.isInline()&&e.hasChildren()){e.children.filter((e=>!e.isEmpty()&&e.isInblock())).forEach((e=>{e.type="inline"}))}},M=function(e){if(e.hasChildren()){const t=e.children.filter((e=>!e.isEmpty())),r=t.filter((e=>e.isBreak()));r.length&&r.length==t.length?(this.range&&e.isContains(this.range.anchor.element)&&this.range.anchor.moveToStart(r[0]),this.range&&e.isContains(this.range.focus.element)&&this.range.focus.moveToStart(r[0]),e.children=[r[0]]):r.length&&r.forEach((e=>{e.toEmpty()}))}},A=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 r=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(r,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 r=e.parent.children.findIndex((t=>e.isEqual(t)));e.parent.children.splice(r,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 r=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(r,1)}else if(e.isInline()){e.children.push(...t.children),e.children.forEach((t=>{t.parent=e})),r(e);const n=t.parent.children.findIndex((e=>t.isEqual(e)));t.parent.children.splice(n,1)}},r=e=>{if(e.hasChildren()&&e.children.length>1){let a=0;for(;a<=e.children.length-2;)r=e.children[a],n=e.children[a+1],r.locked||n.locked||!(r.isEmpty()||n.isEmpty()||(r.isText()&&n.isText()?r.isEqualStyles(n)&&r.isEqualMarks(n):r.isInline()&&n.isInline()&&r.parsedom==n.parsedom&&r.isEqualMarks(n)&&r.isEqualStyles(n)))?a++:t(e.children[a],e.children[a+1])}var r,n};r(e)},O=function(e){const t=(e,t)=>{t.isText()?(e.type="text",e.parsedom=null,t.hasMarks()&&(e.hasMarks()?Object.assign(e.marks,f(t.marks)):e.marks=f(t.marks)),t.hasStyles()&&(e.hasStyles()?Object.assign(e.styles,f(t.styles)):e.styles=f(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,f(t.marks)):e.marks=f(t.marks)),t.hasStyles()&&(e.hasStyles()?Object.assign(e.styles,f(t.styles)):e.styles=f(t.styles)),t.hasChildren()&&(e.children=[...t.children],e.children.forEach((t=>{t.parent=e}))),r(e))},r=e=>{var r,n;e.hasChildren()&&1==e.children.length&&e.children[0]&&(r=e,n=e.children[0],!r.locked&&!n.locked&&(n.isText()&&r.isInline()?r.parsedom==y.TEXT_NODE:(r.isInline()&&n.isInline()||r.isInblock()&&n.isInblock())&&r.parsedom==n.parsedom))&&t(e,e.children[0])};r(e)},z=function(e){if(e.isText()){let t=e.textContent,r=0;for(;r<t.length;){const n=t.charAt(r);g(n)&&r>0&&g(t.charAt(r-1))?(this.range&&this.range.anchor.element.isEqual(e)&&this.range.anchor.offset>=r+1&&(this.range.anchor.offset-=1),this.range&&this.range.focus.element.isEqual(e)&&this.range.focus.offset>=r+1&&(this.range.focus.offset-=1),t=o.delete(t,r,1)):r++}e.textContent=t}},{Mac:R}=p.os(),I=function(e,t){let r="",n="";return t.forEach((e=>{const t=e.element.clone();e.offset&&(t.textContent=t.textContent.substring(e.offset[0],e.offset[1])),t.__render(),r+=t.elm.outerHTML,n+=t.elm.innerText})),e.setData("text/plain",n),e.setData("text/html",r),{html:r,text:n}},L=async function(e,t,r){if(e)if(this.allowPasteHtml){const t=this.parseHtml(e).filter((e=>!e.isEmpty()));if("function"==typeof this.customHtmlPaste)await this.customHtmlPaste.apply(this,[t,e]);else{for(let e=0;e<t.length;e++)0==e?this.insertElement(t[e]):this.insertElement(t[e],!1);this.emit("pasteHtml",t,e)}}else t&&("function"==typeof this.customTextPaste?await this.customTextPaste.apply(this,[t]):(this.insertText(t),this.emit("pasteText",t)));else if(t)"function"==typeof this.customTextPaste?await this.customTextPaste.apply(this,[t]):(this.insertText(t),this.emit("pasteText",t));else{let e=r.length;for(let t=0;t<e;t++)if(r[t].type.startsWith("image/"))if("function"==typeof this.customImagePaste)await this.customImagePaste.apply(this,[r[t]]);else{const e=await m.dataFileToBase64(r[t]),n=new y("closed","img",{src:e},null,null);this.insertElement(n),this.emit("pasteImage",e)}else if(r[t].type.startsWith("video/"))if("function"==typeof this.customVideoPaste)await this.customVideoPaste.apply(this,[r[t]]);else{const e=await m.dataFileToBase64(r[t]),n=new y("closed","video",{src:e},null,null);this.insertElement(n),this.emit("pasteVideo",e)}else"function"==typeof this.customFilePaste&&await this.customFilePaste.apply(this,[r[t]])}},D=function(){if(0==y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.VOID_NODES.includes(e.parsedom))).length){const e=new y("block",y.BLOCK_NODE,null,null,null),t=new y("closed","br",null,null,null);this.addElementTo(t,e),this.stack=[e]}},F=function(e){const t=this.getPreviousElementOfPoint(e),r=this.getNextElementOfPoint(e),n=e.element.getBlock(),a=e.element.getInblock();t&&!y.VOID_NODES.includes(t.parsedom)&&a&&a.isContains(t)?e.moveToEnd(t):r&&!y.VOID_NODES.includes(r.parsedom)&&a&&a.isContains(r)?e.moveToStart(r):t&&!y.VOID_NODES.includes(t.parsedom)&&n.isContains(t)?e.moveToEnd(t):r&&!y.VOID_NODES.includes(r.parsedom)&&n.isContains(r)?e.moveToStart(r):t&&!y.VOID_NODES.includes(t.parsedom)?e.moveToEnd(t):r&&!y.VOID_NODES.includes(r.parsedom)&&e.moveToStart(r)},P=function(e){e.isInblock()&&"default"==e.behavior&&e.hasChildren()&&e.children.forEach((e=>{if(e.isInblock())P.apply(this,[e]);else if(e.toEmpty(),e.parent.isEmpty()){const t=new y("closed","br",null,null,null);this.addElementTo(t,e.parent)}}))},q=function(){const e=async e=>{const t=i.getScrollHeight(e),r=i.getScrollWidth(e);if(e.clientHeight<t||e.clientWidth<r){const n=window.getSelection();if(0==n.rangeCount)return;const a=n.getRangeAt(0),o=a.getClientRects();let l=a;0==o.length&&(l=this.range.focus.element.elm);const s=l.getBoundingClientRect(),c=e.getBoundingClientRect();if(e.clientHeight<t)if(s.top<c.top){await i.setScrollTop({el:e,number:0});const t=l.getBoundingClientRect(),r=e.getBoundingClientRect();i.setScrollTop({el:e,number:t.top-r.top})}else if(s.bottom>c.bottom){await i.setScrollTop({el:e,number:0});const t=l.getBoundingClientRect(),r=e.getBoundingClientRect();i.setScrollTop({el:e,number:t.bottom-r.bottom})}if(e.clientWidth<r)if(s.left<c.left){await i.setScrollLeft({el:e,number:0});const t=l.getBoundingClientRect(),r=e.getBoundingClientRect();i.setScrollLeft({el:e,number:t.left-r.left+20})}else if(s.right>c.right){await i.setScrollLeft({el:e,number:0});const t=l.getBoundingClientRect(),r=e.getBoundingClientRect();i.setScrollLeft({el:e,number:t.right-r.right+20})}}};if(this.range&&this.range.focus.element.elm){let t=this.range.focus.element.elm;for(;i.isElement(t)&&t!=document.documentElement;)e(t),t=t.parentNode}},H=function(){if(0==y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.VOID_NODES.includes(e.parsedom))).length){const e=new y("block",y.BLOCK_NODE,null,null,null),t=new y("closed","br",null,null,null);this.addElementTo(t,e),this.stack=[e],this.range&&(this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t))}},$=function(){if(this.__isInputChinese)return;if(this.__innerSelectionChange)return;const e=window.getSelection();if(e&&e.rangeCount){const t=e.getRangeAt(0);if(v(this.$el,t.startContainer)&&v(this.$el,t.endContainer)){let e=null,r=null,n=null,a=null;if(3==t.startContainer.nodeType)e=t.startContainer.parentNode,n=t.startOffset;else if(1==t.startContainer.nodeType){const r=Array.from(t.startContainer.childNodes);r.length?(e=r[t.startOffset]?r[t.startOffset]:r[t.startOffset-1],n=r[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)r=t.endContainer.parentNode,a=t.endOffset;else if(1==t.endContainer.nodeType){const e=Array.from(t.endContainer.childNodes);e.length?(r=e[t.endOffset]?e[t.endOffset]:e[t.endOffset-1],a=e[t.endOffset]?0:1,3==r.nodeType&&(a=0==a?0:r.textContent.length,r=r.parentNode)):(r=t.endContainer,a=1)}const o=s.get(e,"data-alex-editor-key"),i=s.get(r,"data-alex-editor-key"),l=this.getElementByKey(o),c=this.getElementByKey(i),d=new x(l,n),u=new x(c,a);this.range?(this.range.anchor=d,this.range.focus=u):this.range=new w(d,u),this.history.updateCurrentRange(this.range),this.emit("rangeUpdate",this.range)}}},V=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)))},j=function(e){if(!this.disabled&&!this.__isInputChinese)if("keydown"==e.type){if(function(e){return R?"z"==e.key&&e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:"z"==e.key&&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 R?"z"==e.key&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey:"z"==e.key&&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())}this.emit("keydown",this.value,e)}else"keyup"==e.type&&this.emit("keyup",this.value,e)},W=async function(e){if(e.preventDefault(),!this.range)return;if(!this.allowCopy)return;const t=e,r=this.getElementsByRange().list;if(t.clipboardData&&r.length){const{text:e,html:n}=I.apply(this,[t.clipboardData,r]);this.emit("copy",e,n)}},K=async function(e){if(e.preventDefault(),!this.range)return;if(!this.allowCut)return;const t=e,r=this.getElementsByRange().list;if(t.clipboardData&&r.length){const{text:e,html:n}=I.apply(this,[t.clipboardData,r]);this.disabled||(this.delete(),this.formatElementStack(),this.domRender(),this.rangeRender()),this.emit("cut",e,n)}},G=async function(e){if(e.preventDefault(),this.disabled)return;if(!this.range)return;if(!this.allowPaste)return;const t=e;if(t.clipboardData){const e=t.clipboardData.getData("text/html"),r=t.clipboardData.getData("text/plain"),n=t.clipboardData.files;await L.apply(this,[e,r,n]),this.formatElementStack(),this.domRender(),this.rangeRender()}},Z=async function(e){if(e.preventDefault(),"drop"==e.type){if(this.disabled)return;if(!this.range)return;if(!this.allowPaste)return;const t=e;if(t.dataTransfer){const e=t.dataTransfer.getData("text/html"),r=t.dataTransfer.getData("text/plain"),n=t.dataTransfer.files;await L.apply(this,[e,r,n]),this.formatElementStack(),this.domRender(),this.rangeRender()}}},X=function(e){this.disabled||this.emit("focus",this.value,e)},Y=function(e){this.disabled||this.emit("blur",this.value,e)};class Q{constructor(e,t){n(this,"$el"),n(this,"disabled"),n(this,"value"),n(this,"renderRules"),n(this,"allowCopy"),n(this,"allowPaste"),n(this,"allowCut"),n(this,"allowPasteHtml"),n(this,"customTextPaste"),n(this,"customHtmlPaste"),n(this,"customImagePaste"),n(this,"customVideoPaste"),n(this,"customFilePaste"),n(this,"customMerge"),n(this,"customParseNode"),n(this,"extraKeepTags"),n(this,"history",new E),n(this,"stack"),n(this,"range",null),n(this,"__guid",function(){let e=s.get(window,"data-alex-editor-guid")||0;return e++,s.set(window,"data-alex-editor-guid",e),e}()),n(this,"__events",{}),n(this,"__firstRender",!0),n(this,"__isInputChinese",!1),n(this,"__innerSelectionChange",!1),n(this,"__chineseInputTimer",null),this.$el=function(e){if("string"==typeof e&&e&&(e=document.body.querySelector(e)),!i.isElement(e))throw new Error("You must specify a dom container to initialize the editor");if(s.get(e,"data-alex-editor-init"))throw new Error("The element node has been initialized to the editor");return s.set(e,"data-alex-editor-init",!0),e}(e);const r=function(e){let t={disabled:!1,renderRules:[],value:"",allowCopy:!0,allowPaste:!0,allowCut:!0,allowPasteHtml:!1,customTextPaste:null,customHtmlPaste:null,customImagePaste:null,customVideoPaste:null,customFilePaste:null,customMerge:null,customParseNode:null,extraKeepTags:[]};return c.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.customFilePaste&&(t.customFilePaste=e.customFilePaste),"function"==typeof e.customMerge&&(t.customMerge=e.customMerge),"function"==typeof e.customParseNode&&(t.customParseNode=e.customParseNode),Array.isArray(e.extraKeepTags)&&(t.extraKeepTags=e.extraKeepTags)),t}(t);this.disabled=r.disabled,this.value=r.value,this.renderRules=r.renderRules,this.allowCopy=r.allowCopy,this.allowPaste=r.allowPaste,this.allowCut=r.allowCut,this.allowPasteHtml=r.allowPasteHtml,this.customTextPaste=r.customTextPaste,this.customHtmlPaste=r.customHtmlPaste,this.customImagePaste=r.customImagePaste,this.customVideoPaste=r.customVideoPaste,this.customFilePaste=r.customFilePaste,this.customMerge=r.customMerge,this.customParseNode=r.customParseNode,this.extraKeepTags=r.extraKeepTags,this.stack=this.parseHtml(this.value),D.apply(this),this.disabled?this.setDisabled():this.setEnabled(),h.on(document,`selectionchange.alex_editor_${this.__guid}`,$.bind(this)),h.on(this.$el,"beforeinput.alex_editor",V.bind(this)),h.on(this.$el,"compositionstart.alex_editor compositionupdate.alex_editor compositionend.alex_editor",U.bind(this)),h.on(this.$el,"keydown.alex_editor keyup.alex_editor",j.bind(this)),h.on(this.$el,"cut.alex_editor",K.bind(this)),h.on(this.$el,"paste.alex_editor",G.bind(this)),h.on(this.$el,"copy.alex_editor",W.bind(this)),h.on(this.$el,"dragstart.alex_editor drop.alex_editor",Z.bind(this)),h.on(this.$el,"focus.alex_editor",X.bind(this)),h.on(this.$el,"blur.alex_editor",Y.bind(this))}initRange(){const e=y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.VOID_NODES.includes(e.parsedom)))[0],t=new x(e,0),r=new x(e,0);this.range=new w(t,r)}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(),r=this.range.anchor.element.getInblock();if(r)if(0==this.range.anchor.offset)if(e){if(r.isContains(e))return this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),void this.delete();if("block"==r.behavior){const t=e.getBlock(),n=e.getInblock();n?"block"==n.behavior&&this.merge(r,n):this.merge(r,t)}}else this.emit("deleteInStart",r);else if(this.range.anchor.element.isSpaceText()){if(this.range.anchor.element.toEmpty(),!r.isEmpty())return this.range.anchor.offset=0,this.range.focus.offset=0,void this.delete();{const e=new y("closed","br",null,null,null);this.addElementTo(e,r),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=g(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(r.isEmpty()){const e=new y("closed","br",null,null,null);this.addElementTo(e,r),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const t=this.range.anchor.element.isBreak();if(this.range.anchor.element.toEmpty(),r.isEmpty())if(t&&"default"!=r.behavior){if(!e){const e=new y("closed","br",null,null,null);this.addElementTo(e,r),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const e=new y("closed","br",null,null,null);this.addElementTo(e,r),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 r=e.getInblock(),n=e.getBlock();r?"block"==r.behavior&&this.merge(t,r):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 y("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 r=g(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,r)return void this.delete();if(t.isEmpty()){const e=new y("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}else{const r=this.range.anchor.element.isBreak();if(this.range.anchor.element.toEmpty(),t.isEmpty()&&(!r||!e)){const e=new y("closed","br",null,null,null);this.addElementTo(e,t),this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e)}}}else{const e=this.getElementsByRange().list.filter((e=>!y.VOID_NODES.includes(e.element.parsedom))),t=this.range.anchor.element.getInblock(),r=this.range.focus.element.getInblock(),n=this.range.anchor.element.getBlock(),a=this.range.focus.element.getBlock();t&&r&&t.isEqual(r)?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 y("closed","br",null,null,null);this.addElementTo(e,t)}})):t&&r?(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)P.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 y("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==t.behavior&&"block"==r.behavior&&this.merge(r,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)P.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 y("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==t.behavior&&this.merge(a,t)):r?(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)P.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 y("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),"block"==r.behavior&&this.merge(r,n)):n.isEqual(a)?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 y("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)P.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 y("closed","br",null,null,null);this.addElementTo(t,e.element.parent)}})),this.merge(a,n))}this.range.anchor.element.isEmpty()&&F.apply(this,[this.range.anchor]),this.range.focus.element=this.range.anchor.element,this.range.focus.offset=this.range.anchor.offset,H.apply(this),this.emit("deleteComplete")}}insertText(e){if(!this.disabled&&this.range){if(!e||"string"!=typeof e)throw new Error("The argument must be a string");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 y("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),r=this.range.anchor.element.getBlock(),n=this.range.anchor.element.getInblock(),a=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=y.getSpaceElement();this.insertElement(e),this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),this.emit("insertParagraph",n,n)}else if("block"==n.behavior)if(0!=this.range.anchor.offset||e&&n.isContains(e))if(this.range.anchor.offset!=a||t&&n.isContains(t)){const e=n.clone();this.addElementAfter(e,n);const t=y.flatElements(n.children).findIndex((e=>this.range.anchor.element.isEqual(e)));this.range.focus.moveToEnd(n),this.delete();const r=y.flatElements(e.children);this.range.focus.element=r[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 y("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 y("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=y.getSpaceElement();this.insertElement(e),this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e),this.emit("insertParagraph",r,r)}else if(0!=this.range.anchor.offset||e&&r.isContains(e))if(this.range.anchor.offset!=a||t&&r.isContains(t)){const e=r.clone();this.addElementAfter(e,r);const t=y.flatElements(r.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=this.range.anchor.offset;this.range.focus.moveToEnd(r),this.delete();const a=y.flatElements(e.children);this.range.focus.element=a[t],this.range.focus.offset=n,this.range.anchor.moveToStart(e),this.delete(),this.emit("insertParagraph",e,r)}else{const e=r.clone(!1),t=new y("closed","br",null,null,null);this.addElementTo(t,e),this.addElementAfter(e,r),this.range.anchor.moveToStart(t),this.range.focus.moveToStart(t),this.emit("insertParagraph",e,r)}else{const e=r.clone(!1),t=new y("closed","br",null,null,null);this.addElementTo(t,e),this.addElementBefore(e,r),this.emit("insertParagraph",r,e)}}else this.delete(),this.insertParagraph()}insertElement(e,t=!0){if(!this.disabled&&this.range){if(!y.isElement(e))throw new Error("The argument must be an AlexElement instance");if(!e.isEmpty())if(this.range.anchor.isEqual(this.range.focus)){const r=this.getPreviousElementOfPoint(this.range.anchor),n=this.getNextElementOfPoint(this.range.anchor),a=this.range.anchor.element.getBlock(),o=this.range.anchor.element.getInblock(),i=this.range.anchor.element.isText()?this.range.anchor.element.textContent.length:1;if(e.isInblock()&&"block"==e.behavior&&o&&"block"==o.behavior)if(o.isOnlyHasBreak()&&t)this.addElementBefore(e,o),o.toEmpty();else if(0!=this.range.anchor.offset||r&&o.isContains(r))if(this.range.anchor.offset!=i||n&&o.isContains(n)){const t=o.clone();this.addElementAfter(t,o),this.range.focus.moveToEnd(o),this.delete();const r=y.flatElements(o.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=y.flatElements(t.children);this.range.focus.element=n[r],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(e.isInblock()&&o)if(o.isOnlyHasBreak())this.addElementTo(e,o,0);else if(0!=this.range.anchor.offset||r&&o.isContains(r))if(this.range.anchor.offset!=i||n&&o.isContains(n)){const t=o.clone();this.addElementAfter(t,o),this.range.focus.moveToEnd(o),this.delete();const r=y.flatElements(o.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=y.flatElements(t.children);this.range.focus.element=n[r],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.isInblock())if(a.isOnlyHasBreak())this.addElementTo(e,a,0);else if(0!=this.range.anchor.offset||r&&a.isContains(r))if(this.range.anchor.offset!=i||n&&a.isContains(n)){const t=a.clone();this.addElementAfter(t,a),this.range.focus.moveToEnd(a),this.delete();const r=y.flatElements(a.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=y.flatElements(t.children);this.range.focus.element=n[r],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementTo(e,t),this.merge(t,a)}else this.addElementTo(e,a,a.children.length);else this.addElementTo(e,a,0);else if(e.isBlock())if(a.isOnlyHasBreak()&&t)this.addElementBefore(e,a),a.toEmpty();else if(0!=this.range.anchor.offset||r&&a.isContains(r))if(this.range.anchor.offset!=i||n&&a.isContains(n)){const t=a.clone();this.addElementAfter(t,a),this.range.focus.moveToEnd(a),this.delete();const r=y.flatElements(a.children).findIndex((e=>this.range.anchor.element.isEqual(e))),n=y.flatElements(t.children);this.range.focus.element=n[r],this.range.focus.offset=this.range.anchor.offset,this.range.anchor.moveToStart(t),this.delete(),this.addElementBefore(e,t)}else this.addElementAfter(e,a);else this.addElementBefore(e,a);else if(this.range.anchor.element.isText()){let t=this.range.anchor.element.textContent,r=this.range.anchor.element.clone();this.range.anchor.element.textContent=t.substring(0,this.range.anchor.offset),r.textContent=t.substring(this.range.anchor.offset),this.addElementAfter(r,this.range.anchor.element),this.addElementBefore(e,r)}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)}}formatElementStack(){const e=(t,r,n)=>{"boolean"!=typeof n&&(n=!1);let a=0;for(;a<t.length;)t[a]?t[a].isEmpty()?(this.range&&t[a].isContains(this.range.anchor.element)&&F.apply(this,[this.range.anchor]),this.range&&t[a].isContains(this.range.focus.element)&&F.apply(this,[this.range.focus]),t.splice(a,1)):(r.apply(this,[t[a]]),t[a].isEmpty()?(this.range&&t[a].isContains(this.range.anchor.element)&&F.apply(this,[this.range.anchor]),this.range&&t[a].isContains(this.range.focus.element)&&F.apply(this,[this.range.focus]),t.splice(a,1)):(!t[a].isBlock()&&n&&t[a].convertToBlock(),t[a].hasChildren()&&e(t[a].children,r),t[a].isEmpty()?(this.range&&t[a].isContains(this.range.anchor.element)&&F.apply(this,[this.range.anchor]),this.range&&t[a].isContains(this.range.focus.element)&&F.apply(this,[this.range.focus]),t.splice(a,1)):a++)):t.splice(a,1)};let t=this.renderRules.filter((e=>"function"==typeof e));[_,C,N,M,O,A,O,z,...t].forEach((t=>{e(this.stack,t,!0)})),H.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 r=this.value;this.value=this.$el.innerHTML,(this.__firstRender||r!=this.value)&&(this.__firstRender||this.emit("change",this.value,r),e||this.history.push(this.stack,this.range)),this.__firstRender&&(this.__firstRender=!1),this.emit("afterRender")}rangeRender(){if(!this.disabled){if(this.range){const e=e=>{let t=null,r=null;if(e.element.isText())t=e.element.elm.childNodes[0],r=e.offset;else{t=e.element.parent.elm;const n=e.element.parent.children.findIndex((t=>e.element.isEqual(t)));r=e.offset+n}return{node:t,offset:r}};this.__innerSelectionChange=!0;const t=e(this.range.anchor),r=e(this.range.focus),n=window.getSelection();if(n){n.removeAllRanges();const e=document.createRange();e.setStart(t.node,t.offset),e.setEnd(r.node,r.offset),n.addRange(e)}}else{const e=window.getSelection();e&&e.removeAllRanges()}setTimeout((()=>{q.apply(this),this.__innerSelectionChange=!1,this.history.updateCurrentRange(this.range),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 r=[];return Array.from(t.childNodes).forEach((e=>{if(1==e.nodeType||3==e.nodeType){const t=this.parseNode(e);r.push(t)}})),r}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 y("text",null,null,null,e.textContent);const t=function(e){let t={};const r=e.attributes.length;for(let n=0;n<r;n++){const r=e.attributes[n];/(^on)|(^style$)|(^face$)/g.test(r.nodeName)||(t[r.nodeName]=r.nodeValue)}return t}(e),r=function(e){let t={};const r=e.getAttribute("style");if(r){let e=0,n=0,a=[];for(;e<r.length;)";"==r[e]&&"base64,"!=r.substring(e+1,e+8)&&(a.push(r.substring(n,e)),n=e+1),e==r.length-1&&n<e&&a.push(r.substring(n,e)),e++;a.forEach((e=>{const r=e.indexOf(":"),n=e.substring(0,r).trim(),a=e.substring(r+1).trim();t[n]=a}))}return t}(e),n=e.nodeName.toLocaleLowerCase(),a=e.namespaceURI;if(y.EMPTY_NODES.includes(n))return new y("text",null,null,null,null);if(n==y.TEXT_NODE&&e.childNodes.length&&Array.from(e.childNodes).every((e=>3==e.nodeType)))return new y("text",null,t,r,e.textContent);const o=k.find((e=>e.parsedom==n)),i=T.find((e=>e.parsedom==n)),l=B.find((e=>e.parsedom==n)),s=S.find((e=>e.parsedom==n));let d=null,u={type:"inline",parsedom:n,marks:t,styles:r,behavior:"default",namespace:a};if(o)u.type="block",o.parse&&(u.parsedom=y.BLOCK_NODE);else if(i)u.type="inblock",i.block&&(u.behavior="block");else if(l){if(u.type="inline",l.parse&&(u.parsedom=y.TEXT_NODE,c.isObject(l.parse)))for(let c in l.parse)"function"==typeof l.parse[c]?u.styles[c]=l.parse[c].apply(this,[e]):u.styles[c]=l.parse[c]}else s?u.type="closed":this.extraKeepTags.includes(u.parsedom)||(u.type="inline",u.parsedom=y.TEXT_NODE,u.namespace=null);return d=new y(u.type,u.parsedom,u.marks,u.styles,null),d.behavior=u.behavior,d.namespace=u.namespace,s||Array.from(e.childNodes).forEach((e=>{if(1==e.nodeType||3==e.nodeType){const t=this.parseNode(e);t.parent=d,d.hasChildren()?d.children.push(t):d.children=[t]}})),"function"==typeof this.customParseNode&&(d=this.customParseNode.apply(this,[d])),d}merge(e,t){if(!y.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!y.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=r=>{let n=null;const a=r.length;for(let o=0;o<a;o++){const a=r[o];if(a&&a.key===e){n=a;break}if(a&&a.hasChildren()){const e=t(a.children);if(e){n=e;break}}}return n};return t(this.stack)}getPreviousElement(e){if(!y.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(!y.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=e=>{let r=null;for(let n=e.length-1;n>=0;n--){const a=e[n];if(!a.isEmpty()){if(a.isText()||a.isClosed()){r=a;break}if(r=t(a.children),r)break}}return r},r=e=>{const n=this.getPreviousElement(e);return n?n.isEmpty()?r(n):n.isText()||n.isClosed()?n:t(n.children):e.parent?r(e.parent):null};return r(e.element)}getNextElementOfPoint(e){if(!x.isPoint(e))throw new Error("The argument must be an AlexPoint instance");const t=e=>{let r=null;const n=e.length;for(let a=0;a<n;a++){const n=e[a];if(!n.isEmpty()){if(n.isText()||n.isClosed()){r=n;break}if(r=t(n.children),r)break}}return r},r=e=>{const n=this.getNextElement(e);return n?n.isEmpty()?r(n):n.isText()||n.isClosed()?n:t(n.children):e.parent?r(e.parent):null};return r(e.element)}getElementsByRange(){if(!this.range)return{list:[],flatList:[]};if(this.range.anchor.isEqual(this.range.focus))return{list:[],flatList:[]};const e=(()=>{let e=[];const t=0==this.range.anchor.offset,r=this.range.focus.offset==(this.range.focus.element.isText()?this.range.focus.element.textContent.length:1),n=this.range.anchor.element.getBlock(),a=this.range.focus.element.getBlock(),o=this.stack.findIndex((e=>n.isEqual(e))),i=this.stack.findIndex((e=>a.isEqual(e)));let l=y.flatElements(this.stack.slice(o,i+1));const s=function(e){let t=e.element;for(;t.parent&&e.element.isFirst(t.parent);)t=t.parent;return t}(this.range.anchor),c=l.findIndex((e=>e.isEqual(s||this.range.anchor.element))),d=l.findIndex((e=>e.isEqual(this.range.focus.element)));if((c>0||d<l.length-1)&&(l=l.slice(c,d+1)),this.range.anchor.element.isEqual(this.range.focus.element))e=t&&r?l.map((e=>({element:e,offset:!1}))):[{element:this.range.anchor.element,offset:[this.range.anchor.offset,this.range.focus.offset]}];else{const n=l.length;for(let a=0;a<n;a++)if(this.range.anchor.element.isEqual(l[a]))t?e.push({element:this.range.anchor.element,offset:!1}):this.range.anchor.element.isText()&&this.range.anchor.offset<this.range.anchor.element.textContent.length&&e.push({element:this.range.anchor.element,offset:[this.range.anchor.offset,this.range.anchor.element.textContent.length]});else if(l[a].isContains(this.range.anchor.element)){const n=this.range.anchor.element.isFirst(l[a]),o=l[a].isContains(this.range.focus.element),i=this.range.focus.element.isLast(l[a]);(t&&n&&o&&i&&r||t&&n&&!o)&&e.push({element:l[a],offset:!1})}else if(this.range.focus.element.isEqual(l[a]))r?e.push({element:this.range.focus.element,offset:!1}):this.range.focus.offset>0&&e.push({element:this.range.focus.element,offset:[0,this.range.focus.offset]});else if(l[a].isContains(this.range.focus.element)){this.range.focus.element.isLast(l[a])&&r&&e.push({element:l[a],offset:!1})}else e.push({element:l[a],offset:!1})}return e})();return{list:(e=>{let t=[],r=[],n=[];const a=e.length;for(let o=0;o<a;o++)if(e[o].element.isBlock())t.push(e[o]),r.push(e[o].element);else{const a=e[o].element.getBlock();let i=!1;for(let e=r.length-1;e>=0;e--)if(r[e].isEqual(a)){i=!0;break}if(!i){n.some((t=>t.isContains(e[o].element)))||(t.push(e[o]),(e[o].element.isInblock()||e[o].element.isInline())&&n.push(e[o].element))}}return t})(e),flatList:e}}addElementTo(e,t,r=0){if(!y.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!y.isElement(t))throw new Error("The second argument must be an AlexElement instance");if("number"!=typeof r||isNaN(r)||r<0)throw new Error("The third argument must be an integer not less than 0");t.hasChildren()?r>=t.children.length?t.children.push(e):t.children.splice(r,0,e):t.children=[e],e.parent=t}addElementBefore(e,t){if(!y.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!y.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(t.isBlock()){const r=this.stack.findIndex((e=>t.isEqual(e)));this.stack.splice(r,0,e),e.parent=null}else{const r=t.parent.children.findIndex((e=>t.isEqual(e)));this.addElementTo(e,t.parent,r)}}addElementAfter(e,t){if(!y.isElement(e))throw new Error("The first argument must be an AlexElement instance");if(!y.isElement(t))throw new Error("The second argument must be an AlexElement instance");if(t.isBlock()){const r=this.stack.findIndex((e=>t.isEqual(e)));r>=this.stack.length-1?this.stack.push(e):this.stack.splice(r+1,0,e),e.parent=null}else{const r=t.parent.children.findIndex((e=>t.isEqual(e)));this.addElementTo(e,t.parent,r+1)}}collapseToStart(e){if(this.disabled)return;let t=!1;if(this.range||(this.initRange(),t=!0),y.isElement(e))this.range.anchor.moveToStart(e),this.range.focus.moveToStart(e);else{const e=y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.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),y.isElement(e))this.range.anchor.moveToEnd(e),this.range.focus.moveToEnd(e);else{const e=y.flatElements(this.stack).filter((e=>!e.isEmpty()&&!y.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","true")}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(),h.off(document,`selectionchange.alex_editor_${this.__guid}`),h.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")}}console.log("%c alex-editor %c v1.4.6 ","padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;","padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;");const J={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 r=0,n=0,a=0;try{r=e.toString().split(".")[1].length}catch(o){}try{n=t.toString().split(".")[1].length}catch(o){}return a=Math.pow(10,Math.max(r,n)),(e*a+t*a)/a})),subtract:(...e)=>e.reduce(((e,t)=>{let r=0,n=0,a=0;try{r=e.toString().split(".")[1].length}catch(o){}try{n=t.toString().split(".")[1].length}catch(o){}return a=Math.pow(10,Math.max(r,n)),(e*a-t*a)/a})),mutiply:(...e)=>e.reduce(((e,t)=>{let r=0,n=e.toString(),a=t.toString();try{r+=n.split(".")[1].length}catch(o){}try{r+=a.split(".")[1].length}catch(o){}return Number(n.replace(".",""))*Number(a.replace(".",""))/Math.pow(10,r)})),divide:(...e)=>e.reduce(((e,t)=>{let r=0,n=0,a=e.toString(),o=t.toString();try{r=a.split(".")[1].length}catch(i){}try{n=o.split(".")[1].length}catch(i){}return Number(a.replace(".",""))/Number(o.replace(".",""))*Math.pow(10,n-r)}))},ee={insert(e,t,r){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(!J.isNumber(r))throw new TypeError("The third argument must be a number");if(r<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,r)+t+e.substring(r,e.length)},delete(e,t,r){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!J.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(!J.isNumber(r))throw new TypeError("The third argument must be a number");if(r<0)throw new Error("The third argument cannot be less than 0");return e.substring(0,t)+e.substring(t+r,e.length)},replace(e,t,r,n){if(!e||"string"!=typeof e)throw new TypeError("The first argument must be a string");if(!J.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(!J.isNumber(r))throw new TypeError("The third argument must be a number");if(r<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(r,e.length)},trim(e,t){if("string"!=typeof e)throw new TypeError("The first argument must be a string");let r=e.replace(/(^\s+)|(\s+$)/g,"");return t&&(r=r.replace(/\s/g,"")),r}},te={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 r=e,n=0,a=0;for(;this.isElement(e)&&this.isContains(t,e)&&t!==e;)n+=e.offsetTop,a+=e.offsetLeft,e=e.offsetParent;return{top:n,left:a,right:t.offsetWidth-a-r.offsetWidth,bottom:t.offsetHeight-n-r.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)))},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(!J.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return J.mutiply(e,parseFloat(t))},px2rem(e){if(!J.isNumber(e))throw new TypeError("The argument must be a number");let t=this.getCssStyle(document.documentElement,"font-size");return J.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,r=parseFloat(this.getCssStyle(e,"padding-left")),n=parseFloat(this.getCssStyle(e,"padding-right"));return J.subtract(t,r,n)},height(e){"string"==typeof e&&e&&(e=document.body.querySelector(e)),this.isElement(e)||(e=document.body);let t=e.clientHeight,r=parseFloat(this.getCssStyle(e,"padding-top")),n=parseFloat(this.getCssStyle(e,"padding-bottom"));return J.subtract(t,r,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 r=e.classList;ee.trim(t).split(/\s+/).forEach((e=>{r.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 r=e.classList;ee.trim(t).split(/\s+/).forEach((e=>{r.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 r=e.classList;return ee.trim(t).split(/\s+/).every((e=>r.contains(e)))},scrollTopBottomTrigger(e,t){"string"==typeof e&&e&&(e=document.body.querySelector(e));let r=window;this.isElement(e)&&e!=document.body&&e!=document.documentElement&&(r=e),"function"==typeof e&&(t=e);let n=!0;r.addEventListener("scroll",(()=>{if(this.getScrollTop(r)<=0){if(!n)return;"function"==typeof t&&(n=!1,t({state:"top",target:r}))}else{let e={state:"bottom",target:r},a=0;if(a=r==window?window.innerHeight:r.clientHeight,J.add(this.getScrollTop(r),a)+1>=this.getScrollHeight(r)&&a!=this.getScrollHeight(r)){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,r=e.el;"string"==typeof r&&r&&(r=document.body.querySelector(r));let n=e.number||0,a=e.time||0;return this.isElement(r)&&r!=document.body&&r!=document.documentElement&&r!=window||(t=!0),new Promise((e=>{if(a<=0)t?document.documentElement.scrollTop=document.body.scrollTop=n:r.scrollTop=n,e();else{let o=10,i=J.divide(a,o),l=this.getScrollTop(r),s=J.divide(J.subtract(n,l),i),c=setInterval((()=>{i>0?(i--,t?document.documentElement.scrollTop=document.body.scrollTop=l=J.add(l,s):r.scrollTop=l=J.add(l,s)):(clearInterval(c),e())}),o)}}))},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,r=e.el;"string"==typeof r&&r&&(r=document.body.querySelector(r));let n=e.number||0,a=e.time||0;return this.isElement(r)&&r!=document.body&&r!=document.documentElement&&r!=window||(t=!0),new Promise((e=>{if(a<=0)t?document.documentElement.scrollLeft=document.body.scrollLeft=n:r.scrollLeft=n,e();else{let o=10,i=J.divide(a,o),l=this.getScrollLeft(r),s=J.divide(J.subtract(n,l),i),c=setInterval((()=>{i>0?(i--,t?document.documentElement.scrollLeft=document.body.scrollLeft=l=J.add(l,s):r.scrollLeft=l=J.add(l,s)):(clearInterval(c),e())}),o)}}))},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 r="";return r=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(e)[t]:e.currentStyle[t],r},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",r="",n=ee.trim(e,!0).substring(1,ee.trim(e,!0).length-1).split("=");return 1==n.length&&(r=n[0]),2==n.length&&(r={attributeName:n[0],attributeValue:n[1].replace(/\'/g,"").replace(/\"/g,"")}),{type:t,value:r}}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:J.subtract(document.documentElement.clientHeight||window.innerHeight,t.bottom),left:t.left,right:J.subtract(document.documentElement.clientWidth||window.innerWidth,t.right)}},isElement:e=>e&&e instanceof Node&&1===e.nodeType,string2dom(e,t){if(!e||"string"!=typeof e)throw new TypeError("The argument must be an HTML string");let r=document.createElement(t||"div");return r.innerHTML=e,1==r.children.length?r.children[0]:Array.from(r.children)}},re="_dap-datas",ne={remove(e,t){if(!(e instanceof Document||te.isElement(e)||te.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let r=e[re]||{};null==t||""===t?e[re]={}:(delete r[t],e[re]=r)},has(e,t){if(!(e instanceof Document||te.isElement(e)||te.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[re]||{}).hasOwnProperty(t)},get(e,t){if(!(e instanceof Document||te.isElement(e)||te.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let r=e[re]||{};return null==t||""===t?r:r[t]},set(e,t,r){if(!(e instanceof Document||te.isElement(e)||te.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[re]||{};n[t]=r,e[re]=n}},ae={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 r=null;if("Chinese"==t&&(r=/^[\u4e00-\u9fa5]+$/),"chinese"==t&&(r=/[\u4e00-\u9fa5]/),"email"==t&&(r=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/),"username"==t&&(r=/^[a-zA-Z0-9_]{4,16}$/),"int+"==t&&(r=/^\d+$/),"int-"==t&&(r=/^-\d+$/),"int"==t&&(r=/^-?\d+$/),"pos"==t&&(r=/^\d*\.?\d+$/),"neg"==t&&(r=/^-\d*\.?\d+$/),"number"==t&&(r=/^-?\d*\.?\d+$/),"phone"==t&&(r=/^1[0-9]\d{9}$/),"idCard"==t&&(r=/^[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&&(r=/^(https?|ftp):\/\/(-\.)?([^\s\/?\.#-]+\.?)+(\/[^\s]*)?$/),"IPv4"==t&&(r=/^(?:(?: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&&(r=/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/),"rgb"==t&&(r=/^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&&(r=/^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&&(r=/^[1-9][0-9]{4,10}$/),"weixin"==t&&(r=/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/),"plate"==t&&(r=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/),!r)throw new Error("The second parameter is out of scope");return r.test(e)},getUrlParams(e){if(!e||"string"!=typeof e)throw new TypeError("The argument must be a string");let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),r=window.location.search.substr(1);if(!r){let e=window.location.hash.split("?");2==e.length&&(r=e[1])}let n=r.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 r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);if(r.length!=n.length)return!1;let a=r.length,o=!0;for(let i=0;i<a;i++){let n=r[i],a=e[n],l=t[n];if(!this.equal(a,l)){o=!1;break}}return o}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 r in e)t[r]=this.clone(e[r]);return t}return e}},oe=e=>{let t=e.split(/[\s]+/g),r=[];return t.forEach((e=>{let t=e.split("."),n={eventName:t[0]};t.length>1&&(n.guid=t[1]),r.push(n)})),r},ie=(e,t,r)=>{let n=ne.get(e,"dap-defined-events")||{},a=Object.keys(n),o=a.length;for(let i=0;i<o;i++){let o=a[i];n[o].type==t&&(r?o==t+"."+r&&(e.removeEventListener(n[o].type,n[o].fn,n[o].options),n[o]=void 0):(e.removeEventListener(n[o].type,n[o].fn,n[o].options),n[o]=void 0))}n=(e=>{let t={};return Object.keys(e).forEach((r=>{e[r]&&(t[r]=e[r])})),t})(n),ne.set(e,"dap-defined-events",n)},le={on(e,t,r,n){if(!(e instanceof Document||te.isElement(e)||te.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(!r||"function"!=typeof r)throw new TypeError("The third argument must be a function");ae.isObject(n)||(n={});oe(t).forEach((t=>{((e,t,r,n,a)=>{let o=ne.get(e,"dap-defined-events")||{};r||(r=ne.get(e,"dap-event-guid")||0,ne.set(e,"dap-event-guid",r+1)),o[r=t+"."+r]&&o[r].type==t&&e.removeEventListener(t,o[r].fn,o[r].options),e.addEventListener(t,n,a),o[r]={type:t,fn:n,options:a},ne.set(e,"dap-defined-events",o)})(e,t.eventName,t.guid,r.bind(e),n)}))},off(e,t){if(!(e instanceof Document||te.isElement(e)||te.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let r=ne.get(e,"dap-defined-events");if(!r)return;if(!t){let t=Object.keys(r),n=t.length;for(let a=0;a<n;a++){let n=t[a];e.removeEventListener(r[n].type,r[n].fn,r[n].options)}return ne.remove(e,"dap-defined-events"),void ne.remove(e,"dap-event-guid")}oe(t).forEach((t=>{ie(e,t.eventName,t.guid)}))},get(e){if(!(e instanceof Document||te.isElement(e)||te.isWindow(e)))throw new TypeError("The first argument must be an element node or window or document");let t=ne.get(e,"dap-defined-events");if(t)return t}},se={rgb2hsv(e){if(!Array.isArray(e)||3!=e.length)throw new TypeError("Invalid argument");let t=0,r=0,n=0,a=e[0]>=255?255:e[0],o=e[1]>=255?255:e[1],i=e[2]>=255?255:e[2];a=a<=0?0:a,o=o<=0?0:o,i=i<=0?0:i;let l=Math.max(a,o,i),s=Math.min(a,o,i);return n=l/255,r=0===l?0:1-s/l,l===s?t=0:l===a&&o>=i?t=(o-i)/(l-s)*60+0:l===a&&o<i?t=(o-i)/(l-s)*60+360:l===o?t=(i-a)/(l-s)*60+120:l===i&&(t=(a-o)/(l-s)*60+240),[t,100*r,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],r=e[1]>=100?100:e[1];r=r<=0?0:r;let n=e[2]>=100?100:e[2];n=n<=0?0:n,r/=100,n/=100;let a=0,o=0,i=0,l=parseInt(t/60%6+""),s=t/60-l,c=n*(1-r),d=n*(1-s*r),u=n*(1-(1-s)*r);switch(l){case 0:a=n,o=u,i=c;break;case 1:a=d,o=n,i=c;break;case 2:a=c,o=n,i=u;break;case 3:a=c,o=d,i=n;break;case 4:a=u,o=c,i=n;break;case 5:a=n,o=c,i=d}return a=parseInt(255*a+""),o=parseInt(255*o+""),i=parseInt(255*i+""),[a,o,i]},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(!ae.matchingText(t,"hex"))throw new TypeError("The argument must be a hexadecimal color value");if(4===t.length){let e="#";for(let r=1;r<4;r+=1)e+=t.slice(r,r+1).concat(t.slice(r,r+1));t=e}let r=[];for(let n=1;n<7;n+=2)r.push(parseInt("0x"+t.slice(n,n+2)));return r}},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,r)=>{e&&e instanceof File||r(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 r=e.split(","),n=r[0].match(/:(.*?);/)[1],a=atob(r[1]),o=a.length,i=new Uint8Array(o);for(;o--;)i[o]=a.charCodeAt(o);return new File([i],t,{type:n})},compressImage(e,t){const r={width:void 0,quality:.8,mimeType:"jpeg",maxSize:0,minSize:0};ae.isObject(t)&&(J.isNumber(t.width)&&(r.width=t.width),J.isNumber(t.quality)&&t.quality>=0&&t.quality<=1&&(r.quality=t.quality),"jpeg"!=t.mimeType&&"webp"!=t.mimeType||(r.mimeType=t.mimeType),J.isNumber(t.maxSize)&&(r.maxSize=t.maxSize),J.isNumber(t.minSize)&&(r.minSize=t.minSize));const n=(e,t,a)=>{let o=e.toDataURL("image/"+r.mimeType,a),i=this.dataBase64toFile(o,t);if(r.maxSize>0&&i.size>1024*r.maxSize){a=a<=0?0:Number((a-.01).toFixed(2));const r=n(e,t,a);o=r.url,i=r.file,a=r.quality}return{file:i,url:o,quality:a}};return new Promise(((t,a)=>{let o=new FileReader;o.readAsDataURL(e),o.onload=()=>{let i=o.result,l=new Image;l.src=i,l.onload=()=>{if(r.minSize>0&&e.size<=1024*r.minSize)return void t({file:e,url:i,quality:1,width:l.width,height:l.height});let a=document.createElement("canvas"),o=a.getContext("2d");a.width=r.width||l.width,a.height=r.width?r.width/(l.width/l.height):l.height,o.drawImage(l,0,0,a.width,a.height);let s=e.name.lastIndexOf(".");const c=e.name.substring(0,s)+"."+r.mimeType;let d=n(a,c,r.quality);t({...d,width:a.width,height:a.height})},l.onerror=()=>{a(new Error("Failed to load image file"))}},o.onerror=()=>{a(new Error("Failed to load image file"))}}))}};function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ue(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 r=e[t],n=typeof r;"object"!==n&&"function"!==n||Object.isFrozen(r)||ue(r)})),e}class he{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function me(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function pe(e,...t){const r=Object.create(null);for(const n in e)r[n]=e[n];return t.forEach((function(e){for(const t in e)r[t]=e[t]})),r}const ge=e=>!!e.scope;class fe{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=me(e)}openNode(e){if(!ge(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const r=e.split(".");return[`${t}${r.shift()}`,...r.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){ge(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const ve=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class be{constructor(){this.rootNode=ve(),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=ve({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=>{be._collapse(e)})))}}class ye extends be{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const r=e.root;t&&(r.scope=`language:${t}`),this.add(r)}toHTML(){return new fe(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function we(e){return e?"string"==typeof e?e:e.source:null}function xe(e){return Se("(?=",e,")")}function Ee(e){return Se("(?:",e,")*")}function ke(e){return Se("(?:",e,")?")}function Se(...e){return e.map((e=>we(e))).join("")}function Te(...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=>we(e))).join("|")+")"}function Be(e){return new RegExp(e.toString()+"|").exec("").length-1}const _e=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ce(e,{joinWith:t}){let r=0;return e.map((e=>{r+=1;const t=r;let n=we(e),a="";for(;n.length>0;){const e=_e.exec(n);if(!e){a+=n;break}a+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+String(Number(e[1])+t):(a+=e[0],"("===e[0]&&r++)}return a})).map((e=>`(${e})`)).join(t)}const Ne="[a-zA-Z]\\w*",Me="[a-zA-Z_]\\w*",Ae="\\b\\d+(\\.\\d+)?",Oe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ze="\\b(0b[01]+)",Re={begin:"\\\\[\\s\\S]",relevance:0},Ie={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Re]},Le={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Re]},De=function(e,t,r={}){const n=pe({scope:"comment",begin:e,end:t,contains:[]},r);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 a=Te("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:Se(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},Fe=De("//","$"),Pe=De("/\\*","\\*/"),qe=De("#","$"),He={scope:"number",begin:Ae,relevance:0},$e={scope:"number",begin:Oe,relevance:0},Ve={scope:"number",begin:ze,relevance:0},Ue={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Re,{begin:/\[/,end:/\]/,relevance:0,contains:[Re]}]},je={scope:"title",begin:Ne,relevance:0},We={scope:"title",begin:Me,relevance:0},Ke={begin:"\\.\\s*"+Me,relevance:0};var Ge=Object.freeze({__proto__:null,APOS_STRING_MODE:Ie,BACKSLASH_ESCAPE:Re,BINARY_NUMBER_MODE:Ve,BINARY_NUMBER_RE:ze,COMMENT:De,C_BLOCK_COMMENT_MODE:Pe,C_LINE_COMMENT_MODE:Fe,C_NUMBER_MODE:$e,C_NUMBER_RE:Oe,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:qe,IDENT_RE:Ne,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Ke,NUMBER_MODE:He,NUMBER_RE:Ae,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:Le,REGEXP_MODE:Ue,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Se(t,/.*\b/,e.binary,/\b.*/)),pe({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:je,UNDERSCORE_IDENT_RE:Me,UNDERSCORE_TITLE_MODE:We});function Ze(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Xe(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function Ye(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ze,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Qe(e,t){Array.isArray(e.illegal)&&(e.illegal=Te(...e.illegal))}function Je(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 et(e,t){void 0===e.relevance&&(e.relevance=1)}const tt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const r=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=r.keywords,e.begin=Se(r.beforeMatch,xe(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},rt=["of","and","for","in","not","or","if","then","parent","list","value"],nt="keyword";function at(e,t,r=nt){const n=Object.create(null);return"string"==typeof e?a(r,e.split(" ")):Array.isArray(e)?a(r,e):Object.keys(e).forEach((function(r){Object.assign(n,at(e[r],t,r))})),n;function a(e,r){t&&(r=r.map((e=>e.toLowerCase()))),r.forEach((function(t){const r=t.split("|");n[r[0]]=[e,ot(r[0],r[1])]}))}}function ot(e,t){return t?Number(t):function(e){return rt.includes(e.toLowerCase())}(e)?0:1}const it={},lt=e=>{console.error(e)},st=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ct=(e,t)=>{it[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),it[`${e}/${t}`]=!0)},dt=new Error;function ut(e,t,{key:r}){let n=0;const a=e[r],o={},i={};for(let l=1;l<=t.length;l++)i[l+n]=a[l],o[l+n]=!0,n+=Be(t[l-1]);e[r]=i,e[r]._emit=o,e[r]._multi=!0}function ht(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 lt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),dt;if("object"!=typeof e.beginScope||null===e.beginScope)throw lt("beginScope must be object"),dt;ut(e,e.begin,{key:"beginScope"}),e.begin=Ce(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw lt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),dt;if("object"!=typeof e.endScope||null===e.endScope)throw lt("endScope must be object"),dt;ut(e,e.end,{key:"endScope"}),e.end=Ce(e.end,{joinWith:""})}}(e)}function mt(e){function t(t,r){return new RegExp(we(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(r?"g":""))}class r{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+=Be(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(Ce(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const r=t.findIndex(((e,t)=>t>0&&void 0!==e)),n=this.matchIndexes[r];return t.splice(0,r),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 r;return this.rules.slice(e).forEach((([e,r])=>t.addRule(e,r))),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 r=t.exec(e);if(this.resumingScanAtSamePosition())if(r&&r.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,r=t.exec(e)}return r&&(this.regexIndex+=r.position+1,this.regexIndex===this.count&&this.considerAll()),r}}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=pe(e.classNameAliases||{}),function r(a,o){const i=a;if(a.isCompiled)return i;[Xe,Je,ht,tt].forEach((e=>e(a,o))),e.compilerExtensions.forEach((e=>e(a,o))),a.__beforeBegin=null,[Ye,Qe,et].forEach((e=>e(a,o))),a.isCompiled=!0;let l=null;return"object"==typeof a.keywords&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),l=a.keywords.$pattern,delete a.keywords.$pattern),l=l||/\w+/,a.keywords&&(a.keywords=at(a.keywords,e.case_insensitive)),i.keywordPatternRe=t(l,!0),o&&(a.begin||(a.begin=/\B|\b/),i.beginRe=t(i.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(i.endRe=t(i.end)),i.terminatorEnd=we(i.end)||"",a.endsWithParent&&o.terminatorEnd&&(i.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(i.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return pe(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(pt(e))return pe(e,{starts:e.starts?pe(e.starts):null});if(Object.isFrozen(e))return pe(e);return e}("self"===e?a:e)}))),a.contains.forEach((function(e){r(e,i)})),a.starts&&r(a.starts,o),i.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}(i),i}(e)}function pt(e){return!!e&&(e.endsWithParent||pt(e.starts))}class gt extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const ft=me,vt=pe,bt=Symbol("nomatch"),yt=function(e){const t=Object.create(null),r=Object.create(null),n=[];let a=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ye};function s(e){return l.noHighlightRe.test(e)}function c(e,t,r){let n="",a="";"object"==typeof t?(n=e,r=t.ignoreIllegals,a=t.language):(ct("10.7.0","highlight(lang, code, ...args) has been deprecated."),ct("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),a=e,n=t),void 0===r&&(r=!0);const o={code:n,language:a};b("before:highlight",o);const i=o.result?o.result:d(o.language,o.code,r);return i.code=o.code,b("after:highlight",i),i}function d(e,r,n,i){const s=Object.create(null);function c(){if(!T.keywords)return void _.addText(C);let e=0;T.keywordPatternRe.lastIndex=0;let t=T.keywordPatternRe.exec(C),r="";for(;t;){r+=C.substring(e,t.index);const a=E.case_insensitive?t[0].toLowerCase():t[0],o=(n=a,T.keywords[n]);if(o){const[e,n]=o;if(_.addText(r),r="",s[a]=(s[a]||0)+1,s[a]<=7&&(N+=n),e.startsWith("_"))r+=t[0];else{const r=E.classNameAliases[e]||e;m(t[0],r)}}else r+=t[0];e=T.keywordPatternRe.lastIndex,t=T.keywordPatternRe.exec(C)}var n;r+=C.substring(e),_.addText(r)}function h(){null!=T.subLanguage?function(){if(""===C)return;let e=null;if("string"==typeof T.subLanguage){if(!t[T.subLanguage])return void _.addText(C);e=d(T.subLanguage,C,!0,B[T.subLanguage]),B[T.subLanguage]=e._top}else e=u(C,T.subLanguage.length?T.subLanguage:null);T.relevance>0&&(N+=e.relevance),_.__addSublanguage(e._emitter,e.language)}():c(),C=""}function m(e,t){""!==e&&(_.startScope(t),_.addText(e),_.endScope())}function p(e,t){let r=1;const n=t.length-1;for(;r<=n;){if(!e._emit[r]){r++;continue}const n=E.classNameAliases[e[r]]||e[r],a=t[r];n?m(a,n):(C=a,c(),C=""),r++}}function f(e,t){return e.scope&&"string"==typeof e.scope&&_.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(C,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),C=""):e.beginScope._multi&&(p(e.beginScope,t),C="")),T=Object.create(e,{parent:{value:T}}),T}function v(e,t,r){let n=function(e,t){const r=e&&e.exec(t);return r&&0===r.index}(e.endRe,r);if(n){if(e["on:end"]){const r=new he(e);e["on:end"](t,r),r.isMatchIgnored&&(n=!1)}if(n){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return v(e.parent,t,r)}function b(e){return 0===T.matcher.regexIndex?(C+=e[0],1):(O=!0,0)}function y(e){const t=e[0],n=r.substring(e.index),a=v(T,e,n);if(!a)return bt;const o=T;T.endScope&&T.endScope._wrap?(h(),m(t,T.endScope._wrap)):T.endScope&&T.endScope._multi?(h(),p(T.endScope,e)):o.skip?C+=t:(o.returnEnd||o.excludeEnd||(C+=t),h(),o.excludeEnd&&(C=t));do{T.scope&&_.closeNode(),T.skip||T.subLanguage||(N+=T.relevance),T=T.parent}while(T!==a.parent);return a.starts&&f(a.starts,e),o.returnEnd?0:t.length}let w={};function x(t,o){const i=o&&o[0];if(C+=t,null==i)return h(),0;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===i){if(C+=r.slice(o.index,o.index+1),!a){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=w.rule,t}return 1}if(w=o,"begin"===o.type)return function(e){const t=e[0],r=e.rule,n=new he(r),a=[r.__beforeBegin,r["on:begin"]];for(const o of a)if(o&&(o(e,n),n.isMatchIgnored))return b(t);return r.skip?C+=t:(r.excludeBegin&&(C+=t),h(),r.returnBegin||r.excludeBegin||(C=t)),f(r,e),r.returnBegin?0:t.length}(o);if("illegal"===o.type&&!n){const e=new Error('Illegal lexeme "'+i+'" for mode "'+(T.scope||"<unnamed>")+'"');throw e.mode=T,e}if("end"===o.type){const e=y(o);if(e!==bt)return e}if("illegal"===o.type&&""===i)return 1;if(A>1e5&&A>3*o.index){throw new Error("potential infinite loop, way more iterations than matches")}return C+=i,i.length}const E=g(e);if(!E)throw lt(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const k=mt(E);let S="",T=i||k;const B={},_=new l.__emitter(l);!function(){const e=[];for(let t=T;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>_.openNode(e)))}();let C="",N=0,M=0,A=0,O=!1;try{if(E.__emitTokens)E.__emitTokens(r,_);else{for(T.matcher.considerAll();;){A++,O?O=!1:T.matcher.considerAll(),T.matcher.lastIndex=M;const e=T.matcher.exec(r);if(!e)break;const t=x(r.substring(M,e.index),e);M=e.index+t}x(r.substring(M))}return _.finalize(),S=_.toHTML(),{language:e,value:S,relevance:N,illegal:!1,_emitter:_,_top:T}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:e,value:ft(r),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:M,context:r.slice(M-100,M+100),mode:z.mode,resultSoFar:S},_emitter:_};if(a)return{language:e,value:ft(r),illegal:!1,relevance:0,errorRaised:z,_emitter:_,_top:T};throw z}}function u(e,r){r=r||l.languages||Object.keys(t);const n=function(e){const t={value:ft(e),illegal:!1,relevance:0,_top:i,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}(e),a=r.filter(g).filter(v).map((t=>d(t,e,!1)));a.unshift(n);const o=a.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(g(e.language).supersetOf===t.language)return 1;if(g(t.language).supersetOf===e.language)return-1}return 0})),[s,c]=o,u=s;return u.secondBest=c,u}function h(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const r=l.languageDetectRe.exec(t);if(r){const t=g(r[1]);return t||(st(o.replace("{}",r[1])),st("Falling back to no-highlight mode for this block.",e)),t?r[1]:"no-highlight"}return t.split(/\s+/).find((e=>s(e)||g(e)))}(e);if(s(n))return;if(b("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&&(l.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)),l.throwUnescapedHTML)){throw new gt("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const a=t.textContent,i=n?c(a,{language:n,ignoreIllegals:!0}):u(a);e.innerHTML=i.value,e.dataset.highlighted="yes",function(e,t,n){const a=t&&r[t]||n;e.classList.add("hljs"),e.classList.add(`language-${a}`)}(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),b("after:highlightElement",{el:e,result:i,text:a})}let m=!1;function p(){if("loading"===document.readyState)return void(m=!0);document.querySelectorAll(l.cssSelector).forEach(h)}function g(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]}function f(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{r[e.toLowerCase()]=t}))}function v(e){const t=g(e);return t&&!t.disableAutodetect}function b(e,t){const r=e;n.forEach((function(e){e[r]&&e[r](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){m&&p()}),!1),Object.assign(e,{highlight:c,highlightAuto:u,highlightAll:p,highlightElement:h,highlightBlock:function(e){return ct("10.7.0","highlightBlock will be removed entirely in v12.0"),ct("10.7.0","Please use highlightElement now."),h(e)},configure:function(e){l=vt(l,e)},initHighlighting:()=>{p(),ct("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){p(),ct("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(r,n){let o=null;try{o=n(e)}catch(l){if(lt("Language definition for '{}' could not be registered.".replace("{}",r)),!a)throw l;lt(l),o=i}o.name||(o.name=r),t[r]=o,o.rawDefinition=n.bind(null,e),o.aliases&&f(o.aliases,{languageName:r})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(r))r[t]===e&&delete r[t]},listLanguages:function(){return Object.keys(t)},getLanguage:g,registerAliases:f,autoDetection:v,inherit:vt,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(){a=!1},e.safeMode=function(){a=!0},e.versionString="11.9.0",e.regex={concat:Se,lookahead:xe,either:Te,optional:ke,anyNumberOfTimes:Ee};for(const y in Ge)"object"==typeof Ge[y]&&ue(Ge[y]);return Object.assign(e,Ge),e},wt=yt({});wt.newInstance=()=>yt({});var xt=wt;wt.HighlightJS=wt,wt.default=wt;const Et=de(xt);const kt="[A-Za-z$_][0-9A-Za-z$_]*",St=["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"],Tt=["true","false","null","undefined","NaN","Infinity"],Bt=["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"],_t=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ct=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Nt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Mt=[].concat(Ct,Bt,_t);var At="[0-9](_*[0-9])*",Ot=`\\.(${At})`,zt="[0-9a-fA-F](_*[0-9a-fA-F])*",Rt={className:"number",variants:[{begin:`(\\b(${At})((${Ot})|\\.)?|(${Ot}))[eE][+-]?(${At})[fFdD]?\\b`},{begin:`\\b(${At})((${Ot})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ot})[fFdD]?\\b`},{begin:`\\b(${At})[fFdD]\\b`},{begin:`\\b0[xX]((${zt})\\.?|(${zt})?\\.(${zt}))[pP][+-]?(${At})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${zt})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function It(e,t,r){return-1===r?"":e.replace(t,(n=>It(e,t,r-1)))}const Lt="[A-Za-z$_][0-9A-Za-z$_]*",Dt=["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"],Ft=["true","false","null","undefined","NaN","Infinity"],Pt=["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"],qt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ht=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$t=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Vt=[].concat(Ht,Pt,qt);const Ut=["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"],jt=["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"],Wt=["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"],Kt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Gt=["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 Zt=["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"],Xt=["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"],Yt=["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"],Qt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Jt=["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(),er=Yt.concat(Qt);const tr=["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"],rr=["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"],nr=["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"],ar=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],or=["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 ir(e){return e?"string"==typeof e?e:e.source:null}function lr(e){return sr("(?=",e,")")}function sr(...e){return e.map((e=>ir(e))).join("")}function cr(...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=>ir(e))).join("|")+")"}const dr=e=>sr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),ur=["Protocol","Type"].map(dr),hr=["init","self"].map(dr),mr=["Any","Self"],pr=["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"],gr=["false","nil","true"],fr=["assignment","associativity","higherThan","left","lowerThan","none","right"],vr=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],br=["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"],yr=cr(/[/=\-+!*%<>&|^~?]/,/[\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]/),wr=cr(yr,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),xr=sr(yr,wr,"*"),Er=cr(/[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]/),kr=cr(Er,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Sr=sr(Er,kr,"*"),Tr=sr(/[A-Z]/,kr,"*"),Br=["attached","autoclosure",sr(/convention\(/,cr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",sr(/objc\(/,Sr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],_r=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];var Cr="[0-9](_*[0-9])*",Nr=`\\.(${Cr})`,Mr="[0-9a-fA-F](_*[0-9a-fA-F])*",Ar={className:"number",variants:[{begin:`(\\b(${Cr})((${Nr})|\\.)?|(${Nr}))[eE][+-]?(${Cr})[fFdD]?\\b`},{begin:`\\b(${Cr})((${Nr})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Nr})[fFdD]?\\b`},{begin:`\\b(${Cr})[fFdD]\\b`},{begin:`\\b0[xX]((${Mr})\\.?|(${Mr})?\\.(${Mr}))[pP][+-]?(${Cr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Mr})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};Et.registerLanguage("plaintext",(function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),Et.registerLanguage("json",(function(e){const t=["true","false","null"],r={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,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),Et.registerLanguage("javascript",(function(e){const t=e.regex,r=kt,n="<>",a="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const r=e[0].length+e.index,n=e.input[r];if("<"===n||","===n)return void t.ignoreMatch();let a;">"===n&&(((e,{after:t})=>{const r="</"+e[0].slice(1);return-1!==e.input.indexOf(r,t)})(e,{after:r})||t.ignoreMatch());const o=e.input.substring(r);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&0===a.index)&&t.ignoreMatch()}},i={$pattern:kt,keyword:St,literal:Tt,built_in:Mt,"variable.language":Nt},l="[0-9](_?[0-9])*",s=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${s})|\\.)?|(${s}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${s})\\b|\\.)?|(${s})\\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},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:i,contains:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},m={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},p={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},f={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,p,g,{match:/\$\d+/},d];u.contains=v.concat({begin:/\{/,end:/\}/,keywords:i,contains:["self"].concat(v)});const b=[].concat(f,u.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:i,contains:["self"].concat(b)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:y},x={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={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:{_:[...Bt,..._t]}},k={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},S={match:t.concat(/\b/,(T=[...Ct,"super","import"],t.concat("(?!",T.join("|"),")")),r,t.lookahead(/\(/)),className:"title.function",relevance:0};var T;const B={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},_={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:E},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,h,m,p,g,f,{match:/\$\d+/},d,E,{className:"attr",begin:r+t.lookahead(":"),relevance:0},N,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:C,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:i,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n,end:a},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.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:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},B,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},S,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},x,_,{match:/\$[(.]/}]}})),Et.registerLanguage("java",(function(e){const t=e.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=r+It("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),a={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"]},o={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},i={className:"params",begin:/\(/,end:/\)/,keywords:a,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:a,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+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[i,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:a,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:a,relevance:0,contains:[o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Rt,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Rt,o]}})),Et.registerLanguage("typescript",(function(e){const t=function(e){const t=e.regex,r=Lt,n="<>",a="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const r=e[0].length+e.index,n=e.input[r];if("<"===n||","===n)return void t.ignoreMatch();let a;">"===n&&(((e,{after:t})=>{const r="</"+e[0].slice(1);return-1!==e.input.indexOf(r,t)})(e,{after:r})||t.ignoreMatch());const o=e.input.substring(r);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&0===a.index)&&t.ignoreMatch()}},i={$pattern:Lt,keyword:Dt,literal:Ft,built_in:Vt,"variable.language":$t},l="[0-9](_?[0-9])*",s=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${s})|\\.)?|(${s}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${s})\\b|\\.)?|(${s})\\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},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:i,contains:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},m={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},p={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},f={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,p,g,{match:/\$\d+/},d];u.contains=v.concat({begin:/\{/,end:/\}/,keywords:i,contains:["self"].concat(v)});const b=[].concat(f,u.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:i,contains:["self"].concat(b)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:y},x={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={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:{_:[...Pt,...qt]}},k={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},S={match:t.concat(/\b/,(T=[...Ht,"super","import"],t.concat("(?!",T.join("|"),")")),r,t.lookahead(/\(/)),className:"title.function",relevance:0};var T;const B={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},_={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:E},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,h,m,p,g,f,{match:/\$\d+/},d,E,{className:"attr",begin:r+t.lookahead(":"),relevance:0},N,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:C,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:i,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n,end:a},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.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:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},B,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},S,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},x,_,{match:/\$[(.]/}]}}(e),r=Lt,n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[t.exports.CLASS_REFERENCE]},i={$pattern:Lt,keyword:Dt.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:Ft,built_in:Vt.concat(n),"variable.language":$t},l={className:"meta",begin:"@"+r},s=(e,t,r)=>{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,r)};return Object.assign(t.keywords,i),t.exports.PARAMS_CONTAINS.push(l),t.contains=t.contains.concat([l,a,o]),s(t,"shebang",e.SHEBANG()),s(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})),Et.registerLanguage("python",(function(e){const t=e.regex,r=new RegExp("[\\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"],a={$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"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},l={begin:/\{\{/,relevance:0},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,l,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,l,i]},{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,l,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,l,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,u=`\\b|${n.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${u})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${u})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${u})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${u})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${u})`},{begin:`\\b(${c})[jJ](?=${u})`}]},m={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},p={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",o,h,s,e.HASH_COMMENT_MODE]}]};return i.contains=[s,h,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[o,h,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},s,m,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[p]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,p,s]}]}})),Et.registerLanguage("php",(function(e){const t=e.regex,r=/(?![A-Za-z0-9])(?![$])/,n=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),o={scope:"variable",match:"\\$+"+n},i={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),s="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(i)}),l,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(i),"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/})]},d={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},u=["false","null","true"],h=["__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"],m=["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"],p={keyword:h,literal:(e=>{const t=[];return e.forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(u),built_in:m},g=e=>e.map((e=>e.replace(/\|\d+$/,""))),f={variants:[{match:[/new/,t.concat(s,"+"),t.concat("(?!",g(m).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},v=t.concat(n,"\\b(?!\\()"),b={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),v],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),v],scope:{1:"title.class",3:"variable.constant"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},y={scope:"attr",match:t.concat(n,t.lookahead(":"),t.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:p,contains:[y,o,b,e.C_BLOCK_COMMENT_MODE,c,d,f]},x={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",g(h).join("\\b|"),"|",g(m).join("\\b|"),"\\b)"),n,t.concat(s,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(x);const E=[y,b,e.C_BLOCK_COMMENT_MODE,c,d,f];return{case_insensitive:!1,keywords:p,contains:[{begin:t.concat(/#\[\s*/,a),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:u,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:u,keyword:["new","array"]},contains:["self",...E]},...E,{scope:"meta",match:a}]},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/},o,x,b,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},f,{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:p,contains:["self",o,b,e.C_BLOCK_COMMENT_MODE,c,d]}]},{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]},c,d]}})),Et.registerLanguage("css",(function(e){const t=e.regex,r=(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:[r.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r.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},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Wt.join("|")+")"},{begin:":(:)?("+Kt.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Gt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.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}]},r.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:jt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...n,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ut.join("|")+")\\b"}]}})),Et.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),r=er,n="[\\w-]+",a="("+n+"|@\\{"+n+"\\})",o=[],i=[],l=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},s=function(e,t,r){return{className:e,begin:t,relevance:r}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Xt.join(" ")},d={begin:"\\(",end:"\\)",contains:i,keywords:c,relevance:0};i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,s("variable","@@?"+n,10),s("variable","@\\{"+n+"\\}"),s("built_in","~?`[^`]*?`"),{className:"attribute",begin:n+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const u=i.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(i)},m={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Jt.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:i}}]},p={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:i,relevance:0}},g={className:"variable",variants:[{begin:"@"+n+"\\s*:",relevance:15},{begin:"@"+n}],starts:{end:"[;}]",returnEnd:!0,contains:u}},f={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,s("keyword","all\\b"),s("variable","@\\{"+n+"\\}"),{begin:"\\b("+Zt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,s("selector-tag",a,0),s("selector-id","#"+a),s("selector-class","\\."+a,0),s("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Yt.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Qt.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:u},{begin:"!important"},t.FUNCTION_DISPATCH]},v={begin:n+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[f]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,g,v,m,f,h,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:o}})),Et.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),r=ar,n=nr,a="@[a-z-]+",o={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("+tr.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+or.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,o,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:a,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:rr.join(" ")},contains:[{begin:a,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}})),Et.registerLanguage("html",(function(e){const t=e.regex,r=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]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),i=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),s={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:[a,l,i,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,l,i]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},n,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[s],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[s],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(r,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:s}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),Et.registerLanguage("markdown",(function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={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}/}]},a={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},o=e.inherit(n,{contains:[]}),i=e.inherit(a,{contains:[]});n.contains.push(i),a.contains.push(o);let l=[t,r];return[n,a,o,i].forEach((e=>{e.contains=e.contains.concat(l)})),l=l.concat(n,a),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:l},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:l}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},n,a,{className:"quote",begin:"^>\\s+",contains:l,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:"$"},r,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}})),Et.registerLanguage("objectivec",(function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,r={$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:"("+r.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:r,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}})),Et.registerLanguage("swift",(function(e){const t={match:/\s+/,relevance:0},r=e.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[e.C_LINE_COMMENT_MODE,r],a={match:[/\./,cr(...ur,...hr)],className:{2:"keyword"}},o={match:sr(/\./,cr(...pr)),relevance:0},i=pr.filter((e=>"string"==typeof e)).concat(["_|0"]),l={variants:[{className:"keyword",match:cr(...pr.filter((e=>"string"!=typeof e)).concat(mr).map(dr),...hr)}]},s={$pattern:cr(/\b\w+/,/#\w+/),keyword:i.concat(vr),literal:gr},c=[a,o,l],d=[{match:sr(/\./,cr(...br)),relevance:0},{className:"built_in",match:sr(/\b/,cr(...br),/(?=\()/)}],u={match:/->/,relevance:0},h=[u,{className:"operator",relevance:0,variants:[{match:xr},{match:`\\.(\\.|${wr})+`}]}],m="([0-9]_*)+",p="([0-9a-fA-F]_*)+",g={className:"number",relevance:0,variants:[{match:`\\b(${m})(\\.(${m}))?([eE][+-]?(${m}))?\\b`},{match:`\\b0x(${p})(\\.(${p}))?([pP][+-]?(${m}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},f=(e="")=>({className:"subst",variants:[{match:sr(/\\/,e,/[0\\tnr"']/)},{match:sr(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),v=(e="")=>({className:"subst",match:sr(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),b=(e="")=>({className:"subst",label:"interpol",begin:sr(/\\/,e,/\(/),end:/\)/}),y=(e="")=>({begin:sr(e,/"""/),end:sr(/"""/,e),contains:[f(e),v(e),b(e)]}),w=(e="")=>({begin:sr(e,/"/),end:sr(/"/,e),contains:[f(e),b(e)]}),x={className:"string",variants:[y(),y("#"),y("##"),y("###"),w(),w("#"),w("##"),w("###")]},E=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],k={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},S=e=>{const t=sr(e,/\//),r=sr(/\//,e);return{begin:t,end:r,contains:[...E,{scope:"comment",begin:`#(?!.*${r})`,end:/$/}]}},T={scope:"regexp",variants:[S("###"),S("##"),S("#"),k]},B={match:sr(/`/,Sr,/`/)},_=[B,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${kr}+`}],C=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:_r,contains:[...h,g,x]}]}},{scope:"keyword",match:sr(/@/,cr(...Br))},{scope:"meta",match:sr(/@/,Sr)}],N={match:lr(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:sr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,kr,"+")},{className:"type",match:Tr,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:sr(/\s+&\s+/,lr(Tr)),relevance:0}]},M={begin:/</,end:/>/,keywords:s,contains:[...n,...c,...C,u,N]};N.contains.push(M);const A={begin:/\(/,end:/\)/,relevance:0,keywords:s,contains:["self",{match:sr(Sr,/\s*:/),keywords:"_|0",relevance:0},...n,T,...c,...d,...h,g,x,..._,...C,N]},O={begin:/</,end:/>/,keywords:"repeat each",contains:[...n,N]},z={begin:/\(/,end:/\)/,keywords:s,contains:[{begin:cr(lr(sr(Sr,/\s*:/)),lr(sr(Sr,/\s+/,Sr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Sr}]},...n,...c,...h,g,x,...C,N,A],endsParent:!0,illegal:/["']/},R={match:[/(func|macro)/,/\s+/,cr(B.match,Sr,xr)],className:{1:"keyword",3:"title.function"},contains:[O,z,t],illegal:[/\[/,/%/]},I={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[O,z,t],illegal:/\[|%/},L={match:[/operator/,/\s+/,xr],className:{1:"keyword",3:"title"}},D={begin:[/precedencegroup/,/\s+/,Tr],className:{1:"keyword",3:"title"},contains:[N],keywords:[...fr,...gr],end:/}/};for(const F of x.variants){const e=F.contains.find((e=>"interpol"===e.label));e.keywords=s;const t=[...c,...d,...h,g,x,..._];e.contains=[...t,{begin:/\(/,end:/\)/,contains:["self",...t]}]}return{name:"Swift",keywords:s,contains:[...n,R,I,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:s,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},L,D,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},T,...c,...d,...h,g,x,..._,...C,N,A]}})),Et.registerLanguage("dart",(function(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},r={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,r]},{begin:'"""',end:'"""',contains:[e.BACKSLASH_ESCAPE,t,r]},{begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,r]},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,r]}]};r.contains=[e.C_NUMBER_MODE,n];const a=["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"],o=a.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:a.concat(o).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:"=>"}]}})),Et.registerLanguage("nginx",(function(e){const t=e.regex,r={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,r],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[r]},{className:"regexp",contains:[e.BACKSLASH_ESCAPE,r],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},r]};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\\}\\{]"}})),Et.registerLanguage("go",(function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}})),Et.registerLanguage("http",(function(e){const t="HTTP/([32]|1\\.[01])",r={className:"attribute",begin:e.regex.concat("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},n=[r,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+t+" \\d{3})",end:/$/,contains:[{className:"meta",begin:t},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:n}},{begin:"(?=^[A-Z]+ (.*?) "+t+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:t},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:n}},e.inherit(r,{relevance:0})]}})),Et.registerLanguage("ruby",(function(e){const t=e.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(n,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},i={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},s=[e.COMMENT("#","$",{contains:[i]}),e.COMMENT("^=begin","^=end",{contains:[i],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},d={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},u="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${u}))?([eE][+-]?(${u})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},p=[d,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:o},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:r}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,s),relevance:0}].concat(l,s);c.contains=p,m.contains=p;const g=[{begin:/^\s*=>/,starts:{end:"$",contains:p}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:o,contains:p}}];return s.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(g).concat(s).concat(p)}})),Et.registerLanguage("c",(function(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="("+n+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",i={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},u=t.optional(a)+e.IDENT_RE+"\\s*\\(",h={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},m=[c,i,r,e.C_BLOCK_COMMENT_MODE,s,l],p={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:m.concat([{begin:/\(/,end:/\)/,keywords:h,contains:m.concat(["self"]),relevance:0}]),relevance:0},g={begin:"("+o+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,l,s,i,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,s,i]}]},i,r,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:h,disableAutodetect:!0,illegal:"</",contains:[].concat(p,g,m,[c,{begin:e.IDENT_RE+"::",keywords:h},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:l,keywords:h}}})),Et.registerLanguage("cpp",(function(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+n+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",i={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},u=t.optional(a)+e.IDENT_RE+"\\s*\\(",h={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},m={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},p=[m,c,i,r,e.C_BLOCK_COMMENT_MODE,s,l],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:p.concat([{begin:/\(/,end:/\)/,keywords:h,contains:p.concat(["self"]),relevance:0}]),relevance:0},f={className:"function",begin:"("+o+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,s]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,l,s,i,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,s,i]}]},i,r,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(g,f,m,p,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:h,contains:["self",i]},{begin:e.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}})),Et.registerLanguage("csharp",(function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},r=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),n={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},a={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=e.inherit(a,{illegal:/\n/}),i={className:"subst",begin:/\{/,end:/\}/,keywords:t},l=e.inherit(i,{illegal:/\n/}),s={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,l]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},i]},d=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]});i.contains=[c,s,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,n,e.C_BLOCK_COMMENT_MODE],l.contains=[d,s,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,n,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const u={variants:[c,s,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:"<",end:">",contains:[{beginKeywords:"in out"},r]},m=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",p={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},u,n,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},r,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[r,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+m+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[u,n,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},p]}})),Et.registerLanguage("sql",(function(e){const t=e.regex,r=e.COMMENT("--","$"),n=["true","false","unknown"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],o=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],i=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],l=o,s=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!o.includes(e))),c={begin:t.concat(/\b/,t.either(...l),/\s*\(/),relevance:0,keywords:{built_in:l}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:r}={}){const n=r;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:n(e)?`${e}|0`:e))}(s,{when:e=>e.length<3}),literal:n,type:a,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...i),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:s.concat(i),literal:n,type:a}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}})),Et.registerLanguage("shell",(function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}})),Et.registerLanguage("r",(function(e){const t=e.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[a,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[o,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}})),Et.registerLanguage("kotlin",(function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},n={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,n]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,n]}]};n.contains.push(o);const i={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},s=Ar,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},u=d;return u.variants[1].contains=[d],d.variants[1].contains=[u],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r,i,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,i,l,o,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},i,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},s]}})),Et.registerLanguage("rust",(function(e){const t=e.regex,r={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},n="([ui](8|16|32|64|128|size)|f(32|64))?",a=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],o=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:o,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:a},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n},{begin:"\\b0x([A-Fa-f0-9_]+)"+n},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+n}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:a,type:o}},{className:"punctuation",begin:"->"},r]}})),Et.configure({cssSelector:"pre",classPrefix:"editify-hljs-",ignoreUnescapedHTML:!0});const Or=[{label:"Plain Text",value:"plaintext"},{label:"JSON",value:"json"},{label:"JavaScript",value:"javascript"},{label:"Java",value:"java"},{label:"TypeScript",value:"typescript"},{label:"Python",value:"python"},{label:"PHP",value:"php"},{label:"CSS",value:"css"},{label:"Less",value:"less"},{label:"Scss",value:"scss"},{label:"HTML",value:"html"},{label:"Markdown",value:"markdown"},{label:"Objective-C",value:"objectivec"},{label:"Swift",value:"swift"},{label:"Dart",value:"dart"},{label:"Nginx",value:"nginx"},{label:"HTTP",value:"http"},{label:"Go",value:"go"},{label:"Ruby",value:"ruby"},{label:"C",value:"c"},{label:"C++",value:"cpp"},{label:"C#",value:"csharp"},{label:"SQL",value:"sql"},{label:"Shell",value:"shell"},{label:"R",value:"r"},{label:"Kotlin",value:"kotlin"},{label:"Rust",value:"rust"}],zr=function(e,t){if(!ae.isObject(e)&&ae.isObject(t))return null;for(let r in t)ae.isObject(t[r])&&!Array.isArray(t[r])&&ae.isObject(e[r])&&!Array.isArray(e[r])?e[r]=zr(e[r],t[r]):e[r]=t[r];return e},Rr=function(e,t,r){if(null==r||null==r)return e.hasOwnProperty(t);let n=e[t];if(null==n||null==n)return!1;if("string"==typeof r&&(r=r.toLocaleLowerCase()),"string"==typeof n&&(n=n.toLocaleLowerCase()),"string"==typeof r&&r&&(ae.matchingText(r,"rgb")||ae.matchingText(r,"rgba"))&&(r=ee.trim(r,!0)),"string"==typeof n&&n&&(ae.matchingText(n,"rgb")||ae.matchingText(n,"rgba"))&&(n=ee.trim(n,!0)),"string"==typeof r&&r&&ae.matchingText(r,"hex")){const e=se.hex2rgb(r);r=`rgb(${e[0]},${e[1]},${e[2]})`}if("string"==typeof n&&n&&ae.matchingText(n,"hex")){const e=se.hex2rgb(n);n=`rgb(${e[0]},${e[1]},${e[2]})`}return n==r},Ir=function(e){return ae.isObject(e)||Array.isArray(e)?JSON.parse(JSON.stringify(e)):e},Lr=function(e){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"]}},Dr=(e,t)=>e.isBlock()?e.parsedom==t?e:null:e.isText()||e.parsedom!=t?Dr(e.parent,t):e,Fr=(e,t,r)=>{if(!e.range)return null;if(e.range.anchor.element.isEqual(e.range.focus.element))return Dr(e.range.anchor.element,r);const n=t.list.map((e=>Dr(e.element,r)));if(n.some((e=>null==e)))return null;if(1==n.length)return n[0];let a=!0;for(let o=1;o<n.length;o++)if(!n[o].isEqual(n[0])){a=!1;break}return a?n[0]:null},Pr=(e,t)=>!!Hr(e,t)||!!e.parent&&Pr(e.parent,t),qr=e=>!!$r(e)||!!e.parent&&qr(e.parent),Hr=(e,t=!1)=>!e.isEmpty()&&("div"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-list"]==(t?"ol":"ul")),$r=e=>!e.isEmpty()&&("div"==e.parsedom&&e.hasMarks()&&e.marks.hasOwnProperty("data-editify-task")),Vr=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Dr(e.range.anchor.element,"pre"):t.flatList.some((e=>!!Dr(e.element,"pre")))),Ur=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Dr(e.range.anchor.element,"blockquote"):t.flatList.some((e=>!!Dr(e.element,"blockquote")))),jr=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Dr(e.range.anchor.element,"blockquote"):t.list.every((e=>!!Dr(e.element,"blockquote")))),Wr=(e,t,r=!1)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?Pr(e.range.anchor.element,r):t.list.every((e=>Pr(e.element,r)))),Kr=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?qr(e.range.anchor.element):t.list.every((e=>qr(e.element)))),Gr=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Dr(e.range.anchor.element,"a"):t.flatList.some((e=>!!Dr(e.element,"a")))),Zr=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Dr(e.range.anchor.element,"table"):t.flatList.some((e=>!!Dr(e.element,"table")))),Xr=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Dr(e.range.anchor.element,"img"):t.flatList.some((e=>!!Dr(e.element,"img")))),Yr=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Dr(e.range.anchor.element,"video"):t.flatList.some((e=>!!Dr(e.element,"video")))),Qr=(e,t,r,n)=>{if(!e.range)return!1;if(e.range.anchor.isEqual(e.range.focus))return!(!e.range.anchor.element.isText()||!e.range.anchor.element.hasStyles())&&Rr(e.range.anchor.element.styles,r,n);let a=t.flatList.filter((e=>e.element.isText()));return 0!=a.length&&a.every((e=>!!e.element.hasStyles()&&Rr(e.element.styles,r,n)))},Jr=(e,t,r,n)=>{if(!e.range)return!1;if(e.range.anchor.isEqual(e.range.focus))return!(!e.range.anchor.element.isText()||!e.range.anchor.element.hasMarks())&&Rr(e.range.anchor.element.marks,r,n);let a=t.flatList.filter((e=>e.element.isText()));return 0!=a.length&&a.every((e=>!!e.element.hasMarks()&&Rr(e.element.marks,r,n)))},en=e=>{let t="";return e.flatList.forEach((e=>{e.element.isText()&&(e.offset?t+=e.element.textContent.substring(e.offset[0],e.offset[1]):t+=e.element.textContent||"")})),t},tn=(e,t)=>{if(!e.range)return[];let r=t.flatList.length,n=[];for(let a=0;a<r;a++){const o=t.flatList[a];if(o.offset){let t=null;if(0==o.offset[0]&&o.offset[1]<o.element.textContent.length){const r=o.element.clone();o.element.textContent=o.element.textContent.substring(0,o.offset[1]),r.textContent=r.textContent.substring(o.offset[1]),e.addElementAfter(r,o.element),t=o.element}else if(o.offset[1]==o.element.textContent.length&&o.offset[0]>0){const r=o.element.clone();o.element.textContent=o.element.textContent.substring(0,o.offset[0]),r.textContent=r.textContent.substring(o.offset[0]),e.addElementAfter(r,o.element),t=r}else if(o.offset[0]>0&&o.offset[1]<o.element.textContent.length){const r=o.element.clone(),n=o.element.clone();o.element.textContent=o.element.textContent.substring(0,o.offset[0]),r.textContent=r.textContent.substring(o.offset[0],o.offset[1]),n.textContent=n.textContent.substring(o.offset[1]),e.addElementAfter(r,o.element),e.addElementAfter(n,r),t=r}t&&(0==a&&e.range.anchor.moveToStart(t),a==r-1&&e.range.focus.moveToEnd(t),n.push(t))}else n.push(o.element)}return n},rn=e=>{e.marks=null,e.styles=null,e.parsedom=y.BLOCK_NODE},nn=(e,t=!1)=>{Hr(e,t)||(rn(e),e.parsedom="div",e.hasMarks()||(e.marks={}),e.marks["data-editify-list"]=t?"ol":"ul")},an=e=>{$r(e)||(rn(e),e.parsedom="div",e.hasMarks()||(e.marks={}),e.marks["data-editify-task"]="uncheck")},on=(e,t,r,n)=>{if(!e.range)return;if(!Lr(r).heading.map((e=>e.value)).includes(n))throw new Error("The parameter supports only h1-h6 and p");if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();rn(t),t.parsedom=n}else t.list.forEach((e=>{if(e.element.isBlock())rn(e.element),e.element.parsedom=n;else{const t=e.element.getBlock();rn(t),t.parsedom=n}}))},ln=(e,t)=>{if(!e.range)return;const r=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(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock(),n=e.range.anchor.element.getInblock();n&&"block"==n.behavior&&!n.isPreStyle()?r(n):t.isPreStyle()||r(t)}else t.list.forEach((e=>{const t=e.element.getBlock(),n=e.element.getInblock();n&&"block"==n.behavior&&!n.isPreStyle()?r(n):t.isPreStyle()||r(t)}))},sn=(e,t)=>{if(!e.range)return;const r=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(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock(),n=e.range.anchor.element.getInblock();n&&"block"==n.behavior&&!n.isPreStyle()?r(n):t.isPreStyle()||r(t)}else t.list.forEach((e=>{const t=e.element.getBlock(),n=e.element.getInblock();n&&"block"==n.behavior&&!n.isPreStyle()?r(n):t.isPreStyle()||r(t)}))},cn=(e,t)=>{if(!e.range)return;const r=jr(e,t);if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();rn(t),r||(t.parsedom="blockquote")}else{let e=[];t.list.forEach((t=>{const r=t.element.getBlock();e.some((e=>r.isEqual(e)))||e.push(r)})),e.forEach((e=>{rn(e),r||(e.parsedom="blockquote")}))}},dn=(e,t,r)=>{if(e.range)if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock(),n=e.range.anchor.element.getInblock();n?n.hasStyles()?n.styles["text-align"]=r:n.styles={"text-align":r}:t.hasStyles()?t.styles["text-align"]=r:t.styles={"text-align":r}}else t.list.forEach((e=>{if(e.element.isBlock()||e.element.isInblock())e.element.hasStyles()?e.element.styles["text-align"]=r:e.element.styles={"text-align":r};else{const t=e.element.getBlock(),n=e.element.getInblock();n?n.hasStyles()?n.styles["text-align"]=r:n.styles={"text-align":r}:t.hasStyles()?t.styles["text-align"]=r:t.styles={"text-align":r}}}))},un=(e,t,r)=>{if(!e.range)return;const n=Wr(e,t,r);if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();n?rn(t):nn(t,r)}else{let e=[];t.list.forEach((t=>{const r=t.element.getBlock();e.some((e=>r.isEqual(e)))||e.push(r)})),e.forEach((e=>{n?rn(e):nn(e,r)}))}},hn=(e,t)=>{if(!e.range)return;const r=Kr(e,t);if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();r?rn(t):an(t)}else{let e=[];t.list.forEach((t=>{const r=t.element.getBlock();e.some((e=>r.isEqual(e)))||e.push(r)})),e.forEach((e=>{r?rn(e):an(e)}))}},mn=(e,t,r)=>{if(e.range)if(e.range.anchor.isEqual(e.range.focus))if(e.range.anchor.element.isSpaceText())e.range.anchor.element.hasStyles()?Object.assign(e.range.anchor.element.styles,Ir(r)):e.range.anchor.element.styles=Ir(r);else if(e.range.anchor.element.isText()){const t=y.getSpaceElement();t.styles=Ir(e.range.anchor.element.styles),t.marks=Ir(e.range.anchor.element.marks),t.hasStyles()?Object.assign(t.styles,Ir(r)):t.styles=Ir(r),e.insertElement(t)}else{const t=y.getSpaceElement();t.styles=Ir(r),e.insertElement(t)}else{tn(e,t).forEach((e=>{e.isText()&&(e.hasStyles()?Object.assign(e.styles,Ir(r)):e.styles=Ir(r))}))}},pn=(e,t,r)=>{if(e.range){if(!ae.isObject(r))throw new Error("The argument must be an object");if(e.range.anchor.isEqual(e.range.focus))if(e.range.anchor.element.isSpaceText())e.range.anchor.element.hasMarks()?Object.assign(e.range.anchor.element.marks,Ir(r)):e.range.anchor.element.marks=Ir(r);else if(e.range.anchor.element.isText()){const t=y.getSpaceElement();t.styles=Ir(e.range.anchor.element.styles),t.marks=Ir(e.range.anchor.element.marks),t.hasMarks()?Object.assign(t.marks,Ir(r)):t.marks=Ir(r),e.insertElement(t)}else{const t=y.getSpaceElement();t.marks=Ir(r),e.insertElement(t)}else{tn(e,t).forEach((e=>{e.isText()&&(e.hasMarks()?Object.assign(e.marks,Ir(r)):e.marks=Ir(r))}))}}},gn=(e,t,r)=>{if(!e.range)return;const n=e=>{if(Array.isArray(r)){if(e.hasStyles()){let t={};Object.keys(e.styles).forEach((n=>{r.includes(n)||(t[n]=e.styles[n])})),e.styles=t}}else e.styles=null};if(e.range.anchor.isEqual(e.range.focus)){if(e.range.anchor.element.isSpaceText())n(e.range.anchor.element);else if(e.range.anchor.element.isText()){const t=y.getSpaceElement();t.styles=Ir(e.range.anchor.element.styles),t.marks=Ir(e.range.anchor.element.marks),n(t),e.insertElement(t)}}else{tn(e,t).forEach((e=>{e.isText()&&n(e)}))}},fn=(e,t,r)=>{if(!e.range)return;const n=e=>{if(Array.isArray(r)){if(e.hasMarks()){let t={};Object.keys(e.marks).forEach((n=>{r.includes(n)||(t[n]=e.marks[n])})),e.marks=t}}else e.marks=null};if(e.range.anchor.isEqual(e.range.focus)){if(e.range.anchor.element.isSpaceText())n(e.range.anchor.element);else if(e.range.anchor.element.isText()){const t=y.getSpaceElement();t.styles=Ir(e.range.anchor.element.styles),t.marks=Ir(e.range.anchor.element.marks),n(t),e.insertElement(t)}}else{tn(e,t).forEach((e=>{e.isText()&&n(e)}))}},vn=(e,t,r)=>{if(e.range)if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock(),n=e.range.anchor.element.getInblock();n?n.hasStyles()?n.styles["line-height"]=r:n.styles={"line-height":r}:t.hasStyles()?t.styles["line-height"]=r:t.styles={"line-height":r}}else t.list.forEach((e=>{if(e.element.isBlock()||e.element.isInblock())e.element.hasStyles()?e.element.styles["line-height"]=r:e.element.styles={"line-height":r};else{const t=e.element.getBlock(),n=e.element.getInblock();n?n.hasStyles()?n.styles["line-height"]=r:n.styles={"line-height":r}:t.hasStyles()?t.styles["line-height"]=r:t.styles={"line-height":r}}}))},bn=(e,t,r,n)=>{if(!e.range)return;t||(t=r);const a={href:r};n&&(a.target="_blank");const o=new y("inline","a",a,null,null),i=new y("text",null,null,null,t);e.addElementTo(i,o),e.insertElement(o)},yn=(e,t)=>{if(!e.range)return;const r=new y("closed","img",{src:t},null,null);e.insertElement(r)},wn=(e,t)=>{if(!e.range)return;const r=new y("closed","video",{src:t},null,null);e.insertElement(r),e.range.anchor.moveToEnd(r),e.range.focus.moveToEnd(r)},xn=(e,t,r)=>{if(!e.range)return;const n=new y("block","table",null,null,null),a=new y("inblock","tbody",null,null,null);e.addElementTo(a,n);for(let l=0;l<t;l++){const t=new y("inblock","tr",null,null,null);for(let n=0;n<r;n++){const r=new y("inblock","td",null,null,null),n=new y("closed","br",null,null,null);e.addElementTo(n,r),e.addElementTo(r,t)}e.addElementTo(t,a)}e.insertElement(n);const o=new y("block",y.BLOCK_NODE,null,null,null),i=new y("closed","br",null,null,null);e.addElementTo(i,o),e.addElementAfter(o,n),e.range.anchor.moveToStart(a),e.range.focus.moveToStart(a)},En=(e,t)=>{if(!e.range)return;const r=Fr(e,t,"pre");if(r){let t="";y.flatElements(r.children).filter((e=>e.isText())).forEach((e=>{t+=e.textContent}));t.split("\n").forEach((t=>{const n=new y("block",y.BLOCK_NODE,null,null,null),a=new y("text",null,null,null,t);e.addElementTo(a,n),e.addElementBefore(n,r)})),r.toEmpty()}else if(e.range.anchor.isEqual(e.range.focus)){const t=e.range.anchor.element.getBlock();rn(t),t.parsedom="pre";const r=new y("block",y.BLOCK_NODE,null,null,null),n=new y("closed","br",null,null,null);e.addElementTo(n,r),e.addElementAfter(r,t)}else{e.range.anchor.moveToStart(t.list[0].element.getBlock()),e.range.focus.moveToEnd(t.list[t.list.length-1].element.getBlock());const r=t.flatList.filter((e=>e.element.isText())),n={};r.forEach((e=>{n[e.element.getBlock().key]?n[e.element.getBlock().key].push(e.element.clone()):n[e.element.getBlock().key]=[e.element.clone()]}));const a=new y("block","pre",null,null,null);Object.keys(n).forEach(((t,r)=>{if(r>0){const t=new y("text",null,null,null,"\n");a.hasChildren()?e.addElementTo(t,a,a.children.length):e.addElementTo(t,a)}n[t].forEach((t=>{a.hasChildren()?e.addElementTo(t,a,a.children.length):e.addElementTo(t,a)}))})),e.delete(),e.insertElement(a);const o=new y("block",y.BLOCK_NODE,null,null,null),i=new y("closed","br",null,null,null);e.addElementTo(i,o),e.addElementAfter(o,a)}},kn=function(e,t){if("table"==t.parsedom){const r={"data-editify-element":t.key};t.hasMarks()?Object.assign(t.marks,r):t.marks=r;const n={"white-space":"pre-wrap","word-break":"break-word"};t.hasStyles()?Object.assign(t.styles,n):t.styles=n;const a=y.flatElements(t.children),o=a.filter((e=>"tr"==e.parsedom));let i=a.find((e=>"colgroup"==e.parsedom));if(i)i.children.forEach((e=>{e.hasMarks()?e.marks.width||(e.marks.width="auto"):e.marks={width:"auto"}}));else{i=new y("inblock","colgroup",null,null,null);for(let t=function(e){const t=e.children||[];let r=0;return t.forEach((e=>{if(e.hasMarks()&&e.marks.hasOwnProperty("colspan")){const t=Number(e.marks.colspan);isNaN(t)||(r+=t)}else r+=1})),r}(o[0])-1;t>=0;t--){const t=new y("closed","col",{width:"auto"},null,null);e.addElementTo(t,i)}}t.children=[];const l=new y("inblock","tbody",null,null,null);o.reverse().forEach((t=>{e.addElementTo(t,l)})),e.addElementTo(l,t),e.addElementTo(i,t)}"th"==t.parsedom&&(t.parsedom="td")},Sn=function(e,t,r,n){if("pre"==t.parsedom){const a={"data-editify-element":t.key};if(t.hasMarks()?Object.assign(t.marks,a):t.marks=a,r&&t.hasChildren()){let r=t.marks["data-editify-hljs"]||"";if(r&&n){n.some((e=>ae.isObject(e)?e.value==r:e==r))||(r="")}const a=y.flatElements(t.children).filter((e=>e.isText()&&!e.isEmpty())),o=function(e,t){return t?Et.highlight(e,{language:t,ignoreIllegals:!0}).value:Et.highlightAuto(e).value}(a.reduce(((e,t)=>e+t.textContent),""),r);if(o){const r=e.parseHtml(o);t.children=r,r.forEach((e=>{e.parent=t})),((e,t,r,n)=>{if(e.range){if(e.range.anchor.element.getBlock().isEqual(t)){const t=r.findIndex((t=>e.range.anchor.element.isEqual(t))),a=r.filter(((e,r)=>r<t)).reduce(((e,t)=>e+t.textContent.length),0)+e.range.anchor.offset,o=y.flatElements(n).filter((e=>e.isText()&&!e.isEmpty()));let i=0,l=0;for(;i<o.length;){let t=l+o[i].textContent.length;if(a>=l&&a<=t){e.range.anchor.element=o[i],e.range.anchor.offset=a-l;break}i++,l=t}}if(e.range.focus.element.getBlock().isEqual(t)){const t=r.findIndex((t=>e.range.focus.element.isEqual(t))),a=r.filter(((e,r)=>r<t)).reduce(((e,t)=>e+t.textContent.length),0)+e.range.focus.offset,o=y.flatElements(n).filter((e=>e.isText()&&!e.isEmpty()));let i=0,l=0;for(;i<o.length;){let t=l+o[i].textContent.length;if(a>=l&&a<=t){e.range.focus.element=o[i],e.range.focus.offset=a-l;break}i++,l=t}}}})(e,t,a,r)}else{const r=new y("closed","br",null,null,null);t.children=[r],r.parent=t,e.range&&(e.range.anchor.moveToStart(r),e.range.focus.moveToStart(r))}}}},Tn={placement:{type:String,default:"top",validator:e=>["top","left","right","bottom"].includes(e)},color:{type:String,default:null},background:{type:String,default:null}},Bn=["data-editify-placement"],_n=(e,t)=>{const r=e.__vccOpts||e;for(const[n,a]of t)r[n]=a;return r},Cn=_n(t.defineComponent({name:"Triangle",__name:"triangle",props:Tn,setup(e){const r=e,n=t.computed((()=>"top"==r.placement?{borderBottomColor:r.color||""}:"bottom"==r.placement?{borderTopColor:r.color||""}:"left"==r.placement?{borderRightColor:r.color||""}:"right"==r.placement?{borderLeftColor:r.color||""}:{})),a=t.computed((()=>"top"==r.placement?{borderBottomColor:r.background||""}:"bottom"==r.placement?{borderTopColor:r.background||""}:"left"==r.placement?{borderRightColor:r.background||""}:"right"==r.placement?{borderLeftColor:r.background||""}:{}));return(e,r)=>(t.openBlock(),t.createElementBlock("div",{class:"editify-triangle",style:t.normalizeStyle(n.value),"data-editify-placement":e.placement},[t.createElementVNode("div",{class:"editify-triangle-el",style:t.normalizeStyle(a.value)},null,4)],12,Bn))}}),[["__scopeId","data-v-e1abc967"]]),Nn={modelValue:{type:Boolean,default:!1},node:{type:[String,HTMLElement],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}},Mn=["data-editify-placement"],An=_n(t.defineComponent({name:"Layer",__name:"layer",props:Nn,emits:["update:modelValue","show","shown","hidden"],setup(e,{expose:r,emit:n}){const a=t.getCurrentInstance(),o=e,i=n,l=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.ref(null),u=t.computed((()=>"bottom-start"==l.value||"bottom"==l.value||"bottom-end"==l.value?"top":"top-start"==l.value||"top"==l.value||"top-end"==l.value?"bottom":"left-start"==l.value||"left"==l.value||"left-end"==l.value?"right":"right-start"==l.value||"right"==l.value||"right-end"==l.value?"left":"top")),h=t.computed((()=>({borderColor:o.border&&o.borderColor||"",background:o.background||"",color:o.color||""}))),m=()=>o.node?te.isElement(o.node)?o.node:document.body.querySelector(o.node):null,p=()=>{l.value=null;const e=window.getSelection();if(e&&e.rangeCount){const r=e.getRangeAt(0).getClientRects();if(r.length){const e=r[0],n=r[r.length-1],a=te.getElementBounding(c.value.offsetParent),i=document.documentElement.clientHeight||window.innerHeight,u=document.documentElement.clientWidth||window.innerWidth;"top"==o.placement||"top-start"==o.placement||"top-end"==o.placement?e.top>=0&&e.top>=a.top&&e.top>=c.value.offsetHeight?l.value=o.placement:i-n.bottom>=0&&i-n.bottom>=a.bottom&&i-n.bottom>=c.value.offsetHeight&&(l.value="top"==o.placement?"bottom":"top-start"==o.placement?"bottom-start":"bottom-end"):"bottom"!=o.placement&&"bottom-start"!=o.placement&&"bottom-end"!=o.placement||(i-n.bottom>=0&&i-n.bottom>=a.bottom&&i-n.bottom>=c.value.offsetHeight?l.value=o.placement:e.top>=0&&e.top>=a.top&&e.top>=c.value.offsetHeight&&(l.value="bottom"==o.placement?"top":"bottom-start"==o.placement?"top-start":"top-end")),"top"==l.value?u-e.right+e.width/2<c.value.offsetWidth/2?l.value="top-end":e.left+e.width/2<c.value.offsetWidth/2&&(l.value="top-start"):"bottom"==l.value?u-n.right+n.width/2<c.value.offsetWidth/2?l.value="bottom-end":n.left+n.width/2<c.value.offsetWidth/2&&(l.value="bottom-start"):"top-start"==l.value?u-e.right+e.width<c.value.offsetWidth&&(u-e.right+e.width/2>=c.value.offsetWidth/2?l.value="top":l.value="top-end"):"bottom-start"==l.value?u-n.right+n.width<c.value.offsetWidth&&(u-n.right+n.width/2>=c.value.offsetWidth/2?l.value="bottom":l.value="bottom-end"):"top-end"==l.value?e.left+e.width<c.value.offsetWidth&&(e.left+e.width/2>=c.value.offsetWidth/2?l.value="top":l.value="top-start"):"bottom-end"==l.value&&n.left+n.width<c.value.offsetWidth&&(n.left+n.width/2>=c.value.offsetWidth/2?l.value="bottom":l.value="bottom-start"),t.nextTick((()=>{"top"==l.value?(c.value.style.left=e.left-a.left+e.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto",c.value.style.top=e.top-a.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"top-start"==l.value?(c.value.style.left=e.left-a.left+"px",c.value.style.right="auto",c.value.style.top=e.top-a.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"top-end"==l.value?(c.value.style.left="auto",c.value.style.right=u-e.right-a.right+"px",c.value.style.top=e.top-a.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"bottom"==l.value?(c.value.style.left=n.left-a.left+n.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto",c.value.style.top="auto",c.value.style.bottom=i-n.bottom-a.bottom-c.value.offsetHeight+"px"):"bottom-start"==l.value?(c.value.style.left=n.left-a.left+"px",c.value.style.right="auto",c.value.style.top="auto",c.value.style.bottom=i-n.bottom-a.bottom-c.value.offsetHeight+"px"):"bottom-end"==l.value?(c.value.style.left="auto",c.value.style.right=u-n.right-a.right+"px",c.value.style.top="auto",c.value.style.bottom=i-n.bottom-a.bottom-c.value.offsetHeight+"px"):(c.value.style.top="auto",c.value.style.bottom=(a.bottom<0?-a.bottom:0)+"px","top"==o.placement?u-e.right+e.width/2<c.value.offsetWidth/2?(c.value.style.left="auto",c.value.style.right=u-e.right-a.right+"px"):e.left+e.width/2<c.value.offsetWidth/2?(c.value.style.left=e.left-a.left+"px",c.value.style.right="auto"):(c.value.style.left=e.left-a.left+e.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):"bottom"==o.placement?u-n.right+n.width/2<c.value.offsetWidth/2?(c.value.style.left="auto",c.value.style.right=u-n.right-a.right+"px"):n.left+n.width/2<c.value.offsetWidth/2?(c.value.style.left=n.left-a.left+"px",c.value.style.right="auto"):(c.value.style.left=n.left-a.left+n.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):"top-start"==o.placement?u-e.right+e.width<c.value.offsetWidth?u-e.right+e.width/2>=c.value.offsetWidth/2?(c.value.style.left=e.left-a.left+e.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=u-e.right-a.right+"px"):(c.value.style.left=e.left-a.left+"px",c.value.style.right="auto"):"bottom-start"==o.placement?u-n.right+n.width<c.value.offsetWidth?u-n.right+n.width/2>=c.value.offsetWidth/2?(c.value.style.left=n.left-a.left+n.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=u-n.right-a.right+"px"):(c.value.style.left=n.left-a.left+"px",c.value.style.right="auto"):"top-end"==o.placement?e.left+e.width<c.value.offsetWidth?e.left+e.width/2>=c.value.offsetWidth/2?(c.value.style.left=e.left-a.left+e.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left=e.left-a.left+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=u-e.right-a.right+"px"):"bottom-end"==o.placement&&(n.left+n.width<c.value.offsetWidth?n.left+n.width/2>=c.value.offsetWidth/2?(c.value.style.left=n.left-a.left+n.width/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left=n.left-a.left+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=u-n.right-a.right+"px"))),o.showTriangle&&(()=>{const e=window.getSelection();if(e&&e.rangeCount){const t=e.getRangeAt(0).getClientRects();if(t.length){const e=t[0],r=t[t.length-1];"top"==l.value?(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"top-start"==l.value?(d.value.$el.style.left=(s.value.offsetWidth>e.width?e.width:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"top-end"==l.value?(d.value.$el.style.left="auto",d.value.$el.style.right=(s.value.offsetWidth>e.width?e.width:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"bottom"==l.value?(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):"bottom-start"==l.value?(d.value.$el.style.left=(s.value.offsetWidth>r.width?r.width:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):"bottom-end"==l.value?(d.value.$el.style.left="auto",d.value.$el.style.right=(s.value.offsetWidth>r.width?r.width:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=1-d.value.$el.offsetHeight+"px",d.value.$el.style.bottom="auto")}}})()}))}}},g=()=>{const e=m();if(!te.isElement(e))return;l.value=null;const r=te.getElementBounding(e),n=te.getElementBounding(c.value.offsetParent);"top"==o.placement||"top-start"==o.placement||"top-end"==o.placement?r.top>=0&&r.top>=n.top&&r.top>=c.value.offsetHeight?l.value=o.placement:r.bottom>=0&&r.bottom>=n.bottom&&r.bottom>=c.value.offsetHeight&&(l.value="top"==o.placement?"bottom":"top-start"==o.placement?"bottom-start":"bottom-end"):"bottom"!=o.placement&&"bottom-start"!=o.placement&&"bottom-end"!=o.placement||(r.bottom>=0&&r.bottom>=n.bottom&&r.bottom>=c.value.offsetHeight?l.value=o.placement:r.top>=0&&r.top>=n.top&&r.top>=c.value.offsetHeight&&(l.value="bottom"==o.placement?"top":"bottom-start"==o.placement?"top-start":"top-end")),"top"==l.value?r.right+e.offsetWidth/2<c.value.offsetWidth/2?l.value="top-end":r.left+e.offsetWidth/2<c.value.offsetWidth/2&&(l.value="top-start"):"top-start"==l.value?r.right+e.offsetWidth<c.value.offsetWidth&&(r.right+e.offsetWidth/2>=c.value.offsetWidth/2?l.value="top":l.value="top-end"):"top-end"==l.value?r.left+e.offsetWidth<c.value.offsetWidth&&(r.left+e.offsetWidth/2>=c.value.offsetWidth/2?l.value="top":l.value="top-start"):"bottom"==l.value?r.right+e.offsetWidth/2<c.value.offsetWidth/2?l.value="bottom-end":r.left+e.offsetWidth/2<c.value.offsetWidth/2&&(l.value="bottom-start"):"bottom-start"==l.value?r.right+e.offsetWidth<c.value.offsetWidth&&(r.right+e.offsetWidth/2>=c.value.offsetWidth/2?l.value="bottom":l.value="bottom-end"):"bottom-end"==l.value&&r.left+e.offsetWidth<c.value.offsetWidth&&(r.left+e.offsetWidth/2>=c.value.offsetWidth/2?l.value="bottom":l.value="bottom-start"),t.nextTick((()=>{"top"==l.value?(c.value.style.left=r.left-n.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto",c.value.style.top=r.top-n.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"top-start"==l.value?(c.value.style.left=r.left-n.left+"px",c.value.style.right="auto",c.value.style.top=r.top-n.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"top-end"==l.value?(c.value.style.left="auto",c.value.style.right=r.right-n.right+"px",c.value.style.top=r.top-n.top-c.value.offsetHeight+"px",c.value.style.bottom="auto"):"bottom"==l.value?(c.value.style.left=r.left-n.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto",c.value.style.top="auto",c.value.style.bottom=r.bottom-n.bottom-c.value.offsetHeight+"px"):"bottom-start"==l.value?(c.value.style.left=r.left-n.left+"px",c.value.style.right="auto",c.value.style.top="auto",c.value.style.bottom=r.bottom-n.bottom-c.value.offsetHeight+"px"):"bottom-end"==l.value?(c.value.style.left="auto",c.value.style.right=r.right-n.right+"px",c.value.style.top="auto",c.value.style.bottom=r.bottom-n.bottom-c.value.offsetHeight+"px"):(c.value.style.top="auto",c.value.style.bottom=(n.bottom<0?-n.bottom:0)+"px","top"==o.placement||"bottom"==o.placement?r.right+e.offsetWidth/2<c.value.offsetWidth/2?(c.value.style.left="auto",c.value.style.right=r.right-n.right+"px"):r.left+e.offsetWidth/2<c.value.offsetWidth/2?(c.value.style.left=r.left-n.left+"px",c.value.style.right="auto"):(c.value.style.left=r.left-n.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):"top-start"==o.placement||"bottom-start"==o.placement?r.right+e.offsetWidth<c.value.offsetWidth?r.right+e.offsetWidth/2>=c.value.offsetWidth/2?(c.value.style.left=r.left-n.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=r.right-n.right+"px"):(c.value.style.left=r.left-n.left+"px",c.value.style.right="auto"):"top-end"!=o.placement&&"bottom-end"!=o.placement||(r.left+e.offsetWidth<c.value.offsetWidth?r.left+e.offsetWidth/2>=c.value.offsetWidth/2?(c.value.style.left=r.left-n.left+e.offsetWidth/2-c.value.offsetWidth/2+"px",c.value.style.right="auto"):(c.value.style.left=r.left-n.left+"px",c.value.style.right="auto"):(c.value.style.left="auto",c.value.style.right=r.right-n.right+"px"))),o.showTriangle&&(()=>{const e=m();te.isElement(e)&&("top"==l.value?(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"top-start"==l.value?(d.value.$el.style.left=(s.value.offsetWidth>e.offsetWidth?e.offsetWidth:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"top-end"==l.value?(d.value.$el.style.left="auto",d.value.$el.style.right=(s.value.offsetWidth>e.offsetWidth?e.offsetWidth:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.top=s.value.offsetHeight-1+"px",d.value.$el.style.bottom="auto"):"bottom"==l.value?(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):"bottom-start"==l.value?(d.value.$el.style.left=(s.value.offsetWidth>e.offsetWidth?e.offsetWidth:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):"bottom-end"==l.value?(d.value.$el.style.left="auto",d.value.$el.style.right=(s.value.offsetWidth>e.offsetWidth?e.offsetWidth:s.value.offsetWidth)/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.top="auto",d.value.$el.style.bottom=s.value.offsetHeight-1+"px"):(d.value.$el.style.left=s.value.offsetWidth/2-d.value.$el.offsetWidth/2+"px",d.value.$el.style.right="auto",d.value.$el.style.top=1-d.value.$el.offsetHeight+"px",d.value.$el.style.bottom="auto"))})()}))},f=()=>{o.useRange?p():g()},v=e=>{f(),i("show",e)},b=e=>{i("shown",e)},y=e=>{i("hidden",e)},w=()=>{o.modelValue&&i("update:modelValue",!1)},x=e=>{te.isElement(c.value)&&(te.isContains(c.value.offsetParent,e.target)||o.modelValue&&i("update:modelValue",!1))};return t.onMounted((()=>{o.modelValue&&f(),le.on(window,`click.editify_layer_${a.uid}`,x),le.on(window,`resize.editify_layer_${a.uid}`,w)})),t.onBeforeUnmount((()=>{le.off(window,`click.editify_layer_${a.uid} resize.editify_layer_${a.uid}`)})),r({setPosition:f}),(e,r)=>(t.openBlock(),t.createBlock(t.Transition,{name:e.animation?"editify-layer-"+e.animation:"editify-layer",onEnter:v,onAfterEnter:b,onAfterLeave:y},{default:t.withCtx((()=>[e.modelValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:"editify-layer","data-editify-placement":l.value||null,style:t.normalizeStyle({zIndex:e.zIndex}),ref_key:"elRef",ref:c},[e.showTriangle?(t.openBlock(),t.createBlock(Cn,{key:0,color:e.border&&e.borderColor?e.borderColor:e.background,background:e.background,placement:u.value,ref_key:"triangleRef",ref:d},null,8,["color","background","placement"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"wrapRef",ref:s,class:t.normalizeClass(["editify-layer-wrap",{"editify-border":e.border}]),style:t.normalizeStyle(h.value)},[t.renderSlot(e.$slots,"default",{},void 0,!0)],6)],12,Mn)):t.createCommentVNode("",!0)])),_:3},8,["name"]))}}),[["__scopeId","data-v-09578d83"]]),On={content:{type:String,default:""},disabled:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},zn={class:"editify-tooltip-content"},Rn=_n(t.defineComponent({name:"Tooltip",__name:"tooltip",props:On,setup(e){const r=e,n=t.ref(!1),a=t.ref(null),o=()=>{r.disabled||(n.value=!0)},i=()=>{r.disabled||(n.value=!1)};return(e,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-tooltip",{"editify-block":e.block}])},[t.createElementVNode("div",{ref_key:"targetRef",ref:a,class:"editify-tooltip-target",onMouseenter:o,onMouseleave:i},[t.renderSlot(e.$slots,"default",{},void 0,!0)],544),t.createVNode(An,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=e=>n.value=e),node:a.value,border:"","border-color":"#000",background:"#000","show-triangle":"",color:"#fff",placement:"bottom",animation:"fade","z-index":10},{default:t.withCtx((()=>[t.createElementVNode("div",zn,t.toDisplayString(e.content),1)])),_:1},8,["modelValue","node"])],2))}}),[["__scopeId","data-v-7b5e30d1"]]),In={value:{type:String,default:""}},Ln=_n(t.defineComponent({name:"Icon",__name:"icon",props:In,setup:e=>(e,r)=>(t.openBlock(),t.createElementBlock("i",{class:t.normalizeClass(["editify-icon","editify-icon-"+e.value])},null,2))}),[["__scopeId","data-v-6e00035b"]]),Dn={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}},Fn={class:"editify-button"},Pn={key:0,class:"editify-button-slot"},qn={key:1},Hn={key:1,class:"editify-button-options"},$n=["onClick"],Vn={key:1,class:"editify-button-option-flex"},Un=_n(t.defineComponent({name:"Button",__name:"button",props:Dn,emits:["operate","layerShow","layerShown","layerHidden"],setup(e,{expose:r,emit:n}){const a=e,o=n,i=t.ref(!1),l=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.computed((()=>{let e=[],t="",r="";return ae.isObject(a.selectConfig)&&(Array.isArray(a.selectConfig.options)&&(e=a.selectConfig.options.map((e=>ae.isObject(e)?{label:e.label,value:e.value,icon:e.icon,style:e.style}:{label:e,value:e}))),"number"==typeof a.selectConfig.width&&(t=a.selectConfig.width),"number"==typeof a.selectConfig.maxHeight&&(r=a.selectConfig.maxHeight)),{options:e,width:t,maxHeight:r}})),u=t.computed((()=>{let e=[],t="",r="",n="";if(ae.isObject(a.displayConfig)){if("string"!=typeof a.displayConfig.value&&"number"!=typeof a.displayConfig.value||(n=a.displayConfig.value),Array.isArray(a.displayConfig.options)){e=a.displayConfig.options.map((e=>ae.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 a.displayConfig.width&&(t=a.displayConfig.width),"number"==typeof a.displayConfig.maxHeight&&(r=a.displayConfig.maxHeight)}return{options:e,width:t,maxHeight:r,value:n}})),h=t.computed((()=>"select"==a.type?d.value.options:u.value.options)),m=t.computed((()=>{const e=u.value.options.find((e=>e.value==u.value.value));return e?e.label:""})),p=t.computed((()=>a.color?se.hex2rgb(a.color):[])),g=t.computed((()=>{if(a.disabled)return{};if(a.color){if(a.active||"down"==l.value)return{color:a.color,backgroundColor:`rgba(${p.value[0]},${p.value[1]},${p.value[2]},0.15)`};if("hover"==l.value)return{color:`rgba(${p.value[0]},${p.value[1]},${p.value[2]},0.9)`,backgroundColor:`rgba(${p.value[0]},${p.value[1]},${p.value[2]},0.05)`}}return{}})),f=()=>{a.disabled||("default"==a.type?o("operate",a.name):i.value=!i.value)};return r({show:i,status:l}),(e,r)=>(t.openBlock(),t.createElementBlock("div",Fn,[t.createElementVNode("div",{class:t.normalizeClass(["editify-button-wrap",{"editify-right-border":e.rightBorder,"editify-left-border":e.leftBorder}])},[t.createVNode(Rn,{content:e.title,disabled:!e.tooltip},{default:t.withCtx((()=>[t.createElementVNode("div",{ref_key:"btnRef",ref:s,style:t.normalizeStyle(g.value),class:t.normalizeClass(["editify-button-el",{"editify-disabled":e.disabled,"editify-active":e.active}]),onMouseenter:r[0]||(r[0]=e=>l.value="hover"),onMouseleave:r[1]||(r[1]=e=>l.value=null),onMousedown:r[2]||(r[2]=e=>l.value="down"),onMouseup:r[3]||(r[3]=e=>l.value="hover"),onClick:f},["default"==e.type||"select"==e.type?(t.openBlock(),t.createElementBlock("div",Pn,[t.renderSlot(e.$slots,"default",{},void 0,!0)])):"display"==e.type?(t.openBlock(),t.createElementBlock("div",qn,t.toDisplayString(m.value),1)):t.createCommentVNode("",!0),"select"==e.type||"display"==e.type?(t.openBlock(),t.createBlock(Ln,{key:2,value:"caret-down",class:t.normalizeClass(["editify-button-caret",{"editify-rotate":i.value}])},null,8,["class"])):t.createCommentVNode("",!0)],38)])),_:3},8,["content","disabled"]),t.createVNode(An,{ref_key:"layerRef",ref:c,modelValue:i.value,"onUpdate:modelValue":r[4]||(r[4]=e=>i.value=e),node:s.value,border:"",fade:"",placement:"bottom-start","z-index":12,animation:"translate",onShow:r[5]||(r[5]=e=>o("layerShow")),onShown:r[6]||(r[6]=e=>o("layerShown")),onHidden:r[7]||(r[7]=e=>o("layerHidden"))},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"editify-button-layer",style:t.normalizeStyle({width:("select"==e.type?d.value.width:u.value.width)+"px",maxHeight:("select"==e.type?d.value.maxHeight:u.value.maxHeight)+"px",overflow:e.hideScroll?"visible":""})},[e.$slots.layer?t.renderSlot(e.$slots,"layer",{key:0,options:h.value},void 0,!0):(t.openBlock(),t.createElementBlock("div",Hn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,(r=>(t.openBlock(),t.createElementBlock("div",{onClick:e=>(e=>{a.disabled||(o("operate",a.name,e.value),i.value=!1)})(r),class:t.normalizeClass(["editify-button-option",{"editify-active":"display"==e.type&&r.value==u.value.value}]),style:t.normalizeStyle(r.style||"")},[e.$slots.option?t.renderSlot(e.$slots,"option",{key:0,item:r},void 0,!0):(t.openBlock(),t.createElementBlock("div",Vn,[r.icon?(t.openBlock(),t.createBlock(Ln,{key:0,value:r.icon},null,8,["value"])):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(r.label),1)]))],14,$n)))),256))]))],4)])),_:3},8,["modelValue","node"])],2)]))}}),[["__scopeId","data-v-14398008"]]),jn={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=>ae.matchingText(e,"hex")}},Wn=["data-editify-placement","textContent"],Kn=["value","disabled","checked"],Gn=["data-editify-placement","textContent"],Zn=_n(t.defineComponent({name:"Checkbox",__name:"checkbox",props:jn,emits:["update:modelValue","change"],setup(e,{emit:r}){const n=e,a=r,o=t.computed((()=>"boolean"==typeof n.modelValue?n.modelValue:!!Array.isArray(n.modelValue)&&n.modelValue.some((e=>ae.equal(e,n.value))))),i=t.computed((()=>{let e={};return n.color&&o.value&&!n.disabled&&(e.backgroundColor=n.color,e.borderColor=n.color),e})),l=e=>{if(Array.isArray(n.modelValue)){let t=[...n.modelValue];e.target.checked&&!o.value?t.push(n.value):o.value&&(t=t.filter((e=>!ae.equal(e,n.value)))),a("update:modelValue",t),a("change",t)}else"boolean"==typeof n.modelValue&&(a("update:modelValue",e.target.checked),a("change",e.target.checked))};return(e,r)=>(t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["editify-checkbox",{"editify-disabled":e.disabled}])},["left"==e.placement&&e.label?(t.openBlock(),t.createElementBlock("span",{key:0,class:"editify-checkbox-label","data-editify-placement":e.placement,textContent:t.toDisplayString(e.label)},null,8,Wn)):t.createCommentVNode("",!0),t.createElementVNode("input",{onChange:l,value:e.value,disabled:e.disabled,checked:o.value,type:"checkbox"},null,40,Kn),t.createElementVNode("span",{class:t.normalizeClass(["editify-checkbox-item",{"editify-reverse":!e.color,"editify-round":e.round,"editify-checked":o.value&&!e.disabled}]),style:t.normalizeStyle(i.value)},[t.createVNode(Ln,{value:"check",style:t.normalizeStyle({opacity:o.value?"":0})},null,8,["style"])],6),"right"==e.placement&&e.label?(t.openBlock(),t.createElementBlock("span",{key:1,class:"editify-checkbox-label","data-editify-placement":e.placement,textContent:t.toDisplayString(e.label)},null,8,Gn)):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d99c609b"]]),Xn={data:{type:Array,default:function(){return[]}},value:{type:String,default:null},color:{type:String,default:""},tooltip:{type:Boolean,default:!1}},Yn={class:"editify-colors"},Qn={class:"editify-colors-list"},Jn=["onClick"],ea=_n(t.defineComponent({name:"Colors",__name:"colors",props:Xn,emits:["change"],setup(e,{emit:r}){const n=r,a=t.inject("$editTrans"),o=e=>{n("change",e.value)};return(e,r)=>(t.openBlock(),t.createElementBlock("div",Yn,[t.createElementVNode("div",{class:"editify-colors-header",onClick:r[0]||(r[0]=e=>o({value:""}))},[t.createVNode(Ln,{value:"remove"}),t.createElementVNode("span",null,t.toDisplayString(t.unref(a)("defaultColor")),1)]),t.createElementVNode("div",Qn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.data,(r=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-color",{"editify-active":e.value==r.value}]),style:t.normalizeStyle({borderColor:e.value==r.value&&e.color||""})},[t.createVNode(Rn,{block:"",content:r.label,disabled:!e.tooltip},{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:e=>o(r),class:"editify-color-el",style:t.normalizeStyle({background:r.value})},null,12,Jn)])),_:2},1032,["content","disabled"])],6)))),256))])]))}}),[["__scopeId","data-v-dec8d117"]]),ta={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},color:{type:String,default:""}},ra={key:0,class:"editify-toolbar-link"},na={class:"editify-toolbar-link-label"},aa=["placeholder"],oa={class:"editify-toolbar-link-footer"},ia={class:"editify-toolbar-link-operations"},la=["href"],sa=_n(t.defineComponent({name:"Toolbar",__name:"toolbar",props:ta,emits:["update:modelValue"],setup(e,{emit:r}){const n=e,a=r,o=t.inject("editor"),i=t.inject("dataRangeCaches"),l=t.inject("$editTrans"),s=t.ref(null),c=t.ref(null),d=t.ref(null),u=t.ref(null),h=t.ref({url:"",newOpen:!1}),m=t.ref({controls:!1,loop:!1,autoplay:!1,muted:!1}),p=t.ref({show:n.config.codeBlock.languages.show,displayConfig:{options:n.config.codeBlock.languages.options,value:"",width:n.config.codeBlock.languages.width,maxHeight:n.config.codeBlock.languages.maxHeight},leftBorder:n.config.codeBlock.languages.leftBorder,rightBorder:n.config.codeBlock.languages.rightBorder,active:!1,disabled:!1}),g=t.ref({show:n.config.text.heading.show,displayConfig:{options:n.config.text.heading.options,value:"",width:n.config.text.heading.width,maxHeight:n.config.text.heading.maxHeight},defaultValue:n.config.text.heading.defaultValue,leftBorder:n.config.text.heading.leftBorder,rightBorder:n.config.text.heading.rightBorder,active:!1,disabled:!1}),f=t.ref({show:n.config.text.align.show,selectConfig:{options:n.config.text.align.options,width:n.config.text.align.width,maxHeight:n.config.text.align.maxHeight},leftBorder:n.config.text.align.leftBorder,rightBorder:n.config.text.align.rightBorder,active:!1,disabled:!1}),v=t.ref({show:n.config.text.orderList.show,leftBorder:n.config.text.orderList.leftBorder,rightBorder:n.config.text.orderList.rightBorder,active:!1,disabled:!1}),b=t.ref({show:n.config.text.unorderList.show,leftBorder:n.config.text.unorderList.leftBorder,rightBorder:n.config.text.unorderList.rightBorder,active:!1,disabled:!1}),w=t.ref({show:n.config.text.task.show,leftBorder:n.config.text.task.leftBorder,rightBorder:n.config.text.task.rightBorder,active:!1,disabled:!1}),x=t.ref({show:n.config.text.bold.show,leftBorder:n.config.text.bold.leftBorder,rightBorder:n.config.text.bold.rightBorder,active:!1,disabled:!1}),E=t.ref({show:n.config.text.italic.show,leftBorder:n.config.text.italic.leftBorder,rightBorder:n.config.text.italic.rightBorder,active:!1,disabled:!1}),k=t.ref({show:n.config.text.strikethrough.show,leftBorder:n.config.text.strikethrough.leftBorder,rightBorder:n.config.text.strikethrough.rightBorder,active:!1,disabled:!1}),S=t.ref({show:n.config.text.underline.show,leftBorder:n.config.text.underline.leftBorder,rightBorder:n.config.text.underline.rightBorder,active:!1,disabled:!1}),T=t.ref({show:n.config.text.code.show,leftBorder:n.config.text.code.leftBorder,rightBorder:n.config.text.code.rightBorder,active:!1,disabled:!1}),B=t.ref({show:n.config.text.super.show,leftBorder:n.config.text.super.leftBorder,rightBorder:n.config.text.super.rightBorder,active:!1,disabled:!1}),_=t.ref({show:n.config.text.sub.show,leftBorder:n.config.text.sub.leftBorder,rightBorder:n.config.text.sub.rightBorder,active:!1,disabled:!1}),C=t.ref({show:n.config.text.fontSize.show,displayConfig:{options:n.config.text.fontSize.options,value:"",width:n.config.text.fontSize.width,maxHeight:n.config.text.fontSize.maxHeight},defaultValue:n.config.text.fontSize.defaultValue,leftBorder:n.config.text.fontSize.leftBorder,rightBorder:n.config.text.fontSize.rightBorder,active:!1,disabled:!1}),N=t.ref({show:n.config.text.fontFamily.show,displayConfig:{options:n.config.text.fontFamily.options,value:"",width:n.config.text.fontFamily.width,maxHeight:n.config.text.fontFamily.maxHeight},defaultValue:n.config.text.fontFamily.defaultValue,leftBorder:n.config.text.fontFamily.leftBorder,rightBorder:n.config.text.fontFamily.rightBorder,active:!1,disabled:!1}),M=t.ref({show:n.config.text.lineHeight.show,displayConfig:{options:n.config.text.lineHeight.options,value:"",width:n.config.text.lineHeight.width,maxHeight:n.config.text.lineHeight.maxHeight},defaultValue:n.config.text.lineHeight.defaultValue,leftBorder:n.config.text.lineHeight.leftBorder,rightBorder:n.config.text.lineHeight.rightBorder,active:!1,disabled:!1}),A=t.ref({show:n.config.text.foreColor.show,selectConfig:{options:n.config.text.foreColor.options},leftBorder:n.config.text.foreColor.leftBorder,rightBorder:n.config.text.foreColor.rightBorder,value:"",active:!1,disabled:!1}),O=t.ref({show:n.config.text.backColor.show,selectConfig:{options:n.config.text.backColor.options},leftBorder:n.config.text.backColor.leftBorder,rightBorder:n.config.text.backColor.rightBorder,value:"",active:!1,disabled:!1}),z=t.ref({show:n.config.text.formatClear.show,leftBorder:n.config.text.formatClear.leftBorder,rightBorder:n.config.text.formatClear.rightBorder,active:!1,disabled:!1}),R=t.computed({get:()=>n.modelValue,set(e){a("update:modelValue",e)}}),I=e=>{n.color&&(e.currentTarget.style.borderColor=n.color)},L=e=>{e.currentTarget.style.borderColor=""},D=()=>{gn(o.value,i.value),fn(o.value,i.value),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},F=e=>{mn(o.value,i.value,{"background-color":e}),u.value.show=!1,o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},P=e=>{mn(o.value,i.value,{color:e}),d.value.show=!1,o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},q=(e,t)=>{vn(o.value,i.value,t),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},H=(e,t)=>{mn(o.value,i.value,{"font-family":t}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},$=(e,t)=>{mn(o.value,i.value,{"font-size":t}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},V=()=>{Qr(o.value,i.value,"vertical-align","super")?gn(o.value,i.value,["vertical-align"]):mn(o.value,i.value,{"vertical-align":"super"}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},U=()=>{Qr(o.value,i.value,"vertical-align","sub")?gn(o.value,i.value,["vertical-align"]):mn(o.value,i.value,{"vertical-align":"sub"}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},j=()=>{Jr(o.value,i.value,"data-editify-code")?fn(o.value,i.value,["data-editify-code"]):pn(o.value,i.value,{"data-editify-code":!0}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},W=()=>{Qr(o.value,i.value,"text-decoration","underline")||Qr(o.value,i.value,"text-decoration-line","underline")?gn(o.value,i.value,["text-decoration","text-decoration-line"]):mn(o.value,i.value,{"text-decoration":"underline"}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},K=()=>{Qr(o.value,i.value,"text-decoration","line-through")||Qr(o.value,i.value,"text-decoration-line","line-through")?gn(o.value,i.value,["text-decoration","text-decoration-line"]):mn(o.value,i.value,{"text-decoration":"line-through"}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},G=e=>{un(o.value,i.value,"orderList"==e),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},Z=()=>{hn(o.value,i.value),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},X=()=>{Qr(o.value,i.value,"font-style","italic")?gn(o.value,i.value,["font-style"]):mn(o.value,i.value,{"font-style":"italic"}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},Y=()=>{Qr(o.value,i.value,"font-weight","bold")||Qr(o.value,i.value,"font-weight","700")?gn(o.value,i.value,["font-weight"]):mn(o.value,i.value,{"font-weight":"bold"}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},Q=(e,t)=>{on(o.value,i.value,l,t),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},J=(e,t)=>{dn(o.value,i.value,t),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},ee=e=>{const t=o.value.range.anchor.element;m.value[e]?delete t.marks[e]:t.marks[e]=!0,m.value[e]=!m.value[e],o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},te=e=>{const t=o.value.range.anchor.element;if(t){const r={width:e};t.hasStyles()?t.styles=Object.assign(t.styles,r):t.styles=r,o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender(),setTimeout((()=>{s.value.setPosition()}),0)}},re=()=>{if(!h.value.url)return;const e=Fr(o.value,i.value,"a");e&&(e.marks.href=h.value.url,h.value.newOpen?e.marks.target="_blank":delete e.marks.target),o.value.formatElementStack(),o.value.domRender()},ne=()=>{const e=Fr(o.value,i.value,"a");e&&(e.parsedom=y.TEXT_NODE,delete e.marks.target,delete e.marks.href,delete e.marks["data-editify-element"]),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()},oe=(e,t)=>{const r=Fr(o.value,i.value,"pre");r&&(Object.assign(r.marks,{"data-editify-hljs":t}),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender())},ie=(e="up")=>{o.value.range.anchor.isEqual(o.value.range.focus)||(o.value.range.anchor.element=o.value.range.focus.element,o.value.range.anchor.offset=o.value.range.focus.offset);const t=Fr(o.value,i.value,"pre");if(t){const r=new y("block",y.BLOCK_NODE,null,null,null),n=new y("closed","br",null,null,null);o.value.addElementTo(n,r),"up"==e?o.value.addElementBefore(r,t):o.value.addElementAfter(r,t),o.value.range.anchor.moveToEnd(r),o.value.range.focus.moveToEnd(r),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()}},le=(e="left")=>{o.value.range.anchor.isEqual(o.value.range.focus)||(o.value.range.anchor.element=o.value.range.focus.element,o.value.range.anchor.offset=o.value.range.focus.offset);const t=Fr(o.value,i.value,"table"),r=Fr(o.value,i.value,"td"),n=Fr(o.value,i.value,"tbody");if(r&&t&&n){const a=n.children,i=r.parent.children.findIndex((e=>e.isEqual(r)));a.forEach((t=>{const n=r.clone(!1),a=new y("closed","br",null,null,null);o.value.addElementTo(a,n),"left"==e?o.value.addElementTo(n,t,i):o.value.addElementTo(n,t,i+1)}));const l=t.children.find((e=>"colgroup"==e.parsedom)),s=new y("closed","col",null,null,null);if("left"==e?o.value.addElementTo(s,l,i):o.value.addElementTo(s,l,i+1),o.value.formatElementStack(),"left"==e){const e=o.value.getPreviousElement(r);o.value.range.anchor.moveToStart(e),o.value.range.focus.moveToStart(e)}else{const e=o.value.getNextElement(r);o.value.range.anchor.moveToStart(e),o.value.range.focus.moveToStart(e)}o.value.domRender(),o.value.rangeRender()}},se=(e="up")=>{o.value.range.anchor.isEqual(o.value.range.focus)||(o.value.range.anchor.element=o.value.range.focus.element,o.value.range.anchor.offset=o.value.range.focus.offset);const t=Fr(o.value,i.value,"table"),r=Fr(o.value,i.value,"tr");if(t&&r){const t=r.clone();t.children.forEach((e=>{e.children=[];const t=new y("closed","br",null,null,null);o.value.addElementTo(t,e)})),"up"==e?o.value.addElementBefore(t,r):o.value.addElementAfter(t,r),o.value.formatElementStack(),o.value.range.anchor.moveToStart(t),o.value.range.focus.moveToStart(t),o.value.domRender(),o.value.rangeRender(),setTimeout((()=>{s.value.setPosition()}),0)}},ce=(e="up")=>{const t=Fr(o.value,i.value,"table");if(t){const r=new y("block",y.BLOCK_NODE,null,null,null),n=new y("closed","br",null,null,null);o.value.addElementTo(n,r),"up"==e?o.value.addElementBefore(r,t):o.value.addElementAfter(r,t),o.value.range.anchor.moveToEnd(r),o.value.range.focus.moveToEnd(r),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender()}},de=e=>{const t=Fr(o.value,i.value,e);t&&(t.toEmpty(),o.value.formatElementStack(),o.value.domRender(),o.value.rangeRender())},ue=()=>{o.value.range.anchor.isEqual(o.value.range.focus)||(o.value.range.anchor.element=o.value.range.focus.element,o.value.range.anchor.offset=o.value.range.focus.offset);const e=Fr(o.value,i.value,"table"),t=Fr(o.value,i.value,"tr");if(e&&t){if(1==t.parent.children.length)return void de("table");const e=o.value.getPreviousElement(t),r=o.value.getNextElement(t);t.toEmpty(),o.value.formatElementStack(),e?(o.value.range.anchor.moveToEnd(e.children[0]),o.value.range.focus.moveToEnd(e.children[0])):(o.value.range.anchor.moveToEnd(r.children[0]),o.value.range.focus.moveToEnd(r.children[0])),o.value.domRender(),o.value.rangeRender(),setTimeout((()=>{s.value.setPosition()}),0)}},he=()=>{o.value.range.anchor.isEqual(o.value.range.focus)||(o.value.range.anchor.element=o.value.range.focus.element,o.value.range.anchor.offset=o.value.range.focus.offset);const e=Fr(o.value,i.value,"td"),t=Fr(o.value,i.value,"tbody"),r=Fr(o.value,i.value,"table");if(e&&r&&t){const n=t.children;if(1==e.parent.children.length)return void de("table");const a=o.value.getPreviousElement(e),i=o.value.getNextElement(e),l=e.parent.children.findIndex((t=>t.isEqual(e)));n.forEach((e=>{e.children[l].toEmpty()}));r.children.find((e=>"colgroup"==e.parsedom)).children[l].toEmpty(),o.value.formatElementStack(),a?(o.value.range.anchor.moveToEnd(a),o.value.range.focus.moveToEnd(a)):(o.value.range.anchor.moveToEnd(i),o.value.range.focus.moveToEnd(i)),o.value.domRender(),o.value.rangeRender()}},me=()=>{if("codeBlock"==n.type){const e=Fr(o.value,i.value,"pre");e&&(p.value.displayConfig.value=e.marks["data-editify-hljs"]||"")}else if("link"==n.type){const e=Fr(o.value,i.value,"a");e&&(h.value.url=e.marks.href,h.value.newOpen="_blank"==e.marks.target)}else if("video"==n.type){const e=Fr(o.value,i.value,"video");e&&(m.value.autoplay=!!e.marks.autoplay,m.value.loop=!!e.marks.loop,m.value.controls=!!e.marks.controls,m.value.muted=!!e.marks.muted)}else if("text"==n.type){const e=e=>"function"==typeof n.config.extraDisabled&&n.config.extraDisabled(e)||!1,t=g.value.displayConfig.options.find((e=>{let t=e;return ae.isObject(e)&&(t=e.value),i.value.list.every((e=>e.element.isBlock()?e.element.parsedom==t:e.element.getBlock().parsedom==t))}));g.value.displayConfig.value=t?ae.isObject(t)?t.value:t:g.value.defaultValue,g.value.disabled=e("heading"),f.value.disabled=e("align"),v.value.active=Wr(o.value,i.value,!0),v.value.disabled=e("orderList"),b.value.active=Wr(o.value,i.value,!1),b.value.disabled=e("unorderList"),w.value.active=Kr(o.value,i.value),w.value.disabled=e("task"),x.value.active=Qr(o.value,i.value,"font-weight","bold")||Qr(o.value,i.value,"font-weight","700"),x.value.disabled=e("bold"),E.value.active=Qr(o.value,i.value,"font-style","italic"),E.value.disabled=e("italic"),k.value.active=Qr(o.value,i.value,"text-decoration","line-through")||Qr(o.value,i.value,"text-decoration-line","line-through"),k.value.disabled=e("strikethrough"),S.value.active=Qr(o.value,i.value,"text-decoration","underline")||Qr(o.value,i.value,"text-decoration-line","underline"),S.value.disabled=e("underline"),T.value.active=Jr(o.value,i.value,"data-editify-code"),T.value.disabled=e("code"),B.value.active=Qr(o.value,i.value,"vertical-align","super"),B.value.disabled=e("super"),_.value.active=Qr(o.value,i.value,"vertical-align","sub"),_.value.disabled=e("sub");const r=C.value.displayConfig.options.find((e=>ae.isObject(e)?Qr(o.value,i.value,"font-size",e.value):Qr(o.value,i.value,"font-size",e)));C.value.displayConfig.value=r?ae.isObject(r)?r.value:r:C.value.defaultValue,C.value.disabled=e("fontSize");const a=N.value.displayConfig.options.find((e=>ae.isObject(e)?Qr(o.value,i.value,"font-family",e.value):Qr(o.value,i.value,"font-family",e)));N.value.displayConfig.value=a?ae.isObject(a)?a.value:a:N.value.defaultValue,N.value.disabled=e("fontFamily");const l=M.value.displayConfig.options.find((e=>{let t=e;return ae.isObject(e)&&(t=e.value),i.value.list.every((e=>{if(e.element.isBlock()||e.element.isInblock())return e.element.hasStyles()&&e.element.styles["line-height"]==t;const r=e.element.getBlock(),n=e.element.getInblock();return n?n.hasStyles()&&n.styles["line-height"]==t:r.hasStyles()&&r.styles["line-height"]==t}))}));M.value.displayConfig.value=l?ae.isObject(l)?l.value:l:M.value.defaultValue,M.value.disabled=e("lineHeight");const s=A.value.selectConfig.options.find((e=>ae.isObject(e)?Qr(o.value,i.value,"color",e.value):Qr(o.value,i.value,"color",e)));A.value.value=s?ae.isObject(s)?s.value:s:"",A.value.disabled=e("foreColor");const c=O.value.selectConfig.options.find((e=>ae.isObject(e)?Qr(o.value,i.value,"background-color",e.value):Qr(o.value,i.value,"background-color",e)));O.value.value=c?ae.isObject(c)?c.value:c:"",O.value.disabled=e("backColor"),z.value.disabled=e("formatClear")}};return(e,r)=>(t.openBlock(),t.createBlock(An,{modelValue:R.value,"onUpdate:modelValue":r[21]||(r[21]=e=>R.value=e),ref_key:"layerRef",ref:s,node:e.node,border:"",placement:"bottom-start",onShow:me,useRange:"text"==e.type,"z-index":10},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"editify-toolbar",ref_key:"toolbarRef",ref:c,style:t.normalizeStyle(e.config.style)},["link"==e.type?(t.openBlock(),t.createElementBlock("div",ra,[t.createElementVNode("div",na,t.toDisplayString(t.unref(l)("linkAddress")),1),t.withDirectives(t.createElementVNode("input",{onChange:re,onFocus:I,onBlur:L,placeholder:t.unref(l)("linkUrlEnterPlaceholder"),"onUpdate:modelValue":r[0]||(r[0]=e=>h.value.url=e),type:"url"},null,40,aa),[[t.vModelText,h.value.url,void 0,{trim:!0}]]),t.createElementVNode("div",oa,[t.createVNode(Zn,{onChange:re,modelValue:h.value.newOpen,"onUpdate:modelValue":r[1]||(r[1]=e=>h.value.newOpen=e),label:t.unref(l)("newWindowOpen"),color:e.color,size:10},null,8,["modelValue","label","color"]),t.createElementVNode("div",ia,[t.createElementVNode("span",{onClick:ne},t.toDisplayString(t.unref(l)("removeLink")),1),t.createElementVNode("a",{href:h.value.url,target:"_blank",style:t.normalizeStyle({color:e.color||""})},t.toDisplayString(t.unref(l)("viewLink")),13,la)])])])):"image"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(Un,{onOperate:r[2]||(r[2]=e=>te("30%")),name:"set30Width",title:t.unref(l)("width30"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 30% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[3]||(r[3]=e=>te("50%")),name:"set50Width",title:t.unref(l)("width50"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 50% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{rightBorder:"",onOperate:r[4]||(r[4]=e=>te("100%")),name:"set100Width",title:t.unref(l)("width100"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 100% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[5]||(r[5]=e=>te("auto")),name:"setAutoWidth",title:t.unref(l)("auto"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"auto-width"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[6]||(r[6]=e=>de("img")),name:"deleteImage",title:t.unref(l)("deleteImage"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"delete"})])),_:1},8,["title","tooltip","color"])],64)):"video"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createVNode(Un,{onOperate:r[7]||(r[7]=e=>te("30%")),name:"set30Width",title:t.unref(l)("width30"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 30% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[8]||(r[8]=e=>te("50%")),name:"set50Width",title:t.unref(l)("width50"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 50% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[9]||(r[9]=e=>te("100%")),name:"set100Width",title:t.unref(l)("width100"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createTextVNode(" 100% ")])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{rightBorder:"",onOperate:r[10]||(r[10]=e=>te("auto")),name:"setAutoWidth",title:t.unref(l)("auto"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"auto-width"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:ee,name:"autoplay",title:m.value.autoplay?t.unref(l)("disabledAutoplay"):t.unref(l)("autoplay"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:m.value.autoplay?"autoplay":"stop"},null,8,["value"])])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:ee,name:"loop",title:m.value.loop?t.unref(l)("disabledLoop"):t.unref(l)("loop"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:m.value.loop?"loop":"single"},null,8,["value"])])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:ee,name:"muted",title:m.value.muted?t.unref(l)("unmuted"):t.unref(l)("muted"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:m.value.muted?"muted":"unmuted"},null,8,["value"])])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{leftBorder:"",onOperate:ee,name:"controls",title:t.unref(l)("controls"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"controls"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[11]||(r[11]=e=>de("video")),name:"deleteVideo",title:t.unref(l)("deleteVideo"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"delete"})])),_:1},8,["title","tooltip","color"])],64)):"table"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createVNode(Un,{onOperate:r[12]||(r[12]=e=>ce("up")),name:"textWrapUp",title:t.unref(l)("textWrapUp"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"text-wrap",class:"editify-icon-rotate"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[13]||(r[13]=e=>ce("down")),rightBorder:"",name:"textWrapDown",title:t.unref(l)("textWrapDown"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"text-wrap"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[14]||(r[14]=e=>se("up")),name:"insertRowTop",title:t.unref(l)("insertRowTop"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"insert-row-top"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[15]||(r[15]=e=>se("down")),name:"insertRowBottom",title:t.unref(l)("insertRowBottom"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"insert-row-bottom"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:ue,rightBorder:"",name:"deleteRow",title:t.unref(l)("deleteRow"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"delete-row"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[16]||(r[16]=e=>le("left")),name:"insertColumnLeft",title:t.unref(l)("insertColumnLeft"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"insert-column-left"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[17]||(r[17]=e=>le("right")),name:"insertColumnRight",title:t.unref(l)("insertColumnRight"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"insert-column-right"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:he,rightBorder:"",name:"deleteColumn",title:t.unref(l)("deleteColumn"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"delete-column"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[18]||(r[18]=e=>de("table")),name:"deleteTable",title:t.unref(l)("deleteTable"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"delete-table"})])),_:1},8,["title","tooltip","color"])],64)):t.createCommentVNode("",!0),"codeBlock"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createVNode(Un,{onOperate:r[19]||(r[19]=e=>ie("up")),name:"textWrapUp",title:t.unref(l)("textWrapUp"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"text-wrap",class:"editify-icon-rotate"})])),_:1},8,["title","tooltip","color"]),t.createVNode(Un,{onOperate:r[20]||(r[20]=e=>ie("down")),name:"textWrapDown",title:t.unref(l)("textWrapDown"),tooltip:e.config.tooltip,color:e.color},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"text-wrap"})])),_:1},8,["title","tooltip","color"]),p.value.show?(t.openBlock(),t.createBlock(Un,{key:0,name:"languages",type:"display",title:t.unref(l)("selectLanguages"),tooltip:e.config.tooltip,leftBorder:p.value.leftBorder,rightBorder:p.value.rightBorder,"display-config":p.value.displayConfig,color:e.color,active:p.value.active,disabled:p.value.disabled,onOperate:oe},null,8,["title","tooltip","leftBorder","rightBorder","display-config","color","active","disabled"])):t.createCommentVNode("",!0)],64)):"text"==e.type?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[g.value.show?(t.openBlock(),t.createBlock(Un,{key:0,name:"heading",type:"display",title:t.unref(l)("heading"),tooltip:e.config.tooltip,"display-config":g.value.displayConfig,leftBorder:g.value.leftBorder,rightBorder:g.value.rightBorder,color:e.color,active:g.value.active,disabled:g.value.disabled,onOperate:Q},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),f.value.show?(t.openBlock(),t.createBlock(Un,{key:1,name:"align",type:"select",title:t.unref(l)("align"),tooltip:e.config.tooltip,"select-config":f.value.selectConfig,leftBorder:f.value.leftBorder,rightBorder:f.value.rightBorder,color:e.color,active:f.value.active,disabled:f.value.disabled,onOperate:J},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"align-left"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),v.value.show?(t.openBlock(),t.createBlock(Un,{key:2,name:"orderList",title:t.unref(l)("orderList"),tooltip:e.config.tooltip,leftBorder:v.value.leftBorder,rightBorder:v.value.rightBorder,color:e.color,active:v.value.active,disabled:v.value.disabled,onOperate:G},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"list-ordered"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),b.value.show?(t.openBlock(),t.createBlock(Un,{key:3,name:"unorderList",title:t.unref(l)("unorderList"),tooltip:e.config.tooltip,leftBorder:b.value.leftBorder,rightBorder:b.value.rightBorder,color:e.color,active:b.value.active,disabled:b.value.disabled,onOperate:G},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"list-unordered"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),w.value.show?(t.openBlock(),t.createBlock(Un,{key:4,name:"task",title:t.unref(l)("task"),tooltip:e.config.tooltip,leftBorder:w.value.leftBorder,rightBorder:w.value.rightBorder,color:e.color,active:w.value.active,disabled:w.value.disabled,onOperate:Z},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"task"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),x.value.show?(t.openBlock(),t.createBlock(Un,{key:5,name:"bold",title:t.unref(l)("bold"),tooltip:e.config.tooltip,leftBorder:x.value.leftBorder,rightBorder:x.value.rightBorder,color:e.color,active:x.value.active,disabled:x.value.disabled,onOperate:Y},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"bold"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),E.value.show?(t.openBlock(),t.createBlock(Un,{key:6,name:"italic",title:t.unref(l)("italic"),tooltip:e.config.tooltip,leftBorder:E.value.leftBorder,rightBorder:E.value.rightBorder,color:e.color,active:E.value.active,disabled:E.value.disabled,onOperate:X},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"italic"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),k.value.show?(t.openBlock(),t.createBlock(Un,{key:7,name:"strikethrough",title:t.unref(l)("strikethrough"),tooltip:e.config.tooltip,leftBorder:k.value.leftBorder,rightBorder:k.value.rightBorder,color:e.color,active:k.value.active,disabled:k.value.disabled,onOperate:K},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"strikethrough"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),S.value.show?(t.openBlock(),t.createBlock(Un,{key:8,name:"underline",title:t.unref(l)("underline"),tooltip:e.config.tooltip,leftBorder:S.value.leftBorder,rightBorder:S.value.rightBorder,color:e.color,active:S.value.active,disabled:S.value.disabled,onOperate:W},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"underline"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),T.value.show?(t.openBlock(),t.createBlock(Un,{key:9,name:"code",title:t.unref(l)("code"),tooltip:e.config.tooltip,leftBorder:T.value.leftBorder,rightBorder:T.value.rightBorder,color:e.color,active:T.value.active,disabled:T.value.disabled,onOperate:j},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"code"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),B.value.show?(t.openBlock(),t.createBlock(Un,{key:10,name:"superscript",title:t.unref(l)("superscript"),tooltip:e.config.tooltip,leftBorder:B.value.leftBorder,rightBorder:B.value.rightBorder,color:e.color,active:B.value.active,disabled:B.value.disabled,onOperate:V},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"superscript"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),_.value.show?(t.openBlock(),t.createBlock(Un,{key:11,name:"subscript",title:t.unref(l)("subscript"),tooltip:e.config.tooltip,leftBorder:_.value.leftBorder,rightBorder:_.value.rightBorder,color:e.color,active:_.value.active,disabled:_.value.disabled,onOperate:U},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"subscript"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),C.value.show?(t.openBlock(),t.createBlock(Un,{key:12,name:"fontSize",type:"display",title:t.unref(l)("fontSize"),tooltip:e.config.tooltip,"display-config":C.value.displayConfig,leftBorder:C.value.leftBorder,rightBorder:C.value.rightBorder,color:e.color,active:C.value.active,disabled:C.value.disabled,onOperate:$},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),N.value.show?(t.openBlock(),t.createBlock(Un,{key:13,name:"fontFamily",type:"display",title:t.unref(l)("fontFamily"),tooltip:e.config.tooltip,"display-config":N.value.displayConfig,leftBorder:N.value.leftBorder,rightBorder:N.value.rightBorder,color:e.color,active:N.value.active,disabled:N.value.disabled,onOperate:H},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),M.value.show?(t.openBlock(),t.createBlock(Un,{key:14,name:"lineHeight",type:"display",title:t.unref(l)("lineHeight"),tooltip:e.config.tooltip,"display-config":M.value.displayConfig,leftBorder:M.value.leftBorder,rightBorder:M.value.rightBorder,color:e.color,active:M.value.active,disabled:M.value.disabled,onOperate:q},null,8,["title","tooltip","display-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),A.value.show?(t.openBlock(),t.createBlock(Un,{key:15,name:"foreColor",type:"select",title:t.unref(l)("foreColor"),tooltip:e.config.tooltip,"select-config":A.value.selectConfig,leftBorder:A.value.leftBorder,rightBorder:A.value.rightBorder,color:e.color,active:A.value.active,disabled:A.value.disabled,hideScroll:"",ref_key:"foreColorRef",ref:d},{layer:t.withCtx((({options:r})=>[t.createVNode(ea,{tooltip:e.config.tooltip,color:e.color,value:A.value.value,onChange:P,data:r},null,8,["tooltip","color","value","data"])])),default:t.withCtx((()=>[t.createVNode(Ln,{value:"font-color"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),O.value.show?(t.openBlock(),t.createBlock(Un,{key:16,name:"backColor",type:"select",title:t.unref(l)("backColor"),tooltip:e.config.tooltip,"select-config":O.value.selectConfig,leftBorder:O.value.leftBorder,rightBorder:O.value.rightBorder,color:e.color,active:O.value.active,disabled:O.value.disabled,hideScroll:"",ref_key:"backColorRef",ref:u},{layer:t.withCtx((({options:r})=>[t.createVNode(ea,{tooltip:e.config.tooltip,color:e.color,value:O.value.value,onChange:F,data:r},null,8,["tooltip","color","value","data"])])),default:t.withCtx((()=>[t.createVNode(Ln,{value:"brush"})])),_:1},8,["title","tooltip","select-config","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0),z.value.show?(t.openBlock(),t.createBlock(Un,{key:17,name:"formatClear",title:t.unref(l)("formatClear"),tooltip:e.config.tooltip,leftBorder:z.value.leftBorder,rightBorder:z.value.rightBorder,color:e.color,active:z.value.active,disabled:z.value.disabled,onOperate:D},{default:t.withCtx((()=>[t.createVNode(Ln,{value:"format-clear"})])),_:1},8,["title","tooltip","leftBorder","rightBorder","color","active","disabled"])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0)],4)])),_:1},8,["modelValue","node","useRange"]))}}),[["__scopeId","data-v-357be052"]]),ca={color:{type:String,default:""},text:{type:String,default:""}},da={class:"editify-link"},ua={class:"editify-link-label"},ha=["placeholder"],ma=["placeholder"],pa={class:"editify-link-footer"},ga={class:"editify-link-operations"},fa=_n(t.defineComponent({name:"InsertLink",__name:"insertLink",props:ca,emits:["insert"],setup(e,{emit:r}){const n=e,a=r,o=t.inject("$editTrans"),i=t.ref(""),l=t.ref(""),s=t.ref(!1);t.watch((()=>n.text),(e=>{l.value=e}),{immediate:!0});const c=e=>{n.color&&(e.currentTarget.style.borderColor=n.color)},d=e=>{e.currentTarget.style.borderColor=""},u=()=>{a("insert",l.value,i.value,s.value)};return(e,r)=>(t.openBlock(),t.createElementBlock("div",da,[t.createElementVNode("div",ua,t.toDisplayString(t.unref(o)("linkAddress")),1),t.withDirectives(t.createElementVNode("input",{onFocus:c,onBlur:d,placeholder:t.unref(o)("linkTextEnterPlaceholder"),"onUpdate:modelValue":r[0]||(r[0]=e=>l.value=e),type:"text"},null,40,ha),[[t.vModelText,l.value,void 0,{trim:!0}]]),t.withDirectives(t.createElementVNode("input",{onFocus:c,onBlur:d,placeholder:t.unref(o)("linkUrlEnterPlaceholder"),"onUpdate:modelValue":r[1]||(r[1]=e=>i.value=e),type:"url"},null,40,ma),[[t.vModelText,i.value,void 0,{trim:!0}]]),t.createElementVNode("div",pa,[t.createVNode(Zn,{modelValue:s.value,"onUpdate:modelValue":r[2]||(r[2]=e=>s.value=e),label:t.unref(o)("newWindowOpen"),color:e.color,size:10},null,8,["modelValue","label","color"]),t.createElementVNode("div",ga,[t.createElementVNode("span",{style:t.normalizeStyle({color:e.color||""}),onClick:u},t.toDisplayString(t.unref(o)("insertLink")),5)])])]))}}),[["__scopeId","data-v-9f80e392"]]),va={color:{type:String,default:""},allowedFileType:{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}},ba={class:"editify-image"},ya={class:"editify-image-header"},wa={key:0,class:"editify-image-remote"},xa=["placeholder"],Ea={key:1,class:"editify-image-upload"},ka=["multiple"],Sa=_n(t.defineComponent({name:"InsertImage",__name:"insertImage",props:va,emits:["change","insert"],setup(e,{emit:r}){const n=e,a=r,o=t.inject("$editTrans"),i=t.ref("upload"),l=t.ref(""),s=t.computed((()=>e=>i.value==e?{color:n.color}:{})),c=e=>{const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},d=e=>{n.color&&(e.currentTarget.style.borderColor=n.color)},u=e=>{e.currentTarget.style.borderColor=""},h=()=>{a("insert",[l.value])},m=async e=>{const t=e.currentTarget,r=t.files;if(!r||!r.length)return;let o=[];for(let a=0;a<r.length;a++){const e=r[a],t=c(e);!(n.allowedFileType&&Array.isArray(n.allowedFileType)&&n.allowedFileType.length)||n.allowedFileType.some((e=>e.toLocaleLowerCase()==t.toLocaleLowerCase()))?n.maxSize&&e.size/1024>n.maxSize?"function"==typeof n.handleError&&n.handleError("maxSizeError",e):n.minSize&&e.size/1024<n.minSize?"function"==typeof n.handleError&&n.handleError("minSizeError",e):o.push(e):"function"==typeof n.handleError&&n.handleError("suffixError",e)}if(o.length){let e=[];if("function"==typeof n.customUpload)e=await n.customUpload(o)||[];else for(let t=0;t<o.length;t++){const r=await ce.dataFileToBase64(o[t]);e.push(r)}a("insert",e)}t.value=""};return t.watch((()=>i.value),(()=>{a("change")})),(e,r)=>(t.openBlock(),t.createElementBlock("div",ba,[t.createElementVNode("div",ya,[t.createElementVNode("div",{onClick:r[0]||(r[0]=e=>i.value="upload"),class:t.normalizeClass(["editify-image-header-item",{"editify-active":"upload"==i.value}]),style:t.normalizeStyle(s.value("upload"))},t.toDisplayString(t.unref(o)("uploadImage")),7),t.createElementVNode("div",{onClick:r[1]||(r[1]=e=>i.value="remote"),class:t.normalizeClass(["editify-image-header-item",{"editify-active":"remote"==i.value}]),style:t.normalizeStyle(s.value("remote"))},t.toDisplayString(t.unref(o)("remoteImage")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-image-header-slider","editify-"+i.value]),style:t.normalizeStyle({backgroundColor:e.color||""})},null,6)]),"remote"==i.value?(t.openBlock(),t.createElementBlock("div",wa,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":r[2]||(r[2]=e=>l.value=e),placeholder:t.unref(o)("imageUrlPlaceholder"),onBlur:u,onFocus:d},null,40,xa),[[t.vModelText,l.value,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-image-remote-footer",style:t.normalizeStyle({color:e.color||""})},[t.createElementVNode("span",{onClick:h},t.toDisplayString(t.unref(o)("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",Ea,[t.createVNode(Ln,{value:"upload"}),t.createElementVNode("input",{multiple:e.multiple,accept:"image/*",onChange:m,type:"file"},null,40,ka)]))]))}}),[["__scopeId","data-v-b63a5bff"]]),Ta={color:{type:String,default:""},allowedFileType:{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}},Ba={class:"editify-video"},_a={class:"editify-video-header"},Ca={key:0,class:"editify-video-remote"},Na=["placeholder"],Ma={key:1,class:"editify-video-upload"},Aa=["multiple"],Oa=_n(t.defineComponent({name:"InsertVideo",__name:"insertVideo",props:Ta,emits:["change","insert"],setup(e,{emit:r}){const n=e,a=r,o=t.inject("$editTrans"),i=t.ref("upload"),l=t.ref(""),s=t.computed((()=>e=>i.value==e?{color:n.color}:{})),c=e=>{const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},d=e=>{n.color&&(e.currentTarget.style.borderColor=n.color)},u=e=>{e.currentTarget.style.borderColor=""},h=()=>{a("insert",[l.value])},m=async e=>{const t=e.currentTarget,r=t.files;if(!r||!r.length)return;let o=[];for(let a=0;a<r.length;a++){const e=r[a],t=c(e);!(n.allowedFileType&&Array.isArray(n.allowedFileType)&&n.allowedFileType.length)||n.allowedFileType.some((e=>e.toLocaleLowerCase()==t.toLocaleLowerCase()))?n.maxSize&&e.size/1024>n.maxSize?"function"==typeof n.handleError&&n.handleError("maxSizeError",e):n.minSize&&e.size/1024<n.minSize?"function"==typeof n.handleError&&n.handleError("minSizeError",e):o.push(e):"function"==typeof n.handleError&&n.handleError("suffixError",e)}if(o.length){let e=[];if("function"==typeof n.customUpload)e=await n.customUpload(o)||[];else for(let t=0;t<o.length;t++){const r=await ce.dataFileToBase64(o[t]);e.push(r)}a("insert",e)}t.value=""};return t.watch((()=>i.value),(()=>{a("change")})),(e,r)=>(t.openBlock(),t.createElementBlock("div",Ba,[t.createElementVNode("div",_a,[t.createElementVNode("div",{onClick:r[0]||(r[0]=e=>i.value="upload"),class:t.normalizeClass(["editify-video-header-item",{"editify-active":"upload"==i.value}]),style:t.normalizeStyle(s.value("upload"))},t.toDisplayString(t.unref(o)("uploadVideo")),7),t.createElementVNode("div",{onClick:r[1]||(r[1]=e=>i.value="remote"),class:t.normalizeClass(["editify-video-header-item",{"editify-active":"remote"==i.value}]),style:t.normalizeStyle(s.value("remote"))},t.toDisplayString(t.unref(o)("remoteVideo")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-video-header-slider","editify-"+i.value]),style:t.normalizeStyle({backgroundColor:e.color||""})},null,6)]),"remote"==i.value?(t.openBlock(),t.createElementBlock("div",Ca,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":r[2]||(r[2]=e=>l.value=e),placeholder:t.unref(o)("videoUrlPlaceholder"),onBlur:u,onFocus:d},null,40,Na),[[t.vModelText,l.value,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-video-remote-footer",style:t.normalizeStyle({color:e.color||""})},[t.createElementVNode("span",{onClick:h},t.toDisplayString(t.unref(o)("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",Ma,[t.createVNode(Ln,{value:"upload"}),t.createElementVNode("input",{multiple:e.multiple,accept:"video/*",onChange:m,type:"file"},null,40,Aa)]))]))}}),[["__scopeId","data-v-4383bae9"]]),za={color:{type:String,default:""},maxRows:{type:Number,default:10},maxColumns:{type:Number,default:10}},Ra={class:"editify-table"},Ia=["onMouseenter","onClick"],La=[(e=>(t.pushScopeId("data-v-9a40c4f5"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("span",null,null,-1)))],Da={class:"editify-table-footer"},Fa={key:0},Pa={key:1},qa=_n(t.defineComponent({name:"InsertTable",__name:"insertTable",props:za,emits:["insert"],setup(e,{emit:r}){const n=e,a=r,o=t.inject("$editTrans"),i=t.ref((()=>{const e=[];for(let t=1;t<=n.maxRows;t++){let r=[];for(let e=1;e<=n.maxColumns;e++)r.push({x:t,y:e,inside:!1});e.push(r)}return e})()),l=t.computed((()=>i.value.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]));return(e,r)=>(t.openBlock(),t.createElementBlock("div",Ra,[t.createElementVNode("table",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,(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({"editify-inside":e.inside}),onMouseenter:t=>(e=>{for(let t in i.value){const r=i.value[t];for(let n in r)r[n].x<=e.x&&r[n].y<=e.y?i.value[t][n].inside=!0:i.value[t][n].inside=!1}})(e),onClick:t=>{var r;a("insert",(r=e).x,r.y)}},La,42,Ia)))),256))])))),256))]),t.createElementVNode("div",Da,[l.value?(t.openBlock(),t.createElementBlock("span",Fa,t.toDisplayString(l.value.x)+" x "+t.toDisplayString(l.value.y),1)):(t.openBlock(),t.createElementBlock("span",Pa,t.toDisplayString(t.unref(o)("insertTable")),1))])]))}}),[["__scopeId","data-v-9a40c4f5"]]),Ha={config:{type:Object,default:null},color:{type:String,default:""}},$a=["data-editify-mode"],Va=_n(t.defineComponent({name:"Menu",__name:"menu",props:Ha,setup(e,{expose:r}){const n=e,a=t.inject("$editTrans"),o=t.inject("editify"),i=t.inject("isSourceView"),l=t.inject("isFullScreen"),s=t.inject("canUseMenu"),c=t.inject("editor"),d=t.inject("dataRangeCaches"),u=t.inject("showBorder"),h=t.inject("pluginResultList"),m=t.ref({show:n.config.undo.show,leftBorder:n.config.undo.leftBorder,rightBorder:n.config.undo.rightBorder,active:!1,disabled:!1}),p=t.ref({show:n.config.redo.show,leftBorder:n.config.redo.leftBorder,rightBorder:n.config.redo.rightBorder,active:!1,disabled:!1}),g=t.ref({show:n.config.heading.show,displayConfig:{options:n.config.heading.options,value:"",width:n.config.heading.width,maxHeight:n.config.heading.maxHeight},defaultValue:n.config.heading.defaultValue,leftBorder:n.config.heading.leftBorder,rightBorder:n.config.heading.rightBorder,active:!1,disabled:!1}),f=t.ref({show:n.config.indent.show,selectConfig:{options:n.config.indent.options,value:"",width:n.config.indent.width,maxHeight:n.config.indent.maxHeight},leftBorder:n.config.indent.leftBorder,rightBorder:n.config.indent.rightBorder,active:!1,disabled:!1}),v=t.ref({show:n.config.quote.show,leftBorder:n.config.quote.leftBorder,rightBorder:n.config.quote.rightBorder,active:!1,disabled:!1}),b=t.ref({show:n.config.separator.show,leftBorder:n.config.separator.leftBorder,rightBorder:n.config.separator.rightBorder,active:!1,disabled:!1}),w=t.ref({show:n.config.align.show,selectConfig:{options:n.config.align.options,width:n.config.align.width,maxHeight:n.config.align.maxHeight},leftBorder:n.config.align.leftBorder,rightBorder:n.config.align.rightBorder,active:!1,disabled:!1}),x=t.ref({show:n.config.orderList.show,leftBorder:n.config.orderList.leftBorder,rightBorder:n.config.orderList.rightBorder,active:!1,disabled:!1}),E=t.ref({show:n.config.unorderList.show,leftBorder:n.config.unorderList.leftBorder,rightBorder:n.config.unorderList.rightBorder,active:!1,disabled:!1}),k=t.ref({show:n.config.task.show,leftBorder:n.config.task.leftBorder,rightBorder:n.config.task.rightBorder,active:!1,disabled:!1}),S=t.ref({show:n.config.bold.show,leftBorder:n.config.bold.leftBorder,rightBorder:n.config.bold.rightBorder,active:!1,disabled:!1}),T=t.ref({show:n.config.underline.show,leftBorder:n.config.underline.leftBorder,rightBorder:n.config.underline.rightBorder,active:!1,disabled:!1}),B=t.ref({show:n.config.italic.show,leftBorder:n.config.italic.leftBorder,rightBorder:n.config.italic.rightBorder,active:!1,disabled:!1}),_=t.ref({show:n.config.strikethrough.show,leftBorder:n.config.strikethrough.leftBorder,rightBorder:n.config.strikethrough.rightBorder,active:!1,disabled:!1}),C=t.ref({show:n.config.code.show,leftBorder:n.config.code.leftBorder,rightBorder:n.config.code.rightBorder,active:!1,disabled:!1}),N=t.ref({show:n.config.super.show,leftBorder:n.config.super.leftBorder,rightBorder:n.config.super.rightBorder,active:!1,disabled:!1}),M=t.ref({show:n.config.sub.show,leftBorder:n.config.sub.leftBorder,rightBorder:n.config.sub.rightBorder,active:!1,disabled:!1}),A=t.ref({show:n.config.formatClear.show,leftBorder:n.config.formatClear.leftBorder,rightBorder:n.config.formatClear.rightBorder,active:!1,disabled:!1}),O=t.ref({show:n.config.fontSize.show,displayConfig:{options:n.config.fontSize.options,value:"",width:n.config.fontSize.width,maxHeight:n.config.fontSize.maxHeight},defaultValue:n.config.fontSize.defaultValue,leftBorder:n.config.fontSize.leftBorder,rightBorder:n.config.fontSize.rightBorder,active:!1,disabled:!1}),z=t.ref({show:n.config.fontFamily.show,displayConfig:{options:n.config.fontFamily.options,value:"",width:n.config.fontFamily.width,maxHeight:n.config.fontFamily.maxHeight},defaultValue:n.config.fontFamily.defaultValue,leftBorder:n.config.fontFamily.leftBorder,rightBorder:n.config.fontFamily.rightBorder,active:!1,disabled:!1}),R=t.ref({show:n.config.lineHeight.show,displayConfig:{options:n.config.lineHeight.options,value:"",width:n.config.lineHeight.width,maxHeight:n.config.lineHeight.maxHeight},defaultValue:n.config.lineHeight.defaultValue,leftBorder:n.config.lineHeight.leftBorder,rightBorder:n.config.lineHeight.rightBorder,active:!1,disabled:!1}),I=t.ref({show:n.config.foreColor.show,selectConfig:{options:n.config.foreColor.options},leftBorder:n.config.foreColor.leftBorder,rightBorder:n.config.foreColor.rightBorder,value:"",active:!1,disabled:!1}),L=t.ref({show:n.config.backColor.show,selectConfig:{options:n.config.backColor.options},leftBorder:n.config.backColor.leftBorder,rightBorder:n.config.backColor.rightBorder,value:"",active:!1,disabled:!1}),D=t.ref({show:n.config.link.show,leftBorder:n.config.link.leftBorder,rightBorder:n.config.link.rightBorder,active:!1,disabled:!1,text:""}),F=t.ref({show:n.config.image.show,leftBorder:n.config.image.leftBorder,rightBorder:n.config.image.rightBorder,active:!1,disabled:!1,allowedFileType:n.config.image.allowedFileType,multiple:n.config.image.multiple,maxSize:n.config.image.maxSize,minSize:n.config.image.minSize,handleError:n.config.image.handleError,customUpload:n.config.image.customUpload}),P=t.ref({show:n.config.video.show,leftBorder:n.config.video.leftBorder,rightBorder:n.config.video.rightBorder,active:!1,disabled:!1,allowedFileType:n.config.video.allowedFileType,multiple:n.config.video.multiple,maxSize:n.config.video.maxSize,minSize:n.config.video.minSize,handleError:n.config.video.handleError,customUpload:n.config.video.customUpload}),q=t.ref({show:n.config.table.show,leftBorder:n.config.table.leftBorder,rightBorder:n.config.table.rightBorder,active:!1,disabled:!1,maxRows:n.config.table.maxRows,maxColumns:n.config.table.maxColumns}),H=t.ref({show:n.config.codeBlock.show,leftBorder:n.config.codeBlock.leftBorder,rightBorder:n.config.codeBlock.rightBorder,active:!1,disabled:!1}),$=t.ref({show:n.config.sourceView.show,leftBorder:n.config.sourceView.leftBorder,rightBorder:n.config.sourceView.rightBorder,active:!1,disabled:!1}),V=t.ref({show:n.config.fullScreen.show,leftBorder:n.config.fullScreen.leftBorder,rightBorder:n.config.fullScreen.rightBorder,active:!1,disabled:!1}),U=t.computed((()=>o.props.disabled||!s.value)),j=t.computed((()=>{let e={};return h.value.forEach((t=>{t.menu&&(e[t.name]=t.menu.sequence)})),e=zr(e,n.config.sequence),Object.keys(e).sort(((t,r)=>e[t]>e[r]?1:-1))})),W=t.computed((()=>e=>"sourceView"!=e&&"fullScreen"!=e&&i.value)),K=t.computed((()=>(l.value||o.props.autoheight)&&"fixed"==n.config.mode?"default":n.config.mode)),G=t.computed((()=>"fixed"!=K.value&&u.value)),Z=t.computed((()=>{let e={};return h.value.forEach((t=>{t.menu&&(e[t.name]=t.menu.extend)})),zr(e,n.config.extends)})),X=(e,t)=>{if(!U.value&&c.value.range)if("undo"==e)o.exposed.undo();else if("redo"==e)o.exposed.redo();else if("heading"==e)on(c.value,d.value,a,t),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("indent"==e)"indent-increase"==t?ln(c.value,d.value):"indent-decrease"==t&&sn(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("quote"==e)cn(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("separator"==e)(e=>{if(!e.range)return;const t=new y("closed","hr",null,null,null);e.insertElement(t),e.range.anchor.moveToEnd(t),e.range.focus.moveToEnd(t)})(c.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("align"==e)dn(c.value,d.value,t),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("orderList"==e)un(c.value,d.value,!0),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("unorderList"==e)un(c.value,d.value,!1),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("task"==e)hn(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("bold"==e)Qr(c.value,d.value,"font-weight","bold")||Qr(c.value,d.value,"font-weight","700")?gn(c.value,d.value,["font-weight"]):mn(c.value,d.value,{"font-weight":"bold"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("underline"==e)Qr(c.value,d.value,"text-decoration","underline")||Qr(c.value,d.value,"text-decoration-line","underline")?gn(c.value,d.value,["text-decoration","text-decoration-line"]):mn(c.value,d.value,{"text-decoration":"underline"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("italic"==e)Qr(c.value,d.value,"font-style","italic")?gn(c.value,d.value,["font-style"]):mn(c.value,d.value,{"font-style":"italic"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("strikethrough"==e)Qr(c.value,d.value,"text-decoration","line-through")||Qr(c.value,d.value,"text-decoration-line","line-through")?gn(c.value,d.value,["text-decoration","text-decoration-line"]):mn(c.value,d.value,{"text-decoration":"line-through"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("code"==e)Jr(c.value,d.value,"data-editify-code")?fn(c.value,d.value,["data-editify-code"]):pn(c.value,d.value,{"data-editify-code":!0}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("super"==e)Qr(c.value,d.value,"vertical-align","super")?gn(c.value,d.value,["vertical-align"]):mn(c.value,d.value,{"vertical-align":"super"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("sub"==e)Qr(c.value,d.value,"vertical-align","sub")?gn(c.value,d.value,["vertical-align"]):mn(c.value,d.value,{"vertical-align":"sub"}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("formatClear"==e)gn(c.value,d.value),fn(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("fontSize"==e)mn(c.value,d.value,{"font-size":t}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("fontFamily"==e)mn(c.value,d.value,{"font-family":t}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("lineHeight"==e)vn(c.value,d.value,t),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("foreColor"==e)mn(c.value,d.value,{color:t}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("backColor"==e)mn(c.value,d.value,{"background-color":t}),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender();else if("link"==e){if(!t.url)return;bn(c.value,t.text,t.url,t.newOpen),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()}else if("image"==e){if(!t)return;const e=t.filter((e=>!!e));if(0==e.length)return;e.forEach((e=>{yn(c.value,e)})),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()}else if("video"==e){if(!t)return;const e=t.filter((e=>!!e));if(0==e.length)return;e.forEach((e=>{wn(c.value,e)})),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()}else"table"==e?(xn(c.value,t.row,t.column),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()):"codeBlock"==e?(En(c.value,d.value),c.value.formatElementStack(),c.value.domRender(),c.value.rangeRender()):"sourceView"==e?(i.value=!i.value,$.value.active=i.value,i.value||c.value.rangeRender()):"fullScreen"==e&&(l.value=!l.value,V.value.active=l.value,c.value.rangeRender())},Y=t.defineComponent((e=>{const r=t.getCurrentInstance(),o={tooltip:n.config.tooltip,name:e.name};return()=>{if("undo"==o.name&&m.value.show)return t.h(Un,{...o,title:a("undo"),leftBorder:m.value.leftBorder,rightBorder:m.value.rightBorder,disabled:m.value.disabled||e.disabled||U.value,color:n.color,active:m.value.active,onOperate:X},(()=>t.h(Ln,{value:"undo"})));if("redo"==o.name&&p.value.show)return t.h(Un,{...o,title:a("redo"),leftBorder:p.value.leftBorder,rightBorder:p.value.rightBorder,disabled:p.value.disabled||e.disabled||U.value,color:n.color,active:p.value.active,onOperate:X},(()=>t.h(Ln,{value:"redo"})));if("heading"==o.name&&g.value.show)return t.h(Un,{...o,type:"display",displayConfig:g.value.displayConfig,title:a("heading"),leftBorder:g.value.leftBorder,rightBorder:g.value.rightBorder,color:n.color,disabled:g.value.disabled||e.disabled||U.value,active:g.value.active,onOperate:X});if("indent"==o.name&&f.value.show)return t.h(Un,{...o,type:"select",selectConfig:f.value.selectConfig,title:a("indent"),leftBorder:f.value.leftBorder,rightBorder:f.value.rightBorder,color:n.color,disabled:f.value.disabled||e.disabled||U.value,active:f.value.active,onOperate:X},(()=>t.h(Ln,{value:"indent-increase"})));if("quote"==o.name&&v.value.show)return t.h(Un,{...o,title:a("quote"),leftBorder:v.value.leftBorder,rightBorder:v.value.rightBorder,color:n.color,disabled:v.value.disabled||e.disabled||U.value,active:v.value.active,onOperate:X},(()=>t.h(Ln,{value:"quote"})));if("separator"==o.name&&b.value.show)return t.h(Un,{...o,title:a("separator"),leftBorder:b.value.leftBorder,rightBorder:b.value.rightBorder,color:n.color,disabled:b.value.disabled||e.disabled||U.value,active:b.value.active,onOperate:X},(()=>t.h(Ln,{value:"separator"})));if("align"==o.name&&w.value.show)return t.h(Un,{...o,type:"select",selectConfig:w.value.selectConfig,title:a("align"),leftBorder:w.value.leftBorder,rightBorder:w.value.rightBorder,color:n.color,disabled:w.value.disabled||e.disabled||U.value,active:w.value.active,onOperate:X},(()=>t.h(Ln,{value:"align-left"})));if("orderList"==o.name&&x.value.show)return t.h(Un,{...o,title:a("orderList"),leftBorder:x.value.leftBorder,rightBorder:x.value.rightBorder,color:n.color,disabled:x.value.disabled||e.disabled||U.value,active:x.value.active,onOperate:X},(()=>t.h(Ln,{value:"list-ordered"})));if("unorderList"==o.name&&E.value.show)return t.h(Un,{...o,title:a("unorderList"),leftBorder:E.value.leftBorder,rightBorder:E.value.rightBorder,color:n.color,disabled:E.value.disabled||e.disabled||U.value,active:E.value.active,onOperate:X},(()=>t.h(Ln,{value:"list-unordered"})));if("task"==o.name&&k.value.show)return t.h(Un,{...o,title:a("task"),leftBorder:k.value.leftBorder,rightBorder:k.value.rightBorder,color:n.color,disabled:k.value.disabled||e.disabled||U.value,active:k.value.active,onOperate:X},(()=>t.h(Ln,{value:"task"})));if("bold"==o.name&&S.value.show)return t.h(Un,{...o,title:a("bold"),leftBorder:S.value.leftBorder,rightBorder:S.value.rightBorder,color:n.color,disabled:S.value.disabled||e.disabled||U.value,active:S.value.active,onOperate:X},(()=>t.h(Ln,{value:"bold"})));if("underline"==o.name&&T.value.show)return t.h(Un,{...o,title:a("underline"),leftBorder:T.value.leftBorder,rightBorder:T.value.rightBorder,color:n.color,disabled:T.value.disabled||e.disabled||U.value,active:T.value.active,onOperate:X},(()=>t.h(Ln,{value:"underline"})));if("italic"==o.name&&B.value.show)return t.h(Un,{...o,title:a("italic"),leftBorder:B.value.leftBorder,rightBorder:B.value.rightBorder,color:n.color,disabled:B.value.disabled||e.disabled||U.value,active:B.value.active,onOperate:X},(()=>t.h(Ln,{value:"italic"})));if("strikethrough"==o.name&&_.value.show)return t.h(Un,{...o,title:a("strikethrough"),leftBorder:_.value.leftBorder,rightBorder:_.value.rightBorder,color:n.color,disabled:_.value.disabled||e.disabled||U.value,active:_.value.active,onOperate:X},(()=>t.h(Ln,{value:"strikethrough"})));if("code"==o.name&&C.value.show)return t.h(Un,{...o,title:a("code"),leftBorder:C.value.leftBorder,rightBorder:C.value.rightBorder,color:n.color,disabled:C.value.disabled||e.disabled||U.value,active:C.value.active,onOperate:X},(()=>t.h(Ln,{value:"code"})));if("super"==o.name&&N.value.show)return t.h(Un,{...o,title:a("superscript"),leftBorder:N.value.leftBorder,rightBorder:N.value.rightBorder,color:n.color,disabled:N.value.disabled||e.disabled||U.value,active:N.value.active,onOperate:X},(()=>t.h(Ln,{value:"superscript"})));if("sub"==o.name&&M.value.show)return t.h(Un,{...o,title:a("subscript"),leftBorder:M.value.leftBorder,rightBorder:M.value.rightBorder,color:n.color,disabled:M.value.disabled||e.disabled||U.value,active:M.value.active,onOperate:X},(()=>t.h(Ln,{value:"subscript"})));if("formatClear"==o.name&&A.value.show)return t.h(Un,{...o,title:a("formatClear"),leftBorder:A.value.leftBorder,rightBorder:A.value.rightBorder,color:n.color,disabled:A.value.disabled||e.disabled||U.value,active:A.value.active,onOperate:X},(()=>t.h(Ln,{value:"format-clear"})));if("fontSize"==o.name&&O.value.show)return t.h(Un,{...o,type:"display",displayConfig:O.value.displayConfig,title:a("fontSize"),leftBorder:O.value.leftBorder,rightBorder:O.value.rightBorder,color:n.color,disabled:O.value.disabled||e.disabled||U.value,active:O.value.active,onOperate:X});if("fontFamily"==o.name&&z.value.show)return t.h(Un,{...o,type:"display",displayConfig:z.value.displayConfig,title:a("fontFamily"),leftBorder:z.value.leftBorder,rightBorder:z.value.rightBorder,color:n.color,disabled:z.value.disabled||e.disabled||U.value,active:z.value.active,onOperate:X});if("lineHeight"==o.name&&R.value.show)return t.h(Un,{...o,type:"display",displayConfig:R.value.displayConfig,title:a("lineHeight"),leftBorder:R.value.leftBorder,rightBorder:R.value.rightBorder,color:n.color,disabled:R.value.disabled||e.disabled||U.value,active:R.value.active,onOperate:X});if("foreColor"==o.name&&I.value.show)return t.h(Un,{...o,ref:"btnRef",type:"select",selectConfig:I.value.selectConfig,title:a("foreColor"),leftBorder:I.value.leftBorder,rightBorder:I.value.rightBorder,color:n.color,disabled:I.value.disabled||e.disabled||U.value,active:I.value.active,hideScroll:!0},{default:()=>t.h(Ln,{value:"font-color"}),layer:e=>t.h(ea,{tooltip:n.config.tooltip,value:I.value.value,data:e.options,color:n.color,onChange:e=>{X("foreColor",e);r.proxy.$refs.btnRef.show=!1}})});if("backColor"==o.name&&L.value.show)return t.h(Un,{...o,type:"select",ref:"btnRef",selectConfig:L.value.selectConfig,title:a("backColor"),leftBorder:L.value.leftBorder,rightBorder:L.value.rightBorder,color:n.color,disabled:L.value.disabled||e.disabled||U.value,active:L.value.active,onOperate:X,hideScroll:!0},{default:()=>t.h(Ln,{value:"brush"}),layer:e=>t.h(ea,{tooltip:n.config.tooltip,value:L.value.value,data:e.options,color:n.color,onChange:e=>{X("backColor",e);r.proxy.$refs.btnRef.show=!1}})});if("link"==o.name&&D.value.show)return t.h(Un,{...o,type:"select",ref:"btnRef",title:a("insertLink"),leftBorder:D.value.leftBorder,rightBorder:D.value.rightBorder,color:n.color,disabled:D.value.disabled||e.disabled||U.value,active:D.value.active,hideScroll:!0,onLayerShow:()=>{D.value.text=en(d.value)}},{default:()=>t.h(Ln,{value:"link"}),layer:()=>t.h(fa,{color:n.color,text:D.value.text,onInsert:(e,t,n)=>{X("link",{text:e,url:t,newOpen:n});r.proxy.$refs.btnRef.show=!1}})});if("image"==o.name&&F.value.show)return t.h(Un,{...o,type:"select",ref:"btnRef",title:a("insertImage"),leftBorder:F.value.leftBorder,rightBorder:F.value.rightBorder,color:n.color,disabled:F.value.disabled||e.disabled||U.value,active:F.value.active,hideScroll:!0},{default:()=>t.h(Ln,{value:"image"}),layer:()=>t.h(Sa,{color:n.color,allowedFileType:F.value.allowedFileType,multiple:F.value.multiple,maxSize:F.value.maxSize,minSize:F.value.minSize,customUpload:F.value.customUpload,handleError:F.value.handleError,onChange:()=>{r.proxy.$refs.btnRef.$refs.layerRef.setPosition()},onInsert:e=>{X("image",e);r.proxy.$refs.btnRef.show=!1}})});if("video"==o.name&&P.value.show)return t.h(Un,{...o,type:"select",ref:"btnRef",title:a("insertVideo"),leftBorder:P.value.leftBorder,rightBorder:P.value.rightBorder,color:n.color,disabled:P.value.disabled||e.disabled||U.value,active:P.value.active,hideScroll:!0},{default:()=>t.h(Ln,{value:"video"}),layer:()=>t.h(Oa,{color:n.color,allowedFileType:P.value.allowedFileType,multiple:P.value.multiple,maxSize:P.value.maxSize,minSize:P.value.minSize,customUpload:P.value.customUpload,handleError:P.value.handleError,onChange:()=>{r.proxy.$refs.btnRef.$refs.layerRef.setPosition()},onInsert:e=>{X("video",e);r.proxy.$refs.btnRef.show=!1}})});if("table"==o.name&&q.value.show)return t.h(Un,{...o,type:"select",ref:"btnRef",title:a("insertTable"),leftBorder:q.value.leftBorder,rightBorder:q.value.rightBorder,color:n.color,disabled:q.value.disabled||e.disabled||U.value,active:q.value.active,hideScroll:!0},{default:()=>t.h(Ln,{value:"table"}),layer:()=>t.h(qa,{color:n.color,maxRows:q.value.maxRows,maxColumns:q.value.maxColumns,onInsert:(e,t)=>{X("table",{row:e,column:t});r.proxy.$refs.btnRef.show=!1}})});if("codeBlock"==o.name&&H.value.show)return t.h(Un,{...o,title:a("inserCodeBlock"),leftBorder:H.value.leftBorder,rightBorder:H.value.rightBorder,color:n.color,disabled:H.value.disabled||e.disabled||U.value,active:H.value.active,onOperate:X},(()=>t.h(Ln,{value:"code-block"})));if("sourceView"==o.name&&$.value.show)return t.h(Un,{...o,title:a("sourceView"),leftBorder:$.value.leftBorder,rightBorder:$.value.rightBorder,color:n.color,disabled:$.value.disabled||e.disabled||U.value,active:$.value.active,onOperate:X},(()=>t.h(Ln,{value:"source-view"})));if("fullScreen"==o.name&&V.value.show)return t.h(Un,{...o,title:a("fullScreen"),leftBorder:V.value.leftBorder,rightBorder:V.value.rightBorder,color:n.color,disabled:V.value.disabled||e.disabled||U.value,active:V.value.active,onOperate:X},(()=>t.h(Ln,{value:"full-screen"})));if(ae.isObject(Z.value)){const a=Z.value[o.name];if(a)return t.h(Un,{...o,ref:"btnRef",type:a.type||"default",title:a.title||"",leftBorder:a.leftBorder||!1,rightBorder:a.rightBorder||!1,disabled:a.disabled||e.disabled||U.value,hideScroll:a.hideScroll||!1,active:a.active||!1,selectConfig:{width:a.width,maxHeight:a.maxHeight,options:a.options},displayConfig:{width:a.width,maxHeight:a.maxHeight,value:a.value,options:a.options},color:n.color,onLayerShow:()=>{"function"==typeof a.onLayerShow&&a.onLayerShow(o.name,r.proxy.$refs.btnRef)},onLayerShown:()=>{"function"==typeof a.onLayerShown&&a.onLayerShown(o.name,r.proxy.$refs.btnRef)},onLayerHidden:()=>{"function"==typeof a.onLayerHidden&&a.onLayerHidden(o.name,r.proxy.$refs.btnRef)},onOperate:(e,t)=>{"function"==typeof a.onOperate&&a.onOperate(e,t,r.proxy.$refs.btnRef)}},{default:()=>a.default?a.default(o.name,r.proxy.$refs.btnRef):null,layer:()=>a.layer?a.layer(o.name,r.proxy.$refs.btnRef):null,option:()=>a.option?a.option(o.name,r.proxy.$refs.btnRef):null})}return null}}),{props:{name:String,disabled:Boolean}});return r({handleRangeUpdate:()=>{const e=Vr(c.value,d.value),t=Zr(c.value,d.value),r=Ur(c.value,d.value),a=jr(c.value,d.value),o=Gr(c.value,d.value),s=Wr(c.value,d.value,!0),u=Wr(c.value,d.value,!1),b=Kr(c.value,d.value),y=Xr(c.value,d.value),U=Yr(c.value,d.value),j=e=>{let t=!1,r=h.value.length;for(let n=0;n<r;n++){const r=h.value[n];if(r.menu&&"function"==typeof r.menu.extraDisabled&&(t=r.menu.extraDisabled(e),t))break}return"function"==typeof n.config.extraDisabled?n.config.extraDisabled(e)||t||!1:t||!1};m.value.disabled=!c.value.history.get(-1)||j("undo"),p.value.disabled=!c.value.history.get(1)||j("redo");const W=g.value.displayConfig.options.find((e=>{let t=e;return ae.isObject(e)&&(t=e.value),c.value.range.anchor.isEqual(c.value.range.focus)?c.value.range.anchor.element.getBlock().parsedom==t:d.value.list.every((e=>e.element.isBlock()?e.element.parsedom==t:e.element.getBlock().parsedom==t))}));g.value.displayConfig.value=W?ae.isObject(W)?W.value:W:g.value.defaultValue,g.value.disabled=e||t||j("heading"),f.value.disabled=e||t||j("indent"),v.value.active=a,v.value.disabled=e||t||j("quote"),w.value.disabled=e||j("align"),x.value.active=s,x.value.disabled=e||t||j("orderList"),E.value.active=u,E.value.disabled=e||t||j("unorderList"),k.value.active=b,k.value.disabled=e||t||j("task"),S.value.active=Qr(c.value,d.value,"font-weight","bold")||Qr(c.value,d.value,"font-weight","700"),S.value.disabled=e||j("bold"),T.value.active=Qr(c.value,d.value,"text-decoration","underline")||Qr(c.value,d.value,"text-decoration-line","underline"),T.value.disabled=e||j("underline"),B.value.active=Qr(c.value,d.value,"font-style","italic"),B.value.disabled=e||j("italic"),_.value.active=Qr(c.value,d.value,"text-decoration","line-through")||Qr(c.value,d.value,"text-decoration-line","line-through"),_.value.disabled=e||j("strikethrough"),C.value.active=Jr(c.value,d.value,"data-editify-code"),C.value.disabled=e||j("code"),N.value.active=Qr(c.value,d.value,"vertical-align","super"),N.value.disabled=e||j("super"),M.value.active=Qr(c.value,d.value,"vertical-align","sub"),M.value.disabled=e||j("sub"),A.value.disabled=e||j("formatClear");const K=O.value.displayConfig.options.find((e=>ae.isObject(e)?Qr(c.value,d.value,"font-size",e.value):Qr(c.value,d.value,"font-size",e)));O.value.displayConfig.value=K?ae.isObject(K)?K.value:K:O.value.defaultValue,O.value.disabled=e||j("fontSize");const G=z.value.displayConfig.options.find((e=>ae.isObject(e)?Qr(c.value,d.value,"font-family",e.value):Qr(c.value,d.value,"font-family",e)));z.value.displayConfig.value=G?ae.isObject(G)?G.value:G:z.value.defaultValue,z.value.disabled=e||j("fontFamily");const Z=R.value.displayConfig.options.find((e=>{let t=e;if(ae.isObject(e)&&(t=e.value),c.value.range.anchor.isEqual(c.value.range.focus)){const e=c.value.range.anchor.element.getBlock();return e.hasStyles()&&e.styles["line-height"]==t}return d.value.list.every((e=>{if(e.element.isBlock()||e.element.isInblock())return e.element.hasStyles()&&e.element.styles["line-height"]==t;const r=e.element.getBlock(),n=e.element.getInblock();return n?n.hasStyles()&&n.styles["line-height"]==t:r.hasStyles()&&r.styles["line-height"]==t}))}));R.value.displayConfig.value=Z?ae.isObject(Z)?Z.value:Z:R.value.defaultValue,R.value.disabled=e||j("lineHeight");const X=I.value.selectConfig.options.find((e=>ae.isObject(e)?Qr(c.value,d.value,"color",e.value):Qr(c.value,d.value,"color",e)));I.value.value=X?ae.isObject(X)?X.value:X:"",I.value.disabled=e||j("foreColor");const Y=L.value.selectConfig.options.find((e=>ae.isObject(e)?Qr(c.value,d.value,"background-color",e.value):Qr(c.value,d.value,"background-color",e)));L.value.value=Y?ae.isObject(Y)?Y.value:Y:"",L.value.disabled=e||j("backColor"),D.value.disabled=o||e||j("link"),F.value.disabled=e||j("image"),P.value.disabled=e||j("video"),q.value.disabled=e||t||r||j("table"),H.value.active=!!Fr(c.value,d.value,"pre"),H.value.disabled=t||r||y||U||j("codeBlock"),$.value.active=i.value,V.value.active=l.value}}),(e,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify-menu",{"editify-border":G.value,"editify-source":t.unref(i)&&"inner"==K.value,"editify-fullscreen":t.unref(l)}]),"data-editify-mode":K.value,style:t.normalizeStyle(e.config.style||"")},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j.value,(e=>(t.openBlock(),t.createBlock(t.unref(Y),{name:e,disabled:W.value(e)},null,8,["name","disabled"])))),256))],14,$a))}}),[["__scopeId","data-v-13b11735"]]),Ua={locale:{type:String,default:"zh_CN"},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},border:{type:Boolean,default:!1},color:{type:String,default:"#03a8f3",validator:e=>ae.matchingText(e,"hex")},videoRatio:{type:Number,default:16/9},toolbar:{type:Object,default:null},showWordLength:{type:Boolean,default:!1},customTextPaste:{type:Function,default:null},customHtmlPaste:{type:Function,default:null},customImagePaste:{type:Function,default:null},customVideoPaste:{type:Function,default:null},customFilePaste:{type:Function,default:null},menu:{type:Object,default:null},pasteKeepMarks:{type:Function,default:null},pasteKeepStyles:{type:Function,default:null},customParseNode:{type:Function,default:null},extraKeepTags:{type:Array,default:function(){return[]}},renderRules:{type:Array,default:function(){return[]}},autoheight:{type:Boolean,default:!1},tab:{type:Boolean,default:!0},plugins:{type:Array,default:function(){return[]}}},ja={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",separator:"Separator",lineHeight:"Line height",indent:"Indent",insertLink:"Insert Link",insertImage:"Insert Image",remoteImage:"Remote",uploadImage:"Upload",imageUrlPlaceholder:"Please enter the image address",insert:"Insert",insertVideo:"Insert Video",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",auto:"auto",fullScreen:"Full screen",confirm:"Confirm",insertAttachment:"Insert attachment",uploadAttachment:"Upload",remoteAttachment:"Remote",attachmentNamePlaceholder:"Please enter the attachment name",attachmentUrlPlaceholder:"Please enter the attachment address",attachmentDownloadTitle:"Click to download attachment",attachmentDefaultName:"attachment",insertMathformula:"Insert mathematical formula",mathformulaPlaceholder:"Please enter LaTex syntax"},Wa={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:"引用",separator:"分隔线",lineHeight:"行高",indent:"缩进",insertLink:"插入链接",insertImage:"插入图片",remoteImage:"网络图片",uploadImage:"上传图片",imageUrlPlaceholder:"请输入图片地址",insert:"插入",insertVideo:"插入视频",remoteVideo:"网络视频",uploadVideo:"上传视频",videoUrlPlaceholder:"请输入视频地址",insertTable:"插入表格",inserCodeBlock:"插入代码块",sourceView:"代码视图",task:"待办",indentIncrease:"增加缩进",indentDecrease:"减少缩进",alignLeft:"左对齐",alignCenter:"居中对齐",alignRight:"右对齐",alignJustify:"两端对齐",defaultLineHeight:"默认行高",auto:"自适应",fullScreen:"全屏",confirm:"确定",insertAttachment:"插入附件",uploadAttachment:"上传附件",remoteAttachment:"远程地址",attachmentNamePlaceholder:"请输入附件名称",attachmentUrlPlaceholder:"请输入附件地址",attachmentDownloadTitle:"点击下载附件",attachmentDefaultName:"附件",insertMathformula:"插入数学公式",mathformulaPlaceholder:"请输入LaTex语法"},Ka=["data-editify-uid"],Ga=["data-editify-placeholder"],Za=["value"],Xa={class:"editify-footer-words"},Ya=_n(t.defineComponent({name:"editify",__name:"editify",props:Ua,emits:["update:modelValue","focus","blur","change","keydown","keyup","insertparagraph","rangeupdate","updateview"],setup(e,{expose:r,emit:n}){const a=t.getCurrentInstance(),o=e,i=n,l=(s=o.locale||"zh_CN",e=>({zh_CN:Wa,en_US:ja}[s][e]));var s;const c=t.ref(!1),d=t.ref(!1),u=t.ref(null),h=t.ref({element:null,start:0}),m=t.ref({show:!1,node:null,type:"text"}),p=t.ref(null),g=t.ref(null),f=t.ref(null),v=t.ref(null),b=t.ref(null),w=t.ref(null),x=t.ref(null),E=t.ref(!1),k=t.ref(!1),S=t.ref(!1),T=t.ref({flatList:[],list:[]}),B=t.computed({set(e){i("update:modelValue",e)},get:()=>o.modelValue||"<p><br></p>"}),_=t.computed((()=>te.string2dom(`<div>${B.value}</div>`).innerText)),C=t.computed((()=>!(!(x.value&&B.value&&1==x.value.stack.length&&"block"==x.value.stack[0].type&&x.value.stack[0].parsedom==y.BLOCK_NODE&&x.value.stack[0].isOnlyHasBreak())||x.value.stack[0].hasStyles()||x.value.stack[0].hasMarks())&&!d.value)),N=t.computed((()=>!k.value&&o.border)),M=t.computed((()=>{return zr((e=l,t=o.locale,{use:!0,style:null,tooltip:!0,codeBlock:{languages:{show:!0,options:[{label:e("autoRecognize"),value:""},...Or],width:120,maxHeight:180,leftBorder:!0,rightBorder:!1}},text:{heading:{show:!0,options:Lr(e).heading,defaultValue:"p",width:"en_US"==t?150:130,maxHeight:"",leftBorder:!1,rightBorder:!0},align:{show:!1,options:Lr(e).align,width:"zh_CN"==t?110: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:!0,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:Lr(e).fontSize,defaultValue:"",width:100,maxHeight:200,leftBorder:!0,rightBorder:!1},fontFamily:{show:!1,options:Lr(e).fontFamily,defaultValue:"",width:100,maxHeight:200,leftBorder:!1,rightBorder:!1},lineHeight:{show:!1,options:Lr(e).lineHeight,defaultValue:"",width:90,maxHeight:"",leftBorder:!1,rightBorder:!1},foreColor:{show:!0,options:Lr(e).foreColor,leftBorder:!1,rightBorder:!1},backColor:{show:!0,options:Lr(e).backColor,leftBorder:!1,rightBorder:!1},formatClear:{show:!0,leftBorder:!0,rightBorder:!1}},extraDisabled:null}),o.toolbar||{});var e,t})),A=t.computed((()=>{const e=[];return o.plugins.forEach((t=>{let r=t(a,l);e.push(r)})),e})),O=t.computed((()=>{return zr((e=l,t=o.locale,{use:!0,tooltip:!0,mode:"default",extraDisabled:null,style:null,sequence:{undo:0,redo:1,heading:2,indent:3,quote:4,separator:5,align:6,orderList:7,unorderList:8,task:9,bold:10,underline:11,italic:12,strikethrough:13,code:14,super:15,sub:16,formatClear:17,fontSize:18,fontFamily:19,lineHeight:20,foreColor:21,backColor:22,link:23,image:24,video:25,table:26,codeBlock:27,sourceView:28,fullScreen:29},undo:{show:!0,leftBorder:!1,rightBorder:!1},redo:{show:!0,leftBorder:!1,rightBorder:!1},heading:{show:!0,options:Lr(e).heading,defaultValue:"p",width:"en_US"==t?150:130,maxHeight:"",leftBorder:!0,rightBorder:!1},indent:{show:!0,options:Lr(e).indent,width:"en_US"==t?150:110,maxHeight:"",leftBorder:!1,rightBorder:!1},quote:{show:!0,leftBorder:!1,rightBorder:!1},separator:{show:!0,leftBorder:!1,rightBorder:!1},align:{show:!0,options:Lr(e).align,width:"zh_CN"==t?110: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:Lr(e).fontSize,defaultValue:"",width:100,maxHeight:200,leftBorder:!0,rightBorder:!1},fontFamily:{show:!0,options:Lr(e).fontFamily,defaultValue:"",width:100,maxHeight:200,leftBorder:!1,rightBorder:!1},lineHeight:{show:!0,options:Lr(e).lineHeight,defaultValue:"",width:90,maxHeight:"",leftBorder:!1,rightBorder:!1},foreColor:{show:!0,options:Lr(e).foreColor,leftBorder:!0,rightBorder:!1},backColor:{show:!0,options:Lr(e).backColor,leftBorder:!1,rightBorder:!1},link:{show:!0,leftBorder:!0,rightBorder:!1},image:{show:!0,leftBorder:!1,rightBorder:!1,allowedFileType:["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,allowedFileType:["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:!0,rightBorder:!1},fullScreen:{show:!1,leftBorder:!1,rightBorder:!1},extends:{}}),o.menu||{});var e,t})),z=e=>{c.value=!0,B.value=e,t.nextTick((()=>{c.value=!1}))},R=()=>{m.value.show=!1,m.value.node=null},I=()=>{o.disabled||E.value||(R(),t.nextTick((()=>{const e=Fr(x.value,T.value,"table"),t=Fr(x.value,T.value,"pre"),r=Fr(x.value,T.value,"a"),n=Fr(x.value,T.value,"img"),o=Fr(x.value,T.value,"video");if(r)m.value.type="link",m.value.node=`[data-editify-uid="${a.uid}"] [data-editify-element="${r.key}"]`,m.value.show?v.value.$refs.layerRef.setPosition():m.value.show=!0;else if(n)m.value.type="image",m.value.node=`[data-editify-uid="${a.uid}"] [data-editify-element="${n.key}"]`,m.value.show?v.value.$refs.layerRef.setPosition():m.value.show=!0;else if(o)m.value.type="video",m.value.node=`[data-editify-uid="${a.uid}"] [data-editify-element="${o.key}"]`,m.value.show?v.value.$refs.layerRef.setPosition():m.value.show=!0;else if(e)m.value.type="table",m.value.node=`[data-editify-uid="${a.uid}"] [data-editify-element="${e.key}"]`,m.value.show?v.value.$refs.layerRef.setPosition():m.value.show=!0;else if(t)m.value.type="codeBlock",m.value.node=`[data-editify-uid="${a.uid}"] [data-editify-element="${t.key}"]`,m.value.show?v.value.$refs.layerRef.setPosition():m.value.show=!0;else{!T.value.flatList.filter((e=>e.element.isText())).length||Zr(x.value,T.value)||Vr(x.value,T.value)||Gr(x.value,T.value)||Xr(x.value,T.value)||Yr(x.value,T.value)||(m.value.type="text",m.value.show?v.value.$refs.layerRef.setPosition():m.value.show=!0)}})))},L=()=>{let e=[];A.value.forEach((t=>{t.renderRule&&e.push(t.renderRule)}));let t=[...o.extraKeepTags];A.value.forEach((e=>{e.extraKeepTags&&Array.isArray(e.extraKeepTags)&&e.extraKeepTags.forEach((e=>{t.includes(e)||t.push(e)}))})),x.value=new Q(f.value,{value:B.value,disabled:o.disabled,renderRules:[e=>{((e,t)=>{"ol"!=t.parsedom&&"ul"!=t.parsedom||(t.hasChildren()&&t.children.forEach((r=>{const n=r.clone();n.parsedom="div",n.type=t.type,n.hasMarks()?n.marks["data-editify-list"]=t.parsedom:n.marks={"data-editify-list":t.parsedom},e.addElementBefore(n,t)})),t.toEmpty())})(x.value,e)},e=>{!function(e,t){if(Hr(t,!0)){const r=e.getPreviousElement(t);if(r&&Hr(r,!0)){const e=Number(r.marks["data-editify-value"]);t.marks["data-editify-value"]=e+1}else t.marks["data-editify-value"]=1}}(x.value,e)},e=>{!function(e,t){if("img"==t.parsedom||"video"==t.parsedom||"a"==t.parsedom){const e={"data-editify-element":t.key};t.hasMarks()?Object.assign(t.marks,e):t.marks=e}if("video"==t.parsedom||"hr"==t.parsedom){const r=e.getPreviousElement(t),n=e.getNextElement(t);if(!r||!r.isSpaceText()){const r=y.getSpaceElement();e.addElementBefore(r,t)}if(!n||!n.isSpaceText()){const r=y.getSpaceElement();e.addElementAfter(r,t)}e.range&&t.isContains(e.range.anchor.element)&&e.range.anchor.moveToEnd(e.getNextElement(t)),e.range&&t.isContains(e.range.focus.element)&&e.range.focus.moveToEnd(e.getNextElement(t))}if("code"==t.parsedom){t.parsedom="span";const e={"data-editify-code":!0};t.hasMarks()?Object.assign(t.marks,e):t.marks=e}}(x.value,e)},e=>{kn(x.value,e)},e=>{var t,r,n,a,o,i,l;Sn(x.value,e,!(!(null==(t=M.value)?void 0:t.use)||!(null==(a=null==(n=null==(r=M.value)?void 0:r.codeBlock)?void 0:n.languages)?void 0:a.show)),null==(l=null==(i=null==(o=M.value)?void 0:o.codeBlock)?void 0:i.languages)?void 0:l.options)},e=>{!function(e,t){t.hasChildren()&&t.children.forEach((r=>{if(Hr(r,!0)||Hr(r,!1)||$r(r)||["blockquote","pre","table","h1","h2","h3","h4","h5","h6","p"].includes(r.parsedom)){const n=r.clone();n.type="block";const a=t.getBlock();e.addElementAfter(n,a),r.toEmpty()}}))}(x.value,e)},...e,...o.renderRules],allowCopy:o.allowCopy,allowPaste:o.allowPaste,allowCut:o.allowCut,allowPasteHtml:o.allowPasteHtml,customTextPaste:o.customTextPaste,customImagePaste:o.customImagePaste,customVideoPaste:o.customVideoPaste,customFilePaste:o.customFilePaste,customHtmlPaste:$,customMerge:V,customParseNode:U,extraKeepTags:t}),z(x.value.value),x.value.on("change",G),x.value.on("focus",X),x.value.on("blur",Z),x.value.on("keydown",j),x.value.on("keyup",W),x.value.on("insertParagraph",Y),x.value.on("rangeUpdate",ee),x.value.on("deleteInStart",re),x.value.on("deleteComplete",ae),x.value.on("afterRender",oe),x.value.formatElementStack(),x.value.domRender(),!o.autofocus||E.value||o.disabled||ie()},D=()=>{f.value.querySelectorAll("video").forEach((e=>{e.style.height=e.offsetWidth/o.videoRatio+"px"}))},F=e=>{if(!o.disabled){if(te.isContains(f.value,e.target)){const t=e.target,r=ne.get(t,"data-alex-editor-key");if(r){const n=x.value.getElementByKey(r);if(n&&"td"==n.parsedom){const r=n.parent.children.length;if(n.parent.children[r-1].isEqual(n))return;const a=te.getElementBounding(t);e.pageX>=Math.abs(a.left+t.offsetWidth-5)&&e.pageX<=Math.abs(a.left+t.offsetWidth+5)&&(h.value.element=n,h.value.start=e.pageX)}}}te.isContains(w.value,e.target)||E.value||(S.value=!1)}},P=e=>{if(o.disabled)return;if(!h.value.element)return;const t=Fr(x.value,T.value,"table");if(!t)return;const r=t.children.find((e=>"colgroup"==e.parsedom)),n=h.value.element.parent.children.findIndex((e=>e.isEqual(h.value.element))),a=""+(h.value.element.elm.offsetWidth+e.pageX-h.value.start);r.children[n].marks.width=a,r.children[n].elm.setAttribute("width",a),h.value.start=e.pageX},q=()=>{if(o.disabled)return;if(!h.value.element)return;const e=Fr(x.value,T.value,"table");if(!e)return;const t=e.children.find((e=>"colgroup"==e.parsedom)),r=h.value.element.parent.children.findIndex((e=>e.isEqual(h.value.element))),n=Number(t.children[r].marks.width);isNaN(n)||(t.children[r].marks.width=`${Number((n/h.value.element.parent.elm.offsetWidth*100).toFixed(2))}%`,x.value.formatElementStack(),x.value.domRender(),x.value.rangeRender()),h.value.element=null,h.value.start=0},H=e=>{if(!o.disabled&&te.isContains(f.value,e.target)){const t=e.target,r=ne.get(t,"data-alex-editor-key");if(r){const n=x.value.getElementByKey(r);if($r(n)){const r=te.getElementBounding(t);e.pageX>=Math.abs(r.left)&&e.pageX<=Math.abs(r.left+16)&&e.pageY>=Math.abs(r.top+t.offsetHeight/2-8)&&e.pageY<=Math.abs(r.top+t.offsetHeight/2+8)&&("checked"==n.marks["data-editify-task"]?n.marks["data-editify-task"]="uncheck":n.marks["data-editify-task"]="checked",x.value.range||x.value.initRange(),x.value.range.anchor.moveToEnd(n),x.value.range.focus.moveToEnd(n),x.value.formatElementStack(),x.value.domRender(),x.value.rangeRender())}}}},$=async e=>{if(y.flatElements(e).forEach((e=>{if(!e.isText()){let t={},r={};if(e.hasMarks()&&(e.marks.contenteditable&&(t.contenteditable=e.marks.contenteditable),e.marks.name&&(t.name=e.marks.name),e.marks.disabled&&(t.disabled=e.marks.disabled),"td"==e.parsedom&&e.marks.colspan&&(t.colspan=e.marks.colspan),["img","video"].includes(e.parsedom)&&e.marks.src&&(t.src=e.marks.src),"video"==e.parsedom&&e.marks.autoplay&&(t.autoplay=e.marks.autoplay),"video"==e.parsedom&&e.marks.loop&&(t.loop=e.marks.loop),"video"==e.parsedom&&e.marks.muted&&(t.muted=e.marks.muted),"video"==e.parsedom&&e.marks.controls&&(t.controls=e.marks.controls),"a"==e.parsedom&&e.marks.href&&(t.href=e.marks.href),"a"==e.parsedom&&e.marks.target&&(t.target=e.marks.target),"div"==e.parsedom&&e.marks["data-editify-list"]&&(t["data-editify-list"]=e.marks["data-editify-list"],e.marks["data-editify-value"]&&(t["data-editify-value"]=e.marks["data-editify-value"])),e.parsedom==y.TEXT_NODE&&e.marks["data-editify-code"]&&(t["data-editify-code"]=e.marks["data-editify-code"]),"div"==e.parsedom&&e.marks["data-editify-task"]&&(t["data-editify-task"]=e.marks["data-editify-task"])),e.hasStyles()&&((e.isBlock()||e.isInblock())&&e.styles["text-indent"]&&(r["text-indent"]=e.styles["text-indent"]),(e.isBlock()||e.isInblock())&&e.styles["text-align"]&&(r["text-align"]=e.styles["text-align"]),(e.isBlock()||e.isInblock())&&e.styles["line-height"]&&(r["line-height"]=e.styles["line-height"])),A.value.forEach((n=>{if("function"==typeof n.pasteKeepMarks){const r=n.pasteKeepMarks(e);t=zr(t,r)}if("function"==typeof n.pasteKeepStyles){const t=n.pasteKeepStyles(e);r=zr(r,t)}})),"function"==typeof o.pasteKeepMarks){const r=o.pasteKeepMarks(e);t=zr(t,r)}if("function"==typeof o.pasteKeepStyles){const t=o.pasteKeepStyles(e);r=zr(r,t)}e.marks=t,e.styles=r}})),"function"==typeof o.customHtmlPaste)await o.customHtmlPaste(e);else for(let t=0;t<e.length;t++)0==t?x.value.insertElement(e[t]):x.value.insertElement(e[t],!1)},V=(e,t)=>{const r=t.getUneditableElement();r?r.toEmpty():(t.children.push(...e.children),t.children.forEach((e=>{e.parent=t})),e.children=null)},U=e=>(A.value.forEach((t=>{t.customParseNode&&(e=t.customParseNode(e))})),"function"==typeof o.customParseNode&&(e=o.customParseNode(e)),e),j=(e,t)=>{o.disabled||("tab"!=t.key.toLocaleLowerCase()||t.metaKey||t.shiftKey||t.ctrlKey||t.altKey||!o.tab||(t.preventDefault(),x.value.insertText(" "),x.value.formatElementStack(),x.value.domRender(),x.value.rangeRender()),i("keydown",e,t))},W=(e,t)=>{o.disabled||i("keyup",e,t)},K=e=>{if(o.disabled||E.value)return;const t=e.target;if("img"==t.nodeName.toLocaleLowerCase()||"video"==t.nodeName.toLocaleLowerCase()){const e=Number(t.getAttribute("data-editify-element"));if(J.isNumber(e)){const t=x.value.getElementByKey(e);x.value.range||x.value.initRange(),x.value.range.anchor.moveToStart(t),x.value.range.focus.moveToEnd(t),x.value.rangeRender()}}},G=(e,t)=>{o.disabled||(z(e),i("change",e,t))},Z=e=>{o.disabled||(o.border&&o.color&&!k.value&&(g.value.style.borderColor="",g.value.style.boxShadow="",O.value.use&&(p.value.$el.style.borderColor="",p.value.$el.style.boxShadow="")),i("blur",e))},X=e=>{if(!o.disabled){if(o.border&&o.color&&!k.value){g.value.style.borderColor=o.color;const e=se.hex2rgb(o.color);O.value.use&&"inner"==O.value.mode?(g.value.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)`,p.value.$el.style.borderColor=o.color,p.value.$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)`):(O.value.use,g.value.style.boxShadow=`0 0 8px rgba(${e[0]},${e[1]},${e[2]},0.5)`)}setTimeout((()=>{S.value=!0,i("focus",e)}),0)}},Y=(e,t)=>{e.isEqual(t)||(t.isBlock()&&e.isBlock()&&t.isOnlyHasBreak()&&e.isOnlyHasBreak()&&t.parsedom!=y.BLOCK_NODE&&(rn(t),x.value.range.anchor.moveToStart(t),x.value.range.focus.moveToStart(t),e.toEmpty()),$r(e)&&(e.marks["data-editify-task"]="uncheck")),i("insertparagraph",B.value)},ee=()=>{o.disabled||(S.value=!!x.value.range,x.value.range&&(T.value=x.value.getElementsByRange(),u.value&&(clearTimeout(u.value),u.value=null),u.value=setTimeout((()=>{(M.value.use||O.value.use)&&(M.value.use&&I(),O.value.use&&p.value.handleRangeUpdate())}),200),i("rangeupdate")))},re=e=>{e.isBlock()&&rn(e)},ae=()=>{const e=x.value.range.anchor.element.getUneditableElement();e&&e.toEmpty()},oe=()=>{D(),A.value.forEach((e=>{e.updateView&&e.updateView()})),i("updateview")},ie=()=>{o.disabled||(x.value.collapseToEnd(),x.value.rangeRender(),te.setScrollTop({el:f.value,number:1e6,time:0}))};return t.watch((()=>B.value),(e=>{c.value||(x.value.stack=x.value.parseHtml(e),x.value.range=null,x.value.formatElementStack(),x.value.domRender(),x.value.rangeRender(),f.value.blur())})),t.watch((()=>E.value),(e=>{M.value.use&&(e?R():I())})),t.watch((()=>o.disabled),(e=>{e?x.value.setDisabled():x.value.setEnabled()})),t.onMounted((()=>{L(),(()=>{const e=t=>{le.on(t,`scroll.editify_${a.uid}`,(()=>{M.value.use&&m.value.show&&R()})),t.parentNode&&e(t.parentNode)};e(f.value)})(),le.on(document.documentElement,`mousedown.editify_${a.uid}`,F),le.on(document.documentElement,`mousemove.editify_${a.uid}`,P),le.on(document.documentElement,`mouseup.editify_${a.uid}`,q),le.on(document.documentElement,`click.editify_${a.uid}`,H),le.on(window,`resize.editify_${a.uid}`,D)})),t.onBeforeUnmount((()=>{(()=>{const e=t=>{le.off(t,`scroll.editify_${a.uid}`),t.parentNode&&e(t.parentNode)};e(f.value)})(),le.off(document.documentElement,`mousedown.editify_${a.uid} mousemove.editify_${a.uid} mouseup.editify_${a.uid} click.editify_${a.uid}`),le.off(window,`resize.editify_${a.uid}`),x.value.destroy()})),t.provide("$editTrans",l),t.provide("editify",a),t.provide("isSourceView",E),t.provide("isFullScreen",k),t.provide("canUseMenu",S),t.provide("editor",x),t.provide("dataRangeCaches",T),t.provide("showBorder",N),t.provide("pluginResultList",A),r({editor:x,isSourceView:E,isFullScreen:k,canUseMenu:S,dataRangeCaches:T,textValue:_,collapseToEnd:ie,collapseToStart:()=>{o.disabled||(x.value.collapseToStart(),x.value.rangeRender(),t.nextTick((()=>{te.setScrollTop({el:f.value,number:0,time:0})})))},undo:()=>{if(o.disabled)return;const e=x.value.history.get(-1);e&&(x.value.history.current=e.current,x.value.stack=e.stack,x.value.range=e.range,x.value.formatElementStack(),x.value.domRender(!0),x.value.rangeRender())},redo:()=>{if(o.disabled)return;const e=x.value.history.get(1);e&&(x.value.history.current=e.current,x.value.stack=e.stack,x.value.range=e.range,x.value.formatElementStack(),x.value.domRender(!0),x.value.rangeRender())}}),(e,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["editify",{"editify-fullscreen":k.value,"editify-autoheight":!k.value&&e.autoheight}]),ref_key:"elRef",ref:w},[O.value.use?(t.openBlock(),t.createBlock(Va,{key:0,config:O.value,color:e.color,ref_key:"menuRef",ref:p},null,8,["config","color"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"bodyRef",ref:g,class:t.normalizeClass(["editify-body",{"editify-border":N.value,"editify-menu_inner":O.value.use&&"inner"==O.value.mode}]),"data-editify-uid":t.unref(a).uid},[t.createElementVNode("div",{ref_key:"contentRef",ref:f,class:t.normalizeClass(["editify-content",{"editify-placeholder":C.value,"editify-disabled":e.disabled}]),onClick:K,onCompositionstart:r[0]||(r[0]=e=>d.value=!0),onCompositionend:r[1]||(r[1]=e=>d.value=!1),"data-editify-placeholder":e.placeholder},null,42,Ga),E.value?(t.openBlock(),t.createElementBlock("textarea",{key:0,value:B.value,readonly:"",class:"editify-sourceview"},null,8,Za)):t.createCommentVNode("",!0),t.createVNode(sa,{ref_key:"toolbarRef",ref:v,modelValue:m.value.show,"onUpdate:modelValue":r[2]||(r[2]=e=>m.value.show=e),node:m.value.node,type:m.value.type,config:M.value,color:e.color},null,8,["modelValue","node","type","config","color"])],10,Ka),e.showWordLength?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["editify-footer",{"editify-fullscreen":k.value&&!E.value}]),ref_key:"footerRef",ref:b},[t.createElementVNode("div",Xa,t.toDisplayString(t.unref(l)("totalWordCount"))+t.toDisplayString(_.value.length),1)],2)):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-20ab798b"]]),Qa={color:{type:String,default:""},accept:{type:String,default:null},allowedFileType:{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}},Ja={class:"editify-attachment"},eo={class:"editify-attachment-header"},to={key:0,class:"editify-attachment-remote"},ro=["placeholder"],no=["placeholder"],ao={key:1,class:"editify-attachment-upload"},oo=["placeholder"],io=["multiple","accept"],lo=_n(t.defineComponent({name:"InsertAttachment",__name:"insertAttachment",props:Qa,emits:["change","insert"],setup(e,{emit:r}){const n=e,a=r,o=t.inject("$editTrans"),i=t.ref("upload"),l=t.ref(""),s=t.ref(""),c=t.ref(null),d=t.computed((()=>e=>i.value==e?{color:n.color}:{})),u=e=>{const t=e.name.lastIndexOf(".");return t<=0?"":e.name.substring(t+1)},h=e=>{n.color&&(e.currentTarget.style.borderColor=n.color)},m=e=>{e.currentTarget.style.borderColor=""},p=()=>{a("insert",l.value,[s.value])},g=()=>{c.value.click()},f=async()=>{const e=c.value.files;if(!e||!e.length)return;let t=[];for(let r=0;r<e.length;r++){const a=e[r],o=u(a);!(n.allowedFileType&&Array.isArray(n.allowedFileType)&&n.allowedFileType.length)||n.allowedFileType.some((e=>e.toLocaleLowerCase()==o.toLocaleLowerCase()))?n.maxSize&&a.size/1024>n.maxSize?"function"==typeof n.handleError&&n.handleError("maxSizeError",a):n.minSize&&a.size/1024<n.minSize?"function"==typeof n.handleError&&n.handleError("minSizeError",a):t.push(a):"function"==typeof n.handleError&&n.handleError("suffixError",a)}if(t.length){let e=[];if("function"==typeof n.customUpload)e=await n.customUpload(t)||[];else for(let r=0;r<t.length;r++){const n=await ce.dataFileToBase64(t[r]);e.push(n)}a("insert",l.value,e)}c.value.value=""};return t.watch((()=>i.value),(()=>{a("change")})),(e,r)=>(t.openBlock(),t.createElementBlock("div",Ja,[t.createElementVNode("div",eo,[t.createElementVNode("div",{onClick:r[0]||(r[0]=e=>i.value="upload"),class:t.normalizeClass(["editify-attachment-header-item",{"editify-active":"upload"==i.value}]),style:t.normalizeStyle(d.value("upload"))},t.toDisplayString(t.unref(o)("uploadAttachment")),7),t.createElementVNode("div",{onClick:r[1]||(r[1]=e=>i.value="remote"),class:t.normalizeClass(["editify-attachment-header-item",{"editify-active":"remote"==i.value}]),style:t.normalizeStyle(d.value("remote"))},t.toDisplayString(t.unref(o)("remoteAttachment")),7),t.createElementVNode("div",{class:t.normalizeClass(["editify-attachment-header-slider","editify-"+i.value]),style:t.normalizeStyle({backgroundColor:e.color||""})},null,6)]),"remote"==i.value?(t.openBlock(),t.createElementBlock("div",to,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":r[2]||(r[2]=e=>l.value=e),placeholder:t.unref(o)("attachmentNamePlaceholder"),onBlur:m,onFocus:h,type:"text"},null,40,ro),[[t.vModelText,l.value,void 0,{trim:!0}]]),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":r[3]||(r[3]=e=>s.value=e),placeholder:t.unref(o)("attachmentUrlPlaceholder"),onBlur:m,onFocus:h,type:"url"},null,40,no),[[t.vModelText,s.value,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-attachment-remote-footer",style:t.normalizeStyle({color:e.color||""})},[t.createElementVNode("span",{onClick:p},t.toDisplayString(t.unref(o)("insert")),1)],4)])):(t.openBlock(),t.createElementBlock("div",ao,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":r[4]||(r[4]=e=>l.value=e),placeholder:t.unref(o)("attachmentNamePlaceholder"),onBlur:m,onFocus:h,type:"text"},null,40,oo),[[t.vModelText,l.value,void 0,{trim:!0}]]),t.createElementVNode("div",{class:"editify-attachment-btn",onClick:g},[t.createVNode(Ln,{value:"upload"}),t.createElementVNode("input",{ref_key:"fileInputRef",ref:c,multiple:e.multiple,accept:e.accept,onChange:f,type:"file"},null,40,io)])]))]))}}),[["__scopeId","data-v-52b1e545"]]);class so{constructor(e,t,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=r}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new so(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class co{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new co(t,so.range(this,e))}}class uo{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r,n,a="KaTeX parse error: "+e,o=t&&t.loc;if(o&&o.start<=o.end){var i=o.lexer.input;r=o.start,n=o.end,r===i.length?a+=" at end of input: ":a+=" at position "+(r+1)+": ";var l=i.slice(r,n).replace(/[^]/g,"$&̲");a+=(r>15?"…"+i.slice(r-15,r):i.slice(0,r))+l+(n+15<i.length?i.slice(n,n+15)+"…":i.slice(n))}var s=new Error(a);return s.name="ParseError",s.__proto__=uo.prototype,s.position=r,null!=r&&null!=n&&(s.length=n-r),s.rawMessage=e,s}}uo.prototype.__proto__=Error.prototype;var ho=/([A-Z])/g,mo={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},po=/[&><"']/g;var go=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},fo={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(po,(e=>mo[e]))},hyphenate:function(e){return e.replace(ho,"-$1").toLowerCase()},getBaseElem:go,isCharacterBox:function(e){var t=go(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},vo={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function bo(e){if(e.default)return e.default;var t=e.type,r=Array.isArray(t)?t[0]:t;if("string"!=typeof r)return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class yo{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},vo)if(vo.hasOwnProperty(t)){var r=vo[t];this[t]=void 0!==e[t]?r.processor?r.processor(e[t]):e[t]:bo(r)}}reportNonstrict(e,t,r){var n=this.strict;if("function"==typeof n&&(n=n(e,t,r)),n&&"ignore"!==n){if(!0===n||"error"===n)throw new uo("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",r);"warn"===n?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,r){var n=this.strict;if("function"==typeof n)try{n=n(e,t,r)}catch(a){n="error"}return!(!n||"ignore"===n)&&(!0===n||"error"===n||("warn"===n?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if(e.url&&!e.protocol){var t=fo.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}var r="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(r)}}class wo{constructor(e,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=r}sup(){return xo[Eo[this.id]]}sub(){return xo[ko[this.id]]}fracNum(){return xo[So[this.id]]}fracDen(){return xo[To[this.id]]}cramp(){return xo[Bo[this.id]]}text(){return xo[_o[this.id]]}isTight(){return this.size>=2}}var xo=[new wo(0,0,!1),new wo(1,0,!0),new wo(2,1,!1),new wo(3,1,!0),new wo(4,2,!1),new wo(5,2,!0),new wo(6,3,!1),new wo(7,3,!0)],Eo=[4,5,4,5,6,7,6,7],ko=[5,5,5,5,7,7,7,7],So=[2,3,4,5,6,7,6,7],To=[3,3,5,5,7,7,7,7],Bo=[1,1,3,3,5,5,7,7],_o=[0,1,2,3,2,3,2,3],Co={DISPLAY:xo[0],TEXT:xo[2],SCRIPT:xo[4],SCRIPTSCRIPT:xo[6]},No=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var Mo=[];function Ao(e){for(var t=0;t<Mo.length;t+=2)if(e>=Mo[t]&&e<=Mo[t+1])return!0;return!1}No.forEach((e=>e.blocks.forEach((e=>Mo.push(...e)))));var Oo=80,zo={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class Ro{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return fo.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map((e=>e.toText())).join("")}}var Io={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Lo={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Do={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function Fo(e,t,r){if(!Io[t])throw new Error("Font metrics not found for font: "+t+".");var n=e.charCodeAt(0),a=Io[t][n];if(!a&&e[0]in Do&&(n=Do[e[0]].charCodeAt(0),a=Io[t][n]),a||"text"!==r||Ao(n)&&(a=Io[t][77]),a)return{depth:a[0],height:a[1],italic:a[2],skew:a[3],width:a[4]}}var Po={};var qo=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Ho=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],$o=function(e,t){return t.size<2?e:qo[e-1][t.size-1]};class Vo{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Vo.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Ho[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return new Vo(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:$o(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Ho[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=$o(Vo.BASESIZE,e);return this.size===t&&this.textSize===Vo.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Vo.BASESIZE?["sizing","reset-size"+this.size,"size"+Vo.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!Po[t=e>=5?0:e>=3?1:2]){var r=Po[t]={cssEmPerMu:Lo.quad[t]/18};for(var n in Lo)Lo.hasOwnProperty(n)&&(r[n]=Lo[n][t])}return Po[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Vo.BASESIZE=6;var Uo={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},jo={ex:!0,em:!0,mu:!0},Wo=function(e){return"string"!=typeof e&&(e=e.unit),e in Uo||e in jo||"ex"===e},Ko=function(e,t){var r;if(e.unit in Uo)r=Uo[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)r=t.fontMetrics().cssEmPerMu;else{var n;if(n=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)r=n.fontMetrics().xHeight;else{if("em"!==e.unit)throw new uo("Invalid unit: '"+e.unit+"'");r=n.fontMetrics().quad}n!==t&&(r*=n.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*r,t.maxSize)},Go=function(e){return+e.toFixed(4)+"em"},Zo=function(e){return e.filter((e=>e)).join(" ")},Xo=function(e,t,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},Yo=function(e){var t=document.createElement(e);for(var r in t.className=Zo(this.classes),this.style)this.style.hasOwnProperty(r)&&(t.style[r]=this.style[r]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&t.setAttribute(n,this.attributes[n]);for(var a=0;a<this.children.length;a++)t.appendChild(this.children[a].toNode());return t},Qo=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+fo.escape(Zo(this.classes))+'"');var r="";for(var n in this.style)this.style.hasOwnProperty(n)&&(r+=fo.hyphenate(n)+":"+this.style[n]+";");for(var a in r&&(t+=' style="'+fo.escape(r)+'"'),this.attributes)this.attributes.hasOwnProperty(a)&&(t+=" "+a+'="'+fo.escape(this.attributes[a])+'"');t+=">";for(var o=0;o<this.children.length;o++)t+=this.children[o].toMarkup();return t+="</"+e+">"};class Jo{constructor(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Xo.call(this,e,r,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return fo.contains(this.classes,e)}toNode(){return Yo.call(this,"span")}toMarkup(){return Qo.call(this,"span")}}class ei{constructor(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Xo.call(this,t,n),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return fo.contains(this.classes,e)}toNode(){return Yo.call(this,"a")}toMarkup(){return Qo.call(this,"a")}}class ti{constructor(e,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=r}hasClass(e){return fo.contains(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+fo.escape(this.src)+'" alt="'+fo.escape(this.alt)+'"',t="";for(var r in this.style)this.style.hasOwnProperty(r)&&(t+=fo.hyphenate(r)+":"+this.style[r]+";");return t&&(e+=' style="'+fo.escape(t)+'"'),e+="'/>"}}var ri={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class ni{constructor(e,t,r,n,a,o,i,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=r||0,this.italic=n||0,this.skew=a||0,this.width=o||0,this.classes=i||[],this.style=l||{},this.maxFontSize=0;var s=function(e){for(var t=0;t<No.length;t++)for(var r=No[t],n=0;n<r.blocks.length;n++){var a=r.blocks[n];if(e>=a[0]&&e<=a[1])return r.name}return null}(this.text.charCodeAt(0));s&&this.classes.push(s+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ri[this.text])}hasClass(e){return fo.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var r in this.italic>0&&((t=document.createElement("span")).style.marginRight=Go(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Zo(this.classes)),this.style)this.style.hasOwnProperty(r)&&((t=t||document.createElement("span")).style[r]=this.style[r]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=fo.escape(Zo(this.classes)),t+='"');var r="";for(var n in this.italic>0&&(r+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(n)&&(r+=fo.hyphenate(n)+":"+this.style[n]+";");r&&(e=!0,t+=' style="'+fo.escape(r)+'"');var a=fo.escape(this.text);return e?(t+=">",t+=a,t+="</span>"):a}}class ai{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+fo.escape(this.attributes[t])+'"');e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>"}}class oi{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",zo[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+fo.escape(this.alternate)+'"/>':'<path d="'+fo.escape(zo[this.pathName])+'"/>'}}class ii{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+fo.escape(this.attributes[t])+'"');return e+="/>"}}function li(e){if(e instanceof ni)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var si={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ci={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},di={math:{},text:{}};function ui(e,t,r,n,a,o){di[e][a]={font:t,group:r,replace:n},o&&n&&(di[e][n]=di[e][a])}var hi="math",mi="text",pi="main",gi="ams",fi="accent-token",vi="bin",bi="close",yi="inner",wi="mathord",xi="op-token",Ei="open",ki="punct",Si="rel",Ti="spacing",Bi="textord";ui(hi,pi,Si,"≡","\\equiv",!0),ui(hi,pi,Si,"≺","\\prec",!0),ui(hi,pi,Si,"≻","\\succ",!0),ui(hi,pi,Si,"∼","\\sim",!0),ui(hi,pi,Si,"⊥","\\perp"),ui(hi,pi,Si,"⪯","\\preceq",!0),ui(hi,pi,Si,"⪰","\\succeq",!0),ui(hi,pi,Si,"≃","\\simeq",!0),ui(hi,pi,Si,"∣","\\mid",!0),ui(hi,pi,Si,"≪","\\ll",!0),ui(hi,pi,Si,"≫","\\gg",!0),ui(hi,pi,Si,"≍","\\asymp",!0),ui(hi,pi,Si,"∥","\\parallel"),ui(hi,pi,Si,"⋈","\\bowtie",!0),ui(hi,pi,Si,"⌣","\\smile",!0),ui(hi,pi,Si,"⊑","\\sqsubseteq",!0),ui(hi,pi,Si,"⊒","\\sqsupseteq",!0),ui(hi,pi,Si,"≐","\\doteq",!0),ui(hi,pi,Si,"⌢","\\frown",!0),ui(hi,pi,Si,"∋","\\ni",!0),ui(hi,pi,Si,"∝","\\propto",!0),ui(hi,pi,Si,"⊢","\\vdash",!0),ui(hi,pi,Si,"⊣","\\dashv",!0),ui(hi,pi,Si,"∋","\\owns"),ui(hi,pi,ki,".","\\ldotp"),ui(hi,pi,ki,"⋅","\\cdotp"),ui(hi,pi,Bi,"#","\\#"),ui(mi,pi,Bi,"#","\\#"),ui(hi,pi,Bi,"&","\\&"),ui(mi,pi,Bi,"&","\\&"),ui(hi,pi,Bi,"ℵ","\\aleph",!0),ui(hi,pi,Bi,"∀","\\forall",!0),ui(hi,pi,Bi,"ℏ","\\hbar",!0),ui(hi,pi,Bi,"∃","\\exists",!0),ui(hi,pi,Bi,"∇","\\nabla",!0),ui(hi,pi,Bi,"♭","\\flat",!0),ui(hi,pi,Bi,"ℓ","\\ell",!0),ui(hi,pi,Bi,"♮","\\natural",!0),ui(hi,pi,Bi,"♣","\\clubsuit",!0),ui(hi,pi,Bi,"℘","\\wp",!0),ui(hi,pi,Bi,"♯","\\sharp",!0),ui(hi,pi,Bi,"♢","\\diamondsuit",!0),ui(hi,pi,Bi,"ℜ","\\Re",!0),ui(hi,pi,Bi,"♡","\\heartsuit",!0),ui(hi,pi,Bi,"ℑ","\\Im",!0),ui(hi,pi,Bi,"♠","\\spadesuit",!0),ui(hi,pi,Bi,"§","\\S",!0),ui(mi,pi,Bi,"§","\\S"),ui(hi,pi,Bi,"¶","\\P",!0),ui(mi,pi,Bi,"¶","\\P"),ui(hi,pi,Bi,"†","\\dag"),ui(mi,pi,Bi,"†","\\dag"),ui(mi,pi,Bi,"†","\\textdagger"),ui(hi,pi,Bi,"‡","\\ddag"),ui(mi,pi,Bi,"‡","\\ddag"),ui(mi,pi,Bi,"‡","\\textdaggerdbl"),ui(hi,pi,bi,"⎱","\\rmoustache",!0),ui(hi,pi,Ei,"⎰","\\lmoustache",!0),ui(hi,pi,bi,"⟯","\\rgroup",!0),ui(hi,pi,Ei,"⟮","\\lgroup",!0),ui(hi,pi,vi,"∓","\\mp",!0),ui(hi,pi,vi,"⊖","\\ominus",!0),ui(hi,pi,vi,"⊎","\\uplus",!0),ui(hi,pi,vi,"⊓","\\sqcap",!0),ui(hi,pi,vi,"∗","\\ast"),ui(hi,pi,vi,"⊔","\\sqcup",!0),ui(hi,pi,vi,"◯","\\bigcirc",!0),ui(hi,pi,vi,"∙","\\bullet",!0),ui(hi,pi,vi,"‡","\\ddagger"),ui(hi,pi,vi,"≀","\\wr",!0),ui(hi,pi,vi,"⨿","\\amalg"),ui(hi,pi,vi,"&","\\And"),ui(hi,pi,Si,"⟵","\\longleftarrow",!0),ui(hi,pi,Si,"⇐","\\Leftarrow",!0),ui(hi,pi,Si,"⟸","\\Longleftarrow",!0),ui(hi,pi,Si,"⟶","\\longrightarrow",!0),ui(hi,pi,Si,"⇒","\\Rightarrow",!0),ui(hi,pi,Si,"⟹","\\Longrightarrow",!0),ui(hi,pi,Si,"↔","\\leftrightarrow",!0),ui(hi,pi,Si,"⟷","\\longleftrightarrow",!0),ui(hi,pi,Si,"⇔","\\Leftrightarrow",!0),ui(hi,pi,Si,"⟺","\\Longleftrightarrow",!0),ui(hi,pi,Si,"↦","\\mapsto",!0),ui(hi,pi,Si,"⟼","\\longmapsto",!0),ui(hi,pi,Si,"↗","\\nearrow",!0),ui(hi,pi,Si,"↩","\\hookleftarrow",!0),ui(hi,pi,Si,"↪","\\hookrightarrow",!0),ui(hi,pi,Si,"↘","\\searrow",!0),ui(hi,pi,Si,"↼","\\leftharpoonup",!0),ui(hi,pi,Si,"⇀","\\rightharpoonup",!0),ui(hi,pi,Si,"↙","\\swarrow",!0),ui(hi,pi,Si,"↽","\\leftharpoondown",!0),ui(hi,pi,Si,"⇁","\\rightharpoondown",!0),ui(hi,pi,Si,"↖","\\nwarrow",!0),ui(hi,pi,Si,"⇌","\\rightleftharpoons",!0),ui(hi,gi,Si,"≮","\\nless",!0),ui(hi,gi,Si,"","\\@nleqslant"),ui(hi,gi,Si,"","\\@nleqq"),ui(hi,gi,Si,"⪇","\\lneq",!0),ui(hi,gi,Si,"≨","\\lneqq",!0),ui(hi,gi,Si,"","\\@lvertneqq"),ui(hi,gi,Si,"⋦","\\lnsim",!0),ui(hi,gi,Si,"⪉","\\lnapprox",!0),ui(hi,gi,Si,"⊀","\\nprec",!0),ui(hi,gi,Si,"⋠","\\npreceq",!0),ui(hi,gi,Si,"⋨","\\precnsim",!0),ui(hi,gi,Si,"⪹","\\precnapprox",!0),ui(hi,gi,Si,"≁","\\nsim",!0),ui(hi,gi,Si,"","\\@nshortmid"),ui(hi,gi,Si,"∤","\\nmid",!0),ui(hi,gi,Si,"⊬","\\nvdash",!0),ui(hi,gi,Si,"⊭","\\nvDash",!0),ui(hi,gi,Si,"⋪","\\ntriangleleft"),ui(hi,gi,Si,"⋬","\\ntrianglelefteq",!0),ui(hi,gi,Si,"⊊","\\subsetneq",!0),ui(hi,gi,Si,"","\\@varsubsetneq"),ui(hi,gi,Si,"⫋","\\subsetneqq",!0),ui(hi,gi,Si,"","\\@varsubsetneqq"),ui(hi,gi,Si,"≯","\\ngtr",!0),ui(hi,gi,Si,"","\\@ngeqslant"),ui(hi,gi,Si,"","\\@ngeqq"),ui(hi,gi,Si,"⪈","\\gneq",!0),ui(hi,gi,Si,"≩","\\gneqq",!0),ui(hi,gi,Si,"","\\@gvertneqq"),ui(hi,gi,Si,"⋧","\\gnsim",!0),ui(hi,gi,Si,"⪊","\\gnapprox",!0),ui(hi,gi,Si,"⊁","\\nsucc",!0),ui(hi,gi,Si,"⋡","\\nsucceq",!0),ui(hi,gi,Si,"⋩","\\succnsim",!0),ui(hi,gi,Si,"⪺","\\succnapprox",!0),ui(hi,gi,Si,"≆","\\ncong",!0),ui(hi,gi,Si,"","\\@nshortparallel"),ui(hi,gi,Si,"∦","\\nparallel",!0),ui(hi,gi,Si,"⊯","\\nVDash",!0),ui(hi,gi,Si,"⋫","\\ntriangleright"),ui(hi,gi,Si,"⋭","\\ntrianglerighteq",!0),ui(hi,gi,Si,"","\\@nsupseteqq"),ui(hi,gi,Si,"⊋","\\supsetneq",!0),ui(hi,gi,Si,"","\\@varsupsetneq"),ui(hi,gi,Si,"⫌","\\supsetneqq",!0),ui(hi,gi,Si,"","\\@varsupsetneqq"),ui(hi,gi,Si,"⊮","\\nVdash",!0),ui(hi,gi,Si,"⪵","\\precneqq",!0),ui(hi,gi,Si,"⪶","\\succneqq",!0),ui(hi,gi,Si,"","\\@nsubseteqq"),ui(hi,gi,vi,"⊴","\\unlhd"),ui(hi,gi,vi,"⊵","\\unrhd"),ui(hi,gi,Si,"↚","\\nleftarrow",!0),ui(hi,gi,Si,"↛","\\nrightarrow",!0),ui(hi,gi,Si,"⇍","\\nLeftarrow",!0),ui(hi,gi,Si,"⇏","\\nRightarrow",!0),ui(hi,gi,Si,"↮","\\nleftrightarrow",!0),ui(hi,gi,Si,"⇎","\\nLeftrightarrow",!0),ui(hi,gi,Si,"△","\\vartriangle"),ui(hi,gi,Bi,"ℏ","\\hslash"),ui(hi,gi,Bi,"▽","\\triangledown"),ui(hi,gi,Bi,"◊","\\lozenge"),ui(hi,gi,Bi,"Ⓢ","\\circledS"),ui(hi,gi,Bi,"®","\\circledR"),ui(mi,gi,Bi,"®","\\circledR"),ui(hi,gi,Bi,"∡","\\measuredangle",!0),ui(hi,gi,Bi,"∄","\\nexists"),ui(hi,gi,Bi,"℧","\\mho"),ui(hi,gi,Bi,"Ⅎ","\\Finv",!0),ui(hi,gi,Bi,"⅁","\\Game",!0),ui(hi,gi,Bi,"‵","\\backprime"),ui(hi,gi,Bi,"▲","\\blacktriangle"),ui(hi,gi,Bi,"▼","\\blacktriangledown"),ui(hi,gi,Bi,"■","\\blacksquare"),ui(hi,gi,Bi,"⧫","\\blacklozenge"),ui(hi,gi,Bi,"★","\\bigstar"),ui(hi,gi,Bi,"∢","\\sphericalangle",!0),ui(hi,gi,Bi,"∁","\\complement",!0),ui(hi,gi,Bi,"ð","\\eth",!0),ui(mi,pi,Bi,"ð","ð"),ui(hi,gi,Bi,"╱","\\diagup"),ui(hi,gi,Bi,"╲","\\diagdown"),ui(hi,gi,Bi,"□","\\square"),ui(hi,gi,Bi,"□","\\Box"),ui(hi,gi,Bi,"◊","\\Diamond"),ui(hi,gi,Bi,"¥","\\yen",!0),ui(mi,gi,Bi,"¥","\\yen",!0),ui(hi,gi,Bi,"✓","\\checkmark",!0),ui(mi,gi,Bi,"✓","\\checkmark"),ui(hi,gi,Bi,"ℶ","\\beth",!0),ui(hi,gi,Bi,"ℸ","\\daleth",!0),ui(hi,gi,Bi,"ℷ","\\gimel",!0),ui(hi,gi,Bi,"ϝ","\\digamma",!0),ui(hi,gi,Bi,"ϰ","\\varkappa"),ui(hi,gi,Ei,"┌","\\@ulcorner",!0),ui(hi,gi,bi,"┐","\\@urcorner",!0),ui(hi,gi,Ei,"└","\\@llcorner",!0),ui(hi,gi,bi,"┘","\\@lrcorner",!0),ui(hi,gi,Si,"≦","\\leqq",!0),ui(hi,gi,Si,"⩽","\\leqslant",!0),ui(hi,gi,Si,"⪕","\\eqslantless",!0),ui(hi,gi,Si,"≲","\\lesssim",!0),ui(hi,gi,Si,"⪅","\\lessapprox",!0),ui(hi,gi,Si,"≊","\\approxeq",!0),ui(hi,gi,vi,"⋖","\\lessdot"),ui(hi,gi,Si,"⋘","\\lll",!0),ui(hi,gi,Si,"≶","\\lessgtr",!0),ui(hi,gi,Si,"⋚","\\lesseqgtr",!0),ui(hi,gi,Si,"⪋","\\lesseqqgtr",!0),ui(hi,gi,Si,"≑","\\doteqdot"),ui(hi,gi,Si,"≓","\\risingdotseq",!0),ui(hi,gi,Si,"≒","\\fallingdotseq",!0),ui(hi,gi,Si,"∽","\\backsim",!0),ui(hi,gi,Si,"⋍","\\backsimeq",!0),ui(hi,gi,Si,"⫅","\\subseteqq",!0),ui(hi,gi,Si,"⋐","\\Subset",!0),ui(hi,gi,Si,"⊏","\\sqsubset",!0),ui(hi,gi,Si,"≼","\\preccurlyeq",!0),ui(hi,gi,Si,"⋞","\\curlyeqprec",!0),ui(hi,gi,Si,"≾","\\precsim",!0),ui(hi,gi,Si,"⪷","\\precapprox",!0),ui(hi,gi,Si,"⊲","\\vartriangleleft"),ui(hi,gi,Si,"⊴","\\trianglelefteq"),ui(hi,gi,Si,"⊨","\\vDash",!0),ui(hi,gi,Si,"⊪","\\Vvdash",!0),ui(hi,gi,Si,"⌣","\\smallsmile"),ui(hi,gi,Si,"⌢","\\smallfrown"),ui(hi,gi,Si,"≏","\\bumpeq",!0),ui(hi,gi,Si,"≎","\\Bumpeq",!0),ui(hi,gi,Si,"≧","\\geqq",!0),ui(hi,gi,Si,"⩾","\\geqslant",!0),ui(hi,gi,Si,"⪖","\\eqslantgtr",!0),ui(hi,gi,Si,"≳","\\gtrsim",!0),ui(hi,gi,Si,"⪆","\\gtrapprox",!0),ui(hi,gi,vi,"⋗","\\gtrdot"),ui(hi,gi,Si,"⋙","\\ggg",!0),ui(hi,gi,Si,"≷","\\gtrless",!0),ui(hi,gi,Si,"⋛","\\gtreqless",!0),ui(hi,gi,Si,"⪌","\\gtreqqless",!0),ui(hi,gi,Si,"≖","\\eqcirc",!0),ui(hi,gi,Si,"≗","\\circeq",!0),ui(hi,gi,Si,"≜","\\triangleq",!0),ui(hi,gi,Si,"∼","\\thicksim"),ui(hi,gi,Si,"≈","\\thickapprox"),ui(hi,gi,Si,"⫆","\\supseteqq",!0),ui(hi,gi,Si,"⋑","\\Supset",!0),ui(hi,gi,Si,"⊐","\\sqsupset",!0),ui(hi,gi,Si,"≽","\\succcurlyeq",!0),ui(hi,gi,Si,"⋟","\\curlyeqsucc",!0),ui(hi,gi,Si,"≿","\\succsim",!0),ui(hi,gi,Si,"⪸","\\succapprox",!0),ui(hi,gi,Si,"⊳","\\vartriangleright"),ui(hi,gi,Si,"⊵","\\trianglerighteq"),ui(hi,gi,Si,"⊩","\\Vdash",!0),ui(hi,gi,Si,"∣","\\shortmid"),ui(hi,gi,Si,"∥","\\shortparallel"),ui(hi,gi,Si,"≬","\\between",!0),ui(hi,gi,Si,"⋔","\\pitchfork",!0),ui(hi,gi,Si,"∝","\\varpropto"),ui(hi,gi,Si,"◀","\\blacktriangleleft"),ui(hi,gi,Si,"∴","\\therefore",!0),ui(hi,gi,Si,"∍","\\backepsilon"),ui(hi,gi,Si,"▶","\\blacktriangleright"),ui(hi,gi,Si,"∵","\\because",!0),ui(hi,gi,Si,"⋘","\\llless"),ui(hi,gi,Si,"⋙","\\gggtr"),ui(hi,gi,vi,"⊲","\\lhd"),ui(hi,gi,vi,"⊳","\\rhd"),ui(hi,gi,Si,"≂","\\eqsim",!0),ui(hi,pi,Si,"⋈","\\Join"),ui(hi,gi,Si,"≑","\\Doteq",!0),ui(hi,gi,vi,"∔","\\dotplus",!0),ui(hi,gi,vi,"∖","\\smallsetminus"),ui(hi,gi,vi,"⋒","\\Cap",!0),ui(hi,gi,vi,"⋓","\\Cup",!0),ui(hi,gi,vi,"⩞","\\doublebarwedge",!0),ui(hi,gi,vi,"⊟","\\boxminus",!0),ui(hi,gi,vi,"⊞","\\boxplus",!0),ui(hi,gi,vi,"⋇","\\divideontimes",!0),ui(hi,gi,vi,"⋉","\\ltimes",!0),ui(hi,gi,vi,"⋊","\\rtimes",!0),ui(hi,gi,vi,"⋋","\\leftthreetimes",!0),ui(hi,gi,vi,"⋌","\\rightthreetimes",!0),ui(hi,gi,vi,"⋏","\\curlywedge",!0),ui(hi,gi,vi,"⋎","\\curlyvee",!0),ui(hi,gi,vi,"⊝","\\circleddash",!0),ui(hi,gi,vi,"⊛","\\circledast",!0),ui(hi,gi,vi,"⋅","\\centerdot"),ui(hi,gi,vi,"⊺","\\intercal",!0),ui(hi,gi,vi,"⋒","\\doublecap"),ui(hi,gi,vi,"⋓","\\doublecup"),ui(hi,gi,vi,"⊠","\\boxtimes",!0),ui(hi,gi,Si,"⇢","\\dashrightarrow",!0),ui(hi,gi,Si,"⇠","\\dashleftarrow",!0),ui(hi,gi,Si,"⇇","\\leftleftarrows",!0),ui(hi,gi,Si,"⇆","\\leftrightarrows",!0),ui(hi,gi,Si,"⇚","\\Lleftarrow",!0),ui(hi,gi,Si,"↞","\\twoheadleftarrow",!0),ui(hi,gi,Si,"↢","\\leftarrowtail",!0),ui(hi,gi,Si,"↫","\\looparrowleft",!0),ui(hi,gi,Si,"⇋","\\leftrightharpoons",!0),ui(hi,gi,Si,"↶","\\curvearrowleft",!0),ui(hi,gi,Si,"↺","\\circlearrowleft",!0),ui(hi,gi,Si,"↰","\\Lsh",!0),ui(hi,gi,Si,"⇈","\\upuparrows",!0),ui(hi,gi,Si,"↿","\\upharpoonleft",!0),ui(hi,gi,Si,"⇃","\\downharpoonleft",!0),ui(hi,pi,Si,"⊶","\\origof",!0),ui(hi,pi,Si,"⊷","\\imageof",!0),ui(hi,gi,Si,"⊸","\\multimap",!0),ui(hi,gi,Si,"↭","\\leftrightsquigarrow",!0),ui(hi,gi,Si,"⇉","\\rightrightarrows",!0),ui(hi,gi,Si,"⇄","\\rightleftarrows",!0),ui(hi,gi,Si,"↠","\\twoheadrightarrow",!0),ui(hi,gi,Si,"↣","\\rightarrowtail",!0),ui(hi,gi,Si,"↬","\\looparrowright",!0),ui(hi,gi,Si,"↷","\\curvearrowright",!0),ui(hi,gi,Si,"↻","\\circlearrowright",!0),ui(hi,gi,Si,"↱","\\Rsh",!0),ui(hi,gi,Si,"⇊","\\downdownarrows",!0),ui(hi,gi,Si,"↾","\\upharpoonright",!0),ui(hi,gi,Si,"⇂","\\downharpoonright",!0),ui(hi,gi,Si,"⇝","\\rightsquigarrow",!0),ui(hi,gi,Si,"⇝","\\leadsto"),ui(hi,gi,Si,"⇛","\\Rrightarrow",!0),ui(hi,gi,Si,"↾","\\restriction"),ui(hi,pi,Bi,"‘","`"),ui(hi,pi,Bi,"$","\\$"),ui(mi,pi,Bi,"$","\\$"),ui(mi,pi,Bi,"$","\\textdollar"),ui(hi,pi,Bi,"%","\\%"),ui(mi,pi,Bi,"%","\\%"),ui(hi,pi,Bi,"_","\\_"),ui(mi,pi,Bi,"_","\\_"),ui(mi,pi,Bi,"_","\\textunderscore"),ui(hi,pi,Bi,"∠","\\angle",!0),ui(hi,pi,Bi,"∞","\\infty",!0),ui(hi,pi,Bi,"′","\\prime"),ui(hi,pi,Bi,"△","\\triangle"),ui(hi,pi,Bi,"Γ","\\Gamma",!0),ui(hi,pi,Bi,"Δ","\\Delta",!0),ui(hi,pi,Bi,"Θ","\\Theta",!0),ui(hi,pi,Bi,"Λ","\\Lambda",!0),ui(hi,pi,Bi,"Ξ","\\Xi",!0),ui(hi,pi,Bi,"Π","\\Pi",!0),ui(hi,pi,Bi,"Σ","\\Sigma",!0),ui(hi,pi,Bi,"Υ","\\Upsilon",!0),ui(hi,pi,Bi,"Φ","\\Phi",!0),ui(hi,pi,Bi,"Ψ","\\Psi",!0),ui(hi,pi,Bi,"Ω","\\Omega",!0),ui(hi,pi,Bi,"A","Α"),ui(hi,pi,Bi,"B","Β"),ui(hi,pi,Bi,"E","Ε"),ui(hi,pi,Bi,"Z","Ζ"),ui(hi,pi,Bi,"H","Η"),ui(hi,pi,Bi,"I","Ι"),ui(hi,pi,Bi,"K","Κ"),ui(hi,pi,Bi,"M","Μ"),ui(hi,pi,Bi,"N","Ν"),ui(hi,pi,Bi,"O","Ο"),ui(hi,pi,Bi,"P","Ρ"),ui(hi,pi,Bi,"T","Τ"),ui(hi,pi,Bi,"X","Χ"),ui(hi,pi,Bi,"¬","\\neg",!0),ui(hi,pi,Bi,"¬","\\lnot"),ui(hi,pi,Bi,"⊤","\\top"),ui(hi,pi,Bi,"⊥","\\bot"),ui(hi,pi,Bi,"∅","\\emptyset"),ui(hi,gi,Bi,"∅","\\varnothing"),ui(hi,pi,wi,"α","\\alpha",!0),ui(hi,pi,wi,"β","\\beta",!0),ui(hi,pi,wi,"γ","\\gamma",!0),ui(hi,pi,wi,"δ","\\delta",!0),ui(hi,pi,wi,"ϵ","\\epsilon",!0),ui(hi,pi,wi,"ζ","\\zeta",!0),ui(hi,pi,wi,"η","\\eta",!0),ui(hi,pi,wi,"θ","\\theta",!0),ui(hi,pi,wi,"ι","\\iota",!0),ui(hi,pi,wi,"κ","\\kappa",!0),ui(hi,pi,wi,"λ","\\lambda",!0),ui(hi,pi,wi,"μ","\\mu",!0),ui(hi,pi,wi,"ν","\\nu",!0),ui(hi,pi,wi,"ξ","\\xi",!0),ui(hi,pi,wi,"ο","\\omicron",!0),ui(hi,pi,wi,"π","\\pi",!0),ui(hi,pi,wi,"ρ","\\rho",!0),ui(hi,pi,wi,"σ","\\sigma",!0),ui(hi,pi,wi,"τ","\\tau",!0),ui(hi,pi,wi,"υ","\\upsilon",!0),ui(hi,pi,wi,"ϕ","\\phi",!0),ui(hi,pi,wi,"χ","\\chi",!0),ui(hi,pi,wi,"ψ","\\psi",!0),ui(hi,pi,wi,"ω","\\omega",!0),ui(hi,pi,wi,"ε","\\varepsilon",!0),ui(hi,pi,wi,"ϑ","\\vartheta",!0),ui(hi,pi,wi,"ϖ","\\varpi",!0),ui(hi,pi,wi,"ϱ","\\varrho",!0),ui(hi,pi,wi,"ς","\\varsigma",!0),ui(hi,pi,wi,"φ","\\varphi",!0),ui(hi,pi,vi,"∗","*",!0),ui(hi,pi,vi,"+","+"),ui(hi,pi,vi,"−","-",!0),ui(hi,pi,vi,"⋅","\\cdot",!0),ui(hi,pi,vi,"∘","\\circ",!0),ui(hi,pi,vi,"÷","\\div",!0),ui(hi,pi,vi,"±","\\pm",!0),ui(hi,pi,vi,"×","\\times",!0),ui(hi,pi,vi,"∩","\\cap",!0),ui(hi,pi,vi,"∪","\\cup",!0),ui(hi,pi,vi,"∖","\\setminus",!0),ui(hi,pi,vi,"∧","\\land"),ui(hi,pi,vi,"∨","\\lor"),ui(hi,pi,vi,"∧","\\wedge",!0),ui(hi,pi,vi,"∨","\\vee",!0),ui(hi,pi,Bi,"√","\\surd"),ui(hi,pi,Ei,"⟨","\\langle",!0),ui(hi,pi,Ei,"∣","\\lvert"),ui(hi,pi,Ei,"∥","\\lVert"),ui(hi,pi,bi,"?","?"),ui(hi,pi,bi,"!","!"),ui(hi,pi,bi,"⟩","\\rangle",!0),ui(hi,pi,bi,"∣","\\rvert"),ui(hi,pi,bi,"∥","\\rVert"),ui(hi,pi,Si,"=","="),ui(hi,pi,Si,":",":"),ui(hi,pi,Si,"≈","\\approx",!0),ui(hi,pi,Si,"≅","\\cong",!0),ui(hi,pi,Si,"≥","\\ge"),ui(hi,pi,Si,"≥","\\geq",!0),ui(hi,pi,Si,"←","\\gets"),ui(hi,pi,Si,">","\\gt",!0),ui(hi,pi,Si,"∈","\\in",!0),ui(hi,pi,Si,"","\\@not"),ui(hi,pi,Si,"⊂","\\subset",!0),ui(hi,pi,Si,"⊃","\\supset",!0),ui(hi,pi,Si,"⊆","\\subseteq",!0),ui(hi,pi,Si,"⊇","\\supseteq",!0),ui(hi,gi,Si,"⊈","\\nsubseteq",!0),ui(hi,gi,Si,"⊉","\\nsupseteq",!0),ui(hi,pi,Si,"⊨","\\models"),ui(hi,pi,Si,"←","\\leftarrow",!0),ui(hi,pi,Si,"≤","\\le"),ui(hi,pi,Si,"≤","\\leq",!0),ui(hi,pi,Si,"<","\\lt",!0),ui(hi,pi,Si,"→","\\rightarrow",!0),ui(hi,pi,Si,"→","\\to"),ui(hi,gi,Si,"≱","\\ngeq",!0),ui(hi,gi,Si,"≰","\\nleq",!0),ui(hi,pi,Ti," ","\\ "),ui(hi,pi,Ti," ","\\space"),ui(hi,pi,Ti," ","\\nobreakspace"),ui(mi,pi,Ti," ","\\ "),ui(mi,pi,Ti," "," "),ui(mi,pi,Ti," ","\\space"),ui(mi,pi,Ti," ","\\nobreakspace"),ui(hi,pi,Ti,null,"\\nobreak"),ui(hi,pi,Ti,null,"\\allowbreak"),ui(hi,pi,ki,",",","),ui(hi,pi,ki,";",";"),ui(hi,gi,vi,"⊼","\\barwedge",!0),ui(hi,gi,vi,"⊻","\\veebar",!0),ui(hi,pi,vi,"⊙","\\odot",!0),ui(hi,pi,vi,"⊕","\\oplus",!0),ui(hi,pi,vi,"⊗","\\otimes",!0),ui(hi,pi,Bi,"∂","\\partial",!0),ui(hi,pi,vi,"⊘","\\oslash",!0),ui(hi,gi,vi,"⊚","\\circledcirc",!0),ui(hi,gi,vi,"⊡","\\boxdot",!0),ui(hi,pi,vi,"△","\\bigtriangleup"),ui(hi,pi,vi,"▽","\\bigtriangledown"),ui(hi,pi,vi,"†","\\dagger"),ui(hi,pi,vi,"⋄","\\diamond"),ui(hi,pi,vi,"⋆","\\star"),ui(hi,pi,vi,"◃","\\triangleleft"),ui(hi,pi,vi,"▹","\\triangleright"),ui(hi,pi,Ei,"{","\\{"),ui(mi,pi,Bi,"{","\\{"),ui(mi,pi,Bi,"{","\\textbraceleft"),ui(hi,pi,bi,"}","\\}"),ui(mi,pi,Bi,"}","\\}"),ui(mi,pi,Bi,"}","\\textbraceright"),ui(hi,pi,Ei,"{","\\lbrace"),ui(hi,pi,bi,"}","\\rbrace"),ui(hi,pi,Ei,"[","\\lbrack",!0),ui(mi,pi,Bi,"[","\\lbrack",!0),ui(hi,pi,bi,"]","\\rbrack",!0),ui(mi,pi,Bi,"]","\\rbrack",!0),ui(hi,pi,Ei,"(","\\lparen",!0),ui(hi,pi,bi,")","\\rparen",!0),ui(mi,pi,Bi,"<","\\textless",!0),ui(mi,pi,Bi,">","\\textgreater",!0),ui(hi,pi,Ei,"⌊","\\lfloor",!0),ui(hi,pi,bi,"⌋","\\rfloor",!0),ui(hi,pi,Ei,"⌈","\\lceil",!0),ui(hi,pi,bi,"⌉","\\rceil",!0),ui(hi,pi,Bi,"\\","\\backslash"),ui(hi,pi,Bi,"∣","|"),ui(hi,pi,Bi,"∣","\\vert"),ui(mi,pi,Bi,"|","\\textbar",!0),ui(hi,pi,Bi,"∥","\\|"),ui(hi,pi,Bi,"∥","\\Vert"),ui(mi,pi,Bi,"∥","\\textbardbl"),ui(mi,pi,Bi,"~","\\textasciitilde"),ui(mi,pi,Bi,"\\","\\textbackslash"),ui(mi,pi,Bi,"^","\\textasciicircum"),ui(hi,pi,Si,"↑","\\uparrow",!0),ui(hi,pi,Si,"⇑","\\Uparrow",!0),ui(hi,pi,Si,"↓","\\downarrow",!0),ui(hi,pi,Si,"⇓","\\Downarrow",!0),ui(hi,pi,Si,"↕","\\updownarrow",!0),ui(hi,pi,Si,"⇕","\\Updownarrow",!0),ui(hi,pi,xi,"∐","\\coprod"),ui(hi,pi,xi,"⋁","\\bigvee"),ui(hi,pi,xi,"⋀","\\bigwedge"),ui(hi,pi,xi,"⨄","\\biguplus"),ui(hi,pi,xi,"⋂","\\bigcap"),ui(hi,pi,xi,"⋃","\\bigcup"),ui(hi,pi,xi,"∫","\\int"),ui(hi,pi,xi,"∫","\\intop"),ui(hi,pi,xi,"∬","\\iint"),ui(hi,pi,xi,"∭","\\iiint"),ui(hi,pi,xi,"∏","\\prod"),ui(hi,pi,xi,"∑","\\sum"),ui(hi,pi,xi,"⨂","\\bigotimes"),ui(hi,pi,xi,"⨁","\\bigoplus"),ui(hi,pi,xi,"⨀","\\bigodot"),ui(hi,pi,xi,"∮","\\oint"),ui(hi,pi,xi,"∯","\\oiint"),ui(hi,pi,xi,"∰","\\oiiint"),ui(hi,pi,xi,"⨆","\\bigsqcup"),ui(hi,pi,xi,"∫","\\smallint"),ui(mi,pi,yi,"…","\\textellipsis"),ui(hi,pi,yi,"…","\\mathellipsis"),ui(mi,pi,yi,"…","\\ldots",!0),ui(hi,pi,yi,"…","\\ldots",!0),ui(hi,pi,yi,"⋯","\\@cdots",!0),ui(hi,pi,yi,"⋱","\\ddots",!0),ui(hi,pi,Bi,"⋮","\\varvdots"),ui(hi,pi,fi,"ˊ","\\acute"),ui(hi,pi,fi,"ˋ","\\grave"),ui(hi,pi,fi,"¨","\\ddot"),ui(hi,pi,fi,"~","\\tilde"),ui(hi,pi,fi,"ˉ","\\bar"),ui(hi,pi,fi,"˘","\\breve"),ui(hi,pi,fi,"ˇ","\\check"),ui(hi,pi,fi,"^","\\hat"),ui(hi,pi,fi,"⃗","\\vec"),ui(hi,pi,fi,"˙","\\dot"),ui(hi,pi,fi,"˚","\\mathring"),ui(hi,pi,wi,"","\\@imath"),ui(hi,pi,wi,"","\\@jmath"),ui(hi,pi,Bi,"ı","ı"),ui(hi,pi,Bi,"ȷ","ȷ"),ui(mi,pi,Bi,"ı","\\i",!0),ui(mi,pi,Bi,"ȷ","\\j",!0),ui(mi,pi,Bi,"ß","\\ss",!0),ui(mi,pi,Bi,"æ","\\ae",!0),ui(mi,pi,Bi,"œ","\\oe",!0),ui(mi,pi,Bi,"ø","\\o",!0),ui(mi,pi,Bi,"Æ","\\AE",!0),ui(mi,pi,Bi,"Œ","\\OE",!0),ui(mi,pi,Bi,"Ø","\\O",!0),ui(mi,pi,fi,"ˊ","\\'"),ui(mi,pi,fi,"ˋ","\\`"),ui(mi,pi,fi,"ˆ","\\^"),ui(mi,pi,fi,"˜","\\~"),ui(mi,pi,fi,"ˉ","\\="),ui(mi,pi,fi,"˘","\\u"),ui(mi,pi,fi,"˙","\\."),ui(mi,pi,fi,"¸","\\c"),ui(mi,pi,fi,"˚","\\r"),ui(mi,pi,fi,"ˇ","\\v"),ui(mi,pi,fi,"¨",'\\"'),ui(mi,pi,fi,"˝","\\H"),ui(mi,pi,fi,"◯","\\textcircled");var _i={"--":!0,"---":!0,"``":!0,"''":!0};ui(mi,pi,Bi,"–","--",!0),ui(mi,pi,Bi,"–","\\textendash"),ui(mi,pi,Bi,"—","---",!0),ui(mi,pi,Bi,"—","\\textemdash"),ui(mi,pi,Bi,"‘","`",!0),ui(mi,pi,Bi,"‘","\\textquoteleft"),ui(mi,pi,Bi,"’","'",!0),ui(mi,pi,Bi,"’","\\textquoteright"),ui(mi,pi,Bi,"“","``",!0),ui(mi,pi,Bi,"“","\\textquotedblleft"),ui(mi,pi,Bi,"”","''",!0),ui(mi,pi,Bi,"”","\\textquotedblright"),ui(hi,pi,Bi,"°","\\degree",!0),ui(mi,pi,Bi,"°","\\degree"),ui(mi,pi,Bi,"°","\\textdegree",!0),ui(hi,pi,Bi,"£","\\pounds"),ui(hi,pi,Bi,"£","\\mathsterling",!0),ui(mi,pi,Bi,"£","\\pounds"),ui(mi,pi,Bi,"£","\\textsterling",!0),ui(hi,gi,Bi,"✠","\\maltese"),ui(mi,gi,Bi,"✠","\\maltese");for(var Ci='0123456789/@."',Ni=0;Ni<14;Ni++){var Mi=Ci.charAt(Ni);ui(hi,pi,Bi,Mi,Mi)}for(var Ai='0123456789!@*()-=+";:?/.,',Oi=0;Oi<25;Oi++){var zi=Ai.charAt(Oi);ui(mi,pi,Bi,zi,zi)}for(var Ri="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ii=0;Ii<52;Ii++){var Li=Ri.charAt(Ii);ui(hi,pi,wi,Li,Li),ui(mi,pi,Bi,Li,Li)}ui(hi,gi,Bi,"C","ℂ"),ui(mi,gi,Bi,"C","ℂ"),ui(hi,gi,Bi,"H","ℍ"),ui(mi,gi,Bi,"H","ℍ"),ui(hi,gi,Bi,"N","ℕ"),ui(mi,gi,Bi,"N","ℕ"),ui(hi,gi,Bi,"P","ℙ"),ui(mi,gi,Bi,"P","ℙ"),ui(hi,gi,Bi,"Q","ℚ"),ui(mi,gi,Bi,"Q","ℚ"),ui(hi,gi,Bi,"R","ℝ"),ui(mi,gi,Bi,"R","ℝ"),ui(hi,gi,Bi,"Z","ℤ"),ui(mi,gi,Bi,"Z","ℤ"),ui(hi,pi,wi,"h","ℎ"),ui(mi,pi,wi,"h","ℎ");for(var Di="",Fi=0;Fi<52;Fi++){var Pi=Ri.charAt(Fi);ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56320+Fi)),ui(mi,pi,Bi,Pi,Di),ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56372+Fi)),ui(mi,pi,Bi,Pi,Di),ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56424+Fi)),ui(mi,pi,Bi,Pi,Di),ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56580+Fi)),ui(mi,pi,Bi,Pi,Di),ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56684+Fi)),ui(mi,pi,Bi,Pi,Di),ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56736+Fi)),ui(mi,pi,Bi,Pi,Di),ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56788+Fi)),ui(mi,pi,Bi,Pi,Di),ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56840+Fi)),ui(mi,pi,Bi,Pi,Di),ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56944+Fi)),ui(mi,pi,Bi,Pi,Di),Fi<26&&(ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56632+Fi)),ui(mi,pi,Bi,Pi,Di),ui(hi,pi,wi,Pi,Di=String.fromCharCode(55349,56476+Fi)),ui(mi,pi,Bi,Pi,Di))}ui(hi,pi,wi,"k",Di=String.fromCharCode(55349,56668)),ui(mi,pi,Bi,"k",Di);for(var qi=0;qi<10;qi++){var Hi=qi.toString();ui(hi,pi,wi,Hi,Di=String.fromCharCode(55349,57294+qi)),ui(mi,pi,Bi,Hi,Di),ui(hi,pi,wi,Hi,Di=String.fromCharCode(55349,57314+qi)),ui(mi,pi,Bi,Hi,Di),ui(hi,pi,wi,Hi,Di=String.fromCharCode(55349,57324+qi)),ui(mi,pi,Bi,Hi,Di),ui(hi,pi,wi,Hi,Di=String.fromCharCode(55349,57334+qi)),ui(mi,pi,Bi,Hi,Di)}for(var $i="ÐÞþ",Vi=0;Vi<3;Vi++){var Ui=$i.charAt(Vi);ui(hi,pi,wi,Ui,Ui),ui(mi,pi,Bi,Ui,Ui)}var ji=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Wi=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Ki=function(e,t,r){return di[r][e]&&di[r][e].replace&&(e=di[r][e].replace),{value:e,metrics:Fo(e,t,r)}},Gi=function(e,t,r,n,a){var o,i=Ki(e,t,r),l=i.metrics;if(e=i.value,l){var s=l.italic;("text"===r||n&&"mathit"===n.font)&&(s=0),o=new ni(e,l.height,l.depth,s,l.skew,l.width,a)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+r+"'"),o=new ni(e,0,0,0,0,0,a);if(n){o.maxFontSize=n.sizeMultiplier,n.style.isTight()&&o.classes.push("mtight");var c=n.getColor();c&&(o.style.color=c)}return o},Zi=(e,t)=>{if(Zo(e.classes)!==Zo(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var r=e.classes[0];if("mbin"===r||"mord"===r)return!1}for(var n in e.style)if(e.style.hasOwnProperty(n)&&e.style[n]!==t.style[n])return!1;for(var a in t.style)if(t.style.hasOwnProperty(a)&&e.style[a]!==t.style[a])return!1;return!0},Xi=function(e){for(var t=0,r=0,n=0,a=0;a<e.children.length;a++){var o=e.children[a];o.height>t&&(t=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>n&&(n=o.maxFontSize)}e.height=t,e.depth=r,e.maxFontSize=n},Yi=function(e,t,r,n){var a=new Jo(e,t,r,n);return Xi(a),a},Qi=(e,t,r,n)=>new Jo(e,t,r,n),Ji=function(e){var t=new Ro(e);return Xi(t),t},el=function(e,t,r){var n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}return n+"-"+("textbf"===t&&"textit"===r?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},tl={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},rl={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},nl={fontMap:tl,makeSymbol:Gi,mathsym:function(e,t,r,n){return void 0===n&&(n=[]),"boldsymbol"===r.font&&Ki(e,"Main-Bold",t).metrics?Gi(e,"Main-Bold",t,r,n.concat(["mathbf"])):"\\"===e||"main"===di[t][e].font?Gi(e,"Main-Regular",t,r,n):Gi(e,"AMS-Regular",t,r,n.concat(["amsrm"]))},makeSpan:Yi,makeSvgSpan:Qi,makeLineSpan:function(e,t,r){var n=Yi([e],[],t);return n.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=Go(n.height),n.maxFontSize=1,n},makeAnchor:function(e,t,r,n){var a=new ei(e,t,r,n);return Xi(a),a},makeFragment:Ji,wrapFragment:function(e,t){return e instanceof Ro?Yi([],[e],t):e},makeVList:function(e,t){for(var{children:r,depth:n}=function(e){if("individualShift"===e.positionType){for(var t=e.children,r=[t[0]],n=-t[0].shift-t[0].elem.depth,a=n,o=1;o<t.length;o++){var i=-t[o].shift-a-t[o].elem.depth,l=i-(t[o-1].elem.height+t[o-1].elem.depth);a+=i,r.push({type:"kern",size:l}),r.push(t[o])}return{children:r,depth:n}}var s;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}s=c}else if("bottom"===e.positionType)s=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)s=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");s=-h.elem.depth}}return{children:e.children,depth:s}}(e),a=0,o=0;o<r.length;o++){var i=r[o];if("elem"===i.type){var l=i.elem;a=Math.max(a,l.maxFontSize,l.height)}}a+=2;var s=Yi(["pstrut"],[]);s.style.height=Go(a);for(var c=[],d=n,u=n,h=n,m=0;m<r.length;m++){var p=r[m];if("kern"===p.type)h+=p.size;else{var g=p.elem,f=p.wrapperClasses||[],v=p.wrapperStyle||{},b=Yi(f,[s,g],void 0,v);b.style.top=Go(-a-h-g.depth),p.marginLeft&&(b.style.marginLeft=p.marginLeft),p.marginRight&&(b.style.marginRight=p.marginRight),c.push(b),h+=g.height+g.depth}d=Math.min(d,h),u=Math.max(u,h)}var y,w=Yi(["vlist"],c);if(w.style.height=Go(u),d<0){var x=Yi([],[]),E=Yi(["vlist"],[x]);E.style.height=Go(-d);var k=Yi(["vlist-s"],[new ni("​")]);y=[Yi(["vlist-r"],[w,k]),Yi(["vlist-r"],[E])]}else y=[Yi(["vlist-r"],[w])];var S=Yi(["vlist-t"],y);return 2===y.length&&S.classes.push("vlist-t2"),S.height=u,S.depth=-d,S},makeOrd:function(e,t,r){var n=e.mode,a=e.text,o=["mord"],i="math"===n||"text"===n&&t.font,l=i?t.font:t.fontFamily,s="",c="";if(55349===a.charCodeAt(0)&&([s,c]=function(e,t){var r=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,n="math"===t?0:1;if(119808<=r&&r<120484){var a=Math.floor((r-119808)/26);return[ji[a][2],ji[a][n]]}if(120782<=r&&r<=120831){var o=Math.floor((r-120782)/10);return[Wi[o][2],Wi[o][n]]}if(120485===r||120486===r)return[ji[0][2],ji[0][n]];if(120486<r&&r<120782)return["",""];throw new uo("Unsupported character: "+e)}(a,n)),s.length>0)return Gi(a,s,n,t,o.concat(c));if(l){var d,u;if("boldsymbol"===l){var h=function(e,t,r,n,a){return"textord"!==a&&Ki(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(a,n,0,0,r);d=h.fontName,u=[h.fontClass]}else i?(d=tl[l].fontName,u=[l]):(d=el(l,t.fontWeight,t.fontShape),u=[l,t.fontWeight,t.fontShape]);if(Ki(a,d,n).metrics)return Gi(a,d,n,t,o.concat(u));if(_i.hasOwnProperty(a)&&"Typewriter"===d.slice(0,10)){for(var m=[],p=0;p<a.length;p++)m.push(Gi(a[p],d,n,t,o.concat(u)));return Ji(m)}}if("mathord"===r)return Gi(a,"Math-Italic",n,t,o.concat(["mathnormal"]));if("textord"===r){var g=di[n][a]&&di[n][a].font;if("ams"===g){var f=el("amsrm",t.fontWeight,t.fontShape);return Gi(a,f,n,t,o.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==g&&g){var v=el(g,t.fontWeight,t.fontShape);return Gi(a,v,n,t,o.concat(v,t.fontWeight,t.fontShape))}var b=el("textrm",t.fontWeight,t.fontShape);return Gi(a,b,n,t,o.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+r+" in makeOrd")},makeGlue:(e,t)=>{var r=Yi(["mspace"],[],t),n=Ko(e,t);return r.style.marginRight=Go(n),r},staticSvg:function(e,t){var[r,n,a]=rl[e],o=new oi(r),i=new ai([o],{width:Go(n),height:Go(a),style:"width:"+Go(n),viewBox:"0 0 "+1e3*n+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Qi(["overlay"],[i],t);return l.height=a,l.style.height=Go(a),l.style.width=Go(n),l},svgData:rl,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var r=e[t],n=e[t+1];r instanceof ni&&n instanceof ni&&Zi(r,n)&&(r.text+=n.text,r.height=Math.max(r.height,n.height),r.depth=Math.max(r.depth,n.depth),r.italic=n.italic,e.splice(t+1,1),t--)}return e}},al={number:3,unit:"mu"},ol={number:4,unit:"mu"},il={number:5,unit:"mu"},ll={mord:{mop:al,mbin:ol,mrel:il,minner:al},mop:{mord:al,mop:al,mrel:il,minner:al},mbin:{mord:ol,mop:ol,mopen:ol,minner:ol},mrel:{mord:il,mop:il,mopen:il,minner:il},mopen:{},mclose:{mop:al,mbin:ol,mrel:il,minner:al},mpunct:{mord:al,mop:al,mrel:il,mopen:al,mclose:al,mpunct:al,minner:al},minner:{mord:al,mop:al,mbin:ol,mrel:il,mopen:al,mpunct:al,minner:al}},sl={mord:{mop:al},mop:{mord:al,mop:al},mbin:{},mrel:{},mopen:{},mclose:{mop:al},mpunct:{},minner:{mop:al}},cl={},dl={},ul={};function hl(e){for(var{type:t,names:r,props:n,handler:a,htmlBuilder:o,mathmlBuilder:i}=e,l={type:t,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:void 0===n.allowedInMath||n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:a},s=0;s<r.length;++s)cl[r[s]]=l;t&&(o&&(dl[t]=o),i&&(ul[t]=i))}function ml(e){var{type:t,htmlBuilder:r,mathmlBuilder:n}=e;hl({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:r,mathmlBuilder:n})}var pl=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},gl=function(e){return"ordgroup"===e.type?e.body:[e]},fl=nl.makeSpan,vl=["leftmost","mbin","mopen","mrel","mop","mpunct"],bl=["rightmost","mrel","mclose","mpunct"],yl={display:Co.DISPLAY,text:Co.TEXT,script:Co.SCRIPT,scriptscript:Co.SCRIPTSCRIPT},wl={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},xl=function(e,t,r,n){void 0===n&&(n=[null,null]);for(var a=[],o=0;o<e.length;o++){var i=_l(e[o],t);if(i instanceof Ro){var l=i.children;a.push(...l)}else a.push(i)}if(nl.tryCombineChars(a),!r)return a;var s=t;if(1===e.length){var c=e[0];"sizing"===c.type?s=t.havingSize(c.size):"styling"===c.type&&(s=t.havingStyle(yl[c.style]))}var d=fl([n[0]||"leftmost"],[],t),u=fl([n[1]||"rightmost"],[],t),h="root"===r;return El(a,((e,t)=>{var r=t.classes[0],n=e.classes[0];"mbin"===r&&fo.contains(bl,n)?t.classes[0]="mord":"mbin"===n&&fo.contains(vl,r)&&(e.classes[0]="mord")}),{node:d},u,h),El(a,((e,t)=>{var r=Tl(t),n=Tl(e),a=r&&n?e.hasClass("mtight")?sl[r][n]:ll[r][n]:null;if(a)return nl.makeGlue(a,s)}),{node:d},u,h),a},El=function e(t,r,n,a,o){a&&t.push(a);for(var i=0;i<t.length;i++){var l=t[i],s=kl(l);if(s)e(s.children,r,n,null,o);else{var c=!l.hasClass("mspace");if(c){var d=r(l,n.node);d&&(n.insertAfter?n.insertAfter(d):(t.unshift(d),i++))}c?n.node=l:o&&l.hasClass("newline")&&(n.node=fl(["leftmost"])),n.insertAfter=(e=>r=>{t.splice(e+1,0,r),i++})(i)}}a&&t.pop()},kl=function(e){return e instanceof Ro||e instanceof ei||e instanceof Jo&&e.hasClass("enclosing")?e:null},Sl=function e(t,r){var n=kl(t);if(n){var a=n.children;if(a.length){if("right"===r)return e(a[a.length-1],"right");if("left"===r)return e(a[0],"left")}}return t},Tl=function(e,t){return e?(t&&(e=Sl(e,t)),wl[e.classes[0]]||null):null},Bl=function(e,t){var r=["nulldelimiter"].concat(e.baseSizingClasses());return fl(t.concat(r))},_l=function(e,t,r){if(!e)return fl();if(dl[e.type]){var n=dl[e.type](e,t);if(r&&t.size!==r.size){n=fl(t.sizingClasses(r),[n],t);var a=t.sizeMultiplier/r.sizeMultiplier;n.height*=a,n.depth*=a}return n}throw new uo("Got group of unknown type: '"+e.type+"'")};function Cl(e,t){var r=fl(["base"],e,t),n=fl(["strut"]);return n.style.height=Go(r.height+r.depth),r.depth&&(n.style.verticalAlign=Go(-r.depth)),r.children.unshift(n),r}function Nl(e,t){var r=null;1===e.length&&"tag"===e[0].type&&(r=e[0].tag,e=e[0].body);var n,a=xl(e,t,"root");2===a.length&&a[1].hasClass("tag")&&(n=a.pop());for(var o,i=[],l=[],s=0;s<a.length;s++)if(l.push(a[s]),a[s].hasClass("mbin")||a[s].hasClass("mrel")||a[s].hasClass("allowbreak")){for(var c=!1;s<a.length-1&&a[s+1].hasClass("mspace")&&!a[s+1].hasClass("newline");)s++,l.push(a[s]),a[s].hasClass("nobreak")&&(c=!0);c||(i.push(Cl(l,t)),l=[])}else a[s].hasClass("newline")&&(l.pop(),l.length>0&&(i.push(Cl(l,t)),l=[]),i.push(a[s]));l.length>0&&i.push(Cl(l,t)),r?((o=Cl(xl(r,t,!0))).classes=["tag"],i.push(o)):n&&i.push(n);var d=fl(["katex-html"],i);if(d.setAttribute("aria-hidden","true"),o){var u=o.children[0];u.style.height=Go(d.height+d.depth),d.depth&&(u.style.verticalAlign=Go(-d.depth))}return d}function Ml(e){return new Ro(e)}class Al{constructor(e,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Zo(this.classes));for(var r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=fo.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+fo.escape(Zo(this.classes))+'"'),e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</"+this.type+">"}toText(){return this.children.map((e=>e.toText())).join("")}}class Ol{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return fo.escape(this.toText())}toText(){return this.text}}var zl={MathNode:Al,TextNode:Ol,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?"  ":e>=-.05556&&e<=-.05555?" ⁣":e>=-.1667&&e<=-.1666?" ⁣":e>=-.2223&&e<=-.2222?" ⁣":e>=-.2778&&e<=-.2777?" ⁣":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Go(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Go(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:Ml},Rl=function(e,t,r){return!di[t][e]||!di[t][e].replace||55349===e.charCodeAt(0)||_i.hasOwnProperty(e)&&r&&(r.fontFamily&&"tt"===r.fontFamily.slice(4,6)||r.font&&"tt"===r.font.slice(4,6))||(e=di[t][e].replace),new zl.TextNode(e)},Il=function(e){return 1===e.length?e[0]:new zl.MathNode("mrow",e)},Ll=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var r=t.font;if(!r||"mathnormal"===r)return null;var n=e.mode;if("mathit"===r)return"italic";if("boldsymbol"===r)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===r)return"bold";if("mathbb"===r)return"double-struck";if("mathfrak"===r)return"fraktur";if("mathscr"===r||"mathcal"===r)return"script";if("mathsf"===r)return"sans-serif";if("mathtt"===r)return"monospace";var a=e.text;return fo.contains(["\\imath","\\jmath"],a)?null:(di[n][a]&&di[n][a].replace&&(a=di[n][a].replace),Fo(a,nl.fontMap[r].fontName,n)?nl.fontMap[r].variant:null)},Dl=function(e,t,r){if(1===e.length){var n=Pl(e[0],t);return r&&n instanceof Al&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var a,o=[],i=0;i<e.length;i++){var l=Pl(e[i],t);if(l instanceof Al&&a instanceof Al){if("mtext"===l.type&&"mtext"===a.type&&l.getAttribute("mathvariant")===a.getAttribute("mathvariant")){a.children.push(...l.children);continue}if("mn"===l.type&&"mn"===a.type){a.children.push(...l.children);continue}if("mi"===l.type&&1===l.children.length&&"mn"===a.type){var s=l.children[0];if(s instanceof Ol&&"."===s.text){a.children.push(...l.children);continue}}else if("mi"===a.type&&1===a.children.length){var c=a.children[0];if(c instanceof Ol&&"̸"===c.text&&("mo"===l.type||"mi"===l.type||"mn"===l.type)){var d=l.children[0];d instanceof Ol&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),o.pop())}}}o.push(l),a=l}return o},Fl=function(e,t,r){return Il(Dl(e,t,r))},Pl=function(e,t){if(!e)return new zl.MathNode("mrow");if(ul[e.type])return ul[e.type](e,t);throw new uo("Got group of unknown type: '"+e.type+"'")};function ql(e,t,r,n,a){var o,i=Dl(e,r);o=1===i.length&&i[0]instanceof Al&&fo.contains(["mrow","mtable"],i[0].type)?i[0]:new zl.MathNode("mrow",i);var l=new zl.MathNode("annotation",[new zl.TextNode(t)]);l.setAttribute("encoding","application/x-tex");var s=new zl.MathNode("semantics",[o,l]),c=new zl.MathNode("math",[s]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var d=a?"katex":"katex-mathml";return nl.makeSpan([d],[c])}var Hl=function(e){return new Vo({style:e.displayMode?Co.DISPLAY:Co.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},$l=function(e,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),e=nl.makeSpan(r,[e])}return e},Vl={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ul={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},jl=function(e,t,r,n,a){var o,i=e.height+e.depth+r+n;if(/fbox|color|angl/.test(t)){if(o=nl.makeSpan(["stretchy",t],[],a),"fbox"===t){var l=a.color&&a.getColor();l&&(o.style.borderColor=l)}}else{var s=[];/^[bx]cancel$/.test(t)&&s.push(new ii({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&s.push(new ii({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new ai(s,{width:"100%",height:Go(i)});o=nl.makeSvgSpan([],[c],a)}return o.height=i,o.style.height=Go(i),o},Wl=function(e){var t=new zl.MathNode("mo",[new zl.TextNode(Vl[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Kl=function(e,t){var{span:r,minWidth:n,height:a}=function(){var r=4e5,n=e.label.slice(1);if(fo.contains(["widehat","widecheck","widetilde","utilde"],n)){var a,o,i,l="ordgroup"===(m=e.base).type?m.body.length:1;if(l>5)"widehat"===n||"widecheck"===n?(a=420,r=2364,i=.42,o=n+"4"):(a=312,r=2340,i=.34,o="tilde4");else{var s=[1,1,2,2,3,3][l];"widehat"===n||"widecheck"===n?(r=[0,1062,2364,2364,2364][s],a=[0,239,300,360,420][s],i=[0,.24,.3,.3,.36,.42][s],o=n+s):(r=[0,600,1033,2339,2340][s],a=[0,260,286,306,312][s],i=[0,.26,.286,.3,.306,.34][s],o="tilde"+s)}var c=new oi(o),d=new ai([c],{width:"100%",height:Go(i),viewBox:"0 0 "+r+" "+a,preserveAspectRatio:"none"});return{span:nl.makeSvgSpan([],[d],t),minWidth:0,height:i}}var u,h,m,p=[],g=Ul[n],[f,v,b]=g,y=b/1e3,w=f.length;if(1===w)u=["hide-tail"],h=[g[3]];else if(2===w)u=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{if(3!==w)throw new Error("Correct katexImagesData or update code here to support\n "+w+" children.");u=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var x=0;x<w;x++){var E=new oi(f[x]),k=new ai([E],{width:"400em",height:Go(y),viewBox:"0 0 "+r+" "+b,preserveAspectRatio:h[x]+" slice"}),S=nl.makeSvgSpan([u[x]],[k],t);if(1===w)return{span:S,minWidth:v,height:y};S.style.height=Go(y),p.push(S)}return{span:nl.makeSpan(["stretchy"],p,t),minWidth:v,height:y}}();return r.height=a,r.style.height=Go(a),n>0&&(r.style.minWidth=Go(n)),r};function Gl(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Zl(e){var t=Xl(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Xl(e){return e&&("atom"===e.type||ci.hasOwnProperty(e.type))?e:null}var Yl=(e,t)=>{var r,n,a;e&&"supsub"===e.type?(r=(n=Gl(e.base,"accent")).base,e.base=r,a=function(e){if(e instanceof Jo)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(_l(e,t)),e.base=n):r=(n=Gl(e,"accent")).base;var o=_l(r,t.havingCrampedStyle()),i=0;if(n.isShifty&&fo.isCharacterBox(r)){var l=fo.getBaseElem(r);i=li(_l(l,t.havingCrampedStyle())).skew}var s,c="\\c"===n.label,d=c?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight);if(n.isStretchy)s=Kl(n,t),s=nl.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:s,wrapperClasses:["svg-align"],wrapperStyle:i>0?{width:"calc(100% - "+Go(2*i)+")",marginLeft:Go(2*i)}:void 0}]},t);else{var u,h;"\\vec"===n.label?(u=nl.staticSvg("vec",t),h=nl.svgData.vec[1]):((u=li(u=nl.makeOrd({mode:n.mode,text:n.label},t,"textord"))).italic=0,h=u.width,c&&(d+=u.depth)),s=nl.makeSpan(["accent-body"],[u]);var m="\\textcircled"===n.label;m&&(s.classes.push("accent-full"),d=o.height);var p=i;m||(p-=h/2),s.style.left=Go(p),"\\textcircled"===n.label&&(s.style.top=".2em"),s=nl.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-d},{type:"elem",elem:s}]},t)}var g=nl.makeSpan(["mord","accent"],[s],t);return a?(a.children[0]=g,a.height=Math.max(g.height,a.height),a.classes[0]="mord",a):g},Ql=(e,t)=>{var r=e.isStretchy?Wl(e.label):new zl.MathNode("mo",[Rl(e.label,e.mode)]),n=new zl.MathNode("mover",[Pl(e.base,t),r]);return n.setAttribute("accent","true"),n},Jl=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));hl({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var r=pl(t[0]),n=!Jl.test(e.funcName),a=!n||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:a,base:r}},htmlBuilder:Yl,mathmlBuilder:Ql}),hl({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var r=t[0],n=e.parser.mode;return"math"===n&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:Yl,mathmlBuilder:Ql}),hl({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:r,funcName:n}=e,a=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:a}},htmlBuilder:(e,t)=>{var r=_l(e.base,t),n=Kl(e,t),a="\\utilde"===e.label?.12:0,o=nl.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:r}]},t);return nl.makeSpan(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var r=Wl(e.label),n=new zl.MathNode("munder",[Pl(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});var es=e=>{var t=new zl.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};hl({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){var{parser:n,funcName:a}=e;return{type:"xArrow",mode:n.mode,label:a,body:t[0],below:r[0]}},htmlBuilder(e,t){var r,n=t.style,a=t.havingStyle(n.sup()),o=nl.wrapFragment(_l(e.body,a,t),t),i="\\x"===e.label.slice(0,2)?"x":"cd";o.classes.push(i+"-arrow-pad"),e.below&&(a=t.havingStyle(n.sub()),(r=nl.wrapFragment(_l(e.below,a,t),t)).classes.push(i+"-arrow-pad"));var l,s=Kl(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,d=-t.fontMetrics().axisHeight-.5*s.height-.111;if((o.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=o.depth),r){var u=-t.fontMetrics().axisHeight+r.height+.5*s.height+.111;l=nl.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:d},{type:"elem",elem:s,shift:c},{type:"elem",elem:r,shift:u}]},t)}else l=nl.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:d},{type:"elem",elem:s,shift:c}]},t);return l.children[0].children[0].children[1].classes.push("svg-align"),nl.makeSpan(["mrel","x-arrow"],[l],t)},mathmlBuilder(e,t){var r,n=Wl(e.label);if(n.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var a=es(Pl(e.body,t));if(e.below){var o=es(Pl(e.below,t));r=new zl.MathNode("munderover",[n,o,a])}else r=new zl.MathNode("mover",[n,a])}else if(e.below){var i=es(Pl(e.below,t));r=new zl.MathNode("munder",[n,i])}else r=es(),r=new zl.MathNode("mover",[n,r]);return r}});var ts=nl.makeSpan;function rs(e,t){var r=xl(e.body,t,!0);return ts([e.mclass],r,t)}function ns(e,t){var r,n=Dl(e.body,t);return"minner"===e.mclass?r=new zl.MathNode("mpadded",n):"mord"===e.mclass?e.isCharacterBox?(r=n[0]).type="mi":r=new zl.MathNode("mi",n):(e.isCharacterBox?(r=n[0]).type="mo":r=new zl.MathNode("mo",n),"mbin"===e.mclass?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):"mpunct"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0em"):"minner"===e.mclass&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}hl({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:r,funcName:n}=e,a=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:gl(a),isCharacterBox:fo.isCharacterBox(a)}},htmlBuilder:rs,mathmlBuilder:ns});var as=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};hl({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:r}=e;return{type:"mclass",mode:r.mode,mclass:as(t[0]),body:gl(t[1]),isCharacterBox:fo.isCharacterBox(t[1])}}}),hl({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var r,{parser:n,funcName:a}=e,o=t[1],i=t[0];r="\\stackrel"!==a?as(o):"mrel";var l={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==a,body:gl(o)},s={type:"supsub",mode:i.mode,base:l,sup:"\\underset"===a?null:i,sub:"\\underset"===a?i:null};return{type:"mclass",mode:n.mode,mclass:r,body:[s],isCharacterBox:fo.isCharacterBox(s)}},htmlBuilder:rs,mathmlBuilder:ns}),hl({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"pmb",mode:r.mode,mclass:as(t[0]),body:gl(t[0])}},htmlBuilder(e,t){var r=xl(e.body,t,!0),n=nl.makeSpan([e.mclass],r,t);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(e,t){var r=Dl(e.body,t),n=new zl.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var os={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},is=e=>"textord"===e.type&&"@"===e.text;function ls(e,t,r){var n=os[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var a={type:"atom",text:n,mode:"math",family:"rel"},o={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[t[0]],[]),r.callFunction("\\Big",[a],[]),r.callFunction("\\\\cdright",[t[1]],[])]};return r.callFunction("\\\\cdparent",[o],[]);case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return r.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}hl({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:n}=e;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder(e,t){var r=t.havingStyle(t.style.sup()),n=nl.wrapFragment(_l(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=Go(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(e,t){var r=new zl.MathNode("mrow",[Pl(e.label,t)]);return(r=new zl.MathNode("mpadded",[r])).setAttribute("width","0"),"left"===e.side&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),(r=new zl.MathNode("mstyle",[r])).setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),hl({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:r}=e;return{type:"cdlabelparent",mode:r.mode,fragment:t[0]}},htmlBuilder(e,t){var r=nl.wrapFragment(_l(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder:(e,t)=>new zl.MathNode("mrow",[Pl(e.fragment,t)])}),hl({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:r}=e,n=Gl(t[0],"ordgroup").body,a="",o=0;o<n.length;o++){a+=Gl(n[o],"textord").text}var i,l=parseInt(a);if(isNaN(l))throw new uo("\\@char has non-numeric argument "+a);if(l<0||l>=1114111)throw new uo("\\@char with invalid code point "+a);return l<=65535?i=String.fromCharCode(l):(l-=65536,i=String.fromCharCode(55296+(l>>10),56320+(1023&l))),{type:"textord",mode:r.mode,text:i}}});var ss=(e,t)=>{var r=xl(e.body,t.withColor(e.color),!1);return nl.makeFragment(r)},cs=(e,t)=>{var r=Dl(e.body,t.withColor(e.color)),n=new zl.MathNode("mstyle",r);return n.setAttribute("mathcolor",e.color),n};hl({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:r}=e,n=Gl(t[0],"color-token").color,a=t[1];return{type:"color",mode:r.mode,color:n,body:gl(a)}},htmlBuilder:ss,mathmlBuilder:cs}),hl({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:r,breakOnTokenText:n}=e,a=Gl(t[0],"color-token").color;r.gullet.macros.set("\\current@color",a);var o=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:a,body:o}},htmlBuilder:ss,mathmlBuilder:cs}),hl({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,r){var{parser:n}=e,a="["===n.gullet.future().text?n.parseSizeGroup(!0):null,o=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:o,size:a&&Gl(a,"size").value}},htmlBuilder(e,t){var r=nl.makeSpan(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=Go(Ko(e.size,t)))),r},mathmlBuilder(e,t){var r=new zl.MathNode("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",Go(Ko(e.size,t)))),r}});var ds={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},us=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new uo("Expected a control sequence",e);return t},hs=(e,t,r,n)=>{var a=e.gullet.macros.get(r.text);null==a&&(r.noexpand=!0,a={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,a,n)};hl({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:r}=e;t.consumeSpaces();var n=t.fetch();if(ds[n.text])return"\\global"!==r&&"\\\\globallong"!==r||(n.text=ds[n.text]),Gl(t.parseFunction(),"internal");throw new uo("Invalid token after macro prefix",n)}}),hl({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,n=t.gullet.popToken(),a=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(a))throw new uo("Expected a control sequence",n);for(var o,i=0,l=[[]];"{"!==t.gullet.future().text;)if("#"===(n=t.gullet.popToken()).text){if("{"===t.gullet.future().text){o=t.gullet.future(),l[i].push("{");break}if(n=t.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new uo('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==i+1)throw new uo('Argument number "'+n.text+'" out of order');i++,l.push([])}else{if("EOF"===n.text)throw new uo("Expected a macro definition");l[i].push(n.text)}var{tokens:s}=t.gullet.consumeArg();return o&&s.unshift(o),"\\edef"!==r&&"\\xdef"!==r||(s=t.gullet.expandTokens(s)).reverse(),t.gullet.macros.set(a,{tokens:s,numArgs:i,delimiters:l},r===ds[r]),{type:"internal",mode:t.mode}}}),hl({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,n=us(t.gullet.popToken());t.gullet.consumeSpaces();var a=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return hs(t,n,a,"\\\\globallet"===r),{type:"internal",mode:t.mode}}}),hl({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,n=us(t.gullet.popToken()),a=t.gullet.popToken(),o=t.gullet.popToken();return hs(t,n,o,"\\\\globalfuture"===r),t.gullet.pushToken(o),t.gullet.pushToken(a),{type:"internal",mode:t.mode}}});var ms=function(e,t,r){var n=Fo(di.math[e]&&di.math[e].replace||e,t,r);if(!n)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return n},ps=function(e,t,r,n){var a=r.havingBaseStyle(t),o=nl.makeSpan(n.concat(a.sizingClasses(r)),[e],r),i=a.sizeMultiplier/r.sizeMultiplier;return o.height*=i,o.depth*=i,o.maxFontSize=a.sizeMultiplier,o},gs=function(e,t,r){var n=t.havingBaseStyle(r),a=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Go(a),e.height-=a,e.depth+=a},fs=function(e,t,r,n,a,o){var i=function(e,t,r,n){return nl.makeSymbol(e,"Size"+t+"-Regular",r,n)}(e,t,a,n),l=ps(nl.makeSpan(["delimsizing","size"+t],[i],n),Co.TEXT,n,o);return r&&gs(l,n,Co.TEXT),l},vs=function(e,t,r){var n;return n="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:nl.makeSpan(["delimsizinginner",n],[nl.makeSpan([],[nl.makeSymbol(e,t,r)])])}},bs=function(e,t,r){var n=Io["Size4-Regular"][e.charCodeAt(0)]?Io["Size4-Regular"][e.charCodeAt(0)][4]:Io["Size1-Regular"][e.charCodeAt(0)][4],a=new oi("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),o=new ai([a],{width:Go(n),height:Go(t),style:"width:"+Go(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),i=nl.makeSvgSpan([],[o],r);return i.height=t,i.style.height=Go(t),i.style.width=Go(n),{type:"elem",elem:i}},ys={type:"kern",size:-.008},ws=["|","\\lvert","\\rvert","\\vert"],xs=["\\|","\\lVert","\\rVert","\\Vert"],Es=function(e,t,r,n,a,o){var i,l,s,c,d="",u=0;i=s=c=e,l=null;var h="Size1-Regular";"\\uparrow"===e?s=c="⏐":"\\Uparrow"===e?s=c="‖":"\\downarrow"===e?i=s="⏐":"\\Downarrow"===e?i=s="‖":"\\updownarrow"===e?(i="\\uparrow",s="⏐",c="\\downarrow"):"\\Updownarrow"===e?(i="\\Uparrow",s="‖",c="\\Downarrow"):fo.contains(ws,e)?(s="∣",d="vert",u=333):fo.contains(xs,e)?(s="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(i="⎡",s="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(i="⎤",s="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(s=i="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(i="⎡",s=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(s=i="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(i="⎤",s=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(i="⎛",s="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(i="⎞",s="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(i="⎧",l="⎨",c="⎩",s="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(i="⎫",l="⎬",c="⎭",s="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(i="⎧",c="⎩",s="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(i="⎫",c="⎭",s="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(i="⎧",c="⎭",s="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(i="⎫",c="⎩",s="⎪",h="Size4-Regular");var m=ms(i,h,a),p=m.height+m.depth,g=ms(s,h,a),f=g.height+g.depth,v=ms(c,h,a),b=v.height+v.depth,y=0,w=1;if(null!==l){var x=ms(l,h,a);y=x.height+x.depth,w=2}var E=p+b+y,k=E+Math.max(0,Math.ceil((t-E)/(w*f)))*w*f,S=n.fontMetrics().axisHeight;r&&(S*=n.sizeMultiplier);var T=k/2-S,B=[];if(d.length>0){var _=k-p-b,C=Math.round(1e3*k),N=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*_)),M=new oi(d,N),A=(u/1e3).toFixed(3)+"em",O=(C/1e3).toFixed(3)+"em",z=new ai([M],{width:A,height:O,viewBox:"0 0 "+u+" "+C}),R=nl.makeSvgSpan([],[z],n);R.height=C/1e3,R.style.width=A,R.style.height=O,B.push({type:"elem",elem:R})}else{if(B.push(vs(c,h,a)),B.push(ys),null===l){var I=k-p-b+.016;B.push(bs(s,I,n))}else{var L=(k-p-b-y)/2+.016;B.push(bs(s,L,n)),B.push(ys),B.push(vs(l,h,a)),B.push(ys),B.push(bs(s,L,n))}B.push(ys),B.push(vs(i,h,a))}var D=n.havingBaseStyle(Co.TEXT),F=nl.makeVList({positionType:"bottom",positionData:T,children:B},D);return ps(nl.makeSpan(["delimsizing","mult"],[F],D),Co.TEXT,n,o)},ks=.08,Ss=function(e,t,r,n,a){var o=function(e,t,r){t*=1e3;var n="";switch(e){case"sqrtMain":n=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,Oo);break;case"sqrtSize1":n=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,Oo);break;case"sqrtSize2":n=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,Oo);break;case"sqrtSize3":n=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,Oo);break;case"sqrtSize4":n=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,Oo);break;case"sqrtTall":n=function(e,t,r){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(r-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,Oo,r)}return n}(e,n,r),i=new oi(e,o),l=new ai([i],{width:"400em",height:Go(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return nl.makeSvgSpan(["hide-tail"],[l],a)},Ts=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Bs=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],_s=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Cs=[0,1.2,1.8,2.4,3],Ns=[{type:"small",style:Co.SCRIPTSCRIPT},{type:"small",style:Co.SCRIPT},{type:"small",style:Co.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ms=[{type:"small",style:Co.SCRIPTSCRIPT},{type:"small",style:Co.SCRIPT},{type:"small",style:Co.TEXT},{type:"stack"}],As=[{type:"small",style:Co.SCRIPTSCRIPT},{type:"small",style:Co.SCRIPT},{type:"small",style:Co.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Os=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},zs=function(e,t,r,n){for(var a=Math.min(2,3-n.style.size);a<r.length&&"stack"!==r[a].type;a++){var o=ms(e,Os(r[a]),"math"),i=o.height+o.depth;if("small"===r[a].type&&(i*=n.havingBaseStyle(r[a].style).sizeMultiplier),i>t)return r[a]}return r[r.length-1]},Rs=function(e,t,r,n,a,o){var i;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),i=fo.contains(_s,e)?Ns:fo.contains(Ts,e)?As:Ms;var l=zs(e,t,i,n);return"small"===l.type?function(e,t,r,n,a,o){var i=nl.makeSymbol(e,"Main-Regular",a,n),l=ps(i,t,n,o);return r&&gs(l,n,t),l}(e,l.style,r,n,a,o):"large"===l.type?fs(e,l.size,r,n,a,o):Es(e,t,r,n,a,o)},Is={sqrtImage:function(e,t){var r,n,a=t.havingBaseSizing(),o=zs("\\surd",e*a.sizeMultiplier,As,a),i=a.sizeMultiplier,l=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),s=0,c=0,d=0;return"small"===o.type?(e<1?i=1:e<1.4&&(i=.7),c=(1+l)/i,(r=Ss("sqrtMain",s=(1+l+ks)/i,d=1e3+1e3*l+80,l,t)).style.minWidth="0.853em",n=.833/i):"large"===o.type?(d=1080*Cs[o.size],c=(Cs[o.size]+l)/i,s=(Cs[o.size]+l+ks)/i,(r=Ss("sqrtSize"+o.size,s,d,l,t)).style.minWidth="1.02em",n=1/i):(s=e+l+ks,c=e+l,d=Math.floor(1e3*e+l)+80,(r=Ss("sqrtTall",s,d,l,t)).style.minWidth="0.742em",n=1.056),r.height=c,r.style.height=Go(s),{span:r,advanceWidth:n,ruleWidth:(t.fontMetrics().sqrtRuleThickness+l)*i}},sizedDelim:function(e,t,r,n,a){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),fo.contains(Ts,e)||fo.contains(_s,e))return fs(e,t,!1,r,n,a);if(fo.contains(Bs,e))return Es(e,Cs[t],!1,r,n,a);throw new uo("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Cs,customSizedDelim:Rs,leftRightDelim:function(e,t,r,n,a,o){var i=n.fontMetrics().axisHeight*n.sizeMultiplier,l=5/n.fontMetrics().ptPerEm,s=Math.max(t-i,r+i),c=Math.max(s/500*901,2*s-l);return Rs(e,c,!0,n,a,o)}},Ls={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Ds=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Fs(e,t){var r=Xl(e);if(r&&fo.contains(Ds,r.text))return r;throw new uo(r?"Invalid delimiter '"+r.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Ps(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}hl({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var r=Fs(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Ls[e.funcName].size,mclass:Ls[e.funcName].mclass,delim:r.text}},htmlBuilder:(e,t)=>"."===e.delim?nl.makeSpan([e.mclass]):Is.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(Rl(e.delim,e.mode));var r=new zl.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Go(Is.sizeToMaxHeight[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}}),hl({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=e.parser.gullet.macros.get("\\current@color");if(r&&"string"!=typeof r)throw new uo("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Fs(t[0],e).text,color:r}}}),hl({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=Fs(t[0],e),n=e.parser;++n.leftrightDepth;var a=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var o=Gl(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:a,left:r.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{Ps(e);for(var r,n,a=xl(e.body,t,!0,["mopen","mclose"]),o=0,i=0,l=!1,s=0;s<a.length;s++)a[s].isMiddle?l=!0:(o=Math.max(a[s].height,o),i=Math.max(a[s].depth,i));if(o*=t.sizeMultiplier,i*=t.sizeMultiplier,r="."===e.left?Bl(t,["mopen"]):Is.leftRightDelim(e.left,o,i,t,e.mode,["mopen"]),a.unshift(r),l)for(var c=1;c<a.length;c++){var d=a[c].isMiddle;d&&(a[c]=Is.leftRightDelim(d.delim,o,i,d.options,e.mode,[]))}if("."===e.right)n=Bl(t,["mclose"]);else{var u=e.rightColor?t.withColor(e.rightColor):t;n=Is.leftRightDelim(e.right,o,i,u,e.mode,["mclose"])}return a.push(n),nl.makeSpan(["minner"],a,t)},mathmlBuilder:(e,t)=>{Ps(e);var r=Dl(e.body,t);if("."!==e.left){var n=new zl.MathNode("mo",[Rl(e.left,e.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if("."!==e.right){var a=new zl.MathNode("mo",[Rl(e.right,e.mode)]);a.setAttribute("fence","true"),e.rightColor&&a.setAttribute("mathcolor",e.rightColor),r.push(a)}return Il(r)}}),hl({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=Fs(t[0],e);if(!e.parser.leftrightDepth)throw new uo("\\middle without preceding \\left",r);return{type:"middle",mode:e.parser.mode,delim:r.text}},htmlBuilder:(e,t)=>{var r;if("."===e.delim)r=Bl(t,[]);else{r=Is.sizedDelim(e.delim,1,t,e.mode,[]);var n={delim:e.delim,options:t};r.isMiddle=n}return r},mathmlBuilder:(e,t)=>{var r="\\vert"===e.delim||"|"===e.delim?Rl("|","text"):Rl(e.delim,e.mode),n=new zl.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var qs=(e,t)=>{var r,n,a,o=nl.wrapFragment(_l(e.body,t),t),i=e.label.slice(1),l=t.sizeMultiplier,s=0,c=fo.isCharacterBox(e.body);if("sout"===i)(r=nl.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/l,s=-.5*t.fontMetrics().xHeight;else if("phase"===i){var d=Ko({number:.6,unit:"pt"},t),u=Ko({number:.35,unit:"ex"},t);l/=t.havingBaseSizing().sizeMultiplier;var h=o.height+o.depth+d+u;o.style.paddingLeft=Go(h/2+d);var m=Math.floor(1e3*h*l),p="M400000 "+(n=m)+" H0 L"+n/2+" 0 l65 45 L145 "+(n-80)+" H400000z",g=new ai([new oi("phase",p)],{width:"400em",height:Go(m/1e3),viewBox:"0 0 400000 "+m,preserveAspectRatio:"xMinYMin slice"});(r=nl.makeSvgSpan(["hide-tail"],[g],t)).style.height=Go(h),s=o.depth+d+u}else{/cancel/.test(i)?c||o.classes.push("cancel-pad"):"angl"===i?o.classes.push("anglpad"):o.classes.push("boxpad");var f=0,v=0,b=0;/box/.test(i)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),v=f=t.fontMetrics().fboxsep+("colorbox"===i?0:b)):"angl"===i?(f=4*(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),v=Math.max(0,.25-o.depth)):v=f=c?.2:0,r=jl(o,i,f,v,t),/fbox|boxed|fcolorbox/.test(i)?(r.style.borderStyle="solid",r.style.borderWidth=Go(b)):"angl"===i&&.049!==b&&(r.style.borderTopWidth=Go(b),r.style.borderRightWidth=Go(b)),s=o.depth+v,e.backgroundColor&&(r.style.backgroundColor=e.backgroundColor,e.borderColor&&(r.style.borderColor=e.borderColor))}if(e.backgroundColor)a=nl.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:s},{type:"elem",elem:o,shift:0}]},t);else{var y=/cancel|phase/.test(i)?["svg-align"]:[];a=nl.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:r,shift:s,wrapperClasses:y}]},t)}return/cancel/.test(i)&&(a.height=o.height,a.depth=o.depth),/cancel/.test(i)&&!c?nl.makeSpan(["mord","cancel-lap"],[a],t):nl.makeSpan(["mord"],[a],t)},Hs=(e,t)=>{var r=0,n=new zl.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Pl(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),"\\fcolorbox"===e.label){var a=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+a+"em solid "+String(e.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};hl({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,r){var{parser:n,funcName:a}=e,o=Gl(t[0],"color-token").color,i=t[1];return{type:"enclose",mode:n.mode,label:a,backgroundColor:o,body:i}},htmlBuilder:qs,mathmlBuilder:Hs}),hl({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,r){var{parser:n,funcName:a}=e,o=Gl(t[0],"color-token").color,i=Gl(t[1],"color-token").color,l=t[2];return{type:"enclose",mode:n.mode,label:a,backgroundColor:i,borderColor:o,body:l}},htmlBuilder:qs,mathmlBuilder:Hs}),hl({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\fbox",body:t[0]}}}),hl({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:n}=e,a=t[0];return{type:"enclose",mode:r.mode,label:n,body:a}},htmlBuilder:qs,mathmlBuilder:Hs}),hl({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\angl",body:t[0]}}});var $s={};function Vs(e){for(var{type:t,names:r,props:n,handler:a,htmlBuilder:o,mathmlBuilder:i}=e,l={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:a},s=0;s<r.length;++s)$s[r[s]]=l;o&&(dl[t]=o),i&&(ul[t]=i)}var Us={};function js(e,t){Us[e]=t}function Ws(e){var t=[];e.consumeSpaces();var r=e.fetch().text;for("\\relax"===r&&(e.consume(),e.consumeSpaces(),r=e.fetch().text);"\\hline"===r||"\\hdashline"===r;)e.consume(),t.push("\\hdashline"===r),e.consumeSpaces(),r=e.fetch().text;return t}var Ks=e=>{if(!e.parser.settings.displayMode)throw new uo("{"+e.envName+"} can be used only in display mode.")};function Gs(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Zs(e,t,r){var{hskipBeforeAndAfter:n,addJot:a,cols:o,arraystretch:i,colSeparationType:l,autoTag:s,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!i){var m=e.gullet.expandMacroAsText("\\arraystretch");if(null==m)i=1;else if(!(i=parseFloat(m))||i<0)throw new uo("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var p=[],g=[p],f=[],v=[],b=null!=s?[]:void 0;function y(){s&&e.gullet.macros.set("\\@eqnsw","1",!0)}function w(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new co("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(s)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(y(),v.push(Ws(e));;){var x=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),x={type:"ordgroup",mode:e.mode,body:x},r&&(x={type:"styling",mode:e.mode,style:r,body:[x]}),p.push(x);var E=e.fetch().text;if("&"===E){if(u&&p.length===u){if(c||l)throw new uo("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===E){w(),1===p.length&&"styling"===x.type&&0===x.body[0].body.length&&(g.length>1||!d)&&g.pop(),v.length<g.length+1&&v.push([]);break}if("\\\\"!==E)throw new uo("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),f.push(k?k.value:null),w(),v.push(Ws(e)),p=[],g.push(p),y()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:a,arraystretch:i,body:g,cols:o,rowGaps:f,hskipBeforeAndAfter:n,hLinesBeforeRow:v,colSeparationType:l,tags:b,leqno:h}}function Xs(e){return"d"===e.slice(0,1)?"display":"text"}var Ys=function(e,t){var r,n,a=e.body.length,o=e.hLinesBeforeRow,i=0,l=new Array(a),s=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(Co.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?Ko({number:3,unit:"ex"},t):12*d,m=3*d,p=e.arraystretch*h,g=.7*p,f=.3*p,v=0;function b(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),s.push({pos:v,isDashed:e[t]})}for(b(o[0]),r=0;r<e.body.length;++r){var y=e.body[r],w=g,x=f;i<y.length&&(i=y.length);var E=new Array(y.length);for(n=0;n<y.length;++n){var k=_l(y[n],t);x<k.depth&&(x=k.depth),w<k.height&&(w=k.height),E[n]=k}var S=e.rowGaps[r],T=0;S&&(T=Ko(S,t))>0&&(x<(T+=f)&&(x=T),T=0),e.addJot&&(x+=m),E.height=w,E.depth=x,v+=w,E.pos=v,v+=x+T,l[r]=E,b(o[r+1])}var B,_,C=v/2+t.fontMetrics().axisHeight,N=e.cols||[],M=[],A=[];if(e.tags&&e.tags.some((e=>e)))for(r=0;r<a;++r){var O=l[r],z=O.pos-C,R=e.tags[r],I=void 0;(I=!0===R?nl.makeSpan(["eqn-num"],[],t):!1===R?nl.makeSpan([],[],t):nl.makeSpan([],xl(R,t,!0),t)).depth=O.depth,I.height=O.height,A.push({type:"elem",elem:I,shift:z})}for(n=0,_=0;n<i||_<N.length;++n,++_){for(var L=N[_]||{},D=!0;"separator"===L.type;){if(D||((B=nl.makeSpan(["arraycolsep"],[])).style.width=Go(t.fontMetrics().doubleRuleSep),M.push(B)),"|"!==L.separator&&":"!==L.separator)throw new uo("Invalid separator type: "+L.separator);var F="|"===L.separator?"solid":"dashed",P=nl.makeSpan(["vertical-separator"],[],t);P.style.height=Go(v),P.style.borderRightWidth=Go(c),P.style.borderRightStyle=F,P.style.margin="0 "+Go(-c/2);var q=v-C;q&&(P.style.verticalAlign=Go(-q)),M.push(P),L=N[++_]||{},D=!1}if(!(n>=i)){var H=void 0;(n>0||e.hskipBeforeAndAfter)&&0!==(H=fo.deflt(L.pregap,u))&&((B=nl.makeSpan(["arraycolsep"],[])).style.width=Go(H),M.push(B));var $=[];for(r=0;r<a;++r){var V=l[r],U=V[n];if(U){var j=V.pos-C;U.depth=V.depth,U.height=V.height,$.push({type:"elem",elem:U,shift:j})}}$=nl.makeVList({positionType:"individualShift",children:$},t),$=nl.makeSpan(["col-align-"+(L.align||"c")],[$]),M.push($),(n<i-1||e.hskipBeforeAndAfter)&&0!==(H=fo.deflt(L.postgap,u))&&((B=nl.makeSpan(["arraycolsep"],[])).style.width=Go(H),M.push(B))}}if(l=nl.makeSpan(["mtable"],M),s.length>0){for(var W=nl.makeLineSpan("hline",t,c),K=nl.makeLineSpan("hdashline",t,c),G=[{type:"elem",elem:l,shift:0}];s.length>0;){var Z=s.pop(),X=Z.pos-C;Z.isDashed?G.push({type:"elem",elem:K,shift:X}):G.push({type:"elem",elem:W,shift:X})}l=nl.makeVList({positionType:"individualShift",children:G},t)}if(0===A.length)return nl.makeSpan(["mord"],[l],t);var Y=nl.makeVList({positionType:"individualShift",children:A},t);return Y=nl.makeSpan(["tag"],[Y],t),nl.makeFragment([l,Y])},Qs={c:"center ",l:"left ",r:"right "},Js=function(e,t){for(var r=[],n=new zl.MathNode("mtd",[],["mtr-glue"]),a=new zl.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var i=e.body[o],l=[],s=0;s<i.length;s++)l.push(new zl.MathNode("mtd",[Pl(i[s],t)]));e.tags&&e.tags[o]&&(l.unshift(n),l.push(n),e.leqno?l.unshift(a):l.push(a)),r.push(new zl.MathNode("mtr",l))}var c=new zl.MathNode("mtable",r),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",Go(d));var u="",h="";if(e.cols&&e.cols.length>0){var m=e.cols,p="",g=!1,f=0,v=m.length;"separator"===m[0].type&&(u+="top ",f=1),"separator"===m[m.length-1].type&&(u+="bottom ",v-=1);for(var b=f;b<v;b++)"align"===m[b].type?(h+=Qs[m[b].align],g&&(p+="none "),g=!0):"separator"===m[b].type&&g&&(p+="|"===m[b].separator?"solid ":"dashed ",g=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(p)&&c.setAttribute("columnlines",p.trim())}if("align"===e.colSeparationType){for(var y=e.cols||[],w="",x=1;x<y.length;x++)w+=x%2?"0em ":"1em ";c.setAttribute("columnspacing",w.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var E="",k=e.hLinesBeforeRow;u+=k[0].length>0?"left ":"",u+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)E+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(E)&&c.setAttribute("rowlines",E.trim()),""!==u&&(c=new zl.MathNode("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new zl.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},ec=function(e,t){-1===e.envName.indexOf("ed")&&Ks(e);var r,n=[],a=e.envName.indexOf("at")>-1?"alignat":"align",o="split"===e.envName,i=Zs(e.parser,{cols:n,addJot:!0,autoTag:o?void 0:Gs(e.envName),emptySingleRow:!0,colSeparationType:a,maxNumCols:o?2:void 0,leqno:e.parser.settings.leqno},"display"),l=0,s={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",d=0;d<t[0].body.length;d++){c+=Gl(t[0].body[d],"textord").text}r=Number(c),l=2*r}var u=!l;i.body.forEach((function(e){for(var t=1;t<e.length;t+=2){var n=Gl(e[t],"styling");Gl(n.body[0],"ordgroup").body.unshift(s)}if(u)l<e.length&&(l=e.length);else{var a=e.length/2;if(r<a)throw new uo("Too many math in a row: expected "+r+", but got "+a,e[0])}}));for(var h=0;h<l;++h){var m="r",p=0;h%2==1?m="l":h>0&&u&&(p=1),n[h]={type:"align",align:m,pregap:p,postgap:0}}return i.colSeparationType=u?"align":"alignat",i};Vs({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var r=(Xl(t[0])?[t[0]]:Gl(t[0],"ordgroup").body).map((function(e){var t=Zl(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new uo("Unknown column alignment: "+t,e)})),n={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return Zs(e.parser,n,Xs(e.envName))},htmlBuilder:Ys,mathmlBuilder:Js}),Vs({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if("*"===e.envName.charAt(e.envName.length-1)){var a=e.parser;if(a.consumeSpaces(),"["===a.fetch().text){if(a.consume(),a.consumeSpaces(),r=a.fetch().text,-1==="lcr".indexOf(r))throw new uo("Expected l or c or r",a.nextToken);a.consume(),a.consumeSpaces(),a.expect("]"),a.consume(),n.cols=[{type:"align",align:r}]}}var o=Zs(e.parser,n,Xs(e.envName)),i=Math.max(0,...o.body.map((e=>e.length)));return o.cols=new Array(i).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:Ys,mathmlBuilder:Js}),Vs({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=Zs(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Ys,mathmlBuilder:Js}),Vs({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var r=(Xl(t[0])?[t[0]]:Gl(t[0],"ordgroup").body).map((function(e){var t=Zl(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new uo("Unknown column alignment: "+t,e)}));if(r.length>1)throw new uo("{subarray} can contain only one column");var n={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5};if((n=Zs(e.parser,n,"script")).body.length>0&&n.body[0].length>1)throw new uo("{subarray} can contain only one column");return n},htmlBuilder:Ys,mathmlBuilder:Js}),Vs({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=Zs(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Xs(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Ys,mathmlBuilder:Js}),Vs({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:ec,htmlBuilder:Ys,mathmlBuilder:Js}),Vs({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){fo.contains(["gather","gather*"],e.envName)&&Ks(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Gs(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Zs(e.parser,t,"display")},htmlBuilder:Ys,mathmlBuilder:Js}),Vs({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:ec,htmlBuilder:Ys,mathmlBuilder:Js}),Vs({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ks(e);var t={autoTag:Gs(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Zs(e.parser,t,"display")},htmlBuilder:Ys,mathmlBuilder:Js}),Vs({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Ks(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var r=e.fetch().text;if("&"!==r&&"\\\\"!==r){if("\\end"===r){0===t[t.length-1].length&&t.pop();break}throw new uo("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var n,a,o=[],i=[o],l=0;l<t.length;l++){for(var s=t[l],c={type:"styling",body:[],mode:"math",style:"display"},d=0;d<s.length;d++)if(is(s[d])){o.push(c);var u=Zl(s[d+=1]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(u)>-1);else{if(!("<>AV".indexOf(u)>-1))throw new uo('Expected one of "<>AV=|." after @',s[d]);for(var m=0;m<2;m++){for(var p=!0,g=d+1;g<s.length;g++){if(a=u,("mathord"===(n=s[g]).type||"atom"===n.type)&&n.text===a){p=!1,d=g;break}if(is(s[g]))throw new uo("Missing a "+u+" character to complete a CD arrow.",s[g]);h[m].body.push(s[g])}if(p)throw new uo("Missing a "+u+" character to complete a CD arrow.",s[d])}}var f={type:"styling",body:[ls(u,h,e)],mode:"math",style:"display"};o.push(f),c={type:"styling",body:[],mode:"math",style:"display"}}else c.body.push(s[d]);l%2==0?o.push(c):o.shift(),o=[],i.push(o)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}(e.parser)),htmlBuilder:Ys,mathmlBuilder:Js}),js("\\nonumber","\\gdef\\@eqnsw{0}"),js("\\notag","\\nonumber"),hl({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new uo(e.funcName+" valid only within array environment")}});var tc=$s;hl({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:r,funcName:n}=e,a=t[0];if("ordgroup"!==a.type)throw new uo("Invalid environment name",a);for(var o="",i=0;i<a.body.length;++i)o+=Gl(a.body[i],"textord").text;if("\\begin"===n){if(!tc.hasOwnProperty(o))throw new uo("No such environment: "+o,a);var l=tc[o],{args:s,optArgs:c}=r.parseArguments("\\begin{"+o+"}",l),d={mode:r.mode,envName:o,parser:r},u=l.handler(d,s,c);r.expect("\\end",!1);var h=r.nextToken,m=Gl(r.parseFunction(),"environment");if(m.name!==o)throw new uo("Mismatch: \\begin{"+o+"} matched by \\end{"+m.name+"}",h);return u}return{type:"environment",mode:r.mode,name:o,nameGroup:a}}});var rc=(e,t)=>{var r=e.font,n=t.withFont(r);return _l(e.body,n)},nc=(e,t)=>{var r=e.font,n=t.withFont(r);return Pl(e.body,n)},ac={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};hl({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:r,funcName:n}=e,a=pl(t[0]),o=n;return o in ac&&(o=ac[o]),{type:"font",mode:r.mode,font:o.slice(1),body:a}},htmlBuilder:rc,mathmlBuilder:nc}),hl({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:r}=e,n=t[0],a=fo.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:as(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:a}}}),hl({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:r,funcName:n,breakOnTokenText:a}=e,{mode:o}=r,i=r.parseExpression(!0,a);return{type:"font",mode:o,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:i}}},htmlBuilder:rc,mathmlBuilder:nc});var oc=(e,t)=>{var r=t;return"display"===e?r=r.id>=Co.SCRIPT.id?r.text():Co.DISPLAY:"text"===e&&r.size===Co.DISPLAY.size?r=Co.TEXT:"script"===e?r=Co.SCRIPT:"scriptscript"===e&&(r=Co.SCRIPTSCRIPT),r},ic=(e,t)=>{var r,n=oc(e.size,t.style),a=n.fracNum(),o=n.fracDen();r=t.havingStyle(a);var i=_l(e.numer,r,t);if(e.continued){var l=8.5/t.fontMetrics().ptPerEm,s=3.5/t.fontMetrics().ptPerEm;i.height=i.height<l?l:i.height,i.depth=i.depth<s?s:i.depth}r=t.havingStyle(o);var c,d,u,h,m,p,g,f,v,b,y=_l(e.denom,r,t);if(e.hasBarLine?(e.barSize?(d=Ko(e.barSize,t),c=nl.makeLineSpan("frac-line",t,d)):c=nl.makeLineSpan("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),n.size===Co.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,m=d>0?3*u:7*u,p=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,m=u):(h=t.fontMetrics().num3,m=3*u),p=t.fontMetrics().denom2),c){var w=t.fontMetrics().axisHeight;h-i.depth-(w+.5*d)<m&&(h+=m-(h-i.depth-(w+.5*d))),w-.5*d-(y.height-p)<m&&(p+=m-(w-.5*d-(y.height-p)));var x=-(w-.5*d);g=nl.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:p},{type:"elem",elem:c,shift:x},{type:"elem",elem:i,shift:-h}]},t)}else{var E=h-i.depth-(y.height-p);E<m&&(h+=.5*(m-E),p+=.5*(m-E)),g=nl.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:p},{type:"elem",elem:i,shift:-h}]},t)}return r=t.havingStyle(n),g.height*=r.sizeMultiplier/t.sizeMultiplier,g.depth*=r.sizeMultiplier/t.sizeMultiplier,f=n.size===Co.DISPLAY.size?t.fontMetrics().delim1:n.size===Co.SCRIPTSCRIPT.size?t.havingStyle(Co.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?Bl(t,["mopen"]):Is.customSizedDelim(e.leftDelim,f,!0,t.havingStyle(n),e.mode,["mopen"]),b=e.continued?nl.makeSpan([]):null==e.rightDelim?Bl(t,["mclose"]):Is.customSizedDelim(e.rightDelim,f,!0,t.havingStyle(n),e.mode,["mclose"]),nl.makeSpan(["mord"].concat(r.sizingClasses(t)),[v,nl.makeSpan(["mfrac"],[g]),b],t)},lc=(e,t)=>{var r=new zl.MathNode("mfrac",[Pl(e.numer,t),Pl(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var n=Ko(e.barSize,t);r.setAttribute("linethickness",Go(n))}}else r.setAttribute("linethickness","0px");var a=oc(e.size,t.style);if(a.size!==t.style.size){r=new zl.MathNode("mstyle",[r]);var o=a.size===Co.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",o),r.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var i=[];if(null!=e.leftDelim){var l=new zl.MathNode("mo",[new zl.TextNode(e.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),i.push(l)}if(i.push(r),null!=e.rightDelim){var s=new zl.MathNode("mo",[new zl.TextNode(e.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return Il(i)}return r};hl({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var r,{parser:n,funcName:a}=e,o=t[0],i=t[1],l=null,s=null,c="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":r=!0;break;case"\\\\atopfrac":r=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":r=!1,l="(",s=")";break;case"\\\\bracefrac":r=!1,l="\\{",s="\\}";break;case"\\\\brackfrac":r=!1,l="[",s="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:n.mode,continued:!1,numer:o,denom:i,hasBarLine:r,leftDelim:l,rightDelim:s,size:c,barSize:null}},htmlBuilder:ic,mathmlBuilder:lc}),hl({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:r,funcName:n}=e,a=t[0],o=t[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:a,denom:o,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),hl({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:r,funcName:n,token:a}=e;switch(n){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:r.mode,replaceWith:t,token:a}}});var sc=["display","text","script","scriptscript"],cc=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};hl({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var r,{parser:n}=e,a=t[4],o=t[5],i=pl(t[0]),l="atom"===i.type&&"open"===i.family?cc(i.text):null,s=pl(t[1]),c="atom"===s.type&&"close"===s.family?cc(s.text):null,d=Gl(t[2],"size"),u=null;r=!!d.isBlank||(u=d.value).number>0;var h="auto",m=t[3];if("ordgroup"===m.type){if(m.body.length>0){var p=Gl(m.body[0],"textord");h=sc[Number(p.text)]}}else m=Gl(m,"textord"),h=sc[Number(m.text)];return{type:"genfrac",mode:n.mode,numer:a,denom:o,continued:!1,hasBarLine:r,barSize:u,leftDelim:l,rightDelim:c,size:h}},htmlBuilder:ic,mathmlBuilder:lc}),hl({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:r,funcName:n,token:a}=e;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Gl(t[0],"size").value,token:a}}}),hl({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:r,funcName:n}=e,a=t[0],o=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Gl(t[1],"infix").size),i=t[2],l=o.number>0;return{type:"genfrac",mode:r.mode,numer:a,denom:i,continued:!1,hasBarLine:l,barSize:o,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:ic,mathmlBuilder:lc});var dc=(e,t)=>{var r,n,a=t.style;"supsub"===e.type?(r=e.sup?_l(e.sup,t.havingStyle(a.sup()),t):_l(e.sub,t.havingStyle(a.sub()),t),n=Gl(e.base,"horizBrace")):n=Gl(e,"horizBrace");var o,i=_l(n.base,t.havingBaseStyle(Co.DISPLAY)),l=Kl(n,t);if(n.isOver?(o=nl.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:l}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(o=nl.makeVList({positionType:"bottom",positionData:i.depth+.1+l.height,children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:i}]},t)).children[0].children[0].children[0].classes.push("svg-align"),r){var s=nl.makeSpan(["mord",n.isOver?"mover":"munder"],[o],t);o=n.isOver?nl.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.2},{type:"elem",elem:r}]},t):nl.makeVList({positionType:"bottom",positionData:s.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:s}]},t)}return nl.makeSpan(["mord",n.isOver?"mover":"munder"],[o],t)};hl({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:n}=e;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:dc,mathmlBuilder:(e,t)=>{var r=Wl(e.label);return new zl.MathNode(e.isOver?"mover":"munder",[Pl(e.base,t),r])}}),hl({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[1],a=Gl(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:r.mode,href:a,body:gl(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var r=xl(e.body,t,!1);return nl.makeAnchor(e.href,[],r,t)},mathmlBuilder:(e,t)=>{var r=Fl(e.body,t);return r instanceof Al||(r=new Al("mrow",[r])),r.setAttribute("href",e.href),r}}),hl({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=Gl(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var a=[],o=0;o<n.length;o++){var i=n[o];"~"===i&&(i="\\textasciitilde"),a.push({type:"textord",mode:"text",text:i})}var l={type:"text",mode:r.mode,font:"\\texttt",body:a};return{type:"href",mode:r.mode,href:n,body:gl(l)}}}),hl({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:r}=e;return{type:"hbox",mode:r.mode,body:gl(t[0])}},htmlBuilder(e,t){var r=xl(e.body,t,!1);return nl.makeFragment(r)},mathmlBuilder:(e,t)=>new zl.MathNode("mrow",Dl(e.body,t))}),hl({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var r,{parser:n,funcName:a,token:o}=e,i=Gl(t[0],"raw").string,l=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s={};switch(a){case"\\htmlClass":s.class=i,r={command:"\\htmlClass",class:i};break;case"\\htmlId":s.id=i,r={command:"\\htmlId",id:i};break;case"\\htmlStyle":s.style=i,r={command:"\\htmlStyle",style:i};break;case"\\htmlData":for(var c=i.split(","),d=0;d<c.length;d++){var u=c[d].split("=");if(2!==u.length)throw new uo("Error parsing key-value for \\htmlData");s["data-"+u[0].trim()]=u[1].trim()}r={command:"\\htmlData",attributes:s};break;default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(r)?{type:"html",mode:n.mode,attributes:s,body:gl(l)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var r=xl(e.body,t,!1),n=["enclosing"];e.attributes.class&&n.push(...e.attributes.class.trim().split(/\s+/));var a=nl.makeSpan(n,r,t);for(var o in e.attributes)"class"!==o&&e.attributes.hasOwnProperty(o)&&a.setAttribute(o,e.attributes[o]);return a},mathmlBuilder:(e,t)=>Fl(e.body,t)}),hl({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e;return{type:"htmlmathml",mode:r.mode,html:gl(t[0]),mathml:gl(t[1])}},htmlBuilder:(e,t)=>{var r=xl(e.html,t,!1);return nl.makeFragment(r)},mathmlBuilder:(e,t)=>Fl(e.mathml,t)});var uc=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new uo("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!Wo(r))throw new uo("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};hl({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,r)=>{var{parser:n}=e,a={number:0,unit:"em"},o={number:.9,unit:"em"},i={number:0,unit:"em"},l="";if(r[0])for(var s=Gl(r[0],"raw").string.split(","),c=0;c<s.length;c++){var d=s[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":l=u;break;case"width":a=uc(u);break;case"height":o=uc(u);break;case"totalheight":i=uc(u);break;default:throw new uo("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=Gl(t[0],"url").url;return""===l&&(l=(l=(l=h).replace(/^.*[\\/]/,"")).substring(0,l.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:n.mode,alt:l,width:a,height:o,totalheight:i,src:h}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var r=Ko(e.height,t),n=0;e.totalheight.number>0&&(n=Ko(e.totalheight,t)-r);var a=0;e.width.number>0&&(a=Ko(e.width,t));var o={height:Go(r+n)};a>0&&(o.width=Go(a)),n>0&&(o.verticalAlign=Go(-n));var i=new ti(e.src,e.alt,o);return i.height=r,i.depth=n,i},mathmlBuilder:(e,t)=>{var r=new zl.MathNode("mglyph",[]);r.setAttribute("alt",e.alt);var n=Ko(e.height,t),a=0;if(e.totalheight.number>0&&(a=Ko(e.totalheight,t)-n,r.setAttribute("valign",Go(-a))),r.setAttribute("height",Go(n+a)),e.width.number>0){var o=Ko(e.width,t);r.setAttribute("width",Go(o))}return r.setAttribute("src",e.src),r}}),hl({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:r,funcName:n}=e,a=Gl(t[0],"size");if(r.settings.strict){var o="m"===n[1],i="mu"===a.value.unit;o?(i||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+a.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):i&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:a.value}},htmlBuilder:(e,t)=>nl.makeGlue(e.dimension,t),mathmlBuilder(e,t){var r=Ko(e.dimension,t);return new zl.SpaceNode(r)}}),hl({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r,funcName:n}=e,a=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:a}},htmlBuilder:(e,t)=>{var r;"clap"===e.alignment?(r=nl.makeSpan([],[_l(e.body,t)]),r=nl.makeSpan(["inner"],[r],t)):r=nl.makeSpan(["inner"],[_l(e.body,t)]);var n=nl.makeSpan(["fix"],[]),a=nl.makeSpan([e.alignment],[r,n],t),o=nl.makeSpan(["strut"]);return o.style.height=Go(a.height+a.depth),a.depth&&(o.style.verticalAlign=Go(-a.depth)),a.children.unshift(o),a=nl.makeSpan(["thinbox"],[a],t),nl.makeSpan(["mord","vbox"],[a],t)},mathmlBuilder:(e,t)=>{var r=new zl.MathNode("mpadded",[Pl(e.body,t)]);if("rlap"!==e.alignment){var n="llap"===e.alignment?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),hl({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:r,parser:n}=e,a=n.mode;n.switchMode("math");var o="\\("===r?"\\)":"$",i=n.parseExpression(!1,o);return n.expect(o),n.switchMode(a),{type:"styling",mode:n.mode,style:"text",body:i}}}),hl({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new uo("Mismatched "+e.funcName)}});var hc=(e,t)=>{switch(t.style.size){case Co.DISPLAY.size:return e.display;case Co.TEXT.size:return e.text;case Co.SCRIPT.size:return e.script;case Co.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};hl({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:r}=e;return{type:"mathchoice",mode:r.mode,display:gl(t[0]),text:gl(t[1]),script:gl(t[2]),scriptscript:gl(t[3])}},htmlBuilder:(e,t)=>{var r=hc(e,t),n=xl(r,t,!1);return nl.makeFragment(n)},mathmlBuilder:(e,t)=>{var r=hc(e,t);return Fl(r,t)}});var mc=(e,t,r,n,a,o,i)=>{e=nl.makeSpan([],[e]);var l,s,c,d=r&&fo.isCharacterBox(r);if(t){var u=_l(t,n.havingStyle(a.sup()),n);s={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(r){var h=_l(r,n.havingStyle(a.sub()),n);l={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-h.height)}}if(s&&l){var m=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+i;c=nl.makeVList({positionType:"bottom",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Go(-o)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:s.kern},{type:"elem",elem:s.elem,marginLeft:Go(o)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var p=e.height-i;c=nl.makeVList({positionType:"top",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Go(-o)},{type:"kern",size:l.kern},{type:"elem",elem:e}]},n)}else{if(!s)return e;var g=e.depth+i;c=nl.makeVList({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:s.kern},{type:"elem",elem:s.elem,marginLeft:Go(o)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}var f=[c];if(l&&0!==o&&!d){var v=nl.makeSpan(["mspace"],[],n);v.style.marginRight=Go(o),f.unshift(v)}return nl.makeSpan(["mop","op-limits"],f,n)},pc=["\\smallint"],gc=(e,t)=>{var r,n,a,o=!1;"supsub"===e.type?(r=e.sup,n=e.sub,a=Gl(e.base,"op"),o=!0):a=Gl(e,"op");var i,l=t.style,s=!1;if(l.size===Co.DISPLAY.size&&a.symbol&&!fo.contains(pc,a.name)&&(s=!0),a.symbol){var c=s?"Size2-Regular":"Size1-Regular",d="";if("\\oiint"!==a.name&&"\\oiiint"!==a.name||(d=a.name.slice(1),a.name="oiint"===d?"\\iint":"\\iiint"),i=nl.makeSymbol(a.name,c,"math",t,["mop","op-symbol",s?"large-op":"small-op"]),d.length>0){var u=i.italic,h=nl.staticSvg(d+"Size"+(s?"2":"1"),t);i=nl.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:h,shift:s?.08:0}]},t),a.name="\\"+d,i.classes.unshift("mop"),i.italic=u}}else if(a.body){var m=xl(a.body,t,!0);1===m.length&&m[0]instanceof ni?(i=m[0]).classes[0]="mop":i=nl.makeSpan(["mop"],m,t)}else{for(var p=[],g=1;g<a.name.length;g++)p.push(nl.mathsym(a.name[g],a.mode,t));i=nl.makeSpan(["mop"],p,t)}var f=0,v=0;return(i instanceof ni||"\\oiint"===a.name||"\\oiiint"===a.name)&&!a.suppressBaseShift&&(f=(i.height-i.depth)/2-t.fontMetrics().axisHeight,v=i.italic),o?mc(i,r,n,t,l,v,f):(f&&(i.style.position="relative",i.style.top=Go(f)),i)},fc=(e,t)=>{var r;if(e.symbol)r=new Al("mo",[Rl(e.name,e.mode)]),fo.contains(pc,e.name)&&r.setAttribute("largeop","false");else if(e.body)r=new Al("mo",Dl(e.body,t));else{r=new Al("mi",[new Ol(e.name.slice(1))]);var n=new Al("mo",[Rl("⁡","text")]);r=e.parentIsSupSub?new Al("mrow",[r,n]):Ml([r,n])}return r},vc={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};hl({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:r,funcName:n}=e,a=n;return 1===a.length&&(a=vc[a]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:gc,mathmlBuilder:fc}),hl({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:gl(n)}},htmlBuilder:gc,mathmlBuilder:fc});var bc={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};hl({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:gc,mathmlBuilder:fc}),hl({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:gc,mathmlBuilder:fc}),hl({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e,n=r;return 1===n.length&&(n=bc[n]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:gc,mathmlBuilder:fc});var yc=(e,t)=>{var r,n,a,o,i=!1;if("supsub"===e.type?(r=e.sup,n=e.sub,a=Gl(e.base,"operatorname"),i=!0):a=Gl(e,"operatorname"),a.body.length>0){for(var l=a.body.map((e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),s=xl(l,t.withFont("mathrm"),!0),c=0;c<s.length;c++){var d=s[c];d instanceof ni&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=nl.makeSpan(["mop"],s,t)}else o=nl.makeSpan(["mop"],[],t);return i?mc(o,r,n,t,t.style,0,0):o};function wc(e,t,r){for(var n=xl(e,t,!1),a=t.sizeMultiplier/r.sizeMultiplier,o=0;o<n.length;o++){var i=n[o].classes.indexOf("sizing");i<0?Array.prototype.push.apply(n[o].classes,t.sizingClasses(r)):n[o].classes[i+1]==="reset-size"+t.size&&(n[o].classes[i+1]="reset-size"+r.size),n[o].height*=a,n[o].depth*=a}return nl.makeFragment(n)}hl({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:r,funcName:n}=e,a=t[0];return{type:"operatorname",mode:r.mode,body:gl(a),alwaysHandleSupSub:"\\operatornamewithlimits"===n,limits:!1,parentIsSupSub:!1}},htmlBuilder:yc,mathmlBuilder:(e,t)=>{for(var r=Dl(e.body,t.withFont("mathrm")),n=!0,a=0;a<r.length;a++){var o=r[a];if(o instanceof zl.SpaceNode);else if(o instanceof zl.MathNode)switch(o.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var i=o.children[0];1===o.children.length&&i instanceof zl.TextNode?i.text=i.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break;default:n=!1}else n=!1}if(n){var l=r.map((e=>e.toText())).join("");r=[new zl.TextNode(l)]}var s=new zl.MathNode("mi",r);s.setAttribute("mathvariant","normal");var c=new zl.MathNode("mo",[Rl("⁡","text")]);return e.parentIsSupSub?new zl.MathNode("mrow",[s,c]):zl.newDocumentFragment([s,c])}}),js("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),ml({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?nl.makeFragment(xl(e.body,t,!1)):nl.makeSpan(["mord"],xl(e.body,t,!0),t),mathmlBuilder:(e,t)=>Fl(e.body,t,!0)}),hl({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:r}=e,n=t[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(e,t){var r=_l(e.body,t.havingCrampedStyle()),n=nl.makeLineSpan("overline-line",t),a=t.fontMetrics().defaultRuleThickness,o=nl.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*a},{type:"elem",elem:n},{type:"kern",size:a}]},t);return nl.makeSpan(["mord","overline"],[o],t)},mathmlBuilder(e,t){var r=new zl.MathNode("mo",[new zl.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new zl.MathNode("mover",[Pl(e.body,t),r]);return n.setAttribute("accent","true"),n}}),hl({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"phantom",mode:r.mode,body:gl(n)}},htmlBuilder:(e,t)=>{var r=xl(e.body,t.withPhantom(),!1);return nl.makeFragment(r)},mathmlBuilder:(e,t)=>{var r=Dl(e.body,t);return new zl.MathNode("mphantom",r)}}),hl({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:(e,t)=>{var r=nl.makeSpan([],[_l(e.body,t.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n<r.children.length;n++)r.children[n].height=0,r.children[n].depth=0;return r=nl.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},t),nl.makeSpan(["mord"],[r],t)},mathmlBuilder:(e,t)=>{var r=Dl(gl(e.body),t),n=new zl.MathNode("mphantom",r),a=new zl.MathNode("mpadded",[n]);return a.setAttribute("height","0px"),a.setAttribute("depth","0px"),a}}),hl({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(e,t)=>{var r=nl.makeSpan(["inner"],[_l(e.body,t.withPhantom())]),n=nl.makeSpan(["fix"],[]);return nl.makeSpan(["mord","rlap"],[r,n],t)},mathmlBuilder:(e,t)=>{var r=Dl(gl(e.body),t),n=new zl.MathNode("mphantom",r),a=new zl.MathNode("mpadded",[n]);return a.setAttribute("width","0px"),a}}),hl({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:r}=e,n=Gl(t[0],"size").value,a=t[1];return{type:"raisebox",mode:r.mode,dy:n,body:a}},htmlBuilder(e,t){var r=_l(e.body,t),n=Ko(e.dy,t);return nl.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},t)},mathmlBuilder(e,t){var r=new zl.MathNode("mpadded",[Pl(e.body,t)]),n=e.dy.number+e.dy.unit;return r.setAttribute("voffset",n),r}}),hl({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),hl({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,r){var{parser:n}=e,a=r[0],o=Gl(t[0],"size"),i=Gl(t[1],"size");return{type:"rule",mode:n.mode,shift:a&&Gl(a,"size").value,width:o.value,height:i.value}},htmlBuilder(e,t){var r=nl.makeSpan(["mord","rule"],[],t),n=Ko(e.width,t),a=Ko(e.height,t),o=e.shift?Ko(e.shift,t):0;return r.style.borderRightWidth=Go(n),r.style.borderTopWidth=Go(a),r.style.bottom=Go(o),r.width=n,r.height=a+o,r.depth=-o,r.maxFontSize=1.125*a*t.sizeMultiplier,r},mathmlBuilder(e,t){var r=Ko(e.width,t),n=Ko(e.height,t),a=e.shift?Ko(e.shift,t):0,o=t.color&&t.getColor()||"black",i=new zl.MathNode("mspace");i.setAttribute("mathbackground",o),i.setAttribute("width",Go(r)),i.setAttribute("height",Go(n));var l=new zl.MathNode("mpadded",[i]);return a>=0?l.setAttribute("height",Go(a)):(l.setAttribute("height",Go(a)),l.setAttribute("depth",Go(-a))),l.setAttribute("voffset",Go(a)),l}});var xc=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];hl({type:"sizing",names:xc,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:r,funcName:n,parser:a}=e,o=a.parseExpression(!1,r);return{type:"sizing",mode:a.mode,size:xc.indexOf(n)+1,body:o}},htmlBuilder:(e,t)=>{var r=t.havingSize(e.size);return wc(e.body,r,t)},mathmlBuilder:(e,t)=>{var r=t.havingSize(e.size),n=Dl(e.body,r),a=new zl.MathNode("mstyle",n);return a.setAttribute("mathsize",Go(r.sizeMultiplier)),a}}),hl({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,r)=>{var{parser:n}=e,a=!1,o=!1,i=r[0]&&Gl(r[0],"ordgroup");if(i)for(var l="",s=0;s<i.body.length;++s){if("t"===(l=i.body[s].text))a=!0;else{if("b"!==l){a=!1,o=!1;break}o=!0}}else a=!0,o=!0;var c=t[0];return{type:"smash",mode:n.mode,body:c,smashHeight:a,smashDepth:o}},htmlBuilder:(e,t)=>{var r=nl.makeSpan([],[_l(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return r;if(e.smashHeight&&(r.height=0,r.children))for(var n=0;n<r.children.length;n++)r.children[n].height=0;if(e.smashDepth&&(r.depth=0,r.children))for(var a=0;a<r.children.length;a++)r.children[a].depth=0;var o=nl.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},t);return nl.makeSpan(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var r=new zl.MathNode("mpadded",[Pl(e.body,t)]);return e.smashHeight&&r.setAttribute("height","0px"),e.smashDepth&&r.setAttribute("depth","0px"),r}}),hl({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){var{parser:n}=e,a=r[0],o=t[0];return{type:"sqrt",mode:n.mode,body:o,index:a}},htmlBuilder(e,t){var r=_l(e.body,t.havingCrampedStyle());0===r.height&&(r.height=t.fontMetrics().xHeight),r=nl.wrapFragment(r,t);var n=t.fontMetrics().defaultRuleThickness,a=n;t.style.id<Co.TEXT.id&&(a=t.fontMetrics().xHeight);var o=n+a/4,i=r.height+r.depth+o+n,{span:l,ruleWidth:s,advanceWidth:c}=Is.sqrtImage(i,t),d=l.height-s;d>r.height+r.depth+o&&(o=(o+d-r.height-r.depth)/2);var u=l.height-r.height-o-s;r.style.paddingLeft=Go(c);var h=nl.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+u)},{type:"elem",elem:l},{type:"kern",size:s}]},t);if(e.index){var m=t.havingStyle(Co.SCRIPTSCRIPT),p=_l(e.index,m,t),g=.6*(h.height-h.depth),f=nl.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:p}]},t),v=nl.makeSpan(["root"],[f]);return nl.makeSpan(["mord","sqrt"],[v,h],t)}return nl.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:r,index:n}=e;return n?new zl.MathNode("mroot",[Pl(r,t),Pl(n,t)]):new zl.MathNode("msqrt",[Pl(r,t)])}});var Ec={display:Co.DISPLAY,text:Co.TEXT,script:Co.SCRIPT,scriptscript:Co.SCRIPTSCRIPT};hl({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:r,funcName:n,parser:a}=e,o=a.parseExpression(!0,r),i=n.slice(1,n.length-5);return{type:"styling",mode:a.mode,style:i,body:o}},htmlBuilder(e,t){var r=Ec[e.style],n=t.havingStyle(r).withFont("");return wc(e.body,n,t)},mathmlBuilder(e,t){var r=Ec[e.style],n=t.havingStyle(r),a=Dl(e.body,n),o=new zl.MathNode("mstyle",a),i={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return o.setAttribute("scriptlevel",i[0]),o.setAttribute("displaystyle",i[1]),o}});ml({type:"supsub",htmlBuilder(e,t){var r=function(e,t){var r=e.base;return r?"op"===r.type?r.limits&&(t.style.size===Co.DISPLAY.size||r.alwaysHandleSupSub)?gc:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(t.style.size===Co.DISPLAY.size||r.limits)?yc:null:"accent"===r.type?fo.isCharacterBox(r.base)?Yl:null:"horizBrace"===r.type&&!e.sub===r.isOver?dc:null:null}(e,t);if(r)return r(e,t);var n,a,o,{base:i,sup:l,sub:s}=e,c=_l(i,t),d=t.fontMetrics(),u=0,h=0,m=i&&fo.isCharacterBox(i);if(l){var p=t.havingStyle(t.style.sup());n=_l(l,p,t),m||(u=c.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(s){var g=t.havingStyle(t.style.sub());a=_l(s,g,t),m||(h=c.depth+g.fontMetrics().subDrop*g.sizeMultiplier/t.sizeMultiplier)}o=t.style===Co.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var f,v=t.sizeMultiplier,b=Go(.5/d.ptPerEm/v),y=null;if(a){var w=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof ni||w)&&(y=Go(-c.italic))}if(n&&a){u=Math.max(u,o,n.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var x=4*d.defaultRuleThickness;if(u-n.depth-(a.height-h)<x){h=x-(u-n.depth)+a.height;var E=.8*d.xHeight-(u-n.depth);E>0&&(u+=E,h-=E)}var k=[{type:"elem",elem:a,shift:h,marginRight:b,marginLeft:y},{type:"elem",elem:n,shift:-u,marginRight:b}];f=nl.makeVList({positionType:"individualShift",children:k},t)}else if(a){h=Math.max(h,d.sub1,a.height-.8*d.xHeight);var S=[{type:"elem",elem:a,marginLeft:y,marginRight:b}];f=nl.makeVList({positionType:"shift",positionData:h,children:S},t)}else{if(!n)throw new Error("supsub must have either sup or sub.");u=Math.max(u,o,n.depth+.25*d.xHeight),f=nl.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:n,marginRight:b}]},t)}var T=Tl(c,"right")||"mord";return nl.makeSpan([T],[c,nl.makeSpan(["msupsub"],[f])],t)},mathmlBuilder(e,t){var r,n=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(n=!0,r=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var a,o=[Pl(e.base,t)];if(e.sub&&o.push(Pl(e.sub,t)),e.sup&&o.push(Pl(e.sup,t)),n)a=r?"mover":"munder";else if(e.sub)if(e.sup){var i=e.base;a=i&&"op"===i.type&&i.limits&&t.style===Co.DISPLAY||i&&"operatorname"===i.type&&i.alwaysHandleSupSub&&(t.style===Co.DISPLAY||i.limits)?"munderover":"msubsup"}else{var l=e.base;a=l&&"op"===l.type&&l.limits&&(t.style===Co.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Co.DISPLAY)?"munder":"msub"}else{var s=e.base;a=s&&"op"===s.type&&s.limits&&(t.style===Co.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===Co.DISPLAY)?"mover":"msup"}return new zl.MathNode(a,o)}}),ml({type:"atom",htmlBuilder:(e,t)=>nl.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var r=new zl.MathNode("mo",[Rl(e.text,e.mode)]);if("bin"===e.family){var n=Ll(e,t);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===e.family?r.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||r.setAttribute("stretchy","false");return r}});var kc={mi:"italic",mn:"normal",mtext:"normal"};ml({type:"mathord",htmlBuilder:(e,t)=>nl.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var r=new zl.MathNode("mi",[Rl(e.text,e.mode,t)]),n=Ll(e,t)||"italic";return n!==kc[r.type]&&r.setAttribute("mathvariant",n),r}}),ml({type:"textord",htmlBuilder:(e,t)=>nl.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var r,n=Rl(e.text,e.mode,t),a=Ll(e,t)||"normal";return r="text"===e.mode?new zl.MathNode("mtext",[n]):/[0-9]/.test(e.text)?new zl.MathNode("mn",[n]):"\\prime"===e.text?new zl.MathNode("mo",[n]):new zl.MathNode("mi",[n]),a!==kc[r.type]&&r.setAttribute("mathvariant",a),r}});var Sc={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Tc={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ml({type:"spacing",htmlBuilder(e,t){if(Tc.hasOwnProperty(e.text)){var r=Tc[e.text].className||"";if("text"===e.mode){var n=nl.makeOrd(e,t,"textord");return n.classes.push(r),n}return nl.makeSpan(["mspace",r],[nl.mathsym(e.text,e.mode,t)],t)}if(Sc.hasOwnProperty(e.text))return nl.makeSpan(["mspace",Sc[e.text]],[],t);throw new uo('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Tc.hasOwnProperty(e.text)){if(Sc.hasOwnProperty(e.text))return new zl.MathNode("mspace");throw new uo('Unknown type of space "'+e.text+'"')}return new zl.MathNode("mtext",[new zl.TextNode(" ")])}});var Bc=()=>{var e=new zl.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};ml({type:"tag",mathmlBuilder(e,t){var r=new zl.MathNode("mtable",[new zl.MathNode("mtr",[Bc(),new zl.MathNode("mtd",[Fl(e.body,t)]),Bc(),new zl.MathNode("mtd",[Fl(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});var _c={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Cc={"\\textbf":"textbf","\\textmd":"textmd"},Nc={"\\textit":"textit","\\textup":"textup"},Mc=(e,t)=>{var r=e.font;return r?_c[r]?t.withTextFontFamily(_c[r]):Cc[r]?t.withTextFontWeight(Cc[r]):t.withTextFontShape(Nc[r]):t};hl({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:r,funcName:n}=e,a=t[0];return{type:"text",mode:r.mode,body:gl(a),font:n}},htmlBuilder(e,t){var r=Mc(e,t),n=xl(e.body,r,!0);return nl.makeSpan(["mord","text"],n,r)},mathmlBuilder(e,t){var r=Mc(e,t);return Fl(e.body,r)}}),hl({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"underline",mode:r.mode,body:t[0]}},htmlBuilder(e,t){var r=_l(e.body,t),n=nl.makeLineSpan("underline-line",t),a=t.fontMetrics().defaultRuleThickness,o=nl.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:a},{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r}]},t);return nl.makeSpan(["mord","underline"],[o],t)},mathmlBuilder(e,t){var r=new zl.MathNode("mo",[new zl.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new zl.MathNode("munder",[Pl(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),hl({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:r}=e;return{type:"vcenter",mode:r.mode,body:t[0]}},htmlBuilder(e,t){var r=_l(e.body,t),n=t.fontMetrics().axisHeight,a=.5*(r.height-n-(r.depth+n));return nl.makeVList({positionType:"shift",positionData:a,children:[{type:"elem",elem:r}]},t)},mathmlBuilder:(e,t)=>new zl.MathNode("mpadded",[Pl(e.body,t)],["vcenter"])}),hl({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,r){throw new uo("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var r=Ac(e),n=[],a=t.havingStyle(t.style.text()),o=0;o<r.length;o++){var i=r[o];"~"===i&&(i="\\textasciitilde"),n.push(nl.makeSymbol(i,"Typewriter-Regular",e.mode,a,["mord","texttt"]))}return nl.makeSpan(["mord","text"].concat(a.sizingClasses(t)),nl.tryCombineChars(n),a)},mathmlBuilder(e,t){var r=new zl.TextNode(Ac(e)),n=new zl.MathNode("mtext",[r]);return n.setAttribute("mathvariant","monospace"),n}});var Ac=e=>e.body.replace(/ /g,e.star?"␣":" "),Oc=cl,zc="[ \r\n\t]",Rc="(\\\\[a-zA-Z@]+)"+zc+"*",Ic="[̀-ͯ]",Lc=new RegExp(Ic+"+$"),Dc="("+zc+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿]"+Ic+"*|[\ud800-\udbff][\udc00-\udfff]"+Ic+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+Rc+"|\\\\[^\ud800-\udfff])";class Fc{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Dc,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new co("EOF",new so(this,t,t));var r=this.tokenRegex.exec(e);if(null===r||r.index!==t)throw new uo("Unexpected character: '"+e[t]+"'",new co(e[t],new so(this,t,t+1)));var n=r[6]||r[3]||(r[2]?"\\ ":" ");if(14===this.catcodes[n]){var a=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===a?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new co(n,new so(this,t,this.tokenRegex.lastIndex))}}class Pc{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new uo("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,r){if(void 0===r&&(r=!1),r){for(var n=0;n<this.undefStack.length;n++)delete this.undefStack[n][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var qc=Us;js("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),js("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),js("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),js("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),js("\\@ifnextchar",(function(e){var t=e.consumeArgs(3);e.consumeSpaces();var r=e.future();return 1===t[0].length&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),js("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),js("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var Hc={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};js("\\char",(function(e){var t,r=e.popToken(),n="";if("'"===r.text)t=8,r=e.popToken();else if('"'===r.text)t=16,r=e.popToken();else if("`"===r.text)if("\\"===(r=e.popToken()).text[0])n=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new uo("\\char` missing argument");n=r.text.charCodeAt(0)}else t=10;if(t){if(null==(n=Hc[r.text])||n>=t)throw new uo("Invalid base-"+t+" digit "+r.text);for(var a;null!=(a=Hc[e.future().text])&&a<t;)n*=t,n+=a,e.popToken()}return"\\@char{"+n+"}"}));var $c=(e,t,r)=>{var n=e.consumeArg().tokens;if(1!==n.length)throw new uo("\\newcommand's first argument must be a macro name");var a=n[0].text,o=e.isDefined(a);if(o&&!t)throw new uo("\\newcommand{"+a+"} attempting to redefine "+a+"; use \\renewcommand");if(!o&&!r)throw new uo("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var i=0;if(1===(n=e.consumeArg().tokens).length&&"["===n[0].text){for(var l="",s=e.expandNextToken();"]"!==s.text&&"EOF"!==s.text;)l+=s.text,s=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new uo("Invalid number of arguments: "+l);i=parseInt(l),n=e.consumeArg().tokens}return e.macros.set(a,{tokens:n,numArgs:i}),""};js("\\newcommand",(e=>$c(e,!1,!0))),js("\\renewcommand",(e=>$c(e,!0,!1))),js("\\providecommand",(e=>$c(e,!0,!0))),js("\\message",(e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),js("\\errmessage",(e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),js("\\show",(e=>{var t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),Oc[r],di.math[r],di.text[r]),""})),js("\\bgroup","{"),js("\\egroup","}"),js("~","\\nobreakspace"),js("\\lq","`"),js("\\rq","'"),js("\\aa","\\r a"),js("\\AA","\\r A"),js("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),js("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),js("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),js("ℬ","\\mathscr{B}"),js("ℰ","\\mathscr{E}"),js("ℱ","\\mathscr{F}"),js("ℋ","\\mathscr{H}"),js("ℐ","\\mathscr{I}"),js("ℒ","\\mathscr{L}"),js("ℳ","\\mathscr{M}"),js("ℛ","\\mathscr{R}"),js("ℭ","\\mathfrak{C}"),js("ℌ","\\mathfrak{H}"),js("ℨ","\\mathfrak{Z}"),js("\\Bbbk","\\Bbb{k}"),js("·","\\cdotp"),js("\\llap","\\mathllap{\\textrm{#1}}"),js("\\rlap","\\mathrlap{\\textrm{#1}}"),js("\\clap","\\mathclap{\\textrm{#1}}"),js("\\mathstrut","\\vphantom{(}"),js("\\underbar","\\underline{\\text{#1}}"),js("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),js("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),js("\\ne","\\neq"),js("≠","\\neq"),js("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),js("∉","\\notin"),js("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),js("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),js("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),js("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),js("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),js("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),js("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),js("⟂","\\perp"),js("‼","\\mathclose{!\\mkern-0.8mu!}"),js("∌","\\notni"),js("⌜","\\ulcorner"),js("⌝","\\urcorner"),js("⌞","\\llcorner"),js("⌟","\\lrcorner"),js("©","\\copyright"),js("®","\\textregistered"),js("️","\\textregistered"),js("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),js("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),js("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),js("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),js("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),js("⋮","\\vdots"),js("\\varGamma","\\mathit{\\Gamma}"),js("\\varDelta","\\mathit{\\Delta}"),js("\\varTheta","\\mathit{\\Theta}"),js("\\varLambda","\\mathit{\\Lambda}"),js("\\varXi","\\mathit{\\Xi}"),js("\\varPi","\\mathit{\\Pi}"),js("\\varSigma","\\mathit{\\Sigma}"),js("\\varUpsilon","\\mathit{\\Upsilon}"),js("\\varPhi","\\mathit{\\Phi}"),js("\\varPsi","\\mathit{\\Psi}"),js("\\varOmega","\\mathit{\\Omega}"),js("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),js("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),js("\\boxed","\\fbox{$\\displaystyle{#1}$}"),js("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),js("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),js("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Vc={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};js("\\dots",(function(e){var t="\\dotso",r=e.expandAfterFuture().text;return r in Vc?t=Vc[r]:("\\not"===r.slice(0,4)||r in di.math&&fo.contains(["bin","rel"],di.math[r].group))&&(t="\\dotsb"),t}));var Uc={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};js("\\dotso",(function(e){return e.future().text in Uc?"\\ldots\\,":"\\ldots"})),js("\\dotsc",(function(e){var t=e.future().text;return t in Uc&&","!==t?"\\ldots\\,":"\\ldots"})),js("\\cdots",(function(e){return e.future().text in Uc?"\\@cdots\\,":"\\@cdots"})),js("\\dotsb","\\cdots"),js("\\dotsm","\\cdots"),js("\\dotsi","\\!\\cdots"),js("\\dotsx","\\ldots\\,"),js("\\DOTSI","\\relax"),js("\\DOTSB","\\relax"),js("\\DOTSX","\\relax"),js("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),js("\\,","\\tmspace+{3mu}{.1667em}"),js("\\thinspace","\\,"),js("\\>","\\mskip{4mu}"),js("\\:","\\tmspace+{4mu}{.2222em}"),js("\\medspace","\\:"),js("\\;","\\tmspace+{5mu}{.2777em}"),js("\\thickspace","\\;"),js("\\!","\\tmspace-{3mu}{.1667em}"),js("\\negthinspace","\\!"),js("\\negmedspace","\\tmspace-{4mu}{.2222em}"),js("\\negthickspace","\\tmspace-{5mu}{.277em}"),js("\\enspace","\\kern.5em "),js("\\enskip","\\hskip.5em\\relax"),js("\\quad","\\hskip1em\\relax"),js("\\qquad","\\hskip2em\\relax"),js("\\tag","\\@ifstar\\tag@literal\\tag@paren"),js("\\tag@paren","\\tag@literal{({#1})}"),js("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new uo("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),js("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),js("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),js("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),js("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),js("\\newline","\\\\\\relax"),js("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var jc=Go(Io["Main-Regular"]["T".charCodeAt(0)][1]-.7*Io["Main-Regular"]["A".charCodeAt(0)][1]);js("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+jc+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),js("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+jc+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),js("\\hspace","\\@ifstar\\@hspacer\\@hspace"),js("\\@hspace","\\hskip #1\\relax"),js("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),js("\\ordinarycolon",":"),js("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),js("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),js("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),js("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),js("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),js("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),js("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),js("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),js("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),js("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),js("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),js("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),js("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),js("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),js("∷","\\dblcolon"),js("∹","\\eqcolon"),js("≔","\\coloneqq"),js("≕","\\eqqcolon"),js("⩴","\\Coloneqq"),js("\\ratio","\\vcentcolon"),js("\\coloncolon","\\dblcolon"),js("\\colonequals","\\coloneqq"),js("\\coloncolonequals","\\Coloneqq"),js("\\equalscolon","\\eqqcolon"),js("\\equalscoloncolon","\\Eqqcolon"),js("\\colonminus","\\coloneq"),js("\\coloncolonminus","\\Coloneq"),js("\\minuscolon","\\eqcolon"),js("\\minuscoloncolon","\\Eqcolon"),js("\\coloncolonapprox","\\Colonapprox"),js("\\coloncolonsim","\\Colonsim"),js("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),js("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),js("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),js("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),js("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),js("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),js("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),js("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),js("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),js("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),js("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),js("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),js("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),js("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),js("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),js("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),js("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),js("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),js("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),js("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),js("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),js("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),js("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),js("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),js("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),js("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),js("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),js("\\imath","\\html@mathml{\\@imath}{ı}"),js("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),js("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),js("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),js("⟦","\\llbracket"),js("⟧","\\rrbracket"),js("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),js("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),js("⦃","\\lBrace"),js("⦄","\\rBrace"),js("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),js("⦵","\\minuso"),js("\\darr","\\downarrow"),js("\\dArr","\\Downarrow"),js("\\Darr","\\Downarrow"),js("\\lang","\\langle"),js("\\rang","\\rangle"),js("\\uarr","\\uparrow"),js("\\uArr","\\Uparrow"),js("\\Uarr","\\Uparrow"),js("\\N","\\mathbb{N}"),js("\\R","\\mathbb{R}"),js("\\Z","\\mathbb{Z}"),js("\\alef","\\aleph"),js("\\alefsym","\\aleph"),js("\\Alpha","\\mathrm{A}"),js("\\Beta","\\mathrm{B}"),js("\\bull","\\bullet"),js("\\Chi","\\mathrm{X}"),js("\\clubs","\\clubsuit"),js("\\cnums","\\mathbb{C}"),js("\\Complex","\\mathbb{C}"),js("\\Dagger","\\ddagger"),js("\\diamonds","\\diamondsuit"),js("\\empty","\\emptyset"),js("\\Epsilon","\\mathrm{E}"),js("\\Eta","\\mathrm{H}"),js("\\exist","\\exists"),js("\\harr","\\leftrightarrow"),js("\\hArr","\\Leftrightarrow"),js("\\Harr","\\Leftrightarrow"),js("\\hearts","\\heartsuit"),js("\\image","\\Im"),js("\\infin","\\infty"),js("\\Iota","\\mathrm{I}"),js("\\isin","\\in"),js("\\Kappa","\\mathrm{K}"),js("\\larr","\\leftarrow"),js("\\lArr","\\Leftarrow"),js("\\Larr","\\Leftarrow"),js("\\lrarr","\\leftrightarrow"),js("\\lrArr","\\Leftrightarrow"),js("\\Lrarr","\\Leftrightarrow"),js("\\Mu","\\mathrm{M}"),js("\\natnums","\\mathbb{N}"),js("\\Nu","\\mathrm{N}"),js("\\Omicron","\\mathrm{O}"),js("\\plusmn","\\pm"),js("\\rarr","\\rightarrow"),js("\\rArr","\\Rightarrow"),js("\\Rarr","\\Rightarrow"),js("\\real","\\Re"),js("\\reals","\\mathbb{R}"),js("\\Reals","\\mathbb{R}"),js("\\Rho","\\mathrm{P}"),js("\\sdot","\\cdot"),js("\\sect","\\S"),js("\\spades","\\spadesuit"),js("\\sub","\\subset"),js("\\sube","\\subseteq"),js("\\supe","\\supseteq"),js("\\Tau","\\mathrm{T}"),js("\\thetasym","\\vartheta"),js("\\weierp","\\wp"),js("\\Zeta","\\mathrm{Z}"),js("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),js("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),js("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),js("\\bra","\\mathinner{\\langle{#1}|}"),js("\\ket","\\mathinner{|{#1}\\rangle}"),js("\\braket","\\mathinner{\\langle{#1}\\rangle}"),js("\\Bra","\\left\\langle#1\\right|"),js("\\Ket","\\left|#1\\right\\rangle");var Wc=e=>t=>{var r=t.consumeArg().tokens,n=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.consumeArg().tokens,i=t.macros.get("|"),l=t.macros.get("\\|");t.macros.beginGroup();var s=t=>r=>{e&&(r.macros.set("|",i),a.length&&r.macros.set("\\|",l));var o=t;!t&&a.length&&("|"===r.future().text&&(r.popToken(),o=!0));return{tokens:o?a:n,numArgs:0}};t.macros.set("|",s(!1)),a.length&&t.macros.set("\\|",s(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...o,...c,...r]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};js("\\bra@ket",Wc(!1)),js("\\bra@set",Wc(!0)),js("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),js("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),js("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),js("\\angln","{\\angl n}"),js("\\blue","\\textcolor{##6495ed}{#1}"),js("\\orange","\\textcolor{##ffa500}{#1}"),js("\\pink","\\textcolor{##ff00af}{#1}"),js("\\red","\\textcolor{##df0030}{#1}"),js("\\green","\\textcolor{##28ae7b}{#1}"),js("\\gray","\\textcolor{gray}{#1}"),js("\\purple","\\textcolor{##9d38bd}{#1}"),js("\\blueA","\\textcolor{##ccfaff}{#1}"),js("\\blueB","\\textcolor{##80f6ff}{#1}"),js("\\blueC","\\textcolor{##63d9ea}{#1}"),js("\\blueD","\\textcolor{##11accd}{#1}"),js("\\blueE","\\textcolor{##0c7f99}{#1}"),js("\\tealA","\\textcolor{##94fff5}{#1}"),js("\\tealB","\\textcolor{##26edd5}{#1}"),js("\\tealC","\\textcolor{##01d1c1}{#1}"),js("\\tealD","\\textcolor{##01a995}{#1}"),js("\\tealE","\\textcolor{##208170}{#1}"),js("\\greenA","\\textcolor{##b6ffb0}{#1}"),js("\\greenB","\\textcolor{##8af281}{#1}"),js("\\greenC","\\textcolor{##74cf70}{#1}"),js("\\greenD","\\textcolor{##1fab54}{#1}"),js("\\greenE","\\textcolor{##0d923f}{#1}"),js("\\goldA","\\textcolor{##ffd0a9}{#1}"),js("\\goldB","\\textcolor{##ffbb71}{#1}"),js("\\goldC","\\textcolor{##ff9c39}{#1}"),js("\\goldD","\\textcolor{##e07d10}{#1}"),js("\\goldE","\\textcolor{##a75a05}{#1}"),js("\\redA","\\textcolor{##fca9a9}{#1}"),js("\\redB","\\textcolor{##ff8482}{#1}"),js("\\redC","\\textcolor{##f9685d}{#1}"),js("\\redD","\\textcolor{##e84d39}{#1}"),js("\\redE","\\textcolor{##bc2612}{#1}"),js("\\maroonA","\\textcolor{##ffbde0}{#1}"),js("\\maroonB","\\textcolor{##ff92c6}{#1}"),js("\\maroonC","\\textcolor{##ed5fa6}{#1}"),js("\\maroonD","\\textcolor{##ca337c}{#1}"),js("\\maroonE","\\textcolor{##9e034e}{#1}"),js("\\purpleA","\\textcolor{##ddd7ff}{#1}"),js("\\purpleB","\\textcolor{##c6b9fc}{#1}"),js("\\purpleC","\\textcolor{##aa87ff}{#1}"),js("\\purpleD","\\textcolor{##7854ab}{#1}"),js("\\purpleE","\\textcolor{##543b78}{#1}"),js("\\mintA","\\textcolor{##f5f9e8}{#1}"),js("\\mintB","\\textcolor{##edf2df}{#1}"),js("\\mintC","\\textcolor{##e0e5cc}{#1}"),js("\\grayA","\\textcolor{##f6f7f7}{#1}"),js("\\grayB","\\textcolor{##f0f1f2}{#1}"),js("\\grayC","\\textcolor{##e3e5e6}{#1}"),js("\\grayD","\\textcolor{##d6d8da}{#1}"),js("\\grayE","\\textcolor{##babec2}{#1}"),js("\\grayF","\\textcolor{##888d93}{#1}"),js("\\grayG","\\textcolor{##626569}{#1}"),js("\\grayH","\\textcolor{##3b3e40}{#1}"),js("\\grayI","\\textcolor{##21242c}{#1}"),js("\\kaBlue","\\textcolor{##314453}{#1}"),js("\\kaGreen","\\textcolor{##71B307}{#1}");var Kc={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Gc{constructor(e,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Pc(qc,t.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new Fc(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,r,n;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:n,end:r}=this.consumeArg(["]"]))}else({tokens:n,start:t,end:r}=this.consumeArg());return this.pushToken(new co("EOF",r.loc)),this.pushTokens(n),t.range(r,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){var t=[],r=e&&e.length>0;r||this.consumeSpaces();var n,a=this.future(),o=0,i=0;do{if(n=this.popToken(),t.push(n),"{"===n.text)++o;else if("}"===n.text){if(-1===--o)throw new uo("Extra }",n)}else if("EOF"===n.text)throw new uo("Unexpected end of input in a macro argument, expected '"+(e&&r?e[i]:"}")+"'",n);if(e&&r)if((0===o||1===o&&"{"===e[i])&&n.text===e[i]){if(++i===e.length){t.splice(-i,i);break}}else i=0}while(0!==o||r);return"{"===a.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:a,end:n}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new uo("The length of delimiters doesn't match the number of args!");for(var r=t[0],n=0;n<r.length;n++){var a=this.popToken();if(r[n]!==a.text)throw new uo("Use of the macro doesn't match its definition",a)}}for(var o=[],i=0;i<e;i++)o.push(this.consumeArg(t&&t[i+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new uo("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),r=t.text,n=t.noexpand?null:this._getExpansion(r);if(null==n||e&&n.unexpandable){if(e&&null==n&&"\\"===r[0]&&!this.isDefined(r))throw new uo("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var a=n.tokens,o=this.consumeArgs(n.numArgs,n.delimiters);if(n.numArgs)for(var i=(a=a.slice()).length-1;i>=0;--i){var l=a[i];if("#"===l.text){if(0===i)throw new uo("Incomplete placeholder at end of macro body",l);if("#"===(l=a[--i]).text)a.splice(i+1,1);else{if(!/^[1-9]$/.test(l.text))throw new uo("Not a valid argument number",l);a.splice(i,2,...o[+l.text-1])}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new co(e)]):void 0}expandTokens(e){var t=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(!1===this.expandOnce(!0)){var n=this.stack.pop();n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),t.push(n)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var r=this.lexer.catcodes[e];if(null!=r&&13!==r)return}var n="function"==typeof t?t(this):t;if("string"==typeof n){var a=0;if(-1!==n.indexOf("#"))for(var o=n.replace(/##/g,"");-1!==o.indexOf("#"+(a+1));)++a;for(var i=new Fc(n,this.settings),l=[],s=i.lex();"EOF"!==s.text;)l.push(s),s=i.lex();return l.reverse(),{tokens:l,numArgs:a}}return n}isDefined(e){return this.macros.has(e)||Oc.hasOwnProperty(e)||di.math.hasOwnProperty(e)||di.text.hasOwnProperty(e)||Kc.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Oc.hasOwnProperty(e)&&!Oc[e].primitive}}var Zc=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Xc=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Yc={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Qc={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class Jc{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Gc(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new uo("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new co("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(e,t){for(var r=[];;){"math"===this.mode&&this.consumeSpaces();var n=this.fetch();if(-1!==Jc.endOfExpression.indexOf(n.text))break;if(t&&n.text===t)break;if(e&&Oc[n.text]&&Oc[n.text].infix)break;var a=this.parseAtom(t);if(!a)break;"internal"!==a.type&&r.push(a)}return"text"===this.mode&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t,r=-1,n=0;n<e.length;n++)if("infix"===e[n].type){if(-1!==r)throw new uo("only one infix operator per group",e[n].token);r=n,t=e[n].replaceWith}if(-1!==r&&t){var a,o,i=e.slice(0,r),l=e.slice(r+1);return a=1===i.length&&"ordgroup"===i[0].type?i[0]:{type:"ordgroup",mode:this.mode,body:i},o=1===l.length&&"ordgroup"===l[0].type?l[0]:{type:"ordgroup",mode:this.mode,body:l},["\\\\abovefrac"===t?this.callFunction(t,[a,e[r],o],[]):this.callFunction(t,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),r=t.text;this.consume(),this.consumeSpaces();var n=this.parseGroup(e);if(!n)throw new uo("Expected group after '"+r+"'",t);return n}formatUnsupportedCmd(e){for(var t=[],r=0;r<e.length;r++)t.push({type:"textord",mode:"text",text:e[r]});var n={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[n]}}parseAtom(e){var t,r,n=this.parseGroup("atom",e);if("text"===this.mode)return n;for(;;){this.consumeSpaces();var a=this.fetch();if("\\limits"===a.text||"\\nolimits"===a.text){if(n&&"op"===n.type){var o="\\limits"===a.text;n.limits=o,n.alwaysHandleSupSub=!0}else{if(!n||"operatorname"!==n.type)throw new uo("Limit controls must follow a math operator",a);n.alwaysHandleSupSub&&(n.limits="\\limits"===a.text)}this.consume()}else if("^"===a.text){if(t)throw new uo("Double superscript",a);t=this.handleSupSubscript("superscript")}else if("_"===a.text){if(r)throw new uo("Double subscript",a);r=this.handleSupSubscript("subscript")}else if("'"===a.text){if(t)throw new uo("Double superscript",a);var i={type:"textord",mode:this.mode,text:"\\prime"},l=[i];for(this.consume();"'"===this.fetch().text;)l.push(i),this.consume();"^"===this.fetch().text&&l.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:l}}else{if(!Xc[a.text])break;var s=Zc.test(a.text),c=[];for(c.push(new co(Xc[a.text])),this.consume();;){var d=this.fetch().text;if(!Xc[d])break;if(Zc.test(d)!==s)break;c.unshift(new co(Xc[d])),this.consume()}var u=this.subparse(c);s?r={type:"ordgroup",mode:"math",body:u}:t={type:"ordgroup",mode:"math",body:u}}}return t||r?{type:"supsub",mode:this.mode,base:n,sup:t,sub:r}:n}parseFunction(e,t){var r=this.fetch(),n=r.text,a=Oc[n];if(!a)return null;if(this.consume(),t&&"atom"!==t&&!a.allowedInArgument)throw new uo("Got function '"+n+"' with no arguments"+(t?" as "+t:""),r);if("text"===this.mode&&!a.allowedInText)throw new uo("Can't use function '"+n+"' in text mode",r);if("math"===this.mode&&!1===a.allowedInMath)throw new uo("Can't use function '"+n+"' in math mode",r);var{args:o,optArgs:i}=this.parseArguments(n,a);return this.callFunction(n,o,i,r,e)}callFunction(e,t,r,n,a){var o={funcName:e,parser:this,token:n,breakOnTokenText:a},i=Oc[e];if(i&&i.handler)return i.handler(o,t,r);throw new uo("No function handler for "+e)}parseArguments(e,t){var r=t.numArgs+t.numOptionalArgs;if(0===r)return{args:[],optArgs:[]};for(var n=[],a=[],o=0;o<r;o++){var i=t.argTypes&&t.argTypes[o],l=o<t.numOptionalArgs;(t.primitive&&null==i||"sqrt"===t.type&&1===o&&null==a[0])&&(i="primitive");var s=this.parseGroupOfType("argument to '"+e+"'",i,l);if(l)a.push(s);else{if(null==s)throw new uo("Null argument, please report this as a bug");n.push(s)}}return{args:n,optArgs:a}}parseGroupOfType(e,t,r){switch(t){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,t);case"hbox":var n=this.parseArgumentGroup(r,"text");return null!=n?{type:"styling",mode:n.mode,body:[n],style:"text"}:null;case"raw":var a=this.parseStringGroup("raw",r);return null!=a?{type:"raw",mode:"text",string:a.text}:null;case"primitive":if(r)throw new uo("A primitive argument cannot be optional");var o=this.parseGroup(e);if(null==o)throw new uo("Expected group as "+e,this.fetch());return o;case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new uo("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var r=this.gullet.scanArgument(t);if(null==r)return null;for(var n,a="";"EOF"!==(n=this.fetch()).text;)a+=n.text,this.consume();return this.consume(),r.text=a,r}parseRegexGroup(e,t){for(var r,n=this.fetch(),a=n,o="";"EOF"!==(r=this.fetch()).text&&e.test(o+r.text);)o+=(a=r).text,this.consume();if(""===o)throw new uo("Invalid "+t+": '"+n.text+"'",n);return n.range(a,o)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var r=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!r)throw new uo("Invalid color: '"+t.text+"'",t);var n=r[0];return/^[0-9a-f]{6}$/i.test(n)&&(n="#"+n),{type:"color-token",mode:this.mode,color:n}}parseSizeGroup(e){var t,r=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",r=!0);var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!n)throw new uo("Invalid size: '"+t.text+"'",t);var a={number:+(n[1]+n[2]),unit:n[3]};if(!Wo(a))throw new uo("Invalid unit: '"+a.unit+"'",t);return{type:"size",mode:this.mode,value:a,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var r=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,t){var r=this.gullet.scanArgument(e);if(null==r)return null;var n=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:r.loc,body:a};return t&&this.switchMode(n),o}parseGroup(e,t){var r,n=this.fetch(),a=n.text;if("{"===a||"\\begingroup"===a){this.consume();var o="{"===a?"}":"\\endgroup";this.gullet.beginGroup();var i=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),r={type:"ordgroup",mode:this.mode,loc:so.range(n,l),body:i,semisimple:"\\begingroup"===a||void 0}}else if(null==(r=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===a[0]&&!Kc.hasOwnProperty(a)){if(this.settings.throwOnError)throw new uo("Undefined control sequence: "+a,n);r=this.formatUnsupportedCmd(a),this.consume()}return r}formLigatures(e){for(var t=e.length-1,r=0;r<t;++r){var n=e[r],a=n.text;"-"===a&&"-"===e[r+1].text&&(r+1<t&&"-"===e[r+2].text?(e.splice(r,3,{type:"textord",mode:"text",loc:so.range(n,e[r+2]),text:"---"}),t-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:so.range(n,e[r+1]),text:"--"}),t-=1)),"'"!==a&&"`"!==a||e[r+1].text!==a||(e.splice(r,2,{type:"textord",mode:"text",loc:so.range(n,e[r+1]),text:a+a}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var r=t.slice(5),n="*"===r.charAt(0);if(n&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new uo("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:r=r.slice(1,-1),star:n}}Qc.hasOwnProperty(t[0])&&!di[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Qc[t[0]]+t.slice(1));var a,o=Lc.exec(t);if(o&&("i"===(t=t.substring(0,o.index))?t="ı":"j"===t&&(t="ȷ")),di[this.mode][t]){this.settings.strict&&"math"===this.mode&&$i.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var i,l=di[this.mode][t].group,s=so.range(e);if(si.hasOwnProperty(l)){var c=l;i={type:"atom",mode:this.mode,family:c,loc:s,text:t}}else i={type:l,mode:this.mode,loc:s,text:t};a=i}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Ao(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),a={type:"textord",mode:"text",loc:so.range(e),text:t}}if(this.consume(),o)for(var d=0;d<o[0].length;d++){var u=o[0][d];if(!Yc[u])throw new uo("Unknown accent ' "+u+"'",e);var h=Yc[u][this.mode]||Yc[u].text;if(!h)throw new uo("Accent "+u+" unsupported in "+this.mode+" mode",e);a={type:"accent",mode:this.mode,loc:so.range(e),label:h,isStretchy:!1,isShifty:!0,base:a}}return a}}Jc.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var ed=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Jc(e,t);delete r.gullet.macros.current["\\df@tag"];var n=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new uo("\\tag works only in display equations");n=[{type:"tag",mode:"text",body:n,tag:r.subparse([new co("\\df@tag")])}]}return n};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."));var td=function(e,t,r){if(r.throwOnError||!(e instanceof uo))throw e;var n=nl.makeSpan(["katex-error"],[new ni(t)]);return n.setAttribute("title",e.toString()),n.setAttribute("style","color:"+r.errorColor),n},rd=function(e,t){var r=new yo(t);try{return function(e,t,r){var n,a=Hl(r);if("mathml"===r.output)return ql(e,t,a,r.displayMode,!0);if("html"===r.output){var o=Nl(e,a);n=nl.makeSpan(["katex"],[o])}else{var i=ql(e,t,a,r.displayMode,!1),l=Nl(e,a);n=nl.makeSpan(["katex"],[i,l])}return $l(n,r)}(ed(e,r),e,r)}catch(n){return td(n,e,r)}},nd=function(e,t){return rd(e,t).toMarkup()};const ad={color:{type:String,default:""},defaultLaTexContent:{type:String,default:""}},od={class:"editify-mathformula"},id={class:"editify-mathformula-label"},ld=["placeholder"],sd={class:"editify-mathformula-footer"},cd=_n(t.defineComponent({name:"InsertMathformula",__name:"insertMathformula",props:ad,emits:["insert"],setup(e,{emit:r}){const n=e,a=r,o=t.inject("$editTrans"),i=t.ref(""),l=e=>{n.color&&(e.currentTarget.style.borderColor=n.color)},s=e=>{e.currentTarget.style.borderColor=""},c=()=>{a("insert",i.value)};return t.watch((()=>n.defaultLaTexContent),(e=>{i.value=e}),{immediate:!0}),(e,r)=>(t.openBlock(),t.createElementBlock("div",od,[t.createElementVNode("div",id,t.toDisplayString(t.unref(o)("insertMathformula")),1),t.withDirectives(t.createElementVNode("textarea",{class:"editify-mathformula-textarea","onUpdate:modelValue":r[0]||(r[0]=e=>i.value=e),placeholder:t.unref(o)("mathformulaPlaceholder"),onFocus:l,onBlur:s},null,40,ld),[[t.vModelText,i.value,void 0,{trim:!0}]]),t.createElementVNode("div",sd,[t.createElementVNode("span",{style:t.normalizeStyle({color:e.color||""}),onClick:c},t.toDisplayString(t.unref(o)("confirm")),5)])]))}}),[["__scopeId","data-v-ed1761a7"]]),dd=e=>"span"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-mathformula"],ud=e=>!!dd(e)||!!e.parent&&ud(e.parent),hd=e=>dd(e)?e:e.parent?hd(e.parent):null,md=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?ud(e.range.anchor.element):t.flatList.some((e=>ud(e.element)))),pd=(e,t)=>{if(!e.range)return null;if(e.range.anchor.element.isEqual(e.range.focus.element))return hd(e.range.anchor.element);const r=t.list.map((e=>hd(e.element)));if(r.some((e=>null==e)))return null;if(1==r.length)return r[0];let n=!0;for(let a=1;a<r.length;a++)if(!r[a].isEqual(r[0])){n=!1;break}return n?r[0]:null},gd=e=>!e.isEmpty()&&("span"==e.parsedom&&"closed"==e.type&&e.hasMarks()&&e.marks["data-editify-attachment"]),fd=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?gd(e.range.anchor.element):t.flatList.some((e=>gd(e.element)))),vd=e=>{e.component(Ya.name,Ya)},bd="0.1.40";console.log(`%c vue-editify %c v${bd} `,"padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;","padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;"),e.AlexElement=y,e.Editify=Ya,e.attachment=e=>{ae.isObject(e)||(e={});return(r,n)=>{let a=!1;return r.exposed.editor.value&&(a=md(r.exposed.editor.value,r.exposed.dataRangeCaches.value)||Vr(r.exposed.editor.value,r.exposed.dataRangeCaches.value)||Gr(r.exposed.editor.value,r.exposed.dataRangeCaches.value)||Ur(r.exposed.editor.value,r.exposed.dataRangeCaches.value)),{name:"attachment",menu:{sequence:e.sequence||100,extraDisabled:e=>("link"==e||"quote"==e||"codeBlock"==e)&&fd(r.exposed.editor.value,r.exposed.dataRangeCaches.value),extend:{type:"select",title:e.title||n("insertAttachment"),leftBorder:e.leftBorder,rightBorder:e.rightBorder,hideScroll:!0,active:!1,disabled:a||e.disabled,default:()=>t.h(Ln,{value:"attachment"}),layer:(a,o)=>t.h(lo,{color:r.props.color,accept:e.accept,allowedFileType:e.allowedFileType||[],multiple:!!e.multiple,maxSize:e.maxSize,minSize:e.minSize,customUpload:e.customUpload,handleError:e.handleError,onChange:()=>{o.$refs.layerRef.setPosition()},onInsert:(e,t)=>{if((t=t.filter((e=>!!e))).length){const a=r.exposed.editor.value;t.forEach((t=>{const r={"data-editify-attachment":t,"data-editify-attachment-name":e||n("attachmentDefaultName")},o=new y("closed","span",r,null,null);a.insertElement(o),a.range.anchor.moveToEnd(o),a.range.focus.moveToEnd(o)})),a.formatElementStack(),a.domRender(),a.rangeRender()}o.show=!1}})}},updateView:()=>{const e=r.exposed.editor.value;y.flatElements(e.stack).forEach((e=>{"span"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-attachment"]&&(le.off(e.elm,"click"),le.on(e.elm,"click",(async()=>{const t=e.marks["data-editify-attachment"],r=await fetch(t,{method:"GET"}),n=await r.blob(),a=document.createElement("a");a.setAttribute("target","_blank"),a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download",e.marks["data-editify-attachment-name"]),a.click()})))}))},customParseNode:e=>(e.hasMarks()&&e.marks["data-editify-attachment"]&&"span"==e.parsedom&&(e.type="closed"),e),pasteKeepMarks:e=>{const t={};return"span"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-attachment"]&&(t["data-editify-attachment"]=e.marks["data-editify-attachment"],e.marks["data-editify-attachment-name"]&&(t["data-editify-attachment-name"]=e.marks["data-editify-attachment-name"])),t},renderRule:e=>{if(e.hasMarks()&&e.marks["data-editify-attachment"]){e.marks.title=n("attachmentDownloadTitle"),e.marks["data-editify-attachment-name"]||(e.marks["data-editify-attachment-name"]=n("attachmentDefaultName"));const t=r.exposed.editor.value,a=t.getPreviousElement(e),o=t.getNextElement(e);if(!a||!a.isSpaceText()){const r=y.getSpaceElement();t.addElementBefore(r,e)}if(!o||!o.isSpaceText()){const r=y.getSpaceElement();t.addElementAfter(r,e)}t.range&&e.isContains(t.range.anchor.element)&&t.range.anchor.moveToEnd(t.getNextElement(e)),t.range&&e.isContains(t.range.focus.element)&&t.range.focus.moveToEnd(t.getNextElement(e))}}}}},e.default=vd,e.elementIsInList=Pr,e.elementIsInTask=qr,e.getCurrentParsedomElement=Fr,e.getMathformulaElement=hd,e.getMathformulaElementByRange=pd,e.getParsedomElementByElement=Dr,e.getRangeText=en,e.hasAttachmentInRange=fd,e.hasImageInRange=Xr,e.hasLinkInRange=Gr,e.hasListInRange=(e,t,r=!1)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?Pr(e.range.anchor.element,r):t.flatList.some((e=>Pr(e.element,r)))),e.hasMathformulaInRange=md,e.hasPreInRange=Vr,e.hasQuoteInRange=Ur,e.hasTableInRange=Zr,e.hasTaskInRange=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?qr(e.range.anchor.element):t.flatList.some((e=>qr(e.element)))),e.hasVideoInRange=Yr,e.insertCodeBlock=En,e.insertImage=yn,e.insertLink=bn,e.insertTable=xn,e.insertVideo=wn,e.install=vd,e.isAttachment=gd,e.isList=Hr,e.isMathformula=dd,e.isRangeInList=Wr,e.isRangeInPre=(e,t)=>!!e.range&&(e.range.anchor.isEqual(e.range.focus)?!!Dr(e.range.anchor.element,"pre"):t.list.every((e=>!!Dr(e.element,"pre")))),e.isRangeInQuote=jr,e.isRangeInTask=Kr,e.isTask=$r,e.isUnderMathformula=ud,e.mathformula=e=>{ae.isObject(e)||(e={});return(r,n)=>{let a=!1;r.exposed.editor.value&&(a=Vr(r.exposed.editor.value,r.exposed.dataRangeCaches.value)||Gr(r.exposed.editor.value,r.exposed.dataRangeCaches.value));let o="";return{name:"mathformula",menu:{sequence:e.sequence||101,extraDisabled:e=>("link"==e||"image"==e||"video"==e||"table"==e||"codeBlock"==e)&&md(r.exposed.editor.value,r.exposed.dataRangeCaches.value),extend:{type:"select",title:e.title||n("insertMathformula"),leftBorder:e.leftBorder,rightBorder:e.rightBorder,hideScroll:!0,active:!!r.exposed.editor.value&&md(r.exposed.editor.value,r.exposed.dataRangeCaches.value),disabled:a||e.disabled,onLayerShow(){const e=pd(r.exposed.editor.value,r.exposed.dataRangeCaches.value);e&&(o=e.marks["data-editify-mathformula"]||"")},default:()=>t.h(Ln,{value:"mathformula"}),layer:(n,a)=>t.h(cd,{color:r.props.color,defaultLaTexContent:o,onInsert:t=>{if(t){const a=r.exposed.editor.value,o=pd(r.exposed.editor.value,r.exposed.dataRangeCaches.value);o&&(o.toEmpty(),a.range.anchor.moveToStart(a.getNextElement(o)),a.range.focus.moveToStart(a.getNextElement(o)));let i="";try{i=nd(t,{output:"mathml",throwOnError:!0})}catch(n){i="","function"==typeof e.handleError&&e.handleError(n)}if(i){const e=`<span data-editify-mathformula="${t}" contenteditable="false">${i}</span>`,r=a.parseHtml(e);a.insertElement(r[0]),a.range.anchor.moveToEnd(r[0]),a.range.focus.moveToEnd(r[0]),a.formatElementStack(),a.domRender(),a.rangeRender()}}a.show=!1}})}},extraKeepTags:["math","mrow","mi","mo","mn","msup","msub","mfrac","msqrt","mroot","munder","mover","munderover","mtable","mtr","mtd","mtext","mspace","mmultiscripts","menclose","mglyph","maction","maligngroup","malignmark","mprescripts","none","mpadded","ms","mphantom","mstyle","merror","mscarries","mscarry","msline","msgroup","msrow","mscolumn","mstack","mlongdiv","mlabeledtr","mlabeledmultiscripts","semantics","msubsup"],pasteKeepMarks:e=>{let t={};return(dd(e)||ud(e))&&(t=Ir(e.marks)),t},pasteKeepStyles:e=>{let t={};return(dd(e)||ud(e))&&(t=Ir(e.styles)),t},customParseNode:e=>("span"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-mathformula"]&&y.flatElements(e.children).forEach((e=>{e.locked=!0,e.isText()||e.hasChildren()||(e.type="closed")})),e),renderRule:e=>{if("span"==e.parsedom&&e.hasMarks()&&e.marks["data-editify-mathformula"]){const t=r.exposed.editor.value,n=t.getPreviousElement(e),a=t.getNextElement(e);if(!n||!n.isSpaceText()){const r=y.getSpaceElement();t.addElementBefore(r,e)}if(!a||!a.isSpaceText()){const r=y.getSpaceElement();t.addElementAfter(r,e)}t.range&&e.isContains(t.range.anchor.element)&&t.range.anchor.moveToEnd(t.getNextElement(e)),t.range&&e.isContains(t.range.focus.element)&&t.range.focus.moveToEnd(t.getNextElement(e))}}}}},e.queryTextMark=Jr,e.queryTextStyle=Qr,e.removeTextMark=fn,e.removeTextStyle=gn,e.setAlign=dn,e.setIndentDecrease=sn,e.setIndentIncrease=ln,e.setLineHeight=vn,e.setList=un,e.setQuote=cn,e.setTask=hn,e.setTextMark=pn,e.setTextStyle=mn,e.version=bd,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));